lilei пре 3 година
родитељ
комит
888179d08a

+ 28 - 17
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -57,9 +57,11 @@
                 采购数量合计:<strong>{{ detail && (detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--' }}</strong>,
                 审核订单数量:<strong>{{ detail && (detail.totalPushedQty || detail.totalPushedQty==0) ? detail.totalPushedQty : '--' }}</strong>,
                 已取消数量:<strong>{{ detail && (detail.totalCancelQty || detail.totalCancelQty==0) ? detail.totalCancelQty : '--' }}</strong>,
-                采购金额合计:<strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? '¥'+detail.discountedAmount : '--' }}</strong>,
-                审核订单金额:<strong>{{ detail && (detail.totalPushedAmount || detail.totalPushedAmount==0) ? '¥'+detail.totalPushedAmount : '--' }}</strong>,
-                已取消金额:<strong>{{ detail && (detail.totalCancelAmount || detail.totalCancelAmount==0) ? '¥'+detail.totalCancelAmount : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  采购金额合计:<strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? '¥'+detail.discountedAmount : '--' }}</strong>,
+                  审核订单金额:<strong>{{ detail && (detail.totalPushedAmount || detail.totalPushedAmount==0) ? '¥'+detail.totalPushedAmount : '--' }}</strong>,
+                  已取消金额:<strong>{{ detail && (detail.totalCancelAmount || detail.totalCancelAmount==0) ? '¥'+detail.totalCancelAmount : '--' }}</strong>
+                </div>
               </div>
             </a-alert>
             <!-- 列表 -->
@@ -153,20 +155,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', scopedSlots: { customRender: 'origqty' } },
-        { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核订单数量', dataIndex: 'pushedQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -189,6 +177,29 @@ export default {
       printerType: 'NEEDLE' //  打印机类型
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', scopedSlots: { customRender: 'origqty' } },
+        // { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核订单数量', dataIndex: 'pushedQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回列表
     handleBack () {

+ 41 - 27
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -164,7 +164,8 @@
               <a-alert type="info" style="margin-bottom:10px">
                 <div slot="message">产品款数 <strong>{{ detail && (detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--' }}</strong> ,
                   采购数量合计 <strong>{{ detail && (detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--' }}</strong> ,
-                  采购金额合计 <strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? '¥'+detail.discountedAmount : '--' }}</strong></div>
+                  <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">采购金额合计 <strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? '¥'+detail.discountedAmount : '--' }}</strong></div>
+                </div>
               </a-alert>
               <!-- 搜索条件 -->
               <div class="table-page-search-wrapper">
@@ -299,21 +300,6 @@ export default {
       typeData: [], //    下拉数据
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '15%', align: 'center', sorter: true },
-        { title: '产品名称', dataIndex: 'name', width: '23%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'origCode', width: '14%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
-        { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '包装数', scopedSlots: { customRender: 'baozh' }, width: '5%', align: 'center' },
-        { title: '成本价', dataIndex: 'purchasePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '终端会员价', dataIndex: 'terminalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '车主零售价', dataIndex: 'carOwnersPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
-        { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: '6%', align: 'center' },
-        { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -337,17 +323,6 @@ export default {
         orderBy: 'purchase_bill_detail.CREATE_DATE desc'
       },
       purchaseDisabled: false, //  查询、重置按钮是否可操作
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center' },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购单价', dataIndex: 'discountedPrice', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: '10%', align: 'center' },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.disabled = true
@@ -374,6 +349,45 @@ export default {
       openAddrModal: false // 选择地址弹框是否显示
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '15%', align: 'center', sorter: true },
+        { title: '产品名称', dataIndex: 'name', width: '23%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: '14%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
+        { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '包装数', scopedSlots: { customRender: 'baozh' }, width: '5%', align: 'center' },
+        // { title: '成本价', dataIndex: 'purchasePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '终端会员价', dataIndex: 'terminalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '车主零售价', dataIndex: 'carOwnersPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: '6%', align: 'center' },
+        { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center' },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '采购单价', dataIndex: 'discountedPrice', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: '10%', align: 'center' },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '采购金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(3, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 获取采购单明细统计
     getCountQuery (params) {

+ 21 - 15
src/views/purchasingManagement/purchaseReturn/detail.vue

@@ -29,7 +29,7 @@
               <a-descriptions-item label="退货数量">{{ basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0) ? basicInfoData.totalQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="坏件数量">{{ basicInfoData&&(basicInfoData.totalBadQty || basicInfoData.totalBadQty == 0) ? basicInfoData.totalBadQty : '--' }}</a-descriptions-item>
               <a-descriptions-item label="返库数量">{{ basicInfoData&&(basicInfoData.totalBackStockQty || basicInfoData.totalBackStockQty == 0) ? basicInfoData.totalBackStockQty : '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货金额">{{ basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount == 0) ? basicInfoData.totalAmount : '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货金额" v-if="$hasPermissions('M_ShowAllCost')">{{ basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount == 0) ? basicInfoData.totalAmount : '--' }}</a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -76,20 +76,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '售价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货金额小计', dataIndex: 'purchaseReturnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'remarks', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
-      ],
       dataSource: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -116,6 +102,26 @@ export default {
   computed: {
     isEdit () {
       return ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'AUDIT_REJECT')) && this.$hasPermissions('B_purchaseReturnEdit')
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '售价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '退货金额小计', dataIndex: 'purchaseReturnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货原因', dataIndex: 'remarks', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '售价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '退货金额小计', dataIndex: 'purchaseReturnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 41 - 29
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -190,21 +190,6 @@ export default {
       dataSource: [],
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购总数', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { slots: { title: 'refundableQtyTitle' }, dataIndex: 'refundableQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'stock.currentStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货数量', dataIndex: 'cancelQty', width: '7%', align: 'center' },
-        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '8%', align: 'center' },
-        { title: '采购价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -218,19 +203,6 @@ export default {
           return data
         })
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购总数', dataIndex: 'purchaseBillQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
-        { title: '采购价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', scopedSlots: { customRender: 'remarks' }, width: '15%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.$route.params.sn, orderBy: 'qpls_purchase_return_bill_detail.CREATE_DATE desc' })).then(res => {
@@ -248,6 +220,46 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '采购总数', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { slots: { title: 'refundableQtyTitle' }, dataIndex: 'refundableQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'stock.currentStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货数量', dataIndex: 'cancelQty', width: '7%', align: 'center' },
+        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '8%', align: 'center' },
+        // { title: '采购价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(9, 0, { title: '采购价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '采购总数', dataIndex: 'purchaseBillQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
+        // { title: '采购价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', scopedSlots: { customRender: 'remarks' }, width: '15%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '采购价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
@@ -315,7 +327,7 @@ export default {
       return {
         on: {
           dblclick: (event) => {
-			event.stopPropagation()
+            event.stopPropagation()
             this.handleAdd(record)
           }
         }

+ 23 - 15
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -152,21 +152,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采退单号', scopedSlots: { customRender: 'purchaseReturnNo' }, width: '17%', align: 'center' },
-        { title: '退货数量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退款金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '客服审核时间', dataIndex: 'auditTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '扣减库存', dataIndex: 'hasStockBill', width: '6%', align: 'center', customRender: function (text) { return ['否', '是'][text] } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
-        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
-        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
-        // { title: '财务状态', dataIndex: 'settleStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -188,6 +173,29 @@ export default {
       purchaseTragetType: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采退单号', scopedSlots: { customRender: 'purchaseReturnNo' }, width: '17%', align: 'center' },
+        { title: '退货数量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退款金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客服审核时间', dataIndex: 'auditTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '扣减库存', dataIndex: 'hasStockBill', width: '6%', align: 'center', customRender: function (text) { return ['否', '是'][text] } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
+        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
+        // { title: '财务状态', dataIndex: 'settleStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '退款金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 23 - 16
src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue

@@ -237,22 +237,6 @@ export default {
       dataSource: [],
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购价格', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '已退数量', dataIndex: 'refundableQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '可退数量', dataIndex: 'refundableQty', width: '7%', align: 'center' },
-        { title: '库存数量', dataIndex: 'stock.currentStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '8%', align: 'center' },
-        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '8%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -306,6 +290,29 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '采购价格', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '已退数量', dataIndex: 'refundableQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '可退数量', dataIndex: 'refundableQty', width: '7%', align: 'center' },
+        { title: '库存数量', dataIndex: 'stock.currentStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '8%', align: 'center' },
+        { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '8%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '采购价格', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 打印预览/快捷打印
     handlePrint (type, printerType) {

+ 29 - 15
src/views/purchasingManagement/signWarehousing/edit.vue

@@ -16,7 +16,13 @@
         <!-- 总计 -->
         <a-alert type="info" style="margin-bottom:10px">
           <div slot="message" >
-            <div>产品款数 <strong>{{ item.totalPutCategory }}</strong> ,本次发货数量合计 <strong>{{ item.totalPutQty }}</strong> ,本次发货金额合计¥<strong>{{ item.totalPutAmount }}</strong></div>
+            <div>
+              产品款数 <strong>{{ item.totalPutCategory }}</strong> ,
+              本次发货数量合计 <strong>{{ item.totalPutQty }}</strong> ,
+              <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                本次发货金额合计¥<strong>{{ item.totalPutAmount }}</strong>
+              </div>
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -94,20 +100,6 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       warehouseCascadeData: [], //  仓库仓位
       defaultWarehouseCascade: [], //  默认仓库仓位
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购数量', dataIndex: 'qty', width: '6%', align: 'center', scopedSlots: { customRender: 'origqty' } },
-        { title: '本次发货数量', dataIndex: 'shippedQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: '13%', align: 'center' }
-      ],
       chooseLoadData: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -143,6 +135,28 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'qty', width: '6%', align: 'center', scopedSlots: { customRender: 'origqty' } },
+        { title: '本次发货数量', dataIndex: 'shippedQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: '13%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  产品分类  change
     changeProductType (val, opt) {

+ 20 - 12
src/views/purchasingManagement/signWarehousing/list.vue

@@ -119,18 +119,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
-      columns: [
-        { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: '18%', align: 'center' },
-        { title: '发货单号', scopedSlots: { customRender: 'sendBillNo' }, width: '18%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '发货数量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '发货金额', dataIndex: 'totalPutAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库时间', dataIndex: 'stockPutTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库', scopedSlots: { customRender: 'waitIn' }, width: '3%', align: 'center' },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -149,6 +137,26 @@ export default {
       purchaseTragetType: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: '18%', align: 'center' },
+        { title: '发货单号', scopedSlots: { customRender: 'sendBillNo' }, width: '18%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货数量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '发货金额', dataIndex: 'totalPutAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库时间', dataIndex: 'stockPutTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库', scopedSlots: { customRender: 'waitIn' }, width: '3%', align: 'center' },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '发货金额', dataIndex: 'totalPutAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 22 - 14
src/views/purchasingManagement/signWarehousing/stockOrderDetail.vue

@@ -51,7 +51,7 @@
           <div slot="message">
             产品款数:<strong>{{ detail && (detail.totalPutCategory || detail.totalPutCategory==0) ? detail.totalPutCategory : '--' }}</strong>,
             本次发货数量合计:<strong>{{ detail && (detail.totalPutQty || detail.totalPutQty==0) ? detail.totalPutQty : '--' }}</strong>,
-            本次发货金额合计:<strong>{{ detail && (detail.totalPutAmount || detail.totalPutAmount==0) ? '¥'+detail.totalPutAmount : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">本次发货金额合计:<strong>{{ detail && (detail.totalPutAmount || detail.totalPutAmount==0) ? '¥'+detail.totalPutAmount : '--' }}</strong></div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -92,19 +92,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购数量', width: '6%', align: 'center', scopedSlots: { customRender: 'qty' } },
-        { title: '本次发货数量', dataIndex: 'receivingQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -125,6 +112,27 @@ export default {
       printerType: 'NEEDLE' //  打印机类型
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', width: '6%', align: 'center', scopedSlots: { customRender: 'qty' } },
+        { title: '本次发货数量', dataIndex: 'receivingQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  返回列表
     handleBack () {

+ 21 - 12
src/views/salesManagement/giftRecord/list.vue

@@ -86,18 +86,6 @@ export default {
         customerSn: undefined //  赠送客户
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '赠品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '赠送数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '关联销售单号', dataIndex: 'salesBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '赠送客户', dataIndex: 'customerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计', dataIndex: 'totalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -118,6 +106,27 @@ export default {
       }
     }
   },
+  computed: {
+  	columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '赠品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '赠送数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '关联销售单号', dataIndex: 'salesBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '赠送客户', dataIndex: 'customerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        // { title: '成本价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本小计', dataIndex: 'totalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(8, 0, { title: '成本价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(9, 0, { title: '成本小计', dataIndex: 'totalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+  	}
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 1 - 1
src/views/salesManagement/productPricing/list.vue

@@ -44,7 +44,7 @@
     </div>
     <!-- 价格 -->
     <div style="border-top: 1px solid #eee;padding: 10px 0;text-align: right;">
-      <a-checkbox v-model="isCostPrice"><span style="display: inline-block;">成本价</span></a-checkbox>
+      <a-checkbox v-model="isCostPrice" v-if="$hasPermissions('M_ShowAllCost')"><span style="display: inline-block;">成本价</span></a-checkbox>
       <!-- 特约加盟商不可见市级价 -->
       <a-checkbox v-model="isCityPrice" v-if="dealerData && dealerData.dealerLevel != 'SPECIAL'"><span style="display: inline-block;">市级价</span></a-checkbox>
       <!-- 是否展示特约价 -->

+ 10 - 3
src/views/salesManagement/salesQuery/outInDetialModal.vue

@@ -65,9 +65,9 @@ export default {
         { title: '入库类型', dataIndex: 'callOutTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次出库数量', dataIndex: 'productTotalCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本价', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次出库数量', dataIndex: 'productTotalCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -99,12 +99,19 @@ export default {
       this.$nextTick(() => {
         this.$refs.table.refresh(true)
       })
+    },
+    hasCost () {
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        this.columns.splice(5, 0, { title: '成本价', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        this.columns.splice(7, 0, { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
     }
   },
   watch: {
     //  父页面传过来的弹框状态
     openModal (newValue, oldValue) {
       this.isShow = newValue
+	    this.hasCost()
     },
     //  重定义的弹框状态
     isShow (newValue, oldValue) {

+ 20 - 13
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -106,19 +106,6 @@ export default {
         { title: '未冲减数量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库时间', dataIndex: 'stockInDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已冲减数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本小计', dataIndex: 'totalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -143,6 +130,26 @@ export default {
   computed: {
     isWriteDown () {
       return this.detailData && this.detailData.status == 'FINISH'
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库时间', dataIndex: 'stockInDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '成本价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已冲减数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
+        // { title: '成本小计', dataIndex: 'totalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+      	arr.splice(7, 0, { title: '成本价', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      	arr.splice(10, 0, { title: '成本小计', dataIndex: 'totalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {