Bill.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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.conditionName" placeholder="请输入" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item label="开单项目:">
  9. <el-input size="mini" v-model="filter.conceptName" placeholder="请输入" clearable></el-input>
  10. </el-form-item>
  11. <el-form-item label="状态:" class="selectMedicine">
  12. <el-select size="mini" v-model="filter.relationStatus" placeholder="请选择" clearable>
  13. <el-option v-for="item in stateList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item class="dododo">
  17. <el-button size="mini" @click="filterDatas">检索</el-button>
  18. <el-button size="mini" type="warning" @click="addRelation">添加规则</el-button>
  19. </el-form-item>
  20. </el-form>
  21. </crumbs>
  22. <div class="contents">
  23. <el-table :data="list" border style="width: 100%">
  24. <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
  25. <el-table-column :resizable="false" prop="ruleName" label="规则名称" width="180"></el-table-column>
  26. <el-table-column :resizable="false" prop="conditionName" label="条件明细" show-overflow-tooltip></el-table-column>
  27. <el-table-column :resizable="false" prop="conceptName" label="开单项目" show-overflow-tooltip></el-table-column>
  28. <el-table-column :resizable="false" prop="relationName" label="开单类型" show-overflow-tooltip></el-table-column>
  29. <el-table-column :resizable="false" prop="ruleType" label="规则类型" show-overflow-tooltip>
  30. <template slot-scope="scope">
  31. <span>{{scope.row.ruleType === 1 ? '文本类型' : ''}}</span>
  32. <span>{{scope.row.ruleType === 2 ? '数值类型' : ''}}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column :resizable="false" prop="relationStatus" label="状态" show-overflow-tooltip>
  36. <template slot-scope="scope">
  37. <span>{{scope.row.relationStatus === 1 ? '启用' : '禁用'}}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column :resizable="false" prop="operate" label="操作">
  41. <template slot-scope="scope">
  42. <el-button
  43. v-if="scope.row.relationStatus===0"
  44. type="text"
  45. size="small"
  46. class="is-disabled"
  47. >修改</el-button>
  48. <el-button
  49. v-if="scope.row.relationStatus==1"
  50. type="text"
  51. size="small"
  52. @click="toEditProduct(scope.row)"
  53. >修改</el-button>
  54. <span style="margin:0 3px;">|</span>
  55. <el-button
  56. v-if="scope.row.relationStatus===0"
  57. type="text"
  58. size="small"
  59. @click="showReuseDialog(scope.row,'Reuse')"
  60. >启用</el-button>
  61. <el-button
  62. v-if="scope.row.relationStatus===1"
  63. type="text"
  64. size="small"
  65. class="delete"
  66. @click="showReuseDialog(scope.row,'Del')"
  67. >禁用</el-button>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <div class="pagination pagepage">
  72. <el-pagination
  73. :current-page.sync="currentPage"
  74. @current-change="currentChange"
  75. background
  76. :page-size="pageSize"
  77. :page-sizes="pageSizeArr"
  78. @size-change="handleSizeChange"
  79. :layout="pageLayout"
  80. :total="total"
  81. ></el-pagination>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import api from '@api/icss.js';
  88. import config from '@api/config.js';
  89. import utils from '@api/utils.js';
  90. export default {
  91. name: 'Bill',
  92. data() {
  93. return {
  94. list: [],
  95. searched: false,
  96. filter: {
  97. conditionName: '', //条件明细
  98. conceptName: '', //开单项目
  99. relationStatus: ''
  100. },
  101. stateList: [
  102. {
  103. id: "1",
  104. name: '启用'
  105. },
  106. {
  107. id: "0",
  108. name: '禁用'
  109. }
  110. ],
  111. currentPage: 1,
  112. pageSize: config.pageSize,
  113. pageSizeArr: config.pageSizeArr,
  114. pageLayout: config.pageLayout,
  115. total: 0
  116. };
  117. },
  118. created() {
  119. const that = this;
  120. //返回时避免参数未赋值就获取列表
  121. setTimeout(function() {
  122. that.clearFilter();
  123. that.getDataList();
  124. });
  125. // 非首页 编辑页返回 设置 this.currentPage
  126. if (Object.keys(this.$route.params).length !== 0) {
  127. this.currentPage = this.$route.params.currentPage;
  128. }
  129. },
  130. methods: {
  131. toEditProduct(row) {
  132. let ruleData = {};
  133. api.getRecordByRelationId({ relationId: row.relationId }).then(res => {
  134. // console.log(res, '============res');
  135. if (res.data.code === '0') {
  136. ruleData = res.data.data;
  137. const pam = this.searched
  138. ? {
  139. currentPage: this.currentPage,
  140. pageSize: this.pageSize,
  141. filter: this.filter
  142. }
  143. : { currentPage: this.currentPage, pageSize: this.pageSize };
  144. this.$router.push({
  145. name: 'AddBill',
  146. params: Object.assign(pam, { data: ruleData, isEdit: true })
  147. });
  148. }
  149. });
  150. },
  151. showReuseDialog(row, type) {
  152. let showInfo = type !== 'Del' ? '启用' : '禁用';
  153. let status = type === 'Del' ? 0 : 1;
  154. this.showConfirmDialog(
  155. `确定要${showInfo}该规则吗?`,
  156. () => {
  157. api
  158. .updateBillmanStatus({ relationId: row.relationId, status })
  159. .then(res => {
  160. if (res.data.code == '0') {
  161. this.currentPage = 1; //恢复数据跳转到筛选条件下首页
  162. console.log(this.currentPage);
  163. this.warning(res.data.msg || '操作成功', 'success');
  164. this.getDataList();
  165. } else {
  166. this.warning(res.data.msg);
  167. }
  168. })
  169. .catch(error => {
  170. if (error.code === '900010001') {
  171. return false;
  172. }
  173. this.warning(error);
  174. });
  175. },
  176. type
  177. );
  178. },
  179. showConfirmDialog(msg, resolve, type) {
  180. let showInfo = '启用';
  181. let btnNameClass = 'confirmBtn1';
  182. if (type === 'Del') {
  183. showInfo = '禁用';
  184. btnNameClass = 'delBtn';
  185. }
  186. this.$confirm(msg, '提示', {
  187. confirmButtonText: showInfo,
  188. cancelButtonText: '取消',
  189. cancelButtonClass: 'cancelBtn',
  190. confirmButtonClass: btnNameClass,
  191. type: 'warning'
  192. })
  193. .then(() => {
  194. resolve();
  195. })
  196. .catch(() => {});
  197. },
  198. // 获取列表数据
  199. getDataList(isTurnPage) {
  200. const params = this.getFilterItems(isTurnPage);
  201. this.searched = true;
  202. const loading = this.$loading({
  203. lock: true,
  204. text: 'Loading',
  205. spinner: 'el-icon-loading',
  206. background: 'rgba(0, 0, 0, 0.7)'
  207. });
  208. api.getBillmanPage(params).then(res => {
  209. loading.close();
  210. if (res.data.code === '0') {
  211. this.list = res.data.data && res.data.data.content;
  212. }
  213. this.total = res.data.data && res.data.data.totalElements;
  214. if (this.inCurrentPage !== undefined) {
  215. this.currentPage = this.inCurrentPage;
  216. this.inCurrentPage = undefined;
  217. }
  218. });
  219. },
  220. // 处理列表请求数据参数
  221. getFilterItems(isTurnPage) {
  222. //翻页时筛选条件没点确定则清空
  223. if (isTurnPage && !this.searched) {
  224. this.clearFilter();
  225. }
  226. const param = {
  227. number: this.inCurrentPage - 1 || this.currentPage - 1,
  228. size: this.pageSize,
  229. conditionName: this.filter.conditionName.trim(),
  230. conceptName: this.filter.conceptName.trim(),
  231. relationStatus: this.filter.relationStatus
  232. // uniqueCode: ''
  233. };
  234. return param;
  235. },
  236. // 清空搜索参数
  237. clearFilter() {
  238. this.filter = {
  239. conditionName: '',
  240. conceptName: '',
  241. relationStatus: ''
  242. };
  243. },
  244. handleSizeChange(val) {
  245. this.pageSize = val;
  246. this.currentPage = utils.getCurrentPage(
  247. this.currentPage,
  248. this.total,
  249. this.pageSize
  250. );
  251. this.getDataList();
  252. },
  253. filterDatas() {
  254. this.currentPage = 1;
  255. this.getDataList();
  256. },
  257. addRelation() {
  258. const pam = this.searched
  259. ? {
  260. currentPage: this.currentPage,
  261. pageSize: this.pageSize,
  262. filter: this.filter
  263. }
  264. : { currentPage: this.currentPage, pageSize: this.pageSize };
  265. this.$router.push({ name: 'AddBill', params: pam });
  266. },
  267. // 修改诊断关联-跳转至编辑页面
  268. modifyRelation(row) {
  269. const item = Object.assign({}, row);
  270. const pam = this.searched
  271. ? {
  272. currentPage: this.currentPage,
  273. pageSize: this.pageSize,
  274. filter: this.filter
  275. }
  276. : { currentPage: this.currentPage, pageSize: this.pageSize };
  277. this.$router.push({
  278. name: 'AddDept',
  279. params: Object.assign(pam, { isEdit: true, data: item })
  280. });
  281. },
  282. currentChange(next) {
  283. this.currentPage = next;
  284. this.getDataList(true);
  285. // if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  286. // this.list = this.cacheData[next];
  287. // } else {
  288. // this.getDataList();
  289. // }
  290. },
  291. indexMethod(index) {
  292. return (this.currentPage - 1) * this.pageSize + index + 1;
  293. },
  294. getTagType(val) {
  295. return val;
  296. },
  297. warning(msg, type) {
  298. this.$message({
  299. showClose: true,
  300. message: msg,
  301. type: type || 'warning'
  302. });
  303. }
  304. }
  305. };
  306. </script>
  307. <style lang="less">
  308. @import '../../../less/admin.less';
  309. .delete {
  310. color: red;
  311. }
  312. .delete:hover {
  313. color: red;
  314. }
  315. .pagination {
  316. min-width: 1010px;
  317. }
  318. .downTemplate {
  319. margin-right: 8px;
  320. span {
  321. color: #02a7f0;
  322. }
  323. }
  324. #upFile {
  325. display: none !important;
  326. }
  327. .el-message-box {
  328. /deep/.cancelBtn {
  329. background-color: #d7d7d7;
  330. border-color: transparent;
  331. }
  332. /deep/.confirmC {
  333. background-color: #ff545b !important;
  334. border-color: transparent !important;
  335. }
  336. /deep/.el-message-box__header {
  337. border-bottom: 1px solid #dcdfe6;
  338. }
  339. }
  340. .exportBox6 {
  341. /deep/ .el-message-box__btns {
  342. margin-top: 20px;
  343. }
  344. /deep/ .el-message-box__message {
  345. // text-align: center;
  346. }
  347. /deep/.leftbtn {
  348. background-color: #d7d7d7;
  349. border-color: transparent !important;
  350. }
  351. /deep/ .el-message-box__header {
  352. border-bottom: 1px solid #dcdfe6;
  353. }
  354. }
  355. .exportConfirm {
  356. .cancelSure {
  357. display: none;
  358. }
  359. }
  360. </style>