Selaa lähdekoodia

Merge commit 'd0463e6a0c89635f8fede38ab6c9f83defd9a7c8' into HEAD

gitadmin 1 vuosi sitten
vanhempi
commit
e78d06073e
24 muutettua tiedostoa jossa 946 lisäystä ja 490 poistoa
  1. 1 1
      public/version.json
  2. 36 24
      src/api/promotion.js
  3. 39 33
      src/views/allocationManagement/transferReturn/edit.vue
  4. 163 148
      src/views/allocationManagement/transferReturn/editGrp.vue
  5. 1 1
      src/views/allocationManagement/transferReturn/list.vue
  6. 25 8
      src/views/common/rangeDate.vue
  7. 110 25
      src/views/promotionRulesManagement/dealerPromotions/detailModal.vue
  8. 119 0
      src/views/promotionRulesManagement/dealerPromotions/productPreviewModal.vue
  9. 69 9
      src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue
  10. 103 28
      src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue
  11. 59 3
      src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue
  12. 0 1
      src/views/promotionRulesManagement/dealerPromotions/tableType1.vue
  13. 39 23
      src/views/reportData/priceDifferenceDetailReport/list.vue
  14. 38 45
      src/views/reportData/promotionSalesOrderReport/list.vue
  15. 40 49
      src/views/reportData/tireSalesReport/detailList.vue
  16. 6 6
      src/views/reportData/tireSalesReport/list.vue
  17. 15 7
      src/views/reportData/tireSalesReport/outDetailModal.vue
  18. 1 1
      src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue
  19. 1 1
      src/views/salesManagement/salesQueryNew/comps/detailProductList.vue
  20. 1 1
      src/views/salesManagement/salesQueryNew/comps/queryPart.vue
  21. 73 69
      src/views/salesManagement/salesQueryNew/list.vue
  22. 1 4
      src/views/salesReturnManagement/billOfLading/detail.vue
  23. 5 2
      src/views/salesReturnManagement/billOfLading/list.vue
  24. 1 1
      vue.config.js

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.40",
+    "version": "2.2.41",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 36 - 24
src/api/promotion.js

@@ -9,7 +9,7 @@ export const dealerPromotionList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('列表查询')
     }
   })
@@ -20,7 +20,7 @@ export const dealerPromotionSave = params => {
     url: '/promotion/create',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('新增')
     }
   })
@@ -39,7 +39,7 @@ export const dealerPromotionEdit = params => {
     url: '/promotion/modify',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('编辑')
     }
   })
@@ -51,7 +51,7 @@ export const dealerPromotionDel = params => {
     url: `/promotion/delete/${params.sn}`,
     data: {},
     method: 'get',
-    headers:{
+    headers: {
       'module': encodeURIComponent('删除')
     }
   })
@@ -62,7 +62,7 @@ export const getRuleDetail = (params) => {
     url: `/promotion/rule/findBySn/${params.sn}`,
     data: {},
     method: 'get'
-    
+
   })
 }
 // 规则设置 列表
@@ -71,7 +71,7 @@ export const getRuleQueryList = (params) => {
     url: '/promotion/rule/queryList',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('明细列表查询')
     }
   })
@@ -91,7 +91,7 @@ export const promotionSave = (params) => {
     url: '/promotion/rule/save',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('新增/编辑')
     }
   })
@@ -102,7 +102,7 @@ export const promotionRulesDel = (params) => {
     url: '/promotion/rule/delete',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('删除')
     }
   })
@@ -113,7 +113,7 @@ export const promotionSubmit = (params) => {
     url: `/promotion/submit/${params.sn}`,
     data: {},
     method: 'get',
-    headers:{
+    headers: {
       'module': encodeURIComponent('提交')
     }
   })
@@ -125,7 +125,7 @@ export const modifyEnabledFlag = (params) => {
     url: '/promotion/modifyEnabledFlag',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('发布')
     }
   })
@@ -136,7 +136,7 @@ export const promotionAudit = (params) => {
     url: '/promotion/audit',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('审核')
     }
   })
@@ -147,7 +147,7 @@ export const promotionDateModify = (params) => {
     url: '/promotion/promotionDateModify',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('变更促销时间')
     }
   })
@@ -158,7 +158,7 @@ export const promotionIsOver = (params) => {
     url: `/promotion/isOver/${params.sn}`,
     data: {},
     method: 'get',
-    headers:{
+    headers: {
       'module': encodeURIComponent('终止')
     }
   })
@@ -172,7 +172,7 @@ export const downNormalFail = (params) => {
     method: 'post',
     data: paramsNew,
     responseType: 'blob',
-    headers:{
+    headers: {
       'module': encodeURIComponent('导出门槛产品错误项')
     }
   })
@@ -187,7 +187,7 @@ export const downSpecialFail = (params) => {
     method: 'post',
     data: paramsNew,
     responseType: 'blob',
-    headers:{
+    headers: {
       'module': encodeURIComponent('导出促销产品错误项')
     }
   })
@@ -201,7 +201,7 @@ export const downDealerFail = (params) => {
     method: 'post',
     data: params,
     responseType: 'blob',
-    headers:{
+    headers: {
       'module': encodeURIComponent('导出参与客户 (经销商)错误项')
     }
   })
@@ -212,7 +212,7 @@ export const queryCreatorList = (params) => {
   return axios({
     url: '/promotion/queryCreatorList',
     data: params,
-    method: 'post',
+    method: 'post'
   })
 }
 
@@ -222,7 +222,7 @@ export const handleCopyData = (params) => {
     url: '/promotion/copyData',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('复制')
     }
   })
@@ -237,7 +237,7 @@ export const queryAuditPageList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('已选参与客户列表查询')
     }
   })
@@ -251,7 +251,7 @@ export const queryDealerPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('经销商列表查询')
     }
   })
@@ -262,7 +262,7 @@ export const midwaySubmit = (params) => {
     url: '/promotion/dealer/midwaySubmit',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('提交审核')
     }
   })
@@ -273,7 +273,7 @@ export const dealerMidwayUpdate = (params) => {
     url: '/promotion/dealer/midwayUpdate',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('添加经销商并更新列表显示状态')
     }
   })
@@ -284,8 +284,8 @@ export const dealerMidwayAudit = (params) => {
     url: '/promotion/dealer/midwayAudit',
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent(params.dealerAuditStatus=='AUDIT_PASS'?'审核通过':'审核不通过')
+    headers: {
+      'module': encodeURIComponent(params.dealerAuditStatus == 'AUDIT_PASS' ? '审核通过' : '审核不通过')
     }
   })
 }
@@ -306,3 +306,15 @@ export const updateDealerSnList = (params) => {
     method: 'post'
   })
 }
