index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <template>
  2. <view class="query-wrap">
  3. <view class="inner-item">
  4. <view class="text-title">
  5. <view class="title-circ"> </view>
  6. <span class="title-text">基本信息</span>
  7. </view>
  8. <view v-if="isPending">
  9. <view class="inventory-item">
  10. <view class="shuo-item-name">
  11. <view class="shuo-label">配送订单: </view>
  12. <view class="shuo-unit">{{ acceptDetaData.delvOrdId }}</view>
  13. </view>
  14. </view>
  15. <view class="inventory-item">
  16. <view class="shuo-item">
  17. <view class="shuo-label">配送品种: </view>
  18. <view class="shuo-cont">{{ acceptDetaData.delvDrugSum || "" }}</view>
  19. </view>
  20. <view class="shuo-item">
  21. <view class="shuo-label">配送总数: </view>
  22. <view class="shuo-cont">{{ acceptDetaData.delvCntDetlSum || "" }}</view>
  23. </view>
  24. </view>
  25. <view class="inventory-item">
  26. <view class="shuo-item-name">
  27. <view class="shuo-label">采购订单: </view>
  28. <view class="shuo-unit">{{ acceptDetaData.purcOrdId }}</view>
  29. </view>
  30. </view>
  31. <view class="inventory-item">
  32. <view class="shuo-item">
  33. <view class="shuo-label">采购品种: </view>
  34. <view class="shuo-cont">{{ acceptDetaData.ordDetlCnt || "" }}</view>
  35. </view>
  36. <view class="shuo-item">
  37. <view class="shuo-label">采购总数: </view>
  38. <view class="shuo-cont">{{ acceptDetaData.purcCntDetlSum || "" }}</view>
  39. </view>
  40. </view>
  41. <view class="inventory-item">
  42. <view class="shuo-item-name">
  43. <view class="shuo-label">采购员: </view>
  44. <view class="shuo-cont">{{ acceptDetaData.planDocmker }}</view>
  45. </view>
  46. <view class="shuo-item-name">
  47. <view class="shuo-label">采购方式: </view>
  48. <view class="shuo-cont">{{ acceptDetaData.planWay }}</view>
  49. </view>
  50. </view>
  51. <view class="inventory-item">
  52. <view class="shuo-item-name">
  53. <view class="shuo-label">采购时间: </view>
  54. <view class="shuo-cont">{{ forMatTime(acceptDetaData.ordDocmkDate) }}</view>
  55. </view>
  56. <view class="shuo-item-name">
  57. <view class="shuo-label">配送时间: </view>
  58. <view class="shuo-cont">{{ forMatTime(acceptDetaData.docmkDate) }}</view>
  59. </view>
  60. </view>
  61. <view class="inventory-item">
  62. <view class="shuo-item-name">
  63. <view class="shuo-label">配送企业: </view>
  64. <view class="shuo-cont">{{ acceptDetaData.splerName }}</view>
  65. </view>
  66. </view>
  67. </view>
  68. <view v-else>
  69. <view class="inventory-item">
  70. <view class="shuo-item-name">
  71. <view class="shuo-label"> 验收单号: </view>
  72. <view class="shuo-unit">
  73. {{ acceptDetaData.stoinOrdId }}
  74. </view>
  75. </view>
  76. </view>
  77. <view class="inventory-item">
  78. <view class="shuo-item-name">
  79. <view class="shuo-label"> 配送订单: </view>
  80. <view class="shuo-unit">
  81. {{ acceptDetaData.delvOrdId }}
  82. </view>
  83. </view>
  84. </view>
  85. <view class="inventory-item">
  86. <view class="shuo-item-name">
  87. <view class="shuo-label"> 采购订单: </view>
  88. <view class="shuo-unit">
  89. {{ acceptDetaData.purcOrdId }}
  90. </view>
  91. </view>
  92. </view>
  93. <view class="inventory-item">
  94. <view class="shuo-item">
  95. <view class="shuo-label"> 采购品种: </view>
  96. <view class="shuo-cont">
  97. {{ acceptDetaData.detlCnt || "" }}
  98. </view>
  99. </view>
  100. <view class="shuo-item">
  101. <view class="shuo-label"> 配送品种: </view>
  102. <view class="shuo-cont">
  103. {{ acceptDetaData.delvDrugSum || "" }}
  104. </view>
  105. </view>
  106. </view>
  107. <view class="inventory-item">
  108. <view class="shuo-item">
  109. <view class="shuo-label"> 本次配送: </view>
  110. <view class="shuo-cont">
  111. {{ acceptDetaData.delvCntDetlSum || "" }}
  112. </view>
  113. </view>
  114. </view>
  115. <view class="inventory-item">
  116. <view class="shuo-item-name">
  117. <view class="shuo-label"> 采购总额: </view>
  118. <view class="shuo-cont">
  119. {{ acceptDetaData.delvAmt || "" }}
  120. </view>
  121. </view>
  122. <view class="shuo-item-name">
  123. <view class="shuo-label"> 配送总额: </view>
  124. <view class="shuo-cont">
  125. {{ acceptDetaData.ordAmt }}
  126. </view>
  127. </view>
  128. </view>
  129. <view class="inventory-item">
  130. <view class="shuo-item-name">
  131. <view class="shuo-label"> 验收时间: </view>
  132. <view class="shuo-cont">
  133. {{ forMatTime(acceptDetaData.stoinDate) }}
  134. </view>
  135. </view>
  136. <view class="shuo-item-name">
  137. <view class="shuo-label"> 配送时间: </view>
  138. <view class="shuo-cont">
  139. {{ forMatTime(acceptDetaData.docmkDate) }}
  140. </view>
  141. </view>
  142. </view>
  143. <view class="inventory-item">
  144. <view class="shuo-item-name">
  145. <view class="shuo-label"> 本次验收: </view>
  146. <view class="shuo-cont">
  147. {{ acceptDetaData.shppCntDetlSum }}
  148. </view>
  149. </view>
  150. <view class="shuo-item-name">
  151. <view class="shuo-label"> 验收员: </view>
  152. <view class="shuo-cont">
  153. {{ acceptDetaData.docmker }}
  154. </view>
  155. </view>
  156. </view>
  157. <view class="inventory-item">
  158. <view class="shuo-item-name">
  159. <view class="shuo-label"> 配送企业: </view>
  160. <view class="shuo-cont">
  161. {{ acceptDetaData.splerName }}
  162. </view>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. <view class="empty-cont" v-if="listData.length == '0'"> 暂无明细数据 </view>
  168. <view
  169. class="inner-item"
  170. v-for="(item, idex) in listData"
  171. :key="idex"
  172. @click="handleDetail(item)"
  173. >
  174. <view class="text-title" v-if="idex == '0'">
  175. <view class="title-circ"> </view>
  176. <span class="title-text">药品明细</span>
  177. </view>
  178. <view class="inventory-item" style="margin-top: 40rpx">
  179. <view class="shuo-item-name">
  180. <view class="shuo-label-podnme"> 药品名称: </view>
  181. <view class="shuo-unit">
  182. <span>{{ item.drugName }}</span>
  183. </view>
  184. </view>
  185. </view>
  186. <view class="inventory-item">
  187. <view class="shuo-item">
  188. <view class="shuo-label"> 配送数量: </view>
  189. <view class="shuo-cont">
  190. {{ item.delvCnt || "" }}
  191. </view>
  192. </view>
  193. <view
  194. class="shuo-item"
  195. @click.stop="isPending && openRefuseDialog(idex)"
  196. style="cursor: pointer"
  197. >
  198. <view class="shuo-label" :style="{ color: '#ff4d4f' }">拒收数量:</view>
  199. <view class="shuo-cont" :style="{ color: '#ff4d4f' }">
  200. {{ item.refsCnt || 0 }}
  201. </view>
  202. </view>
  203. </view>
  204. <view class="inventory-item">
  205. <view class="shuo-item-name">
  206. <view class="shuo-label"> 规格: </view>
  207. <view class="shuo-cont">
  208. {{ item.specName || "" }}
  209. </view>
  210. </view>
  211. </view>
  212. <view class="inventory-item">
  213. <view class="shuo-item">
  214. <view class="shuo-label"> 验收数量: </view>
  215. <view class="shuo-cont">
  216. {{ item.shppCnt || "" }}
  217. </view>
  218. </view>
  219. <view class="shuo-item">
  220. <view class="shuo-label"> 是否基药: </view>
  221. <view class="shuo-cont">
  222. {{ item.essdrugType === "1" ? "基药" : "非基药" }}
  223. </view>
  224. </view>
  225. </view>
  226. <view class="inventory-item">
  227. <view class="shuo-item">
  228. <view class="shuo-label"> 生产批次: </view>
  229. <view class="shuo-cont">
  230. {{ item.fasBtch || "" }}
  231. </view>
  232. </view>
  233. <view class="shuo-item">
  234. <view class="shuo-label"> 批准文号: </view>
  235. <view class="shuo-cont">
  236. {{ item.aprvNo }}
  237. </view>
  238. </view>
  239. </view>
  240. <view class="inventory-item">
  241. <view class="shuo-item">
  242. <view class="shuo-label"> 生产日期: </view>
  243. <view class="shuo-cont">
  244. {{ forMatTime(item.manuDate) || "" }}
  245. </view>
  246. </view>
  247. <view class="shuo-item">
  248. <view class="shuo-label"> 有效日期: </view>
  249. <view class="shuo-cont">
  250. {{ forMatTime(item.prodExpy) || "" }}
  251. </view>
  252. </view>
  253. </view>
  254. <view class="inventory-item">
  255. <view class="shuo-item">
  256. <view class="shuo-label"> 药品分类: </view>
  257. <view class="shuo-cont">
  258. {{ item.drugType || "" }}
  259. </view>
  260. </view>
  261. <view class="shuo-item">
  262. <view class="shuo-label"> 生产方式: </view>
  263. <view class="shuo-cont">
  264. {{ item.prodMode || "" }}
  265. </view>
  266. </view>
  267. </view>
  268. <view class="inventory-item">
  269. <view class="shuo-item-name">
  270. <view class="shuo-label"> 生产企业: </view>
  271. <view class="shuo-cont">
  272. {{ item.prodentpName }}
  273. </view>
  274. </view>
  275. </view>
  276. <view class="inventory-item">
  277. <view class="shuo-item-name">
  278. <view class="shuo-label"> 拒收原因: </view>
  279. <view class="shuo-cont">
  280. {{ item.refsRea || "" }}
  281. </view>
  282. </view>
  283. </view>
  284. </view>
  285. <view class="botm-btn" v-if="isPending">
  286. <button type="primary" @click="handleAccept">验收</button>
  287. </view>
  288. <!-- 拒收弹窗 -->
  289. <view v-if="showRefuseDialog" class="refuse-dialog-mask">
  290. <view class="refuse-dialog">
  291. <view class="dialog-title">
  292. 拒收
  293. <span class="dialog-close" @click="closeRefuseDialog">×</span>
  294. </view>
  295. <view class="dialog-row">
  296. <view class="dialog-label">拒收数量</view>
  297. <input
  298. class="dialog-input"
  299. type="number"
  300. v-model="refuseForm.refsCnt"
  301. placeholder="请输入"
  302. />
  303. </view>
  304. <view class="dialog-row">
  305. <view class="dialog-label">拒收原因</view>
  306. <input class="dialog-input" v-model="refuseForm.refsRea" placeholder="请输入" />
  307. </view>
  308. <button class="dialog-btn" @click="confirmRefuse">确认</button>
  309. </view>
  310. </view>
  311. </view>
  312. </template>
  313. <script>
  314. import moment from "moment";
  315. export default {
  316. data() {
  317. return {
  318. listData: [],
  319. acceptDetaData: {},
  320. subMitData: {},
  321. isPending: false,
  322. showRefuseDialog: false,
  323. refuseForm: {
  324. refsCnt: 0,
  325. refsRea: "",
  326. },
  327. currentDrugIndex: null,
  328. };
  329. },
  330. onShow() {},
  331. mounted() {
  332. let that = this;
  333. uni.getStorage({
  334. key: "detailsData",
  335. success: function (res) {
  336. that.acceptDetaData = res.data;
  337. that.isPending = res.data.delvOrdStas === "C";
  338. that.getDetail(res.data.stoinOrdId);
  339. },
  340. });
  341. },
  342. methods: {
  343. async getDetail(stoinOrdId) {
  344. if (this.isPending) {
  345. await this.$http(
  346. "drugHospital.getDelvDetlList",
  347. {
  348. delvOrdId: this.acceptDetaData.delvOrdId,
  349. purcPlanId: this.acceptDetaData.purcPlanId,
  350. },
  351. "加载中"
  352. ).then((res) => {
  353. if (res && res.data) {
  354. this.listData = (res.data || []).map((item) => ({
  355. ...item,
  356. shppCnt: item.delvCnt,
  357. }));
  358. }
  359. });
  360. } else {
  361. await this.$http("drugHospital.getStoinDetlList", { stoinOrdId }, "加载中").then(
  362. (res) => {
  363. if (res && res.data) {
  364. this.listData = res.data || [];
  365. }
  366. }
  367. );
  368. }
  369. },
  370. handleDetail(data) {
  371. uni.setStorage({
  372. key: "detailsDrugId",
  373. data: {
  374. ...data,
  375. isPending: this.isPending,
  376. },
  377. success: () => {
  378. uni.navigateTo({
  379. url: "/consumablespkg/pages/management/drugDetails/index",
  380. });
  381. },
  382. });
  383. },
  384. forMatTime(row) {
  385. return moment(row).format("YYYY-MM-DD ");
  386. },
  387. //日期格式化
  388. forMatTime(time) {
  389. return moment(time).format("YYYY-MM-DD");
  390. },
  391. //加时分秒
  392. forMatTimehs(time) {
  393. return moment(time).format("YYYY-MM-DD ");
  394. },
  395. openRefuseDialog(index) {
  396. this.currentDrugIndex = index;
  397. this.refuseForm.refsCnt = this.listData[index].refsCnt || 0;
  398. this.refuseForm.refsRea = this.listData[index].refsRea || "";
  399. this.showRefuseDialog = true;
  400. },
  401. closeRefuseDialog() {
  402. this.showRefuseDialog = false;
  403. },
  404. confirmRefuse() {
  405. const item = this.listData[this.currentDrugIndex];
  406. const refuseCnt = Number(this.refuseForm.refsCnt);
  407. if (refuseCnt > Number(item.delvCnt)) {
  408. uni.showToast({ title: "拒收数量不能大于配送数量", icon: "none" });
  409. return;
  410. }
  411. this.$set(this.listData, this.currentDrugIndex, {
  412. ...item,
  413. refsCnt: refuseCnt,
  414. refsRea: this.refuseForm.refsRea,
  415. });
  416. this.showRefuseDialog = false;
  417. },
  418. async handleAccept() {
  419. const detlList = this.listData.map((item) => ({
  420. delvCnt: item.delvCnt,
  421. delvOrdId: item.delvOrdId,
  422. drugListId: item.drugListId,
  423. id: item.id,
  424. lotNum: item.lotNum,
  425. rfusRea: item.refsRea || "",
  426. shppCnt: item.delvCnt - (item.refsCnt || 0),
  427. }));
  428. uni.showModal({
  429. title: "确认验收",
  430. content: "是否确认验收?",
  431. success: async (res) => {
  432. if (res.confirm) {
  433. await this.$http("drugHospital.saveDetlStoIn", { detlList }, "验收中").then(
  434. (result) => {
  435. if (result.success === true) {
  436. uni.showToast({ title: "验收成功", icon: "success" });
  437. setTimeout(() => {
  438. uni.navigateBack();
  439. }, 1000);
  440. } else {
  441. uni.showToast({ title: result.msg || "验收失败", icon: "none" });
  442. }
  443. }
  444. );
  445. }
  446. },
  447. });
  448. },
  449. },
  450. watch: {},
  451. };
  452. </script>
  453. <style lang="scss" scoped>
  454. .query-wrap {
  455. width: 100%;
  456. height: 100%;
  457. padding: 20rpx;
  458. box-sizing: border-box;
  459. background-color: #f1f1f1;
  460. overflow-y: scroll;
  461. overflow-x: hidden;
  462. position: relative;
  463. padding-bottom: 200rpx;
  464. .botm-btn {
  465. width: 100%;
  466. height: 120rpx;
  467. background-color: transparent;
  468. position: fixed;
  469. left: 0;
  470. bottom: 0;
  471. display: flex;
  472. align-items: center;
  473. justify-content: center;
  474. button[type="primary"] {
  475. width: 80%;
  476. height: 80rpx;
  477. background: #5ab7a5;
  478. color: #fff;
  479. font-size: 32rpx;
  480. border: none;
  481. box-shadow: none;
  482. text-align: center;
  483. border-radius: 12rpx;
  484. }
  485. }
  486. .time-view {
  487. height: 350rpx;
  488. background-color: #fff;
  489. padding: 50rpx 50rpx 0 50rpx;
  490. box-sizing: border-box;
  491. .btn-view {
  492. width: 100%;
  493. height: 100rpx;
  494. margin-top: 100rpx;
  495. display: flex;
  496. justify-content: space-around;
  497. }
  498. }
  499. }
  500. .title-text {
  501. font-size: 32rpx;
  502. color: #5ab7a5;
  503. font-weight: bold;
  504. }
  505. .item-stats {
  506. margin-top: 80rpx;
  507. }
  508. uni-page-body {
  509. width: 100%;
  510. height: 100%;
  511. }
  512. .link-text {
  513. color: #1890ff;
  514. cursor: pointer;
  515. text-decoration: underline;
  516. }
  517. .refuse-dialog-mask {
  518. position: fixed;
  519. left: 0;
  520. top: 0;
  521. right: 0;
  522. bottom: 0;
  523. background: rgba(0, 0, 0, 0.3);
  524. z-index: 999;
  525. display: flex;
  526. align-items: center;
  527. justify-content: center;
  528. }
  529. .refuse-dialog {
  530. background: #fff;
  531. border-radius: 12px;
  532. width: 320px;
  533. padding: 24px 20px 20px 20px;
  534. box-sizing: border-box;
  535. position: relative;
  536. }
  537. .dialog-title {
  538. font-size: 18px;
  539. font-weight: bold;
  540. text-align: center;
  541. margin-bottom: 18px;
  542. position: relative;
  543. }
  544. .dialog-close {
  545. position: absolute;
  546. right: 0;
  547. top: 0;
  548. font-size: 22px;
  549. cursor: pointer;
  550. }
  551. .dialog-row {
  552. margin-bottom: 16px;
  553. }
  554. .dialog-label {
  555. font-size: 14px;
  556. margin-bottom: 6px;
  557. }
  558. .dialog-input {
  559. width: 100%;
  560. height: 36px;
  561. border: 1px solid #e5e5e5;
  562. border-radius: 6px;
  563. padding: 0 8px;
  564. box-sizing: border-box;
  565. font-size: 14px;
  566. }
  567. .dialog-btn {
  568. width: 100%;
  569. height: 40px;
  570. background: #5ab7a5;
  571. color: #fff;
  572. border: none;
  573. border-radius: 6px;
  574. font-size: 16px;
  575. margin-top: 10px;
  576. }
  577. </style>