You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
5.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <el-card>
  4. <div style="display: flex">
  5. <div class="leftTree">
  6. <el-tree :data="sysParmTypesTree" :props="treeProps" @node-click="nodeClick" />
  7. </div>
  8. <div class="midBlock">
  9. <div style="display: flex">
  10. <div>
  11. <span>体检中心</span>
  12. <el-select v-model="organizationId" placeholder="请选择体检中心" style="margin-left: 15px" filterable size="small"
  13. @change="changeOrganization">
  14. <el-option v-for="item in organization" :key="item.id" :label="item.displayName" :value="item.id">
  15. </el-option>
  16. </el-select>
  17. </div>
  18. <div style="display: flex">
  19. <el-color-picker v-model="color16" @change="chooseColor" />
  20. <el-input v-model="color10" @input="inputColor" />
  21. </div>
  22. <div style="margin-left: 30px">
  23. <el-button type="success" @click="save">保存</el-button>
  24. </div>
  25. </div>
  26. <div style="margin-top: 2px">
  27. <el-table :data="sysParms" border :height="window.pageHeight < 600 ? 420 : window.pageHeight - 190"
  28. size="small" highlight-current-row>
  29. <el-table-column prop="id" label="参数ID" />
  30. <el-table-column prop="displayName" label="参数名称" width="120" />
  31. <el-table-column prop="organizationUnitId" label="体检中心">
  32. <template slot-scope="scope">
  33. <el-select v-model="scope.row.organizationUnitId" placeholder="请选择体检中心" filterable size="small">
  34. <el-option v-for="item in organization" :key="item.id" :label="item.displayName" :value="item.id">
  35. </el-option>
  36. </el-select>
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="sysParmValueName" label="参数值">
  40. <template slot-scope="scope">
  41. <el-input type="textarea" v-model="scope.row.sysParmValueName" :autosize="{ minRows: 1, maxRows: 100 }"
  42. maxlength="100" size="small" />
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="valueRemark" label="备注">
  46. <template slot-scope="scope">
  47. <el-input type="textarea" v-model="scope.row.valueRemark" :autosize="{ minRows: 1, maxRows: 100 }"
  48. maxlength="500" size="small" />
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="remark" label="参数说明" />
  52. </el-table>
  53. </div>
  54. </div>
  55. </div>
  56. </el-card>
  57. </div>
  58. </template>
  59. <script>
  60. import { mapState } from "vuex";
  61. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  62. import { tcdate, objCopy } from "../../utlis/proFunc";
  63. export default {
  64. components: {},
  65. data() {
  66. return {
  67. sysParmTypesTree: [], //参数类别树
  68. treeProps: {
  69. label: "displayName",
  70. value: "id",
  71. children: "treeChildren",
  72. },
  73. organization: [], //体检中心
  74. organizationId: "00000000-0000-0000-0000-000000000000",
  75. sysParmTypeId: "",
  76. sysParms: [], //系统参数列表
  77. color16: "#409EFF",
  78. color10: 1089274,
  79. };
  80. },
  81. created() { },
  82. //挂载完成
  83. mounted() {
  84. this.getSysParmTypesTree();
  85. this.getOraniztion();
  86. },
  87. computed: {
  88. ...mapState(["window", "dict"]),
  89. },
  90. methods: {
  91. chooseColor(v) {
  92. this.color10 = eval(v.replace("#", "0x"));
  93. },
  94. inputColor(v) {
  95. this.color10 = Number(v);
  96. let temp = "000000" + this.color10.toString(16);
  97. this.color16 = "#" + temp.substring(temp.length - 6, temp.length);
  98. },
  99. //获取组织体检中心数据
  100. getOraniztion() {
  101. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  102. (res) => {
  103. this.organization = [
  104. {
  105. displayName: "公共参数",
  106. id: "00000000-0000-0000-0000-000000000000",
  107. },
  108. ...res.data,
  109. ];
  110. }
  111. );
  112. },
  113. //获取系统参数类别树数据
  114. getSysParmTypesTree() {
  115. getapi("/api/app/sysparmtype/treelist").then((res) => {
  116. if (res.code != -1) {
  117. this.sysParmTypesTree = res.data;
  118. //console.log("res.data", res.data);
  119. tcdate(this.sysParmTypesTree);
  120. }
  121. });
  122. },
  123. nodeClick(data, node, self) {
  124. this.sysParmTypeId = data.id;
  125. this.getSysParms();
  126. },
  127. changeOrganization(v) {
  128. this.organizationId = v;
  129. this.getSysParms();
  130. },
  131. getSysParms() {
  132. let url = `/api/app/sysparm/getlistinsysparmvaluename?SysParmTypeId=${this.sysParmTypeId}`;
  133. if (this.organizationId) {
  134. url += `&OrganizationUnitId=${this.organizationId}`;
  135. }
  136. getapi(`${url}`).then((res) => {
  137. if (res.code != -1) {
  138. this.sysParms = res.data;
  139. }
  140. });
  141. },
  142. save() {
  143. let body = [];
  144. if (this.sysParms.length < 1) return;
  145. this.sysParms.forEach((item) => {
  146. body.push({
  147. sysParmId: item.id,
  148. organizationUnitId: item.organizationUnitId,
  149. parmValue: item.sysParmValueName,
  150. remark: item.valueRemark,
  151. });
  152. });
  153. postapi("/api/app/sysparmvalue/updatesysparmvaluemany", body).then(
  154. (res) => {
  155. if (res.code != -1) {
  156. this.$message.success("操作成功!");
  157. }
  158. }
  159. );
  160. },
  161. },
  162. };
  163. </script>
  164. <style scoped>
  165. .leftTree {
  166. overflow: scroll;
  167. border: 1px solid;
  168. width: 200px;
  169. height: v-bind("(window.pageHeight < 600 ? 450 : window.pageHeight - 150) + 'px'"
  170. );
  171. }
  172. .midBlock {
  173. margin-left: 5px;
  174. width: v-bind("(window.pageWidth < 500 ? 300 : window.pageWidth - 270) + 'px'"
  175. );
  176. }
  177. </style>