QuestionWords.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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.disName" placeholder="诊断名称" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item label="问题词:">
  9. <el-input size="mini" v-model="filter.questionName" placeholder="问题词" clearable></el-input>
  10. </el-form-item>
  11. <el-form-item label="类型:">
  12. <el-select size="mini" v-model="filter.type" @change="getValue" placeholder="类型" clearable>
  13. <el-option v-for="item in tagTypes" :label="item.name" :value="item.key" :key="item.id" ></el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item>
  17. <el-button size="mini" @click="filterDatas">确认</el-button>
  18. <el-button size="mini" type="warning" @click="addTagGroup">导出</el-button>
  19. </el-form-item>
  20. </el-form>
  21. </crumbs>
  22. <div class="contents">
  23. <el-table
  24. :data="list"
  25. border
  26. style="width: 100%">
  27. <el-table-column
  28. :resizable = "false"
  29. type="index"
  30. :index = 'indexMethod'
  31. label="编号"
  32. width="60">
  33. </el-table-column>
  34. <el-table-column
  35. :resizable = "false"
  36. prop="gmtModified"
  37. label="操作时间"
  38. width="180">
  39. </el-table-column>
  40. <el-table-column
  41. :resizable = "false"
  42. prop="disName"
  43. label="诊断名称">
  44. </el-table-column>
  45. <el-table-column
  46. :resizable = "false"
  47. prop="questionName"
  48. label="问题词">
  49. </el-table-column>
  50. <el-table-column
  51. :resizable = "false"
  52. prop="typeNm"
  53. label="类型">
  54. </el-table-column>
  55. <el-table-column
  56. :resizable = "false"
  57. prop="typeCn"
  58. label="问题词归属">
  59. </el-table-column>
  60. <el-table-column
  61. :resizable = "false"
  62. prop="modifier"
  63. label="操作人">
  64. </el-table-column>
  65. </el-table>
  66. <div class="pagination">
  67. <el-pagination v-if="total>pageSize"
  68. :current-page.sync="currentPage"
  69. @current-change="currentChange"
  70. background
  71. :page-size="pageSize"
  72. layout="total,prev, pager, next, jumper"
  73. :total="total">
  74. </el-pagination>
  75. </div>
  76. </div>
  77. </div>
  78. </template>
  79. <script>
  80. import api from '@api/diagBase.js';
  81. import apis from '@api/icss.js';
  82. import utils from '@api/utils.js';
  83. export default {
  84. name: 'QuestionWords',
  85. data: function() {
  86. return {
  87. list: [],
  88. tagTypes: [],
  89. Adscriptions: [], //标签归属列表
  90. tagTypesList: [], //标签类型列表
  91. searched: false,
  92. filter: {
  93. disName: '', //诊断名称
  94. questionCode: "",//问题词
  95. questionName: "",//问题词
  96. questionType: "",//问题词归属
  97. type:""
  98. },
  99. currentPage: 1,
  100. pageSize: 10,
  101. total: 0,
  102. }
  103. },
  104. created() {
  105. this.getDropList().then(() => {
  106. this.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. getValue(val) {
  125. // console.log('changeVal', val, this.filter.tagAdscription)
  126. },
  127. getDropList() {
  128. return apis.getKnowledgeEnums().then((res) =>{
  129. if(res.data.code === '0') {
  130. // this.Adscriptions = res.data.data[1];
  131. let tmpLis = res.data.data.diagnoseFieldEnum
  132. // this.Adscriptions = tmpLis.filter(item => item.val);
  133. this.Adscriptions = tmpLis;
  134. this.tagTypes = res.data.data.diagnoseFeatureTypeEnum;
  135. // for (var i = 0; i < this.tagTypes.length; i++) {
  136. // this.tagTypesList.push(this.tagTypes[i].val)
  137. // }
  138. }
  139. })
  140. },
  141. getDataList() {
  142. const param = this.getFilterItems();
  143. this.searched = true;
  144. api.queryQuestionPage(param).then((res) => {
  145. const list = res.data.data.records
  146. for (var i = 0; i < list.length; i++) {
  147. for (var z = 0; z < this.Adscriptions.length; z++) {
  148. if(list[i].questionType == this.Adscriptions[z].key) {
  149. list[i].typeCn = this.Adscriptions[z].name
  150. }
  151. }
  152. for (var m = 0; m < this.tagTypes.length; m++) {
  153. if(list[i].type == this.tagTypes[m].key) {
  154. list[i].typeNm = this.tagTypes[m].name
  155. }
  156. }
  157. }
  158. this.list = list;
  159. this.total = res.data.data.total;
  160. })
  161. },
  162. filterDatas() {
  163. this.currentPage = 1;
  164. this.getDataList();
  165. },
  166. addTagGroup() {
  167. const data = {
  168. disName: this.filter.disName,
  169. question: this.filter.questionName,
  170. type: this.filter.type
  171. };
  172. api.exportDiagnosticBasis(data).then((res) => {
  173. utils.downloadExportedData(res.data,'问题词.xls')
  174. })
  175. },
  176. currentChange(next) {
  177. this.currentPage = next;
  178. this.getDataList();
  179. },
  180. getFilterItems() {
  181. const param = {
  182. current: this.currentPage,
  183. size: this.pageSize,
  184. disName: this.filter.disName,
  185. questionCode: this.filter.questionName,
  186. type: this.filter.type
  187. };
  188. return param;
  189. },
  190. indexMethod(index) {
  191. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  192. },
  193. getTagType(val) {
  194. return val
  195. },
  196. warning(msg,type){
  197. this.$message({
  198. showClose: true,
  199. message:msg,
  200. type:type||'warning'
  201. })
  202. },
  203. }
  204. }
  205. </script>
  206. <style lang="less">
  207. @import "../../less/admin.less";
  208. .delete{
  209. color: red;
  210. }
  211. .delete:hover {
  212. color: red;
  213. }
  214. .pagination {
  215. min-width: 1010px;
  216. }
  217. </style>