diff --git a/src/api/claimAndRefund/receive.js b/src/api/claimAndRefund/receive.js index dba805d..2c9f1ab 100644 --- a/src/api/claimAndRefund/receive.js +++ b/src/api/claimAndRefund/receive.js @@ -372,6 +372,14 @@ export function getTaskDetail(data) { }) } +export function getCtDetailList(data) { + return request({ + url: '/material/backApply/getCtDetailList', + method: 'get', + params: data, + }) +} + // 退料接收编辑 保存 export function submitUpdateBackApply(data) { return request({ diff --git a/src/api/claimAndRefund/return.js b/src/api/claimAndRefund/return.js index a9b2c65..988e5e3 100644 --- a/src/api/claimAndRefund/return.js +++ b/src/api/claimAndRefund/return.js @@ -103,6 +103,15 @@ export function submitBackApplyApi(data) { }) } + +export function submitCtBackApplyApi(data) { + return request({ + url: '/material/backApply/submitCtBackInfo', + method: 'post', + data: data + }) +} + // 退料审核新增 export function submitBackApplyApiByCq(data) { return request({ @@ -148,6 +157,14 @@ export function getBackReceiveList(query) { params: query }) } + +export function getCtBackList(query) { + return request({ + url: '/material/backApply/getBackCtList', + method: 'get', + params: query + }) +} // 退料接收详情列表 export function receiveView(data) { return request({ diff --git a/src/api/repairTest/brokenExamine.js b/src/api/repairTest/brokenExamine.js index 52192b7..b2c1108 100644 --- a/src/api/repairTest/brokenExamine.js +++ b/src/api/repairTest/brokenExamine.js @@ -26,6 +26,15 @@ export function addDetailsAuditApi(data) { }) } +export function addDetailsAuditApiNew(data) { + return request({ + url: '/material/scrap/auditNew', + method: 'post', + // contentType: 'application/json', + data: data + }) +} + export function getScrapRecord(query) { return request({ url: '/material/scrap/getScrapRecord', diff --git a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue index ecefa77..3f036bd 100644 --- a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue +++ b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue @@ -158,7 +158,7 @@ style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" - placeholder="预计领料时间1" + placeholder="预计领料时间" > diff --git a/src/views/claimAndreturn/return/ctReceive/component/addReturn1.vue b/src/views/claimAndreturn/return/ctReceive/component/addReturn1.vue index 78de7a8..3d4fc63 100644 --- a/src/views/claimAndreturn/return/ctReceive/component/addReturn1.vue +++ b/src/views/claimAndreturn/return/ctReceive/component/addReturn1.vue @@ -42,39 +42,7 @@ - - + + + + @@ -119,27 +94,13 @@ :maxlength="11" /> - - - - 保存 - - - 完成退料 + 明细提交 @@ -155,19 +116,20 @@ - + + @@ -189,16 +151,7 @@ - - - + @@ -400,22 +168,14 @@ import { treeselect as menuTreeselect, roleMenuTreeselect } from '@/api/system/m import { getProData, getUnitData, - getDeviceTypeTree, getAgreementInfoById, - submitLeaseApply, - getUseTypeTreee, - getUseNumByTypeId, getTaskDetail, - submitUpdateBackApply, - getPreAuditNum, getUseTypeTreeCt, getSltCtList } from '@/api/claimAndRefund/receive' -import { submitBackApplyApi, getMachineById } from '@/api/claimAndRefund/return' import { - submitBackApplyApiByCq, materialReturnNoteByApply, - submitRefuseBackApply, + submitCtBackApplyApi, } from '@/api/claimAndRefund/return.js' import { mapState } from 'vuex' import { getInfo, h } from '@/api/login' @@ -523,6 +283,7 @@ export default { taskStatus: 30, backTime: '', //申请时间 backPerson: '', //退料人 + backCode: '', //退料编码 remark: '', //备注 //退料人信息 leaseApplyInfo: { @@ -672,27 +433,26 @@ export default { 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']), }, methods: { + // 校验本次退料数量 + checkNowNum(row) { + if (row.nowNum > row.needNum) { + row.nowNum = row.needNum; + this.$message.warning('本次退料数量不能大于差缺量'); + }else if(row.nowNum<0){ + row.nowNum = 0; + this.$message.warning('本次退料数量不能小于0'); + } + }, + + // 获取 来往单位 列表数据 async GetUnitData() { const params = { @@ -845,23 +605,6 @@ export default { this.leaseApplyDetails = res.data this.GetDeviceTypeTreeFn(data.agreementId) }, - //生成回显数据 - handelEchoData(item) { - // console.log('item======', item) - const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem)) - template.createBy = item.createBy - template.parentId = item.data.parentId - template.typeId = item.data.typeId - template.companyId = item.companyId - // template.typeId = item.typeId - template.unitNames = item.unitNames - template.typeCn = item.typeName - template.guigeCn = item.typeModelName - template.remark = item.remark - template.preNum = item.preNum - template.status = item.status - return template - }, /** 查询角色列表 */ async getList() {}, @@ -880,15 +623,6 @@ export default { checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys) return checkedKeys }, - // 所有部门节点数据 - getDeptAllCheckedKeys() { - // 目前被选中的部门节点 - let checkedKeys = this.$refs.dept.getCheckedKeys() - // 半选中的部门节点 - let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys() - checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys) - return checkedKeys - }, /** 根据角色ID查询菜单树结构 */ getRoleMenuTreeselect(roleId) { return roleMenuTreeselect(roleId).then((response) => { @@ -963,19 +697,6 @@ export default { console.log('🚀 ~ handleSelectionChange ~ selection:', selection) this.queryParams.leaseApplyDetails = selection }, - // 更多操作触发 - handleCommand(command, row) { - switch (command) { - case 'handleDataScope': - this.handleDataScope(row) - break - case 'handleAuthUser': - this.handleAuthUser(row) - break - default: - break - } - }, /** 保存按钮操作 */ handleAdd(type) { @@ -983,73 +704,38 @@ export default { if (!valid) { return false } else { - let backApplyInfo = [] - if (this.queryParams.leaseApplyDetails.length == 0) { - this.$message.error('请勾选要添加数据') - return - } - // const isRemark = this.queryParams.leaseApplyDetails.some( - // (item) => item.remark == '' || item.remark == undefined - // ); - this.queryParams.leaseApplyDetails.forEach((item) => { - console.log("jjjjjjjjjj",item) - - if (item.manageType == 1) { - item.num1 = Number(item.maintenanceNum || 0) + Number(item.passNum || 0); - - } else { - item.num1 = item.numList && item.numList.length > 0 ? item.numList.length : 0; - } - item.backNum = item.num1 - if (item.manageType == 0) { - item.backNum = item.numList.length - if (item.passMaCodeDtoList) { - item.repairMaCodeDtoList = item.numList.filter( - (item2) => - !item.passMaCodeDtoList.some((standardItem) => standardItem.maId == item2.maId), - ) - } - item.passNum = (item.passMaCodeDtoList && item.passMaCodeDtoList.length) || 0 - item.maintenanceNum = (item.repairMaCodeDtoList && item.repairMaCodeDtoList.length) || 0 + this.leaseApplyDetails.forEach((item) => { + item.ascriptionType = 1 + if(item.maWholeLeaseDetailVoList.length>0){ + item.maWholeLeaseDetailVoList.forEach((e) => { + if(e.nowNum===''){ + this.$message.error('本次退料数量不能为空!') + return + } + }) } + }) - console.log("kkkkkkkkkkkkkkk",this.queryParams.leaseApplyDetails) - const isNum = this.queryParams.leaseApplyDetails.some( - (item) => { - if(item.manageType == 1) {return Number(item.maintenanceNum || 0) + Number(item.passNum || 0)==0} - else {return (!item.numList) || (Number(item.numList.length || 0)==0) } - } - // (item) => item.backNum == '' || item.backNum == undefined || item.backNum == 0, - ) - if (isNum) { - this.$message.error('退料数量不能为空!') - return - } + 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, - taskId: this.taskId, + backCode: this.queryParams.backCode, + agreementId: this.queryParams.agreementId, + createBy: this.queryParams.createBy, } - if (this.taskId != '') { let params = { - isFinishBack: type, - companyId: this.companyId, - createBy: this.createBy, - id: this.rowId, - agreementId: this.queryParams.agreementId, backApplyInfo: this.queryParams.backApplyInfo, - backApplyDetails: this.queryParams.leaseApplyDetails, + ctBackApplyInfo: this.leaseApplyDetails, } - console.log('🚀 ~ this.$refs.queryForm.validate ~ params:', params) - const res = await submitUpdateBackApply(params) + console.log('🚀mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm', params) + const res = await submitCtBackApplyApi(params) if (res.code == 200) { this.$message({ type: 'success', message: res.msg }) setTimeout(() => { @@ -1059,57 +745,11 @@ export default { // }) }, 1000) } - } else { - let params = { - isFinishBack: type, - companyId: this.companyId, - createBy: this.createBy, - agreementId: this.queryParams.agreementId, - backApplyInfo: this.queryParams.backApplyInfo, - backApplyDetails: this.queryParams.leaseApplyDetails, - } - console.log('🚀 ~ this.$refs.queryForm.validate ~ params:', params) - const res = await submitBackApplyApi(params) - if (res.code == 200) { - this.$message({ type: 'success', message: res.msg }) - setTimeout(() => { - this.$emit('goBackPage') - // this.$tab.closeOpenPage({ - // path: '/claimAndRefund/return/returnApplyByCq', - // }) - }, 1000) - } - } + } }) }, - /** 修改按钮操作 */ - handleBack(row) { - this.$tab.closeOpenPage({ - path: '/claimAndRefund/return/returnApplyByCq', - }) - }, - /** 分配数据权限操作 */ - handleDataScope(row) { - this.reset() - const deptTreeSelect = this.getDeptTree(row.roleId) - getRole(row.roleId).then((response) => { - this.form = response.data - this.openDataScope = true - this.$nextTick(() => { - deptTreeSelect.then((res) => { - this.$refs.dept.setCheckedKeys(res.checkedKeys) - }) - }) - this.title = '分配数据权限' - }) - }, - /** 分配用户操作 */ - handleAuthUser: function (row) { - const roleId = row.roleId - this.$router.push('/system/role-auth/user/' + roleId) - }, /** 提交按钮 */ submitForm: function () { this.$refs['form'].validate((valid) => { @@ -1135,14 +775,6 @@ export default { /** 删除按钮操作 */ handleDelete(row) { - // this.deviceType.forEach((e, index) => { - // if (e[3] == row.typeId) { - // this.$nextTick(() => { - // this.deviceType.splice(index, 1) - // this.propsKey++ - // }) - // } - // }) this.leaseApplyDetails.splice(row.index, 1) }, /** 导出按钮操作 */ @@ -1188,47 +820,10 @@ export default { // useNum: deviceTypeList[0].data.num, typeName: deviceTypeList[0].parent.data.typeName, } - // if (val.length > 0) { - // const items = val.map((e) => { - // return e[3] - // }) - // console.log("tttttttttttttt",items) - // for (let i in items) { - // for (let z in deviceTypeList) { - // if (deviceTypeList[z].data.typeId == items[i]) { - - // let { id,} = deviceTypeList[z].data - - // const isRepeat = this.leaseApplyDetails.some((e) => e.typeId === id) - // if (!isRepeat) { - // this.getMaTypeDataByIdFun(deviceTypeList[z].data) - // } - - // } - // } - // } - // } - // console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams) + this.getMaTypeDataByIdFun(val[val.length-1]) }) - // console.log(val, '*******************') - // const deviceTypeList = - // this.$refs.deviceTypeCascader.getCheckedNodes() - // let tempList = [] - - // if (val.length > 0) { - // const items = val.map((e) => { - // return e[3] - // }) - // for (let i in items) { - // for (let z in deviceTypeList) { - // if (deviceTypeList[z].data.typeId == items[i]) { - // this.getMaTypeDataByIdFun(val[val.length-1]) - // } - // } - // } - // } }, // 获取规格型号 async getMaTypeDataByIdFun(val) { @@ -1261,185 +856,7 @@ export default { this.leaseApplyDetails.splice(index, 1); }, - //// 将数据处理成 表格中需要的数据 - handelTableItemData(node) { - const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem)) - template.createBy = this.createBy - template.typeId = node.data.typeId - template.companyId = node.data.companyId - // template.typeId = node.data.id - template.unitNames = node.data.unitNames - template.preNum = node.data.num - template.typeName = node.pathLabels[2] - template.typeCode = node.pathLabels[3] - template.num = node.data.num - template.useNum = node.data.useNum - return template - }, - resetMaCode() { - this.maCode = '' - this.getMachineList() - }, - // 获取编码再用列表 - getMachineList() { - const params = { - unitId: this.queryParams.unitId, - projectId: this.queryParams.proId, - typeId: this.typeId, - maCode: this.maCode, - } - getMachineById(params).then((res) => { - this.machineList = res.data - // 如果this.machineList 中 有 和row.numList 的值是对象 不再是 id 一样的值就设置选中 - this.machineList.forEach((item) => { - if (this.diaRow.numList.some((item2) => item2.maId == item.maId)) { - this.$nextTick(() => { - this.$refs.codeTableList.toggleRowSelection(item, true) - }) - } - }) - }) - }, - // 打开弹框 - handleSelect(row, type) { - console.log('🚀 ~ handleSelect ~ row:', row) - if (!row.numList) row.numList = [] - if (!row.numIds) row.numIds = [] - if (!row.standardIds) row.standardIds = [] - if (!row.fileList) row.fileList = [] - this.dialogType = type - this.selectedList = [] - this.currentRow = row - if (type == 1) { - this.typeId = row.typeId - this.diaRow = row - this.getMachineList() - } else { - if (row.numList.length == 0) { - // 提示 - this.$message({ - message: '请先选择编码退料数量', - type: 'warning', - duration: 1000, - }) - return - } - this.machineList = [...row.numList] - this.machineList.forEach((item) => { - if (row.passMaCodeDtoList && row.passMaCodeDtoList.some((item2) => item2.maId == item.maId)) { - this.$nextTick(() => { - this.$refs.codeTableList.toggleRowSelection(item, true) - }) - } - }) - } - // this.calculateDifference(row) - this.openDialog = true - console.log('🚀 ~ handleSelect ~ row:', row) - }, - // 弹框多选 - codeSelectionChange(selection) { - console.log('🚀 ~ codeSelectionChange ~ selection:', selection) - this.selectedList = selection - }, - // 弹框确定 - dialogConfirm() { - if (this.dialogType == 1) { - this.currentRow.numList = this.selectedList - this.currentRow.numIds = this.selectedList.map((item) => { - return item.maId - }) - this.currentRow.standardIds = [] - this.currentRow.passMaCodeDtoList = [] - } else { - this.currentRow.passMaCodeDtoList = this.selectedList - this.currentRow.standardIds = this.selectedList.map((item) => { - return item.maId - }) - } - if (this.currentRow.numIds.length > this.currentRow.useNum) { - this.$message({ - message: '不能超过使用数量', - type: 'warning', - }) - this.currentRow.numIds = [] - this.currentRow.numList = [] - return - } - this.openDialog = false - }, - handleRemove(file, fileList, row) { - console.log(file, fileList) - console.log('🚀 ~ handleRemove ~ row:', row) - row.fileList = fileList.map((item) => { - let fileName = '' - let fileUrl = '' - if (item.response) { - fileName = item.response.data.fileName - fileUrl = item.response.data.fileUrl - } else { - fileName = item.fileName - fileUrl = item.fileUrl - } - return { - typeId: row.typeId, - fileName: fileName, - fileUrl: fileUrl, - } - }) - console.log('🚀 ~ handleRemove ~ row.fileList:', row.fileList) - }, - handlePreview(file) { - console.log('🚀 ~ handlePreview ~ file:', file) - if (file.response) { - window.open(process.env.VUE_APP_BASE_API + '/system'+ file.response.data.fileUrl) - } else { - window.open(process.env.VUE_APP_BASE_API + '/system'+ file.fileUrl) - } - }, - handleExceed(files, fileList) { - this.$message.warning( - `当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${ - files.length + fileList.length - } 个文件`, - ) - }, - beforeUpload(file) { - const isLtMB = file.size / 1024 / 1024 < 20 - if (!isLtMB) { - this.$message.error('上传文件大小不能超过 20MB!') - } - return isLtMB - }, - beforeRemove(file, fileList) { - return this.$confirm(`确定移除 ${file.name} ?`) - }, - handleSuccess(res, file, fileList, row) { - console.log('🚀 ~ handleSuccess ~ res:', res) - console.log('🚀 ~ handleSuccess ~ file:', file) - console.log('🚀 ~ handleSuccess ~ fileList:', fileList) - console.log('🚀 ~ handleSuccess ~ row:', row) - if (res.code == 200) { - if (!row.fileList) { - row.fileList = [] - } - row.fileList.push({ - typeId: row.typeId, - fileName: res.data.fileName, - name: res.data.fileName, - fileUrl: res.data.fileUrl, - url: res.data.fileUrl, - }) - } - console.log('🚀 ~ row.fileList=fileList.map ~ row.fileList:', row.fileList) - }, - getLength(arr) { - return Array.isArray(arr) ? arr.length : 0 - }, - calculateDifference(row) { - return this.getLength(row.numList) - this.getLength(row.passMaCodeDtoList) - }, }, } diff --git a/src/views/claimAndreturn/return/ctReceive/component/handlePage.vue b/src/views/claimAndreturn/return/ctReceive/component/handlePage.vue index b92c084..1e23db0 100644 --- a/src/views/claimAndreturn/return/ctReceive/component/handlePage.vue +++ b/src/views/claimAndreturn/return/ctReceive/component/handlePage.vue @@ -1,1187 +1,788 @@