report.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <view class="">
  3. <view class="banner">
  4. <view class="step-box">
  5. <up-steps :current="orderStatus" activeColor="#b5aa90">
  6. <up-steps-item
  7. :title="item.name"
  8. v-for="item in stepData"
  9. :key="item.name"
  10. >
  11. </up-steps-item>
  12. </up-steps>
  13. </view>
  14. <view class="block">
  15. <view class="check">
  16. <view class="header">
  17. <span class="title">合后检测确认单</span>
  18. </view>
  19. <view class="desc"
  20. >根据双方认可的检测内容及要求进行认定,为客户合后检测认定结果如下:</view
  21. >
  22. <view class="table">
  23. <view class="title">客户寄送品</view>
  24. <view class="tab_header">
  25. <up-row>
  26. <up-col :span="2">
  27. <view class="col">类型</view>
  28. </up-col>
  29. <up-col :span="2">
  30. <view class="col">来样重</view>
  31. </up-col>
  32. <up-col :span="2.5">
  33. <view class="col">实际重</view>
  34. </up-col>
  35. <up-col :span="2.5">
  36. <view class="col">成色</view>
  37. </up-col>
  38. <up-col :span="3">
  39. <view class="col">存入克重</view>
  40. </up-col>
  41. </up-row>
  42. </view>
  43. <view class="tab_content">
  44. <view>
  45. <up-row v-for="item in detectionDetails" :key="item.id">
  46. <up-col :span="2">
  47. <view class="col">{{ getCate(item.type) }}</view>
  48. </up-col>
  49. <up-col :span="2">
  50. <view class="col">{{ item.userEstimatedWeight }}g</view>
  51. </up-col>
  52. <up-col :span="2.5">
  53. <view class="col">{{ item.discountedWeight }}g</view>
  54. </up-col>
  55. <up-col :span="2.5">
  56. <view class="col">{{ item.purity }}%</view>
  57. </up-col>
  58. <up-col :span="3">
  59. <view class="col"
  60. >{{
  61. item.unloadingWeight > 0
  62. ? item.unloadingWeight
  63. : "0.00" || "0.00"
  64. }}g</view
  65. >
  66. </up-col>
  67. </up-row>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="end">
  72. <view class="end-bttom">
  73. <span class="total">
  74. 总计:
  75. <span class="price"
  76. >{{ detectionReport.totalDiscountedWeight }}g</span
  77. >
  78. 回收价:
  79. <span class="price">¥{{ detectionReport.totalPrice }}</span>
  80. </span>
  81. </view>
  82. <view
  83. class="end-bttom"
  84. style="margin-top: 10rpx"
  85. v-if="detectionReport.totalDeductedDeposit"
  86. >
  87. <span class="total">
  88. 扣除保证金:
  89. <span class="price"
  90. >¥{{ detectionReport.totalDeductedDeposit }}</span
  91. >
  92. </span>
  93. </view>
  94. <view class="end-bttom" style="margin-top: 10rpx">
  95. <span class="total">
  96. 快递费用:
  97. <span class="price">¥{{ deliveryCosts }}</span>
  98. </span>
  99. </view>
  100. <view class="extra"
  101. >即:客户对{{
  102. detectionReport.inspectionTime
  103. }}合后检测重量和回收价无异议</view
  104. >
  105. <view class="sign">
  106. <span>检测人:{{ detectionReport.nikeName || "系统" }}</span>
  107. </view>
  108. <view class="time">
  109. {{ detectionReport.inspectionTime }}
  110. </view>
  111. </view>
  112. <view style="font-size: 14px; padding: 10px">
  113. <span style="font-size: 16px; font-weight: 700">注:</span>
  114. <span>折算公式:兑料重量 = 折足重量 = 来料熔后重量 * 折足成色</span>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="block">
  119. <view class="check">
  120. <view class="header">
  121. <span class="title">检测图片</span>
  122. </view>
  123. <view class="checlImage">
  124. <cl-upload
  125. v-model="detectionImages"
  126. :add="false"
  127. :remove="false"
  128. ></cl-upload>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <view style="height: 70px"></view>
  134. <view class="footer" v-if="orderStatus == 4">
  135. <view class="btn" @click="next()">确认报告</view>
  136. </view>
  137. </view>
  138. </template>
  139. <script setup>
  140. import { onMounted, ref } from "vue";
  141. import { onLoad } from "@dcloudio/uni-app";
  142. import { recyclDetectionReportAPI } from "@/api/functions";
  143. const stepData = ref([
  144. {
  145. name: "待填写",
  146. isNow: 0,
  147. type: 1,
  148. },
  149. {
  150. name: "待邮寄",
  151. isNow: 0,
  152. type: 1,
  153. },
  154. {
  155. name: "待签收",
  156. isNow: 0,
  157. type: 1,
  158. },
  159. {
  160. name: "待检测",
  161. isNow: 0,
  162. type: 1,
  163. },
  164. {
  165. name: "待确认",
  166. isNow: 1,
  167. type: 0,
  168. },
  169. {
  170. name: "待打款",
  171. isNow: 0,
  172. type: 0,
  173. },
  174. {
  175. name: "完成",
  176. isNow: 0,
  177. type: 0,
  178. },
  179. ]);
  180. // 注意:onLoad是uni-app的生命周期,如果是纯Vue3,应使用onMounted
  181. // 替代Vue2的methods中的方法
  182. const getCate = (cate) => {
  183. console.log(cate);
  184. switch (cate) {
  185. case 1:
  186. return "黄金";
  187. case 3:
  188. return "白银";
  189. case 2:
  190. return "铂金";
  191. case 4:
  192. return "K金";
  193. }
  194. };
  195. // 检测信息-成色类型等
  196. const detectionDetails = ref([]);
  197. // 检测详情
  198. const detectionReport = ref({});
  199. // 检测图片
  200. const detectionImages = ref([]);
  201. // 订单号
  202. const orderNo = ref("");
  203. // 订单状态
  204. const orderStatus = ref(4);
  205. // 快递费用
  206. const deliveryCosts = ref(0);
  207. onLoad((options) => {
  208. if (options.orderInfo) {
  209. // 先解码再解析
  210. const orderInfoStr = decodeURIComponent(options.orderInfo);
  211. const res = JSON.parse(orderInfoStr);
  212. detectionDetails.value = res.detectionDetails;
  213. detectionReport.value = res.detectionReport;
  214. detectionImages.value = JSON.parse(res.detectionReport.detectionImages);
  215. orderNo.value = res.id;
  216. orderStatus.value = res.status;
  217. deliveryCosts.value = res.deliveryCosts;
  218. }
  219. });
  220. // 确认报告
  221. const next = async () => {
  222. uni.showLoading({
  223. title: "确认中",
  224. });
  225. const res = await recyclDetectionReportAPI(orderNo.value);
  226. uni.hideLoading();
  227. setTimeout(() => {
  228. uni.redirectTo({
  229. url: "/pages/users/vault/recycle/recyle_order",
  230. });
  231. }, 1000);
  232. };
  233. </script>
  234. <style scoped lang="scss">
  235. .banner {
  236. padding: 10px 15px;
  237. background: $uni-bg-primary; /* fallback for old browsers */
  238. .step-box {
  239. margin: 30rpx 0;
  240. width: 100%;
  241. background: #fff;
  242. height: 150rpx;
  243. display: flex;
  244. flex-direction: column;
  245. justify-content: center;
  246. border-radius: 4px;
  247. &::v-deep .u-text__value {
  248. font-size: 24rpx !important;
  249. }
  250. }
  251. }
  252. .block {
  253. margin-bottom: 10px;
  254. .check {
  255. background-color: #fff;
  256. border-radius: 4px;
  257. padding-top: 10px;
  258. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  259. }
  260. .header {
  261. font-size: 14px;
  262. font-weight: 700;
  263. padding-left: 10px;
  264. margin-left: 10px;
  265. position: relative;
  266. display: flex;
  267. align-items: center;
  268. justify-content: space-between;
  269. &::before {
  270. position: absolute; /*绝对定位*/
  271. top: 50%; /*Y轴方向偏移自身高度的50%*/
  272. transform: translatey(-40%); /*Y轴方向偏移微调*/
  273. left: 0px; /*紧靠容器左边缘*/
  274. content: ""; /*伪元素需要有内容才能显示*/
  275. width: 2px; /*伪元素宽度*/
  276. height: 18px; /*伪元素高度*/
  277. background-color: #daa520; /*伪元素颜色*/
  278. }
  279. .title {
  280. font-size: 18px;
  281. }
  282. }
  283. .desc {
  284. padding: 8px 10px;
  285. color: #888;
  286. font-size: 14px;
  287. }
  288. }
  289. .table {
  290. padding: 14px 10px;
  291. .title {
  292. text-align: center;
  293. padding: 4px 0;
  294. color: #fff;
  295. font-weight: 700;
  296. font-size: 20rpx;
  297. width: 100%;
  298. background-color: #b5aa90;
  299. }
  300. .tab_header {
  301. border-left: 1px solid #b5aa90;
  302. font-size: 18px;
  303. background-color: #fff;
  304. .col {
  305. padding: 12px 0;
  306. line-height: 19px;
  307. font-size: 22rpx;
  308. }
  309. }
  310. .tab_content {
  311. border-left: 1px solid #b5aa90;
  312. font-size: 16px;
  313. background-color: #fff;
  314. .col {
  315. padding: 12px 0;
  316. line-height: 19px;
  317. font-size: 22rpx;
  318. }
  319. }
  320. .tab_header .col,
  321. .tab_content .col {
  322. border-bottom: 1px solid #b5aa90;
  323. border-right: 1px solid #b5aa90;
  324. text-align: center;
  325. font-size: 22rpx;
  326. }
  327. .symbol-name {
  328. font-family: Microsoft YaHei, Arial, Helvetica, sans-serif;
  329. font-size: 20px;
  330. color: #ffbf24;
  331. }
  332. }
  333. .end {
  334. width: 100%;
  335. display: inline-block;
  336. text-align: right;
  337. .end-bttom {
  338. color: #888;
  339. .total {
  340. font-size: 16px;
  341. }
  342. .price {
  343. margin-right: 10px;
  344. color: #ffa034;
  345. }
  346. }
  347. .extra {
  348. font-size: 14px;
  349. margin-top: 15px;
  350. color: #888;
  351. margin-right: 10px;
  352. }
  353. .sign {
  354. margin: 10px;
  355. }
  356. .time {
  357. padding: 10px;
  358. }
  359. }
  360. .checlImage {
  361. padding: 10px;
  362. }
  363. .footer {
  364. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
  365. position: fixed;
  366. width: 100%;
  367. border-radius: 8px 8px 0 0;
  368. background-color: #fff;
  369. bottom: 0;
  370. height: 60px;
  371. display: flex;
  372. justify-content: space-around;
  373. align-items: center;
  374. .btn {
  375. color: #fff;
  376. font-weight: 700;
  377. margin: 0 15px;
  378. border-radius: 10px;
  379. width: 100px;
  380. padding: 10px;
  381. text-align: center;
  382. background-color: #cc9933;
  383. }
  384. }
  385. </style>