瀏覽代碼

Merge branch 'develop_cuxiao' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_cuxiao

lilei 1 年之前
父節點
當前提交
e43d3b3b2b

+ 19 - 6
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -232,6 +232,24 @@ export default {
         }
       })
     },
+    // 重置
+    resetSearchForm () {
+      this.form = {
+        title: '',
+        activeDate: undefined,
+        expenseDepartmentSn: undefined, // 费用所属部门
+        description: '', // 活动简称
+        content: '', // 活动描述
+        attachmentList: '', // 附件
+        dealerSnList: []// 参与客户
+      }
+      this.attachList = []
+      this.chooseDealerList = []
+      this.$nextTick(() => {
+        this.$refs.attachList.setFileList('')
+        this.$refs.ruleForm.resetFields()
+      })
+    },
     // 获取编辑详情
     getDetail () {
       dealerPromotionInfo({ sn: this.itemSn }).then(res => {
@@ -264,12 +282,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.attachList = []
-        this.chooseDealerList = []
-        this.$nextTick(() => {
-          this.$refs.attachList.setFileList('')
-          this.$refs.ruleForm.resetFields()
-        })
+        this.resetSearchForm()
       } else {
         if (this.itemSn) {
           this.getDetail()

+ 8 - 2
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -24,7 +24,7 @@
             <div>{{ detailData.description || '' }}</div>
           </a-descriptions-item>
           <a-descriptions-item label="附件" :span="2">
-            <div v-if="detailData.attachmentList&&detailData.attachmentList.length>0">
+            <div class="attachmentBox" v-if="detailData.attachmentList&&detailData.attachmentList.length>0">
               <a
                 class="link-bule"
                 target="downloadFile"
@@ -104,7 +104,7 @@
               id="promotionList-edit-btn">详情</a-button>
           </template>
         </s-table>
-        <div style="text-align:center;margin-top:20px;">
+        <div style="text-align:center;margin-top:20px;" v-if="$route.query.type=='rule'">
           <a-button type="primary" size="large" style="padding:0 30px;" @click="handleSubmit" :disabled="disabled">提交</a-button>
         </div>
       </a-card>
@@ -311,5 +311,11 @@ export default {
       margin-top: 5px;
       text-align: center;
     }
+    .attachmentBox>a::after{
+      content:','
+    }
+    .attachmentBox>a:last-child::after{
+      content:''
+    }
   }
 </style>

+ 10 - 12
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -18,10 +18,10 @@
             <a-col :md="5" :sm="24">
               <a-form-item label="发布状态">
                 <v-select
-                  v-model="queryParam.publishStatus"
-                  ref="publishStatus"
-                  id="promotionList-publishStatus"
-                  code="SPARE_PARTS_RETURN_REASON"
+                  v-model="queryParam.enabledFlag"
+                  ref="enabledFlag"
+                  id="promotionList-enabledFlag"
+                  code="NOTITY_SEND_STATUS"
                   placeholder="请选择发布状态"
                   allowClear></v-select>
               </a-form-item>
@@ -32,7 +32,7 @@
                   v-model="queryParam.state"
                   ref="state"
                   id="promotionList-state"
-                  code="SPARE_PARTS_RETURN_STATE"
+                  code="PROMOTION_STATE"
                   placeholder="请选择活动状态"
                   allowClear
                 ></v-select>
@@ -88,10 +88,11 @@
         <!-- 发布状态 -->
         <template slot="releaseStatus" slot-scope="text, record">
           <a-switch
-            v-if="record.state === 'NOT_START'||record.state ==='RUNNING'"
+            v-if="record.state === 'NOT_START'||record.state ==='RUNNING'||record.state ==='IS_OVER'"
             id="promotionList-enable"
             @change="changeStatus(record)"
             :checked="record.enabledFlag == 1 ? true : false"></a-switch>
+          <span v-else>--</span>
         </template>
         <!-- 操作 -->
         <!--  state 待提交:WAIT_SUBMIT 待审核:WAIT_AUDIT 未开始:NOT_START 进行中:RUNNING 审核不通过:AUDIT_REJECT 已结束:IS_OVER -->
@@ -185,18 +186,15 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
 import lookUpCustomersModal from '../promotionManagement/lookUpCustomersModal'
-// import detailModal from './detailModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import chooseDepartUserModal from './chooseDepartUserModal.vue'
 import editActiveEndTime from './editActiveEndTime.vue'
-import reportModal from '@/views/common/reportModal.vue'
 import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver } from '@/api/promotion'
 export default {
   name: 'PromotionManagementList',
   mixins: [commonMixin],
-  components: { STable, supplier, VSelect, reportModal, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime },
+  components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime },
   data () {
     return {
       spinning: false,
@@ -211,7 +209,7 @@ export default {
         beginDate: undefined,
         endDate: undefined,
         title: '',
-        publishStatus: undefined, // 发布状态
+        enabledFlag: undefined, // 发布状态
         state: undefined
       },
       columns: [
@@ -391,7 +389,7 @@ export default {
         beginDate: undefined,
         endDate: undefined,
         title: '',
-        publishStatus: undefined, // 发布状态
+        enabledFlag: undefined, // 发布状态
         state: undefined
       }
       this.$refs.rangeDate.resetDate()

+ 19 - 9
src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue

@@ -65,7 +65,11 @@
       :columns="columns"
       :data-source="dealerList"
       @change="handlePage"
-    ></a-table>
+    >
+      <template slot="addressInfo" slot-scope="text, record">
+        {{ record.provinceName }}{{ '-'+ record.cityName }}{{ '-'+ record.districtName }}
+      </template>
+    </a-table>
   </a-spin>
 </template>
 
@@ -114,14 +118,6 @@ export default {
       pageFlag: false,
       chooseInfo: [],
       selectedRowKeys: [],
-      columns: [
-        { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '所在区域', dataIndex: 'subareaArea.subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
       dealerList: [],
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
@@ -131,6 +127,20 @@ export default {
   computed: {
     selectCount () {
       return this.selectedRowKeys && this.selectedRowKeys.length
+    },
+    columns () {
+      const arr = [
+        { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所在区域', dataIndex: 'subareaArea.subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.pageType === 'dealerPromotion') {
+        arr.unshift({ title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '30%', align: 'center', ellipsis: true })
+      }
+      return arr
     }
   },
   methods: {