bug修复
This commit is contained in:
parent
b53e36bd21
commit
d52a080379
|
|
@ -237,7 +237,7 @@
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
:disabled="isDetail"
|
:disabled="isDetail"
|
||||||
@change="getTypeList(scope.row, $event)"
|
@change="(selectedIds) => getTypeList(scope.row, selectedIds, scope.$index)"
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
|
|
||||||
<span v-else>{{ scope.row.maTypeName }}</span>
|
<span v-else>{{ scope.row.maTypeName }}</span>
|
||||||
|
|
@ -252,9 +252,9 @@
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择规格型号"
|
placeholder="请选择规格型号"
|
||||||
:disabled="isDetail"
|
:disabled="isDetail"
|
||||||
@change="changeTypeName(scope.row, $event)"
|
@change="(val) => changeTypeName(scope.row, val, getSelectedItemName(val,scope.row))"
|
||||||
>
|
>
|
||||||
<el-option v-for="item in typeList" :key="item.typeId" :label="item.name" :value="item.typeId"></el-option>
|
<el-option v-for="item in scope.row.typeList" :key="item.typeId" :label="item.name" :value="item.typeId"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span v-else>{{ scope.row.typeName }}</span>
|
<span v-else>{{ scope.row.typeName }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -596,10 +596,37 @@ export default {
|
||||||
console.log('🚀 ~ error:', error)
|
console.log('🚀 ~ error:', error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取规格型号
|
// // 获取规格型号
|
||||||
async getTypeList(row, typeIds) {
|
// async getTypeList(row, typeIds) {
|
||||||
// console.log('🚀 ~ getTypeList ~ row:', row)
|
// console.log('🚀 ~ getTypeList ~ row:', row)
|
||||||
// console.log('🚀 ~ getTypeList ~ typeId:', typeIds[typeIds.length - 1])
|
// console.log('🚀 ~ getTypeList ~ typeId:', typeIds[typeIds.length - 1])
|
||||||
|
// // 递归循环 获取类型名称
|
||||||
|
// const filterData = data => {
|
||||||
|
// data.forEach(item => {
|
||||||
|
// if (item.typeId === typeIds[typeIds.length - 1]) {
|
||||||
|
// row.maTypeName = item.typeName
|
||||||
|
// } else {
|
||||||
|
// if (item.children && item.children.length) {
|
||||||
|
// filterData(item.children)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// filterData(this.maTypeList)
|
||||||
|
// console.log('🚀 ~ getTypeList ~ maType:', row)
|
||||||
|
// row.typeId = ''
|
||||||
|
// row.unitName = ''
|
||||||
|
// try {
|
||||||
|
// const res = await getMaTypeOpt({ typeId: typeIds[typeIds.length - 1] })
|
||||||
|
// // console.log('🚀 ~ getMaTypeOpt ~ res:', res)
|
||||||
|
// this.typeList = res.data
|
||||||
|
// } catch (error) {
|
||||||
|
// console.log('🚀 ~ error:', error)
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
async getTypeList(row, typeIds, index) {
|
||||||
|
console.log('🚀 ~ getTypeList ~ row:', row)
|
||||||
|
console.log('🚀 ~ getTypeList ~ typeId:', typeIds[typeIds.length - 1])
|
||||||
// 递归循环 获取类型名称
|
// 递归循环 获取类型名称
|
||||||
const filterData = data => {
|
const filterData = data => {
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
|
|
@ -617,18 +644,53 @@ export default {
|
||||||
row.typeId = ''
|
row.typeId = ''
|
||||||
row.unitName = ''
|
row.unitName = ''
|
||||||
try {
|
try {
|
||||||
|
if (typeIds.length === 0) {
|
||||||
|
// 如果 typeIds 为空,则清空 typeList
|
||||||
|
row.typeList = []
|
||||||
|
return
|
||||||
|
}
|
||||||
const res = await getMaTypeOpt({ typeId: typeIds[typeIds.length - 1] })
|
const res = await getMaTypeOpt({ typeId: typeIds[typeIds.length - 1] })
|
||||||
// console.log('🚀 ~ getMaTypeOpt ~ res:', res)
|
// 将每个条目的规格型号列表存储在各自的 row 对象中
|
||||||
this.typeList = res.data
|
this.equipmentList[index].typeList = res.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('🚀 ~ error:', error)
|
console.log('🚀 ~ error:', error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
getSelectedItemName(typeId,row) {
|
||||||
|
const selectedItem = row.typeList.find(item => item.typeId === typeId);
|
||||||
|
return selectedItem ? selectedItem.name : '';
|
||||||
|
},
|
||||||
//
|
//
|
||||||
changeTypeName(row, val) {
|
changeTypeName(row, val,name) {
|
||||||
// console.log('🚀 ~ changeTypeName ~ row:', row)
|
console.log('🚀 ~ changeTypeName ~ row:', row)
|
||||||
// console.log('🚀 ~ changeTypeName ~ val:', val)
|
console.log('🚀 ~ changeTypeName ~ val:', val)
|
||||||
const type = this.typeList.find(item => item.typeId === val)
|
this.equipmentList.some(item => {
|
||||||
|
// 跳过当前行
|
||||||
|
if (item === row) return false;
|
||||||
|
if (item.typeId === val) {
|
||||||
|
this.$message({
|
||||||
|
message: `${name} 已添加到列表中`,
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
row.typeId = '';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
// console.log('xxxxxxxxxxxxxxxxx', this.equipmentList.some(item => item.typeId === val))
|
||||||
|
// if (this.equipmentList.some(item => item.typeId === val)) {
|
||||||
|
// // console.log("yyyyyyyyyyy",item.typeId)
|
||||||
|
// console.log("zzzzzzzzz",val)
|
||||||
|
// this.$message({
|
||||||
|
// message: `${name} 已添加到列表中`,
|
||||||
|
// type: 'warning'
|
||||||
|
// })
|
||||||
|
// row.typeId = ''
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
const type = row.typeList.find(item => item.typeId === val)
|
||||||
// console.log('🚀 ~ changeTypeName ~ type:', type)
|
// console.log('🚀 ~ changeTypeName ~ type:', type)
|
||||||
row.unitName = type.unitName
|
row.unitName = type.unitName
|
||||||
row.typeName = type.name
|
row.typeName = type.name
|
||||||
|
|
@ -873,7 +935,8 @@ export default {
|
||||||
typeId: '',
|
typeId: '',
|
||||||
typeName: '',
|
typeName: '',
|
||||||
preNum: 0,
|
preNum: 0,
|
||||||
remark: ''
|
remark: '',
|
||||||
|
typeList: []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 保存按钮操作 */
|
/** 保存按钮操作 */
|
||||||
|
|
@ -884,6 +947,10 @@ export default {
|
||||||
this.$refs['maForm'].validate(async valid => {
|
this.$refs['maForm'].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
for (let i = 0; i < this.equipmentList.length; i++) {
|
for (let i = 0; i < this.equipmentList.length; i++) {
|
||||||
|
if(!this.equipmentList[i].typeId){
|
||||||
|
this.$message.error(`第 ${i + 1} 行的 ${'规格型号'} 不能为空`)
|
||||||
|
return
|
||||||
|
}
|
||||||
if (this.equipmentList[i].preNum <= 0) {
|
if (this.equipmentList[i].preNum <= 0) {
|
||||||
this.$message.error(`第 ${i + 1} 行的 ${'预领数量必须大于0'} `)
|
this.$message.error(`第 ${i + 1} 行的 ${'预领数量必须大于0'} `)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -537,9 +537,11 @@ export default {
|
||||||
getReliefList(params).then((response) => {
|
getReliefList(params).then((response) => {
|
||||||
this.pushReviewList = response.data;
|
this.pushReviewList = response.data;
|
||||||
console.log('22222222',this.pushReviewList)
|
console.log('22222222',this.pushReviewList)
|
||||||
this.leaseAll = this.pushReviewList.reduce((total, item) => {
|
this.leaseAll = Number(
|
||||||
|
this.pushReviewList.reduce((total, item) => {
|
||||||
return total + Number(item.leaseMoney);
|
return total + Number(item.leaseMoney);
|
||||||
}, 0);
|
}, 0).toFixed(2)
|
||||||
|
);
|
||||||
let obj = {
|
let obj = {
|
||||||
id:null,
|
id:null,
|
||||||
leaseMoney: this.leaseAll,
|
leaseMoney: this.leaseAll,
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,7 @@ export default {
|
||||||
endTime: this.queryParams.time && this.queryParams.time[1],
|
endTime: this.queryParams.time && this.queryParams.time[1],
|
||||||
pageSize: this.queryParams.pageSize,
|
pageSize: this.queryParams.pageSize,
|
||||||
pageNum: this.queryParams.pageNum,
|
pageNum: this.queryParams.pageNum,
|
||||||
statusList:[this.queryParams.taskStatus]
|
statusList: this.queryParams.taskStatus ? [this.queryParams.taskStatus]:this.dict.type.lease_task_status.map(item => item.value)
|
||||||
};
|
};
|
||||||
getListLeaseApply(params).then((response) => {
|
getListLeaseApply(params).then((response) => {
|
||||||
this.typeList = response.data.rows;
|
this.typeList = response.data.rows;
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="21" style="text-align: right;">
|
<el-col :span="21" style="text-align: right;">
|
||||||
<div style="color: red;">待审核周期:{{ reviewPeriod }}</div>
|
<div style="color: red;">待审核周期:{{ reviewPeriod }}</div>
|
||||||
<div style="color: red;">审核费用(万元):{{ reviewCost }}</div>
|
<div style="color: red;">审核费用(元):{{ reviewCost.toFixed(2) }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
@ -94,7 +94,11 @@
|
||||||
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
|
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
|
<el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="报废费用(万元)" align="center" prop="totalCost" :show-overflow-tooltip="true"/>
|
<el-table-column label="报废费用(元)" align="center" prop="totalCost" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.totalCost.toFixed(2) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="报废类型" align="center" prop="scrapStyle" :show-overflow-tooltip="true"/>
|
<el-table-column label="报废类型" align="center" prop="scrapStyle" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="损坏类型" align="center" prop="scrapType" :show-overflow-tooltip="true">
|
<el-table-column label="损坏类型" align="center" prop="scrapType" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="费用合计"
|
label="费用合计(元)"
|
||||||
align="center"
|
align="center"
|
||||||
prop="totalCost"
|
prop="totalCost"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="费用合计"
|
label="费用合计(元)"
|
||||||
align="center"
|
align="center"
|
||||||
prop="totalCost"
|
prop="totalCost"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
<el-form-item prop="dateRange">
|
<el-form-item prop="dateRange">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="dateRange"
|
v-model="dateRange"
|
||||||
type="datetimerange"
|
type="daterange"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期">
|
end-placeholder="结束日期">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue