点击项目完成时,先提示是否移交总检?

This commit is contained in:
xiaofajia 2024-11-14 10:05:54 +08:00
parent 2222a406f5
commit a79c5c6dc6

View File

@ -47,25 +47,47 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-if="formData.recordType !== 'sgwczj' && projectList.length > 0" type="primary" @click="doUpdate(null)">
<el-button v-if="formData.recordType !== 'sgwczj' && projectList.length > 0" type="primary"
@click="doUpdate(null)">
</el-button>
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doUpdate(null)">
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary"
@click="doUpdate(null)">
部分完成
</el-button>
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doFinish(true)">
完成并移交下一班组
</el-button>
<el-button v-if="formData.recordType === 'sgwczj' && !isNext && projectList.length !== 0" type="primary"
@click="doFinish(false)">
{{ isEndCheck ? "完成并移交总检" : "完成工单" }}
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary"
@click="handleFinish">
完成
</el-button>
<!-- <el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doFinish(true)">-->
<!-- 完成并移交下一班组-->
<!-- </el-button>-->
<!-- <el-button v-if="formData.recordType === 'sgwczj' && !isNext && projectList.length !== 0" type="primary"-->
<!-- @click="doFinish(false)">-->
<!-- {{ isEndCheck ? "完成并移交总检" : "完成工单" }}-->
<!-- </el-button>-->
<!-- <el-button v-if="formData.recordType === 'sgwczj'" type="success" @click="doFinish">-->
<!-- {{isNext ? "整体完成并指派下一项目" : (isEndCheck ? "整体完成并移交总检" : "整体完成")}}-->
<!-- </el-button>-->
</div>
</el-dialog>
<el-dialog
title="选择"
:visible.sync="chooseVisible"
width="30%">
<span>{{isEndCheck ? '这个工单需要总检,' : '这个工单不需要总检,'}}请选择完成方式</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" v-if="formData.recordType === 'sgwczj' && projectList.length !== 0"
@click="doFinish(true)">完成并移交下一班组</el-button>
<el-button v-if="formData.recordType === 'sgwczj' && !isNext && projectList.length !== 0" type="primary"
@click="doFinish(false)">
{{ isEndCheck ? "完成并移交总检" : "完成工单" }}
</el-button>
<el-button @click="chooseVisible = false"> </el-button>
</span>
</el-dialog>
<UpdateRepair ref="updateRepair" @success="doUpdate"/>
</div>
</template>
@ -104,10 +126,14 @@ export default {
isNext: false,
//
isEndCheck: true,
clickRow: null
clickRow: null,
chooseVisible: false,
}
},
methods: {
handleFinish() {
this.chooseVisible = true
},
init() {
this.formData = {
//
@ -177,6 +203,7 @@ export default {
this.$modal.msgSuccess("操作成功")
}
this.dialogVisible = false
this.chooseVisible = false
this.$emit("success")
} else {
this.formLoading = true
@ -185,6 +212,7 @@ export default {
this.$modal.msgSuccess("操作成功")
}
this.dialogVisible = false
this.chooseVisible = false
this.$emit("success")
}
} catch {
@ -192,6 +220,9 @@ export default {
},
async doFinish(flag) {
try {
if (!this.formData.item.id){
this.$modal.msgError("请先选择要完成的项目")
}
await this.$refs.formRef.validate()
this.formLoading = true
//