AssistCheckSon.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. import utils from '@api/utils.js';
  87. export default {
  88. name: 'AssistCheckSon', //慢病指标值关联维护
  89. data: function() {
  90. return {
  91. list: [],
  92. searched: false,
  93. filter:{
  94. conceptName:'',
  95. },
  96. currentPage: 1,
  97. pageSize: config.pageSize,
  98. pageSizeArr:config.pageSizeArr,
  99. pageLayout:config.pageLayout,
  100. total: 0,
  101. }
  102. },
  103. created() {
  104. const that = this;
  105. //返回时避免参数未赋值就获取列表
  106. setTimeout(function(){
  107. that.getDataList();
  108. });
  109. },
  110. watch: {
  111. 'filter': {
  112. handler: function () {
  113. this.searched = false;
  114. },
  115. deep: true
  116. }
  117. },
  118. beforeRouteEnter(to, from, next) {
  119. next(vm => {
  120. //const pm = to.param;
  121. Object.assign(vm, to.params);
  122. vm.inCurrentPage=to.params.currentPage;
  123. })
  124. },
  125. methods: {
  126. handleSizeChange(val){
  127. this.pageSize = val;
  128. this.currentPage = utils.getCurrentPage(this.currentChange, this.total, this.pageSize);
  129. this.getDataList();
  130. },
  131. getDataList(isTurnPage) {
  132. const param = this.getFilterItems(isTurnPage);
  133. this.searched = true;
  134. const loading = this.$loading({
  135. lock: true,
  136. text: 'Loading',
  137. spinner: 'el-icon-loading',
  138. background: 'rgba(0, 0, 0, 0.7)'
  139. });
  140. api.assistCheckPacsSonContactList(param).then((res) => {
  141. loading.close()
  142. if(res.data.code == '0') {
  143. this.list = res.data.data.records;
  144. this.total = res.data.data.total;
  145. if(this.inCurrentPage!==undefined){
  146. this.currentPage=this.inCurrentPage;
  147. this.inCurrentPage = undefined;
  148. }
  149. }
  150. })
  151. },
  152. filterDatas() {
  153. this.currentPage = 1;
  154. this.getDataList();
  155. },
  156. addRelation() {
  157. const pam = this.searched ? {
  158. currentPage: this.currentPage,
  159. pageSize:this.pageSize,
  160. filter: this.filter
  161. } : {currentPage: this.currentPage,
  162. pageSize:this.pageSize};
  163. this.$router.push({name:'AddAssistCheckSon', params: pam})
  164. },
  165. modifyRelation(row) {
  166. const param = {
  167. conceptId: row.conceptId,
  168. // relationId:18
  169. relationIds:[18], //9-23后台修改
  170. typeIds:[16]
  171. }
  172. api.assistCheckGetPacsContactDetail(param).then((res) => {
  173. if(res.data.code == '0') {
  174. const pam = this.searched ? {
  175. currentPage: this.currentPage,
  176. pageSize:this.pageSize,
  177. filter: this.filter
  178. } : {currentPage: this.currentPage,
  179. pageSize:this.pageSize};
  180. // const item = Object.assign({},row,{data: res.data.data});
  181. const item = res.data.data;
  182. this.$router.push({name:'AddAssistCheckSon',params:Object.assign(pam, {isEdit:true,data:item})});
  183. }
  184. })
  185. },
  186. currentChange(next) {
  187. this.currentPage = next;
  188. this.getDataList(true);
  189. },
  190. getFilterItems(isTurnPage) {
  191. //翻页时筛选条件没点确定则清空
  192. if(isTurnPage&&!this.searched){
  193. this.filter.conceptName='';
  194. };
  195. const param = {
  196. current: this.inCurrentPage||this.currentPage,
  197. size: this.pageSize,
  198. name:this.filter.conceptName
  199. };
  200. return param;
  201. },
  202. indexMethod(index) {
  203. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  204. },
  205. getTagType(val) {
  206. return val
  207. },
  208. warning(msg,type){
  209. this.$message({
  210. showClose: true,
  211. message:msg,
  212. type:type||'warning'
  213. })
  214. },
  215. showConfirmDialog(msg,resolve){
  216. this.$alert(msg, '提示', {
  217. confirmButtonText: '确定',
  218. type: 'warning'
  219. }).then(() => {
  220. resolve();
  221. }).catch(() => {});
  222. },
  223. showDelDialog(row){
  224. const param = {
  225. "conceptId": row.conceptId,
  226. "isDeleted": row.isDeleted=== 'N'?'Y':'N',
  227. "relationId": 18
  228. };
  229. const txt = row.isDeleted=== 'N'?'是否删除该关联?':'是否重新启用该关联?';
  230. this.showConfirmDialog(txt,()=>{
  231. api.assistCheckRemoveRelationPacs(param).then((res)=>{
  232. if(res.data.code=='0'){
  233. if(!this.searched){
  234. //未点确认时清空搜索条件
  235. this.filter={
  236. conceptName:'',
  237. };
  238. }
  239. if(row.isDeleted !== 'N'){ //恢复成功后跳转到筛选条件的首页
  240. this.currentPage = 1;
  241. }
  242. this.getDataList();
  243. this.warning(res.data.msg || '操作成功','success');
  244. }else{
  245. this.warning(res.data.msg);
  246. }
  247. }).catch((error)=>{
  248. this.warning(error);
  249. })
  250. });
  251. }
  252. }
  253. }
  254. </script>
  255. <style lang="less">
  256. @import "../../less/admin.less";
  257. .delete{
  258. color: red;
  259. }
  260. .delete:hover {
  261. color: red;
  262. }
  263. .review{
  264. color: #22ccc8;
  265. }
  266. .pagination {
  267. min-width: 1010px;
  268. }
  269. </style>