lilei 1 rok temu
rodzic
commit
e2e7022839

+ 18 - 1
src/api/salesDetailNew.js

@@ -123,6 +123,14 @@ export const salesDisablePromo = params => {
       method: 'post'
     })
   }
+// 启用活动
+export const salesEnablePromoPromo = params => {
+  return axios({
+    url: '/salesn/detail/enablePromo',
+    data: params,
+    method: 'post'
+  })
+}
  // 更换活动
  export const salesChangePromo = params => {
   return axios({
@@ -147,7 +155,14 @@ export const salesDetailUpdateCancelQty = (params) => {
     method: 'post'
   })
 }
-
+// 整单取消待下推
+export const salesDetailCancleOfAll = (params) => {
+  return axios({
+    url: '/salesn/detail/cancleOfAll',
+    data: params,
+    method: 'post'
+  })
+}
 // 批量新增代发货信息
 export const insertBatchOfWaitDispatch = (params) => {
     return axios({
@@ -157,6 +172,8 @@ export const insertBatchOfWaitDispatch = (params) => {
     })
   }
 
+
+
 // 缺货明细
 export const salesStockoutDetail = (params) => {
   const url = `/sales/detail/queryPageStock`

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

@@ -318,7 +318,7 @@
             }
             // 如果活动没有任何产品,不显示统计一行
             if(active.length){
-              const hasAcp = listData.filter(item => item.id.indexOf("promo-")>=0)
+              const hasAcp = listData.filter(item => item.id=='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
               if(hasAcp && hasAcp.length==1){
                 listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
               }

+ 18 - 2
src/views/salesManagement/salesQueryNew/edit.vue

@@ -160,7 +160,7 @@ import productNormalList from './comps/productNormalList.vue'
 import chooseProduct from './comps/chooseProduct.vue'
 import setPriceModal from './setPriceModal.vue'
 import newPromoModal from './newPromoModal.vue'
-import { salesDisablePromo, salesChangePromo } from '@/api/salesDetailNew'
+import { salesDisablePromo,salesEnablePromoPromo, salesChangePromo } from '@/api/salesDetailNew'
 import { salesDetailBySn,salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo,salesPromoValidaSubmit } from '@/api/salesNew'
 export default {
   name: 'SalesNewEdit',
@@ -437,11 +437,27 @@ export default {
       item.showDesc = v
       this.activeList.splice()
     },
+    // 启用规则
+    enabledActive(e,item){
+      const _this = this
+      salesEnablePromoPromo({
+        salesBillSn: _this.salesBillSn,
+        salesPromoSn: item.salesPromoSn
+      }).then(res => {
+        if(res.status == 200){
+          _this.$refs['productList-'+item.promoRuleSn][0].disableActive(false)
+          item.disabled = false
+          _this.activeList.splice()
+          _this.$message.success("操作成功,请添加产品")
+        }
+      })
+    },
     // 禁用活动
     disabledActive(e,item){
       const _this = this
       if(item.disabled){
-        this.$message.info("规则已经禁用!")
+        // 是否启用规则
+        this.enabledActive(e,item)
         return
       }
       this.$confirm({

+ 35 - 14
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -60,7 +60,8 @@
     <div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
       <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-error" @click="handlePlCancel">批量取消</a-button>
+        <a-button type="danger" v-if="hasPrompActive" :disabled="newLoading" class="button-error" @click="handleAllCancel">整单取消</a-button>
+        <a-button type="danger" v-else :disabled="newLoading" class="button-error" @click="handlePlCancel">批量取消</a-button>
         <span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
       </div>
       <div style="padding-left: 20px;">
@@ -176,10 +177,13 @@ export default {
       showTableHead: true,
       disableSelectedRowKeys: [],
       selectedRowKeys: [],
-      colspanNums: 16
+      colspanNums: 16,
     }
   },
   computed: {
+    hasPrompActive(){
+      return this.activeList.length > 0
+    },
     checkboxOption () {
       return {
           disableSelectedRowKeys: this.disableSelectedRowKeys,
@@ -196,8 +200,15 @@ export default {
     },
     columns () {
       const _this = this
-          const priceFormat = function(data){
-            return _this.toThousands(data) || '--'
+          const priceFormat = function(record,data,h){
+            return (
+              <div>
+                {_this.toThousands(data)}
+                {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
+                  <span title="原价">({ _this.toThousands(record.origPrice)})</span>
+                ):''}
+              </div>
+            )
           }
           const numsFormat = function(data){
             return data || data == 0 ? data : '--'
@@ -209,10 +220,6 @@ export default {
               ftext = '促'
               fcolor = '#52c41a'
             }
-            // if(record.promotionFlag == 'REGULAR'){
-            //   ftext = '正'
-            //   fcolor = '#108ee9'
-            // }
             if(record.promotionFlag == 'DISCOUNT'){
               ftext = '特'
               fcolor = '#faad14'
@@ -301,11 +308,11 @@ export default {
       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])} })
+        arr.push({ title: '销售价', field: 'price', width: 80,key: "f", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row,row[column.field],h)} })
       }
       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])} })
+        arr.push({ title: '成本价', field: 'showCost', width: 80,key: "g", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return _this.toThousands(row[column.field])||'--'} })
       }    
       this.colspanNums = this.colspanNums + 8
       arr = arr.concat([
@@ -389,11 +396,11 @@ export default {
         const proList = await salesDetailAllList(params).then(res => res.data)
         const norTotal = await salesDetaiCount(params).then(res => res.data)
         //没有活动时不显示统计
-        let listData = active.length ? [{
+        let listData = active.length ? (proList.length ? [{
             id: 'promo-normal',
             total: norTotal
-          },...proList] : proList
-        
+          },...proList] : []) : proList
+         
         // 循环获取活动产品
         for(let i=0;i<active.length;i++){
           const promo = active[i]
@@ -419,9 +426,10 @@ export default {
           },...aclist]
           listData = aclist&&aclist.length ? listData.concat(retList) : listData
         }
+  
         // 如果活动没有任何产品
         if(active.length){
-          const hasAcp = listData.filter(item => item.id.indexOf("promo-")>=0)
+          const hasAcp = listData.filter(item => item.id=='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
           if(hasAcp && hasAcp.length==1){
             listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
           }
@@ -516,6 +524,19 @@ export default {
         }
       })
     },
+    // 整单取消
+    handleAllCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定整单取消订单?',
+        centered: true,
+        closable: true,
+        onOk () {
+           
+        }
+      })
+    },
     // 批量取消
     handlePlCancel () {
       const _this = this

+ 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.111/ocs-admin',
+        target: 'http://192.168.2.113:8660/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {