pengjun 2 years ago
parent
commit
196f1bb7df
  1. 2
      src/router/index.js
  2. 168
      src/views/fee-settings/SysParmSet.vue

2
src/router/index.js

@ -197,7 +197,7 @@ const routes = [
},
{
path: "/sys-parm-type",
component: () => import("../views/fee-settings/SysParmType.vue"),
component: () => import("../views/fee-settings/SysParmSet.vue"), //../views/fee-settings/SysParmType.vue
},
//---------------------- 体检登记 start ----------------------
{

168
src/views/fee-settings/SysParmSet.vue

@ -0,0 +1,168 @@
<template>
<div>
<el-card>
<div style="display: flex;">
<div class="leftTree">
<el-tree :data="sysParmTypesTree" :props="treeProps" @node-click="nodeClick" />
</div>
<div class="midBlock">
<div style="display: flex;">
<div>
<span>体检中心</span>
<el-select v-model="organizationId" placeholder="请选择体检中心" style="margin-left: 15px" filterable
size="small" @change="changeOrganization">
<el-option v-for="item in organization" :key="item.id" :label="item.displayName" :value="item.id">
</el-option>
</el-select>
</div>
<div style="margin-left: 30px;">
<el-button type="success" @click="save">保存</el-button>
</div>
</div>
<div style="margin-top: 2px;">
<el-table :data="sysParms" border :height="window.pageHeight < 600 ? 420 : window.pageHeight - 190"
size="small" highlight-current-row>
<el-table-column prop="id" label="参数ID" />
<el-table-column prop="displayName" label="参数名称" />
<el-table-column prop="organizationUnitId" label="体检中心">
<template slot-scope="scope">
<el-select v-model="scope.row.organizationUnitId" placeholder="请选择体检中心" filterable size="small" >
<el-option v-for="item in organization" :key="item.id" :label="item.displayName" :value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="sysParmValueName" label="参数值">
<template slot-scope="scope">
<el-input v-model="scope.row.sysParmValueName"/>
</template>
</el-table-column>
<el-table-column prop="sysParmValueRemark" label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.sysParmValueRemark"/>
</template>
</el-table-column>
<el-table-column prop="remark" label="参数说明" />
</el-table>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate, objCopy } from "../../utlis/proFunc";
export default {
components: {},
data() {
return {
sysParmTypesTree: [], //
treeProps: {
label: "displayName",
value: "id",
children: "treeChildren",
},
organization: [], //
organizationId: '00000000-0000-0000-0000-000000000000',
sysParmTypeId: '',
sysParms: [], //
};
},
created() { },
//
mounted() {
this.getSysParmTypesTree();
this.getOraniztion();
},
computed: {
...mapState(["window", "dict"]),
},
methods: {
//
getOraniztion() {
getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
(res) => {
this.organization = [{ displayName: "公共参数", id: "00000000-0000-0000-0000-000000000000", }, ...res.data];
}
);
},
//
getSysParmTypesTree() {
getapi("/api/app/sys-parm-type/by-code-all").then((res) => {
if (res.code != - 1) {
this.sysParmTypesTree = res.data;
//console.log("res.data", res.data);
tcdate(this.sysParmTypesTree);
}
});
},
nodeClick(data, node, self) {
this.sysParmTypeId = data.id;
this.getSysParms();
},
changeOrganization(v) {
this.organizationId = v;
this.getSysParms();
},
getSysParms() {
let url = `/api/app/sys-parm/in-sys-parm-value-name?SysParmTypeId=${this.sysParmTypeId}`;
if (this.organizationId) {
url += `&OrganizationUnitId=${this.organizationId}`
}
getapi(`${url}`).then((res) => {
if (res.code != - 1) {
this.sysParms = res.data;
}
});
},
save() {
let body = [];
if(this.sysParms.length < 1) return;
this.sysParms.forEach(item =>{
body.push({
sysParmId:item.id,
organizationUnitId:item.organizationUnitId,
parmValue:item.sysParmValueName,
remark:item.sysParmValueRemark
});
});
getpost("/api/app/sys-parm-type/by-code-all",body).then((res) => {
if (res.code != - 1) {
this.$message.success('操作成功!');
}
});
},
},
};
</script>
<style scoped>
.leftTree {
overflow: scroll;
border: 1px solid;
width: 200px;
height: v-bind("(window.pageHeight < 600 ? 450 : window.pageHeight - 150) + 'px'");
}
.midBlock {
margin-left: 5px;
width: v-bind("(window.pageWidth < 500 ? 300 : window.pageWidth - 270) + 'px'");
}
</style>
Loading…
Cancel
Save