You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

order-list-item-new.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <!-- 新办订单item
  2. 新办订单状态:待支付、审核中、审核不通过、待发货、待收货、待激活、已完成、已取消、已结束、退货、换货-->
  3. <template>
  4. <view :class="item.orderStatus == OrderStatus.已取消 ? 'item finished' : 'item'"
  5. @click.stop="gotoOrderDetails(item,1)">
  6. <view class="head">
  7. <view class="name">
  8. <image :src="`${$imgUrl}order/icon-star-green.png`" class="icon" mode="aspectFill"></image>
  9. <text class="title">{{item.productName ?item.productName: ''}}</text>
  10. </view>
  11. <view class="status text-orange" v-if="item.orderStatus == OrderStatus.已取消">已取消</view>
  12. <view class="status text-green" v-else
  13. :class="{'text-orange':item.orderStep == OrderStatus.已完成 || item.orderStep == OrderStatus.已结束
  14. || item.orderStep == OrderStatus['换货-设备已回收'] || item.orderStep == OrderStatus.退款成功 || item.orderStep == OrderStatus.退货成功}">
  15. {{getOrderStatusName(item.orderStep)}}
  16. </view>
  17. </view>
  18. <view class="detail">
  19. <view class="orders">
  20. <view class="order-text">
  21. <text class="type">新办单号:</text>
  22. <text class="value">{{item.orderId}}</text>
  23. </view>
  24. <view class="order-text odd">
  25. <text class="type">业务类型:</text>
  26. <text class="value">{{getOrderTypeName(item.orderType)}}</text>
  27. </view>
  28. <view class="order-text">
  29. <text class="type">订单车牌号:</text>
  30. <text class="value">{{item.vehiclePlate}}</text>
  31. </view>
  32. <view class="order-text odd">
  33. <text class="type">订单车牌颜色:</text>
  34. <text class="value">{{getVehiclePlateColor(item.vehiclePlateColor)}}</text>
  35. </view>
  36. </view>
  37. <view class="money"><text class="cny">¥</text><text class="amount"
  38. v-if="item.amount">{{item.amount / 100}}</text><text class="amount" v-else>0.00</text>
  39. </view>
  40. </view>
  41. <!-- item.orderSource==1 app -->
  42. <view v-if="item.orderStatus != OrderStatus.已取消 && !item.orderSource">
  43. <!-- 微信小程序正常 -->
  44. <view>
  45. <!-- 信息填写未完成 -->
  46. <view class="btns"
  47. v-if="item.orderStep == OrderStatus['完成个人/单位信息上传'] || item.orderStep == OrderStatus.完成填写基本信息 || item.orderStep == OrderStatus.完成车辆信息上传 || item.orderStep == OrderStatus.待支付3">
  48. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  49. <view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">继续申请</view>
  50. </view>
  51. <!-- 待支付 -->
  52. <view class="btns" v-if="item.orderStep == OrderStatus.待加购权益">
  53. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  54. <view class="btn btn-primary" @click.stop="gotoEditUserOrUnitInfo(item)">加购权益</view>
  55. </view>
  56. <view class="btns" v-if="item.orderStep == OrderStatus['完成车辆信息上传/待支付']">
  57. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  58. <view class="btn btn-primary" @click.stop="gotoOrderDetailsPay(item)">支付</view>
  59. </view>
  60. <view class="btns" v-if="item.orderStep == OrderStatus.待支付2">
  61. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  62. <view class="btn btn-primary" @click.stop="gotoOrderDetailsPay(item)">支付</view>
  63. </view>
  64. <view class="btns" v-if="item.orderStep == OrderStatus['已支付/待签约']">
  65. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  66. <view class="btn btn-primary" @click.stop="gotoOrderSign(item)">去签约</view>
  67. </view>
  68. <!-- 审核中/审核不通过 -->
  69. <view class="btns" v-if="item.orderStep == OrderStatus.待审核 || item.orderStep == OrderStatus.审核不通过">
  70. <!-- <view class="btn btn-normal" v-if="item.orderStep == OrderStatus.审核不通过"
  71. @click.stop="gotoEditUserOrUnitInfo(item)">修改资料</view> -->
  72. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  73. </view>
  74. <!-- 待发货 -->
  75. <view class="btns" v-else-if="item.orderStep == OrderStatus.待发货">
  76. <view class="btn btn-normal" @click.stop="gotoCancelOrder(item)">取消订单</view>
  77. </view>
  78. <!-- 待收货 -->
  79. <view class="btns" v-else-if="item.orderStep == OrderStatus.待收货">
  80. <view class="btn btn-normal" @click.stop="gotoCheckLogistics(item)">查看物流
  81. </view>
  82. <view class="btn btn-normal" @click.stop="gotoReturnOrder(item)">申请退货
  83. </view>
  84. <view class="btn btn-primary" @click.stop="gotoConfirmReceipt(item)">确认收货</view>
  85. <view class="btn btn-primary" @click.stop="closeOrder(item)" v-if="item.finishOrder">结束订单</view>
  86. </view>
  87. <!-- 待激活 -->
  88. <view class="btns" v-else-if="item.orderStep == OrderStatus.待激活">
  89. <view class="btn btn-normal" @click.stop="gotoReturnOrder(item)" v-if="item.applyReturn">申请退货</view>
  90. <view class="btn btn-normal" @click.stop="gotoExchangeOrder(item)">申请换货</view>
  91. <view class="btn btn-primary" @click.stop="gotoReplenishmentOrder(item)" v-if="item.deviceType == deviceType">申请补货</view>
  92. <view class="btn btn-primary" @click.stop="gotoActiveOrder(item)">去激活</view>
  93. <view class="btn btn-primary" @click.stop="closeOrder(item)" v-if="item.finishOrder">结束订单</view>
  94. </view>
  95. <!-- ORDER_STEP_31(31, "异地-售前退货"),
  96. ORDER_STEP_32(32, "异地-售前退货后确认收货"),
  97. ORDER_STEP_33(33, "异地-售前换货"), 33包含换货和补货 如果item.orderType=='REPLENISHMENT'是补货 就不展示换货
  98. ORDER_STEP_34(34, "异地-售前换货后确认收货"), -->
  99. <view class="btns" v-else-if="item.orderStep == 31">
  100. <view class="btn btn-primary" @click.stop="gotoReturnOrder(item)" >退货</view>
  101. </view>
  102. <view class="btns" v-else-if="item.orderStep==33">
  103. <view class="btn btn-primary" @click.stop="gotoExchangeOrder(item)" v-if="item.orderType!='REPLENISHMENT'">换货</view>
  104. </view>
  105. <!-- 已完成 售后订单不允许评价产品,储值卡转记账卡除外-->
  106. <!-- 发行产品 isProduct=0; 业务员 isStaff=0; 权益 isEquity=0 业务服务 isService=0; -->
  107. <view class="btns"
  108. v-else-if="item.orderStep == OrderStatus.已完成 && (item.orderType =='ISSUE' || item.orderType =='VALUE_TO_ACCOUNT') ">
  109. <view class="btn btn-normal" v-if="( item.isProduct==1 && item.isService==1) ">
  110. 已评价
  111. </view>
  112. <view class='evaluation' v-else>
  113. <view class="btn btn-primary" v-if="item.isProduct==0 || item.isService==0"
  114. @click.stop="gotoEvaluateProduct(item)">去评价产品</view>
  115. </view>
  116. </view>
  117. <!-- 已结束 -->
  118. <view class="btns" v-else-if="item.orderStep == OrderStatus.已结束 && item.isUseAgain">
  119. <view class="btn btn-primary" @click.stop="gotoAgainUseOrder(item)">再次使用订单</view>
  120. </view>
  121. <!-- 异地-邮寄地址填写 -->
  122. <view class="btns" v-else-if="item.orderStep == OrderStatus.邮寄地址填写 && item.deviceType==deviceType">
  123. <view class="btn btn-primary" @click.stop="gotoAddressOrder(item)">邮寄地址填写</view>
  124. </view>
  125. </view>
  126. <!-- 换货中 -->
  127. <!-- '完成签约' = 5,
  128. '已申请-退货' = 13,
  129. '退款中' = 15,
  130. '退款成功' = 16,
  131. '退货成功' = 17,
  132. '换货-设备已回收' = 18, -->
  133. </view>
  134. <view v-else>
  135. <!-- 待激活 -->
  136. <view class="btns" v-if="item.orderStep == OrderStatus.待激活">
  137. <view class="btn btn-primary" @click.stop="gotoActiveOrder(item)">去激活</view>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 弹窗 -->
  142. <u-popup v-model="showActiveOrder" mode="center">
  143. <popup-active-order content="确认是否重新激活订单" @cancel="showActiveOrder = false" @confirm="toActiveOrder">
  144. </popup-active-order>
  145. </u-popup>
  146. </template>
  147. <script lang="ts" setup>
  148. import popupActiveOrder from "./popup-active-order.vue";
  149. import useOrderSkip from "@/composables/order/useOrderSkip";
  150. import { deviceType } from "@/utils/network/difference";
  151. import {
  152. getOrderStatusName,
  153. msg,
  154. getOrderTypeName
  155. } from "@/utils/utils";
  156. import {
  157. ref
  158. } from "vue";
  159. import {
  160. OrderStatus
  161. } from "@/datas/enum";
  162. import {
  163. vehiclePlateColor
  164. } from "@/datas/vehiclePlateColor";
  165. import { source } from "@/utils/network/difference";
  166. defineProps({
  167. item: {
  168. type: Object,
  169. default: () => ({}),
  170. },
  171. });
  172. //是否确认激活订单弹窗
  173. const showActiveOrder = ref(false);
  174. //办理订单按钮跳转业务逻辑
  175. const {
  176. gotoEditAddress,
  177. gotoCancelOrder,
  178. gotoEditUserOrUnitInfo,
  179. gotoConfirmReceipt,
  180. gotoCheckLogistics,
  181. gotoEvaluateOrder,
  182. gotoEvaluateProduct,
  183. gotoEvaluateSalesman,
  184. gotoActiveOrder,
  185. gotoReturnOrder,
  186. gotoExchangeOrder,
  187. gotoOrderDetailsPay,
  188. gotoOrderDetails,
  189. gotoAgainUseOrder,
  190. gotoOrderSign,
  191. closeOrder,
  192. gotoReplenishmentOrder,
  193. gotoAddressOrder
  194. } = useOrderSkip();
  195. //激活订单
  196. const toActiveOrder = (item) => {
  197. gotoActiveOrder(item);
  198. showActiveOrder.value = false;
  199. }
  200. //获取车牌颜色文字
  201. const getVehiclePlateColor = (id : number) => {
  202. const colors = vehiclePlateColor.filter(item => item.id == id);
  203. return colors[0].color
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .item {
  208. background: #ffffff;
  209. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  210. border-radius: 20rpx;
  211. box-sizing: border-box;
  212. display: flex;
  213. flex-direction: column;
  214. margin: 30rpx 30rpx 0rpx;
  215. }
  216. .bg-white .item {
  217. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  218. }
  219. .item .head {
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. padding: 20rpx 28rpx;
  224. border-bottom: 1px solid #dcdcdc;
  225. }
  226. .item .head {
  227. .head-row {
  228. display: flex;
  229. width: 100%;
  230. justify-content: space-between;
  231. align-items: center;
  232. }
  233. .name {}
  234. .name>text {
  235. font-size: 26rpx;
  236. font-family: Noto Sans S Chinese;
  237. font-weight: 400;
  238. color: #999999;
  239. line-height: 36rpx;
  240. }
  241. }
  242. .item .head .icon {
  243. width: 48rpx;
  244. height: 48rpx;
  245. }
  246. .item .head .name {
  247. display: flex;
  248. align-items: center;
  249. }
  250. .text-green {
  251. font-size: 26rpx;
  252. color: #00b38b;
  253. }
  254. .text-orange {
  255. font-size: 26rpx;
  256. color: #ff8000;
  257. }
  258. .text-black {
  259. font-size: 28rpx;
  260. color: #333;
  261. font-weight: 500;
  262. }
  263. .title {
  264. font-size: 30rpx;
  265. color: #333;
  266. }
  267. .tag-green {
  268. font-size: 22rpx;
  269. height: 40rpx;
  270. line-height: 40rpx;
  271. padding: 0 12rpx;
  272. border-radius: 6rpx;
  273. background: #d9f4ee;
  274. color: #00b38b;
  275. }
  276. .tag-grey {
  277. font-size: 22rpx;
  278. height: 40rpx;
  279. line-height: 40rpx;
  280. padding: 0 12rpx;
  281. border-radius: 6rpx;
  282. background: #e8e8e8;
  283. color: #666;
  284. }
  285. .detail {
  286. display: flex;
  287. justify-content: space-between;
  288. align-items: center;
  289. padding: 30rpx 32rpx;
  290. }
  291. .detail .type {
  292. font-size: 26rpx;
  293. color: #999;
  294. }
  295. .detail .value {
  296. font-size: 26rpx;
  297. color: #333;
  298. }
  299. .finished .detail .value {
  300. color: #999;
  301. }
  302. .detail .odd {
  303. margin: 20rpx 0;
  304. }
  305. .cny {
  306. font-size: 26rpx;
  307. color: #333;
  308. }
  309. .finished .cny {
  310. color: #999;
  311. }
  312. .amount {
  313. font-size: 40rpx;
  314. font-weight: bold;
  315. }
  316. .bottom .amount {
  317. color: #ff8000;
  318. }
  319. .finished .amount {
  320. color: #999;
  321. }
  322. .btns {
  323. position: relative;
  324. display: flex;
  325. align-items: center;
  326. justify-content: flex-end;
  327. border-top: 1px solid #dcdcdc;
  328. margin: 0 30rpx;
  329. padding: 20rpx 0;
  330. }
  331. .bottom {
  332. display: flex;
  333. justify-content: space-between;
  334. align-items: center;
  335. border-top: 1px solid #dcdcdc;
  336. margin: 0 30rpx;
  337. padding: 20rpx 0;
  338. }
  339. .btn {
  340. height: 60rpx;
  341. line-height: 58rpx;
  342. border-radius: 30rpx;
  343. padding: 0 24rpx;
  344. font-size: 23rpx;
  345. box-sizing: border-box;
  346. margin-right: 12rpx;
  347. }
  348. .btns .btn:last-child {
  349. margin: 0;
  350. }
  351. .btns .state {
  352. position: absolute;
  353. left: 0;
  354. font-size: 26rpx;
  355. font-family: Noto Sans S Chinese;
  356. font-weight: 400;
  357. color: #999999;
  358. line-height: 58rpx;
  359. text {
  360. font-size: 26rpx;
  361. font-family: Noto Sans S Chinese;
  362. font-weight: 400;
  363. color: #00B38B;
  364. line-height: 58rpx;
  365. }
  366. }
  367. .btn-primary {
  368. border: 1px solid #00b38b;
  369. color: #00b38b;
  370. }
  371. .btn-disable {
  372. border: 1px solid #999;
  373. color: #999;
  374. }
  375. .btn-normal {
  376. border: 1px solid #dcdcdc;
  377. color: #333;
  378. }
  379. .evaluation {
  380. display: flex;
  381. }
  382. </style>