index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <template>
  2. <view>
  3. <view class="scan">
  4. <view class="header">请选择要核销的订单</view>
  5. <view class="box">
  6. <view
  7. class="content"
  8. v-for="(item, index) in list"
  9. :key="index"
  10. @click="jump(item.id)"
  11. >
  12. <view class="acea-row row-between">
  13. <view
  14. class="orange"
  15. v-if="
  16. (item._status == 4 || item._status == 12) && item.status == 5
  17. "
  18. >部分核销</view
  19. >
  20. <view
  21. class="attributes blue"
  22. v-if="item._status == 4 && item.status == 1"
  23. >未核销</view
  24. >
  25. <view class="attributes blue" v-if="item._status == 11"
  26. >未核销</view
  27. >
  28. <view class="attributes blue" v-if="item._status == 5">已核销</view>
  29. <!-- <navigator class="btn" url="/pages/admin/writeRecordList/index" hover-class="none">核销记录<text class="iconfont icon-ic_rightarrow"></text></navigator> -->
  30. <!-- <view class="btn" @click.stop="goRecord(item.id)">核销记录<text class="iconfont icon-ic_rightarrow"></text></view> -->
  31. </view>
  32. <view class="content_box acea-row">
  33. <image :src="item.image" mode=""></image>
  34. <view class="content_box_title acea-row row-column row-between">
  35. <p class="textbox">订单号:{{ item.order_id }}</p>
  36. <p class="attribute">下单时间:{{ item.add_time }}</p>
  37. <view class="txt">
  38. <p class="attribute">订单实付:¥{{ item.pay_price }}</p>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="mask" v-if="popupShow" @click="closePopup"></view>
  46. <view class="popup acea-row row-column on" v-if="popupShow">
  47. <view class="popup-hd">
  48. 商品核销
  49. <view class="btn" @click="closePopup">
  50. <text class="iconfont icon-ic_close"></text>
  51. </view>
  52. </view>
  53. <writeOffList
  54. class="popup-bd"
  55. :list="orderInfo"
  56. :auth="auth"
  57. :oid="id"
  58. @success="writeSuccess"
  59. ></writeOffList>
  60. </view>
  61. <view v-if="box">
  62. <view class="boxs">
  63. <view class="small_box">
  64. <view class="content">
  65. <view class="font">核销成功</view>
  66. <view v-if="isAll" class="small_font">当前订单已完成核销</view>
  67. <view v-else class="small_font">该订单仍有其他待核销商品</view>
  68. </view>
  69. <view class="acea-row btn-box">
  70. <view v-if="!isAll" class="btn" @click="ok(1)">返回列表</view>
  71. <!-- <navigator v-if="!isAll" :url='"/pages/admin/distribution/scanning/index?code="+attr.code' hover-class='none' open-type="redirect" class="btn btn_no">返回列表</navigator> -->
  72. <navigator
  73. v-if="isAll"
  74. url="/pages/admin/work/index"
  75. hover-class="none"
  76. class="btn btn_no"
  77. >返回工作台</navigator
  78. >
  79. <view v-if="!isAll" class="btn on" @click="ok(2)">继续核销</view>
  80. <view v-if="isAll" class="btn on" @click="ok(3)">核销其他订单</view>
  81. <!-- <navigator v-if="isAll" :url='"/pages/admin/distribution/scanning/index?code="' open-type="redirect" hover-class='none' class="btn on">核销其他订单</navigator> -->
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import { orderWriteoffInfo, orderVerific, orderCartInfo } from "@/api/admin";
  90. import { HTTP_REQUEST_URL } from "@/config/app";
  91. import { nextTick } from "vue";
  92. import writeOffList from "../../components/writeOffList/index.vue";
  93. export default {
  94. name: "scanning",
  95. components: {
  96. writeOffList,
  97. },
  98. data() {
  99. return {
  100. auth: 1,
  101. verify_code: "",
  102. list: [],
  103. imgHost: HTTP_REQUEST_URL,
  104. popupShow: false,
  105. orderInfo: {},
  106. id: 0,
  107. box: false,
  108. isAll: 1,
  109. };
  110. },
  111. onLoad: function (option) {
  112. this.auth = option.auth;
  113. this.verify_code = option.code;
  114. },
  115. onShow(options) {
  116. this.getList();
  117. },
  118. methods: {
  119. goRecord(id) {
  120. uni.navigateTo({
  121. url: "/pages/admin/writeRecordList/index?id=" + id,
  122. });
  123. },
  124. getList: function () {
  125. orderVerific(this.verify_code, this.auth)
  126. .then((res) => {
  127. // self.orderInfo = res.data
  128. this.list = res.data.data;
  129. // self.iShidden = true
  130. })
  131. .catch((res) => {
  132. // self.verify_code = ''
  133. return this.$util.Tips({
  134. title: res,
  135. });
  136. });
  137. },
  138. jump: function (id) {
  139. this.id = id;
  140. this.getCartList(id);
  141. },
  142. getCartList: function (id) {
  143. orderCartInfo({
  144. oid: id,
  145. auth: this.auth,
  146. })
  147. .then((res) => {
  148. if (res.data.product_type == 4) {
  149. uni.navigateTo({
  150. url: "/pages/admin/writeOffCard/index?id=" + id,
  151. });
  152. } else {
  153. let orderInfo = res.data;
  154. for (let i = 0; i < orderInfo.cart_info.length; i++) {
  155. orderInfo.cart_info[i].surplus_num_input =
  156. orderInfo.cart_info[i].surplus_num;
  157. orderInfo.cart_info[i].checked = true;
  158. }
  159. this.orderInfo = orderInfo;
  160. this.popupShow = true;
  161. }
  162. })
  163. .catch((res) => {
  164. this.$util.Tips({
  165. title: res,
  166. });
  167. });
  168. },
  169. closePopup() {
  170. this.popupShow = false;
  171. },
  172. writeSuccess(val) {
  173. this.isAll = val;
  174. this.box = true;
  175. },
  176. ok(val) {
  177. this.box = false;
  178. this.popupShow = false;
  179. this.getList();
  180. },
  181. },
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. .scan {
  186. padding-bottom: 160upx;
  187. .header {
  188. height: 346rpx;
  189. padding: 48rpx 0 0 32rpx;
  190. background: linear-gradient(
  191. 270deg,
  192. $gradient-primary-admin 0%,
  193. $primary-admin 100%
  194. );
  195. font-weight: 500;
  196. font-size: 36rpx;
  197. line-height: 50rpx;
  198. color: #ffffff;
  199. }
  200. .box {
  201. padding: 0 20rpx;
  202. margin: -216rpx 0 0;
  203. }
  204. .content {
  205. padding: 32rpx 24rpx;
  206. border-radius: 24rpx;
  207. margin-bottom: 20rpx;
  208. background: #ffffff;
  209. .attributes {
  210. font-size: 28rpx;
  211. line-height: 40rpx;
  212. color: $primary-admin;
  213. }
  214. .orange {
  215. color: #ff7e00;
  216. }
  217. .pad {
  218. padding: 20upx 20upx 22upx;
  219. }
  220. .btn {
  221. font-size: 28rpx;
  222. line-height: 40rpx;
  223. color: #999999;
  224. .iconfont {
  225. margin-left: 4rpx;
  226. font-size: 32rpx;
  227. }
  228. }
  229. .content_box {
  230. margin-top: 26rpx;
  231. image {
  232. width: 136rpx;
  233. height: 136rpx;
  234. border-radius: 16rpx;
  235. }
  236. .content_box_title {
  237. flex: 1;
  238. padding-left: 20rpx;
  239. font-size: 24rpx;
  240. line-height: 34rpx;
  241. color: #666666;
  242. .textbox {
  243. font-weight: 500;
  244. font-size: 28rpx;
  245. line-height: 40rpx;
  246. color: #333333;
  247. }
  248. .mar {
  249. margin: 16upx 0upx;
  250. }
  251. .attribute {
  252. color: #999999;
  253. // margin: 4upx 0upx 10upx;
  254. }
  255. .txt {
  256. display: flex;
  257. justify-content: space-between;
  258. font-size: 24upx;
  259. .orange {
  260. color: #ff7e00;
  261. }
  262. .blue {
  263. color: $primary-admin;
  264. }
  265. }
  266. }
  267. }
  268. .content_bottom {
  269. display: flex;
  270. justify-content: space-between;
  271. font-size: 22upx;
  272. padding: 0upx 20upx;
  273. color: #666666;
  274. .money {
  275. font-size: 26upx;
  276. color: #f5222d;
  277. }
  278. }
  279. }
  280. }
  281. .popup {
  282. position: fixed;
  283. right: 0;
  284. bottom: 0;
  285. left: 0;
  286. z-index: 6;
  287. // max-height: 75%;
  288. // min-height: 500rpx;
  289. height: 800rpx;
  290. padding-bottom: 0;
  291. padding-bottom: constant(safe-area-inset-bottom);
  292. padding-bottom: env(safe-area-inset-bottom);
  293. border-radius: 40rpx 40rpx 0 0;
  294. background: #ffffff;
  295. overflow: hidden;
  296. flex-wrap: nowrap;
  297. transform: translateY(100%);
  298. transition: transform 0.3s;
  299. &.on {
  300. transform: translateY(0);
  301. }
  302. .popup-hd {
  303. position: relative;
  304. height: 108rpx;
  305. text-align: center;
  306. font-weight: 500;
  307. font-size: 32rpx;
  308. line-height: 108rpx;
  309. color: #333333;
  310. .btn {
  311. position: absolute;
  312. top: 50%;
  313. right: 32rpx;
  314. width: 36rpx;
  315. height: 36rpx;
  316. border-radius: 50%;
  317. background: #eeeeee;
  318. transform: translateY(-50%);
  319. text-align: center;
  320. line-height: 36rpx;
  321. }
  322. .iconfont {
  323. vertical-align: middle;
  324. font-size: 24rpx;
  325. color: #333333;
  326. }
  327. }
  328. .popup-bd {
  329. position: relative;
  330. flex: 1;
  331. min-height: 0;
  332. box-sizing: border-box;
  333. ::v-deep.shoppingCart {
  334. position: absolute;
  335. top: 0;
  336. right: 0;
  337. bottom: 0;
  338. left: 0;
  339. display: flex;
  340. flex-direction: column;
  341. padding: 0;
  342. .content {
  343. flex: 1;
  344. min-height: 0;
  345. overflow-y: auto;
  346. margin-top: 0;
  347. padding: 36rpx 32rpx;
  348. border-radius: 0;
  349. .item {
  350. margin-bottom: 48rpx;
  351. }
  352. }
  353. .footer {
  354. position: static;
  355. height: 96rpx;
  356. padding-bottom: 0;
  357. }
  358. }
  359. }
  360. .popup-ft {
  361. padding: 16rpx 20rpx 16rpx 32rpx;
  362. .btn {
  363. height: 64rpx;
  364. padding: 0 32rpx;
  365. border-radius: 32rpx;
  366. background: $primary-admin;
  367. font-weight: 500;
  368. font-size: 24rpx;
  369. line-height: 64rpx;
  370. color: #ffffff;
  371. }
  372. }
  373. }
  374. .boxs {
  375. position: fixed;
  376. top: 0;
  377. bottom: 0;
  378. width: 100%;
  379. height: 100%;
  380. z-index: 10;
  381. background-color: #78797a;
  382. .small_box {
  383. position: fixed;
  384. top: 50%;
  385. right: 75rpx;
  386. left: 75rpx;
  387. padding: 40rpx;
  388. border-radius: 32rpx;
  389. background: #ffffff;
  390. transform: translateY(-50%);
  391. image {
  392. width: 100%;
  393. height: 228upx;
  394. }
  395. .content {
  396. // height: 200upx;
  397. text-align: center;
  398. .font {
  399. font-weight: 500;
  400. font-size: 32rpx;
  401. line-height: 52rpx;
  402. color: #333333;
  403. }
  404. .small_font {
  405. margin-top: 24rpx;
  406. font-size: 30rpx;
  407. line-height: 42rpx;
  408. color: #666666;
  409. }
  410. }
  411. .btn-box {
  412. margin-top: 40rpx;
  413. }
  414. .btn {
  415. flex: 1;
  416. height: 72rpx;
  417. border: 1rpx solid $primary-admin;
  418. border-radius: 36rpx;
  419. margin-left: 32rpx;
  420. transform: rotateZ(360deg);
  421. text-align: center;
  422. font-weight: 500;
  423. font-size: 26rpx;
  424. line-height: 70rpx;
  425. color: $primary-admin;
  426. &:first-child {
  427. margin-left: 0;
  428. }
  429. &.on {
  430. background: $primary-admin;
  431. color: #ffffff;
  432. }
  433. }
  434. }
  435. }
  436. </style>