lilei 3 vuotta sitten
vanhempi
commit
8fc0d5e713

+ 19 - 9
src/views/chainReportData/chainCustomerReport/list.vue

@@ -96,7 +96,9 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
           总交易金额:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</strong>;
-          总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>
+          </div>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -152,14 +154,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '连锁门店', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
-        { title: '客户类型', dataIndex: 'customerTypeName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '交易金额', dataIndex: 'totalAmount', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
-        { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -207,6 +201,22 @@ export default {
       linkageGroupData: []
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '连锁门店', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
+        { title: '客户类型', dataIndex: 'customerTypeName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '交易金额', dataIndex: 'totalAmount', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true }
+        // { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {

+ 29 - 17
src/views/chainReportData/chainSalesDetailReport/list.vue

@@ -121,7 +121,6 @@
                       </a-select>
                     </a-form-model-item>
                   </a-col>
-                  >>>>>>> 5ecce21f07307a8bedb4226d558b86b26abba9ee:src/views/chainReportData/chainSalesDetailReport/list.vue
                 </a-form-model-item>
               </a-row>
             </a-col>
@@ -141,9 +140,13 @@
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
         产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        </div>
         总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
-        总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        </div>
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -212,20 +215,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'settleStyleName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -263,6 +252,29 @@ export default {
       warehouseCascadeData: [] //  仓库仓位
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(8, 0, { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {

+ 28 - 15
src/views/chainReportData/chainSalesReport/list.vue

@@ -107,9 +107,13 @@
       <div class="ftext" slot="message">
         总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
         产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        </div>
         总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
-        总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        </div>
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -164,19 +168,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'settleStyleName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -209,6 +200,28 @@ export default {
       settleStyleList: [] //  收款方式  下拉数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {

+ 18 - 8
src/views/reportData/customerReport/list.vue

@@ -82,7 +82,9 @@
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
           总交易金额:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</strong>;
-          总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>
+          </div>
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -136,13 +138,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
-        { title: '客户类型', dataIndex: 'customerTypeName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '交易金额', dataIndex: 'totalAmount', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, sorter: true },
-        { title: '毛利率', dataIndex: 'percentageUnit', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -189,6 +184,21 @@ export default {
       productTypeList: [] //  分类下拉数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
+        { title: '客户类型', dataIndex: 'customerTypeName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '交易金额', dataIndex: 'totalAmount', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') }, sorter: true }
+        // { title: '毛利率', dataIndex: 'percentageUnit', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(4, 0, { title: '毛利率', dataIndex: 'percentageUnit', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {

+ 29 - 17
src/views/reportData/salesDetailReport/list.vue

@@ -107,7 +107,6 @@
                       </a-select>
                     </a-form-model-item>
                   </a-col>
-                  >>>>>>> 5ecce21f07307a8bedb4226d558b86b26abba9ee
                 </a-form-model-item>
               </a-row>
             </a-col>
@@ -136,9 +135,13 @@
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
         产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        </div>
         总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
-        总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        </div>
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -206,20 +209,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'settleStyleName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -255,6 +244,29 @@ export default {
       warehouseCascadeData: [] //  仓库仓位
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(8, 0, { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(10, 0, { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {

+ 28 - 15
src/views/reportData/salesReport/list.vue

@@ -102,9 +102,13 @@
       <div class="ftext" slot="message">
         总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
         产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
+        </div>
         总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
-        总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+          总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        </div>
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -158,19 +162,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款方式', dataIndex: 'settleStyleName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -203,6 +194,28 @@ export default {
       settleStyleList: [] //  收款方式  下拉数据
     }
   },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     // 合计
     getCount (params) {