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.

462 lines
14 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 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. export default {
  167. data() {
  168. return {
  169. saveornot: true, //保存按钮
  170. selecteddata: [], //已选数据
  171. unselecteddata: [], //未选数据
  172. unselecteddata: [], //右边勾选中
  173. rightselctedata: [], //右侧已选
  174. options: [],
  175. value: "",
  176. dialogVisible: false,
  177. copyGroupdialogVisible: false,
  178. packagelist: [],
  179. tabledata: [],
  180. temporaryselection: [], //已选组合项目table
  181. copegroupdata: [], //复制分组
  182. addrulst: [], //添加保存的Id
  183. price: "", //价格
  184. title: 1,
  185. };
  186. },
  187. computed: {
  188. ...mapState(["personnelUnit"]),
  189. },
  190. created() {
  191. this.getitemtype();
  192. this.getportfolioitems();
  193. },
  194. methods: {
  195. changingprices(price) {
  196. this.price = price;
  197. },
  198. discount(index) {
  199. console.log(index); //100标准价格
  200. this.personnelUnit.nogroupselected[index].price = Math.round(
  201. (100 * Number(this.personnelUnit.nogroupselected[index].queueTime)) /
  202. 100,
  203. 2
  204. );
  205. },
  206. inputchang(row, newVal) {
  207. this.price = row.price;
  208. console.log(this.price);
  209. },
  210. //保存按钮
  211. Onsubmit() {
  212. if (!this.personnelUnit.customerOrgGroupId) {
  213. alert("请先选择单位分组");
  214. return;
  215. } else {
  216. console.log(this.personnelUnit.nogroupselected);
  217. postapi("/api/app/customer-org-group-detail/many", this.addrulst).then(
  218. (res) => {
  219. this.$message.success("操作成功");
  220. console.log(this.addrulst);
  221. }
  222. );
  223. }
  224. // if (this.title == 2) {
  225. // if (!this.personnelUnit.customerOrgGroupId) {
  226. // alert("请先选择单位分组");
  227. // return;
  228. // } else {
  229. // console.log(this.personnelUnit.nogroupselected);
  230. // postapi(
  231. // "/api/app/customer-org-group-detail/many",
  232. // this.addrulst
  233. // ).then((res) => {
  234. // this.$message.success("操作成功");
  235. // console.log(this.addrulst);
  236. // });
  237. // }
  238. // }
  239. // console.log(this.addrulst);
  240. // // console.log(this.personnelUnit.form.id);
  241. // if (this.addrulst[customerOrgGroupId] == undefined) {
  242. // this.$message.warning("请先选择单位分组");
  243. // } else {
  244. // postapi("/api/app/customer-org-group-detail/many", this.addrulst).then(
  245. // (res) => {
  246. // console.log(this.personnelUnit.form.id);
  247. // this.$message.success("操作成功");
  248. // }
  249. // );
  250. // }
  251. },
  252. //移除按钮
  253. addselecteditems() {
  254. console.log(this.personnelUnit.id);
  255. if (this.personnelUnit.form.id == "") {
  256. alert("请先选择单位类别");
  257. } else {
  258. // 让按钮恢复禁用
  259. this.saveornot = false;
  260. //personnelUnit.nogroupselected
  261. if (this.rightselctedata.length == 0) {
  262. this.$message.warning("已选数据为空无法移动");
  263. } else {
  264. // this.title = 2;
  265. let count = this.rightselctedata.length - 1;
  266. for (var i = count; i >= 0; i--) {
  267. [...new Set(this.rightselctedata)];
  268. this.tabledata.push(this.rightselctedata[i]);
  269. this.personnelUnit.nogroupselected.splice(i, 1);
  270. }
  271. console.log(this.personnelUnit.customerOrgGroupId);
  272. // this.
  273. this.rightselctedata.forEach((item) => {
  274. this.addrulst.push({
  275. asbitemId: item.id,
  276. price: item.price,
  277. // price: this.price,
  278. customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
  279. });
  280. });
  281. }
  282. }
  283. },
  284. //右侧勾选按钮
  285. selecteditems(val) {
  286. this.rightselctedata = val;
  287. // this.personnelUnit.nogroupselected = val;
  288. console.log(this.rightselctedata);
  289. },
  290. // 添加按钮
  291. removedata() {
  292. if (this.personnelUnit.form.id == "") {
  293. alert("请先选择单位分组");
  294. } else {
  295. if (this.unselecteddata.length == 0) {
  296. this.$message.warning("未选数据为空无法移动");
  297. } else {
  298. this.saveornot = false;
  299. let count = this.unselecteddata.length - 1;
  300. for (var i = count; i >= 0; i--) {
  301. // this.tabledata.splice(i, 1);
  302. if ([...new Set(this.unselecteddata)]) {
  303. // this.unselecteddata.push(this.unselecteddata[i]);
  304. this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
  305. this.tabledata.splice(this.tabledata[i], 1);
  306. }
  307. // this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
  308. }
  309. console.log(this.personnelUnit.customerOrgGroupId);
  310. this.unselecteddata.forEach((item) => {
  311. // var price = "";
  312. // if (this.price == "") {
  313. // price = item.price;
  314. // } else {
  315. // price = this.price;
  316. // }
  317. //获取最新价格
  318. });
  319. // let prices = "";
  320. this.personnelUnit.nogroupselected.forEach((items) => {
  321. // prices = items.price;
  322. // this.price = item.price;
  323. // console.log(items, "items");
  324. this.addrulst.push({
  325. asbitemId: items.id, // "3a0b2f0c-f884-bec4-a350-79b46b455a2d"
  326. price: items.price,
  327. // price: this.price == "" ? items.price : this.price,
  328. customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
  329. });
  330. });
  331. console.log(this.addrulst, "hhhhhhh");
  332. }
  333. }
  334. },
  335. // 左侧未选
  336. handleSelectionChange(val) {
  337. // this.selecteddata = val;
  338. this.unselecteddata = val;
  339. console.log(this.unselecteddata);
  340. },
  341. //获取所有组合项目
  342. getportfolioitems() {
  343. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  344. this.tabledata = res.data.items;
  345. });
  346. },
  347. //项目类别选择
  348. getprojectgroups(v) {
  349. if (v !== "") {
  350. getapi(`/api/app/asbitem/in-item-type/${v}`).then((res) => {
  351. console.log(res);
  352. this.tabledata = res.data;
  353. });
  354. } else {
  355. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  356. this.tabledata = res.data.items;
  357. });
  358. }
  359. },
  360. //复制分组弹框
  361. copygroup() {
  362. if (this.personnelUnit.form == "") {
  363. this.$message.warning("请选择分组");
  364. } else {
  365. this.copyGroupdialogVisible = true;
  366. getapi(
  367. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.form.id}`
  368. ).then((res) => {
  369. console.log(res);
  370. this.personnelUnit.form = res.data;
  371. });
  372. }
  373. },
  374. //复制套餐
  375. packagerepicion() {
  376. this.dialogVisible = true;
  377. getapi("/api/app/medical-package").then((res) => {
  378. this.packagelist = res.data.items;
  379. console.log(res);
  380. });
  381. },
  382. //
  383. getitemtype() {
  384. getapi("/api/app/item-type/by-code-all").then((res) => {
  385. this.options = res.data;
  386. });
  387. },
  388. //获取当前列列表数据
  389. listeninglist(customerOrgGroupId) {
  390. getapi(`/api/app/customer-org-group/${customerOrgGroupId}`).then(
  391. (res) => {
  392. this.personnelUnit.form = res.data;
  393. console.log(res);
  394. }
  395. );
  396. getapi(
  397. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`
  398. ).then((res) => {
  399. console.log(
  400. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`,
  401. res
  402. );
  403. this.personnelUnit.nogroupselected = res.data;
  404. });
  405. },
  406. // getapi(`/api/app/customer-org-group/${row.id}`).then((res)
  407. },
  408. //监听事件
  409. watch: {
  410. //
  411. "personnelUnit.customerOrgGroupId"(newVal, oldVal) {
  412. console.log(
  413. "watch patientRegister.addTimes newVal:",
  414. newVal,
  415. " oldVal:",
  416. oldVal
  417. );
  418. if (newVal != oldVal) {
  419. this.listeninglist(newVal);
  420. //
  421. }
  422. },
  423. },
  424. };
  425. </script>
  426. <style scoped>
  427. .operatebottom {
  428. margin-left: 5%;
  429. }
  430. .mainarearightbox {
  431. width: 35%;
  432. border: 1px solid #000;
  433. height: 300px;
  434. margin-left: 7%;
  435. overflow: auto;
  436. }
  437. .mainbutton {
  438. margin-left: 5%;
  439. padding: 5px 10px;
  440. margin-top: 5%;
  441. }
  442. .mainarea {
  443. display: flex;
  444. margin-top: 20px;
  445. }
  446. .mainarealeftbox {
  447. width: 20%;
  448. border: 1px solid #000;
  449. height: 300px;
  450. overflow: hidden;
  451. overflow: auto;
  452. margin-left: 7%;
  453. }
  454. .examinationcategory {
  455. margin-top: 30px;
  456. }
  457. </style>