chenrui %!s(int64=2) %!d(string=hai) anos
pai
achega
eb6d90c3d8

+ 5 - 0
src/views/promotionRulesManagement/promotionManagement/addModal.vue

@@ -25,6 +25,7 @@
             style="width:100%"
             v-model="form.time"
             :format="dateFormat"
+            :disabled-date="disabledDate"
             @change="dateChange"
             :placeholder="['开始时间', '结束时间']" />
         </a-form-model-item>
@@ -84,6 +85,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { promoTerminalSave, promoTerminalDetail } from '@/api/promoTerminal'
 import chooseDealer from './chooseDealer'
+import moment from 'moment'
 export default {
   name: 'PromotionAddModal',
   mixins: [commonMixin],
@@ -132,6 +134,9 @@ export default {
     }
   },
   methods: {
+    disabledDate (current) {
+      return current && current < moment().startOf('day')
+    },
     handleDealerModal () {
       this.openDealerModal = true
       this.handleDealer()

+ 15 - 9
src/views/promotionRulesManagement/promotionManagement/editModal.vue

@@ -85,16 +85,16 @@
               v-if="pageType==='add'"
               class="upload"
               id="promotionEdit-imageSet"
-              v-model="videoPath"
+              v-model="form.content"
               fileType="video/mp4"
               ref="imageSet"
-              :fileSize="10"
+              :fileSize="1024"
               :maxNums="1"
               @change="changeVideo"
               listType="picture-card"></Upload>
             <div v-else>
-              <video width="100" height="100">
-                <source :src="videoPath" type="video/mp4"></source>
+              <video width="100" height="100" controls loop controlsList="nodownload">
+                <source :src="form.content" type="video/mp4"></source>
               </video>
             </div>
             <span class="upload-desc">说明:文件最大1G;视频:mp4.avi.flv</span>
@@ -134,7 +134,8 @@
         <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-right:15px;">取消</a-button>
         <a-button
           style="margin-right:15px;color: #fff;background-color: #39f;border-color: #39f;"
-          @click="handleSee" v-if="form.contentType !='LINK'">预览</a-button>
+          @click="handleSee"
+          v-if="form.contentType !='LINK'">预览</a-button>
         <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">确定</a-button>
       </div>
     </div>
@@ -145,7 +146,6 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import moment from 'moment'
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
 import { saveActive, promoTerminalDetail } from '@/api/promoTerminal'
@@ -153,7 +153,7 @@ import promotionShowModal from './promotionShowModal'
 export default {
   name: 'ProductBrandEditModal',
   mixins: [commonMixin],
-  components: { VSelect, Upload, Editor ,promotionShowModal},
+  components: { VSelect, Upload, Editor, promotionShowModal },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -192,6 +192,7 @@ export default {
         sort: undefined
       },
       images: [],
+      openShowModal: false,
       rules: {
         title: [
           { required: true, message: '请输入标题名称', trigger: 'blur' }
@@ -220,7 +221,12 @@ export default {
   methods: {
     // 预览
     handleSee () {
-      this.$refs.showModal.pageInit({type:this.form.contentType,con:this.form.content})
+      if (this.form.content) {
+        this.openShowModal = true
+        this.$refs.showModal.pageInit({ type: this.form.contentType, con: this.form.content })
+      } else {
+        this.$message.error('请输入预览内容!')
+      }
     },
     onChange (e) {
       console.log('radio checked', e.target.value)
@@ -241,7 +247,7 @@ export default {
           if (res.data.contentType == 'IMAGE_CONTENT') {
             this.$refs.editor.setHtml(res.data.content)
           } else if (res.data.contentType == 'VIDEO') {
-            this.videoPath = res.data.content
+            this.content = res.data.content
           }
         }
       })

+ 6 - 2
src/views/promotionRulesManagement/promotionManagement/list.vue

@@ -78,6 +78,7 @@
             unCheckedChildren="隐藏"
             id="promotion-isEnable"
             v-model="record.isEnable"
+            :disabled="record.state!='PUBLISH'"
             @change="changeFlagHandle(record)" />
         </template>
         <!-- 促销时间 -->
@@ -94,7 +95,10 @@
         </template>
         <!-- 促销展示 -->
         <template slot="salesShow" slot-scope="text, record">
-          <div @click="handleSaleShow(record)" v-if="record.imageSet && record.imageSet.length>0">
+          <div @click="handleSaleShow(record)" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
+            <img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
+          </div>
+          <div v-else-if="record.contentType=='LINK'&&record.imageSet && record.imageSet.length>0">
             <img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
           </div>
           <span v-else>--</span>
@@ -249,7 +253,7 @@ export default {
     handleSaleShow (record) {
       this.openShowModal = true
       this.$nextTick(() => {
-        this.$refs.showModal.getDetail({ sn: record.promoActiveSn })
+        this.$refs.showModal.pageInit({ type: record.contentType, con: record.content })
       })
     },
     // 修改显示状态

+ 24 - 15
src/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal.vue

@@ -26,7 +26,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="经销商名称">
-                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入经销商名称"/>
+                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -56,6 +56,10 @@
           :scroll="{ y: 450 }"
           :rowClassName="(record, index) => record.checkProfitLossQty < 0 ? 'redBg-row':''"
           bordered>
+          <!-- 地区 -->
+          <template slot="address" slot-scope="text, record">
+            {{ record.provinceName }}{{ record.cityName }}{{ record.districtName }}{{ record.address }}
+          </template>
         </s-table>
       </a-card>
       <div class="btn-cont">
@@ -67,7 +71,6 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { hdPrint } from '@/libs/JGPrint.js'
 import { STable } from '@/components'
 import ProductType from '@/views/common/productType.js'
 import subarea from '@/views/common/subarea.js'
@@ -94,12 +97,14 @@ export default {
       exportShow: false,
       exportLoading: false,
       queryParam: {
-        subareaSn: undefined,
-        subareaAreaSn: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        dealerSn: undefined
+        dealerName: undefined
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -123,6 +128,7 @@ export default {
       basicInfoData: null, //  基本信息
       productTotal: null,
       productType: [],
+      snObj: undefined, // 经销商列表
       warehouseList: [], //  仓库  下拉数据
       localDataSource: [],
       isPrice: false, //  仅显示盈亏
@@ -131,9 +137,9 @@ export default {
       printerType: 'NEEDLE', //  打印机类型
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '地区', dataIndex: 'address', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '区域', dataIndex: 'subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '地区', scopedSlots: { customRender: 'address' }, width: '20%', align: 'center', ellipsis: true },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '经销商名称', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '商户类型', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
@@ -147,23 +153,26 @@ export default {
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
     subareaChange (val) {
-      this.queryParam.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
     pageInit (data) {
+      this.snObj = data
       this.queryParam = Object.assign(this.queryParam, data)
       this.$refs.table.refresh(true)
     },
     //  重置
     resetSearchForm () {
-      this.queryParam = {
+      this.queryParam = Object.assign({
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        subareaSn: undefined,
-        subareaAreaSn: undefined
-      }
-      this.queryParam.dealerSn = undefined
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        }
+      }, this.snObj)
+      this.queryParam.dealerName = undefined
       this.$refs.areaList.clearData()
       this.$refs.subarea.clearData()
       this.$refs.table.refresh(true)

+ 12 - 10
src/views/promotionRulesManagement/promotionManagement/promotionShowModal.vue

@@ -10,7 +10,12 @@
     :width="500">
     <div class="promotionDesc-con">
       <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
-      <div class="promotionDescCon" v-html="mainContent"></div>
+      <div class="promotionDescCon" v-show="showType==='IMAGE_CONTENT'" v-html="mainContent"></div>
+      <div class="promotionDescCon" v-show="showType=='VIDEO'" >
+        <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> -->
@@ -35,19 +40,15 @@ export default {
     return {
       modalTit: '促销展示',
       isShow: this.openModal, //  是否打开弹框
-      mainContent: ''
+      mainContent: '', // 主要显示内容
+      showType: undefined//
     }
   },
   methods: {
-    getDetail (con) {
-      promoTerminalDetail(con).then(res => {
-        if (res.status == 200) {
-          this.mainContent = res.data.content
-        }
-      })
-    },
     pageInit (con) {
-      this.mainContent = con
+      console.log('11111111:',con)
+      this.showType = con.type
+     this.mainContent = con.con
     }
   },
   watch: {
@@ -75,6 +76,7 @@ export default {
       width:340px;
       margin:0 auto;
       position:relative;
+      text-align: center;
       img{
          width:81%;
          height:auto;