Kaynağa Gözat

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

chenrui 1 yıl önce
ebeveyn
işleme
182722fb89

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

@@ -156,8 +156,8 @@
                         数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
                         {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
                         {_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.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
+                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
                         {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
                     </div>
                   </div>

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

@@ -16,7 +16,7 @@
                 <span v-else-if="descDetail.gateType==='MIN_AMOUNT'">
                   购买门槛产品满最低金额{{ descDetail.gateAmount }}不限制配额。
                 </span>
-                <span v-else>购买满{{ descDetail.gateAmount }}元门槛产品,可使用 {{ descDetail.quotaAmount }}元配额,采购规则中的正价商品</span>
+                <span v-else>购买满{{ descDetail.gateAmount }}元门槛产品,可使用 {{ descDetail.quotaAmount }}元配额,采购规则中的{{descDetail.promotionRuleType == 'PROMO_PROD'?'特价':'正价'}}商品</span>
               </div>
               <span v-else>无</span>
             </div>

+ 35 - 19
src/views/salesManagement/salesQueryNew/edit.vue

@@ -55,8 +55,8 @@
           <span style="margin-left:20px;color:#00aaff;cursor: pointer;"  @click="(event) => {showDesc(event, item)}">
             <a-icon :type="item.showDesc ? 'eye-invisible' : 'eye'"/> 活动详情
           </span>
-          <span :style="{margin:'0 20px',color:item.disabled?'#14b900':'#ff0800',cursor: 'pointer'}" @click="(event) => {disabledActive(event, item)}">
-            <a-icon title="禁用规则" type="disconnect"/> {{item.disabled ? '启用规则' : '禁用规则'}}
+          <span :style="{margin:'0 20px',color:item.disabled?'#14b900':'#ff0800',cursor: 'pointer'}" @click="(event) => {disenablePromp(event, item)}">
+            <a-icon title="禁用规则" :type="item.disabled?'link':'disconnect'"/> {{item.disabled ? '启用规则' : '禁用规则'}}
           </span>
         </div>
         <div slot="extra" @click="tooglePanel(item)" style="cursor: pointer;">{{ item.isActive ? '收起' : '展开' }} <a-icon type="caret-right" :rotate="item.isActive ? 90 : 0"/> </div>
@@ -244,7 +244,7 @@ export default {
       // 已参与活动列表
       this.activeList = await salesPromoQueryList({ salesBillSn: this.$route.params.sn }).then(res => res.data || [])
       this.activeList.map(item => {
-        item.isActive = true
+        item.isActive = item.enabledFlag == 1
         item.showDesc = false
         item.disabled = item.enabledFlag == 0
         this.activeDesKey['search-'+item.promoRuleSn] = false
@@ -431,6 +431,7 @@ export default {
     // 展开收缩活动详情
     showDesc(e,item){
       e.stopPropagation()
+      item.isActive = true
       const row = this.$refs['productList-'+item.promoRuleSn][0]
       row&&row.showDesc(item.promotionRule)
     },
@@ -448,19 +449,47 @@ export default {
         if(res.status == 200){
           _this.$refs['productList-'+item.promoRuleSn][0].disableActive(false)
           item.disabled = false
+          item.isActive = true
           _this.activeList.splice()
           _this.$message.success("操作成功,请添加产品")
         }
       })
     },
-    // 禁用活动
+    // 禁用规则
     disabledActive(e,item){
       const _this = this
+      salesDisablePromo({
+        salesBillSn: _this.salesBillSn,
+        salesPromoSn: item.salesPromoSn,
+        promoRuleSn: item.promoRuleSn,
+        salesDisableType: _this.disabledActiveOption
+      }).then(res => {
+        if(res.status == 200){
+          _this.$refs['productList-'+item.promoRuleSn][0].disableActive(true)
+          _this.disabledActiveOption = null
+          item.disabled = true
+          item.isActive = false
+          _this.activeList.splice()
+          _this.$message.success("操作成功")
+        }
+      })
+    },
+    // 禁用启用活动规则
+    disenablePromp(e,item){
+      const _this = this
+      const table = _this.$refs['productList-'+item.promoRuleSn][0]
+      // 是否启用规则
       if(item.disabled){
-        // 是否启用规则
         this.enabledActive(e,item)
         return
       }
+      // 如果没有活动产品,直接禁用无需弹框提示
+      if(table.countData&&!table.countData.totalQty){
+        _this.disabledActiveOption = 'DELETE'
+        _this.disabledActive(e,item)
+        return
+      }
+      // 弹框提示禁用方式
       this.$confirm({
         title: '确定禁用规则?',
         centered: true,
@@ -480,19 +509,7 @@ export default {
         </div>,
         onOk() {
           if(_this.disabledActiveOption){
-            salesDisablePromo({
-              salesBillSn: _this.salesBillSn,
-              salesPromoSn: item.salesPromoSn,
-              promoRuleSn: item.promoRuleSn,
-              salesDisableType: _this.disabledActiveOption
-            }).then(res => {
-              if(res.status == 200){
-                _this.$refs['productList-'+item.promoRuleSn][0].disableActive(true)
-                _this.disabledActiveOption = null
-                item.disabled = true
-                _this.activeList.splice()
-              }
-            })
+            _this.disabledActive(e,item)
           }else{
             _this.$message.info("请选择禁用方式!")
             return true
@@ -504,7 +521,6 @@ export default {
       });
     },
     changeDaOpt(e){
-      console.log(e)
       this.disabledActiveOption = e.target.value
     },
     pageInit () {

+ 2 - 2
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -297,8 +297,8 @@ export default {
                   数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
                   {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
                   {_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 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
-                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgeccAmount ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount>0 ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.totalPromoGiftsAmount&&record.total&&record.total.cgejyAmount<0 ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
                   {record.expenseAccountFlag!='WAIT' ? record.expenseAccountFlagDictValue : ''}
                 </div>
               </div>