Browse Source

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

chenrui 1 year ago
parent
commit
0c0df013ce

+ 5 - 2
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -188,7 +188,7 @@
                 { title: '原厂编码', field: 'productOrigCode',key: "d", width: 150, align: 'left',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
                 { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
             ]
-            this.colspanNums = 5
+            this.colspanNums = this.showConvertPromoGifts ? 6 : 5
             if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
               this.colspanNums = this.colspanNums + 1
               arr.push({ title: '成本价', field: 'showCost', width: 80,key: "f", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
@@ -228,7 +228,7 @@
                 { title: '已下推数', field: 'pushedQty', width: 80,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
             ])
             
-            if(this.hasConvertPromoGifts){
+            if(this.showConvertPromoGifts){
               arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 100,key: "z", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
             }
             arr.push({ title: '已取消数', field: 'cancelQty', width: 80,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
@@ -237,6 +237,9 @@
         hasConvertPromoGifts(){
           return this.detailData && this.detailData.totalConvertPromoGiftsQty
         },
+        showConvertPromoGifts(){
+          return this.activeList&&this.activeList.find(item => item.promotionRule&&item.promotionRule.convertExpenseFlag==1&&item.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD')
+        },
         showStock(){
             return this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')
         }

+ 7 - 3
src/views/salesManagement/salesQueryNew/detail.vue

@@ -116,6 +116,9 @@
                         <a-select-option value="GIFT">
                           促销产品
                         </a-select-option>
+                        <a-select-option value="GIFT1" v-if="showConvertPromoGifts">
+                          促销产品(转采购额)
+                        </a-select-option>
                         <a-select-option value="GATE">
                           门槛产品
                         </a-select-option>
@@ -292,6 +295,9 @@ export default {
     hasPrompActive(){
       return this.detailData&&this.detailData.promoFlag==1
     },
+    showConvertPromoGifts(){
+      return this.$refs.productList && this.$refs.productList.showConvertPromoGifts
+    },
     pageHeight () {
       return window.innerHeight - 305 + (this.hideFooter ? 45 : 0)
     }
@@ -356,9 +362,7 @@ export default {
           return
         }
         
-        const acitveList = this.$refs.productList.activeList
-        const hasConvertPromoGift = acitveList&&acitveList.find(item => item.promotionRule&&item.promotionRule.convertExpenseFlag==1&&item.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD')
-        if (hasConvertPromoGift) {
+        if (this.$refs.productList.showConvertPromoGifts) {
           this.$info({
             title: '提示',
             content: '该活动规则中,促销产品可转费用报销单,不可一键审核!',

+ 54 - 47
src/views/salesManagement/salesQueryNew/list.vue

@@ -531,63 +531,70 @@ export default {
     async handleExpense (row) {
       const _this = this
       const hasExpense = await queryCreateBySalesBillSn({ salesBillSn: row.salesBillSn }).then(res => res.data || [])
-      const showModalFlag = [hasExpense.exceed, hasExpense.balance, hasExpense.giftConvertAmount]
-      const showModal = 0
-      showModalFlag.map(item => {
-        if (item) {
-          showModal = showModal + 1
+      const showModalFlag = []
+      const optionsKey = [
+        {
+          id: 'balance',
+          name: '采购额结余'
+        },
+        {
+          id: 'exceed',
+          name: '采购额超出'
+        },
+        {
+          id: 'giftConvertAmount',
+          name: '促销产品转采购额'
+        }
+      ]
+      optionsKey.map(key => {
+        if(hasExpense[key.id]){
+          showModalFlag.push(key)
         }
       })
-      console.log(hasExpense)
-      // 有2个以上采购额时
-      if (hasExpense && showModal > 1) {
-        _this.$confirm({
-          title: '转费用报销单?',
-          centered: true,
-          class: 'confirm-center',
-          content: <div>
-            <div style="padding:10px 0;text-align:center;">请选择费用报销单类型</div>
-            <div style="padding:0 0 10px 0;text-align:center;">
-              <aRadioGroup onChange={_this.changeDaOpt}>
-                <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="balance">
-                  采购额结余
-                </aRadio>
-                <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="exceed">
-                  采购额超出
-                </aRadio>
-                <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="giftConvertAmount">
-                  促销产品转采购额
-                </aRadio>
-              </aRadioGroup>
-            </div>
-          </div>,
-          onOk () {
-            if (_this.expenseOption) {
-              _this.expenseSave(hasExpense, _this.expenseOption)
-            } else {
-              _this.$message.info('请选择费用报销单类型!')
-              return true
-            }
-          },
-          onCancel () {
-            _this.expenseOption = null
-          }
-        })
-      } else {
+      
+      if(showModalFlag.length){
         // 直接转费用单
-        _this.expenseSave(hasExpense, null)
+        if(showModalFlag.length == 1){
+          _this.expenseSave(hasExpense[showModalFlag[0].id])
+        }
+        // 有2个以上采购额时
+        if (showModalFlag.length>1) {
+          _this.$confirm({
+            title: '转费用报销单?',
+            centered: true,
+            class: 'confirm-center',
+            content: <div>
+              <div style="padding:10px 0;text-align:center;">请选择费用报销单类型</div>
+              <div style="padding:0 0 10px 0;text-align:center;">
+                <aRadioGroup onChange={_this.changeDaOpt}>
+                  {showModalFlag.map(item => <aRadio key={item.id} style="height: '30px';lineHeight: '30px';padding:5px 0;" value={item.id}>{item.name}</aRadio>)}
+                </aRadioGroup>
+              </div>
+            </div>,
+            onOk () {
+              if (_this.expenseOption) {
+                _this.expenseSave(hasExpense[_this.expenseOption])
+              } else {
+                _this.$message.info('请选择费用报销单类型!')
+                return true
+              }
+            },
+            onCancel () {
+              _this.expenseOption = null
+            }
+          })
+        }
       }
     },
     changeDaOpt (e) {
       this.expenseOption = e.target.value
     },
     // 转费用单
-    expenseSave (data, type) {
-      console.log(data, type)
-      const params = type ? data[type] : (data.balance || data.exceed || data.giftConvertAmount)
-      if (params) {
+    expenseSave (data) {
+      console.log(data)
+      if (data) {
         this.openBaseModal = true
-        this.$refs.expenseModal.setDetail(params, 'sales')
+        this.$refs.expenseModal.setDetail(data, 'sales')
       }
     },
     expenseSaveOk (params) {

+ 16 - 9
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -289,7 +289,7 @@ export default {
       }
       // 转采购额数量输入框
       const inputFormat1 = function(record,data,h) {
-        if(record.unpushedQty>0){
+        if(record.unpushedQty>=0){
           // 已选
           if(_this.selectedRowKeys.includes(record.id) && record.convertPromoGiftsFlag == 1){
             return (
@@ -300,7 +300,7 @@ export default {
                   onChange={e => _this.convertPromoGiftsChange(e,record)}
                   precision={0}
                   min={0}
-                  max={record.unpushedQty}
+                  max={record.maxConvertNums}
                   style="width: 100%;"
                   placeholder="请输入" />
               </div>
@@ -349,7 +349,7 @@ export default {
                   {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
                   {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
                   {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.convertPromoGiftsAmount ? (<span>促销产品转采购额金额:<strong>{record.total&&record.total.convertPromoGiftsAmount||'--'}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.totalPromoGiftsAmount ? (<span>促销产品转采购额金额:<strong>{record.total&&record.total.totalPromoGiftsAmount||'--'}</strong>;</span>):('')}
                   {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
                 </div>
               </div>
@@ -533,10 +533,17 @@ export default {
           item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
           item.productOrigUnit = productOrigUnit || '--'
           item.cancelNums = item.unpushedQty
-          // 库存为0或待下推数为0,不可添加
-          if(!item.unpushedQty || item.unpushedQty<0){
-            this.disableSelectedRowKeys.push(item.id)
+          
+          if(item.convertPromoGiftsFlag == 1){
+            item.maxConvertNums = item.unpushedQty + item.convertPromoGiftsQty
+          }else{
+            item.maxConvertNums = 0
           }
+          
+          // 库存为0或待下推数为0,不可添加
+          // if(!item.unpushedQty || item.unpushedQty<0){
+          //   this.disableSelectedRowKeys.push(item.id)
+          // }
         })
         this.showEmpty = this.dataSource.length <= 0
         this.tableData = this.dataSource
@@ -591,7 +598,7 @@ export default {
         return
       }
       const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.convertPromoGiftsFlag==1)
-      const noChooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.convertPromoGiftsFlag==0)
+      const noChooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.convertPromoGiftsFlag)
       const obj = []
       const noObj = []
       noChooseRow && noChooseRow.map(item => {
@@ -607,8 +614,8 @@ export default {
       if(obj.length){
         this.$confirm({
           title: '提示',
-          content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确定将选中的促销产品转成采购额吗?</div><div style="font-size:12px;color:#999;padding:10px 0;text-align:center;">
-当该销售单完结后,可将采购额转成费用报销单。</div>{noObj.length?<div style="text-align:center;"><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可转采购额。</div><div> 产品 ({noObj.toString()}) 不可转采购额!</div></div>:''}</div>,
+          content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确定将选中的促销产品转成采购额吗?</div>{noObj.length?<div style="text-align:center;"><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可转采购额。</div><div style="color:red;"> 产品 ({noObj.toString()}) 不可转采购额!</div></div>:''}<div style="font-size:12px;color:#999;padding:10px 0;text-align:center;">
+当该销售单完结后,可将采购额转成费用报销单。</div></div>,
           centered: true,
           closable: true,
           class: 'confirm-center',

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