|
|
@@ -0,0 +1,398 @@
|
|
|
+<!-- 模板区域 -->
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="p-1">
|
|
|
+ <el-button type="primary" :size="overSize" @click="addAttr">新增</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="p-1">
|
|
|
+ <el-button type="primary" :size="overSize" @click="getPdfMsg">获取保单配置信息</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 模板内容 -->
|
|
|
+ <kt-common-table :tableHeights="400" :SerialShow="false" :operationWidth="150" :showOperation="true"
|
|
|
+ :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="attrResult" button2Name="编辑"
|
|
|
+ button2Type="text" @handleButton2="attrUpdate" button3Name="删除" button3Type="text" @handleButton3="attrDel"
|
|
|
+ :columns="attrColumns" @findPage="getList">
|
|
|
+ </kt-common-table>
|
|
|
+ <el-dialog v-dialogDrag :title="attrDialogTitle" :visible.sync="attrVisible" width="80%" top="6vh" @close="attrcloseDialog">
|
|
|
+ <div class="tab-panecent">
|
|
|
+ <el-form ref="form" :model="pdfForm" label-width="140px" :size="overSize" :rules="attrRules">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="保险公司" prop="companyName">
|
|
|
+ <el-input type="text" v-model="pdfForm.companyName" readonly></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="读取pdf字段" prop="ruleName">
|
|
|
+ <el-input type="text" v-model="pdfForm.readName" placeholder="输入读取pdf字段"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="字段截取前缀" prop="readBegin">
|
|
|
+ <el-input type="text" v-model="pdfForm.readBegin" placeholder="输入字段截取前缀"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="字段截取后缀" prop="readEnd">
|
|
|
+ <el-input type="text" v-model="pdfForm.readEnd" placeholder="输入字段截取后缀"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="时间类型" prop="readType">
|
|
|
+ <el-select v-model="pdfForm.readType" placeholder="" filterable clearable>
|
|
|
+ <el-option v-for="item in dateTypeData" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="保单字段设置" prop="orderMsg">
|
|
|
+ <el-input type="text" v-model="pdfForm.orderMsg" placeholder="输入保单字段设置"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="attrVisible = false">取
|
|
|
+ 消</el-button>
|
|
|
+ <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
|
|
|
+ @click="productCostAddSubmit()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-dialogDrag title="读取pdf内容" :visible.sync="pdfVisible" width="80%" top="6vh" @close="pdfcloseDialog">
|
|
|
+ <div class="tab-panecent">
|
|
|
+ <el-form ref="readform" :model="readform" label-width="140px" :size="overSize" :rules="readPdfRules">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="PDF路径" prop="url">
|
|
|
+ <el-input type="text" v-model="readform.url" placeholder="输入PDF路径"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="pdf内容">
|
|
|
+ <el-input type="textarea" v-model="readPdfContent.pdfContent"
|
|
|
+ maxlength="600" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </row>
|
|
|
+ <row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="pdf解析内容">
|
|
|
+ <el-input type="textarea" v-model="readPdfContent.readContent"
|
|
|
+ maxlength="100" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button :size="overSize" style="background: #EAEDF1;color: #2D4D89;" @click="pdfVisible = false">关闭
|
|
|
+ </el-button>
|
|
|
+ <el-button :size="overSize" style="background: #2D4D89;color: #fff;border-color: #2D4D89;" type="primary"
|
|
|
+ @click="readSubmit()">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<!-- 行为区域 -->
|
|
|
+<script>
|
|
|
+import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
|
|
|
+import ProductCostForm from '@/components/Form/ProductCostForm.vue';//表单组件
|
|
|
+export default {
|
|
|
+ // 数据存放区域
|
|
|
+ components: {
|
|
|
+ KtCommonTable,
|
|
|
+ ProductCostForm
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ readPdfContent: {
|
|
|
+ pdfContent: "",
|
|
|
+ readContent: "",
|
|
|
+ },
|
|
|
+ dateTypeData:[],//时间类型
|
|
|
+ overSize: "small",
|
|
|
+ attrVisible: false,
|
|
|
+ pdfVisible: false,
|
|
|
+ attrDialogType: 'add',
|
|
|
+ attrDialogTitle: "添加",
|
|
|
+ attrColumns: [
|
|
|
+ { prop: "id", label: "编号", minWidth: 50, },
|
|
|
+ { prop: "companyId", label: "保险公司编码", minWidth: 160, },
|
|
|
+ { prop: "companyName", label: "保险公司编码", minWidth: 160, },
|
|
|
+ { prop: "readName", label: "读取pdf字段", minWidth: 100, },
|
|
|
+ { prop: "readBegin", label: "字段截取前缀", minWidth: 160 },
|
|
|
+ { prop: "readEnd", label: "字段截取后缀", minWidth: 160 },
|
|
|
+ { prop: "readType", label: "截取时间类型", minWidth: 160, formatter: this.dateTypeFormatter},
|
|
|
+ { prop: "orderMsg", label: "保单字段配置", minWidth: 160 },
|
|
|
+ ],
|
|
|
+ attrResult: [],
|
|
|
+ pageRequest: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ companyId:""
|
|
|
+ },
|
|
|
+ readform: {
|
|
|
+ companyId: "",
|
|
|
+ url: ""
|
|
|
+ },
|
|
|
+ readPdfRules: {
|
|
|
+ url: [
|
|
|
+ { required: true, message: "请填写pdf路径", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ pdfForm: {
|
|
|
+ companyId: "",//保险公司id
|
|
|
+ companyName: "",//保险公司id
|
|
|
+ readName: "",//读取pdf字段
|
|
|
+ readBegin: "",//字段截取前缀
|
|
|
+ readEnd: "",//字段截取后缀
|
|
|
+ readType: "",//时间类型 1.yyyy-mm-dd 2.年月日 3. yyyy/mm/dd
|
|
|
+ orderMsg: "",//保单字段信息
|
|
|
+ id: null,
|
|
|
+ },
|
|
|
+ attrRules: {
|
|
|
+ companyName: [
|
|
|
+ { required: true, message: "请选择保险公司", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ readName: [
|
|
|
+ { required: true, message: "请输入读取pdf字段", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ readBegin: [
|
|
|
+ { required: true, message: "请输入字段截取前缀", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ readEnd: [
|
|
|
+ { required: true, message: "请输入字段截取后缀", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ readType: [
|
|
|
+ { required: true, message: "请输入时间类型", trigger: "change" },
|
|
|
+ ],
|
|
|
+ readName: [
|
|
|
+ { required: true, message: "请输入保单字段设置", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 生命周期函数
|
|
|
+ created() {
|
|
|
+ this.pdfForm.companyId = this.$route.query.companyId;
|
|
|
+ this.pdfForm.companyName = this.$route.query.companyName;
|
|
|
+ this.pageRequest.companyId = this.$route.query.companyId;
|
|
|
+ this.readform.companyId = this.$route.query.companyId;
|
|
|
+ this.getList();
|
|
|
+ this.business("dateType");//时间类型
|
|
|
+ },
|
|
|
+ // 方法函数
|
|
|
+ methods: {
|
|
|
+ //获取保单信息
|
|
|
+ getPdfMsg() {
|
|
|
+ this.readform.url="";
|
|
|
+ this.readPdfContent.pdfContent="";
|
|
|
+ this.readPdfContent.readContent="";
|
|
|
+ this.pdfVisible = true;
|
|
|
+ },
|
|
|
+ //获取时间类型字典
|
|
|
+ business(typeName) {
|
|
|
+ this.$api.dict.findByLableName(typeName).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this[typeName + "Data"] = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //格式化时间
|
|
|
+ dateTypeFormatter(row, column) {
|
|
|
+ let dateType = row.readType;
|
|
|
+ switch (dateType) {
|
|
|
+ case '1':
|
|
|
+ return <el-tag>YYYY-MM-DD</el-tag>
|
|
|
+ case '2':
|
|
|
+ return <el-tag type="success">YYYY/MM/DD</el-tag>
|
|
|
+ case '3':
|
|
|
+ return <el-tag type="warning">YYYY年MM月DD日</el-tag>
|
|
|
+ default:
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取保单设置列表
|
|
|
+ getList() {
|
|
|
+ this.$api.readPdf.queryPage(this.pageRequest).then(res => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ let pageList = {
|
|
|
+ content: res.data.content,
|
|
|
+ pageNum: res.data.current,
|
|
|
+ pageSize: res.data.size,
|
|
|
+ totalPages: res.data.totalPages,
|
|
|
+ totalSize: res.data.totalSize,
|
|
|
+ };
|
|
|
+ this.attrResult = pageList;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //添加
|
|
|
+ addAttr() {
|
|
|
+ //清空数据
|
|
|
+ this.pdfForm.readName = "";
|
|
|
+ this.pdfForm.readBegin = "";
|
|
|
+ this.pdfForm.readEnd = "";
|
|
|
+ this.pdfForm.readType = "";
|
|
|
+ this.pdfForm.orderMsg = "";
|
|
|
+ this.attrDialogType = 'add';
|
|
|
+ this.attrDialogTitle = '添加'
|
|
|
+ this.attrVisible = true;
|
|
|
+ },
|
|
|
+ //修改
|
|
|
+ attrUpdate({ row, column }){
|
|
|
+ this.attrDialogType = 'update';
|
|
|
+ this.attrDialogTitle = '修改'
|
|
|
+ this.$api.readPdf.findById(row.id).then((res) => {
|
|
|
+ this.pdfForm = {
|
|
|
+ companyId: res.data.companyId,
|
|
|
+ companyName: res.data.companyName,
|
|
|
+ readName: res.data.readName,
|
|
|
+ readBegin: res.data.readBegin,
|
|
|
+ readEnd: res.data.readEnd,
|
|
|
+ readType: res.data.readType,
|
|
|
+ orderMsg: res.data.orderMsg,
|
|
|
+ id: row.id,
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.attrVisible = true;
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ attrDel({ row, column }){
|
|
|
+ this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$api.readPdf.deleteById(row.id).then((res) => {
|
|
|
+ if (res.code == "200") {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //关闭
|
|
|
+ attrcloseDialog(){
|
|
|
+ this.attrVisible = false;
|
|
|
+ },
|
|
|
+ //关闭pdf
|
|
|
+ pdfcloseDialog(){
|
|
|
+ this.attrVisible = false;
|
|
|
+ },
|
|
|
+ //保存
|
|
|
+ productCostAddSubmit() {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$api.readPdf.addOrUpdate(this.pdfForm).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ this.attrVisible = false;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //读取保单pdf内容
|
|
|
+ readSubmit() {
|
|
|
+ this.$refs['readform'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$api.readPdf.readPdfContent(this.readform).then((res) => {
|
|
|
+ if (res.code == '200') {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: "读取成功",
|
|
|
+ });
|
|
|
+ this.readPdfContent=res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: "读取失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<!-- 样式区域 -->
|
|
|
+<style lang='scss' scoped>
|
|
|
+/deep/ {
|
|
|
+ .el-dialog__header {
|
|
|
+ font-weight: bold;
|
|
|
+ border-bottom: 1px solid #D7DBE7;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-dialog__body {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs__item.is-active {
|
|
|
+ color: #fff;
|
|
|
+ background: #2D4D89;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs--card>.el-tabs__header .el-tabs__nav,
|
|
|
+ .el-tabs--card>.el-tabs__header,
|
|
|
+ .el-tabs--card>.el-tabs__header .el-tabs__item {
|
|
|
+ border: none;
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs--card>.el-tabs__header .el-tabs__nav {
|
|
|
+ padding-left: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-dialog__footer {
|
|
|
+ padding: 10px 20px 10px 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.tab-panecent {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 15px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ max-height: 600px;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.tab-panestyle {
|
|
|
+ padding: 20px;
|
|
|
+ background: #F2F2F2;
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|