lilei před 1 rokem
rodič
revize
1377935b0f

+ 11 - 3
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -221,9 +221,17 @@
               <div>
                 {{ countData&&countData.remarks }}
               </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 style="display: flex;">
+                <div>
+                  款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? toThousands(countData.totalCategory) : '--' }}</strong>
+                </div>
+                <div>
+                  数量:<strong>-{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : '--' }}</strong>
+                </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>
               </div>
             </div>
           </a-alert>

+ 5 - 6
src/views/salesManagement/salesQueryNew/edit.vue

@@ -73,13 +73,12 @@
     <div class="affix-cont">
       <div class="footer-price">
         <div></div>
-        <div>
-          <div class="totalPrice">合计:¥<span>121.60</span></div>
+        <div v-if="detailData">
+          <div class="totalPrice">总售价:¥<span>{{ toThousands(detailData.totalAmount) }}</span></div>
           <div>
-            产品总款数:<strong>12</strong>;
-            总数量:<strong>111</strong>;
-            总售价:<strong>17898.88</strong>;
-            <span style="margin-right:10px;">优惠金额:<strong>121.60</strong></span>
+            产品总款数:<strong>{{ detailData.totalCategory }}</strong>;
+            总数量:<strong>{{ detailData.totalQty }}</strong>;
+            <span style="margin-right:10px;">优惠金额:<strong>{{ toThousands(detailData.totalLossAmount) }}</strong></span>
             <a-popover title="优惠明细">
               <a-button shape="round" size="small">优惠明细</a-button>
               <div slot="content">

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

@@ -465,13 +465,7 @@ export default {
     },
     // 下推
     handleDispatch (row) {
-      this.spinning = true
-      findBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => {
-        this.spinning = false
-        if (res.status == 200) {
-          this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
-        }
-      })
+      this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
     },
     // 详情
     handleDetail (row) {

+ 2 - 19
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -13,7 +13,6 @@
         <queryPart
           ref="partQuery"
           :newLoading="isInster"
-          @oneDispatch="oneDispatch"
           @cancelProduct="cancelProduct"
           @addProduct="insterProduct"></queryPart>
       </a-card>
@@ -106,7 +105,7 @@ import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import dsModal from './dsModal.vue'
 import { salesDetailBySn } from '@/api/salesNew'
-import { salesDetailDispatchByOneKey, insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetailNew'
+import { insertBatchOfWaitDispatch, salesDetailUpdateCancelQty } from '@/api/salesDetailNew'
 import { deleteBatch, pushDown, waitDispatchDetailAllList, updateQty } from '@/api/waitDispatchDetail'
 import { findBySalesBillSn } from '@/api/dispatch'
 
@@ -326,21 +325,6 @@ export default {
         this.isInster = false
       })
     },
-    // 一键下推
-    oneDispatch () {
-      this.isInster = true
-      this.spinning = true
-      salesDetailDispatchByOneKey({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm()
-          this.$refs.partQuery.resetCurForm()
-          this.spinning = false
-        } else {
-          this.spinning = false
-        }
-        this.isInster = false
-      })
-    },
     //  销售单详情
     getOrderDetail () {
       salesDetailBySn({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
@@ -381,8 +365,7 @@ export default {
     },
     pageInit () {
       this.rowSelectionInfo = null
-      // this.$refs.table.clearTable()
-      this.$refs.partQuery.clearTable()
+      this.$refs.partQuery.clearSelectTable()
       this.salesBillSn = this.$route.params.salesBillSn
       this.getOrderDetail()
       this.getTotalData()

+ 33 - 28
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -164,7 +164,15 @@ export default {
       cellSpanOption: {
           bodyCellSpan: this.bodyCellSpan,
       },
-      checkboxOption:{
+      showEmpty: false,
+      showTableHead: true,
+      disableSelectedRowKeys: [],
+      selectedRowKeys: []
+    }
+  },
+  computed: {
+    checkboxOption () {
+      return {
           disableSelectedRowKeys: this.disableSelectedRowKeys,
           selectedRowKeys: this.selectedRowKeys,
           // 行选择改变事件
@@ -175,14 +183,8 @@ export default {
           selectedAllChange: ({ isSelected, selectedRowKeys }) => {
             this.selectedAllChange({ isSelected, selectedRowKeys })
           },
-      },
-      showEmpty: false,
-      showTableHead: true,
-      disableSelectedRowKeys: [],
-      selectedRowKeys: []
-    }
-  },
-  computed: {
+      }
+    },
     columns () {
       const _this = this
           const priceFormat = function(data){
@@ -241,7 +243,7 @@ export default {
                 size="small"
                 type="link"
                 class="button-info"
-                onClick="handleAdd(record)"
+                onClick={_this.handleAdd(record)}
                 >添加</a-button>
             </div>
           )
@@ -257,7 +259,7 @@ 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="(event) => {showDesc(event, item)}">
+                    <span style="margin-left:10px;color:#00aaff;cursor: pointer;" onClick={this.showDesc(record)}>
                       <a-icon title="查看活动详情" type="eye"/> 活动详情
                     </span>
                   </div>
@@ -321,13 +323,13 @@ export default {
     },
     // 选择单元格
     selectedRowChange({ row, isSelected, selectedRowKeys }){
-      console.log(row, isSelected, selectedRowKeys);
+      // console.log(row, isSelected, selectedRowKeys);
       this.selectedRowKeys = selectedRowKeys;
     },
     // 全选行
     selectedAllChange({ isSelected, selectedRowKeys }){
-      console.log(isSelected, selectedRowKeys);
-      this.selectedRowKeys = this.dataSource.map((x) => x.rowKey);
+      // console.log(isSelected, selectedRowKeys);
+      this.selectedRowKeys = selectedRowKeys;
     },
     // 获取销售单参与的活动列表
     getActiveList(){
@@ -341,6 +343,8 @@ export default {
       })
     },
     async searchTable(){
+        this.selectedRowKeys = []
+        this.disableSelectedRowKeys = []
         this.dataSource = []
         this.disabled = true
         this.spinning = true
@@ -390,6 +394,9 @@ export default {
           item.productName = productName || '--'
           item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
           item.productOrigUnit = productOrigUnit || '--'
+          if(item.stockQty<0 || !item.stockQty){
+            this.disableSelectedRowKeys.push(item.id)
+          }
         })
         this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
         this.spinning = false
@@ -416,12 +423,9 @@ export default {
       // 获取活动列表
       this.getActiveList()
     },
-    clearTable () {
-       
-    },
-    // 刷新当前页面
-    resetCurForm () {
-       
+    // 清空选项
+    clearSelectTable () {
+       this.selectedRowKeys = []
     },
     // 添加
     handleAdd (row) {
@@ -434,20 +438,19 @@ export default {
     // 批量添加
     handlePlAdd () {
       const _this = this
-      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+      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 = []
-      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+      chooseRow && chooseRow.map(item => {
         if (item.stockQty > 0) {
           obj.push(item.salesBillDetailSn)
         }
       })
-      if (obj.length < 1) {
-        this.$message.warning('所选产品库存为0,不可添加!')
-        return
-      }
+       
       this.$confirm({
         title: '提示',
         content: '确认要批量添加到待下推列表吗?',
@@ -461,12 +464,14 @@ export default {
     // 批量取消
     handlePlCancel () {
       const _this = this
-      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+      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 = []
-      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+      chooseRow && chooseRow.map(item => {
         obj.push({
           'cancelQty': item.cancelNums,
           'salesBillDetailSn': item.salesBillDetailSn,

+ 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.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', //  预发布
         ws: false,