lilei 1 rok temu
rodzic
commit
516abfe805

+ 2 - 2
src/api/sales.js

@@ -242,7 +242,7 @@ export const updateWarehouse = (params) => {
 
 //  按仓库查询销售单 列表  有分页
 export const queryPageForWarehouse = (params) => {
-  const url = `/sales/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
+  const url = `/salesn/queryPageForWarehouse/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -254,7 +254,7 @@ export const queryPageForWarehouse = (params) => {
 // 获取按仓库查询销售单数量
 export const queryCountForWarehouse = (params) => {
   return axios({
-    url: '/sales/queryCountForWarehouse',
+    url: '/salesn/queryCountForWarehouse',
     method: 'post',
     data: params
   })

+ 8 - 1
src/api/salesDetailNew.js

@@ -8,7 +8,14 @@ export const salesDetailDel = (params) => {
     method: 'post'
   })
 }
-
+// 销售详情 统计 正常产品
+export const salesDetaiCount = (params) => {
+  return axios({
+    url: `/salesn/detail/queryCount`,
+    data: params,
+    method: 'post'
+  })
+}
 // 批量删除
 export const salesDetailBatchDel = (params) => {
   return axios({

+ 8 - 0
src/api/salesNew.js

@@ -72,6 +72,14 @@ export const salesPromoQueryList = (params) => {
         method: 'post'
     })
 }
+// 判断是否有新的活动
+export const salesQueryUnPartPromo = (params) => {
+  return axios({
+      url: `/salesPromo/queryUnPartPromo/${params.salesBillSn}`,
+      data: params,
+      method: 'post'
+  })
+}
 // 更换促销活动
 export const queryMatchPromoProduct = (params) => {
   return axios({

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

@@ -96,8 +96,9 @@
           class="button-info"
           :loading="newLoading"
           @click="handleAdd(record)"
-          :disabled="!record.productPrice || record.productPrice<=0"
+          v-if="record.productPrice"
           id="productInfoList-edit-btn">添加</a-button>
+        <span v-else>--</span>
       </template>
     </s-table>
   </div>

+ 18 - 2
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -253,7 +253,7 @@
   import chooseWarehouse from '@/views/common/chooseWarehouse'
   import ProductBrand from '@/views/common/productBrand.js'
   import productTypeAll from '@/views/common/productTypeAll.js'
-  import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, deleteAll, updateWarehouse, salesBatchInsert } from '@/api/salesDetailNew'
+  import { salesDetailList, salesDetailPromoCount, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, deleteAll, updateWarehouse, salesBatchInsert } from '@/api/salesDetailNew'
   export default {
     name: 'ProductList',
     mixins: [commonMixin],
@@ -301,6 +301,7 @@
         loadData: parameter => {
           this.disabled = true
           this.queryParam.salesBillSn = this.salesBillSn || ''
+          // this.getCount()
           return salesDetailList(Object.assign(parameter, this.queryParam, {
             showStock: true, 
             promoRuleSn: this.promo.promoRuleSn,
@@ -343,7 +344,8 @@
         openUpActiveModal: false,
         descDetail: null,
         promoProductClz: null, // 活动产品分类
-        disablePromo: false
+        disablePromo: false,
+        countData: null
       }
     },
     computed: {
@@ -409,6 +411,19 @@
         this.resetSearchForm()
         this.disablePromo = true
       },
+      // 统计
+      getCount(){
+        salesDetailPromoCount(Object.assign(this.queryParam, {
+            showStock: true, 
+            promoRuleSn: this.promo.promoRuleSn,
+            promoSn: this.promo.promoSn,
+            salesPromoSn: this.promo.salesPromoSn
+          })).then(res => {
+          if(res.status == 200){
+            this.countData = res.data
+          }
+        })
+      },
       //  重置
       resetSearchForm (flag) {
         this.queryParam.productCode = ''
@@ -419,6 +434,7 @@
         this.queryParam.productTypeSn2 = ''
         this.queryParam.productTypeSn3 = ''
         this.productType = []
+        this.$refs.table.clearSelected()
         this.$refs.table.refresh(!!flag)
       },
       // 删除全部产品

+ 23 - 4
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -156,9 +156,9 @@
         <!-- 总计 -->
         <a-alert type="info" banner :showIcon="false">
           <div slot="message">
-              <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>;
+              <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总售价:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '--' }}</strong>;</span>
+              总款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : '--' }}</strong>;
+              总数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : '--' }}</strong>;
           </div>
         </a-alert>
       </template>
@@ -179,7 +179,16 @@
   import chooseWarehouse from '@/views/common/chooseWarehouse'
   import ProductBrand from '@/views/common/productBrand.js'
   import productTypeAll from '@/views/common/productTypeAll.js'
-  import { salesDetailList, salesDetailInsert, salesDetailUpdateQty, salesDetailDel, salesDetailBatchDel, deleteAll, updateWarehouse, addPromoGoods, salesBatchInsert } from '@/api/salesDetailNew'
+  import { 
+    salesDetailList, 
+    salesDetailInsert, 
+    salesDetailUpdateQty, 
+    salesDetailDel, 
+    salesDetailBatchDel, 
+    deleteAll, 
+    updateWarehouse, 
+    salesDetaiCount, 
+    salesBatchInsert } from '@/api/salesDetailNew'
   export default {
     name: 'ProductList',
     mixins: [commonMixin],
@@ -218,6 +227,7 @@
         loadData: parameter => {
           this.disabled = true
           this.queryParam.salesBillSn = this.salesBillSn || ''
+          // this.getCount()
           return salesDetailList(Object.assign(parameter, this.queryParam, {showStock: true})).then(res => {
             let data
             if (res.status == 200) {
@@ -251,6 +261,7 @@
         productType: [],
         rowSelectionInfo: null,
         warehouseDataList: [],
+        countData: null,
         isInster: false
       }
     },
@@ -294,6 +305,14 @@
       openCpModal(){
         this.$emit('openCpModal', 0, 'productNormalList')
       },
+      // 统计
+      getCount(){
+        salesDetaiCount(Object.assign(this.queryParam, {showStock: true})).then(res => {
+          if(res.status == 200){
+            this.countData = res.data
+          }
+        })
+      },
       handleBatchDelAll () {
         const _this = this
         if (_this.dataSource.length == 0) {

+ 36 - 11
src/views/salesManagement/salesQueryNew/edit.vue

@@ -138,7 +138,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, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList } from '@/api/salesNew'
+import { salesDetailBySn, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo } from '@/api/salesNew'
 export default {
   name: 'SalesNewEdit',
   mixins: [commonMixin],
@@ -186,7 +186,6 @@ export default {
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
     },
     tooglePanel(item){
-      console.log(1)
       item.isActive=!item.isActive
       this.activeList.splice()
     },
@@ -200,16 +199,42 @@ export default {
       })
     },
     // 获取销售单参与的活动列表
-    getActiveList(){
-      salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => {
-        if(res.status == 200){
-          this.activeList = res.data || []
-          this.activeList.map(item => {
-            item.isActive = true
-            this.activeDesKey['search-'+item.promoRuleSn] = false
-          })
-        }
+    async getActiveList(){
+      const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn }).then(res => res.data)
+      console.log(hasNewActive)
+      // 有新活动
+      if(hasNewActive.length){
+        this.showNewActiveModal(hasNewActive)
+      }
+      this.activeList = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
+      this.activeList.map(item => {
+        item.isActive = true
+        this.activeDesKey['search-'+item.promoRuleSn] = false
+      })
+    },
+    // 新活动确认弹框
+    showNewActiveModal(data){
+      let arr = []
+      data.map(item => {
+        arr.push(item.title)
       })
+      this.$confirm({
+        title: '新活动提醒',
+        centered: true,
+        class:'confirm-center',
+        content: <div>
+          <div style="padding:10px 0;text-align:center;">
+            系统发布新的促销活动:{arr.toString()}
+          </div>
+          <div style="padding:0 0 10px 0;text-align:center;">
+            需要将现有产品识别到新的活动中吗?
+          </div>
+        </div>,
+        onOk() {
+           
+        },
+        onCancel() {},
+      });
     },
     // 添加产品,包括正常和活动的产品
     closeProductModal(){

+ 4 - 2
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -2,7 +2,7 @@
   <div class="productInfoList-wrap">
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" @keyup.enter.native="searchTable">
         <a-row :gutter="15">
           <a-col :md="4" :sm="24">
             <a-form-item label="产品名称">
@@ -341,6 +341,7 @@ export default {
       })
     },
     async searchTable(){
+        this.dataSource = []
         this.disabled = true
         this.spinning = true
         this.queryParam.salesBillSn = this.salesBillSn
@@ -406,7 +407,8 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.queryParam.warehouseSn = undefined
       this.productType = []
-      this.$refs.table.refresh(true)
+      this.dataSource = []
+      this.searchTable()
     },
     pageInit (salesBillSn, detailData) {
       this.salesBillSn = salesBillSn

+ 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,