领料申请优化

This commit is contained in:
BianLzhaoMin 2025-03-10 13:31:53 +08:00
parent 3edf61bbfb
commit 8e9208a438
2 changed files with 74 additions and 27 deletions

View File

@ -59,11 +59,14 @@
</el-form-item>
<el-form-item label="成套设备" prop="agreementCode">
<el-select
multiple
clearable
style="width: 240px"
placeholder="请选择成套设备"
@change="onChangeWholeTypeName"
@remove-tag="onRemoveTag"
v-model="queryParams.wholeTypeName"
ref="WholeTypeRef"
>
<el-option
v-for="item in holdingPoleSelList"
@ -98,7 +101,12 @@
placeholder="请选择规格型号"
@change="changeType"
>
<el-option v-for="item in typeListDev" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-option
v-for="item in typeListDev"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
@ -218,7 +226,10 @@
<el-table-column label="序号" type="index" width="80" />
<el-table-column type="expand">
<template slot-scope="props">
<el-table :data="props.row.childrenList">
<el-table
:data="props.row.childrenList"
v-if="props.row.childrenList && props.row.childrenList.length > 0"
>
<!-- <el-table-column align="center" prop="typeName" label="设备名称" /> -->
<el-table-column align="center" label="规格型号" prop="deviceType" />
<el-table-column prop="deviceType" align="center" label="是否管理库存">
@ -868,6 +879,8 @@ export default {
typeId: j.deviceTypeId,
preNum: j.deviceNum,
num: j.num,
isCt: 0,
ctParentId: e.ctParentId,
}
this.queryParams.leaseApplyDetails.push(items)
@ -987,7 +1000,7 @@ export default {
createBy: this.user.name,
companyId: deviceTypeList[0].data.companyId,
// num: deviceTypeList[0].data.num,
typeCn: deviceTypeList[0].data.label
typeCn: deviceTypeList[0].data.label,
}
console.log('🚀 ~ deviceTypeChange ~ this.selectParams:', this.selectParams)
this.getMaTypeDataByIdFun(val[val.length - 1])
@ -1025,7 +1038,7 @@ export default {
//
async getMaTypeDataByIdFun(val) {
const res = await getMaTypeDataById({ id: val })
this.typeListDev = res.data
this.typeListDev = res.data.filter((e) => e.isStorage == 1)
console.log('🚀 ~ getMaTypeDataByIdFun ~ res:', res)
},
//
@ -1047,7 +1060,7 @@ export default {
this.$message.error('当前设备已添加,不可重复添加!')
return
}
this.leaseApplyDetails.push({...this.selectParams})
this.leaseApplyDetails.push({ ...this.selectParams })
console.log('🚀 ~ changeType ~ this.leaseApplyDetails:', this.leaseApplyDetails)
},
////
@ -1102,31 +1115,61 @@ export default {
},
/* 抱杆成套设备change事件 */
onChangeWholeTypeName(val) {
const selLable = this.holdingPoleSelList.find((e) => e.id === val)
val.forEach((e) => {
const selLable = this.holdingPoleSelList.find((j) => j.id === e)
const isPush = this.leaseApplyDetails.some((z) => z.ctParentId == e)
if (!isPush) {
const wholeTypeNameData = {
id: val,
id: e,
wholeTypeName: selLable.wholeTypeName,
wholeTypeNum: 1,
childrenList: [],
}
queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
console.log(res, '996')
this.leaseApplyDetails.push({ wholeTypeName: selLable.wholeTypeName, childrenList: res.data })
// wholeTypeNameData.childrenList = res.data
// wholeTypeNameData.childrenList.forEach((e) => (e.initNum = e.deviceNum))
// const isREpeat = this.wholeTypeNameList.find((e) => e.id === val)
// if (!isREpeat) {
// this.wholeTypeNameList.push(wholeTypeNameData)
// } else {
// this.$modal.msgError('')
// }
// console.log(this.wholeTypeNameList, '---')
queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
this.leaseApplyDetails.push({
wholeTypeName: selLable.wholeTypeName,
childrenList: res.data,
ctParentId: e,
})
})
}
})
// const selLable = this.holdingPoleSelList.find((e) => e.id === val)
// const wholeTypeNameData = {
// id: val,
// wholeTypeName: selLable.wholeTypeName,
// wholeTypeNum: 1,
// childrenList: [],
// }
// queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
// console.log(res, '996')
// this.leaseApplyDetails.push({
// wholeTypeName: selLable.wholeTypeName,
// childrenList: res.data,
// ctParentId: val,
// })
// // wholeTypeNameData.childrenList = res.data
// // wholeTypeNameData.childrenList.forEach((e) => (e.initNum = e.deviceNum))
// // const isREpeat = this.wholeTypeNameList.find((e) => e.id === val)
// // if (!isREpeat) {
// // this.wholeTypeNameList.push(wholeTypeNameData)
// // } else {
// // this.$modal.msgError('')
// // }
// // console.log(this.wholeTypeNameList, '---')
// })
// this.queryParams.wholeTypeName = ''
},
//
onRemoveTag(val) {
this.leaseApplyDetails = this.leaseApplyDetails.filter((e) => e.ctParentId !== val)
},
/* 删除 */
onHandelDelete(index) {
this.wholeTypeNameList.splice(index, 1)

View File

@ -299,6 +299,8 @@ export default {
mainDevice: '',
assortDevice: '',
}
this.$delete(this.saveParams, 'id')
this.tempList = []
this.mainDeviceDisabled = false
this.open = true
@ -310,6 +312,7 @@ export default {
this.saveParams.id = row.id
this.parentId = row.id
this.saveParams.wholeTypeName = row.wholeTypeName
this.deviceName = row.wholeTypeName
this.mainDeviceDisabled = true
this.isEdit = true
@ -374,7 +377,8 @@ export default {
this.parentId = value
const res = await getInfoListByTypeApi({ level: '4', parentId: value + '' })
this.lastTypesList = res.data
console.log(res, '第四级数据')
this.tempList = []
this.addCompleteForm.assortDevice = ''
},
//
selAssortDevice(val) {
@ -460,7 +464,7 @@ export default {
const res = await addCompleteSetToolsApi(this.saveParams)
if (res.code == 200) {
this.$message.success(!this.title === '成套设备新增' ? '新增成功!' : '修改成功!')
this.$message.success(this.title === '成套设备新增' ? '新增成功!' : '修改成功!')
this.open = false
this.tempList = []
this.getList()