medicalWasteSignOut.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. <view class="Scanning_top_icon">
  5. 医废出库
  6. </view>
  7. <view class="Scanning_top_text">
  8. 请确认填写以下医废信息,进行核对
  9. </view>
  10. </view>
  11. <scroll-view scroll-y class="Scanning_cont">
  12. <view class="Scanning_cont_list">
  13. <view class="Scanning_cont_list_head">
  14. <view class="Scanning_cont_list_title">运输内容</view>
  15. </view>
  16. <view class="Scanning_cont_list_body1">
  17. <view class="Scanning_cont_list_body1_item" v-for="item in wastList" :key="item.id">
  18. <view class="column1">{{item.name}}</view>
  19. <view class="column2">{{item.wasteWeight}}kg</view>
  20. <view class="column3">{{item.wasteCount}}袋</view>
  21. </view>
  22. <view class="Scanning_cont_list_body1_item">
  23. <view class="column1">总计</view>
  24. <view class="column2">{{wasteWeightTotal}}kg</view>
  25. <view class="column3">{{wasteCountTotal}}袋</view>
  26. </view>
  27. <view class="Scanning_cont_list_body1_item" v-for="(item, index) in storageUnits" :key="index">
  28. <view class="Scanning_cont_list_title">
  29. {{item}}装数量:
  30. </view>
  31. <view class="Scanning_cont_list_desc" v-if="item == '箱'">
  32. <input class="numInput" type="digit" v-model="totalBox" @blur="blurItem(item)" />{{item}}
  33. </view>
  34. <view class="Scanning_cont_list_desc" v-else-if="item == '桶'">
  35. <input class="numInput" type="digit" v-model="totalBucket" @blur="blurItem(item)" />{{item}}
  36. </view>
  37. </view>
  38. <view class="Scanning_cont_list_body1_item">
  39. <view class="Scanning_cont_list_title">
  40. 凭证编号:
  41. </view>
  42. <view class="Scanning_cont_list_desc">
  43. <input class="textInput" v-model="credentialsNumber" placeholder="请输入凭证编号" />
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="Scanning_cont_list">
  49. <view class="Scanning_cont_list_head">
  50. <view class="Scanning_cont_list_title">运输信息</view>
  51. </view>
  52. <view class="Scanning_cont_list_body2">
  53. <view class="Scanning_cont_list_body2_item">
  54. <view class="Scanning_cont_list_title">
  55. 运输单位:
  56. </view>
  57. <view class="Scanning_cont_list_desc">
  58. <picker @change="bindTransCompany" :value="transCompanyIndex" :range="transCompanyList" range-key="name">
  59. <view class="typeInput">{{transCompanyList[transCompanyIndex] ? transCompanyList[transCompanyIndex].name : ''}}</view>
  60. <text class="newicon newicon-xiala1"></text>
  61. </picker>
  62. </view>
  63. </view>
  64. <view class="Scanning_cont_list_body2_item">
  65. <view class="Scanning_cont_list_title">
  66. 联系电话:
  67. </view>
  68. <view class="Scanning_cont_list_desc">
  69. {{mphone}}
  70. </view>
  71. </view>
  72. <view class="Scanning_cont_list_body2_item">
  73. <view class="Scanning_cont_list_title">
  74. 运营证件号:
  75. </view>
  76. <view class="Scanning_cont_list_desc">
  77. {{businessCode}}
  78. </view>
  79. </view>
  80. <view class="Scanning_cont_list_body2_item" v-if="address">
  81. <view class="Scanning_cont_list_title">
  82. 单位地址:
  83. </view>
  84. <view class="Scanning_cont_list_desc">
  85. {{address}}
  86. </view>
  87. </view>
  88. <view class="Scanning_cont_list_body2_item">
  89. <view class="Scanning_cont_list_title">
  90. 司机信息:
  91. </view>
  92. <view class="Scanning_cont_list_desc">
  93. <picker @change="bindLaborer" :value="laborerIndex" :range="laborerList" range-key="name">
  94. <view class="typeInput">{{laborerList[laborerIndex] ? laborerList[laborerIndex].name : ''}}</view>
  95. <text class="newicon newicon-xiala1"></text>
  96. </picker>
  97. </view>
  98. </view>
  99. <view class="Scanning_cont_list_body2_item">
  100. <view class="Scanning_cont_list_title">
  101. 联系电话:
  102. </view>
  103. <view class="Scanning_cont_list_desc">
  104. {{laborerList[laborerIndex].mphone}}
  105. </view>
  106. </view>
  107. <view class="Scanning_cont_list_body2_item">
  108. <view class="Scanning_cont_list_title">
  109. 车牌号码:
  110. </view>
  111. <view class="Scanning_cont_list_desc">
  112. <picker @change="bindCarNo" :value="carNoIndex" :range="carNoList" range-key="name">
  113. <view class="typeInput">{{carNoList[carNoIndex] ? carNoList[carNoIndex].name : ''}}</view>
  114. <text class="newicon newicon-xiala1"></text>
  115. </picker>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="Scanning_cont_list">
  121. <view class="Scanning_cont_list_head">
  122. <view class="Scanning_cont_list_title">接收单位</view>
  123. </view>
  124. <view class="Scanning_cont_list_body2">
  125. <view class="Scanning_cont_list_body2_item">
  126. <view class="Scanning_cont_list_title">
  127. 接收公司:
  128. </view>
  129. <view class="Scanning_cont_list_desc">
  130. <picker @change="bindReceiveCompany" :value="receiveCompanyIndex" :range="receiveCompanyList" range-key="name">
  131. <view class="typeInput">{{receiveCompanyList[receiveCompanyIndex] ? receiveCompanyList[receiveCompanyIndex].name : ''}}</view>
  132. <text class="newicon newicon-xiala1"></text>
  133. </picker>
  134. </view>
  135. </view>
  136. <view class="Scanning_cont_list_body2_item">
  137. <view class="Scanning_cont_list_title">
  138. 许可证编号:
  139. </view>
  140. <view class="Scanning_cont_list_desc">
  141. {{businessCode2}}
  142. </view>
  143. </view>
  144. <view class="Scanning_cont_list_body2_item" v-if="address2">
  145. <view class="Scanning_cont_list_title">
  146. 单位地址:
  147. </view>
  148. <view class="Scanning_cont_list_desc">
  149. {{address2}}
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. </scroll-view>
  155. <view class="foot_btn">
  156. <view class="btn" @click="goBack()"> 取消 </view>
  157. <view class="btn" @click="submitOk()"> 确定 </view>
  158. </view>
  159. <!-- 弹窗 -->
  160. <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content"
  161. @ok="ok1" @cancel="cancel1" :operate="models1.operate"></showModel>
  162. </view>
  163. </template>
  164. <script>
  165. import {
  166. get,
  167. post,
  168. SM,
  169. webHandle
  170. } from "../../../http/http.js";
  171. import Big from 'big.js';
  172. export default {
  173. data() {
  174. return {
  175. laborerIndex: 0,
  176. laborerList: [{id: 0, name: '请选择司机信息'}],
  177. carNoIndex: 0,
  178. carNoList: [{id: 0, name: '请选择车牌号码'}],
  179. mphone: '',
  180. businessCode: '',
  181. businessCode2: '',
  182. address: '',
  183. address2: '',
  184. transCompanyIndex: 0,
  185. transCompanyList: [],
  186. receiveCompanyIndex: 0,
  187. receiveCompanyList: [],
  188. credentialsNumber: '',
  189. totalBox: 0,//箱
  190. totalBucket: 0,//桶
  191. wasteWeightTotal: 0,
  192. wasteCountTotal: 0,
  193. storageUnits: [],
  194. wastList: [],
  195. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  196. queryObj: {}, //路由传递过来的数据
  197. // 弹窗model
  198. models1: {
  199. disjunctor: false,
  200. },
  201. };
  202. },
  203. methods: {
  204. submitOk(){
  205. if(this.transCompanyIndex == 0){
  206. uni.showModal({
  207. title: "提示",
  208. content: "请选择运输单位!",
  209. showCancel: false,
  210. success: function(res) {
  211. if (res.confirm) {
  212. console.log("用户点击确定");
  213. } else if (res.cancel) {
  214. console.log("用户点击取消");
  215. }
  216. },
  217. });
  218. return;
  219. }
  220. if(this.laborerIndex == 0){
  221. uni.showModal({
  222. title: "提示",
  223. content: "请选择司机信息!",
  224. showCancel: false,
  225. success: function(res) {
  226. if (res.confirm) {
  227. console.log("用户点击确定");
  228. } else if (res.cancel) {
  229. console.log("用户点击取消");
  230. }
  231. },
  232. });
  233. return;
  234. }
  235. if(this.carNoIndex == 0){
  236. uni.showModal({
  237. title: "提示",
  238. content: "请选择车牌号码!",
  239. showCancel: false,
  240. success: function(res) {
  241. if (res.confirm) {
  242. console.log("用户点击确定");
  243. } else if (res.cancel) {
  244. console.log("用户点击取消");
  245. }
  246. },
  247. });
  248. return;
  249. }
  250. if(this.receiveCompanyIndex == 0){
  251. uni.showModal({
  252. title: "提示",
  253. content: "请选择接收单位!",
  254. showCancel: false,
  255. success: function(res) {
  256. if (res.confirm) {
  257. console.log("用户点击确定");
  258. } else if (res.cancel) {
  259. console.log("用户点击取消");
  260. }
  261. },
  262. });
  263. return;
  264. }
  265. if(!this.wasteCountTotal){
  266. uni.showModal({
  267. title: "提示",
  268. content: "选择的类型,无医废数据请确认后发起出库!",
  269. showCancel: false,
  270. success: function(res) {
  271. if (res.confirm) {
  272. console.log("用户点击确定");
  273. } else if (res.cancel) {
  274. console.log("用户点击取消");
  275. }
  276. },
  277. });
  278. return;
  279. }
  280. this.showModel1()
  281. },
  282. goBack(){
  283. uni.navigateBack();
  284. },
  285. //确定
  286. ok1() {
  287. this.models1.disjunctor = false;
  288. uni.showLoading({
  289. title: "加载中",
  290. mask: true,
  291. });
  292. post("/medicalWaste/complete", {
  293. clinicalWasteTypeIds: this.queryObj.clinicalWasteTypeIds,
  294. wasteOutInfo:{
  295. credentialsNumber: this.credentialsNumber,
  296. totalBox: +this.totalBox,
  297. totalBucket: +this.totalBucket,
  298. transportCompany: this.transCompanyList[this.transCompanyIndex],
  299. receptionCompany: this.receiveCompanyList[this.receiveCompanyIndex],
  300. hosId: this.hosId,
  301. driver: this.laborerList[this.laborerIndex],
  302. carNo: this.carNoList[this.carNoIndex].name,
  303. }
  304. }).then((res) => {
  305. uni.hideLoading();
  306. if (res.status == 200) {
  307. uni.showModal({
  308. title: "提示",
  309. content: "操作成功",
  310. showCancel: false,
  311. success: (result) => {
  312. if (result.confirm) {
  313. console.log("用户点击确定");
  314. uni.navigateTo({
  315. url: `/pages/receiptpage/receiptpage`,
  316. });
  317. }
  318. },
  319. });
  320. }else{
  321. uni.showToast({
  322. icon: "none",
  323. title: res.msg || "接口获取数据失败!",
  324. });
  325. }
  326. });
  327. },
  328. //取消
  329. cancel1() {
  330. this.models1.disjunctor = false;
  331. },
  332. // 被服回收弹窗
  333. showModel1() {
  334. this.models1 = {
  335. disjunctor: true,
  336. title: "提示",
  337. content: `您确认要出库吗?`,
  338. icon: "warn",
  339. operate: {
  340. ok: "确定",
  341. cancel: "取消",
  342. },
  343. };
  344. },
  345. getCompanyTransType(){
  346. post("/common/common/getDictionary", {
  347. key: 'company_trans_type',
  348. type: 'list',
  349. }).then((result) => {
  350. let company_trans_types = result || [];
  351. let transCompany = company_trans_types.find(v => v.value == 1);//运输单位
  352. let receiveCompany = company_trans_types.find(v => v.value == 2);//接收单位
  353. transCompany && this.getCompany(transCompany);
  354. receiveCompany && this.getCompany(receiveCompany);
  355. });
  356. },
  357. getCompany(dictionary){
  358. post("/simple/data/fetchDataList/company", {
  359. idx: 0,
  360. sum: 9999,
  361. company: {
  362. hosId: this.hosId,
  363. transType: dictionary,
  364. busiType: { key: 'company_busi_type', value: '1' },
  365. }
  366. }).then((result) => {
  367. if (result.status == 200) {
  368. if(dictionary.value == 1){
  369. // 运输单位
  370. let transCompanyList = result.list || [];
  371. transCompanyList.unshift({id: 0, name: '请选择运输单位'});
  372. this.transCompanyList = transCompanyList;
  373. } else if(dictionary.value == 2){
  374. // 接收单位
  375. let receiveCompanyList = result.list || [];
  376. receiveCompanyList.unshift({id: 0, name: '请选择接收单位'});
  377. this.receiveCompanyList = receiveCompanyList;
  378. }
  379. } else {
  380. uni.showToast({
  381. icon: "none",
  382. title: result.msg || "接口获取数据失败!",
  383. });
  384. }
  385. });
  386. },
  387. blurItem(type){
  388. if(type == '桶'){
  389. this.totalBucket = Math.abs(this.totalBucket).toFixed(0);
  390. }else if(type == '箱'){
  391. this.totalBox = Math.abs(this.totalBox).toFixed(0);
  392. }
  393. },
  394. bindTransCompany: function(e) {
  395. console.log('picker发送选择改变,携带值为', e.detail.value)
  396. this.transCompanyIndex = e.detail.value;
  397. let transCompany = this.transCompanyList[this.transCompanyIndex];
  398. let laborerList = transCompany.laborers || [];
  399. laborerList.unshift({id: 0, name: '请选择司机信息'});
  400. this.laborerList = laborerList;
  401. this.laborerIndex = 0;
  402. let carNoList = transCompany.carNo ? transCompany.carNo.split(',').map((v, index) => ({id: index + 1, name: v})) : [];
  403. carNoList.unshift({id: 0, name: '请选择车牌号码'});
  404. this.carNoList = carNoList;
  405. this.carNoIndex = 0;
  406. this.mphone = transCompany.mphone;
  407. this.businessCode = transCompany.businessCode;
  408. this.address = transCompany.address;
  409. },
  410. bindReceiveCompany: function(e) {
  411. console.log('picker发送选择改变,携带值为', e.detail.value)
  412. this.receiveCompanyIndex = e.detail.value;
  413. let receiveCompany = this.receiveCompanyList[this.receiveCompanyIndex];
  414. this.businessCode2 = receiveCompany.businessCode;
  415. this.address2 = receiveCompany.address;
  416. },
  417. bindLaborer: function(e) {
  418. console.log('picker发送选择改变,携带值为', e.detail.value)
  419. this.laborerIndex = e.detail.value;
  420. },
  421. bindCarNo: function(e) {
  422. console.log('picker发送选择改变,携带值为', e.detail.value)
  423. this.carNoIndex = e.detail.value;
  424. },
  425. getInfo(){
  426. uni.showLoading({
  427. title: "加载中",
  428. mask: true,
  429. });
  430. post("/medicalWaste/info", {
  431. hosId: this.hosId,
  432. clinicalWasteTypeIds: this.queryObj.clinicalWasteTypeIds,
  433. }).then((result) => {
  434. uni.hideLoading();
  435. if (result.status == 200) {
  436. this.wastList = result.data || [];
  437. this.storageUnits = result.storageUnits || [];
  438. this.wasteWeightTotal = this.wastList.reduce((pre,cur) => Big(pre).plus(cur.wasteWeight), 0);
  439. this.wasteCountTotal = this.wastList.reduce((pre,cur) => Big(pre).plus(cur.wasteCount), 0);
  440. } else {
  441. uni.showToast({
  442. icon: "none",
  443. title: result.msg || "接口获取数据失败!",
  444. });
  445. }
  446. });
  447. },
  448. },
  449. onLoad(options) {
  450. console.log(options, "result");
  451. this.queryObj = options;
  452. this.getCompanyTransType();
  453. this.getInfo();
  454. // #ifdef APP-PLUS
  455. webHandle("no", "app");
  456. // #endif
  457. // #ifdef H5
  458. webHandle("no", "wx");
  459. // #endif
  460. },
  461. };
  462. </script>
  463. <style lang="less" scoped>
  464. .Scanning_Result {
  465. height: 100vh;
  466. display: flex;
  467. flex-direction: column;
  468. background-color: #fff;
  469. .typeInput{
  470. font-size: 28rpx;
  471. width: 260rpx;
  472. height: 56rpx;
  473. border: 1rpx solid #D9D9D9;
  474. padding: 8rpx;
  475. padding-right: 50rpx;
  476. box-sizing: border-box;
  477. line-height: 38rpx;
  478. text-overflow: ellipsis;
  479. overflow: hidden;
  480. white-space: nowrap;
  481. }
  482. .numInput{
  483. width: 110rpx;
  484. height: 56rpx;
  485. border: 1rpx solid #D9D9D9;
  486. margin-right: 12rpx;
  487. padding: 8rpx;
  488. font-size: 28rpx;
  489. box-sizing: border-box;
  490. }
  491. .textInput{
  492. width: 260rpx;
  493. height: 56rpx;
  494. border: 1rpx solid #D9D9D9;
  495. padding: 8rpx;
  496. font-size: 28rpx;
  497. box-sizing: border-box;
  498. }
  499. .Scanning_top {
  500. flex-shrink: 0;
  501. .Scanning_top_icon {
  502. padding-top: 26rpx;
  503. display: flex;
  504. flex-direction: column;
  505. justify-content: center;
  506. align-items: center;
  507. font-size: 40rpx;
  508. font-weight: bold;
  509. .cubeic-ok {
  510. font-size: 100rpx;
  511. color: #35b34a;
  512. }
  513. .text1 {
  514. font-size: 28rpx;
  515. font-weight: bold;
  516. }
  517. }
  518. .Scanning_top_text{
  519. text-align: center;
  520. font-size: 34rpx;
  521. font-weight: bold;
  522. padding: 26rpx 0 38rpx 0;
  523. }
  524. }
  525. .Scanning_cont {
  526. flex: 1;
  527. min-height: 0;
  528. display: flex;
  529. flex-direction: column;
  530. width: 710rpx;
  531. margin: 0 20rpx;
  532. padding: 6rpx;
  533. background-color: #FBFCFE;
  534. box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(0,0,0,0.16);
  535. font-size: 28rpx;
  536. line-height: 1;
  537. .Scanning_cont_list{
  538. padding: 20rpx;
  539. border-bottom: 1rpx solid #D9D9D9;
  540. &:last-of-type{
  541. border-bottom: none;
  542. }
  543. .Scanning_cont_list_head{
  544. display: flex;
  545. align-items: center;
  546. .Scanning_cont_list_title{
  547. position: relative;
  548. font-size: 30rpx;
  549. font-weight: bold;
  550. &::after{
  551. content: '';
  552. position: absolute;
  553. top: 35rpx;
  554. left: 50%;
  555. transform: translateX(-50%);
  556. width: 70rpx;
  557. height: 10rpx;
  558. background-color: #49B856;
  559. border-radius: 6rpx;
  560. }
  561. }
  562. }
  563. .Scanning_cont_list_body1{
  564. padding: 18rpx;
  565. font-size: 28rpx;
  566. .Scanning_cont_list_body1_item{
  567. height: 56rpx;
  568. display: flex;
  569. justify-content: space-between;
  570. align-items: center;
  571. margin-top: 10rpx;
  572. .column1,.column2,.column3{
  573. flex: 1;
  574. text-align: left;
  575. }
  576. .column1{
  577. flex: 2;
  578. white-space: nowrap;
  579. overflow: hidden;
  580. text-overflow: ellipsis;
  581. }
  582. .column3{
  583. text-align: right;
  584. }
  585. .Scanning_cont_list_desc{
  586. display: flex;
  587. align-items: center;
  588. }
  589. }
  590. }
  591. .Scanning_cont_list_body2{
  592. padding: 18rpx;
  593. font-size: 28rpx;
  594. .Scanning_cont_list_body2_item{
  595. height: 56rpx;
  596. display: flex;
  597. justify-content: space-between;
  598. align-items: center;
  599. margin-top: 10rpx;
  600. .Scanning_cont_list_title{
  601. flex-shrink: 0;
  602. }
  603. .Scanning_cont_list_desc{
  604. text-align: right;
  605. position: relative;
  606. .newicon-xiala1{
  607. position: absolute;
  608. top: 50%;
  609. right: 16rpx;
  610. color:#C3BFBF;
  611. transform: translateY(-50%);
  612. }
  613. }
  614. }
  615. }
  616. }
  617. }
  618. .foot_btn {
  619. margin: 57rpx 20rpx 10rpx;
  620. flex-shrink: 0;
  621. display: flex;
  622. justify-content: center;
  623. .btn {
  624. height: 88rpx;
  625. line-height: 1;
  626. display: flex;
  627. justify-content: center;
  628. align-items: center;
  629. flex: 1;
  630. margin-right: 32rpx;
  631. background-image: linear-gradient(to right, #72c172, #3bb197);
  632. color: #fff;
  633. border-radius: 8rpx;
  634. font-size: 34rpx;
  635. font-weight: bold;
  636. &:last-of-type{
  637. margin-right: 0;
  638. }
  639. }
  640. }
  641. }
  642. </style>