refunds_dispose.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div>
  3. <use-table ref="tbl"></use-table>
  4. <div class="container padding_b_0">
  5. <!-- <div class="dflex_wrap">
  6. <div class="dflex_vertical_c margin_r_40 margin_b_20">
  7. <div class="search_name">会员名称:</div>
  8. <el-input v-model="req.name" placeholder="请输入" @input="loadData" class="search_input"></el-input>
  9. </div>
  10. <div class="dflex_vertical_c margin_r_40 margin_b_20" v-if="advancedSearch">
  11. <div class="search_name">订单编号:</div>
  12. <el-input v-model="req.order_id" placeholder="请输入" @input="loadData" class="search_input"></el-input>
  13. </div>
  14. <el-button size="mini" class="search_btn margin_b_20 margin_r_40" @click="loadData">搜索</el-button>
  15. <div class="search_advanced margin_b_20" @click="advancedSearch = !advancedSearch" v-if="!advancedSearch">高级筛选</div>
  16. <div class="search_common margin_b_20" @click="advancedSearch = !advancedSearch" v-if="advancedSearch">常用筛选</div>
  17. </div> -->
  18. </div>
  19. <div class="container use-table">
  20. <el-table :height="tblHeight" :data="tableDatas" highlight-current-row>
  21. <el-table-column label="订单编号" align="center">
  22. <template scope="scope">
  23. <div class="theme_color crpr" @click="toOrderDetail(scope.row.payOrderId)">{{ scope.row.payOrderId }}</div>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="会员" align="center">
  27. <template slot-scope="scope">
  28. <div class="dflex_vertical_c">
  29. <el-image
  30. class="headimg_small"
  31. :src="scope.row.userHead || require('static/img/touxiang.png')"
  32. :preview-src-list="scope.row.imgs"
  33. fit="contain"
  34. ></el-image>
  35. <div class="margin_l_5">{{ scope.row.userName || '未知' }}</div>
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column property="refundReason" label="退款原因" align="center"></el-table-column>
  40. <el-table-column property="goodsState" label="货物状态" align="center"></el-table-column>
  41. <el-table-column property="remark" label="备注" align="center"></el-table-column>
  42. <el-table-column label="退款状态" align="center">
  43. <!-- 1申请成功、2退款成功、3退款异常、4退款关闭-->
  44. <template slot-scope="scope">
  45. <div v-if="scope.row.state==1">申请成功</div>
  46. <div v-if="scope.row.state==2">退款成功</div>
  47. <div v-if="scope.row.state==3">退款异常</div>
  48. <div v-if="scope.row.state==4">退款关闭</div>
  49. </template>
  50. </el-table-column>
  51. <!-- <el-table-column label="操作" align="center" fixed="right">
  52. <template slot-scope="scope">
  53. <div v-if="scope.row.state == '处理中'">
  54. <el-tooltip content="同意退款" placement="top" :hide-after="1000" :enterable="false" effect="light">
  55. <el-button type="text" icon="el-icon-check" class="bbb" @click="refunded(scope.row._id, scope.row.orderId)"></el-button>
  56. </el-tooltip>
  57. <el-tooltip content="拒绝退款" placement="top" :hide-after="1000" :enterable="false" effect="light">
  58. <el-button type="text" icon="el-icon-close" class="bbb" @click="refuseRefund(scope.row._id, scope.row.orderId)"></el-button>
  59. </el-tooltip>
  60. </div>
  61. </template>
  62. </el-table-column> -->
  63. </el-table>
  64. <el-pagination
  65. :current-page="req.page"
  66. :page-sizes="[10, 20, 30, 50, 100]"
  67. :page-size="req.rows"
  68. layout="total, sizes, prev, pager, next, jumper"
  69. :total="tableTotal"
  70. @size-change="sizeChange"
  71. @current-change="currentChange"
  72. ></el-pagination>
  73. </div>
  74. <el-drawer title="拒绝原因" :visible.sync="refundDrawer" :wrapperClosable="false" direction="rtl" :append-to-body="true">
  75. <el-form class="add_edit" :model="form" :rules="rules" ref="ruleForm" label-width="100px">
  76. <el-form-item label="拒绝原因" prop="refund" ref="refund"><el-input type="textarea" :autosize="{ minRows: 3 }" v-model="form.refund"></el-input></el-form-item>
  77. <el-form-item>
  78. <el-button class="confirm_btn" @click="submitForm('ruleForm')">确 定</el-button>
  79. <el-button @click="refundDrawer = false">返回列表</el-button>
  80. </el-form-item>
  81. </el-form>
  82. </el-drawer>
  83. </div>
  84. </template>
  85. <script>
  86. const __name = 'usemall-order-refund';
  87. export default {
  88. data() {
  89. return {
  90. advancedSearch: false,
  91. req: {
  92. page: 1,
  93. rows: 10,
  94. orderby: 'sort asc',
  95. name: '',
  96. order_id: ''
  97. },
  98. refundDrawer: false,
  99. refundId: '',
  100. orderId: '',
  101. form: {
  102. refund: ''
  103. },
  104. rules: {
  105. refund: [
  106. {
  107. required: true,
  108. message: '请输入拒绝原因',
  109. trigger: 'change'
  110. }
  111. ]
  112. },
  113. tblHeight: 0,
  114. tableDatas: [],
  115. tableTotal: 0
  116. };
  117. },
  118. methods: {
  119. loadData() {
  120. this.$axios.get("/payRefund/admin/list",
  121. {
  122. params:{
  123. 'curPage':this.req.page,
  124. 'pageSize':this.req.rows,
  125. },
  126. headers:{
  127. 'Mall-Token': uni.getStorageSync("token")
  128. }
  129. }).then(response => {
  130. let res = response
  131. if (res.success) {
  132. // res.data.list.forEach((row, idx) => {
  133. // row.imgs = [row.member_headimg];
  134. // });
  135. this.tableDatas = res.data.list;
  136. this.tableTotal = res.data.totalCount;
  137. } else {
  138. }
  139. }).catch(res =>{
  140. });
  141. // this.$db[__name]
  142. // .whereif(this.req.name, { name: new RegExp(this.req.name) })
  143. // .whereif(this.req.order_id, { order_id: new RegExp(this.req.order_id) })
  144. // .totable(this.req)
  145. // .then(res => {
  146. // if (res.code == 200) {
  147. // res.datas.rows.forEach((row, idx) => {
  148. // row.imgs = [row.member_headimg];
  149. // });
  150. // this.tableDatas = res.datas.rows;
  151. // this.tableTotal = res.datas.total;
  152. // }
  153. // });
  154. },
  155. toOrderDetail(id) {
  156. //通过订单详情获取订单id
  157. this.$axios.get("/payOrder/admin/info/getByPayOrderId?payOrderId="+id,
  158. {
  159. params:{
  160. },
  161. headers:{
  162. 'Mall-Token': uni.getStorageSync("token")
  163. }
  164. }).then(response => {
  165. let res = response
  166. if (res.success) {
  167. var payId=res.data.orderId
  168. } else {
  169. }
  170. }).catch(res =>{
  171. });
  172. uni.navigateTo({
  173. url: `/pages/order/order/detail?order_id=${payId}&flag=refunds_dispose&tab=退款详情`,
  174. events: {
  175. refreshData: () => {
  176. this.loadData();
  177. }
  178. }
  179. });
  180. },
  181. refunded(id, orderId) {
  182. this.$confirm('此操作将同意退款!', '提示', {
  183. confirmButtonText: '确定',
  184. cancelButtonText: '取消',
  185. type: 'warning'
  186. }).then(() => {
  187. this.$func.useadmin.call('order/refund', { id: id, orderId: orderId, remark: '退款成功', state: '已退款' }).then(res => {
  188. if (res.code == 200) {
  189. this.loadData();
  190. }
  191. });
  192. });
  193. },
  194. refuseRefund(id, orderId) {
  195. this.refundDrawer = true;
  196. this.refundId = id;
  197. this.orderId = orderId;
  198. },
  199. submitForm(formName) {
  200. this.$refs[formName].validate((valid, obj) => {
  201. // 默认获取第一个未验证 form 属性名
  202. this.$api.set_unvalidated_form_focus(this, obj);
  203. if (valid) {
  204. this.$func.useadmin.call('order/refuse', { id: this.refundId, order_id: this.orderId, remark: this.form.refund, state: '拒绝退款' }).then(res => {
  205. if (res.code == 200) {
  206. this.refuseDrawer = false;
  207. this.loadData();
  208. }
  209. });
  210. }
  211. });
  212. },
  213. sizeChange(size) {
  214. this.req.rows = size;
  215. this.loadData();
  216. },
  217. currentChange(current) {
  218. this.req.page = current;
  219. this.loadData();
  220. }
  221. },
  222. created() {
  223. this.loadData();
  224. },
  225. updated() {
  226. if (!this.tblHeight) {
  227. this.tblHeight = this.$refs.tbl.tblHeight;
  228. }
  229. }
  230. };
  231. </script>
  232. <style>
  233. .theme_color:hover {
  234. text-decoration: underline;
  235. }
  236. .add_edit .el-textarea {
  237. width: 90%;
  238. }
  239. </style>