diff --git a/src/api/claimAndRefund/receive.js b/src/api/claimAndRefund/receive.js
index 154e2ca..192c997 100644
--- a/src/api/claimAndRefund/receive.js
+++ b/src/api/claimAndRefund/receive.js
@@ -405,6 +405,17 @@ export function getFourMaTypeList(data) {
})
}
+export function getFourMaTypeListTwo(data) {
+ return request({
+ url: '/material/select/getFourMaTypeListTwo',
+ method: 'post',
+ headers: {
+ repeatSubmit: false,
+ },
+ data,
+ })
+}
+
// 获取预退数量
export function getPreAuditNum(params) {
return request({
diff --git a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue
index 0d729bf..5014ed1 100644
--- a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue
+++ b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue
@@ -116,15 +116,6 @@
-
-
-
-
+
+
+
+
-
+
待出库数量:{{ outNum }}
@@ -305,7 +305,7 @@
-
+
@@ -362,7 +362,7 @@
-
+
@@ -644,6 +644,24 @@ export default {
},
showSelect: true,
rowTemp: {}, // 临时存储行数据
+ queryRules: {
+ createTime: [
+ {
+ required: true,
+ message: '请选择出库时间',
+ trigger: 'change',
+ },
+ ],
+ },
+ queryRulesNum: {
+ createTime: [
+ {
+ required: true,
+ message: '请选择出库时间',
+ trigger: 'change',
+ },
+ ],
+ }
}
},
created() {
@@ -822,53 +840,66 @@ export default {
},
//编码出库保存
saveCodeOut() {
- if (this.maCodeList.length <= this.outObj.outNum) {
- let params = this.maCodeList.map((item) => {
- let obj = {
- id: this.outObj.id,
- maId: item,
- manageType: 0,
- carCode: this.codeOutForm.carCode,
- remark: this.codeOutForm.remark,
- typeId: this.outObj.typeId,
- parentId: this.outObj.parentId,
- outNum: 1,
- taskId: this.outObj.taskId,
- leaseType: this.leaseType,
- maModel: this.outObj.maModel,
- maName: this.outObj.maName,
- createTime: this.codeOutForm.createTime,
- // remark: this.outCodeList.find((v) => v.maId == item).remark,
- }
- return obj
- })
+ this.$refs.codeOutForm.validate(async (valid) => {
+ if (!valid) {
+ return false
+ } else {
+ if (this.maCodeList.length <= this.outObj.outNum) {
+ let params = this.maCodeList.map((item) => {
+ let obj = {
+ id: this.outObj.id,
+ maId: item,
+ manageType: 0,
+ carCode: this.codeOutForm.carCode,
+ remark: this.codeOutForm.remark,
+ typeId: this.outObj.typeId,
+ parentId: this.outObj.parentId,
+ outNum: 1,
+ taskId: this.outObj.taskId,
+ leaseType: this.leaseType,
+ maModel: this.outObj.maModel,
+ maName: this.outObj.maName,
+ createTime: this.codeOutForm.createTime,
+ // remark: this.outCodeList.find((v) => v.maId == item).remark,
+ }
+ return obj
+ })
- console.log(params, '编码出库时参数')
- // console.log(params)
- submitOut(params).then((response) => {
- this.$modal.msgSuccess('出库成功')
- this.openCode = false
- this.handleDialogQuery()
- this.handleQuery()
- })
- } else {
- this.$modal.msgError('所选机具编码已超出出库数量!')
- }
+ console.log(params, '编码出库时参数')
+ // console.log(params)
+ submitOut(params).then((response) => {
+ this.$modal.msgSuccess('出库成功')
+ this.openCode = false
+ this.handleDialogQuery()
+ this.handleQuery()
+ })
+ } else {
+ this.$modal.msgError('所选机具编码已超出出库数量!')
+ }
+ }
+ })
},
//数量出库保存
saveNumOut() {
- this.outNumList[0].carCode = this.numOutForm.carCode
- this.outNumList[0].remark = this.numOutForm.remark
- this.outNumList[0].createTime = this.numOutForm.createTime
- this.outNumList[0].leaseType = this.leaseType
- let param = this.outNumList
- // console.log(param, '数量出库时参数')
- submitNumOut(param).then((response) => {
- this.$modal.msgSuccess('出库成功')
- this.openNum = false
- this.handleDialogQuery()
- this.handleQuery()
+ this.$refs.numOutForm.validate(async (valid) => {
+ if (!valid) {
+ return false
+ } else{
+ this.outNumList[0].carCode = this.numOutForm.carCode
+ this.outNumList[0].remark = this.numOutForm.remark
+ this.outNumList[0].createTime = this.numOutForm.createTime
+ this.outNumList[0].leaseType = this.leaseType
+ let param = this.outNumList
+ // console.log(param, '数量出库时参数')
+ submitNumOut(param).then((response) => {
+ this.$modal.msgSuccess('出库成功')
+ this.openNum = false
+ this.handleDialogQuery()
+ this.handleQuery()
+ })
+ }
})
+
},
//输入出库数量
diff --git a/src/views/claimAndreturn/return/receive/component/addReturn1.vue b/src/views/claimAndreturn/return/receive/component/addReturn1.vue
index a449f45..7599f7d 100644
--- a/src/views/claimAndreturn/return/receive/component/addReturn1.vue
+++ b/src/views/claimAndreturn/return/receive/component/addReturn1.vue
@@ -42,7 +42,7 @@
-
+
+
+
+
导出 -->
-
+
-
+
-
+
{{ row.manageType == '0' ? '编码退料' : '数量退料' }}
-
+
{{
Number(row.maintenanceNum || 0) + Number(row.passNum || 0)
@@ -208,7 +224,7 @@
{{ calculateDifference(row) }}
-
+
{
if (data) {
data.forEach((item) => {
if (item.children) {
recursion(item.children, level + 1)
}
- if (level == 3) {
+ if (level == 4) {
delete item.children
}
})
@@ -1104,8 +1120,8 @@ export default {
/////// 设备类型树 切换
async deviceTypeChange(val) {
this.queryParams.typeId = ''
- this.typeListDev = []
- // console.log('🚀 ~ deviceTypeChange ~ val:', val)
+ // this.typeListDev = []
+ console.log('🚀 ~ deviceTypeChange ~ valtttttttttttt:', val)
this.$nextTick(() => {
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
console.log('🚀 ~ deviceTypeChange ~ deviceTypeList:', deviceTypeList[0])
@@ -1117,8 +1133,28 @@ export default {
// useNum: deviceTypeList[0].data.num,
typeName: deviceTypeList[0].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])
+ this.getMaTypeDataByIdFun(val[val.length-1])
})
// console.log(val, '*******************')
@@ -1129,65 +1165,21 @@ export default {
// if (val.length > 0) {
// const items = val.map((e) => {
// return e[3]
- // })x
+ // })
// for (let i in items) {
// for (let z in deviceTypeList) {
// if (deviceTypeList[z].data.typeId == items[i]) {
- // let { num, companyId, typeId, unitNames } =
- // deviceTypeList[z].data
- // tempList.push({
- // createBy: this.createBy,
- // typeId,
- // preNum: num,
- // num,
- // companyId,
- // unitNames,
- // useNum: num,
- // typeName: deviceTypeList[z].pathLabels[2],
- // typeCode: deviceTypeList[z].pathLabels[3],
- // })
- // break
+ // this.getMaTypeDataByIdFun(val[val.length-1])
// }
// }
// }
-
- // const newDataList = [...this.leaseApplyDetails, ...tempList]
- // const map = new Map()
- // for (let item of newDataList) {
- // if (!map.has(item.typeId * 1)) {
- // map.set(item.typeId * 1, item)
- // }
- // }
- // const newArray = [...map.values()]
-
- // console.log(newArray, 'newArray', items, 'items')
-
- // let newArray_array = []
- // items.forEach((e) => {
- // newArray.forEach((j) => {
- // if (e == j.typeId) {
- // newArray_array.push(j)
- // }
- // })
- // })
- // this.leaseApplyDetails = newArray_array
- // } else {
- // this.leaseApplyDetails = []
// }
},
// 获取规格型号
async getMaTypeDataByIdFun(val) {
- const res = await getFourMaTypeList({ id: val, agreementId: this.queryParams.agreementId })
- this.typeListDev = res.data
- console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
- },
- // 选择规格型号
- async changeType(e) {
- console.log('🚀 ~ changeType ~ e:', e)
- if (!e) return
- // 获取选中的规格型号
- const selectType = this.typeListDev.find((item) => item.id == e)
- console.log('🚀 ~ changeType ~ selectType:', selectType)
+ console.log("yyyyyyyyyyy",val)
+ const res = await getFourMaTypeListTwo({ id: val, agreementId: this.queryParams.agreementId })
+ const selectType = res.data
this.selectParams.typeId = selectType.id
this.selectParams.typeCode = selectType.name
this.selectParams.unitNames = selectType.unit
@@ -1207,15 +1199,44 @@ export default {
this.$message.error('当前设备已添加,不可重复添加!')
return
}
- // const { data: outNum } = await getPreAuditNum({
- // typeId: selectType.id,
- // agreementId: this.queryParams.agreementId,
- // })
- // console.log('🚀 ~ deviceTypeChange ~ outNum:', outNum)
- // this.selectParams.outNum = outNum
- this.leaseApplyDetails.push({ ...this.selectParams })
- console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
+
+ this.leaseApplyDetails.unshift({ ...this.selectParams })
},
+ // // 选择规格型号
+ // async changeType(e) {
+ // console.log('🚀 ~ changeType ~ e:', e)
+ // if (!e) return
+ // // 获取选中的规格型号
+ // const selectType = this.typeListDev.find((item) => item.id == e)
+ // console.log('🚀 ~ changeType ~ selectType:', selectType)
+ // this.selectParams.typeId = selectType.id
+ // this.selectParams.typeCode = selectType.name
+ // this.selectParams.unitNames = selectType.unit
+ // this.selectParams.num = selectType.num
+ // this.selectParams.preNum = selectType.num
+ // this.selectParams.useNum = selectType.num
+ // this.selectParams.numList = []
+ // this.selectParams.numIds = []
+ // this.selectParams.standardIds = []
+ // this.selectParams.passMaCodeDtoList = []
+ // this.selectParams.manageType = selectType.manageType
+ // console.log('🚀 ~ changeType ~ this.selectParams:', this.selectParams)
+ // // 判断是否重复
+ // const isRepeat = this.leaseApplyDetails.find((item) => item.typeId == selectType.id)
+ // // console.log('🚀 ~ changeType ~ isRepeat:', isRepeat)
+ // if (isRepeat) {
+ // this.$message.error('当前设备已添加,不可重复添加!')
+ // return
+ // }
+ // // const { data: outNum } = await getPreAuditNum({
+ // // typeId: selectType.id,
+ // // agreementId: this.queryParams.agreementId,
+ // // })
+ // // console.log('🚀 ~ deviceTypeChange ~ outNum:', outNum)
+ // // this.selectParams.outNum = outNum
+ // this.leaseApplyDetails.push({ ...this.selectParams })
+ // console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
+ // },
//// 将数据处理成 表格中需要的数据
handelTableItemData(node) {
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
@@ -1402,11 +1423,11 @@ export default {