zhaoyun 18 цаг өмнө
parent
commit
15d8204465

+ 73 - 0
mer_plat_admin/src/api/measure.js

@@ -0,0 +1,73 @@
+// +----------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +----------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +----------------------------------------------------------------------
+import request from '@/utils/request';
+
+
+/**
+ * 商铺优惠措施 列表
+ */
+export function merchantMeasuresListApi(params) {
+  return request({
+    url: '/admin/platform/manage/measures/list',
+    method: 'get',
+    params,
+  });
+}
+
+/**
+ * 商铺优惠措施 全部列表
+ */
+export function merchantMeasuresAllListApi() {
+  return request({
+    url: '/admin/platform/manage/measures/all/list',
+    method: 'get',
+  });
+}
+
+/**
+ * 优惠措施  添加
+ */
+export function merchantMeasuresAddApi(data) {
+  return request({
+    url: '/admin/platform/manage/measures/add',
+    method: 'post',
+    data,
+  });
+} 
+
+/**
+ * 优惠措施  编辑
+ */
+export function merchantMeasuresUpdateApi(data) {
+  return request({
+    url: '/admin/platform/manage/measures/update',
+    method: 'post',
+    data,
+  });
+}
+
+/**
+ * 优惠措施  删除
+ */
+export function merchantMeasuresDeleteApi(id) {
+  return request({
+    url: `/admin/platform/manage/measures/delete/${id}`,
+    method: 'post',
+  });
+}
+/**
+ * 优惠措施 推荐开关
+ */
+export function merchantMeasuresSwitchApi(id) {
+  return request({
+    url: `/admin/platform/manage/measures/switch/${id}`,
+    method: 'post',
+  });
+}

+ 9 - 0
mer_plat_admin/src/api/merchant.js

@@ -416,4 +416,13 @@ export function merchantMeasuresSwitchApi(id) {
     url: `/admin/platform/merchant/measures/switch/${id}`,
     method: 'post',
   });
+}
+/**
+ * 优惠措施 推荐开关
+ */
+export function merchantMeasuresShowApi(id) {
+  return request({
+    url: `/admin/platform/merchant/measures/show/${id}`,
+    method: 'post',
+  });
 }

+ 81 - 0
mer_plat_admin/src/api/systemPrefernMeasure.js

@@ -0,0 +1,81 @@
+// +----------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +----------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +----------------------------------------------------------------------
+
+import request from '@/utils/request';
+/**
+ * 商铺优惠措施 列表
+ */
+export function prefernMeasuresListApi(params) {
+  return request({
+    url: '/admin/platform/system/measures/list',
+    method: 'get',
+    params,
+  });
+}
+
+/**
+ * 商铺优惠措施 全部列表
+ */
+export function prefernMeasuresAllListApi() {
+  return request({
+    url: '/admin/platform/system/measures/all/list',
+    method: 'get',
+  });
+}
+
+/**
+ * 优惠措施  添加
+ */
+export function prefernMeasuresAddApi(data) {
+  return request({
+    url: '/admin/platform/system/measures/add',
+    method: 'post',
+    data,
+  });
+} 
+
+/**
+ * 优惠措施  编辑
+ */
+export function prefernMeasuresUpdateApi(data) {
+  return request({
+    url: '/admin/platform/system/measures/update',
+    method: 'post',
+    data,
+  });
+}
+
+/**
+ * 优惠措施  删除
+ */
+export function prefernMeasuresDeleteApi(id) {
+  return request({
+    url: `/admin/platform/system/measures/delete/${id}`,
+    method: 'post',
+  });
+}
+/**
+ * 优惠措施 推荐开关
+ */
+export function prefernMeasuresSwitchApi(id) {
+  return request({
+    url: `/admin/platform/system/measures/switch/${id}`,
+    method: 'post',
+  });
+}
+/**
+ * 优惠措施 推荐开关
+ */
+export function prefernMeasuresShowApi(id) {
+  return request({
+    url: `/admin/platform/system/measures/show/${id}`,
+    method: 'post',
+  });
+}

+ 23 - 0
mer_plat_admin/src/router/modules/operation.js

@@ -372,6 +372,29 @@ const operationRouter = {
         },
       ],
     },
