Jelajahi Sumber

Merge commit '483a1e69074a252d0bd95ac5430c0748fe47f771' into HEAD

gitadmin 8 bulan lalu
induk
melakukan
92484f23fc

+ 9 - 0
src/api/shopBanner.js

@@ -69,3 +69,12 @@ export const shopBannerExport = params => {
     }
   })
 }
+
+// 促销活动  设置轮播图
+export const updateSetShopBanner = (params) => {
+  return axios({
+    url: '/shopBanner/queryByBizSn',
+    data: params,
+    method: 'post'
+  })
+}

+ 16 - 0
src/api/shopPromoProduct.js

@@ -0,0 +1,16 @@
+import { axios } from '@/utils/request'
+
+// 促销活动  有分页
+export const shopPromoProductList = (params) => {
+  const url = `/shopPromoProduct/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}

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

@@ -3685,6 +3685,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/easyPassManagement/promotionalProducts',
+            redirect: '/easyPassManagement/promotionalProducts/list',
+            name: 'promotionalProducts',
+            component: BlankLayout,
+            meta: {
+              title: '促销产品',
+              icon: 'file-ppt',
+              permission: 'M_promoProduct'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'promoProductList',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/promotionalProducts/list.vue'),
+                meta: {
+                  title: '促销产品列表',
+                  icon: 'file-ppt',
+                  hidden: true,
+                  permission: 'M_promoProductList'
+                }
+              }
+            ]
+          },
           {
             path: '/easyPassManagement/homepageCarouselImg',
             redirect: '/easyPassManagement/homepageCarouselImg/list',

+ 20 - 10
src/views/easyPassManagement/homepageCarouselImg/edit.vue

@@ -115,7 +115,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-              <a-form-model-item label="内容" prop="contentEditor" v-show="form.contentType =='IMAGE_CONTENT'">
+              <a-form-model-item label="内容" class="contentBox" v-show="form.contentType =='IMAGE_CONTENT'">
                 <editor
                   v-show="!isDisabled"
                   id="carouselImageEdit-editor"
@@ -125,7 +125,7 @@
                   :cache="false"></editor>
                 <div style="border:1px solid #efefef;border-radius:8px;padding:10px 20px;" v-if="isDisabled" v-html="form.content"></div>
               </a-form-model-item>
-              <a-form-model-item label="上传视频" prop="content" v-show="form.contentType =='VIDEO'">
+              <a-form-model-item label="上传视频" prop="content" v-if="form.contentType =='VIDEO'">
                 <Upload
                   class="upload"
                   id="carouselImageEdit-videoSet"
@@ -223,8 +223,7 @@ export default {
         imageUrl: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
         contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
         content: [{ required: true, message: '请选择视频展示', trigger: ['blur', 'change'] }],
-        contentLink: [{ required: true, message: '请输入跳转链接', trigger: ['blur', 'change'] }],
-        contentEditor: [{ required: true, message: '请输入图文内容', trigger: ['blur', 'change'] }]
+        contentLink: [{ required: true, message: '请输入跳转链接', trigger: ['blur', 'change'] }]
       }
     }
   },
@@ -303,7 +302,6 @@ export default {
             _this.form.contentEditor = res.data.content
             _this.form.time = [res.data.bannerStartDate, res.data.bannerEndDate]
           })
-          console.log('22222222222222:', _this.form)
         }
       })
     },
@@ -314,9 +312,8 @@ export default {
         _this.form.content = _this.form.contentLink
       }
       if (_this.form.contentType === 'IMAGE_CONTENT') {
-        _this.form.content = _this.form.contentEditor
+        _this.form.content = _this.form.contentEditor ? _this.form.contentEditor : _this.form.content
       }
-      console.log('11111111111:', _this.form)
       // 验证组件必填项
       _this.$refs.ruleForm.validate(valid => {
         if (valid) {
@@ -334,6 +331,10 @@ export default {
         }
         _this.form.dealerSnList = _this.chooseDealerList.map(con => con.dealerSn)
       }
+      if (_this.form.contentType === 'IMAGE_CONTENT' && !_this.form.contentEditor) {
+        _this.$message.warning('请输入图文内容!')
+        return
+      }
       _this.form.bannerSn = _this.$route.params.sn || undefined
       var formData = JSON.parse(JSON.stringify(_this.form))
       delete formData.time
@@ -364,9 +365,6 @@ export default {
     //  文本编辑器
     editorChange (html, text) {
       this.form.contentEditor = html
-      if (html) {
-        this.$refs.ruleForm.clearValidate('contentEditor')
-      }
     },
     // 重置
     resetSearchForm () {
@@ -457,6 +455,18 @@ export default {
         z-index: 0;
       }
     }
+    //图文必填标志显示
+  .contentBox {
+      /deep/.ant-form-item-label label::before{
+        display:inline-block;
+        margin-right: 4px;
+        color: #f5222d !important;
+        font-size: 12px;
+        font-family: SimSun, sans-serif;
+        line-height: 1;
+        content: '*';
+      }
+    }
     .buyerBox{
       border:1px solid #d9d9d9;
       margin-top:10px;

+ 9 - 5
src/views/easyPassManagement/promotionalActivities/edit.vue

@@ -116,7 +116,6 @@
                   id="promotion-dealerOpenFlag"
                   code="FLAG"
                   showType="radio"
-                  :disabled="true"
                   allowClear></v-select>
               </a-form-model-item>
             </a-col>
@@ -457,13 +456,16 @@ export default {
     // 添加产品成功
     addProductSuccess (list) {
       const productArr = list.map(item => {
-        return {
+        const obj = {
           promoSn: this.form.promoSn,
           shopProductSn: item.shopProductSn,
           productSn: item.productSn,
-          productCode: item.productCode,
-          conditionValue: item.conditionValue ? item.conditionValue : item.shopProductPrice
+          productCode: item.productCode
         }
+        if (this.pageType === 'PROMO_PROD') {
+          obj.conditionValue = item.conditionValue ? item.conditionValue : item.shopProductPrice
+        }
+        return obj
       })
       saveChooseProduct(productArr).then(res => {
         if (res.status == 200) {
@@ -472,10 +474,12 @@ export default {
             // 获取产品列表 有分页
             this.$refs.chooseProductList.pageInit()
           } else {
+            const tipArr = res.data ? res.data.split(';') : []
+            const newTipArr = tipArr.filter(item => { return item != '' })
             const _this = this
             this.$confirm({
               title: '提示',
-              content: res.data,
+              content: newTipArr.map((item, i) => { return <p>{i * 1 + 1}、{item}</p> }),
               centered: true,
               okText: '知道了',
               cancelText: '取消', // 将cancelText设置为空字符串或去掉该属性可以隐藏取消按钮

+ 38 - 8
src/views/easyPassManagement/promotionalActivities/list.vue

@@ -52,7 +52,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator" v-if="$hasPermissions('B_promoActivitiesAdd')">
-          <!-- <a-button type="primary" class="button-info" id="promotion-add1-btn" @click="handleEdit('BUY_PROD_GIVE_PROD')">买产品送产品</a-button> -->
+          <a-button type="primary" class="button-info" id="promotion-add1-btn" @click="handleEdit('BUY_PROD_GIVE_PROD')">买产品送产品</a-button>
           <a-button type="primary" class="button-info" id="promotion-add2-btn" @click="handleEdit('PROMO_PROD')">特价产品</a-button>
           <a-button type="primary" class="button-info" id="promotion-add3-btn" @click="handleEdit('BUY_PROD_GIVE_VALID')">买产品返代金券</a-button>
         </div>
@@ -108,14 +108,14 @@
                 type="link"
                 class="button-warning"
                 :id="'promotion-abandon-btn-'+record.id"
-                v-if="(record.promoState=='HAVE_RELEASE') && $hasPermissions('B_promoActivitiesAbandon')"
+                v-if="record.promoState=='HAVE_RELEASE'&&record.dealerOpenFlag=='0'&& $hasPermissions('B_promoActivitiesAbandon')"
                 @click="handleAbandon(record)">废弃</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-warning"
                 :id="'promotion-img-btn-'+record.id"
-                v-if="(record.promoState=='HAVE_RELEASE') && $hasPermissions('B_promoActivitiesImg')"
+                v-if="record.promoState=='HAVE_RELEASE'&&record.dealerOpenFlag=='0'&& $hasPermissions('B_promoActivitiesImg')"
                 @click="handleSet(record)">轮播图</a-button>
               <a-button
                 size="small"
@@ -150,12 +150,14 @@
           <a-icon type="question-circle" :style="{fontSize:'20px',color:'#faad14'}"/>
           <div style="margin-left:10px;margin-top:-3px;">
             <p style="font-size:16px;font-wight:bold;">设置</p>
-            <p>确定设为首页轮播图吗?</p>
+            <p v-if="itemFlag=='1'">确定设为首页轮播图吗?</p>
+            <p v-else>已有轮播图,不可再次生成</p>
           </div>
         </div>
         <!-- 按钮 -->
         <div style="text-align: right;">
           <a-button
+            v-if="itemFlag=='1'"
             id="auditModal-cancel"
             type="primary"
             @click="handleSetModal('0')"
@@ -165,7 +167,14 @@
             id="auditModal-save"
             class="button-info"
             @click="handleSetModal('1')"
+            v-if="itemFlag=='1'"
           >确定</a-button>
+          <a-button
+            v-else
+            type="primary"
+            id="auditModal-close"
+            @click="handleSetModal('0')"
+          >知道了</a-button>
         </div>
       </a-modal>
     </a-card>
@@ -181,6 +190,7 @@ import lookUpCustomersModal from './lookUpCustomersModal'
 import detailModal from './detailModal'
 // 接口
 import { shopPromoActiveList, shopPromoDel, shopPromoRelease, shopPromoDiscard, updateShopBanner } from '@/api/shopPromo'
+import { updateSetShopBanner } from '@/api/shopBanner'
 
 export default {
   name: 'PromotionalActivitiesList',
@@ -205,6 +215,7 @@ export default {
       },
       itemId: '', // 当前活动sn
       itemObj: null, // 促销活动当前行信息
+      itemFlag: null, // 设置轮播图显示弹窗按钮
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -232,8 +243,8 @@ export default {
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '18%', align: 'center' },
         { title: '参与经销商', scopedSlots: { customRender: 'joinCustomers' }, width: '8%', align: 'center' },
         { title: '促销类型', dataIndex: 'promoTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '加盟商编辑', dataIndex: 'dealerEditFlag', width: '6%', align: 'center', customRender: function (text) { return (text ? text == '1' ? '是' : '否' : '--') } },
-        { title: '首页轮播图', dataIndex: 'shopBannerFlag', width: '6%', align: 'center', customRender: function (text) { return (text ? text == '1' ? '是' : '否' : '--') } },
+        { title: '加盟商开关权限', dataIndex: 'dealerOpenFlag', width: '8%', align: 'center', customRender: function (text) { return (text ? text == '1' ? '是' : '否' : '--') } },
+        // { title: '首页轮播图', dataIndex: 'shopBannerFlag', width: '6%', align: 'center', customRender: function (text) { return (text ? text == '1' ? '是' : '否' : '--') } },
         { title: '促销状态', dataIndex: 'promoStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
       ]
@@ -311,6 +322,7 @@ export default {
       this.queryParam.promoName = ''
       this.queryParam.promoType = undefined
       this.queryParam.promoState = undefined
+      this.itemFlag = null
       this.$refs.table.refresh(true)
     },
     // 促销发布
@@ -337,13 +349,31 @@ export default {
     // 打开 设置轮播图弹窗
     handleSet (row) {
       this.itemObj = row
-      this.openSetImgModal = true
+      this.spinning = true
+      updateSetShopBanner({ bizSn: row.promoSn, stateList: ['UNPUBLISH', 'PUBLISH', 'CLOSE'] }).then(res => {
+        if (res.status == 200) {
+          this.itemFlag = res.data && Object.keys(res.data).length > 0 ? '0' : '1'
+          this.openSetImgModal = true
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
     },
     // 设置轮播图
     handleSetModal (val) {
+      const _this = this
+      if (val === '1') {
+        _this.setImage()
+      } else {
+        _this.openSetImgModal = false
+      }
+    },
+    // 设置轮播图
+    setImage (val) {
       const _this = this
       _this.spinning = true
-      updateShopBanner({ promoSn: _this.itemObj.promoSn, shopBannerFlag: val }).then(res => {
+      updateShopBanner({ promoSn: _this.itemObj.promoSn, shopBannerFlag: 1 }).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.$refs.table.refresh()

+ 2 - 0
src/views/easyPassManagement/promotionalActivities/productTable.vue

@@ -21,6 +21,7 @@
             :step="1"
             :precision="0"
             :max="99999999"
+            style="width:90%;"
             @blur="editProductVal(record,'conditionValue')"
             placeholder="请输入"
             v-model="record.conditionValue"
@@ -129,6 +130,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              console.log('11111111:', this.activeType)
               if (this.activeType === 'PROMO_PROD') {
                 data.list[i].conditionValue = data.list[i].conditionValue ? data.list[i].conditionValue : data.list[i].shopProductPrice
               }

+ 313 - 0
src/views/easyPassManagement/promotionalProducts/list.vue

@@ -0,0 +1,313 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="promoProducts-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" id="promoProducts-form" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码/原厂编码">
+                <a-input id="promoProducts-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码/原厂编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="promoProducts-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="品牌">
+                <productBrand id="promoProducts-productBrandSn" v-model="queryParam.productBrandSn"></productBrand>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <productType id="promoProducts-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></productType>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="促销名称">
+                  <a-input id="promoProducts-promoName" v-model.trim="queryParam.promoName" allowClear placeholder="请输入促销名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="促销类型">
+                  <v-select
+                    v-model="queryParam.promoType"
+                    ref="promotionType"
+                    id="promoProducts-promoType"
+                    code="SHOP_PROMO_PROMO_TYPE"
+                    placeholder="请选择促销类型"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="促销状态">
+                  <v-select
+                    v-model="queryParam.promoState"
+                    ref="promoState"
+                    id="promoProducts-promoState"
+                    :notIn="['HAVE_DISCARD','IS_OVER']"
+                    code="SHOP_PROMO_PROMO_STATE"
+                    placeholder="请选择促销状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="商城类目">
+                  <a-cascader
+                    id="promoProducts-category"
+                    expandTrigger="hover"
+                    :changeOnSelect="true"
+                    :fieldNames="fieldNames"
+                    :options="categoryOptions"
+                    placeholder="请选择商城类目"
+                    @change="changeProductsCategory"
+                    allowClear
+                    v-model="category"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="商城状态">
+                  <v-select code="SHOP_PRODUCT_STATUS" id="promoProducts-status" v-model="queryParam.shopProductStatus" allowClear placeholder="请选择商城状态"></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promoProducts-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="promoProducts-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="merchantInfoManagementList-advanced">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :pageSize="20"
+          :scroll="{ y: tableHeight - 20 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            {{ record.productCode }}
+          </template>
+          <!-- 产品分类 -->
+          <template slot="productType" slot-scope="text, record">
+            <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 促销时间 -->
+          <template slot="promoTime" slot-scope="text, record">
+            <span v-if="record.promoStartDate">{{ record.promoStartDate }} 至 {{ record.promoEndDate }}</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 活动规则 -->
+          <template slot="promoRules" slot-scope="text, record">
+            <span v-if="record.promoType==='BUY_PROD_GIVE_PROD'&&record.conditionValue&&record.resultValue">买{{ record.conditionValue }}赠{{ record.resultValue }}</span>
+            <div v-else-if="record.promoType==='PROMO_PROD'&&(record.shopProductPrice||record.shopProductPrice ==0)&&(record.conditionValue||record.conditionValue==0)">
+              <span v-if="record.shopProductPrice - record.conditionValue>0">优惠{{ (record.shopProductPrice - record.conditionValue).toFixed(2) }}元</span>
+              <span v-else style="color:#ED1C24;">优惠{{ (record.shopProductPrice - record.conditionValue).toFixed(2) }}元</span>
+            </div>
+            <span v-else-if="record.promoType==='BUY_PROD_GIVE_VALID'&&record.resultValue">返{{ record.resultValue ? record.resultValue.toFixed(2):'--' }}元</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 促销售价 -->
+          <template slot="promoPrice" slot-scope="text, record">
+            <span v-if="record.promoType==='BUY_PROD_GIVE_PROD'&&record.shopProductPrice">{{ record.shopProductPrice ?record.shopProductPrice.toFixed(2):'--' }}</span>
+            <span v-else-if="record.promoType==='PROMO_PROD'&&record.conditionValue">{{ record.conditionValue?record.conditionValue.toFixed(2):'--' }}</span>
+            <span v-else-if="record.promoType==='BUY_PROD_GIVE_VALID'&&record.shopProductPrice">{{ record.shopProductPrice?record.shopProductPrice.toFixed(2):'--' }}</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 商城类目 -->
+          <template slot="categoryName" slot-scope="text, record">
+            <span v-if="record.indName || record.dirName">{{ record.indName }} {{ (record.indName&&record.dirName) ? '>' : '' }} {{ record.dirName }}</span>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import productType from '@/views/common/productType.js'
+import productBrand from '@/views/common/productBrand.js'
+// 接口
+import { shopPromoProductList } from '@/api/shopPromoProduct'
+import { queryExtList } from '@/api/shopProduct'
+export default {
+  name: 'PromoProductsList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, productType, productBrand },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      // form表单label布局
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      productType: [], // 产品分类
+      // 查询条件
+      queryParam: {
+        productName: '', // 产品名称
+        productCode: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        promoName: '', // 促销名称
+        promoType: undefined, // 促销状态
+        promoState: undefined, // 促销状态
+        categorySn: undefined, // 商城类目
+        shopProductStatus: undefined, // 商城状态
+        shopProductDelFlag: 0, // 促销产品标志
+        promoStateList: ['NOT_RELEASE', 'HAVE_RELEASE']// 促销列表只查询这两种状态
+      },
+      categoryOptions: [], // 产品类目列表
+      fieldNames: { label: 'categoryName', value: 'categorySn', children: 'shopCategoryList' },
+      category: [], // 类目val
+      columns: [
+        { title: '序号', dataIndex: 'no', align: 'center', width: '50px' },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', scopedSlots: { customRender: 'productCode' } },
+        { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', align: 'center', width: '15%', scopedSlots: { customRender: 'productType' } },
+        { title: '促销名称', dataIndex: 'promoName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '促销时间', dataIndex: 'promoStartDate', align: 'center', width: '16%', scopedSlots: { customRender: 'promoTime' } },
+        { title: '促销类型', dataIndex: 'promoTypeDictValue', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '活动规则', align: 'center', width: '10%', scopedSlots: { customRender: 'promoRules' } },
+        { title: '促销状态', dataIndex: 'promoStateDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '促销售价', width: '8%', align: 'right', scopedSlots: { customRender: 'promoPrice' } },
+        { title: '商城类目', scopedSlots: { customRender: 'categoryName' }, width: '15%', align: 'center' },
+        { title: '商城状态', dataIndex: 'shopProductStatusDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return shopPromoProductList(params).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
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 获取产品类目列表
+    getCategoryList () {
+      const _this = this
+      _this.spinning = true
+      queryExtList({}).then(res => {
+        if (res.status == 200) {
+          this.categoryOptions = res.data || []
+        }
+        _this.spinning = false
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.promoName = ''
+      this.queryParam.promoType = undefined
+      this.queryParam.promoState = undefined
+      this.queryParam.shopProductStatus = undefined
+      this.queryParam.categorySn = undefined
+      this.queryParam.shopProductDelFlag = 0
+      this.queryParam.promoStateList = ['NOT_RELEASE', 'HAVE_RELEASE']
+      this.productType = []
+      this.category = []
+      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] : ''
+    },
+    // 商城类目
+    changeProductsCategory (val) {
+      this.queryParam.categorySn = (val[0] && val[1]) ? val[1] : (val[0] && !val[1]) ? val[0] : undefined
+    },
+    // 初始化
+    pageInit () {
+      const _this = this
+      _this.getCategoryList()
+      _this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 200
+    }
+  },
+  watch: {
+    // 展开关闭  监听表格高度变化
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.124:8602/ocs-admin',
+        target: 'http://192.168.2.100:89/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {