Explorar el Código

成本价是否可查看

chenrui hace 3 años
padre
commit
3f38a0f925

+ 18 - 14
src/views/allocationManagement/transferOut/detail.vue

@@ -37,7 +37,7 @@
         <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">
             总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
-            总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,
+            <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
             总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
           </div>
         </a-alert>
@@ -73,19 +73,6 @@ export default {
   data () {
     return {
       spinning: false,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'totalCost', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价小计(¥)', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return allocateBillDetailList(Object.assign(parameter, { allocateSn: this.outBizSn || this.$route.params.sn })).then(res => {
@@ -106,6 +93,23 @@ export default {
   computed: {
     isEdit () {
       return (this.basicInfoData && this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData && this.basicInfoData.state == 'WAIT_AUDIT')
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价小计(¥)', dataIndex: 'totalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '成本小计(¥)', dataIndex: 'totalCost', width: 115, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 36 - 26
src/views/allocationManagement/transferOut/edit.vue

@@ -70,7 +70,7 @@
             <a-alert type="info" style="margin-bottom:10px">
               <div slot="message">
                 总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
-                总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,
+                <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
                 总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong>
               </div>
             </a-alert>
@@ -188,18 +188,6 @@ export default {
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseList: [], //  仓库  下拉数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'lastStockCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -213,19 +201,6 @@ export default {
           return data
         })
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
-      ],
       localDataSource: [],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
@@ -249,6 +224,41 @@ export default {
       openGuideModal: false //  导入产品引导
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'lastStockCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存数量', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: 100, align: 'center' },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(4, 0, { title: '成本价', dataIndex: 'cost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {

+ 23 - 16
src/views/allocationManagement/transferOut/list.vue

@@ -143,22 +143,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center' },
-        { title: '调往对象', dataIndex: 'targetName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总数量', dataIndex: 'totalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总成本', dataIndex: 'totalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印状态', dataIndex: 'printStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '打印次数', dataIndex: 'printCount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -181,6 +165,29 @@ export default {
       openModal: false //  新增编辑  弹框
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center' },
+        { title: '调往对象', dataIndex: 'targetName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总数量', dataIndex: 'totalQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印状态', dataIndex: 'printStateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '打印次数', dataIndex: 'printCount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(6, 0, { title: '总成本', dataIndex: 'totalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  创建时间  change
     dateChange (date) {

+ 21 - 14
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -10,7 +10,10 @@
     :width="960">
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
-      <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
+      <div class="ftext" slot="message">
+        现有库存总数量(个):<strong>{{ stockQty }}</strong>;
+        <span v-if="$hasPermissions('B_isShowCost')">现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</span>
+      </div>
     </a-alert>
     <!-- 库存详情 -->
     <s-table
@@ -54,19 +57,6 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: 180, align: 'center' },
-        { title: '成本单价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -98,6 +88,23 @@ export default {
       const currentStockCost = Number(this.currentStock.currentStockCost) || 0
       const freezeStockCost = Number(this.currentStock.freezeStockCost) || 0
       return ((currentStockCost * 1000 + freezeStockCost * 1000) / 1000).toFixed(2)
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: 180, align: 'center' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(9, 0, { title: '成本单价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
     }
   },
   methods: {

+ 20 - 12
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -79,7 +79,10 @@
       </div>
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
-        <div class="ftext" slot="message">现有库存总数量(个):<strong>{{ stockQty }}</strong>;现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</div>
+        <div class="ftext" slot="message">
+          现有库存总数量(个):<strong>{{ stockQty }}</strong>;
+          <span v-if="$hasPermissions('B_isShowCost')">现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</span>
+        </div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -158,17 +161,6 @@ export default {
         { name: '库存数量为0', id: '1' },
         { name: '库存数量不为0', id: '0' }
       ],
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 120, align: 'center', sorter: true },
-        { title: '库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 120, align: 'center', sorter: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center', fixed: 'right' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -218,6 +210,22 @@ export default {
       const currentStockCost = this.currentStock && this.currentStock.currentStockCost ? Number(this.currentStock.currentStockCost) : 0
       const freezeCost = this.currentStock && this.currentStock.freezeCost ? Number(this.currentStock.freezeCost) : 0
       return ((currentStockCost * 1000 + freezeCost * 1000) / 1000).toFixed(2)
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 120, align: 'center', sorter: true },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center', fixed: 'right' }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(7, 0, { title: '库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 120, align: 'center', sorter: true })
+      }
+      return arr
     }
   },
   methods: {

+ 23 - 16
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -68,7 +68,7 @@
         <a-alert type="info" style="margin-bottom:10px">
           <div class="ftext" slot="message">
             当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong>;
-            当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong>。
+            <span v-if="$hasPermissions('B_isShowCost')">当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong>。</span>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -116,21 +116,6 @@ export default {
         warehouseSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 70, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '批次号', dataIndex: 'stockBatchNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'unitName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '数量', scopedSlots: { customRender: 'qty' }, width: 80, align: 'center' },
-        { title: '总成本', dataIndex: 'totalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -157,6 +142,28 @@ export default {
       productTotal: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据审核时间', dataIndex: 'auditTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'unitName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '数量', scopedSlots: { customRender: 'qty' }, width: 80, align: 'center' },
+        { title: '总售价', dataIndex: 'totalPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(11, 0, { title: '总成本', dataIndex: 'totalCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  创建时间  change
     dateChange (date) {

+ 1 - 1
src/views/salesManagement/salesQuery/detail.vue

@@ -59,7 +59,7 @@
           已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
           待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
           总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
-          总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;
+          <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;</span>
           总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
           已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? detailData.totalCancelAmount : '--' }}</strong>;
           已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? detailData.totalPushedAmount : '--' }}</strong>;

+ 1 - 1
src/views/salesManagement/salesQuery/edit.vue

@@ -120,7 +120,7 @@
         <a-alert type="info" style="margin-bottom: 10px;">
           <div slot="message" class="total-bar">
             <div>
-              总成本:<strong>{{ detailData&&(detailData.totalPromoCost || detailData.totalPromoCost==0) ? '¥'+detailData.totalPromoCost : '--' }}</strong>;
+              <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalPromoCost || detailData.totalPromoCost==0) ? '¥'+detailData.totalPromoCost : '--' }}</strong>;</span>
               总款数:<strong>{{ detailData&&(detailData.totalPromoCategory || detailData.totalPromoCategory==0) ? detailData.totalPromoCategory : '--' }}</strong>;
               总数量:<strong>{{ detailData&&(detailData.totalPromoQty || detailData.totalPromoQty==0) ? detailData.totalPromoQty : '--' }}</strong>;
             </div>

+ 1 - 1
src/views/salesManagement/waitDispatch/queryPart.vue

@@ -64,7 +64,7 @@
         已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
         待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;<br/>
         总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
-        总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;
+        <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;</span>
         总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
         已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? detailData.totalCancelAmount : '--' }}</strong>;
         已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? detailData.totalPushedAmount :'--' }}</strong>;