RuleCheck.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <template>
  2. <div>
  3. <crumbs title="规则维护" :minWidth="titleWidth" class="knowledgeTitle">
  4. <el-form :inline="true" class="demo-form-inline">
  5. <el-form-item label="规则名称:">
  6. <el-input size="mini" v-model="filter.description" placeholder="请输入" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item label="规则类型:">
  9. <el-select v-model="filter.ruleType" clearable placeholder="请选择" size="mini">
  10. <el-option v-for="item in ruleTypeList" :key="item.val" :label="item.name" :value="item.val">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="规则术语类型:">
  15. <el-select v-model="filter.libType" clearable placeholder="请选择" size="mini">
  16. <el-option v-for="item in ruleTermTypeList" :key="item.val" :label="item.name"
  17. :value="item.val">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="医学标准术语:">
  22. <el-input size="mini" v-model="filter.libName" placeholder="请输入" clearable></el-input>
  23. </el-form-item>
  24. </el-form>
  25. <el-form class="secLine" :inline="true">
  26. <el-form-item label="基础规则术语类型:">
  27. <el-select v-model="filter.baseLibType" clearable placeholder="请选择" size="mini">
  28. <el-option v-for="item in baseTermTypeList" :key="item.val" :label="item.name" :value="item.val">
  29. </el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="基础医学标准术语:">
  33. <el-input size="mini" v-model="filter.baseLibName" placeholder="请输入" clearable></el-input>
  34. </el-form-item>
  35. <el-form-item>
  36. <el-button size="mini" @click="filterDatas">确认</el-button>
  37. </el-form-item>
  38. </el-form>
  39. </crumbs>
  40. <div class="contents knowledgeContents">
  41. <el-table :data="list" border style="width: 100%">
  42. <el-table-column type="index" :index="indexMethod" label="编号" width="120"></el-table-column>
  43. <el-table-column prop="ruleTypeName" label="规则类型" width="240">
  44. </el-table-column>
  45. <el-table-column prop="libTypeName" label="规则术语类型"></el-table-column>
  46. <el-table-column prop="libName" label="医学标准术语">
  47. </el-table-column>
  48. <el-table-column label="操作" width="120" fixed="right">
  49. <template slot-scope="scope">
  50. <el-button type="text" size="small" @click="checkData(scope.row)">查看</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <el-pagination :current-page.sync="currentPage" @current-change="currentChange" background
  55. :page-size="pageSize" :page-sizes="pageSizeArr" @size-change="handleSizeChange" :layout="pageLayout"
  56. :total="total"></el-pagination>
  57. </div>
  58. <el-dialog title="查看" :visible.sync="dialogVisible" :before-close="closecheckDialog" width="80rem"
  59. v-if="dialogVisible" :close-on-click-modal="false" :fullscreen="true">
  60. <CheckRule :rulelist="rulelist" :baseTypeList="baseTypeList" :baseTermTypeList="baseTermTypeList"
  61. :row="row" :description="filter.description" :baseLibType="filter.baseLibType" :baseLibName="filter.baseLibName">
  62. </CheckRule>
  63. <div style="text-align: center;">
  64. <el-button @click="closecheckDialog" style="width: 180px;">关闭</el-button>
  65. </div>
  66. </el-dialog>
  67. </div>
  68. </template>
  69. <script>
  70. import api from '@api/knowledgeLib.js';
  71. import config from '@api/config.js';
  72. import utils from '@api/utils.js';
  73. import CheckRule from "./DiagCheckRule.vue";
  74. export default {
  75. name: 'ZskRuleCheck',
  76. data: function() {
  77. return {
  78. list: [],
  79. searched: false,
  80. filter: {
  81. // parStatus: '',
  82. // parDescription: '',
  83. // parConceptName: '',
  84. // parRuleType: '',
  85. description: '', //规则名称
  86. ruleType: '', //规则类型
  87. libType: '', //规则术语类型
  88. libName: '', //医学标准术语
  89. baseLibType: '', //基础规则术语类型
  90. baseLibName: '', //基础医学标准术语
  91. },
  92. ruleTypeList: [], //规则类型列表 1
  93. ruleTermTypeList: [], //规则术语类型列表 2
  94. conceptList: [], //医学标准术语列表 3
  95. baseTypeList: [], //基础规则类型列表 4
  96. baseTermTypeList: [], //基础规则术语类型列表 5
  97. rulelist: [], //查看
  98. cacheData: {},
  99. currentPage: 1,
  100. pageSize: config.pageSize,
  101. pageSizeArr: config.pageSizeArr,
  102. pageLayout: config.pageLayout,
  103. total: 0,
  104. titleWidth: '970px', //头部最小宽度
  105. dialogVisible: false,
  106. row:{},
  107. };
  108. },
  109. components: {
  110. CheckRule
  111. },
  112. created() {
  113. // const param = this.$route.params;
  114. // console.log(param)
  115. // if (param.currentPage) {
  116. // this.inCurrentPage = param.currentPage;
  117. // }
  118. // if (param.filter) {
  119. // this.filter = param.filter;
  120. // }
  121. const that = this;
  122. //返回时避免参数未赋值就获取列表
  123. setTimeout(function() {
  124. that.getDataList();
  125. });
  126. this.getDict();
  127. },
  128. watch: {
  129. filter: {
  130. handler: function() {
  131. this.searched = false;
  132. },
  133. deep: true
  134. }
  135. },
  136. // beforeRouteEnter(to, from, next) {
  137. // next(vm => {
  138. // //const pm = to.param;
  139. // Object.assign(vm, to.params);
  140. // vm.inCurrentPage=to.params.currentPage;
  141. // })
  142. // },
  143. methods: {
  144. getDict() {
  145. api.zskgetDict().then(res => {
  146. if (res.data.code == '0') {
  147. const data = res.data.data;
  148. this.ruleTypeList = data[-101]
  149. this.ruleTermTypeList = data[-102]
  150. this.baseTypeList = data[-103]
  151. this.baseTermTypeList = data[-104]
  152. // const arr = data['20'].map(it => it.val);
  153. // //this.dict = arr.join(",");
  154. // //this.msgDict=(data['21'].map((it)=>it.val)||[]).join(",");
  155. // localStorage.setItem('zskDicts', arr.join(','));
  156. // localStorage.setItem(
  157. // 'zskMsgDict',
  158. // (data['21'].map(it => it.val) || []).join(',')
  159. // );
  160. // localStorage.setItem('zskNumDict', data['22'][0].val);
  161. // localStorage.setItem('zskSubDict', (data['23'].map(it => it.val) || []).join(','));
  162. // localStorage.setItem('zskDragDict', (data['27'].map(it => it.val) || []).join(','));
  163. // localStorage.setItem('zskDelDict', data['26'][0].val);
  164. }
  165. })
  166. .catch(error => {
  167. console.log(error);
  168. });
  169. },
  170. statusTrans(type) {
  171. const obj = this.ruleTypeList.find(it => it.type === type);
  172. return obj && obj.name;
  173. },
  174. handleSizeChange(val) {
  175. this.pageSize = val;
  176. this.currentPage = utils.getCurrentPage(
  177. this.currentPage,
  178. this.total,
  179. this.pageSize
  180. );
  181. this.getDataList();
  182. },
  183. filterDatas() {
  184. this.currentPage = 1;
  185. this.getDataList(1);
  186. },
  187. getDataList(flag, isTurnPage) {
  188. const params = this.getFilterItems(isTurnPage);
  189. this.searched = true;
  190. const loading = this.$loading({
  191. lock: true,
  192. text: 'Loading',
  193. spinner: 'el-icon-loading',
  194. background: 'rgba(0, 0, 0, 0.7)'
  195. });
  196. api.zskgetRulePage(params).then(res => {
  197. loading.close();
  198. if (res.data.code == '0') {
  199. const data = res.data.data;
  200. this.list = data.records;
  201. if (!flag) {
  202. //搜索时不缓存
  203. this.cacheData[params.current] = data.records;
  204. } else {
  205. this.cacheData = {};
  206. }
  207. this.total = data.total;
  208. if (this.inCurrentPage !== undefined) {
  209. this.currentPage = this.inCurrentPage;
  210. this.inCurrentPage = undefined;
  211. }
  212. } else {
  213. this.warning(res.data.msg || '获取列表数据失败');
  214. }
  215. })
  216. .catch(error => {
  217. loading.close();
  218. console.log(error);
  219. });
  220. },
  221. getFilterItems(isTurnPage) {
  222. //翻页时筛选条件没点确定则清空
  223. if (isTurnPage && !this.searched) {
  224. this.clearFilter();
  225. }
  226. const param = {
  227. current: this.inCurrentPage || this.currentPage,
  228. size: this.pageSize,
  229. libName: this.filter.libName.trim(),
  230. libType: this.filter.libType,
  231. ruleType: this.filter.ruleType,
  232. baseLibName: this.filter.baseLibName.trim(),
  233. baseLibType: this.filter.baseLibType,
  234. description: this.filter.description.trim(),
  235. };
  236. return param;
  237. },
  238. indexMethod(index) {
  239. return (this.currentPage - 1) * this.pageSize + index + 1;
  240. },
  241. currentChange(next) {
  242. this.currentPage = next;
  243. /*if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  244. this.list = this.cacheData[next];
  245. } else {*/
  246. this.getDataList(1, true);
  247. //}
  248. },
  249. warning(msg, type) {
  250. this.$message({
  251. showClose: true,
  252. message: msg,
  253. type: type || 'warning'
  254. });
  255. },
  256. checkData(row) {
  257. console.log(row)
  258. this.row=row
  259. if(!this.searched) {
  260. this.clearFilter();
  261. }
  262. const param = {
  263. baseLibName: this.filter.baseLibName,
  264. baseLibType: this.filter.baseLibType,
  265. description: this.filter.description,
  266. libName: row.libName,
  267. libType: row.libType,
  268. ruleType: row.ruleType,
  269. }
  270. api.zskgetRuleDetail(param).then((res) => {
  271. if (res.data.code == "0") {
  272. // this.rulelist = res.data.data
  273. console.log(res.data.data.ruleConditionDTOList)
  274. let datalist =[]
  275. const data=res.data.data.ruleConditionDTOList
  276. for(let i in data){
  277. for(let j of data[i].ruleBaseDTOList){
  278. let a = parseInt(i)
  279. datalist.push({
  280. id:a+1,
  281. msg:data[i].msg,
  282. description:data[i].description,
  283. ...j
  284. })
  285. }
  286. }
  287. this.rulelist=datalist
  288. console.log(datalist)
  289. this.dialogVisible = true
  290. }
  291. })
  292. .catch((error) => {
  293. console.log(error);
  294. });
  295. },
  296. closecheckDialog() {
  297. this.dialogVisible = false
  298. },
  299. clearFilter() {
  300. this.filter = {
  301. description: '',
  302. ruleType: '',
  303. libType: '',
  304. libName: '',
  305. baseLibType: '',
  306. baseLibName: '',
  307. };
  308. },
  309. }
  310. };
  311. </script>
  312. <style lang="less" scoped>
  313. @import '../../less/admin.less';
  314. /deep/ .container.knowledgeTitle {
  315. height: 80px;
  316. }
  317. /deep/ .contents.knowledgeContents {
  318. padding: 104px 20px 0;
  319. }
  320. /deep/ .secLine.el-form {
  321. float: right;
  322. display: block;
  323. position: relative;
  324. top: -5px;
  325. }
  326. .delete {
  327. color: red;
  328. }
  329. .review {
  330. color: #22ccc8;
  331. }
  332. .el-table .cell {
  333. overflow: hidden;
  334. white-space: nowrap;
  335. }
  336. #upFile {
  337. display: none !important;
  338. }
  339. .unvailable {
  340. color: #fe7d3d;
  341. &:hover {
  342. color: #f19061;
  343. }
  344. }
  345. /deep/.el-dialog__body{
  346. padding-top:0px
  347. }
  348. /deep/.el-dialog__title{
  349. color: #333333;
  350. font-weight: bold;
  351. font-size: 16px;
  352. }
  353. /deep/.el-dialog__header{
  354. border-left:4px #48C5D7 solid
  355. }
  356. </style>