소스 검색

Merge branch 'master' into pengyouhao_dev

pengyh 1 년 전
부모
커밋
065669bd57
2개의 변경된 파일95개의 추가작업 그리고 10개의 파일을 삭제
  1. 9 0
      public/index.html
  2. 86 10
      src/views/mallManagement/setActivity/index.vue

+ 9 - 0
public/index.html

@@ -31,6 +31,15 @@
         s.parentNode.insertBefore(hm, s);
       })();
     }
+    if (!!~window.location.href.indexOf("jxgree.zfire.top")) {
+      var _hmt = _hmt || [];
+      (function() {
+        var hm = document.createElement("script");
+        hm.src = "https://hm.baidu.com/hm.js?158171d714ae89f3d40f9e31cc8c6545";
+        var s = document.getElementsByTagName("script")[0]; 
+        s.parentNode.insertBefore(hm, s);
+      })();
+    }
   </script>
   <title>
     <%= webpackConfig.name %>

+ 86 - 10
src/views/mallManagement/setActivity/index.vue

@@ -1,7 +1,7 @@
 <template>
   <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
     :table-events="tableEvents" :options-evens-group="optionsEvensGroup"
-    :column-parsing="columnParsing" :operation="operation()" :operationColumnWidth="200">
+    :column-parsing="columnParsing" :operation="operation()" :operationColumnWidth="200" :moreParameters="moreParameters">
     <div class="cartographer">
       <el-dialog :title="formData.id?'详情':'新增'" width="100%" :modal="false" :visible.sync="formDialog"
         :before-close="formCancel">
@@ -70,6 +70,31 @@ export default {
     }
   },
   computed:{
+    moreParameters() {
+      return [
+        {
+          name: '状态',
+          key: 'status',
+          value: '',
+          conditions: [{
+            label: "生效中",
+            value: "1"
+          },{
+            label: "待生效",
+            value: "0"
+          },{
+            label: "已过期",
+            value: "2"
+          },{
+            label: "已终止",
+            value: "3"
+          },{
+            label: "全部",
+            value: ""
+          }]
+        }
+      ]
+    },
     // 事件组合
     optionsEvensGroup() {
       return [
@@ -98,11 +123,21 @@ export default {
             style: { width: '100%' },
             placeholder: '请选择',
             'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                return time.getTime() < (Date.now() - 86400000)
+              }
+            }
           },
           formItemAttributes: {
             label: '活动开始日期',
             prop: 'startTime',
             rules: [{ required: true, message: '请选择', trigger: 'blur' }]
+          },
+          events:{
+            change: ()=>{
+              this.formData.endTime = ''
+            }
           }
         },
         {
@@ -113,6 +148,14 @@ export default {
             style: { width: '100%' },
             placeholder: '请选择',
             'value-format': 'yyyy-MM-dd HH:mm:ss',
+            'picker-options': {
+              disabledDate: time => {
+                if(this.formData.startTime){
+                  return time.getTime() < (new Date(this.formData.startTime)).getTime()
+                }
+                return true
+              }
+            }
           },
           formItemAttributes: {
             label: '活动结束日期',
@@ -374,11 +417,25 @@ export default {
                         <div style="padding:6px;">
                           <div style="font-weight:bold;">{row.isRequire?<span style="color:red">*</span> : null}{index+1}、{row.question}({['单选','多选','填写','图片','视频'][row.type-1]})</div>
                           {[
-                          <div>
-                            {row.answer.map(item=><el-radio disabled label="">{item.option_value}</el-radio>)}
+                          <div style="display: flex">
+                            {row.answer.map(item=>{
+                              return <div style="margin-right:10px">
+                                <el-radio disabled label="">{item.option_value}</el-radio>
+                                <div>
+                                  {item.option_files.map(v => <el-image src={v.url} preview-src-list={[v.url]} fit="fit" style="width:80px;height:80px;" />)}
+                                </div>
+                              </div>
+                            })}
                           </div>,
-                          <div>
-                            {row.answer.map(item=><el-checkbox disabled label="">{item.option_value}</el-checkbox>)}
+                          <div style="display: flex">
+                            {row.answer.map(item=>{
+                              return <div style="margin-right:10px">
+                                <el-checkbox disabled label="">{item.option_value}</el-checkbox>
+                                <div>
+                                  {item.option_files.map(v => <el-image src={v.url} preview-src-list={[v.url]} fit="fit" style="width:80px;height:80px;" />)}
+                                </div>
+                              </div>
+                            })}
                           </div>,
                           <div>
                             <el-input disabled placeholder="请输入内容"></el-input>
@@ -440,11 +497,24 @@ export default {
     columnParsing(item, defaultData) {
       if (item.jname === 'qrcode') {
 				defaultData.render = (h, { row, index, column }) => {
-					return (
-						<div style="padding:0 6px;cursor: pointer;">
-							{row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-						</div>
-					)
+          return (
+            <div style="padding:0 6px;cursor: pointer;">
+              {row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+            </div>
+          )
+          //if(!!~[0, 2].indexOf(row.status) || !!~['待生效','生效中'].indexOf(row.statusText)){
+          //  return (
+          //    <div style="padding:0 6px;cursor: pointer;">
+          //      {row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+          //    </div>
+          //  )
+          //}else{
+          //  return (
+          //    <div style="padding:0 6px;cursor: pointer;opacity: 0.3;">
+          //      {row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} fit="fit" style="width:80px;height:80px;" />) : null}
+          //    </div>
+          //  )
+          //}
 				}
 			}
       if (item.jname == 'startTime') {
@@ -494,6 +564,9 @@ export default {
           }
         },
         createActivity: {
+          conditions: ({ row, index, column }) => {
+            return !!~[0, 2].indexOf(row.status) || !!~['待生效','生效中'].indexOf(row.statusText)
+          },
           click: ({ row, index, column }) => {
             this.$router.push({
               name: "activityOrder",
@@ -584,6 +657,9 @@ export default {
         this.formData.promotionQuestionnaireItems.splice(data.rowIndex, 1, {...data})
       }
       this.questionClose()
+      this.$nextTick(()=>{
+        this.$refs.formRef.validateField(["promotionQuestionnaireItems"], (v) => {})
+      })
     }
   }
 }