lilei 2 years ago
parent
commit
2a945d54e4

+ 6 - 0
src/utils/mixin.js

@@ -1,5 +1,6 @@
 // import Vue from 'vue'
 import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
+import { toThousands } from '@/libs/tools'
 import { mapState } from 'vuex'
 
 // const mixinsComputed = Vue.config.optionMergeStrategies.computed
@@ -77,6 +78,11 @@ const AppDeviceEnquire = {
 
 // 所有页
 const commonMixin = {
+  data(){
+    return {
+      toThousands
+    }
+  },
   watch: {
     '$store.state.app.loadingStatus': function (a, b) {
       if (!a) {

+ 2 - 1
src/views/supplierManagement/associatedProductDetails/list.vue

@@ -115,6 +115,7 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '供应商名称', dataIndex: 'supplierName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -126,7 +127,7 @@ export default {
         { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
-        arr.splice(6, 0, { title: '成本价(¥)', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '成本价(¥)', dataIndex: 'cost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 3 - 2
src/views/supplierManagement/costSetRecord/list.vue

@@ -80,6 +80,7 @@ export default {
   mixins: [commonMixin],
   components: { STable, VSelect, ProductBrand, ProductType },
   data () {
+    const _this = this
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
@@ -104,8 +105,8 @@ export default {
         { title: '产品品牌', dataIndex: 'product.productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
         { title: '供应商名称', dataIndex: 'supplierName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '变更前', dataIndex: 'oldCost', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '变更后', dataIndex: 'newCost', width: '7%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '变更前', dataIndex: 'oldCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '变更后', dataIndex: 'newCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
 
       ],
       disabled: false, //  查询、重置按钮是否可操作

+ 6 - 3
src/views/supplierManagement/costSetting/chooseImportModal.vue

@@ -27,7 +27,7 @@
       <!-- 不可导入数据 -->
       <p class="red">不可导入数据{{ unLoadData.length }}条</p>
       <a-table
-        class="unTable"
+        class="sTable"
         ref="unTable"
         size="small"
         :rowKey="(record) => record.errorDesc"
@@ -66,9 +66,11 @@
 </template>
 
 <script>
+import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { supplierProductParseNewProducts, supplierProductailNewExcel } from '@/api/supplier'
 export default {
+  mixins: [commonMixin],
   name: 'ChooseImportModal',
   props: {
     openModal: { //  弹框显示状态
@@ -83,6 +85,7 @@ export default {
     }
   },
   data () {
+    const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [ //  可导入
@@ -90,14 +93,14 @@ export default {
         { title: '供应商名称', dataIndex: 'supplierName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ],
       nowUnColumns: [ //  不可导入
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '供应商名称', dataIndex: 'supplierName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'costText', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '备注', dataIndex: 'importErrorMsgList', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],

+ 5 - 4
src/views/supplierManagement/costSetting/list.vue

@@ -174,21 +174,22 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品名称', dataIndex: 'product.name', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '12%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'product.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'product.productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
-        { title: '供应商名称', dataIndex: 'supplierName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'supplierName', width: '12%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
-        arr.splice(7, 0, { title: '当前成本价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(8, 0, { title: '变更成本价', dataIndex: 'modifyCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '当前成本价', dataIndex: 'cost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '变更成本价', dataIndex: 'modifyCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 1 - 1
src/views/supplierManagement/costSetting/settingCost.vue

@@ -27,7 +27,7 @@
             {{ supplierName }}
           </a-form-model-item>
           <a-form-model-item style="margin-bottom:10px;" label="原成本价">
-            {{ cost||'--' }}
+            {{ cost ? toThousands(cost) : '--' }}
           </a-form-model-item>
           <a-form-model-item label="变更成本价" prop="modifyCost">
             <a-input-number