|
|
@@ -115,6 +115,8 @@ import UploadExcelDialog from "@/components/upload-excel-dialog";
|
|
|
import projectSelect from "@/components/project-select";
|
|
|
import assetSelect from "@/components/asset-select";
|
|
|
import moment from "moment";
|
|
|
+import Decimal from "decimal.js";
|
|
|
+import { isAlphanumericCombination } from "@/util/regex";
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
|
@@ -154,7 +156,7 @@ export default window.$crudCommon({
|
|
|
return { ...this.form, yearAndMonth: this.params.yearAndMonth }
|
|
|
},
|
|
|
validCustom() {
|
|
|
- if (this.form.cqdtfybh && !isAlphanumericCombination(this.form.cgbh)) {
|
|
|
+ if (this.form.ctdtfybm && !isAlphanumericCombination(this.form.ctdtfybm)) {
|
|
|
this.$message.warning("长期待摊费用编号必须是英文字母加数字组合!");
|
|
|
return false;
|
|
|
}
|
|
|
@@ -167,6 +169,13 @@ export default window.$crudCommon({
|
|
|
}
|
|
|
callback && callback();
|
|
|
},
|
|
|
+ updateBefore(loading, callback) {
|
|
|
+ if (!this.validCustom()) {
|
|
|
+ loading();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ callback && callback();
|
|
|
+ },
|
|
|
handleImport() {
|
|
|
let excelParams = { yearAndMonth: this.params.yearAndMonth };
|
|
|
this.$refs.uploadExcelDialog.open('/api/kd-scientific/xm/cqdtfy/import', excelParams);
|
|
|
@@ -207,6 +216,14 @@ export default window.$crudCommon({
|
|
|
// 模块路径
|
|
|
name: 'yfCostManage/basicDataSetting/dtCostAllocationList',
|
|
|
res: ({ data }) => {
|
|
|
+ data.records = data.records.map(item => {
|
|
|
+ let ytxeNum = Number(item.ytxe);
|
|
|
+ let syzbNum = new Decimal(Number(item.syzb)).div(new Decimal(100));
|
|
|
+ item.yftxe = new Decimal(ytxeNum).mul(new Decimal(syzbNum)).toFixed(2);
|
|
|
+
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+
|
|
|
return data;
|
|
|
},
|
|
|
});
|