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.

852 lines
26 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
  1. <template>
  2. <div class="box">
  3. <div style="width: 100%">
  4. <el-card class="elcard" style="border-radius: 15px">
  5. <div class="publiccss">项目模板</div>
  6. <el-table
  7. :data="tableData"
  8. style="width: 100%; margin-top: 20px"
  9. row-key="id"
  10. class="el-table__body-wrapper tbody"
  11. @row-click="rowclick"
  12. highlight-current-row
  13. height="300"
  14. >
  15. <el-table-column prop="id" label="编号" width="300">
  16. </el-table-column>
  17. <el-table-column prop="displayName" label="名称"> </el-table-column>
  18. <el-table-column prop="creatorName" label="创建者" width="130">
  19. </el-table-column>
  20. <el-table-column prop="creationTime" label="创建时间" width="200">
  21. <template slot-scope="scope">
  22. {{ scope.row.creationTime | dateFormat }}
  23. </template>
  24. </el-table-column>
  25. <el-table-column prop="lastModifierName" label="修改者" width="">
  26. </el-table-column>
  27. <el-table-column
  28. prop="lastModificationTime"
  29. label="修改时间"
  30. width="200"
  31. >
  32. <template slot-scope="scope">
  33. {{ scope.row.lastModificationTime | dateFormat }}
  34. </template>
  35. </el-table-column>
  36. <el-table-column prop="result" label="结果" width="">
  37. </el-table-column>
  38. <el-table-column label="操作" width="">
  39. <template>
  40. <el-tag
  41. class="move"
  42. style="cursor: move; margin-left: 15px"
  43. draggable="true"
  44. >
  45. <i
  46. class="el-icon-d-caret"
  47. style="width: 1rem; height: 1rem"
  48. ></i>
  49. </el-tag>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <!-- <comp-table
  54. :tableData="tableData"
  55. :tableHeader="tableHeader"
  56. @clickevents="rowclick"
  57. ref="singleTable"
  58. >
  59. </comp-table> -->
  60. <div class="subjecttitle">
  61. <span style="margin-top: 10px; padding: 5px; margin-left: %"
  62. >项目类别</span
  63. >
  64. <el-select
  65. v-model="values"
  66. placeholder="请选择"
  67. @change="ischangs"
  68. style="margin-top: 5px"
  69. >
  70. <el-option
  71. v-for="item in projectid"
  72. :key="item.id"
  73. :label="item.displayName"
  74. :value="item.id"
  75. >
  76. </el-option>
  77. </el-select>
  78. <span style="margin-left: 10%; padding: 5px">搜索选择</span>
  79. <el-select
  80. filterable
  81. v-model="flitvalues"
  82. placeholder="请选择"
  83. style="margin-top: 5px"
  84. >
  85. <el-option
  86. v-for="item in filetelists"
  87. :key="item.id"
  88. :label="item.displayName"
  89. :value="item.id"
  90. >
  91. </el-option>
  92. </el-select>
  93. </div>
  94. <div class="mainbox">
  95. <div class="mainleftbox">
  96. <div class="weixuan">未选项目</div>
  97. <div
  98. v-for="(item, index) in leftdata"
  99. :key="index"
  100. @click="clickPaixu(item, index)"
  101. @dblclick="shuanji(item, index)"
  102. :class="num === index ? 'activetext' : ''"
  103. style=""
  104. >
  105. <div>{{ item.displayName }}</div>
  106. </div>
  107. </div>
  108. <div class="Selectbutton">
  109. <div style="margin-top: 10px">
  110. <el-button @click="addall"
  111. >全添加<i class="el-icon-caret-right"></i
  112. ><i class="el-icon-caret-right"></i
  113. ></el-button>
  114. </div>
  115. <div style="margin-top: 10px">
  116. <el-button @click="addobj" style="width: 111px"
  117. >添加<i class="el-icon-caret-right"></i>
  118. </el-button>
  119. </div>
  120. <div style="margin-top: 10px">
  121. <el-button @click="removeright" style="width: 111px"
  122. >移去<i class="el-icon-caret-left"></i>
  123. </el-button>
  124. </div>
  125. <div style="margin-top: 10px">
  126. <el-button @click="allclear"
  127. >全移去<i class="el-icon-caret-left"></i
  128. ><i class="el-icon-caret-left"></i>
  129. </el-button>
  130. </div>
  131. </div>
  132. <div class="mainleftbox">
  133. <div class="weixuan">已选项目</div>
  134. <div
  135. v-for="(item, index) in rightdata"
  136. :key="index"
  137. @click="rightindex(item, index)"
  138. @dblclick="rightdelite(item, index)"
  139. :class="nums === index ? 'activetext' : ''"
  140. >
  141. <div>{{ item.displayName }}</div>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="confirmcancellation">
  146. <el-button :disabled="isdislob" @click="Onsubmit">确定</el-button>
  147. <el-button :disabled="isdislob">取消</el-button>
  148. </div>
  149. </el-card>
  150. <!-- 弹框 -->
  151. <el-dialog
  152. :title="title == 1 ? '新增' : '编辑'"
  153. :visible.sync="dialogVisible"
  154. width="75%"
  155. :close-on-click-modal="false"
  156. >
  157. <el-form ref="form" :model="form" label-width="80px" :rules="rules">
  158. <el-row>
  159. <el-col :span="8">
  160. <el-form-item label="名称" prop="displayName">
  161. <el-input
  162. ref="refinput"
  163. v-model="form.displayName"
  164. style="width: 80%"
  165. ></el-input>
  166. </el-form-item>
  167. </el-col>
  168. </el-row>
  169. </el-form>
  170. <span slot="footer" class="dialog-footer">
  171. <el-button @click="dialogVisible = false"> </el-button>
  172. <el-button type="primary" @click="onsbmit"> </el-button>
  173. </span>
  174. </el-dialog>
  175. </div>
  176. <!-- 按钮区域 -->
  177. <div style="margin-left: 10px; margin-top: 5%">
  178. <div style="">
  179. <!-- undate -->
  180. <!-- <el-row>
  181. <div class="el-form-item__content">
  182. <el-upload
  183. ref="upload"
  184. accept=".xls,.xlsx"
  185. action="#"
  186. :auto-upload="false"
  187. :multiple="false"
  188. :file-list="fileList"
  189. :before-upload="beforeUpload"
  190. :http-request="uploadHttpRequest"
  191. :on-remove="fileRemove"
  192. :on-change="fileChange"
  193. >
  194. <el-button size="small" type="primary">选择文件</el-button>
  195. </el-upload>
  196. </div>
  197. </el-row> -->
  198. <!-- -->
  199. <!-- <el-button type="primary" @click="exportexc">导出excel</el-button> -->
  200. </div>
  201. <div>
  202. <!-- <el-button type="primary" @click="parseImportData(importData)"
  203. >parse</el-button
  204. > -->
  205. </div>
  206. <div>
  207. <el-button type="" @click="add" class="commonbutton">新增</el-button>
  208. </div>
  209. <el-button
  210. type=""
  211. @click="editpopup"
  212. style="margin-left: 0; margin-top: 10px"
  213. class="commonbutton"
  214. >编辑</el-button
  215. >
  216. <!-- <input type="file" accept=".xlsx" @change="onFileChange" /> -->
  217. <div style="margin-top: 10px">
  218. <el-button type="" @click="delets" class="commonbutton">删除</el-button>
  219. </div>
  220. <div style="margin-top: 10px">
  221. <el-button type="" @click="topping" class="commonbutton"
  222. >置顶</el-button
  223. >
  224. </div>
  225. <div style="margin-top: 10px">
  226. <el-button type="" @click="toppings" class="commonbutton"
  227. >置底</el-button
  228. >
  229. </div>
  230. <div style="margin-top: 10px">
  231. <el-button type="" :disabled="isshow" @click="assertion"
  232. class="commonbutton"
  233. >排序</el-button
  234. >
  235. </div>
  236. <div style="margin-top: 5px">
  237. <el-button type="" :disabled="isshow" @click="cancellation" class="commonbutton"
  238. >取消</el-button
  239. >
  240. </div>
  241. </div>
  242. <!-- 选择文件之后的弹框 -->
  243. <el-dialog title="提示" :visible.sync="filepopupdialogVisible" width="60%">
  244. <!-- <el-table :data="importData" style="width: 100%"> </el-table> -->
  245. <div v-for="(item, index) in importData" :key="index">
  246. <el-checkbox v-model="item.a">备选项</el-checkbox>
  247. {{ item }}
  248. </div>
  249. <span slot="footer" class="dialog-footer">
  250. <el-button @click="filepopupdialogVisible = false"> </el-button>
  251. <el-button type="primary" @click="filepopupdialogVisible = false"
  252. > </el-button
  253. >
  254. </span>
  255. </el-dialog>
  256. <!-- -->
  257. </div>
  258. </template>
  259. <script>
  260. import ExcelJS from "exceljs";
  261. import { rowDrop } from "@/components/publicjs/public";
  262. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  263. import { getporjectlists } from "@/request/commonapi";
  264. import compTable from "@/components/compTable.vue";
  265. import Sortable from "sortablejs";
  266. export default {
  267. components: { compTable },
  268. data() {
  269. return {
  270. filepopupdialogVisible: false,
  271. ary1: [],
  272. ary2: [],
  273. nums: 0,
  274. num: 0,
  275. flitvalues: [], //搜索选择
  276. filetelists: [], //项目类别
  277. projectid: [],
  278. values: "",
  279. isshow: true,
  280. rules: {
  281. itemId: [{ required: true, message: "请选择项目", trigger: "change" }],
  282. displayName: [
  283. { required: true, message: "请输入名称", trigger: "blur" },
  284. ],
  285. diagnosisId: [
  286. { required: true, message: "请选择诊断编号", trigger: "change" },
  287. ],
  288. isNameIntoSummary: [
  289. { required: true, message: "请选择小结名称", trigger: "change" },
  290. ],
  291. isResultIntoSummary: [
  292. { required: true, message: "请选择进入小结", trigger: "change" },
  293. ],
  294. resultStatusId: [
  295. { required: true, message: "请选择结果状态", trigger: "change" },
  296. ],
  297. simpleCode: [
  298. { required: true, message: "请输入拼音简码", trigger: "change" },
  299. ],
  300. },
  301. form: {
  302. displayName: "",
  303. },
  304. dialogVisible: false,
  305. title: 1,
  306. pages: {
  307. SkipCount: 0,
  308. MaxResultCount: 100,
  309. Sorting: "displayOrder desc",
  310. },
  311. itemId: [], //项目
  312. diagnosisId: [], //诊断
  313. resultStatusId: [], //结果状态
  314. isNameIntoSummary: [
  315. {
  316. value: "N",
  317. label: "否",
  318. },
  319. {
  320. value: "Y",
  321. label: "是",
  322. },
  323. ], // 小结名称
  324. isResultIntoSummary: [
  325. {
  326. value: "N",
  327. label: "否",
  328. },
  329. {
  330. value: "Y",
  331. label: "是",
  332. },
  333. ], //进入小结
  334. tableData: [],
  335. initTableData: [],
  336. tableHeader: [
  337. // 表头信息,可根据minWidth修改宽度
  338. { prop: "id", label: "编号", minWidth: "150px" },
  339. { prop: `creatorName`, label: "创建者" },
  340. { prop: `creationTime`, label: "创建时间" },
  341. { prop: `lastModifierName`, label: "修改者" },
  342. { prop: `lastModificationTime`, label: "创建时间" },
  343. { prop: "result", label: "结果" },
  344. // { prop: "simpleCode", label: "拼音简码" },
  345. ],
  346. leftdata: [], //左边侧边栏数据
  347. rightobj: {},
  348. rightdata: [], //右边侧边栏数据
  349. isdislob: true,
  350. flitvalues: [],
  351. fileList: [],
  352. importData: [],
  353. };
  354. },
  355. created() {
  356. this.getlist();
  357. this.gitprojectcategory();
  358. },
  359. mounted() {
  360. this.rowDrop();
  361. // this.getdiagnosisitem();
  362. },
  363. methods: {
  364. onFileChange(event) {
  365. // 获取上传的文件
  366. const file = event.target.files[0];
  367. // 调用导入Excel文件的方法
  368. this.importExcelFile(file);
  369. },
  370. importExcelFile(file) {
  371. this.filepopupdialogVisible = true;
  372. console.log("333");
  373. // 创建一个工作簿
  374. const workbook = new ExcelJS.Workbook();
  375. // 读取Excel文件
  376. const reader = new FileReader();
  377. console.log(reader);
  378. reader.onload = () => {
  379. const buffer = reader.result;
  380. const typedArray = new Uint8Array(buffer);
  381. const blob = new Blob([typedArray], {
  382. type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  383. });
  384. // 从Blob中读取Excel文件
  385. workbook.xlsx.load(blob).then((workbook) => {
  386. // 获取第一个工作表
  387. const worksheet = workbook.getWorksheet(1);
  388. // 处理Excel文件内容
  389. worksheet.eachRow((row, rowNumber) => {
  390. this.importData.push(row.values);
  391. // console.log(`第${rowNumber}行的数据:${rowData}`);
  392. });
  393. });
  394. };
  395. reader.readAsArrayBuffer(file);
  396. },
  397. parseImportData(importData) {
  398. console.log("importData", importData.length, importData);
  399. importData.forEach((item) => {
  400. console.log(item);
  401. this.importData = item.splice(1).map((items) => {
  402. return { id: items[0] };
  403. });
  404. // this.importData.push(item);
  405. // item.forEach((item2) => {
  406. // item2.displayName = item2[0];
  407. // console.log(item2.displayName);
  408. // });
  409. console.log(item, "item", item.length);
  410. });
  411. },
  412. // 上传文件之前的钩子:判断上传文件格式、大小等,若返回false则停止上传
  413. beforeUpload(file) {
  414. console.log(file);
  415. console.log("333");
  416. console.log("2222");
  417. //文件类型
  418. const isType = file.type === "application/vnd.ms-excel";
  419. const isTypeComputer =
  420. file.type ===
  421. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
  422. const fileType = isType || isTypeComputer;
  423. if (!fileType) {
  424. this.$message.error("上传文件只能是xls/xlsx格式!");
  425. }
  426. // 文件大小限制为10M
  427. const fileLimit = file.size / 1024 / 1024 < 10;
  428. if (!fileLimit) {
  429. this.$message.error("上传文件大小不超过10M!");
  430. }
  431. return fileType && fileLimit;
  432. },
  433. uploadHttpRequest(param) {
  434. const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加
  435. formData.append("file", param.file); //添加文件对象
  436. formData.append("uploadType", this.rulesType);
  437. const url = `${this.myBaseURL}/operation/ruleImport/importData`; //上传地址
  438. axios
  439. .post(url, formData)
  440. .then((res) => {
  441. const {
  442. data: { code, mark },
  443. } = res;
  444. if (code === 0) {
  445. param.onSuccess(); // 上传成功的文件显示绿色的对勾
  446. this.uploadMark = mark;
  447. }
  448. return this.countData(this.uploadMark); //根据响应的 mark 值调用统计结果接口,返回一个promise以便进行链式调用
  449. })
  450. .then((res) => {
  451. //链式调用,统计结果的响应
  452. const {
  453. data: { code, data },
  454. } = res;
  455. if (code === 0) {
  456. console.log("统计结果", data);
  457. }
  458. })
  459. .catch((err) => {
  460. console.log("失败", err);
  461. param.onError(); //上传失败的文件会从文件列表中删除
  462. });
  463. },
  464. // 统计结果
  465. countFile(mark) {
  466. return new Promise((resolve, reject) => {
  467. axios
  468. .get(`/operation/ruleImport/countData?mark=${mark}`)
  469. .then((res) => {
  470. resolve(res);
  471. })
  472. .catch((error) => {
  473. reject(error);
  474. });
  475. });
  476. },
  477. // 点击上传:手动上传到服务器,此时会触发组件的http-request
  478. submitUpload() {
  479. this.$refs.upload.submit();
  480. },
  481. // 文件发生改变
  482. fileChange(file, fileList) {
  483. if (fileList.length > 0) {
  484. this.fileList = [fileList[fileList.length - 1]]; // 展示最后一次选择的文件
  485. }
  486. },
  487. // 移除选择的文件
  488. fileRemove(file, fileList) {
  489. if (fileList.length < 1) {
  490. this.uploadDisabled = true; //未选择文件则禁用上传按钮
  491. console.log(file);
  492. }
  493. },
  494. exportexc() {
  495. // console.log('1');
  496. },
  497. // getdiagnosisitem() {
  498. // getapi("/api/app/item").then((res) => {
  499. // console.log(res);
  500. // });
  501. // },
  502. Onsubmit() {
  503. let sampleGroupId = this.form.id;
  504. console.log(this.form.id);
  505. console.log(this.rightdata);
  506. let sdate = [];
  507. this.rightdata.forEach((element) => {
  508. let sss = { sampleGroupId: sampleGroupId, asbitemId: element.id };
  509. sdate.push(sss);
  510. });
  511. this.leftdata.forEach((element) => {
  512. let sss = { sampleGroupId: sampleGroupId, asbitemId: element.id };
  513. sdate.push(sss);
  514. });
  515. console.log(sdate);
  516. if (sampleGroupId == undefined) {
  517. this.$message.warning("请选择列表");
  518. } else {
  519. postapi("/api/app/item-template-detail/many", sdate).then((res) => {
  520. this.$message.success("操作成功");
  521. this.isdislob = true;
  522. });
  523. }
  524. },
  525. //右侧点击选中
  526. rightindex(item, index) {
  527. this.nums = index;
  528. this.leftobj = item;
  529. console.log(this.leftobj);
  530. },
  531. //q全移去
  532. allclear() {
  533. this.isdislob = false;
  534. if (this.rightdata.length > 0) {
  535. this.ary1 = this.rightdata;
  536. this.ary2 = this.leftdata;
  537. this.updatedate();
  538. this.rightdata = [];
  539. }
  540. },
  541. //右移动
  542. removeright() {
  543. if (this.rightdata.length > 0) {
  544. this.rightdata.splice(this.num, 1);
  545. this.leftdata.push(this.leftobj);
  546. this.isdislob = true;
  547. this.updatedate();
  548. }
  549. },
  550. //左侧添加按钮
  551. addobj() {
  552. if (this.leftdata.length > 0) {
  553. this.leftdata.splice(this.num, 1);
  554. this.rightdata.push(this.rightobj);
  555. }
  556. },
  557. //全添加
  558. addall() {
  559. this.isdislob = false;
  560. if (this.leftdata.length > 0) {
  561. this.ary1 = this.leftdata;
  562. this.ary2 = this.rightdata;
  563. this.updatedate();
  564. this.leftdata = [];
  565. }
  566. },
  567. //左侧双击事件
  568. shuanji(item, index) {
  569. console.log(item);
  570. this.leftdata.splice(index, 1);
  571. this.rightdata.push(item);
  572. },
  573. clickPaixu(item, index) {
  574. this.rightobj = item;
  575. // this.ischank = 2;
  576. this.num = index;
  577. console.log(this.num);
  578. },
  579. //项目类别选择框
  580. ischangs(v) {
  581. getapi(`/api/app/item/in-item-type/${v}`).then((res) => {
  582. console.log(res);
  583. this.leftdata = res.data;
  584. });
  585. console.log(v);
  586. },
  587. //获取项目类别
  588. gitprojectcategory() {
  589. getapi("/api/app/item-type").then((res) => {
  590. this.projectid = res.data.items;
  591. });
  592. },
  593. //取消排序
  594. cancellation() {
  595. this.$message.info("取消操作");
  596. this.isshow = true;
  597. this.getlist();
  598. },
  599. //确定排序
  600. assertion() {
  601. const result = [];
  602. this.tableData.forEach((item, index) => {
  603. // index 从0开始的, 你的displayOrder从大到小排
  604. console.log(item.id);
  605. // const currentDisplayOrder = this.tableData.length -1
  606. const currentDisplayOrder = this.initTableData[index].displayOrder;
  607. if (item.displayOrder != currentDisplayOrder) {
  608. // 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
  609. result.push({ id: item.id, displayOrder: currentDisplayOrder });
  610. }
  611. });
  612. putapi("/api/app/itemtemplate/updatesortmany", {
  613. itemList: result,
  614. }).then((res) => {
  615. this.$message.success("操作成功");
  616. this.isshow = true;
  617. this.getlist();
  618. });
  619. },
  620. //初始化
  621. rowDrop() {
  622. this.$nextTick(() => {
  623. const tbody = document.querySelector(".el-table__body-wrapper tbody");
  624. const _this = this;
  625. Sortable.create(tbody, {
  626. handle: ".move",
  627. animation: 300,
  628. onEnd({ newIndex, oldIndex }) {
  629. _this.isshow = false;
  630. const currRow = _this.tableData.splice(oldIndex, 1)[0];
  631. _this.tableData.splice(newIndex, 0, currRow);
  632. _this.tableData.map((item, index) => {
  633. if (index == newIndex && index == oldIndex) {
  634. // console.log(item, "新数据");
  635. } else if (index == oldIndex) {
  636. } else if (index == newIndex) {
  637. }
  638. });
  639. console.log(_this.tableData.map((item) => item.displayOrder));
  640. },
  641. });
  642. });
  643. },
  644. toppings() {
  645. if (this.form.id == undefined) {
  646. this.$message.warning("请选择操作的数据");
  647. } else {
  648. putapi(
  649. `/api/app/itemtemplate/updatemanysort?id=${
  650. this.form.id
  651. }&SortType=${2}`
  652. ).then((res) => {
  653. this.$message.success("操作成功");
  654. this.getlist();
  655. });
  656. }
  657. },
  658. topping() {
  659. if (this.form.id == undefined) {
  660. this.$message.warning("请选择操作的数据");
  661. } else {
  662. putapi(
  663. `/api/app/itemtemplate/updatemanysort?id=${
  664. this.form.id
  665. }&SortType=${1}`
  666. ).then((res) => {
  667. this.$message.success("操作成功");
  668. this.getlist();
  669. });
  670. }
  671. },
  672. //删除
  673. delets(row) {
  674. if (this.form.id == undefined) {
  675. this.$message.warning("请选择删除的数据");
  676. } else {
  677. this.$confirm("是否确认删除,是否继续?", "提示", {
  678. confirmButtonText: "确定",
  679. cancelButtonText: "取消",
  680. type: "warning",
  681. })
  682. .then(() => {
  683. deletapi(`/api/app/item-template/${this.form.id}`).then((res) => {
  684. this.$message.success("删除成功");
  685. this.getlist();
  686. });
  687. })
  688. .catch(() => {});
  689. }
  690. },
  691. //编辑弹框
  692. editpopup() {
  693. if (this.form.id == undefined) {
  694. this.$message.warning("请点击选择操作的数据");
  695. } else {
  696. this.dialogVisible = true;
  697. this.title = 2;
  698. // this.addtoedit();
  699. getapi(`/api/app/item-template/${this.form.id}`).then((res) => {
  700. this.form = res.data;
  701. console.log(res);
  702. });
  703. }
  704. },
  705. //确定新增或者编辑
  706. onsbmit() {
  707. this.$refs.form.validate((v) => {
  708. if (v) {
  709. if (this.title == 1) {
  710. postapi("/api/app/item-template/", this.form).then((res) => {
  711. this.$message.success("新增成功");
  712. this.getlist();
  713. this.dialogVisible = false;
  714. });
  715. } else if (this.title == 2) {
  716. putapi(`/api/app/item-template/${this.form.id}`, this.form).then(
  717. (res) => {
  718. this.$message.success("修改成功");
  719. this.getlist();
  720. this.dialogVisible = false;
  721. }
  722. );
  723. }
  724. }
  725. });
  726. },
  727. rowclick(val) {
  728. getapi(`/api/app/item-template/${val.id}`).then((res) => {
  729. this.form = res.data;
  730. console.log(res);
  731. });
  732. getapi(`/api/app/item/in-item-type/${val.id}`).then((res) => {
  733. let dq = res.data;
  734. if (dq.length > 0) {
  735. this.rightdata = [];
  736. dq.forEach((element) => {
  737. let bb = { displayName: element.displayName, id: element.id };
  738. this.rightdata.push(bb);
  739. });
  740. }
  741. });
  742. },
  743. //ary1 需要追加的数据 ary2目标数组
  744. updatedate() {
  745. this.ary1.forEach((item) => {
  746. let iscz = false;
  747. this.ary2.forEach((item2) => {
  748. if (item2.id == item.id) {
  749. iscz = true;
  750. }
  751. });
  752. if (!iscz) {
  753. console.log(item.id);
  754. this.ary2.push(item);
  755. // this.allid.push({ id: item.id });
  756. }
  757. });
  758. },
  759. handleRowClick(Row) {
  760. console.log(Row);
  761. console.log("1");
  762. },
  763. // 新增或者编辑需要的类别
  764. addtoedit() {
  765. //项目
  766. getporjectlists().then((res) => {
  767. this.itemId = res.data.items;
  768. });
  769. // 诊断
  770. postapi("/api/app/diagnosis/getlistinfilter").then((res) => {
  771. this.diagnosisId = res.data.items;
  772. });
  773. //结果状态
  774. getapi("/api/app/result-status").then((res) => {
  775. this.resultStatusId = res.data.items;
  776. });
  777. getapi("/api/app/diagnosis/getlistinfilter").then((res) => {});
  778. },
  779. //新增弹框
  780. add() {
  781. // this.addtoedit();
  782. this.dialogVisible = true;
  783. this.title = 1;
  784. this.form = {};
  785. this.$nextTick(() => {
  786. this.$refs.refinput.focus();
  787. });
  788. },
  789. getlist() {
  790. getapi("/api/app/item-template/in-filter", this.pages).then((res) => {
  791. console.log(res);
  792. this.tableData = res.data.items;
  793. this.initTableData = [...res.data.items];
  794. });
  795. let that = this;
  796. },
  797. },
  798. };
  799. </script>
  800. <style scoped>
  801. ::v-deep .el-table__header th {
  802. /* font-size: px; */
  803. background-color: rgb(245, 245, 245); /* 设置表头背景颜色 */
  804. color: rgb(113, 113, 113); /* 设置表头文字颜色 */
  805. }
  806. .subjecttitle {
  807. display: flex;
  808. justify-content: center;
  809. }
  810. .confirmcancellation {
  811. margin-left: 45%;
  812. }
  813. .Selectbutton {
  814. margin-left: 3%;
  815. }
  816. .activetext {
  817. background: rgb(185, 203, 235);
  818. }
  819. .mainbox {
  820. display: flex;
  821. justify-content: center;
  822. margin-top: 20px;
  823. }
  824. .mainleftbox {
  825. width: 200px;
  826. height: 240px;
  827. border: 1px solid #ccc;
  828. margin-left: 6%;
  829. }
  830. .box {
  831. display: flex;
  832. }
  833. .weixuan {
  834. text-align: center;
  835. line-height: 20px;
  836. background: rgb(185, 203, 235);
  837. }
  838. </style>