|
|
@@ -76,6 +76,7 @@ import NProgress from 'nprogress';
|
|
|
import 'nprogress/nprogress.css';
|
|
|
import {getToken} from "@/util/auth";
|
|
|
import {downloadXls} from "@/util/util";
|
|
|
+import Decimal from "decimal.js";
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
|
@@ -103,13 +104,6 @@ export default window.$crudCommon({
|
|
|
submitBtn: false,
|
|
|
emptyBtn: false,
|
|
|
column: [
|
|
|
- // {
|
|
|
- // label: '上传月份',
|
|
|
- // prop: 'yearAndMonth',
|
|
|
- // type: 'input',
|
|
|
- // span: 24,
|
|
|
- // disabled: true,
|
|
|
- // },
|
|
|
{
|
|
|
label: '模板上传',
|
|
|
prop: 'excelFile',
|
|
|
@@ -145,6 +139,7 @@ export default window.$crudCommon({
|
|
|
if (!!item) {
|
|
|
this.form = {
|
|
|
...this.form,
|
|
|
+ name: item.name,
|
|
|
number: item.number,
|
|
|
identityCard: item.identityCard,
|
|
|
department: item.department,
|
|
|
@@ -159,36 +154,13 @@ export default window.$crudCommon({
|
|
|
methods: {
|
|
|
handleBeforeOpen(done, type) {
|
|
|
this.option.column.forEach(item => {
|
|
|
- if (item.prop == "name") {
|
|
|
- item.dicUrl = '/api/kd-scientific/technician/page';
|
|
|
- item.dicQuery.yearAndMonth = moment(this.params.yearAndMonth).subtract(1, 'year').format('YYYY');
|
|
|
+ if (item.prop == "name") {
|
|
|
+ item.dicUrl = '/api/kd-scientific/technician/page';
|
|
|
+ item.dicQuery.yearAndMonth = this.params.yearAndMonth;
|
|
|
}
|
|
|
});
|
|
|
- // this.option = { ...this.option };
|
|
|
- // console.log(this.option)
|
|
|
done();
|
|
|
},
|
|
|
- validCustom() {
|
|
|
- if (!this.form.number && !this.form.identityCard) {
|
|
|
- this.$message.warning("工号和身份证号必须填写一项!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- },
|
|
|
- addBefore(loading, callback) {
|
|
|
- if (!this.validCustom()) {
|
|
|
- loading();
|
|
|
- return;
|
|
|
- }
|
|
|
- callback && callback();
|
|
|
- },
|
|
|
- updateBefore(loading, callback) {
|
|
|
- if (!this.validCustom()) {
|
|
|
- loading();
|
|
|
- return false;
|
|
|
- }
|
|
|
- callback && callback();
|
|
|
- },
|
|
|
handleImport() {
|
|
|
this.excelBox = true;
|
|
|
this.excelForm.yearAndMonth = this.params.yearAndMonth;
|
|
|
@@ -238,6 +210,26 @@ export default window.$crudCommon({
|
|
|
},
|
|
|
}, {
|
|
|
// 模块路径
|
|
|
- name: 'technicianMonthAvgSales'
|
|
|
+ name: 'technicianMonthAvgSales',
|
|
|
+ res: ({ data }) => {
|
|
|
+ data.records = data.records.map(item => {
|
|
|
+ let pensionInsurance = new Decimal(item.pensionInsurance || 0);
|
|
|
+ let medicalInsurance = new Decimal(item.medicalInsurance || 0);
|
|
|
+ let unemploymentInsurance = new Decimal(item.unemploymentInsurance || 0);
|
|
|
+ let injuryInsurance = new Decimal(item.injuryInsurance || 0);
|
|
|
+ let maternityInsurance = new Decimal(item.maternityInsurance || 0);
|
|
|
+ let providentFund = new Decimal(item.providentFund || 0);
|
|
|
+
|
|
|
+ // 社保合计
|
|
|
+ let socialInsurance = pensionInsurance.add(medicalInsurance).add(unemploymentInsurance).add(injuryInsurance).add(maternityInsurance);
|
|
|
+ // 总计
|
|
|
+ let total = socialInsurance.add(providentFund);
|
|
|
+
|
|
|
+ item.socialInsurance = socialInsurance.toFixed(2);
|
|
|
+ item.total = total.toFixed(2);
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ return data;
|
|
|
+ },
|
|
|
});
|
|
|
</script>
|