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

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