|
|
|
|
@ -22,18 +22,18 @@ |
|
|
|
|
getStatus('maintain', role_id, row.status).name }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="scope" slot="menuLeft"> |
|
|
|
|
<el-button type="primary" size="small" @click="handleAccept" v-show="role_id != '1839600115013713921'">{{ |
|
|
|
|
<!-- <el-button type="primary" size="small" @click="handleAccept" v-show="role_id != '1839600115013713921'">{{ |
|
|
|
|
role_id |
|
|
|
|
== '1839552581620793346' ? '接单确认' : '接单' }}</el-button> |
|
|
|
|
== '1839552581620793346' ? '接单确认' : '接单' }}</el-button> --> |
|
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" @click="handleApproval" |
|
|
|
|
v-show="role_id == '1839600115013713921'">审批</el-button> |
|
|
|
|
<el-button type="primary" size="small" @click="allExportReport">批量导出报告</el-button> |
|
|
|
|
<el-button type="primary" size="small" @click="allExportReport">批量导出报告</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{ row }" slot="menu"> |
|
|
|
|
<el-button v-show="permission.ordinaryView" @click="handleView(row)">查看</el-button> |
|
|
|
|
|
|
|
|
|
<el-button v-show="permission.ordinaryOrder && (row.status == 101 || row.status == 400)" |
|
|
|
|
<el-button v-show="permission.ordinaryOrder && (row.status == 101 || row.status == 400 || row.status == 205)" |
|
|
|
|
@click="takeOrders(row)">接单</el-button> |
|
|
|
|
<el-button v-show="permission.ordinaryClose && row.status == 101" @click="handleClone(row)">关闭</el-button> |
|
|
|
|
<el-button v-show="permission.ordinaryConfirm && row.status == 201" @click="reciveOrder(row)">确认</el-button> |
|
|
|
|
@ -47,9 +47,10 @@ |
|
|
|
|
@click="handleRepairFinish(row)">维修完成</el-button> |
|
|
|
|
<el-button v-show="permission.ordinarySubmit && (row.status == 401 || row.status == 300 || row.status == 105)" |
|
|
|
|
@click="handleRepair(row)">提交</el-button> |
|
|
|
|
<el-button v-show="permission.ordinaryPay&&row.status == 104" @click="handlePayment(row)">确认付款</el-button> |
|
|
|
|
<el-button @click="handleExport(row)" v-show="row.status == 202||row.status == 203||row.status == 204">报告</el-button> |
|
|
|
|
<el-button @click="viewLog(row)" >日志</el-button> |
|
|
|
|
<el-button v-show="permission.ordinaryPay && row.status == 104" @click="handlePayment(row)">确认付款</el-button> |
|
|
|
|
<el-button @click="handleExport(row)" |
|
|
|
|
v-show="row.status == 202 || row.status == 203 || row.status == 204">报告</el-button> |
|
|
|
|
<el-button @click="viewLog(row)">日志</el-button> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
@ -209,7 +210,7 @@ |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div v-show="repairForm.closeReason == ''"> |
|
|
|
|
<div v-show="repairForm.status != 100 && repairForm.status != 101"> |
|
|
|
|
<div style="color: #101010;font-size: 20px;font-weight: 550;margin-bottom: 20px;">处理情况</div> |
|
|
|
|
<el-form-item label="接单时间" prop="dispatchTime"> |
|
|
|
|
<el-date-picker v-model="repairForm.dispatchTime" type="datetime" disabled style="width:98%;" |
|
|
|
|
@ -228,7 +229,7 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div |
|
|
|
|
v-show="(repairForm.status == 105||repairForm.status == 401 || repairForm.status == 402 || repairForm.status == 403 || repairForm.status == 301 || repairForm.status == 300 || repairForm.status == 102 || repairForm.status == 103 || repairForm.status == 104)"> |
|
|
|
|
v-show="(repairForm.status == 105 || repairForm.status == 401 || repairForm.status == 402 || repairForm.status == 403 || repairForm.status == 301 || repairForm.status == 300 || repairForm.status == 102 || repairForm.status == 103 || repairForm.status == 104)"> |
|
|
|
|
<div style="color: #101010;font-size: 20px;font-weight: 550;margin-bottom: 20px;">维修详情</div> |
|
|
|
|
<el-form-item label="维修人" prop="repairPersonName"> |
|
|
|
|
<el-input placeholder="请输入维修人" |
|
|
|
|
@ -592,9 +593,9 @@ |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
<!-- 报告导出页面 --> |
|
|
|
|
<div id="pdfDom" style="padding: 20px;"> |
|
|
|
|
<!-- <div id="pdfDom" style="padding:10px;"> |
|
|
|
|
<requirement :detailForm="requireForm"></requirement> |
|
|
|
|
</div> |
|
|
|
|
</div> --> |
|
|
|
|
<!-- 流程弹框 --> |
|
|
|
|
<logDialog :orderId="logOrderId" :infoDialog="infoDialog" @closeLog="closeLog"></logDialog> |
|
|
|
|
<!-- 工单处理弹框 --> |
|
|
|
|
@ -622,6 +623,8 @@ import { |
|
|
|
|
import { getGoodsList } from '@/api/goodsManagement/goods' |
|
|
|
|
import logDialog from '../../components/order/logDialog.vue' |
|
|
|
|
import workOrderDialog from '../../components/order/workOrderDialog.vue' |
|
|
|
|
import { exportBlob, exportBlob1 } from "@/api/common"; |
|
|
|
|
import { downloadXls } from "@/util/util"; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
requestSub, |
|
|
|
|
@ -736,15 +739,15 @@ export default { |
|
|
|
|
labelWidth: 120, |
|
|
|
|
prop: "faultType", |
|
|
|
|
overHidden: true, |
|
|
|
|
type: "select", |
|
|
|
|
searchLabelWidth: 100, |
|
|
|
|
search: true, |
|
|
|
|
viewDisplay: false, |
|
|
|
|
dicUrl: '/api/blade-system/dict-biz/child-list?current=1&size=100&parentId=1846802246527463425', |
|
|
|
|
props: { |
|
|
|
|
label: "dictValue", |
|
|
|
|
value: "dictValue", |
|
|
|
|
}, |
|
|
|
|
// type: "select", |
|
|
|
|
// searchLabelWidth: 100, |
|
|
|
|
// search: true, |
|
|
|
|
// viewDisplay: false, |
|
|
|
|
// dicUrl: '/api/blade-system/dict-biz/child-list?current=1&size=100&parentId=1846802246527463425', |
|
|
|
|
// props: { |
|
|
|
|
// label: "dictValue", |
|
|
|
|
// value: "dictValue", |
|
|
|
|
// }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "故障专业描述", |
|
|
|
|
@ -826,13 +829,13 @@ export default { |
|
|
|
|
infoDialog: false,//流程查看弹框 |
|
|
|
|
workOrderShow: false,//工单处理弹框 |
|
|
|
|
workOrderId: '',//id |
|
|
|
|
dataTypes:'' |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(["userInfo", "permission"]), |
|
|
|
|
...mapState({ |
|
|
|
|
dataType: state => state.user.dataType, |
|
|
|
|
}), |
|
|
|
|
getStatus() { |
|
|
|
|
return (type, id, status) => { |
|
|
|
|
for (let i in statusData[type]) { |
|
|
|
|
@ -858,14 +861,18 @@ export default { |
|
|
|
|
// 维修类型 |
|
|
|
|
getChildList(1, 100, '1869925082102702082').then(res => { |
|
|
|
|
this.repairTypeList = res.data.data |
|
|
|
|
this.repairTypeList.forEach(item=>{ |
|
|
|
|
item.dictKey=Number(item.dictKey) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.getGoodsList() |
|
|
|
|
this.getProductLists() |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.role_id = this.userInfo.role_id |
|
|
|
|
this.dataTypes=this.userInfo.dataType |
|
|
|
|
// 获取维修人员列表 |
|
|
|
|
getRepairPeople({ isRepair: this.role_id == '1839537055389515777' ? true : false }).then(res => { |
|
|
|
|
getRepairPeople().then(res => { |
|
|
|
|
this.repairPersonList = res.data.data |
|
|
|
|
}) |
|
|
|
|
this.option.column.find(item => item.prop == 'finishTime').hide = false |
|
|
|
|
@ -884,11 +891,15 @@ export default { |
|
|
|
|
this.option.column.find(item => item.prop == 'finishTime').hide = true |
|
|
|
|
this.option.column.find(item => item.prop == 'approveTime').hide = false |
|
|
|
|
} |
|
|
|
|
this.onLoad() |
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.onLoad() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 批量导出报告 |
|
|
|
|
allExportReport() { |
|
|
|
|
// 批量导出报告 |
|
|
|
|
allExportReport() { |
|
|
|
|
if (this.selectList.length == 0) { |
|
|
|
|
this.$message.warning('请至少选择一条数据') |
|
|
|
|
} else { |
|
|
|
|
@ -896,7 +907,27 @@ export default { |
|
|
|
|
if (tmp.length != this.selectList.length) { |
|
|
|
|
this.$message.warning('请选择状态为已完成的数据') |
|
|
|
|
} else { |
|
|
|
|
console.log('批量导出报告', this.selectList) |
|
|
|
|
zipDownload('/api/lab-ops/work-order/batch-report-service', this.selectList) |
|
|
|
|
.then((response) => { |
|
|
|
|
const blob = new Blob([response.data]) |
|
|
|
|
const fileName = '运维服务单.zip' |
|
|
|
|
if ('download' in document.createElement('a')) { // 非IE下载 |
|
|
|
|
const elink = document.createElement('a') |
|
|
|
|
elink.download = fileName |
|
|
|
|
elink.style.display = 'none' |
|
|
|
|
elink.href = URL.createObjectURL(blob) |
|
|
|
|
document.body.appendChild(elink) |
|
|
|
|
elink.click() |
|
|
|
|
URL.revokeObjectURL(elink.href)// 释放URL 对象 |
|
|
|
|
document.body.removeChild(elink) |
|
|
|
|
} else { // IE10+下载 |
|
|
|
|
navigator.msSaveBlob(blob, fileName) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch((err) => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -1079,7 +1110,7 @@ export default { |
|
|
|
|
this.repairForm.errorVideo = res.data.data.videoAttaches.length > 0 ? res.data.data.videoAttaches[0].link : '' |
|
|
|
|
this.repairForm.errorImg = res.data.data.picAttaches.map(item => { return { name: item.originalName, url: item.link } }) |
|
|
|
|
this.repairForm.deviceId = this.repairForm.deviceId == -1 ? '' : this.repairForm.deviceId |
|
|
|
|
this.repairForm.isNeedMaterial = (this.repairForm.status == 201 || this.repairForm.status == 401 || this.repairForm.status == 402|| this.repairForm.status == 105) && this.repairForm.isNeedMaterial == -1 ? '' : this.repairForm.isNeedMaterial |
|
|
|
|
this.repairForm.isNeedMaterial = (this.repairForm.status == 201 || this.repairForm.status == 401 || this.repairForm.status == 402 || this.repairForm.status == 105) && this.repairForm.isNeedMaterial == -1 ? '' : this.repairForm.isNeedMaterial |
|
|
|
|
this.getDeviceList(res.data.data.createDept) |
|
|
|
|
|
|
|
|
|
if (this.repairForm.isNeedMaterial != '') { |
|
|
|
|
@ -1140,13 +1171,18 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleExport(row) { |
|
|
|
|
getDetail({ id: row.id }).then(res => { |
|
|
|
|
this.requireForm = res.data.data |
|
|
|
|
// this.getPdf() |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.getPdf() |
|
|
|
|
}, 100) |
|
|
|
|
let query = JSON.parse(JSON.stringify(row)) |
|
|
|
|
exportBlob1(`/api/lab-ops/work-order/report-service`, query).then(res => { |
|
|
|
|
downloadXls(res.data, "运维服务单.xlsx"); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// getDetail({ id: row.id }).then(res => { |
|
|
|
|
// this.requireForm = res.data.data |
|
|
|
|
// // this.getPdf() |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// this.getPdf() |
|
|
|
|
// }, 100) |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
// 维修人员提交维修结果 |
|
|
|
|
handleRepairFinish(row) { |
|
|
|
|
@ -1410,7 +1446,7 @@ export default { |
|
|
|
|
this.$message.warning('请选择一条数据') |
|
|
|
|
} else if (this.selectList.length > 1) { |
|
|
|
|
this.$message.warning('只能选择一条数据') |
|
|
|
|
} else if (this.selectList[0].status != 2) { |
|
|
|
|
} else if (this.selectList[0].status != 100) { |
|
|
|
|
this.$message.warning('只能选择状态为待确认的数据') |
|
|
|
|
} else { |
|
|
|
|
this.dialogTitle = '工单' |
|
|
|
|
@ -1457,7 +1493,7 @@ export default { |
|
|
|
|
handleRepairConfirm() { |
|
|
|
|
this.$refs.repairForm.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.repairForm.status == 105 ||this.repairForm.status == 401 || this.repairForm.status == 300) { |
|
|
|
|
if (this.repairForm.status == 105 || this.repairForm.status == 401 || this.repairForm.status == 300) { |
|
|
|
|
if (this.repairForm.isNeedMaterial == '1') { |
|
|
|
|
if (this.tableData.length == 0) { |
|
|
|
|
this.$message.error('请至少填写一条维修材料信息') |
|
|
|
|
@ -1486,10 +1522,10 @@ export default { |
|
|
|
|
materials: data |
|
|
|
|
} |
|
|
|
|
// 紧急维修 |
|
|
|
|
if(this.repairForm.repairType==1){ |
|
|
|
|
query.discountPrice=data.reduce((sum, item) => sum + item.materialPrice, 0) |
|
|
|
|
query.totalPrice=data.reduce((sum, item) => sum + item.materialPrice, 0) |
|
|
|
|
query.discount=0 |
|
|
|
|
if (this.repairForm.repairType == 1) { |
|
|
|
|
query.discountPrice = data.reduce((sum, item) => sum + item.materialPrice, 0) |
|
|
|
|
query.totalPrice = data.reduce((sum, item) => sum + item.materialPrice, 0) |
|
|
|
|
query.discount = 0 |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
editData(query).then(res => { |
|
|
|
|
@ -1498,7 +1534,7 @@ export default { |
|
|
|
|
id: this.repairForm.id, |
|
|
|
|
deviceId: this.repairForm.deviceId, |
|
|
|
|
deviceName: this.repairForm.deviceName, |
|
|
|
|
repairType:this.repairForm.repairType |
|
|
|
|
repairType: this.repairForm.repairType |
|
|
|
|
}).then(res => { |
|
|
|
|
this.$message.success("提交成功") |
|
|
|
|
this.repairVisible = false |
|
|
|
|
@ -1652,7 +1688,7 @@ export default { |
|
|
|
|
if (valid) { |
|
|
|
|
let query = {} |
|
|
|
|
// 客服提交 |
|
|
|
|
if (this.dataType == '2') { |
|
|
|
|
if (this.dataTypes == '2') { |
|
|
|
|
query = { |
|
|
|
|
id: this.addForm.id, |
|
|
|
|
reportUnit: this.addForm.reportUnit, |
|
|
|
|
@ -1670,7 +1706,6 @@ export default { |
|
|
|
|
remark: this.addForm.remark, |
|
|
|
|
repairType: this.addForm.repairType |
|
|
|
|
} |
|
|
|
|
console.log(1111111111, manQuery) |
|
|
|
|
// editData(query).then(res => { |
|
|
|
|
// if (res.data.code == 200) { |
|
|
|
|
// serviceman(manQuery).then(result => { |
|
|
|
|
@ -1779,6 +1814,7 @@ export default { |
|
|
|
|
this.selectList = selection |
|
|
|
|
}, |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
console.log(6666,this.dataTypes) |
|
|
|
|
let query = { |
|
|
|
|
current: this.page.currentPage, //页数 |
|
|
|
|
size: this.page.pageSize, //条数 |
|
|
|
|
@ -1786,7 +1822,7 @@ export default { |
|
|
|
|
endTime: this.searchForm.timeRange && this.searchForm.timeRange.length != 0 ? this.searchForm.timeRange[1].toString() + ' 23:59:59' : '', //结束时间 |
|
|
|
|
faultType: this.searchForm.faultType ? this.searchForm.faultType : '', //故障类型 |
|
|
|
|
reportUnitName: this.searchForm.reportUnitName ? this.searchForm.reportUnitName : '', |
|
|
|
|
// dataType: this.role_id == '1839536982874193922' || this.role_id == '1839600115013713921' ? 2 : this.role_id == '1839537055389515777' ? 3 : this.role_id == '1839552581620793346' ? 4 : '' |
|
|
|
|
dataType: this.dataTypes |
|
|
|
|
} |
|
|
|
|
getList(query).then(res => { |
|
|
|
|
let data_ = res.data.data.records |
|
|
|
|
|