AssistCheckSon.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <div>
  3. <crumbs title="辅检子项维护" style="min-width: 980px">
  4. <el-form :inline="true" class="demo-form-inline">
  5. <el-form-item label="标准术语:">
  6. <el-input size="mini" v-model.trim="filter.conceptName" placeholder="术语名称" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item>
  9. <el-button size="mini" @click="filterDatas">确认</el-button>
  10. <el-button size="mini" type="warning" @click="addRelation">添加辅检子项</el-button>
  11. </el-form-item>
  12. </el-form>
  13. </crumbs>
  14. <div class="contents">
  15. <el-table
  16. :data="list"
  17. border
  18. style="width: 100%">
  19. <el-table-column
  20. :resizable = "false"
  21. type="index"
  22. :index = 'indexMethod'
  23. label="编号"
  24. width="60">
  25. </el-table-column>
  26. <el-table-column
  27. :resizable = "false"
  28. prop="operTime"
  29. label="操作时间"
  30. width="180">
  31. </el-table-column>
  32. <el-table-column
  33. :resizable = "false"
  34. prop="libName"
  35. label="标准术语"
  36. show-overflow-tooltip>
  37. </el-table-column>
  38. <el-table-column
  39. :resizable = "false"
  40. prop="otherNames"
  41. label="子项"
  42. show-overflow-tooltip>
  43. </el-table-column>
  44. <el-table-column
  45. label="状态"
  46. show-overflow-tooltip>
  47. <template slot-scope="scope">
  48. <span :class="scope.row.isDeleted == 'N'?'':'delete'">
  49. {{scope.row.isDeleted == 'N'?'启用中':'已删除'}}
  50. </span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column
  54. :resizable = "false"
  55. prop="operName"
  56. label="操作人">
  57. </el-table-column>
  58. <el-table-column
  59. :resizable = "false"
  60. prop="operate"
  61. label="操作">
  62. <template slot-scope="scope">
  63. <el-button @click="modifyRelation(scope.row)" type="text" size="small" :disabled="scope.row.isDeleted != 'N'">修改</el-button>
  64. <span style="margin:0 3px;">|</span>
  65. <el-button @click="showDelDialog(scope.row)" :class="scope.row.isDeleted == 'N'?'delete':'review'" type="text" size="small">{{scope.row.isDeleted == 'N'?'删除':'恢复'}}</el-button>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <div class="pagination">
  70. <el-pagination :current-page.sync="currentPage"
  71. @current-change="currentChange"
  72. background
  73. :page-size="pageSize"
  74. :page-sizes="pageSizeArr"
  75. @size-change="handleSizeChange"
  76. :layout="pageLayout"
  77. :total="total">
  78. </el-pagination>
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import api from '@api/medicalTerm.js';
  85. import config from '@api/config.js';
  86. export default {
  87. name: 'AssistCheckSon', //慢病指标值关联维护
  88. data: function() {
  89. return {
  90. list: [],
  91. searched: false,
  92. filter:{
  93. conceptName:'',
  94. },
  95. currentPage: 1,
  96. pageSize: config.pageSize,
  97. pageSizeArr:config.pageSizeArr,
  98. pageLayout:config.pageLayout,
  99. total: 0,
  100. }
  101. },
  102. created() {
  103. const that = this;
  104. //返回时避免参数未赋值就获取列表
  105. setTimeout(function(){
  106. that.getDataList();
  107. });
  108. },
  109. watch: {
  110. 'filter': {
  111. handler: function () {
  112. this.searched = false;
  113. },
  114. deep: true
  115. }
  116. },
  117. beforeRouteEnter(to, from, next) {
  118. next(vm => {
  119. //const pm = to.param;
  120. Object.assign(vm, to.params);
  121. })
  122. },
  123. methods: {
  124. handleSizeChange(val){
  125. this.pageSize = val;
  126. this.getDataList();
  127. },
  128. getDataList(isTurnPage) {
  129. const param = this.getFilterItems(isTurnPage);
  130. this.searched = true;
  131. api.assistCheckPacsSonContactList(param).then((res) => {
  132. if(res.data.code == '0') {
  133. this.list = res.data.data.records;
  134. this.total = res.data.data.total;
  135. }
  136. })
  137. },
  138. filterDatas() {
  139. this.currentPage = 1;
  140. this.getDataList();
  141. },
  142. addRelation() {
  143. const pam = this.searched ? {
  144. currentPage: this.currentPage,
  145. pageSize:this.pageSize,
  146. filter: this.filter
  147. } : {currentPage: this.currentPage,
  148. pageSize:this.pageSize};
  149. this.$router.push({name:'AddAssistCheckSon', params: pam})
  150. },
  151. modifyRelation(row) {
  152. const param = {
  153. conceptId: row.conceptId,
  154. // relationId:18
  155. relationIds:[18], //9-23后台修改
  156. typeIds:[16]
  157. }
  158. api.assistCheckGetPacsContactDetail(param).then((res) => {
  159. if(res.data.code == '0') {
  160. const pam = this.searched ? {
  161. currentPage: this.currentPage,
  162. pageSize:this.pageSize,
  163. filter: this.filter
  164. } : {currentPage: this.currentPage,
  165. pageSize:this.pageSize};
  166. // const item = Object.assign({},row,{data: res.data.data});
  167. const item = res.data.data;
  168. this.$router.push({name:'AddAssistCheckSon',params:Object.assign(pam, {isEdit:true,data:item})});
  169. }
  170. })
  171. },
  172. currentChange(next) {
  173. this.currentPage = next;
  174. this.getDataList(true);
  175. },
  176. getFilterItems(isTurnPage) {
  177. //翻页时筛选条件没点确定则清空
  178. if(isTurnPage&&!this.searched){
  179. this.filter.conceptName='';
  180. };
  181. const param = {
  182. current: this.currentPage,
  183. size: this.pageSize,
  184. name:this.filter.conceptName
  185. };
  186. return param;
  187. },
  188. indexMethod(index) {
  189. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  190. },
  191. getTagType(val) {
  192. return val
  193. },
  194. warning(msg,type){
  195. this.$message({
  196. showClose: true,
  197. message:msg,
  198. type:type||'warning'
  199. })
  200. },
  201. showConfirmDialog(msg,resolve){
  202. this.$alert(msg, '提示', {
  203. confirmButtonText: '确定',
  204. type: 'warning'
  205. }).then(() => {
  206. resolve();
  207. }).catch(() => {});
  208. },
  209. showDelDialog(row){
  210. const param = {
  211. "conceptId": row.conceptId,
  212. "isDeleted": row.isDeleted=== 'N'?'Y':'N',
  213. "relationId": 18
  214. };
  215. const txt = row.isDeleted=== 'N'?'是否删除该关联?':'是否重新启用该关联?';
  216. this.showConfirmDialog(txt,()=>{
  217. api.assistCheckRemoveRelationPacs(param).then((res)=>{
  218. if(res.data.code=='0'){
  219. if(!this.searched){
  220. //未点确认时清空搜索条件
  221. this.filter={
  222. conceptName:'',
  223. };
  224. }
  225. if(row.isDeleted !== 'N'){ //恢复成功后跳转到筛选条件的首页
  226. this.currentPage = 1;
  227. }
  228. this.getDataList();
  229. this.warning(res.data.msg || '操作成功','success');
  230. }else{
  231. this.warning(res.data.msg);
  232. }
  233. }).catch((error)=>{
  234. this.warning(error);
  235. })
  236. });
  237. }
  238. }
  239. }
  240. </script>
  241. <style lang="less">
  242. @import "../../less/admin.less";
  243. .delete{
  244. color: red;
  245. }
  246. .delete:hover {
  247. color: red;
  248. }
  249. .review{
  250. color: #22ccc8;
  251. }
  252. .pagination {
  253. min-width: 1010px;
  254. }
  255. </style>