Ver código fonte

Merge remote-tracking branch 'origin/master'

pangqijun 1 ano atrás
pai
commit
75f35d476f
2 arquivos alterados com 90 adições e 5 exclusões
  1. 10 0
      src/api/finance/aftersales.js
  2. 80 5
      src/views/finance/aftersales.vue

+ 10 - 0
src/api/finance/aftersales.js

@@ -59,3 +59,13 @@ export const refund = (orderId, afterSalesId) => {
   })
 }
 
+export const refundApply = (param) => {
+  return request({
+    url: '/api/finance/aftersales/refundApply',
+    method: 'post',
+    params: {
+      ...param
+    }
+  })
+}
+

+ 80 - 5
src/views/finance/aftersales.vue

@@ -30,11 +30,11 @@
 
         <template slot-scope="scope" slot="menu">
             <el-button
-                    v-if="scope.row.refundState == 0"
+                    v-if="scope.row.refundState == 0 && scope.row.status == 3"
                     type="text"
                     size="small"
-                    @click="refund(scope.row)"
-            >退款
+                    @click="openRefundApplyBox(scope.row)"
+            >退款审核
             </el-button>
         </template>
 
@@ -49,16 +49,52 @@
             </avue-crud>
         </template>
     </avue-crud>
+
+      <el-dialog title="退款审核" @close="refreshChange"
+                 append-to-body
+                 :visible.sync="auditBox"
+                 :before-close="handleClose"
+                 width="600px"
+                 heigh="40%">
+          <el-form :model="auditForm" label-width="80px">
+              <el-form-item label="审核意见:">
+                  <el-select v-model="auditForm.auditStatus" placeholder="请选择">
+                      <el-option
+                              v-for="item in auditList"
+                              :key="item.value"
+                              :label="item.name"
+                              :value="item.value">
+                      </el-option>
+                  </el-select>
+              </el-form-item>
+              <el-form-item label="驳回描述:" v-if="auditForm.auditStatus == 2">
+                  <el-input type="textarea" v-model="auditForm.remark" :autosize="{ minRows: 3, maxRows: 5}"></el-input>
+              </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+              <el-button @click="handleClose">取 消</el-button>
+              <el-button type="primary" @click="refundApply()">确 定</el-button>
+          </div>
+      </el-dialog>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove, refund} from "@/api/finance/aftersales";
+  import {getList, getDetail, add, update, remove, refund, refundApply} from "@/api/finance/aftersales";
   import {mapGetters} from "vuex";
 
   export default {
     data() {
       return {
+          auditList: [
+              {name: '通过', value: 1}, {name: '驳回', value: 2}
+          ],
+          auditForm: {
+              auditStatus: '',
+              afterSalesId: '',
+              remark: ''
+          },
+          auditBox: false,
           tableData: [],
         form: {},
         query: {},
@@ -337,7 +373,46 @@
                     loading.close();
                 });
             });
-        }
+        },
+        openRefundApplyBox(row) {
+            this.auditBox = true;
+            this.auditForm.afterSalesId = row.id;
+        },
+        refundApply() {
+          if (this.auditForm.auditStatus == 2 && this.auditForm.remark.length < 1) {
+              this.$message({
+                  type: "error",
+                  message: "请输入驳回描述!"
+              });
+              return;
+          }
+            const loading = this.$loading({
+                lock: true,
+                text: '处理中中...',
+                spinner: 'el-icon-loading',
+                background: 'rgba(0, 0, 0, 0.7)'
+            });
+            refundApply(this.auditForm).then(() => {
+                loading.close();
+                this.auditBox = false;
+                this.onLoad(this.page, this.query);
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                });
+            }, error => {
+                loading.close();
+                console.log(error);
+            });
+        },
+        handleClose() {
+            this.auditBox = false;
+            this.auditForm = {
+                auditStatus: '',
+                afterSalesId: '',
+                remark: ''
+            };
+        },
     }
   };
 </script>