+		{
+		  path: 'prefernMeasure',
+		  name: 'prefernMeasure',
+		  component: () => import('@/views/systemSetting/prefernMeasure'),
+		  meta: {
+		    title: '优惠措施设置',
+		    icon: 'clipboard',
+		  },
+		  children: [
+		    {
+		      path: 'basicPrefernMeasureSettings',
+		      component: () => import('@/views/systemSetting/prefernMeasure/basicSettings/index'),
+		      name: 'basicPrefernMeasureSettings',
+		      meta: { title: '优惠措施', icon: '' },
+		    },
+		    {
+		      path: 'platPrefernMeasureSettings',
+		      component: () => import('@/views/systemSetting/prefernMeasure/platSettings/index'),
+		      name: 'platSettings',
+		      meta: { title: '平台优惠', icon: '' },
+		    },
+		  ],
+		},
   ],
 };
 

+ 2 - 2
mer_plat_admin/src/views/login/index.vue

@@ -131,8 +131,8 @@ export default {
         },
       },
       loginForm: {
-        account: 'admin', // admin
-        pwd: '123456',
+        account: '', // admin
+        pwd: '',  //123456
         captchaVO: {},
       },
       loginRules: {

+ 33 - 4
mer_plat_admin/src/views/merchant/measures/list/index.vue

@@ -14,7 +14,22 @@
       >
         <el-table-column prop="id" label="ID" min-width="50" />
         <el-table-column label="优惠措施名称" prop="measure" min-width="150"> </el-table-column>
-		<el-table-column label="开关" min-width="90" fixed="right">
+		<el-table-column prop="remark" label="备注说明" min-width="200" :show-overflow-tooltip="true" />
+		<el-table-column label="小程序首页显示" min-width="90">
+		  <template slot-scope="scope">
+		    <el-switch
+		      v-if="checkPermi(['platform:merchant:measures:switch'])"
+		      v-model="scope.row.isShow"
+		      :active-value="true"
+		      :inactive-value="false"
+		      active-text="显示"
+		      inactive-text="隐藏"
+		      @click.native="onchangeIsShow(scope.row)"
+		    />
+		    <div v-else>{{ scope.row.isShow ? '显示' : '隐藏' }}</div>
+		  </template>
+		</el-table-column>
+		<el-table-column label="开关" min-width="90">
 		  <template slot-scope="scope">
 		    <el-switch
 		      v-if="checkPermi(['platform:merchant:measures:switch'])"
@@ -23,12 +38,12 @@
 		      :inactive-value="false"
 		      active-text="开"
 		      inactive-text="关"
-		      @click.native="onchangeIsShow(scope.row)"
+		      @click.native="onchangeIsSwitch(scope.row)"
 		    />
 		    <div v-else>{{ scope.row.isSwitch ? '开' : '关' }}</div>
 		  </template>
 		</el-table-column>
-        <el-table-column prop="remark" label="备注说明" min-width="200" :show-overflow-tooltip="true" />
+       
 		<el-table-column prop="sort" label="排序"  />
         <el-table-column label="添加时间" min-width="120">
           <template slot-scope="scope">
@@ -133,8 +148,22 @@ export default {
 	 *  修改状态
 	 */
 	onchangeIsShow(row) {
+	  if (this.tableFrom.isShow === '0') return;
+      row.isShow = !row.isShow;
+	  const title = !row.isShow ? '是否开启' : '是否关闭';
+	  this.$modalSure(title).then(() => {
+	    merchant.merchantMeasuresShowApi(row.id).then((res) => {
+	      row.isShow = !row.isShow;
+	      this.$message.success('切换开关成功');
+	    });
+	  });
+	},
+	/**
+	 *  修改状态
+	 */
+	onchangeIsSwitch(row) {
 	  if (this.tableFrom.isSwitch === '0') return;
-      row.isSwitch = !row.isSwitch;
+	  row.isSwitch = !row.isSwitch;
 	  const title = !row.isSwitch ? '是否开启' : '是否关闭';
 	  this.$modalSure(title).then(() => {
 	    merchant.merchantMeasuresSwitchApi(row.id).then((res) => {

+ 222 - 0
mer_plat_admin/src/views/systemSetting/prefernMeasure/basicSettings/index.vue

@@ -0,0 +1,222 @@
+<template>
+  <div class="divBox relative">
+    <el-card class="box-card" shadow="never" :bordered="false">
+      <el-button v-hasPermi="['plat:system:prefern:measure:add']" type="primary" size="small" @click="handlerOpenEdit(0)"
+        >添加优惠措施</el-button
+      >
+      <el-table
+        v-loading="listLoading"
+        :data="tableData.data"
+        size="small"
+        height="500px"
+        :highlight-current-row="true"
+        class="mt20"
+      >
+        <el-table-column prop="id" label="ID" min-width="50" />
+        <el-table-column label="优惠措施名称" prop="measure" min-width="150"> </el-table-column>
+		<el-table-column prop="remark" label="备注说明" min-width="200" :show-overflow-tooltip="true" />
+		<el-table-column label="小程序首页显示" min-width="90">
+		  <template slot-scope="scope">
+		    <el-switch
+		      v-if="checkPermi(['plat:system:prefern:measure:switch'])"
+		      v-model="scope.row.isShow"
+		      :active-value="true"
+		      :inactive-value="false"
+		      active-text="显示"
+		      inactive-text="隐藏"
+		      @click.native="onchangeIsShow(scope.row)"
+		    />
+		    <div v-else>{{ scope.row.isShow ? '显示' : '隐藏' }}</div>
+		  </template>
+		</el-table-column>
+		<el-table-column label="开关" min-width="90">
+		  <template slot-scope="scope">
+		    <el-switch
+		      v-if="checkPermi(['plat:system:prefern:measure:switch'])"
+		      v-model="scope.row.isSwitch"
+		      :active-value="true"
+		      :inactive-value="false"
+		      active-text="开"
+		      inactive-text="关"
+		      @click.native="onchangeIsSwitch(scope.row)"
+		    />
+		    <div v-else>{{ scope.row.isSwitch ? '开' : '关' }}</div>
+		  </template>
+		</el-table-column>
+       
+		<el-table-column prop="sort" label="排序"  />
+        <el-table-column label="添加时间" min-width="120">
+          <template slot-scope="scope">
+            <span>{{ scope.row.createTime }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <a @click="handlerOpenEdit(1, scope.row)" v-hasPermi="['plat:system:prefern:measure:update']">编辑</a>
+            <el-divider direction="vertical"></el-divider>
+            <a @click="handlerOpenDel(scope.row)" v-hasPermi="['plat:system:prefern:measure:delete']">删除</a>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="block">
+        <el-pagination
+          background
+          :page-sizes="[20, 40, 60, 80]"
+          :page-size="tableFrom.limit"
+          :current-page="tableFrom.page"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="tableData.total"
+          @size-change="handleSizeChange"
+          @current-change="pageChange"
+        />
+      </div>
+    </el-card>
+  </div>
+</template>
+<script>
+// +---------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +---------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +---------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +---------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +---------------------------------------------------------------------
+import * as measure from '@/api/systemPrefernMeasure';
+import { checkPermi } from '@/utils/permission'; // 权限判断函数
+export default {
+  data() {
+    return {
+      tableFrom: {},
+      tableData: {
+        data: [],
+        total: 0,
+      },
+      listLoading: false,
+      editDialogConfig: {
+        visible: false,
+        editData: {},
+      },
+      keyNum: 0,
+      id: 0,
+    };
+  },
+  mounted() {
+    if (checkPermi(['platform:system:prefern:measure:page'])) this.getList();
+  },
+  methods: {
+    checkPermi,
+    // 列表
+    getList() {
+      this.listLoading = true;
+      measure
+        .prefernMeasuresListApi()
+        .then((res) => {
+          this.tableData.data = res.list;
+          this.tableData.total = res.total;
+          this.listLoading = false;
+        })
+        .catch((res) => {
+          this.listLoading = false;
+          this.$message.error(res.message);
+        });
+    },
+    pageChange(page) {
+      this.tableFrom.page = page;
+      this.getList();
+    },
+    handleSizeChange(val) {
+      this.tableFrom.limit = val;
+      this.getList();
+    },
+    handlerOpenEdit(isCreate, editDate) {
+      const _this = this;
+      this.id = editDate ? editDate.id : 0;
+      this.$modalParserFrom(
+        isCreate === 0 ? '添加优惠措施' : '编辑优惠措施',
+        '优惠措施',
+        isCreate,
+        isCreate === 0 ? { id: 0, measure: '', remark: '',sort: 0,isSwitch: false } : Object.assign({}, editDate),
+        function (formValue) {
+          _this.submit(formValue);
+        },
+        (this.keyNum += 3),
+      );
+    },
+	/**
+	 *  修改状态
+	 */
+	onchangeIsShow(row) {
+	  if (this.tableFrom.isShow === '0') return;
+      row.isShow = !row.isShow;
+	  const title = !row.isShow ? '是否开启' : '是否关闭';
+	  this.$modalSure(title).then(() => {
+	    measure.prefernMeasuresShowApi(row.id).then((res) => {
+	      row.isShow = !row.isShow;
+	      this.$message.success('切换开关成功');
+	    });
+	  });
+	},
+	/**
+	 *  修改状态
+	 */
+	onchangeIsSwitch(row) {
+	  if (this.tableFrom.isSwitch === '0') return;
+	  row.isSwitch = !row.isSwitch;
+	  const title = !row.isSwitch ? '是否开启' : '是否关闭';
+	  this.$modalSure(title).then(() => {
+	    measure.prefernMeasuresSwitchApi(row.id).then((res) => {
+	      row.isSwitch = !row.isSwitch;
+	      this.$message.success('切换开关成功');
+	    });
+	  });
+	},
+    submit(formValue) {
+      const data = {
+        id: this.id,
+        measure: formValue.measure,
+        remark: formValue.remark,
+		sort: formValue.sort,
+		isSwitch: formValue.isSwitch,
+      };
+      !this.id
+        ? measure
+            .prefernMeasuresAddApi(data)
+            .then((res) => {
+              this.$message.success('操作成功');
+              this.$msgbox.close();
+              //this.$store.commit('merchant/SET_MerchantMeasures', []);
+              this.getList();
+            })
+            .catch(() => {
+              this.loading = false;
+            })
+        : measure
+            .prefernMeasuresUpdateApi(data)
+            .then((res) => {
+              this.$message.success('操作成功');
+              this.$msgbox.close();
+              //this.$store.commit('product/SET_MerchantMeasures', []);
+              this.getList();
+            })
+            .catch(() => {
+              this.loading = false;
+            });
+    },
+    handlerOpenDel(rowData) {
+      this.$modalSure('删除优惠措施吗?').then(() => {
+        measure.prefernTypeDeleteApi(rowData.id).then((data) => {
+          this.$message.success('删除优惠措施成功');
+          this.getList();
+          //this.$store.commit('product/SET_MerchantMeasures', []);
+        });
+      });
+    },
+    hideEditDialog() {
+      this.editDialogConfig.visible = false;
+      this.handleGetRoleList();
+    },
+  },
+};
+</script>

+ 11 - 0
mer_plat_admin/src/views/systemSetting/prefernMeasure/default.js

@@ -0,0 +1,11 @@
+export const defaultData = {
+  id: 0,
+  isSwitch: false,
+  sort: 0,
+  measureId: null,
+  measureValue: 0,
+  measureValue1: 0,
+  unit: '元',
+  isSetting: null,
+  remark: null
+};

+ 9 - 0
mer_plat_admin/src/views/systemSetting/prefernMeasure/index.vue

@@ -0,0 +1,9 @@
+<script setup></script>
+
+<template>
+  <div>
+    <router-view />
+  </div>
+</template>
+
+<style scoped lang="scss"></style>

+ 176 - 0
mer_plat_admin/src/views/systemSetting/prefernMeasure/platSettings/creatMeasure.vue

@@ -0,0 +1,176 @@
+<template>
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="540px" append-to-body :before-close="handleResetForm">
+    <el-form
+      v-if="dialogVisible && formValidate"
+      ref="formValidate"
+      class="formValidate"
+      :model="formValidate"
+      :rules="rules"
+      @submit.native.prevent
+      label-width="100px"
+    >
+      <el-form-item label="优惠措施:" prop="measureId">
+		  <el-select v-model="formValidate.measureId" placeholder="请选择" @change="handleChange" value-key="label" clearable >
+		    <el-option v-for="item in measures" :key="item.id" :label="item.measure" :value="parseInt(item.id)">
+		    </el-option>
+		  </el-select>
+      </el-form-item>
+      <el-form-item label="措施开关:" prop="isSwitch">
+		  <el-switch
+			v-model="formValidate.isSwitch"
+			:active-value="true"
+			:inactive-value="false"
+			active-text="启用"
+			inactive-text="停用"
+		  />
+      </el-form-item>
+	  <el-form-item label="设置参数:" prop="isSetting">
+	    <el-radio-group v-model="formValidate.isSetting" @click.native="handleChange" v-removeAriaHidden>
+		  <el-radio :label="false">否</el-radio>
+		  <el-radio :label="true">是</el-radio>
+	    </el-radio-group>
+		<div class="from-tips mb5" v-if="formValidate.measureId && formValidate.isSetting==true">设置{{formValidate.measureLabel}}具体数值。</div>
+	  </el-form-item>
+	  <el-form-item :label="formValidate.measureLabel" prop="measureValue" v-show="formValidate.isSetting==true">
+		<div v-if="formValidate.measureLabel=='满减大促:'">
+		 <span class="from-tips mb5">满  </span>
+		 <el-input-number
+		   v-model.trim="formValidate.measureValue1"
+		   :min="0"
+		   :max="99"
+		   :step="0.1"
+		   step-strictly
+		   placeholder="请输入参数"
+		   label="参数"
+		 ></el-input-number><span class="from-tips mb5">元</span>
+		 <span style="padding-left: 20px;" class="from-tips mb5">减  </span>
+		  <el-input-number
+			v-model.trim="formValidate.measureValue"
+			:min="0"
+			:max="99"
+			:step="0.1"
+			step-strictly
+			placeholder="请输入参数"
+			label="参数"
+		  ></el-input-number><span class="from-tips mb5">元</span>
+		</div>
+		<div v-else>
+		   <el-input-number
+			 v-model.trim="formValidate.measureValue"
+			 :min="0"
+			 :max="99"
+			 :step="0.1"
+			 step-strictly
+			 placeholder="请输入参数"
+			 label="参数"
+		   ></el-input-number> <span class="from-tips mb5">元</span>
+		</div>
+	   <!-- <div class="from-tips mb5">优惠措施对应参数值如1,单位输入元。表示优惠1元。</div> -->
+	  </el-form-item>
+      <el-form-item label="备注:" prop="remark">
+      		  <el-input type="textarea"
+			  v-model.trim="formValidate.remark"
+			  ></el-input>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="handleResetForm">取 消</el-button>
+      <el-button type="primary" @click="handleSure" :loading="loadingBtn">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+import { expressRelateApi } from '@/api/logistics';
+import { useLogisticsAllList } from '@/hooks/use-order';
+import { validatePhone } from '@/utils/toolsValidate';
+import { defaultData } from '@/views/systemSetting/prefernMeasure/default';
+import * as merchant from '@/api/measure';
+export default {
+  name: 'CreatMeasure',
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    editData: {
+      type: Object,
+      default: {},
+    },
+  },
+  watch: {
+    editData: {
+      handler(nVal, oVal) {
+        if (nVal) {
+          this.formValidate = this.editData;
+          this.title = this.formValidate.id ? '修改措施' : '新增措施';
+		  this.handleChange();
+        }
+      },
+      deep: true,
+    },
+  },
+  data() {
+    return {
+      title: '',
+	  measures: [],
+      formValidate: Object.assign({}, defaultData),
+      loadingBtn: false,
+      rules: {
+        measureId: [{ required: true, message: '请选择优惠措施', trigger: 'blue' }],
+		isSetting: [{ required: true, message: '请选择是否设置参数', trigger: 'blue' }],
+      },
+    };
+  },
+  mounted() {
+	  this.getAll();
+	
+   },
+	created(){
+		  this.handleChange();
+	},
+  methods: {
+	getAll(){
+		merchant
+		  .merchantMeasuresAllListApi()
+		  .then((res) => {
+		    this.measures = res;
+		  });
+	},
+	handleChange() {
+		  const selectedOption = this.measures.find(item => item.id ===  this.formValidate.measureId);
+	       if (selectedOption) {
+	        this.formValidate.measureLabel=selectedOption.measure+":";
+	       } else {
+	         console.log('未找到对应的选项');
+	       }	     
+	},
+    //取消
+    handleResetForm() {
+      this.$emit('handlerCloseFrom');
+      this.$refs.formValidate.resetFields();
+    },
+    // 提交
+    handleSure() {
+      this.$refs.formValidate.validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loadingBtn = true;
+			this.formValidate.unit="元";
+            const data = this.formValidate.id == 0
+              ? await merchant.merchantMeasuresAddApi(this.formValidate)
+              : await merchant.merchantMeasuresUpdateApi(this.formValidate);
+            if (data) this.$message.success(data);
+            this.$emit('handlerSuccessSubmit');
+            this.handleResetForm();
+            this.loadingBtn = false;
+          } catch (e) {
+            this.loadingBtn = false;
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss"></style>

+ 260 - 0
mer_plat_admin/src/views/systemSetting/prefernMeasure/platSettings/index.vue

@@ -0,0 +1,260 @@
+<template>
+  <div class="divBox">
+    <!-- <el-card
+      :bordered="false"
+      shadow="never"
+      class="ivu-mt"
+      v-hasPermi="['merchant:prefern:measure:page']"
+      :body-style="{ padding: 0 }"
+    >
+      <div class="padding-add">
+       <el-form ref="form" inline :model="tableFrom" :rules="rules" @submit.native.prevent label-position="right">
+          <el-form-item label="配送人员:">
+            <el-input
+              @keyup.enter.native="getList(1)"
+              v-model.trim="personnelName"
+              placeholder="请输入配送人员姓名"
+              class="selWidth"
+              size="small"
+              clearable
+            >
+            </el-input>
+          </el-form-item>
+          <el-form-item label="手机号码:" prop="personnelPhone">
+            <el-input
+              v-model.trim="tableFrom.personnelPhone"
+              class="selWidth"
+              placeholder="请输入配送人员手机号码"
+              clearable
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="创建日期:">
+            <el-date-picker
+              v-model="timeVal"
+              value-format="yyyy-MM-dd"
+              format="yyyy-MM-dd"
+              size="small"
+              type="daterange"
+              placement="bottom-end"
+              range-separator="-"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              class="selWidth"
+              @change="onchangeTime"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="small" v-debounceClick="2000" @click="getList(1)">查询</el-button>
+            <el-button size="small" @click="handleReset">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-card> -->
+    <el-card shadow="never" :bordered="false" class="box-card mt14" :body-style="{ padding: '20px' }">
+      <el-button
+        type="primary"
+        size="small"
+        @click="handleCreatPersonnel()"
+        v-hasPermi="['plat:manage:prefern:measure:add']"
+        >新增</el-button
+      >
+      <el-table v-loading="loading" :data="tableData.data" class="mt20" size="small">
+        <el-table-column prop="id" label="ID" min-width="60" />
+        <el-table-column label="优惠措施名称" min-width="200" prop="measure" :show-overflow-tooltip="true" />
+        <el-table-column label="开关" min-width="150">
+          <template slot-scope="scope">
+            <el-switch
+              v-if="checkPermi(['plat:manage:prefern:measure:switch'])"
+              v-model="scope.row.isSwitch"
+              :active-value="true"
+              active-text="启用"
+              :inactive-value="false"
+              inactive-text="停用"
+              @change="handleOnchangeIsShow(scope.row)"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column label="参数设置" min-width="150" prop="sort">
+			<template slot-scope="scope">
+			  {{scope.row.isSetting==true&& scope.row.measureValue?'已设置':'未设置'}}
+			</template>
+		</el-table-column>
+		<el-table-column label="优惠措施" min-width="150" prop="sort">
+			<!-- <template slot-scope="scope" v-if="scope.row.measure==='满减大促'">
+			  {{scope.row.isSetting==true && scope.row.measureValue?scope.row.measure+":"+'满'+scope.row.measureValue+scope.row.unit+'减'+scope.row.measureValue1+scope.row.unit :'无'}}
+			</template> -->
+			<template slot-scope="scope">
+			  {{scope.row.isSetting==true && scope.row.measureValue&& scope.row.measure==='满减大促'?scope.row.measure+":"+'满'+scope.row.measureValue1+scope.row.unit+'减'+scope.row.measureValue+scope.row.unit :(scope.row.isSetting==true && scope.row.measureValue?scope.row.measure+":"+scope.row.measureValue+scope.row.unit :'无')}}
+				
+			  <!-- {{scope.row.isSetting==true && scope.row.measureValue?scope.row.measure+":"+scope.row.measureValue+scope.row.unit :'无'}} -->
+			</template>
+		</el-table-column>
+        <el-table-column prop="createTime" label="创建时间" min-width="200" />
+        <el-table-column fixed="right" width="120" label="操作">
+          <template slot-scope="scope">
+            <a @click="handleCreatPersonnel(scope.row)" v-hasPermi="['plat:manage:prefern:measure:update']">编辑</a>
+            <el-divider direction="vertical"></el-divider>
+            <a @click="handleDelete(scope.row)" v-hasPermi="['plat:manage:prefern:measure:delete']">删除</a>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="block-pagination">
+        <el-pagination
+          background
+          :page-sizes="$constants.page.limit"
+          :page-size="tableData.limit"
+          :current-page="tableData.page"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="tableData.total"
+          @current-change="pageChange"
+          @size-change="handleSizeChange"
+        />
+      </div>
+    </el-card>
+
+    <creat-measure
+      :dialogVisible="dialogVisible"
+      :editData="editData"
+      @handlerCloseFrom="handlerCloseFrom"
+      @handlerSuccessSubmit="handlerSuccessSubmit"
+    ></creat-measure>
+  </div>
+</template>
+
+<script>
+// +----------------------------------------------------------------------
+// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
+// +----------------------------------------------------------------------
+// | Author: CRMEB Team <admin@crmeb.com>
+// +----------------------------------------------------------------------
+
+import { checkPermi } from '@/utils/permission'; // 权限判断函数
+import { handleDeleteTable } from '@/libs/public';
+import CreatMeasure from './creatMeasure.vue';
+import { validatePhone } from '@/utils/toolsValidate';
+import * as merchant from '@/api/measure';
+import { defaultData } from '@/views/systemSetting/prefernMeasure/default';
+export default {
+  name: 'DeliveryPersonnel',
+  components: { CreatMeasure },
+  data() {
+    return {
+      rules: {
+        personnelPhone: [{ validator: validatePhone, trigger: 'blur' }],
+      },
+      timeVal: [],
+	  measures: [],
+      tableFrom: {
+        page: 1,
+        dateLimit: '',
+        personnelName: '',
+        personnelPhone: '',
+        limit: this.$constants.page.limit[0],
+      },
+      personnelName: '',
+      tableData: {
+        data: [],
+        total: 0,
+      },
+      loading: false,
+      dialogVisible: false,
+      editData: Object.assign({}, defaultData),
+    };
+  },
+  created() {
+	this.getAll();
+    if (checkPermi(['plat:manage:prefern:measure:page'])) this.getList(1);
+  },
+  methods: {
+    checkPermi,
+	handleOnchangeIsShow(row) {
+	  merchant
+	    .merchantMeasuresSwitchApi(row.id).then((data) => {
+	    this.$message.success('更新状态成功');
+	    this.getDataList();
+	  });
+	},
+	getAll(){
+		merchant
+		  .merchantMeasuresAllListApi()
+		  .then((res) => {
+		    this.measures = res;
+		  });
+	},
+    //重置
+    handleReset() {
+      this.tableFrom.dateLimit = '';
+      this.tableFrom.personnelName = '';
+      this.tableFrom.personnelPhone = '';
+      this.timeVal = [];
+      this.personnelName = '';
+      this.getList();
+    },
+    handlerCloseFrom() {
+      this.dialogVisible = false;
+    },
+    handlerSuccessSubmit() {
+      this.getList(1);
+      this.dialogVisible = false;
+    },
+    // 添加
+    handleCreatPersonnel(row) {
+      this.editData = row ? row : Object.assign({}, defaultData);
+      this.dialogVisible = true;
+    },
+    // 分页
+    pageChange(page) {
+      this.tableFrom.page = page;
+      this.getList();
+    },
+    handleSizeChange(val) {
+      this.tableFrom.limit = val;
+      this.getList();
+    },
+    // 具体日期
+    onchangeTime(e) {
+      this.timeVal = e;
+      this.tableFrom.dateLimit = e ? this.timeVal.join(',') : '';
+      this.getList(1);
+    },
+    // 数据列表
+    getList(num) {
+      this.loading = true;
+      let params = {
+        ...this.tableFrom,
+        page: num ? num : this.tableFrom.page,
+        personnelName: encodeURIComponent(this.personnelName),
+      };
+      merchant.merchantMeasuresListApi(params)
+        .then((res) => {
+          this.loading = false;
+          this.tableData.data = res.list;
+		  this.tableData.data.find((item,index)=>{
+		         const selectedOptionText = this.measures.find(option => option.id === item.measureId).measure;
+		        item.measure=selectedOptionText;
+		  })
+          this.tableData.total = res.total;
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    // 删除
+    handleDelete(item) {
+      this.$modalSure('确定要删除此优惠措施吗?').then(() => {
+        merchant.merchantMeasuresDeleteApi(item.id).then((res) => {
+          this.$message.success('删除成功');
+          handleDeleteTable(this.tableData.data.length, this.tableFrom);
+          this.getList();
+        });
+      });
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss"></style>