Browse Source

优惠卷 禅道问题修改

changhaoning 1 năm trước cách đây
mục cha
commit
5a5b616bb3

+ 1 - 0
src/api/pages/mst/coupon.js

@@ -16,5 +16,6 @@ export default {
  */
 export const routeUrl = {
   coupon:{
+    check:{key:'check',routeName:'coupon-view',chooseFlag:true},
   }
 }

+ 20 - 0
src/api/pages/mst/couponReceive.js

@@ -0,0 +1,20 @@
+/**
+ * @desc   : 优惠券获取服务
+ * @author : 常皓宁
+ * @date   : 2024/5/7 14:10
+ */
+export default {
+  couponReceiveService:{
+    prefix: '/mdm-server/mst/couponReceive/',
+  }
+}
+
+/**
+ * @desc   : 优惠券获取
+ * @author : 常皓宁
+ * @date   : 2024/5/7 14:10
+ */
+export const routeUrl = {
+  couponReceive:{
+  }
+}

+ 20 - 0
src/api/pages/mst/couponSend.js

@@ -0,0 +1,20 @@
+/**
+ * @desc   : 优惠券发出服务
+ * @author : 常皓宁
+ * @date   : 2024/5/7 14:10
+ */
+export default {
+  couponSendService:{
+    prefix: '/mdm-server/mst/couponSend/',
+  }
+}
+
+/**
+ * @desc   : 优惠券发出路由
+ * @author : 常皓宁
+ * @date   : 2024/5/7 14:10
+ */
+export const routeUrl = {
+  couponSend:{
+  }
+}

+ 20 - 0
src/api/pages/mst/couponUse.js

@@ -0,0 +1,20 @@
+/**
+ * @desc   : 优惠券使用服务
+ * @author : 常皓宁
+ * @date   : 2024/5/7 14:10
+ */
+export default {
+  couponUseService:{
+    prefix: '/mdm-server/mst/couponUse/',
+  }
+}
+
+/**
+ * @desc   : 优惠券使用路由
+ * @author : 常皓宁
+ * @date   : 2024/5/7 14:10
+ */
+export const routeUrl = {
+  couponUse:{
+  }
+}

+ 9 - 0
src/locale/lang/zh-CN.js

@@ -618,6 +618,15 @@ export const columns = {
   integral:'积分',
   signDays:'连续签到天数',
   lastDate:'最近签到日期',
+  couponInfo:'优惠卷介绍',
+  couponReceive:'优惠券获取',
+  couponSend:'优惠券发出',
+  couponUse:'优惠券使用',
+  sendDate:'发出时间',
+  receiveDate:'获取日期',
+  useDate:'核销日期',
+  couponStatusName:'优惠券状态',
+  assistDate:'助力日期',
 }
 
 /**

+ 6 - 3
src/view/mst/company/form.vue

@@ -36,7 +36,7 @@
             <InputPop ref="wxMaxNum" v-model="formData.wxMaxNum" :readonly="type == $config.formMode.edit"/>
           </DkFormItem>
           <!--结束日期-->
-          <DkFormItem prop="endDate" :required="true" :data-type="$config.dataType.date">
+          <DkFormItem prop="endDate" :required="true" :data-type="$config.dataType.date" v-if="formData.gradeCode == 'PRO'">
             <DatePickerPop v-model="formData.endDate"
                            :placeholder="$t('inputWords',{'search-name':$t('endDate')})"
                            type="date" :short-cut-flag="true"/>
@@ -82,8 +82,8 @@ export default {
         cpSize:null,
         shopSize:null,
         feedback:null,
-        webMaxNum:0,
-        wxMaxNum:1,
+        webMaxNum:null,
+        wxMaxNum:null,
         endDate:null,
       },
     }
@@ -108,6 +108,9 @@ export default {
 
     setParams() {
       this.params = {...this.formData}
+      if(this.formData.gradeCode == 'STD'){
+        this.params.endDate = '2099-12-31'
+      }
       if (this.formData.endDate) {
         this.params.endDate = this.formData.endDate.format('yyyy-MM-dd')
       }

+ 2 - 0
src/view/mst/coupon/index.vue

@@ -11,6 +11,8 @@
         <BaseIndexButton  ref="enable" name="enable"></BaseIndexButton>
         <!--    停用    -->
         <BaseIndexButton  ref="disable" name="disable"></BaseIndexButton>
+        <!--    查看    -->
+        <BaseIndexButton ref="check" name="check"></BaseIndexButton>
       </template>
       <template #right>
         <BaseIndexButton ref="add" name="add"></BaseIndexButton>

+ 274 - 0
src/view/mst/coupon/view.vue

@@ -0,0 +1,274 @@
+<!-- @desc:优惠卷查看  @auth:常皓宁  @time:2024/7/29 9:15 -->
+<template>
+  <div class="main-div">
+    <Card class="card" style="width: 100%">
+      <p slot="title">
+        {{ $t('couponInfo') }}
+      </p>
+      <DkRow>
+        <Col span="8">
+          {{ $t('couponName') + ':' }}
+          <b>{{ formData.couponName }}</b>
+        </Col>
+      </DkRow>
+      <DkRow>
+        <Col span="8">
+          {{ $t('couponDesc') + ':' + formData.couponDesc }}
+        </Col>
+        <Col span="8">
+          {{ $t('discount') + ':' + formData.discount + '折' }}
+        </Col>
+      </DkRow>
+      <DkRow>
+        <Col span="8">
+          {{ $t('useValidDays') + ':' + formData.useValidDays + '天' }}
+        </Col>
+        <Col span="8">
+          {{ $t('linkValidTimes') + ':' + formData.linkValidTimes + '小时' }}
+        </Col>
+      </DkRow>
+    </Card>
+    <Card>
+      <DkForm ref="formInline" :col-count="4" :width="50">
+        <!--企业-->
+        <DkFormItem prop="cpId" :label="this.$t('cpName')" :span="6" :data-type="$config.dataType.number">
+          <SelectMagnifier v-model="cpId" :display-text="cpName"
+                           :type="this.$config.MagnifierType.company"
+                           :multiple="false"
+                           @ok="clickOk"/>
+        </DkFormItem>
+        <Button type="primary" @click="detail">查询</Button>
+      </DkForm>
+      <DkTabs ref="tab" v-model="tabsModel" :options="tabsOptions">
+        <!--优惠券发出-->
+        <div slot="22">
+          <div style="margin-top: 5px">
+            <Card>
+              <DkTable :pageFlag="true" primaryKey="sendId" :id="'table-'+$options.name" name="table"
+                       @pageChange="sendPageSizeChange" :refreshSelect="false" :show-footer="true"
+                       ref="couponSendTable" :data="CouponSendList" :height="tableHeight - 140" :choose-flag="false">
+                <DkTableColumn field="cpName" width="200px"></DkTableColumn>
+                <DkTableColumn field="sendDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
+                <DkTableColumn field="endDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
+                <DkTableColumn field="userNum" width="200px"></DkTableColumn>
+              </DkTable>
+            </Card>
+          </div>
+        </div>
+
+        <!--优惠券使用-->
+        <div slot="21">
+          <div style="margin-top: 5px">
+            <Card>
+              <DkTable :pageFlag="true" primaryKey="useId" :id="'table-'+$options.name" name="table"
+                       @pageChange="usePageSizeChange" :refreshSelect="false" :show-footer="true"
+                       ref="couponUseTable" :data="CouponUseList" :height="tableHeight - 140" :choose-flag="false">
+                <DkTableColumn field="cpName" width="200px"></DkTableColumn>
+                <DkTableColumn field="useValidDays" width="200px"></DkTableColumn>
+                <DkTableColumn field="couponStatusName" width="200px"></DkTableColumn>
+                <DkTableColumn field="receiveDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
+                <DkTableColumn field="useDate" width="200px" :dataType="$config.columnType.date"></DkTableColumn>
+              </DkTable>
+            </Card>
+          </div>
+        </div>
+
+        <!--优惠券获取-->
+        <div slot="23">
+          <div style="margin-top: 5px">
+            <Card>
+              <DkTable :pageFlag="true" primaryKey="receiveId" :id="'table-'+$options.name" name="table"
+                       @pageChange="receivePageSizeChange" :refreshSelect="false" :show-footer="true"
+                       ref="couponReceiveTable" :data="CouponReceiveList" :height="tableHeight - 140" :choose-flag="false">
+                <DkTableColumn field="assistDate" :dataType="$config.columnType.date"></DkTableColumn>
+              </DkTable>
+            </Card>
+          </div>
+        </div>
+      </DkTabs>
+    </Card>
+  </div>
+</template>
+
+<script>
+
+import {indexMixin} from '@/mixins'
+import XEUtils from "xe-utils";
+
+export default {
+  name: 'coupon-view',
+  mixins: [indexMixin],
+  data() {
+    let self = this
+    return {
+      cpId:null,
+      cpName:null,
+      XEUtils: XEUtils,
+      formData: {},
+      loading: false,
+      sendPageInfo: {
+        pageSize: this.$config.pageSize,
+        currentPage: 1
+      },
+      CouponUseList: [],
+      usePageInfo: {
+        pageSize: this.$config.pageSize,
+        currentPage: 1
+      },
+      CouponSendList: [],
+      receivePageInfo: {
+        pageSize: this.$config.pageSize,
+        currentPage: 1
+      },
+      CouponReceiveList: [],
+      tabsModel: '22',
+      tabsOptions: [
+        {label: self.$t('couponSend'), name: '22'},
+        {label: self.$t('couponUse'), name: '21'},
+        {label: self.$t('couponReceive'), name: '23'},
+      ],
+    }
+  },
+  methods: {
+    /**
+     * @desc   : 选择后事件
+     * @author : 常皓宁
+     * @date   : 2024/6/5 9:18
+     */
+    clickOk(val) {
+      this.cpId = val[0]['cpId']
+      this.cpName = val[0]['cpName']
+    },
+
+    /**
+    * @desc   : 通过id查询
+    * @author : 常皓宁
+    * @date   : 2024/7/29 9:50
+    */
+    detail() {
+      //编辑将只读属性改为true
+      this.loading = true
+      //优惠卷信息
+      this.excuteNoParam(this.$service.couponService, this.$service.couponService.selectById, [this.$route.params.id],false).then(res => {
+        if (res.code === 200) {
+          this.formData = res.data
+          this.loading = false
+
+          //查询优惠券发出
+          this.getCouponSend()
+          //查询优惠券使用
+          this.getCouponUse()
+          //查询优惠券获取
+          this.getCouponReceive()
+        } else {
+          this.$Message.error(res.message)
+          this.loading = false
+        }
+      })
+    },
+    /**
+     * @desc   : 查询优惠券发出
+     * @author : 常皓宁
+     * @date   : 2024/7/15 14:05
+     */
+    getCouponSend() {
+      let param = {
+        couponId:this.$route.params.id,
+        cpId: this.cpId,
+      }
+      this.excute(this.$service.couponSendService, this.$service.couponSendService.selectByCond, param).then(res=>{
+        if (res.code == 200) {
+          this.CouponSendList = res.data.list
+          this.$refs['couponSendTable'].pageInfo.total = res.data.total
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+
+    /**
+     * @desc   : 查询优惠券使用
+     * @author : 常皓宁
+     * @date   : 2024/7/15 14:40
+     */
+    getCouponUse() {
+      let param = {
+        couponId:this.$route.params.id,
+        cpId: this.cpId,
+      }
+      this.excute(this.$service.couponUseService, this.$service.couponUseService.selectByCond, param).then(res=>{
+        if (res.code == 200) {
+          this.CouponUseList = res.data.list
+          this.$refs['couponUseTable'].pageInfo.total = res.data.total
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+
+    /**
+     * @desc   : 查询优惠券获取
+     * @author : 常皓宁
+     * @date   : 2024/7/15 14:49
+     */
+    getCouponReceive() {
+      let param = {
+        couponId:this.$route.params.id,
+        cpId: this.cpId,
+      }
+      this.excute(this.$service.couponReceiveService, this.$service.couponReceiveService.selectByCond, param).then(res=>{
+        if (res.code == 200) {
+          this.CouponReceiveList = res.data.list
+          this.$refs['couponReceiveTable'].pageInfo.total = res.data.total
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    /**
+     * @desc   : 分页
+     * @author : 付斌
+     * @date   : 2024-02-01 14:29
+     */
+    sendPageSizeChange(pageInfo) {
+      this.sendPageInfo = pageInfo
+      this.getCouponSend() // 查询数据
+    },
+    usePageSizeChange(pageInfo) {
+      this.usePageInfo = pageInfo
+      this.getCouponUse() // 查询数据
+    },
+    receivePageSizeChange(pageInfo) {
+      this.receivePageInfo = pageInfo
+      this.getCouponReceive() // 查询数据
+    },
+  },
+  activated() {
+    //通过id查询
+    this.detail()
+  }
+}
+</script>
+
+
+<style scoped>
+.card{
+  width: 99%;
+  margin-bottom: 10px;
+}
+.col{
+  padding-bottom: 10px;
+}
+.order-info{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.order-info>div:nth-child(n){
+  text-align: center;
+}
+.yuan-fh{
+  font-size: 8px
+}
+</style>

+ 44 - 2
src/view/mst/knowledge/index.vue

@@ -50,14 +50,26 @@ export default {
     let self = this
     return {
       modalTitle: '',
-      gradeList:[],//版本代码
       appCodeList: [
         {appCode:'CP-WEB',appName:'智云PC端'},
         {appCode:'CP-WXP',appName:'智云移动端'},
         {appCode:'DK-WEB',appName:'智云运营端'}
       ],//应用类型
       searchContent: [
-
+        {
+          itemCode: 'kgName',
+        },
+        {
+          itemCode: '功能-文本',
+          itemName: self.$t('menuName'),
+          valueFormat: {
+            code: 'funList',
+            data: [],
+            valueKey: 'funUuid',
+            labelKey: 'menuName',
+          },
+          valueKind: 'M-CHOICE'
+        },
       ],
     }
   },
@@ -71,6 +83,36 @@ export default {
       return this.excute(this.$service.knowledgeService, this.$service.knowledgeService.selectByCond, params)
     },
 
+    /**
+     * @desc   : 获取功能列表
+     * @author : 常皓宁
+     * @date   : 2024/4/15 10:47
+     */
+    getFun() {
+      // 查询数据
+      let params = {
+        appCode: 'CP-WXP'
+      }
+      this.excute(this.$service.commonService, this.$service.commonService.getFunction, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.funList = res.data
+          let list = this.searchContent.filter(it => it.valueFormat.code == 'funList')
+          if (list.length > 0) {
+            list[0].valueFormat.data = res.data
+          }
+        }
+      })
+    },
+
+    /**
+     * @desc   : 加载数据
+     * @author : 付斌
+     * @date   : 2024/3/1 11:16
+     */
+    initData() {
+      this.getFun()
+    },
+
   },
   created() {
     this.primaryKey = 'kgId'  // 设置主键Id