领料申请优化

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

View File

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