lilei 1 year ago
parent
commit
2113b2f797

+ 11 - 4
src/api/salesNew.js

@@ -81,15 +81,22 @@ export const queryMatchPromoProduct = (params) => {
   })
 }
 
-//  销售 审核
-export const salesWriteAudit = (params) => {
+//  销售 审核通过
+export const salesWriteAuditPass = (params) => {
   return axios({
-    url: '/salesn/audit',
+    url: '/salesn/auditPass',
+    data: params,
+    method: 'post'
+  })
+}
+//  销售 审核驳回
+export const salesWriteAuditReject = (params) => {
+  return axios({
+    url: '/salesn/auditReject',
     data: params,
     method: 'post'
   })
 }
-
 //  销售 一键审核下推
 export const salesWriteAuditPush = (params) => {
   return axios({

+ 26 - 15
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -3,8 +3,10 @@
     <a-spin :spinning="spinning" tip="Loading...">
         <ve-table
               border-y
+              v-show="!showEmpty"
               :scroll-width="0"
               :max-height="tableHeight"
+              :show-header="showTableHead"
               :row-style-option="{clickHighlight: true}"
               :cellSelectionOption="{enable: false}"
               :virtual-scroll-option="{enable: true}"
@@ -57,8 +59,12 @@
         },
         maxHeight:{
           type: [String,Number],
-          default: '250'
+          default: '300'
         },
+        showHeader: {
+            type: Boolean,
+            default: true
+        }
       },
       data () {
         return {
@@ -74,7 +80,8 @@
           },
           isCityPrice: false,
           outStockStr: '',
-          showEmpty: false
+          showEmpty: false,
+          showTableHead: true
         }
       },
       computed: {
@@ -122,15 +129,15 @@
           }
 
           let arr= [
-                { title: '序号', field: 'no',key: "a", width: 60, align: 'center', fixed: 'left',operationColumn: false },
-                { title: '产品编码', field: 'productCode',key: "b", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
+                { title: '序号', field: 'no',key: "a", width: 50, align: 'center', fixed: 'left',operationColumn: false },
+                { title: '产品编码', field: 'productCode',key: "b", width: 150, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
                 { title: '产品名称', field: 'productName',key: "c", width: 250, align: 'center',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '原厂编码', field: 'productOrigCode',key: "d", width: 100, align: 'center',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
-                { title: '出库仓库', field: 'warehouseName',key: "e", width: 120, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
+                { title: '原厂编码', field: 'productOrigCode',key: "d", width: 150, align: 'center',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
+                { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
             ]
 
             if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
-                arr.push({ title: '成本价', field: 'showCost', width: 100,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+                arr.push({ title: '成本价', field: 'showCost', width: 80,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
             }
             arr = arr.concat([
                 { title: '单位', field: 'productOrigUnit',key: "g", width: 80, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
@@ -138,27 +145,27 @@
             ])
 
             if (this.$hasPermissions(this.authCode + '_provincePrice')) {
-                arr.push({ title: '省级价', field: 'provincePrice', width: 100,key: "i", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+                arr.push({ title: '省级价', field: 'provincePrice', width: 80,key: "i", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
             }
             // 是否勾选市级价格
             if (this.isCityPrice) {
-                arr.push({ title: '市级价', field: 'cityPrice', width: 100,key: "j", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+                arr.push({ title: '市级价', field: 'cityPrice', width: 80,key: "j", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
                 if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-                    arr.push({ title: '销售价', field: 'price', width: 100,key: "k", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+                    arr.push({ title: '销售价', field: 'price', width: 80,key: "k", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
                 }
             } else {
                 if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-                    arr.push({ title: '销售价', field: 'price', width: 100,key: "l", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+                    arr.push({ title: '销售价', field: 'price', width: 80,key: "l", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
                 }
             }
 
             if (this.showStock) { //  审核,需用到库存
-                arr.push({ title: '库存', field: 'stockQty', width: 100,key: "m", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
+                arr.push({ title: '库存', field: 'stockQty', width: 80,key: "m", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
             }
             arr = arr.concat([
-                { title: '待下推数', field: 'unpushedQty', width: 100,key: "o", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-                { title: '已下推数', field: 'pushedQty', width: 100,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-                { title: '已取消数', field: 'cancelQty', width: 100,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} }
+                { title: '待下推数', field: 'unpushedQty', width: 80,key: "o", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+                { title: '已下推数', field: 'pushedQty', width: 80,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+                { title: '已取消数', field: 'cancelQty', width: 80,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} }
             ])
           return arr
         },
@@ -216,8 +223,12 @@
                 }
                 this.showEmpty = data.length <= 0
                 this.tableHeight = (this.showEmpty ? 30 : this.maxHeight) + 'px'
+                if(!this.showEmpty && data.length < 10){
+                  this.tableHeight = 'auto'
+                }
                 this.spinning = false
                 this.dataSource = data
+                this.showTableHead = this.showHeader
               }
             })
          }

+ 27 - 15
src/views/salesManagement/salesQueryNew/detail.vue

@@ -107,16 +107,17 @@
             </a-row>
           </a-form>
         </div>
-        <!-- 列表 -->
-        <detailProductList 
-        ref="normalProduct" 
-        :detailData="detailData" 
-        :warehouseSn="warehouseSn"
-        :salesBillSn="$route.params.sn || bizSn" 
-        :authCode="authCode"
-        :maxHeight="activeList.length?'250':pageHeight"
-        :showCityPrice="isCityPrice"></detailProductList> 
-
+        <!-- 正常产品列表 -->
+        <div style="margin-bottom: 10px;">
+          <detailProductList 
+          ref="normalProduct" 
+          :detailData="detailData" 
+          :warehouseSn="warehouseSn"
+          :salesBillSn="$route.params.sn || bizSn" 
+          :authCode="authCode"
+          :maxHeight="activeList.length?'300':pageHeight"
+          :showCityPrice="isCityPrice"></detailProductList> 
+        </div>
         <!-- 活动列表 -->
         <div 
         v-for="item in activeList" 
@@ -124,7 +125,7 @@
         >
         <div class="active-title">
           <div>
-            <strong style="margin-right:10px;font-size:14px;">{{item.promotion.title}}</strong> ({{item.promotionRule.description}})
+            <strong style="margin-right:10px;font-size:14px;">{{item.promotion.title}} ({{item.promotionRule.description}})</strong>
             <span style="margin-left:10px;color:#00aaff;cursor: pointer;"  @click="(event) => {showDesc(event, item)}">
               <a-icon title="查看活动详情" type="eye"/> 活动详情
             </span>
@@ -138,6 +139,7 @@
         <detailProductList 
         :ref="'active-'+item.promoRuleSn" 
         :promo="item"
+        :showHeader="false"
         :detailData="detailData" 
         :warehouseSn="warehouseSn"
         :salesBillSn="$route.params.sn || bizSn" 
@@ -225,7 +227,16 @@ import stockOutDetail from './stockOutDetailModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import detailProductList from './comps/detailProductList.vue'
 // 接口
-import { salesDetailBySn, salesPromoQueryList, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAudit, salesWriteAuditPush } from '@/api/salesNew'
+import { 
+  salesDetailBySn, 
+  salesPromoQueryList, 
+  salesDetailPrint, 
+  salesDetailExcel, 
+  salesDetailTypeExcel, 
+  salesWriteAuditPass, 
+  salesWriteAuditReject, 
+  salesWriteAuditPush 
+} from '@/api/salesNew'
  
 export default {
   name: 'SalesDetailNew',
@@ -377,7 +388,8 @@ export default {
     // 审核
     auditOrder (billStatus) {
       this.spinningAudit = true
-      salesWriteAudit({
+      const auditFun = billStatus =='AUDIT_PASS' ? salesWriteAuditPass : salesWriteAuditReject
+      auditFun({
         salesBillSn: this.bizSn || this.$route.params.sn,
         billStatus: billStatus
       }).then(res => {
@@ -388,7 +400,7 @@ export default {
           const _this = this
           this.$nextTick(() => {
             if (billStatus == 'AUDIT_PASS' && !_this.auditText) {
-              _this.$router.push({ name: 'waitDispatch', params: { salesBillSn: _this.bizSn || _this.$route.params.sn } })
+              _this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: _this.bizSn || _this.$route.params.sn } })
             } else {
               //  关闭详情跳列表
               _this.handleBack()
@@ -484,7 +496,7 @@ export default {
       align-items: center;
       justify-content: space-between;
       padding: 10px;
-      background: #dafafa;
+      background: #f3f8fa;
     }
     .flexBox{
       display: flex;

+ 3 - 3
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -105,11 +105,11 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import dsModal from './dsModal.vue'
-import { salesDetailBySn } from '@/api/sales'
-import { salesDetailDispatchByOneKey, insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetail'
+import { salesDetailBySn } from '@/api/salesNew'
+import { salesDetailDispatchByOneKey, insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetailNew'
 import { deleteBatch, pushDown, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
 import { findBySalesBillSn } from '@/api/dispatch'
-import { keys } from 'core-js/fn/array'
+
 export default {
   name: 'WaitDispatch',
   mixins: [commonMixin],

+ 173 - 117
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -76,62 +76,33 @@
         <span v-if="$hasPermissions('B_salesDispatch_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
       </div>
     </div>
-     
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :row-selection="{ columnWidth: 40, getCheckboxProps:record =>({props: { disabled: record.surplusQty<=0 }})}"
-      @rowSelection="rowSelectionFun"
-      :columns="columns"
-      :showPagination="false"
-      :data="loadData"
-      :scroll="{ y: 300 }"
-      :defaultLoadData="false"
-      bordered>
-      <!-- 取消数量 -->
-      <template slot="nums" slot-scope="text, record">
-        <div v-if="record.surplusQty>0" @dblclick.stop>
-          <a-input-number
-            size="small"
-            v-model="record.cancelNums"
-            :precision="0"
-            :min="0"
-            :max="record.surplusQty"
-            style="width: 100%;"
-            placeholder="请输入" />
-        </div>
-        <div v-else>--</div>
-      </template>
-      <!-- 产品编码 -->
-      <template slot="productCode" slot-scope="text, record">
-        <a-badge count="促" v-if="record.promotionFlag == 1">
-          <div style="padding-right: 15px;">{{ text }}</div>
-        </a-badge>
-        <span v-else>{{ text }}</span>
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button
-          size="small"
-          type="link"
-          class="button-info"
-          :loading="newLoading"
-          @click="handleAdd(record)"
-          v-if="record.surplusQty>0"
-          id="productInfoList-edit-btn">添加</a-button>
-        <span v-else>--</span>
-      </template>
-    </s-table>
+    
+    <a-spin :spinning="spinning" tip="Loading...">
+        <ve-table
+              border-y
+              v-show="!showEmpty"
+              :scroll-width="0"
+              :max-height="tableHeight"
+              :show-header="showTableHead"
+              :row-style-option="{clickHighlight: true}"
+              :cellSelectionOption="{enable: false}"
+              :virtual-scroll-option="{enable: true}"
+              :columns="columns"
+              :table-data="dataSource"
+              row-key-field-name="id"
+              :cell-style-option="cellStyleOption"
+              :column-width-resize-option="columnWidthResizeOption"
+            />
+        <div v-show="showEmpty" class="empty-data">暂无数据</div>
+    </a-spin>
 
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { salesDetailAllStockList } from '@/api/salesDetail'
+import { salesPromoQueryList } from '@/api/salesNew'
+import { salesDetailAllList } from '@/api/salesDetailNew'
 import { STable, VSelect } from '@/components'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 export default {
@@ -139,17 +110,19 @@ export default {
   mixins: [commonMixin],
   components: { STable, VSelect, chooseWarehouse },
   props: {
-    newLoading: Boolean
-  },
-  watch: {
-    data (newValue, oldValue) {
-      this.resetSearchForm()
+    newLoading: Boolean,
+    maxHeight:{
+          type: [String,Number],
+          default: '300'
+        },
+    showHeader: {
+        type: Boolean,
+        default: true
     }
   },
   data () {
     return {
       advanced: true, // 高级搜索 展开/关闭
-      showSetting: false, // 设置弹框
       productType: [],
       salesBillSn: '',
       detailData: null,
@@ -166,71 +139,124 @@ export default {
         warehouseSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.queryParam.salesBillSn = this.salesBillSn
-        return salesDetailAllStockList(Object.assign(parameter, this.queryParam)).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            if (data) {
-              // 根据类型过滤数据
-              data = data.filter(item => {
-                if (this.queryParam.ptype == '1') {
-                  return item != null && item.surplusQty > 0
-                }
-                if (this.queryParam.ptype == '2') {
-                  return item != null && item.surplusQty > 0 && item.surplusQty <= item.stockQty
-                }
-                if (this.queryParam.ptype == '3') {
-                  return item != null && item.surplusQty > item.stockQty
-                }
-                if (this.queryParam.ptype == '0') {
-                  return item != null
-                }
-              })
-              // 增加编号
-              const no = 0
-              for (var i = 0; i < data.length; i++) {
-                data[i].no = no + i + 1
-                data[i].cancelNums = data[i].surplusQty
-              }
-              this.disabled = false
-            }
-          }
-          return data
-        })
+      activeList: [], // 活动列表
+      spinning: false,
+      dataSource: [],
+      tableHeight: this.maxHeight,
+      cellStyleOption: {},
+      columnWidthResizeOption: {
+          // default false
+          enable: true,
+          // column resize min width
+          minWidth: 50
       },
-      rowSelectionInfo: null
+      showEmpty: false,
+      showTableHead: true
     }
   },
   computed: {
     columns () {
-      const arr = [
-        // { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '14%', align: 'center' },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '出库仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '可用库存', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已下推', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '待下推数量', dataIndex: 'surplusQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '取消数量', dataIndex: 'cancelNums', scopedSlots: { customRender: 'nums' }, width: '7%', align: 'center' },
-        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ]
+      const _this = this
+          const priceFormat = function(data){
+            return _this.toThousands(data) || '--'
+          }
+          const numsFormat = function(data){
+            return data || data == 0 ? data : '--'
+          }
+          const codeFormat = function(record,data,h){
+            if(record.promotionFlag=='GIFT'){
+                return (
+                    <div>
+                        <span style="padding-right: 15px;">{data}</span>
+                        <a-badge count="促" number-style={{ backgroundColor: '#52c41a', zoom:'80%' }}></a-badge>
+                    </div>
+                )
+            }
+            if(record.promotionFlag=='REGULAR'){
+                return (
+                    <div>
+                        <span style="padding-right: 15px;">{data}</span>
+                        <a-badge count="正" number-style={{ backgroundColor: '#108ee9', zoom:'80%' }}></a-badge>
+                    </div>
+                )
+            }
+            if(record.promotionFlag=='DISCOUNT'){
+                return (
+                    <div>
+                        <span style="padding-right: 15px;">{data}</span>
+                        <a-badge count="特" number-style={{ backgroundColor: '#faad14', zoom:'80%' }}></a-badge>
+                    </div>
+                )
+            }
+            if(Number(record.stockQty||0) < Number(record.unpushedQty||0)){
+                return (
+                    <div>
+                        <span style="padding-right: 15px;">{data}</span>
+                        <a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>
+                    </div>
+                )
+            }
+          }
+      // 输入框
+      const inputFormat = function(record,data,h) {
+        if(record.surplusQty>0){
+          return (
+            <div>
+              <a-input-number
+                size="small"
+                vModel={record.cancelNums}
+                precision="0"
+                min="0"
+                max={record.surplusQty}
+                style="width: 100%;"
+                placeholder="请输入" />
+            </div>
+          )
+        }
+        return '--'
+      }
+      // 操作按钮
+      const actionFormat = function(record,data,h) {
+        if(record.surplusQty>0){
+          return (
+            <div>
+               <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                loading={newLoading}
+                onClick="handleAdd(record)"
+                >添加</a-button>
+            </div>
+          )
+        }
+        return '--'
+      }
+      let arr= [
+            { title: '序号', field: 'no',key: "a", width: 50, align: 'center', fixed: 'left',operationColumn: false },
+            { title: '产品编码', field: 'productCode',key: "b", width: 150, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
+            { title: '产品名称', field: 'productName',key: "c", width: 250, align: 'center',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+            { title: '原厂编码', field: 'productOrigCode',key: "d", width: 150, align: 'center',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
+            { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
+        ]
       if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
-        arr.splice(3, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.push({ title: '销售价', field: 'price', width: 80,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
       }
       if (this.$hasPermissions('B_salesDispatch_costPrice')) {
-        const ind = this.$hasPermissions('B_salesDispatch_salesPrice') ? 4 : 3
-        arr.splice(ind, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-      }
+        arr.push({ title: '成本价', field: 'showCost', width: 80,key: "g", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+      }    
+      arr = arr.concat([
+          { title: '出库仓库', field: 'warehouseName',key: "h", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+          { title: '单位', field: 'productOrigUnit',key: "i", width: 80, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+          { title: '可用库存', field: 'stockQty', width: 80,key: "j", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+          { title: '销售数量', field: 'qty', width: 80,key: "k", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+          { title: '已取消', field: 'cancelQty', width: 80,key: "o", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+          { title: '已下推', field: 'pushedQty', width: 80,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+          { title: '待下推', field: 'surplusQty', width: 80,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+          { title: '取消数量', field: 'surplusQty', width: 80,key: "r", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return inputFormat(row,row[column.field],h)} },
+          { title: '操作', field: 'action', width: 80,key: "s", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row,row[column.field],h)} },
+        ])
+      
       return arr
     }
   },
@@ -239,8 +265,38 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    // 类型变化,过滤列表
-    handlePtypeChange () {},
+    // 获取销售单参与的活动列表
+    getActiveList(){
+      salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
+        if(res.status == 200){
+          this.activeList = res.data || []
+        }
+        this.$nextTick(()=>{
+          this.searchTable()
+        })
+      })
+    },
+    async searchTable(){
+        this.disabled = true
+        this.queryParam.salesBillSn = this.salesBillSn
+        this.queryParam.showStock = true
+        const params = this.queryParam
+        // 正常产品
+        const list0 = await salesDetailAllList(params).then(res => res.data)
+        const list1 = [], active = this.activeList;
+        // 活动产品
+        for(let i=0;i<active.length;i++){
+          const promo = active[i]
+          params.promoRuleSn = promo.promoRuleSn
+          params.promoSn = promo.promoSn
+          params.salesPromoSn = promo.salesPromoSn
+          list1[i] = await salesDetailAllList(params).then(res => res.data)
+        }
+
+        console.log(list0)
+        console.log(list1)
+        this.dataSource = list0
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.ptype = '0'
@@ -258,8 +314,8 @@ export default {
     pageInit (salesBillSn, detailData) {
       this.salesBillSn = salesBillSn
       this.detailData = detailData
-      this.$refs.table.clearSelected()
-      this.resetSearchForm()
+      // 获取活动列表
+      this.getActiveList()
     },
     clearTable () {
       this.rowSelectionInfo = null

+ 2 - 2
vue.config.js

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