202505261413
This commit is contained in:
parent
0a9592f7a2
commit
e2ab03ffcc
|
|
@ -139,6 +139,14 @@ public class Users extends BaseEntity
|
||||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
private Date updatedAt;
|
private Date updatedAt;
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------------
|
||||||
|
private BigDecimal totalCommMin;
|
||||||
|
private BigDecimal totalCommMax;
|
||||||
|
private BigDecimal marginMin;
|
||||||
|
private BigDecimal marginMax;
|
||||||
|
private BigDecimal commissionMin;
|
||||||
|
private BigDecimal commissionMax;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
@ -439,6 +447,54 @@ public class Users extends BaseEntity
|
||||||
return updatedAt;
|
return updatedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCommissionMax() {
|
||||||
|
return commissionMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommissionMax(BigDecimal commissionMax) {
|
||||||
|
this.commissionMax = commissionMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCommissionMin() {
|
||||||
|
return commissionMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommissionMin(BigDecimal commissionMin) {
|
||||||
|
this.commissionMin = commissionMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMarginMax() {
|
||||||
|
return marginMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMarginMax(BigDecimal marginMax) {
|
||||||
|
this.marginMax = marginMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMarginMin() {
|
||||||
|
return marginMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMarginMin(BigDecimal marginMin) {
|
||||||
|
this.marginMin = marginMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalCommMax() {
|
||||||
|
return totalCommMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCommMax(BigDecimal totalCommMax) {
|
||||||
|
this.totalCommMax = totalCommMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalCommMin() {
|
||||||
|
return totalCommMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCommMin(BigDecimal totalCommMin) {
|
||||||
|
this.totalCommMin = totalCommMin;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="title" column="title" />
|
<result property="title" column="title" />
|
||||||
<result property="parentId" column="parent_id" />
|
<result property="parentId" column="parent_id" />
|
||||||
<result property="order" column="order" />
|
<result property="order" column="order_data" />
|
||||||
<result property="lat" column="lat" />
|
<result property="lat" column="lat" />
|
||||||
<result property="lng" column="lng" />
|
<result property="lng" column="lng" />
|
||||||
<result property="provinceId" column="province_id" />
|
<result property="provinceId" column="province_id" />
|
||||||
|
|
@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectDiyCityVo">
|
<sql id="selectDiyCityVo">
|
||||||
select id, title, parent_id, order, lat, lng, province_id, city_id, district_id, created_at, updated_at from diy_city
|
select id, title, parent_id, order_data, lat, lng, province_id, city_id, district_id, created_at, updated_at from diy_city
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDiyCityList" parameterType="DiyCity" resultMap="DiyCityResult">
|
<select id="selectDiyCityList" parameterType="DiyCity" resultMap="DiyCityResult">
|
||||||
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<where>
|
<where>
|
||||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
<if test="order != null "> and order = #{order}</if>
|
<if test="order != null "> and order_data = #{order}</if>
|
||||||
<if test="lat != null and lat != ''"> and lat = #{lat}</if>
|
<if test="lat != null and lat != ''"> and lat = #{lat}</if>
|
||||||
<if test="lng != null and lng != ''"> and lng = #{lng}</if>
|
<if test="lng != null and lng != ''"> and lng = #{lng}</if>
|
||||||
<if test="provinceId != null "> and province_id = #{provinceId}</if>
|
<if test="provinceId != null "> and province_id = #{provinceId}</if>
|
||||||
|
|
@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="title != null and title != ''">title,</if>
|
<if test="title != null and title != ''">title,</if>
|
||||||
<if test="parentId != null">parent_id,</if>
|
<if test="parentId != null">parent_id,</if>
|
||||||
<if test="order != null">order,</if>
|
<if test="order != null">order_data,</if>
|
||||||
<if test="lat != null">lat,</if>
|
<if test="lat != null">lat,</if>
|
||||||
<if test="lng != null">lng,</if>
|
<if test="lng != null">lng,</if>
|
||||||
<if test="provinceId != null">province_id,</if>
|
<if test="provinceId != null">province_id,</if>
|
||||||
|
|
@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="title != null and title != ''">title = #{title},</if>
|
<if test="title != null and title != ''">title = #{title},</if>
|
||||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
<if test="order != null">order = #{order},</if>
|
<if test="order != null">order_data = #{order},</if>
|
||||||
<if test="lat != null">lat = #{lat},</if>
|
<if test="lat != null">lat = #{lat},</if>
|
||||||
<if test="lng != null">lng = #{lng},</if>
|
<if test="lng != null">lng = #{lng},</if>
|
||||||
<if test="provinceId != null">province_id = #{provinceId},</if>
|
<if test="provinceId != null">province_id = #{provinceId},</if>
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectUsersList" parameterType="Users" resultMap="UsersResult">
|
<select id="selectUsersList" parameterType="Users" resultMap="UsersResult">
|
||||||
<include refid="selectUsersVo"/>
|
<include refid="selectUsersVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
|
||||||
|
<if test="totalCommMin != null and totalCommMax != null">
|
||||||
|
and total_comm BETWEEN #{totalCommMin} AND #{totalCommMax}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="marginMin != null and marginMax != null">
|
||||||
|
and margin BETWEEN #{marginMin} AND #{marginMax}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="commissionMin != null and commissionMax != null">
|
||||||
|
and commission BETWEEN #{commissionMin} AND #{commissionMax}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
<if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
|
<if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
|
||||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
<if test="jobNumber != null "> and job_number like concat('%', #{jobNumber}, '%')</if>
|
||||||
|
|
||||||
|
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
|
||||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||||
<if test="rememberToken != null and rememberToken != ''"> and remember_token = #{rememberToken}</if>
|
<if test="rememberToken != null and rememberToken != ''"> and remember_token = #{rememberToken}</if>
|
||||||
<if test="openid != null and openid != ''"> and openid = #{openid}</if>
|
<if test="openid != null and openid != ''"> and openid = #{openid}</if>
|
||||||
|
|
@ -60,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="commission != null "> and commission = #{commission}</if>
|
<if test="commission != null "> and commission = #{commission}</if>
|
||||||
<if test="totalComm != null "> and total_comm = #{totalComm}</if>
|
<if test="totalComm != null "> and total_comm = #{totalComm}</if>
|
||||||
<if test="margin != null "> and margin = #{margin}</if>
|
<if test="margin != null "> and margin = #{margin}</if>
|
||||||
<if test="jobNumber != null "> and job_number = #{jobNumber}</if>
|
|
||||||
<if test="prohibitTime != null "> and prohibit_time = #{prohibitTime}</if>
|
<if test="prohibitTime != null "> and prohibit_time = #{prohibitTime}</if>
|
||||||
<if test="prohibitTimeNum != null "> and prohibit_time_num = #{prohibitTimeNum}</if>
|
<if test="prohibitTimeNum != null "> and prohibit_time_num = #{prohibitTimeNum}</if>
|
||||||
<if test="toa != null "> and toa = #{toa}</if>
|
<if test="toa != null "> and toa = #{toa}</if>
|
||||||
|
|
|
||||||
|
|
@ -130,49 +130,54 @@
|
||||||
v-hasPermi="['system:DiyCity:export']"
|
v-hasPermi="['system:DiyCity:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-expand"
|
||||||
|
size="mini"
|
||||||
|
@click="expandAll"
|
||||||
|
>展开</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-fold"
|
||||||
|
size="mini"
|
||||||
|
@click="collapseAll"
|
||||||
|
>收起</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="DiyCityList" @selection-change="handleSelectionChange">
|
<el-tree
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
:data="DiyCityList"
|
||||||
<el-table-column label="${comment}" align="center" prop="id" />
|
:props="defaultProps"
|
||||||
<el-table-column label="名称" align="center" prop="title" />
|
node-key="id"
|
||||||
<el-table-column label="父级ID" align="center" prop="parentId" />
|
ref="tree"
|
||||||
<el-table-column label="排序" align="center" prop="order" />
|
highlight-current
|
||||||
<el-table-column label="纬度" align="center" prop="lat" />
|
@node-click="handleNodeClick"
|
||||||
<el-table-column label="经度" align="center" prop="lng" />
|
:expand-on-click-node="false"
|
||||||
<el-table-column label="省id" align="center" prop="provinceId" />
|
>
|
||||||
<el-table-column label="市" align="center" prop="cityId" />
|
<span slot-scope="{ data }">
|
||||||
<el-table-column label="区" align="center" prop="districtId" />
|
{{ data.title }}
|
||||||
<el-table-column label="${comment}" align="center" prop="createdAt" width="180">
|
<el-button
|
||||||
<template slot-scope="scope">
|
size="mini"
|
||||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
type="text"
|
||||||
</template>
|
icon="el-icon-edit"
|
||||||
</el-table-column>
|
@click="handleUpdate(data)"
|
||||||
<el-table-column label="${comment}" align="center" prop="updatedAt" width="180">
|
v-hasPermi="['system:DiyCity:edit']"
|
||||||
<template slot-scope="scope">
|
>修改</el-button>
|
||||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
<el-button
|
||||||
</template>
|
size="mini"
|
||||||
</el-table-column>
|
type="text"
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
icon="el-icon-delete"
|
||||||
<template slot-scope="scope">
|
@click="handleDelete(data)"
|
||||||
<el-button
|
v-hasPermi="['system:DiyCity:remove']"
|
||||||
size="mini"
|
>删除</el-button>
|
||||||
type="text"
|
</span>
|
||||||
icon="el-icon-edit"
|
</el-tree>
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['system:DiyCity:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['system:DiyCity:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
|
|
@ -254,7 +259,40 @@ export default {
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 自定义地区表格数据
|
// 自定义地区表格数据
|
||||||
DiyCityList: [],
|
DiyCityList: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: '西安市',
|
||||||
|
children: [
|
||||||
|
{ id: 5, title: '西咸新区' },
|
||||||
|
{ id: 2, title: '未央区' },
|
||||||
|
{ id: 7, title: '莲湖区' },
|
||||||
|
{ id: 10, title: '雁塔区' },
|
||||||
|
{ id: 11, title: '高新区' },
|
||||||
|
{ id: 12, title: '长安区' },
|
||||||
|
{ id: 13, title: '新城区' },
|
||||||
|
{ id: 14, title: '碑林区' },
|
||||||
|
{ id: 15, title: '灞桥区' },
|
||||||
|
{ id: 16, title: '临潼区' },
|
||||||
|
{ id: 17, title: '高陵区' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 27,
|
||||||
|
title: '上海市',
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 44,
|
||||||
|
title: '长沙市',
|
||||||
|
children: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 52,
|
||||||
|
title: '合肥市',
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
|
@ -284,6 +322,10 @@ export default {
|
||||||
parentId: [
|
parentId: [
|
||||||
{ required: true, message: "父级ID不能为空", trigger: "blur" }
|
{ required: true, message: "父级ID不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
|
},
|
||||||
|
defaultProps: {
|
||||||
|
children: 'children',
|
||||||
|
label: 'title'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -389,6 +431,19 @@ export default {
|
||||||
this.download('system/DiyCity/export', {
|
this.download('system/DiyCity/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `DiyCity_${new Date().getTime()}.xlsx`)
|
}, `DiyCity_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
expandAll() {
|
||||||
|
this.$refs.tree.store.nodesMap.forEach(node => {
|
||||||
|
this.$refs.tree.store.expandNode(node, true)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
collapseAll() {
|
||||||
|
this.$refs.tree.store.nodesMap.forEach(node => {
|
||||||
|
this.$refs.tree.store.collapseNode(node, true)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleNodeClick(data) {
|
||||||
|
console.log(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,297 +1,396 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="sysseting-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-tabs v-model="activeTab">
|
||||||
<el-form-item label="名称" prop="name">
|
<el-tab-pane label="基本信息" name="base">
|
||||||
<el-input
|
<el-form :model="baseForm" label-width="120px" class="tab-form">
|
||||||
v-model="queryParams.name"
|
<el-form-item label="投诉电话">
|
||||||
placeholder="请输入名称"
|
<el-input v-model="baseForm.phone" placeholder="请输入投诉电话" style="width: 300px" />
|
||||||
clearable
|
</el-form-item>
|
||||||
@keyup.enter.native="handleQuery"
|
<el-form-item label="抢单开始时间">
|
||||||
/>
|
<el-time-picker v-model="baseForm.startTime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="width: 150px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="${comment}" prop="createdAt">
|
<el-form-item label="抢单结束时间">
|
||||||
<el-date-picker clearable
|
<el-time-picker v-model="baseForm.endTime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="width: 150px" />
|
||||||
v-model="queryParams.createdAt"
|
</el-form-item>
|
||||||
type="date"
|
<el-form-item label="质保金扣除比例">
|
||||||
value-format="yyyy-MM-dd"
|
<el-input-number v-model="baseForm.marginRate" :min="0" :max="100" />
|
||||||
placeholder="请选择${comment}">
|
<span style="margin-left: 8px">%</span>
|
||||||
</el-date-picker>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="下单送积分">
|
||||||
<el-form-item label="${comment}" prop="updatedAt">
|
<el-input v-model="baseForm.orderScore" style="width: 120px" />
|
||||||
<el-date-picker clearable
|
<el-tooltip content="下单支付金额多少元赠送1积分,不填则不赠送" placement="right">
|
||||||
v-model="queryParams.updatedAt"
|
<i class="el-icon-question" style="margin-left: 8px; color: #999" />
|
||||||
type="date"
|
</el-tooltip>
|
||||||
value-format="yyyy-MM-dd"
|
</el-form-item>
|
||||||
placeholder="请选择${comment}">
|
<el-form-item label="搜索热词">
|
||||||
</el-date-picker>
|
<el-select v-model="baseForm.hotwords" multiple filterable allow-create default-first-option placeholder="请输入热词" style="width: 600px">
|
||||||
</el-form-item>
|
<el-option v-for="item in baseForm.hotwords" :key="item" :label="item" :value="item" />
|
||||||
<el-form-item>
|
</el-select>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
</el-form-item>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-form-item label="客服二维码">
|
||||||
</el-form-item>
|
<el-upload
|
||||||
</el-form>
|
class="avatar-uploader"
|
||||||
|
action="#"
|
||||||
<el-row :gutter="10" class="mb8">
|
:show-file-list="false"
|
||||||
<el-col :span="1.5">
|
:on-change="handleQrChange"
|
||||||
<el-button
|
:before-upload="beforeQrUpload"
|
||||||
type="primary"
|
>
|
||||||
plain
|
<img v-if="baseForm.qrUrl" :src="baseForm.qrUrl" class="qr-img" />
|
||||||
icon="el-icon-plus"
|
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
||||||
size="mini"
|
</el-upload>
|
||||||
@click="handleAdd"
|
</el-form-item>
|
||||||
v-hasPermi="['system:SiteConfig:add']"
|
<el-form-item>
|
||||||
>新增</el-button>
|
<el-button type="primary" @click="saveAllConfig('1')">提交</el-button>
|
||||||
</el-col>
|
<el-button @click="resetBase">重置</el-button>
|
||||||
<el-col :span="1.5">
|
</el-form-item>
|
||||||
<el-button
|
</el-form>
|
||||||
type="success"
|
</el-tab-pane>
|
||||||
plain
|
<el-tab-pane label="文本配置" name="text">
|
||||||
icon="el-icon-edit"
|
<el-form :model="textForm" label-width="120px" class="tab-form">
|
||||||
size="mini"
|
<el-form-item label="公司名称">
|
||||||
:disabled="single"
|
<el-input v-model="textForm.company" placeholder="请输入公司名称" />
|
||||||
@click="handleUpdate"
|
</el-form-item>
|
||||||
v-hasPermi="['system:SiteConfig:edit']"
|
<el-form-item label="简介">
|
||||||
>修改</el-button>
|
<el-input type="textarea" v-model="textForm.intro" :rows="4" placeholder="请输入公司简介" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="1.5">
|
<el-form-item label="质保金说明">
|
||||||
<el-button
|
<quill-editor v-model="textForm.marginDesc" :options="editorOptions" />
|
||||||
type="danger"
|
</el-form-item>
|
||||||
plain
|
<el-form-item>
|
||||||
icon="el-icon-delete"
|
<el-button type="primary" @click="saveAllConfig('2')">提交</el-button>
|
||||||
size="mini"
|
<el-button @click="resetText">重置</el-button>
|
||||||
:disabled="multiple"
|
</el-form-item>
|
||||||
@click="handleDelete"
|
</el-form>
|
||||||
v-hasPermi="['system:SiteConfig:remove']"
|
</el-tab-pane>
|
||||||
>删除</el-button>
|
<el-tab-pane label="下单时间配置" name="orderTime">
|
||||||
</el-col>
|
<el-form label-width="120px" class="tab-form">
|
||||||
<el-col :span="1.5">
|
<el-form-item label="下单时间">
|
||||||
<el-button
|
<div v-for="(item, idx) in orderTimes" :key="idx" style="display: flex; align-items: center; margin-bottom: 8px;">
|
||||||
type="warning"
|
<el-time-picker
|
||||||
plain
|
v-model="item.start"
|
||||||
icon="el-icon-download"
|
placeholder="开始时间"
|
||||||
size="mini"
|
format="HH:mm"
|
||||||
@click="handleExport"
|
value-format="HH:mm"
|
||||||
v-hasPermi="['system:SiteConfig:export']"
|
style="width: 130px; margin-right: 8px;"
|
||||||
>导出</el-button>
|
@change="updateTimeRange(idx)"
|
||||||
</el-col>
|
/>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<span style="margin: 0 4px;">-</span>
|
||||||
</el-row>
|
<el-time-picker
|
||||||
|
v-model="item.end"
|
||||||
<el-table v-loading="loading" :data="SiteConfigList" @selection-change="handleSelectionChange">
|
placeholder="结束时间"
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
format="HH:mm"
|
||||||
<el-table-column label="${comment}" align="center" prop="id" />
|
value-format="HH:mm"
|
||||||
<el-table-column label="名称" align="center" prop="name" />
|
style="width: 130px; margin-right: 12px;"
|
||||||
<el-table-column label="值" align="center" prop="value" />
|
@change="updateTimeRange(idx)"
|
||||||
<el-table-column label="${comment}" align="center" prop="createdAt" width="180">
|
/>
|
||||||
<template slot-scope="scope">
|
<el-input-number v-model="item.count" :min="0" style="width:25%; margin-right: 12px;" />
|
||||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
<el-button icon="el-icon-delete" type="danger" @click="removeOrderTime(idx)" circle />
|
||||||
</template>
|
</div>
|
||||||
</el-table-column>
|
<el-button type="primary" icon="el-icon-plus" @click="addOrderTime">新增</el-button>
|
||||||
<el-table-column label="${comment}" align="center" prop="updatedAt" width="180">
|
</el-form-item>
|
||||||
<template slot-scope="scope">
|
<el-form-item>
|
||||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
<el-button type="primary" @click="saveAllConfig('3')">提交</el-button>
|
||||||
</template>
|
<el-button @click="resetOrderTime">重置</el-button>
|
||||||
</el-table-column>
|
</el-form-item>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
</el-form>
|
||||||
<template slot-scope="scope">
|
</el-tab-pane>
|
||||||
<el-button
|
<el-tab-pane label="时间配置" name="time">
|
||||||
size="mini"
|
<el-form :model="timeForm" label-width="120px" class="tab-form">
|
||||||
type="text"
|
<el-form-item label="每月提现时间">
|
||||||
icon="el-icon-edit"
|
<el-select v-model="timeForm.withdrawDays" multiple placeholder="请选择日期" style="width: 300px">
|
||||||
@click="handleUpdate(scope.row)"
|
<el-option v-for="d in 31" :key="d" :label="d + '号'" :value="d + '号'" />
|
||||||
v-hasPermi="['system:SiteConfig:edit']"
|
</el-select>
|
||||||
>修改</el-button>
|
</el-form-item>
|
||||||
<el-button
|
<el-form-item label="定时接单时长">
|
||||||
size="mini"
|
<el-input-number v-model="timeForm.autoOrderMinutes" :min="1" style="width: 120px" />
|
||||||
type="text"
|
<span style="margin-left: 8px">分钟</span>
|
||||||
icon="el-icon-delete"
|
<div class="el-form-item__tip">订单无人接单时多少分钟后,自动重新派单。单位(分钟)</div>
|
||||||
@click="handleDelete(scope.row)"
|
</el-form-item>
|
||||||
v-hasPermi="['system:SiteConfig:remove']"
|
<el-form-item label="取消订单时长">
|
||||||
>删除</el-button>
|
<el-input-number v-model="timeForm.cancelOrderDays" :min="1" style="width: 120px" />
|
||||||
</template>
|
<span style="margin-left: 8px">天</span>
|
||||||
</el-table-column>
|
<div class="el-form-item__tip">师傅到达之后,多久之后没有报工则取消订单。单位(天)</div>
|
||||||
</el-table>
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
<pagination
|
<el-button type="primary" @click="saveAllConfig('4')">提交</el-button>
|
||||||
v-show="total>0"
|
<el-button @click="resetTime">重置</el-button>
|
||||||
:total="total"
|
</el-form-item>
|
||||||
:page.sync="queryParams.pageNum"
|
</el-form>
|
||||||
:limit.sync="queryParams.pageSize"
|
</el-tab-pane>
|
||||||
@pagination="getList"
|
</el-tabs>
|
||||||
/>
|
<el-button type="primary" style="margin-top: 24px;" @click="saveAllConfig">保存全部配置</el-button>
|
||||||
|
|
||||||
<!-- 添加或修改系统配置对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="名称" prop="name">
|
|
||||||
<el-input v-model="form.name" placeholder="请输入名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="值" prop="value">
|
|
||||||
<el-input v-model="form.value" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="${comment}" prop="createdAt">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="form.createdAt"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="请选择${comment}">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="${comment}" prop="updatedAt">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="form.updatedAt"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="请选择${comment}">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listSiteConfig, getSiteConfig, delSiteConfig, addSiteConfig, updateSiteConfig } from "@/api/system/SiteConfig"
|
import { listSiteConfig, getSiteConfig, delSiteConfig, addSiteConfig, updateSiteConfig } from "@/api/system/SiteConfig"
|
||||||
|
import { quillEditor } from 'vue-quill-editor'
|
||||||
|
import 'quill/dist/quill.core.css'
|
||||||
|
import 'quill/dist/quill.snow.css'
|
||||||
|
import 'quill/dist/quill.bubble.css'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SiteConfig",
|
name: 'SysSeting',
|
||||||
|
components: {
|
||||||
|
quillEditor
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
activeTab: 'base',
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 系统配置表格数据
|
|
||||||
SiteConfigList: [],
|
SiteConfigList: [],
|
||||||
// 弹出层标题
|
config_one: {},
|
||||||
title: "",
|
config_two: {},
|
||||||
// 是否显示弹出层
|
config_three: {},
|
||||||
open: false,
|
config_four: {},
|
||||||
// 查询参数
|
total: 0, // 系统配置表格数据
|
||||||
queryParams: {
|
// 基本信息
|
||||||
pageNum: 1,
|
baseForm: {
|
||||||
pageSize: 10,
|
phone: '',
|
||||||
name: null,
|
startTime: '',
|
||||||
value: null,
|
endTime: '',
|
||||||
createdAt: null,
|
marginRate: 10,
|
||||||
updatedAt: null
|
orderScore: 100,
|
||||||
|
hotwords: ['水电维修', '家电清洗', '灯具维修', '墙面翻新', '门窗家具', '疏通维修', '防水维修'],
|
||||||
|
qrUrl: ''
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 文本配置
|
||||||
form: {},
|
textForm: {
|
||||||
// 表单校验
|
company: '',
|
||||||
rules: {
|
intro: '',
|
||||||
|
marginDesc: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
// 下单时间配置
|
||||||
|
orderTimes: [
|
||||||
|
|
||||||
|
],
|
||||||
|
// 时间配置
|
||||||
|
timeForm: {
|
||||||
|
withdrawDays: ['8号', '18号', '28号'],
|
||||||
|
autoOrderMinutes: 10,
|
||||||
|
cancelOrderDays: 7
|
||||||
|
},
|
||||||
|
editorOptions: {
|
||||||
|
placeholder: '请输入质保金说明...'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询系统配置列表 */
|
/** 查询系统配置列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
listSiteConfig(this.queryParams).then(response => {
|
listSiteConfig(this.queryParams).then(response => {
|
||||||
this.SiteConfigList = response.rows
|
this.SiteConfigList = response.rows
|
||||||
|
|
||||||
|
// config_one 基本信息
|
||||||
|
this.config_one=response.rows.find(item => item.name === 'config_one')
|
||||||
|
const configOneObj =JSON.parse(this.config_one.value)
|
||||||
|
|
||||||
|
|
||||||
|
if (configOneObj) {
|
||||||
|
this.baseForm = {
|
||||||
|
phone: configOneObj.phone || '',
|
||||||
|
startTime:configOneObj.loot_start || '',
|
||||||
|
endTime: configOneObj.loot_end || '',
|
||||||
|
marginRate: configOneObj.margin || 10,
|
||||||
|
orderScore: configOneObj.orderScore || 100,
|
||||||
|
hotwords: configOneObj.hot || [],
|
||||||
|
qrUrl: configOneObj.kf || '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// config_two 文本配置
|
||||||
|
this.config_two=response.rows.find(item => item.name === 'config_two')
|
||||||
|
const configTwoObj =JSON.parse(this.config_two.value)
|
||||||
|
|
||||||
|
if (configTwoObj) {
|
||||||
|
this.textForm = {
|
||||||
|
company: configTwoObj.name || '',
|
||||||
|
intro: configTwoObj.brief || '',
|
||||||
|
marginDesc: configTwoObj.money_explain || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// config_three 下单时间配置
|
||||||
|
this.config_three=response.rows.find(item => item.name === 'config_three')
|
||||||
|
|
||||||
|
let _data=JSON.parse(this.config_three.value)
|
||||||
|
for(let key in _data.time){
|
||||||
|
const [start, end] =_data.time[key].key.split('-');
|
||||||
|
this.orderTimes.push({
|
||||||
|
start: start || '',
|
||||||
|
end: end || '',
|
||||||
|
count: _data.time[key].num || 99
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// config_four 时间配置
|
||||||
|
this.config_four=response.rows.find(item => item.name === 'config_four')
|
||||||
|
const configFourObj =JSON.parse(this.config_four.value)
|
||||||
|
|
||||||
|
if (configFourObj) {
|
||||||
|
this.timeForm = {
|
||||||
|
withdrawDays: configFourObj.time || [],
|
||||||
|
autoOrderMinutes: configFourObj.order_time || 10,
|
||||||
|
cancelOrderDays: configFourObj.remove_time || 7
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.total = response.total
|
this.total = response.total
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 基本信息
|
||||||
cancel() {
|
submitBase() {
|
||||||
this.open = false
|
this.$message.success('提交成功(模拟)')
|
||||||
this.reset()
|
|
||||||
},
|
},
|
||||||
// 表单重置
|
resetBase() {
|
||||||
reset() {
|
this.$refs.baseForm && this.$refs.baseForm.resetFields && this.$refs.baseForm.resetFields()
|
||||||
this.form = {
|
},
|
||||||
id: null,
|
handleQrChange(file) {
|
||||||
name: null,
|
// 模拟上传二维码
|
||||||
value: null,
|
const reader = new FileReader()
|
||||||
createdAt: null,
|
reader.onload = e => {
|
||||||
updatedAt: null
|
this.baseForm.qrUrl = e.target.result
|
||||||
}
|
}
|
||||||
this.resetForm("form")
|
reader.readAsDataURL(file.raw)
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
beforeQrUpload(file) {
|
||||||
handleQuery() {
|
const isImg = file.type.startsWith('image/')
|
||||||
this.queryParams.pageNum = 1
|
if (!isImg) {
|
||||||
this.getList()
|
this.$message.error('只能上传图片格式')
|
||||||
|
}
|
||||||
|
return isImg
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
// 文本配置
|
||||||
resetQuery() {
|
submitText() {
|
||||||
this.resetForm("queryForm")
|
this.$message.success('提交成功(模拟)')
|
||||||
this.handleQuery()
|
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
resetText() {
|
||||||
handleSelectionChange(selection) {
|
this.textForm = { company: '', intro: '', marginDesc: '' }
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
// 下单时间配置
|
||||||
handleAdd() {
|
updateTimeRange(idx) {
|
||||||
this.reset()
|
const item = this.orderTimes[idx];
|
||||||
this.open = true
|
if (item.start && item.end && item.start >= item.end) {
|
||||||
this.title = "添加系统配置"
|
this.$message.error('结束时间必须大于开始时间');
|
||||||
|
item.end = '';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
addOrderTime() {
|
||||||
handleUpdate(row) {
|
this.orderTimes.push({ start: '', end: '', count: 99 });
|
||||||
this.reset()
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getSiteConfig(id).then(response => {
|
|
||||||
this.form = response.data
|
|
||||||
this.open = true
|
|
||||||
this.title = "修改系统配置"
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
removeOrderTime(idx) {
|
||||||
submitForm() {
|
this.orderTimes.splice(idx, 1)
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateSiteConfig(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功")
|
|
||||||
this.open = false
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
addSiteConfig(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功")
|
|
||||||
this.open = false
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
submitOrderTime() {
|
||||||
handleDelete(row) {
|
// 提交时拼接时间段
|
||||||
const ids = row.id || this.ids
|
const timeList = this.orderTimes.map(item => ({
|
||||||
this.$modal.confirm('是否确认删除系统配置编号为"' + ids + '"的数据项?').then(function() {
|
time: `${item.start}-${item.end}`,
|
||||||
return delSiteConfig(ids)
|
count: item.count
|
||||||
}).then(() => {
|
}));
|
||||||
this.getList()
|
// 这里可以将 timeList 发送给后端
|
||||||
this.$modal.msgSuccess("删除成功")
|
this.$message.success('提交成功(模拟)')
|
||||||
}).catch(() => {})
|
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
resetOrderTime() {
|
||||||
handleExport() {
|
this.orderTimes = [
|
||||||
this.download('system/SiteConfig/export', {
|
|
||||||
...this.queryParams
|
]
|
||||||
}, `SiteConfig_${new Date().getTime()}.xlsx`)
|
},
|
||||||
|
// 时间配置
|
||||||
|
submitTime() {
|
||||||
|
this.$message.success('提交成功(模拟)')
|
||||||
|
},
|
||||||
|
resetTime() {
|
||||||
|
this.timeForm = { withdrawDays: ['8号', '18号', '28号'], autoOrderMinutes: 10, cancelOrderDays: 7 }
|
||||||
|
},
|
||||||
|
async saveAllConfig(e) {
|
||||||
|
// 1. 组装 config_one
|
||||||
|
const config_one = {
|
||||||
|
phone: this.baseForm.phone,
|
||||||
|
loot_start: this.baseForm.startTime,
|
||||||
|
loot_end: this.baseForm.endTime,
|
||||||
|
margin: this.baseForm.marginRate,
|
||||||
|
orderScore: this.baseForm.orderScore,
|
||||||
|
hot: this.baseForm.hotwords,
|
||||||
|
kf: this.baseForm.qrUrl
|
||||||
|
};
|
||||||
|
// 2. 组装 config_two
|
||||||
|
const config_two = {
|
||||||
|
name: this.textForm.company,
|
||||||
|
brief: this.textForm.intro,
|
||||||
|
money_explain: this.textForm.marginDesc
|
||||||
|
};
|
||||||
|
// 3. 组装 config_three
|
||||||
|
const config_three = {
|
||||||
|
time: this.orderTimes.map(item => ({
|
||||||
|
key: `${item.start}-${item.end}`,
|
||||||
|
num: item.count
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
// 4. 组装 config_four
|
||||||
|
const config_four = {
|
||||||
|
time: this.timeForm.withdrawDays,
|
||||||
|
order_time: this.timeForm.autoOrderMinutes,
|
||||||
|
remove_time: this.timeForm.cancelOrderDays
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
if(e=='1'){
|
||||||
|
await updateSiteConfig({ name: 'config_one',id:this.config_one.id, value: JSON.stringify(config_one) });
|
||||||
|
}else if(e=='2'){
|
||||||
|
await updateSiteConfig({ name: 'config_two',id:this.config_two.id, value: JSON.stringify(config_two) });
|
||||||
|
}else if(e=='3'){
|
||||||
|
await updateSiteConfig({ name: 'config_three',id:this.config_three.id, value: JSON.stringify(config_three) });
|
||||||
|
}else if(e=='4'){
|
||||||
|
await updateSiteConfig({ name: 'config_four',id:this.config_four.id, value: JSON.stringify(config_four) });
|
||||||
|
}
|
||||||
|
this.$message.success('保存成功!');
|
||||||
|
this.getList();
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error('保存失败,请重试');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.sysseting-container {
|
||||||
|
background: #fff;
|
||||||
|
padding: 24px;
|
||||||
|
min-height: 600px;
|
||||||
|
}
|
||||||
|
.tab-form {
|
||||||
|
max-width: 900px;
|
||||||
|
}
|
||||||
|
.qr-img {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.avatar-uploader .el-upload {
|
||||||
|
border: 1px dashed #d9d9d9;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.avatar-uploader-icon {
|
||||||
|
font-size: 32px;
|
||||||
|
color: #8c939d;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue