applyDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <div class="detail-container">
  3. <el-card shadow="never">
  4. <span class="font-title-medium">退货商品</span>
  5. <el-table
  6. border
  7. class="standard-margin"
  8. ref="productTable"
  9. :data="productList"
  10. >
  11. <el-table-column label="商品图片" width="160" align="center">
  12. <template slot-scope="scope">
  13. <img style="height: 80px" :src="scope.row.productPic" />
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="商品名称" align="center">
  17. <template slot-scope="scope">
  18. <span class="font-small">{{ scope.row.productName }}</span
  19. ><br />
  20. <span class="font-small">品牌:{{ scope.row.productBrand }}</span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="价格/货号" width="180" align="center">
  24. <template slot-scope="scope">
  25. <span class="font-small"
  26. >价格:¥{{ scope.row.productRealPrice }}</span
  27. ><br />
  28. <span class="font-small">货号:NO.{{ scope.row.productId }}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="属性" width="180" align="center">
  32. <template slot-scope="scope">{{ scope.row.productAttr }}</template>
  33. </el-table-column>
  34. <el-table-column label="数量" width="100" align="center">
  35. <template slot-scope="scope">{{ scope.row.productCount }}</template>
  36. </el-table-column>
  37. <el-table-column label="小计" width="100" align="center">
  38. <template slot-scope="scope">¥{{ totalAmount }}</template>
  39. </el-table-column>
  40. </el-table>
  41. <div style="float: right; margin-top: 15px; margin-bottom: 15px">
  42. <span class="font-title-medium">合计:</span>
  43. <span class="font-title-medium color-danger">¥{{ totalAmount }}</span>
  44. </div>
  45. </el-card>
  46. <el-card shadow="never" class="standard-margin">
  47. <span class="font-title-medium">服务单信息</span>
  48. <div class="form-container-border">
  49. <el-row>
  50. <el-col :span="6" class="form-border form-left-bg font-small"
  51. >服务单号</el-col
  52. >
  53. <el-col class="form-border font-small" :span="18">{{
  54. orderReturnApply.id
  55. }}</el-col>
  56. </el-row>
  57. <el-row>
  58. <el-col class="form-border form-left-bg font-small" :span="6"
  59. >申请状态</el-col
  60. >
  61. <el-col class="form-border font-small" :span="18">{{
  62. orderReturnApply.status | formatStatus
  63. }}</el-col>
  64. </el-row>
  65. <el-row>
  66. <el-col
  67. :span="6"
  68. class="form-border form-left-bg font-small"
  69. style="height: 50px; line-height: 30px"
  70. >订单编号
  71. </el-col>
  72. <el-col
  73. class="form-border font-small"
  74. :span="18"
  75. style="height: 50px"
  76. >
  77. {{ orderReturnApply.orderSn }}
  78. <el-button type="text" size="small" @click="handleViewOrder"
  79. >查看</el-button
  80. >
  81. </el-col>
  82. </el-row>
  83. <el-row>
  84. <el-col class="form-border form-left-bg font-small" :span="6"
  85. >申请时间</el-col
  86. >
  87. <el-col class="form-border font-small" :span="18">{{
  88. orderReturnApply.createTime | formatTime
  89. }}</el-col>
  90. </el-row>
  91. <el-row>
  92. <el-col class="form-border form-left-bg font-small" :span="6"
  93. >用户账号</el-col
  94. >
  95. <el-col class="form-border font-small" :span="18">{{
  96. orderReturnApply.memberUsername
  97. }}</el-col>
  98. </el-row>
  99. <el-row>
  100. <el-col class="form-border form-left-bg font-small" :span="6"
  101. >联系人</el-col
  102. >
  103. <el-col class="form-border font-small" :span="18">{{
  104. orderReturnApply.returnName
  105. }}</el-col>
  106. </el-row>
  107. <el-row>
  108. <el-col class="form-border form-left-bg font-small" :span="6"
  109. >联系电话</el-col
  110. >
  111. <el-col class="form-border font-small" :span="18">{{
  112. orderReturnApply.returnPhone
  113. }}</el-col>
  114. </el-row>
  115. <el-row>
  116. <el-col class="form-border form-left-bg font-small" :span="6"
  117. >退货原因</el-col
  118. >
  119. <el-col class="form-border font-small" :span="18">{{
  120. orderReturnApply.reason
  121. }}</el-col>
  122. </el-row>
  123. <el-row>
  124. <el-col class="form-border form-left-bg font-small" :span="6"
  125. >问题描述</el-col
  126. >
  127. <el-col class="form-border font-small" :span="18">{{
  128. orderReturnApply.description
  129. }}</el-col>
  130. </el-row>
  131. <el-row>
  132. <el-col
  133. class="form-border form-left-bg font-small"
  134. :span="6"
  135. style="height: 100px; line-height: 80px"
  136. >凭证图片
  137. </el-col>
  138. <el-col
  139. class="form-border font-small"
  140. :span="18"
  141. style="height: 100px"
  142. >
  143. <img
  144. v-for="item in proofPics"
  145. style="width: 80px; height: 80px"
  146. :src="item"
  147. />
  148. </el-col>
  149. </el-row>
  150. </div>
  151. <div class="form-container-border">
  152. <el-row>
  153. <el-col class="form-border form-left-bg font-small" :span="6"
  154. >订单金额</el-col
  155. >
  156. <el-col class="form-border font-small" :span="18"
  157. >¥{{ totalAmount }}</el-col
  158. >
  159. </el-row>
  160. <el-row>
  161. <el-col
  162. class="form-border form-left-bg font-small"
  163. :span="6"
  164. style="height: 52px; line-height: 32px"
  165. >确认退款金额
  166. </el-col>
  167. <el-col
  168. class="form-border font-small"
  169. style="height: 52px"
  170. :span="18"
  171. >
  172. <el-input
  173. size="small"
  174. v-model="updateStatusParam.returnAmount"
  175. :disabled="orderReturnApply.status !== 0"
  176. style="width: 200px; margin-left: 10px"
  177. ></el-input>
  178. </el-col>
  179. </el-row>
  180. <div v-show="orderReturnApply.status !== 3">
  181. <el-row>
  182. <el-col class="form-border form-left-bg font-small" :span="6"
  183. >快递单号</el-col
  184. >
  185. <el-col class="form-border font-small" :span="18">{{
  186. orderReturnApply.deliverySn|| '--'
  187. }}</el-col>
  188. </el-row>
  189. <!-- <el-row>
  190. <el-col class="form-border form-left-bg font-small" :span="6" style="height:52px;line-height:32px">选择收货点
  191. </el-col>
  192. <el-col class="form-border font-small" style="height:52px" :span="18">
  193. <el-select size="small"
  194. style="width:200px"
  195. :disabled="orderReturnApply.status!==0"
  196. v-model="updateStatusParam.companyAddressId">
  197. <el-option v-for="address in companyAddressList"
  198. :key="address.id"
  199. :value="address.id"
  200. :label="address.addressName">
  201. </el-option>
  202. </el-select>
  203. </el-col>
  204. </el-row> -->
  205. <!-- <el-row>
  206. <el-col class="form-border form-left-bg font-small" :span="6">收货人姓名</el-col>
  207. <el-col class="form-border font-small" :span="18">{{currentAddress.name?currentAddress.name:''}}</el-col>
  208. </el-row>
  209. <el-row>
  210. <el-col class="form-border form-left-bg font-small" :span="6">所在区域</el-col>
  211. <el-col class="form-border font-small" :span="18">{{currentAddress | formatRegion}}</el-col>
  212. </el-row>
  213. <el-row>
  214. <el-col class="form-border form-left-bg font-small" :span="6">详细地址</el-col>
  215. <el-col class="form-border font-small" :span="18">{{currentAddress.detailAddress}}</el-col>
  216. </el-row>
  217. <el-row>
  218. <el-col class="form-border form-left-bg font-small" :span="6">联系电话</el-col>
  219. <el-col class="form-border font-small" :span="18">{{currentAddress.phone}}</el-col>
  220. </el-row> -->
  221. </div>
  222. </div>
  223. <div class="form-container-border" v-show="orderReturnApply.status !== 0">
  224. <el-row>
  225. <el-col class="form-border form-left-bg font-small" :span="6"
  226. >处理人员</el-col
  227. >
  228. <el-col class="form-border font-small" :span="18">{{
  229. orderReturnApply.handleMan
  230. }}</el-col>
  231. </el-row>
  232. <el-row>
  233. <el-col class="form-border form-left-bg font-small" :span="6"
  234. >处理时间</el-col
  235. >
  236. <el-col class="form-border font-small" :span="18">{{
  237. orderReturnApply.handleTime | formatTime
  238. }}</el-col>
  239. </el-row>
  240. <el-row>
  241. <el-col class="form-border form-left-bg font-small" :span="6"
  242. >处理备注</el-col
  243. >
  244. <el-col class="form-border font-small" :span="18">{{
  245. orderReturnApply.handleNote
  246. }}</el-col>
  247. </el-row>
  248. </div>
  249. <div class="form-container-border" v-show="orderReturnApply.status === 2">
  250. <el-row>
  251. <el-col class="form-border form-left-bg font-small" :span="6"
  252. >收货人员</el-col
  253. >
  254. <el-col class="form-border font-small" :span="18">{{
  255. orderReturnApply.receiveMan
  256. }}</el-col>
  257. </el-row>
  258. <el-row>
  259. <el-col class="form-border form-left-bg font-small" :span="6"
  260. >收货时间</el-col
  261. >
  262. <el-col class="form-border font-small" :span="18">{{
  263. orderReturnApply.receiveTime | formatTime
  264. }}</el-col>
  265. </el-row>
  266. <el-row>
  267. <el-col class="form-border form-left-bg font-small" :span="6"
  268. >收货备注</el-col
  269. >
  270. <el-col class="form-border font-small" :span="18">{{
  271. orderReturnApply.receiveNote
  272. }}</el-col>
  273. </el-row>
  274. </div>
  275. <div class="form-container-border" v-show="orderReturnApply.status === 0">
  276. <el-row>
  277. <el-col
  278. class="form-border form-left-bg font-small"
  279. :span="6"
  280. style="height: 52px; line-height: 32px"
  281. >处理备注</el-col
  282. >
  283. <el-col class="form-border font-small" :span="18">
  284. <el-input
  285. size="small"
  286. v-model="updateStatusParam.handleNote"
  287. style="width: 200px; margin-left: 10px"
  288. ></el-input>
  289. </el-col>
  290. </el-row>
  291. </div>
  292. <div class="form-container-border" v-show="orderReturnApply.status === 1">
  293. <el-row>
  294. <el-col
  295. class="form-border form-left-bg font-small"
  296. :span="6"
  297. style="height: 52px; line-height: 32px"
  298. >收货备注</el-col
  299. >
  300. <el-col class="form-border font-small" :span="18">
  301. <el-input
  302. size="small"
  303. v-model="updateStatusParam.receiveNote"
  304. style="width: 200px; margin-left: 10px"
  305. ></el-input>
  306. </el-col>
  307. </el-row>
  308. </div>
  309. <div
  310. style="margin-top: 15px; text-align: center"
  311. v-show="orderReturnApply.status === 0"
  312. >
  313. <el-button type="primary" size="small" @click="handleUpdateStatus(1)"
  314. >确认退货</el-button
  315. >
  316. <el-button type="danger" size="small" @click="handleUpdateStatus(3)"
  317. >拒绝退货</el-button
  318. >
  319. </div>
  320. <div
  321. style="margin-top: 15px; text-align: center"
  322. v-show="orderReturnApply.status === 1"
  323. >
  324. <el-button type="primary" size="small" @click="handleUpdateStatus(2)"
  325. >确认收货</el-button
  326. >
  327. </div>
  328. </el-card>
  329. </div>
  330. </template>
  331. <script>
  332. import { getApplyDetail, updateApplyStatus } from "@/api/returnApply";
  333. import { fetchList } from "@/api/companyAddress";
  334. import { formatDate } from "@/utils/date";
  335. const defaultUpdateStatusParam = {
  336. companyAddressId: null,
  337. handleMan: "admin",
  338. handleNote: null,
  339. receiveMan: "admin",
  340. receiveNote: null,
  341. returnAmount: 0,
  342. status: 0,
  343. };
  344. const defaultOrderReturnApply = {
  345. id: null,
  346. orderId: null,
  347. companyAddressId: null,
  348. productId: null,
  349. orderSn: null,
  350. createTime: null,
  351. memberUsername: null,
  352. returnAmount: null,
  353. returnName: null,
  354. returnPhone: null,
  355. status: null,
  356. handleTime: null,
  357. productPic: null,
  358. productName: null,
  359. productBrand: null,
  360. productAttr: null,
  361. productCount: null,
  362. productPrice: null,
  363. productRealPrice: null,
  364. reason: null,
  365. description: null,
  366. proofPics: null,
  367. handleNote: null,
  368. handleMan: null,
  369. receiveMan: null,
  370. receiveTime: null,
  371. receiveNote: null,
  372. deliverySn:null
  373. };
  374. export default {
  375. name: "returnApplyDetail",
  376. data() {
  377. return {
  378. id: null,
  379. orderReturnApply: Object.assign({}, defaultOrderReturnApply),
  380. productList: null,
  381. proofPics: null,
  382. updateStatusParam: Object.assign({}, defaultUpdateStatusParam),
  383. companyAddressList: null,
  384. };
  385. },
  386. created() {
  387. this.id = this.$route.query.id;
  388. this.getDetail();
  389. },
  390. computed: {
  391. totalAmount() {
  392. if (this.orderReturnApply != null) {
  393. return (
  394. this.orderReturnApply.productRealPrice *
  395. this.orderReturnApply.productCount
  396. );
  397. } else {
  398. return 0;
  399. }
  400. },
  401. currentAddress() {
  402. console.log("currentAddress()");
  403. let id = this.updateStatusParam.companyAddressId;
  404. if (this.companyAddressList == null) return {};
  405. for (let i = 0; i < this.companyAddressList.length; i++) {
  406. let address = this.companyAddressList[i];
  407. if (address.id === id) {
  408. return address;
  409. }
  410. }
  411. return null;
  412. },
  413. },
  414. filters: {
  415. formatStatus(status) {
  416. if (status === 0) {
  417. return "待处理";
  418. } else if (status === 1) {
  419. return "退货中";
  420. } else if (status === 2) {
  421. return "已完成";
  422. } else {
  423. return "已拒绝";
  424. }
  425. },
  426. formatTime(time) {
  427. if (time == null || time === "") {
  428. return "--";
  429. }
  430. let date = new Date(time);
  431. return formatDate(date, "yyyy-MM-dd hh:mm:ss");
  432. },
  433. formatRegion(address) {
  434. let str = address.province;
  435. if (address.city != null) {
  436. str += " " + address.city;
  437. }
  438. str += " " + address.region;
  439. return str;
  440. },
  441. },
  442. methods: {
  443. handleViewOrder() {
  444. this.$router.push({
  445. path: "/oms/orderDetail",
  446. query: { id: this.orderReturnApply.orderId },
  447. });
  448. },
  449. getDetail() {
  450. getApplyDetail(this.id).then((response) => {
  451. console.log("getDetail");
  452. this.orderReturnApply = response.data;
  453. this.productList = [];
  454. this.productList.push(this.orderReturnApply);
  455. if (this.orderReturnApply.proofPics != null) {
  456. this.proofPics = this.orderReturnApply.proofPics.split(",");
  457. }
  458. //退货中和完成
  459. if (
  460. this.orderReturnApply.status === 1 ||
  461. this.orderReturnApply.status === 2
  462. ) {
  463. this.updateStatusParam.returnAmount =
  464. this.orderReturnApply.returnAmount;
  465. this.updateStatusParam.companyAddressId =
  466. this.orderReturnApply.companyAddressId;
  467. }
  468. this.getCompanyAddressList();
  469. });
  470. },
  471. getCompanyAddressList() {
  472. fetchList().then((response) => {
  473. console.log("getCompanyAddressList()");
  474. this.companyAddressList = response.data;
  475. for (let i = 0; i < this.companyAddressList.length; i++) {
  476. if (
  477. this.companyAddressList[i].receiveStatus === 1 &&
  478. this.orderReturnApply.status === 0
  479. ) {
  480. this.updateStatusParam.companyAddressId =
  481. this.companyAddressList[i].id;
  482. }
  483. }
  484. });
  485. },
  486. handleUpdateStatus(status) {
  487. this.updateStatusParam.status = status;
  488. this.$confirm("是否要进行此操作?", "提示", {
  489. confirmButtonText: "确定",
  490. cancelButtonText: "取消",
  491. type: "warning",
  492. }).then(() => {
  493. updateApplyStatus(this.id, this.updateStatusParam).then((response) => {
  494. this.$message({
  495. type: "success",
  496. message: "操作成功!",
  497. duration: 1000,
  498. });
  499. this.$router.back();
  500. });
  501. });
  502. },
  503. },
  504. };
  505. </script>
  506. <style scoped>
  507. .detail-container {
  508. position: absolute;
  509. left: 0;
  510. right: 0;
  511. width: 1080px;
  512. padding: 35px 35px 15px 35px;
  513. margin: 20px auto;
  514. }
  515. .standard-margin {
  516. margin-top: 15px;
  517. }
  518. .form-border {
  519. border-right: 1px solid #dcdfe6;
  520. border-bottom: 1px solid #dcdfe6;
  521. padding: 10px;
  522. }
  523. .form-container-border {
  524. border-left: 1px solid #dcdfe6;
  525. border-top: 1px solid #dcdfe6;
  526. margin-top: 15px;
  527. }
  528. .form-left-bg {
  529. background: #f2f6fc;
  530. }
  531. </style>