detail.vue 12 KB

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