Browse Source

修改金额格式

chenrui 2 years ago
parent
commit
f44aee71ff

+ 2 - 2
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -151,7 +151,6 @@ import chooseDepartUserModal from './chooseDepartUserModal.vue'
 import reviewProgressModal from './reviewProgressModal.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { toThousands } from '@/libs/tools.js'
 import supplier from '@/views/common/supplier.js'
 import { sparePartsReturnList, sparePartsReturnDelete, sparePartsReturnExportDetail, againSubmit } from '@/api/sparePartsReturn'
 export default {
@@ -202,6 +201,7 @@ export default {
   },
   computed: {
     columns () {
+      let _this=this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -214,7 +214,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '9%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  售价权限
-        arr.splice(6, 0, { title: '退货金额', dataIndex: 'totalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? toThousands(text, 2) : '--') } })
+        arr.splice(6, 0, { title: '退货金额', dataIndex: 'totalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr
     }

+ 4 - 4
src/views/purchasingManagement/purchaseReturn/purchaseReturnDeatil.vue

@@ -146,7 +146,6 @@ import {
   sparePartsReturnInfo,
   sparePartsReturnDetailSaveBatch
 } from '@/api/sparePartsReturn'
-import { toThousands } from '@/libs/tools.js'
 export default {
   name: 'PurchaseReturnEdit',
   mixins: [commonMixin],
@@ -196,6 +195,7 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
         {
@@ -254,7 +254,7 @@ export default {
           width: '8%',
           align: 'right',
           customRender: function (text) {
-            return text || text == 0 ? toThousands(text, 2) : '--'
+            return text || text == 0 ? _this.toThousands(text, 2) : '--'
           }
         })
         arr.splice(8, 0, {
@@ -263,7 +263,7 @@ export default {
           width: '8%',
           align: 'right',
           customRender: function (text) {
-            return text || text == 0 ? toThousands(text, 2) : '--'
+            return text || text == 0 ? _this.toThousands(text, 2) : '--'
           }
         })
       }
@@ -470,7 +470,7 @@ export default {
       queryPageCount({ sparePartsReturnSn: this.sparePartsReturnSn }).then(res => {
         if (res.status == 200) {
           if (res.data) {
-            res.data.totalCost = res.data && (res.data.totalCost || res.data.totalCost == 0) ? toThousands(res.data.totalCost, 2) : '--'
+            res.data.totalCost = res.data && (res.data.totalCost || res.data.totalCost == 0) ? this.toThousands(res.data.totalCost, 2) : '--'
             this.statisticsObj = res.data
           } else {
             this.statisticsObj = null

+ 3 - 3
src/views/reportData/urchaseReturn/list.vue

@@ -100,7 +100,6 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import supplier from '@/views/common/supplier.js'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { toThousands } from '@/libs/tools.js'
 import reportModal from '@/views/common/reportModal.vue'
 import { sparePartsReturnReportList, sparePartsReturnReportStat, sparePartsReturnReportExport } from '@/api/reportData'
 export default {
@@ -150,6 +149,7 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '采购退货单号', dataIndex: 'sparePartsReturnNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货完成日期', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
@@ -162,7 +162,7 @@ export default {
         { title: '操作员', dataIndex: 'submitorName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  售价权限
-        arr.splice(8, 0, { title: '退货金额', dataIndex: 'totalCost', width: 60, align: 'right', customRender: function (text) { return ((text || text == 0) ? toThousands(text, 2) : '--') } })
+        arr.splice(8, 0, { title: '退货金额', dataIndex: 'totalCost', width: 60, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr
     }
@@ -191,7 +191,7 @@ export default {
     getCount (params) {
       sparePartsReturnReportStat(params).then(res => {
         if (res.status == 200 && res.data) {
-          res.data.totalCost = res.data && (res.data.totalCost || res.data.totalCost == 0) ? toThousands(res.data.totalCost, 2) : '--'
+          res.data.totalCost = res.data && (res.data.totalCost || res.data.totalCost == 0) ? this.toThousands(res.data.totalCost, 2) : '--'
           this.totalData = res.data
         } else {
           this.totalData = null