details.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <template>
  2. <zj-page-container>
  3. <div style="box-sizing: border-box; padding:0 10px;">
  4. <el-tabs v-model="activeName">
  5. <el-tab-pane label="详情" name="first"></el-tab-pane>
  6. <el-tab-pane label="操作记录" name="second"></el-tab-pane>
  7. </el-tabs>
  8. </div>
  9. <zj-page-fill>
  10. <template v-if="activeName=='first'">
  11. <div style="box-sizing: border-box; padding:10px;">
  12. <div>
  13. <div class="order-main">
  14. <el-row style="padding: 15px 15px 10px">
  15. <el-col :span="24">
  16. <div class="order-main-title">
  17. <span>订单编号:{{ orderDetail.esOrderId }}</span>
  18. <span>下单时间:{{ orderDetail.createTime }}</span>
  19. </div>
  20. </el-col>
  21. </el-row>
  22. <div style="width: 100%; padding: 10px 15px 15px 15px">
  23. <el-row>
  24. <el-col :span="10">
  25. <!-- -->
  26. <div v-if="~[0, 1].indexOf(detailsTypeCp)" style="display: flex;">
  27. <div>
  28. <div class="order-main-status">
  29. <span>{{ ({SAVE: "待支付", WAIT: "待确认", PAID: "待发货", SEND: "卖家发货", OVER: "已完成", TIME_OUT: "超时", CANCEL: "已售后/取消", WAIT_REFUND: "售后中"})[orderDetail.status] }}</span>
  30. </div>
  31. <div class="order-main-opt-btn">
  32. <template>
  33. <el-button v-if="~['SEND','OVER'].indexOf(orderDetail.status)" size="small" type="primary" @click="lookkuaidi">查看物流</el-button>
  34. <el-button v-if="~['SEND','OVER'].indexOf(orderDetail.status)" size="small" type="primary" @click="detailsTypeCp = 2">退货退款</el-button>
  35. </template>
  36. </div>
  37. </div>
  38. </div>
  39. <!-- -->
  40. <div v-if="detailsTypeCp==2">
  41. <el-form ref="formTHref" :model="formTH" label-width="80px" size="mini">
  42. <el-form-item label="处理结果" prop="refundType" :rules="[{ required: true, message: '请选择', trigger: 'blur' }]">
  43. <el-radio-group v-model="formTH.refundType">
  44. <el-radio label="GOODS">仅退货</el-radio>
  45. <el-radio label="REFUND">仅退款</el-radio>
  46. <el-radio label="GOODS_REFUND">退货退款</el-radio>
  47. </el-radio-group>
  48. </el-form-item>
  49. <el-form-item v-if="~['GOODS','GOODS_REFUND'].indexOf(formTH.refundType)" label="退货数量" prop="refundNum" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
  50. <el-input v-model="formTH.refundNum"></el-input>
  51. </el-form-item>
  52. <el-form-item v-if="~['REFUND','GOODS_REFUND'].indexOf(formTH.refundType)" label="退款金额" prop="refundPrice" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
  53. <el-input type="number" v-model="formTH.refundPrice"></el-input>
  54. </el-form-item>
  55. <el-form-item label="备注">
  56. <el-input type="textarea" v-model="formTH.refundRemark"></el-input>
  57. </el-form-item>
  58. </el-form>
  59. </div>
  60. </el-col>
  61. <el-col v-if="detailsTypeCp==0" :span="14" style="padding-top: 10px;">
  62. <el-steps :active="zhuangtai" align-center>
  63. <el-step title="买家下单" ></el-step>
  64. <el-step title="买家付款" ></el-step>
  65. <el-step title="卖家发货" ></el-step>
  66. <el-step title="交易成功" ></el-step>
  67. </el-steps>
  68. </el-col>
  69. </el-row>
  70. </div>
  71. </div>
  72. <div class="order-receive-info">
  73. <el-row :gutter="10">
  74. <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
  75. <div class='info'>
  76. <div class='info_title'>卖家信息</div>
  77. <div class='info_bottom'>
  78. <div class='info_bottom_lt'>
  79. <el-image v-if="orderDetail.sellUrl" style='width: 40px; height: 40px' :src="orderDetail.sellUrl"></el-image>
  80. </div>
  81. <div class='info_bottom_rt'>
  82. <div>昵称:{{orderDetail.sellName}}</div>
  83. <div>手机号:{{orderDetail.sellMobile}}</div>
  84. <div>发布时间:{{orderDetail.sellTime}}</div>
  85. </div>
  86. </div>
  87. </div>
  88. </el-col>
  89. <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
  90. <div class='info'>
  91. <div class='info_title'>买家信息</div>
  92. <div class='info_bottom'>
  93. <div class='info_bottom_lt'>
  94. <el-image v-if="orderDetail.wechatUserUrl" style='width: 40px; height: 40px' :src="orderDetail.wechatUserUrl">
  95. </el-image>
  96. </div>
  97. <div class='info_bottom_rt'>
  98. <div v-if="orderDetail.wechatUserName">昵称:{{orderDetail.wechatUserName}}</div>
  99. <div v-if="orderDetail.wechatUserMobile">手机号:{{orderDetail.wechatUserMobile}}</div>
  100. <div>收货人信息:({{orderDetail.userName}}){{orderDetail.userMobile}}</div>
  101. <div>收货人地址:{{ orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street + orderDetail.receAddress }}</div>
  102. <div>支付方式:{{({WECHAT:"微信支付", CASH:"到店支付", TRANSFER:"转账支付"})[orderDetail.payType]}}</div>
  103. </div>
  104. </div>
  105. </div>
  106. </el-col>
  107. <el-col v-if="~['SEND','OVER'].indexOf(orderDetail.status)" :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
  108. <div class='info'>
  109. <div class='info_title'>物流信息</div>
  110. <div class='info_bottom'>
  111. <div class='info_bottom_rt'>
  112. <div>
  113. <el-radio-group disabled v-model="orderDetail.pickType">
  114. <el-radio label='YES'>自提</el-radio>
  115. <el-radio label='NO'>物流</el-radio>
  116. </el-radio-group>
  117. </div>
  118. <div v-if="orderDetail.pickType=='NO'">快递单号:{{orderDetail.logisticsNo}}</div>
  119. <div v-if="orderDetail.pickType=='NO'">快递公司:{{orderDetail.logisticsName}}</div>
  120. </div>
  121. </div>
  122. </div>
  123. </el-col>
  124. </el-row>
  125. </div>
  126. <h3>商品信息</h3>
  127. <div class="order-main" style="border:none;">
  128. <!-- 订单表格 -->
  129. <el-table :data="[orderDetail]" style="width: 100%" border>
  130. <el-table-column label="商品信息" min-width="200">
  131. <template slot-scope="scope">
  132. <el-row>
  133. <el-col v-if="scope.row.goodsUrl" :span="6">
  134. <el-image style="width: 40px; height: 40px" :src="scope.row.goodsUrl">
  135. <div slot="error" class="image-slot">
  136. <i class="el-icon-picture-outline"></i>
  137. </div>
  138. </el-image>
  139. </el-col>
  140. <el-col :span="18">
  141. <div>{{ scope.row.esGoodsName }}</div>
  142. </el-col>
  143. </el-row>
  144. </template>
  145. </el-table-column>
  146. <el-table-column prop="goodsPrice" label="单价" align="center"></el-table-column>
  147. <el-table-column prop="num" label="数量" align="center"></el-table-column>
  148. <el-table-column prop="totalAmount" label="商品总金额" align="center" min-width="100"></el-table-column>
  149. <el-table-column prop="refundPrice" label="退款金额" align="center"></el-table-column>
  150. </el-table>
  151. </div>
  152. <h3 v-if="detailsTypeCp==1">收款信息</h3>
  153. <div v-if="detailsTypeCp==1" class="order-main">
  154. <div style="width: 100%; padding: 10px 15px 15px 15px">
  155. <el-row>
  156. <el-col :span="10">
  157. <div>
  158. <el-form ref="formSKref" :model="formSK" label-width="80px" size="mini">
  159. <el-form-item label="收款金额" prop="price" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
  160. <el-input type="number" v-model="formSK.price"></el-input>
  161. </el-form-item>
  162. <el-form-item label="收款金额" prop="fileUrl">
  163. <ImageUpload :fileList="formSK.fileUrl" :limit="1"/>
  164. </el-form-item>
  165. <el-form-item label="备注" prop="remark">
  166. <el-input type="textarea" v-model="formSK.remark"></el-input>
  167. </el-form-item>
  168. </el-form>
  169. </div>
  170. </el-col>
  171. </el-row>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </template>
  177. <template v-if="activeName=='second'">
  178. <div style="box-sizing: border-box; padding:10px;">
  179. <div>
  180. <div class="order-main" style="border:none;">
  181. <el-table :data="orderPayPriceList" style="width: 100%" border>
  182. <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
  183. <el-table-column prop="fileUrl" label="收款凭证" min-width="200">
  184. <template slot-scope="scope">
  185. <el-image v-if="scope.row.fileUrl" style="width: 40px; height: 40px" :src="scope.row.fileUrl">
  186. <div slot="error" class="image-slot">
  187. <i class="el-icon-picture-outline"></i>
  188. </div>
  189. </el-image>
  190. </template>
  191. </el-table-column>
  192. <el-table-column prop="createBy" label="操作人" align="center" min-width="100"></el-table-column>
  193. <el-table-column prop="createTime" label="操作时间" align="center"></el-table-column>
  194. </el-table>
  195. </div>
  196. </div>
  197. </div>
  198. </template>
  199. </zj-page-fill>
  200. <div style="box-sizing: border-box; padding: 10px; text-align: right;">
  201. <!-- 确定退货退款 -->
  202. <el-button v-if="detailsTypeCp==2" type="primary" size="small" @click="faqituikuan">确定</el-button>
  203. <!-- 确认收款 -->
  204. <el-button v-if="detailsTypeCp==1" type="primary" size="small" @click="quererndingda">确认收款</el-button>
  205. </div>
  206. </zj-page-container>
  207. </template>
  208. <script>
  209. import { esOrderDetail, esOrderRefund, esOrderPayPrice, esOrderPayPriceList } from "@/api/orderManagement";
  210. import ImageUpload from '@/components/file-upload'
  211. export default {
  212. components:{
  213. ImageUpload
  214. },
  215. props:{
  216. detailsId: {
  217. type: [String, Number],
  218. default: ""
  219. },
  220. detailsType: {
  221. type: [String, Number],
  222. default: ""
  223. },
  224. },
  225. data() {
  226. return {
  227. activeName: "first",
  228. detailsTypeCp: this.detailsType,
  229. // 退货退款表单
  230. formTH: {
  231. },
  232. // 收款表单
  233. formSK: {
  234. fileUrl:[]
  235. },
  236. // 订单详情
  237. orderDetail: {
  238. },
  239. // 物流详情
  240. expressDetail: {
  241. },
  242. orderPayPriceList:[],
  243. }
  244. },
  245. computed:{
  246. zhuangtai(){
  247. return !!~['SAVE','WAIT'].indexOf(this.orderDetail.status)?1:!!~['PAID'].indexOf(this.orderDetail.status)?2:!!~['SEND'].indexOf(this.orderDetail.status)?3:!!~['OVER'].indexOf(this.orderDetail.status)?4:-1
  248. }
  249. },
  250. watch: {
  251. detailsId: {
  252. handler(newVal, oldVal) {
  253. this.getEsOrderDetail()
  254. },
  255. deep: true,
  256. immediate: true,
  257. },
  258. },
  259. methods: {
  260. getEsOrderDetail(){
  261. esOrderDetail({
  262. esOrderId: this.detailsId
  263. }).then(res=>{
  264. this.orderDetail = {
  265. ...res.data
  266. }
  267. })
  268. esOrderPayPriceList({
  269. esOrderId: this.detailsId
  270. }).then(res=>{
  271. this.orderPayPriceList = res.data
  272. })
  273. },
  274. lookkuaidi(){
  275. this.$emit("viewMaterialFlow", {...this.orderDetail})
  276. },
  277. faqituikuan(){
  278. this.$refs.formTHref.validate((valid) => {
  279. if (valid) {
  280. esOrderRefund({
  281. esOrderId: this.detailsId,
  282. ...this.formTH
  283. }).then(res=>{
  284. this.$message({ type: 'success', message: `确定退货退款成功!` })
  285. this.$emit("removeTab")
  286. })
  287. }
  288. });
  289. },
  290. quererndingda(){
  291. this.$refs.formSKref.validate((valid) => {
  292. if (valid) {
  293. esOrderPayPrice({
  294. esOrderId: this.detailsId,
  295. ...this.formSK,
  296. fileUrl: this.formSK.fileUrl.map(item=>item.url).join(",")
  297. }).then(res=>{
  298. this.$message({ type: 'success', message: `确认收款成功!` })
  299. this.$emit("removeTab")
  300. })
  301. }
  302. });
  303. }
  304. }
  305. }
  306. </script>
  307. <style scoped lang="scss">
  308. .info {
  309. .info_title {
  310. font-size: 16px;
  311. font-weight: 700;
  312. }
  313. .info_bottom {
  314. display: flex;
  315. margin: 10px 0;
  316. .info_bottom_lt {
  317. width: 40px;
  318. height: 40px;
  319. }
  320. .info_bottom_rt {
  321. padding: 0 0 0 10px;
  322. line-height: 30px;
  323. .photoPZ {
  324. display: inline-block;
  325. vertical-align: text-top;
  326. }
  327. }
  328. }
  329. }
  330. .order-main {
  331. margin-top: 15px;
  332. border: 1px solid #e5e5e5;
  333. .order-main-title {
  334. font-size: 14px;
  335. }
  336. .order-main-title span {
  337. margin-right: 15px;
  338. }
  339. .order-main-status {
  340. padding: 15px 0;
  341. font-size: 24px;
  342. color: #409EFF;
  343. }
  344. .order-main-opt-btn {
  345. padding: 15px 0;
  346. }
  347. }
  348. .order-receive-info {
  349. margin: 15px 0 30px;
  350. padding: 15px;
  351. background: #f5f7fa;
  352. :first-child div span {
  353. padding-right: 15px;
  354. }
  355. }
  356. .order-detail {
  357. background: #f5f7fa;
  358. .order-amount-info {
  359. padding: 15px 0;
  360. font-size: 12px;
  361. font-weight: bold;
  362. }
  363. ::v-deep .el-table tr,
  364. ::v-deep .el-table th {
  365. background-color: #f5f7fa;
  366. }
  367. }
  368. .main-detail {
  369. .title {
  370. font-size: 16px;
  371. font-weight: 700;
  372. margin-bottom: 20px;
  373. }
  374. .item {
  375. display: flex;
  376. font-size: 14px;
  377. color: #666;
  378. padding-bottom: 12px;
  379. .label {
  380. white-space: nowrap;
  381. }
  382. }
  383. }
  384. .order-evaluate-info {
  385. margin: 15px 0;
  386. padding: 30px 15px;
  387. background: #f5f7fa;
  388. .title {
  389. display: flex;
  390. justify-content: space-between;
  391. align-items: center;
  392. .left {
  393. font-size: 16px;
  394. font-weight: 700;
  395. span {
  396. font-weight: normal;
  397. margin-left: 20px;
  398. font-size: 14px;
  399. color: #666;
  400. }
  401. }
  402. .right {
  403. display: flex;
  404. align-items: center;
  405. font-size: 14px;
  406. span {
  407. margin-right: 10px;
  408. }
  409. }
  410. }
  411. .main {
  412. margin-top: 20px;
  413. display: flex;
  414. .rate-list {
  415. font-size: 14px;
  416. flex-shrink: 0;
  417. }
  418. .tag-list {
  419. margin-left: 30px;
  420. ::v-deep .el-tag {
  421. margin-right: 10px;
  422. margin-bottom: 10px;
  423. }
  424. }
  425. }
  426. .content {
  427. width: 400px;
  428. line-height: 20px;
  429. font-size: 14px;
  430. color: #333;
  431. margin-top: 10px;
  432. }
  433. .img-list {
  434. display: flex;
  435. flex-wrap: wrap;
  436. margin-top: 10px;
  437. width: 400px;
  438. ::v-deep .el-image {
  439. width: 100px;
  440. height: 100px;
  441. margin-right: 10px;
  442. margin-bottom: 10px;
  443. border: 1px solid #eaeaea;
  444. }
  445. }
  446. }
  447. </style>