AssaySon.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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/icss.js';
  84. export default {
  85. name: 'AssaySon', //慢病指标值关联维护
  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() {
  121. const param = this.getFilterItems();
  122. this.searched = true;
  123. api.getAssaySon(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:'AddAssaySon', params: pam})
  140. },
  141. modifyRelation(row) {
  142. const param = {
  143. conceptId: row.conceptId,
  144. relationId:18
  145. }
  146. api.getAssaySonDetail(param).then((res) => {
  147. if(res.data.code == '0') {
  148. const pam = this.searched ? {
  149. currentPage: this.currentPage,
  150. filter: this.filter
  151. } : {currentPage: this.currentPage};
  152. // const item = Object.assign({},row,{data: res.data.data});
  153. const item = res.data.data;
  154. this.$router.push({name:'AddAssaySon',params:Object.assign(pam, {isEdit:true,data:item})});
  155. }
  156. })
  157. },
  158. currentChange(next) {
  159. this.currentPage = next;
  160. this.getDataList();
  161. },
  162. getFilterItems() {
  163. const param = {
  164. current: this.currentPage,
  165. size: this.pageSize,
  166. name:this.filter.conceptName
  167. };
  168. return param;
  169. },
  170. indexMethod(index) {
  171. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  172. },
  173. getTagType(val) {
  174. return val
  175. },
  176. warning(msg,type){
  177. this.$message({
  178. showClose: true,
  179. message:msg,
  180. type:type||'warning'
  181. })
  182. },
  183. showConfirmDialog(msg,resolve){
  184. this.$alert(msg, '提示', {
  185. confirmButtonText: '确定',
  186. type: 'warning'
  187. }).then(() => {
  188. resolve();
  189. }).catch(() => {});
  190. },
  191. showDelDialog(row){
  192. const param = {
  193. "conceptId": row.conceptId,
  194. "isDeleted": row.isDeleted=== 'N'?'Y':'N',
  195. "relationId": 18
  196. }
  197. this.showConfirmDialog('是否删除该关联?',()=>{
  198. api.delAssaySon(param).then((res)=>{
  199. if(res.data.code=='0'){
  200. this.getDataList();
  201. this.warning(res.data.msg || '操作成功','success');
  202. }else{
  203. this.warning(res.data.msg);
  204. }
  205. }).catch((error)=>{
  206. this.warning(error);
  207. })
  208. });
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="less">
  214. @import "../../less/admin.less";
  215. .delete{
  216. color: red;
  217. }
  218. .delete:hover {
  219. color: red;
  220. }
  221. .review{
  222. color: #22ccc8;
  223. }
  224. .pagination {
  225. min-width: 1010px;
  226. }
  227. </style>