Browse Source

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

chenrui 1 year ago
parent
commit
1d04b47cc7

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
 {
-    "version": "2.2.61",
+    "version": "2.2.62",
     "message": "发现有新版本发布,确定更新系统?"
     "message": "发现有新版本发布,确定更新系统?"
 }
 }

+ 18 - 1
src/api/salesDetailNew.js

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

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

@@ -41,9 +41,7 @@
         bordered>
         bordered>
         <template slot="salesBillNo" slot-scope="text, record">
         <template slot="salesBillNo" slot-scope="text, record">
           <span style="padding-right: 15px;">{{ 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="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
         </template>
         </template>
         <!-- 操作 -->
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
         <template slot="action" slot-scope="text, record">

+ 6 - 1
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -96,6 +96,11 @@
             <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></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=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
             <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
           </template>
           </template>
+           <!-- 销售价 -->
+          <template slot="price" slot-scope="text, record">
+            {{ toThousands(text) }}
+            <span v-if="record.promotionFlag=='GIFT'" title="原价">({{ toThousands(record.origPrice) }})</span>
+          </template>
         </s-table>
         </s-table>
       </a-card>
       </a-card>
     </a-spin>
     </a-spin>
@@ -199,7 +204,7 @@ export default {
         // { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       ]
       if (this.$hasPermissions('B_dispatchDetail_salesPrice')) { //  售价权限
       if (this.$hasPermissions('B_dispatchDetail_salesPrice')) { //  售价权限
-        arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' }, })
         arr.splice(9, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(9, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       }
       if (this.$hasPermissions('B_dispatchDetail_cityPrice')) { //  市级权限
       if (this.$hasPermissions('B_dispatchDetail_cityPrice')) { //  市级权限

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

@@ -87,8 +87,7 @@
         <!-- 单号 -->
         <!-- 单号 -->
         <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
         <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
           <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
           <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=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
+          <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
         </template>
         </template>
       </s-table>
       </s-table>
     </a-spin>
     </a-spin>

+ 11 - 6
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -304,10 +304,13 @@
               const aclist = await salesDetailAllList(activeParams).then(res => res.data)
               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)
-              // 采购额结余
-              acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount) - Number(acTotal.totalUsePromoGiftsAmount)
-              // 采购额超出
-              acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount) - Number(acTotal.totalPromoGiftsAmount)
+              if(acTotal){
+                // 采购额结余
+                acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
+                // 采购额超出
+                acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
+              }
+              
               const retList = aclist.length ? [{
               const retList = aclist.length ? [{
                 id: 'promo-'+i,
                 id: 'promo-'+i,
                 promo: promo,
                 promo: promo,
@@ -316,13 +319,15 @@
               // 将活动产品数据拼接
               // 将活动产品数据拼接
               listData = aclist&&aclist.length ? listData.concat(retList) : listData
               listData = aclist&&aclist.length ? listData.concat(retList) : listData
             }
             }
+            console.log(listData)
             // 如果活动没有任何产品,不显示统计一行
             // 如果活动没有任何产品,不显示统计一行
             if(active.length){
             if(active.length){
-              const hasAcp = listData.filter(item => item.id.indexOf("promo-")>=0)
-              if(hasAcp && hasAcp.length==1){
+              const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
+              if(hasAcp && hasAcp.length==0){
                 listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
                 listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
               }
               }
             }
             }
+
             console.log(listData)
             console.log(listData)
             this.dataSource = listData
             this.dataSource = listData
 
 

+ 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 chooseProduct from './comps/chooseProduct.vue'
 import setPriceModal from './setPriceModal.vue'
 import setPriceModal from './setPriceModal.vue'
 import newPromoModal from './newPromoModal.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'
 import { salesDetailBySn,salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo,salesPromoValidaSubmit } from '@/api/salesNew'
 export default {
 export default {
   name: 'SalesNewEdit',
   name: 'SalesNewEdit',
@@ -437,11 +437,27 @@ export default {
       item.showDesc = v
       item.showDesc = v
       this.activeList.splice()
       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){
     disabledActive(e,item){
       const _this = this
       const _this = this
       if(item.disabled){
       if(item.disabled){
-        this.$message.info("规则已经禁用!")
+        // 是否启用规则
+        this.enabledActive(e,item)
         return
         return
       }
       }
       this.$confirm({
       this.$confirm({

+ 11 - 1
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -14,6 +14,7 @@
           ref="partQuery"
           ref="partQuery"
           :newLoading="isInster"
           :newLoading="isInster"
           @cancelProduct="cancelProduct"
           @cancelProduct="cancelProduct"
+          @cancelAll = "cancelAll"
           @addProduct="insterProduct"></queryPart>
           @addProduct="insterProduct"></queryPart>
       </a-card>
       </a-card>
       <a-card size="small" :bordered="false" class="waitDispatch-cont">
       <a-card size="small" :bordered="false" class="waitDispatch-cont">
@@ -55,7 +56,7 @@ import queryPart from './queryPart.vue'
 import detailProductList from './detailProductList.vue'
 import detailProductList from './detailProductList.vue'
 import dsModal from './dsModal.vue'
 import dsModal from './dsModal.vue'
 import { salesDetailBySn } from '@/api/salesNew'
 import { salesDetailBySn } from '@/api/salesNew'
-import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetailNew'
+import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty, salesDetailCancleOfAll } from '@/api/salesDetailNew'
 import { pushDown } from '@/api/waitDispatchDetail'
 import { pushDown } from '@/api/waitDispatchDetail'
 import { findBySalesBillSn } from '@/api/dispatch'
 import { findBySalesBillSn } from '@/api/dispatch'
 
 
@@ -129,6 +130,15 @@ export default {
         this.isInster = false
         this.isInster = false
       })
       })
     },
     },
+    // 整单取消
+    cancelAll(){
+      salesDetailCancleOfAll({salesBillSn: this.salesBillSn}).then(res=>{
+        if(res.status == 200){
+          this.handleBack()
+          this.$message.success(res.message)
+        }
+      })
+    },
     // 批量取消产品
     // 批量取消产品
     cancelProduct (list) {
     cancelProduct (list) {
       // 防止多次添加产品
       // 防止多次添加产品

+ 42 - 19
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="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
       <div style="display: flex;align-items: center;">
       <div style="display: flex;align-items: center;">
         <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
         <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>
         <span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
       </div>
       </div>
       <div style="padding-left: 20px;">
       <div style="padding-left: 20px;">
@@ -176,10 +177,13 @@ export default {
       showTableHead: true,
       showTableHead: true,
       disableSelectedRowKeys: [],
       disableSelectedRowKeys: [],
       selectedRowKeys: [],
       selectedRowKeys: [],
-      colspanNums: 16
+      colspanNums: 16,
     }
     }
   },
   },
   computed: {
   computed: {
+    hasPrompActive(){
+      return this.detailData&&this.detailData.promoFlag==1
+    },
     checkboxOption () {
     checkboxOption () {
       return {
       return {
           disableSelectedRowKeys: this.disableSelectedRowKeys,
           disableSelectedRowKeys: this.disableSelectedRowKeys,
@@ -196,8 +200,15 @@ export default {
     },
     },
     columns () {
     columns () {
       const _this = this
       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){
           const numsFormat = function(data){
             return data || data == 0 ? data : '--'
             return data || data == 0 ? data : '--'
@@ -209,10 +220,6 @@ export default {
               ftext = '促'
               ftext = '促'
               fcolor = '#52c41a'
               fcolor = '#52c41a'
             }
             }
-            // if(record.promotionFlag == 'REGULAR'){
-            //   ftext = '正'
-            //   fcolor = '#108ee9'
-            // }
             if(record.promotionFlag == 'DISCOUNT'){
             if(record.promotionFlag == 'DISCOUNT'){
               ftext = '特'
               ftext = '特'
               fcolor = '#faad14'
               fcolor = '#faad14'
@@ -301,11 +308,11 @@ export default {
       this.colspanNums = 6
       this.colspanNums = 6
       if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
       if (this.$hasPermissions('B_salesDispatch_salesPrice')) { //  售价权限
         this.colspanNums = this.colspanNums + 1
         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')) {
       if (this.$hasPermissions('B_salesDispatch_costPrice')) {
         this.colspanNums = this.colspanNums + 1
         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
       this.colspanNums = this.colspanNums + 8
       arr = arr.concat([
       arr = arr.concat([
@@ -389,11 +396,11 @@ export default {
         const proList = await salesDetailAllList(params).then(res => res.data)
         const proList = await salesDetailAllList(params).then(res => res.data)
         const norTotal = await salesDetaiCount(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',
             id: 'promo-normal',
             total: norTotal
             total: norTotal
-          },...proList] : proList
-        
+          },...proList] : []) : proList
+         
         // 循环获取活动产品
         // 循环获取活动产品
         for(let i=0;i<active.length;i++){
         for(let i=0;i<active.length;i++){
           const promo = active[i]
           const promo = active[i]
@@ -408,10 +415,12 @@ export default {
           const aclist = await salesDetailAllList(activeParams).then(res => res.data)
           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)
-          // 采购额结余
-          acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount) - Number(acTotal.totalUsePromoGiftsAmount)
-          // 采购额超出
-          acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount) - Number(acTotal.totalPromoGiftsAmount)
+          if(acTotal){
+            // 采购额结余
+            acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
+            // 采购额超出
+            acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
+          }
           const retList = [{
           const retList = [{
             id: 'promo-'+i,
             id: 'promo-'+i,
             promo: promo,
             promo: promo,
@@ -419,10 +428,11 @@ export default {
           },...aclist]
           },...aclist]
           listData = aclist&&aclist.length ? listData.concat(retList) : listData
           listData = aclist&&aclist.length ? listData.concat(retList) : listData
         }
         }
+  
         // 如果活动没有任何产品
         // 如果活动没有任何产品
         if(active.length){
         if(active.length){
-          const hasAcp = listData.filter(item => item.id.indexOf("promo-")>=0)
-          if(hasAcp && hasAcp.length==1){
+          const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
+          if(hasAcp && hasAcp.length==0){
             listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
             listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
           }
           }
         }
         }
@@ -516,6 +526,19 @@ export default {
         }
         }
       })
       })
     },
     },
+    // 整单取消
+    handleAllCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定整单取消订单?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.$emit('cancelAll')
+        }
+      })
+    },
     // 批量取消
     // 批量取消
     handlePlCancel () {
     handlePlCancel () {
       const _this = this
       const _this = this

+ 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
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/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://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         ws: false,