领料申请优化
This commit is contained in:
parent
3edf61bbfb
commit
8e9208a438
|
|
@ -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,7 +101,12 @@
|
||||||
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
|
||||||
|
v-for="item in typeListDev"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
|
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
|
||||||
|
|
@ -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)
|
||||||
},
|
},
|
||||||
// 选择规格型号
|
// 选择规格型号
|
||||||
|
|
@ -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 selLable = this.holdingPoleSelList.find((j) => j.id === e)
|
||||||
|
const isPush = this.leaseApplyDetails.some((z) => z.ctParentId == e)
|
||||||
|
|
||||||
|
if (!isPush) {
|
||||||
const wholeTypeNameData = {
|
const wholeTypeNameData = {
|
||||||
id: val,
|
id: e,
|
||||||
wholeTypeName: selLable.wholeTypeName,
|
wholeTypeName: selLable.wholeTypeName,
|
||||||
wholeTypeNum: 1,
|
wholeTypeNum: 1,
|
||||||
childrenList: [],
|
childrenList: [],
|
||||||
}
|
}
|
||||||
queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
|
|
||||||
console.log(res, '996')
|
|
||||||
|
|
||||||
this.leaseApplyDetails.push({ wholeTypeName: selLable.wholeTypeName, childrenList: res.data })
|
queryCompleteSetToolsApi(wholeTypeNameData).then((res) => {
|
||||||
// wholeTypeNameData.childrenList = res.data
|
this.leaseApplyDetails.push({
|
||||||
// wholeTypeNameData.childrenList.forEach((e) => (e.initNum = e.deviceNum))
|
wholeTypeName: selLable.wholeTypeName,
|
||||||
// const isREpeat = this.wholeTypeNameList.find((e) => e.id === val)
|
childrenList: res.data,
|
||||||
// if (!isREpeat) {
|
ctParentId: e,
|
||||||
// this.wholeTypeNameList.push(wholeTypeNameData)
|
|
||||||
// } else {
|
|
||||||
// this.$modal.msgError('当前抱杆成套设备已添加,不可重复添加!')
|
|
||||||
// }
|
|
||||||
// console.log(this.wholeTypeNameList, '处理后的数据---')
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 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)
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue