lilei 1 年之前
父節點
當前提交
da9ea3a64e

+ 14 - 25
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -94,38 +94,27 @@
             return data || data == 0 ? data : '--'
           }
           const codeFormat = function(record,data,h){
-            if(record.promotionFlag=='GIFT'){
-                return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="促" number-style={{ backgroundColor: '#52c41a', zoom:'80%' }}></a-badge>
-                    </div>
-                )
+            let ftext = ''
+            let fcolor = ''
+            if(record.promotionFlag == 'GIFT'){
+              ftext = '促'
+              fcolor = '#52c41a'
             }
-            if(record.promotionFlag=='REGULAR'){
-                return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="正" number-style={{ backgroundColor: '#108ee9', zoom:'80%' }}></a-badge>
-                    </div>
-                )
+            if(record.promotionFlag == 'REGULAR'){
+              ftext = '正'
+              fcolor = '#108ee9'
             }
-            if(record.promotionFlag=='DISCOUNT'){
-                return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="特" number-style={{ backgroundColor: '#faad14', zoom:'80%' }}></a-badge>
-                    </div>
-                )
+            if(record.promotionFlag == 'DISCOUNT'){
+              ftext = '特'
+              fcolor = '#faad14'
             }
-            if(Number(record.stockQty||0) < Number(record.unpushedQty||0)){
-                return (
+            return (
                     <div>
                         <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>
+                        {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
+                        {Number(record.stockQty||0) < Number(record.unpushedQty||0)?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
                     </div>
                 )
-            }
           }
 
           let arr= [

+ 2 - 1
src/views/salesManagement/waitDispatch/edit.vue

@@ -199,7 +199,8 @@ export default {
         updateQty({
           dispatchBillDetailSn: record.dispatchBillDetailSn,
           qty: record.qty,
-          salesBillSn: _this.salesBillSn
+          salesBillSn: _this.salesBillSn,
+          dispatchBillSn: _this.productForm.dispatchBillSn
         }).then(res => {
           if (res.status == 200) {
             _this.$refs.partQuery.resetCurForm()

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

@@ -195,7 +195,8 @@ export default {
         updateQty({
           dispatchBillDetailSn: record.dispatchBillDetailSn,
           qty: record.qty,
-          salesBillSn: _this.salesBillSn
+          salesBillSn: _this.salesBillSn,
+          dispatchBillSn: _this.productForm.dispatchBillSn
         }).then(res => {
           if (res.status == 200) {
             _this.$refs.partQuery.resetCurForm()
@@ -268,7 +269,7 @@ export default {
           _this.resetSearchForm()
           _this.$refs.partQuery.resetCurForm()
           if (type == 1) { //  批量操作
-            _this.$refs.table.clearSelected() // 清空表格选中项
+            // 清空表格选中项
           } else if (type == 0) { //  单条
             const ind = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.findIndex(item => item == row.id)
             _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.splice(ind, 1)

+ 43 - 34
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -110,7 +110,10 @@ export default {
   mixins: [commonMixin],
   components: { STable, VSelect, chooseWarehouse },
   props: {
-    newLoading: Boolean,
+    newLoading: {
+        type: Boolean,
+        default: false
+    },
     maxHeight:{
           type: [String,Number],
           default: '300'
@@ -164,38 +167,27 @@ export default {
             return data || data == 0 ? data : '--'
           }
           const codeFormat = function(record,data,h){
-            if(record.promotionFlag=='GIFT'){
-                return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="促" number-style={{ backgroundColor: '#52c41a', zoom:'80%' }}></a-badge>
-                    </div>
-                )
+            let ftext = ''
+            let fcolor = ''
+            if(record.promotionFlag == 'GIFT'){
+              ftext = '促'
+              fcolor = '#52c41a'
             }
-            if(record.promotionFlag=='REGULAR'){
-                return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="正" number-style={{ backgroundColor: '#108ee9', zoom:'80%' }}></a-badge>
-                    </div>
-                )
+            if(record.promotionFlag == 'REGULAR'){
+              ftext = '正'
+              fcolor = '#108ee9'
             }
-            if(record.promotionFlag=='DISCOUNT'){
-                return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="特" number-style={{ backgroundColor: '#faad14', zoom:'80%' }}></a-badge>
-                    </div>
-                )
+            if(record.promotionFlag == 'DISCOUNT'){
+              ftext = '特'
+              fcolor = '#faad14'
             }
-            if(Number(record.stockQty||0) < Number(record.unpushedQty||0)){
-                return (
+            return (
                     <div>
                         <span style="padding-right: 15px;">{data}</span>
-                        <a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>
+                        {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
+                        {Number(record.stockQty||0) < Number(record.unpushedQty||0)?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
                     </div>
                 )
-            }
           }
       // 输入框
       const inputFormat = function(record,data,h) {
@@ -205,8 +197,8 @@ export default {
               <a-input-number
                 size="small"
                 vModel={record.cancelNums}
-                precision="0"
-                min="0"
+                precision={0}
+                min={0}
                 max={record.surplusQty}
                 style="width: 100%;"
                 placeholder="请输入" />
@@ -224,7 +216,6 @@ export default {
                 size="small"
                 type="link"
                 class="button-info"
-                loading={newLoading}
                 onClick="handleAdd(record)"
                 >添加</a-button>
             </div>
@@ -290,12 +281,32 @@ export default {
           params.promoRuleSn = promo.promoRuleSn
           params.promoSn = promo.promoSn
           params.salesPromoSn = promo.salesPromoSn
-          list1[i] = await salesDetailAllList(params).then(res => res.data)
+          // 获取活动产品列表
+          const aclist = await salesDetailAllList(params).then(res => res.data)
+          // 获取活动产品统计
+          //const acTotal = await salesDetailCount(params).then(res => res.data)
+          list1[i] = [{
+            promo: promo,
+            // total: acTotal
+          },...aclist]
         }
 
         console.log(list0)
         console.log(list1)
         this.dataSource = list0
+
+        // 格式化数据
+        this.dataSource.map(item => {
+          data[i].no = no + i + 1
+          const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
+          const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
+          const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
+          const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
+          item.productCode = productCode || '--'
+          item.productName = productName || '--'
+          item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+          item.productOrigUnit = productOrigUnit || '--'
+        })
     },
     //  重置
     resetSearchForm () {
@@ -318,13 +329,11 @@ export default {
       this.getActiveList()
     },
     clearTable () {
-      this.rowSelectionInfo = null
-      this.$refs.table.clearSelected()
+       
     },
     // 刷新当前页面
     resetCurForm () {
-      this.$refs.table.clearSelected() // 清空表格选中项
-      this.$refs.table.refresh()
+       
     },
     // 添加
     handleAdd (row) {