|
|
@ -15,11 +15,11 @@
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template #search>
|
|
|
|
<template #search>
|
|
|
|
<el-form inline>
|
|
|
|
<el-form inline>
|
|
|
|
<el-form-item label="所属系统" prop="systemId">
|
|
|
|
<el-form-item label="所属店铺" prop="storeId">
|
|
|
|
<el-select
|
|
|
|
<el-select
|
|
|
|
v-model="state.condition.systemId"
|
|
|
|
v-model="state.condition.storeId"
|
|
|
|
:config="{ label: 'name', value: 'id' }"
|
|
|
|
:config="{ label: 'name', value: 'id' }"
|
|
|
|
:opts="opts.system"
|
|
|
|
:opts="opts.store"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="客服ID" prop="waiterId">
|
|
|
|
<el-form-item label="客服ID" prop="waiterId">
|
|
|
@ -32,23 +32,29 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</table-list>
|
|
|
|
</table-list>
|
|
|
|
<el-dialog v-model="formState.formVisible" :title="formState.form.id ? '编辑' : '添加' + '店铺'">
|
|
|
|
<el-dialog v-model="formState.formVisible" :title="formState.form.id ? '编辑' : '添加' + '店铺'">
|
|
|
|
<el-form ref="refsForm" label-width="100px" :model="formState.form" :rules="formState.rules">
|
|
|
|
<el-form
|
|
|
|
<el-form-item label="所属系统" prop="systemId">
|
|
|
|
ref="refsForm"
|
|
|
|
|
|
|
|
v-loading="formState.submitting"
|
|
|
|
|
|
|
|
label-width="100px"
|
|
|
|
|
|
|
|
:model="formState.form"
|
|
|
|
|
|
|
|
:rules="formState.rules"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-form-item label="所属店铺" prop="storeId">
|
|
|
|
<el-select
|
|
|
|
<el-select
|
|
|
|
v-model="formState.form.sysId"
|
|
|
|
v-model="formState.form.storeId"
|
|
|
|
:config="{ label: 'name', value: 'id' }"
|
|
|
|
:config="{ label: 'name', value: 'id' }"
|
|
|
|
:disabled="formState.form.id"
|
|
|
|
:disabled="formState.form.id"
|
|
|
|
:opts="opts.system"
|
|
|
|
:opts="opts.store"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="客服类型" prop="type">
|
|
|
|
<el-form-item label="客服类型" prop="type">
|
|
|
|
<el-radio-group v-model="formState.form.type" :opts="opts.type" />
|
|
|
|
<el-input v-model="formState.form.type" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="客服头像" prop="waiterAvatar">
|
|
|
|
<el-form-item label="客服头像" prop="waiterAvatar">
|
|
|
|
<el-upload-image v-model="formState.form.waiterAvatar" config-id="im/" />
|
|
|
|
<el-upload-image v-model="formState.form.waiterAvatar" config-id="im/" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="客服ID" prop="waiterId">
|
|
|
|
<el-form-item label="客服ID" prop="waiterId">
|
|
|
|
<el-input v-model="formState.form.waiterId" />
|
|
|
|
<el-input v-model="formState.form.waiterId" :disabled="!!formState.form.id" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="客服昵称" prop="waiterNickname">
|
|
|
|
<el-form-item label="客服昵称" prop="waiterNickname">
|
|
|
|
<el-input v-model="formState.form.waiterNickname" />
|
|
|
|
<el-input v-model="formState.form.waiterNickname" />
|
|
|
@ -78,35 +84,50 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const state = reactive({
|
|
|
|
const state = reactive({
|
|
|
|
condition: {
|
|
|
|
condition: {
|
|
|
|
systemId: null,
|
|
|
|
storeId: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const handleReset = () => {
|
|
|
|
const handleReset = () => {
|
|
|
|
state.condition = {
|
|
|
|
state.condition = {
|
|
|
|
systemId: null,
|
|
|
|
storeId: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const handleSearch = async () => {
|
|
|
|
const handleSearch = async () => {
|
|
|
|
|
|
|
|
if (state.condition.storeId) {
|
|
|
|
loading.value = true;
|
|
|
|
loading.value = true;
|
|
|
|
await store.dispatch('chatWaiter/search');
|
|
|
|
await store.dispatch('chatWaiter/search');
|
|
|
|
loading.value = false;
|
|
|
|
loading.value = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
|
|
|
() => unref(opts).store,
|
|
|
|
|
|
|
|
(value) => {
|
|
|
|
|
|
|
|
if (!state.condition.storeId) {
|
|
|
|
|
|
|
|
state.condition.storeId = value[0]?.id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
|
() => state.condition,
|
|
|
|
() => state.condition,
|
|
|
|
(value) => {
|
|
|
|
(value) => {
|
|
|
|
store.commit('chatWaiter/setCondition', _.cloneDeep(value));
|
|
|
|
store.commit('chatWaiter/setCondition', _.cloneDeep(value));
|
|
|
|
handleSearch();
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ immediate: true, deep: true }
|
|
|
|
{ immediate: true, deep: true }
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
|
|
|
() => state.condition.storeId,
|
|
|
|
|
|
|
|
() => {
|
|
|
|
|
|
|
|
handleSearch();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
onActivated(() => {
|
|
|
|
onActivated(() => {
|
|
|
|
let sysId = route.query.sysId;
|
|
|
|
let storeId = route.query.storeId;
|
|
|
|
if (sysId) {
|
|
|
|
if (storeId) {
|
|
|
|
state.condition.sysId = +sysId;
|
|
|
|
state.condition.storeId = +storeId;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
handleSearch();
|
|
|
|
handleSearch();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,14 +140,14 @@
|
|
|
|
submitting: false,
|
|
|
|
submitting: false,
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
systemId: null,
|
|
|
|
storeId: null,
|
|
|
|
type: 0,
|
|
|
|
type: null,
|
|
|
|
waiterAvatar: null,
|
|
|
|
waiterAvatar: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
systemId: [{ required: true, message: '所属系统不能为空' }],
|
|
|
|
storeId: [{ required: true, message: '所属店铺不能为空' }],
|
|
|
|
type: [{ required: true, message: '客服类型不能为空' }],
|
|
|
|
type: [{ required: true, message: '客服类型不能为空' }],
|
|
|
|
waiterAvatar: [{ required: true, message: '客服头像不能为空' }],
|
|
|
|
waiterAvatar: [{ required: true, message: '客服头像不能为空' }],
|
|
|
|
waiterId: [{ required: true, message: '客服ID不能为空' }],
|
|
|
|
waiterId: [{ required: true, message: '客服ID不能为空' }],
|
|
|
@ -139,13 +160,16 @@
|
|
|
|
formState.form,
|
|
|
|
formState.form,
|
|
|
|
row || {
|
|
|
|
row || {
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
systemId: null,
|
|
|
|
storeId: null,
|
|
|
|
type: 0,
|
|
|
|
type: null,
|
|
|
|
waiterAvatar: null,
|
|
|
|
waiterAvatar: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterId: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
waiterNickname: null,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
if (!formState.form.storeId) {
|
|
|
|
|
|
|
|
formState.form.storeId = state.condition.storeId;
|
|
|
|
|
|
|
|
}
|
|
|
|
formState.formVisible = true;
|
|
|
|
formState.formVisible = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 保存
|
|
|
|
// 保存
|
|
|
@ -162,19 +186,19 @@
|
|
|
|
formState.submitting = false;
|
|
|
|
formState.submitting = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const handleRemove = async (rows) => {
|
|
|
|
const handleRemove = async (rows) => {
|
|
|
|
store.dispatch(
|
|
|
|
store.dispatch('chatWaiter/remove', {
|
|
|
|
'chatWaiter/remove',
|
|
|
|
storeId: state.condition.storeId,
|
|
|
|
rows.map((item) => item.id)
|
|
|
|
waiterIds: rows.map((item) => item.waiterId),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const config = reactive({
|
|
|
|
const config = reactive({
|
|
|
|
// 表格列配置
|
|
|
|
// 表格列配置
|
|
|
|
columns: [
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '所属系统',
|
|
|
|
label: '所属店铺',
|
|
|
|
width: 160,
|
|
|
|
width: 160,
|
|
|
|
slots: {
|
|
|
|
slots: {
|
|
|
|
default: ({ row }) => proxy.$dict(unref(opts).system, row.sysId, { label: 'name', value: 'id' }),
|
|
|
|
default: ({ row }) => proxy.$dict(unref(opts).store, row.storeId, { label: 'name', value: 'id' }),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|