detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view class="deliver-page">
  3. <u-navbar
  4. height="40px"
  5. title="拣货任务详情"
  6. bgColor="#0256FF"
  7. :titleStyle="{ color: '#fff' }"
  8. leftIconColor="#fff"
  9. autoBack
  10. placeholder
  11. >
  12. </u-navbar>
  13. <view class="container_main">
  14. <view class="info-box" :class="isUnfold ? '' : 'min-height'">
  15. <view class="info-line">
  16. <view class="info-line-label">
  17. <text>出库单号</text>
  18. </view>
  19. <view class="info-line-value">
  20. {{ orderInfo.number }}
  21. </view>
  22. </view>
  23. <view class="info-line">
  24. <view class="info-line-label">
  25. <text>发出仓库</text>
  26. </view>
  27. <view class="info-line-value">
  28. {{ depotInfo ? depotInfo.depotName : "" }}
  29. </view>
  30. </view>
  31. <view class="info-line">
  32. <view class="info-line-label">
  33. <text>出库数量</text>
  34. </view>
  35. <view class="info-line-value">
  36. {{ orderInfo.goodsQuantity }}
  37. </view>
  38. </view>
  39. <view class="info-line">
  40. <view class="info-line-label">
  41. <text>出库种类</text>
  42. </view>
  43. <view class="info-line-value">
  44. {{ orderInfo.goodsTypeCount }}
  45. </view>
  46. </view>
  47. <view class="info-line">
  48. <view class="info-line-label">
  49. <text>制单日期</text>
  50. </view>
  51. <view class="info-line-value">
  52. {{ orderInfo.createTime }}
  53. </view>
  54. </view>
  55. <view class="info-line">
  56. <view class="info-line-label">
  57. <text>制单人</text>
  58. </view>
  59. <view class="info-line-value">
  60. {{ orderInfo.createName || "-" }}
  61. </view>
  62. </view>
  63. <view class="info-line">
  64. <view class="info-line-label">
  65. <text>出库类型</text>
  66. </view>
  67. <view class="info-line-value">
  68. {{ orderInfo.subType }}
  69. </view>
  70. </view>
  71. <view class="info-line">
  72. <view class="info-line-label">
  73. <text>出库人</text>
  74. </view>
  75. <view class="info-line-value">
  76. {{ orderInfo.operName || "-" }}
  77. </view>
  78. </view>
  79. <view class="info-line">
  80. <view class="info-line-label">
  81. <text>备注信息</text>
  82. </view>
  83. <view class="info-line-value">
  84. {{ orderInfo.remark || "-" }}
  85. </view>
  86. </view>
  87. <view class="info-line">
  88. <view class="info-line-label">
  89. <text>出库时间</text>
  90. </view>
  91. <view class="info-line-value">
  92. {{ orderInfo.submitTime }}
  93. </view>
  94. </view>
  95. <view class="info-line" v-if="orderInfo.auditorName">
  96. <view class="info-line-label">
  97. <text>驳回人</text>
  98. </view>
  99. <view class="info-line-value">
  100. {{ orderInfo.auditorName }}
  101. </view>
  102. </view>
  103. <view class="info-line" v-if="orderInfo.rejectTime">
  104. <view class="info-line-label">
  105. <text>驳回时间</text>
  106. </view>
  107. <view class="info-line-value">
  108. {{ $u.timeFormat(orderInfo.rejectTime, "yyyy-mm-dd hh:MM:ss") }}
  109. </view>
  110. </view>
  111. <view class="info-line" v-if="orderInfo.reject">
  112. <view class="info-line-label">
  113. <text>驳回原因</text>
  114. </view>
  115. <view class="info-line-value">
  116. {{ orderInfo.reject }}
  117. </view>
  118. </view>
  119. </view>
  120. <view class="btn-box">
  121. <view class="btn-cont" @click="isUnfold = !isUnfold">
  122. <text>{{ isUnfold ? "收起" : "展开" }}</text>
  123. <u-icon :name="isUnfold ? 'arrow-up' : 'arrow-down'"></u-icon>
  124. </view>
  125. </view>
  126. <!-- 货物清单 -->
  127. <view class="cargo-list">
  128. <view class="cargo-list-title">
  129. <view>出库货物清单</view>
  130. <view class="cargo-list-title-tips">(轻触货物查看详情)</view>
  131. </view>
  132. <block v-for="(item, i) in goodsList" :key="i">
  133. <good-item
  134. :item="item"
  135. @toDetail="toDetail"
  136. :show-print="true"
  137. @print="(e) => handlePrint(e.id, '2', status)"
  138. >
  139. <view class="num-box">
  140. <view class="num-box-text">已确认出库数量</view>
  141. <u-number-box
  142. v-model="item.actualQuantityInStorage"
  143. disabled
  144. :min="0"
  145. :inputWidth="56"
  146. :max="item.inventory"
  147. >
  148. </u-number-box>
  149. </view>
  150. </good-item>
  151. </block>
  152. </view>
  153. </view>
  154. <view class="footer-box" v-if="auditState == '1'">
  155. <u-button class="cancelBtn" @tap="showReject = true">驳回</u-button>
  156. <u-button class="submitBtn" @tap="submit('2')">复核通过</u-button>
  157. </view>
  158. <!-- 打印条码弹框 -->
  159. <print-pop
  160. :show.sync="blePrintPop.show"
  161. :info="blePrintPop.data"
  162. @confirm="startPrint"
  163. ></print-pop>
  164. <!-- 选择蓝牙设备弹框 -->
  165. <ble-pop
  166. :show.sync="bleSelectPop.show"
  167. :list="discoveredDevices"
  168. @close="closeBleSelectPop"
  169. @refresh="refreshBleDevice"
  170. @selectItem="handleSelectBle"
  171. ></ble-pop>
  172. <ble-tip-pop
  173. v-model="bleErrorTipPop.show"
  174. :is-center="true"
  175. @confirm="bleErrorTipConfirm"
  176. :content="bleErrorTipPop.content"
  177. :extraText="bleErrorTipPop.extraText"
  178. >
  179. </ble-tip-pop>
  180. <auditReject :show.sync="showReject" @ok="onReject" />
  181. </view>
  182. </template>
  183. <script>
  184. import goodItem from "@/components/good-item/good-item.vue";
  185. import auditReject from "@/components/audit-reject/audit-reject.vue";
  186. import { orderDetail, orderInfo } from "@/common/request/apis/purchase";
  187. import { mapGetters } from "vuex";
  188. import blePrintMixin from "@/common/mixins/blePrintMixin.js";
  189. import { setReviewTask } from "@/common/request/apis/aduit.js";
  190. export default {
  191. mixins: [blePrintMixin],
  192. components: {
  193. goodItem,
  194. auditReject,
  195. },
  196. data() {
  197. return {
  198. isUnfold: true, //是否展开
  199. orderInfo: {},
  200. goodsList: [],
  201. status: null,
  202. auditState: "0",
  203. showReject: false,
  204. };
  205. },
  206. onLoad(e) {
  207. this.getOrderInfo(e.id);
  208. this.getOrderDetail(e.id);
  209. this.auditState = e.auditState || "0";
  210. },
  211. computed: {
  212. ...mapGetters(["depotInfo"]),
  213. },
  214. methods: {
  215. getOrderInfo(id) {
  216. orderInfo(id).then((res) => {
  217. if (res.code == 200) {
  218. this.orderInfo = res.data;
  219. this.status = res.data.status;
  220. console.log("orderInfo===", res);
  221. }
  222. });
  223. },
  224. getOrderDetail(id) {
  225. orderDetail(id).then((res) => {
  226. if (res.code == 200) {
  227. res.data.rows.forEach((item) => {
  228. if (item.imgName && item.imgName.length > 0) {
  229. item.imgNameArr = item.imgName.split(",");
  230. } else {
  231. item.imgNameArr = [];
  232. }
  233. item.materialNumber = 0;
  234. });
  235. console.log("goodsList=====", res.data);
  236. this.goodsList = res.data.rows;
  237. }
  238. });
  239. },
  240. toDetail(val) {
  241. uni.navigateTo({
  242. url: `/pages/goods/detail?id=${val.id}&name=${val.materialName}&materialId=${val.materialId}`,
  243. });
  244. },
  245. onReject(reject) {
  246. this.submit("7", reject);
  247. },
  248. async submit(status, reject) {
  249. try {
  250. const params = {
  251. id: this.orderInfo.id,
  252. status,
  253. number: this.orderInfo.number,
  254. };
  255. if (reject) {
  256. params.reject = reject;
  257. }
  258. const result = await setReviewTask(params);
  259. console.log("setReviewTask====params", params);
  260. console.log("setReviewTask====result", result);
  261. if (result.code === 200) {
  262. uni.$u.toast(result.msg);
  263. setTimeout(() => {
  264. uni.navigateBack();
  265. }, 1000);
  266. uni.setStorageSync("auditTaskRefresh", true);
  267. } else {
  268. uni.$u.toast(result.msg);
  269. }
  270. } catch (error) {}
  271. },
  272. },
  273. };
  274. </script>
  275. <style lang="scss" scoped>
  276. .deliver-page {
  277. min-height: 100vh;
  278. background-color: #f0f6fb;
  279. padding-bottom: 130rpx;
  280. .container_main {
  281. padding: 24rpx;
  282. .info-box {
  283. background-color: #fff;
  284. border-radius: 16rpx 16rpx 0 0;
  285. padding: 24rpx 24rpx 0 24rpx;
  286. .info-line {
  287. border-bottom: 1px solid #f4f4f4;
  288. padding: 24rpx 0;
  289. color: #333;
  290. font-family: "PingFang SC";
  291. font-size: 28rpx;
  292. line-height: 1.5;
  293. font-weight: 400;
  294. display: flex;
  295. align-items: center;
  296. &-label {
  297. flex: 0 0 162rpx;
  298. width: 162rpx;
  299. }
  300. &-value {
  301. word-break: break-all;
  302. }
  303. .must-box {
  304. color: #ff3b1d;
  305. }
  306. }
  307. }
  308. .min-height {
  309. height: 300rpx;
  310. overflow: hidden;
  311. }
  312. .btn-box {
  313. height: 112rpx;
  314. display: flex;
  315. align-items: center;
  316. justify-content: center;
  317. background-color: #fff;
  318. border-radius: 0 0 16rpx 16rpx;
  319. .btn-cont {
  320. display: flex;
  321. align-items: center;
  322. justify-content: center;
  323. width: 154rpx;
  324. height: 56rpx;
  325. border-radius: 120rpx;
  326. border: 1px solid #d9d9d9;
  327. color: #666;
  328. font-family: "PingFang SC";
  329. font-size: 28rpx;
  330. font-weight: 400;
  331. }
  332. }
  333. .cargo-list {
  334. padding: 24rpx 0;
  335. background-color: #fff;
  336. margin-top: 24rpx;
  337. border-radius: 16rpx;
  338. .cargo-list-title {
  339. font-family: "PingFang SC";
  340. font-size: 32rpx;
  341. font-style: normal;
  342. font-weight: bold;
  343. display: flex;
  344. align-items: center;
  345. position: relative;
  346. padding-left: 50rpx;
  347. &::after {
  348. content: "";
  349. display: block;
  350. width: 6rpx;
  351. height: 30rpx;
  352. border-radius: 100px;
  353. background: #0256ff;
  354. position: absolute;
  355. top: 50%;
  356. left: 24rpx;
  357. transform: translateY(-50%);
  358. }
  359. .cargo-list-title-tips {
  360. color: #0256ff;
  361. font-size: 24rpx;
  362. font-weight: 400;
  363. }
  364. }
  365. .num-box {
  366. display: flex;
  367. align-items: center;
  368. justify-content: space-between;
  369. padding: 0 48rpx 0 26rpx;
  370. .num-box-text {
  371. color: #666;
  372. font-family: "PingFang SC";
  373. font-size: 28rpx;
  374. font-weight: 400;
  375. }
  376. .input {
  377. width: 112rpx;
  378. text-align: center;
  379. border-bottom: 1px solid #dadada;
  380. margin: 0 8rpx;
  381. }
  382. .minus {
  383. width: 40rpx;
  384. height: 40rpx;
  385. border-radius: 8rpx;
  386. border: 1px solid #dadada;
  387. display: flex;
  388. align-items: center;
  389. justify-content: center;
  390. }
  391. .plus {
  392. width: 40rpx;
  393. height: 40rpx;
  394. border-radius: 8rpx;
  395. background-color: #dadada;
  396. display: flex;
  397. align-items: center;
  398. justify-content: center;
  399. }
  400. }
  401. }
  402. }
  403. .footer-box {
  404. background-color: #fff;
  405. height: 126rpx;
  406. position: fixed;
  407. bottom: 0;
  408. left: 0;
  409. right: 0;
  410. display: flex;
  411. align-items: center;
  412. justify-content: center;
  413. .cancelBtn {
  414. width: 244rpx;
  415. height: 80rpx;
  416. border-radius: 16rpx;
  417. color: #666;
  418. font-family: "PingFang SC";
  419. font-size: 32rpx;
  420. font-weight: 500;
  421. margin-right: 20rpx;
  422. }
  423. .submitBtn {
  424. width: 244rpx;
  425. height: 80rpx;
  426. border-radius: 16rpx;
  427. background: #0256ff;
  428. color: #fff;
  429. font-size: 32rpx;
  430. font-weight: 500;
  431. }
  432. }
  433. }
  434. </style>