diff --git a/src/api/claimAndRefund/receive.js b/src/api/claimAndRefund/receive.js index 7a0be06..8927937 100644 --- a/src/api/claimAndRefund/receive.js +++ b/src/api/claimAndRefund/receive.js @@ -333,3 +333,22 @@ export function getLeaseOutDetailRecordApi(data) { export const getHoldingPoleSelListApi = () => { return request.get('/material/maWhole/selectWholeList') } + + +// 退料接收编辑 获取详情数据 +export function getTaskDetail(data) { + return request({ + url: '/material/base/backReceive/getDetailsReceiveList', + method: 'get', + params: data, + }) +} + +// 退料接收编辑 保存 +export function submitUpdateBackApply(data) { + return request({ + url: '/material/backApply/updateBackApply', + method: 'post', + data, + }) +} \ No newline at end of file diff --git a/src/views/claimAndreturn/return/receive/component/addReturn1.vue b/src/views/claimAndreturn/return/receive/component/addReturn1.vue index f7463e3..2af1e43 100644 --- a/src/views/claimAndreturn/return/receive/component/addReturn1.vue +++ b/src/views/claimAndreturn/return/receive/component/addReturn1.vue @@ -190,17 +190,17 @@ @@ -273,6 +273,8 @@ import { submitLeaseApply, getUseTypeTreee, getUseNumByTypeId, + getTaskDetail, + submitUpdateBackApply, } from '@/api/claimAndRefund/receive' import { submitBackApplyApi } from '@/api/claimAndRefund/return' import { @@ -295,6 +297,9 @@ export default { type: Boolean, default: false, }, + rejectTaskId: { + type: [String, Number], + }, }, data() { const validatePhone = (rule, value, callback) => { @@ -372,6 +377,8 @@ export default { taskType: 29, taskStatus: 30, backTime: '', //申请时间 + backPerson: '', //退料人 + remark: '', //备注 //退料人信息 leaseApplyInfo: { backPerson: '', @@ -493,6 +500,7 @@ export default { // isEdit: 'true', rowId: '', propsKey: 2000, + taskId:'', } }, mounted() { @@ -506,17 +514,38 @@ export default { // this.rowId = this.$route.query.Id // this.GetViewByApply(this.$route.query.Id) // } - if (this.rejectId) { - this.rowId = this.rejectId - this.GetViewByApply({ - id: this.rejectId, - agreementId: this.agreementId, - }) - } + // if (this.rejectTaskId && this.isEdit) { + // this.rowId = this.rejectTaskId + // this.GetViewByApply({ + // id: this.rejectId, + // agreementId: this.agreementId, + // }) + // } getInfo().then((res) => { this.companyId = res.user.companyId this.createBy = res.user.userName }) + this.taskId = this.rejectTaskId + this.rowId = this.rejectId + if(this.taskId && this.isEdit){ + Promise.all([ + this.GetTaskDetail(this.taskId), + // this.GetDeviceTypeTree(), + ]) + // .then(() => { + // let selectList = [] + // this.leaseApplyDetails.forEach((e) => { + // selectList.push( + // this.getParentsById(this.deviceTypeTree, e.typeId), + // ) + // }) + // console.log( 'selectList', selectList) + // this.$nextTick(() => { + // this.deviceType = selectList + // this.propsKey++ + // }) + // }) + } }, computed: { ...mapState(['user']), @@ -543,9 +572,10 @@ export default { }, // 获取 设备树结构数据 - async GetDeviceTypeTreeFn(agreementId) { + async GetDeviceTypeTreeFn(agreementId,id) { const params = { agreementId: agreementId, + id: id, // this.agreementId } @@ -604,8 +634,28 @@ export default { } }, + //编辑获取信息 + async GetTaskDetail(taskId) { + const res = await getTaskDetail({ + taskId: taskId, + }) + const data = res.data.backApplyInfo + // console.log(data) + // this.queryParams.taskId = data.taskId + this.queryParams.unitId = data.unitId + this.queryParams.proId = Number(data.projectId) + this.$set(this.queryParams, 'phone', data.phone) + this.queryParams.backPerson = data.backPerson + this.queryParams.backTime = data.backTime + this.queryParams.agreementCode = data.agreementCode + this.queryParams.agreementId = data.agreementId + this.queryParams.remark = data.remark + this.leaseApplyDetails = res.data.backApplyDetails + this.GetDeviceTypeTreeFn(data.agreementId,data.id) + }, + // 获取 任务详情数据 - async GetViewByApply(params) { + async GetViewByApply(taskId) { const res = await materialReturnNoteByApply({ id: params.id, agreementId: params.agreementId, @@ -782,13 +832,14 @@ export default { this.queryParams.createBy = this.user.name this.queryParams.companyId = this.companyId this.queryParams.backApplyInfo = { + id: this.rowId, backPerson: this.queryParams.backPerson, phone: this.queryParams.phone, remark: this.queryParams.remark, backTime: this.queryParams.backTime, companyId: this.companyId, } - if (this.rowId != '') { + if (this.taskId != '') { let params = { companyId: this.companyId, createBy: this.createBy, @@ -798,7 +849,7 @@ export default { backApplyDetails: this.queryParams.leaseApplyDetails, } - const res = await submitRefuseBackApply(params) + const res = await submitUpdateBackApply(params) if (res.code == 200) { this.$message({ type: 'success', message: res.msg }) setTimeout(() => { @@ -905,11 +956,12 @@ export default { }, checkNum(row) { - let maxNum = row.useNum + let maxNum = Number(row.useNum) + console.log('maxNum', maxNum) if (row.num <= 1) { - row.num = 1 + this.$set(row, 'num', 1); } else if (row.num >= maxNum) { - row.num = maxNum + this.$set(row, 'num', maxNum); } }, diff --git a/src/views/claimAndreturn/return/receive/component/handlePage.vue b/src/views/claimAndreturn/return/receive/component/handlePage.vue index 0c4c81f..d1dad59 100644 --- a/src/views/claimAndreturn/return/receive/component/handlePage.vue +++ b/src/views/claimAndreturn/return/receive/component/handlePage.vue @@ -820,24 +820,57 @@ export default { }, //完成退料接收 async completeBack() { - let param1 = { - parentId: this.queryParams.id, - } - const res1 = await getRecord(param1) - if (res1.code == 200) { - let param = { - createBy: this.createBy, + // 显示确认操作弹窗 + this.$confirm('该操作后进行退料的数据之后无法再次修改和删除,是否确认?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + let param1 = { parentId: this.queryParams.id, - taskId: this.queryParams.taskId, } - endBack(param).then((response) => { - if (response.code == 200) { - this.$modal.msgSuccess('操作成功') - // this.back() - this.$emit('goBackPage') + const res1 = await getRecord(param1) + if (res1.code == 200) { + let param = { + createBy: this.createBy, + parentId: this.queryParams.id, + taskId: this.queryParams.taskId, } - }) - } + endBack(param).then((response) => { + if (response.code == 200) { + this.$modal.msgSuccess('操作成功') + // this.back() + this.$emit('goBackPage') + } + }) + } + }).catch(() => { + // this.$message({ + // type: 'info', + // message: '已取消操作' + // }); + }); + + // let param1 = { + // parentId: this.queryParams.id, + // } + + + // const res1 = await getRecord(param1) + // if (res1.code == 200) { + // let param = { + // createBy: this.createBy, + // parentId: this.queryParams.id, + // taskId: this.queryParams.taskId, + // } + // endBack(param).then((response) => { + // if (response.code == 200) { + // this.$modal.msgSuccess('操作成功') + // // this.back() + // this.$emit('goBackPage') + // } + // }) + // } }, //查看数据 handleViewCode(row) { diff --git a/src/views/claimAndreturn/return/receive/component/home.vue b/src/views/claimAndreturn/return/receive/component/home.vue index dcf37da..e81c61c 100644 --- a/src/views/claimAndreturn/return/receive/component/home.vue +++ b/src/views/claimAndreturn/return/receive/component/home.vue @@ -223,6 +223,16 @@ @click="handleSee(scope.row, 'see')" >查看 + + 编辑 +