index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div class="app-container mod-order-order">
  3. <!-- 筛选条件 -->
  4. <div class="screen-container">
  5. <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
  6. <el-row :gutter="20">
  7. <el-col :xs="24" :sm="12" :lg="6">
  8. <el-form-item label="订单号" prop="orderId">
  9. <el-input v-model="screenForm.orderId" placeholder="请输入订单号"></el-input>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :xs="24" :sm="12" :lg="6">
  13. <el-form-item label="售后编号" prop="orderRefundId">
  14. <el-input v-model="screenForm.orderRefundId" placeholder="请输入售后编号"></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :xs="24" :sm="12" :lg="6">
  18. <el-form-item label="会员昵称" prop="userName">
  19. <el-input v-model="screenForm.userName" placeholder="请输入会员昵称"></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="手机号" prop="phone">
  24. <el-input v-model="screenForm.phone" placeholder="请输入手机号"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="网点名称" prop="websitId">
  29. <el-select v-model="screenForm.websitId" placeholder="全部" filterable>
  30. <el-option label="全部" value=""></el-option>
  31. <el-option :label="item.name" :value="item.id" v-for="(item, index) in websiteList" :key="index"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. </el-col>
  35. <!-- <el-col :xs="24" :sm="12" :lg="6">-->
  36. <!-- <el-form-item label="当前状态" prop="orderStatus">-->
  37. <!-- <el-select v-model="screenForm.orderStatus" placeholder="全部">-->
  38. <!-- <el-option label="全部" value=""></el-option>-->
  39. <!-- <el-option :label="item.label" :value="item.value" v-for="(item, index) in screen_status" :key="index"></el-option>-->
  40. <!-- </el-select>-->
  41. <!-- </el-form-item>-->
  42. <!-- </el-col>-->
  43. <el-col :xs="24" :sm="12" :lg="6">
  44. <el-form-item label="申请时间" prop="createDate">
  45. <el-date-picker
  46. v-model="screenForm.createDate"
  47. type="datetimerange"
  48. value-format="yyyy-MM-dd HH:mm:ss"
  49. range-separator="至"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期">
  52. </el-date-picker>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="12" :lg="6">
  56. <el-form-item label="处理时间" prop="examineDate">
  57. <el-date-picker
  58. v-model="screenForm.examineDate"
  59. type="datetimerange"
  60. value-format="yyyy-MM-dd HH:mm:ss"
  61. range-separator="至"
  62. start-placeholder="开始日期"
  63. end-placeholder="结束日期">
  64. </el-date-picker>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  68. <el-form-item label="">
  69. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  70. <el-button size="small" @click="resetScreenForm">清空</el-button>
  71. </el-form-item>
  72. </el-col>
  73. </el-row>
  74. </el-form>
  75. </div>
  76. <div class="tabs-container order-tabs-container clearfix">
  77. <div class="fl">
  78. <el-tabs v-model="tabCurrent" type="card" @tab-click="changeTabs">
  79. <el-tab-pane label="全部" name="ALL"></el-tab-pane>
  80. <el-tab-pane label="待商家处理" name="DSJCL"></el-tab-pane>
  81. <el-tab-pane label="待买家处理" name="DMJCL"></el-tab-pane>
  82. <el-tab-pane label="待商家收货" name="DSJSH"></el-tab-pane>
  83. <el-tab-pane label="已完成" name="OVER"></el-tab-pane>
  84. </el-tabs>
  85. </div>
  86. <div class="fr">
  87. <el-button v-if="$restrict('exp')" size="small" type="primary" @click="handleExport">导出报表</el-button>
  88. </div>
  89. </div>
  90. <div class="order-main-container">
  91. <div class="table-top">
  92. <el-row style="width:100%">
  93. <el-col :span="6"><span class="item product">商品信息</span></el-col>
  94. <el-col :span="3" style="text-align: right"><span class="item">单价(元)/数量</span></el-col>
  95. <el-col :span="3" style="text-align: center"><span class="item">买家信息</span></el-col>
  96. <el-col :span="3" style="text-align: center"><span class="item">订单金额</span></el-col>
  97. <el-col :span="3" style="text-align: center"><span class="item">退款金额</span></el-col>
  98. <el-col :span="3" style="text-align: center"><span class="item">维权类型/状态</span></el-col>
  99. <el-col :span="3" style="text-align: center"><span class="item">操作</span></el-col>
  100. </el-row>
  101. </div>
  102. <div class="order-item" v-for="(order, index) in dataList" :key="order.orderRefundId">
  103. <div class="order-top">
  104. <el-row>
  105. <el-col :xs="24" :sm="24" :lg="20">
  106. <span><b>售后编号</b>:{{order.orderRefundId}}</span>
  107. <span><b>申请时间</b>:{{order.createTime}}</span>
  108. <span><b>商户</b>:{{order.companyWechatName || '无'}}</span>
  109. <span><b>发货状态</b>:{{order.logisticsNo ? '已发货' : '未发货'}}</span>
  110. </el-col>
  111. <el-col :xs="24" :sm="24" :lg="4" style="text-align: right;">
  112. <el-link type="primary" v-if="$restrict('orderNote')" :underline="false" @click="showRemark(order.orderRefundId, order.remark)">订单备注</el-link>
  113. <el-link type="primary" v-if="$restrict('detail')" :underline="false" @click="showDetail(order.orderRefundId)">查看详情</el-link>
  114. <!-- <el-link type="primary" :underline="false" @click="queryWorkOrder(order.orderId)">订单工单</el-link> -->
  115. </el-col>
  116. </el-row>
  117. </div>
  118. <div class="order-content">
  119. <el-row style="width:100%">
  120. <el-col :span="9" style="height: 100%;">
  121. <div class="col-item-pro">
  122. <div v-if="order.examineStatus === 'FAIL'">
  123. <div v-for="orderItem in order.orderDetails" :key="orderItem.orderDetailId">
  124. <div class="pro-item">
  125. <div class="left">
  126. <div class="image">
  127. <img :src="orderItem.imgUrl" style="height:80px;width: 80px;">
  128. </div>
  129. <div class="main">
  130. <span>{{orderItem.goodsName}}</span>
  131. <span class="spec">{{orderItem.goodsSpecName}}-{{orderItem.goodsSpecValue}}</span>
  132. </div>
  133. </div>
  134. <div class="right">
  135. <span>¥{{orderItem.price}}</span>
  136. <span>x{{orderItem.num}}</span>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div v-else>
  142. <div v-for="orderItem in order.orderDetails" :key="orderItem.orderDetailId">
  143. <div class="pro-item" v-if="orderItem.refund">
  144. <div class="left">
  145. <div class="image">
  146. <img :src="orderItem.imgUrl" style="height:80px;width: 80px;">
  147. </div>
  148. <div class="main">
  149. <span>{{orderItem.goodsName}}</span>
  150. <span class="spec" v-if="orderItem.goodsSpecName === '默认' && orderItem.goodsSpecValue === '默认'">默认</span>
  151. <span class="spec" v-else>{{orderItem.goodsSpecName}}-{{orderItem.goodsSpecValue}}</span>
  152. </div>
  153. </div>
  154. <div class="right">
  155. <span>¥{{orderItem.price}}</span>
  156. <span>x{{orderItem.refundNum}}</span>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </el-col>
  163. <el-col :span="3" style="height: 100%;">
  164. <div class="col-item">
  165. <div>{{ order.userName }}</div>
  166. <div>{{ order.phone }}</div>
  167. </div>
  168. </el-col>
  169. <el-col :span="3" style="height: 100%;">
  170. <div class="col-item">
  171. <div class="totalprice">¥{{ order.payAmount }}</div>
  172. </div>
  173. </el-col>
  174. <el-col :span="3" style="height: 100%;">
  175. <div class="col-item">
  176. <div class="totalprice">¥{{ order.refundAmount }}</div>
  177. </div>
  178. </el-col>
  179. <el-col :span="3" style="height: 100%;">
  180. <div class="col-item">
  181. <div>{{order.refundType | REFUND_CURRENT_TYPE_FILTER}}</div>
  182. <div>{{ order.orderStatus | ORDER_REFUND_CURRENT_STATUS_FILTER }}</div>
  183. </div>
  184. </el-col>
  185. <el-col :span="3" style="height: 100%;">
  186. <div class="col-item">
  187. <div class="operate" v-if="order.orderStatus === 'DSJCL'">
  188. <div>
  189. <el-button v-if="$restrict('agree')" slot="reference" type="text" size="small" @click="changeExamineStatus(order.orderRefundId,'OK')">同意</el-button>
  190. </div>
  191. <div>
  192. <el-button v-if="$restrict('reject')" slot="reference" type="text" size="small" @click="changeExamineStatus(order.orderRefundId,'FAIL')">拒绝</el-button>
  193. </div>
  194. <div>
  195. <!-- toWorkOrderDetail(order.orderId) -->
  196. <el-button type="text" size="small" v-if="order.toWorkOrder && $restrict('workOrder_detail')" @click="queryWorkOrder(order.orderId)">查看工单</el-button>
  197. </div>
  198. </div>
  199. <div class="operate" v-if="order.orderStatus === 'DSJSH'">
  200. <div v-if="$restrict('confirmReceipt')">
  201. <el-popconfirm title="确定要收货吗?" @confirm="receiveProd(order.orderRefundId)">
  202. <el-button slot="reference" type="text" size="small">确认收货</el-button>
  203. </el-popconfirm>
  204. </div>
  205. <div v-if="order.logisticsNo && $restrict('viewLogistics')">
  206. <el-button type="text" size="small" @click="queryLogistics(order.logisticsNo)">查看物流</el-button>
  207. </div>
  208. <div>
  209. <el-button type="text" size="small" v-if="order.toWorkOrder && $restrict('workOrder_detail')" @click="toWorkOrderDetail(order.orderId)">查看工单</el-button>
  210. </div>
  211. </div>
  212. </div>
  213. </el-col>
  214. </el-row>
  215. </div>
  216. <div class="order-remark buyer" v-if="order.buyerMsg">买家留言:{{order.buyerMsg}}</div>
  217. <div class="order-remark saler" v-if="order.remark">商家备注:{{order.remark}}</div>
  218. </div>
  219. <div class="no-data" v-if="dataList.length <= 0">暂无订单</div>
  220. </div>
  221. <div class="pagination clearfix">
  222. <div class="fr">
  223. <el-pagination
  224. @size-change="handleSizeChange"
  225. @current-change="handleCurrentChange"
  226. :current-page="currentPage"
  227. :page-sizes="[10, 20, 30, 50]"
  228. :page-size="10"
  229. layout="total, sizes, prev, pager, next, jumper"
  230. :total="listTotal">
  231. </el-pagination>
  232. </div>
  233. </div>
  234. <el-dialog :title="'订单备注'" :visible.sync="remarkVisible" :show-close="false" width="50%" :close-on-click-modal="false">
  235. <el-input
  236. type="textarea"
  237. :autosize="{ minRows: 8, maxRows: 16}"
  238. placeholder="请输入备注内容"
  239. v-model="remark"
  240. maxlength="100"
  241. show-word-limit>
  242. </el-input>
  243. <div slot="footer" class="dialog-footer">
  244. <el-button type="primary" @click="saveRemark">保 存</el-button>
  245. <el-button @click="cancelRemark">取 消</el-button>
  246. </div>
  247. </el-dialog>
  248. <el-dialog :title="'物流信息'" :visible.sync="logisticsVisible" :show-close="false" width="80%" :close-on-click-modal="false">
  249. <el-table
  250. :data="logistics"
  251. style="width: 100%"
  252. size="mini">
  253. <el-table-column prop="logisticsNo" label="快递单号" align="center"></el-table-column>
  254. <el-table-column prop="comName" label="物流公司" align="center"></el-table-column>
  255. <el-table-column prop="time" label="物流时间" align="center"></el-table-column>
  256. <el-table-column prop="state" label="物流状态" align="center">
  257. <template slot-scope="scope">
  258. {{ scope.row.state | EXPRESS_CURRENT_STATE_FILTER }}
  259. </template>
  260. </el-table-column>
  261. <el-table-column prop="context" label="物流详情" align="center"></el-table-column>
  262. </el-table>
  263. <div slot="footer" class="dialog-footer">
  264. <el-button @click="logisticsVisible = false">关 闭</el-button>
  265. </div>
  266. </el-dialog>
  267. </div>
  268. </template>
  269. <script>
  270. import {getRefundList, saveRefundRemark, changeExamineStatus, receiveProd, getWebsiteList} from "@/api/order"
  271. import {getExpress} from "@/api/common"
  272. import {downloadFiles} from '@/utils/util'
  273. import '@/styles/order-list.scss'
  274. export default {
  275. name: "order_refund",
  276. data() {
  277. return {
  278. screenForm: { // 筛选表单数据
  279. orderId: '', // 订单号
  280. orderRefundId: '', // 售后编号
  281. userName: '', // 会员昵称
  282. phone: '', // 手机号
  283. websitId: '', // 网点名称
  284. createDate: '', // 创建时间
  285. examineDate: '', // 支付时间
  286. orderStatus: '',
  287. },
  288. tabCurrent: 'ALL',
  289. currentPage: 1, // 当前页码
  290. pageSize: 10, // 每页数量
  291. listTotal: 0, // 列表总数
  292. dataList: [],
  293. remarkVisible: false,
  294. editOrderId: '',
  295. remark: '', // 订单备注
  296. logisticsVisible: false,
  297. logistics: [],
  298. detail: {},
  299. websiteList: [],
  300. }
  301. },
  302. created() {
  303. this.getList();
  304. this.getWebsiteList();
  305. if(this.$route.query.id){
  306. this.showDetail(this.$route.query.id)
  307. }
  308. },
  309. methods: {
  310. queryWorkOrder(id) {
  311. this.$router.push({
  312. name: 'workOrderPool',
  313. params: {
  314. pageType: 'saleOrderId',
  315. pageCode: id,
  316. },
  317. })
  318. },
  319. changeTabs(tab, event) {
  320. // this.$refs.screenForm.resetFields();
  321. this.screenForm.orderStatus = this.tabCurrent === 'ALL' ? '' : tab.$options.propsData.name
  322. this.currentPage = 1;
  323. this.getList();
  324. },
  325. // 获取数据列表
  326. getList () {
  327. this.listLoading = true;
  328. let pageData = {
  329. pageNum: this.currentPage,
  330. pageSize: this.pageSize
  331. }
  332. let screenData = {
  333. orderId: this.screenForm.orderId, // 订单号
  334. orderRefundId: this.screenForm.orderRefundId, // 售后编号
  335. userName: this.screenForm.userName, // 会员昵称
  336. phone: this.screenForm.phone, // 手机号
  337. websitId: this.screenForm.websitId,
  338. orderStatus: this.screenForm.orderStatus, // 状态
  339. startCreateTime: this.screenForm.createDate ? this.screenForm.createDate[0] : '', // 创建时间
  340. endCreateTime: this.screenForm.createDate ? this.screenForm.createDate[1] : '', // 创建时间
  341. startExamineTime: this.screenForm.examineDate ? this.screenForm.examineDate[0] : '', // 处理时间
  342. endExamineTime: this.screenForm.examineDate ? this.screenForm.examineDate[1] : '', // 处理时间
  343. };
  344. let params = {};
  345. Object.assign(params, screenData, pageData);
  346. getRefundList(params).then(res => {
  347. this.dataList = res.data.records;
  348. this.listTotal = res.data.total;
  349. this.listLoading = false;
  350. })
  351. },
  352. // 查看详情
  353. queryDetail (orderRefundId) {
  354. },
  355. // 更改每页数量
  356. handleSizeChange(val) {
  357. this.pageSize = val;
  358. this.currentPage = 1;
  359. this.getList();
  360. },
  361. // 更改当前页
  362. handleCurrentChange(val) {
  363. this.currentPage = val;
  364. this.getList();
  365. },
  366. // 提交筛选表单
  367. submitScreenForm() {
  368. this.currentPage = 1;
  369. this.getList();
  370. },
  371. // 重置筛选表单
  372. resetScreenForm() {
  373. this.$refs.screenForm.resetFields();
  374. this.currentPage = 1;
  375. this.getList();
  376. },
  377. // 网点列表
  378. getWebsiteList() {
  379. getWebsiteList({
  380. pageNum: 1,
  381. pageSize: 1000
  382. }).then(res => {
  383. this.websiteList = res.data.records;
  384. })
  385. },
  386. showRemark(orderId, remark) {
  387. this.remarkVisible = true
  388. this.editOrderId = orderId
  389. this.remark = remark
  390. },
  391. cancelRemark() {
  392. this.remarkVisible = false
  393. this.editOrderId = ''
  394. this.remark = ''
  395. },
  396. saveRemark() {
  397. const params = {
  398. orderRefundId: this.editOrderId,
  399. remark: this.remark
  400. }
  401. saveRefundRemark(params).then(() => {
  402. this.cancelRemark();
  403. this.getList();
  404. this.$successMsg('保存成功');
  405. })
  406. },
  407. // 变更维权处理状态
  408. changeExamineStatus(orderRefundId, examineStatus) {
  409. this.$prompt('请输入卖家留言', examineStatus == 'OK' ? '同意':'拒绝', {
  410. confirmButtonText: '确定',
  411. cancelButtonText: '取消',
  412. }).then(({ value }) => {
  413. changeExamineStatus({
  414. orderRefundId,
  415. examineStatus,
  416. refundMessage: value
  417. }).then(() => {
  418. this.getList();
  419. this.$successMsg('操作成功');
  420. })
  421. }).catch(() => {});
  422. },
  423. // 查看物流
  424. queryLogistics(logisticsNo) {
  425. this.logisticsVisible = true
  426. getExpress({ logisticsNo }).then(res => {
  427. this.logistics = res.data
  428. })
  429. },
  430. // 查看详情
  431. showDetail(orderRefundId) {
  432. // const orderRefundId = this.dataList[index].orderRefundId
  433. // let {href} = this.$router.resolve({path: `/order/order_refund_detail?orderRefundId=${orderRefundId}`});
  434. // window.open(href, '_blank');
  435. this.$router.push({
  436. name:"order_refund_detail",
  437. query: {
  438. orderRefundId
  439. }
  440. })
  441. },
  442. receiveProd(orderRefundId) {
  443. receiveProd({orderRefundId}).then(() => {
  444. this.getList();
  445. this.$successMsg('操作成功');
  446. })
  447. },
  448. // 查看工单
  449. toWorkOrderDetail(orderId) {
  450. // let {href} = this.$router.resolve({path: `/order/workOrder_detail?orderId=${orderId}`});
  451. // window.open(href, '_blank');
  452. this.$router.push({
  453. name:"workOrder_detail",
  454. query: {
  455. orderId
  456. }
  457. })
  458. },
  459. // 导出
  460. handleExport() {
  461. let screenData = {
  462. orderId: this.screenForm.orderId, // 订单号
  463. orderRefundId: this.screenForm.orderRefundId, // 售后编号
  464. userName: this.screenForm.userName, // 会员昵称
  465. phone: this.screenForm.phone, // 手机号
  466. websitId: this.screenForm.websitId,
  467. orderStatus: this.screenForm.orderStatus, // 状态
  468. startCreateTime: this.screenForm.createDate ? this.screenForm.createDate[0] : '', // 创建时间
  469. endCreateTime: this.screenForm.createDate ? this.screenForm.createDate[1] : '', // 创建时间
  470. startExamineTime: this.screenForm.examineDate ? this.screenForm.examineDate[0] : '', // 处理时间
  471. endExamineTime: this.screenForm.examineDate ? this.screenForm.examineDate[1] : '', // 处理时间
  472. pageNum: this.currentPage,
  473. pageSize: this.pageSize
  474. };
  475. downloadFiles('order/refund/downLoadExcel', screenData);
  476. },
  477. }
  478. }
  479. </script>