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.

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