lilei 3 lat temu
rodzic
commit
3eb63e0977

+ 21 - 13
src/views/allocationManagement/chainTransferOut/detail.vue

@@ -40,8 +40,10 @@
             <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">
                 总款数 <strong>{{ (productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0)) ? productTotal.productTotalCategory : '--' }}</strong> ,
-                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong> ,
-                总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                </div>
               </div>
             </a-alert>
             <!-- 列表 -->
@@ -82,17 +84,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'outCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出仓库', dataIndex: 'warehouseName', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', dataIndex: 'outQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -122,6 +113,23 @@ export default {
   computed: {
     isEdit () {
       return ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')) && this.$hasPermissions('B_allocLinkageOutEdit')
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价', dataIndex: 'outCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出仓库', dataIndex: 'warehouseName', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', dataIndex: 'outQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'outCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 47 - 32
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -107,8 +107,10 @@
             <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">
                 总款数 <strong>{{ (productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0)) ? productTotal.productTotalCategory : '--' }}</strong> ,
-                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong> ,
-                总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                </div>
               </div>
             </a-alert>
             <!-- 筛选条件 -->
@@ -206,21 +208,6 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       chooseDisabled: false,
       advanced: false, // 高级搜索 展开/关闭
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -241,21 +228,6 @@ export default {
         productCode: '',
         productName: ''
       },
-      // 表头
-      chooseColumns: [
-        { 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: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', dataIndex: 'outQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
@@ -279,6 +251,49 @@ export default {
       localDataSource: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '成本价', dataIndex: 'putCost', 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: 'dealerProductEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', dataIndex: 'outQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', 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(8, 0, { title: '成本价', dataIndex: 'outCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '成本小计', dataIndex: 'costSubtotal', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {

+ 25 - 17
src/views/allocationManagement/chainTransferOut/list.vue

@@ -172,23 +172,6 @@ export default {
         settleState: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '连锁调出单号', scopedSlots: { customRender: 'allocationLinkageOutNo' }, width: '16%', align: 'center' },
-        { title: '调往对象', dataIndex: 'putTenantName', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类型', dataIndex: 'allocationTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', 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: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -212,6 +195,31 @@ export default {
       itemId: '' //  当前品牌id
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '连锁调出单号', scopedSlots: { customRender: 'allocationLinkageOutNo' }, width: '16%', align: 'center' },
+        { title: '调往对象', dataIndex: 'putTenantName', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型', dataIndex: 'allocationTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', 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: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 22 - 15
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -38,8 +38,10 @@
         <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">
             总款数 <strong>{{ (productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0)) ? productTotal.productTotalCategory : '--' }}</strong> ,
-            总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong> ,
-            总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+            总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -94,19 +96,6 @@ export default {
     return {
       spinning: false,
       showOutInModal: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'outCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出仓库', dataIndex: 'warehouseName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调出数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
@@ -135,6 +124,24 @@ export default {
   computed: {
     isEdit () {
       return ((this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')) && this.$hasPermissions('B_storeCallOutEdit')
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价(¥)', dataIndex: 'outCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出仓库', dataIndex: 'warehouseName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', 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(4, 0, { title: '成本价(¥)', dataIndex: 'outCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 43 - 29
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -119,8 +119,10 @@
             <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">
                 总款数 <strong>{{ (productTotal&&(productTotal.productTotalCategory || productTotal.productTotalCategory==0)) ? productTotal.productTotalCategory : '--' }}</strong> ,
-                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong> ,
-                总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                总数量 <strong>{{ (productTotal&&(productTotal.productTotalQty || productTotal.productTotalQty==0)) ? productTotal.productTotalQty : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  ,总成本 <strong>{{ (productTotal&&(productTotal.productTotalCost || productTotal.productTotalCost==0)) ? '¥'+productTotal.productTotalCost : '--' }}</strong>
+                </div>
               </div>
             </a-alert>
             <!-- 筛选条件 -->
@@ -249,19 +251,6 @@ export default {
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseList: [], //  仓库  下拉数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'unit', width: '6%', 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: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -276,20 +265,6 @@ export default {
           return data
         })
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '成本价(¥)', dataIndex: 'outCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
-        // { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
@@ -315,6 +290,45 @@ export default {
       printCostChecked: true //  打印成本
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'unit', width: '6%', 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: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '成本价(¥)', dataIndex: 'outCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
+        // { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', 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(4, 0, { title: '成本价(¥)', dataIndex: 'outCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {

+ 25 - 17
src/views/allocationManagement/storeTransferOut/list.vue

@@ -162,23 +162,6 @@ export default {
         settleState: undefined //  财务状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: '14%', align: 'center' },
-        { title: '调往对象名称', dataIndex: 'putPersonName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨类型', dataIndex: 'callOutTypeName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
-        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
-        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -202,6 +185,31 @@ export default {
       itemId: '' //  当前品牌id
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: '14%', align: 'center' },
+        { title: '调往对象名称', dataIndex: 'putPersonName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调拨类型', dataIndex: 'callOutTypeName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '财务状态', dataIndex: 'settleStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
+        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 19 - 10
src/views/allocationManagement/storeTransferOut/outInDetialModal.vue

@@ -59,16 +59,6 @@ export default {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
       baseData: null,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { 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 : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -89,6 +79,25 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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 : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '总成本', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     cansel () {
       this.isShow = false

+ 3 - 1
src/views/inventoryManagement/inventoryChecking/detailModal.vue

@@ -58,7 +58,9 @@
                 <div>
                   总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
                   总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
-                  <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> </div>
+                  <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                    总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>
+                  </div>
                 </div>
                 <div>
                   盘盈总数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong>,

+ 23 - 15
src/views/inventoryManagement/inventoryChecking/list.vue

@@ -150,21 +150,6 @@ export default {
       tableHeight: 0,
       advanced: true,
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '12%', align: 'center' },
-        { title: '总款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'totalStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'totalStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '盘点类型', dataIndex: 'checkTypeDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否区分仓库', dataIndex: 'warehouseFlagDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'checkSuperviseTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '监盘人审核', scopedSlots: { customRender: 'dpaudit' }, width: '3%', align: 'center' },
-        { title: '财务人审核', scopedSlots: { customRender: 'cwaudit' }, width: '3%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -193,6 +178,29 @@ export default {
       itemSn: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '盘点单号', scopedSlots: { customRender: 'checkWarehouseNo' }, width: '12%', align: 'center' },
+        { title: '总款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总成本', dataIndex: 'totalStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点类型', dataIndex: 'checkTypeDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否区分仓库', dataIndex: 'warehouseFlagDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'checkSuperviseTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '监盘人审核', scopedSlots: { customRender: 'dpaudit' }, width: '3%', align: 'center' },
+        { title: '财务人审核', scopedSlots: { customRender: 'cwaudit' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '总成本', dataIndex: 'totalStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 3 - 1
src/views/inventoryManagement/inventoryChecking/makeInventory.vue

@@ -56,7 +56,9 @@
               <div>
                 总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
                 总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
-                总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong> ,
+                </div>
                 盘盈数量: <strong>{{ productTotal&&(productTotal.checkProfitQty || productTotal.checkProfitQty==0) ? productTotal.checkProfitQty : '--' }}</strong> ,
                 盘亏数量: <strong>{{ productTotal&&(productTotal.checkLossQty || productTotal.checkLossQty==0) ? productTotal.checkLossQty : '--' }}</strong>
               </div>

+ 4 - 2
src/views/inventoryManagement/inventoryChecking/overall.vue

@@ -27,8 +27,10 @@
         <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">
             总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
-            总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
-            总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>
+            总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong>
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              ,总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>。
+            </div>
           </div>
         </a-alert>
         <!-- 筛选条件 -->

+ 3 - 1
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -174,7 +174,9 @@
               <div slot="message">
                 总款数: <strong>{{ productTotal&&(productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong> ,
                 总数量: <strong>{{ productTotal&&(productTotal.stockQty || productTotal.stockQty==0) ? productTotal.stockQty : '--' }}</strong> ,
-                总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>
+                <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+                  总成本: <strong>{{ productTotal&&(productTotal.checkCost || productTotal.checkCost==0) ? '¥'+productTotal.checkCost : '--' }}</strong>。
+                </div>
               </div>
             </a-alert>
           </a-col>

+ 17 - 10
src/views/inventoryManagement/inventoryImport/list.vue

@@ -96,16 +96,6 @@ export default {
       tableHeight: 0,
       queryParam: {}, // 查询参数
       isAllError: false, // 是否全部错误
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '错误原因', dataIndex: 'errorMsg', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       listData: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -138,6 +128,23 @@ export default {
       filePath: 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/StockImports.xlsx'
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'putQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '错误原因', dataIndex: 'errorMsg', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 上传文件  change
     changeImport (file) {

+ 22 - 13
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -13,9 +13,13 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
           可用库存总数量(个):<strong>{{ currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0) ? currentStock.currentStockQty : '--' }}</strong>;
-          可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? currentStock.currentStockCost : '--' }}</strong>;
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0) ? currentStock.currentStockCost : '--' }}</strong>;
+          </div>
           冻结库存总数量(个):<strong>{{ currentStock&&(currentStock.freezeQty || currentStock.freezeQty==0) ? currentStock.freezeQty : '--' }}</strong>;
-          冻结库存总成本(¥):<strong>{{ currentStock&&(currentStock.freezeCost || currentStock.freezeCost==0) ? currentStock.freezeCost : '--' }}</strong>。
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            冻结库存总成本(¥):<strong>{{ currentStock&&(currentStock.freezeCost || currentStock.freezeCost==0) ? currentStock.freezeCost : '--' }}</strong>。
+          </div>
         </div>
       </a-alert>
       <!-- 库存详情 -->
@@ -60,14 +64,9 @@ export default {
   computed: {
     modalTit () {
       return '库存详情'
-    }
-  },
-  data () {
-    return {
-      spinning: false,
-      isShow: this.openModal, //  是否打开弹框
-      // 表头
-      columns: [
+    },
+    columns () {
+      const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
@@ -77,9 +76,19 @@ export default {
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '可用库存数量', dataIndex: 'currentQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '冻结库存数量', dataIndex: 'freezeQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
+        { title: '冻结库存数量', dataIndex: 'freezeQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(10, 0, { title: '成本单价', dataIndex: 'putCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true

+ 23 - 13
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -86,7 +86,9 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
           可用库存总数量(个):<strong>{{ currentStock&&(currentStock.totalCurrentStockQty || currentStock.totalCurrentStockQty==0) ? currentStock.totalCurrentStockQty : '--' }}</strong>;
-          可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            可用库存总成本(¥):<strong>{{ currentStock&&(currentStock.totalCurrentStockCost || currentStock.totalCurrentStockCost==0) ? currentStock.totalCurrentStockCost : '--' }}</strong>。
+          </div>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -174,18 +176,6 @@ export default {
         { name: '库存数量为0', id: '1' },
         { name: '库存数量不为0', id: '0' }
       ],
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '16%', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'brandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: '13%', align: 'center' },
-        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: <div><a-tooltip placement='top' title='1:产品距离最近一次销售的时间,30天算一个月 2:采购退货,调拨等不算销售,不用来计算滞销天数'><a-icon type="question-circle" /></a-tooltip>&nbsp;滞销天数</div>, width: '10%', align: 'center', scopedSlots: { customRender: 'unsalableDays' }, sorter: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         // 查询条件有直销天数先校验滞销天数
@@ -236,6 +226,26 @@ export default {
       currentStock: null
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '16%', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: '13%', align: 'center' },
+        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div><a-tooltip placement='top' title='1:产品距离最近一次销售的时间,30天算一个月 2:采购退货,调拨等不算销售,不用来计算滞销天数'><a-icon type="question-circle" /></a-tooltip>&nbsp;滞销天数</div>, width: '10%', align: 'center', scopedSlots: { customRender: 'unsalableDays' }, sorter: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '8%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 校验滞销天数数值范围
     checkValueRange () {

+ 31 - 19
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -84,9 +84,13 @@
         <a-alert type="info" style="margin-bottom:10px">
           <div class="ftext" slot="message">
             当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.currentStockQty || productTotal.currentStockQty==0)) ? productTotal.currentStockQty : '--' }}</strong>;
-            当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? productTotal.currentStockCost : '--' }}</strong>;
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.currentStockCost || productTotal.currentStockCost==0)) ? productTotal.currentStockCost : '--' }}</strong>;
+            </div>
             冻结库存总数量(个):<strong>{{ productTotal&&(productTotal.freezeQty || productTotal.freezeQty==0) ? productTotal.freezeQty : '--' }}</strong>;
-            冻结库存总成本(¥):<strong>{{ productTotal&&(productTotal.freezeCost || productTotal.freezeCost==0) ? productTotal.freezeCost : '--' }}</strong>。
+            <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+              冻结库存总成本(¥):<strong>{{ productTotal&&(productTotal.freezeCost || productTotal.freezeCost==0) ? productTotal.freezeCost : '--' }}</strong>。
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -141,23 +145,6 @@ export default {
         state: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'product.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '12%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '批次号', dataIndex: 'stockBatchNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联单据号', dataIndex: 'bizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'unitName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '数量', scopedSlots: { customRender: 'qty' }, width: '5%', align: 'center' },
-        { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '出入库状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -187,6 +174,31 @@ export default {
       productTotal: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'product.code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '12%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'product.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单据号', dataIndex: 'bizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'unitName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '9%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '数量', scopedSlots: { customRender: 'qty' }, width: '5%', align: 'center' },
+        // { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '出入库状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(12, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {

+ 19 - 17
src/views/salesManagement/salesQuery/outInDetialModal.vue

@@ -59,16 +59,6 @@ export default {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
       baseData: null,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { 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 : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -89,6 +79,25 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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 : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     cansel () {
       this.isShow = false
@@ -99,19 +108,12 @@ 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) {