+// 导出规则产品明细列表
+export const excelProductExcel = (params) => {
+  return axios({
+    url: '/promotion/rule/excelProductExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}

+ 39 - 33
src/views/allocationManagement/transferReturn/edit.vue

@@ -86,18 +86,22 @@
           :scroll="{ y: 300 }"
           :defaultLoadData="false"
           bordered>
+          <!-- 价格级别 -->
+          <template slot="priceLevel" slot-scope="text, record, index">
+            <span v-if="record.powerFlag!=0">{{ record.priceLevelDictValue }}</span>
+            <v-select
+              v-else
+              style="width:90%;"
+              size="small"
+              code="PRICE_LEVEL"
+              v-model="record.priceLevel"
+              allowClear
+              placeholder="请选择价格级别"
+              @change="e => handlePriceLevel(e,index)"></v-select>
+          </template>
           <!-- 退货单价 -->
           <template slot="returnPrice" slot-scope="text, record">
-            <div @dblclick.stop>
-              <a-input-number
-                size="small"
-                v-model="record.productPrice"
-                :precision="2"
-                :min="0"
-                :max="99999999"
-                placeholder="请输入"
-                style="width: 100%;" />
-            </div>
+            <span>{{ record.productPrice }}</span>
           </template>
           <!-- 退货数量 -->
           <template slot="returnQty" slot-scope="text, record">
@@ -176,18 +180,6 @@
           :scroll="{ y: 300 }"
           :defaultLoadData="false"
           bordered>
-          <!-- 退货单价 -->
-          <template slot="returnPrice" slot-scope="text, record">
-            <a-input-number
-              size="small"
-              v-model="record.price"
-              :precision="2"
-              :min="0"
-              :max="99999999"
-              @blur="e => priceChange(e.target.value, record)"
-              placeholder="请输入"
-              style="width: 100%;" />
-          </template>
           <!-- 退货数量 -->
           <template slot="returnQty" slot-scope="text, record">
             <a-input-number
@@ -286,19 +278,25 @@ export default {
       loading: false,
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
+      dealerLevel: '',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        const dealerLevel = this.dealerLevel == 'OTHER' ? undefined : this.dealerLevel
-        const warehouseSn = this.basicInfoData.warehouseSn
-        const dealerSnInfo = this.dealerLevel != 'OTHER' ? this.basicInfoData.dealerEntity.dealerSn : undefined
-        const ajaxName = _this.$route.params.targetType === 'DEALER' ? queryStockProductPage : stockQueryStockProductPage
-        return ajaxName(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel == 0 ? '' : dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
+        const warehouseSn = _this.basicInfoData.warehouseSn
+        const dealerLevel = _this.dealerLevel == 'OTHER' ? undefined : _this.dealerLevel
+        const dealerSnInfo = _this.dealerLevel != 'OTHER' ? _this.basicInfoData.dealerEntity.dealerSn : undefined
+        const ajaxName = _this.basicInfoData.targetType === 'DEALER' ? queryStockProductPage : stockQueryStockProductPage
+        return ajaxName(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel === '0' ? '' : dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].qty = 1
+            if (_this.basicInfoData.targetType === 'DEALER') {
+              data.list[i].productPrice = data.list[i].priceLevel === 'PROVINCE' ? data.list[i].provincePrice : data.list[i].priceLevel === 'CITY' ? data.list[i].cityPrice : data.list[i].specialPrice
+            } else {
+              data.list[i].productPrice = data.list[i].lastStockCost
+            }
           }
           this.loadDataSource = data.list || []
           this.disabled = false
@@ -307,7 +305,6 @@ export default {
       },
       loadDataSource: [],
       localDataSource: [],
-      dealerLevel: '',
       allocateReturnSn: '',
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
@@ -336,18 +333,19 @@ export default {
   },
   computed: {
     columns () {
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'left', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'right' },
+        { title: '退货单价', dataIndex: 'productPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$route.params.targetType === 'DEALER') {
-        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
+      if (_this.basicInfoData && _this.basicInfoData.targetType === 'DEALER') {
+        arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', scopedSlots: { customRender: 'priceLevel' } })
       }
       return arr
     },
@@ -358,7 +356,7 @@ export default {
         { title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', align: 'left', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'right' },
+        { title: '退货单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
@@ -369,6 +367,10 @@ export default {
     }
   },
   methods: {
+    // 价格等级
+    handlePriceLevel (val, pos) {
+      this.loadDataSource[pos].productPrice = val == 'PROVINCE' ? this.loadDataSource[pos].provincePrice : val == 'CITY' ? this.loadDataSource[pos].cityPrice : this.loadDataSource[pos].specialPrice
+    },
     // 修改备注
     handleEditRemark (flag) {
       const _this = this
@@ -446,6 +448,10 @@ export default {
     },
     //  添加/编辑
     handleAdd (row, isEdit, isRefresh) {
+      if (this.dealerLevel === 'DEALER' && !row.priceLevel) {
+        this.$message.error('请先选择产品价格级别')
+        return
+      }
       const params = {
         allocateReturnSn: this.allocateReturnSn,
         productSn: row.productSn,
@@ -540,6 +546,7 @@ export default {
       allocateReturnQueryBySn({ allocateReturnSn: this.allocateReturnSn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
+          this.dealerLevel = res.data.dealerLevel || '0'
           if (this.basicInfoData.costTypeSn) {
             this.allocateTypeVal = [this.basicInfoData.costTypeSn, this.basicInfoData.allocateSortSn, this.basicInfoData.allocateReturnTypeSn]
           }
@@ -576,7 +583,6 @@ export default {
       this.$refs.chooseTable.refresh()
     },
     pageInit () {
-      this.dealerLevel = this.$route.params.dealerLevel
       this.allocateReturnSn = this.$route.params.sn
       this.refashPage()
     }

+ 163 - 148
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -52,58 +52,58 @@
       </a-card>
       <!-- 选择产品 -->
       <a-card size="small" title="选择产品" :bordered="false" class="editGrap-cont">
-            <!-- 筛选条件 -->
-            <div class="table-page-search-wrapper" style="display:flex;align-items: center;">
-              <div style="margin-bottom: 10px;padding-right: 20px;">
-                <a-button
-                  type="primary"
-                  class="button-info"
-                  id="salesEdit-plDel-btn"
-                  @click="handleBatchAdd">批量添加</a-button>
-                  <span>已选{{ selectTotal }}项</span>
-              </div>
-              <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-                <a-row :gutter="15">
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="调拨单号" prop="allocateNo">
-                      <a-input id="editGrap-allocateNo" v-model.trim="queryParam.allocateNo" placeholder="请输入调拨单号" allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品编码" prop="productCode">
-                      <a-input id="editGrap-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24">
-                    <a-form-item label="产品名称" prop="productName">
-                      <a-input id="editGrap-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
-                    </a-form-item>
-                  </a-col>
-                  <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
-                    <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
-                  </a-col>
-                </a-row>
-              </a-form>
-            </div>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="table"
-              size="small"
-              index="0"
-              tableId="table1"
-              :rowKey="(record) => record.allocateNo +'-'+ record.productSn"
-              :columns="columns"
-              :customRow="handleClickRow"
-              :data="loadData"
-              :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.refundableQty } }) }"
-              @rowSelection="rowSelectionFun"
-              :scroll="{ y: 300 }"
-              :defaultLoadData="false"
-              bordered>
-              <!-- 退货单价 -->
-              <template slot="returnPrice" slot-scope="text, record">
+        <!-- 筛选条件 -->
+        <div class="table-page-search-wrapper" style="display:flex;align-items: center;">
+          <div style="margin-bottom: 10px;padding-right: 20px;">
+            <a-button
+              type="primary"
+              class="button-info"
+              id="salesEdit-plDel-btn"
+              @click="handleBatchAdd">批量添加</a-button>
+            <span>已选{{ selectTotal }}项</span>
+          </div>
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="调拨单号" prop="allocateNo">
+                  <a-input id="editGrap-allocateNo" v-model.trim="queryParam.allocateNo" placeholder="请输入调拨单号" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品编码" prop="productCode">
+                  <a-input id="editGrap-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品名称" prop="productName">
+                  <a-input id="editGrap-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          index="0"
+          tableId="table1"
+          :rowKey="(record) => record.allocateNo +'-'+ record.productSn"
+          :columns="columns"
+          :customRow="handleClickRow"
+          :data="loadData"
+          :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.refundableQty } }) }"
+          @rowSelection="rowSelectionFun"
+          :scroll="{ y: 300 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 退货单价 -->
+          <!-- <template slot="returnPrice" slot-scope="text, record">
                 <div @dblclick.stop>
                   <a-input-number
                     size="small"
@@ -114,89 +114,102 @@
                     placeholder="请输入"
                     style="width: 100%;" />
                 </div>
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button
-                  size="small"
-                  v-if="record.refundableQty"
-                  type="link"
-                  class="button-primary"
-                  @click="handleAdd(record)"
-                  id="editGrap-add-btn">添加</a-button>
-                <span v-else>--</span>
-              </template>
-            </s-table>
+              </template> -->
+          <!-- 本次可退数量 -->
+          <template slot="returnNumber" slot-scope="text, record,index">
+            <a-input-number
+              v-if="record.refundableQty!=0"
+              size="small"
+              v-model="record.returnableQty"
+              :precision="0"
+              :min="0"
+              :max="record.refundableQty"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>0</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              v-if="record.refundableQty"
+              type="link"
+              class="button-primary"
+              @click="handleAdd(record)"
+              id="editGrap-add-btn">添加</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
       </a-card>
       <!-- 已选产品 -->
       <a-card size="small" title="已选产品" :bordered="false" class="editGrap-cont">
-            <!-- 总计 -->
-            <a-alert type="info" style="margin-bottom:10px">
-              <div slot="message">
-                退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ;
-                <span>退货总金额:<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(basicInfoData.totalPrice) : '--' }}</strong>;</span>
-              </div>
-            </a-alert>
-            <!-- 筛选条件 -->
-            <a-row :gutter="15">
-              <a-col :span="17">
-                <div class="table-page-search-wrapper">
-                  <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
-                    <a-row :gutter="15">
-                      <a-col :md="9" :sm="24">
-                        <a-form-item label="产品编码" prop="productCode">
-                          <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
-                        </a-form-item>
-                      </a-col>
-                      <a-col :md="9" :sm="24">
-                        <a-form-item label="产品名称" prop="productName">
-                          <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
-                        </a-form-item>
-                      </a-col>
-                      <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                        <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
-                        <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
-                      </a-col>
-                    </a-row>
-                  </a-form>
-                </div>
-              </a-col>
-              <a-col :span="7" style="text-align: right;">
-                <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
-                <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
-              </a-col>
-            </a-row>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="chooseTable"
+        <!-- 总计 -->
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            退货总数量:<strong>{{ (basicInfoData&&(basicInfoData.totalQty || basicInfoData.totalQty==0)) ? basicInfoData.totalQty : '--' }}</strong> ;
+            <span>退货总金额:<strong>{{ (basicInfoData&&(basicInfoData.totalPrice || basicInfoData.totalPrice==0)) ? toThousands(basicInfoData.totalPrice) : '--' }}</strong>;</span>
+          </div>
+        </a-alert>
+        <!-- 筛选条件 -->
+        <a-row :gutter="15">
+          <a-col :span="17">
+            <div class="table-page-search-wrapper">
+              <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+                <a-row :gutter="15">
+                  <a-col :md="9" :sm="24">
+                    <a-form-item label="产品编码" prop="productCode">
+                      <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="9" :sm="24">
+                    <a-form-item label="产品名称" prop="productName">
+                      <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                  </a-col>
+                </a-row>
+              </a-form>
+            </div>
+          </a-col>
+          <a-col :span="7" style="text-align: right;">
+            <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
+            <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
+          </a-col>
+        </a-row>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="chooseTable"
+          size="small"
+          index="1"
+          tableId="table2"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="chooseColumns"
+          :data="chooseLoadData"
+          :scroll="{ y: 300 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 退货单价 -->
+          <!-- <template slot="returnPrice" slot-scope="text, record">
+            <a-input-number
               size="small"
-              index="1"
-              tableId="table2"
-              :rowKey="(record) => record.no"
-              rowKeyName="no"
-              :columns="chooseColumns"
-              :data="chooseLoadData"
-              :scroll="{ y: 300 }"
-              :defaultLoadData="false"
-              bordered>
-              <!-- 退货单价 -->
-              <template slot="returnPrice" slot-scope="text, record">
-                <a-input-number
-                  size="small"
-                  v-model="record.price"
-                  @blur="e => priceChange(e.target.value, record)"
-                  :precision="2"
-                  :min="0"
-                  :max="99999999"
-                  placeholder="请输入"
-                  style="width: 100%;" />
-              </template>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
-              </template>
-            </s-table>
+              v-model="record.price"
+              @blur="e => priceChange(e.target.value, record)"
+              :precision="2"
+              :min="0"
+              :max="99999999"
+              placeholder="请输入"
+              style="width: 100%;" />
+          </template> -->
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
+          </template>
+        </s-table>
       </a-card>
     <!--</a-spin>-->
     </div>
@@ -278,15 +291,13 @@ export default {
       loading: false,
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      targetType: '',
       allocateReturnSn: '',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        const warehouseSn = this.basicInfoData.warehouseSn
-        const targetSn =  this.basicInfoData.targetSn
+        const targetSn = this.basicInfoData.targetSn
         const allocateNo = this.queryParam.allocateNo
-        const otherParams = { allocateBill: { targetType: this.targetType , targetSn:targetSn, allocateNo: allocateNo } }
+        const otherParams = { allocateBill: { targetType: this.basicInfoData.targetType, targetSn: targetSn, allocateNo: allocateNo } }
         return allocDetailQueryPageForReturn(Object.assign(parameter, this.queryParam, otherParams)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -294,6 +305,7 @@ export default {
             data.list[i].no = no + i + 1
             data.list[i].returnPrice = data.list[i].price
             data.list[i].oldPrice = data.list[i].price
+            data.list[i].returnableQty = undefined
           }
           this.loadDataSource = data.list || []
           this.disabled = false
@@ -338,11 +350,12 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '剩余可退数量', dataIndex: 'refundableQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
+        { title: '退货单价', dataIndex: 'returnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次可退数量', scopedSlots: { customRender: 'returnNumber' }, width: '8%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-        arr.splice(5,0,{ title: '调拨单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(5, 0, { title: '调拨单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     },
     chooseColumns () {
@@ -353,11 +366,11 @@ export default {
         { title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
+        { title: '退货单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-        arr.splice(7,0,{ title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }})
+      arr.splice(7, 0, { title: '退货金额', dataIndex: 'totalReturnPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     }
   },
@@ -434,7 +447,7 @@ export default {
       _this.editRemark = false
     },
     // 修改仓库
-    updateWarehouse(warehouseSn){
+    updateWarehouse (warehouseSn) {
       this.basicInfoData.warehouseSn = warehouseSn
       this.handleEditRemark()
     },
@@ -498,12 +511,17 @@ export default {
     },
     //  添加/编辑
     handleAdd (row, isEdit, isRefresh) {
+      if (!row.returnableQty) {
+        this.$message.error('本次可退数量不能为空!')
+        return
+      }
       const params = {
         allocateReturnSn: this.allocateReturnSn,
         productSn: row.productSn,
         price: isEdit ? row.price : row.returnPrice,
         allocateNo: row.allocateNo,
-        allocateSn: row.allocateSn
+        allocateSn: row.allocateSn,
+        returnableQty: row.returnableQty
       }
       const fun = isEdit ? allocReturnDetailUpdate : allocReturnDetailInsert
       if (isEdit) { // 编辑
@@ -605,12 +623,10 @@ export default {
     handleBack () {
       this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
     },
-    // 已选产品 退货单价  change
-    priceChange (val, record) {
-      //  光标移出,值发生改变再调用编辑接口
-      if (Number(val) != Number(record.oldPrice)) {
-        this.handleAdd(record, true, 'noRefresh')
-      }
+    // 已选产品 退货数量  change
+    returnQtyChange (val, row, pos) {
+      this.localDataSource[pos].returnQty = Number(val)
+      this.handleAdd(row, true, 'refresh')
     },
     // 刷新当前页面
     refashPage () {
@@ -619,7 +635,6 @@ export default {
       this.$refs.chooseTable.refresh()
     },
     pageInit () {
-      this.targetType = this.$route.params.targetType
       this.allocateReturnSn = this.$route.params.sn
       this.getDetail()
       this.chooseResetSearchForm()

+ 1 - 1
src/views/allocationManagement/transferReturn/list.vue

@@ -317,7 +317,7 @@ export default {
     },
     //  编辑
     handleEdit (row) {
-      this.$router.push({ name: row.grabFlag == 1 ? 'transferReturnGrpEdit' : 'transferReturnEdit', params: { sn: row.allocateReturnSn, targetType: row.targetType, dealerLevel: row.dealerLevel || '0' } })
+      this.$router.push({ name: row.grabFlag == 1 ? 'transferReturnGrpEdit' : 'transferReturnEdit', params: { sn: row.allocateReturnSn } })
     },
     // 品检
     handleCheck (row) {

+ 25 - 8
src/views/common/rangeDate.vue

@@ -1,7 +1,7 @@
 <template>
   <a-range-picker
     style="width:100%"
-    :ranges="ranges"
+    :ranges="rangesVal"
     :value="date"
     :size="size"
     :disabledDate="disabledDate"
@@ -27,18 +27,35 @@ export default {
     showTime: {
       type: Boolean,
       default: true
+    },
+    today: {
+      type: Boolean,
+      default: true
     }
   },
   data () {
     return {
       date: this.value,
       dateFormat: 'YYYY-MM-DD',
-      selectPriceDate: '',
-      ranges: {
-        '今天': [moment(), moment()],
-        '近一个月': [moment().subtract(1, 'months'), moment()],
-        '本月': [moment().startOf('month'), moment()],
-        '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] }
+      selectPriceDate: ''
+    }
+  },
+  computed: {
+    rangesVal () {
+      if (this.today) {
+        return {
+          '今天': [moment(), moment()],
+          '近一个月': [moment().subtract(1, 'months'), moment()],
+          '本月': [moment().startOf('month'), moment()],
+          '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')]
+        }
+      } else {
+        return {
+          '近一个月': [moment().subtract(1, 'months'), moment().subtract(1, 'days')],
+          '本月': [moment().startOf('month'), moment().subtract(1, 'days')],
+          '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')]
+        }
+      }
     }
   },
   methods: {
@@ -46,7 +63,7 @@ export default {
     disabledDate (current) {
       //  最早可倒推选择两年数据,最晚为今天
       const minYearVs = moment().subtract(2, 'years') //  两年前   负值
-      const maxYearVs = moment().endOf('day') //  今天,包含今天
+      const maxYearVs = this.today ? moment().endOf('day') : moment().subtract(1, 'days').endOf('day') //  今天,包含今天
       //  限制最多只能查一年区间的数据
       if (this.selectPriceDate) {
         const oMinYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD').subtract(1, 'years') //  当前选中开始日期前推一年

+ 110 - 25
src/views/promotionRulesManagement/dealerPromotions/detailModal.vue

@@ -76,23 +76,26 @@
         </a-form-model-item>
       </a-form-model>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <a-radio-group v-model="chooseVal" button-style="solid">
-          <a-radio-button value="a" v-show="form.gateFlag==='1'">
-            门槛产品
-          </a-radio-button>
-          <a-radio-button value="b" v-show="form.promotionRuleType!='PROMO_PROD'">
-            正价产品
-          </a-radio-button>
-          <a-radio-button value="c" v-show="(form.regularPromotionSameFlag==='0'||form.scopeFlag==='0')&&form.promotionRuleType!='BUY_PROD_GIVE_PROD'">
-            促销产品
-          </a-radio-button>
-          <a-radio-button :value="'c'+i" v-for="(item,i) in form.giveRuleList" :key="i" v-show="(form.regularPromotionSameFlag==='0'||form.scopeFlag==='0')&&form.promotionRuleType=='BUY_PROD_GIVE_PROD'&&form.giveRuleList">
-            {{ form.giveRuleList.length>1? '促销产品'+'(阶梯'+(i*1+1) +')' :'促销产品' }}
-          </a-radio-button>
-          <a-radio-button value="d" v-show="form.promotionRuleType=='PROMO_PROD'">
-            特价产品
-          </a-radio-button>
-        </a-radio-group>
+        <div class="flex">
+          <a-radio-group v-model="chooseVal" button-style="solid" @change="onChange">
+            <a-radio-button value="a" v-show="form.gateFlag==='1'">
+              门槛产品
+            </a-radio-button>
+            <a-radio-button value="b" v-show="form.promotionRuleType!='PROMO_PROD'">
+              正价产品
+            </a-radio-button>
+            <a-radio-button value="c" v-show="(form.regularPromotionSameFlag==='0'||form.scopeFlag==='0')&&form.promotionRuleType!='BUY_PROD_GIVE_PROD'">
+              促销产品
+            </a-radio-button>
+            <a-radio-button :value="'c'+i" v-for="(item,i) in form.giveRuleList" :key="i" v-show="(form.regularPromotionSameFlag==='0'||form.scopeFlag==='0')&&form.promotionRuleType=='BUY_PROD_GIVE_PROD'&&form.giveRuleList">
+              {{ form.giveRuleList.length>1? '促销产品'+'(阶梯'+(i*1+1) +')' :'促销产品' }}
+            </a-radio-button>
+            <a-radio-button value="d" v-show="form.promotionRuleType=='PROMO_PROD'">
+              特价产品
+            </a-radio-button>
+          </a-radio-group>
+          <a-button type="link" v-show="isShowPreview" class="button-info" @click="handlePreview">预览</a-button>
+        </div>
         <!-- 列表 -->
         <div v-show="chooseVal==='a'||chooseVal==='b'||chooseVal==='c'">
           <a-table
@@ -218,15 +221,19 @@
         <a-button id="dealerPromotions-basicInfo-modal-back" @click="isShow = false">关闭</a-button>
       </div>
     </a-spin>
+    <!-- 预览弹窗 -->
+    <productPreviewModal ref="previewModal" :openModal="openProductModal" :dataList="previewList" @close="closeProductModal"></productPreviewModal>
   </a-modal>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { getRuleDetail } from '@/api/promotion'
+import productPreviewModal from './productPreviewModal'
 export default {
   name: 'DetailModal',
   mixins: [commonMixin],
+  components: { productPreviewModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -235,6 +242,10 @@ export default {
     itemSn: {
       type: String,
       default: ''
+    },
+    pageType:{
+      type: String,
+      default: 'promotionsPage'
     }
   },
   data () {
@@ -269,13 +280,17 @@ export default {
         productBrandList: [],
         productThisList: []
       },
+
       chooseVal: 'a',
       columns: [
         { title: '产品分类', width: '30%', scopedSlots: { customRender: 'productType' }, align: 'center' },
         { title: '品牌', width: '35%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
         { title: '产品', width: '35%', scopedSlots: { customRender: 'product' }, align: 'center' },
         { title: '设置起订量', width: '20%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
-      ]
+      ],
+      isShowPreview: false, // 是否显示预览按钮
+      openProductModal: false, // 预览弹窗
+      previewList: []// 预览值
     }
   },
   computed: {
@@ -360,19 +375,18 @@ export default {
           const resultObj = res.data
           if (resultObj.gateFlag == '1') {
             this.chooseVal = 'a'
+            this.isShowPreview =this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.gateProductList)
           } else {
             if (resultObj.promotionRuleType == 'BUY_PROD_GIVE_PROD') {
               this.chooseVal = 'b'
+              this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.regularProductList)
             } else if (resultObj.promotionRuleType == 'BUY_PROD_GIVE_MONEY') {
               this.chooseVal = 'b'
+              this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.regularProductList)
             } else {
               this.chooseVal = 'd'
+              this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.specialProductList)
             }
-            // if (resultObj.giveRuleList && resultObj.giveRuleList.length > 0) {
-            //   this.chooseVal = 'c0'
-            // } else {
-            //   this.chooseVal = resultObj.promotionRuleType == 'PROMO_PROD' ? 'd' : 'b'
-            // }
           }
           this.form = { ...this.form, ...resultObj }
           this.setTableData = [{
@@ -382,6 +396,72 @@ export default {
           }]
         }
       })
+    },
+    // 判断预览按钮是否显示
+    judgeBtnShow (conData) {
+      const hasData = conData.some(item => item.productThisList)
+      return hasData
+    },
+    getPreviewList (dataList) {
+      let newList = []
+      dataList.forEach(con => {
+        if (con.productThisList) {
+          con.productThisList.forEach((item, i) => {
+            item.unitTypeInfo = con.unitTypeDictValue + con.unitQty
+            item.productTypeInfo = con.promotionProductType
+          })
+          newList = [ ...newList, ...con.productThisList ]
+        }
+      })
+      return newList
+    },
+    // 预览
+    handlePreview () {
+      const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : this.chooseVal === 'c' ? 'gift' : this.chooseVal === 'd' ? 'special' : 'giftGroup'
+      const titName = this.chooseVal === 'a' ? '门槛产品' : this.chooseVal === 'b' ? '正价产品' : this.chooseVal === 'd' ? '特价产品' : '促销产品'
+      if (dataName != 'giftGroup') {
+        const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
+        if (newPreviewList && newPreviewList.length > 0) {
+          this.previewList = newPreviewList
+          const resuleObj = {
+            tit: titName,
+            promotionRuleSn: this.itemSn,
+            promotionProductType: newPreviewList[0].productTypeInfo
+          }
+          this.$refs.previewModal.pageInit(resuleObj)
+        }
+      } else {
+        // 阶梯数据处理
+        const stepIndex = this.chooseVal.split('')[1]
+        if (this.form.giftProductMap && Object.keys(this.form.giftProductMap).length > 0) {
+          const stepPreviewList = this.getPreviewList(this.form.giftProductMap['GIFT' + (stepIndex * 1 + 1)])
+          this.previewList = stepPreviewList
+          const resuleObj = {
+            tit: '促销产品(阶梯' + (stepIndex * 1 + 1) + ')',
+            promotionRuleSn: this.itemSn,
+            promotionProductType: stepPreviewList[0].productTypeInfo,
+            scopeLevel: (stepIndex * 1 + 1)
+          }
+          this.$refs.previewModal.pageInit(resuleObj)
+        }
+      }
+      this.openProductModal = true
+    },
+    closeProductModal () {
+      this.previewList = []
+      this.openProductModal = false
+    },
+    onChange () {
+      const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : this.chooseVal === 'c' ? 'gift' : this.chooseVal === 'd' ? 'special' : 'giftGroup'
+      if (dataName != 'giftGroup') {
+        this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(this.form[dataName + 'ProductList'])
+      } else {
+        // 阶梯数据处理
+        const pos = this.chooseVal.split('')[1]
+        if (this.form.giftProductMap && Object.keys(this.form.giftProductMap).length > 0) {
+          this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(this.form.giftProductMap['GIFT' + (pos * 1 + 1)])
+        }
+      }
     }
   },
   watch: {
@@ -431,11 +511,11 @@ export default {
     .tabBox::-webkit-scrollbar-track {
       background: transparent;
     }
-     
+
     .tabBox::-webkit-scrollbar-thumb {
       background: transparent;
     }
-     
+
     .tabBox::-webkit-scrollbar-button {
       display: none;
     }
@@ -457,6 +537,11 @@ export default {
       color:#333 !important;
       background:#fff;
    }
+   .flex{
+     display:flex;
+     align-items:center;
+     justify-content:space-between;
+   }
   }
 
 </style>

+ 119 - 0
src/views/promotionRulesManagement/dealerPromotions/productPreviewModal.vue

@@ -0,0 +1,119 @@
+<template>
+  <a-modal
+    centered
+    class="productPreview-modal"
+    :footer="null"
+    :maskClosable="false"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <template slot="title">
+      <div v-if="resObj"><strong>{{ resObj.tit }}</strong>(已选<span style="color:#ed1c24;">{{ dataList.length }}</span>项)</div>
+      <span v-else>预览弹窗</span>
+    </template>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="height:540px;">
+        <ve-table
+          :max-height="500"
+          :columns="columns"
+          :table-data="newDataList"
+          :border-around="true"
+          :border-y="true"
+        />
+        <div v-show="newDataList&&newDataList.length==0" class="empty-data" style="height:'300px'"><a-empty description="暂无数据" :image="simpleImage"/></div>
+      </div>
+      <div class="btn-cont">
+        <a-button type="primary" v-if="resObj&&resObj.promotionRuleSn" style="margin-right:20px;" @click="handleExport" :loading="exportLoading">导出</a-button>
+        <a-button id="productPreview-back" @click="isShow = false">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { Empty } from 'ant-design-vue'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { excelProductExcel } from '@/api/promotion'
+export default {
+  name: 'ProductPreviewModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    dataList: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      titName: '',
+      resObj: {},
+      exportLoading: false,
+      spinning: false,
+      columns: [
+        { title: '序号', field: 'no', key: 'a', width: 20, align: 'center', operationColumn: false },
+        { title: '产品编码', field: 'productCode', key: 'b', width: '45%', align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
+        { title: '起订量', field: 'unitTypeInfo', key: 'c', width: '45%', align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } }
+      ],
+      newDataList: this.dataList
+    }
+  },
+  methods: {
+    pageInit (obj) {
+      this.resObj = obj
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.exportLoading = true
+      _this.spinning = true
+      const ajaxData = {
+        promotionRuleSn: _this.resObj.promotionRuleSn,
+        promotionProductType: _this.resObj.promotionProductType,
+        scopeLevel: _this.resObj.scopeLevel || 1
+      }
+      hdExportExcel(excelProductExcel, ajaxData, '促销活动' + this.resObj.tit, function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        if (this.dataList && this.dataList.length > 0) {
+          this.newDataList = this.dataList.map((item, i) => {
+            item.no = i * 1 + 1
+            return item
+          })
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .productPreview-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 5px 0 10px;
+    }
+  }
+</style>

+ 69 - 9
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -178,12 +178,15 @@
               促销产品
             </a-radio-button>
           </a-radio-group>
-          <a-button
-            size="small"
-            type="link"
-            class="button-info"
-            @click="openGuideModal=true"
-            id="promotionList-edit-btn">+导入产品</a-button>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              @click="openGuideModal=true"
+              id="promotionList-edit-btn">+导入产品</a-button>
+            <a-button type="link" class="button-error" @click="handlePreview">预览</a-button>
+          </div>
         </div>
         <div v-show="chooseVal=='a'"><tableType1 :unitTypeList="unitTypeDataList" ref="cillProduct"></tableType1></div>
         <div v-show="chooseVal=='b'"><tableType1 :unitTypeList="unitTypeDataList" ref="normalPriceProduct"></tableType1></div>
@@ -196,6 +199,8 @@
     </a-spin>
     <!-- 导入产品 -->
     <importGuideModal goodFlag="1" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
+    <!-- 预览弹窗 -->
+    <productPreviewModal ref="previewModal" :openModal="openProductModal" :dataList="previewList" @close="closeProductModal"></productPreviewModal>
   </a-modal>
 </template>
 
@@ -206,10 +211,11 @@ import tableType1 from './tableType1.vue'
 import { promotionSave, getRuleDetail } from '@/api/promotion'
 import ImportGuideModal from './importGuideModal.vue'
 import { getLookUpData } from '@/api/data'
+import productPreviewModal from './productPreviewModal'
 export default {
   name: 'PromotionListBasicInfoModal',
   mixins: [commonMixin],
-  components: { VSelect, tableType1, ImportGuideModal },
+  components: { VSelect, tableType1, ImportGuideModal, productPreviewModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -262,7 +268,9 @@ export default {
         promotionValue: undefined
       }],
       code: 'SCOPE_UNIT_TYPE', // 起订类型数据字典
-      unitTypeDataList: []
+      unitTypeDataList: [],
+      openProductModal: false, // 预览弹窗
+      previewList: []// 预览值
     }
   },
   methods: {
@@ -546,10 +554,11 @@ export default {
     // 获取编辑详情
     getDetail () {
       const _this = this
+      _this.spinning = true
       getRuleDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
-          this.chooseVal = res.data.gateFlag == '0' ? 'b' : 'a'
           const resultObj = res.data
+          _this.chooseVal = resultObj.gateFlag == '0' ? 'b' : 'a'
           if (resultObj.gateFlag === '1') {
             resultObj.gateValue = resultObj.gateType === 'RATIO_AMOUNT' ? resultObj.gateValue * 100 : resultObj.gateValue
           }
@@ -573,6 +582,7 @@ export default {
           _this.form = { ..._this.form, ...resultObj }
           _this.calculatePrice()
         }
+        _this.spinning = false
       })
     },
     newData (list) {
@@ -582,6 +592,7 @@ export default {
           const brandList = []
           con.productBrandList.forEach(item => {
             item.brandName = item.productBrandName
+            item.brandSn = item.productBrandSn
             const brandObj = {
               productBrandSn: item.productBrandSn
             }
@@ -643,6 +654,55 @@ export default {
           _this.unitTypeDataList = res.data.list
         }
       })
+    },
+    // 获取预览数据
+    getPreviewList (dataList) {
+      if (dataList && dataList.length > 0) {
+        let newList = []
+        dataList.forEach(con => {
+          if (con.productThisList) {
+            con.productThisList.forEach((item, i) => {
+              item.unitTypeInfo = (con.unitType === 'SL' ? '按数量设置' : '按整箱设置') + con.unitQty
+              item.productTypeInfo = con.promotionProductType
+            })
+            newList = [ ...newList, ...con.productThisList ]
+          }
+        })
+        return newList
+      } else {
+        return []
+      }
+    },
+    // 预览  删除标签,添加标签  预览按钮显示不显示
+    handlePreview () {
+      const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : 'gift'
+      const titName = this.chooseVal === 'a' ? '门槛产品' : this.chooseVal === 'b' ? '正价产品' : '促销产品'
+      if (!this.itemSn) {
+        if (this.chooseVal === 'a') {
+          this.form.gateProductList = this.$refs.cillProduct.getResultVal()
+        } else if (this.chooseVal === 'b') {
+          this.form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
+        } else {
+          this.form.giftProductList = this.$refs.offerProduct.getResultVal()
+        }
+      }
+      this.$nextTick(() => {
+        const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
+        if (newPreviewList && newPreviewList.length === 0) {
+          this.$message.warning('暂时没有可预览的产品')
+          return
+        }
+        this.previewList = newPreviewList
+        const resuleObj = {
+          tit: titName
+        }
+        this.$refs.previewModal.pageInit(resuleObj)
+        this.openProductModal = true
+      })
+    },
+    closeProductModal () {
+      this.previewList = []
+      this.openProductModal = false
     }
   },
   watch: {

+ 103 - 28
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -173,12 +173,15 @@
               {{ fullGiftRuleList.length>1?'促销产品('+'阶梯'+(i*1+1)+')':'促销产品' }}
             </a-radio-button>
           </a-radio-group>
-          <a-button
-            size="small"
-            type="link"
-            class="button-info"
-            @click="openGuideModal=true"
-            id="promotionList-edit-btn">+导入产品</a-button>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              @click="openGuideModal=true"
+              id="promotionList-edit-btn">+导入产品</a-button>
+            <a-button type="link" class="button-error" @click="handlePreview">预览</a-button>
+          </div>
         </div>
         <div v-show="chooseVal=='a'"><tableType1 :unitTypeList="unitTypeDataList" ref="cillProduct"></tableType1></div>
         <div v-show="chooseVal=='b'"><tableType1 :unitTypeList="unitTypeDataList" ref="normalPriceProduct"></tableType1></div>
@@ -191,6 +194,8 @@
     </a-spin>
     <!-- 导入产品 -->
     <importGuideModal goodFlag="1" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
+    <!-- 预览弹窗 -->
+    <productPreviewModal ref="previewModal" :openModal="openProductModal" :dataList="previewList" @close="closeProductModal"></productPreviewModal>
   </a-modal>
 </template>
 
@@ -201,10 +206,11 @@ import tableType1 from './tableType1.vue'
 import { promotionSave, getRuleDetail, getNewScopeSn } from '@/api/promotion'
 import ImportGuideModal from './importGuideModal.vue'
 import { getLookUpData } from '@/api/data'
+import productPreviewModal from './productPreviewModal'
 export default {
   name: 'PromotionListBasicInfoModal',
   mixins: [commonMixin],
-  components: { VSelect, tableType1, ImportGuideModal },
+  components: { VSelect, tableType1, ImportGuideModal, productPreviewModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -227,12 +233,7 @@ export default {
         labelCol: { span: 4 },
         wrapperCol: { span: 17 }
       },
-      fullGiftRuleList: [{
-        id: undefined,
-        scopeLevel: undefined,
-        regularValue: undefined,
-        promotionValue: undefined
-      }],
+      fullGiftRuleList: [],
       form: {
         giveRuleType: 'RATIO', // 满赠规则类型: SUM_MONEY[金额叠加] / RATIO[按比例]   满产品送产品写死为: 按比例
         promotionRuleType: 'BUY_PROD_GIVE_PROD', // 买产品送产品
@@ -266,7 +267,9 @@ export default {
       id: null,
       code: 'SCOPE_UNIT_TYPE', // 起订类型数据字典
       unitTypeDataList: [],
-      loadingSave: false
+      loadingSave: false,
+      openProductModal: false, // 预览弹窗
+      previewList: []// 预览值
     }
   },
   methods: {
@@ -277,9 +280,6 @@ export default {
         item.regularValue = undefined
       })
     },
-    onChooseVal (e) {
-      this.chooseVal = e.target.value
-    },
     // 新增  满减规则  最多能添加五个
     async addFullGiftRule () {
       const result = await getNewScopeSn({})
@@ -541,7 +541,7 @@ export default {
       return flag
     },
     // 重置表格
-    async resetSearchForm () {
+    resetSearchForm () {
       this.form = {
         giveRuleType: 'RATIO', // 满赠规则类型: SUM_MONEY[金额叠加] / RATIO[按比例]   满产品送产品写死为: 按比例
         promotionRuleType: 'BUY_PROD_GIVE_PROD', // 买产品送产品
@@ -573,17 +573,13 @@ export default {
       this.fullGiftRuleList.forEach((val, i) => {
         this.$refs['offerProduct' + i][0].reSetTableData()
       })
-      const result = await getNewScopeSn({})
-      this.fullGiftRuleList = [{
-        id: result.data,
-        regularValue: undefined,
-        promotionValue: undefined
-      }]
+      this.fullGiftRuleList = []
       this.id = null
     },
     // 获取编辑详情
     getDetail () {
       const _this = this
+      _this.spinning = true
       getRuleDetail({ sn: _this.itemSn }).then(res => {
         if (res.status == 200) {
           const resultObj = res.data
@@ -593,11 +589,13 @@ export default {
           }
           if (resultObj.giveRuleList && resultObj.giveRuleList.length > 0) {
             _this.fullGiftRuleList = resultObj.giveRuleList
-            _this.$nextTick(() => {
-              resultObj.giveRuleList.forEach((item, i) => {
-                _this.$refs['offerProduct' + i][0].setTabVal(_this.newData(resultObj.giftProductMap['GIFT' + (i * 1 + 1)]))
+            if (resultObj.giftProductMap && Object.keys(resultObj.giftProductMap).length > 0) {
+              _this.$nextTick(() => {
+                resultObj.giveRuleList.forEach((item, i) => {
+                  _this.$refs['offerProduct' + i][0].setTabVal(_this.newData(resultObj.giftProductMap['GIFT' + (i * 1 + 1)]))
+                })
               })
-            })
+            }
           }
           // 重新组成保存数据
           if (resultObj.gateProductList && resultObj.gateProductList.length > 0) {
@@ -612,6 +610,7 @@ export default {
           delete newDataObj.giftProductList
           _this.form = newDataObj
         }
+        _this.spinning = false
       })
     },
     newData (list) {
@@ -621,6 +620,7 @@ export default {
           const brandList = []
           con.productBrandList.forEach(item => {
             item.brandName = item.productBrandName
+            item.brandSn = item.productBrandSn
             const brandObj = {
               productBrandSn: item.productBrandSn
             }
@@ -679,6 +679,80 @@ export default {
           _this.unitTypeDataList = res.data.list
         }
       })
+    },
+    // 获取预览产品数据
+    getPreviewList (dataList) {
+      if (dataList && dataList.length > 0) {
+        let newList = []
+        dataList.forEach(con => {
+          if (con.productThisList) {
+            con.productThisList.forEach((item, i) => {
+              item.unitTypeInfo = (con.unitType === 'SL' ? '按数量设置' : '按整箱设置') + con.unitQty
+              item.productTypeInfo = con.promotionProductType
+            })
+            newList = [ ...newList, ...con.productThisList ]
+          }
+        })
+        return newList
+      } else {
+        return []
+      }
+    },
+    // 预览
+    handlePreview () {
+      const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : 'giftGroup'
+      const titName = this.chooseVal === 'a' ? '门槛产品' : this.chooseVal === 'b' ? '正价产品' : '促销产品'
+      if (dataName != 'giftGroup') {
+        if (!this.itemSn) {
+          if (this.chooseVal === 'a') {
+            this.form.gateProductList = this.$refs.cillProduct.getResultVal()
+          } else if (this.chooseVal === 'b') {
+            this.form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
+          }
+        }
+        const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
+        if (newPreviewList && newPreviewList.length > 0) {
+          this.previewList = newPreviewList
+          const resuleObj = {
+            tit: titName
+          }
+          this.$nextTick(() => {
+            this.$refs.previewModal.pageInit(resuleObj)
+          })
+          this.openProductModal = true
+        } else {
+          this.$message.warning('暂时没有可预览的产品')
+        }
+      } else {
+        // 阶梯数据处理
+        const idInfo = this.chooseVal.split('c')[1]
+        const stepIndex = this.fullGiftRuleList.findIndex(item => item.id === idInfo)
+        if (stepIndex > -1 && !this.itemSn) {
+          this.form.giftProductMap['GIFT' + (stepIndex * 1 + 1)] = this.$refs['offerProduct' + stepIndex][0].getResultVal()
+        }
+        if (this.form.giftProductMap && Object.keys(this.form.giftProductMap).length > 0) {
+          const stepPreviewList = this.getPreviewList(this.form.giftProductMap['GIFT' + (stepIndex * 1 + 1)])
+          if (stepPreviewList && stepPreviewList.length > 0) {
+            this.previewList = stepPreviewList
+            const resuleObj = {
+              tit: '促销产品(阶梯' + (stepIndex * 1 + 1) + ')'
+            }
+            this.$nextTick(() => {
+              this.$refs.previewModal.pageInit(resuleObj)
+            })
+            this.openProductModal = true
+          } else {
+            this.$message.warning('暂时没有可预览的产品')
+          }
+        }
+      }
+    },
+    closeProductModal () {
+      this.previewList = []
+      this.openProductModal = false
+    },
+    onChooseVal (e) {
+      this.chooseVal = e.target.value
     }
   },
   watch: {
@@ -694,6 +768,7 @@ export default {
       } else {
         // 获取起订类型数据字典
         this.getUnitTypeList()
+        this.addFullGiftRule()
         if (this.itemSn) {
           this.getDetail()
         } else {

+ 59 - 3
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -191,9 +191,10 @@
               style="margin-left:10px;"
               size="small"
               type="link"
-              class="button-error"
+              class="button-info"
               id="promotionList-edit-btn"
               @click="addProducts">+新增产品</a-button>
+            <a-button type="link" class="button-error" @click="handlePreview">预览</a-button>
           </div>
         </div>
         <div v-show="chooseVal=='a'"><tableType1 :unitTypeList="unitTypeDataList" ref="cillProduct"></tableType1></div>
@@ -214,6 +215,8 @@
       @ok="handleProductsAdd" />
     <!-- 导入产品 -->
     <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :rulesType="form.discountType" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
+    <!-- 预览弹窗 -->
+    <productPreviewModal ref="previewModal" :openModal="openProductModal" :dataList="previewList" @close="closeProductModal"></productPreviewModal>
   </a-modal>
 </template>
 
@@ -226,10 +229,11 @@ import { promotionSave, getRuleDetail } from '@/api/promotion'
 import chooseProductsModal from './chooseProductsModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
 import { getLookUpData } from '@/api/data'
+import productPreviewModal from './productPreviewModal'
 export default {
   name: 'PromotionListBasicInfoModal',
   mixins: [commonMixin],
-  components: { VSelect, tableType1, tableType3, chooseProductsModal, ImportGuideModal },
+  components: { VSelect, tableType1, tableType3, chooseProductsModal, ImportGuideModal, productPreviewModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -276,7 +280,9 @@ export default {
       chooseProducts: [],
       openGuideModal: false, // 导入弹窗
       code: 'SCOPE_UNIT_TYPE', // 起订类型数据字典
-      unitTypeDataList: []
+      unitTypeDataList: [],
+      openProductModal: false, // 预览弹窗
+      previewList: []// 预览值
     }
   },
   computed: {
@@ -541,6 +547,7 @@ export default {
     // 获取编辑详情
     getDetail () {
       const _this = this
+      _this.spinning = true
       getRuleDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           this.chooseVal = res.data.gateFlag == '0' ? 'd' : 'a'
@@ -566,6 +573,7 @@ export default {
           }
           this.form = { ...this.form, ...resultObj }
         }
+        _this.spinning = false
       })
     },
     newData (list) {
@@ -575,6 +583,7 @@ export default {
           const brandList = []
           con.productBrandList.forEach(item => {
             item.brandName = item.productBrandName
+            item.brandSn = item.productBrandSn
             const brandObj = {
               productBrandSn: item.productBrandSn
             }
@@ -812,6 +821,53 @@ export default {
           _this.unitTypeDataList = res.data.list
         }
       })
+    },
+    // 获取预览数据
+    getPreviewList (dataList) {
+      if (dataList && dataList.length > 0) {
+        let newList = []
+        dataList.forEach(con => {
+          if (con.productThisList) {
+            con.productThisList.forEach((item, i) => {
+              item.unitTypeInfo = (con.unitType === 'SL' ? '按数量设置' : '按整箱设置') + con.unitQty
+              item.productTypeInfo = con.promotionProductType
+            })
+            newList = [ ...newList, ...con.productThisList ]
+          }
+        })
+        return newList
+      } else {
+        return []
+      }
+    },
+    // 预览  删除标签,添加标签  预览按钮显示不显示
+    handlePreview () {
+      const dataName = this.chooseVal === 'a' ? 'gate' : 'special'
+      const titName = this.chooseVal === 'a' ? '门槛产品' : '特价产品'
+      if (!this.itemSn) {
+        if (this.chooseVal === 'a') {
+          this.form.gateProductList = this.$refs.cillProduct.getResultVal()
+        } else {
+          this.form.specialProductList = this.$refs.specialProduct.getResultVal()
+        }
+      }
+      this.$nextTick(() => {
+        const newPreviewList = this.getPreviewList(this.form[dataName + 'ProductList'])
+        if (newPreviewList.length === 0) {
+          this.$message.warning('暂时没有可预览的产品')
+          return
+        }
+        this.previewList = newPreviewList
+        const resuleObj = {
+          tit: titName
+        }
+        this.$refs.previewModal.pageInit(resuleObj)
+        this.openProductModal = true
+      })
+    },
+    closeProductModal () {
+      this.previewList = []
+      this.openProductModal = false
     }
   },
   watch: {

+ 0 - 1
src/views/promotionRulesManagement/dealerPromotions/tableType1.vue

@@ -175,7 +175,6 @@ import { VSelect } from '@/components'
 import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
 import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
 import chooseProductsModal from './chooseProductsModal.vue'
-import { forEach } from 'core-js/library/es6/array'
 export default {
   name: 'TableType1',
   mixins: [commonMixin],

+ 39 - 23
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -43,6 +43,11 @@
                 <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="所在区域">
+                <subarea id="priceDifferenceDetailList-allocateTypeSn" placeholder="请选择区域" showLeve="1" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-model-item>
+            </a-col>
             <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
               <a-form-item label="单据类型">
                 <v-select
@@ -55,7 +60,7 @@
               </a-form-item>
             </a-col>
 
-            <a-col :md="isShowCustomerSearch?6:24" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'':'center'}">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="priceDifferenceDetailList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceDifferenceDetailList-reset">重置</a-button>
               <a-button
@@ -91,17 +96,15 @@
           <template slot="footer">
             <table>
               <tr>
-                <td width="41%" colspan="4">总计:</td>
-                <td width="8%" align="right">
-                  <div>实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</div>
-                </td>
-                <td width="8%" align="right">
-                  <div>开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</div>
+                <td width="16%" colspan="3">总计:</td>
+                <td width="76%" colspan="8" style="display:flex;justify-content: space-between;">
+                  <span>实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</span>
+                  <span>开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</span>
+                  <span>销售一部差价金额:{{ (totalData && (totalData.oneRebateAmount || totalData.oneRebateAmount==0)) ? toThousands(totalData.oneRebateAmount) : '--' }}</span>
+                  <span>销售二部差价金额:{{ (totalData && (totalData.twoRebateAmount || totalData.twoRebateAmount==0)) ? toThousands(totalData.twoRebateAmount) : '--' }}</span>
+                  <span>差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</span>
                 </td>
-                <td width="8%" align="right">
-                  <div>差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</div>
-                </td>
-                <td width="34%" colspan="3"></td>
+                <td width="8%"></td>
               </tr>
             </table>
           </template>
@@ -141,7 +144,11 @@ export default {
         parentDealerSn: undefined,
         buyerSn: undefined,
         bizUserSn: undefined,
-        bizType: undefined // 单据类型
+        bizType: undefined, // 单据类型
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        }
       },
       rules: {
         'month': [{ required: true, message: '请选择月份', trigger: 'change' }],
@@ -180,17 +187,19 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '月份', dataIndex: 'bizDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'provinceName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '记账门店', dataIndex: 'parentDealerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '月份', dataIndex: 'bizDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', show: true, width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', show: true, width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'provinceName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '记账门店', dataIndex: 'parentDealerName', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      arr.splice(4, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      arr.splice(5, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      arr.splice(6, 0, { title: '差价金额', dataIndex: 'directRebateAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      arr.splice(7, 0, { title: '记账费用', dataIndex: 'rebateAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(4, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(5, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(6, 0, { title: '差价金额', dataIndex: 'directRebateAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(7, 0, { title: '记账费用', dataIndex: 'rebateAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     }
   },
@@ -201,6 +210,11 @@ export default {
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    // 区域分区
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
     // 合计
     getCount (params) {
       reportRebateCount(params).then(res => {
@@ -237,10 +251,12 @@ export default {
       this.queryParam.buyerSn = undefined
       this.queryParam.bizUserSn = undefined
       this.queryParam.bizType = undefined
-
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.subareaAreaSn = undefined
       this.$refs.rebateDealerList.resetForm()
       this.totalData = null
       this.$refs.custList.resetForm()
+      this.$refs.subarea.clearData()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },

+ 38 - 45
src/views/reportData/promotionSalesOrderReport/list.vue

@@ -156,19 +156,26 @@
                     v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">未参与活动销售额:{{ (totalData.notpromotionSale || totalData.notpromotionSale==0) ? toThousands(totalData.notpromotionSale) : '--' }}</a-col>
                   <a-col
                     span="4"
-                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">调拨物料成本费用:{{ (totalData.allocateCost || totalData.allocateCost==0) ? toThousands(totalData.allocateCost) : '--' }}</a-col>
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">产品赠品成本费用:{{ (totalData.allocateGiftCost || totalData.allocateGiftCost==0) ? toThousands(totalData.allocateGiftCost) : '--' }}</a-col>
                   <a-col
                     span="4"
-                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">调拨物料销售费用:{{ (totalData.allocateSaleAmount || totalData.allocateSaleAmount==0) ? toThousands(totalData.allocateSaleAmount) : '--' }}</a-col>
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">产品赠品销售费用:{{ (totalData.allocateGiftAmount || totalData.allocateGiftAmount==0) ? toThousands(totalData.allocateGiftAmount) : '--' }}</a-col>
                   <a-col
                     span="4"
-                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">促销成本费用+物料成本费用合计:{{ (totalData.promoCostFeeAndAllocateCost || totalData.promoCostFeeAndAllocateCost==0)? toThousands(totalData.promoCostFeeAndAllocateCost) : '--' }}</a-col>
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">物料赠品成本费用:{{ (totalData.allocateCost || totalData.allocateCost==0) ? toThousands(totalData.allocateCost) : '--' }}</a-col>
+                  <a-col
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">物料赠品销售费用:{{ (totalData.allocateSaleAmount || totalData.allocateSaleAmount==0) ? toThousands(totalData.allocateSaleAmount) : '--' }}</a-col>
+
+                  <a-col
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">成本费用合计(促销+产品+物料):{{ (totalData.promoCostFeeAndAllocateCost || totalData.promoCostFeeAndAllocateCost==0)? toThousands(totalData.promoCostFeeAndAllocateCost) : '--' }}</a-col>
                   <a-col
                     span="4"
                     v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">成本合计占比:{{ totalData.totalCostRate ? (totalData.totalCostRate*100).toFixed(2)+'%' : '--' }}</a-col>
                   <a-col
                     span="4"
-                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">促销销售费用+物料销售费用合计:{{ (totalData.promoSaleFeeAndAllocateAmount || totalData.promoSaleFeeAndAllocateAmount==0) ? toThousands(totalData.promoSaleFeeAndAllocateAmount) : '--' }}</a-col>
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">销售费用合计(促销+产品+物料):{{ (totalData.promoSaleFeeAndAllocateAmount || totalData.promoSaleFeeAndAllocateAmount==0) ? toThousands(totalData.promoSaleFeeAndAllocateAmount) : '--' }}</a-col>
                   <a-col
                     span="4"
                     v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">销售合计占比:{{ totalData.totalSaleRate ? (totalData.totalSaleRate*100).toFixed(2)+'%' : '--' }}</a-col>
@@ -265,49 +272,35 @@ export default {
   computed: {
     columns () {
       const _this = this
+      const isCostFlag = this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')
+      const isSellFlag = this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')
       const arr = [
-        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域负责人', dataIndex: 'bizUserName', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealerInfo.provinceName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerInfo.dealerName', width: '130px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandName' } },
-        { title: '二级分类', dataIndex: 'brandtypeName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } }
-        // { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        // { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
-        // { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
-        // { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '调拨物料成本费用', dataIndex: 'allocateCost', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '调拨物料销售费用', dataIndex: 'allocateSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '促销成本费用+物料成本费用合计', dataIndex: 'promoCostFeeAndAllocateCost', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '成本合计占比', dataIndex: 'totalCostRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
-        // { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
+        { title: '区域', dataIndex: 'subareaArea.subareaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域负责人', dataIndex: 'bizUserName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerInfo.provinceName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerInfo.dealerName', show: true, width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', show: true, width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', show: true, width: '80px', align: 'center', scopedSlots: { customRender: 'brandName' } },
+        { title: '二级分类', dataIndex: 'brandtypeName', show: true, width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } },
+        { title: '销售额', dataIndex: 'totalSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '促销成本费用', dataIndex: 'promoCostFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
+        { title: '促销销售费用', dataIndex: 'promoSaleFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
+        { title: '参与活动销售额', dataIndex: 'promoSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '未参与活动销售额', dataIndex: 'notpromotionSale', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '产品赠品成本费用', dataIndex: 'allocateGiftCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '产品赠品销售费用', dataIndex: 'allocateGiftAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '物料赠品成本费用', dataIndex: 'allocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '物料赠品销售费用', dataIndex: 'allocateSaleAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '成本费用合计(促销+产品+物料)', dataIndex: 'promoCostFeeAndAllocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '成本合计占比', dataIndex: 'totalCostRate', show: isCostFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
+        { title: '销售费用合计(促销+产品+物料)', dataIndex: 'promoSaleFeeAndAllocateAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '销售合计占比', dataIndex: 'totalSaleRate', show: isSellFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
       ]
-      if (this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')) { //  售价权限
-        const isCostFlag = this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')
-        arr.splice(8, 0, { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 11 : 9, 0, { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 12 : 10, 0, { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-        arr.splice(isCostFlag ? 12 : 11, 0, { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 13 : 12, 0, { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 16 : 13, 0, { title: '调拨物料销售费用', dataIndex: 'allocateSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 19 : 14, 0, { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 20 : 15, 0, { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-      }
-      if (this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')) { //  成本
-        const isSellFlag = this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')
-        arr.splice(isSellFlag ? 9 : 8, 0, { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isSellFlag ? 10 : 9, 0, { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-        arr.splice(isSellFlag ? 15 : 10, 0, { title: '调拨物料成本费用', dataIndex: 'allocateCost', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isSellFlag ? 17 : 11, 0, { title: '促销成本费用+物料成本费用合计', dataIndex: 'promoCostFeeAndAllocateCost', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isSellFlag ? 18 : 12, 0, { title: '成本合计占比', dataIndex: 'totalCostRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-      }
-      return arr
+
+      return arr.filter(item => item.show)
     }
   },
   watch: {

+ 40 - 49
src/views/reportData/tireSalesReport/detailList.vue

@@ -13,7 +13,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" :showTime="false" :value="queryParam.time" @change="dateChange" />
+                <rangeDate ref="rangeDate" :showTime="false" :today="false" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -45,7 +45,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.bizUserSn"></BizUser>
+                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -59,7 +59,7 @@
                 </a-form-model-item>
               </a-col>
             </template>
-            <a-col :md="24" :sm="24" style="text-align:center;margin-bottom:10px;">
+            <a-col :md="24" :sm="24" style="text-align:center;">
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -105,7 +105,8 @@
           class="sTable fixPagination"
           ref="table"
           size="small"
-          :rowKey="(record) => record.id"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
           :style="{ height: tableHeight+70+'px' }"
           :columns="columns"
           :data="loadData"
@@ -193,9 +194,9 @@ export default {
         dealerSn: undefined,
         subareaArea: {// 区域分区
           subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaAreaSn: undefined,
+          bizUserSn: undefined // 区域负责人
         },
-        bizUserSn: undefined, // 区域负责人
         productWord: '', // 产品编码/原厂编码
         productName: '' // 产品名称
       },
@@ -245,48 +246,39 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '12%', align: 'center' },
-        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域负责人', dataIndex: 'bizUserName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品尺寸', dataIndex: 'productEntity.size', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总部订货数量', dataIndex: 'sysOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '上级订货数量', dataIndex: 'upOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '跨地区订货数量', dataIndex: 'crossRegionQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '累计入库数量', dataIndex: 'putQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '累计入库金额', dataIndex: 'putAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
+        { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '80px', align: 'center' },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域负责人', dataIndex: 'bizUserName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品尺寸', dataIndex: 'productEntity.size', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '200px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: <div>总部订货<div>数量</div></div>, dataIndex: 'sysOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div>上级订货<div>数量</div></div>, dataIndex: 'upOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div>跨地区订货<div>数量</div></div>, dataIndex: 'crossRegionQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div>累计入库<div>数量</div></div>, dataIndex: 'putQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货数量', dataIndex: 'returnQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '退货金额', dataIndex: 'returnAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户现有库存数量', dataIndex: 'rptDealerStockVO.totalStockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '客户现有库存金额', dataIndex: 'dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库加盟商数量', dataIndex: 'outQtyDealer', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库终端数量', dataIndex: 'outQtyTerminal', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '累计出库数量', dataIndex: 'outQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '累计出库金额', dataIndex: 'outAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: <div>客户现有<div>库存数量</div></div>, dataIndex: 'rptDealerStockVO.totalStockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div>出库加盟商<div>数量</div></div>, dataIndex: 'outQtyDealer', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div>出库终端<div>数量</div></div>, dataIndex: 'outQtyTerminal', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <div>累计出库<div>数量</div></div>, dataIndex: 'outQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: <div>已绑质保单<div>数量</div></div>, dataIndex: 'rptDealerStockVO.totalWarrantyQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '80px', align: 'center', fixed: 'right' }
       ]
       if (this.$hasPermissions('M_tireSalesReportList_salesPrice')) {
-        arr.splice(12, 0, { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(14, 0, { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(16, 0, { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(18, 0, { title: '累计入库金额', dataIndex: 'putAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(20, 0, { title: '退货金额', dataIndex: 'returnAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(22, 0, { title: '客户现有库存金额', dataIndex: 'rptDealerStockVO.totalStockAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(24, 0, { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(26, 0, { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(28, 0, { title: '累计出库金额', dataIndex: 'outAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(12, 0, { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(14, 0, { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(16, 0, { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(18, 0, { title: '累计入库金额', dataIndex: 'putAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(20, 0, { title: '退货金额', dataIndex: 'returnAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(22, 0, { title: '客户现有库存金额', dataIndex: 'rptDealerStockVO.totalStockAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(24, 0, { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(26, 0, { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(28, 0, { title: '累计出库金额', dataIndex: 'outAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -369,7 +361,7 @@ export default {
       this.queryParam.subareaArea.subareaSn = undefined
       this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.dealerLevel = undefined
-      this.queryParam.bizUserSn = undefined
+      this.queryParam.subareaArea.bizUserSn = undefined
       this.queryParam.productWord = undefined
       this.queryParam.productName = undefined
       this.$refs.subarea.clearData()
@@ -416,7 +408,7 @@ export default {
       _this.exportLoading = true
       _this.spinning = true
       _this.showExport = true
-      _this.$store.state.app.curActionPermission = 'B_tireReportExport'
+      _this.$store.state.app.curActionPermission = 'B_tireDetailExport'
       delete params.time
       hdExportExcel(tireOutDetailListExport, params, '轮胎出库明细报表', function () {
         _this.exportLoading = false
@@ -425,14 +417,13 @@ export default {
       })
     },
     pageInit () {
-      const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
+        this.setTableH()
       })
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 276
+      this.tableHeight = window.innerHeight - tableSearchH - 280
     }
   },
   mounted () {

+ 6 - 6
src/views/reportData/tireSalesReport/list.vue

@@ -13,7 +13,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" :showTime="false" :value="queryParam.time" @change="dateChange" />
+                <rangeDate ref="rangeDate" :showTime="false" :today="false" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -45,7 +45,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.bizUserSn"></BizUser>
+                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -160,9 +160,9 @@ export default {
         dealerSn: undefined,
         subareaArea: {// 区域分区
           subareaSn: undefined,
-          subareaAreaSn: undefined
-        },
-        bizUserSn: undefined // 区域负责人
+          subareaAreaSn: undefined,
+          bizUserSn: undefined // 区域负责人
+        }
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
@@ -314,7 +314,7 @@ export default {
       this.queryParam.dealerSn = undefined
       this.queryParam.subareaArea.subareaSn = undefined
       this.queryParam.subareaArea.subareaAreaSn = undefined
-      this.queryParam.bizUserSn = undefined
+      this.queryParam.subareaArea.bizUserSn = undefined
       this.queryParam.dealerLevel = undefined
       this.totalData = null
       this.$refs.areaList.clearData()

+ 15 - 7
src/views/reportData/tireSalesReport/outDetailModal.vue

@@ -15,7 +15,7 @@
         :columns="columns"
         :data="loadData"
         :style="{height: '400px' }"
-        :scroll="{ y: 600 }"
+        :scroll="{ y: 330 }"
         :showPagination="true"
         :defaultLoadData="false"
         bordered>
@@ -43,17 +43,11 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       spinning: false,
       isShow: this.openModal,
       titleInfo: '出库明细',
       queryParam: {},
-      columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '类型', width: '15%', dataIndex: 'customTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '加盟商/终端', dataIndex: 'customName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '数量', dataIndex: 'outQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '金额', dataIndex: 'outAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
@@ -74,6 +68,20 @@ export default {
       }
     }
   },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '类型', width: '15%', dataIndex: 'customTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '加盟商/终端', dataIndex: 'customName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '数量', dataIndex: 'outQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('B_outDetailShow_salesPrice')) {
+        arr.push({ title: '金额', dataIndex: 'outAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     getAjaxData (obj, titObj) {
       this.queryParam = obj

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -149,7 +149,7 @@ export default {
         this.disabled = true
         this.queryParam.dealerSn = this.buyerSn
         this.queryParam.promoProductClz = this.promoProductClz
-        return queryPromoProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1', pricingState: 'PRICED' })).then(res => {
+        return queryPromoProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1' })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -19,7 +19,7 @@
           />
         <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
         <!-- 活动规则详情 -->
-        <detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
+        <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
     </a-spin>
   </template>
   

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/queryPart.vue

@@ -137,7 +137,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.queryParam.dealerSn = this.buyerSn
-        return queryStockProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1', pricingState: 'PRICED' })).then(res => {
+        return queryStockProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1' })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data

+ 73 - 69
src/views/salesManagement/salesQueryNew/list.vue

@@ -71,19 +71,19 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="所在区域">
+                <a-form-item label="所在区域">
                   <subarea ref="subarea" id="salesManagementList-subarea" @change="subareaChange"></subarea>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
+                <a-form-item label="地区" prop="shippingAddrProvinceSn">
                   <Area id="salesManagementList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="出库仓库">
+                <a-form-item label="出库仓库">
                   <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="促销单">
@@ -195,12 +195,12 @@
           </template>
           <!-- 出库仓库 -->
           <template slot="warehouseBox" slot-scope="text, record">
-            <a-tooltip placement="right" v-if="record.newWarehouseNameSet && record.newWarehouseNameSet.length>0">
+            <a-tooltip placement="right" v-if="record.warehouseNameSet && record.warehouseNameSet.length>0">
               <template slot="title">
-                <span>{{ record.newWarehouseNameSet.toString() }}</span>
+                <span>{{ record.warehouseNameSet.toString() }}</span>
               </template>
               <div class="warehouse_box">
-                <span>{{ record.newWarehouseNameSet.toString() }}</span>
+                <span>{{ record.warehouseNameSet.toString() }}</span>
               </div>
             </a-tooltip>
             <div v-else>--</div>
@@ -309,9 +309,11 @@
 </template>
 
 <script>
-import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -321,12 +323,13 @@ import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDataModal.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import { salesList, salesDel, salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
-import { hdExportExcel } from '@/libs/exportExcel'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
+import customerService from '@/views/common/customerService'
+// 接口
 import { dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
+import { salesList, salesDel, salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
 import { salesDetailExport } from '@/api/salesBillReport'
-import customerService from '@/views/common/customerService'
+
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
@@ -339,48 +342,50 @@ export default {
       openModal: false, // 选择客户弹框是否显示
       openBaseModal: false, // 费用弹框
       showTipModal: false, // 备货打印弹框
-      showExport: false,
-      exportLoading: false,
-      expenseOption: false,
-      tableHeight: 0,
+      showExport: false, // 导出提示框
+      exportLoading: false, // 导出按钮加载状态
+      expenseOption: false, // 已选转费用报销单状态
+      tableHeight: 0, // 表格高度
+      // 默认时间
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
       // 查询参数
       queryParam: {
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         buyerSn: undefined, //  客户名称
         salesBillNo: '', //  销售单号
-        purchaseBillNo: '',
-        printStatus: undefined,
+        purchaseBillNo: '', // 采购单号
+        printStatus: undefined, // 打印状态
         billStatus: undefined, //  业务状态
         financialStatus: undefined, //  财务状态
-        salesBillSource: undefined,
+        salesBillSource: undefined, // 单据来源
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined // 分区
         },
-        shippingAddrProvinceSn: undefined,
-        warehouseSn: undefined,
-        promoFlag: undefined,
-        expenseClainFlag: undefined,
-        bizUserSn: undefined
+        shippingAddrProvinceSn: undefined, // 省
+        warehouseSn: undefined, // 仓库
+        promoFlag: undefined, // 是否促销单
+        expenseClainFlag: undefined, // 转费用报销单状态
+        bizUserSn: undefined // 客服
       },
+      // 统计数据
       totalData: {
-        totalAmount: 0,
-        totalCategory: 0,
-        totalQty: 0,
-        totalRecord: 0,
-        totalPushedQty: 0,
-        totalDispatchQty: 0,
-        totalCancelQty: 0,
-        totalUnpushedQty: 0,
-        totalPushedAmount: 0,
-        totalCancelAmount: 0,
-        totalUnpushedAmount: 0,
-        totalDispatchAmount: 0
+        totalCategory: 0, // 总款数
+        totalQty: 0, // 总数量
+        totalRecord: 0, // 总单数
+        totalPushedQty: 0, // 已下推数量
+        totalDispatchQty: 0, // 已发货数量
+        totalCancelQty: 0, // 已取消数量
+        totalUnpushedQty: 0, // 待下推数量
+        totalAmount: 0, // 总售价
+        totalPushedAmount: 0, // 已下推金额
+        totalCancelAmount: 0, // 已取消金额
+        totalUnpushedAmount: 0, // 待下推金额
+        totalDispatchAmount: 0 // 已发货金额
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -388,6 +393,8 @@ export default {
         this.spinning = true
         delete parameter.tableId
         delete parameter.index
+
+        // 如果按业务状态排序
         if (parameter.sortOrder) {
           parameter['sortAlias'] = 'sales_bill'
         } else {
@@ -397,22 +404,15 @@ export default {
         salesCount(Object.assign(parameter, this.queryParam)).then(res => {
           this.totalData = res.data || {}
         })
+        // 查询列表
         return salesList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算编号
             const no = (data.pageNo - 1) * data.pageSize
             data.list.forEach((con, i) => {
               con.no = no + i + 1
-              const newWarehouseName = []
-              if (con.warehouseNameSet) {
-                con.warehouseNameSet.forEach(item => {
-                  if (item) {
-                    newWarehouseName.push(item)
-                  }
-                })
-                con.newWarehouseNameSet = newWarehouseName
-              }
             })
             this.disabled = false
           }
@@ -420,10 +420,10 @@ export default {
           return data
         })
       },
+      // 允许备货打印弹框
       tipData: null, // 备货单信息
-      tempSalesBillSn: null,
-      // 允许备货打印
-      selectedRowKeys: [],
+      tempSalesBillSn: null, // 关联的下推单sn
+      selectedRowKeys: [], // 允许备货打印选项
       bhColumns: [
         {
           title: '备货单号',
@@ -438,7 +438,8 @@ export default {
           dataIndex: 'printStatusDictValue'
         }
       ],
-      showCols: [], // 列表显示列
+      // 列表列显示
+      showCols: [], // 已勾选的列
       colsArr: [
         {
           title: '已取消数量',
@@ -500,7 +501,7 @@ export default {
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
-
+      // 根据权限及勾选按固定顺序动态显示列
       arr.map(item => {
         if (this.$hasPermissions('M_salesQueryList_salesPrice')) {
           item.isShow = ['totalAmount', 'totalPushedAmount', 'totalUnpushedAmount', 'totalConvertPromoGiftsAmount'].includes(item.dataIndex)
@@ -509,7 +510,6 @@ export default {
           item.isShow = this.showCols.includes(item.dataIndex)
         }
       })
-      console.log(arr)
       return arr.filter(item => !this.colsArr.find(k => k.value == item.dataIndex) || item.isShow)
     }
   },
@@ -527,22 +527,25 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 选择客户
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
+    // 所在区域
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
+    // 打开批量转费用单页面
     toWaitCostOrder () {
       this.$router.push({ name: 'waitCostOrder' })
     },
-    // 新增
+    // 新增销售单先打开选择客户弹框
     handleAdd () {
       this.openModal = true
     },
@@ -648,17 +651,18 @@ export default {
         }
       }
     },
+    // 选择费用报销单类型
     changeDaOpt (e) {
       this.expenseOption = e.target.value
     },
-    // 转费用单
+    // 转费用单确定
     expenseSave (data) {
-      console.log(data)
       if (data) {
         this.openBaseModal = true
         this.$refs.expenseModal.setDetail(data, 'sales')
       }
     },
+    // 转费用单成功
     expenseSaveOk (params) {
       expenseAccountSave(params).then(res => {
         if (res.status == 200) {
@@ -685,16 +689,18 @@ export default {
         this.showTipModal = true
       })
     },
+    // 关闭允许备货打印弹框
     canselModal () {
       this.tipData = null
       this.showTipModal = false
       this.tempSalesBillSn = null
       this.selectedRowKeys = []
     },
+    // 选择要备货打印的
     onSelectChange (selectedRowKeys) {
       this.selectedRowKeys = selectedRowKeys
     },
-    // 允许备货打印状态
+    // 确定允许备货打印
     updatePrintStatus () {
       const isOne = this.tipData.length
       if (isOne > 1 && this.selectedRowKeys.length == 0) {
@@ -705,7 +711,6 @@ export default {
       this.tipData.map(item => {
         dispatchBillSnList.push(item.dispatchBillSn)
       })
-
       const params = {
         'salesBillSn': this.tempSalesBillSn,
         'dispatchBillSnList': isOne > 1 ? this.selectedRowKeys : dispatchBillSnList,
@@ -719,7 +724,7 @@ export default {
         }
       })
     },
-    // 重置
+    // 重置列表
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
@@ -744,23 +749,22 @@ export default {
       }
       this.$refs.table.refresh(true)
     },
+    // 初始化
     pageInit () {
-      const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
+        this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 260
     }
   },
   watch: {
+    // 展开收起
     advanced (newValue, oldValue) {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
+      this.pageInit()
     },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       console.log(newValue)

+ 1 - 4
src/views/salesReturnManagement/billOfLading/detail.vue

@@ -121,7 +121,7 @@
               <a-form-model-item style="margin-bottom:10px" label="附件" :label-col="{span:2}" :wrapper-col="{span:22}">
                 <div style="line-height:26px;">
                   <div v-for="item in form.attachmentList" :key="item.id">
-                    <a href="javascript:;" @click="openLink(item.filePath)">{{ item.fileName }}</a>
+                    <a :href="item.filePath.replace('http:','https:')" download="true">{{ item.fileName }}</a>
                   </div>
                 </div>
               </a-form-model-item>
@@ -242,9 +242,6 @@ export default {
     }
   },
   methods: {
-    openLink (url) {
-      window.open(url)
-    },
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this

+ 5 - 2
src/views/salesReturnManagement/billOfLading/list.vue

@@ -334,6 +334,9 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.queryParam.bizUserSn = undefined
       this.$refs.table.refresh(true)
+      if (!flag) {
+        this.$route.query.billNo = ''
+      }
     },
     pageInit () {
       const _this = this
@@ -368,8 +371,8 @@ export default {
     if (this.$store.state.app.isNewTab) {
       this.resetSearchForm(!!this.$route.query.billNo)
       this.pageInit()
-    } else {
-      this.setTableH()
+    }
+    if (this.$route.query.billNo) {
       this.resetSearchForm(!!this.$route.query.billNo)
     }
     // 仅刷新列表,不重置页面

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.113:8660/ocs-admin',
+        // target: 'http://192.168.2.117/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,