|
@@ -1,5 +1,6 @@
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import KtCommonTable from "@/views/Core/KtCommonTable.vue";
|
|
import KtCommonTable from "@/views/Core/KtCommonTable.vue";
|
|
|
|
|
+import dayjs from "dayjs";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -63,7 +64,7 @@ export default {
|
|
|
{prop: "userId", label: "工号"},
|
|
{prop: "userId", label: "工号"},
|
|
|
{prop: "receptionist", label: "企微用户"},
|
|
{prop: "receptionist", label: "企微用户"},
|
|
|
{prop: "dutyCustomer", label: "值班客服"},
|
|
{prop: "dutyCustomer", label: "值班客服"},
|
|
|
- // {prop: "dutyCustomer", label: "值班时间"},
|
|
|
|
|
|
|
+ {prop: "dutyDatetime", label: "值班时间"},
|
|
|
],
|
|
],
|
|
|
|
|
|
|
|
rules: {
|
|
rules: {
|
|
@@ -84,6 +85,9 @@ export default {
|
|
|
this.queryPage();
|
|
this.queryPage();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ changeDateTime(value) {
|
|
|
|
|
+ return dayjs(value).format("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ },
|
|
|
queryPage() {
|
|
queryPage() {
|
|
|
this.$api.customerManage.pageQuery(this.queryCondition).then((res) => {
|
|
this.$api.customerManage.pageQuery(this.queryCondition).then((res) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -105,10 +109,6 @@ export default {
|
|
|
this.$message.error(res.msg)
|
|
this.$message.error(res.msg)
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- },
|
|
|
|
|
- // 编辑客服
|
|
|
|
|
- editCustomer(customerID) {
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
// 删除客服
|
|
// 删除客服
|
|
|
deleteCustomer({row}) {
|
|
deleteCustomer({row}) {
|
|
@@ -117,14 +117,10 @@ export default {
|
|
|
this.$message("删除成功")
|
|
this.$message("删除成功")
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- },
|
|
|
|
|
- // 值班配置
|
|
|
|
|
- saveDutyConfig() {
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
// 清除值班配置
|
|
// 清除值班配置
|
|
|
- clearDutyConfig(customerID) {
|
|
|
|
|
- this.$api.customerManage.clearDutyConfig(customerID).then((res) => {
|
|
|
|
|
|
|
+ clearDutyConfig({row}) {
|
|
|
|
|
+ this.$api.customerManage.clearDutyConfig(row.id).then((res) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.$message("清除值班配置成功")
|
|
this.$message("清除值班配置成功")
|
|
|
}
|
|
}
|
|
@@ -287,11 +283,12 @@ export default {
|
|
|
// 获取详情数据
|
|
// 获取详情数据
|
|
|
getDutyConfig(customerId) {
|
|
getDutyConfig(customerId) {
|
|
|
this.$api.customerManage.getDutyConfig(customerId).then(res => {
|
|
this.$api.customerManage.getDutyConfig(customerId).then(res => {
|
|
|
-
|
|
|
|
|
this.formData.dutyCustomerId = res.data.dutyCustomerId
|
|
this.formData.dutyCustomerId = res.data.dutyCustomerId
|
|
|
- if (res.data.dutyDateTimeList != null && res.data.dutyDateTimeList.length > 0) {
|
|
|
|
|
- this.formData.dutyDateTimeList = res.data.dutyDateTimeList
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ res.data.dutyDateTimeList.map(item => {
|
|
|
|
|
+ this.startTime = dayjs(item.startTime).valueOf()
|
|
|
|
|
+ this.endTime = dayjs(item.endTime).valueOf()
|
|
|
|
|
+ })
|
|
|
|
|
+ this.formData.dutyDateTimeList = res.data.dutyDateTimeList
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
openDialog({row}) {
|
|
openDialog({row}) {
|
|
@@ -302,31 +299,40 @@ export default {
|
|
|
this.dialogVisibleDuty = true;
|
|
this.dialogVisibleDuty = true;
|
|
|
},
|
|
},
|
|
|
addTime() {
|
|
addTime() {
|
|
|
- this.formData.dutyTimes.push({
|
|
|
|
|
|
|
+ this.formData.dutyDateTimeList.push({
|
|
|
startTime: new Date().setHours(8, 30, 0),
|
|
startTime: new Date().setHours(8, 30, 0),
|
|
|
endTime: new Date().setHours(18, 30, 0)
|
|
endTime: new Date().setHours(18, 30, 0)
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
removeTime(index) {
|
|
removeTime(index) {
|
|
|
- if (this.formData.dutyTimes.length === 1) {
|
|
|
|
|
|
|
+ if (this.formData.dutyDateTimeList.length === 1) {
|
|
|
this.$message.warning('请至少保留一条数据');
|
|
this.$message.warning('请至少保留一条数据');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.formData.dutyTimes.splice(index, 1);
|
|
|
|
|
|
|
+ this.formData.dutyDateTimeList.splice(index, 1);
|
|
|
},
|
|
},
|
|
|
handleCancel() {
|
|
handleCancel() {
|
|
|
this.resetFormData();
|
|
this.resetFormData();
|
|
|
this.dialogVisibleDuty = false;
|
|
this.dialogVisibleDuty = false;
|
|
|
this.$message({type: 'info', message: '已取消操作'});
|
|
this.$message({type: 'info', message: '已取消操作'});
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ dutyConfigData() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ customerId: this.formData.customerId,
|
|
|
|
|
+ dutyCustomerId: this.formData.dutyCustomerId,
|
|
|
|
|
+ dutyDateTimeList: this.formData.dutyDateTimeList.map(t => ({
|
|
|
|
|
+ startTime: dayjs(t.start).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
+ endTime: dayjs(t.end).format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
+ }))
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 确认操作
|
|
// 确认操作
|
|
|
handleConfirm() {
|
|
handleConfirm() {
|
|
|
// 数据校验
|
|
// 数据校验
|
|
|
if (!this.validateTime()) return;
|
|
if (!this.validateTime()) return;
|
|
|
|
|
|
|
|
// 提交逻辑(示例)
|
|
// 提交逻辑(示例)
|
|
|
- this.$api.customerManage.dutyConfig(this.formData)
|
|
|
|
|
|
|
+ this.$api.customerManage.dutyConfig(this.dutyConfigData())
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
@@ -343,7 +349,7 @@ export default {
|
|
|
|
|
|
|
|
// 时间有效性校验
|
|
// 时间有效性校验
|
|
|
validateTime() {
|
|
validateTime() {
|
|
|
- for (const time of this.formData.dutyTimes) {
|
|
|
|
|
|
|
+ for (const time of this.formData.dutyDateTimeList) {
|
|
|
if (new Date(time.start) >= new Date(time.end)) {
|
|
if (new Date(time.start) >= new Date(time.end)) {
|
|
|
this.$message.error('结束时间必须晚于开始时间');
|
|
this.$message.error('结束时间必须晚于开始时间');
|
|
|
return false;
|
|
return false;
|
|
@@ -354,7 +360,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
showAddButton() {
|
|
showAddButton() {
|
|
|
- return this.formData.dutyTimes.length < 10;
|
|
|
|
|
|
|
+ return this.formData.dutyDateTimeList.length < 10;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
@@ -381,6 +387,7 @@ export default {
|
|
|
button2Name="编辑" @handleButton2="handleEdit"
|
|
button2Name="编辑" @handleButton2="handleEdit"
|
|
|
button3Name="删除" @handleButton3="deleteCustomer"
|
|
button3Name="删除" @handleButton3="deleteCustomer"
|
|
|
button4Name="值班配置" @handleButton4="openDialog"
|
|
button4Name="值班配置" @handleButton4="openDialog"
|
|
|
|
|
+ button5Name="清除值班配置" @handleButton5="clearDutyConfig"
|
|
|
>
|
|
>
|
|
|
</kt-common-table>
|
|
</kt-common-table>
|
|
|
|
|
|
|
@@ -488,7 +495,7 @@ export default {
|
|
|
<el-form :model="formData" label-width="100px" label-position="right">
|
|
<el-form :model="formData" label-width="100px" label-position="right">
|
|
|
<!-- 当前客服(只读) -->
|
|
<!-- 当前客服(只读) -->
|
|
|
<el-form-item label="当前客服">
|
|
<el-form-item label="当前客服">
|
|
|
- <el-input v-model="currentService" clearable readonly></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="formData.nickname" width="700px" clearable readonly></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<!-- 值班客服(可编辑) -->
|
|
<!-- 值班客服(可编辑) -->
|