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.

397 lines
13 KiB

3 years ago
2 years ago
3 years ago
2 months ago
2 years ago
2 months ago
3 years ago
3 years ago
3 years ago
2 months ago
3 years ago
3 years ago
3 years ago
2 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 months ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 months ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 months ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 months ago
3 years ago
  1. <template>
  2. <div class="" style="width: 100%;display: flex;margin-top: 15px;">
  3. <div style="width: 90%">
  4. <el-table :data="tableData" style="width: 100%" class="el-table__body-wrapper tbody" border
  5. :height="window.pageHeight < 600 ? 260 : window.pageHeight - 340" @row-click="rowick" highlight-current-row>
  6. <el-table-column prop="forSexId" label="性别" align="center">
  7. <template slot-scope="scope">
  8. <div>
  9. {{ ldddw(forSexId, "id", scope.row.forSexId, "displayName") }}
  10. </div>
  11. </template>
  12. </el-table-column>
  13. <el-table-column prop="ageLowerLimit" label="年龄上限" align="center" />
  14. <el-table-column prop="ageUpperLimit" label="年龄下限" align="center" />
  15. <el-table-column prop="referenceRangeValue" label="参考范围" align="center" />
  16. <el-table-column prop="followUpRangeValue" label="随访范围" align="center" />
  17. <el-table-column prop="criticalRangeValue" label="危急范围" align="center" />
  18. <el-table-column prop="lowerDiagnosisId" label="偏低诊断" align="center">
  19. <template slot-scope="scope">
  20. <div>
  21. {{
  22. ldddw(
  23. diagnosis,
  24. "id",
  25. scope.row.lowerDiagnosisId,
  26. "displayName"
  27. )
  28. }}
  29. </div>
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="upperDiagnosisId" label="偏高诊断" align="center">
  33. <template slot-scope="scope">
  34. <div>
  35. {{
  36. ldddw(
  37. diagnosis,
  38. "id",
  39. scope.row.upperDiagnosisId,
  40. "displayName"
  41. )
  42. }}
  43. </div>
  44. </template>
  45. </el-table-column>
  46. <!-- <el-table-column label="操作">
  47. <template>
  48. <el-tag
  49. class="move"
  50. style="cursor: move; margin-left: 15px"
  51. draggable="true"
  52. >
  53. <i class="el-icon-d-caret" style="width: 1rem; height: 1rem"></i>
  54. </el-tag>
  55. </template>
  56. </el-table-column> -->
  57. </el-table>
  58. </div>
  59. <!-- 按钮区域 -->
  60. <div style="margin-left: 10px;" class="editButton">
  61. <div>
  62. <el-button type="" @click="add" class="commonbutton">新增</el-button>
  63. </div>
  64. <div style="margin-top: 5px;">
  65. <el-button type="" @click="edit" class="commonbutton">编辑</el-button>
  66. </div>
  67. <div style="margin-top: 5px;">
  68. <el-button type="" @click="del" class="deleteButton">删除</el-button>
  69. </div>
  70. </div>
  71. <!-- 新增或者编辑弹框 -->
  72. <el-dialog :title="id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="70%" :append-to-body="true">
  73. <el-form ref="form" :model="form" label-width="100px" :rules="rules">
  74. <el-row>
  75. <el-col :span="8">
  76. <el-form-item label="性别" prop="forSexId">
  77. <el-select v-model="form.forSexId" placeholder="请选择" size="small">
  78. <el-option v-for="item in forSexId" :key="item.id" :label="item.displayName" :value="item.id">
  79. </el-option>
  80. </el-select>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="8">
  84. <el-form-item label="年龄下限" prop="ageLowerLimit">
  85. <el-input v-model="form.ageLowerLimit" size="small"></el-input> </el-form-item></el-col>
  86. <el-col :span="8">
  87. <el-form-item label="年龄上限" prop="ageUpperLimit">
  88. <el-input v-model="form.ageUpperLimit" size="small"></el-input> </el-form-item></el-col>
  89. <el-col :span="8">
  90. <el-form-item label="参考范围" prop="referenceRangeValue">
  91. <el-input v-model="form.referenceRangeValue" size="small"></el-input>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="8">
  95. <el-form-item label="随访范围" prop="followUpRangeValue">
  96. <el-input v-model="form.followUpRangeValue" size="small"></el-input>
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="8">
  100. <el-form-item label="危急值范围" prop="criticalRangeValue">
  101. <el-input v-model="form.criticalRangeValue" size="small"></el-input>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :span="8">
  105. <el-form-item label="偏低诊断" prop="">
  106. <el-select v-model="form.lowerDiagnosisId" placeholder="请选择" filterable :filter-method="remoteMethods"
  107. default-first-option clearable popper-class="diagnosisSelect" :popper-append-to-body="false"
  108. @change="quckEditdigoisce" size="small">
  109. <el-option v-for="item in diagnosis" :key="item.id" :label="item.displayName" :value="item.id">
  110. </el-option>
  111. </el-select> </el-form-item></el-col>
  112. <el-col :span="8">
  113. <el-form-item label="偏高诊断" prop="">
  114. <el-select v-model="form.upperDiagnosisId" placeholder="请选择" filterable :filter-method="remoteMethodes"
  115. default-first-option clearable popper-class="diagnosisSelect" :popper-append-to-body="false"
  116. @change="quckEditdigoisces" size="small">
  117. <el-option v-for="item in diagnosies" :key="item.id" :label="item.displayName" :value="item.id">
  118. </el-option>
  119. </el-select> </el-form-item></el-col>
  120. </el-row>
  121. </el-form>
  122. <span slot="footer" class="dialog-footer">
  123. <el-button @click="dialogVisible = false, id = curRowes.id" class="difference"> </el-button>
  124. <el-button type="primary" @click="onsbmint" class="commonbutton"> </el-button>
  125. </span>
  126. </el-dialog>
  127. </div>
  128. </template>
  129. <script>
  130. import { mapState } from "vuex";
  131. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  132. import { examinationgender } from "@/request/systemapi";
  133. import { dddw } from "../../utlis/proFunc";
  134. // import
  135. export default {
  136. props: ["itemId", "ReferenceRangeTypeFlag"],
  137. data() {
  138. return {
  139. rules: {
  140. itemId: [{ required: true, message: "请选择项目", trigger: "blur" }],
  141. forSexId: [{ required: true, message: "请选择性别", trigger: "blur" }],
  142. ageLowerLimit: [
  143. { required: true, message: "请输入年龄下限", trigger: "blur" },
  144. ],
  145. ageUpperLimit: [
  146. { required: true, message: "请输入年龄上限", trigger: "blur" },
  147. ],
  148. referenceRangeValue: [
  149. { required: true, message: "请输入参考范围", trigger: "blur" },
  150. ],
  151. lowerDiagnosisId: [
  152. { required: true, message: "请选择偏低诊断", trigger: "blur" },
  153. ],
  154. upperDiagnosisId: [
  155. { required: true, message: "请选择偏高诊断", trigger: "blur" },
  156. ],
  157. },
  158. pages: {
  159. SkipCount: 0,
  160. MaxResultCount: 100,
  161. // Sorting: "displayOrder desc",
  162. },
  163. dialogVisible: false,
  164. form: {
  165. itemId: "",
  166. forSexId: "",
  167. ageLowerLimit: "",
  168. ageUpperLimit: "",
  169. referenceRangeValue: "",
  170. criticalRangeValue: "",
  171. followUpRangeValue: "",
  172. lowerDiagnosisId: "",
  173. upperDiagnosisId: "",
  174. referenceRangeTypeFlag: "1",
  175. },
  176. id: "", //新增/编辑 或删除的记录 id
  177. forSexId: [], //性别
  178. diagnosis: [], //偏低诊断
  179. diagnosies: [],//偏高诊断
  180. tableData: [],
  181. curRowes: {},
  182. diagnosisId: ""
  183. };
  184. },
  185. created() { },
  186. mounted() {
  187. this.addtoedit();
  188. this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
  189. },
  190. computed: {
  191. ...mapState(["itemSet", "window"]),
  192. },
  193. methods: {
  194. getlist(itemId, ReferenceRangeTypeFlag) {
  195. getapi(
  196. `/api/app/reference-range/in-type/${itemId}?ReferenceRangeTypeFlag=${ReferenceRangeTypeFlag}`
  197. ).then((res) => {
  198. this.tableData = res.data;
  199. });
  200. },
  201. remoteMethods(keyWords) {
  202. if (keyWords) {
  203. this.diagnosis = [];
  204. this.diagnosisId.forEach(item => {
  205. if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  206. || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  207. // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  208. ) {
  209. this.diagnosis.push(item);
  210. }
  211. });
  212. } else {
  213. this.quckeDitd = deepCopy(this.diagnosis);
  214. }
  215. },
  216. remoteMethodes(keyWords) {
  217. if (keyWords) {
  218. this.diagnosies = [];
  219. this.diagnosisId.forEach(item => {
  220. if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  221. || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  222. // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  223. ) {
  224. this.diagnosies.push(item);
  225. }
  226. });
  227. } else {
  228. this.quckeDitd = deepCopy(this.diagnosies);
  229. }
  230. },
  231. rowick(row) {
  232. this.curRowes = row;
  233. this.id = row.id;
  234. // getapi(`/api/app/reference-range/${row.id}`).then((res) => {
  235. // this.curRowes = res.data;
  236. // this.id = res.data.id;
  237. // });
  238. },
  239. quckEditdigoisce(e) {
  240. if (!e) {
  241. this.remoteMethods()
  242. }
  243. },
  244. quckEditdigoisces(e) {
  245. if (!e) {
  246. this.remoteMethodes()
  247. }
  248. },
  249. //ldddw(forSexId, 'id', scope.row.forSexId, 'displayName')
  250. ldddw(arrayData, key, value, display) {
  251. return dddw(arrayData, key, value, display);
  252. },
  253. // 新增或者编辑需要的类别
  254. addtoedit() {
  255. //适用性别
  256. getapi("/api/app/for-sex").then((res) => {
  257. this.forSexId = res.data;
  258. });
  259. //诊断
  260. postapi("/api/app/Diagnosis/GetSimpleList").then((res) => {
  261. this.diagnosis = res.data;
  262. this.diagnosies = res.data
  263. this.diagnosisId = res.data
  264. });
  265. },
  266. add() {
  267. this.addtoedit()
  268. this.id = "";
  269. this.dialogVisible = true;
  270. if (this.$refs.form !== undefined) {
  271. this.$refs.form.resetFields()
  272. }
  273. Object.assign(this.$data.form, this.$options.data().form)
  274. this.form = {
  275. itemId: this.itemId,
  276. referenceRangeTypeFlag: this.ReferenceRangeTypeFlag,
  277. forSexId: "A",
  278. ageLowerLimit: "0",
  279. ageUpperLimit: "200",
  280. };
  281. },
  282. //编辑弹框
  283. edit() {
  284. if (!this.id) {
  285. this.$message.warning({ showClose: true, message: "请先选中要编辑的记录" });
  286. return;
  287. }
  288. this.dialogVisible = true;
  289. if (this.$refs.form !== undefined) {
  290. this.$refs.form.resetFields()
  291. }
  292. this.form = { ...this.curRowes }
  293. this.addtoedit()
  294. },
  295. del() {
  296. //console.log("删除操作");
  297. if (!this.id) {
  298. this.$message.warning({ showClose: true, message: "请先选中要删除的记录" });
  299. return;
  300. }
  301. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  302. confirmButtonText: "确定",
  303. cancelButtonText: "取消",
  304. type: "warning",
  305. cancelButtonClass: "difference",
  306. confirmButtonClass: "commonbutton"
  307. })
  308. .then(() => {
  309. return deletapi(`/api/app/reference-range/${this.id}`, this.form);
  310. })
  311. .then((res) => {
  312. if (res.code != -1) {
  313. console.log("删除成功");
  314. this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
  315. this.id = "";
  316. }
  317. })
  318. .catch(() => {
  319. this.$message.info({ showClose: true, message: "已取消删除" });
  320. });
  321. },
  322. confirmationRequest() {
  323. if (!this.id) {
  324. postapi("/api/app/reference-range", this.form).then((res) => {
  325. if (res.code != -1) {
  326. console.log("新增成功");
  327. this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
  328. this.id = this.curRowes.id;
  329. this.dialogVisible = false
  330. }
  331. });
  332. } else {
  333. putapi(`/api/app/reference-range/${this.id}`, this.form).then(
  334. (res) => {
  335. if (res.code != -1) {
  336. console.log("修改成功");
  337. this.dialogVisible = false
  338. this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
  339. }
  340. }
  341. );
  342. }
  343. },
  344. //确定新增或者编辑
  345. onsbmint() {
  346. this.$refs["form"].validate((v) => {
  347. let that = this
  348. if (v) {
  349. that.confirmationRequest()
  350. }
  351. });
  352. },
  353. },
  354. //监听事件
  355. watch: {
  356. //itemId','ReferenceRangeTypeFlag'
  357. itemId(newVal, oldVal) {
  358. if (newVal != oldVal && newVal != "") {
  359. this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
  360. }
  361. },
  362. ReferenceRangeTypeFlag(newVal, oldVal) {
  363. if (newVal != oldVal && newVal != "") {
  364. this.getlist(this.itemId, this.ReferenceRangeTypeFlag);
  365. }
  366. },
  367. },
  368. };
  369. </script>
  370. <style scoped>
  371. /* .box {
  372. display: flex;
  373. margin-top: 15px;
  374. } */
  375. /* :deep .editButton .el-button{
  376. width: 100%;
  377. } */
  378. /* :deep .el-form-item {
  379. margin-bottom: 14px;
  380. } */
  381. ::v-deep .diagnosisSelect .el-select-dropdown__wrap {
  382. background-color: #FFF;
  383. max-height: 288px;
  384. max-width: 280px;
  385. }
  386. </style>