Ver Fonte

促销活动

chenrui há 2 anos atrás
pai
commit
54b3e475c8

+ 22 - 0
src/api/promoTerminal.js

@@ -0,0 +1,22 @@
+import { axios } from '@/utils/request'
+
+//  促销查看列表  有分页
+export const promoTerminalList = (params) => {
+  const url = `/promoTerminal/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 促销查看详情
+export const promoTerminalDetail = params => {
+  return axios({
+    url: `/promoTerminal/findBySn/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}

BIN
src/assets/iphone.png


+ 2 - 2
src/config/router.config.js

@@ -3210,7 +3210,7 @@ export const asyncRouterMap = [
             name: 'promotionInfo',
             component: BlankLayout,
             meta: {
-              title: '促销查看',
+              title: '促销活动',
               icon: 'contacts'
               // permission: 'M_promotionInfoList'
             },
@@ -3221,7 +3221,7 @@ export const asyncRouterMap = [
                 name: 'promotionInfoList',
                 component: () => import(/* webpackChunkName: "productManagement" */ '@/views/promotionManagement/promotionInfo/list.vue'),
                 meta: {
-                  title: '促销列表',
+                  title: '促销活动列表',
                   icon: 'contacts',
                   hidden: true
                   // permission: 'M_promotionInfoList'

+ 73 - 57
src/views/promotionManagement/promotionInfo/list.vue

@@ -12,27 +12,27 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="促销名称">
-                <a-input id="promotionInfoList-urgentBillNo" v-model.trim="queryParam.urgentBillNo" allowClear placeholder="请输入急件单号"/>
+                <a-input id="promotionInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入促销名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="4" :sm="24">
               <a-form-item label="显示状态">
-                <v-select
-                  v-model="queryParam.status"
-                  ref="status"
-                  id="chainTransferInList-status"
-                  code="URGENT_STATUS"
+                <a-select
+                  v-model="queryParam.showFlag"
                   placeholder="请选择显示状态"
-                  allowClear></v-select>
+                >
+                  <a-select-option :value="1">已显示</a-select-option>
+                  <a-select-option :value="0">未显示</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="4" :sm="24">
               <a-form-item label="促销状态">
                 <v-select
-                  v-model="queryParam.sourceType"
+                  v-model="queryParam.state"
                   ref="sourceType"
                   id="promotionInfoList-sourceType"
-                  code="SALES_SOURCE"
+                  code="PROMO_STATE"
                   placeholder="请选择促销状态"
                   allowClear></v-select>
               </a-form-item>
@@ -56,48 +56,45 @@
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         bordered>
-        <!-- 参与客户 -->
-        <template slot="joinCustomers" slot-scope="text, record">
-          <span @click="openCustomerModal = true">共<span style="color:red;">17</span>个客户</span>
+        <!-- 促销时间 -->
+        <template slot="promotionTime" slot-scope="text, record">
+          <span>{{ record.activeDateStart }}至{{ record.activeDateEnd }}</span>
+        </template>
+        <!-- 促销描述 -->
+        <template slot="desc" slot-scope="text, record">
+          <div class="desc font1" @click="handleDescModal(record)">{{ record.description }}</div>
         </template>
         <!-- 状态 -->
-        <template slot="status" slot-scope="text, record">
-          <stateIcon :title="record.statusDictValue" :state="record.status=='WAIT'?'2':'1'"></stateIcon>
+        <template slot="showStatus" slot-scope="text, record">
+          {{ record.showFlag == '1'?'已显示':'未显示' }}
         </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            v-if="record.status == 'WAIT' && $hasPermissions('B_urgentWriteDown')"
-            @click="handleWriteDown(record)"
-            class="button-primary"
-            id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
+        <!-- 促销展示 -->
+        <template slot="salesShow" slot-scope="text, record">
+          <div @click="handleSaleShow(record)" v-if="record.images && record.images.length>0">
+            <img :src="record.images[0]" alt="图片走丢啦" width="60" />
+          </div>
           <span v-else>--</span>
         </template>
       </s-table>
     </a-spin>
-    <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"/>
-    <promotion-desc-modal :openModal="openDescModal" @close="openDescModal = false"/>
-    <promotion-show-modal :openModal="openShowModal" @close="openShowModal = false"/>
+    <promotion-desc-modal :con="descInfo" :openModal="openDescModal" @close="openDescModal = false"/>
+    <promotion-show-modal ref="promotionShow" :openModal="openShowModal" @close="openShowModal = false"/>
   </a-card>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { urgentList, urgentWriteDown } from '@/api/urgent'
+import { promoTerminalList, promoTerminalDetail } from '@/api/promoTerminal'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import stateIcon from '@/views/common/stateIcon'
 import custList from '@/views/common/custList.vue'
-import getDate from '@/libs/getDate.js'
-import lookUpCustomersModal from './lookUpCustomersModal'
 import promotionDescModal from './promotionDescModal'
 import promotionShowModal from './promotionShowModal'
 
 export default {
   name: 'UrgentOffsetList',
-  components: { STable, VSelect, rangeDate, custList, stateIcon, lookUpCustomersModal, promotionDescModal, promotionShowModal },
+  components: { STable, VSelect, rangeDate, custList, stateIcon, promotionDescModal, promotionShowModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -106,42 +103,38 @@ export default {
       openCustomerModal: false, // 参与客户弹窗
       openDescModal: false, // 促销描述弹窗
       openShowModal: true, // 促销展示弹窗
-      time: [
-        getDate.getCurrMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ],
+      time: [],
       queryParam: { //  查询条件
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        buyerNameCurrent: undefined, //  客户名称
-        bizBillNo: '', //  关联单号
-        urgentBillNo: '', //  急件单号
-        status: undefined, //  状态
-        sourceType: undefined // 单据来源
+        beginDate: undefined,
+        endDate: undefined,
+        name: '', //  促销名称
+        showFlag: undefined, // 显示状态
+        state: undefined// 促销状态
       },
+      descInfo: '', // 促销描述
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '发布时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销名称', dataIndex: 'buyerNameCurrent', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '促销时间', dataIndex: 'offSetTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '15%', align: 'center' },
-        { title: '促销描述', dataIndex: 'bizBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销展示', scopedSlots: { customRender: 'status' }, width: '15%', align: 'center' },
-        { title: '显示状态', dataIndex: 'bizBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'bizBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '促销名称', dataIndex: 'name', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '20%', align: 'center' },
+        { title: '促销描述', scopedSlots: { customRender: 'desc' }, width: '20%', align: 'center' },
+        { title: '促销展示', scopedSlots: { customRender: 'salesShow' }, width: '10%', align: 'center' },
+        { title: '显示状态', scopedSlots: { customRender: 'showStatus' }, width: '10%', align: 'center' },
+        { title: '状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return urgentList(Object.assign(parameter, this.queryParam)).then(res => {
+        return promoTerminalList(Object.assign(parameter, this.queryParam)).then(res => {
           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
           }
@@ -157,6 +150,14 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 查看促销描述
+    handleDescModal (row) {
+      this.descInfo = row.description
+      const _this = this
+      this.$nextTick(() => {
+        _this.openDescModal = true
+      })
+    },
     // 冲减
     handleWriteDown (row) {
       const _this = this
@@ -178,17 +179,21 @@ export default {
         }
       })
     },
+    handleSaleShow (row) {
+      const _this = this
+      _this.openShowModal = true
+      this.$nextTick(() => {
+        _this.$refs.promotionShow.getDetail({ id: row.promoActiveSn })
+      })
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.buyerNameCurrent = undefined
-      this.queryParam.bizBillNo = ''
-      this.queryParam.urgentBillNo = ''
-      this.queryParam.status = undefined
-      this.queryParam.sourceType = undefined
-      this.$refs.custList.resetForm()
+      this.queryParam.beginDate = undefined
+      this.queryParam.endDate = undefined
+      this.queryParam.name = ''
+      this.queryParam.showFlag = undefined
+      this.queryParam.state = undefined
       this.$refs.table.refresh(true)
     },
     //  详情
@@ -243,5 +248,16 @@ export default {
     .green{
       color: #19be6b;
     }
+    .font1{
+     color:#39f;
+    }
+    .desc{
+      width: 100%;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      display: -webkit-box;
+      -webkit-line-clamp: 3;
+      -webkit-box-orient: vertical;
+    }
   }
 </style>

+ 0 - 282
src/views/promotionManagement/promotionInfo/lookUpCustomersModal.vue

@@ -1,282 +0,0 @@
-<template>
-  <a-modal
-    centered
-    class="lookUpCustomers-modal"
-    :footer="null"
-    :maskClosable="false"
-    title="参与客户"
-    v-model="isShow"
-    @cancel="isShow = false"
-    width="50%">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-card size="small" :bordered="false">
-        <!-- 筛选条件 -->
-        <div class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-            <a-row :gutter="15">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="客户名称">
-                  <custList ref="custList" @change="custChange" placeholder="输入客户名称搜索"></custList>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="联系人">
-                  <custList ref="custList" @change="custChange" placeholder="输入联系人名称搜索"></custList>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
-              </a-col>
-            </a-row>
-          </a-form>
-        </div>
-        <!-- 列表 -->
-        <s-table
-          class="sTable"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :data="loadData"
-          :defaultLoadData="false"
-          :scroll="{ y: 450 }"
-          :rowClassName="(record, index) => record.checkProfitLossQty < 0 ? 'redBg-row':''"
-          bordered>
-        </s-table>
-      </a-card>
-      <div class="btn-cont">
-        <a-button type="primary" id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
-      </div>
-    </a-spin>
-  </a-modal>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { hdPrint } from '@/libs/JGPrint.js'
-import { STable } from '@/components'
-// import printModal from './printModal.vue'
-// import exportModal from './exportModal.vue'
-import ProductType from '@/views/common/productType.js'
-import custList from '@/views/common/custList.vue'
-import { checkWarehouseDetailList, checkWarehouseDetail, checkWarehouseDetailCount, checkWarehouseDetailExport, checkWarehouseDetailPrint, checkWarehouseWarehouse } from '@/api/checkWarehouse'
-export default {
-  name: 'LookUpCustomersModal',
-  components: { STable, ProductType, custList },
-  mixins: [commonMixin],
-  props: {
-    openModal: { //  弹框显示状态
-      type: Boolean,
-      default: false
-    },
-    itemSn: {
-      type: String || Number,
-      default: ''
-    }
-  },
-  data () {
-    return {
-      spinning: false,
-      isShow: this.openModal, //  是否打开弹框
-      disabled: false,
-      advanced: false,
-      exportShow: false,
-      queryParam: {
-        productName: '',
-        productCode: '',
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined,
-        warehouseSn: undefined
-      },
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        const params = Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })
-        if (this.isPrice) {
-          params.profitLossFlag = 1
-        }
-        return checkWarehouseDetailList(params).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            this.getDetailCount(params)
-            const no = (data.pageNo - 1) * data.pageSize
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
-            this.localDataSource = data.list || []
-            this.disabled = false
-          }
-          this.spinning = false
-          return data
-        })
-      },
-      basicInfoData: null, //  基本信息
-      productTotal: null,
-      productType: [],
-      warehouseList: [], //  仓库  下拉数据
-      localDataSource: [],
-      isPrice: false, //  仅显示盈亏
-      openPrintModal: false,
-      nowType: null,
-      printerType: 'NEEDLE', //  打印机类型
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '客户名称', dataIndex: 'productName', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '联系人', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系电话', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
-      ]
-    }
-  },
-  methods: {
-    // 详情
-    getDetail () {
-      checkWarehouseDetail({ sn: this.itemSn }).then(res => {
-        if (res.status == 200) {
-          this.basicInfoData = res.data || null
-        } else {
-          this.basicInfoData = null
-        }
-      })
-    },
-    // 合计
-    getDetailCount (params) {
-      checkWarehouseDetailCount(params).then(res => {
-        if (res.status == 200) {
-          this.productTotal = res.data
-          if (res.data && res.data.checkLossQty) {
-            this.productTotal.checkLossQty = Math.abs(this.productTotal.checkLossQty || 0)
-          }
-        } else {
-          this.productTotal = null
-        }
-      })
-    },
-    //  重置
-    resetSearchForm () {
-      this.queryParam.productName = ''
-      this.queryParam.productCode = ''
-      this.queryParam.warehouseSn = undefined
-      this.queryParam.productTypeSn1 = undefined
-      this.queryParam.productTypeSn2 = undefined
-      this.queryParam.productTypeSn3 = undefined
-      this.productType = []
-      this.$refs.table.refresh(true)
-    },
-    //  产品分类  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] : ''
-    },
-    // 仓库下拉数据
-    getWarehouseList () {
-      checkWarehouseWarehouse({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
-    handleExport () {
-      this.exportShow = true
-    },
-    // 打印导出
-    handlePrint (type, data) {
-      if (type == 'export') {
-        this.exportShow = false
-        this.nowType = type
-        this.handleOk(data)
-      } else {
-        this.nowType = type
-        this.openPrintModal = true
-      }
-    },
-    handleOk (objs) {
-      const _this = this
-      let params, type
-      let url = checkWarehouseDetailPrint //  打印
-      if (this.nowType == 'export') { //  导出
-        url = checkWarehouseDetailExport
-        params = { checkWarehouseSn: this.itemSn, ...objs }
-        type = 'export'
-      } else { //  打印
-        params = JSON.parse(JSON.stringify(objs))
-        params.printType = this.printerType
-        type = params.type
-        delete params.type
-      }
-      _this.spinning = true
-      // 打印或导出
-      hdPrint(this.printerType, type, url, params, '库存盘点', function () {
-        _this.spinning = false
-      })
-    }
-  },
-  watch: {
-    //  父页面传过来的弹框状态
-    openModal (newValue, oldValue) {
-      this.isShow = newValue
-    },
-    //  重定义的弹框状态
-    isShow (newValue, oldValue) {
-      if (!newValue) {
-        this.$emit('close')
-        this.printerType = 'NEEDLE'
-        this.$refs.table.clearTable()
-        this.basicInfoData = null
-      } else {
-        const _this = this
-        setTimeout(() => (
-          _this.resetSearchForm()
-        ), 300)
-      }
-    },
-    itemSn (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.isPrice = false
-        this.getDetail()
-        this.getWarehouseList()
-      }
-    },
-    isPrice (newValue, oldValue) {
-      this.$refs.table.refresh(true)
-    }
-  }
-}
-</script>
-<style lang="less" scoped>
-  .lookUpCustomers-modal{
-    .ant-modal-body{
-      padding: 0 24px 24px;
-    }
-    .redBg-row{
-      background-color: #f5cdc8;
-    }
-    .btn-cont {
-      text-align: center;
-      margin: 5px 0 10px;
-    }
-    .table-page-search-wrapper{
-      margin-bottom:6px;
-      /deep/.ant-select-selection{
-        border:0 !important;
-        box-shadow: none !important;
-      }
-      .ant-form.ant-form-inline .ant-form-item{
-        border:1px solid #dadada;
-        border-radius: 3px;
-        overflow: hidden;
-        margin-bottom: 10px!important;
-        /deep/.ant-form-item-label{
-          padding-left: 11px !important;
-          padding-right: 0!important;
-        }
-      }
-    }
-  }
-</style>

