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.

730 lines
25 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
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
11 months 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
11 months ago
3 weeks 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
11 months 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
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
11 months ago
2 years ago
11 months 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 class="box">
  3. <div>
  4. <div class="middlebox">
  5. <div class="contenttitle">
  6. 基础资料 /
  7. <span class="contenttitleBold"
  8. >诊断建议设置</span
  9. >
  10. </div>
  11. <div class="seachinput">
  12. <el-select v-model="diagnosis" placeholder="快速查找" size="small"
  13. filterable :filter-method="filterMethod" value-key="id"
  14. clearable @clear="quickTableData = deepCopy(tableData)"
  15. @change="quickDiagnosis" default-first-option ref="elSelectKeyWords">
  16. <!--
  17. <el-option key='1' value="" label="1" />
  18. <el-option key='2' value="{id:'2',displayName:'n2'}" label="2" />
  19. -->
  20. <!-- -->
  21. <el-option v-for="item in quickTableData" :key="item.id" :value="item" :label="item.displayName" />
  22. </el-select>
  23. </div>
  24. </div>
  25. <div style="display: flex;margin-top: 7px;">
  26. <!-- 类别树组件 -->
  27. <div :style="'width: 208px; height:' +(window.pageHeight < 600 ? 505 : window.pageHeight - 100) +'px;background-color: #fff; border-radius: 8px'">
  28. <ItemTypeTree :refreshItemTypeId="refreshItemTypeId" :itemTypeId="query.itemTypeId"/>
  29. </div>
  30. <!-- 诊断与建议 -->
  31. <div style="display: block;">
  32. <!-- 诊断列表 -->
  33. <div style="margin-left:15px;display: flex;">
  34. <div :style="'width:' + (window.pageWidth - 200 - 110 - 50-14) + 'px;padding: 15px;background-color: #fff;border-radius: 8px;'">
  35. <div style="margin-left: 5px;display: flex; flex-wrap: wrap;">
  36. <div>
  37. <!--
  38. <el-checkbox v-model="query.itemTypeFlag">项目类别作为查询条件</el-checkbox>
  39. <el-input placeholder="查询关键字" v-model="query.keyWords" size="small" clearable style="width: 200px" />
  40. -->
  41. </div>
  42. </div>
  43. <div>
  44. <el-table :data="tableData" id="elTableDiagnosis" row-key="id"
  45. :height="window.pageHeight < 600 ? 190 : Math.floor((window.pageHeight - 240) / 2)"
  46. highlight-current-row @row-click="rowClick" size="small" ref="elTable">
  47. <el-table-column type="index" label="序号" width="40" align="center"/>
  48. <el-table-column
  49. v-for="(item, index) in headerCols"
  50. :key="`col_${index}`"
  51. :min-width="dropCol[index].minWidth"
  52. :align="dropCol[index].align"
  53. :label="item.label"
  54. >
  55. <template slot-scope="scope">
  56. <div v-if="dropCol[index].prop == 'sn'" >
  57. {{ scope.$index + 1 }}
  58. </div>
  59. <div v-else-if ="dropCol[index].prop == 'isIll'
  60. || dropCol[index].prop == 'isSummaryTemplate'" >
  61. {{ scope.row[dropCol[index].prop] == 'Y' ? '是':'否' }}
  62. </div>
  63. <!--
  64. <div v-else-if="dropCol[index].prop == 'itemTypeId'" >
  65. <el-cascader :options="dict.itemTypeTree" v-model="scope.row[dropCol[index].prop]"
  66. :props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" :show-all-levels="false"
  67. disabled size="small">
  68. </el-cascader>
  69. </div>
  70. -->
  71. <div v-else-if="dropCol[index].prop == 'diagnosisLevelId'" >
  72. {{ dddw(dict.diagnosisLevel, "id", scope.row[dropCol[index].prop], "displayName") }}
  73. </div>
  74. <div v-else-if="dropCol[index].prop == 'forSexId'" >
  75. {{ dddw(dict.forSex, "id", scope.row[dropCol[index].prop], "displayName") }}
  76. </div>
  77. <div v-else-if ="dropCol[index].prop == 'lastModificationTime'
  78. || dropCol[index].prop == 'creationTime'" >
  79. {{ scope.row[dropCol[index].prop] ? moment(scope.row[dropCol[index].prop]).format('yyyy-MM-DD HH:mm:ss'):'' }}
  80. </div>
  81. <div v-else>
  82. {{ scope.row[dropCol[index].prop] }}
  83. </div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="排序" width="40" align="center">
  87. <template>
  88. <el-tag
  89. class="move"
  90. style="
  91. cursor: move;
  92. background-color: rgb(245, 245, 245);
  93. border: none;
  94. "
  95. draggable="true"
  96. >
  97. <i
  98. class="el-icon-d-caret"
  99. style="
  100. width: 1rem;
  101. height: 1rem;
  102. color: rgb(113, 113, 113);
  103. "
  104. ></i>
  105. </el-tag>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. </div>
  110. </div>
  111. <!--按钮-->
  112. <div style="margin-left: 10px;">
  113. <!---->
  114. <div>
  115. <el-button class="commonbutton" @click="btnQuery">刷新</el-button>
  116. </div>
  117. <div style="margin-top: 10px">
  118. <el-button type="primary" class="commonbutton" @click="btnAdd">新增</el-button>
  119. </div>
  120. <div style="margin-top: 10px">
  121. <el-button type="success" class="commonbutton" @click="btnEdit">编辑</el-button>
  122. </div>
  123. <div style="margin-top: 10px">
  124. <el-button type="danger" class="deleteButton" @click="btnDel">删除</el-button>
  125. </div>
  126. <div style="margin-top: 10px">
  127. <el-button type="danger" class="commonbutton" @click="btnSort">保存排序</el-button>
  128. </div>
  129. </div>
  130. </div>
  131. <!-- 诊断对应的建议列表 -->
  132. <div style="margin-top:15px;">
  133. <DiagnosisSug :formDiagnosis="form" :refreshSugs="refreshSugs" :refreshSuges="refreshSuges" :refreshSugess="refreshSugess"/>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <!--新增/编辑-->
  139. <el-dialog
  140. :title="form.id ? '编辑' : '新增'"
  141. :visible.sync="dialogVisible"
  142. width="800px" @close="closeDialog"
  143. :close-on-click-modal="false"
  144. >
  145. <el-form ref="form" :model="form" label-width="100px" :rules="rules">
  146. <el-row>
  147. <el-col :span="8">
  148. <el-form-item label="名称" prop="displayName">
  149. <el-input v-model="form.displayName" size="small" @input="inputDisplayName" />
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="8">
  153. <el-form-item label="项目类别" prop="itemTypeId">
  154. <el-cascader :options="dict.itemTypeTree" v-model="form.itemTypeId"
  155. :props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" popper-class="example"
  156. ref="itemTypeIds"
  157. @change="ischangsItemTypeId"
  158. size="small">
  159. </el-cascader>
  160. </el-form-item>
  161. </el-col>
  162. <el-col :span="8">
  163. <el-form-item label="疾病" prop="isIll">
  164. <el-radio v-model="form.isIll" label="Y"></el-radio>
  165. <el-radio v-model="form.isIll" label="N"></el-radio>
  166. </el-form-item>
  167. </el-col>
  168. </el-row>
  169. <el-row>
  170. <el-col :span="8">
  171. <el-form-item label="建议名称" prop="suggestionName">
  172. <el-input v-model="form.suggestionName" size="small"/>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="8">
  176. <el-form-item label="总检模板" prop="isSummaryTemplate">
  177. <el-radio v-model="form.isSummaryTemplate" label="Y"></el-radio>
  178. <el-radio v-model="form.isSummaryTemplate" label="N"></el-radio>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="8">
  182. <el-form-item label="适用性别" prop="forSexId">
  183. <el-select v-model="form.forSexId" placeholder="请选择" size="small">
  184. <el-option
  185. v-for="item in dict.forSex"
  186. :key="item.id"
  187. :label="item.displayName"
  188. :value="item.id"
  189. >
  190. </el-option>
  191. </el-select> </el-form-item
  192. ></el-col>
  193. </el-row>
  194. <el-row>
  195. <el-col :span="8">
  196. <el-form-item label="诊断级别" prop="diagnosisLevelId">
  197. <el-select v-model="form.diagnosisLevelId" placeholder="请选择" size="small">
  198. <el-option
  199. v-for="item in dict.diagnosisLevel"
  200. :key="item.id"
  201. :label="item.displayName"
  202. :value="item.id"
  203. >
  204. </el-option>
  205. </el-select> </el-form-item
  206. ></el-col>
  207. <el-col :span="8">
  208. <el-form-item label="启用" prop="isActive">
  209. <el-radio v-model="form.isActive" label="Y"></el-radio>
  210. <el-radio v-model="form.isActive" label="N"></el-radio>
  211. </el-form-item>
  212. </el-col>
  213. </el-row>
  214. </el-form>
  215. <span slot="footer" class="dialog-footer">
  216. <el-button @click="dialogVisible = false" class="difference"> </el-button>
  217. <el-button type="primary" @click="onSubmit('form')" class="commonbutton"> </el-button>
  218. </span>
  219. </el-dialog>
  220. </div>
  221. </template>
  222. <script>
  223. import moment from "moment";
  224. import { mapState } from "vuex";
  225. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  226. import Sortable from "sortablejs";
  227. import ItemTypeTree from "../../components/common/ItemTypeTree.vue";
  228. import DiagnosisSug from "./diagnosisSug.vue";
  229. import { deepCopy,dddw, arrayExistObj, objCopy } from '@/utlis/proFunc';
  230. export default {
  231. components: {
  232. ItemTypeTree,
  233. DiagnosisSug,
  234. },
  235. data() {
  236. return {
  237. query:{
  238. triggerScroll:0, //触发按类别定
  239. itemTypeFlag:true, //项目类别是否 作为查询条件
  240. itemTypeId:'',
  241. keyWords:'',
  242. },
  243. diagnosis: {}, //null, //{id:'',displayName:''}
  244. tableData:[], //诊断列表(显示)
  245. diagnosisAll:[], // 所有诊断列表
  246. quickTableData:[], //快速查找诊断
  247. formInit:{},
  248. form:{
  249. id:'',
  250. itemTypeId:'',
  251. isIll:'Y',
  252. displayName:'',
  253. suggestionName:'',
  254. forSexId:'A',
  255. isSummaryTemplate:'N',
  256. isActive:'Y',
  257. diagnosisLevelId:1, //
  258. medicalInterpretations:[],
  259. healthGuidances:[],
  260. commonReasons:[]
  261. },
  262. dialogVisible:false,
  263. rules: {
  264. displayName: [{ required: true, message: "请输入诊断名称", trigger: "blur" }],
  265. itemTypeId: [{ required: true, message: "请输入项目类别", trigger: "blur" }],
  266. },
  267. //动态列(预留)
  268. headerCols: [],
  269. //拖动列(预留)
  270. dropCol: [
  271. //{ label: "序号",prop: "sn",minWidth: 40,align:"center"},
  272. // { label: "项目类别",prop: "itemTypeId",minWidth: 120,align:"center"},
  273. { label: "诊断级别",prop: "diagnosisLevelId",minWidth: 60,align:"center"},
  274. { label: "诊断名称",prop: "displayName",minWidth: 100,align:"center"},
  275. { label: "建议名称",prop: "suggestionName",minWidth: 100,align:"center"},
  276. { label: "疾病",prop: "isIll",minWidth: 40,align:"center"},
  277. { label: "适用性别",prop: "forSexId",minWidth: 60,align:"center"},
  278. { label: "总检模板",prop: "isSummaryTemplate",minWidth: 60,align:"center"},
  279. { label: "创建者",prop: "creatorName",minWidth: 60,align:"center"},
  280. { label: "创建时间",prop: "creationTime",minWidth: 130,align:"center"},
  281. { label: "修改者",prop: "lastModifierName",minWidth: 60,align:"center"},
  282. { label: "修改时间",prop: "lastModificationTime",minWidth: 130,align:"center"},
  283. ],
  284. };
  285. },
  286. created() {
  287. this.init()
  288. },
  289. //挂载完成
  290. mounted() {
  291. this.rowDrop('elTableDiagnosis')
  292. // this.btnQuery()
  293. },
  294. computed: {
  295. ...mapState(["customerOrg", "window","dict"]),
  296. },
  297. methods: {
  298. moment,dddw,deepCopy,
  299. init(){
  300. this.formInit = Object.assign({},this.form)
  301. this.headerCols = deepCopy(this.dropCol)
  302. //适用性别(查询)
  303. getapi("/api/app/for-sex").then((res) => {
  304. if (res.code != -1) {
  305. this.dict.forSex = res.data;
  306. }
  307. });
  308. //诊断级别
  309. getapi("/api/app/diagnosis-level/in-filter").then((res) => {
  310. if (res.code != -1) {
  311. this.dict.diagnosisLevel = res.data;
  312. }
  313. });
  314. this.allDiagnosis()
  315. },
  316. //查询所有 诊断记录
  317. allDiagnosis(){
  318. postapi('/api/app/diagnosis/getlistinsuggestion',{}).then(res =>{
  319. if(res.code != -1){
  320. this.diagnosisAll = res.data
  321. this.quickTableData = res.data
  322. }
  323. })
  324. },
  325. // 供树节点组件调用,更新当前所选的项目类别
  326. refreshItemTypeId(itemTypeId){
  327. this.query.itemTypeId = itemTypeId
  328. this.query.triggerScroll++
  329. },
  330. // 供明建议组件调用,更新所选建议
  331. refreshSugs(sugs){
  332. if(!this.form.id) return
  333. this.form.medicalInterpretations = deepCopy(sugs)
  334. let lfind = arrayExistObj(this.tableData,'id',this.form.id)
  335. if(lfind > -1) this.tableData[lfind] = Object.assign(this.tableData[lfind],this.form)
  336. },
  337. refreshSuges(sugs){
  338. if(!this.form.id) return
  339. this.form.healthGuidances = deepCopy(sugs)
  340. let lfind = arrayExistObj(this.tableData,'id',this.form.id)
  341. if(lfind > -1) this.tableData[lfind] = Object.assign(this.tableData[lfind],this.form)
  342. },
  343. refreshSugess(sugs){
  344. if(!this.form.id) return
  345. this.form.commonReasons = deepCopy(sugs)
  346. let lfind = arrayExistObj(this.tableData,'id',this.form.id)
  347. if(lfind > -1) this.tableData[lfind] = Object.assign(this.tableData[lfind],this.form)
  348. },
  349. async btnQuery(){
  350. let body = {}
  351. if(this.query.itemTypeFlag && this.query.itemTypeId){
  352. body.itemTypeId = this.query.itemTypeId
  353. }else{
  354. return
  355. }
  356. // if(this.query.keyWords) body.keyWords = this.query.keyWords
  357. postapi('/api/app/diagnosis/getlistinsuggestion',body).then(res =>{
  358. if(res.code != -1){
  359. this.tableData = res.data
  360. this.form = Object.assign({},this.formInit)
  361. }
  362. })
  363. },
  364. //快速查找诊断时,调整可按拼间简码及简称查找
  365. filterMethod(keyWords) {
  366. //console.log('filterMethod',this.dict.asbItemQuick)
  367. if (keyWords) {
  368. this.quickTableData = [];
  369. this.diagnosisAll.forEach(item => {
  370. if (item.displayName.indexOf(keyWords) > - 1
  371. || item.simpleCode.indexOf(keyWords.toUpperCase()) > - 1
  372. || item.suggestionName.indexOf(keyWords) > - 1) {
  373. this.quickTableData.push(item);
  374. }
  375. });
  376. } else {
  377. this.quickTableData = deepCopy(this.diagnosisAll);
  378. }
  379. },
  380. //快速查找诊断
  381. quickDiagnosis(v) {
  382. //远程查询时,设置了 value-key 也不管用,只能取到value console.log('quickDiagnosis',v)
  383. let lfind = -1
  384. if(!v.itemTypeId) return
  385. this.query.itemTypeId = v.itemTypeId
  386. let body = {
  387. itemTypeId:v.itemTypeId
  388. }
  389. postapi('/api/app/diagnosis/getlistinsuggestion',body).then(res =>{
  390. if(res.code != -1){
  391. this.tableData = res.data
  392. this.form = Object.assign({},this.formInit)
  393. // lfind = arrayExistObj(this.tableData, 'id', v.id)
  394. // if (lfind > -1) {
  395. // this.$refs['elTable'].setCurrentRow(this.tableData[lfind])
  396. // this.rowClick(this.tableData[lfind])
  397. // this.scrollToRow(lfind)
  398. // }
  399. this.tableData.forEach((item, index) => {
  400. if (v.id == item.id) {
  401. this.$refs["elTable"].setCurrentRow(item);
  402. this.rowClick(item);
  403. this.scrollToRow(item)
  404. this.searchup(item, index)
  405. }
  406. });
  407. }
  408. })
  409. //console.log('v,query.diagnosis',v,this.query.diagnosis)
  410. this.$refs['elSelectKeyWords'].focus(); //asbItemId
  411. this.$nextTick(() => {
  412. this.$refs['elSelectKeyWords'].blur(); //total asbItemId
  413. // this.query.keyWords = ''
  414. this.quickTableData = deepCopy(this.diagnosisAll)
  415. this.$refs['elSelectKeyWords'].focus(); //total asbItemId
  416. });
  417. },
  418. searchup(data,index) {
  419. this.$nextTick(()=>{
  420. if(index==0){
  421. index=1
  422. }
  423. const targetTop = this.$refs["elTable"].$el.querySelectorAll('.el-table__body tr')[index-1].getBoundingClientRect().top
  424. const containerTop = this.$refs["elTable"].$el.querySelector('.el-table__body').getBoundingClientRect().top
  425. const scrollParent = this.$refs["elTable"].$el.querySelector('.el-table__body-wrapper')
  426. scrollParent.scrollTop = targetTop - containerTop
  427. })
  428. },
  429. // 选体检类别时,定位到相应类别的第1行
  430. triggerScroll(){
  431. if(!this.query.itemTypeId) return
  432. let lfind = arrayExistObj(this.tableData,'itemTypeId',this.query.itemTypeId)
  433. if(lfind > -1){
  434. this.scrollToRow(lfind)
  435. }
  436. },
  437. scrollToRow(rowNum){
  438. let dom = this.$refs['elTable'].bodyWrapper
  439. this.$nextTick(() =>{
  440. let tableHeight = this.window.pageHeight < 600 ? 200 : Math.floor((this.window.pageHeight - 200) / 2)
  441. let rowHeight = 36.96
  442. dom.scrollTo(0, rowHeight * rowNum - tableHeight*rowNum/(2*this.tableData.length) )
  443. })
  444. },
  445. //拖拽
  446. rowDrop(elId) {
  447. this.$nextTick(() => {
  448. let el = document.querySelector(`#${elId} tbody`);
  449. //console.log('tbody', el)
  450. let that = this;
  451. Sortable.create(el, {
  452. handle: ".move", // 选中class='move'的元素按住,方可拖动
  453. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  454. //拖拽结束
  455. onChoose({ oldIndex }) {
  456. that.$refs["elTable"].setCurrentRow(that.tableData[oldIndex]);
  457. that.rowClick(that.tableData[oldIndex]);
  458. },
  459. onEnd({ newIndex, oldIndex }) {
  460. let currRow = that.tableData.splice(oldIndex, 1)[0];
  461. that.tableData.splice(newIndex, 0, currRow);
  462. },
  463. });
  464. });
  465. },
  466. rowClick(row){
  467. this.form = deepCopy(row)
  468. //用于选择树节点
  469. // if(typeof row.itemTypeId == 'string'){
  470. // this.query.itemTypeId = row.itemTypeId
  471. // }else{
  472. // this.query.itemTypeId = row.itemTypeId[row.itemTypeId.length - 1]
  473. // }
  474. },
  475. btnAdd(){
  476. if(!this.query.itemTypeId){
  477. this.$message.warning("请先选择项目类别!")
  478. return
  479. }
  480. this.form = deepCopy(this.formInit)
  481. this.form.itemTypeId = this.query.itemTypeId
  482. this.dialogVisible = true
  483. },
  484. btnEdit(){
  485. if(!this.form.id){
  486. this.$message.warning("请先选择要编辑的诊断记录!")
  487. return
  488. }
  489. this.dialogVisible = true
  490. },
  491. ischangsItemTypeId(v){
  492. if(v.length>1){
  493. this.form.itemTypeId=this.form.itemTypeId.slice(-1)[0]
  494. }else{
  495. this.form.itemTypeId=this.form.itemTypeId[0]
  496. }
  497. this.$refs.itemTypeIds.toggleDropDownVisible();
  498. },
  499. inputDisplayName(v){
  500. //console.log(v)
  501. this.form.suggestionName = v
  502. },
  503. onSubmit(formName){
  504. let msg='',body = {},itemTypeId=''
  505. this.$refs[formName].validate((valid, fields) => {
  506. if (!valid) {
  507. msg = fields[Object.keys(fields)[0]][0].message;
  508. return false;
  509. }
  510. })
  511. if(msg){
  512. this.$message.warning(msg);
  513. return
  514. }
  515. if(typeof this.form.itemTypeId == 'object'){
  516. itemTypeId = this.form.itemTypeId[this.form.itemTypeId.length - 1]
  517. }else{
  518. itemTypeId = this.form.itemTypeId
  519. }
  520. body = {
  521. displayName: this.form.displayName,
  522. itemTypeId,
  523. suggestionName: this.form.suggestionName,
  524. isIll: this.form.isIll,
  525. isSummaryTemplate: this.form.isSummaryTemplate,
  526. forSexId: this.form.forSexId,
  527. diagnosisLevelId: this.form.diagnosisLevelId,
  528. isActive:this.form.isActive,
  529. }
  530. // console.log('this.form',this.form)
  531. if(this.form.id){
  532. postapi(`/api/app/diagnosis/updatediagnosis?id=${this.form.id}`,body).then(res =>{
  533. if(res.code != -1){
  534. this.dialogVisible = false
  535. //this.$message.success('操作成功!')
  536. }
  537. })
  538. }else{
  539. postapi(`/api/app/diagnosis/creatediagnosis`,body).then(res =>{
  540. if(res.code != -1){
  541. this.form = Object.assign(this.form,res.data)
  542. this.dialogVisible = false
  543. //this.$message.success('操作成功!')
  544. }
  545. })
  546. }
  547. },
  548. btnSort(){
  549. if(this.tableData.length<2) return
  550. let itemList = []
  551. this.tableData.forEach((e,index) =>{
  552. itemList.push({
  553. id:e.id,
  554. displayOrder:index+1
  555. })
  556. })
  557. putapi('/api/app/diagnosis/updatesortmany',{itemList}).then(res =>{
  558. if(res.code != -1){
  559. //this.$message.success('操作成功!')
  560. }
  561. })
  562. },
  563. closeDialog(){
  564. if(!this.form.id) return
  565. let curRow = {}
  566. let lfind = arrayExistObj(this.tableData,'id',this.form.id)
  567. if(lfind > -1){
  568. curRow = Object.assign(this.tableData[lfind],this.form)
  569. this.tableData[lfind] = curRow
  570. }else{
  571. lfind = this.tableData.length
  572. curRow = Object.assign({},this.form)
  573. this.tableData.push(curRow)
  574. }
  575. if(lfind > -1){
  576. this.$refs['elTable'].setCurrentRow(curRow)
  577. this.$nextTick(() =>{
  578. this.rowClick(curRow)
  579. })
  580. }
  581. this.allDiagnosis()
  582. },
  583. btnDel(){
  584. if(!this.form.id){
  585. this.$message.warning("请先选中要删除的诊断记录!")
  586. return
  587. }
  588. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  589. confirmButtonText: "是",
  590. cancelButtonText: "否",
  591. type: "warning",
  592. cancelButtonClass:"difference",
  593. confirmButtonClass:"commonbutton"
  594. }).then(() => {
  595. //console.log('{patientRegisterIds}',{patientRegisterIds})
  596. return postapi(`/api/app/diagnosis/deletediagnosis?id=${this.form.id}`);
  597. }).then((res) => {
  598. if(res.code != -1){
  599. let lfind = arrayExistObj(this.tableData,'id',this.form.id)
  600. if(lfind > -1) this.tableData.splice(lfind,1)
  601. this.form = deepCopy(this.formInit)
  602. this.allDiagnosis()
  603. //this.$message.success('操作成功!')
  604. }
  605. }).catch((err) => {
  606. if (err == "cancel") {
  607. this.$message.info("已取消操作");
  608. }
  609. });
  610. },
  611. },
  612. watch: {
  613. // "query.itemTypeId":{
  614. // immediate: true, // 立即执行
  615. // // deep: true, // 深度监听复杂类型内变化
  616. // handler(newVal,oldVal){
  617. // // console.log('watch:patientRegisterNo:',newVal,oldVal)
  618. // if(newVal != oldVal){
  619. // this.btnQuery();
  620. // }
  621. // }
  622. // },
  623. "query.triggerScroll":{
  624. immediate: true, // 立即执行
  625. // deep: true, // 深度监听复杂类型内变化
  626. handler(newVal,oldVal){
  627. // console.log('watch:patientRegisterNo:',newVal,oldVal)
  628. if(newVal != oldVal){
  629. this.btnQuery();
  630. }
  631. }
  632. },
  633. },
  634. };
  635. </script>
  636. <style scoped>
  637. @import '../../assets/css/global_button.css';
  638. @import '../../assets/css/global_card.css';
  639. @import '../../assets/css/global_dialog.css';
  640. @import '../../assets/css/global_form.css';
  641. @import '../../assets/css/global_input.css';
  642. @import '../../assets/css/global_table.css';
  643. @import '../../assets/css/global.css';
  644. .box {
  645. display: flex;
  646. flex-direction: column;
  647. }
  648. /* form表单每一项的下边距 */
  649. :deep .el-form-item {
  650. margin-bottom: 14px;
  651. }
  652. /* 去掉input textarea的手动扩张样式 */
  653. :deep(.el-textarea__inner) {
  654. resize: none;
  655. }
  656. /* el-dialog的头部样式 */
  657. :deep .el-dialog__header {
  658. padding: 11px 20px 11px;
  659. }
  660. /* el-dialog的主体样式 */
  661. :deep .el-dialog__body {
  662. padding: 0px 20px 0px;
  663. }
  664. /* el-divider样式 */
  665. :deep .el-divider--horizontal {
  666. margin: 0px 0 12px;
  667. }
  668. /* el-dialog的底部样式 */
  669. :deep .el-dialog__footer {
  670. padding: 0px 20px 14px;
  671. }
  672. .seachinput {
  673. width: 250px;
  674. margin-right: 110px;
  675. }
  676. :deep .seachinput .el-select {
  677. width: 100%;
  678. }
  679. </style>