浏览代码

修改bug

chenrui 8 月之前
父节点
当前提交
fde8b47c27
共有 1 个文件被更改,包括 22 次插入65 次删除
  1. 22 65
      src/views/promotionManagement/promotionInfo/list.vue

+ 22 - 65
src/views/promotionManagement/promotionInfo/list.vue

@@ -3,11 +3,11 @@
     <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="promotionInfoList-form">
           <a-row :gutter="15">
             <a-col :md="5" :sm="24">
               <a-form-item label="发布时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="promotionInfoList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -62,7 +62,7 @@
         </template>
         <!-- 促销展示 -->
         <template slot="salesShow" slot-scope="text, record">
-          <div @click="handleDescModal(record)" v-if="record.imageUrl">
+          <div @click="handleDescModal(record)" v-if="record.imageUrl" :id="'promotionInfoList-img-'+record.id">
             <img :src="record.imageUrl" alt="图片走丢啦" width="60" />
           </div>
           <span v-else>--</span>
@@ -76,24 +76,19 @@
             class="button-primary"
             @click="handleOpenOrClose(record,'1')"
             v-if="record.dealerOpenFlag==='1'&&record.dealerOpenState=='0'&&(record.promoState=='IS_CLOSE'||record.promoState=='NOT_RELEASE')&&$hasPermissions('B_publishActiveBtn')"
-            id="productOnlineInfoList-detail-btn">开启</a-button>
+            :id="'promotionInfoList-openBtn-'+record.id">开启</a-button>
           <a-button
             size="small"
             type="link"
             class="button-primary"
             v-if="record.dealerOpenFlag==='1'&&record.dealerOpenState=='1'&&record.promoState=='HAVE_RELEASE'&&$hasPermissions('B_closeActiveBtn')"
             @click="handleOpenOrClose(record,'0')"
-            id="productOnlineInfoList-detail-btn">关闭</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-primary"
-            v-if="record.dealerEditFlag==='1'&&record.dealerPublishState!='END'&&$hasPermissions('B_promoActiveEditBtn')"
-            @click="handleEdit(record,'edit')">编辑</a-button>
+            :id="'promotionInfoList-closeBtn-'+record.id">关闭</a-button>
           <a-button
             size="small"
             type="link"
             class="button-success"
+            :id="'promotionInfoList-seeBtn-'+record.id"
             v-if="$hasPermissions('B_promoActiveSeeBtn')"
             @click="handleSee(record)">查看</a-button>
         </template>
@@ -108,36 +103,39 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import promotionDescModal from './promotionDescModal'
 import promotionShowModal from './promotionShowModal'
 import detailModal from './detailModal'
+// 接口
 import { shopPromoList, openOrCloseActive } from '@/api/shopPromo'
 import { closeActive } from '@/api/promoActive'
 
 export default {
-  name: 'UrgentOffsetList',
+  name: 'PromotionInfoList',
   components: { STable, VSelect, rangeDate, promotionDescModal, promotionShowModal, detailModal },
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      openDescModal: false, // 促销描述弹窗
-      openShowModal: false, // 促销展示弹窗
-      time: [],
-      queryParam: { //  查询条件
-        beginDate: undefined,
-        endDate: undefined,
+      tableHeight: 0, // 表格高度
+      openDescModal: false, // 促销展示弹窗
+      time: [], // 发布时间
+      //  查询条件
+      queryParam: {
+        beginDate: undefined, // 发布开始时间
+        endDate: undefined, // 发布结束时间
         promoName: '', //  促销名称
         promoType: '', // 促销类型
         promoState: undefined// 促销状态
       },
-      descInfo: '', // 促销描述
+      descInfo: '', // 促销展示内容
       itemId: null, // 促销当前行sn
       disabled: false, //  查询、重置按钮是否可操作
-      openDetailModal: false,
+      openDetailModal: false, // 打开详情弹窗
+      // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '发布时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -156,10 +154,10 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
-              data.list[i].images = data.list[i].images ? data.list[i].images.split(',') : []
             }
             this.disabled = false
           }
@@ -185,7 +183,7 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    // 查看促销描述
+    // 促销展示 查看大图
     handleDescModal (row) {
       this.descInfo = row.imageUrl
       const _this = this
@@ -193,14 +191,6 @@ export default {
         _this.openDescModal = true
       })
     },
-    // 促销展示
-    handleSaleShow (row) {
-      const _this = this
-      _this.openShowModal = true
-      this.$nextTick(() => {
-        _this.$refs.promotionShow.getDetail({ id: row.promoActiveSn, showType: row.contentType })
-      })
-    },
     // 开启
     handleOpenOrClose (row, val) {
       const _this = this
@@ -222,42 +212,9 @@ export default {
         }
       })
     },
-    // 关闭
-    handleClose (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '促销活动一旦,客户无法参与活动。确认关闭吗?',
-        centered: true,
-        onOk () {
-          _this.spinning = true
-          closeActive({ sn: row.promoActiveSn }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
-        }
-      })
-    },
-    // 编辑
-    handleEdit (row, type) {
-      const _this = this
-      if (row.dealerPublishState === 'PUBLISH' && type === 'edit') {
-        _this.$warning({
-          title: '提示',
-          content: '请先关闭活动,活动关闭后可编辑活动'
-        })
-      } else {
-        const nameInfo = type === 'edit' ? 'promotionInfoEdit' : 'promotionInfoDetail'
-        _this.$router.push({ name: nameInfo, params: { sn: row.promoActiveSn, pageType: type } })
-      }
-    },
     //  重置
     resetSearchForm () {
+      this.time = []
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = undefined
       this.queryParam.endDate = undefined