lilei há 1 ano atrás
pai
commit
cf66c8ac99

+ 38 - 96
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -214,9 +214,11 @@
     </s-table>
     
       <!-- 导入产品 -->
-      <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
+      <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeImportOk" />
       <!-- 仓库设置 -->
       <setWarehouse :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse>
+      <!-- 换促销 -->
+      <updateActiveModal :show="openUpActiveModal" @ok="upActiveOk" @cancel="openUpActiveModal=false"></updateActiveModal>
   </div>
 </template>
 
@@ -225,6 +227,7 @@
   import { STable, VSelect } from '@/components'
   import ImportGuideModal from './importGuideModal.vue'
   import setWarehouse from './setWarehouse.vue'
+  import updateActiveModal from './updateActiveModal.vue'
   import chooseWarehouse from '@/views/common/chooseWarehouse'
   import ProductBrand from '@/views/common/productBrand.js'
   import productTypeAll from '@/views/common/productTypeAll.js'
@@ -240,7 +243,8 @@
       chooseWarehouse,
       setWarehouse,
       ProductBrand,
-      productTypeAll
+      productTypeAll,
+      updateActiveModal
     },
     props: {
       openModal: { //  弹框显示状态
@@ -306,7 +310,7 @@
         productType: [],
         rowSelectionInfo: null,
         warehouseDataList: [],
-        upActiveVal: null
+        openUpActiveModal: false
       }
     },
     computed: {
@@ -360,6 +364,25 @@
       rowSelectionFun (obj) {
         this.rowSelectionInfo = obj || null
       },
+      //  产品分类  change
+      changeProductType (val, opt) {
+        this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+        this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+        this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+      },
+      //  重置
+      resetSearchForm (flag) {
+        this.queryParam.productCode = ''
+        this.queryParam.productName = ''
+        this.queryParam.warehouseSn = undefined
+        this.queryParam.productBrandSn = undefined
+        this.queryParam.productTypeSn1 = ''
+        this.queryParam.productTypeSn2 = ''
+        this.queryParam.productTypeSn3 = ''
+        this.productType = []
+        this.$refs.table.refresh(!!flag)
+      },
+      // 删除全部产品
       handleBatchDelAll () {
         const _this = this
         if (_this.dataSource.length == 0) {
@@ -448,12 +471,6 @@
           _this.spinning = false
         })
       },
-      //  产品分类  change
-      changeProductType (val, opt) {
-        this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
-        this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
-        this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
-      },
       handleMenuClick (e) {
         const _this = this
         if (e.key == 0) { // 仓库设置
@@ -467,57 +484,13 @@
         } else {
           this.handleBatchDelAll()
         }
-      },
-      // 导入产品
-      handleImportClick(e){
-
       },
       // 换促销
+      upActiveOk(data){
+        this.openUpActiveModal = false
+      },
       handleUpdateActive(record){
-        const _this = this
-        this.$confirm({
-          title: '确定换促销活动?',
-          centered: true,
-          content: <div>
-            <div>禁用规则后,将无法享受该活动规则优惠</div>
-            <div style="padding:10px 0;">
-              <aRadioGroup onChange={_this.changeUpActOpt}>
-                <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="1">
-                  不参加促销
-                </aRadio>
-                <div>
-                  520以爱之名保护你 <a-button>详情</a-button>
-                </div>
-                <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="2">
-                  1、满10送2
-                </aRadio>
-                <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="3">
-                  2、满10000送500(5%)采购额
-                </aRadio>
-                <div>
-                  滤清器秋季大派送 <a-button>详情</a-button>
-                </div>
-                <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="4">
-                  1、满20送5
-                </aRadio>
-                <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="5">
-                  2、特价产品,33元(8折)                                                                                                                                                                          
-                </aRadio>
-              </aRadioGroup>
-            </div>
-          </div>,
-          onOk() {
-            if(_this.upActiveVal){
-              _this.upActiveVal = null
-            }else{
-              _this.$message.info("请选择活动规则!")
-              return true
-            }
-          },
-          onCancel() {
-            _this.upActiveVal = null
-          },
-        });
+        this.openUpActiveModal = true
       },
       // 已选产品  blur
       onCellBlur (val, record) {
@@ -540,40 +513,7 @@
           record.qty = record.qtyBackups
         }
       },
-      //  重置
-      resetSearchForm (flag) {
-        this.queryParam.productCode = ''
-        this.queryParam.productName = ''
-        this.queryParam.warehouseSn = undefined
-        this.queryParam.productBrandSn = undefined
-        this.queryParam.productTypeSn1 = ''
-        this.queryParam.productTypeSn2 = ''
-        this.queryParam.productTypeSn3 = ''
-        this.productType = []
-        this.$refs.table.refresh(!!flag)
-      },
-      // 整单删除
-      delSalerDetailAll () {
-        const _this = this
-        this.$confirm({
-          title: '提示',
-          content: '确认要整单删除吗?',
-          centered: true,
-          closable: true,
-          onOk () {
-            _this.delLoading = true
-            _this.spinning = true
-            salesDetailDelAll({ salesBillSn: _this.salesBillSn }).then(res => {
-              if (res.status == 200) {
-                _this.resetSearchForm()
-                _this.$message.success(res.message)
-              }
-              _this.delLoading = false
-              _this.spinning = false
-            })
-          }
-        })
-      },
+    
       // 删除产品
       handleDel (row) {
         const _this = this
@@ -630,20 +570,22 @@
           if (res.status == 200) {
             this.resetSearchForm()
             this.$message.success('产品添加成功', 2.5)
-            this.spinning = false
-          } else {
-            this.spinning = false
           }
+          this.spinning = false
           this.isInster = false
         }).catch(err => {
           this.isInster = false
+          this.spinning = false
         })
       },
