|
@@ -10,7 +10,7 @@
|
|
|
<div class="add-customer-btn">
|
|
|
<!--<el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印-->
|
|
|
<!--</el-button>-->
|
|
|
- <el-button v-if="form.dispatchingWorkers == 2" type="warning" size="small" :disabled="option.disabled" @click="editCustomer(2)">
|
|
|
+ <el-button v-if="form.dispatchingWorkers == 2" type="warning" size="small" :disabled="option.dispatchWorkers" @click="editCustomer(2)">
|
|
|
撤销派工
|
|
|
</el-button>
|
|
|
<el-button v-else type="warning" size="small" :disabled="option.disabled && (form.dispatchingWorkers == 0 || form.dispatchingWorkers == 1)" @click="editCustomer(1)">
|
|
@@ -18,7 +18,7 @@
|
|
|
</el-button>
|
|
|
|
|
|
<el-button type="primary" size="small"
|
|
|
- class="el-button--small-yh" :disabled="!option.disabled" @click.stop="openEdit">编辑
|
|
|
+ class="el-button--small-yh" :disabled="!option.disabled" @click.stop="openEdit">编辑
|
|
|
</el-button>
|
|
|
<el-button type="primary" size="small" :disabled="option.disabled" @click="editCustomer(0)">
|
|
|
保存数据
|
|
@@ -33,6 +33,28 @@
|
|
|
<!-- -->
|
|
|
<!--</template>-->
|
|
|
|
|
|
+ <template slot="deviceName">
|
|
|
+ <el-select v-model="form.deviceName" @change='deviceNameChange' filterable placeholder="请选择设备">
|
|
|
+ <el-option
|
|
|
+ v-for="item in deviceList"
|
|
|
+ :key="item.cname"
|
|
|
+ :label="item.cname"
|
|
|
+ :value="item.cname">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="maintenanceWorkerId">
|
|
|
+ <el-select v-model="form.maintenanceWorkerId" @change='maintenanceWorkerIdChange' filterable placeholder="请选择维修工">
|
|
|
+ <el-option
|
|
|
+ v-for="item in maintenanceWorkersList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.realName"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot="maintenanceAmount">
|
|
|
<el-input v-model="form.maintenanceAmount" type="number" disabled
|
|
|
placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
|
|
@@ -109,11 +131,17 @@ import {
|
|
|
corpequipmentarchivesitemList,
|
|
|
corpequipmentarchivesList,
|
|
|
} from "@/api/basicData/EquipmentArchives";
|
|
|
+import {date} from "mockjs/src/mock/random/date";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
return {
|
|
|
|
|
|
+ // 设备list
|
|
|
+ deviceList: [],
|
|
|
+ // 维修工list
|
|
|
+ maintenanceWorkersList: [],
|
|
|
+
|
|
|
loadingBtn: false,
|
|
|
addressTitle: null,
|
|
|
form: {},
|
|
@@ -128,6 +156,7 @@ export default {
|
|
|
menuBtn: false,
|
|
|
labelWidth: 90,
|
|
|
disabled: false,
|
|
|
+ dispatchWorkers: false,
|
|
|
column: [
|
|
|
{
|
|
|
label: "客户名称",
|
|
@@ -156,6 +185,7 @@ export default {
|
|
|
// 设备名称
|
|
|
corpequipmentarchivesitemList({pid:item.id}).then(res=>{
|
|
|
this.findObject(this.option.column, "deviceName").dicData = res.data.data.records
|
|
|
+ this.deviceList = res.data.data.records
|
|
|
})
|
|
|
break;
|
|
|
}
|
|
@@ -325,9 +355,17 @@ export default {
|
|
|
if (this.detailData.id) {
|
|
|
this.option.disabled = true
|
|
|
this.getDetail(this.detailData.id);
|
|
|
+ } else {
|
|
|
+ // 报修日期默认当天
|
|
|
+ var time = new Date();
|
|
|
+ var day = ("0" + time.getDate()).slice(-2);
|
|
|
+ var month = ("0" + (time.getMonth() + 1)).slice(-2);
|
|
|
+ var today = time.getFullYear() + "-" + month + "-" + day;
|
|
|
+ this.form.repairReportDate = today;
|
|
|
}
|
|
|
if (this.detailData.status == 1) {
|
|
|
this.option.disabled = true;
|
|
|
+ this.option.dispatchWorkers = true;
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -341,12 +379,38 @@ export default {
|
|
|
this.findObject(this.option.column, "corpName").dicData = res.data.data.records
|
|
|
})
|
|
|
bladeUserList({roleAlias:'维修工'}).then(res=>{
|
|
|
+ console.log(res.data.data)
|
|
|
this.findObject(this.option.column, "maintenanceWorkerId").dicData = res.data.data
|
|
|
+ this.maintenanceWorkersList = res.data.data
|
|
|
+ console.log(this.maintenanceWorkersList)
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
+ deviceNameChange(cname) {
|
|
|
+ for (const item of this.deviceList) {
|
|
|
+ if (item.cname == cname) {
|
|
|
+
|
|
|
+ this.form.deviceId = item.id
|
|
|
+ this.form.deviceDescribe = item.cname
|
|
|
+
|
|
|
+ this.form.categoryitem = item.categoryitem
|
|
|
+ this.form.categoryitemId = item.categoryitemId
|
|
|
+ this.form.factoryId = item.factoryId
|
|
|
+ this.form.factoryName = item.factoryName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ maintenanceWorkerIdChange(id) {
|
|
|
+ for (const item of this.maintenanceWorkersList) {
|
|
|
+ if (item.id == id) {
|
|
|
+ this.form.maintenanceWorkerName = item.name
|
|
|
+ this.form.maintenanceWorkerTel = item.phone
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 维修项目的失焦事件
|
|
|
amountblur(){
|
|
|
let sum = 0
|
|
@@ -530,6 +594,7 @@ export default {
|
|
|
this.data = res.data.data.maintenanceFees;
|
|
|
this.maintenanceFiles = res.data.data.maintenanceFiles ? res.data.data.maintenanceFiles : [];
|
|
|
this.option.disabled = true;
|
|
|
+ this.option.dispatchWorkers = true;
|
|
|
})
|
|
|
},
|
|
|
// 撤销派工
|
|
@@ -540,6 +605,7 @@ export default {
|
|
|
this.data = res.data.data.maintenanceFees;
|
|
|
this.maintenanceFiles = res.data.data.maintenanceFiles ? res.data.data.maintenanceFiles : [];
|
|
|
this.option.disabled = true;
|
|
|
+ this.option.dispatchWorkers = true;
|
|
|
})
|
|
|
},
|
|
|
// 保存接口
|
|
@@ -550,6 +616,7 @@ export default {
|
|
|
// this.maintenanceFiles = res.data.data.maintenanceFiles ? res.data.data.maintenanceFiles : [];
|
|
|
this.detailData.status = 1
|
|
|
this.option.disabled = true;
|
|
|
+ this.option.dispatchWorkers = true;
|
|
|
|
|
|
if (index == 0) {
|
|
|
this.$message.success("保存成功");
|
|
@@ -590,7 +657,11 @@ export default {
|
|
|
},
|
|
|
openEdit() {
|
|
|
// this.detailData.status = 2
|
|
|
+ if (this.form.dispatchingWorkers == 2) {
|
|
|
+ this.option.dispatchWorkers = false
|
|
|
+ } else {
|
|
|
this.option.disabled = false
|
|
|
+ }
|
|
|
// this.option = this.$options.data().option;
|
|
|
// this.$refs.crud.refreshTable();
|
|
|
},
|