chenrui před 8 měsíci
rodič
revize
b87f94ea0a
1 změnil soubory, kde provedl 28 přidání a 18 odebrání
  1. 28 18
      src/views/reportData/frozenProductReport/list.vue

+ 28 - 18
src/views/reportData/frozenProductReport/list.vue

@@ -96,7 +96,7 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
           冻结数量:<strong>{{ totalData&&(totalData.outQty || totalData.outQty==0) ? totalData.outQty : '--' }}</strong>;
-          总成本:<strong>{{ totalData&&(totalData.totalPutCost || totalData.totalPutCost==0) ? toThousands(totalData.totalPutCost) : '--' }}</strong>;
+          总成本:<strong>{{ $hasPermissions('M_ShowAllCost')&&totalData&&(totalData.totalPutCost || totalData.totalPutCost==0) ? toThousands(totalData.totalPutCost) : '--' }}</strong>;
         </div>
       </a-alert>
       <s-table
@@ -130,7 +130,6 @@ export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
   mixins: [commonMixin],
   data () {
-    const _this = this
     return {
       advanced: true, // 高级搜索 展开/关闭
       spinning: false,
@@ -155,22 +154,6 @@ export default {
       rules: {
         'time': [{ required: true, message: '请选择冻结生成时间', trigger: 'change' }]
       },
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '批次号', dataIndex: 'stockBatchNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联单据号', dataIndex: 'outBizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据类型', dataIndex: 'outBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位名称', dataIndex: 'demanderName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '冻结数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本单价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '总成本', dataIndex: 'totalPutCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '冻结生成时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -198,6 +181,32 @@ export default {
 
     }
   },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单据号', dataIndex: 'outBizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据类型', dataIndex: 'outBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位名称', dataIndex: 'demanderName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '冻结数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本单价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '总成本', dataIndex: 'totalPutCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '冻结生成时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(11, 0, { title: '成本单价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(12, 0, { title: '总成本', dataIndex: 'totalPutCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
   watch: {
     advanced (newValue, oldValue) {
       const _this = this
@@ -261,6 +270,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = _this.queryParam
+          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
           _this.exportLoading = true
           _this.spinning = true
           freezeReportExport(params).then(res => {