|
|
|
|
@ -60,8 +60,9 @@ |
|
|
|
|
</div> |
|
|
|
|
<el-form-item label="异常清单"> |
|
|
|
|
<el-table row-key="id" :span-method="errorSpanMethod" :data="errorForm.tableData" border |
|
|
|
|
style="width: 98%" :summary-method="getSummaries" show-summary :row-class-name="tableRowClassName"> |
|
|
|
|
<el-table-column type="expand"> |
|
|
|
|
style="width: 98%" :summary-method="getSummaries" show-summary :row-class-name="tableRowClassName" |
|
|
|
|
:expand-row-keys="expandedKeys"> |
|
|
|
|
<el-table-column type="expand" fixed="left"> |
|
|
|
|
<template slot-scope="props"> |
|
|
|
|
<el-table :data="props.row.detailGoodsList" stripe style="width: 100%"> |
|
|
|
|
<el-table-column prop="goodsName" align="center" label="物料名称"> |
|
|
|
|
@ -83,20 +84,20 @@ |
|
|
|
|
</el-table> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column type="index" width="50" label="序号"> |
|
|
|
|
<el-table-column type="index" width="50" label="序号" fixed="left"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="楼层" prop="floorName"></el-table-column> |
|
|
|
|
<el-table-column label="房间名称" prop="deptName"></el-table-column> |
|
|
|
|
<el-table-column label="专业/设备" prop="deviceName"></el-table-column> |
|
|
|
|
<el-table-column label="巡检内容" prop="checkContent"></el-table-column> |
|
|
|
|
<el-table-column label="工艺要求" prop="craft"></el-table-column> |
|
|
|
|
<el-table-column label="状态" prop="status" v-if="errorForm.repairStatus != 1"> |
|
|
|
|
<el-table-column label="楼层" prop="floorName" width="150"></el-table-column> |
|
|
|
|
<el-table-column label="房间名称" prop="deptName" width="150"></el-table-column> |
|
|
|
|
<el-table-column label="专业/设备" prop="deviceName" width="150"></el-table-column> |
|
|
|
|
<el-table-column label="巡检内容" prop="checkContent" width="150"></el-table-column> |
|
|
|
|
<el-table-column label="工艺要求" prop="craft" width="150"></el-table-column> |
|
|
|
|
<el-table-column label="状态" prop="status" v-if="errorForm.repairStatus != 1" width="100"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.remark }} |
|
|
|
|
{{ scope.row.status == 1 ? '异常' : '正常' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="异常原因" prop="remark"></el-table-column> |
|
|
|
|
<el-table-column label="异常原因" prop="remark" width="100"></el-table-column> |
|
|
|
|
<!-- <el-table-column label="价格" prop="price" v-if="errorForm.repairStatus != 1"></el-table-column> |
|
|
|
|
<el-table-column label="价格" prop="price" v-if="errorForm.repairStatus == 1"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
@ -104,7 +105,8 @@ |
|
|
|
|
:disabled="viewType == 'view' || viewType == 'evaluate' || viewType == 'confirm'"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
<el-table-column prop="isRepair" align="center" label="是否维修" v-if="errorForm.repairStatus >= 3"> |
|
|
|
|
<el-table-column prop="isRepair" align="center" label="是否维修" |
|
|
|
|
v-if="(errorForm.repairStatus >= 3) && (errorForm.repairStatus != 101)" width="150"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-radio-group v-model="scope.row.isRepair" fill="red"> |
|
|
|
|
<el-radio :disabled="viewType == 'view' || viewType == 'evaluate' || dataTypes != 1" |
|
|
|
|
@ -114,51 +116,72 @@ |
|
|
|
|
</el-radio-group> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="option" align="center" label="维修方案"> |
|
|
|
|
<el-table-column prop="repairOption" align="center" label="维修方案" width="150"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入使用人签字" v-model="scope.row.option" style="width: 98%;"></el-input> |
|
|
|
|
<el-input placeholder="请输入维修方案" |
|
|
|
|
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)" |
|
|
|
|
v-model="scope.row.repairOption" style="width: 98%;"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="isNeed" align="center" label="是否需要物料"> |
|
|
|
|
<el-table-column prop="isNeed" align="center" label="是否需要物料" width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-radio-group v-model="scope.row.isNeed" fill="red"> |
|
|
|
|
<!-- || errorForm.repairStatus != 1 --> |
|
|
|
|
<el-radio :disabled="viewType == 'view' || errorForm.repairStatus != 1" :label="'1'">是</el-radio> |
|
|
|
|
<el-radio :disabled="viewType == 'view' || errorForm.repairStatus != 1" class="error_radio" |
|
|
|
|
:label="'0'">否</el-radio> |
|
|
|
|
<el-radio |
|
|
|
|
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)" |
|
|
|
|
:label="'1'">是</el-radio> |
|
|
|
|
<el-radio |
|
|
|
|
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)" |
|
|
|
|
class="error_radio" :label="'0'">否</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="物料配置"> |
|
|
|
|
<el-table-column align="center" label="物料配置" width="120" v-if="errorForm.repairStatus == 1"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button @click="setMaterial(scope.row)" :disabled="scope.row.isNeed == 0">物料配置</el-button> |
|
|
|
|
<el-button @click="setMaterial(scope.row)" :disabled="scope.row.isNeed == 0" |
|
|
|
|
size="mini">物料配置</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<!-- 维修完成 --> |
|
|
|
|
<el-table-column align="center" label="维修完成图片" width="200" |
|
|
|
|
v-if="errorForm.repairStatus == 4 || errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div v-if="errorForm.repairStatus == 4"> |
|
|
|
|
<el-upload action="/api/blade-resource/oss/endpoint/put-file" list-type="picture-card" |
|
|
|
|
:headers="headers" accept=".jpeg,.jpg,.png,.pdf" :file-list="scope.row.completeImgList" |
|
|
|
|
:on-success="handleSuccess(scope.$index)" :on-remove="handleRemove(scope.$index)" |
|
|
|
|
:before-upload="beforeAvatarUpload(scope.$index)"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
</el-upload> |
|
|
|
|
</div> |
|
|
|
|
<div v-else> |
|
|
|
|
<img v-for="item in scope.row.completeImgList" :key="item" :src="item.url" alt="" |
|
|
|
|
style="width: 148px; height: 148px;margin-right:10px;"> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- <el-form-item label="故障现象"> |
|
|
|
|
<el-input placeholder="请输入故障现象描述" type="textarea" v-model="errorForm.faultDescribe" style="width:98%;" |
|
|
|
|
:disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="差旅费"> |
|
|
|
|
<el-input placeholder="请输入差旅费" v-model="errorForm.travelExpense" style="width:98%;" |
|
|
|
|
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)" |
|
|
|
|
@input="actualAmount()"><template slot="append">元</template></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="故障产生原因"> |
|
|
|
|
<el-input placeholder="请输入故障产生原因" type="textarea" v-model="errorForm.faultCause" style="width:98%;" |
|
|
|
|
:disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input> |
|
|
|
|
</el-form-item> --> |
|
|
|
|
<el-form-item label="处理结果"> |
|
|
|
|
<el-input placeholder="请输入处理结果" type="textarea" v-model="errorForm.processingResult" style="width:98%;" |
|
|
|
|
:disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input> |
|
|
|
|
:disabled="viewType == 'view' || (errorForm.repairStatus != 1 && errorForm.repairStatus != 101)"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="差旅费"> |
|
|
|
|
<el-input placeholder="请输入差旅费" v-model="errorForm.travelExpense" style="width:98%;" |
|
|
|
|
:disabled="viewType == 'view' || errorForm.repairStatus != 1"><template |
|
|
|
|
<el-form-item label="维修总计" |
|
|
|
|
v-if="errorForm.repairStatus == 2 || errorForm.repairStatus == 3 || errorForm.repairStatus == 4 || errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8 || errorForm.repairStatus == 102"> |
|
|
|
|
<el-input placeholder="请输入" v-model="errorForm.actualAmount" style="width:98%;" |
|
|
|
|
:disabled="viewType == 'view' || (errorForm.repairStatus != 2 && errorForm.repairStatus != 102)"><template |
|
|
|
|
slot="append">元</template></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- <el-form-item label="巡检结论"> |
|
|
|
|
<el-input placeholder="请输入巡检结论" type="textarea" v-model="errorForm.inspectionConclusion" |
|
|
|
|
style="width:98%;" :disabled="viewType == 'view' || errorForm.repairStatus != 1"></el-input> |
|
|
|
|
</el-form-item> --> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<!-- 主管审核 --> |
|
|
|
|
<div |
|
|
|
|
v-show="((errorForm.repairStatus == 2 || errorForm.repairStatus == 102) || ((errorForm.repairStatus == 1 || errorForm.repairStatus == 101) && errorForm.approvePoint == '主管审核维修方案')) && viewType != 'view'"> |
|
|
|
|
<div style=" |
|
|
|
|
@ -170,14 +193,14 @@ |
|
|
|
|
主管审核 |
|
|
|
|
</div> |
|
|
|
|
<el-form-item label="审核结果"> |
|
|
|
|
<el-select placeholder="请选择审核结果" v-model="errorForm.approveResult" style="width: 98%;" |
|
|
|
|
<el-select placeholder="请选择审核结果" v-model="errorForm.approveResultManager" style="width: 98%;" |
|
|
|
|
:disabled="(errorForm.repairStatus == 1 || errorForm.repairStatus == 101) && errorForm.approvePoint == '主管审核维修方案'"> |
|
|
|
|
<el-option label="通过" :value="1"></el-option> |
|
|
|
|
<el-option label="驳回" :value="0"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item v-if="errorForm.approveResult === 0" label="驳回意见"> |
|
|
|
|
<el-input type="textarea" v-model="errorForm.approveRemark" style="width: 98%;" |
|
|
|
|
<el-form-item label="审核意见"> |
|
|
|
|
<el-input type="textarea" v-model="errorForm.approveRemarkManager" style="width: 98%;" |
|
|
|
|
:disabled="(errorForm.repairStatus == 1 || errorForm.repairStatus == 101) && errorForm.approvePoint == '主管审核维修方案'"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item |
|
|
|
|
@ -188,22 +211,9 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 维修完成 --> |
|
|
|
|
<div |
|
|
|
|
v-show="errorForm.repairStatus == 4 || errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8"> |
|
|
|
|
<el-form-item label="维修完成图片" prop="signaturePerson" v-if="errorForm.repairStatus == 4"> |
|
|
|
|
<el-upload action="/api/blade-resource/oss/endpoint/put-file" list-type="picture-card" :headers="headers" |
|
|
|
|
accept=".jpeg,.jpg,.png,.pdf" :file-list="completeImgList" :on-success="handleSuccess" |
|
|
|
|
:on-remove="handleRemove"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="维修完成图片" prop="signaturePerson" v-else> |
|
|
|
|
<img v-for="item in completeImgList" :key="item" :src="item.url" alt="" |
|
|
|
|
style="width: 148px; height: 148px;margin-right:10px;"> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div v-show="dataTypes == 1 && errorForm.repairStatus == 3 && viewType != 'view'"> |
|
|
|
|
|
|
|
|
|
<!-- 客户确认审核效果 --> |
|
|
|
|
<div v-show="errorForm.repairStatus == 3 && viewType != 'view'"> |
|
|
|
|
<div style=" |
|
|
|
|
color: #101010; |
|
|
|
|
font-size: 20px; |
|
|
|
|
@ -219,12 +229,12 @@ |
|
|
|
|
<el-option label="驳回" :value="0"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item v-if="errorForm.approveResult === 0" label="驳回意见"> |
|
|
|
|
<el-form-item label="审核意见"> |
|
|
|
|
<el-input type="textarea" v-model="errorForm.approveRemark" style="width: 98%;" |
|
|
|
|
:disabled="viewType == 'view'"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- 维修效果确认 --> |
|
|
|
|
<div |
|
|
|
|
v-show="(errorForm.repairStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8)"> |
|
|
|
|
<div style=" |
|
|
|
|
@ -324,7 +334,13 @@ |
|
|
|
|
@click="clickTimeNo">不满意</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-form-item label="意见" label-width="60px" |
|
|
|
|
v-show="(!errorForm.isOkQuality || !errorForm.isOkSecure || !errorForm.isOkValidity)"> |
|
|
|
|
<el-input type="textarea" v-model="errorForm.evaluationRemarks" placeholder="意见" style="width: 98%;" |
|
|
|
|
:disabled="dialogType == 'view'||(errorForm.repairStatus==6||errorForm.repairStatus==7||errorForm.repairStatus==8)"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div |
|
|
|
|
v-show="(rowStatus == 5 || errorForm.repairStatus == 6 || errorForm.repairStatus == 7 || errorForm.repairStatus == 8 || isEvalute) && errorForm.approveResult1 == 1"> |
|
|
|
|
<div style=" |
|
|
|
|
@ -563,7 +579,7 @@ export default { |
|
|
|
|
dataTypes: '',//数据 |
|
|
|
|
headers: {}, |
|
|
|
|
completeImgList: [],//维修完成上传图片 |
|
|
|
|
|
|
|
|
|
expandedKeys: [],//默认展开 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
@ -597,6 +613,9 @@ export default { |
|
|
|
|
} |
|
|
|
|
return ''; |
|
|
|
|
}, |
|
|
|
|
deleteColumn(row, index) { |
|
|
|
|
this.tableData.splice(index, 1); |
|
|
|
|
}, |
|
|
|
|
// 物料总价 |
|
|
|
|
getSummaries(param) { |
|
|
|
|
const { columns, data } = param; |
|
|
|
|
@ -632,6 +651,10 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sums; |
|
|
|
|
}, |
|
|
|
|
// 计算维修总金额 |
|
|
|
|
actualAmount() { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
closeName() { |
|
|
|
|
if (this.nameImg == '') { |
|
|
|
|
@ -691,7 +714,6 @@ export default { |
|
|
|
|
item.detailGoodsList = data |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log(11111, this.errorForm.tableData) |
|
|
|
|
this.materialVisible = false |
|
|
|
|
}, |
|
|
|
|
changeProduct(value, index) { |
|
|
|
|
@ -835,6 +857,7 @@ export default { |
|
|
|
|
let data = this.checkDeepData(res.data.data.details) |
|
|
|
|
if (this.errorForm.repairStatus > 1) { |
|
|
|
|
data.forEach(item => { |
|
|
|
|
item.completeImgList = item.completeImgList != '' ? JSON.parse(item.completeImgList) : [] |
|
|
|
|
if (item.detailGoodsList.length > 0) { |
|
|
|
|
item.isNeed = '1' |
|
|
|
|
} else { |
|
|
|
|
@ -844,11 +867,12 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.errorForm.tableData = [] |
|
|
|
|
this.errorForm.tableData = data |
|
|
|
|
this.getExpandedKeys(data) |
|
|
|
|
this.errorForm.tableData.map(item => { |
|
|
|
|
item.price = item.price == -1 ? '' : item.price |
|
|
|
|
}) |
|
|
|
|
// completeImgList |
|
|
|
|
this.completeImgList = this.errorForm.completeImgList != '' ? JSON.parse(this.errorForm.completeImgList) : [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.errorForm.approveResult1 = this.errorForm.approveResult |
|
|
|
|
this.nameImg = '' |
|
|
|
|
this.getSpanArr(this.errorForm.tableData) |
|
|
|
|
@ -875,6 +899,7 @@ export default { |
|
|
|
|
|
|
|
|
|
if (this.errorForm.repairStatus > 1) { |
|
|
|
|
data.forEach(item => { |
|
|
|
|
item.completeImgList = JSON.parse(item.completeImgList) |
|
|
|
|
if (item.detailGoodsList.length > 0) { |
|
|
|
|
item.isNeed = '1' |
|
|
|
|
} else { |
|
|
|
|
@ -883,6 +908,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.errorForm.tableData = data |
|
|
|
|
this.getExpandedKeys(data) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
@ -947,6 +973,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.errorForm.tableData = data |
|
|
|
|
this.getExpandedKeys(data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@ -970,8 +997,13 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.errorForm.tableData = data |
|
|
|
|
this.errorForm.approveResult = '' |
|
|
|
|
this.errorForm.approveRemark = '' |
|
|
|
|
this.getExpandedKeys(data) |
|
|
|
|
this.errorForm.approveResultManager = '' |
|
|
|
|
this.errorForm.approveRemarkManager = '' |
|
|
|
|
// 处理维修总金额 |
|
|
|
|
this.errorForm.actualAmount = (this.errorForm.totalPrice ? this.errorForm.totalPrice : 0) + this.errorForm.travelExpense ? Number(this.errorForm.travelExpense) : 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
@ -987,6 +1019,7 @@ export default { |
|
|
|
|
this.errorForm.tableData.map(item => { |
|
|
|
|
item.isRepair = 1 |
|
|
|
|
}) |
|
|
|
|
this.getExpandedKeys(data) |
|
|
|
|
this.errorForm.approveResult = '' |
|
|
|
|
this.errorForm.approveRemark = '' |
|
|
|
|
} |
|
|
|
|
@ -1006,7 +1039,8 @@ export default { |
|
|
|
|
approveResult: this.errorForm.approveResult1, |
|
|
|
|
approvePerson: this.userInfo.user_id, |
|
|
|
|
approveTime: moment().format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
|
approveRemark: this.errorForm.approveRemark |
|
|
|
|
approveRemark: this.errorForm.approveRemark, |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
customerRefuseFinish(query).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
@ -1034,6 +1068,7 @@ export default { |
|
|
|
|
signaturePerson: this.errorForm.signaturePerson, |
|
|
|
|
signatureTime: this.errorForm.signatureTime, |
|
|
|
|
approveResult: this.errorForm.approveResult1, |
|
|
|
|
evaluationRemarks:this.errorForm.evaluationRemarks |
|
|
|
|
} |
|
|
|
|
customerConfirmFinish(query).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
@ -1160,6 +1195,7 @@ export default { |
|
|
|
|
startTime: item.startTime, //计划开始时间 |
|
|
|
|
isNeed: item.isNeed,//是否需要物料 0,1 |
|
|
|
|
detailGoodsList: item.detailGoodsList,//物料列表 |
|
|
|
|
repairOption: item.repairOption |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
@ -1174,6 +1210,7 @@ export default { |
|
|
|
|
travelExpense: this.errorForm.travelExpense,// 差旅费 |
|
|
|
|
inspectionConclusion: this.errorForm.inspectionConclusion,//巡检结论 |
|
|
|
|
totalPrice: this.totalPrice,//总价 |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
solutionSave(params).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
@ -1188,9 +1225,16 @@ export default { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
} else if (this.viewType == 'check') { |
|
|
|
|
if (this.errorForm.approveResult == 1) { |
|
|
|
|
supervisorConfirm({ id: this.errorForm.id }).then(res => { |
|
|
|
|
} else if (this.viewType == 'check') {//主管审核 |
|
|
|
|
if (this.errorForm.approveResultManager == 1) { |
|
|
|
|
let query = { |
|
|
|
|
id: this.errorForm.id, //任务id |
|
|
|
|
approvePerson: this.userInfo.user_id, //审核人 |
|
|
|
|
approveResultManager: this.errorForm.approveResultManager, //审核结果 |
|
|
|
|
approveRemarkManager: this.errorForm.approveRemarkManager, //备注 |
|
|
|
|
actualAmount: this.errorForm.actualAmount |
|
|
|
|
} |
|
|
|
|
supervisorConfirm(query).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('提交成功') |
|
|
|
|
this.dialogerror = false |
|
|
|
|
@ -1201,8 +1245,8 @@ export default { |
|
|
|
|
let query = { |
|
|
|
|
id: this.errorForm.id, //任务id |
|
|
|
|
approvePerson: this.userInfo.user_id, //审核人 |
|
|
|
|
approveResult: this.errorForm.approveResult, //审核结果 |
|
|
|
|
approveRemark: this.errorForm.approveRemark //备注 |
|
|
|
|
approveResultManager: this.errorForm.approveResultManager, //审核结果 |
|
|
|
|
approveRemarkManager: this.errorForm.approveRemarkManager //备注 |
|
|
|
|
} |
|
|
|
|
supervisorRefuse(query).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
@ -1266,8 +1310,36 @@ export default { |
|
|
|
|
this.handleConfirm() |
|
|
|
|
} |
|
|
|
|
else if (this.viewType == 'repairupload') { |
|
|
|
|
|
|
|
|
|
let query = [] |
|
|
|
|
this.errorForm.tableData.map(item => { |
|
|
|
|
query.push({ |
|
|
|
|
id: item.id, // 明细id |
|
|
|
|
status: item.status, //状态,0:正常,1:异常 |
|
|
|
|
taskId: this.errorForm.id, // 任务ID |
|
|
|
|
floorName: item.floorName, //楼层 |
|
|
|
|
deptId: item.deptId, //房间 |
|
|
|
|
majorName: item.majorName, //专业名称 |
|
|
|
|
checkContent: item.checkContent, //巡检内容 |
|
|
|
|
craft: item.craft, //工艺要求 |
|
|
|
|
period: item.period, //巡检周期 1:月, 2:季, 3:半年 |
|
|
|
|
picUrl: item.picUrl, //现场图片地址 |
|
|
|
|
signUrl: item.signUrl, //签字图片地址 |
|
|
|
|
remark: item.remark, //备注 |
|
|
|
|
price: item.price, //价格 |
|
|
|
|
startTime: item.startTime, //计划开始时间 |
|
|
|
|
isNeed: item.isNeed,//是否需要物料 0,1 |
|
|
|
|
detailGoodsList: item.detailGoodsList,//物料列表 |
|
|
|
|
repairOption: item.repairOption, |
|
|
|
|
completeImgList: JSON.stringify(item.completeImgList) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
// 维修完成 |
|
|
|
|
servicemanSubmit({ id: this.errorForm.id, completeImgList: JSON.stringify(this.completeImgList) }).then(res => { |
|
|
|
|
let dataTable = { |
|
|
|
|
id: this.errorForm.id, |
|
|
|
|
details: query, |
|
|
|
|
} |
|
|
|
|
servicemanSubmit(dataTable).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('维修完成') |
|
|
|
|
this.dialogerror = false |
|
|
|
|
@ -1333,10 +1405,11 @@ export default { |
|
|
|
|
getRepairDetail({ id: row.id }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.errorForm = res.data.data |
|
|
|
|
this.dialogerror = true |
|
|
|
|
|
|
|
|
|
let data = this.checkDeepData(res.data.data.details) |
|
|
|
|
if (this.errorForm.repairStatus > 1) { |
|
|
|
|
data.forEach(item => { |
|
|
|
|
item.completeImgList = JSON.parse(item.completeImgList) |
|
|
|
|
if (item.detailGoodsList.length > 0) { |
|
|
|
|
item.isNeed = '1' |
|
|
|
|
} else { |
|
|
|
|
@ -1345,30 +1418,107 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.errorForm.tableData = data |
|
|
|
|
// this.errorForm.approveResult = '' |
|
|
|
|
// this.errorForm.approveRemark = '' |
|
|
|
|
this.getExpandedKeys(data) |
|
|
|
|
|
|
|
|
|
this.dialogerror = true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 附件上传成功 |
|
|
|
|
handleSuccess(response, file, fileList) { |
|
|
|
|
this.completeImgList.push( |
|
|
|
|
{ |
|
|
|
|
url: response.data.link, //--文件url |
|
|
|
|
name: response.data.originalName //--文件名称 |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
handleSuccess(index) { |
|
|
|
|
return (response, file, fileList) => { |
|
|
|
|
this.errorForm.tableData[index].completeImgList = [] |
|
|
|
|
fileList.map(item => { |
|
|
|
|
this.errorForm.tableData[index].completeImgList.push({ name: item.name, url: item.response ? item.response.data.link : item.url }) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 附件删除 |
|
|
|
|
handleRemove(file, fileList) { |
|
|
|
|
handleRemove(index) { |
|
|
|
|
return (file, fileList) => { |
|
|
|
|
this.completeImgList = [] |
|
|
|
|
this.errorForm.tableData[index].completeImgList = [] |
|
|
|
|
fileList.map(item => { |
|
|
|
|
this.completeImgList.push({ name: item.name, url: item.response ? item.response.data.link : item.url }) |
|
|
|
|
this.errorForm.tableData[index].completeImgList.push({ name: item.name, url: item.response ? item.response.data.link : item.url }) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
beforeAvatarUpload(index) { |
|
|
|
|
return (file) => { |
|
|
|
|
if (this.errorForm.tableData[index].completeImgList.length < 3) { |
|
|
|
|
const isLt3M = file.size |
|
|
|
|
|
|
|
|
|
const _this = this |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
const image = new Image() |
|
|
|
|
let resultBlob = '' |
|
|
|
|
image.src = URL.createObjectURL(file) |
|
|
|
|
image.onload = () => { |
|
|
|
|
// 调用方法获取blob格式,方法写在下边 |
|
|
|
|
resultBlob = _this.compressUpload(image, file) |
|
|
|
|
const fs = new File([resultBlob], file.name, { |
|
|
|
|
type: file.type, |
|
|
|
|
width: 200, |
|
|
|
|
height: 200 |
|
|
|
|
}) |
|
|
|
|
if (fs.size > 1024 * 1024 * 3) { |
|
|
|
|
this.$message.warning('压缩后图片仍大于3Mb,请您手动压缩') |
|
|
|
|
reject() |
|
|
|
|
} |
|
|
|
|
resolve(fs) |
|
|
|
|
} |
|
|
|
|
image.onerror = () => { |
|
|
|
|
reject() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.$message.error('故障视频与故障图片最多可上传3个') |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
/* 图片压缩方法-canvas压缩 */ |
|
|
|
|
compressUpload(image, file) { |
|
|
|
|
const canvas = document.createElement('canvas') |
|
|
|
|
const ctx = canvas.getContext('2d') |
|
|
|
|
const width = image.width * 0.1 // 图片宽度 * 压缩比例 |
|
|
|
|
|
|
|
|
|
const height = image.height * 0.1 // 图片高度 * 压缩比例 |
|
|
|
|
|
|
|
|
|
canvas.width = width // 画布宽度 |
|
|
|
|
|
|
|
|
|
canvas.height = height // 画布宽度 |
|
|
|
|
|
|
|
|
|
ctx.fillRect(0, 0, canvas.width, canvas.height) |
|
|
|
|
ctx.drawImage(image, 0, 0, width, height) |
|
|
|
|
const dataUrl = canvas.toDataURL(file.type) //图片转路径 |
|
|
|
|
|
|
|
|
|
const blobData = this.dataURItoBlob(dataUrl, file.type) //图片转二进制 |
|
|
|
|
|
|
|
|
|
return blobData |
|
|
|
|
}, |
|
|
|
|
/* base64转Blob对象 */ |
|
|
|
|
dataURItoBlob(data) { |
|
|
|
|
let byteString |
|
|
|
|
if (data.split(',')[0].indexOf('base64') >= 0) { |
|
|
|
|
byteString = atob(data.split(',')[1]) |
|
|
|
|
} else { |
|
|
|
|
byteString = unescape(data.split(',')[1]) |
|
|
|
|
} |
|
|
|
|
const mimeString = data.split(',')[0].split(':')[1].split(';')[0] |
|
|
|
|
const ia = new Uint8Array(byteString.length) |
|
|
|
|
for (let i = 0; i < byteString.length; i += 1) { |
|
|
|
|
ia[i] = byteString.charCodeAt(i) |
|
|
|
|
} |
|
|
|
|
return new Blob([ia], { type: mimeString }) |
|
|
|
|
}, |
|
|
|
|
getExpandedKeys(table) { |
|
|
|
|
this.expandedKeys = [] |
|
|
|
|
table.forEach(item => { |
|
|
|
|
this.expandedKeys.push(item.id) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|