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

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