+      // 导入产品
+      handleImportClick(e){
+        this.openGuideModal = true
+      },
       closeGuideModel () {
         this.openGuideModal = false
       },
-      // 导入产品
-      hanldeOk (obj) {
+      hanldeImportOk (obj) {
         salesBatchInsert(obj).then(res => {
           if (res.status == 200) {
             this.$refs.table.refresh(true)

+ 0 - 23
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -440,29 +440,6 @@
         this.productType = []
         this.$refs.table.refresh(!!flag)
       },
-      // 整单删除
-      delSalerDetailAll () {
-        const _this = this
-        this.$confirm({
-          title: '提示',
-          content: '确认要整单删除吗?',
-          centered: true,
-          closable: true,
-          onOk () {
-            _this.delLoading = true
-            _this.spinning = true
-            salesDetailDelAll({ salesBillSn: _this.salesBillSn }).then(res => {
-              if (res.status == 200) {
-                _this.resetSearchForm()
-                // _this.$refs.promotable.resetCurForm()
-                _this.$message.success(res.message)
-              }
-              _this.delLoading = false
-              _this.spinning = false
-            })
-          }
-        })
-      },
       // 删除产品
       handleDel (row) {
         const _this = this

+ 116 - 0
src/views/salesManagement/salesQueryNew/comps/updateActiveModal.vue

@@ -0,0 +1,116 @@
+<template>
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    width="450px"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="padding: 0 30px;">
+        <aRadioGroup v-model="upActiveVal">
+          <aRadio :style="radioStyle" value="1">
+            不参加促销
+          </aRadio>
+          <div>
+            <strong>520以爱之名保护你</strong> 
+            <a-popover title="活动详情">
+              <template slot="content">
+                <ul class="active-li">
+                  <li><strong>促销类型:</strong> 买产品送产品</li>
+                  <li><strong>促销门槛:</strong> 购买1000元门槛产品,可使用200元配额,采购正价产品</li>
+                  <li><strong>促销规则:</strong> 购买满10个正价产品,送10个促销产品</li>
+                  <li><strong>显示正价产品款数:</strong> 40</li>
+                  <li><strong>订单起订金额:</strong> 20000</li>
+                  <li><strong>活动经费上线:</strong> 5000</li>
+                </ul>
+              </template>
+              <a-button type="link">详情</a-button>
+            </a-popover>
+          </div>
+          <aRadio :style="radioStyle" value="2">
+            1、满10送2
+          </aRadio>
+          <aRadio :style="radioStyle" value="3">
+            2、满10000送500(5%)采购额
+          </aRadio>
+          <div>
+            <strong>滤清器秋季大派送</strong>
+            <a-popover title="活动详情">
+              <template slot="content">
+                <ul class="active-li">
+                  <li><strong>促销类型:</strong> 买产品送产品</li>
+                  <li><strong>促销门槛:</strong> 购买1000元门槛产品,可使用200元配额,采购正价产品</li>
+                  <li><strong>促销规则:</strong> 购买满10个正价产品,送10个促销产品</li>
+                  <li><strong>显示正价产品款数:</strong> 40</li>
+                  <li><strong>订单起订金额:</strong> 20000</li>
+                  <li><strong>活动经费上线:</strong> 5000</li>
+                </ul>
+              </template>
+              <a-button type="link">详情</a-button>
+            </a-popover>
+          </div>
+          <aRadio :style="radioStyle" value="4">
+            1、满20送5
+          </aRadio>
+          <aRadio :style="radioStyle" value="5">
+            2、特价产品,33元(8折)                                                                                                                                                                          
+          </aRadio>
+        </aRadioGroup>
+      </div>
+        <div style="padding: 30px 0 0;text-align: center;">
+          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+        </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+export default {
+  name: 'SetWarehouse',
+  mixins: [commonMixin],
+  props: {
+    show: [Boolean]
+  },
+  data () {
+    return {
+      opened: this.show,
+      spinning: false,
+      title: '确定换促销活动?',
+      confirmLoading: false,
+      upActiveVal: null,
+      radioStyle:"display:block;height: '30px';lineHeight: '30px';padding:5px 0;"
+    }
+  },
+  methods: {
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      if(_this.upActiveVal){
+        _this.$emit('ok', _this.upActiveVal)
+      }else{
+        _this.$message.info("请选择活动规则!")
+      }
+    },
+    cancel () {
+      this.opened = false
+      this.upActiveVal = null
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (!newValue) {
+        this.upActiveVal = null
+      }
+    }
+  }
+}
+</script>