230320a303 1 рік тому
батько
коміт
6f38fe981c

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/index.html


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/css/chunk-634f0541.26cf5686.css


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/app.90466380.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/chunk-634f0541.7a6cc889.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/chunk-9e3bf050.82789b85.js


+ 15 - 0
src/api/facility.js

@@ -19,4 +19,19 @@ export default {
   admfacilitydel: params => { // 公共配套 删除
     return getRequestNoSort('/adm/facility/del', params, 'loading')
   },
+  admsalerulelist: params => { // 销售积分规则 - 洪楼分 列表接口
+    return getRequest('/adm/sale/rule/list', params)
+  },
+  admsaleruleadd: params => { // 销售积分规则 - 洪楼分 添加
+    return getRequestNoSort('/adm/sale/rule/add', params, 'loading')
+  },
+  admsaleruleedit: params => { // 销售积分规则 - 洪楼分 编辑
+    return getRequestNoSort('/adm/sale/rule/edit', params, 'loading')
+  },
+  admsaleruledetail: params => { // 销售积分规则 - 洪楼分 详情
+    return getRequestNoSort('/adm/sale/rule/detail', params, 'loading')
+  },
+  admsaleruledel: params => { // 销售积分规则 - 洪楼分 删除
+    return getRequestNoSort('/adm/sale/rule/del', params, 'loading')
+  },
 }

+ 106 - 0
src/views/user/appScoreRule.vue

@@ -0,0 +1,106 @@
+<template>
+  <div class="app-container">
+    <!-- <search-form
+      :list-loading="listLoading"
+      @change="searchHandle"
+    /> -->
+    <table-list
+      :list-loading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :current-page="currentPage"
+      :page-size="pageSize"
+      :total-records="totalRecords"
+      @currentChange="pageHandle"
+      @sizeChange="sizeChange"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+// import SearchForm from './components/searchForm/AppSale'
+import PopupEdit from './components/popup/ScoreRuleEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'index',
+  components: {
+    // SearchForm,
+    PopupEdit,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'facility.admsalerulelist',
+      searchForm: null,
+      isDtlShow: false,
+      curObj: {},
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+        item.rewardNum = item.reward_num == 0 ? '不限' : item.reward_num
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '类目', prop: 'category' },
+        { label: '奖励积分', prop: 'reward_point' },
+        { label: '奖励周期(天)', prop: 'cycle' },
+        { label: '奖励次数', prop: 'rewardNum' },
+        { 说明: '说明', prop: 'remark' },
+        // { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 200, type: 'handle2', operations:
+          [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle(row) {
+      this.$msg(`您确定要删除该规则吗?`, 'confirm', () => {
+        this.$api.facility.admsaleruledel({
+          id: row.id
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    }
+  }
+}
+</script>

+ 96 - 0
src/views/user/components/popup/ScoreRuleEdit.vue

@@ -0,0 +1,96 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="this.curObj && this.curObj.id ? '编辑规则' : '添加规则'"
+      :fullscreen="false"
+      width="700px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
+        <div slot="footer">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  components: {},
+  mixins: [...mixins],
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      isShowMap: false
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    getDef() {
+      const params = { ...this.curObj }
+      this.formData = [
+        { label: '类目', key: 'category', class: 'c-2', rules: 1 },
+        { label: '奖励积分', key: 'reward_point', class: 'c-2', rules: 1 },
+        { label: '奖励周期', key: 'cycle', class: 'c-2', type: 'inputFont', appendFont: '天', rules: 1 },
+        { label: '奖励次数', key: 'reward_num', class: 'c-2', rules: 1 },
+        { label: '说明', key: 'remark' },
+      ]
+      this.setDefaultValue(params)
+    },
+    close(str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            let newForm = { ...oldform }
+            let apiStr = 'admsaleruleadd'
+            if (this.curObj.id) {
+              apiStr = 'admsaleruleedit'
+              newForm.id = this.curObj.id
+            }
+            this.$api.facility[apiStr](newForm).then(data => {
+              this.$msgs(this.curObj.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import "../../../../styles/libEdit.scss";
+.lib-edit {
+  padding-top: 0;
+  width:100%;
+  ::v-deep .el-form-item {
+    margin-bottom: 10px;
+  }
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+}
+</style>

Деякі файли не було показано, через те що забагато файлів було змінено