details.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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>快递单号:{{orderDetail.logisticsNo}}</div>
  119. <div>快递公司:{{orderDetail.logisticsName}}</div>
  120. <!-- <el-button v-if="detailsTypeCp==0 && orderDetail.logisticsCode && orderDetail.logisticsNo" type='primary' size='small' @click="lookkuaidi">查看物流
  121. </el-button> -->
  122. </div>
  123. </div>
  124. </div>
  125. </el-col>
  126. </el-row>
  127. </div>
  128. <h3>商品信息</h3>
  129. <div class="order-main" style="border:none;">
  130. <!-- 订单表格 -->
  131. <el-table :data="[orderDetail]" style="width: 100%" border>
  132. <el-table-column label="商品信息" min-width="200">
  133. <template slot-scope="scope">
  134. <el-row>
  135. <el-col :span="6">
  136. <el-image style="width: 40px; height: 40px" :src="scope.row.goodsUrl">
  137. <div slot="error" class="image-slot">
  138. <i class="el-icon-picture-outline"></i>
  139. </div>
  140. </el-image>
  141. </el-col>
  142. <el-col :span="18">
  143. <div>{{ scope.row.esGoodsName }}</div>
  144. </el-col>
  145. </el-row>
  146. </template>
  147. </el-table-column>
  148. <el-table-column prop="goodsPrice" label="单价" align="center"></el-table-column>
  149. <el-table-column prop="num" label="数量" align="center"></el-table-column>
  150. <el-table-column prop="totalAmount" label="商品总金额" align="center" min-width="100"></el-table-column>
  151. <el-table-column prop="refundPrice" label="退款金额" align="center"></el-table-column>
  152. </el-table>
  153. </div>
  154. <h3 v-if="detailsTypeCp==1">收款信息</h3>
  155. <div v-if="detailsTypeCp==1" class="order-main">
  156. <div style="width: 100%; padding: 10px 15px 15px 15px">
  157. <el-row>
  158. <el-col :span="10">
  159. <div>
  160. <el-form ref="formSKref" :model="formSK" label-width="80px" size="mini">
  161. <el-form-item label="收款金额" prop="price" :rules="[{ required: true, message: '请填写', trigger: 'blur' }]">
  162. <el-input type="number" v-model="formSK.price"></el-input>
  163. </el-form-item>
  164. <el-form-item label="收款金额" prop="fileUrl">
  165. <ImageUpload :fileList="formSK.fileUrl" :limit="1"/>
  166. </el-form-item>
  167. <el-form-item label="备注" prop="remark">
  168. <el-input type="textarea" v-model="formSK.remark"></el-input>
  169. </el-form-item>
  170. </el-form>
  171. </div>
  172. </el-col>
  173. </el-row>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </template>
  179. <template v-if="activeName=='second'">
  180. <div style="box-sizing: border-box; padding:10px;">
  181. <div>
  182. <div class="order-main" style="border:none;">
  183. <el-table :data="orderPayPriceList" style="width: 100%" border>
  184. <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
  185. <el-table-column prop="fileUrl" label="收款凭证" min-width="200">
  186. <template slot-scope="scope">
  187. <el-image style="width: 40px; height: 40px" :src="scope.row.fileUrl">
  188. <div slot="error" class="image-slot">
  189. <i class="el-icon-picture-outline"></i>
  190. </div>
  191. </el-image>
  192. </template>
  193. </el-table-column>
  194. <el-table-column prop="createBy" label="操作人" align="center" min-width="100"></el-table-column>
  195. <el-table-column prop="createTime" label="操作时间" align="center"></el-table-column>
  196. </el-table>
  197. </div>
  198. </div>
  199. </div>
  200. </template>
  201. </zj-page-fill>
  202. <div style="box-sizing: border-box; padding: 10px; text-align: right;">
  203. <!-- 确定退货退款 -->
  204. <el-button v-if="detailsTypeCp==2" type="primary" size="small" @click="faqituikuan">确定</el-button>
  205. <!-- 确认收款 -->
  206. <el-button v-if="detailsTypeCp==1" type="primary" size="small" @click="quererndingda">确认收款</el-button>
  207. </div>
  208. </zj-page-container>
  209. </template>
  210. <script>
  211. import { esOrderDetail, esOrderRefund, esOrderPayPrice, esOrderPayPriceList } from "@/api/orderManagement";
  212. import ImageUpload from '@/components/file-upload'
  213. export default {
  214. components:{
  215. ImageUpload
  216. },
  217. props:{
  218. detailsId: {
  219. type: [String, Number],
  220. default: ""
  221. },
  222. detailsType: {
  223. type: [String, Number],
  224. default: ""
  225. },
  226. },
  227. data() {
  228. return {
  229. activeName: "first",
  230. detailsTypeCp: this.detailsType,
  231. // 退货退款表单
  232. formTH: {
  233. },
  234. // 收款表单
  235. formSK: {
  236. fileUrl:[]
  237. },
  238. // 订单详情
  239. orderDetail: {
  240. },
  241. // 物流详情
  242. expressDetail: {
  243. },
  244. orderPayPriceList:[],
  245. }
  246. },
  247. computed:{
  248. zhuangtai(){
  249. 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
  250. }
  251. },
  252. watch: {
  253. detailsId: {
  254. handler(newVal, oldVal) {
  255. this.getEsOrderDetail()
  256. },
  257. deep: true,
  258. immediate: true,
  259. },
  260. },
  261. methods: {
  262. getEsOrderDetail(){
  263. esOrderDetail({
  264. esOrderId: this.detailsId
  265. }).then(res=>{
  266. this.orderDetail = {
  267. ...res.data
  268. }
  269. })
  270. esOrderPayPriceList({
  271. esOrderId: this.detailsId
  272. }).then(res=>{
  273. this.orderPayPriceList = res.data
  274. console.log(this.orderPayPriceList)
  275. })
  276. },
  277. lookkuaidi(){
  278. this.$emit("viewMaterialFlow", {...this.orderDetail})
  279. },
  280. faqituikuan(){
  281. this.$refs.formTHref.validate((valid) => {
  282. if (valid) {
  283. esOrderRefund({
  284. esOrderId: this.detailsId,
  285. ...this.formTH
  286. }).then(res=>{
  287. this.$message({ type: 'success', message: `确定退货退款成功!` })
  288. this.$emit("removeTab")
  289. })
  290. }
  291. });
  292. },
  293. quererndingda(){
  294. this.$refs.formSKref.validate((valid) => {
  295. if (valid) {
  296. esOrderPayPrice({
  297. esOrderId: this.detailsId,
  298. ...this.formSK,
  299. fileUrl: this.formSK.fileUrl.map(item=>item.url).join(",")
  300. }).then(res=>{
  301. this.$message({ type: 'success', message: `确认收款成功!` })
  302. this.$emit("removeTab")
  303. })
  304. }
  305. });
  306. }
  307. }
  308. }
  309. </script>
  310. <style scoped lang="scss">
  311. .info {
  312. .info_title {
  313. font-size: 16px;
  314. font-weight: 700;
  315. }
  316. .info_bottom {
  317. display: flex;
  318. margin: 10px 0;
  319. .info_bottom_lt {
  320. width: 40px;
  321. height: 40px;
  322. }
  323. .info_bottom_rt {
  324. padding: 0 0 0 10px;
  325. line-height: 30px;
  326. .photoPZ {
  327. display: inline-block;
  328. vertical-align: text-top;
  329. }
  330. }
  331. }
  332. }
  333. .order-main {
  334. margin-top: 15px;
  335. border: 1px solid #e5e5e5;
  336. .order-main-title {
  337. font-size: 14px;
  338. }
  339. .order-main-title span {
  340. margin-right: 15px;
  341. }
  342. .order-main-status {
  343. padding: 15px 0;
  344. font-size: 24px;
  345. color: #409EFF;
  346. }
  347. .order-main-opt-btn {
  348. padding: 15px 0;
  349. }
  350. }
  351. .order-receive-info {
  352. margin: 15px 0 30px;
  353. padding: 15px;
  354. background: #f5f7fa;
  355. :first-child div span {
  356. padding-right: 15px;
  357. }
  358. }
  359. .order-detail {
  360. background: #f5f7fa;
  361. .order-amount-info {
  362. padding: 15px 0;
  363. font-size: 12px;
  364. font-weight: bold;
  365. }
  366. ::v-deep .el-table tr,
  367. ::v-deep .el-table th {
  368. background-color: #f5f7fa;
  369. }
  370. }
  371. .main-detail {
  372. .title {
  373. font-size: 16px;
  374. font-weight: 700;
  375. margin-bottom: 20px;
  376. }
  377. .item {
  378. display: flex;
  379. font-size: 14px;
  380. color: #666;
  381. padding-bottom: 12px;
  382. .label {
  383. white-space: nowrap;
  384. }
  385. }
  386. }
  387. .order-evaluate-info {
  388. margin: 15px 0;
  389. padding: 30px 15px;
  390. background: #f5f7fa;
  391. .title {
  392. display: flex;
  393. justify-content: space-between;
  394. align-items: center;
  395. .left {
  396. font-size: 16px;
  397. font-weight: 700;
  398. span {
  399. font-weight: normal;
  400. margin-left: 20px;
  401. font-size: 14px;
  402. color: #666;
  403. }
  404. }
  405. .right {
  406. display: flex;
  407. align-items: center;
  408. font-size: 14px;
  409. span {
  410. margin-right: 10px;
  411. }
  412. }
  413. }
  414. .main {
  415. margin-top: 20px;
  416. display: flex;
  417. .rate-list {
  418. font-size: 14px;
  419. flex-shrink: 0;
  420. }
  421. .tag-list {
  422. margin-left: 30px;
  423. ::v-deep .el-tag {
  424. margin-right: 10px;
  425. margin-bottom: 10px;
  426. }
  427. }
  428. }
  429. .content {
  430. width: 400px;
  431. line-height: 20px;
  432. font-size: 14px;
  433. color: #333;
  434. margin-top: 10px;
  435. }
  436. .img-list {
  437. display: flex;
  438. flex-wrap: wrap;
  439. margin-top: 10px;
  440. width: 400px;
  441. ::v-deep .el-image {
  442. width: 100px;
  443. height: 100px;
  444. margin-right: 10px;
  445. margin-bottom: 10px;
  446. border: 1px solid #eaeaea;
  447. }
  448. }
  449. }
  450. </style>