Ver Fonte

Merge branch 'develop_sale20' of jianguan-web/qpls-md-html into pre-release

李磊 há 2 anos atrás
pai
commit
fcf8957d5c

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1686188414638
+  "version": 1687168379154
 }

+ 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


+ 38 - 0
src/config/router.config.js

@@ -3193,6 +3193,44 @@ export const asyncRouterMap = [
           }
         ]
       },
+      // 促销管理
+      {
+        path: '/promotionManagement',
+        redirect: '/promotionManagement/promotionInfo',
+        component: PageView,
+        meta: {
+          title: '促销管理',
+          icon: 'contacts'
+          // permission: 'M_promotionInfoList'
+        },
+        children: [
+          {
+            path: '/promotionManagement/promotionInfo',
+            redirect: '/promotionManagement/promotionInfo/list',
+            name: 'promotionInfo',
+            component: BlankLayout,
+            meta: {
+              title: '促销活动',
+              icon: 'contacts'
+              // permission: 'M_promotionInfoList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'promotionInfoList',
+                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/promotionManagement/promotionInfo/list.vue'),
+                meta: {
+                  title: '促销活动列表',
+                  icon: 'contacts',
+                  hidden: true
+                  // permission: 'M_promotionInfoList'
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 中心店/配送店管理
       {
         path: '/storeManagement',

+ 2 - 2
src/views/bulkManagement/bulkImport/list.vue

@@ -23,7 +23,7 @@
             <div class="explain-tit">导入文件说明</div>
             <ul>
               <li>1) 导入的EXCEL文件中必须包含名为"供应商"、"产品品牌"、"产品编码"、"原厂编码"、"产品名称"、"产品一级分类"、"产品二级分类"、"产品三级分类"、"仓库"、"仓位"、"入库数量"、"成本价"、"售价";列顺序可忽略、行顺序可忽略。其中"供应商"、"产品品牌"、"产品编码"、"产品名称"、"仓库"、"仓位"、"入库数量"、"成本价"、"售价"内容不能为空。</li>
-              <li>2) 红色底白字为错误项,对应错误原因列显示错误信息,存在错误项时不能导入,请取消修改后重新上传操作。</li>
+              <li>2) 红色底为错误项,错误项忽略不能导入,正确项可直接导入。</li>
               <li>3) 供应商/产品品牌为必填项且不能包含箭冠、箭牌、冠牌等文字,产品名称为必填项。</li>
               <li>4) 支持上传文件格式:.xls、.xlsx。</li>
             </ul>
@@ -140,7 +140,7 @@ export default {
         savePathType: 'local'
       },
       uploadData: null,
-      filePath: location.protocol + '//' +location.host + '/templ/散件产品导入模板.xlsx'
+      filePath: location.protocol + '//' + location.host + '/templ/散件产品导入模板.xlsx'
     }
   },
   methods: {

+ 1 - 0
src/views/productManagement/newProduct/detail.vue

@@ -22,6 +22,7 @@
             <a-descriptions-item label="产品品牌:">{{ (detailsData && detailsData.productBrandName) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="产品编码:">{{ (detailsData && detailsData.code) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="原厂编码:">{{ (detailsData && detailsData.origCode) || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="条形码:">{{ detailsData&&detailsData.qrCode || '--' }}</a-descriptions-item>
             <a-descriptions-item label="商品尺寸:">{{ (detailsData && detailsData.size) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="重量:">{{ (detailsData && detailsData.weight) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="计量单位:">{{ (detailsData && detailsData.unit) || '--' }}</a-descriptions-item>

+ 1 - 0
src/views/productManagement/productInfo/detailModal.vue

@@ -14,6 +14,7 @@
         <a-descriptions-item label="产品名称:">{{ detailsData&&detailsData.name || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品编码:">{{ detailsData&&detailsData.code || '--' }}</a-descriptions-item>
         <a-descriptions-item label="原厂编码:">{{ detailsData&&detailsData.origCode || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="条形码:">{{ detailsData&&detailsData.qrCode || '--' }}</a-descriptions-item>
         <a-descriptions-item label="基本单位:">{{ detailsData&&detailsData.unit || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品品牌:">{{ detailsData&&detailsData.productBrandName || '--' }}</a-descriptions-item>
         <a-descriptions-item label="产品分类:">{{ productTypeName || '--' }}</a-descriptions-item>

+ 12 - 1
src/views/productManagement/productInfo/edit.vue

@@ -44,7 +44,17 @@
               v-model.trim="form.origCode"
               placeholder="请输入原厂编码(最多200个字符,多个编码用逗号隔开)"
               ref="origCode"
-              @keydown.enter.native="nextFocus('origCode', 'unit', $event)"
+              @keydown.enter.native="nextFocus('origCode', 'qrCode', $event)"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="条形码">
+            <a-input
+              id="productInfoEdit-qrCode"
+              :maxLength="100"
+              v-model.trim="form.qrCode"
+              placeholder="请输入条形码(最多100个字符)"
+              ref="code"
+              @keydown.enter.native="nextFocus('qrCode', 'unit', $event)"
               allowClear />
           </a-form-model-item>
           <a-form-model-item label="基本单位" prop="unit">
@@ -266,6 +276,7 @@ export default {
         name: '', // 产品名称
         code: '', //  产品编码
         origCode: '', //  原厂编码
+        qrCode:'', // 条形码
         unit: '', //  基本单位
         productBrandSn: undefined, //  产品品牌
         productTypeSn3: '', //  产品三级分类

+ 246 - 0
src/views/promotionManagement/promotionInfo/list.vue

@@ -0,0 +1,246 @@
+<template>
+  <a-card size="small" :bordered="false" class="jg-page-wrap promotionInfoList-wrap">
+    <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-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="发布时间">
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="促销名称">
+                <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="显示状态">
+                <a-select
+                  v-model="queryParam.showFlag"
+                  placeholder="请选择显示状态"
+                  allowClear
+                >
+                  <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.state"
+                  ref="sourceType"
+                  id="promotionInfoList-sourceType"
+                  code="PROMO_STATE"
+                  placeholder="请选择促销状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionInfoList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="promotionInfoList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 促销时间 -->
+        <template slot="promotionTime" slot-scope="text, record">
+          <span>{{ record.activeDateStart }}至{{ record.activeDateEnd }}</span>
+        </template>
+        <!-- 促销描述 -->
+        <template slot="desc" slot-scope="text, record">
+          <a-tooltip placement="rightBottom" v-if="record.description&&record.description.length>60">
+            <template slot="title">
+              <span>{{ record.description }}</span>
+            </template>
+            <div class="desc font1" @click="handleDescModal(record)">{{ record.description }}</div>
+          </a-tooltip>
+          <div v-else class="desc font1" @click="handleDescModal(record)">{{ record.description }}</div>
+        </template>
+        <!-- 状态 -->
+        <template slot="showStatus" slot-scope="text, record">
+          {{ record.showFlag == '1'?'已显示':'未显示' }}
+        </template>
+        <!-- 促销展示 -->
+        <template slot="salesShow" slot-scope="text, record">
+          <div @click="handleSaleShow(record)" v-if="record.contentType!='LINK'&&record.images && record.images.length>0">
+            <img :src="record.images[0]" alt="图片走丢啦" width="60" />
+          </div>
+          <div v-else-if="record.contentType=='LINK'&&record.images && record.images.length>0">
+            <img :src="record.images[0]" alt="图片走丢啦" width="60" />
+          </div>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
+    <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 { promoTerminalList } from '@/api/promoTerminal'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import promotionDescModal from './promotionDescModal'
+import promotionShowModal from './promotionShowModal'
+
+export default {
+  name: 'UrgentOffsetList',
+  components: { STable, VSelect, rangeDate, promotionDescModal, promotionShowModal },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      openDescModal: false, // 促销描述弹窗
+      openShowModal: false, // 促销展示弹窗
+      time: [],
+      queryParam: { //  查询条件
+        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: '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 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
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 查看促销描述
+    handleDescModal (row) {
+      this.descInfo = row.description
+      const _this = this
+      this.$nextTick(() => {
+        _this.openDescModal = true
+      })
+    },
+    // 促销展示
+    handleSaleShow (row) {
+      const _this = this
+      _this.openShowModal = true
+      this.$nextTick(() => {
+        _this.$refs.promotionShow.getDetail({ id: row.promoActiveSn, showType: row.contentType })
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = undefined
+      this.queryParam.endDate = undefined
+      this.queryParam.name = ''
+      this.queryParam.showFlag = undefined
+      this.queryParam.state = undefined
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 195
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 只刷新列表
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .promotionInfoList-wrap{
+    .red{
+      color: #ed1c24;
+    }
+    .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>

+ 66 - 0
src/views/promotionManagement/promotionInfo/promotionDescModal.vue

@@ -0,0 +1,66 @@
+<template>
+  <a-modal
+    centered
+    class="promotionDesc-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="500">
+    <div class="promotionDesc-con">
+      <p>{{ con }}</p>
+    </div>
+    <div class="btn-cont">
+      <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+export default {
+  name: 'PromotionDescModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    con: { //  弹框显示状态
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      modalTit: '促销描述',
+      isShow: this.openModal //  是否打开弹框
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .promotionDesc-modal{
+    .promotionDesc-con{
+       text-align: center;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 50px 0 0px;
+    }
+  }
+</style>

+ 114 - 0
src/views/promotionManagement/promotionInfo/promotionShowModal.vue

@@ -0,0 +1,114 @@
+<template>
+  <a-modal
+    centered
+    class="promotionDesc-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="500">
+    <div class="promotionDesc-con">
+      <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
+      <div class="promotionDescCon" v-if="showType=='IMAGE_CONTENT'" v-html="mainContent"></div>
+      <div class="promotionDescCon" v-if="showType=='VIDEO'&&mainContent" >
+        <video width="100%" height="auto" controls loop controlsList="nodownload">
+          <source :src="mainContent" type="video/mp4"></source>
+        </video>
+      </div>
+    </div>
+    <div class="btn-cont">
+      <!-- <a-button id="promotionDesc-modal-back" @click="isShow = false" style="margin-right:10px;">下载图片</a-button> -->
+      <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { promoTerminalDetail } from '@/api/promoTerminal'
+export default {
+  name: 'PromotionDescModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      modalTit: '促销展示',
+      isShow: this.openModal, //  是否打开弹框
+      mainContent: '', // 主要显示内容
+      showType: undefined//
+    }
+  },
+  methods: {
+    getDetail (con) {
+      const ajaxData = {
+        id: con.id
+      }
+      promoTerminalDetail(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.$nextTick(() => {
+            this.showType = res.data.contentType
+            this.mainContent = res.data.content
+          })
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.mainContent = ''
+        this.showType = undefined
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotionDesc-modal{
+    /deep/.ant-modal-body{
+       text-algin:center !important;
+    }
+
+    .promotionDesc-con{
+      width:340px;
+      margin:0 auto;
+      position:relative;
+      text-align: center;
+      img{
+         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;
+    }
+  }
+</style>