<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="categoryName">
|
<el-input v-model="queryParams.categoryName" placeholder="请输入${comment}" clearable
|
@keyup.enter.native="handleQuery" />
|
</el-form-item>
|
<el-form-item label="指标值" prop="targetValue">
|
<el-input v-model="queryParams.targetValue" placeholder="请输入${comment}" clearable
|
@keyup.enter.native="handleQuery" />
|
</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 type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
v-hasPermi="['smartor:ivrtemplatetarget:add']">新增</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
v-hasPermi="['smartor:ivrtemplatetarget:edit']">修改</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-hasPermi="['smartor:ivrtemplatetarget:remove']">删除</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
v-hasPermi="['smartor:ivrtemplatetarget:export']">导出</el-button>
|
</el-col>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
</el-row>
|
|
<el-table v-loading="loading" :data="ivrtemplatetargetList" @selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column label="模板名称" align="center" prop="templateID" />
|
<el-table-column label="话术" align="center" prop="templateQuestionID" />
|
<el-table-column label="指标类型" align="center" prop="targetType" />
|
<el-table-column label="指标名称" align="center" prop="categoryName" />
|
<el-table-column label="指标值" align="center" prop="targetValue" />
|
<el-table-column label="适用语言" align="center" prop="language" />
|
<el-table-column label="适用医院" align="center" prop="orgid" />
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<template slot-scope="scope">
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
v-hasPermi="['smartor:ivrtemplatetarget:edit']">修改</el-button>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
v-hasPermi="['smartor:ivrtemplatetarget:remove']">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
@pagination="getList" />
|
|
<!-- 添加或修改话术模板库话术指标对话框 -->
|
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form-item label="指标名称" prop="categoryName">
|
<el-input v-model="form.categoryName" placeholder="请输入${comment}" />
|
</el-form-item>
|
<el-form-item label="指标值" prop="targetValue">
|
<el-input v-model="form.targetValue" placeholder="请输入${comment}" />
|
</el-form-item>
|
<el-form-item label="跳转话术到" prop="nextQuestionNum">
|
<el-input v-model="form.nextQuestionNum" placeholder="请输入${comment}" />
|
</el-form-item>
|
<el-form-item label="节点描述" prop="switchDescription">
|
<el-input v-model="form.switchDescription" placeholder="请输入${comment}" />
|
</el-form-item>
|
<el-form-item label="本节点文本" prop="switchText">
|
<el-input v-model="form.switchText" type="textarea" placeholder="请输入内容" />
|
</el-form-item>
|
<el-form-item label="本节点语音" prop="switchWav">
|
<el-input v-model="form.switchWav" type="textarea" placeholder="请输入内容" />
|
</el-form-item> <el-form-item label="节点待匹配语音" prop="switchTempWav">
|
<el-input v-model="form.switchTempWav" type="textarea" placeholder="请输入内容" />
|
</el-form-item>
|
<el-form-item label="基本匹配规则" prop="basicRegex">
|
<el-input v-model="form.basicRegex" type="textarea" placeholder="请输入内容" />
|
</el-form-item>
|
<el-form-item label="附加匹配规则" prop="selfRegex">
|
<el-input v-model="form.selfRegex" type="textarea" placeholder="请输入内容" />
|
</el-form-item>
|
<el-form-item label="适用语言" prop="language">
|
<el-input v-model="form.language" placeholder="请输入${comment}" />
|
</el-form-item>
|
<el-form-item label=" 适用医院" prop="orgid">
|
<el-input v-model="form.orgid" placeholder="请输入 机构ID " />
|
</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>
|
</template>
|
|
<script>
|
import { listIvrtemplatetarget, getIvrtemplatetarget, delIvrtemplatetarget, addIvrtemplatetarget, updateIvrtemplatetarget } from "@/api/smartor/ivrtemplatetarget";
|
|
export default {
|
name: "Ivrtemplatetarget",
|
data() {
|
return {
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 话术模板库话术指标表格数据
|
ivrtemplatetargetList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
templateQuestionID: null,
|
templateQuestionNum: null,
|
nextQuestionNum: null,
|
templateID: null,
|
switchID: null,
|
switchDescription: null,
|
switchText: null,
|
switchWav: null,
|
switchTempWav: null,
|
targetType: null,
|
categoryName: null,
|
targetValue: null,
|
targetID: null,
|
questionTargetID: null,
|
basicRegex: null,
|
selfRegex: null,
|
regexUsedType: null,
|
language: null,
|
isEnable: null,
|
isDel: null,
|
playType: null,
|
isupload: null,
|
uploadTime: null,
|
orgid: null
|
},
|
// 表单参数
|
form: {},
|
// 表单校验
|
rules: {
|
templateQuestionID: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
templateQuestionNum: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
nextQuestionNum: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
templateID: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
switchID: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
language: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
isEnable: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
isDel: [
|
{ required: true, message: "$comment不能为空", trigger: "blur" }
|
],
|
delFlag: [
|
{ required: true, message: " 删除标记 不能为空", trigger: "blur" }
|
],
|
isupload: [
|
{ required: true, message: " 上传标记 不能为空", trigger: "blur" }
|
],
|
}
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询话术模板库话术指标列表 */
|
getList() {
|
this.loading = true;
|
listIvrtemplatetarget(this.queryParams).then(response => {
|
this.ivrtemplatetargetList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
templateTargetID: null,
|
templateQuestionID: null,
|
templateQuestionNum: null,
|
nextQuestionNum: null,
|
templateID: null,
|
switchID: null,
|
switchDescription: null,
|
switchText: null,
|
switchWav: null,
|
switchTempWav: null,
|
targetType: null,
|
categoryName: null,
|
targetValue: null,
|
targetID: null,
|
questionTargetID: null,
|
basicRegex: null,
|
selfRegex: null,
|
regexUsedType: null,
|
language: null,
|
isEnable: null,
|
isDel: null,
|
playType: null,
|
delFlag: null,
|
updateBy: null,
|
updateTime: null,
|
createBy: null,
|
createTime: null,
|
isupload: null,
|
uploadTime: null,
|
orgid: null
|
};
|
this.resetForm("form");
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.templateTargetID)
|
this.single = selection.length !== 1
|
this.multiple = !selection.length
|
},
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.open = true;
|
this.title = "添加话术模板库话术指标";
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
this.reset();
|
const templateTargetID = row.templateTargetID || this.ids
|
getIvrtemplatetarget(templateTargetID).then(response => {
|
this.form = response.data;
|
this.open = true;
|
this.title = "修改话术模板库话术指标";
|
});
|
},
|
/** 提交按钮 */
|
submitForm() {
|
this.$refs["form"].validate(valid => {
|
if (valid) {
|
if (this.form.templateTargetID != null) {
|
updateIvrtemplatetarget(this.form).then(response => {
|
this.$modal.msgSuccess("修改成功");
|
this.open = false;
|
this.getList();
|
});
|
} else {
|
addIvrtemplatetarget(this.form).then(response => {
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
this.getList();
|
});
|
}
|
}
|
});
|
},
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const templateTargetIDs = row.templateTargetID || this.ids;
|
this.$modal.confirm('是否确认删除话术模板库话术指标编号为"' + templateTargetIDs + '"的数据项?').then(function () {
|
return delIvrtemplatetarget(templateTargetIDs);
|
}).then(() => {
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
}).catch(() => { });
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
this.download('smartor/ivrtemplatetarget/export', {
|
...this.queryParams
|
}, `ivrtemplatetarget_${new Date().getTime()}.xlsx`)
|
}
|
}
|
};
|
</script>
|