Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

batch_delete.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. <template>
  2. <!--批量删除-->
  3. <div class="main-contain">
  4. <div class="app-container">
  5. <div class="bannar_list">
  6. <div class="banner_left">
  7. <div>
  8. 透析模式:
  9. <el-select
  10. v-model="modeOptions_value"
  11. placeholder="请选择"
  12. @change="getUsername"
  13. >
  14. <el-option
  15. v-for="item in modeOptions"
  16. :key="item.id"
  17. :label="item.name"
  18. :value="item.id"
  19. >
  20. </el-option>
  21. </el-select>
  22. </div>
  23. <div>
  24. 删除类型:
  25. <el-select v-model="new_type" placeholder="请选择" @change="changetype">
  26. <el-option
  27. v-for="item in options"
  28. :key="item.id"
  29. :label="item.name"
  30. :value="item.id"
  31. >
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div v-if="new_type == 1">
  36. 请输入需要删除的药品:
  37. <el-select
  38. filterable
  39. v-model="id"
  40. placeholder="请选择"
  41. @change="getUsername"
  42. >
  43. <el-option
  44. v-for="item in druglist"
  45. :key="item.id"
  46. :label="item.name"
  47. :value="item.id"
  48. >
  49. </el-option>
  50. </el-select>
  51. </div>
  52. <div v-if="new_type == 2">
  53. 请输入需要删除的项目:
  54. <el-select
  55. filterable
  56. v-model="id"
  57. placeholder="请选择"
  58. @change="getUsername"
  59. >
  60. <el-option
  61. v-for="item in projectlist"
  62. :key="item.id"
  63. :label="item.name"
  64. :value="item.id"
  65. >
  66. </el-option>
  67. </el-select>
  68. </div>
  69. </div>
  70. <!-- <button @click="lili">调试</button>-->
  71. <el-button type="primary" @click="save">保存</el-button>
  72. </div>
  73. <el-container>
  74. <div style="width: 211px">
  75. <el-table
  76. border
  77. ref="multipleTable"
  78. :data="tableData"
  79. tooltip-effect="dark"
  80. style="width: 100%"
  81. @selection-change="handleSelectionChange"
  82. @current-change="test"
  83. :row-style="{ color: '#303133' }"
  84. :header-cell-style="{
  85. backgroundColor: 'rgb(245, 247, 250)',
  86. color: '#606266',
  87. }"
  88. >
  89. <el-table-column type="selection" width="55"> </el-table-column>
  90. <el-table-column label="患者姓名" width="155">
  91. <template slot-scope="scope" >{{ scope.row.name }}</template>
  92. </el-table-column>
  93. </el-table>
  94. </div>
  95. <el-tabs type="border-card" v-if="isshow == 1 && list.length > 0">
  96. <el-tab-pane
  97. v-for="(item,index) in list"
  98. :key="index"
  99. :label="'处方'+(index+1)"
  100. :name="index"
  101. >
  102. <el-table
  103. v-if="item.advices.length > 0"
  104. :data="item.advices"
  105. style="width: 100%"
  106. max-height="250"
  107. border
  108. :row-style="{ color: '#303133' }"
  109. :header-cell-style="{
  110. backgroundColor: 'rgb(245, 247, 250)',
  111. color: '#606266',
  112. }"
  113. >
  114. <el-table-column fixed label="药品名称" width="230">
  115. <template slot-scope="scope">
  116. {{scope.row.advice_name}}
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="单次用量" width="200">
  120. <template slot-scope="scope">
  121. {{scope.row.single_dose}}{{scope.row.single_dose_unit}}
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="用法" width="120">
  125. <template slot-scope="scope">
  126. {{scope.row.delivery_way}}
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="频率" width="120">
  130. <template slot-scope="scope">
  131. {{scope.row.execution_frequency}}
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="天数" width="110">
  135. <template slot-scope="scope">
  136. {{scope.row.day}}天
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="总量" width="200">
  140. <template slot-scope="scope">
  141. {{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}
  142. </template>
  143. </el-table-column>
  144. <el-table-column label="单价" width="120">
  145. <template slot-scope="scope">
  146. {{ scope.row.price }}元
  147. </template>
  148. </el-table-column>
  149. <el-table-column label="备注" width="120">
  150. <template slot-scope="scope">
  151. {{ scope.row.remark }}
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="操作" width="120">
  155. <template slot-scope="scope">
  156. <el-button
  157. @click.native.prevent="delects(scope.$index,scope,item)"
  158. type="text"
  159. size="small">
  160. 删除
  161. </el-button>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <el-table
  166. v-if="item.project.length > 0"
  167. :data="item.project"
  168. style="width: 100%"
  169. max-height="250"
  170. border
  171. :row-style="{ color: '#303133' }"
  172. :header-cell-style="{
  173. backgroundColor: 'rgb(245, 247, 250)',
  174. color: '#606266',
  175. }"
  176. >
  177. <el-table-column fixed label="项目名称" width="230">
  178. <template slot-scope="scope">
  179. <div v-if="scope.row.type == 2">{{scope.row.project.project_name}}</div>
  180. <div v-if="scope.row.type == 3">{{scope.row.good_info.good_name}}</div>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="组" width="120">
  184. <template slot-scope="scope">
  185. <div v-if="scope.row.type == 2">{{scope.row.project.translate}}</div>
  186. <div v-if="scope.row.type == 3">{{scope.row.good_info.translate}}</div>
  187. </template>
  188. </el-table-column>
  189. <el-table-column label="单次用量" width="120">
  190. <template slot-scope="scope">
  191. {{scope.row.single_dose}}
  192. {{ scope.row.unit }}
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="用法" width="120">
  196. <template slot-scope="scope">
  197. {{scope.row.delivery_way}}
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="频率" width="120">
  201. <template slot-scope="scope">
  202. {{scope.row.execution_frequency}}
  203. </template>
  204. </el-table-column>
  205. <el-table-column label="天数" width="110">
  206. <template slot-scope="scope">
  207. {{scope.row.day}}天
  208. </template>
  209. </el-table-column>
  210. <el-table-column label="总量" width="100">
  211. <template slot-scope="scope">
  212. {{scope.row.count}}
  213. {{ scope.row.unit }}
  214. </template>
  215. </el-table-column>
  216. <el-table-column label="单价" width="120">
  217. <template slot-scope="scope">
  218. {{scope.row.price}}元
  219. </template>
  220. </el-table-column>
  221. <el-table-column label="备注" width="120">
  222. <template slot-scope="scope">
  223. {{scope.row.remark}}
  224. </template>
  225. </el-table-column>
  226. <el-table-column label="推送频率" width="120">
  227. <template slot-scope="scope">
  228. <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
  229. <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
  230. <div v-if="scope.row.frequency_type == 3">{{scope.row.week_days}}</div>
  231. </template>
  232. </el-table-column>
  233. <el-table-column fixed="right" label="操作" width="102">
  234. <template slot-scope="scope">
  235. <el-button
  236. @click.native.prevent="delects(scope.$index,scope,item)"
  237. type="text"
  238. size="small">
  239. 删除
  240. </el-button>
  241. </template>
  242. </el-table-column>
  243. </el-table>
  244. </el-tab-pane>
  245. </el-tabs>
  246. </el-container>
  247. </div>
  248. </div>
  249. </template>
  250. <script>
  251. import { gethisusertoalive } from "@/api/deposit";
  252. import {
  253. getdrugsinformation,
  254. replacepeoplename,
  255. replaceconfig,
  256. deletedrugsbatch,
  257. batchdeleteitems,
  258. getmodeconfigs,
  259. ptemplateinformation,
  260. deleteone,
  261. } from "@/api/batch/batch";
  262. export default {
  263. data() {
  264. return {
  265. dialogVisible: false,
  266. tableList: [],
  267. editableTabsValue: "1",
  268. modeOptions: {},
  269. tableDatas:[{
  270. id: "",
  271. drug_name: "",
  272. single_dose: "",
  273. single_dose_unit: "",
  274. delivery_way: "",
  275. execution_frequency: "",
  276. day: "",
  277. prescribing_number: "",
  278. prescribing_number_unit: "",
  279. price: "",
  280. remark: "",
  281. },],//药品
  282. project:[ {
  283. id: "",
  284. drug_name: "",
  285. translate:"",
  286. single_dose: "",
  287. unit: "",
  288. delivery_way: "",
  289. execution_frequency: "",
  290. day: "",
  291. prescribing_number: "",
  292. price: "",
  293. remark: "",
  294. frequency_type:1,
  295. day_count:"",
  296. week_days:"",
  297. },],//项目
  298. tabIndex: 2,
  299. modeOptions_value: 1, //透析模式
  300. multipleSelection: [],//选中的患者
  301. tableData:[],
  302. options:[{id:1,name:"药品"},{id:2,name:"项目"}],
  303. options_patient:[{id:1,name:"是"},{id:2,name:"否"}],
  304. options_2:[{id:1,name:"普通门诊"},{id:2,name:"门诊特殊病"}],
  305. new_type:1,//新增类型
  306. druglist:[],//药品列表
  307. projectlist:[],//项目列表
  308. id:"",//药品、项目、耗材
  309. tmplist:[],//临时
  310. unit:[{id:1,name:"g"},{id:2,name:"mg"},{id:3,name:"u"},{id:4,name:"ml"},{id:5,name:"万U"},{id:6,name:"枚"},{id:7,name:"粒"},
  311. {id:8,name:"片"},{id:9,name:"支"},{id:10,name:"μg"},{id:11,name:"iu"},{id:12,name:"包"},{id:13,name:"袋"},{id:14,name:"万"},
  312. {id:15,name:"万iu"},{id:16,name:"丸"},{id:17,name:"盒"},{id:18,name:"瓶"},{id:19,name:"瓶(袋)"},{id:20,name:"次"}],
  313. usage:[],//用法
  314. frequency:[],//频率
  315. frequency_type:"",//周期提醒
  316. day_count:"",//周期提醒天
  317. week_days:[],//周期提醒星期
  318. tabhang:0,//tab的下标
  319. hang:0,//行数
  320. list:[],
  321. isshow:0,//是否显示处方
  322. tmpid:0,
  323. }
  324. },
  325. created() {
  326. // console.log("this.$store.getters.treatment_mode",this.$store.getters.treatment_mode)
  327. for (let key in this.$store.getters.treatment_mode) {
  328. this.modeOptions[key] = this.$store.getters.treatment_mode[key]
  329. }
  330. // console.log("this.modeOptions",this.modeOptions)
  331. this.getdrugconfigs();
  332. this.isshow = 0
  333. this.tmpid = 0;
  334. },
  335. methods: {
  336. save() {
  337. var tmp = this.modeOptions[this.modeOptions_value].name
  338. var tmp2 = ""
  339. if (this.druglist != null){
  340. for(let i = 0;i < this.druglist.length;i++){
  341. if (this.id == this.druglist[i].id){
  342. tmp2 = this.druglist[i].name
  343. }
  344. }
  345. }
  346. if(this.projectlist != null){
  347. for (let j = 0;j < this.projectlist.length;j++){
  348. if (this.id == this.projectlist[j].id){
  349. tmp2 = this.projectlist[j].name
  350. }
  351. }
  352. }
  353. this.$confirm(
  354. "请确定是否删除?",//注:该操作将会把所选患者的"+tmp+"透析模式中的"+tmp2+"进行删除,
  355. "",
  356. {
  357. confirmButtonText: "确 定",
  358. cancelButtonText: "取 消",
  359. type: "warning",
  360. }
  361. ).then(() => {
  362. if (this.multipleSelection.length == 0){
  363. this.$message.error('没有选中有效信息')
  364. return
  365. }
  366. let st = ""
  367. for (let i = 0;i < this.multipleSelection.length;i++){
  368. st = st + this.multipleSelection[i].id + ","
  369. }
  370. console.log("string",st)
  371. let params = {
  372. mode_id:this.modeOptions_value,
  373. patient_id: st,
  374. type:this.new_type,
  375. replaced: this.id,
  376. }
  377. if (this.new_type == 1){
  378. deletedrugsbatch(params).then((res) =>{
  379. if (res.data.state == 1){
  380. this.$message.success('删除成功')
  381. this.getUsername()
  382. }else{
  383. this.$message.error(res.data.msg)
  384. }
  385. })
  386. }else{
  387. batchdeleteitems(params).then((res) =>{
  388. if (res.data.state == 1){
  389. this.$message.success('删除成功')
  390. this.getUsername()
  391. }else{
  392. this.$message.error(res.data.msg)
  393. }
  394. })
  395. }
  396. });
  397. },
  398. test(val){
  399. console.log("val?:",val);
  400. this.tmpid = val.id
  401. var params = {
  402. mode_id:this.modeOptions_value,
  403. patient_id:val.id,
  404. }
  405. ptemplateinformation(params).then((res) =>{
  406. if (res.data.state == 1){
  407. this.list = res.data.data.list
  408. this.isshow = 1
  409. }
  410. })
  411. },
  412. lili() {
  413. console.log("this.list",this.list);
  414. console.log("this.multipleSelection",this.multipleSelection)
  415. // console.log("this.mode",this.modeOptions_value)
  416. // console.log("this.projectlist2",this.projectlist2)
  417. // console.log("patient_value",this.patient_value)
  418. },
  419. delects(hang,sc,item){
  420. this.$confirm('删除后不可恢复,是否确认删除?', '删除', {
  421. confirmButtonText: '确定',
  422. cancelButtonText: '取消',
  423. type: 'warning'
  424. }).then(() => {
  425. var params ={
  426. type:item.type,//1药品2项目
  427. id:sc.row.id,
  428. }
  429. var params2 = {
  430. mode_id:this.modeOptions_value,
  431. patient_id:this.tmpid,
  432. }
  433. deleteone(params).then((res) =>{
  434. if (res.data.state == 1){
  435. this.$message.success('删除成功')
  436. ptemplateinformation(params2).then((res) =>{
  437. if (res.data.state == 1){
  438. this.list = res.data.data.list
  439. this.isshow = 1
  440. }
  441. })
  442. }
  443. })
  444. }).catch(() => {
  445. this.$message({
  446. type: 'info',
  447. message: '已取消删除'
  448. });
  449. });
  450. // console.log("hang",hang)
  451. // console.log("sc",sc)
  452. // console.log("item",item)
  453. },
  454. changetype(){
  455. console.log(">>>>>>>",this.new_type)
  456. this.id = ""
  457. this.tableData = []
  458. },
  459. changeid(item,index){
  460. item.id = item.drug_name
  461. var params = {
  462. id:item.id
  463. }
  464. getdrugsinformation(params).then((res) =>{
  465. if (res.data.state == 1){
  466. console.log("res??",res)
  467. this.tableDatas[0].single_dose = res.data.data.list[0].single_dose;
  468. this.tableDatas[0].single_dose_unit = res.data.data.list[0].single_dose_unit;
  469. this.tableDatas[0].delivery_way = res.data.data.list[0].delivery_way;
  470. this.tableDatas[0].execution_frequency = res.data.data.list[0].execution_frequency;
  471. this.tableDatas[0].day = res.data.data.list[0].drug_day;
  472. this.tableDatas[0].prescribing_number = res.data.data.list[0].prescribing_number;
  473. this.tableDatas[0].prescribing_number_unit = res.data.data.list[0].prescribing_number_unit;
  474. this.tableDatas[0].price = res.data.data.list[0].retail_price;
  475. this.tableDatas[0].remark = res.data.data.list[0].remark;
  476. }
  477. });
  478. },
  479. handleSelectionChange(val) {
  480. this.multipleSelection = val;
  481. },
  482. changeid2(item,index){
  483. item.id = item.drug_name
  484. var params = {
  485. id:item.id
  486. }
  487. getdrugsinformation(params).then((res) =>{
  488. if (res.data.state == 1){
  489. console.log("res??",res)
  490. this.project[0].single_dose = res.data.data.list[0].single_dose;
  491. this.project[0].translate = res.data.data.list[0].translate;
  492. this.project[0].delivery_way = res.data.data.list[0].delivery_way;
  493. this.project[0].execution_frequency = res.data.data.list[0].execution_frequency;
  494. this.project[0].day = res.data.data.list[0].day;
  495. this.project[0].prescribing_number = res.data.data.list[0].prescribing_number;
  496. this.project[0].unit = res.data.data.list[0].unit;
  497. this.project[0].price = res.data.data.list[0].retail_price;
  498. this.project[0].remark = res.data.data.list[0].remark;
  499. }
  500. });
  501. },
  502. //获取配置
  503. getdrugconfigs(){
  504. var params = {}
  505. replaceconfig(params).then((res) =>{
  506. if (res.data.state == 1){
  507. this.druglist = res.data.data.list
  508. this.projectlist = res.data.data.list2
  509. }
  510. })
  511. getmodeconfigs(params).then((res) =>{
  512. if (res.data.state == 1){
  513. this.frequency = res.data.data.efs
  514. this.usage = res.data.data.drugways
  515. }
  516. })
  517. },
  518. getUsername(){
  519. var params = {
  520. id: this.id,
  521. mode: this.modeOptions_value
  522. }
  523. replacepeoplename(params).then((res) =>{
  524. if (res.data.state == 1){
  525. this.tableData = res.data.data.list
  526. }
  527. })
  528. },
  529. handleClose(done) {
  530. this.$confirm('确认关闭?')
  531. .then(_ => {
  532. done();
  533. })
  534. .catch(_ => {});
  535. }
  536. }
  537. }
  538. </script>
  539. <style lang="scss" scoped>
  540. .bannar_list {
  541. margin-bottom: 10px;
  542. display: flex;
  543. justify-content: space-between;
  544. .banner_left {
  545. width: 1000px;
  546. display: flex;
  547. justify-content: space-around;
  548. div {
  549. font-size: 14px;
  550. color: #606266;
  551. white-space: nowrap;
  552. }
  553. }
  554. }
  555. .zone {
  556. // margin-left: 30px;
  557. // text-align: left;
  558. width: 70px;
  559. display: inline-block;
  560. color: #606266;
  561. }
  562. .disinfect {
  563. position: relative;
  564. .newButton {
  565. // position: absolute;
  566. // right: 2%;
  567. // top:4px;
  568. // z-index: 9;
  569. margin-bottom: 10px;
  570. margin-left: 90%;
  571. }
  572. }
  573. .disinfectOne {
  574. position: relative;
  575. .newButtonOne {
  576. position: absolute;
  577. right: 0;
  578. top: -10;
  579. z-index: 18;
  580. }
  581. }
  582. .but {
  583. width: 200px;
  584. height: 50px;
  585. // border: solid 1px red;
  586. margin-left: 77%;
  587. }
  588. .clearn {
  589. width: 460px;
  590. height: 50px;
  591. // border:solid 1px red;
  592. margin-left: 650px;
  593. }
  594. .zClass {
  595. width: 200px;
  596. height: 200px;
  597. // border:solid 1px red;
  598. margin-left: 450px;
  599. margin-top: 200px;
  600. }
  601. .warn {
  602. color: red;
  603. font-size: 14px;
  604. width: 100%;
  605. display: inline-block;
  606. margin-left: 96px;
  607. }
  608. .userbutton {
  609. margin-bottom: 10px;
  610. margin-left: 82%;
  611. }
  612. </style>
  613. <style lang="scss" >
  614. .a {
  615. margin-bottom: 10px;
  616. margin-top: 6px;
  617. }
  618. .b {
  619. .el-button {
  620. margin-left: 90%;
  621. margin-bottom: 10px;
  622. }
  623. }
  624. .stoppage {
  625. .el-form-item__label {
  626. width: 190px;
  627. }
  628. }
  629. .st {
  630. .el-form-item__label {
  631. width: -10px;
  632. }
  633. }
  634. .main {
  635. position: relative;
  636. .newButtonOne {
  637. position: absolute;
  638. right: 0;
  639. z-index: 2;
  640. }
  641. }
  642. .elbutton {
  643. // border: solid 1px red;
  644. height: 50px;
  645. width: 400px;
  646. margin-left: 650px;
  647. }
  648. // .el-form-item__label {
  649. // width: 130px;
  650. // font-size: 14px;
  651. // }
  652. .el-form-item__error {
  653. margin-left: 130px;
  654. }
  655. .el-upload-list__item-name {
  656. color: #606266;
  657. display: block;
  658. margin-right: 40px;
  659. overflow: hidden;
  660. padding-left: 4px;
  661. text-overflow: ellipsis;
  662. transition: color 0.3s;
  663. white-space: nowrap;
  664. }
  665. .el-main {
  666. padding-top: 0px;
  667. }
  668. .newMain {
  669. .el-form-item__label {
  670. width: 104px;
  671. }
  672. }
  673. .newDisinfectOne {
  674. .el-input--prefix .el-input__inner {
  675. padding-left: 15px;
  676. }
  677. }
  678. .stoppage {
  679. .el-form-item__label {
  680. width: 18%;
  681. }
  682. }
  683. .newItem {
  684. .el-form-item__label {
  685. width: 130px;
  686. }
  687. }
  688. .formItem {
  689. .el-form-item__label {
  690. width: 104px;
  691. line-height: 30px;
  692. }
  693. }
  694. .newname {
  695. .el-form-item__label {
  696. width: 60px;
  697. }
  698. }
  699. ::-webkit-scrollbar {
  700. height: 20px;
  701. }
  702. .el-table td .cell {
  703. padding: 0 10px;
  704. }
  705. </style>