diff --git a/src/views/businessManagement/ordinary.vue b/src/views/businessManagement/ordinary.vue index edaae5d..6057bac 100644 --- a/src/views/businessManagement/ordinary.vue +++ b/src/views/businessManagement/ordinary.vue @@ -1338,14 +1338,6 @@ export default { 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) { @@ -1388,7 +1380,7 @@ export default { 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.laborCost = this.repairForm.laborCost < 0 ? null : this.repairForm.laborCost //人工费 this.repairForm.travelExpense = this.repairForm.travelExpense < 0 ? null : this.repairForm.travelExpense //差旅费 - this.getDeviceList(res.data.data.createDept) + this.getDeviceList(res.data.data.reportUnit) if (this.repairForm.isNeedMaterial != '') { this.repairVisible = true @@ -1419,9 +1411,6 @@ export default { this.productLists = res.data.data.records item.productList = res.data.data.records item.productId = res.data.data.records.find(item1 => item1.name == item.productName).id - // this.tableData[index].productList = res.data.data.records - // this.tableData[index].productId = res.data.data.records.find(item1 => item1.name == item.productName).id - }) }) this.totalPrice = this.tableData.reduce((sum, item) => sum + item.price, 0) @@ -1511,7 +1500,7 @@ export default { getGoodsList({ bigClassId: event.node, current: 1, //页数 - size: 100, + size: 99999, }).then(res => { this.tableData[index].inventoryId = '' this.tableData[index].productName = '' @@ -1646,7 +1635,6 @@ export default { }, searchReset(params, done) { this.searchForm.timeRange = [moment().subtract(7, 'days').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')] - // params.releaseTimeRange = dateFormat(new Date(), 'yyyy-MM-dd'); this.query = params; this.onLoad(this.page); }, @@ -1699,7 +1687,6 @@ export default { name: item.name } }) - // this.repairForm.approvePerson = this.repairForm.status == 4 ? '' : this.repairForm.approvePerson }) } else if (this.selectList.length == 0) { this.$message.warning('请选择一条数据') @@ -1789,13 +1776,13 @@ export default { deviceName: this.repairForm.deviceName, repairType: this.repairForm.repairType }).then(res => { - applyGoods(query1).then(res => { - if (res.data.code == 200) { + // applyGoods(query1).then(res => { + // if (res.data.code == 200) { this.$message.success("提交成功") this.repairVisible = false this.onLoad() - } - }) + // } + // }) }) } diff --git a/src/views/operation/hand.vue b/src/views/operation/hand.vue index 4b8afe8..f7de8f7 100644 --- a/src/views/operation/hand.vue +++ b/src/views/operation/hand.vue @@ -481,6 +481,7 @@ import { color } from "echarts"; import { exportBlob, exportBlob1, zipDownload } from "@/api/common"; import { downloadXls } from "@/util/util"; let action = "https://api.avuejs.com/imgupload"; +import { applyGoods } from '@/api/goodsManagement/goods' export default { components: { @@ -1148,11 +1149,48 @@ export default { } }) } else { + let goodsList = [] + this.detailForm.materials && this.detailForm.materials.length != 0 && this.detailForm.materials.map(item =>{ + goodsList.push({ + productId: item.id, + productName: item.materialName, + applyNum: item.materialCount, + orderId: this.detailForm.id, + materialName: item.materialName, + materialCount: item.materialCount, + materialPrice: item.materialPrice, + bigClassId: item.bigClassId, + rule: item.rule, + unit: item.unit, + xh: item.xh, + inventoryId: item.inventoryId, + productCode:item.inventoryId + }) + }) + let query1 = { + details: goodsList, + applyUserId: this.detailForm.repairPerson, //申领人Id + applyUser: this.detailForm.repairPersonName, //申领人 + applyTime: moment().format('YYYY-MM-DD HH:mm:ss'), //申领时间(yyyy-MM-dd HH:mm:ss) + status: 0, + workId: this.detailForm.id, + remark: '维修单申领' + } customerConfirm(query).then(res => { if (res.data.code == 200) { - this.$message.success('审批成功') - this.detailVisible = false - this.onLoad() + if(this.detailForm.isNeedMaterial == 1){ + applyGoods(query1).then(res =>{ + if (res.data.code == 200) { + this.$message.success('审批成功') + this.detailVisible = false + this.onLoad() + } + }) + }else{ + this.$message.success('审批成功') + this.detailVisible = false + this.onLoad() + } } }) } @@ -1160,7 +1198,6 @@ export default { // 查看 handleView(row) { getDetail({ id: row.id }).then(res => { - console.log('res-------------->', res.data.data.videoAttaches) this.rowStatus = res.data.data.status this.detailVisible = true this.viewType = 'view'