فهرست منبع

feat:销售端添加充值记录

caoliqin 6 روز پیش
والد
کامیت
b7fbed30b9
2فایلهای تغییر یافته به همراه100 افزوده شده و 7 حذف شده
  1. 10 1
      src/api/company/companyRecharge.js
  2. 90 6
      src/views/company/companyRecharge/index.vue

+ 10 - 1
src/api/company/companyRecharge.js

@@ -50,4 +50,13 @@ export function exportCompanyRecharge(query) {
     method: 'get',
     params: query
   })
-}
+}
+
+// 充值接口
+export function recharge(data) {
+  return request({
+    url: '/company/companyRecharge/recharge',
+    method: 'post',
+    data: data
+  })
+}

+ 90 - 6
src/views/company/companyRecharge/index.vue

@@ -39,6 +39,12 @@
           @click="handleExport"
           v-hasPermi="['company:companyRecharge:export']"
         >导出</el-button>
+        <el-button
+          size="mini"
+          type="primary"
+          icon="el-icon-edit"
+          @click="handleRecharge"
+        >充值</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -53,7 +59,6 @@
               <el-tag prop="status" v-for="(item, index) in payTypeOptions"   v-if="scope.row.payType==item.dictValue">{{item.dictLabel}}</el-tag>
         </template>
       </el-table-column>
-
       <el-table-column label="凭证照片" align="center" prop="images" >
         <template slot-scope="scope">
           <div v-if="scope.row.imgs != null && scope.row.imgs != undefined && scope.row.imgs != ''">
@@ -66,7 +71,7 @@
           </div>
         </template>
       </el-table-column>
-       <el-table-column label="状态" align="center" prop="status" >
+       <el-table-column label="支付状态" align="center" prop="status" >
         <template slot-scope="scope">
               <el-tag prop="status" v-for="(item, index) in statusOptions"  :type="scope.row.status==1?'success':'danger'"  v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
         </template>
@@ -76,6 +81,18 @@
           <span>{{ parseTime(scope.row.payTime) }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="审核状态" align="center" prop="isAudit" >
+        <template slot-scope="scope">
+          <el-tag prop="isAudit" type="danger"  v-if="scope.row.isAudit === -1">已驳回</el-tag>
+          <el-tag prop="isAudit" type="warning"  v-if="scope.row.isAudit === 0">待审核</el-tag>
+          <el-tag prop="isAudit" type="success"  v-if="scope.row.isAudit === 1">已审核</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="审核时间" align="center" prop="auditTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.auditTime) }}</span>
+        </template>
+      </el-table-column>
     </el-table>
     <pagination
       v-show="total>0"
@@ -116,12 +133,38 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 充值对话框 -->
+    <el-dialog :title="recharge.title" :visible.sync="recharge.open" width="500px" append-to-body>
+      <el-form ref="rechargeForm" :rules="rechargeRules" :model="rechargeForm"  label-width="80px">
+<!--        <el-form-item label="公司" >-->
+<!--          <el-input v-model="rechargeForm.companyName" disabled />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="余额" >-->
+<!--          <el-input v-model="rechargeForm.balance" disabled />-->
+<!--        </el-form-item>-->
+        <el-form-item label="充值金额" prop="money">
+          <el-input-number v-model="rechargeForm.money" :min="0" placeholder="请输入充值金额" />
+        </el-form-item>
+        <el-form-item label="凭证" prop="imgs">
+          <image-upload v-model="rechargeForm.imgs" :limit="9" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="rechargeForm.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRechargeForm">确 定</el-button>
+        <el-button @click="recharge.open=false">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listCompanyRecharge, getCompanyRecharge, delCompanyRecharge, addCompanyRecharge, updateCompanyRecharge, exportCompanyRecharge } from "@/api/company/companyRecharge";
-
+import { listCompanyRecharge, getCompanyRecharge, delCompanyRecharge, addCompanyRecharge, updateCompanyRecharge, exportCompanyRecharge, recharge } from "@/api/company/companyRecharge";
+import { getInfo } from '@/api/login';
 export default {
   name: "CompanyRecharge",
   data() {
@@ -162,7 +205,24 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      recharge:{
+        open:false,
+        title:"后台充值"
+      },
+      // 表单校验
+      rechargeRules: {
+        money: [
+          { required: true, message: "充值金额不能为空", trigger: "blur" }
+        ],
+        imgs: [
+          { required: true, message: "凭证不能为空", trigger: "change" }
+        ],
+      },
+      // 表单参数
+      rechargeForm: {
+        money: 0,
+      },
     };
   },
   created() {
@@ -285,7 +345,31 @@ export default {
         }).then(response => {
           this.download(response.msg);
         }).catch(function() {});
-    }
+    },
+    /** 充值按钮操作 */
+    handleRecharge() {
+      this.rechargeForm = {
+        money: 0,
+        balance: 0, //默认余额为0
+        remark: '',
+        imgs: []
+      };
+      this.recharge.open = true;
+    },
+    /** 提交按钮 */
+    submitRechargeForm() {
+      this.$refs["rechargeForm"].validate(valid => {
+        if (valid) {
+          recharge(this.rechargeForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess(response.msg);
+              this.recharge.open = false;
+              this.getList();
+            }
+          });
+        }
+      });
+    },
   }
 };
 </script>