AddAssistCheckSon.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <div class="assayBox" @click="close">
  3. <crumbs
  4. :title="'辅检子项维护-'+titleText"
  5. class="topBack"
  6. :param="$route.params"
  7. linkTo="AssistCheckSon"
  8. ></crumbs>
  9. <el-form :model="form" ref="ruleForm" class="addDepartForm">
  10. <p class="assayTitle">添加辅检标准术语</p>
  11. <el-form-item class="addDepartFormItem" v-if="!isEdit" label="添加:" prop="department">
  12. <input class="searchInput" @focus="focuInput" type="text" v-model = "searchConcept">
  13. <span class="searchName" @click="searchDiag">搜索</span>
  14. <ul class="itemList" v-show="conceptList.length>0">
  15. <li
  16. v-for="item in conceptList"
  17. class="diagItem ellipsis"
  18. :title="item.conceptName"
  19. @click="selectDiag(item)"
  20. :key="item.conceptId">
  21. {{item.conceptNameType||item.conceptName}}
  22. </li>
  23. </ul>
  24. </el-form-item>
  25. <el-form-item class="isRequired" label="已选择辅检标准术语:" prop="type">
  26. {{form.conceptNameType||form.conceptName}}
  27. </el-form-item>
  28. </el-form>
  29. <div class="symptomList">
  30. <div class="screenIndex clearfix">
  31. <p class="assayTitle">辅检子项添加</p>
  32. <label class="screenIndexLabel">添加:</label>
  33. <input class="searchInput" @focus="focuInput" type="text" v-model = "searchIndexVal">
  34. <span class="searchName" @click="searchIndex">搜索</span>
  35. <ul class="itemList indexList" v-show="indexList.length>0">
  36. <li
  37. v-for="item in indexList"
  38. class="diagItem ellipsis"
  39. :title="item.conceptName"
  40. @click="selectIndex(item)"
  41. :key="item.conceptName">
  42. {{item.conceptNameType||item.conceptName}}
  43. </li>
  44. </ul>
  45. </div>
  46. <table class="indexTab">
  47. <tr>
  48. <td class="selectedContent">已选择内容</td>
  49. <td class="selectedContentOpera">操作</td>
  50. </tr>
  51. <tr v-for="(item, index) in selectedIndexList" :key="item.conceptId">
  52. <!-- <td class="selectedContent ">{{item.parentConceptName?item.conceptName+'('+item.parentConceptName+')':item.conceptName}}</td> -->
  53. <td class="selectedContent ">{{item.conceptNameType||item.conceptName}}</td>
  54. <td class="selectedContentOpera"><el-button type="text" size="small" class="delete" @click="delSelectedIndex(item, index)">删除</el-button></td>
  55. </tr>
  56. </table>
  57. </div>
  58. <div class="btn">
  59. <el-button
  60. type="primary"
  61. :disabled = 'saveDisable'
  62. @click="submitForm('ruleForm')"
  63. >确 定</el-button>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import api from '@api/icss.js';
  69. import apis from '@api/medicalTerm.js';
  70. export default {
  71. name: 'AddAssistCheckSon',
  72. data() {
  73. return{
  74. form: {
  75. conceptId: '',
  76. conceptName:'' ,
  77. conceptNameType:''
  78. },
  79. titleText: '添加辅检子项',
  80. conceptList: [],
  81. indexList: [],
  82. selectedIndexList: [], //选择的同义词
  83. searchConcept: '',
  84. searchIndexVal: '',
  85. isEdit: false,
  86. nodeList:[], //辅检子项列表
  87. saveDisable: false
  88. }
  89. },
  90. created(){
  91. const { isEdit, data } = this.$route.params;
  92. if(isEdit) {
  93. this.isEdit = isEdit;
  94. this.titleText = '修改辅检子项';
  95. this.form.conceptId = data.conceptId;
  96. this.form.conceptName = data.conceptName;
  97. this.form.conceptNameType = data.conceptNameType;
  98. this.selectedIndexList = data.nodeList;
  99. }
  100. },
  101. methods: {
  102. close() {
  103. this.conceptList = [];
  104. this.indexList = [];
  105. },
  106. back(){
  107. this.$router.go(-1);
  108. },
  109. searchDiag() {
  110. const param = {
  111. "name": this.searchConcept,
  112. "relationId": 18,
  113. "relationPosition": 1,
  114. "relationTypeId": 16,
  115. "typeId": 16
  116. }
  117. api.getConceptInfoAssay(param).then((res)=>{
  118. if(res.data.code === '0') {
  119. this.conceptList = res.data.data
  120. }
  121. })
  122. },
  123. selectDiag(item) {
  124. this.form.conceptId = item.conceptId;
  125. this.form.conceptName = item.conceptName;
  126. this.form.conceptNameType = item.conceptNameType;
  127. this.searchConcept = '';
  128. this.conceptList=[];
  129. },
  130. focuInput() {
  131. // 聚焦时清空搜索结果?
  132. },
  133. selectedTags() {//已选项ids
  134. let selectedTags = []
  135. for (let i =0; i < this.selectedIndexList.length; i++) {
  136. selectedTags.push(this.selectedIndexList[i].conceptId)
  137. }
  138. return selectedTags
  139. },
  140. searchIndex() {
  141. const notIds =[this.form.conceptId ,...this.selectedTags()];
  142. const param = {
  143. "name": this.searchIndexVal,
  144. "relationId": 18,
  145. "relationPosition": 0,
  146. "typeId": 16,
  147. // "relationConceptId":this.form.conceptId,
  148. "excludedConceptIds":notIds
  149. }
  150. api.getConceptInfoAssay(param).then((res)=>{
  151. if(res.data.code === '0') {
  152. this.indexList = res.data.data;
  153. }
  154. })
  155. },
  156. selectIndex(item) {
  157. this.selectedIndexList.push(item);
  158. this.indexList = [];
  159. },
  160. delSelectedIndex(selectedItem, index) {
  161. this.selectedIndexList.splice(index, 1)
  162. this.nodeList.splice(index, 1)
  163. },
  164. submitForm(formName) {
  165. if(!this.form.conceptId) {
  166. this.warning('请选择辅检标准术语')
  167. return
  168. }
  169. if(this.selectedIndexList.length === 0) {
  170. this.warning('请添加辅检子项')
  171. return
  172. }
  173. this.showDelDialog();
  174. },
  175. showDelDialog() {
  176. const selected = this.selectedIndexList;
  177. for (let i = 0; i < selected.length; i++) {
  178. let item = {};
  179. item.conceptId = selected[i].conceptId;
  180. item.relationId = 18;
  181. this.nodeList.push(item);
  182. }
  183. const param ={
  184. "conceptId": this.form.conceptId,
  185. "nodeList": this.nodeList,
  186. "sonRelationId": 18
  187. }
  188. this.showConfirmDialog('是否建立该关联?', () => {
  189. this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
  190. apis.assistCheckPacsAddPacsRelation(param).then((res) => {
  191. if (res.data.code === '0') {
  192. this.warning(res.data.msg || '关联成功', 'success','1000')
  193. setTimeout(() => {
  194. //返回带搜索条件的首页
  195. this.$router.push({
  196. name:'AssistCheckSon',
  197. params: Object.assign({}, this.$route.params, {currentPage: 1})
  198. })
  199. }, 1000);
  200. } else {
  201. this.warning(res.data.msg)
  202. }
  203. this.saveDisable = false
  204. }).catch((err) => {
  205. this.warning(err);
  206. })
  207. });
  208. },
  209. showConfirmDialog(msg, resolve) {
  210. this.$alert(msg, '提示', {
  211. confirmButtonText: '确定',
  212. type: 'warning'
  213. }).then(() => {
  214. resolve();
  215. }).catch(() => {});
  216. },
  217. warning(msg, type,time) {
  218. this.$message({
  219. showClose: true,
  220. message: msg,
  221. type: type || 'warning',
  222. duration:time || '3000'
  223. })
  224. },
  225. }
  226. }
  227. </script>
  228. <style lang="less">
  229. @import '../../less/common.less';
  230. .assayBox {
  231. color: #606266;
  232. min-width: 980px;
  233. .topBack {
  234. top: 0;
  235. }
  236. .assayTitle{
  237. font-weight: bold;
  238. margin-bottom: 20px;
  239. }
  240. .groupTitle {
  241. background-color: #fff;
  242. height: 40px;
  243. line-height: 40px;
  244. padding-left: 20px;
  245. }
  246. .searchInput, .searchName {
  247. display: inline-block;
  248. height: 32px;
  249. line-height: 32px;
  250. border: 1px solid #a9a9a9;
  251. margin: 0px 0 0 0;
  252. padding: 0 5px;
  253. float: left;
  254. margin-top: 4px;
  255. }
  256. .isRequired .el-form-item__label::before {
  257. content: '*';
  258. color: red;
  259. }
  260. .searchName {
  261. border-left: none;
  262. cursor: pointer;
  263. font-size: 16px;
  264. padding: 0 14px;
  265. }
  266. .itemList {
  267. position: absolute;
  268. // display: none;
  269. background: #fff;
  270. width: 162px;
  271. max-height: 150px;
  272. border: 1px solid #a9a9a9;
  273. left: 54px;
  274. top: 37px;
  275. z-index: 2;
  276. overflow-y: auto;
  277. }
  278. .diagItem {
  279. padding: 0 5px;
  280. height: 30px;
  281. line-height: 30px;
  282. font-size: 14px;
  283. cursor: pointer;
  284. }
  285. .diagItem:hover {
  286. background: #f5f7fa;
  287. }
  288. .addDepartForm {
  289. position: relative;
  290. background-color: #fff;
  291. padding: 20px;
  292. margin: 70px 20px 0px 20px;
  293. border-bottom: 1px solid #c0c4cc;
  294. }
  295. .addDepartFormItem {
  296. position: relative;
  297. }
  298. .symptomList {
  299. background-color: #fff;
  300. padding: 20px;
  301. margin: 0px 20px 0px 20px;
  302. min-height: 400px;
  303. }
  304. .screenIndexLabel {
  305. float: left;
  306. height: 40px;
  307. line-height: 40px;
  308. font-size: 14px;
  309. }
  310. .indexTab {
  311. // width: 100%;
  312. width: 600px;
  313. border-collapse: collapse;
  314. tr {
  315. td {
  316. padding: 5px 10px;
  317. border-bottom: 1px solid #a9a9a9;
  318. text-align: center;
  319. }
  320. }
  321. .selectedContent {
  322. width: 25%;
  323. }
  324. .selectedContentGrop {
  325. width: 55%;
  326. }
  327. .selectedContentOpera {
  328. width: 20%;
  329. }
  330. }
  331. .screenIndex {
  332. width: 100%;
  333. margin-bottom: 30px;
  334. position: relative;
  335. }
  336. .indexList {
  337. left: 42px;
  338. top: 78px;
  339. }
  340. .groupInput {
  341. text-align: center;
  342. height: 28px;
  343. color: #606266;
  344. width: 60%;
  345. }
  346. .btn {
  347. position: relative;
  348. background-color: #fff;
  349. margin: 0px 20px;
  350. height: 40px;
  351. padding: 20px;
  352. .el-button {
  353. position: absolute;
  354. right: 20px;
  355. }
  356. }
  357. .selectDepart {
  358. }
  359. }
  360. </style>