瀏覽代碼

修改bug

chenrui 10 月之前
父節點
當前提交
d51122b384

+ 19 - 17
src/views/promotionManagement/couponDetails/list.vue

@@ -3,7 +3,7 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)" id="couponDetails-form">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="券名称/券副标题">
@@ -12,15 +12,15 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="客户名称">
-                <selectCust ref="custList" :isValidateEnabled="true" id="couponDetails-customerSn" @change="custChange" v-model="queryParam.customerSn"></selectCust>
+                <selectCust ref="custList" id="couponDetails-customerSn" :isValidateEnabled="true" @change="custChange" v-model="queryParam.customerSn"></selectCust>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="券状态">
                 <v-select
+                  id="couponDetails-ticketState"
                   v-model="queryParam.ticketState"
                   ref="sourceType"
-                  id="couponDetails-ticketState"
                   code="TICKET_STATE"
                   placeholder="请选择优惠券使用状态"
                   allowClear></v-select>
@@ -72,35 +72,36 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { ticketQueryPage } from '@/api/ticket'
+// 组件
 import { STable, VSelect } from '@/components'
 import selectCust from '@/views/common/selectCust.vue'
 import writeOffModal from './writeOffModal.vue'
+// 接口
+import { ticketQueryPage } from '@/api/ticket'
 
 export default {
-  name: 'UrgentOffsetList',
+  name: 'CouponDetails',
   components: { STable, VSelect, writeOffModal, selectCust },
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       openModal: false, // 核销弹窗
-      openShowModal: false, // 促销展示弹窗
-      time: [],
-      queryParam: { //  查询条件
-        queryWord: undefined,
-        customerSn: undefined,
-        ticketState: undefined
-      },
-      writeOffObj: null,
-      descInfo: '', // 促销描述
       disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
+        queryWord: undefined, // 券名称/券副标题
+        customerSn: undefined, // 客户名称sn
+        ticketState: undefined// 券状态
+      },
+      writeOffObj: null, // 核销弹窗回显数据
+      // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
         { title: '销售单号', dataIndex: 'usedBizNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'customerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '货架名称', dataIndex: 'customerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货架名称', dataIndex: 'shelfName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '券名称', dataIndex: 'ruleName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '券副标题', dataIndex: 'ruleTitle', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '券金额', dataIndex: 'ticketValue', width: '10%', align: 'right', customRender: text => { return text || text == 0 ? this.toThousands(text, 2) : '--' } },
@@ -113,6 +114,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取优惠券列表数据  有分页
         return ticketQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {

+ 10 - 31
src/views/promotionManagement/couponDetails/writeOffModal.vue

@@ -6,7 +6,6 @@
     :maskClosable="false"
     title="核销"
     v-model="isShow"
-    :rules="rules"
     @cancel="isShow=false"
     :width="450">
     <div class="writeOffCon">
@@ -14,13 +13,13 @@
         id="writeOffModal-form"
         ref="ruleForm"
         :model="form"
-
+        :rules="rules"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol" >
         <a-form-model-item label="客户名称" prop="purchaseTargetSn">
           {{ itemObj&&itemObj.customerName?itemObj.customerName:'--' }}
         </a-form-model-item>
-        <a-form-model-item label="核销码" prop="settleStyleSn">
+        <a-form-model-item label="核销码" prop="usedBizNo">
           <a-input id="writeOffModal-customerName" v-model.trim="form.usedBizNo" allowClear placeholder="请输入该客户的销售单号核销"/>
         </a-form-model-item>
       </a-form-model>
@@ -76,6 +75,7 @@ export default {
           ticketCheckTicket(this.form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
+              _this.isShow = false
               _this.$emit('ok')
             }
           })
@@ -85,8 +85,8 @@ export default {
       })
     },
     reSetData () {
-      this.form.usedBizNo = undefined
       this.$refs.ruleForm.resetFields()
+      this.form.usedBizNo = undefined
     }
   },
   watch: {
@@ -97,6 +97,7 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
+        this.reSetData()
         this.$emit('close')
       }
     }
