浏览代码

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

chenrui 1 年之前
父节点
当前提交
568cd3fefb

+ 14 - 12
src/api/salesNew.js

@@ -73,24 +73,34 @@ export const salesPromoQueryList = (params) => {
     })
 }
 
-
 //  销售 审核
 export const salesWriteAudit = (params) => {
   return axios({
-    url: '/sales/audit',
+    url: '/salesn/audit',
     data: params,
     method: 'post'
   })
 }
-//  销售 一键审核
+
+//  销售 一键审核下推
 export const salesWriteAuditPush = (params) => {
   return axios({
-    url: '/sales/auditPush',
+    url: '/salesn/auditPush',
+    data: params,
+    method: 'post'
+  })
+}
+//  销售 提交
+export const salesWriteSubmit = (params) => {
+  return axios({
+    url: '/salesn/submit',
     data: params,
     method: 'post'
   })
 }
 
+
+
 //  销售 打印
 export const salesPrint = (params) => {
   return axios({
@@ -107,14 +117,6 @@ export const salesPrintPreview = (params) => {
     method: 'post'
   })
 }
-//  销售 提交
-export const salesWriteSubmit = (params) => {
-  return axios({
-    url: '/sales/submit',
-    data: params,
-    method: 'post'
-  })
-}
 
 // 获取促销活动
 export const getPromoacActiveList = (params) => {

+ 11 - 0
src/api/stock.js

@@ -59,6 +59,17 @@ export const queryStockProductPage = (params) => {
     method: 'post'
   })
 }
