Merge branch 'dev-sy-9-24'

This commit is contained in:
BianLzhaoMin 2024-09-25 17:36:18 +08:00
commit fc4e3e63de
3 changed files with 87 additions and 43 deletions

View File

@ -927,9 +927,28 @@ export default {
} }
} }
} }
}
this.leaseApplyDetails = [...new Set(tempList)] const newDataList = [...this.leaseApplyDetails, ...tempList]
const map = new Map()
for (let item of newDataList) {
if (!map.has(item.typeId)) {
map.set(item.typeId, item)
}
}
const newArray = [...map.values()]
let newArray_array = []
items.forEach((e) => {
newArray.forEach((j) => {
if (e == j.typeId) {
newArray_array.push(j)
}
})
})
this.leaseApplyDetails = newArray_array
} else {
this.leaseApplyDetails = []
}
// const templateList = deviceTypeList.map((e) => { // const templateList = deviceTypeList.map((e) => {
// let { num, companyId, id, unitName } = e.data // let { num, companyId, id, unitName } = e.data

View File

@ -884,9 +884,11 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.deviceType.forEach((e, index) => { this.deviceType.forEach((e, index) => {
if (e[3] === row.typeId) { if (e[3] == row.typeId) {
this.deviceType.splice(index, 1) this.$nextTick(() => {
this.propsKey++ this.deviceType.splice(index, 1)
this.propsKey++
})
} }
}) })
this.leaseApplyDetails.splice(row.index, 1) this.leaseApplyDetails.splice(row.index, 1)
@ -913,6 +915,7 @@ export default {
/////// ///////
async deviceTypeChange(val) { async deviceTypeChange(val) {
console.log(val, '*******************')
// let nodes = null // let nodes = null
// console.log( // console.log(
// 'vall1211221122', // 'vall1211221122',
@ -955,13 +958,14 @@ export default {
// } // }
// } // }
let tempList = [] let tempList = []
if (val.length > 0) { if (val.length > 0) {
const items = val.map((e) => { const items = val.map((e) => {
return e[3] return e[3]
}) })
for (let i in items) { for (let i in items) {
for (let z in deviceTypeList) { for (let z in deviceTypeList) {
if (deviceTypeList[z].data.typeId === items[i]) { if (deviceTypeList[z].data.typeId == items[i]) {
let { num, companyId, typeId, unitNames } = let { num, companyId, typeId, unitNames } =
deviceTypeList[z].data deviceTypeList[z].data
tempList.push({ tempList.push({
@ -979,9 +983,30 @@ export default {
} }
} }
} }
}
this.leaseApplyDetails = [...new Set(tempList)] 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 = []
}
}, },
//// ////
handelTableItemData(node) { handelTableItemData(node) {

View File

@ -177,19 +177,14 @@
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" label="采购数量" prop="purchaseNum">
align="center"
label="采购数量"
prop="purchaseNum"
type="number"
maxlength="10"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input-number
v-model="scope.row.purchaseNum" type="number"
controls-position="right"
style="width: 100%"
:min="1" :min="1"
clearable
v-model.number="scope.row.purchaseNum"
style="width: 100%"
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
@ -775,36 +770,41 @@ export default {
const items = val.map((e) => { const items = val.map((e) => {
return e[3] return e[3]
}) })
for (let i in items) { for (let i of items) {
for (let z in deviceTypeList) { for (let z of deviceTypeList) {
if (deviceTypeList[z].data.typeId === items[i]) { if (z.data.typeId === i) {
this.$set(deviceTypeList[z].data, 'supplierId', '') const obj = JSON.parse(JSON.stringify(z.data))
this.$set( obj.supplierId = ''
deviceTypeList[z].data, obj.createTime = null
'createTime', obj.productionTime = ''
null, obj.purchasePrice = 0
) obj.purchaseNum = ''
this.$set( tempList.push(obj)
deviceTypeList[z].data,
'productionTime',
'',
)
this.$set(
deviceTypeList[z].data,
'purchasePrice',
0,
)
this.$set(deviceTypeList[z].data, 'purchaseNum', 1)
tempList.push(deviceTypeList[z].data)
break break
} }
} }
} }
}
this.equipmentList = [...new Set(tempList)] const newDataListNew = [...this.equipmentList, ...tempList]
const map = new Map()
for (let item of newDataListNew) {
if (!map.has(item.typeId)) {
map.set(item.typeId, item)
}
}
const newArray = [...map.values()]
let newArray_array = []
items.forEach((e) => {
newArray.forEach((j) => {
if (e == j.typeId) {
newArray_array.push(j)
}
})
})
this.equipmentList = newArray_array
} else {
this.equipmentList = []
}
}, },
}, },
} }