index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <div class="app-container">
  3. <el-page-header @back="goBack" content="订单详情"></el-page-header>
  4. <div class="order-refund-main">
  5. <el-row style="padding: 15px 15px 10px">
  6. <el-col :span="24">
  7. <div class="order-refund-main-title">
  8. <span>订单编号:{{ orderDetail.orderId }}</span>
  9. <span>申请退款时间:{{ orderDetail.createTime }}</span>
  10. <span>商户:{{ orderDetail.companyWechatName || '无' }}</span>
  11. <div class="fr">
  12. <el-link type="primary" :underline="false" @click="showRemark('remark')">修改订单备注</el-link>
  13. </div>
  14. </div>
  15. </el-col>
  16. </el-row>
  17. <div style="width: 100%; padding: 10px 15px 15px 15px">
  18. <el-row>
  19. <el-col :span="8" style="border-right: 1px solid #e8e8e8;">
  20. <div class="order-refund-main-status">
  21. <span>{{ orderDetail.orderStatus | ORDER_REFUND_CURRENT_STATUS_FILTER }}</span>
  22. </div>
  23. <div class="order-refund-main-opt-btn">
  24. <template v-if="orderDetail.orderStatus === 'DSJCL'">
  25. <el-popconfirm title="确定同意吗?" @onConfirm="changeExamineStatus('OK')">
  26. <el-button slot="reference" size="small" type="primary">同意</el-button>
  27. </el-popconfirm>
  28. <el-popconfirm title="确定拒绝吗?" @onConfirm="changeExamineStatus('FAIL')" style="margin-left: 10px;">
  29. <el-button slot="reference" size="small" type="warning">拒绝</el-button>
  30. </el-popconfirm>
  31. </template>
  32. <template v-if="orderDetail.orderStatus === 'DSJSH'">
  33. <el-popconfirm title="确定要收货吗?" @onConfirm="receiveProd()">
  34. <el-button slot="reference" size="small" type="primary">确认收货</el-button>
  35. </el-popconfirm>
  36. <el-button type="success" size="small" @click="queryLogistics(orderDetail.logisticsNo)" v-if="orderDetail.logisticsNo" style="margin-left: 10px;">查看物流</el-button>
  37. </template>
  38. </div>
  39. </el-col>
  40. <el-col :span="16" style="padding: 0 15px;">订单备注:{{ orderDetail.remark }}</el-col>
  41. </el-row>
  42. </div>
  43. </div>
  44. <div class="order-refund-receive-info">
  45. <el-row :gutter="30">
  46. <el-col :xs="24" :sm="12" :lg="12">
  47. <div class="main-detail">
  48. <div class="title">订单信息</div>
  49. <div class="item">
  50. <div class="label">收货人信息:</div>
  51. <div class="value">{{orderDetail.receUserName}} ({{orderDetail.recePhone}})</div>
  52. </div>
  53. <div class="item">
  54. <div class="label">收货人地址:</div>
  55. <div class="value">{{orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street + orderDetail.receAddress}}</div>
  56. </div>
  57. <div class="item">
  58. <div class="label">销售员信息:</div>
  59. <div class="value">{{orderDetail.workerName}} ({{orderDetail.workerPhone}})</div>
  60. </div>
  61. <div class="item">
  62. <div class="label">下单渠道:</div>
  63. <div class="value">{{orderDetail.source}}</div>
  64. </div>
  65. <div class="item">
  66. <div class="label">支付方式:</div>
  67. <div class="value">{{orderDetail.payType}}</div>
  68. </div>
  69. <div class="item">
  70. <div class="label">是否开票:</div>
  71. <div class="value">{{orderDetail.tax ? '是':'否'}}</div>
  72. </div>
  73. </div>
  74. </el-col>
  75. <el-col :xs="24" :sm="12" :lg="12">
  76. <div class="main-detail">
  77. <div class="title">维权信息</div>
  78. <div class="item">
  79. <div class="label">退款方式:</div>
  80. <div class="value">{{orderDetail.refundType | REFUND_CURRENT_TYPE_FILTER}}</div>
  81. </div>
  82. <div class="item">
  83. <div class="label">退款原因:</div>
  84. <div class="value">{{orderDetail.refundReason}}</div>
  85. </div>
  86. <div class="item">
  87. <div class="label">退款说明:</div>
  88. <div class="value">{{orderDetail.refundExplain}}</div>
  89. </div>
  90. <div class="item">
  91. <div class="label">退款凭证:</div>
  92. <div class="value" style="display: flex;">
  93. <div v-for="(item, index) in orderDetail.tkFiles" :key="index" style="margin-right: 10px">
  94. <el-image :src="item.url" style="width: 50px; height: 50px;" :preview-src-list="[item.url]"></el-image>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </el-col>
  100. </el-row>
  101. </div>
  102. <div class="order-refund-detail">
  103. <el-table :data="orderDetail.orderDetails" style="width: 100%" border >
  104. <el-table-column label="商品信息" min-width="200">
  105. <template slot-scope="scope">
  106. <el-row>
  107. <el-col :span="6">
  108. <el-image style="width: 40px; height: 40px" :src="scope.row.imgUrl">
  109. <div slot="error" class="image-slot">
  110. <i class="el-icon-picture-outline"></i>
  111. </div>
  112. </el-image>
  113. </el-col>
  114. <el-col :span="18">
  115. <div>{{ scope.row.goodsName }}</div>
  116. </el-col>
  117. </el-row>
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="goodsSpecName" label="规格" align="center"></el-table-column>
  121. <el-table-column prop="price" label="单价" align="center"></el-table-column>
  122. <el-table-column prop="num" label="数量" align="center"></el-table-column>
  123. <el-table-column prop="shareAmount" label="分销金额" align="center"></el-table-column>
  124. <el-table-column prop="profitAmount" label="预计盈利" align="center"></el-table-column>
  125. <el-table-column prop="totalPrice" label="商品总金额" align="center" min-width="100"></el-table-column>
  126. <el-table-column prop="refundAmount" label="退款金额" align="center"></el-table-column>
  127. <el-table-column prop="refundNum" label="退款数量" align="center"></el-table-column>
  128. <el-table-column label="退款时间" align="center" min-width="160">
  129. <template>
  130. {{ orderDetail.examineTime || '' }}
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <div class="order-amount-info">
  135. <el-row>
  136. <el-col :span="19"><div style="width: 1px;height: 1px;"></div></el-col>
  137. <el-col :span="5">
  138. <div style="padding-bottom: 10px;">商品总价:¥ {{ totalAmountCompute }}</div>
  139. <div style="padding-bottom: 10px;">运费:¥ {{ orderDetail.freight }}</div>
  140. <div style="padding-bottom: 10px;">优惠:¥ {{ orderDetail.discountAmount }}</div>
  141. <div style="font-size: 14px;">
  142. <span style="padding-right: 15px;">实际收款</span><span style="color: red;font-size: 18px;">¥ {{ orderDetail.payAmount }}</span>
  143. </div>
  144. </el-col>
  145. </el-row>
  146. </div>
  147. </div>
  148. <el-dialog :title="'订单备注'" :visible.sync="remarkVisible" :show-close="false" width="50%" :close-on-click-modal="false">
  149. <el-input
  150. type="textarea"
  151. :autosize="{ minRows: 8, maxRows: 16}"
  152. placeholder="请输入备注内容"
  153. v-model="orderDetail.remark"
  154. maxlength="100"
  155. show-word-limit>
  156. </el-input>
  157. <div slot="footer" class="dialog-footer">
  158. <el-button type="primary" @click="saveRemark">保 存</el-button>
  159. <el-button @click="cancelRemark">取 消</el-button>
  160. </div>
  161. </el-dialog>
  162. <el-dialog :title="'物流信息'" :visible.sync="logisticsVisible" :show-close="false" width="80%" :close-on-click-modal="false">
  163. <el-table
  164. :data="logistics"
  165. style="width: 100%"
  166. size="mini">
  167. <el-table-column prop="logisticsNo" label="快递单号" align="center"></el-table-column>
  168. <el-table-column prop="comName" label="物流公司" align="center"></el-table-column>
  169. <el-table-column prop="time" label="物流时间" align="center"></el-table-column>
  170. <el-table-column prop="state" label="物流状态" align="center">
  171. <template slot-scope="scope">
  172. {{ scope.row.state | EXPRESS_CURRENT_STATE_FILTER }}
  173. </template>
  174. </el-table-column>
  175. <el-table-column prop="context" label="物流详情" align="center"></el-table-column>
  176. </el-table>
  177. <div slot="footer" class="dialog-footer">
  178. <el-button @click="logisticsVisible = false">关 闭</el-button>
  179. </div>
  180. </el-dialog>
  181. </div>
  182. </template>
  183. <script>
  184. import {changeExamineStatus, getOrderRefundDetail, receiveProd, saveRefundRemark} from "@/api/order";
  185. import {getExpress} from "@/api/common";
  186. export default {
  187. name: "orderRefundDetail",
  188. data() {
  189. return {
  190. orderRefundId: '',
  191. orderDetail: {},
  192. remarkVisible: false,
  193. logisticsVisible: false,
  194. logistics: []
  195. }
  196. },
  197. created() {
  198. this.orderRefundId = this.$route.query.orderRefundId
  199. this.getDetail()
  200. },
  201. methods: {
  202. getDetail() {
  203. getOrderRefundDetail({ orderRefundId: this.orderRefundId }).then((res) => {
  204. this.orderDetail = res.data
  205. this.orderDetail.workerName = this.orderDetail.workerName ? this.orderDetail.workerName : '暂无'
  206. this.orderDetail.workerPhone = this.orderDetail.workerPhone ? this.orderDetail.workerPhone : ''
  207. })
  208. },
  209. goBack() {
  210. this.$router.go(-1);
  211. },
  212. showRemark() {
  213. this.remarkVisible = true
  214. },
  215. cancelRemark() {
  216. this.remarkVisible = false
  217. },
  218. saveRemark() {
  219. const params = {
  220. orderRefundId: this.orderRefundId,
  221. remark: this.orderDetail.remark
  222. }
  223. saveRefundRemark(params).then(() => {
  224. this.cancelRemark();
  225. this.getDetail();
  226. this.$successMsg('保存成功');
  227. })
  228. },
  229. // 变更维权处理状态
  230. changeExamineStatus(examineStatus) {
  231. console.log(123);
  232. const orderRefundId = this.orderRefundId
  233. changeExamineStatus({orderRefundId, examineStatus}).then(() => {
  234. this.getDetail();
  235. this.$successMsg('操作成功');
  236. })
  237. },
  238. // 确认收货
  239. receiveProd() {
  240. const orderRefundId = this.orderRefundId
  241. receiveProd({orderRefundId}).then(() => {
  242. this.getDetail();
  243. this.$successMsg('确认收货成功');
  244. })
  245. },
  246. // 查看物流
  247. queryLogistics(logisticsNo) {
  248. this.logisticsVisible = true
  249. getExpress({ logisticsNo }).then(res => {
  250. this.logistics = res.data
  251. })
  252. },
  253. },
  254. computed: {
  255. totalAmountCompute() {
  256. if(!this.orderDetail.totalAmount) {
  257. return 0
  258. }
  259. const totalAmount = parseFloat(this.orderDetail.totalAmount)
  260. const freight = parseFloat(this.orderDetail.freight)
  261. return (totalAmount - freight).toFixed(2)
  262. }
  263. }
  264. }
  265. </script>
  266. <style scoped lang="scss">
  267. .order-refund-main {
  268. margin-top: 15px;
  269. border: 1px solid #e5e5e5;
  270. .order-refund-main-title {
  271. font-size: 14px;
  272. }
  273. .order-refund-main-title span {
  274. margin-right: 15px;
  275. }
  276. .order-refund-main-status {
  277. color: #409EFF;
  278. padding: 15px 0;
  279. font-size: 24px;
  280. }
  281. .order-refund-main-opt-btn {
  282. padding: 15px 0;
  283. }
  284. }
  285. .order-refund-receive-info {
  286. margin: 15px 0;
  287. padding: 15px;
  288. background: #f5f7fa;
  289. :first-child div span {
  290. padding-right: 15px;
  291. }
  292. .el-row{
  293. padding-top: 15px;
  294. }
  295. }
  296. .order-refund-detail {
  297. background: #f5f7fa;
  298. .order-amount-info {
  299. padding: 15px 0;
  300. font-size: 12px;
  301. font-weight: bold;
  302. }
  303. }
  304. .main-detail {
  305. .title {
  306. font-size: 16px;
  307. font-weight: 700;
  308. margin-bottom: 20px;
  309. }
  310. .item {
  311. display: flex;
  312. font-size: 14px;
  313. color: #666;
  314. padding-bottom: 12px;
  315. .label {
  316. white-space: nowrap;
  317. }
  318. }
  319. }
  320. </style>
  321. <style lang="scss">
  322. .order-refund-detail {
  323. .el-table tr,.el-table th {
  324. background-color: #f5f7fa;
  325. }
  326. }
  327. </style>