|
|
|
|
@ -31,9 +31,9 @@ |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #standardType="scope"> |
|
|
|
|
<el-tag v-if="scope.row.standardType == 1" type="success">军品</el-tag> |
|
|
|
|
<el-tag v-if="scope.row.standardType == 2" type="danger">非军品</el-tag> |
|
|
|
|
<el-tag v-if="scope.row.standardType == 3">通用</el-tag> |
|
|
|
|
<el-tag v-if="scope.row.standardType == '2'" type="success">军品</el-tag> |
|
|
|
|
<el-tag v-if="scope.row.standardType == '3'" type="danger">非军品</el-tag> |
|
|
|
|
<el-tag v-if="scope.row.standardType == '1'">通用</el-tag> |
|
|
|
|
</template> |
|
|
|
|
<!-- 工序选择 --> |
|
|
|
|
<template #processId-form="{ type, disabled }"> |
|
|
|
|
@ -86,9 +86,9 @@ |
|
|
|
|
</avue-crud> |
|
|
|
|
<!-- 导入 --> |
|
|
|
|
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" |
|
|
|
|
templateUrl="/blade-desk/QA/CycleTestItem/download-excel-template" |
|
|
|
|
templateName="试验项目模板.xls" |
|
|
|
|
importUrl="/blade-desk/QA/CycleTestItem/import-excel" |
|
|
|
|
templateUrl="/blade-desk/bsSalaryStandard/download-excel-template" |
|
|
|
|
templateName="工资维护标准模板.xls" |
|
|
|
|
importUrl="/blade-desk/bsSalaryStandard/import-excel" |
|
|
|
|
@closeDialog="closeDialog"></basic-import> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
@ -96,6 +96,7 @@ |
|
|
|
|
<script> |
|
|
|
|
import basicImport from '@/components/basic-import/main.vue' |
|
|
|
|
import {getProcessList,getList,deleteTable,addTable } from "@/api/performanceManagement/salaryManagement" |
|
|
|
|
import { fa } from 'element-plus/es/locales.mjs'; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
basicImport, |
|
|
|
|
@ -182,9 +183,9 @@ export default { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
dicData: [ |
|
|
|
|
{ label: "军品", value: 1 }, |
|
|
|
|
{ label: "非军品", value: 2 }, |
|
|
|
|
{ label: "通用", value: 3 }, |
|
|
|
|
{ label: "军品", value: '2' }, |
|
|
|
|
{ label: "非军品", value: '3' }, |
|
|
|
|
{ label: "通用", value: '1' }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
@ -269,9 +270,9 @@ export default { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
dicData: [ |
|
|
|
|
{ label: "件", value: 1 }, |
|
|
|
|
{ label: "批", value: 2 }, |
|
|
|
|
{ label: "面积", value: 3 }, |
|
|
|
|
{ label: "件", value: '1' }, |
|
|
|
|
{ label: "批", value: '2' }, |
|
|
|
|
{ label: "面积", value: '3' }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
@ -323,8 +324,8 @@ export default { |
|
|
|
|
overHidden: true, |
|
|
|
|
width: 100, |
|
|
|
|
dicData: [ |
|
|
|
|
{ label: "件", value: 1 }, |
|
|
|
|
{ label: "面积", value: 2 }, |
|
|
|
|
{ label: "件", value: '1' }, |
|
|
|
|
{ label: "面积", value: '2' }, |
|
|
|
|
], |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
@ -372,8 +373,8 @@ export default { |
|
|
|
|
overHidden: true, |
|
|
|
|
width: 120, |
|
|
|
|
dicData: [ |
|
|
|
|
{ label: "批", value: 1 }, |
|
|
|
|
{ label: "倍", value: 2 }, |
|
|
|
|
{ label: "批", value: '1' }, |
|
|
|
|
{ label: "倍", value: '2' }, |
|
|
|
|
], |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
@ -426,7 +427,7 @@ export default { |
|
|
|
|
this.option.column.find(item => item.prop == "stepSettlementPrice").rules[0].required = false |
|
|
|
|
this.option.column.find(item => item.prop == "stepSettlementUnit").rules[0].required = false |
|
|
|
|
}else if(val == 2){ |
|
|
|
|
this.form.step = '' |
|
|
|
|
this.form.step = 0 |
|
|
|
|
this.option.column.find(item => item.prop == "step").rules[0].required = false |
|
|
|
|
this.option.column.find(item => item.prop == "stepUnit").rules[0].required = true |
|
|
|
|
this.option.column.find(item => item.prop == "stepSettlementPrice").rules[0].required = true |
|
|
|
|
@ -470,28 +471,69 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowSpan(key, parent) { |
|
|
|
|
let list = []; |
|
|
|
|
let list = []; |
|
|
|
|
let position = 0; |
|
|
|
|
|
|
|
|
|
// 遍历数据进行合并计算 |
|
|
|
|
this.data.forEach((item, index) => { |
|
|
|
|
if (index === 0) { |
|
|
|
|
// 第一行,初始化合并数为1 |
|
|
|
|
list.push(1); |
|
|
|
|
let position = 0; |
|
|
|
|
position = 0; |
|
|
|
|
} else { |
|
|
|
|
if (this.data[index][key] === this.data[index - 1][key]) { |
|
|
|
|
const prevItem = this.data[index - 1]; |
|
|
|
|
const currentItem = item; |
|
|
|
|
|
|
|
|
|
// 核心修改点: |
|
|
|
|
// 1. 判断当前列的值是否相同: currentItem[key] === prevItem[key] |
|
|
|
|
// 2. 判断是否属于同一个分组(即ID是否相同): currentItem.id === prevItem.id |
|
|
|
|
// 注意:请确保你的数据对象中有 'id' 字段,如果没有,请替换为实际的分组字段名 |
|
|
|
|
const isSameValue = currentItem[key] === prevItem[key]; |
|
|
|
|
const isSameGroup = currentItem.id === prevItem.id; |
|
|
|
|
|
|
|
|
|
// 只有当【值相同】且【属于同一组(ID相同)】时,才尝试合并 |
|
|
|
|
if (isSameValue && isSameGroup) { |
|
|
|
|
// 如果有父级合并逻辑(多列联动合并),需检查父级是否在同一合并块中 |
|
|
|
|
if (parent && parent[index] !== 0) { |
|
|
|
|
// 父级断开了,子级也必须断开 |
|
|
|
|
list.push(1); |
|
|
|
|
position = index; |
|
|
|
|
} else { |
|
|
|
|
// 继续合并 |
|
|
|
|
list[position] += 1; |
|
|
|
|
list.push(0); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 值不同 或 ID不同,断开合并,重新开始计数 |
|
|
|
|
list.push(1); |
|
|
|
|
position = index; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return list; |
|
|
|
|
|
|
|
|
|
// let list = []; |
|
|
|
|
// let position = 0; |
|
|
|
|
// this.data.forEach((item, index) => { |
|
|
|
|
// if (index === 0) { |
|
|
|
|
// list.push(1); |
|
|
|
|
// let position = 0; |
|
|
|
|
// } else { |
|
|
|
|
// if (this.data[index][key] === this.data[index - 1][key]) { |
|
|
|
|
// if (parent && parent[index] !== 0) { |
|
|
|
|
// list.push(1); |
|
|
|
|
// position = index; |
|
|
|
|
// } else { |
|
|
|
|
// list[position] += 1; |
|
|
|
|
// list.push(0); |
|
|
|
|
// } |
|
|
|
|
// } else { |
|
|
|
|
// list.push(1); |
|
|
|
|
// position = index; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// return list; |
|
|
|
|
}, |
|
|
|
|
spanMethod({ row, column, rowIndex, columnIndex }) { |
|
|
|
|
for (let i = 0; i < this.spanArr.length; i++) { |
|
|
|
|
@ -527,7 +569,7 @@ export default { |
|
|
|
|
if(type == 'add'){ |
|
|
|
|
this.form = { |
|
|
|
|
...this.form, |
|
|
|
|
settlementUnit:1 |
|
|
|
|
settlementUnit:'1' |
|
|
|
|
} |
|
|
|
|
done() |
|
|
|
|
}else{ |
|
|
|
|
@ -540,24 +582,81 @@ export default { |
|
|
|
|
if(row.stepType == 2){ |
|
|
|
|
let stepSettlementPriceArr = row.stepSettlementPrice.split(' ') |
|
|
|
|
if(stepSettlementPriceArr.length > 1){ |
|
|
|
|
this.$message.error('【固定补贴金额】时,阶梯结算价应只有一个') |
|
|
|
|
this.$message.error('阶梯结算价与阶梯不一致') |
|
|
|
|
loading() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
}else if(row.stepType == 3){ |
|
|
|
|
let stepArr = row.step.split(' ') |
|
|
|
|
let stepSettlementPriceArr = row.stepSettlementPrice.split(' ') |
|
|
|
|
stepArr = stepArr.filter(item => item != '') |
|
|
|
|
stepSettlementPriceArr = stepSettlementPriceArr.filter(item => item != '') |
|
|
|
|
console.log('stepArr',stepArr) |
|
|
|
|
console.log('stepSettlementPriceArr',stepSettlementPriceArr.length) |
|
|
|
|
if(stepArr.length > 0 && stepSettlementPriceArr.length > 0 && stepSettlementPriceArr.length - stepArr.length != 1){ |
|
|
|
|
this.$message.error('【阶梯补贴金额】时,阶梯结算价应比阶梯上下限数量多一个') |
|
|
|
|
this.$message.error('阶梯结算价与阶梯不一致') |
|
|
|
|
loading() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// 2. 新增校验:阶梯值必须递增 |
|
|
|
|
for (let i = 0; i < stepArr.length - 1; i++) { |
|
|
|
|
if (stepArr[i+1] <= stepArr[i]) { |
|
|
|
|
this.$message.error('【阶梯上下限】配置错误:后一个阶梯值必须大于前一个阶梯值'); |
|
|
|
|
loading(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
done(); |
|
|
|
|
addTable(row).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
} |
|
|
|
|
}).catch(err =>{ |
|
|
|
|
loading() |
|
|
|
|
done(); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 修改数据 |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
done(); |
|
|
|
|
console.log('row---------------',row) |
|
|
|
|
if(row.stepType == 2){ |
|
|
|
|
let stepSettlementPriceArr = row.stepSettlementPrice.split(' ') |
|
|
|
|
if(stepSettlementPriceArr.length > 1){ |
|
|
|
|
this.$message.error('【固定补贴金额】时,阶梯结算价应只有一个') |
|
|
|
|
loading() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
}else if(row.stepType == 3){ |
|
|
|
|
let stepArr = row.step.split(' ') |
|
|
|
|
let stepSettlementPriceArr = row.stepSettlementPrice.split(' ') |
|
|
|
|
console.log('stepArr',stepArr.length) |
|
|
|
|
console.log('stepSettlementPriceArr',stepSettlementPriceArr.length) |
|
|
|
|
if(stepArr.length > 0 && stepSettlementPriceArr.length > 0 && stepSettlementPriceArr.length - stepArr.length != 1){ |
|
|
|
|
this.$message.error('【阶梯补贴金额】时,阶梯结算价应比阶梯上下限数量多一个') |
|
|
|
|
loading() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// 2. 新增校验:阶梯值必须递增 |
|
|
|
|
for (let i = 0; i < stepArr.length - 1; i++) { |
|
|
|
|
if (stepArr[i+1] <= stepArr[i]) { |
|
|
|
|
this.$message.error('【阶梯上下限】配置错误:后一个阶梯值必须大于前一个阶梯值'); |
|
|
|
|
loading(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
addTable(row).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
} |
|
|
|
|
}).catch(err =>{ |
|
|
|
|
loading() |
|
|
|
|
done(); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 批量删除 |
|
|
|
|
handleDelete() { |
|
|
|
|
@ -611,13 +710,25 @@ export default { |
|
|
|
|
handleImport() { |
|
|
|
|
this.isShowImport = true |
|
|
|
|
}, |
|
|
|
|
closeDialog(val){ |
|
|
|
|
this.isShowImport = false |
|
|
|
|
if(val){ |
|
|
|
|
this.onLoad() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
this.loading = true |
|
|
|
|
getList({ |
|
|
|
|
curremt:this.page.currentPage, |
|
|
|
|
current:this.page.currentPage, |
|
|
|
|
size:this.page.pageSize, |
|
|
|
|
...this.query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
res.data.data.records.forEach(item => { |
|
|
|
|
item.minStep = item.minStep == -1 ? '' : item.minStep |
|
|
|
|
item.maxStep = item.maxStep == -1 ? '' : item.maxStep |
|
|
|
|
item.stepSettlementPrice = item.stepSettlementPrice == -1 ? '' : item.stepSettlementPrice |
|
|
|
|
item.price = item.price == -1 ? '' : item.price |
|
|
|
|
}) |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.page.total = res.data.data.total |
|
|
|
|
// this.$nextTick(() =>{ |
|
|
|
|
|