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

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