AssistCheckSon.vue 8.1 KB

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