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.

464 lines
14 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
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="examinationcategory">
  3. <div>
  4. <span>项目类别</span>
  5. <el-select
  6. v-model="value"
  7. placeholder="请选择"
  8. style="margin-left: 20px"
  9. @change="getprojectgroups"
  10. clearable
  11. >
  12. <el-option
  13. v-for="item in options"
  14. :key="item.id"
  15. :label="item.displayName"
  16. :value="item.id"
  17. >
  18. </el-option>
  19. </el-select>
  20. </div>
  21. <div class="mainarea">
  22. <div class="mainarealeftbox">
  23. <el-table
  24. :header-cell-style="{ background: '#eef1f6' }"
  25. :data="tabledata"
  26. @selection-change="handleSelectionChange"
  27. >
  28. <el-table-column type="selection"></el-table-column>
  29. <el-table-column
  30. label="未选组合项目"
  31. prop="displayName"
  32. ></el-table-column>
  33. </el-table>
  34. </div>
  35. <div class="mainbutton">
  36. <div>
  37. <el-button
  38. type="primary"
  39. style="margin-top: 10px"
  40. @click="addselecteditems"
  41. >移除 <i class="el-icon-arrow-left"></i
  42. ></el-button>
  43. </div>
  44. <div>
  45. <el-button type="primary" style="margin-top: 10px" @click="removedata"
  46. >添加 <i class="el-icon-arrow-right"></i
  47. ></el-button>
  48. </div>
  49. <div>
  50. <el-button
  51. style="margin-top: 10px"
  52. :disabled="saveornot"
  53. @click="Onsubmit"
  54. >保存
  55. </el-button>
  56. </div>
  57. </div>
  58. <!-- -->
  59. <div class="mainarearightbox">
  60. <el-table
  61. :header-cell-style="{ background: '#eef1f6' }"
  62. :data="personnelUnit.nogroupselected"
  63. @selection-change="selecteditems"
  64. >
  65. <!-- temporaryselection personnelUnit.nogroupselected-->
  66. <el-table-column type="selection"></el-table-column>
  67. <el-table-column
  68. label="已选组合项目"
  69. width="110"
  70. prop="displayName"
  71. ></el-table-column>
  72. <el-table-column label="标准价格" prop="price">
  73. <template slot-scope="scope">
  74. <el-input
  75. disabled
  76. type="text"
  77. v-model="personnelUnit.nogroupselected[scope.$index].price"
  78. />
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="折扣" prop="price">
  82. <template slot-scope="scope">
  83. <el-input
  84. @change="discount(scope.$index)"
  85. type="text"
  86. v-model="personnelUnit.nogroupselected[scope.$index].discount"
  87. />
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="价格" prop="price">
  91. <template slot-scope="scope">
  92. <el-input
  93. @input="changingprices(scope.row.price)"
  94. type="text"
  95. v-model="personnelUnit.nogroupselected[scope.$index].price"
  96. />
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. </div>
  101. <div class="operatebottom">
  102. <div>
  103. <el-button type="primary" @click="packagerepicion"
  104. >复制套餐</el-button
  105. >
  106. </div>
  107. <div style="margin-top: 10px">
  108. <el-button type="primary" @click="copygroup">复制分组</el-button>
  109. </div>
  110. </div>
  111. </div>
  112. <!-- 复制套餐弹框 -->
  113. <el-dialog title="编辑" :visible.sync="dialogVisible" width="60%">
  114. <el-table :data="packagelist">
  115. <el-table-column label="编号" prop="id"></el-table-column>
  116. <el-table-column label="名称" prop="displayName"></el-table-column>
  117. <el-table-column label="创建者" prop="creatorName"></el-table-column>
  118. <el-table-column label="创建时间" prop="creatorName">
  119. <template slot-scope="scope">
  120. {{ scope.row.creationTime | dateFormat }}
  121. </template>
  122. </el-table-column>
  123. <el-table-column
  124. label="修改者"
  125. prop="lastModifierName"
  126. ></el-table-column>
  127. <el-table-column label="修改时间" prop="lastModificationTime">
  128. <template slot-scope="scope">
  129. {{ scope.row.lastModificationTime | dateFormat }}
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <span slot="footer" class="dialog-footer">
  134. <el-button @click="dialogVisible = false"> </el-button>
  135. <el-button type="primary" @click="dialogVisible = false"
  136. > </el-button
  137. >
  138. </span>
  139. </el-dialog>
  140. <!-- 复制分组 弹框-->
  141. <el-dialog
  142. title="复制分组"
  143. :visible.sync="copyGroupdialogVisible"
  144. width="50%"
  145. >
  146. <el-table>
  147. <el-table-column label="编号"></el-table-column>
  148. <el-table-column label="创建者"></el-table-column>
  149. <el-table-column label="创建时间"></el-table-column>
  150. <el-table-column label="修改者"></el-table-column>
  151. <el-table-column label="修改时间"></el-table-column>
  152. </el-table>
  153. <span slot="footer" class="dialog-footer">
  154. <el-button @click="copyGroupdialogVisible = false"> </el-button>
  155. <el-button type="primary" @click="copyGroupdialogVisible = false"
  156. > </el-button
  157. >
  158. </span>
  159. </el-dialog>
  160. <!-- -->
  161. </div>
  162. </template>
  163. <script>
  164. import { getapi, postapi } from "@/api/api";
  165. import { mapState } from "vuex";
  166. import { arrayExistObj } from "../../utlis/proFunc";
  167. export default {
  168. data() {
  169. return {
  170. saveornot: true, //保存按钮
  171. selecteddata: [], //已选数据
  172. unselecteddata: [], //未选数据
  173. unselecteddata: [], //右边勾选中
  174. rightselctedata: [], //右侧已选
  175. options: [],
  176. value: "",
  177. dialogVisible: false,
  178. copyGroupdialogVisible: false,
  179. packagelist: [],
  180. tabledata: [],
  181. temporaryselection: [], //已选组合项目table
  182. copegroupdata: [], //复制分组
  183. addrulst: [], //添加保存的Id
  184. price: "", //价格
  185. title: 1,
  186. };
  187. },
  188. computed: {
  189. ...mapState(["personnelUnit"]),
  190. },
  191. created() {
  192. this.getitemtype();
  193. this.getportfolioitems();
  194. },
  195. methods: {
  196. changingprices(price) {
  197. this.price = price;
  198. },
  199. discount(index) {
  200. console.log(index); //100标准价格
  201. this.personnelUnit.nogroupselected[index].price = Math.round(
  202. (100 * Number(this.personnelUnit.nogroupselected[index].queueTime)) /
  203. 100,
  204. 2
  205. );
  206. },
  207. inputchang(row, newVal) {
  208. this.price = row.price;
  209. console.log(this.price);
  210. },
  211. //保存按钮
  212. Onsubmit() {
  213. if (!this.personnelUnit.customerOrgGroupId) {
  214. alert("请先选择单位分组");
  215. return;
  216. } else {
  217. console.log(this.personnelUnit.nogroupselected);
  218. postapi("/api/app/customer-org-group-detail/many", this.addrulst).then(
  219. (res) => {
  220. this.$message.success("操作成功");
  221. console.log(this.addrulst);
  222. }
  223. );
  224. }
  225. // if (this.title == 2) {
  226. // if (!this.personnelUnit.customerOrgGroupId) {
  227. // alert("请先选择单位分组");
  228. // return;
  229. // } else {
  230. // console.log(this.personnelUnit.nogroupselected);
  231. // postapi(
  232. // "/api/app/customer-org-group-detail/many",
  233. // this.addrulst
  234. // ).then((res) => {
  235. // this.$message.success("操作成功");
  236. // console.log(this.addrulst);
  237. // });
  238. // }
  239. // }
  240. // console.log(this.addrulst);
  241. // // console.log(this.personnelUnit.form.id);
  242. // if (this.addrulst[customerOrgGroupId] == undefined) {
  243. // this.$message.warning("请先选择单位分组");
  244. // } else {
  245. // postapi("/api/app/customer-org-group-detail/many", this.addrulst).then(
  246. // (res) => {
  247. // console.log(this.personnelUnit.form.id);
  248. // this.$message.success("操作成功");
  249. // }
  250. // );
  251. // }
  252. },
  253. //移除按钮
  254. addselecteditems() {
  255. let lfind = -1;
  256. console.log(this.personnelUnit.id);
  257. if (this.personnelUnit.form.id == "") {
  258. alert("请先选择单位类别");
  259. } else {
  260. // 让按钮恢复禁用
  261. this.saveornot = false;
  262. //personnelUnit.nogroupselected
  263. if (this.rightselctedata.length == 0) {
  264. this.$message.warning("已选数据为空无法移动");
  265. } else {
  266. // this.title = 2;
  267. let count = this.rightselctedata.length - 1;
  268. for (var i = count; i >= 0; i--) {
  269. if ([...new Set(this.rightselctedata)]) {
  270. this.tabledata.push(this.rightselctedata[i]);
  271. this.personnelUnit.nogroupselected.splice(i, 1);
  272. }
  273. }
  274. console.log(this.personnelUnit.customerOrgGroupId);
  275. // this.
  276. this.rightselctedata.forEach((item) => {
  277. lfind = arrayExistObj(
  278. this.personnelUnit.nogroupselected,
  279. "id",
  280. item.id
  281. );
  282. if (lfind > -1) this.personnelUnit.nogroupselected.splice(lfind, 1);
  283. this.addrulst.push({
  284. asbitemId: item.id,
  285. price: item.price,
  286. // price: this.price,
  287. customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
  288. });
  289. });
  290. }
  291. }
  292. },
  293. //右侧勾选按钮
  294. selecteditems(val) {
  295. this.rightselctedata = val;
  296. console.log(this.rightselctedata);
  297. },
  298. // 添加按钮
  299. removedata() {
  300. let lfind = -1;
  301. if (this.personnelUnit.form.id == "") {
  302. alert("请先选择单位分组");
  303. } else {
  304. if (this.unselecteddata.length == 0) {
  305. this.$message.warning("未选数据为空无法移动");
  306. } else {
  307. this.saveornot = false;
  308. let count = this.unselecteddata.length - 1;
  309. for (var i = count; i >= 0; i--) {
  310. // this.tabledata.splice(i, 1);
  311. if ([...new Set(this.personnelUnit.nogroupselected)]) {
  312. // this.unselecteddata.push(this.unselecteddata[i]);
  313. this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
  314. this.tabledata.splice(this.tabledata[i], 1);
  315. }
  316. // this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
  317. }
  318. console.log(this.personnelUnit.customerOrgGroupId);
  319. // let prices = "";
  320. this.personnelUnit.nogroupselected.forEach((items) => {
  321. // prices = items.price;
  322. //this.tabledata
  323. console.log(items);
  324. lfind = arrayExistObj(this.tabledata, "id", items.id);
  325. if (lfind > -1) this.tabledata.splice(lfind, 1);
  326. this.addrulst.push({
  327. asbitemId: items.id, // "3a0b2f0c-f884-bec4-a350-79b46b455a2d"
  328. price: items.price,
  329. // price: this.price == "" ? items.price : this.price,
  330. customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
  331. });
  332. });
  333. console.log(this.addrulst, "hhhhhhh");
  334. }
  335. }
  336. },
  337. // 左侧未选
  338. handleSelectionChange(val) {
  339. // this.selecteddata = val;
  340. this.unselecteddata = val;
  341. console.log(this.unselecteddata);
  342. },
  343. //获取所有组合项目
  344. getportfolioitems() {
  345. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  346. this.tabledata = res.data.items;
  347. });
  348. },
  349. //项目类别选择
  350. getprojectgroups(v) {
  351. if (v !== "") {
  352. getapi(`/api/app/asbitem/in-item-type/${v}`).then((res) => {
  353. console.log(res);
  354. this.tabledata = res.data;
  355. });
  356. } else {
  357. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  358. this.tabledata = res.data.items;
  359. });
  360. }
  361. },
  362. //复制分组弹框
  363. copygroup() {
  364. if (this.personnelUnit.form == "") {
  365. this.$message.warning("请选择分组");
  366. } else {
  367. this.copyGroupdialogVisible = true;
  368. getapi(
  369. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.form.id}`
  370. ).then((res) => {
  371. console.log(res);
  372. this.personnelUnit.form = res.data;
  373. });
  374. }
  375. },
  376. //复制套餐
  377. packagerepicion() {
  378. this.dialogVisible = true;
  379. getapi("/api/app/medical-package").then((res) => {
  380. this.packagelist = res.data.items;
  381. console.log(res);
  382. });
  383. },
  384. //
  385. getitemtype() {
  386. getapi("/api/app/item-type/by-code-all").then((res) => {
  387. this.options = res.data;
  388. });
  389. },
  390. //获取当前列列表数据
  391. listeninglist(customerOrgGroupId) {
  392. getapi(`/api/app/customer-org-group/${customerOrgGroupId}`).then(
  393. (res) => {
  394. this.personnelUnit.form = res.data;
  395. console.log(res);
  396. }
  397. );
  398. getapi(
  399. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`
  400. ).then((res) => {
  401. console.log(
  402. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`,
  403. res
  404. );
  405. this.personnelUnit.nogroupselected = res.data;
  406. });
  407. },
  408. // getapi(`/api/app/customer-org-group/${row.id}`).then((res)
  409. },
  410. //监听事件
  411. watch: {
  412. //
  413. "personnelUnit.customerOrgGroupId"(newVal, oldVal) {
  414. console.log(
  415. "watch patientRegister.addTimes newVal:",
  416. newVal,
  417. " oldVal:",
  418. oldVal
  419. );
  420. if (newVal != oldVal) {
  421. this.listeninglist(newVal);
  422. //
  423. }
  424. },
  425. },
  426. };
  427. </script>
  428. <style scoped>
  429. .operatebottom {
  430. margin-left: 5%;
  431. }
  432. .mainarearightbox {
  433. width: 35%;
  434. border: 1px solid #000;
  435. height: 300px;
  436. margin-left: 7%;
  437. overflow: auto;
  438. }
  439. .mainbutton {
  440. margin-left: 5%;
  441. padding: 5px 10px;
  442. margin-top: 5%;
  443. }
  444. .mainarea {
  445. display: flex;
  446. margin-top: 20px;
  447. }
  448. .mainarealeftbox {
  449. width: 20%;
  450. border: 1px solid #000;
  451. height: 300px;
  452. overflow: hidden;
  453. overflow: auto;
  454. margin-left: 7%;
  455. }
  456. .examinationcategory {
  457. margin-top: 30px;
  458. }
  459. </style>