fix: 修改话术增删改查
This commit is contained in:
@@ -18,46 +18,47 @@ const formDialogRef = ref()
|
||||
const tableIns = ref()
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'verbalName',
|
||||
label: '话术问题',
|
||||
prop: 'query',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入话术问题查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
prop: 'verbalType',
|
||||
label: '话术答案',
|
||||
prop: 'answer',
|
||||
props: {
|
||||
placeholder: '请输入类型查询',
|
||||
placeholder: '请输入话术答案查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '内容',
|
||||
prop: 'verbalContent',
|
||||
props: {
|
||||
placeholder: '请输入内容查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'state',
|
||||
props: {
|
||||
placeholder: '请选择状态查询',
|
||||
cacheKey: 'verbal_trick_state',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
component: shallowRef(fvSelect),
|
||||
},
|
||||
// {
|
||||
// label: '是否挂断电话',
|
||||
// prop: 'callOff',
|
||||
// props: {
|
||||
// placeholder: '请选择是否挂断电话查询',
|
||||
// cacheKey: 'call_off',
|
||||
// clearable: true,
|
||||
// filterable: true,
|
||||
// },
|
||||
// component: shallowRef(fvSelect),
|
||||
// },
|
||||
// {
|
||||
// label: '上下文类型',
|
||||
// prop: 'type',
|
||||
// props: {
|
||||
// placeholder: '请选择上下文类型查询',
|
||||
// cacheKey: 'context_type',
|
||||
// clearable: true,
|
||||
// filterable: true,
|
||||
// },
|
||||
// component: shallowRef(fvSelect),
|
||||
// },
|
||||
])
|
||||
const verbalTrickTableConfig = reactive({
|
||||
columns: [
|
||||
@@ -73,27 +74,27 @@ const verbalTrickTableConfig = reactive({
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
prop: 'verbalName',
|
||||
label: '名称',
|
||||
prop: 'query',
|
||||
label: '话术问题',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'verbalType',
|
||||
label: '类型',
|
||||
prop: 'answer',
|
||||
label: '话术答案',
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// prop: 'verbalContent',
|
||||
// label: '内容',
|
||||
// align: 'center'
|
||||
// },
|
||||
{
|
||||
prop: 'verbalContent',
|
||||
label: '内容',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'calloff',
|
||||
prop: 'callOff',
|
||||
label: '是否挂断电话',
|
||||
align: 'center',
|
||||
currentRender: ({ row, index }) => {
|
||||
if (row.calloff !== null) {
|
||||
return (<Tag dictType={'yes_no'} value={row.calloff} />)
|
||||
if (row.callOff !== null) {
|
||||
return (<Tag dictType={'call_off'} value={row.callOff} />)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
@@ -111,24 +112,19 @@ const verbalTrickTableConfig = reactive({
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'state',
|
||||
label: '状态',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({ row, index }) => {
|
||||
if (row.state !== null) {
|
||||
return (<Tag dictType={'verbal_trick_state'} value={row.state} />)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// prop: 'state',
|
||||
// label: '状态',
|
||||
// align: 'center',
|
||||
// showOverflowTooltip: false,
|
||||
// currentRender: ({ row, index }) => {
|
||||
// if (row.state !== null) {
|
||||
// return (<Tag dictType={'verbal_trick_state'} value={row.state} />)
|
||||
// } else {
|
||||
// return '--'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
{
|
||||
prop: 'oper',
|
||||
label: '操作',
|
||||
@@ -167,67 +163,73 @@ const verbalTrickTableConfig = reactive({
|
||||
]
|
||||
})
|
||||
const formRules = reactive({
|
||||
verbalName: [
|
||||
{required: true, message: "请输入名称", trigger: ["change", "blur"]}
|
||||
query: [
|
||||
{required: true, message: "请输入话术问题", trigger: ["change", "blur"]}
|
||||
],
|
||||
verbalType: [
|
||||
{required: true, message: "请输入类型", trigger: ["change", "blur"]}
|
||||
],
|
||||
verbalContent: [
|
||||
{required: true, message: "请输入内容", trigger: ["change", "blur"]}
|
||||
],
|
||||
state: [
|
||||
{required: true, message: "请选择状态", trigger: ["change", "blur"]}
|
||||
// answer: [
|
||||
// {required: true, message: "请输入话术答案", trigger: ["change", "blur"]}
|
||||
// ],
|
||||
callOff: [
|
||||
{required: true, message: "请选择是否挂断电话", trigger: ["change", "blur"]}
|
||||
],
|
||||
// state: [
|
||||
// {required: true, message: "请选择状态", trigger: ["change", "blur"]}
|
||||
// ],
|
||||
});
|
||||
const formSchema = computed(() => {
|
||||
return [
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'verbalName',
|
||||
label: '话术问题',
|
||||
prop: 'query',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入名称',
|
||||
placeholder: '请输入话术问题',
|
||||
clearable: true,
|
||||
type:'textarea',
|
||||
rows:3
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
prop: 'verbalType',
|
||||
label: '话术答案',
|
||||
prop: 'answer',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入类型',
|
||||
placeholder: '请输入话术答案',
|
||||
clearable: true,
|
||||
type:'textarea',
|
||||
rows:3
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '内容',
|
||||
prop: 'verbalContent',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入内容',
|
||||
clearable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'state',
|
||||
label: '是否挂断电话',
|
||||
prop: 'callOff',
|
||||
component: shallowRef(fvSelect),
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请选择状态',
|
||||
cacheKey: 'verbal_trick_state',
|
||||
placeholder: '请选择是否挂断电话',
|
||||
cacheKey: 'call_off',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '上下文类型',
|
||||
prop: 'type',
|
||||
component: shallowRef(fvSelect),
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请选择上下文类型',
|
||||
cacheKey: 'context_type',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
@@ -273,22 +275,23 @@ const handleEdit = (row) => {
|
||||
dialogType.value = "edit";
|
||||
}
|
||||
const getDetail = (row) => {
|
||||
getVerbalDetail(row.verbalId).then(res => {
|
||||
getVerbalDetail(row.templateId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
res.data.callOff=res.data.callOff+''
|
||||
nextTick(() => {
|
||||
formDialogRef.value.getFormInstance().setValues(res.data)
|
||||
// 清空校验
|
||||
formDialogRef.value.getFormInstance().clearValidate()
|
||||
})
|
||||
} else {
|
||||
ElMessage.warning(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const selectionChange = (selection) => {
|
||||
if (selection.length !== 0) {
|
||||
verbalIds.value = selection.map(item => item.verbalId).join()
|
||||
verbalIds.value = selection.map(item => item.templateId).join()
|
||||
} else {
|
||||
verbalIds.value=''
|
||||
}
|
||||
@@ -317,12 +320,12 @@ const handleMoreDelete = () => {
|
||||
}
|
||||
}
|
||||
const handleSingleDelete = (row) => {
|
||||
ElMessageBox.confirm(`确认删除名称为${row.verbalName}的话术吗?`, '系统提示', {
|
||||
ElMessageBox.confirm(`确认删除问题为${row.query}的话术吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContactMethod(row.verbalId)
|
||||
deleteContactMethod(row.templateId)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user