|
|
|
@ -1,20 +1,26 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div class="contenttitle"> |
|
|
|
明细记录 |
|
|
|
<div style="display: flex;justify-content: space-between;"> |
|
|
|
<div class="contenttitle"> |
|
|
|
明细记录 |
|
|
|
</div> |
|
|
|
<el-input v-model="searchKeyWord" size="small" placeholder="请输入查询关键字" @keyup.native.enter="searchEnter" @input="searchEnter" |
|
|
|
style="width: 200px;" /> |
|
|
|
</div> |
|
|
|
<!--公共表分类信息--> |
|
|
|
<div style="display: flex; font-size: 14px"> |
|
|
|
<div :style="'display: block;width:' + (window.pageWidth - window.pageMarginWidth - 110 - 5) + 'px;'"> |
|
|
|
<el-table id="commonTables" :data="commonTables" ref="commonTables" row-key="id" border :height="`${tableHeight}px`" |
|
|
|
size="small" highlight-current-row :row-class-name="handleRowClassName" @row-click="rowClick" @row-dblclick="dblClick"> |
|
|
|
<el-table id="commonTables" :data="commonTables" ref="commonTables" row-key="id" border |
|
|
|
:height="`${tableHeight}px`" size="small" highlight-current-row :row-class-name="handleRowClassName" |
|
|
|
@row-click="rowClick" @row-dblclick="dblClick"> |
|
|
|
<el-table-column type="index" label="序号" width="50" align="center" /> |
|
|
|
<el-table-column label="编号" prop="id" min-width="200" align="center" /> |
|
|
|
<el-table-column prop="dataCode" label="dataCode" min-width="100" /> |
|
|
|
<el-table-column prop="displayName" label="项目名称" min-width="150" /> |
|
|
|
<el-table-column prop="commonTableTypeId" label="分类" min-width="150" /> |
|
|
|
<el-table-column prop="simpleCode" label="简码" min-width="60" /> |
|
|
|
<el-table-column label="编号" prop="id" min-width="150" align="center" sortable /> |
|
|
|
<el-table-column prop="displayName" label="体检系统编码" min-width="150" sortable /> |
|
|
|
<el-table-column prop="simpleCode" label="体检系统名称" min-width="150" sortable /> |
|
|
|
<el-table-column v-for="col in Object.keys(commonTableCols)" :prop="col" :label="commonTableCols[col]" |
|
|
|
min-width="100" sortable /> |
|
|
|
<el-table-column prop="commonTableTypeId" label="分类" min-width="150" sortable /> |
|
|
|
<el-table-column prop="creatorName" label="创建者" min-width="80" align="center" /> |
|
|
|
<el-table-column label="创建时间" min-width="150" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -68,7 +74,7 @@ |
|
|
|
<!-- 新增或者编辑弹框 --> |
|
|
|
<el-dialog :title="dataTransOpts.tableS.common_table.id ? '编辑' : '新增'" :close-on-click-modal="false" |
|
|
|
:visible.sync="dialogWin.CommonTableEdit" width="600px" @close="close_dialogWinCommonTableEdit"> |
|
|
|
<CommonTableEdit :params="CommonTableEditParams" /> |
|
|
|
<CommonTableEdit :params="CommonTableEditParams" :commonTableCols="commonTableCols" /> |
|
|
|
</el-dialog> |
|
|
|
<!-- --> |
|
|
|
</div> |
|
|
|
@ -89,10 +95,12 @@ import { |
|
|
|
|
|
|
|
import CommonTableEdit from "./CommonTableEdit.vue"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
CommonTableEdit |
|
|
|
}, |
|
|
|
props: ["refParams"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pagePriv: { |
|
|
|
@ -101,9 +109,14 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
commonTables: [], // 公共表 |
|
|
|
commonTablesAll: [], |
|
|
|
curCommonTable: {}, // 当前选中公共表 |
|
|
|
commonTableCols: { |
|
|
|
dataCode: '', |
|
|
|
// dataCode2:'' |
|
|
|
}, // 多列对照名 |
|
|
|
CommonTableEditParams: {}, //公共表 新增时 用到参数 |
|
|
|
|
|
|
|
searchKeyWord: "", |
|
|
|
isDrag: false, |
|
|
|
clickTime1: 0, |
|
|
|
clickTime2: 0 |
|
|
|
@ -127,6 +140,9 @@ export default { |
|
|
|
// 清除当前选中的分组ID |
|
|
|
this.dataTransOpts.tableS.common_table.id = '' |
|
|
|
|
|
|
|
// 多列初始化 |
|
|
|
this.commonTableColsInit() |
|
|
|
|
|
|
|
this.rowDrop(); |
|
|
|
|
|
|
|
}, |
|
|
|
@ -141,16 +157,48 @@ export default { |
|
|
|
dddw, |
|
|
|
deepCopy, |
|
|
|
|
|
|
|
// 多列初始化 |
|
|
|
commonTableColsInit() { |
|
|
|
// console.log('refParams', this.refParams) |
|
|
|
try { |
|
|
|
this.commonTableCols = {} |
|
|
|
if (this.refParams?.columnName) this.commonTableCols = JSON.parse(this.refParams?.columnName) |
|
|
|
} catch (error) { |
|
|
|
console.error('公共表多列名转换失败', error) |
|
|
|
} finally { |
|
|
|
this.commonTableCols.dataCode = this.refParams?.displayName || '第三方对照编码' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 对照项目检索 |
|
|
|
searchEnter() { |
|
|
|
if (this.searchKeyWord) { |
|
|
|
let temp = '' |
|
|
|
this.commonTables = this.commonTablesAll.filter(e => { |
|
|
|
temp = '' |
|
|
|
if (e.displayName) temp += ',' + e.displayName |
|
|
|
if (e.simpleCode) temp += ',' + e.simpleCode |
|
|
|
Object.keys(this.commonTableCols).forEach(col => { |
|
|
|
if (e[col]) temp += ',' + e[col] |
|
|
|
}); |
|
|
|
return temp.includes(this.searchKeyWord) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.commonTables = this.commonTablesAll |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getList(body) { |
|
|
|
// body = { |
|
|
|
// "commonTableTypeId": "string", |
|
|
|
// "keyWord": "string" |
|
|
|
// } |
|
|
|
this.commonTables = [] |
|
|
|
if(!body.commonTableTypeId) return |
|
|
|
if (!body.commonTableTypeId) return |
|
|
|
postapi('/api/app/CommonTable/GetList', body).then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
this.commonTables = res.data |
|
|
|
this.commonTablesAll = res.data |
|
|
|
this.rowDrop() |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -229,7 +277,7 @@ export default { |
|
|
|
|
|
|
|
//获取初始数据 |
|
|
|
dictInit() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
@ -257,7 +305,7 @@ export default { |
|
|
|
id, |
|
|
|
commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id, |
|
|
|
} |
|
|
|
this.dataTransOpts.refresh.common_table.S++ |
|
|
|
this.dataTransOpts.refresh.common_table.S++ |
|
|
|
this.dialogWin.CommonTableEdit = true; |
|
|
|
|
|
|
|
}, |
|
|
|
@ -284,13 +332,13 @@ export default { |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
return postapi('/api/app/CommonTable/Delete', {commonTableId:this.dataTransOpts.tableS.common_table.id}); |
|
|
|
return postapi('/api/app/CommonTable/Delete', { commonTableId: this.dataTransOpts.tableS.common_table.id }); |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
console.log("删除成功"); |
|
|
|
let lfind = arrayExistObj(this.commonTables, "id", this.dataTransOpts.tableS.common_table.id); |
|
|
|
if (lfind > -1) this.commonTables.splice(lfind, 1); |
|
|
|
if (lfind > -1) this.commonTables.splice(lfind, 1); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
@ -340,7 +388,10 @@ export default { |
|
|
|
// immediate:true, |
|
|
|
handler(newVal, oldVal) { |
|
|
|
console.log(`watch 公共表分类 newVal:${newVal} oldVal:${oldVal} commonTableTypeId: ${this.dataTransOpts.tableS.common_table_type.id}`); |
|
|
|
if (newVal != oldVal) this.getList({ commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id }); |
|
|
|
if (newVal != oldVal) { |
|
|
|
this.commonTableColsInit() |
|
|
|
this.getList({ commonTableTypeId: this.dataTransOpts.tableS.common_table_type.id }); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|