Browse Source

长期待摊费用分配表使用占比传给后端的值转为小数

ljb 9 months ago
parent
commit
f74f3a0e0b

+ 1 - 1
src/option/yfCostManage/basicDataSetting/dtCostAllocationList.js

@@ -185,7 +185,7 @@ export default {
       prop: 'syzb',
       type: 'number',
       min: 0,
-      precision: 2,
+      max: 100,
       span: 24,
       width: 80,
       align: 'center',

+ 8 - 1
src/styles/element-ui.scss

@@ -82,7 +82,7 @@
 }
 
 .el-table .el-table__body .el-button--text {
-  padding: 7px 0;
+  padding: 0 0;
 }
 
 .el-table .cell .el-tag {
@@ -115,3 +115,10 @@
     margin-left: 0 !important;
   }
 }
+
+.avue-dialog__footer {
+  z-index: 1;
+}
+.el-drawer .avue-form {
+  padding: 20px 20px 40px;
+}

+ 5 - 4
src/views/yf-cost-manage/basic-data-setting/dt-cost-allocation-list.vue

@@ -153,7 +153,8 @@ export default window.$crudCommon({
       return newParams;
     },
     getFormData() {
-      return { ...this.form, yearAndMonth: this.params.yearAndMonth }
+      let syzb = new Decimal(this.form.syzb || 0).div(100).toNumber();
+      return { ...this.form, syzb,  yearAndMonth: this.params.yearAndMonth }
     },
     validCustom() {
       if (this.form.ctdtfybm && !isAlphanumericCombination(this.form.ctdtfybm)) {
@@ -216,10 +217,10 @@ export default window.$crudCommon({
   // 模块路径
   name: 'yfCostManage/basicDataSetting/dtCostAllocationList',
   res: ({ data }) => {
-    data.records = data.records.map(item => {
-      let ytxeNum = Number(item.ytxe);
+    data.records = data.records.map(item => {      
+      item.syzb = new Decimal(item.syzb || 0).mul(new Decimal(100)).toNumber();
       let syzbNum = new Decimal(Number(item.syzb)).div(new Decimal(100));
-      item.yftxe = new Decimal(ytxeNum).mul(new Decimal(syzbNum)).toFixed(2);
+      item.yftxe = new Decimal(item.ytxe || 0).mul(new Decimal(syzbNum)).toFixed(2);
 
       return item;
     });