@@ -106,37 +107,15 @@ export default {
 
 <style lang="less" scoped>
   .writeOff-modal{
-    /deep/.ant-modal-body{
-       text-algin:center !important;
-    }
-
-    .writeOff-con{
-      width:340px;
-      margin:0 auto;
-      position:relative;
-      text-align: center;
-      img{
-         width:81%;
-         height:auto;
-       }
-       .writeOffCon{
-         position: absolute;
-         left:15%;
-         top:12.5%;
-         width: 70%;
-         max-height:420px;
-         overflow-y: scroll;
-         scrollbar-width:none;
-         -ms-overflow-style: none;
-       }
-       .writeOffCon::-webkit-scrollbar{
-           display:none;
-       }
+    .writeOffCon{
+      /deep/.ant-form-item{
+        margin-bottom:18px;
+      }
     }
 
     .btn-cont {
       text-align: center;
-      margin: 30px 0 0px;
+      margin: 40px 0 0px;
     }
   }
 </style>

+ 18 - 15
src/views/promotionManagement/promotionInfo/setPromotion.vue

@@ -115,11 +115,12 @@
                       </a-form-model-item>
                       <a-form-model-item class="productName" label="活动产品" prop="ruleProductList">
                         <a-button type="primary" :disabled="pageType==='see'?disabledVal:!disabledVal" @click="handleAddProduct(item)" size="small">添加产品</a-button>
-                        <div class="productCon" v-if="item.ruleProductList && item.ruleProductList.length>0">
+                        <!-- <div class="productCon" v-if="item.ruleProductList && item.ruleProductList.length>0">
                           <a-tag :closable="pageType==='see'?!disabledVal:disabledVal" @close="delBuyerName(item,con)" v-for="con in item.ruleProductList" :key="con.productSn">
                             {{ con.productCode }}
                           </a-tag>
-                        </div>
+                        </div> -->
+
                       </a-form-model-item>
                       <a-form-model-item class="productName" label="券适用范围" prop="range">
                         全部产品
@@ -170,7 +171,7 @@
                   :placeholder="['开始时间', '结束时间']" />
               </a-radio>
               <a-radio :style="radioStyle" value="LIMIT">
-                <span>领取后,当天生效,有效期</span><a-input-number
+                <span>领取后,当天生效,有效期</span><a-input-number
                   style="margin:0 5px;"
                   v-model="sellForm.validDays"
                   :step="1"
@@ -383,19 +384,19 @@ export default {
     // 验证必填项
     testAndVerify (callBack) {
       if (this.couponList && this.couponList.length > 0) {
-       let moneyFlag = this.couponList.some( con => !con.ruleValue)
-       let productFlag = this.couponList.some( con => con.ruleProductList && con.ruleProductList.length == 0)
-       if(moneyFlag){
-         this.$message.warning('请输入返利金额!')
-         return false
-       }
-       if(productFlag){
-         this.$message.warning('请选择活动产品!')
-        return false
-       }
+        const moneyFlag = this.couponList.some(con => !con.ruleValue)
+        const productFlag = this.couponList.some(con => con.ruleProductList && con.ruleProductList.length == 0)
+        if (moneyFlag) {
+          this.$message.warning('请输入返利金额!')
+          return false
+        }
+        if (productFlag) {
+          this.$message.warning('请选择活动产品!')
+          return false
+        }
       }
       this.$refs.sellRuleForm.validate(valid => {
-        if (valid){
+        if (valid) {
           callBack(valid)
         } else {
           return false
@@ -414,7 +415,9 @@ export default {
     },
     // 详情赋值
     setDetailData (info, arr) {
-      info.productRangeList = info.productRangeList.map(item => item.productTypeSn)
+      if (info.productRangeList && info.productRangeList.length > 0) {
+        info.productRangeList = info.productRangeList.map(item => item.productTypeSn)
+      }
       if (info.validType === 'FIXED') {
         this.time = [info.validStartDate, info.validEndDate]
       }