+ 5 - 6
src/views/promotionManagement/promotionInfo/promotionDescModal.vue

@@ -9,9 +9,7 @@
     @cancel="isShow=false"
     :width="500">
     <div class="promotionDesc-con">
-      <p>购买满 10000 元正价产品,送 1000 元代金券可用于购买促销品</p>
-      <p>购买满 20000 元正价产品,返 3000 元代金券可用于购买促销品</p>
-      <p>正价消费满 1000 元 减 500 元</p>
+      <p>{{ con }}</p>
     </div>
     <div class="btn-cont">
       <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
@@ -28,6 +26,10 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    con: { //  弹框显示状态
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -35,9 +37,6 @@ export default {
       modalTit: '促销描述',
       isShow: this.openModal //  是否打开弹框
     }
-  },
-  methods: {
-
   },
   watch: {
     //  父页面传过来的弹框状态

+ 37 - 7
src/views/promotionManagement/promotionInfo/promotionShowModal.vue

@@ -9,7 +9,10 @@
     @cancel="isShow=false"
     :width="500">
     <div class="promotionDesc-con">
-      <img src="https://img0.baidu.com/it/u=107997771,2476879867&fm=253&fmt=auto&app=138&f=JPEG?w=716&h=500" alt="图片走丢了" srcset="">
+      <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
+      <div class="promotionDescCon" v-html="mainContent">
+
+      </div>
     </div>
     <div class="btn-cont">
       <a-button id="promotionDesc-modal-back" @click="isShow = false">下载图片</a-button>
@@ -20,6 +23,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { promoTerminalDetail } from '@/api/promoTerminal'
 export default {
   name: 'PromotionDescModal',
   mixins: [commonMixin],
@@ -32,11 +36,18 @@ export default {
   data () {
     return {
       modalTit: '促销展示',
-      isShow: this.openModal //  是否打开弹框
+      isShow: this.openModal, //  是否打开弹框
+      mainContent: ''
     }
   },
   methods: {
-
+    getDetail (con) {
+      promoTerminalDetail(con).then(res => {
+        if (res.status == 200) {
+          this.mainContent = res.data.content
+        }
+      })
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -53,16 +64,35 @@ export default {
 }
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
   .promotionDesc-modal{
+    /deep/.ant-modal-body{
+       text-algin:center !important;
+    }
+
     .promotionDesc-con{
-      max-height:600px;
-      overflow-y: scroll;
+      width:340px;
+      margin:0 auto;
+      position:relative;
       img{
-         width:100%;
+         width:81%;
          height:auto;
        }
+       .promotionDescCon{
+         position: absolute;
+         left:15%;
+         top:12.5%;
+         width: 70%;
+         max-height:420px;
+         overflow-y: scroll;
+         scrollbar-width:none;
+         -ms-overflow-style: none;
+       }
+       .promotionDescCon::-webkit-scrollbar{
+           display:none;
+       }
     }
+
     .btn-cont {
       text-align: center;
       margin: 30px 0 0px;