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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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. {{(item.orderStep==12 && item.reshipment==1)?"补货中":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. ORDER_STEP_35(35, "异地-下单-->
  100. <view class="btns" v-else-if="item.orderStep == 31">
  101. <view class="btn btn-primary" @click.stop="gotoReturnOrder(item)" >退货</view>
  102. </view>
  103. <view class="btns" v-else-if="item.orderStep==33">
  104. <view class="btn btn-primary" @click.stop="gotoExchangeOrder(item)" v-if="item.orderType!='REPLENISHMENT'">换货</view>
  105. </view>
  106. <view class="btns" v-else-if="item.orderStep == 35">
  107. <view class="btn btn-primary" @click.stop="placeAnOrder(item)" >下单</view>
  108. </view>
  109. <!-- 已完成 售后订单不允许评价产品,储值卡转记账卡除外-->
  110. <!-- 发行产品 isProduct=0; 业务员 isStaff=0; 权益 isEquity=0 业务服务 isService=0; -->
  111. <view class="btns"
  112. v-else-if="item.orderStep == OrderStatus.已完成 && (item.orderType =='ISSUE' || item.orderType =='VALUE_TO_ACCOUNT') ">
  113. <view class="btn btn-normal" v-if="( item.isProduct==1 && item.isService==1) ">
  114. 已评价
  115. </view>
  116. <view class='evaluation' v-else>
  117. <view class="btn btn-primary" v-if="item.isProduct==0 || item.isService==0"
  118. @click.stop="gotoEvaluateProduct(item)">去评价产品</view>
  119. </view>
  120. </view>
  121. <!-- 已结束 -->
  122. <view class="btns" v-else-if="item.orderStep == OrderStatus.已结束 && item.isUseAgain">
  123. <view class="btn btn-primary" @click.stop="gotoAgainUseOrder(item)">再次使用订单</view>
  124. </view>
  125. <!-- 异地-邮寄地址填写 -->
  126. <view class="btns" v-else-if="item.orderStep == OrderStatus.邮寄地址填写 && item.deviceType==deviceType">
  127. <view class="btn btn-primary" @click.stop="gotoAddressOrder(item)">邮寄地址填写</view>
  128. </view>
  129. </view>
  130. <!-- 换货中 -->
  131. <!-- '完成签约' = 5,
  132. '已申请-退货' = 13,
  133. '退款中' = 15,
  134. '退款成功' = 16,
  135. '退货成功' = 17,
  136. '换货-设备已回收' = 18, -->
  137. </view>
  138. <view v-else>
  139. <!-- 待激活 -->
  140. <view class="btns" v-if="item.orderStep == OrderStatus.待激活">
  141. <view class="btn btn-primary" @click.stop="gotoActiveOrder(item)">去激活</view>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- 弹窗 -->
  146. <u-popup v-model="showActiveOrder" mode="center">
  147. <popup-active-order content="确认是否重新激活订单" @cancel="showActiveOrder = false" @confirm="toActiveOrder">
  148. </popup-active-order>
  149. </u-popup>
  150. </template>
  151. <script lang="ts" setup>
  152. import popupActiveOrder from "./popup-active-order.vue";
  153. import useOrderSkip from "@/composables/order/useOrderSkip";
  154. import { deviceType } from "@/utils/network/difference";
  155. import {
  156. getOrderStatusName,
  157. msg,
  158. getOrderTypeName
  159. } from "@/utils/utils";
  160. import {
  161. ref
  162. } from "vue";
  163. import {
  164. OrderStatus
  165. } from "@/datas/enum";
  166. import {
  167. vehiclePlateColor
  168. } from "@/datas/vehiclePlateColor";
  169. import { source } from "@/utils/network/difference";
  170. defineProps({
  171. item: {
  172. type: Object,
  173. default: () => ({}),
  174. },
  175. });
  176. //是否确认激活订单弹窗
  177. const showActiveOrder = ref(false);
  178. //办理订单按钮跳转业务逻辑
  179. const {
  180. gotoEditAddress,
  181. gotoCancelOrder,
  182. gotoEditUserOrUnitInfo,
  183. gotoConfirmReceipt,
  184. gotoCheckLogistics,
  185. gotoEvaluateOrder,
  186. gotoEvaluateProduct,
  187. gotoEvaluateSalesman,
  188. gotoActiveOrder,
  189. gotoReturnOrder,
  190. gotoExchangeOrder,
  191. gotoOrderDetailsPay,
  192. gotoOrderDetails,
  193. gotoAgainUseOrder,
  194. gotoOrderSign,
  195. closeOrder,
  196. gotoReplenishmentOrder,
  197. gotoAddressOrder,
  198. placeAnOrder
  199. } = useOrderSkip();
  200. //激活订单
  201. const toActiveOrder = (item) => {
  202. gotoActiveOrder(item);
  203. showActiveOrder.value = false;
  204. }
  205. //获取车牌颜色文字
  206. const getVehiclePlateColor = (id : number) => {
  207. const colors = vehiclePlateColor.filter(item => item.id == id);
  208. return colors[0].color
  209. }
  210. </script>
  211. <style lang="scss" scoped>
  212. .item {
  213. background: #ffffff;
  214. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  215. border-radius: 20rpx;
  216. box-sizing: border-box;
  217. display: flex;
  218. flex-direction: column;
  219. margin: 30rpx 30rpx 0rpx;
  220. }
  221. .bg-white .item {
  222. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  223. }
  224. .item .head {
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. padding: 20rpx 28rpx;
  229. border-bottom: 1px solid #dcdcdc;
  230. }
  231. .item .head {
  232. .head-row {
  233. display: flex;
  234. width: 100%;
  235. justify-content: space-between;
  236. align-items: center;
  237. }
  238. .name {}
  239. .name>text {
  240. font-size: 26rpx;
  241. font-family: Noto Sans S Chinese;
  242. font-weight: 400;
  243. color: #999999;
  244. line-height: 36rpx;
  245. }
  246. }
  247. .item .head .icon {
  248. width: 48rpx;
  249. height: 48rpx;
  250. }
  251. .item .head .name {
  252. display: flex;
  253. align-items: center;
  254. }
  255. .text-green {
  256. font-size: 26rpx;
  257. color: #00b38b;
  258. }
  259. .text-orange {
  260. font-size: 26rpx;
  261. color: #ff8000;
  262. }
  263. .text-black {
  264. font-size: 28rpx;
  265. color: #333;
  266. font-weight: 500;
  267. }
  268. .title {
  269. font-size: 30rpx;
  270. color: #333;
  271. }
  272. .tag-green {
  273. font-size: 22rpx;
  274. height: 40rpx;
  275. line-height: 40rpx;
  276. padding: 0 12rpx;
  277. border-radius: 6rpx;
  278. background: #d9f4ee;
  279. color: #00b38b;
  280. }
  281. .tag-grey {
  282. font-size: 22rpx;
  283. height: 40rpx;
  284. line-height: 40rpx;
  285. padding: 0 12rpx;
  286. border-radius: 6rpx;
  287. background: #e8e8e8;
  288. color: #666;
  289. }
  290. .detail {
  291. display: flex;
  292. justify-content: space-between;
  293. align-items: center;
  294. padding: 30rpx 32rpx;
  295. }
  296. .detail .type {
  297. font-size: 26rpx;
  298. color: #999;
  299. }
  300. .detail .value {
  301. font-size: 26rpx;
  302. color: #333;
  303. }
  304. .finished .detail .value {
  305. color: #999;
  306. }
  307. .detail .odd {
  308. margin: 20rpx 0;
  309. }
  310. .cny {
  311. font-size: 26rpx;
  312. color: #333;
  313. }
  314. .finished .cny {
  315. color: #999;
  316. }
  317. .amount {
  318. font-size: 40rpx;
  319. font-weight: bold;
  320. }
  321. .bottom .amount {
  322. color: #ff8000;
  323. }
  324. .finished .amount {
  325. color: #999;
  326. }
  327. .btns {
  328. position: relative;
  329. display: flex;
  330. align-items: center;
  331. justify-content: flex-end;
  332. border-top: 1px solid #dcdcdc;
  333. margin: 0 30rpx;
  334. padding: 20rpx 0;
  335. }
  336. .bottom {
  337. display: flex;
  338. justify-content: space-between;
  339. align-items: center;
  340. border-top: 1px solid #dcdcdc;
  341. margin: 0 30rpx;
  342. padding: 20rpx 0;
  343. }
  344. .btn {
  345. height: 60rpx;
  346. line-height: 58rpx;
  347. border-radius: 30rpx;
  348. padding: 0 24rpx;
  349. font-size: 23rpx;
  350. box-sizing: border-box;
  351. margin-right: 12rpx;
  352. }
  353. .btns .btn:last-child {
  354. margin: 0;
  355. }
  356. .btns .state {
  357. position: absolute;
  358. left: 0;
  359. font-size: 26rpx;
  360. font-family: Noto Sans S Chinese;
  361. font-weight: 400;
  362. color: #999999;
  363. line-height: 58rpx;
  364. text {
  365. font-size: 26rpx;
  366. font-family: Noto Sans S Chinese;
  367. font-weight: 400;
  368. color: #00B38B;
  369. line-height: 58rpx;
  370. }
  371. }
  372. .btn-primary {
  373. border: 1px solid #00b38b;
  374. color: #00b38b;
  375. }
  376. .btn-disable {
  377. border: 1px solid #999;
  378. color: #999;
  379. }
  380. .btn-normal {
  381. border: 1px solid #dcdcdc;
  382. color: #333;
  383. }
  384. .evaluation {
  385. display: flex;
  386. }
  387. </style>