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.

376 lines
11 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
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
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
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
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
  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"></el-table-column>
  73. </el-table>
  74. </div>
  75. <div class="operatebottom">
  76. <div>
  77. <el-button type="primary" @click="packagerepicion"
  78. >复制套餐</el-button
  79. >
  80. </div>
  81. <div style="margin-top: 10px">
  82. <el-button type="primary" @click="copygroup">复制分组</el-button>
  83. </div>
  84. </div>
  85. </div>
  86. <!-- 复制套餐弹框 -->
  87. <el-dialog title="编辑" :visible.sync="dialogVisible" width="60%">
  88. <el-table :data="packagelist">
  89. <el-table-column label="编号" prop="id"></el-table-column>
  90. <el-table-column label="名称" prop="displayName"></el-table-column>
  91. <el-table-column label="创建者" prop="creatorName"></el-table-column>
  92. <el-table-column label="创建时间" prop="creatorName">
  93. <template slot-scope="scope">
  94. {{ scope.row.creationTime | dateFormat }}
  95. </template>
  96. </el-table-column>
  97. <el-table-column
  98. label="修改者"
  99. prop="lastModifierName"
  100. ></el-table-column>
  101. <el-table-column label="修改时间" prop="lastModificationTime">
  102. <template slot-scope="scope">
  103. {{ scope.row.lastModificationTime | dateFormat }}
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. <span slot="footer" class="dialog-footer">
  108. <el-button @click="dialogVisible = false"> </el-button>
  109. <el-button type="primary" @click="dialogVisible = false"
  110. > </el-button
  111. >
  112. </span>
  113. </el-dialog>
  114. <!-- 复制分组 弹框-->
  115. <el-dialog
  116. title="复制分组"
  117. :visible.sync="copyGroupdialogVisible"
  118. width="50%"
  119. >
  120. <el-table>
  121. <el-table-column label="编号"></el-table-column>
  122. <el-table-column label="创建者"></el-table-column>
  123. <el-table-column label="创建时间"></el-table-column>
  124. <el-table-column label="修改者"></el-table-column>
  125. <el-table-column label="修改时间"></el-table-column>
  126. </el-table>
  127. <span slot="footer" class="dialog-footer">
  128. <el-button @click="copyGroupdialogVisible = false"> </el-button>
  129. <el-button type="primary" @click="copyGroupdialogVisible = false"
  130. > </el-button
  131. >
  132. </span>
  133. </el-dialog>
  134. <!-- -->
  135. </div>
  136. </template>
  137. <script>
  138. import { getapi, postapi } from "@/api/api";
  139. import { mapState } from "vuex";
  140. export default {
  141. data() {
  142. return {
  143. saveornot: true, //保存按钮
  144. selecteddata: [], //已选数据
  145. unselecteddata: [], //未选数据
  146. unselecteddata: [], //右边勾选中
  147. rightselctedata: [], //右侧已选
  148. options: [],
  149. value: "",
  150. dialogVisible: false,
  151. copyGroupdialogVisible: false,
  152. packagelist: [],
  153. tabledata: [],
  154. temporaryselection: [], //已选组合项目table
  155. copegroupdata: [], //复制分组
  156. addrulst: [], //添加保存的Id
  157. };
  158. },
  159. computed: {
  160. ...mapState(["personnelUnit"]),
  161. },
  162. created() {
  163. this.getitemtype();
  164. this.getportfolioitems();
  165. },
  166. methods: {
  167. //保存按钮
  168. Onsubmit() {
  169. if (!this.personnelUnit.customerOrgGroupId) {
  170. alert("请先选择单位分组");
  171. return;
  172. } else {
  173. postapi("/api/app/customer-org-group-detail/many", this.addrulst).then(
  174. (res) => {
  175. this.$message.success("操作成功");
  176. console.log(this.addrulst);
  177. }
  178. );
  179. }
  180. // console.log(this.addrulst);
  181. // // console.log(this.personnelUnit.form.id);
  182. // if (this.addrulst[customerOrgGroupId] == undefined) {
  183. // this.$message.warning("请先选择单位分组");
  184. // } else {
  185. // postapi("/api/app/customer-org-group-detail/many", this.addrulst).then(
  186. // (res) => {
  187. // console.log(this.personnelUnit.form.id);
  188. // this.$message.success("操作成功");
  189. // }
  190. // );
  191. // }
  192. },
  193. //移除按钮
  194. addselecteditems() {
  195. //personnelUnit.nogroupselected
  196. if (this.rightselctedata.length == 0) {
  197. this.$message.warning("已选数据为空无法移动");
  198. } else {
  199. let count = this.rightselctedata.length - 1;
  200. for (var i = count; i >= 0; i--) {
  201. // this.personnelUnit.nogroupselected.splice(i, 1);
  202. if (
  203. // !this.rightselctedata.includes(this.rightselctedata[i].displayName)
  204. [...new Set(this.rightselctedata)]
  205. ) {
  206. this.tabledata.push(this.rightselctedata[i]);
  207. this.personnelUnit.nogroupselected.splice(i, 1);
  208. }
  209. // this.tabledata.push(this.rightselctedata[i]);
  210. }
  211. // this.
  212. this.rightselctedata.forEach((item) => {
  213. this.addrulst.push({
  214. asbitemId: item.id,
  215. price: item.price,
  216. customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
  217. });
  218. });
  219. }
  220. },
  221. //右侧勾选按钮
  222. selecteditems(val) {
  223. this.rightselctedata = val;
  224. // this.personnelUnit.nogroupselected = val;
  225. console.log(this.rightselctedata);
  226. },
  227. // 添加按钮
  228. removedata() {
  229. if (this.unselecteddata.length == 0) {
  230. this.$message.warning("未选数据为空无法移动");
  231. } else {
  232. this.saveornot = false;
  233. let count = this.unselecteddata.length - 1;
  234. for (var i = count; i >= 0; i--) {
  235. // this.tabledata.splice(i, 1);
  236. // this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
  237. if ([...new Set(this.unselecteddata)]) {
  238. this.tabledata.splice(i, 1);
  239. this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
  240. }
  241. }
  242. this.unselecteddata.forEach((item) => {
  243. this.addrulst.push({
  244. asbitemId: item.id,
  245. price: item.price,
  246. customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
  247. });
  248. });
  249. console.log(this.addrulst, "hhhhhhh");
  250. // this.selecteddata = this.unselecteddata;
  251. // 复制
  252. // let count = this.unselecteddata.length - 1;
  253. // for (var i = count; i >= 0; i--) {
  254. // this.tabledata.splice(i, 1);
  255. // this.selecteddata.push(this.unselecteddata[i]);
  256. // }
  257. }
  258. },
  259. // 左侧未选
  260. handleSelectionChange(val) {
  261. // this.selecteddata = val;
  262. this.unselecteddata = val;
  263. console.log(this.unselecteddata);
  264. },
  265. //获取所有组合项目
  266. getportfolioitems() {
  267. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  268. this.tabledata = res.data.items;
  269. });
  270. },
  271. //项目类别选择
  272. getprojectgroups(v) {
  273. if (v !== "") {
  274. getapi(`/api/app/asbitem/in-item-type/${v}`).then((res) => {
  275. console.log(res);
  276. this.tabledata = res.data;
  277. });
  278. } else {
  279. getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
  280. this.tabledata = res.data.items;
  281. });
  282. }
  283. },
  284. //复制分组弹框
  285. copygroup() {
  286. if (this.personnelUnit.form == "") {
  287. this.$message.warning("请选择分组");
  288. } else {
  289. this.copyGroupdialogVisible = true;
  290. getapi(
  291. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.form.id}`
  292. ).then((res) => {
  293. console.log(res);
  294. this.personnelUnit.form = res.data;
  295. });
  296. }
  297. },
  298. //复制套餐
  299. packagerepicion() {
  300. this.dialogVisible = true;
  301. getapi("/api/app/medical-package").then((res) => {
  302. this.packagelist = res.data.items;
  303. console.log(res);
  304. });
  305. },
  306. //
  307. getitemtype() {
  308. getapi("/api/app/item-type/by-code-all").then((res) => {
  309. this.options = res.data;
  310. });
  311. },
  312. //获取当前列列表数据
  313. listeninglist() {
  314. getapi(
  315. `/api/app/customer-org-group/${this.personnelUnit.customerOrgGroupId}`
  316. ).then((res) => {
  317. this.personnelUnit.form = res.data;
  318. console.log(res);
  319. });
  320. getapi(
  321. `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.form.id}`
  322. ).then((res) => {
  323. console.log(res);
  324. this.personnelUnit.nogroupselected = res.data;
  325. });
  326. },
  327. // getapi(`/api/app/customer-org-group/${row.id}`).then((res)
  328. },
  329. //监听事件
  330. watch: {
  331. //
  332. "personnelUnit.customerOrgGroupId"(newVal, oldVal) {
  333. //console.log('patientRegister.addTimes newVal:',newVal,' oldVal:',oldVal)
  334. if (newVal != oldVal) {
  335. console.log("newVal", newVal);
  336. this.listeninglist();
  337. //
  338. }
  339. },
  340. },
  341. };
  342. </script>
  343. <style scoped>
  344. .operatebottom {
  345. margin-left: 5%;
  346. }
  347. .mainarearightbox {
  348. width: 30%;
  349. border: 1px solid #000;
  350. height: 300px;
  351. margin-left: 7%;
  352. }
  353. .mainbutton {
  354. margin-left: 5%;
  355. padding: 5px 10px;
  356. margin-top: 5%;
  357. }
  358. .mainarea {
  359. display: flex;
  360. margin-top: 20px;
  361. }
  362. .mainarealeftbox {
  363. width: 20%;
  364. border: 1px solid #000;
  365. height: 300px;
  366. margin-left: 7%;
  367. }
  368. .examinationcategory {
  369. margin-top: 30px;
  370. }
  371. </style>