Merge branch 'master' of http://61.174.243.28:15863/chuangte/electripper-v2-ui
This commit is contained in:
commit
08ab8a5f56
|
@ -1,14 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="广告图片" prop="picture">
|
||||
<el-input
|
||||
v-model="queryParams.picture"
|
||||
placeholder="请输入广告图片"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转链接" prop="url">
|
||||
<el-input
|
||||
v-model="queryParams.url"
|
||||
|
@ -17,14 +9,18 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="逻辑删除标志,0否,1是" prop="deleted">
|
||||
<el-input
|
||||
v-model="queryParams.deleted"
|
||||
placeholder="请输入逻辑删除标志,0否,1是"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
||||
<el-form-item label="广告类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择广告类型" @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ad_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
@ -32,27 +28,27 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-has-permi="['bst:ad:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-has-permi="['bst:ad:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
<!-- v-has-permi="['bst:ad:add']"-->
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-has-permi="['bst:ad:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
|
@ -68,28 +64,23 @@
|
|||
|
||||
<el-table v-loading="loading" :data="adList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'adId'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="广告类型" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ad_type" :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="广告图片" align="center" prop="picture" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="跳转类型" align="center" prop="urlType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ad_url_type" :value="scope.row.urlType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="跳转链接" align="center" prop="url" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -99,13 +90,13 @@
|
|||
@click="handleUpdate(scope.row)"
|
||||
v-has-permi="['bst:ad:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-has-permi="['bst:ad:remove']"
|
||||
>删除</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-has-permi="['bst:ad:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -119,22 +110,37 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改广告对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<form-col :span="span" label="广告图片" prop="picture">
|
||||
<el-input v-model="form.picture" placeholder="请输入广告图片" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="跳转链接" prop="url">
|
||||
<el-input v-model="form.url" placeholder="请输入跳转链接" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="逻辑删除标志,0否,1是" prop="deleted">
|
||||
<el-input v-model="form.deleted" placeholder="请输入逻辑删除标志,0否,1是" />
|
||||
</form-col>
|
||||
</el-row>
|
||||
<el-form-item label="广告类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择广告类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ad_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="广告图片" prop="picture">
|
||||
<image-upload v-model="form.picture" :limit="1"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转类型" prop="urlType">
|
||||
<el-select v-model="form.urlType" placeholder="请选择跳转类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ad_url_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转链接" prop="url">
|
||||
<el-input v-model="form.url" placeholder="请输入跳转链接" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -157,6 +163,7 @@ const defaultSort = {
|
|||
|
||||
export default {
|
||||
name: "Ad",
|
||||
dicts:['ad_type','ad_url_type'],
|
||||
mixins: [$showColumns],
|
||||
components: {FormCol},
|
||||
data() {
|
||||
|
@ -164,13 +171,13 @@ export default {
|
|||
span: 24,
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'adId', visible: true, label: '广告ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'type', visible: true, label: '广告类型 1:活动推广', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'adId', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'type', visible: true, label: '广告类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'picture', visible: true, label: '广告图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'url', visible: true, label: '跳转链接', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'deleted', visible: true, label: '逻辑删除标志,0否,1是', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'urlType', visible: true, label: '跳转类型,1外链跳转,2站内跳转', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
//{key: 'deleted', visible: true, label: '逻辑删除标志,0否,1是', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
//{key: 'urlType', visible: true, label: '跳转类型,1外链跳转,2站内跳转', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
|
@ -208,17 +215,17 @@ export default {
|
|||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
deleted: [
|
||||
{ required: true, message: "逻辑删除标志,0否,1是不能为空", trigger: "blur" }
|
||||
],
|
||||
urlType: [
|
||||
{ required: true, message: "跳转类型,1外链跳转,2站内跳转不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
// rules: {
|
||||
// createTime: [
|
||||
// { required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
// ],
|
||||
// deleted: [
|
||||
// { required: true, message: "逻辑删除标志,0否,1是不能为空", trigger: "blur" }
|
||||
// ],
|
||||
// urlType: [
|
||||
// { required: true, message: "跳转类型,1外链跳转,2站内跳转不能为空", trigger: "change" }
|
||||
// ]
|
||||
// }
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
<form-col :span="span" label="联系人" prop="contact">
|
||||
<el-input v-model="form.contact" placeholder="请输入联系人" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||
<form-col :span="span" label="联系联系方式" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系联系方式" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
|
@ -30,9 +30,9 @@
|
|||
</el-radio-group>
|
||||
</form-col>
|
||||
<form-col :span="span" label="运营时间" prop="areaTimeStart" tip="超出营业时间后,将无法继续下单">
|
||||
<el-time-picker
|
||||
is-range
|
||||
v-model="timeRange"
|
||||
<el-time-picker
|
||||
is-range
|
||||
v-model="timeRange"
|
||||
placeholder="请选择运营时间"
|
||||
value-format="HH:mm:ss"
|
||||
start-placeholder="开始时间"
|
||||
|
@ -272,4 +272,4 @@ export default {
|
|||
.dialog-footer {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -35,10 +35,10 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-form-item label="联系联系方式" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入联系电话"
|
||||
placeholder="请输入联系联系方式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
@ -108,9 +108,9 @@
|
|||
</template>
|
||||
<template v-else-if="column.key === 'subArea'">
|
||||
<el-button type="text" size="mini" @click="handleSubArea(d.row.id)">
|
||||
停车区({{d.row.parkingAreaCount | dv}})
|
||||
禁停区({{d.row.noParkingAreaCount | dv}})
|
||||
禁行区({{d.row.noRideAreaCount | dv}})
|
||||
停车区({{d.row.parkingAreaCount | dv}})
|
||||
禁停区({{d.row.noParkingAreaCount | dv}})
|
||||
禁行区({{d.row.noRideAreaCount | dv}})
|
||||
点击管理
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -173,7 +173,7 @@ export default {
|
|||
{key: 'userName', visible: true, label: '运营商', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
// {key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'contact', visible: true, label: '联系人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'phone', visible: true, label: '联系电话', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'phone', visible: true, label: '联系联系方式', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'subArea', visible: true, label: '下属区域', minWidth: "200", sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createName', visible: true, label: '创建人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
|
|
|
@ -137,9 +137,9 @@
|
|||
/>
|
||||
|
||||
<!-- 引入运营加盟编辑对话框组件 -->
|
||||
<area-join-edit-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:id="editId"
|
||||
<area-join-edit-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:id="editId"
|
||||
:init-data="initData"
|
||||
@success="getList"
|
||||
/>
|
||||
|
|
|
@ -146,9 +146,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {getArticleCategory, listArticleCategory} from "@/api/bst/articleCategory.js";
|
||||
import {getArticleCategory, listArticleCategory,delArticleCategory,addArticleCategory} from "@/api/bst/articleCategory.js";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {delArea} from "@/api/bst/area";
|
||||
|
||||
export default {
|
||||
name: "ArticleCategory",
|
||||
|
@ -311,13 +312,14 @@
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除文章分类编号为"' + row.id + '"的数据项?').then(function() {
|
||||
return delArticleCategory(row.id);
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除运营区编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delArticleCategory(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,184 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="500px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
@open="handleOpen"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-loading="loading">
|
||||
<el-row>
|
||||
<form-col :span="span" label="运营区" prop="areaId">
|
||||
<area-remote-select v-model="form.areaId" :init-options="initAreaOptions" style="width: 100%;" v-if="!loading"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入客服姓名" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="联系方式" prop="contact">
|
||||
<el-input v-model="form.contact" placeholder="请输入客服联系方式" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="上班时间" prop="startTime">
|
||||
<el-time-picker clearable
|
||||
v-model="form.startTime"
|
||||
type="time"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
placeholder="选择时间">
|
||||
</el-time-picker>
|
||||
</form-col>
|
||||
<form-col :span="span" label="下班时间" prop="endTime">
|
||||
<el-time-picker clearable
|
||||
v-model="form.endTime"
|
||||
type="time"
|
||||
format="HH:mm:ss"
|
||||
value-format="HH:mm:ss"
|
||||
placeholder="选择时间">
|
||||
</el-time-picker>
|
||||
</form-col>
|
||||
<form-col :span="span" label="客服状态" prop="isEnabled">
|
||||
<el-select v-model="form.isEnabled" placeholder="客服状态" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in dict.type.customer_service_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</form-col>
|
||||
|
||||
</el-row>
|
||||
</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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getCustomerService,updateCustomerService,addCustomerService} from "@/api/bst/customerService";
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import UserInput from "@/components/Business/User/UserInput.vue";
|
||||
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
||||
import {getArea} from "@/api/bst/area";
|
||||
export default{
|
||||
name:'CustomerServiceEditDialog',
|
||||
components: {AreaRemoteSelect,FormCol,UserInput},
|
||||
dicts:['customer_service_status'],
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
id: {
|
||||
type: [String, Number],
|
||||
default: null
|
||||
},
|
||||
initData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
span: 24,
|
||||
title: '',
|
||||
form: {},
|
||||
loading: false,
|
||||
rules:{
|
||||
areaId: [
|
||||
{ required: true, message: "运营区不能为空", trigger: "change" }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" }
|
||||
],
|
||||
contact: [
|
||||
{ required: true, message: "联系方式不能为空", trigger: "blur" },
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: "上班时间不能为空", trigger: "change" }
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: "下班时间不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogVisible: {
|
||||
get() { return this.visible; },
|
||||
set(val) { this.$emit('update:visible', val); }
|
||||
},
|
||||
initAreaOptions() {
|
||||
return [{id: this.form.areaId, name: this.form.areaName}]
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleOpen() {
|
||||
if (this.id == null) {
|
||||
this.reset();
|
||||
this.title = "新增客服";
|
||||
} else {
|
||||
this.getDetail();
|
||||
this.title = "修改客服";
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
areaId: null,
|
||||
name: null,
|
||||
contact: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
isEnabled: "1", // 默认启用
|
||||
...this.initData
|
||||
};
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form && this.$refs.form.clearValidate();
|
||||
});
|
||||
},
|
||||
async getDetail() {
|
||||
this.loading = true;
|
||||
try {
|
||||
// 1. 获取客服信息
|
||||
const customerRes = await getCustomerService(this.id);
|
||||
this.form = customerRes.data;
|
||||
|
||||
// 2. 根据 areaId 获取区域名称
|
||||
if (this.form.areaId) {
|
||||
const areaRes = await getArea(this.form.areaId); // 替换为实际接口
|
||||
this.form.areaName = areaRes.data.name; // 假设接口返回 name 字段
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("加载区域信息失败:", error);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
const promise = this.form.id != null ? updateCustomerService(this.form) : addCustomerService(this.form);
|
||||
promise.then(response => {
|
||||
this.$modal.msgSuccess(this.form.id != null ? "修改成功" : "新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.dialogVisible = false;
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
|
@ -1,21 +1,8 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="客服信息id" prop="id">
|
||||
<el-input
|
||||
v-model="queryParams.id"
|
||||
placeholder="请输入客服信息id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属运营区id" prop="areaId">
|
||||
<el-input
|
||||
v-model="queryParams.areaId"
|
||||
placeholder="请输入所属运营区id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" >
|
||||
<el-form-item :span="span" label="运营区" prop="areaId">
|
||||
<area-remote-select v-model="queryParams.areaId" :init-options="initAreaOptions" style="width: 100%;" @change="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客服姓名" prop="name">
|
||||
<el-input
|
||||
|
@ -25,44 +12,29 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="客服电话" prop="contact">
|
||||
<el-form-item label="联系方式" prop="contact">
|
||||
<el-input
|
||||
v-model="queryParams.contact"
|
||||
placeholder="请输入客服电话"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择工作开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作结束时间" prop="endTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.endTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择工作结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="isEnabled">
|
||||
<el-input
|
||||
v-model="queryParams.isEnabled"
|
||||
placeholder="请输入是否启用"
|
||||
placeholder="请输入联系方式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item >
|
||||
<el-form-item label="客服状态" prop="isEnabled">
|
||||
<el-select v-model="queryParams.isEnabled" placeholder="请选择客服状态" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.customer_service_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -116,9 +88,17 @@
|
|||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="column.key==='isEnabled'">
|
||||
<dict-tag
|
||||
:options="dict.type.customer_service_status"
|
||||
:value="d.row[column.key]"
|
||||
:size="mini"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
@ -150,75 +130,48 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客服对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<form-col :span="span" label="所属运营区id" prop="areaId">
|
||||
<el-input v-model="form.areaId" placeholder="请输入所属运营区id" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="客服姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入客服姓名" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="客服电话" prop="contact">
|
||||
<el-input v-model="form.contact" placeholder="请输入客服电话" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="工作开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择工作开始时间">
|
||||
</el-date-picker>
|
||||
</form-col>
|
||||
<form-col :span="span" label="工作结束时间" prop="endTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.endTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择工作结束时间">
|
||||
</el-date-picker>
|
||||
</form-col>
|
||||
<form-col :span="span" label="是否启用" prop="isEnabled">
|
||||
<el-input v-model="form.isEnabled" placeholder="请输入是否启用" />
|
||||
</form-col>
|
||||
</el-row>
|
||||
</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>
|
||||
|
||||
<!-- 引入客服编辑对话框组件 -->
|
||||
<customer-service-edit-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:id="editId"
|
||||
:init-data="initData"
|
||||
@success="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCustomerService, getCustomerService, delCustomerService, addCustomerService, updateCustomerService } from "@/api/bst/customerService";
|
||||
import { listCustomerService, delCustomerService, addCustomerService, updateCustomerService } from "@/api/bst/customerService";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import CustomerServiceEditDialog from "@/views/bst/customerService/components/CustomerServiceEditDialog.vue";
|
||||
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
prop: "id",
|
||||
order: "descending"
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "CustomerService",
|
||||
mixins: [$showColumns],
|
||||
components: {FormCol},
|
||||
components: {AreaRemoteSelect, CustomerServiceEditDialog, FormCol},
|
||||
dicts:['customer_service_status'],
|
||||
data() {
|
||||
return {
|
||||
span: 24,
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: true, label: '客服信息id', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'areaId', visible: true, label: '所属运营区id', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'name', visible: true, label: '客服姓名', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'contact', visible: true, label: '客服电话', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'startTime', visible: true, label: '工作开始时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'endTime', visible: true, label: '工作结束时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'isEnabled', visible: true, label: '是否启用', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'id', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
//{key: 'areaId', visible: true, label: '所属运营区id', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'areaName', visible: true, label: '所属运营区', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'name', visible: true, label: '姓名', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'contact', visible: true, label: '联系方式', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'startTime', visible: true, label: '上班时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'endTime', visible: true, label: '下班时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
||||
{key: 'isEnabled', visible: true, label: '客服状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
|
@ -238,6 +191,12 @@ export default {
|
|||
customerServiceList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
//对话框显示状态
|
||||
dialogVisible: false,
|
||||
// 编辑id
|
||||
editId: null,
|
||||
// 初始数据
|
||||
initData: {},
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
defaultSort,
|
||||
|
@ -254,23 +213,17 @@ export default {
|
|||
startTime: null,
|
||||
endTime: null,
|
||||
isEnabled: null,
|
||||
deleted:0
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
contact: [
|
||||
{ required: true, message: "客服电话不能为空", trigger: "blur" }
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: "工作开始时间不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
initAreaOptions() {
|
||||
return [{id: this.form.areaId, name: this.form.areaName}]
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
@ -332,19 +285,15 @@ export default {
|
|||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加客服";
|
||||
this.editId = null;
|
||||
this.initData = {};
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getCustomerService(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改客服";
|
||||
});
|
||||
this.editId = row.id || this.ids;
|
||||
this.initData = {};
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user