|
|
@@ -16,7 +16,7 @@
|
|
|
plain
|
|
|
@click="handleDelete"
|
|
|
>
|
|
|
- 删 除
|
|
|
+ 清除工资数据
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="success"
|
|
|
@@ -90,6 +90,11 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
excelBox: false,
|
|
|
excelForm: {},
|
|
|
+
|
|
|
+ operateType: '',
|
|
|
+ watchUpdateKey: ["averageMonthlySalary", "pensionInsurance", "medicalInsurance", "unemploymentInsurance", "injuryInsurance", "maternityInsurance", "providentFund"],
|
|
|
+ beforeUpdatedData: {},
|
|
|
+ updatedFormData: {},
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -103,6 +108,7 @@ export default window.$crudCommon({
|
|
|
return {
|
|
|
submitBtn: false,
|
|
|
emptyBtn: false,
|
|
|
+
|
|
|
column: [
|
|
|
{
|
|
|
label: '模板上传',
|
|
|
@@ -153,6 +159,8 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
methods: {
|
|
|
handleBeforeOpen(done, type) {
|
|
|
+ this.operateType = type;
|
|
|
+ this.beforeUpdatedData = { ...this.form };
|
|
|
this.option.column.forEach(item => {
|
|
|
if (item.prop == "name") {
|
|
|
item.dicUrl = '/api/kd-scientific/technician/page';
|
|
|
@@ -161,6 +169,30 @@ export default window.$crudCommon({
|
|
|
});
|
|
|
done();
|
|
|
},
|
|
|
+ getFormData() {
|
|
|
+ if (this.operateType === 'edit') {
|
|
|
+ return this.updatedFormData
|
|
|
+ }
|
|
|
+ return this.form;
|
|
|
+ },
|
|
|
+ updateBefore(loading, callback) {
|
|
|
+ let updatedData = {};
|
|
|
+ this.watchUpdateKey.forEach(key => {
|
|
|
+ if (Number(this.form[key]) != Number(this.beforeUpdatedData[key])) {
|
|
|
+ updatedData[key] = this.form[key];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.updatedFormData = {
|
|
|
+ number: this.form.number,
|
|
|
+ identityCard: this.form.identityCard,
|
|
|
+ yearAndMonth: this.params.yearAndMonth,
|
|
|
+ ...updatedData
|
|
|
+ };
|
|
|
+ callback && callback();
|
|
|
+ },
|
|
|
+ getDelParams(row) {
|
|
|
+ return { yearAndMonth: this.params.yearAndMonth, number: row.number, identityCard: row.identityCard }
|
|
|
+ },
|
|
|
handleImport() {
|
|
|
this.excelBox = true;
|
|
|
this.excelForm.yearAndMonth = this.params.yearAndMonth;
|
|
|
@@ -179,7 +211,7 @@ export default window.$crudCommon({
|
|
|
}).then(() => {
|
|
|
NProgress.start();
|
|
|
exportBloByPost(`/api/kd-scientific/salary/export-salary?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
- downloadXls(res.data, `技术人员上一年度平均工资${this.params.yearAndMonth}.xlsx`);
|
|
|
+ downloadXls(res.data, `技术人员${this.params.yearAndMonth}年度平均工资.xlsx`);
|
|
|
NProgress.done();
|
|
|
})
|
|
|
});
|