浏览代码

fix:修改结算单、验收单价格精度

lazy 3 周之前
父节点
当前提交
4b2ad51d53

+ 24 - 5
src/views/financingManage/components/ApplyFinancing.vue

@@ -158,7 +158,7 @@
 
 <script>
 import { validMail } from '@/utils/validate'
-import { getUuid } from '@/utils'
+import { getUuid, formatMoney } from '@/utils'
 export default {
   name: 'ApplyFinancing',
   props: {
@@ -302,16 +302,25 @@ export default {
         },
         {
           label: '参考价格',
-          prop: 'referencePrice'
+          prop: 'referencePrice',
+          render: (h, row) => {
+            return <div>{ this.formatMoney(row.referencePrice, 4) }</div>
+          }
         },
         {
           label: '浮动价格',
-          prop: 'floatingPrice'
+          prop: 'floatingPrice',
+          render: (h, row) => {
+            return <div>{ this.formatMoney(row.floatingPrice, 4) }</div>
+          }
         },
         {
           label: '销售单价(元)',
           prop: 'salesPrice',
-          width: '140'
+          width: '140',
+          render: (h, row) => {
+            return <div>{ this.formatMoney(row.salesPrice, 4) }</div>
+          }
         },
         {
           label: '销售总价(元)',
@@ -326,7 +335,10 @@ export default {
         {
           label: '采购单价(元)',
           prop: 'purchasePrice',
-          width: '140'
+          width: '140',
+          render: (h, row) => {
+            return <div>{ this.formatMoney(row.purchasePrice, 4) }</div>
+          }
         },
         {
           label: '采购总价(元)',
@@ -454,6 +466,13 @@ export default {
       goodsLoading: false
     }
   },
+  computed: {
+    formatMoney() {
+      return (val, reserveNum) => {
+        return formatMoney(val, reserveNum)
+      }
+    }
+  },
   watch: {
     detailsInfo: {
       handler(newV) {

+ 26 - 5
src/views/settlementManagement/components/add.vue

@@ -49,12 +49,28 @@
           <el-table-column prop="goodsType" label="型号" show-overflow-tooltip/>
           <el-table-column prop="goodsUnit" label="单位" show-overflow-tooltip/>
           <el-table-column prop="goodsQuantity" label="数量" show-overflow-tooltip/>
-          <el-table-column prop="referencePrice" label="参考价格" show-overflow-tooltip/>
-          <el-table-column prop="floatingPrice" label="浮动价格" show-overflow-tooltip/>
-          <el-table-column prop="salesPrice" label="销售单价" show-overflow-tooltip/>
+          <el-table-column prop="referencePrice" label="参考价格" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.referencePrice, 4) }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="floatingPrice" label="浮动价格" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.floatingPrice, 4) }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="salesPrice" label="销售单价" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.salesPrice, 4) }}</div>
+            </template>
+          </el-table-column>
           <el-table-column prop="salesTotalPrice" label="销售总价" show-overflow-tooltip/>
           <el-table-column prop="salesGuaranteeMoney" label="销售质保金" show-overflow-tooltip/>
-          <el-table-column prop="purchasePrice" label="采购单价" show-overflow-tooltip/>
+          <el-table-column prop="purchasePrice" label="采购单价" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.purchasePrice, 4) }}</div>
+            </template>
+          </el-table-column>
           <el-table-column prop="purchaseTotalPrice" label="采购总价" show-overflow-tooltip/>
           <el-table-column prop="purchaseGuaranteeMoney" label="采购质保金" show-overflow-tooltip/>
         </el-table>
@@ -135,7 +151,7 @@
 
 <script>
 import request from '@/utils/request'
-import { handleMoney, fourMoney } from '@/utils'
+import { handleMoney, fourMoney, formatMoney } from '@/utils'
 
 export default {
   name: 'AddSettlement',
@@ -349,6 +365,11 @@ export default {
     },
     changeNum3() {
       return handleMoney(this.buyTotalPrice)
+    },
+    formatMoney() {
+      return (val, reserveNum) => {
+        return formatMoney(val, reserveNum)
+      }
     }
   },
   watch: {

+ 28 - 7
src/views/settlementManagement/components/edit.vue

@@ -18,7 +18,7 @@
         <el-input v-model="ruleForm.businessNumber" disabled />
       </el-form-item>
       <el-form-item label="经办人(供应商)" prop="operatorSupplier" required>
-        <el-input v-model="ruleForm.operatorSupplier" placeholder="请输入经办人(供应商)" /> 
+        <el-input v-model="ruleForm.operatorSupplier" placeholder="请输入经办人(供应商)" />
       </el-form-item>
       <cy-info-title style="margin-top: 15px;">货物信息(下游结算)
         <span style="font-size: 12px; color: #A3A8AC;">单位:元</span>
@@ -40,12 +40,28 @@
           <el-table-column prop="goodsType" label="型号" show-overflow-tooltip/>
           <el-table-column prop="goodsUnit" label="单位" show-overflow-tooltip/>
           <el-table-column prop="goodsQuantity" label="数量" show-overflow-tooltip/>
-          <el-table-column prop="referencePrice" label="参考价格" show-overflow-tooltip/>
-          <el-table-column prop="floatingPrice" label="浮动价格" show-overflow-tooltip/>
-          <el-table-column prop="salesPrice" label="销售单价" show-overflow-tooltip/>
+          <el-table-column prop="referencePrice" label="参考价格" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.referencePrice, 4) }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="floatingPrice" label="浮动价格" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.floatingPrice, 4) }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="salesPrice" label="销售单价" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.salesPrice, 4) }}</div>
+            </template>
+          </el-table-column>
           <el-table-column prop="salesTotalPrice" label="销售总价" show-overflow-tooltip/>
           <el-table-column prop="salesGuaranteeMoney" label="销售质保金" show-overflow-tooltip/>
-          <el-table-column prop="purchasePrice" label="采购单价" show-overflow-tooltip/>
+          <el-table-column prop="purchasePrice" label="采购单价" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div>{{ formatMoney(scope.row.purchasePrice, 4) }}</div>
+            </template>
+          </el-table-column>
           <el-table-column prop="purchaseTotalPrice" label="采购总价" show-overflow-tooltip/>
           <el-table-column prop="purchaseGuaranteeMoney" label="采购质保金" show-overflow-tooltip/>
         </el-table>
@@ -74,7 +90,7 @@
 
 <script>
 import request from '@/utils/request'
-import { handleMoney, fourMoney } from '@/utils'
+import { handleMoney, fourMoney, formatMoney } from '@/utils'
 
 export default {
   name: 'AddSettlement',
@@ -163,6 +179,11 @@ export default {
     },
     changeNum3() {
       return handleMoney(this.buyTotalPrice)
+    },
+    formatMoney() {
+      return (val, reserveNum) => {
+        return formatMoney(val, reserveNum)
+      }
     }
   },
   watch: {
@@ -205,4 +226,4 @@ export default {
     }
   }
 }
-</style>
+</style>