开始施工-施工中-施工完成 100%

This commit is contained in:
xiaofajia 2024-10-19 11:06:09 +08:00
parent fdcc7367e3
commit 9698765ac7
2 changed files with 65 additions and 21 deletions

View File

@ -50,16 +50,21 @@
<el-button v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '01'" size="mini" type="text" icon="el-icon-check" @click="handleNotify(scope.row)">
通知施工
</el-button>
<el-button size="mini" v-if="userRole === 'repair_staff'" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgz')">
<el-button size="mini" v-if="userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgz')">
过程记录
</el-button>
<el-button size="mini" v-if="userRole === 'repair_staff'" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'kssg')">
<el-button size="mini" v-if="userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'kssg')">
开始施工
</el-button>
<el-button size="mini" v-if="userRole === 'repair_staff'" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgwczj')">
<el-button size="mini" v-if="userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgwczj')">
施工完成
</el-button>
<el-dropdown @command="(command) => handleCommand(command, scope.$index, scope.row)">
<el-button @click="handleRecord(scope.row, 'zj')" size="mini" type="text" icon="el-icon-monitor" v-if="userRole === 'general_inspection' && scope.row.ticketsWorkStatus === '05'">
终检
</el-button>
<el-dropdown
v-if="userRole !== 'general_inspection'"
@command="(command) => handleCommand(command, scope.$index, scope.row)">
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="!isFinish && scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'" command="handleGet" size="mini" type="text" icon="el-icon-document-add"
@ -70,7 +75,7 @@
</el-dropdown-item>
<!-- 还要判断是不是员工 -->
<el-dropdown-item
v-if="userRole === 'repair_staff' ? leader : true"
v-if="(userRole === 'repair_staff' ? leader : true) && !isFinish"
command="handleReTake" size="mini" type="text" icon="el-icon-refresh"
>重新指派
</el-dropdown-item>

View File

@ -4,7 +4,7 @@
<el-form :model="formData" ref="formRef" :rules="formRules" :loading="formLoading" :inline="true" label-width="15rem">
<el-row :gutter="1">
<el-col :span="24">
<el-form-item label="维修项目" prop="item.id">
<el-form-item v-if="formData.recordType !== 'zj'" label="维修项目" prop="item.id">
<el-select style="width: 20rem" v-model="formData.item.id" >
<el-option v-for="item in projectList" :key="item.id" :label="item.itemName" :value="item.id" />
</el-select>
@ -29,22 +29,26 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-if="formData.recordType !== 'sgwczj'" type="primary" @click="doUpdate"> </el-button>
<el-button v-if="formData.recordType === 'sgwczj'" type="primary">部分完成</el-button>
<el-button v-if="formData.recordType === 'sgwczj'" type="success">
<el-button v-if="formData.recordType === 'sgwczj'" type="primary" @click="doUpdate">部分完成</el-button>
<el-button v-if="formData.recordType === 'sgwczj'" type="success" @click="doFinish">
{{isNext ? "整体完成并指派下一项目" : (isEndCheck ? "整体完成并移交总检" : "整体完成")}}
</el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
<UpdateRepair ref="updateRepair" @success="doUpdate" />
</div>
</template>
<script>
import {getProjectList} from "@/api/repair/tickets/TicketsItem";
import {updateStatus} from "@/api/repair/tickets/Tickets";
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
export default {
name: "UpdateRecord",
components: {UpdateRepair},
data(){
return {
dialogVisible: false,
@ -71,6 +75,7 @@ export default {
isNext: false,
//
isEndCheck: true,
clickRow: null
}
},
methods:{
@ -90,9 +95,11 @@ export default {
recordType: null,
}
this.projectList = []
this.clickRow = null
},
async open(row){
this.init()
this.clickRow = row
this.isEndCheck = row.endCheck === '1'
this.formData.id = row.id
this.formData.recordType = row.clickType
@ -104,16 +111,15 @@ export default {
this.formLoading = true
const res = await getProjectList(ticketId)
this.projectList = res.data
if (this.formData.recordType === 'kssg') {
this.formData.ticketsWorkStatus = "02"
this.formData.item.itemStatus = "02"
if (this.formData.recordType === 'kssg') {
this.projectList = this.projectList.filter(item => item.itemStatus === '01')
}else if (this.formData.recordType === 'sgz'){
this.formData.ticketsWorkStatus = "02"
this.formData.item.itemStatus = "02"
this.projectList = this.projectList.filter(item => item.itemStatus === '02')
}else {
this.isNext = this.projectList.filter(item => item.itemStatus !== '03').length > 0
// >1
this.isNext = this.projectList.filter(item => item.itemStatus !== '03').length > 1
this.projectList = this.projectList.filter(item => item.itemStatus === '02')
}
}finally {
@ -122,16 +128,49 @@ export default {
},
async doUpdate(){
try {
if (this.formData.recordType === 'zj'){
this.formData.ticketsWorkStatus = '03'
this.formData['isFinish'] = '1'
}
if (this.formData.recordType !== 'zj'){
await this.$refs.formRef.validate()
// this.formData.image = this.formData.image.map(item => item.url).join(",")
this.formLoading = true
await updateStatus(this.formData)
this.$modal.msgSuccess("操作成功")
this.dialogVisible = false
this.$emit("success")
}else {
this.formLoading = true
await updateStatus(this.formData)
this.$modal.msgSuccess("操作成功")
this.dialogVisible = false
this.$emit("success")
}
}catch {
}
},
async doFinish(){
try{
await this.$refs.formRef.validate()
this.formLoading = true
//
this.formData.item.itemStatus = "03"
//
if (this.isNext){
await this.$refs.updateRepair.open(this.clickRow)
return
}
//
if (this.isEndCheck){
this.formData.ticketsWorkStatus = "05"
await this.doUpdate();
return
}
// ,
this.formData.ticketsWorkStatus = "03"
this.formData['isFinish'] = '1'
await this.doUpdate()
}catch{}
}
}
}