productAfterSalesOrder.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <div class="order-content">
  3. <div class="order-status" v-if="afterSales!=null" >
  4. <el-steps :active="afterSales.status==4?afterSales.status+1:afterSales.status" align-center>
  5. <el-step title="待审核(24小时自动审核)"></el-step>
  6. <el-step title="平台已审核等待用户发货"></el-step>
  7. <el-step title="用户已发货待仓库审核"></el-step>
  8. <el-step title="财务审核"></el-step>
  9. <el-step title="退款成功"></el-step>
  10. </el-steps>
  11. </div>
  12. <div v-if="afterSales!=null">
  13. <el-card shadow="never" style="margin-top: 15px">
  14. <div class="operate-container">
  15. <span style="margin-left: 20px" class="color-danger">售后状态:
  16. <el-tag prop="status" v-for="(item, index) in salesStatusOptions" v-if="afterSales.salesStatus==item.dictValue">{{item.dictLabel}}</el-tag>
  17. </span>
  18. <div class="operate-button-container" >
  19. <el-button size="mini" v-hasPermi="['store:storeAfterSales:edit']" v-show="afterSales.salesStatus==0&&afterSales.status===1" @click="addDelivery">编辑物流</el-button>
  20. <el-button size="mini" v-hasPermi="['store:storeAfterSales:audit1']" v-show="afterSales.salesStatus==0&&afterSales.status===0" @click="handleAudit1">平台审核</el-button>
  21. <el-button size="mini" v-hasPermi="['store:storeAfterSales:audit2']" v-show="afterSales.salesStatus==0&&afterSales.status===2" @click="handleAudit2">仓库审核</el-button>
  22. <el-button size="mini" v-hasPermi="['store:storeAfterSales:refund']" @click="handleRefund" v-show="afterSales.salesStatus==0&&afterSales.status===3">财务审核</el-button>
  23. <el-button size="mini" v-hasPermi="['store:storeAfterSales:cancel']" @click="cancel" v-show="afterSales.salesStatus==0">撤销</el-button>
  24. <el-button size="mini" @click="showOrder">查看订单</el-button>
  25. </div>
  26. </div>
  27. <div style="margin: 20px 0px">
  28. <span class="font-small">基本信息</span>
  29. </div>
  30. <el-descriptions :column="4" border >
  31. <el-descriptions-item label="订单编号" >
  32. <span v-if="afterSales!=null">
  33. {{afterSales.orderCode}}
  34. </span>
  35. </el-descriptions-item>
  36. <el-descriptions-item label="会员" >
  37. <span v-if="user!=null">
  38. {{user.nickname}}({{user.phone}})
  39. </span>
  40. </el-descriptions-item>
  41. <el-descriptions-item label="退款金额" >
  42. <span v-if="afterSales!=null">
  43. {{afterSales.refundAmount}}
  44. </span>
  45. </el-descriptions-item>
  46. <el-descriptions-item label="申请类型" >
  47. <span v-if="afterSales!=null">
  48. <el-tag v-for="(item, index) in serviceTypeOptions" v-if="afterSales.serviceType==item.dictValue" >{{item.dictLabel}}</el-tag>
  49. </span>
  50. </el-descriptions-item>
  51. <el-descriptions-item label="申请原因" >
  52. <span v-if="afterSales!=null">
  53. {{afterSales.reasons}}
  54. </span>
  55. </el-descriptions-item>
  56. <el-descriptions-item label="说明" >
  57. <span v-if="afterSales!=null">
  58. {{afterSales.explains}}
  59. </span>
  60. </el-descriptions-item>
  61. <el-descriptions-item label="状态" >
  62. <span v-if="afterSales!=null">
  63. <el-tag v-for="(item, index) in statusOptions" v-if="afterSales.status==item.dictValue" >{{item.dictLabel}}</el-tag>
  64. </span>
  65. </el-descriptions-item>
  66. <el-descriptions-item label="售后状态" >
  67. <span v-if="afterSales!=null">
  68. <el-tag v-for="(item, index) in salesStatusOptions" v-if="afterSales.salesStatus==item.dictValue" >{{item.dictLabel}}</el-tag>
  69. </span>
  70. </el-descriptions-item>
  71. </el-descriptions>
  72. <div style="margin: 20px 0px">
  73. <span class="font-small">收货信息</span>
  74. </div>
  75. <el-descriptions :column="4" border >
  76. <el-descriptions-item label="收货人" >
  77. <span v-if="afterSales!=null">
  78. {{afterSales.consignee}}
  79. </span>
  80. </el-descriptions-item>
  81. <el-descriptions-item label="收货人" >
  82. <span v-if="afterSales!=null">
  83. {{afterSales.consignee}}
  84. </span>
  85. </el-descriptions-item>
  86. <el-descriptions-item label="手机号码" >
  87. <span v-if="afterSales!=null">
  88. {{afterSales.phoneNumber}}
  89. </span>
  90. </el-descriptions-item>
  91. <el-descriptions-item label="收货地址" >
  92. <span v-if="afterSales!=null">
  93. {{afterSales.address}}
  94. </span>
  95. </el-descriptions-item>
  96. <el-descriptions-item label="快递公司" >
  97. <span v-if="afterSales!=null">
  98. {{afterSales.deliveryName}}
  99. </span>
  100. </el-descriptions-item>
  101. <el-descriptions-item label="运单号" >
  102. <span v-if="afterSales!=null">
  103. {{afterSales.deliverySn}}
  104. </span>
  105. </el-descriptions-item>
  106. </el-descriptions>
  107. <div style="margin-top: 20px">
  108. <span class="font-small">商品信息</span>
  109. </div>
  110. <el-table
  111. border
  112. :data="items"
  113. size="small"
  114. style="width: 100%;margin-top: 20px" >
  115. <el-table-column label="商品图片" width="150" align="center">
  116. <template slot-scope="scope">
  117. <img :src="JSON.parse(scope.row.jsonInfo).image" style="height: 80px">
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="商品名称" width="300" align="center">
  121. <template slot-scope="scope">
  122. <p>{{JSON.parse(scope.row.jsonInfo).productName}}</p>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="价格" width="240" align="center">
  126. <template slot-scope="scope">
  127. <p>价格:¥{{JSON.parse(scope.row.jsonInfo).price}}</p>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="属性" width="240" align="center">
  131. <template slot-scope="scope">
  132. {{JSON.parse(scope.row.jsonInfo).sku}}
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="数量" width="180" align="center">
  136. <template slot-scope="scope">
  137. {{JSON.parse(scope.row.jsonInfo).num}}
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="小计" align="center">
  141. <template slot-scope="scope">
  142. ¥{{JSON.parse(scope.row.jsonInfo).num*JSON.parse(scope.row.jsonInfo).price}}
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. <div style="margin-top: 20px">
  147. <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
  148. <span class="font-small">操作信息</span>
  149. </div>
  150. <el-table style="margin-top: 20px;width: 100%"
  151. ref="orderHistoryTable"
  152. :data="logs" border>
  153. <el-table-column label="操作时间" width="160" align="center">
  154. <template slot-scope="scope">
  155. {{scope.row.changeTime}}
  156. </template>
  157. </el-table-column>
  158. <el-table-column label="备注" align="center">
  159. <template slot-scope="scope">
  160. {{scope.row.changeMessage}}
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="操作员" align="center">
  164. <template slot-scope="scope">
  165. {{scope.row.operator}}
  166. </template>
  167. </el-table-column>
  168. </el-table>
  169. </el-card>
  170. </div>
  171. <el-dialog :title="audit.title" :visible.sync="audit.open" width="800px" append-to-body>
  172. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  173. <el-form-item label="退款金额" prop="refundAmount" >
  174. <el-input-number disabled v-model="form.refundAmount" :min="0" />
  175. </el-form-item>
  176. </el-form>
  177. <div slot="footer" class="dialog-footer">
  178. <el-button type="primary" @click="submitAuditForm">确 定</el-button>
  179. </div>
  180. </el-dialog>
  181. <el-drawer
  182. :append-to-body="true"
  183. size="75%"
  184. :title="show.title" :visible.sync="show.open"
  185. >
  186. <product-order ref="productOrder" />
  187. </el-drawer>
  188. <el-dialog :title="add.title" :visible.sync="add.open" width="500px" append-to-body>
  189. <div slot="footer" class="dialog-footer">
  190. <el-form ref="addForm" :model="addForm" :rules="addRules" label-width="100px">
  191. <el-form-item label="id" prop="id" v-if="false">
  192. <el-input v-model="addForm.id" placeholder="请输入" />
  193. </el-form-item>
  194. <el-form-item label="快递公司" prop="deliveryName">
  195. <el-input v-model="addForm.deliveryName" placeholder="请输入" />
  196. </el-form-item>
  197. <el-form-item label="运单号" prop="deliverySn">
  198. <el-input v-model="addForm.deliverySn" placeholder="请输入" />
  199. </el-form-item>
  200. </el-form>
  201. <el-button type="primary" @click="submitForm">确 定</el-button>
  202. <el-button @click="cancel1">取 消</el-button>
  203. </div>
  204. </el-dialog>
  205. </div>
  206. </template>
  207. <script>
  208. import {getStoreAfterSales,cancel,refund,audit1,audit2,updateStoreAfterSales} from "@/api/store/storeAfterSales";
  209. import productOrder from "./productOrder";
  210. export default {
  211. components: { productOrder },
  212. name: "order",
  213. data() {
  214. return {
  215. show:{
  216. open:false,
  217. title:"订单详情"
  218. },
  219. audit:{
  220. title:"财务审核",
  221. open:false,
  222. },
  223. add:{
  224. open:false,
  225. title:"添加物流"
  226. },
  227. addForm:{
  228. id:null,
  229. deliveryName:null,
  230. deliverySn:null
  231. },
  232. addRules:{
  233. deliveryName: [
  234. { required: true, message: "物流名称不能为空", trigger: "blur" }
  235. ],
  236. deliverySn: [
  237. { required: true, message: "物流单号不能为空", trigger: "blur" }
  238. ],
  239. },
  240. order:null,
  241. user:null,
  242. serviceTypeOptions:[],
  243. salesStatusOptions:[],
  244. statusOptions:[],
  245. afterSales:null,
  246. items:[],
  247. logs:[],
  248. form:{
  249. refundAmount:0,
  250. },
  251. rules:{
  252. status: [
  253. { required: true, message: "状态不能为空", trigger: "blur" }
  254. ],
  255. refundAmount: [
  256. { required: true, message: "退款金额不能为空", trigger: "blur" }
  257. ],
  258. }
  259. };
  260. },
  261. created() {
  262. this.getDicts("store_after_sales_sales_status").then((response) => {
  263. this.salesStatusOptions = response.data;
  264. });
  265. this.getDicts("store_after_sales_status").then((response) => {
  266. this.statusOptions = response.data;
  267. });
  268. this.getDicts("store_after_sales_service_type").then((response) => {
  269. this.serviceTypeOptions = response.data;
  270. });
  271. },
  272. methods: {
  273. submitForm() {
  274. var id=this.afterSales.id;
  275. this.addForm.id = id;
  276. updateStoreAfterSales(this.addForm).then(response => {
  277. if (response.code === 200) {
  278. this.msgSuccess("编辑成功");
  279. this.add.open = false;
  280. this.getStoreAfterSales(id);
  281. }
  282. });
  283. },
  284. cancel1(){
  285. this.add.open = false;
  286. },
  287. addDelivery(){
  288. this.add.open = true;
  289. },
  290. showOrder(){
  291. this.show.open=true;
  292. const orderId = this.order.id ;
  293. setTimeout(() => {
  294. this.$refs.productOrder.getOrder(orderId);
  295. }, 500);
  296. },
  297. handleAudit1(){
  298. var id=this.afterSales.id;
  299. this.$confirm('确定审请通过?', "警告", {
  300. confirmButtonText: "确定",
  301. cancelButtonText: "取消",
  302. type: "warning"
  303. }).then(function() {
  304. var data={salesId:id}
  305. return audit1(data);
  306. }).then(() => {
  307. this.getStoreAfterSales(id);
  308. this.msgSuccess("操作成功");
  309. }).catch(function() {});
  310. },
  311. handleAudit2(){
  312. var id=this.afterSales.id;
  313. this.$confirm('确定审请通过?', "警告", {
  314. confirmButtonText: "确定",
  315. cancelButtonText: "取消",
  316. type: "warning"
  317. }).then(function() {
  318. var data={salesId:id}
  319. return audit2(data);
  320. }).then(() => {
  321. this.getStoreAfterSales(id);
  322. this.msgSuccess("操作成功");
  323. }).catch(function() {});
  324. },
  325. handleRefund(){
  326. this.audit.open=true;
  327. this.form.salesId=this.afterSales.id;
  328. this.form.refundAmount=this.afterSales.refundAmount;
  329. },
  330. submitAuditForm() {
  331. this.$refs["form"].validate(valid => {
  332. if (valid) {
  333. refund(this.form).then(response => {
  334. if (response.code === 200) {
  335. this.audit.open = false;
  336. this.getStoreAfterSales(this.afterSales.id);
  337. this.msgSuccess("操作成功");
  338. }
  339. });
  340. }
  341. });
  342. },
  343. cancel(){
  344. var id=this.afterSales.id;
  345. this.$prompt('是否确定取消订单?', '提示', {
  346. confirmButtonText: '确定',
  347. cancelButtonText: '取消',
  348. }).then(({ value }) => {
  349. var data={salesId:id,remark:value};
  350. return cancel(data);
  351. }).then(() => {
  352. this.getStoreAfterSales(id);
  353. this.msgSuccess("操作成功");
  354. }).catch(() => {
  355. });
  356. },
  357. getStoreAfterSales(id){
  358. getStoreAfterSales(id).then(response => {
  359. this.afterSales = response.afterSales;
  360. this.logs = response.logs;
  361. this.items = response.items;
  362. this.user=response.user;
  363. this.order=response.order;
  364. });
  365. }
  366. }
  367. };
  368. </script>
  369. <style scoped>
  370. .order-content{
  371. margin: 10px;
  372. }
  373. .operate-container {
  374. background: #F2F6FC;
  375. height: 60px;
  376. margin: -20px -20px 0;
  377. line-height: 60px;
  378. }
  379. .operate-button-container {
  380. float: right;
  381. margin-right: 20px
  382. }
  383. </style>