+// 分页查询促销产品
+export const queryPromoProductPage = (params) => {
+  const url = `/stock/queryPromoProductPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 
 //  出入库明细 列表  有分页
 export const stockFlowList = (params) => {

+ 35 - 15
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -48,10 +48,7 @@
       </a-form>
     </div>
     <a-tabs type="card" @change="changeTab">
-      <a-tab-pane key="1" tab="门槛产品"></a-tab-pane>
-      <a-tab-pane key="2" tab="正价产品"></a-tab-pane>
-      <a-tab-pane key="3" tab="促销产品"></a-tab-pane>
-      <a-tab-pane key="4" tab="特价产品"></a-tab-pane>
+      <a-tab-pane v-for="item in tabList" :key="item.val" :tab="item.text"></a-tab-pane>
     </a-tabs>
     <!-- 列表 -->
     <s-table
@@ -108,7 +105,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { queryStockProductPage } from '@/api/stock'
+import { queryPromoProductPage } from '@/api/stock'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
@@ -139,12 +136,15 @@ export default {
       defaultWarehouseSn: undefined, // 默认仓库sn
       tableHeight: 300,
       disabled: false, //  查询、重置按钮是否可操作
-      promoProductClz: null,
+      promoProductClz: 'GATE',
+      promoRuleData: null,
+      tabList:[],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.queryParam.dealerSn = this.buyerSn
-        return queryStockProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1', pricingState: 'PRICED' })).then(res => {
+        this.queryParam.promoProductClz = this.promoProductClz
+        return queryPromoProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: '1', pricingState: 'PRICED' })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -158,6 +158,7 @@ export default {
               const productUnit = data.list[i].productUnit || '--'
               const productPackQtyUnit = data.list[i].productPackQtyUnit || '--'
               data.list[i].packQtyV = productPackQty + productUnit + '/' + productPackQtyUnit
+              data.list[i].unitQtyV = data.list[i].unitQty + data.list[i].unitTypeDictValue
             }
             this.disabled = false
           }
@@ -175,12 +176,11 @@ export default {
         { title: '品牌', dataIndex: 'productBrandName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '出库仓库', dataIndex: 'warehouseName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '包装数', dataIndex: 'packQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '起订量', dataIndex: 'packQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '起订量', dataIndex: 'unitQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '下单数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '8%', align: 'center' },
-        { title: '实际数量', dataIndex: 'packQtyV', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
@@ -204,8 +204,8 @@ export default {
     },
     // 切换tab
     changeTab(e){
-      console.log(e)
-      this.promoProductClz = e.key
+      this.promoProductClz = e
+      this.resetSearchForm()
     },
     // 双击列表
     handleClickRow (record) {
@@ -244,8 +244,28 @@ export default {
       this.queryParam.warehouseSn = this.defaultWarehouseSn
       this.$refs.table.refresh(true)
     },
-    pageInit (buyerSn, warehouseSn) {
-      this.buyerSn = buyerSn
+    pageInit (data, promo) {
+      this.buyerSn = data.buyerSn
+      this.promoRuleData = promo.promotionRule
+      this.queryParam.dealerLevel = data.buyerLevel
+      this.queryParam.promoRuleSn = promo.promoRuleSn
+      const tabList = []
+      if(this.promoRuleData){
+        if(this.promoRuleData.gateFlag==='1'){
+          tabList.push({text:'门槛产品',val:'GATE'})
+        }
+        if(this.promoRuleData.promotionRuleType!='PROMO_PROD'){
+          tabList.push({text:'正价产品',val:'REGULAR'})
+        }
+        if(this.promoRuleData.regularPromotionSameFlag==='0'){
+          tabList.push({text:'促销产品',val:'GIFT'})
+        }
+        if(this.promoRuleData.promotionRuleType=='PROMO_PROD'){
+          tabList.push({text:'特价产品',val:'DISCOUNT'})
+        }
+      }
+      this.tabList = tabList
+      this.promoProductClz = tabList[0].val
       this.tableHeight = window.innerHeight - 350
     },
     // 刷新当前页面
@@ -257,7 +277,7 @@ export default {
     },
     // 选择配件
     handleAdd (row) {
-      this.$emit('add', row, 0)
+      this.$emit('add', row, 0, this.promoProductClz)
     },
     //  产品分类  change
     changeProductType (val, opt) {

+ 15 - 17
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -15,7 +15,7 @@
           <div>
             <!-- 查询配件列表 -->
             <queryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
-            <activeQueryPart v-else ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
+            <activeQueryPart v-if="cptype==1" ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
           </div>
         </div>
       </a-spin>
@@ -39,18 +39,10 @@ export default {
         return []
       }
     },
-    buyerSn: {
-      type: String,
-      default: ''
-    },
     isInster: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    type: {
-      type: [String,Number],
-      default: '0'
-    },
     zIndex:{
       type: [String,Number],
       default: 1000
@@ -59,8 +51,9 @@ export default {
   data () {
     return {
       spinning: false,
-      cptype: 0,
+      cptype: 3,
       isShow: this.openModal, //  是否打开弹框
+      orderData: null
     }
   },
   
@@ -71,25 +64,30 @@ export default {
     // 添加产品
     insterProduct (row, promotionFlag, promoProductClz) {
       this.$emit('addProduct', row, promotionFlag, promoProductClz)
+    },
+    pageInit(data, promo, type){
+      console.log(data, promo, type)
+      this.cptype = type
+      this.orderData = data
+      this.$nextTick(()=>{
+        this.$refs.partQuery.pageInit(data, promo)
+      })
     }
   },
   watch: {
-    type(newValue, oldValue){
-      this.cptype = newValue
-    },
     //  父页面传过来的弹框状态
     openModal (newValue, oldValue) {
       this.isShow = newValue
     },
-    buyerSn (newStr, oldStr){
-      this.$refs.partQuery.pageInit(newStr)
-    },
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
+        this.cptype = 3
         this.$emit('close')
       } else {
-        this.$refs.partQuery.resetSearchForm()
+        if(this.$refs.partQuery){
+          this.$refs.partQuery.resetSearchForm() 
+        }
       }
     }
   }

+ 25 - 19
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -81,7 +81,7 @@
         <a-col :md="12" :sm="24" style="text-align:left;">
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
-              <a-menu-item key="0">
+              <a-menu-item key="0" :disabled="disablePromo">
                 仓库设置
               </a-menu-item>
               <a-menu-item key="1">
@@ -103,26 +103,27 @@
             type="link"
             class="button-info"
              @click="showSearchBox=!showSearchBox" ><a-icon type="search"/> 筛选</a-button>
-          <a-dropdown>
+          <a-dropdown :disabled="disablePromo">
             <a-menu slot="overlay" @click="handleImportClick">
-              <a-menu-item key="0">
+              <a-menu-item key="GATE">
                 导入门槛产品
               </a-menu-item>
-              <a-menu-item key="1">
+              <a-menu-item key="REGULAR">
                 导入正价产品
               </a-menu-item>
-              <a-menu-item key="2">
+              <a-menu-item key="GIFT">
                 导入促销产品
               </a-menu-item>
             </a-menu>
             <a-button
               type="link"
-              class="button-info"
+              :class="disablePromo?'button-gray':'button-info'"
             > 导入产品 <a-icon type="down" /> </a-button>
           </a-dropdown>
           <a-button
             type="link"
-            class="button-info"
+            :class="disablePromo?'button-gray':'button-info'"
+            :disabled="disablePromo"
             @click="openCpModal"><a-icon type="plus" /> 添加产品</a-button>
         </a-col>
       </a-row>
@@ -142,10 +143,11 @@
       bordered>
       <!-- 产品编码 -->
       <template slot="productCode" slot-scope="text, record">
-        <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)">
-          <div style="padding-right: 15px;">{{ text }}</div>
-        </a-badge>
-        <span v-if="!(Number(record.stockQty||0) < Number(record.unpushedQty||0))">{{ text }}</span>
+        <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>
+        <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)" :number-style="{ zoom:'80%' }"></a-badge>
       </template>
       <!-- 产品名称 -->
       <template slot="productName" slot-scope="text, record">
@@ -341,6 +343,7 @@
         openUpActiveModal: false,
         descDetail: null,
         promoProductClz: null, // 活动产品分类
+        disablePromo: false
       }
     },
     computed: {
@@ -389,7 +392,7 @@
         this.descDetail = descDetail
       },
       openCpModal(){
-        this.$emit('openCpModal', 1, 'productList-'+this.id)
+        this.$emit('openCpModal', 1, this.id)
       },
       // 表格选中项
       rowSelectionFun (obj) {
@@ -401,6 +404,11 @@
         this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
         this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
       },
+      // 禁用活动
+      disableActive(){
+        this.resetSearchForm()
+        this.disablePromo = true
+      },
       //  重置
       resetSearchForm (flag) {
         this.queryParam.productCode = ''
@@ -573,7 +581,7 @@
       },
       // 添加产品
       insterProduct (row, promotionFlag, promoProductClz) {
-        console.log(row, promotionFlag)
+        console.log(row, promotionFlag, promoProductClz)
         // 防止多次添加产品
         if (this.isInster) { return }
         const _this = this
@@ -585,12 +593,10 @@
         this.isInster = true
         this.spinning = true
         salesDetailInsert({
-          salesPromoDetailDTO:{
-            salesPromoSn: this.promo.salesPromoSn,
-            promoRuleSn: this.promo.promoRuleSn,
-            promoSn: this.promo.promoSn,
-            promoProductClz: promoProductClz
-          },
+          salesPromoSn: this.promo.salesPromoSn,
+          promoRuleSn: this.promo.promoRuleSn,
+          promoSn: this.promo.promoSn,
+          promoProductClz: promoProductClz,
           packQty: row.productPackQty,
           productSn: row.productSn,
           showCost: row.lastStockCost,

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

@@ -90,7 +90,7 @@
       bordered>
       <!-- 产品编码 -->
       <template slot="productCode" slot-scope="text, record">
-        <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)">
+        <a-badge count="缺" v-if="Number(record.stockQty||0) < Number(record.unpushedQty||0)" :number-style="{ zoom:'80%' }">
           <div style="padding-right: 15px;">{{ text }}</div>
         </a-badge>
         <span v-if="!(Number(record.stockQty||0) < Number(record.unpushedQty||0))">{{ text }}</span>

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

@@ -231,8 +231,8 @@ export default {
       this.queryParam.warehouseSn = this.defaultWarehouseSn
       this.$refs.table.refresh(true)
     },
-    pageInit (buyerSn, warehouseSn) {
-      this.buyerSn = buyerSn
+    pageInit (data, promo) {
+      this.buyerSn = data.buyerSn
       this.tableHeight = window.innerHeight - 310
     },
     // 刷新当前页面

+ 2 - 2
src/views/salesManagement/salesQueryNew/detail.vue

@@ -122,7 +122,7 @@
           <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'))">
               <span>{{ text }}</span>
-              <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1"></a-badge>
+              <!-- <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1"></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>
@@ -218,7 +218,7 @@ import dsModal from '@/views/salesManagement/waitDispatch/dsModal.vue'
 import stockOutDetail from './stockOutDetailModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAudit, salesWriteAuditPush } from '@/api/salesNew'
-import { salesDetailAllList } from '@/api/salesDetail'
+import { salesDetailAllList } from '@/api/salesDetailNew'
 export default {
   name: 'SalesDetail',
   mixins: [commonMixin],

+ 17 - 9
src/views/salesManagement/salesQueryNew/edit.vue

@@ -31,7 +31,12 @@
       <!-- 正常产品 -->
       <a-card size="small" :bordered="false" class="salesEdit-cont" v-if="salesBillSn">
         <div style="padding: 10px;">
-          <productNormalList ref="productNormalList" @openCpModal="openProductModal" :detailData="detailData" :warehouseSn="warehouseSn" :salesBillSn="salesBillSn"></productNormalList>
+          <productNormalList 
+          ref="productNormalList" 
+          @openCpModal="openProductModal" 
+          :detailData="detailData" 
+          :warehouseSn="warehouseSn" 
+          :salesBillSn="salesBillSn"></productNormalList>
         </div>
       </a-card>
       <!-- 活动产品 -->
@@ -118,8 +123,6 @@
     <chooseProduct
         ref="chooseProduct"
         :openModal="showCpModal"
-        :type="cpModalType"
-        :buyerSn="detailData&&detailData.buyerSn||''"
         @close="closeProductModal"
         @addProduct="insterProduct"></chooseProduct>
     <!-- 价格更新弹窗 -->
@@ -159,7 +162,6 @@ export default {
       priceUpdateModal: false, // 价格更新弹窗
       showDetail: false,
       showCpModal: false,
-      cpModalType: '0',
       cpCurRefId: '',
       disabledActiveOption: null
     }
@@ -210,14 +212,14 @@ export default {
     },
     // 添加产品,包括正常和活动的产品
     closeProductModal(){
-        this.cpModalType = 0
         this.cpCurRefId = ''
         this.showCpModal = false
     },
     openProductModal(type, refId){
         console.log(type, refId)
-        this.cpModalType = type
-        this.cpCurRefId = refId
+        const promo = this.activeList.find(item => item.promoRuleSn == refId)
+        this.$refs.chooseProduct.pageInit(this.detailData, promo, type)
+        this.cpCurRefId = 'productList-' + refId
         this.showCpModal = true
     },
     // 新增产品
@@ -296,6 +298,10 @@ export default {
     // 禁用活动
     disabledActive(e,item){
       const _this = this
+      if(item.disabled){
+        this.$message.info("规则已经禁用!")
+        return
+      }
       this.$confirm({
         title: '确定禁用规则?',
         centered: true,
@@ -317,12 +323,14 @@ export default {
           if(_this.disabledActiveOption){
             salesDisablePromo({
               salesBillSn: _this.salesBillSn,
-              salesPromoSn: item.promo.salesPromoSn,
+              salesPromoSn: item.salesPromoSn,
+              promoRuleSn: item.promoRuleSn,
               salesDisableType: _this.disabledActiveOption
             }).then(res => {
               if(res.status == 200){
-                _this.$refs[item.promoRuleSn][0].resetSearchForm()
+                _this.$refs['productList-'+item.promoRuleSn][0].disableActive()
                 _this.disabledActiveOption = null
+                item.disabled = true
               }
             })
           }else{

+ 1 - 1
vue.config.js

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