chenrui 2 mēneši atpakaļ
vecāks
revīzija
ff0f69537c

+ 1 - 1
src/api/reportData.js

@@ -1486,7 +1486,7 @@ export const subsidyTireList = (params) => {
 // 补贴返利列表   统计
 export const subsidyTireCount = (params) => {
   return axios({
-    url: '/report/subsidyTire/queryCount ',
+    url: '/report/subsidyTire/queryCount',
     data: params,
     method: 'post'
   })

+ 18 - 23
src/views/reportData/salesDetails/list.vue

@@ -152,18 +152,7 @@
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
         <div style="margin-bottom:12px;text-align: right;">
-          <span>显示:</span>
-          <a-tree-select
-            size="small"
-            v-model="showCols"
-            style="min-width: 200px"
-            dropdownMatchSelectWidth
-            :maxTagCount="3"
-            id="salesOrderTotalList-isShowColumn"
-            :tree-data="colsArr"
-            tree-checkable
-            placeholder="请选择要显示的列(多选)"
-          />
+          <a-checkbox id="salesDetailsList-cityPrice" v-model="isAveragePrice" v-if="$hasPermissions('B_salesDetails_avgprice')"><span style="display: inline-block;margin-top: 1px;">平均公斤单价</span></a-checkbox>
         </div>
         <!-- 列表 -->
         <s-table
@@ -196,10 +185,10 @@
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')"><label>实售金额:</label>{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')"><label>特价产品优惠金额:</label>{{ (totalData && (totalData.specialDiscountAmount || totalData.specialDiscountAmount==0)) ? toThousands(totalData.specialDiscountAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24"><label>实际毛利率:</label>{{ (totalData && (totalData.realGrossMargin || totalData.realGrossMargin==0)) ? (totalData.realGrossMargin*100).toFixed(2)+'%' : '--' }}</a-col>
-              <a-col :md="4" :sm="24"><label>合计重量:</label>{{ (totalData && (totalData.realGrossMargin || totalData.realGrossMargin==0)) ? totalData.realGrossMargin : '--' }}</a-col>
-              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')"><label>平均成本公斤单价:</label>{{ (totalData && (totalData.specialDiscountAmount || totalData.specialDiscountAmount==0)) ? toThousands(totalData.specialDiscountAmount) : '--' }}</a-col>
-              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')"><label>平均售价公斤单价:</label>{{ (totalData && (totalData.specialDiscountAmount || totalData.specialDiscountAmount==0)) ? toThousands(totalData.specialDiscountAmount) : '--' }}</a-col>
-              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')"><label>返利金额:</label>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="isAveragePrice"><label>合计重量(kg):</label>{{ (totalData && (totalData.realGrossMargin || totalData.realGrossMargin==0)) ? totalData.realGrossMargin : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')&&isAveragePrice"><label>平均成本公斤单价:</label>{{ (totalData && (totalData.weightAvgCost || totalData.weightAvgCost==0)) ? toThousands(totalData.weightAvgCost) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')&&isAveragePrice"><label>平均售价公斤单价:</label>{{ (totalData && (totalData.weightAvgPrice || totalData.weightAvgPrice==0)) ? toThousands(totalData.weightAvgPrice) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')"><label>返利金额:</label>{{ (totalData && (totalData.totalFactoryRebateAmount || totalData.totalFactoryRebateAmount==0)) ? toThousands(totalData.totalFactoryRebateAmount) : '--' }}</a-col>
             </a-row>
           </template>
         </s-table>
@@ -273,6 +262,7 @@ export default {
         promotionFlag: undefined, // 产品类型
         bizUserSn: undefined // 客服
       },
+      isAveragePrice: false, // 平均公斤单价
       productType: [], // 产品分类
       totalData: null, // 统计数据
       rules: {
@@ -342,10 +332,7 @@ export default {
         { title: '产品名称', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', scopedSlots: { customRender: 'productCode' } },
         { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '下推数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单重(kg)', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '合计重量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-
+        { title: '下推数量', dataIndex: 'qty', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '成本价', dataIndex: 'totalCost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '实售价', dataIndex: 'totalRealAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '开单价', dataIndex: 'totalAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -355,14 +342,22 @@ export default {
         // { title: '折后单价', dataIndex: 'discountedPrice', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '折扣金额', dataIndex: 'discountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
       ]
+      if (this.isAveragePrice) {
+        arr.push({ title: '单重(kg)', dataIndex: 'weight', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.push({ title: '合计重量(kg)', dataIndex: 'totalWeight', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       if (this.$hasPermissions('M_salesDetailsList_costPrice')) { //  成本价权限
         arr.push({ title: '成本金额', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.push({ title: '平均成本公斤单价', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.isAveragePrice) {
+          arr.push({ title: '平均成本公斤单价', dataIndex: 'weightAvgCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
       }
       if (this.$hasPermissions('M_salesDetailsList_salesPrice')) { //  售价权限
         arr.push({ title: '实售金额', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.push({ title: '平均售价公斤单价', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.push({ title: '返利金额', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.isAveragePrice) {
+          arr.push({ title: '平均售价公斤单价', dataIndex: 'weightAvgPrice', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
+        arr.push({ title: '返利金额', dataIndex: 'totalFactoryRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '开单金额', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.$hasPermissions('M_salesDetailsList_cityPrice')) { //  市级价权限

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

@@ -186,7 +186,7 @@
           :showFooter="false"
           :openModal="showDetailModal"
           @cancel="closeDetailModal">
-          <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+          <salesDetail v-if="showDetailModal" pageTypeAuth="B_dispatchDetail" ref="salesDetail" :bizSn="bizSn"></salesDetail>
         </commonModal>
 
         <!-- 发货说明 -->

+ 5 - 4
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -287,13 +287,14 @@ export default {
       }
       arr.push({ title: '已取消数', field: 'cancelQty', width: 80, key: 'q', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
       if (this.showAveragePrice) {
-        arr.push({ title: '单重', field: 'weight', width: 80, key: 'q1', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
-        arr.push({ title: '合计重量', field: 'totalWeight', width: 80, key: 'q2', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        this.colspanNums = this.colspanNums + 4
+        arr.push({ title: '单重(kg)', field: 'weight', width: 80, key: 'q1', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        arr.push({ title: '合计重量(kg)', field: 'totalWeight', width: 98, key: 'q2', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         if (this.$hasPermissions(this.authCode + '_costPrice')) {
-          arr.push({ title: '平均成本公斤单价', field: 'weightAvgCost', width: 100, key: 'q3', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+          arr.push({ title: '平均成本公斤单价', field: 'weightAvgCost', width: 105, key: 'q3', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         }
         if (this.$hasPermissions(this.authCode + '_salesPrice')) {
-          arr.push({ title: '平均售价公斤单价', field: 'weightAvgPrice', width: 100, key: 'q4', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+          arr.push({ title: '平均售价公斤单价', field: 'weightAvgPrice', width: 105, key: 'q4', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         }
       }
       return arr

+ 43 - 26
src/views/salesManagement/salesQueryNew/detail.vue

@@ -72,27 +72,46 @@
         <a-alert type="info" style="margin-bottom: 10px;">
           <div slot="message">
             <div class="form-grid">
-              <div v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</div>
-              <div>总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;</div>
-              <div>已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;</div>
-              <div>已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;</div>
-              <div>待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;</div>
-              <div>已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;</div>
-              <div>待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;</div>
-              <div style="width:190px;" v-if="$hasPermissions(authCode + '_costPrice')&&isAveragePrice"><label style="width:108px;">平均成本公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgCost || detailData.totalWeightAvgCost==0) ? toThousands(detailData.totalWeightAvgCost) : '--' }}</strong>;</label></div>
-              <div v-if="isAveragePrice">合计重量(kg):<strong>{{ detailData&&(detailData.totalWeight || detailData.totalWeight==0) ? detailData.totalWeight : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong>;</div>
-              </br>
-              <div v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</div>
-              <div style="width:190px;" v-if="$hasPermissions(authCode + '_salesPrice')&&isAveragePrice"><label style="width:108px;">平均售价公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgPrice || detailData.totalWeightAvgPrice==0) ? toThousands(detailData.totalWeightAvgPrice) : '--' }}</strong>;</label></div>
-              <div v-if="isCityPrice">&nbsp;&nbsp;市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</div>
-              <div v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color: red;width:170px;">促销产品转采购额金额:<strong>{{ Number(detailData.totalConvertPromoGiftsAmount).toFixed(2) }}</strong>;</div>
+              <div class="tongji-bar-col">
+                <div v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')"> 待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div>待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div v-if="$hasPermissions(authCode + '_costPrice')&&isAveragePrice"><label style="width:108px;">平均成本公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgCost || detailData.totalWeightAvgCost==0) ? toThousands(detailData.totalWeightAvgCost) : '--' }}</strong>;</label></div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')&&isAveragePrice"><label style="width:108px;">平均售价公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgPrice || detailData.totalWeightAvgPrice==0) ? toThousands(detailData.totalWeightAvgPrice) : '--' }}</strong>;</label></div>
+              </div>
+              <div class="tongji-bar-col">
+                <div v-if="isAveragePrice">合计重量(kg):<strong>{{ detailData&&(detailData.totalWeight || detailData.totalWeight==0) ? detailData.totalWeight : '--' }}</strong>;</div>
+                <div v-if="isCityPrice">&nbsp;&nbsp;市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</div>
+              </div>
+              <div class="tongji-bar-col">
+                <div v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ Number(detailData.totalDiscountAmount).toFixed(2) }}</strong>;</div>
+                <div v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalConvertPromoGiftsAmount" style="color: red;width:170px;">促销产品转采购额金额:<strong>{{ Number(detailData.totalConvertPromoGiftsAmount).toFixed(2) }}</strong>;</div>
+              </div>
             </div>
           </div>
         </a-alert>
@@ -161,7 +180,7 @@
               <a-button id="salesDetail-updateStock" type="primary" v-if="showStock" @click="getThreeStock" class="button-info">第三方库存</a-button>
               <a-button id="salesDetail-stockOut" v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
               <a-checkbox id="salesDetail-cityPrice" v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
-              <a-checkbox id="salesDetail-cityPrice" v-model="isAveragePrice" v-if="$hasPermissions(authCode + '_costPrice')&&$hasPermissions(authCode + '_salesPrice')"><span style="display: inline-block;margin-top: 1px;">平均公斤单价</span></a-checkbox>
+              <a-checkbox id="salesDetail-cityPrice" v-model="isAveragePrice" v-if="$hasPermissions(authCode + '_avgprice')"><span style="display: inline-block;margin-top: 1px;">平均公斤单价</span></a-checkbox>
             </div>
           </div>
         </div>
@@ -778,10 +797,8 @@ export default {
       color: red;
     }
     .form-grid{
-      div{
-        display: inline-block;
-        width:136px;
-      }
+      display: flex;
+      flex:1;
     }
   }
 </style>

+ 40 - 20
src/views/salesManagement/salesQueryNew/detailAll.vue

@@ -67,8 +67,6 @@
         <a-alert type="info" style="margin: 10px 0;">
           <div slot="message">
             <div>
-              总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-              已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
               已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
               待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
               已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
@@ -83,9 +81,9 @@
               <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
               <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
               <span v-if="$hasPermissions(authCode + '_salesPrice')&&detailData&&detailData.totalDiscountAmount" style="color: red;">优惠金额:<strong>{{ toThousands(detailData.totalDiscountAmount) }}</strong>;</span>
-              <span>合计重量(kg):<strong>{{ detailData&&(detailData.totalWeight || detailData.totalWeight==0) ? detailData.totalWeight : '--' }}</strong>;</span>
-              <span>平均成本公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgCost || detailData.totalWeightAvgCost==0) ? toThousands(detailData.totalWeightAvgCost) : '--' }}</strong>;</span>
-              <span>平均售价公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgPrice || detailData.totalWeightAvgPrice==0) ? toThousands(detailData.totalWeightAvgPrice) : '--' }}</strong>;</span>
+              <span v-if="isAveragePrice">合计重量(kg):<strong>{{ detailData&&(detailData.totalWeight || detailData.totalWeight==0) ? detailData.totalWeight : '--' }}</strong>;</span>
+              <span v-if="isAveragePrice&&$hasPermissions(pageTypeAuth + '_costPrice')">平均成本公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgCost || detailData.totalWeightAvgCost==0) ? toThousands(detailData.totalWeightAvgCost) : '--' }}</strong>;</span>
+              <span v-if="isAveragePrice&&$hasPermissions(pageTypeAuth + '_salesPrice')">平均售价公斤单价:<strong>{{ detailData&&(detailData.totalWeightAvgPrice || detailData.totalWeightAvgPrice==0) ? toThousands(detailData.totalWeightAvgPrice) : '--' }}</strong>;</span>
             </div>
           </div>
         </a-alert>
@@ -110,6 +108,7 @@
             <div>
               <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
               <a-checkbox v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              <a-checkbox v-model="isAveragePrice" v-if="$hasPermissions(pageTypeAuth + '_avgprice')"><span style="display: inline-block;margin-top: 1px;">平均公斤单价</span></a-checkbox>
             </div>
           </div>
         </div>
@@ -234,6 +233,10 @@ export default {
     bizSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
       default: ''
+    },
+    pageTypeAuth: { // 页面权限显示
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -296,7 +299,8 @@ export default {
       spinningAudit: false, // 审核loading
       outStockStr: '', // 缺货产品信息说明
       auditText: null, // 审核备注
-      authCode: '' // 当前权限码
+      authCode: '', // 当前权限码
+      isAveragePrice: false// 平均公斤单价
     }
   },
   computed: {
@@ -320,40 +324,52 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '10%', scopedSlots: { customRender: 'productCode' }, align: 'left' },
         { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '出库仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '出库仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
         // { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+
         // { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
-        { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '成本价', dataIndex: 'showCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-
-      const ind = this.$hasPermissions(this.authCode + '_costPrice') ? 6 : 5
       if (this.$hasPermissions(this.authCode + '_provincePrice')) {
-        arr.splice(ind, 0, { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       // 是否勾选市级价格
       if (this.isCityPrice) {
-        arr.splice(ind + 1, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-          arr.splice(ind + 2, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+          arr.push({ title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       } else {
         if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-          arr.splice(ind + 1, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+          arr.push({ title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       }
+      arr.push({ title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } })
+      arr.push({ title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       //  审核,需用到库存
       if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) {
-        arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
+        arr.push({ title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
+      }
+      arr.push({ title: '待下推数', dataIndex: 'unpushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      arr.push({ title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      arr.push({ title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      if (this.isAveragePrice) {
+        arr.push({ title: '单重(kg)', dataIndex: 'weight', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.push({ title: '合计重量(kg)', dataIndex: 'totalWeight', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      if (this.$hasPermissions(this.pageTypeAuth + '_costPrice') && this.isAveragePrice) {
+        arr.push({ title: '平均成本公斤单价', dataIndex: 'weightAvgCost', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      if (this.$hasPermissions(this.pageTypeAuth + '_salesPrice') && this.isAveragePrice) {
+        arr.push({ title: '平均售价公斤单价', dataIndex: 'weightAvgPrice', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -545,5 +561,9 @@ export default {
         font-weight: bold;
         color: red;
       }
+      .form-grid{
+        display:flex;
+        flex:1;
+      }
     }
   </style>

+ 0 - 1
src/views/salesManagement/salesQueryNew/list.vue

@@ -915,7 +915,6 @@ export default {
     .tongji-bar{
       flex:1;
       display: flex;
-      align-items: center;
     }
   }
 </style>