Преглед изворни кода

Merge branch 'develop_cuxiao' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_cuxiao

chenrui пре 1 година
родитељ
комит
f609fa6b98

+ 9 - 0
src/api/salesNew.js

@@ -106,6 +106,15 @@ export const queryMatchPromoProduct = (params) => {
   })
 }
 
+// 提交时活动规则校验
+export const salesPromoValidaSubmit = (params) => {
+  return axios({
+      url: `/salesPromo/validationSubmit/${params.salesBillSn}`,
+      data: params,
+      method: 'post'
+  })
+}
+
 //  销售 审核通过
 export const salesWriteAuditPass = (params) => {
   return axios({

+ 8 - 91
src/config/router.config.js

@@ -119,7 +119,7 @@ export const asyncRouterMap = [
       // 销售管理
       {
         path: '/salesManagement',
-        redirect: '/salesManagement/salesQuery',
+        redirect: '/salesManagement/salesQueryNew',
         component: PageView,
         meta: {
           title: '销售管理',
@@ -127,96 +127,13 @@ export const asyncRouterMap = [
           permission: 'M_salesManagement'
         },
         children: [
-          {
-            path: '/salesManagement/salesQuery',
-            redirect: '/salesManagement/salesQuery/list',
-            name: 'salesQuery',
-            component: BlankLayout,
-            meta: {
-              title: '销售单查询',
-              icon: 'monitor',
-              permission: 'M_salesQueryList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'salesQueryList',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/list.vue'),
-                meta: {
-                  title: '销售单列表',
-                  icon: 'monitor',
-                  hidden: true,
-                  permission: 'M_salesQueryList'
-                }
-              },
-              {
-                path: 'detail/:sn',
-                name: 'salesDetail',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/detail.vue'),
-                meta: {
-                  title: '销售单详情',
-                  icon: 'monitor',
-                  hidden: true,
-                  replaceTab: true,
-                  permission: 'B_salesDetail'
-                }
-              },
-              {
-                path: 'detail/:sn',
-                name: 'salesDetailAudit',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/detail.vue'),
-                meta: {
-                  title: '销售单审核',
-                  icon: 'monitor',
-                  hidden: true,
-                  replaceTab: true,
-                  permission: 'B_salesAudit'
-                }
-              },
-              {
-                path: 'add/:sn',
-                name: 'salesAdd',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/edit.vue'),
-                meta: {
-                  title: '新增销售单',
-                  icon: 'monitor',
-                  hidden: true,
-                  permission: 'B_salesEdit'
-                }
-              },
-              {
-                path: 'edit/:sn',
-                name: 'salesEdit',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQuery/edit.vue'),
-                meta: {
-                  title: '编辑销售单',
-                  icon: 'monitor',
-                  hidden: true,
-                  permission: 'B_salesEdit'
-                }
-              },
-              {
-                path: 'waitDispatch/:salesBillSn',
-                name: 'waitDispatch',
-                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/waitDispatch/edit.vue'),
-                meta: {
-                  title: '下推销售单',
-                  icon: 'monitor',
-                  replaceTab: true,
-                  hidden: true,
-                  permission: 'B_salesDispatch'
-                }
-              }
-            ]
-          },
           {
             path: '/salesManagement/salesQueryNew',
             redirect: '/salesManagement/salesQueryNew/list',
             name: 'salesQueryNew',
             component: BlankLayout,
             meta: {
-              title: '销售单查询(新版)',
+              title: '销售单查询',
               icon: 'monitor',
               permission: 'M_salesQueryList'
             },
@@ -227,7 +144,7 @@ export const asyncRouterMap = [
                 name: 'salesQueryNewList',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/list.vue'),
                 meta: {
-                  title: '销售单列表(新版)',
+                  title: '销售单列表',
                   icon: 'monitor',
                   hidden: true,
                   permission: 'M_salesQueryList'
@@ -238,7 +155,7 @@ export const asyncRouterMap = [
                 name: 'salesNewDetail',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/detail.vue'),
                 meta: {
-                  title: '销售单详情(新版)',
+                  title: '销售单详情',
                   icon: 'monitor',
                   hidden: true,
                   replaceTab: true,
@@ -250,7 +167,7 @@ export const asyncRouterMap = [
                 name: 'salesNewDetailAudit',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/detail.vue'),
                 meta: {
-                  title: '销售单审核(新版)',
+                  title: '销售单审核',
                   icon: 'monitor',
                   hidden: true,
                   replaceTab: true,
@@ -262,7 +179,7 @@ export const asyncRouterMap = [
                 name: 'salesNewAdd',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/edit.vue'),
                 meta: {
-                  title: '新增销售单(新版)',
+                  title: '新增销售单',
                   icon: 'monitor',
                   hidden: true,
                   permission: 'B_salesEdit'
@@ -273,7 +190,7 @@ export const asyncRouterMap = [
                 name: 'salesNewEdit',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/edit.vue'),
                 meta: {
-                  title: '编辑销售单(新版)',
+                  title: '编辑销售单',
                   icon: 'monitor',
                   hidden: true,
                   permission: 'B_salesEdit'
@@ -284,7 +201,7 @@ export const asyncRouterMap = [
                 name: 'waitDispatchNew',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/waitDispatchNew/edit.vue'),
                 meta: {
-                  title: '下推销售单(新版)',
+                  title: '下推销售单',
                   icon: 'monitor',
                   replaceTab: true,
                   hidden: true,

+ 1 - 1
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -174,7 +174,7 @@ export default {
             this.disabled = false
           }
           this.spinning = false
-          this.mainContentList = data.list
+          this.mainContentList = data
           return data
         })
       },

+ 12 - 3
src/views/salesManagement/backorder/detailModal.vue

@@ -42,6 +42,12 @@
           :defaultLoadData="false"
           :scroll="{ y: 500 }"
           bordered>
+          <template slot="productCode" slot-scope="text, record">
+            <span style="padding-right: 15px;">{{ text }}</span>
+            <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+            <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
+            <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
+          </template>
         </s-table>
       </a-card>
     </a-spin>
@@ -98,16 +104,19 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', scopedSlots: { customRender: 'productCode' } },
         { title: '产品名称', dataIndex: 'productEntity.name', width: '24%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '缺货数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
-        // { title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
+      if (this.$hasPermissions('B_oosDetail_costPrice')) { //  成本
+        arr.push({ title: '缺货成本金额', dataIndex: 'showCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      }
       if (this.$hasPermissions('B_oosDetail_salesPrice')) { //  售价权限
-        arr.splice(6, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.push({ title: '售价', dataIndex: 'price', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.push({ title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }

+ 7 - 1
src/views/salesManagement/backorder/list.vue

@@ -39,6 +39,12 @@
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
+        <template slot="salesBillNo" slot-scope="text, record">
+          <span style="padding-right: 15px;">{{ text }}</span>
+          <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+          <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
+          <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -107,7 +113,7 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '20%', align: 'center', scopedSlots: { customRender: 'salesBillNo' }},
         { title: '客户名称', dataIndex: 'dealerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         // { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '缺货款数', dataIndex: 'totalCategory', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 4 - 4
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -92,10 +92,10 @@
           bordered>
           <!-- 产品编码 -->
           <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>
+            <span>{{ text }}</span>
+            <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+            <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
+            <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
           </template>
         </s-table>
       </a-card>

+ 5 - 2
src/views/salesManagement/salesOrderWarehouse/list.vue

@@ -62,8 +62,8 @@
               >导出</a-button>
             </a-col>
           </a-row>
-          </a-form>
-        </a-form-model></div>
+        </a-form-model>
+      </div>
       <!-- alert -->
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
@@ -87,6 +87,9 @@
         <!-- 单号 -->
         <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
           <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+          <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+          <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
+          <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
         </template>
       </s-table>
     </a-spin>

+ 5 - 3
src/views/salesManagement/salesQuery/detail.vue

@@ -121,14 +121,16 @@
           bordered>
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
-            <div v-if="(record.promotionFlag == 1) || (Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
+            <div v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
               <span>{{ text }}</span>
-              <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1"></a-badge>
+              <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+              <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
+              <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
               <!-- 可审核时才可显示“缺”货产品 -->
               <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
               </a-badge>
             </div>
-            <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
+            <span v-else>{{ text }}</span>
           </template>
           <!-- 当前库存 -->
           <template slot="stockQty" slot-scope="text, record">

+ 178 - 71
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -1,28 +1,30 @@
 <template>
     <!-- 已选配件列表 -->
     <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"
-            />
+          <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"
+            :cell-span-option="cellSpanOption"
+            :column-width-resize-option="columnWidthResizeOption"
+          />
         <div v-show="showEmpty" class="empty-data">暂无数据</div>
     </a-spin>
   </template>
   
   <script>
     import { commonMixin } from '@/utils/mixin'
-    import { salesDetailAllList } from '@/api/salesDetailNew'
+    import { salesPromoQueryList } from '@/api/salesNew'
+    import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
     export default {
       name: 'DetailProductList',
       mixins: [commonMixin],
@@ -69,19 +71,30 @@
       data () {
         return {
           spinning: false,
+          activeList: [], // 活动列表
           dataSource: [],
           tableHeight: this.maxHeight,
-          cellStyleOption: {},
+          cellStyleOption: {
+            bodyCellClass: ({ row, column, rowIndex }) => {
+                if (row.id.indexOf('promo-')>=0 && column.field === "no") {
+                    return "table-body-cell-no";
+                }
+            },
+          },
           columnWidthResizeOption: {
               // default false
               enable: true,
               // column resize min width
               minWidth: 50
           },
+          cellSpanOption: {
+              bodyCellSpan: this.bodyCellSpan,
+          },
           isCityPrice: false,
           outStockStr: '',
           showEmpty: false,
-          showTableHead: true
+          showTableHead: true,
+          colspanNums: 13
         }
       },
       computed: {
@@ -100,10 +113,10 @@
               ftext = '促'
               fcolor = '#52c41a'
             }
-            if(record.promotionFlag == 'REGULAR'){
-              ftext = '正'
-              fcolor = '#108ee9'
-            }
+            // if(record.promotionFlag == 'REGULAR'){
+            //   ftext = '正'
+            //   fcolor = '#108ee9'
+            // }
             if(record.promotionFlag == 'DISCOUNT'){
               ftext = '特'
               fcolor = '#faad14'
@@ -116,41 +129,72 @@
                     </div>
                 )
           }
-
+          // 编号,并且格式化活动分类行
+          const noFormat = function(record,data,h){
+            return (
+              <div>
+                {record.id.indexOf('promo-')>=0 ? (
+                  <div class="active-title">
+                    {record.promo?(
+                      <div>
+                        <strong style="margin-right:10px;font-size:14px;">{record.promo.promotion.title} ({record.promo.promotionRule.description})</strong>
+                        <span style="margin-left:10px;color:#00aaff;cursor: pointer;" onClick={()=>_this.showDesc(record)}>
+                          <a-icon title="查看活动详情" type="eye"/> 活动详情
+                        </span>
+                      </div>
+                    ):(<div></div>)}
+                    <div>
+                        款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
+                        数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
+                        {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
+                    </div>
+                  </div>
+                ):(<span>{data}</span>)}
+              </div>
+            )
+          }
           let arr= [
-                { title: '序号', field: 'no',key: "a", width: 50, align: 'center', fixed: 'left',operationColumn: false },
+                { title: '序号', field: 'no',key: "a", width: 50, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
                 { 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] || '--'}}
             ]
-
+            this.colspanNums = 5
             if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
-                arr.push({ title: '成本价', field: 'showCost', width: 80,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+              this.colspanNums = this.colspanNums + 1
+              arr.push({ title: '成本价', field: 'showCost', width: 80,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
             }
+            this.colspanNums = this.colspanNums + 2
             arr = arr.concat([
                 { title: '单位', field: 'productOrigUnit',key: "g", width: 80, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
                 { title: '销售数量', field: 'qty', width: 80,key: "h", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} }
             ])
 
             if (this.$hasPermissions(this.authCode + '_provincePrice')) {
-                arr.push({ title: '省级价', field: 'provincePrice', width: 80,key: "i", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
+              this.colspanNums = this.colspanNums + 1
+              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) {
+              this.colspanNums = this.colspanNums + 1
                 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')) { //  售价权限
+                  this.colspanNums = this.colspanNums + 1
                     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')) { //  售价权限
+                  this.colspanNums = this.colspanNums + 1
                     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) { //  审核,需用到库存
+              this.colspanNums = this.colspanNums + 1
                 arr.push({ title: '库存', field: 'stockQty', width: 80,key: "m", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
             }
+            this.colspanNums = this.colspanNums + 3
             arr = arr.concat([
                 { 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])} },
@@ -165,62 +209,112 @@
       watch: {
         showCityPrice(newValue, oldValue){
             this.isCityPrice = newValue
-        },
-        salesBillSn(newValue, oldValue){
-             
         }
       },
       methods: {
-         // 获取表格数据
-         getTableData(){
+         // 合并活动分类单元格
+        bodyCellSpan({ row, column, rowIndex }) {
+          if (row.id.indexOf('promo-')>=0) {
+            if(column.field=='no'){
+              return {
+                        rowspan: 1,
+                        colspan: this.colspanNums,
+                    };
+            }else{
+              return {
+                    rowspan: 0,
+                    colspan: 0,
+                }
+            }
+          }
+        },
+         // 查看活动详情
+        showDesc(e,item){
+
+        },
+        // 获取销售单参与的活动列表
+        pageInit(){
+          salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
+            if(res.status == 200){
+              this.activeList = res.data || []
+            }
+            this.$nextTick(()=>{
+              this.searchTable()
+            })
+          })
+        },
+        async searchTable(){
+            this.dataSource = []
+            this.disabled = true
             this.spinning = true
+            // 参数
             const params = {
                 salesBillSn: this.salesBillSn,
                 showStock: this.showStock,
                 warehouseSn: this.warehouseSn
             }
-            // 活动列表
-            if(this.promo){
-                params.promoRuleSn = this.promo.promoRuleSn
-                params.promoSn = this.promo.promoSn
-                params.salesPromoSn = this.promo.salesPromoSn
+            // 正常产品
+            const proList = await salesDetailAllList(params).then(res => res.data)
+            const norTotal = await salesDetaiCount(params).then(res => res.data)
+            let listData = [{
+                id: 'promo-normal',
+                total: norTotal
+              },...proList]
+            
+            // 循环获取活动产品
+            const active = this.activeList
+            for(let i=0;i<active.length;i++){
+              const promo = active[i]
+              const activeParams = {
+                promoRuleSn: promo.promoRuleSn,
+                promoSn: promo.promoSn,
+                salesPromoSn: promo.salesPromoSn,
+                ...params
+              }
+              
+              // 获取活动产品列表
+              const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+              // 获取活动产品统计
+              const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+              const retList = [{
+                id: 'promo-'+i,
+                promo: promo,
+                total: acTotal
+              },...aclist]
+              listData = aclist&&aclist.length ? listData.concat(retList) : listData
             }
-            salesDetailAllList(params).then(res => {
-              let data
-              if (res.status == 200) {
-                data = res.data
-                const no = 0
-                this.outStockStr = ''
-                let str = ''
-                for (var i = 0; i < data.length; i++) {
-                    data[i].no = no + i + 1
-                    const productCode = (data[i].productEntity && data[i].productEntity.code) || (data[i].dealerProductEntity && data[i].dealerProductEntity.code)
-                    const productName = (data[i].productEntity && data[i].productEntity.name) || (data[i].dealerProductEntity && data[i].dealerProductEntity.name)
-                    const productOrigCode = (data[i].productEntity && data[i].productEntity.origCode) || (data[i].dealerProductEntity && data[i].dealerProductEntity.origCode)
-                    const productOrigUnit = (data[i].productEntity && data[i].productEntity.unit) || (data[i].dealerProductEntity && data[i].dealerProductEntity.unit)
-                    data[i].productCode = productCode || '--'
-                    data[i].productName = productName || '--'
-                    data[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
-                    data[i].productOrigUnit = productOrigUnit || '--'
-                    if (data[i].unpushedQty && (Number(data[i].stockQty) < Number(data[i].unpushedQty))) {
-                        str += data[i].productCode + '、'
-                    }
-                }
-                if (str.length > 0) {
-                    str = str.substr(0, str.length - 1)
-                    this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
-                }
-                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
+
+            console.log(listData)
+            this.dataSource = listData
+
+            // 格式化数据
+            let f = 0
+            this.outStockStr = ''
+            let str = ''
+            this.dataSource.map((item,i) => {
+              if(item.id.indexOf('promo-')>=0){f = f - 1}
+              item.no = i + 1 + f
+              const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
+              const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
+              const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
+              const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
+              item.productCode = productCode || '--'
+              item.productName = productName || '--'
+              item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+              item.productOrigUnit = productOrigUnit || '--'
+              if (item.unpushedQty && (Number(item.stockQty) < Number(item.unpushedQty))) {
+                  str += item.productCode + '、'
               }
             })
-         }
+            if (str.length > 0) {
+                str = str.substr(0, str.length - 1)
+                this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
+            }
+            this.showEmpty = this.dataSource.length <= 0
+            this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
+            this.spinning = false
+            this.disabled = false
+        },
       }
     }
   </script>
@@ -231,4 +325,17 @@
         text-align: center;
         padding: 20px;
     }
+    .ve-table-body-td{
+      .active-title{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 10px;
+        background: #f3f8fa;
+      }
+    }
+    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no, 
+    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
+      padding: 0;
+    } 
   </style>

+ 47 - 31
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -29,13 +29,13 @@
             </div>
           </a-descriptions-item>
           <a-descriptions-item label="显示正价产品款数">
-            40
+            {{ descDetail.restrictCategory||'--' }}
           </a-descriptions-item>
           <a-descriptions-item label="订单起订金额">
-            {{ descDetail.minOrderAmount }}
+            {{ descDetail.minOrderAmount||'--' }}
           </a-descriptions-item>
           <a-descriptions-item label="活动经费上线">
-            {{ descDetail.upperLimitAmount }}
+            {{ descDetail.upperLimitAmount||'--' }}
           </a-descriptions-item>
         </a-descriptions>
     </div>
@@ -145,7 +145,7 @@
       <template slot="productCode" slot-scope="text, record">
         <span style="padding-right: 15px;">{{ text }}</span>
         <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-        <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge>
+        <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
         <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
         <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)" :number-style="{ zoom:'80%' }"></a-badge>
       </template>
@@ -230,7 +230,7 @@
                 </div>
                 <div>
                   <div v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '--' }}</strong></div>
-                  <div v-if="$hasPermissions('B_salesEdit_salesPrice')">优惠金额:<strong>-{{ countData&&(countData.lossAmount || countData.lossAmount==0) ? toThousands(countData.lossAmount) : '--' }}</strong></div>
+                  <div v-if="$hasPermissions('B_salesEdit_salesPrice')">优惠金额:<strong>{{ countData&&(countData.lossAmount || countData.lossAmount==0) ? toThousands(countData.lossAmount) : '--' }}</strong></div>
                 </div>
               </div>
             </div>
@@ -461,6 +461,7 @@
             deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: _this.promo.salesPromoSn }).then(res => {
               if (res.status == 200) {
                 _this.resetSearchForm(true)
+                _this.$emit('insterOk','promo')
                 _this.$message.success(res.message)
               }
               _this.spinning = false
@@ -492,6 +493,7 @@
             }).then(res => {
               if (res.status == 200) {
                 _this.resetSearchForm(true)
+                _this.$emit('insterOk','promo')
                 _this.$message.success(res.message)
               }
               _this.spinning = false
@@ -551,25 +553,7 @@
           this.handleBatchDelAll()
         }
       },
-      // 换促销
-      async upActiveOk(data, editRow){
-        console.log(data)
-        console.log(editRow)
-        this.spinning = true
-        // 先删除当前活动
-        const delRet = await salesDetailDel({ 
-          salesBillDetailSn: editRow.salesBillDetailSn, 
-          salesBillSn: this.salesBillSn, 
-          salesPromoSn: this.promo.salesPromoSn 
-        })
-        // 当删除成功且不是”不参与活动“时
-        if(delRet.status == 200 && data != 0){
-          // 再添加到其它活动
-          this.$emit()
-        }
-        this.openUpActiveModal = false
-        this.spinning = false
-      },
+      // 打开换促销活动列表选项
       handleUpdateActive(record){
         this.$refs.updateActive.getActiveList({
           productSn: record.productSn, 
@@ -590,8 +574,9 @@
             salesBillSn: _this.salesBillSn,
             salesPromoSn: _this.promo.salesPromoSn
           }).then(res => {
-            _this.resetSearchForm(true)
             if (res.status == 200) {
+              _this.resetSearchForm(true)
+              _this.$emit('insterOk','promo')
               _this.$message.success(res.message)
             }
             _this.spinning = false
@@ -623,20 +608,50 @@
           }
         })
       },
+      // 确定更换促销活动
+      async upActiveOk(data, editRow){
+        console.log(data)
+        console.log(editRow)
+        this.spinning = true
+        // 先删除当前活动
+        const delRet = await salesDetailDel({ 
+          salesBillDetailSn: editRow.salesBillDetailSn, 
+          salesBillSn: this.salesBillSn, 
+          salesPromoSn: this.promo.salesPromoSn 
+        })
+        // 当删除成功且不是”不参与活动“时
+        if(delRet.status == 200){
+          // 刷下当前活动列表
+          this.resetSearchForm()
+          // 再添加到其它活动
+          if(data != 0){
+            editRow.productPackQty = editRow.packQty
+            editRow.lastStockCost = editRow.showCost
+            editRow.productPrice = editRow.price
+            editRow.salesNums = editRow.qty
+            this.$emit("upActive",editRow, data)
+          }else{
+            // 刷下正常产品列表
+            this.$emit('insterOk', 'promo')
+          }
+        }
+        this.openUpActiveModal = false
+        this.spinning = false
+      },
       // 添加产品
       insterProduct (row, promotionFlag, promoProductClz) {
         console.log(row, promotionFlag, promoProductClz)
         // 防止多次添加产品
         if (this.isInster) { return }
-        const _this = this
-        _this.saveNewProduct(row, promotionFlag, promoProductClz)
+        this.saveNewProduct(row, promotionFlag, promoProductClz)
       },
       // 保存添加的产品到销售列表
       saveNewProduct (row, promotionFlag, promoProductClz) {
         this.$message.loading('正在添加产品...', 1)
         this.isInster = true
         this.spinning = true
-        salesDetailInsert({
+        console.log(row)
+        const params = {
           salesPromoSn: this.promo.salesPromoSn,
           promoRuleSn: this.promo.promoRuleSn,
           promoSn: this.promo.promoSn,
@@ -645,7 +660,7 @@
           productSn: row.productSn,
           showCost: row.lastStockCost,
           price: row.productPrice,
-          origPrice: row.productPrice,
+          origPrice: row.origPrice,
           promotionGiftsAmount: 0,
           usePromotionGiftsAmount: 0,
           qty: row.salesNums,
@@ -657,11 +672,12 @@
           promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
           promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1
           warehouseSn: row.warehouseSn
-        }).then(res => {
+        }
+        salesDetailInsert(params).then(res => {
           if (res.status == 200) {
             this.resetSearchForm()
             this.$message.success('产品添加成功', 2.5)
-            this.$emit('insterOk')
+            this.$emit('insterOk','promo')
           }
           this.spinning = false
           this.isInster = false

+ 9 - 10
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -227,7 +227,7 @@
         loadData: parameter => {
           this.disabled = true
           this.queryParam.salesBillSn = this.salesBillSn || ''
-          // this.getCount()
+          this.getCount()
           return salesDetailList(Object.assign(parameter, this.queryParam, {showStock: true})).then(res => {
             let data
             if (res.status == 200) {
@@ -328,7 +328,7 @@
             deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
               if (res.status == 200) {
                 _this.resetSearchForm(true)
-                // _this.$refs.promotable.resetCurForm()
+                _this.$emit('insterOk','normal')
                 _this.$message.success(res.message)
               }
               _this.spinning = false
@@ -359,7 +359,7 @@
             }).then(res => {
               if (res.status == 200) {
                 _this.resetSearchForm(true)
-                // _this.$refs.promotable.resetCurForm()
+                _this.$emit('insterOk','normal')
                 _this.$message.success(res.message)
               }
               _this.spinning = false
@@ -397,7 +397,6 @@
           if (res.status == 200) {
             _this.openWarehouseModal = false
             _this.resetSearchForm(true)
-            // _this.$refs.promotable.resetCurForm()
             _this.$message.success(res.message)
           }
           _this.$refs.table.refresh(true)
@@ -436,9 +435,9 @@
             qty: record.qty,
             salesBillSn: _this.salesBillSn
           }).then(res => {
-            _this.resetSearchForm(true)
-            // _this.$refs.promotable.resetCurForm()
             if (res.status == 200) {
+              _this.resetSearchForm(true)
+              _this.$emit('insterOk','normal')
               _this.$message.success(res.message)
             }
             _this.spinning = false
@@ -473,8 +472,8 @@
             salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
               if (res.status == 200) {
                 _this.resetSearchForm(true)
-                // _this.$refs.promotable.resetCurForm()
                 _this.$message.success(res.message)
+                _this.$emit('insterOk','normal')
               }
               _this.delLoading = false
               _this.spinning = false
@@ -515,12 +514,12 @@
           if (res.status == 200) {
             this.resetSearchForm()
             this.$message.success('产品添加成功', 2.5)
-            this.spinning = false
-          } else {
-            this.spinning = false
+            this.$emit('insterOk','normal')
           }
+          this.spinning = false
           this.isInster = false
         }).catch(err => {
+          this.spinning = false
           this.isInster = false
         })
       },

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

@@ -32,7 +32,7 @@
                 <a-button type="link">详情</a-button>
               </a-popover> -->
             </div>
-            <aRadio :style="radioStyle" v-for="(sitem,sindex) in item.promotionRuleList" :key="sindex" :value="item.promotionSn+'-'+sitem.promotionRuleSn">
+            <aRadio :style="radioStyle" v-for="(sitem,sindex) in item.promotionRuleList" :key="sindex" :value="item.promotionSn+'-'+sitem.promotionRuleSn+'-'+sitem.promotionProductType">
               {{sindex+1}}、{{ sitem.description }}
             </aRadio>
           </div>

+ 12 - 59
src/views/salesManagement/salesQueryNew/detail.vue

@@ -83,6 +83,7 @@
                 <span v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
                 <span v-if="$hasPermissions(authCode + '_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
                 <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_salesPrice')" style="color: red;">优惠金额:<strong>{{ detailData&&(detailData.totalLossAmount || detailData.totalLossAmount==0) ? toThousands(detailData.totalLossAmount) : '--' }}</strong>;</span>
               </div>
               <div>
                 <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
@@ -107,44 +108,17 @@
             </a-row>
           </a-form>
         </div>
-        <!-- 正常产品列表 -->
-        <div style="margin-bottom: 10px;">
+        <!-- 产品列表 -->
+        <div>
           <detailProductList 
-          ref="normalProduct" 
+          ref="productList" 
           :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" 
-        :key="item.promoRuleSn" 
-        >
-        <div class="active-title">
-          <div>
-            <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>
-          </div>
-          <div>
-            <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span>
-              总款数:<strong>{{ detailData&&(detailData.totalCommonCategory || detailData.totalCommonCategory==0) ? detailData.totalCommonCategory : '--' }}</strong>;
-              总数量:<strong>{{ detailData&&(detailData.totalCommonQty || detailData.totalCommonQty==0) ? detailData.totalCommonQty : '--' }}</strong>;
-          </div>
-        </div>
-        <detailProductList 
-        :ref="'active-'+item.promoRuleSn" 
-        :promo="item"
-        :showHeader="false"
-        :detailData="detailData" 
-        :warehouseSn="warehouseSn"
-        :salesBillSn="$route.params.sn || bizSn" 
-        :authCode="authCode"
-        :showCityPrice="isCityPrice"></detailProductList> 
+          :maxHeight="pageHeight"
+          :showCityPrice="isCityPrice">
+        </detailProductList> 
         </div>
       </a-card>
     </a-spin>
@@ -219,7 +193,7 @@
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
-import { STable, VSelect } from '@/components'
+import { VSelect } from '@/components'
 import printModal from './printModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import dsModal from '@/views/salesManagement/waitDispatchNew/dsModal.vue'
@@ -229,7 +203,6 @@ import detailProductList from './comps/detailProductList.vue'
 // 接口
 import { 
   salesDetailBySn, 
-  salesPromoQueryList, 
   salesDetailPrint, 
   salesDetailExcel, 
   salesDetailTypeExcel, 
@@ -241,7 +214,7 @@ import {
 export default {
   name: 'SalesDetailNew',
   mixins: [commonMixin],
-  components: { STable, VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList },
+  components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList },
   props: {
     bizSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
@@ -304,11 +277,9 @@ export default {
         this.searchTable()
       },100)
     },
+    // 查询数据
     searchTable(){
-      this.$refs.normalProduct.getTableData()
-      this.activeList.map(item => {
-        this.$refs['active-'+item.promoRuleSn][0].getTableData()
-      })
+      this.$refs.productList.pageInit()
     },
     //  详情
     getDetail () {
@@ -316,25 +287,7 @@ export default {
         if (res.status == 200) {
           this.detailData = res.data || null
         }
-        this.getActiveList()
-      })
-    },
-    // 查看活动详情
-    showDesc(e,item){
-
-    },
-    // 获取销售单参与的活动列表
-    getActiveList(){
-      salesPromoQueryList({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
-        if(res.status == 200){
-          this.activeList = res.data || []
-          this.activeList.map(item => {
-            item.isActive = true
-          })
-        }
-        this.$nextTick(()=>{
-          this.searchTable()
-        })
+        this.resetSearchForm()
       })
     },
     // 打开缺货明细

+ 96 - 25
src/views/salesManagement/salesQueryNew/edit.vue

@@ -33,6 +33,7 @@
         <div style="padding: 10px;">
           <productNormalList 
           ref="productNormalList" 
+          @insterOk="insterActiveOk"
           @openCpModal="openProductModal" 
           :detailData="detailData" 
           :warehouseSn="warehouseSn" 
@@ -46,6 +47,7 @@
       class="salesEdit-cont" 
       v-for="item in activeList" 
       :key="item.promoRuleSn" 
+      v-if="activeList.length"
       >
         <div slot="title" style="display: inline-block;width:100%;">
           <strong style="margin-right:10px;font-size:14px;">{{item.promotion.title}}</strong> ({{item.promotionRule.description}})
@@ -63,6 +65,7 @@
           :id="item.promoRuleSn" 
           @openCpModal="openProductModal" 
           @insterOk="insterActiveOk"
+          @upActive="upActive"
           :promo="item"
           :detailData="detailData" 
           :warehouseSn="warehouseSn" 
@@ -119,12 +122,17 @@
     </div>
     <!-- 添加产品 -->
     <chooseProduct
-        ref="chooseProduct"
-        :openModal="showCpModal"
-        @close="closeProductModal"
-        @addProduct="insterProduct"></chooseProduct>
+    ref="chooseProduct"
+    :openModal="showCpModal"
+    @close="closeProductModal"
+    @addProduct="insterProduct"></chooseProduct>
     <!-- 价格更新弹窗 -->
-    <setPriceModal :show="priceUpdateModal" :totalRealAmount="updataData.totalRealAmount" :totalAmount="updataData.totalAmount" @ok="updatePrice" @cancel="priceUpdateModal=false"></setPriceModal>
+    <setPriceModal 
+    :show="priceUpdateModal" 
+    :totalRealAmount="updataData.totalRealAmount" 
+    :totalAmount="updataData.totalAmount" 
+    @ok="updatePrice" 
+    @cancel="priceUpdateModal=false"></setPriceModal>
  </div>
 </template>
 
@@ -135,7 +143,7 @@ import productNormalList from './comps/productNormalList.vue'
 import chooseProduct from './comps/chooseProduct.vue'
 import setPriceModal from './setPriceModal.vue'
 import { salesDisablePromo } from '@/api/salesDetailNew'
-import { salesDetailBySn,salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo } from '@/api/salesNew'
+import { salesDetailBySn,salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo,salesPromoValidaSubmit } from '@/api/salesNew'
 export default {
   name: 'SalesNewEdit',
   mixins: [commonMixin],
@@ -193,7 +201,9 @@ export default {
         if (res.status == 200) {
           this.detailData = res.data
         }
-        this.getActiveList()
+        if(flag){
+          this.getActiveList()
+        }
       })
     },
     // 优惠明细查看
@@ -257,9 +267,19 @@ export default {
         this.showCpModal = true
     },
     // 添加活动产品成功的回调
-    insterActiveOk(){
-      // 刷新正常产品列表
-      this.$refs.productNormalList.resetSearchForm()
+    insterActiveOk(type){
+      if(type == 'promo'){
+        // 刷新正常产品列表
+        this.$refs.productNormalList.resetSearchForm()
+      }
+      if(type == 'normal'){
+        // 刷新活动产品列表
+        this.activeList.map(item => {
+          this.$refs['productList-' + item.promoRuleSn][0].resetSearchForm()
+        })
+      }
+      
+      this.getOrderDetail()
     },
     // 新增产品
     insterProduct(row, promotionFlag, type){
@@ -271,6 +291,12 @@ export default {
         this.$refs[this.cpCurRefId][0].insterProduct(row, promotionFlag, type)
       }
     },
+    // 更换活动promoRuleSn
+    upActive(row,data){
+      console.log(row,data)
+      const promo = data.split('-')
+      this.$refs['productList-'+promo[1]][0].insterProduct(row, 0, promo[2])
+    },
     // 选择价格类型  并更新
     updatePrice (type) {
       const _this = this
@@ -305,28 +331,73 @@ export default {
                 _this.priceUpdateModal = true
               })
             } else {
-              const ajax_data = { salesBillSn: this.salesBillSn }
-              this.submitResult(ajax_data)
+              this.submitResult({ salesBillSn: this.salesBillSn })
             }
           }
         })
       } else {
-        const ajax_data = { salesBillSn: this.salesBillSn }
-        this.submitResult(ajax_data)
+        this.submitResult({ salesBillSn: this.salesBillSn })
       }
     },
-    // 提交
-    submitResult (data) {
-      this.spinning = true
-      salesWriteSubmit(data).then(res => {
-        if (res.status == 200) {
-          this.handleBack()
-          this.$message.success(res.message)
-          this.spinning = false
-        } else {
-          this.spinning = false
+    // 提交销售单
+    async submitResult (data) {
+      const _this = this
+      // 校验活动规则
+      const vaildActive = await salesPromoValidaSubmit({salesBillSn: this.salesBillSn}).then(res => res.data)
+      // console.log(vaildActive)
+      const a = vaildActive.filter(item => item.type == 1) // 不可提交
+      const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
+      // 弹出不符合规则弹框,不可提交
+      if(a.length){
+        this.$info({
+          title: '提示',
+          centered: true,
+          class:'confirm-center',
+          okText:'关闭',
+          width: 600,
+          content: <div style="padding-top:15px;">
+            <ol>
+            {a.map(item => (
+              <li style="padding:3px 0;">{item.message}</li>
+            ))}
+            </ol>
+            <div style="padding:10px 0;text-align:center"><strong>请按照以上提示修改后再提交</strong></div>
+          </div>
+        });
+      }else{
+        // 弹出确认提示信息,可跳过继续提交
+        if(b.length){
+          this.$confirm({
+            title: '提示',
+            centered: true,
+            class:'confirm-center',
+            okText:'提交',
+            width: 600,
+            content: <div style="padding-top:15px;">
+              <ol>
+              {b.map(item => (
+                <li style="padding:3px 0;">{item.message}</li>
+              ))}
+              </ol>
+              <div style="padding:10px 0;text-align:center"><strong>继续提交将无法享受优惠</strong></div>
+            </div>,
+            onOk() {
+              _this.submitOrder(data)
+            }
+          });
+        }else{
+          _this.submitOrder(data)
         }
-      })
+      }
+    },
+    async submitOrder(data){
+      this.spinning = true
+      const res = await salesWriteSubmit(data)
+      if (res.status == 200) {
+        this.handleBack()
+        this.$message.success(res.message)
+      }
+      this.spinning = false
     },
     // 展开收缩活动详情
     showDesc(e,item){

+ 21 - 15
src/views/salesManagement/salesQueryNew/list.vue

@@ -88,7 +88,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="促销单">
                   <v-select
-                    v-model="queryParam.cxFlag"
+                    v-model="queryParam.promoFlag"
                     ref="cxFlag"
                     code="FLAG"
                     placeholder="请选择是否促销单"
@@ -162,13 +162,10 @@
         bordered>
         <!-- 销售单号 -->
         <template slot="salesBillNo" slot-scope="text, record">
-          <div v-if="$hasPermissions('B_salesDetail')">
-            <a-badge :count="'改'+record.changeTimes" :offset="[16,-13]" v-if="record.changeTimes>0" class="badge-con-t">
-              <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-            </a-badge>
-            <span v-else class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-          </div>
-          <div v-else>{{ record.salesBillNo }}</div>
+          <span v-if="$hasPermissions('B_salesDetail')" class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+          <span v-else>{{ record.salesBillNo }}</span>
+          <a-badge :count="'改'+record.changeTimes" :number-style="{ zoom:'80%' }" v-if="record.changeTimes>0"></a-badge>
+          <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
         </template>
         <!-- 出库仓库 -->
         <template slot="warehouseBox" slot-scope="text, record">
@@ -250,7 +247,7 @@
               size="small"
               type="link"
               class="button-warning"
-              v-if="record.billStatus=='FINISH'"
+              v-if="record.billStatus=='FINISH' && record.totalPromoGiftsAmount"
               @click="handleExpense(record)"
             >转费用报销单</a-button>
           </div>
@@ -298,7 +295,7 @@ 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 { findBySalesBillSn, dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
+import { dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
 import { salesDetailExport } from '@/api/salesBillReport'
 export default {
   name: 'SalesQueryList',
@@ -335,7 +332,8 @@ export default {
           subareaAreaSn: undefined
         },
         shippingAddrProvinceSn: undefined,
-        warehouseSn: undefined
+        warehouseSn: undefined,
+        promoFlag: undefined
       },
       totalData: {
         totalAmount: 0,
@@ -517,10 +515,10 @@ export default {
             <div style="padding:10px 0;text-align:center;">请选择费用报销单类型</div>
             <div style="padding:0 0 10px 0;text-align:center;">
               <aRadioGroup onChange={_this.changeDaOpt}>
-                <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="1">
+                <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="balance">
                   采购额结余
                 </aRadio>
-                <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="2">
+                <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="exceed">
                   采购额超出
                 </aRadio>
               </aRadioGroup>
@@ -544,8 +542,15 @@ export default {
       }
     },
     // 转费用单
-    expenseSave(data){
-
+    expenseSave(data, type){
+      console.log(data,type)
+      const row = data[type]
+      expenseAccountSave(row).then(res => {
+        if(res.status == 200){
+          this.$message.info(res.message)
+          this.$refs.table.refresh()
+        }
+      })
     },
     changeDaOpt(e){
       this.expenseOption = e.target.value
@@ -616,6 +621,7 @@ export default {
       this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.shippingAddrProvinceSn = undefined
       this.queryParam.warehouseSn = undefined
+      this.queryParam.promoFlag = undefined
       if (this.advanced) {
         this.$refs.subarea.clearData()
       }

+ 7 - 1
src/views/salesManagement/shortageStatisticsC/list.vue

@@ -127,6 +127,12 @@
         <template slot="salesBillNo" slot-scope="text, record">
           {{ record.salesBillNo }}
         </template>
+        <template slot="productCode" slot-scope="text, record">
+          <span style="padding-right: 15px;">{{ text }}</span>
+          <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+          <!-- <a-badge count="正" v-if="record.promotionFlag=='REGULAR'" :number-style="{ backgroundColor: '#108ee9', zoom:'80%' }"></a-badge> -->
+          <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
+        </template>
       </s-table>
     </a-spin>
   </a-card>
@@ -222,7 +228,7 @@ export default {
         { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '二级分类', dataIndex: 'productEntity.productTypeName2', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: 180, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', scopedSlots: { customRender: 'productCode' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品状态', dataIndex: 'productEntity.stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '缺货数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 5 - 2
src/views/salesManagement/shortageStatisticsP/list.vue

@@ -165,8 +165,11 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品状态', dataIndex: 'productShowStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      if (this.$hasPermissions('M_shortageStatisticsPList_salesPrice')) { //  售价权限
-        arr.splice(6, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      if (this.$hasPermissions('M_shortageStatisticsPList_costPrice')) { // 成本权限
+        arr.splice(6, 0, { title: '缺货成本金额', dataIndex: 'showCost', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      }
+      if (this.$hasPermissions('M_shortageStatisticsPList_salesPrice')) { // 售价权限
+        arr.splice(7, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }

+ 118 - 153
src/views/salesManagement/waitDispatchNew/detailProductList.vue

@@ -1,17 +1,16 @@
 <template>
     <div class="productInfoList-wrap">
       <!-- alert -->
-      <div style="margin-bottom: 10px;display: flex;align-items: center;">
+      <div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="!showEmpty">
         <div style="display: flex;align-items: center;">
-          <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量删除</a-button>
+          <a-button type="danger" :disabled="newLoading" class="button-info" @click="delSalerDetailAll">批量删除</a-button>
           <span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
         </div>
-        <div style="padding-left: 20px;" v-if="detailData">
-          本次下推款数:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-          本次下推数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
+        <div style="padding-left: 20px;">
+          <slot name="total"></slot>
         </div>
       </div>
-      
+
       <a-spin :spinning="spinning" tip="Loading...">
           <ve-table
                 border-y
@@ -30,7 +29,7 @@
                 :column-width-resize-option="columnWidthResizeOption"
                 :checkbox-option="checkboxOption"
               />
-          <div v-show="showEmpty" class="empty-data">暂无数据</div>
+          <div v-show="showEmpty" class="empty-data">暂无待下推产品</div>
       </a-spin>
   
     </div>
@@ -39,7 +38,6 @@
   <script>
   import { commonMixin } from '@/utils/mixin'
   import { deleteBatch, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
-  import { findBySalesBillSn } from '@/api/dispatch'
  
   import { STable, VSelect } from '@/components'
   import chooseWarehouse from '@/views/common/chooseWarehouse'
@@ -63,8 +61,8 @@
     },
     data () {
       return {
-        queryParam: {
-            dispatchBillSn
+        productForm: {
+            dispatchBillSn: ''
         },
         disabled: false, //  查询、重置按钮是否可操作
         spinning: false,
@@ -89,7 +87,9 @@
         showEmpty: false,
         showTableHead: true,
         disableSelectedRowKeys: [],
-        selectedRowKeys: []
+        selectedRowKeys: [],
+        detailData: null,
+        activeList: []
       }
     },
     computed: {
@@ -122,10 +122,10 @@
                 ftext = '促'
                 fcolor = '#52c41a'
               }
-              if(record.promotionFlag == 'REGULAR'){
-                ftext = '正'
-                fcolor = '#108ee9'
-              }
+              // if(record.promotionFlag == 'REGULAR'){
+              //   ftext = '正'
+              //   fcolor = '#108ee9'
+              // }
               if(record.promotionFlag == 'DISCOUNT'){
                 ftext = '特'
                 fcolor = '#faad14'
@@ -145,9 +145,10 @@
               <div>
                 <a-input-number
                   size="small"
-                  vModel={record.cancelNums}
+                  value={record.qty}
+                  onChange={e => _this.cancelNumsChange(e,record)}
                   precision={0}
-                  min={0}
+                  min={1}
                   max={record.surplusQty}
                   style="width: 100%;"
                   placeholder="请输入" />
@@ -164,75 +165,31 @@
                  <a-button
                   size="small"
                   type="link"
-                  class="button-info"
-                  onClick={()=>_this.handleAdd(record)}
-                  >添加</a-button>
+                  class="button-error"
+                  onClick={()=>_this.handleDel(record)}
+                  >删除</a-button>
               </div>
             )
           }
           return '--'
         }
-        // 编号,并且格式化活动分类行
-        const noFormat = function(record,data,h){
-          return (
-            <div>
-              {record.id.indexOf('promo-')>=0 ? (
-                <div class="active-title">
-                  {record.promo?(
-                    <div>
-                      <strong style="margin-right:10px;font-size:14px;">{record.promo.promotion.title} ({record.promo.promotionRule.description})</strong>
-                      <span style="margin-left:10px;color:#00aaff;cursor: pointer;" onClick={()=>this.showDesc(record)}>
-                        <a-icon title="查看活动详情" type="eye"/> 活动详情
-                      </span>
-                    </div>
-                  ):(<div></div>)}
-                  <div>
-                      总售价:<strong>12333</strong>;
-                      总款数:<strong>22</strong>;
-                      总数量:<strong>134</strong>;
-                  </div>
-                </div>
-              ):(<span>{data}</span>)}
-            </div>
-          )
-        }
-  
+
         let arr= [
               { title: "", field: "", key: "acheck", type: "checkbox", align: "center" },
-              { title: '序号', field: 'no',key: "a", width: 50, align: 'center', operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
+              { title: '序号', field: 'no',key: "a", width: 50, align: 'center', 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] || '--'}}
+              { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+              { title: '待下推数量', field: 'surplusQty', width: 80,key: "o", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
+              { title: '本次下推数', field: 'qty', width: 80,key: "r", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return inputFormat(row,row[column.field],h)} },
+              { title: '单位', field: 'productOrigUnit',key: "i", width: 80, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
+              { title: '操作', field: 'action', width: 80,key: "s", align: 'center',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row,row[column.field],h)} }
           ]
-        if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
-          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')) {
-          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',fixed: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return actionFormat(row,row[column.field],h)} },
-          ])
-        
+       
         return arr
       }
     },
     methods: {
-      //  产品分类  change
-      changeProductType (val, opt) {
-        this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
-        this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
-        this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
-      },
       // 合并活动分类单元格
       bodyCellSpan({ row, column, rowIndex }) {
         if (row.id.indexOf('promo-')>=0) {
@@ -259,29 +216,15 @@
         // console.log(isSelected, selectedRowKeys);
         this.selectedRowKeys = selectedRowKeys;
       },
-      // 获取销售单参与的活动列表
-      getActiveList(){
-        salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
-          if(res.status == 200){
-            this.activeList = res.data || []
-          }
-          this.$nextTick(()=>{
-            this.searchTable()
-          })
-        })
-      },
       async searchTable(){
           this.selectedRowKeys = []
           this.disableSelectedRowKeys = []
           this.dataSource = []
           this.disabled = true
           this.spinning = true
-          this.queryParam.salesBillSn = this.salesBillSn
-          this.queryParam.showStock = true
-          const params = this.queryParam
-          // 正常产品
+          const params = this.productForm
+          // 带下推产品
           const listData = await waitDispatchDetailAllList(params).then(res => res.data)
-          const countData = await findBySalesBillSn({salesBillSn: this.salesBillSn}).then(res => res.data)
           console.log(listData)
           this.dataSource = listData
   
@@ -294,100 +237,122 @@
             const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
             const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
             const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
+            const warehouseName = item.dispatchBill && item.dispatchBill.warehouseName || ''
             item.productCode = productCode || '--'
             item.productName = productName || '--'
             item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
             item.productOrigUnit = productOrigUnit || '--'
-            if(item.stockQty<0 || !item.stockQty){
-              this.disableSelectedRowKeys.push(item.id)
-            }
+            item.warehouseName = warehouseName || '--'
+            item.qtyBackups = item.qty
           })
-          this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
+          this.showEmpty = this.dataSource.length <= 0
+          this.tableHeight = (this.showEmpty ? 300 : this.maxHeight) + 'px'
           this.spinning = false
           this.disabled = false
       },
       //  重置
       resetSearchForm () {
-        this.queryParam.ptype = '0'
-        this.queryParam.productCode = ''
-        this.queryParam.productName = ''
-        this.queryParam.promotionFlag = undefined
-        this.queryParam.brandSn = undefined
-        this.queryParam.productTypeSn1 = ''
-        this.queryParam.productTypeSn2 = ''
-        this.queryParam.productTypeSn3 = ''
-        this.queryParam.warehouseSn = undefined
-        this.productType = []
         this.dataSource = []
+        this.clearSelectTable()
         this.searchTable()
       },
-      pageInit (salesBillSn, detailData) {
-        this.salesBillSn = salesBillSn
+      pageInit (productForm, detailData, activeList) {
+        this.productForm = Object.assign(this.productForm,productForm)
         this.detailData = detailData
+        this.activeList = activeList
         // 获取活动列表
-        this.getActiveList()
+        this.resetSearchForm()
       },
       // 清空选项
       clearSelectTable () {
          this.selectedRowKeys = []
       },
-      // 添加
-      handleAdd (row) {
-        if (row.stockQty > 0) { //  可用库存大于0才可添加
-          this.$emit('addProduct', [row.salesBillDetailSn])
+      // 已选产品  blur
+      cancelNumsChange (val, record) {
+        const _this = this
+        if (val && val != record.qtyBackups) {
+          _this.spinning = true
+          updateQty({
+            dispatchBillDetailSn: record.dispatchBillDetailSn,
+            qty: record.qty,
+            salesBillSn: _this.detailData.salesBillSn,
+            dispatchBillSn: _this.productForm.dispatchBillSn
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.spinning = false
+              _this.$emit('refashTable')
+            } else {
+              _this.spinning = false
+            }
+          })
         } else {
-          this.$message.warning('库存为0,不可添加!')
+          record.qty = record.qtyBackups
         }
       },
-      // 批量添加
-      handlePlAdd () {
-        const _this = this
-        const chooseList = this.selectedRowKeys
-        if (chooseList.length == 0) {
-          _this.$message.warning('请先选择产品!')
-          return
-        }
-        const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
-        const obj = []
-        chooseRow && chooseRow.map(item => {
-          if (item.stockQty > 0) {
-            obj.push(item.salesBillDetailSn)
-          }
-        })
-         
-        this.$confirm({
-          title: '提示',
-          content: '确认要批量添加到待下推列表吗?',
-          centered: true,
-          closable: true,
-          onOk () {
-            _this.$emit('addProduct', obj)
+       // 删除产品
+        handleDel (row) {
+          const _this = this
+          this.$confirm({
+            title: '提示',
+            content: '确认要删除吗?',
+            centered: true,
+            closable: true,
+            onOk () {
+              _this.deleteFun(row, 0)
+            }
+          })
+        },
+        // 移除操作
+        deleteFun (row, type) {
+          const _this = this
+          _this.spinning = true
+          deleteBatch({
+            dispatchBillSn: this.productForm.dispatchBillSn,
+            dispatchBillDetailList : type == 0 ? [row.dispatchBillDetailSn] : row
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$emit('refashTable')
+              _this.$message.success(res.message)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        },
+        // 批量删除
+        delSalerDetailAll () {
+          const _this = this
+          const chooseList = this.selectedRowKeys
+          if (chooseList.length == 0) {
+            _this.$message.warning('请选择待下推产品!')
+            return
           }
-        })
-      },
-      // 批量取消
-      handlePlCancel () {
-        const _this = this
-        const chooseList = this.selectedRowKeys
-        if (chooseList.length == 0) {
-          _this.$message.warning('请先选择产品!')
-          return
-        }
-        const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
-        const obj = []
-        chooseRow && chooseRow.map(item => {
-          obj.push({
-            'cancelQty': item.cancelNums,
-            'salesBillDetailSn': item.salesBillDetailSn
+          const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
+          const obj = []
+          chooseRow && chooseRow.map(item => {
+            obj.push(item.dispatchBillDetailSn)
           })
-        })
-  
-        this.$emit('cancelProduct', obj)
-      }
+
+          this.$confirm({
+            title: '提示',
+            content: '确认要批量删除吗?',
+            centered: true,
+            closable: true,
+            onOk () {
+              _this.deleteFun(obj, 1)
+            }
+          })
+        },
     }
   }
   </script>
   <style lang="less">
+  .empty-data{
+        color: #999;
+        text-align: center;
+        padding: 20px;
+    }
     .ve-table-body-td{
       .active-title{
         display: flex;

+ 26 - 187
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -23,64 +23,13 @@
           </div>
         </div>
 
-        <div style="margin: 0 0 10px 0;">
-          <a-button
-            type="danger"
-            @click="delSalerDetailAll"
-            :loading="delLoading"
-            id="waitDispatch-del-all">批量移除</a-button>
-
-            <div style="display: inline-block;margin-left: 15px;">
-              本次下推款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
-              本次下推数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
-            </div>
-        </div>
-        
         <!-- 已选配件列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.id"
-          :row-selection="{ columnWidth: 40 }"
-          @rowSelection="rowSelectionFun"
-          :columns="columns"
-          :data="loadData"
-          :showPagination="false"
-          :scroll="{ y: 300 }"
-          :defaultLoadData="false"
-          bordered>
-          <!-- 产品编码 -->
-          <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="salesNums" slot-scope="text, record">
-            <a-input-number
-              id="salesReturn-qty"
-              size="small"
-              v-model="record.qty"
-              :precision="0"
-              :min="1"
-              :max="record.surplusQty"
-              placeholder="请输入"
-              @blur="e => onCellBlur(e.target.value, record)"
-              style="width: 100%;" />
-          </template>
-          <!-- 操作 -->
-          <template slot="action" slot-scope="text, record">
-            <a-button
-              size="small"
-              type="link"
-              :loading="delLoading"
-              class="button-error"
-              @click="handleDel(record)"
-            >移除</a-button>
+        <detailProductList ref="waitProduct" @refashTable="refashTable">
+          <template slot="total">
+            本次下推款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
+            本次下推数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
           </template>
-        </s-table>
+        </detailProductList>
       </a-card>
     </a-spin>
     <div class="affix-cont">
@@ -101,18 +50,19 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
+import { VSelect } from '@/components'
 import queryPart from './queryPart.vue'
+import detailProductList from './detailProductList.vue'
 import dsModal from './dsModal.vue'
 import { salesDetailBySn } from '@/api/salesNew'
 import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetailNew'
-import { deleteBatch, pushDown, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
+import { pushDown } from '@/api/waitDispatchDetail'
 import { findBySalesBillSn } from '@/api/dispatch'
 
 export default {
   name: 'WaitDispatch',
   mixins: [commonMixin],
-  components: { STable, VSelect, queryPart, dsModal },
+  components: { detailProductList, VSelect, queryPart, dsModal },
   data () {
     return {
       showDsModal: false,
@@ -123,152 +73,36 @@ export default {
       delLoading: false, // 是否正在移除产品
       loading: false, // 是否下推中
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
-      dataSource: [],
       productForm: {
         dispatchBillSn: ''
       },
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '26%', align: 'center' },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '29%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '出库仓库', dataIndex: 'dispatchBill.warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '待下推数量', dataIndex: 'surplusQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次下推数', scopedSlots: { customRender: 'salesNums' }, width: '11%', align: 'center' },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // 查询统计
-        return waitDispatchDetailAllList(Object.assign(parameter, this.productForm)).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            const no = 0
-            for (var i = 0; i < data.length; i++) {
-              data[i].no = no + i + 1
-              data[i].qtyBackups = data[i].qty
-            }
-            this.disabled = false
-            this.dataSource = data
-          }
-          return data
-        })
-      },
-      totalData: null,
-      rowSelectionInfo: null
+      totalData: null
     }
   },
   methods: {
-    // 表格选中项
-    rowSelectionFun (obj) {
-      this.rowSelectionInfo = obj || null
-    },
     // 统计查询
-    getTotalData () {
+    getTotalData (flag) {
       findBySalesBillSn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
         if (res.status == 200) {
           this.totalData = res.data || null
           if (res.data && Object.keys(res.data).length > 0) {
             this.productForm.dispatchBillSn = res.data.dispatchBillSn
             const _this = this
-            this.$nextTick(() => {
-              _this.$refs.table.refresh()
-            })
-          } else {
-            this.dataSource = []
-            this.$refs.table.clearTable()
+            if(flag){
+              _this.$refs.waitProduct.pageInit(this.productForm, this.detailData, this.$refs.partQuery.activeList)
+            }else{
+              _this.$refs.waitProduct.resetSearchForm()
+            }
           }
         } else {
           this.totalData = null
         }
       })
     },
-    // 已选产品  blur
-    onCellBlur (val, record) {
-      const _this = this
-      if (val && val != record.qtyBackups) {
-        _this.spinning = true
-        updateQty({
-          dispatchBillDetailSn: record.dispatchBillDetailSn,
-          qty: record.qty,
-          salesBillSn: _this.salesBillSn,
-          dispatchBillSn: _this.productForm.dispatchBillSn
-        }).then(res => {
-          if (res.status == 200) {
-            _this.$refs.partQuery.resetCurForm()
-            _this.$message.success(res.message)
-            _this.spinning = false
-            _this.getTotalData()
-          } else {
-            _this.spinning = false
-          }
-        })
-      } else {
-        record.qty = record.qtyBackups
-      }
-    },
     //  返回
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
     },
-    // 批量删除
-    delSalerDetailAll () {
-      const _this = this
-      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
-        _this.$message.warning('请在选择待下推产品!')
-        return
-      }
-      const obj = []
-      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-        if (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.indexOf(item.id) != -1) {
-          obj.push(item.dispatchBillDetailSn)
-        }
-      })
-      this.$confirm({
-        title: '提示',
-        content: '确认要批量删除吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.deleteFun(obj, 1)
-        }
-      })
-    },
-    // 删除产品
-    handleDel (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要删除吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.deleteFun(row, 0)
-        }
-      })
-    },
-    // 移除操作
-    deleteFun (row, type) {
-      const _this = this
-      _this.delLoading = true
-      _this.spinning = true
-      deleteBatch({
-        dispatchBillSn: this.productForm.dispatchBillSn,
-        dispatchBillDetailList : type == 0 ? [row.dispatchBillDetailSn] : row
-      }).then(res => {
-        if (res.status == 200) {
-          _this.getTotalData()
-          _this.$message.success(res.message)
-          _this.spinning = false
-        } else {
-          _this.spinning = false
-        }
-        _this.delLoading = false
-      })
-    },
     // 添加产品
     insterProduct (list) {
       // 防止多次添加产品
@@ -286,6 +120,7 @@ export default {
       }).then(res => {
         if (res.status == 200) {
           this.getTotalData()
+          this.$refs.partQuery.clearSelectTable()
           this.$message.success('添加成功', 2.5)
           this.spinning = false
         } else {
@@ -315,18 +150,24 @@ export default {
         this.isInster = false
       })
     },
+    refashTable(){
+      this.getTotalData()
+      // this.$refs.partQuery.resetSearchForm()
+    },
     //  销售单详情
     getOrderDetail () {
-      salesDetailBySn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
+      salesDetailBySn({ salesBillSn: this.salesBillSn }).then(res => {
         if (res.status == 200) {
           this.detailData = res.data
-          this.$refs.partQuery.pageInit(this.$route.params.salesBillSn, this.detailData)
+          this.getTotalData(true)
+          this.$refs.partQuery.pageInit(this.salesBillSn, this.detailData)
         }
       })
     },
     // 提交下推
     handleDispatch () {
-      if (this.dataSource.length) {
+      const dataSource = this.$refs.waitProduct.dataSource
+      if (dataSource.length) {
         this.showDsModal = true
         this.detailData.dispatchBillCount = this.totalData.dispatchBillCount
         this.detailData.receiverName = this.totalData.receiverName ? this.totalData.receiverName : ''
@@ -355,11 +196,9 @@ export default {
       })
     },
     pageInit () {
-      this.rowSelectionInfo = null
       this.$refs.partQuery.clearSelectTable()
       this.salesBillSn = this.$route.params.salesBillSn
       this.getOrderDetail()
-      this.getTotalData()
     }
   },
   mounted () {

+ 29 - 18
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -14,17 +14,17 @@
               <a-input id="productInfoList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
-          <!-- <a-col :md="6" :sm="24">
+          <a-col :md="4" :sm="24">
             <a-form-item label="是否促销品">
               <v-select
                 code="FLAG"
-                id="productInfoList-promotionFlag"
-                v-model="queryParam.promotionFlag"
+                id="productInfoList-promoFlag"
+                v-model="queryParam.promoFlag"
                 allowClear
                 placeholder="请选择是否"
               ></v-select>
             </a-form-item>
-          </a-col> -->
+          </a-col>
           <a-col :md="4" :sm="24">
             <a-form-item label="类型">
               <a-select v-model.trim="queryParam.ptype" :dropdownMatchSelectWidth="false" >
@@ -135,7 +135,7 @@ export default {
         ptype: '0', // 类型
         productCode: '', //  产品编码
         productName: '', //  产品名称
-        promotionFlag: undefined, //  是否促销品
+        promoFlag: undefined, //  是否促销品
         brandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
@@ -167,7 +167,8 @@ export default {
       showEmpty: false,
       showTableHead: true,
       disableSelectedRowKeys: [],
-      selectedRowKeys: []
+      selectedRowKeys: [],
+      colspanNums: 16
     }
   },
   computed: {
@@ -200,10 +201,10 @@ export default {
               ftext = '促'
               fcolor = '#52c41a'
             }
-            if(record.promotionFlag == 'REGULAR'){
-              ftext = '正'
-              fcolor = '#108ee9'
-            }
+            // if(record.promotionFlag == 'REGULAR'){
+            //   ftext = '正'
+            //   fcolor = '#108ee9'
+            // }
             if(record.promotionFlag == 'DISCOUNT'){
               ftext = '特'
               fcolor = '#faad14'
@@ -260,15 +261,15 @@ export default {
                 {record.promo?(
                   <div>
                     <strong style="margin-right:10px;font-size:14px;">{record.promo.promotion.title} ({record.promo.promotionRule.description})</strong>
-                    <span style="margin-left:10px;color:#00aaff;cursor: pointer;" onClick={()=>this.showDesc(record)}>
+                    <span style="margin-left:10px;color:#00aaff;cursor: pointer;" onClick={()=>_this.showDesc(record)}>
                       <a-icon title="查看活动详情" type="eye"/> 活动详情
                     </span>
                   </div>
                 ):(<div></div>)}
                 <div>
-                    总售价:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;
-                    总款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
-                    总数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
+                    款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
+                    数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
+                    {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
                 </div>
               </div>
             ):(<span>{data}</span>)}
@@ -284,14 +285,17 @@ export default {
             { 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] || '--'}}
         ]
+      this.colspanNums = 6
       if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
+        this.colspanNums = this.colspanNums + 1
         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')) {
+        this.colspanNums = this.colspanNums + 1
         arr.push({ title: '成本价', field: 'showCost', width: 80,key: "g", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
       }    
+      this.colspanNums = this.colspanNums + 8
       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])} },
@@ -318,7 +322,7 @@ export default {
         if(column.field=='no'){
           return {
                     rowspan: 1,
-                    colspan: 17,
+                    colspan: this.colspanNums,
                 };
         }else{
           return {
@@ -384,11 +388,11 @@ export default {
           // 获取活动产品列表
           const aclist = await salesDetailAllList(activeParams).then(res => res.data)
           // 获取活动产品统计
-          // const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+          const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
           const retList = [{
             id: 'promo-'+i,
             promo: promo,
-            // total: acTotal
+            total: acTotal
           },...aclist]
           listData = aclist&&aclist.length ? listData.concat(retList) : listData
         }
@@ -415,6 +419,7 @@ export default {
             this.disableSelectedRowKeys.push(item.id)
           }
         })
+        this.showEmpty = this.dataSource.length <= 0
         this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
         this.spinning = false
         this.disabled = false
@@ -432,6 +437,7 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.productType = []
       this.dataSource = []
+      this.clearSelectTable()
       this.searchTable()
     },
     pageInit (salesBillSn, detailData) {
@@ -501,6 +507,11 @@ export default {
 }
 </script>
 <style lang="less">
+    .empty-data{
+        color: #999;
+        text-align: center;
+        padding: 20px;
+    }
   .ve-table-body-td{
     .active-title{
       display: flex;

+ 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.113:8660/ocs-admin',
+        // target: 'http://192.168.2.111/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: {