You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

694 lines
21 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="box">
  3. <div style="position: relative">
  4. <div class="middlebox">
  5. <div class="contenttitle">
  6. 基础资料 /
  7. <span class="contenttitleBold">第三方接口</span>
  8. </div>
  9. <!-- <div class="seachinput">
  10. <el-select
  11. v-model="department"
  12. placeholder="请搜索"
  13. filterable
  14. :filter-method="remoteMethodes"
  15. default-first-option
  16. @change="quckDepartments"
  17. clearable
  18. size="small"
  19. >
  20. <el-option
  21. v-for="item in quckDepartment"
  22. :key="item.id"
  23. :label="item.displayName"
  24. :value="item.id"
  25. >
  26. </el-option>
  27. </el-select>
  28. </div> -->
  29. </div>
  30. <div style="display: block; margin-top: 7px; margin-right: 110px">
  31. <div style="background-color: #fff; padding: 15px; border-radius: 8px">
  32. <div id="printTest">
  33. <el-table
  34. :data="tableData"
  35. row-key="id"
  36. class="el-table__body-wrapper tbody"
  37. @row-click="rowick"
  38. highlight-current-row
  39. :height="window.pageHeight < 600 ? 480 : window.pageHeight - 130"
  40. ref="tableData"
  41. tooltip-effect="light"
  42. >
  43. <el-table-column prop="id" label="编号" width="300">
  44. </el-table-column>
  45. <el-table-column prop="displayName" label="名称" width="">
  46. </el-table-column>
  47. <el-table-column
  48. prop="parmValue"
  49. label="配置参数"
  50. width=""
  51. show-overflow-tooltip
  52. >
  53. </el-table-column>
  54. <el-table-column prop="medicalCenterId" label="体检中心">
  55. <template slot-scope="scope">
  56. <div>
  57. {{
  58. getTreeName(
  59. medicalCenter,
  60. scope.row.medicalCenterId
  61. )
  62. }}
  63. </div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column
  67. prop="thirdInterfaceType"
  68. label="接口类型"
  69. width=""
  70. >
  71. <template slot-scope="scope">
  72. <div>
  73. {{
  74. scope.row.thirdInterfaceType == "01"
  75. ? "LIS申请"
  76. : "收费申请"
  77. }}
  78. </div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="isActive" label="启用" width="">
  82. <template slot-scope="scope">
  83. <el-checkbox
  84. v-model="scope.row.isActive"
  85. true-label="Y"
  86. false-label="N"
  87. disabled
  88. ></el-checkbox>
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="creatorName" label="创建者" width="">
  92. </el-table-column>
  93. <el-table-column prop="lastModifierName" label="修改者" width="">
  94. </el-table-column>
  95. <!-- <el-table-column prop="simpleCode" label="简称" width="180">
  96. </el-table-column> -->
  97. <el-table-column prop="creationTime" label="创建时间" width="200">
  98. <template slot-scope="scope">
  99. {{ scope.row.creationTime | dateFormat }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column
  103. prop="lastModificationTime"
  104. label="修改时间"
  105. width="200"
  106. >
  107. <template slot-scope="scope">
  108. {{ scope.row.lastModificationTime | dateFormat }}
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="操作" width="" align="center">
  112. <template>
  113. <el-tag
  114. class="move"
  115. style="
  116. cursor: move;
  117. background-color: rgb(245, 245, 245);
  118. border: none;
  119. "
  120. draggable="true"
  121. >
  122. <i
  123. class="el-icon-d-caret"
  124. style="
  125. width: 1rem;
  126. height: 1rem;
  127. color: rgb(113, 113, 113);
  128. "
  129. ></i>
  130. </el-tag>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. </div>
  135. </div>
  136. </div>
  137. <!-- 按钮区域 -->
  138. <div
  139. style="
  140. margin-left: 10px;
  141. margin-top: 3%;
  142. position: absolute;
  143. top: 0;
  144. right: 0;
  145. "
  146. >
  147. <el-button type="" @click="add" class="commonbutton">新增</el-button>
  148. <div style="margin-top: 10px">
  149. <el-button type="" @click="edlits" class="commonbutton"
  150. >编辑</el-button
  151. >
  152. </div>
  153. <div style="margin-top: 10px">
  154. <el-button type="" @click="deleteid" class="deleteButton"
  155. >删除</el-button
  156. >
  157. </div>
  158. <div style="margin-top: 10px">
  159. <el-button type="" @click="topping" class="commonbutton"
  160. >置顶</el-button
  161. >
  162. </div>
  163. <div style="margin-top: 10px">
  164. <el-button type="" @click="toppings" class="commonbutton"
  165. >置底</el-button
  166. >
  167. </div>
  168. <div style="margin-top: 10px">
  169. <el-button
  170. type=""
  171. :disabled="isshow"
  172. @click="assertion"
  173. class="commonbutton"
  174. >排序</el-button
  175. >
  176. </div>
  177. <div style="margin-top: 10px">
  178. <el-button
  179. type=""
  180. :disabled="isshow"
  181. @click="cancellation"
  182. class="commonbutton"
  183. >取消</el-button
  184. >
  185. </div>
  186. </div>
  187. <!-- <div class="cancelorconfirm"></div> -->
  188. <!-- 新增或者编辑弹框 -->
  189. <el-dialog
  190. :title="title == 1 ? '新增' : '修改'"
  191. :visible.sync="dialogVisible"
  192. width="90%"
  193. :close-on-click-modal="false"
  194. fullscreen
  195. >
  196. <el-form ref="form" :model="form" label-width="80px">
  197. <el-row>
  198. <el-col :span="6">
  199. <el-form-item label="编号">
  200. <el-input
  201. v-model="form.id"
  202. style="width: 100%"
  203. disabled
  204. size="small"
  205. ></el-input>
  206. </el-form-item>
  207. </el-col>
  208. <el-col :span="6">
  209. <el-form-item label="名称">
  210. <el-input
  211. ref="refinput"
  212. v-model="form.displayName"
  213. style="width: 100%"
  214. size="small"
  215. ></el-input>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="5">
  219. <el-form-item label="体检中心">
  220. <el-cascader
  221. v-model="form.medicalCenterId"
  222. :options="medicalCenter"
  223. ref="example"
  224. popper-class="example"
  225. @change="ischangs"
  226. :props="{
  227. value: 'id',
  228. label: 'displayName',
  229. children: 'treeChildren',
  230. checkStrictly: true,
  231. expandTrigger: 'hover',
  232. }"
  233. size="small"
  234. >
  235. </el-cascader>
  236. </el-form-item>
  237. </el-col>
  238. <el-col :span="4">
  239. <el-form-item label="接口类型">
  240. <el-select
  241. v-model="form.thirdInterfaceType"
  242. placeholder="请选择接口类型"
  243. size="small"
  244. >
  245. <el-option label="LIS申请" value="01" />
  246. <el-option label="收费申请" value="02" />
  247. <el-option label="检验结果导入" value="03" />
  248. </el-select>
  249. </el-form-item>
  250. </el-col>
  251. <el-col :span="2">
  252. <el-form-item label="启用">
  253. <el-checkbox
  254. v-model="form.isActive"
  255. true-label="Y"
  256. false-label="N"
  257. ></el-checkbox>
  258. </el-form-item>
  259. </el-col>
  260. </el-row>
  261. <el-row>
  262. <el-col :span="24">
  263. <el-form-item label="配置参数">
  264. <!-- <el-input
  265. v-model="form.parmValue"
  266. size="small"
  267. ></el-input> -->
  268. <el-input
  269. type="textarea"
  270. v-model="form.parmValue"
  271. :autosize="{ minRows: 23, maxRows: 23 }"
  272. ></el-input>
  273. </el-form-item>
  274. </el-col>
  275. </el-row>
  276. <el-row>
  277. <el-divider></el-divider>
  278. <el-col :span="4" style="margin-left: 15px">
  279. <el-form-item label="创建者">
  280. <el-input
  281. v-model="form.creatorName"
  282. disabled
  283. size="small"
  284. ></el-input>
  285. </el-form-item>
  286. </el-col>
  287. <el-col :span="6">
  288. <el-form-item label="创建时间">
  289. <el-input
  290. :value="form.creationTime | dateFormat"
  291. disabled
  292. size="small"
  293. ></el-input>
  294. </el-form-item>
  295. </el-col>
  296. <el-col :span="4">
  297. <el-form-item label="修改者">
  298. <el-input
  299. v-model="form.lastModifierName"
  300. disabled
  301. size="small"
  302. ></el-input>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="6">
  306. <el-form-item label="修改时间">
  307. <el-input
  308. style="width: 85%"
  309. :value="form.lastModificationTime | dateFormat"
  310. disabled
  311. size="small"
  312. ></el-input>
  313. </el-form-item>
  314. </el-col>
  315. </el-row>
  316. </el-form>
  317. <span slot="footer" class="dialog-footer">
  318. <el-button @click="dialogVisible = false" class="difference"
  319. > </el-button
  320. >
  321. <el-button type="primary" @click="addoredit" class="commonbutton"
  322. > </el-button
  323. >
  324. </span>
  325. </el-dialog>
  326. </div>
  327. </div>
  328. </template>
  329. <script>
  330. import Sortable, { get } from "sortablejs";
  331. import { mapState } from "vuex";
  332. import {
  333. examinationlist,
  334. newphysical,
  335. listsid,
  336. Modifiers,
  337. deletecol,
  338. medicaltopbottom,
  339. examinationdragging,
  340. } from "../../request/systemapi";
  341. import { getapi, postapi, putapi } from "@/api/api";
  342. export default {
  343. data() {
  344. return {
  345. isshow: true,
  346. dialogVisible: false,
  347. title: 1,
  348. form: {
  349. displayName: "",
  350. parmValue: "",
  351. thirdInterfaceType: "",
  352. medicalCenterId: "",
  353. isActive: "Y",
  354. },
  355. tableData: [],
  356. initTableData: [],
  357. curRow: {},
  358. department: "",
  359. quckDepartment: [],
  360. medicalCenter: [],
  361. };
  362. },
  363. created() {
  364. this.getmedicalCenter();
  365. this.getlist();
  366. },
  367. mounted() {
  368. this.rowDrop();
  369. },
  370. computed: {
  371. ...mapState(["window"]),
  372. },
  373. methods: {
  374. getTreeName(list, id) {
  375. for (let i = 0; i < list.length; i++) {
  376. if (list[i].id === id) {
  377. return list[i].displayName;
  378. } else if (list[i].treeChildren && list[i].treeChildren.length > 0) {
  379. let res = this.getTreeName(list[i].treeChildren, id);
  380. if (res) {
  381. return res;
  382. }
  383. }
  384. }
  385. },
  386. ischangs(v) {
  387. if (v.length > 1) {
  388. this.form.medicalCenterId = this.form.medicalCenterId.slice(-1)[0];
  389. } else {
  390. this.form.medicalCenterId = this.form.medicalCenterId[0];
  391. }
  392. this.$refs.example.toggleDropDownVisible();
  393. },
  394. //点击列表通过id查询
  395. rowick(row) {
  396. this.curRow = { ...row };
  397. // listsid(row.id).then((res) => {
  398. // if(res.code!=-1){
  399. // this.curRow = { ...res.data };
  400. // }
  401. // // this.form = res.data;
  402. // });
  403. },
  404. remoteMethodes(keyWords) {
  405. if (keyWords) {
  406. this.quckDepartment = [];
  407. this.initTableData.forEach((item) => {
  408. if (
  409. item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) >
  410. -1 ||
  411. item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1
  412. // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  413. ) {
  414. this.quckDepartment.push(item);
  415. }
  416. });
  417. } else {
  418. this.quckDepartment = [...this.initTableData];
  419. }
  420. },
  421. quckDepartments(e) {
  422. if (e) {
  423. this.tableData.forEach((item, index) => {
  424. if (e == item.id) {
  425. this.$refs["tableData"].setCurrentRow(item);
  426. this.rowick(item);
  427. this.searchup(item, index);
  428. }
  429. });
  430. } else {
  431. this.remoteMethodes();
  432. }
  433. },
  434. searchup(data, index) {
  435. // if (index > 3) {
  436. const targetTop = this.$refs["tableData"].$el
  437. .querySelectorAll(".el-table__body tr")
  438. [index - 1].getBoundingClientRect().top;
  439. const containerTop = this.$refs["tableData"].$el
  440. .querySelector(".el-table__body")
  441. .getBoundingClientRect().top;
  442. const scrollParent = this.$refs["tableData"].$el.querySelector(
  443. ".el-table__body-wrapper"
  444. );
  445. scrollParent.scrollTop = targetTop - containerTop;
  446. // }
  447. },
  448. cancellation() {
  449. this.$message.info("取消操作");
  450. this.isshow = true;
  451. this.getlist();
  452. },
  453. //确定排序
  454. assertion() {
  455. const result = [];
  456. this.tableData.forEach((item, index) => {
  457. // index 从0开始的, 你的displayOrder从大到小排
  458. // const currentDisplayOrder = this.tableData.length -1
  459. // const currentDisplayOrder = this.initTableData[index].displayOrder;
  460. // if (item.displayOrder != currentDisplayOrder) {
  461. // 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
  462. result.push({ id: item.id, displayOrder: index + 1 });
  463. // }
  464. });
  465. putapi("/api/app/ThirdInterface/UpdateSortMany", {
  466. itemList: result,
  467. }).then((res) => {
  468. if (res.code != -1) {
  469. this.getlist();
  470. this.isshow = true;
  471. //this.$message.success("操作成功");
  472. }
  473. });
  474. },
  475. //初始化
  476. rowDrop() {
  477. this.$nextTick(() => {
  478. const tbody = document.querySelector(".el-table__body-wrapper tbody");
  479. const _this = this;
  480. Sortable.create(tbody, {
  481. handle: ".move",
  482. animation: 300,
  483. // 指定父元素下可被拖拽的子元素
  484. // draggable: ".module-manager .el-table__row",
  485. onChoose({ oldIndex }) {
  486. _this.$refs["tableData"].setCurrentRow(_this.tableData[oldIndex]);
  487. _this.rowick(_this.tableData[oldIndex]);
  488. },
  489. onEnd({ newIndex, oldIndex }) {
  490. // console.log(arr);
  491. _this.isshow = false;
  492. const currRow = _this.tableData.splice(oldIndex, 1)[0];
  493. _this.tableData.splice(newIndex, 0, currRow);
  494. _this.tableData.map((item, index) => {
  495. if (index == newIndex && index == oldIndex) {
  496. // console.log(item, "新数据");
  497. } else if (index == oldIndex) {
  498. } else if (index == newIndex) {
  499. }
  500. });
  501. },
  502. });
  503. });
  504. },
  505. //置底置顶
  506. topping() {
  507. this.form = { ...this.curRow };
  508. if (this.form.id == undefined) {
  509. this.$message.warning("请选择操作的数据");
  510. } else {
  511. putapi(
  512. `/api/app/ThirdInterface/UpdateManySort?id=${this.form.id}&SortType=1`
  513. ).then((res) => {
  514. if (res.code != -1) {
  515. this.getlist();
  516. //this.$message.success("操作成功");
  517. }
  518. });
  519. }
  520. },
  521. toppings() {
  522. this.form = { ...this.curRow };
  523. if (this.form.id == undefined) {
  524. this.$message.warning("请选择操作的数据");
  525. } else {
  526. putapi(
  527. `/api/app/ThirdInterface/UpdateManySort?id=${this.form.id}&SortType=2`
  528. ).then((res) => {
  529. if (res.code != -1) {
  530. this.getlist();
  531. //this.$message.success("操作成功");
  532. }
  533. });
  534. }
  535. },
  536. //删除
  537. deleteid(row) {
  538. this.form = { ...this.curRow };
  539. if (this.form.id == undefined) {
  540. this.$message.warning("请选择删除的数据");
  541. } else {
  542. this.$confirm("是否确认删除,是否继续", "提示", {
  543. confirmButtonText: "确定",
  544. cancelButtonText: "取消",
  545. type: "warning",
  546. cancelButtonClass: "difference",
  547. confirmButtonClass: "commonbutton",
  548. })
  549. .then(() => {
  550. postapi("/api/app/ThirdInterface/Delete", {
  551. id: this.curRow.id,
  552. }).then((res) => {
  553. if (res.code != -1) {
  554. this.curRow = this.$options.data().curRow;
  555. this.getlist();
  556. //this.$message.success("删除成功");
  557. }
  558. });
  559. })
  560. .catch(() => {});
  561. // deletecol(this.form.id).then((res) => {
  562. // console.log("删除成功");
  563. // this.getlist();
  564. // });
  565. }
  566. },
  567. //edlits编辑弹框
  568. edlits(row) {
  569. this.form = { ...this.curRow };
  570. if (this.form.id == undefined) {
  571. this.$message.warning("请选择操作的数据");
  572. } else {
  573. this.title = 2;
  574. this.dialogVisible = true;
  575. }
  576. },
  577. //确定新增或者修改
  578. addoredit() {
  579. if (this.form.displayName == undefined || this.form.displayName == "") {
  580. this.$message.warning("请输入名称");
  581. } else if (
  582. this.form.medicalCenterId == undefined ||
  583. this.form.medicalCenterId == ""
  584. ) {
  585. this.$message.warning("请选择体检中心");
  586. } else if (
  587. this.form.thirdInterfaceType == undefined ||
  588. this.form.thirdInterfaceType == ""
  589. ) {
  590. this.$message.warning("请选择接口类型");
  591. } else {
  592. if (this.title == 1) {
  593. postapi("/api/app/ThirdInterface/Create", {
  594. displayName: this.form.displayName,
  595. parmValue: this.form.parmValue,
  596. thirdInterfaceType: this.form.thirdInterfaceType,
  597. medicalCenterId: this.form.medicalCenterId,
  598. isActive: this.form.isActive,
  599. }).then((res) => {
  600. if (res.code != -1) {
  601. this.getlist();
  602. this.dialogVisible = false;
  603. //this.$message.success("新增成功");
  604. }
  605. });
  606. } else if (this.title == 2) {
  607. postapi("/api/app/ThirdInterface/Update", {
  608. id: this.form.id,
  609. displayName: this.form.displayName,
  610. parmValue: this.form.parmValue,
  611. thirdInterfaceType: this.form.thirdInterfaceType,
  612. medicalCenterId: this.form.medicalCenterId,
  613. isActive: this.form.isActive,
  614. }).then((res) => {
  615. if (res.code != -1) {
  616. this.curRow={...res.data}
  617. this.getlist();
  618. this.dialogVisible = false;
  619. //this.$message.success("修改成功");
  620. }
  621. });
  622. }
  623. }
  624. },
  625. //新增弹框
  626. add() {
  627. this.dialogVisible = true;
  628. this.title = 1;
  629. this.form = this.$options.data().form;
  630. this.$nextTick(() => {
  631. this.$refs.refinput.focus();
  632. });
  633. },
  634. //
  635. getmedicalCenter() {
  636. getapi("/api/app/organization-units/by-code-all").then((res) => {
  637. this.medicalCenter = [...res.data];
  638. });
  639. },
  640. getlist() {
  641. postapi("/api/app/ThirdInterface/GetList").then((res) => {
  642. if (res.code != -1) {
  643. this.initTableData = [...res.data];
  644. this.tableData = res.data;
  645. // this.quckDepartment=[...res.data.items]
  646. }
  647. });
  648. },
  649. },
  650. };
  651. </script>
  652. <style scoped>
  653. @import "../../assets/css/global_button.css";
  654. @import "../../assets/css/global_dialog.css";
  655. @import "../../assets/css/global_table.css";
  656. @import "../../assets/css/global_form.css";
  657. @import "../../assets/css/global_input.css";
  658. @import "../../assets/css/global.css";
  659. .box {
  660. display: flex;
  661. flex-direction: column;
  662. }
  663. :deep .el-form-item {
  664. margin-bottom: 14px;
  665. }
  666. /* el-dialog的头部样式 */
  667. :deep .el-dialog__header {
  668. padding: 11px 20px 11px;
  669. }
  670. /* el-dialog的主体样式 */
  671. :deep .el-dialog__body {
  672. padding: 0px 20px 0px;
  673. }
  674. /* el-divider样式 */
  675. :deep .el-divider--horizontal {
  676. margin: 0px 0 12px;
  677. }
  678. /* el-dialog的底部样式 */
  679. :deep .el-dialog__footer {
  680. padding: 0px 20px 14px;
  681. }
  682. .seachinput {
  683. width: 250px;
  684. margin-right: 110px;
  685. }
  686. :deep .seachinput .el-select {
  687. width: 100%;
  688. }
  689. :deep .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  690. background-color: #409eff !important;
  691. border-color: #409eff !important;
  692. }
  693. </style>