您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

order-details-new.vue 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. <!-- 新办订单-订单详情 -->
  2. <template>
  3. <view class="wrapper">
  4. <!-- 只有审核中、审核不通过和待发货订单有地址信息显示 -->
  5. <template v-if="state.orderInfo.orderStatus != OrderStatus.已取消">
  6. <view class="address-box as-gravity-center-start as-layout-horizontal"
  7. v-if="state.orderInfo.orderStep == OrderStatus.待审核 || state.orderInfo.orderStep == OrderStatus.审核不通过 || state.orderInfo.orderStep == OrderStatus.待发货">
  8. <view class="avatar as-gravity-center">
  9. {{state.orderInfo.orderInfoExt.consignee != null ? state.orderInfo.orderInfoExt.consignee.charAt(0) : ''}}
  10. </view>
  11. <view class="center" style="flex:1">
  12. <view class="as-layout-horizontal">
  13. <view class="name">
  14. {{state.orderInfo.orderInfoExt.consignee ?state.orderInfo.orderInfoExt.consignee: ''}}
  15. </view>
  16. <view class="phone">
  17. {{state.orderInfo.orderInfoExt.consigneeTel ?state.orderInfo.orderInfoExt.consigneeTel: ''}}
  18. </view>
  19. </view>
  20. <view class="addr">{{state.orderInfo.orderInfoExt.region ?state.orderInfo.orderInfoExt.region: ''}}
  21. {{state.orderInfo.orderInfoExt.address ?state.orderInfo.orderInfoExt.address: ''}}
  22. </view>
  23. </view>
  24. <image :src="`${$imgUrl}applyCard/edit.png`" mode="" class="edit"
  25. @click="gotoEditAddress(state.orderInfo)"></image>
  26. </view>
  27. </template>
  28. <view class="detail-box">
  29. <view class="detail-header">
  30. <image class="d-img" :src="`${$imgUrl}order/icon-star-green.png`"></image>
  31. <text class="detail-name">{{state.orderInfo.productName ?state.orderInfo.productName: ''}}</text>
  32. </view>
  33. <view class="detail-content">
  34. <view class="base-info-box">
  35. <!-- 基础信息 -->
  36. <view class="base-info">
  37. <view class="d-row">
  38. <text class="d-label">新办单号:</text>
  39. <text class="d-value">{{state.orderInfo.orderNo}}</text>
  40. </view>
  41. <!-- <view class="d-row">
  42. <text class="d-label">业务类型:</text>
  43. <text class="d-value">{{getOrderTypeName(state.orderInfo.orderType)}}</text>
  44. </view> -->
  45. <view class="d-row">
  46. <text class="d-label">订单车牌:</text>
  47. <text class="d-value">{{state.orderInfo.vehiclePlate}}</text>
  48. </view>
  49. <view class="d-row">
  50. <text class="d-label">所属类型:</text>
  51. <!-- PERSONAL USER:个人 UNIT_USER:单位 -->
  52. <text class="d-value">{{state.orderInfo.userType === 'UNIT_USER' ? '单位' : '个人'}}</text>
  53. </view>
  54. <view class="d-row">
  55. <text class="d-label">车辆类型:</text>
  56. <text class="d-value">{{getCarTypeName(state.orderInfo.vanType)}}</text>
  57. </view>
  58. <view class="d-row" v-if="getCarTypeName(state.orderInfo.vanType)=='货车'">
  59. <text class="d-label">牵引车:</text>
  60. <text class="d-value">{{state.orderInfo.tractorSign=='1'?'是':'否'}}</text>
  61. </view>
  62. <view class="d-row">
  63. <text class="d-label">订单金额:</text>
  64. <text class="d-value text-orange">¥
  65. {{state.orderInfo.amount / 100 ?state.orderInfo.amount / 100: '0.00'}}</text>
  66. </view>
  67. <view class="d-row">
  68. <text class="d-label">订单状态:</text>
  69. <text v-if="state.orderInfo.orderStep == 12 && state.reshipment=='1'" class="d-value text-green">补货中</text>
  70. <text v-if="state.orderInfo.orderStatus == OrderStatus.已取消 && state.orderInfo.remoteStatus=='7'" class="d-value text-green">审核不通过</text>
  71. <text v-else-if="state.orderInfo.orderStep == 35" class="d-value text-green">下单</text>
  72. <text v-else class="d-value text-green">{{state.orderInfo.orderStatus == OrderStatus.已取消 ? '已取消' : $util.getOrderStatusName(state.orderInfo.orderStep)}}</text>
  73. </view>
  74. <view class="d-row">
  75. <text class="d-label">创建时间:</text>
  76. <text class="d-value">{{getOrderTime(state.orderInfo.insertTime)}}</text>
  77. </view>
  78. </view>
  79. <!-- 已取消订单信息 -->
  80. <view v-if="state.orderInfo.orderStatus == OrderStatus.已取消">
  81. <view class="d-row" v-if="state.orderInfo.orderStep > OrderStatus.已支付">
  82. <text class="d-label">付款时间:</text>
  83. <text
  84. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.payTime:"")}}</text>
  85. </view>
  86. <view class="d-row">
  87. <text class="d-label">取消时间:</text>
  88. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.cancelTime)}}</text>
  89. </view>
  90. <view class="d-row" v-if="state.orderInfo.staffName">
  91. <text class="d-label">业 务 员:</text>
  92. <text class="d-value">{{state.orderInfo.staffName}}</text>
  93. </view>
  94. <view class="d-row">
  95. <text class="d-label">取消原因:</text>
  96. <text
  97. class="d-value">{{state.orderInfo.orderInfoExt.cancelReason ?state.orderInfo.orderInfoExt.cancelReason: ''}}</text>
  98. </view>
  99. </view>
  100. <view v-else>
  101. <!-- 审核中/审核不通过订单信息 -->
  102. <view
  103. v-if="state.orderInfo.orderStep == OrderStatus.审核不通过 || state.orderInfo.orderStep == OrderStatus.待审核">
  104. <view class="d-row" v-if="state.orderInfo.orderInfoExt.payTime">
  105. <text class="d-label">付款时间:</text>
  106. <text
  107. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.payTime:"")}}</text>
  108. </view>
  109. <view class="d-row" v-if="state.orderInfo.orderStep == OrderStatus.审核不通过">
  110. <text class="d-label">不通过原因:</text>
  111. <text
  112. class="d-value">{{state.orderInfo.orderInfoExt.auditReason ?state.orderInfo.orderInfoExt.auditReason: ''}}</text>
  113. </view>
  114. </view>
  115. <!-- 待发货 -->
  116. <view v-if="state.orderInfo.orderStep == OrderStatus.待发货">
  117. <view class="d-row" v-if="state.orderInfo.orderInfoExt.payTime">
  118. <text class="d-label">付款时间:</text>
  119. <text
  120. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.payTime:"")}}</text>
  121. </view>
  122. <view class="d-row" v-if="state.orderInfo.staffName">
  123. <text class="d-label">业 务 员:</text>
  124. <text class="d-value">{{state.orderInfo.staffName}}</text>
  125. </view>
  126. </view>
  127. <!-- 待收货/待激活/已结束/换货/退货-->
  128. <view v-if="state.orderInfo.orderStep == OrderStatus.待收货 || state.orderInfo.orderStep == OrderStatus.待激活
  129. || state.orderInfo.orderStep == OrderStatus.已结束
  130. || state.orderInfo.orderStep == OrderStatus['已申请-换货']
  131. || state.orderInfo.orderStep == OrderStatus['已申请-退货']">
  132. <view class="d-row" v-if="state.orderInfo.orderInfoExt.payTime">
  133. <text class="d-label">付款时间:</text>
  134. <text
  135. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.payTime:'')}}</text>
  136. </view>
  137. <view class="d-row">
  138. <text class="d-label">发货时间:</text>
  139. <text
  140. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.deliveryTime:"")}}</text>
  141. </view>
  142. <view class="d-row" v-if="state.orderInfo.orderStep != OrderStatus.待收货">
  143. <text class="d-label">收货时间:</text>
  144. <text
  145. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.receivingTime:"")}}</text>
  146. </view>
  147. <view class="d-row">
  148. <text class="d-label">卡 号:</text>
  149. <text class="d-value">{{state.orderInfo.cardId ?state.orderInfo.cardId: ''}}</text>
  150. </view>
  151. <view class="d-row" v-if="state.orderInfo.cardStatus">
  152. <text class="d-label">卡 状 态:</text>
  153. <text class="d-value">{{getETCStatusName(state.orderInfo.cardStatus)}}</text>
  154. </view>
  155. <view class="d-row">
  156. <text class="d-label">OBU 号:</text>
  157. <text class="d-value">{{state.orderInfo.obuId ?state.orderInfo.obuId: ''}}</text>
  158. </view>
  159. <view class="d-row" v-if="state.orderInfo.obuStatus">
  160. <text class="d-label">OBU状态:</text>
  161. <text class="d-value">{{getOBUStatusName(state.orderInfo.obuStatus)}}</text>
  162. </view>
  163. <view class="d-row" v-if="state.orderInfo.staffName">
  164. <text class="d-label">业 务 员:</text>
  165. <text class="d-value">{{state.orderInfo.staffName}}</text>
  166. </view>
  167. <view class="d-row">
  168. <text class="d-label">快递单号:</text>
  169. <text
  170. class="d-value">{{state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.trackingNumber: ''}}</text>
  171. </view>
  172. <view class="d-row">
  173. <text class="d-label">物流公司:</text>
  174. <text
  175. class="d-value">{{state.orderInfo.orderInfoExt?getCodeName('快递物流公司',state.orderInfo.orderInfoExt.courierCompany): ''}}</text>
  176. </view>
  177. </view>
  178. <!-- 订单已完成 -->
  179. <view v-if="state.orderInfo.orderStep == OrderStatus.已完成">
  180. <view class="d-row" v-if="state.orderInfo.orderInfoExt.payTime">
  181. <text class="d-label">付款时间:</text>
  182. <text
  183. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.payTime:"")}}</text>
  184. </view>
  185. <view class="d-row">
  186. <text class="d-label">发货时间:</text>
  187. <text
  188. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.deliveryTime:"")}}</text>
  189. </view>
  190. <view class="d-row">
  191. <text class="d-label">收货时间:</text>
  192. <text
  193. class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt?state.orderInfo.orderInfoExt.receivingTime:"")}}</text>
  194. </view>
  195. <view class="d-row">
  196. <text class="d-label">激活时间:</text>
  197. <text class="d-value">{{getOrderTime(state.orderInfo.cardEnableTime)}}</text>
  198. </view>
  199. <view class="d-row">
  200. <text class="d-label">卡 号:</text>
  201. <text class="d-value">{{state.orderInfo.cardId ?state.orderInfo.cardId: ''}}</text>
  202. </view>
  203. <view class="d-row" v-if="state.orderInfo.cardStatus">
  204. <text class="d-label">卡 状 态:</text>
  205. <text class="d-value">{{getETCStatusName(state.orderInfo.cardStatus)}}</text>
  206. </view>
  207. <view class="d-row">
  208. <text class="d-label">OBU 号:</text>
  209. <text class="d-value">{{state.orderInfo.obuId ?state.orderInfo.obuId: ''}}</text>
  210. </view>
  211. <view class="d-row" v-if="state.orderInfo.obuStatus">
  212. <text class="d-label">OBU状态:</text>
  213. <text class="d-value">{{getOBUStatusName(state.orderInfo.obuStatus)}}</text>
  214. </view>
  215. <view class="d-row" v-if="state.orderInfo.staffName">
  216. <text class="d-label">业 务 员:</text>
  217. <text class="d-value">{{state.orderInfo.staffName}}</text>
  218. </view>
  219. <view class="d-row">
  220. <text class="d-label">快递单号:</text>
  221. <text
  222. class="d-value">{{state.orderInfo.orderInfoExt ?state.orderInfo.orderInfoExt.trackingNumber: ''}}</text>
  223. </view>
  224. <view class="d-row">
  225. <text class="d-label">物流公司:</text>
  226. <text
  227. class="d-value">{{state.orderInfo.orderInfoExt?getCodeName('快递物流公司',state.orderInfo.orderInfoExt.courierCompany): ''}}</text>
  228. </view>
  229. </view>
  230. </view>
  231. <!-- 售后 -->
  232. <view class="post-sale" v-if="state.orderInfo.orderStep == OrderStatus['已申请-换货']
  233. || state.orderInfo.orderStep == OrderStatus['已申请-退货'] || isHaveAfterSaleInfo()">
  234. <!-- 售后退货-->
  235. <view
  236. v-if="state.orderInfo.orderStep == OrderStatus['已申请-退货'] || !isBlank(state.orderInfo.orderInfoExt && state.orderInfo.orderInfoExt.returnMode)">
  237. <view class="d-row" v-if="state.orderInfo.XXX">
  238. <text class="d-label">售后单号:</text>
  239. <text class="d-value">{{state.orderInfo.XXX ?state.orderInfo.XXX: ''}}</text>
  240. </view>
  241. <view class="d-row">
  242. <text class="d-label">业务类型:</text>
  243. <text class="d-value">退货</text>
  244. </view>
  245. <view class="d-row" v-if="state.orderInfo.cancelTime">
  246. <text class="d-label">创建时间:</text>
  247. <text class="d-value">{{getOrderTime(state.orderInfo.cancelTime)}}</text>
  248. </view>
  249. <view class="d-row">
  250. <text class="d-label">退货方式:</text>
  251. <text
  252. class="d-value">{{state.orderInfo.orderInfoExt.returnMode === 'ON_LINE' ? '线上' : '线下'}}</text>
  253. </view>
  254. <template v-if="state.orderInfo.orderInfoExt.returnMode === 'ON_LINE'">
  255. <view class="d-row">
  256. <text class="d-label">物流公司:</text>
  257. <text
  258. class="d-value">{{state.orderInfo.orderInfoExt.returnLogisticsCompany ?state.orderInfo.orderInfoExt.returnLogisticsCompany: ''}}</text>
  259. </view>
  260. <view class="d-row">
  261. <text class="d-label">快递单号:</text>
  262. <text
  263. class="d-value">{{state.orderInfo.orderInfoExt.returnLogisticsNumber ?state.orderInfo.orderInfoExt.returnLogisticsNumber: ''}}</text>
  264. </view>
  265. </template>
  266. <template v-if="state.orderInfo.orderInfoExt.returnMode === 'OFFLINE'">
  267. <view class="d-row">
  268. <text class="d-label">退货网点:</text>
  269. <text
  270. class="d-value">{{state.orderInfo.orderInfoExt.returnNetworkName ?state.orderInfo.orderInfoExt.returnNetworkName: ''}}</text>
  271. </view>
  272. </template>
  273. <view class="d-row">
  274. <text class="d-label">退货原因:</text>
  275. <text
  276. class="d-value">{{state.orderInfo.orderInfoExt.returnReason ?state.orderInfo.orderInfoExt.returnReason: ''}}</text>
  277. </view>
  278. <view class="d-row" v-if="state.orderInfo.staffName">
  279. <text class="d-label">业 务 员:</text>
  280. <text class="d-value">{{state.orderInfo.staffName}}</text>
  281. </view>
  282. </view>
  283. <!-- 售后换货 -->
  284. <view
  285. v-if="state.orderInfo.orderStep == OrderStatus['已申请-换货'] || !isBlank(state.orderInfo.orderInfoExt.exchangeMode)">
  286. <view class="d-row" v-if="state.orderInfo.XXX">
  287. <text class="d-label">售后单号:</text>
  288. <text class="d-value">{{state.orderInfo.XXX ?state.orderInfo.XXX: ''}}</text>
  289. </view>
  290. <view class="d-row">
  291. <text class="d-label">业务类型:</text>
  292. <text class="d-value">换货</text>
  293. </view>
  294. <view class="d-row" v-if="state.orderInfo.XXX">
  295. <text class="d-label">创建时间:</text>
  296. <text class="d-value">{{getOrderTime(state.orderInfo.XXXX)}}</text>
  297. </view>
  298. <view class="d-row">
  299. <text class="d-label">退货方式:</text>
  300. <text
  301. class="d-value">{{state.orderInfo.orderInfoExt.exchangeMode === 'ON_LINE' ? '线上' : '线下'}}</text>
  302. </view>
  303. <!-- 线上 -->
  304. <template v-if="state.orderInfo.orderInfoExt.exchangeMode === 'ON_LINE'">
  305. <view class="d-row">
  306. <text class="d-label">物流公司:</text>
  307. <text
  308. class="d-value">{{state.orderInfo.orderInfoExt.exchangeLogisticsCompany ?state.orderInfo.orderInfoExt.exchangeLogisticsCompany: ''}}</text>
  309. </view>
  310. <view class="d-row">
  311. <text class="d-label">快递单号:</text>
  312. <text
  313. class="d-value">{{state.orderInfo.orderInfoExt.exchangeLogisticsNumber ?state.orderInfo.orderInfoExt.exchangeLogisticsNumber: ''}}</text>
  314. </view>
  315. <view class="d-row">
  316. <text class="d-label">收货方式:</text>
  317. <text
  318. class="d-value">{{state.orderInfo.orderInfoExt.exchangeRgMode === 'SELF' ? '营业点自提' : '邮寄'}}</text>
  319. </view>
  320. <template v-if="state.orderInfo.orderInfoExt.exchangeRgMode === 'SELF'">
  321. <view class="d-row">
  322. <text class="d-label">自提网点:</text>
  323. <text
  324. class="d-value">{{state.orderInfo.orderInfoExt.exchangeRgNetworkName ?state.orderInfo.orderInfoExt.exchangeRgNetworkName: ''}}</text>
  325. </view>
  326. </template>
  327. <template v-if="state.orderInfo.orderInfoExt.exchangeRgMode === 'MAIL'">
  328. <view class="d-row">
  329. <text class="d-label">收件人姓名:</text>
  330. <text
  331. class="d-value">{{state.orderInfo.orderInfoExt.consignee ?state.orderInfo.orderInfoExt.consignee: ''}}</text>
  332. </view>
  333. <view class="d-row">
  334. <text class="d-label">收件人电话:</text>
  335. <text
  336. class="d-value">{{state.orderInfo.orderInfoExt.consigneeTel ?state.orderInfo.orderInfoExt.consigneeTel: ''}}</text>
  337. </view>
  338. <view class="d-row">
  339. <text class="d-label">收件人地址:</text>
  340. <text class="d-value">{{state.orderInfo.orderInfoExt.address}}</text>
  341. </view>
  342. <view class="d-row" v-if="state.orderInfo.orderInfoExt.postalCode">
  343. <text class="d-label">邮政编码:</text>
  344. <text
  345. class="d-value">{{state.orderInfo.orderInfoExt.postalCode ?state.orderInfo.orderInfoExt.postalCode: ''}}</text>
  346. </view>
  347. </template>
  348. </template>
  349. <!-- 线下 -->
  350. <template v-if="state.orderInfo.orderInfoExt.exchangeMode === 'OFFLINE'">
  351. <view class="d-row">
  352. <text class="d-label">退货网点:</text>
  353. <text
  354. class="d-value">{{state.orderInfo.orderInfoExt.exchangeNetworkName ?state.orderInfo.orderInfoExt.exchangeNetworkName: ''}}</text>
  355. </view>
  356. </template>
  357. <view class="d-row">
  358. <text class="d-label">换货原因:</text>
  359. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeReason}}</text>
  360. </view>
  361. <view class="d-row" v-if="state.orderInfo.staffName">
  362. <text class="d-label">业 务 员:</text>
  363. <text class="d-value">{{state.orderInfo.staffName}}</text>
  364. </view>
  365. </view>
  366. <!-- 已完成订单的售后怎么判断 -->
  367. <!-- TODO 已完成订单存在售后信息的要显示售后信息,但是不知道用什么字段来来判断已完成订单有没有售后信息及哪一种售后信息,需走完订单所有流程在进行测试修改 -->
  368. </view>
  369. </view>
  370. <!-- orderSource类型 SERVICE_HALL app只展示待激活按钮-->
  371. <!-- WECHAT("WECHAT", "九州ETC小程序"),
  372. SERVICE_HALL("SERVICE_HALL", "线上营业厅"),
  373. WEB("WEB", "后台PC端",),
  374. H5("H5", "H5页面", ),
  375. ALI("ALI", "支付宝小程序", ) -->
  376. <!-- 按钮区 -->
  377. <view>
  378. <view class="btn-view"
  379. v-if="state.orderInfo.orderStatus != OrderStatus.已取消 && state.orderInfo['orderSource'] !='SERVICE_HALL'">
  380. <!-- 信息填写未完成 -->
  381. <view class="btn-status"
  382. v-if="state.orderInfo.orderStep == OrderStatus['完成个人/单位信息上传'] || state.orderInfo.orderStep == OrderStatus.完成填写基本信息 || state.orderInfo.orderStep == OrderStatus.待支付3">
  383. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  384. <view class="btn-green" @click="gotoEditUserOrUnitInfo(state.orderInfo)">继续申请</view>
  385. </view>
  386. <!-- 审核中/审核不通过 -->
  387. <view
  388. v-if="state.orderInfo.orderStep == OrderStatus.审核不通过 || state.orderInfo.orderStep == OrderStatus.待审核"
  389. class="btn-status">
  390. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  391. <view class="btn space" @click="gotoEditUserOrUnitInfo(state.orderInfo)" v-if="state.orderInfo.orderStep == OrderStatus.审核不通过">修改资料</view>
  392. <!-- <view class="btn space" v-if="state.orderInfo.orderStep == OrderStatus.审核不通过"
  393. @click="gotoEditUserOrUnitInfo(state.orderInfo)">修改资料</view> -->
  394. <view class="btn-green" @click="gotoEditAddress(state.orderInfo)">修改地址</view>
  395. </view>
  396. <!-- 待支付 -->
  397. <view
  398. v-if="state.orderInfo.orderStep == OrderStatus['完成车辆信息上传/待支付'] || state.orderInfo.orderStep == OrderStatus.待支付2 "
  399. class="btn-status">
  400. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  401. <view class="btn-green width-num-1" @click="gotoOrderDetailsPay(state.orderInfo)">支付</view>
  402. </view>
  403. <!-- 待签约-->
  404. <view v-if="state.orderInfo.orderStep == OrderStatus['已支付/待签约']" class="btn-status">
  405. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  406. <view class="btn-green" @click="gotoOrderSign(state.orderInfo)">去签约</view>
  407. </view>
  408. <!-- 待发货 -->
  409. <view v-if="state.orderInfo.orderStep == OrderStatus.待发货" class="btn-status">
  410. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  411. <view class="btn-green" @click="gotoEditAddress(state.orderInfo)">修改地址</view>
  412. </view>
  413. <!-- 待收货 -->
  414. <view v-if="state.orderInfo.orderStep == OrderStatus.待收货" class="btn-status">
  415. <view class="btn space" @click="gotoCheckLogistics(state.orderInfo)">查看物流</view>
  416. <view class="btn space" @click.stop="gotoReplenishmentOrder(state.orderInfo)" v-if="state.orderInfo.deviceType == deviceType">申请补货</view>
  417. <view class="btn space" @click="gotoReturnOrder(state.orderInfo)" v-else>申请退货</view>
  418. <view class="btn-green space" @click="gotoConfirmReceipt(state.orderInfo)">确认收货</view>
  419. <view class="btn-green" @click.stop="closeOrder(state.orderInfo)"
  420. v-if="state.orderInfo.finishOrder">结束订单</view>
  421. </view>
  422. <!-- 待激活 -->
  423. <!-- 确认收货之后可以退换补 异地 -->
  424. <view v-if="state.orderInfo.orderStep == OrderStatus.待激活" class="btn-status">
  425. <view class="btn space" @click="gotoReturnOrder(state.orderInfo)"
  426. v-if="state.orderInfo.applyReturn || state.orderInfo.deviceType == deviceType">申请退货</view>
  427. <view class="btn space" @click="gotoExchangeOrder(state.orderInfo)">申请换货</view>
  428. <view class="btn space" @click.stop="gotoReplenishmentOrder(state.orderInfo)" v-if="state.orderInfo.deviceType == deviceType">申请补货</view>
  429. <view class="btn-green space" @click="gotoActiveOrder(state.orderInfo)">去激活</view>
  430. <view class="btn-green" @click.stop="closeOrder(state.orderInfo)"
  431. v-if="state.orderInfo.finishOrder">结束订单</view>
  432. </view>
  433. <!-- 订单已结束 -->
  434. <view v-if="state.orderInfo.orderStep == OrderStatus.已结束 && state.orderInfo.isUseAgain"
  435. class="btn-status">
  436. <view class="btn-green" @click.stop="gotoAgainUseOrder(state.orderInfo)">再次使用订单</view>
  437. </view>
  438. <!-- 异地-邮寄地址填写 -->
  439. <view v-if="state.orderInfo.orderStep == OrderStatus.邮寄地址填写 && state.orderInfo.deviceType==deviceType"
  440. class="btn-status">
  441. <view class="btn-green" @click.stop="gotoAddressOrder(state.orderInfo)">邮寄地址填写</view>
  442. </view>
  443. <!-- 异地开始 -->
  444. <view v-if="state.orderInfo.orderStep == 31" class="btn-status">
  445. <view class="btn btn-green" @click="gotoReturnOrder(state.orderInfo)">退货</view>
  446. </view>
  447. <view v-if="state.orderInfo.orderStep == 33" class="btn-status">
  448. <view class="btn btn-green" @click="gotoExchangeOrder(state.orderInfo)" v-if="state.orderInfo.orderType!='REPLENISHMENT'">换货</view>
  449. </view>
  450. <view v-if="state.orderInfo.orderStep == 35" class="btn-status">
  451. <view class="btn btn-green" @click="placeAnOrder(state.orderInfo)">下单</view>
  452. </view>
  453. <!-- 异地结束-->
  454. <!-- 订单完成 -->
  455. <view v-if="state.isWeiXin==1">
  456. <view
  457. v-if="state.orderInfo.orderStep == OrderStatus.已完成 && (state.orderInfo.orderType =='ISSUE' || state.orderInfo.orderType =='VALUE_TO_ACCOUNT')"
  458. class="btn-status">
  459. <view class="btn space"
  460. v-if="( state.orderInfo.isProduct==1 && state.orderInfo.isService==1) ">
  461. 已评价</view>
  462. <view class="btn-green" v-else @click.stop="gotoEvaluateProduct(state.orderInfo)">去评价产品
  463. </view>
  464. </view>
  465. </view>
  466. <view v-if="state.isWeiXin==2">
  467. <view class="btn-status" v-if="state.orderInfo.orderStep == OrderStatus.已完成">
  468. <view class="btn space"
  469. v-if="state.orderInfo.isStaff==1 && state.orderInfo.isProduct==1">
  470. 已评价
  471. </view>
  472. <view class='evaluation' v-else>
  473. <view class="btn-green" @click.stop="gotoEvaluateSalesman(state.orderInfo)">去评价
  474. </view>
  475. </view>
  476. </view>
  477. </view>
  478. </view>
  479. <view v-else>
  480. <!-- 待激活 -->
  481. <view class="btn-status" style="display: flex;justify-content: flex-end;"
  482. v-if="state.orderInfo.orderStep == OrderStatus.待激活 && state.orderInfo.cardId && state.orderInfo.obuId">
  483. <view class="btn btn-green" @click.stop="gotoActiveOrder(state.orderInfo)"
  484. style="border: 1px solid #00B38B;">去激活</view>
  485. </view>
  486. </view>
  487. </view>
  488. </view>
  489. </view>
  490. </view>
  491. <!-- 弹窗 -->
  492. <u-popup v-model="state.showActiveOrder" mode="center">
  493. <popup-active-order content="确认是否重新激活订单" @cancel="state.showActiveOrder = false"
  494. @confirm="toActiveOrder"></popup-active-order>
  495. </u-popup>
  496. </template>
  497. <script setup lang="ts">
  498. import popupActiveOrder from "@/pages/order/components/popup-active-order.vue";
  499. import { reactive } from "vue";
  500. import { onLoad, onUnload, onShow } from "@dcloudio/uni-app";
  501. import { request, requestNew } from "@/utils/network/request";
  502. import { updateShippingAddress,orderDetailQuery } from "@/utils/network/api";
  503. import useOrderSkip from "@/composables/order/useOrderSkip";
  504. import { getETCStatusName, getOBUStatusName, msg, getOrderTypeName, getCarTypeName, getOrderTime, isBlank, timesDiff } from "@/utils/utils";
  505. import { OrderStatus } from "@/datas/enum";
  506. import {deviceType} from "@/utils/network/difference";
  507. import {
  508. getCodeName
  509. } from "@/datas/queryKey.js";
  510. const state = reactive({
  511. orderInfo: {
  512. orderInfoExt: {}
  513. } as any, //订单信息
  514. showActiveOrder: false, //激活弹窗
  515. isWeiXin: 1, //1 微信 2 app
  516. appraise: "",
  517. id: "",
  518. reshipment:"",//异地补货
  519. });
  520. //按钮跳转业务逻辑
  521. const { gotoEditAddress, gotoCancelOrder, gotoEditUserOrUnitInfo,
  522. gotoConfirmReceipt, gotoCheckLogistics, gotoEvaluateProduct,
  523. gotoActiveOrder, gotoReturnOrder, gotoExchangeOrder, gotoOrderSign, gotoOrderDetailsPay, gotoEvaluateSalesman, closeOrder, gotoAgainUseOrder,gotoAddressOrder,placeAnOrder,gotoReplenishmentOrder } = useOrderSkip();
  524. //获取订单详情
  525. const getOrderDetails = (id, appraise) => {
  526. const options = {
  527. type: 2,
  528. data: { "id": id },
  529. method: 'POST',
  530. showLoading: true,
  531. }
  532. requestNew(orderDetailQuery, options).then((res) => {
  533. state.orderInfo = res.data;
  534. console.log("state.orderInfo",state.orderInfo)
  535. // 订单发货后未激活 30天 以后 结束订单功能 insertTime >30 算出来距离今天是负数 updateTime<30(结束订单)
  536. for (var i in state.orderInfo) {
  537. if (state.orderInfo['insertTime']) {
  538. if (timesDiff(state.orderInfo['insertTime'].replace("T", " ")).days > 30) {
  539. state.orderInfo['finishOrder'] = true //可以结束
  540. } else {
  541. state.orderInfo['finishOrder'] = false //不可以结束
  542. }
  543. }
  544. if (state.orderInfo['updateTime']) {
  545. if (timesDiff(state.orderInfo['updateTime'].replace("T", " ")).days <= 30) {
  546. state.orderInfo['isUseAgain'] = true //可以结束
  547. } else {
  548. state.orderInfo['isUseAgain'] = false //不可以结束
  549. }
  550. }
  551. // 收货日期超过7个自然日不允许申请退货
  552. if (state.orderInfo.orderInfoExt['receivingTime']) {
  553. if (timesDiff(state.orderInfo.orderInfoExt['receivingTime'].replace("T", " ")).days > 7) {
  554. state.orderInfo['applyReturn'] = false //不展示申请退货
  555. } else {
  556. state.orderInfo['applyReturn'] = true //展示申请退货
  557. }
  558. }
  559. }
  560. console.log("获取订单详情", state.orderInfo, state.orderInfo['applyReturn'])
  561. })
  562. }
  563. //修改订单收货地址
  564. const requestEditOrderAddr = (addr) => {
  565. console.log("addr",addr)
  566. const options = {
  567. type: 2, data: {
  568. "id": state.orderInfo.id,
  569. 'consignee': addr.consignee,
  570. 'consigneeTel': addr.consigneeTel,
  571. 'region': addr.region,
  572. 'address': addr.address,
  573. 'postalCode': addr.postalCode,
  574. 'orderId': state.orderInfo.orderNo,
  575. },
  576. method: 'POST',
  577. showLoading: true,
  578. }
  579. requestNew(updateShippingAddress, options).then((res) => {
  580. state.orderInfo.orderInfoExt.id = addr.id,
  581. state.orderInfo.orderInfoExt.consignee = addr.consignee;
  582. state.orderInfo.orderInfoExt.consigneeTel = addr.consigneeTel;
  583. state.orderInfo.orderInfoExt.region = addr.region;
  584. state.orderInfo.orderInfoExt.address = addr.address;
  585. state.orderInfo.orderInfoExt.postalCode = addr.postalCode;
  586. setTimeout(() => {
  587. msg('收货地址修改成功');
  588. }, 1000)
  589. })
  590. }
  591. //激活订单
  592. const toActiveOrder = () => {
  593. gotoActiveOrder(state.orderInfo);
  594. state.showActiveOrder = false;
  595. }
  596. //是否有售后信息
  597. const isHaveAfterSaleInfo = () => {
  598. if (isBlank(state.orderInfo.orderInfoExt ? state.orderInfo.orderInfoExt.returnMode : null) && isBlank(state.orderInfo.orderInfoExt ? state.orderInfo.orderInfoExt.exchangeMode : null)) {
  599. return false;
  600. }
  601. return true;
  602. }
  603. onLoad((options) => {
  604. state.isWeiXin = options.isWeiXin
  605. state.reshipment = options.reshipment
  606. console.log("options.reshipment",options.reshipment)
  607. //刷新订单信息
  608. uni.$on('refreshOrder', (data) => {
  609. getOrderDetails(options.id, state.orderInfo.appraise);
  610. });
  611. //修改收货地址
  612. uni.$on('selectAddressSuccess', (addr) => {
  613. requestEditOrderAddr(addr);
  614. });
  615. console.log("optionssdsfd", options)
  616. state.id = options.id
  617. state.appraise = options.appraise
  618. })
  619. onShow(() => {
  620. getOrderDetails(state.id, state.appraise);
  621. })
  622. onUnload(() => {
  623. uni.$off('refreshOrder');
  624. uni.$off('selectAddressSuccess');
  625. console.log("已评价")
  626. })
  627. </script>
  628. <style>
  629. page {
  630. background: #EEF7F7;
  631. padding-bottom: 30rpx;
  632. }
  633. :deep(.u-mode-center-box) {
  634. border-radius: 20rpx;
  635. }
  636. </style>
  637. <style lang="scss" scoped>
  638. .address-box {
  639. background: #FFFFFF;
  640. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  641. border-radius: 20rpx;
  642. margin: 30rpx 30rpx 0rpx;
  643. padding: 30rpx;
  644. .avatar {
  645. background: rgba(0, 179, 139, 0.2);
  646. border-radius: 50%;
  647. color: #00B38B;
  648. font-size: 26rpx;
  649. width: 80rpx;
  650. height: 80rpx;
  651. }
  652. .center {
  653. margin-left: 20rpx;
  654. margin-right: 20rpx;
  655. display: flex;
  656. flex-direction: column;
  657. justify-content: center;
  658. .name {
  659. font-size: 30rpx;
  660. font-family: Microsoft YaHei;
  661. font-weight: 400;
  662. color: #333333;
  663. }
  664. .phone {
  665. font-size: 24rpx;
  666. font-family: Microsoft YaHei;
  667. font-weight: 400;
  668. color: #999999;
  669. margin-left: 20rpx;
  670. }
  671. .addr {
  672. margin-top: 18rpx;
  673. font-size: 26rpx;
  674. font-family: Microsoft YaHei;
  675. font-weight: 400;
  676. color: #333333;
  677. line-height: 36rpx;
  678. }
  679. }
  680. .edit {
  681. width: 60rpx;
  682. height: 55rpx;
  683. }
  684. }
  685. .detail-box {
  686. background: #FFFFFF;
  687. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  688. border-radius: 20rpx;
  689. margin: 30rpx;
  690. .detail-header {
  691. display: flex;
  692. border-bottom: 1rpx solid #DCDCDC;
  693. padding: 30rpx;
  694. align-items: center;
  695. .d-img {
  696. width: 48rpx;
  697. height: 48rpx;
  698. }
  699. .detail-name {
  700. font-size: 30rpx;
  701. font-weight: 400;
  702. color: #333333;
  703. margin-left: 12rpx;
  704. }
  705. }
  706. .detail-content {
  707. padding: 28rpx 29rpx 10rpx 29rpx;
  708. .post-sale {
  709. border-top: 1rpx solid #DCDCDC;
  710. padding-top: 38rpx
  711. }
  712. .d-row {
  713. display: flex;
  714. margin-bottom: 32rpx;
  715. .d-label {
  716. font-size: 26rpx;
  717. // color: #133850;
  718. text-align: right;
  719. }
  720. .d-value {
  721. font-size: 26rpx;
  722. // color: #133850;
  723. flex: 1;
  724. overflow: hidden;
  725. }
  726. }
  727. .btn-view {
  728. .btn-status {
  729. display: flex;
  730. justify-content: flex-end;
  731. padding: 20rpx 0;
  732. border-top: 1rpx solid #DCDCDC;
  733. }
  734. .space {
  735. margin-right: 19rpx
  736. }
  737. .btn {
  738. border: 1px solid #133850 ;
  739. color: #133850 ;
  740. border-radius: 30rpx;
  741. font-size: 24rpx;
  742. height: 52rpx;
  743. width: 130rpx;
  744. display: flex;
  745. justify-content: center;
  746. align-items: center;
  747. }
  748. .btn-green {
  749. color:white;
  750. background-color: #133850 ;
  751. border-radius: 30rpx;
  752. height: 52rpx;
  753. padding: 2rpx 22rpx;
  754. display: flex;
  755. justify-content: center;
  756. align-items: center;
  757. font-size: 24rpx;
  758. }
  759. .width-num-1 {
  760. width: 115rpx;
  761. }
  762. .width-num-2 {
  763. width: 221rpx;
  764. }
  765. .width-num-3 {
  766. width: 201rpx;
  767. }
  768. }
  769. }
  770. }
  771. .text-orange {
  772. color: #FF8000 !important;
  773. }
  774. .text-green {
  775. color: #00B38B !important;
  776. }
  777. .btn-primary {
  778. border: 1px solid #00b38b;
  779. color: #00b38b;
  780. }
  781. .btn {
  782. border: 1px solid #DCDCDC;
  783. border-radius: 30rpx;
  784. color: #333333;
  785. font-size: 24rpx;
  786. height: 52rpx;
  787. width: 130rpx;
  788. display: flex;
  789. justify-content: center;
  790. align-items: center;
  791. }
  792. </style>