From 66eff909403555bdc86d25eeec78c7b4a2f2ee59 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Sat, 19 Jul 2025 18:22:23 +0800
Subject: [PATCH] 1

---
 src/views/loanmanage/index.vue |  505 +++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 297 insertions(+), 208 deletions(-)

diff --git a/src/views/loanmanage/index.vue b/src/views/loanmanage/index.vue
index b528dec..2f12429 100644
--- a/src/views/loanmanage/index.vue
+++ b/src/views/loanmanage/index.vue
@@ -7,277 +7,366 @@
         :pagination="pagination"
         :columns="columns"
         :data-source="agentlist"
-        rowKey="id">
-        <span slot="id" slot-scope="text,record">
+        rowKey="id"
+      >
+        <span slot="id" slot-scope="text, record">
           <template>
             <div>
               <span>{{ record.id }}</span>
             </div>
           </template>
         </span>
-        <span slot="dkJg" slot-scope="text,record">
+        <span slot="dkJg" slot-scope="text, record">
           <template>
             <div>
               <span>{{ record.dkJgName }}</span>
             </div>
           </template>
         </span>
-        <span slot="dkUserId" slot-scope="text,record">
+        <span slot="dkUserId" slot-scope="text, record">
           <template>
             <div>
               <span>{{ record.dkUserId }}</span>
             </div>
           </template>
         </span>
-        <span slot="dkUserName" slot-scope="text,record">
+        <span slot="dkUserName" slot-scope="text, record">
           <template>
             <div>
               <span>{{ record.dkUserName }}</span>
             </div>
           </template>
         </span>
-        <span slot="dkPhone" slot-scope="text,record">
+        <span slot="dkPhone" slot-scope="text, record">
           <template>
             <div>
               <span>{{ record.dkPhone }}</span>
             </div>
           </template>
         </span>
-        <span slot="createTime" slot-scope="text,record">
+        <span slot="createTime" slot-scope="text, record">
           <template>
             <div>
               <span>{{ record.createTime }}</span>
             </div>
           </template>
         </span>
-        <span slot="dkMoney" slot-scope="text,record">
+        <span slot="dkMoney" slot-scope="text, record">
           <template>
             <div>
               <span>{{ record.dkMoney }}</span>
             </div>
           </template>
         </span>
-        <!-- <span slot="dkState" slot-scope="text,record">
+        <span slot="dkState" slot-scope="text, record">
           <template>
             <div>
-              <span v-if="record.dkState==1">123</span>
+              <span v-if="record.dkState == 0">申请中</span>
+              <span v-else-if="record.dkState == 1">审批通过</span>
+              <span v-else-if="record.dkState == 2">审核拒绝</span>
             </div>
           </template>
-        </span> -->
-        <!-- <template slot="action" slot-scope="text,record">
+        </span>
+        <span slot="dkRefundState" slot-scope="text, record">
+          <template>
+            <div>
+              <span v-if="record.dkState == 0 && record.dkState == 1">未还款</span>
+              <span v-else-if="record.dkState == 1 && record.dkState == 1">已还款</span>
+            </div>
+          </template>
+        </span>
+        <template slot="action" slot-scope="text, record">
+          <!-- <a slot="action" href="javascript:;" @click="$refs.EditAgentinfodialog.getEditorder(record)">修改机构</a>
           <a-divider type="vertical" />
-          <a
-            slot="action"
-            href="javascript:;"
-            @click="$refs.EditAgentinfodialog.getEditorder(record)">修改机构</a>
-            <a-divider type="vertical" />
-          <a slot="action" href="javascript:;" @click="getDelagent(record)">删除机构</a>
+          <a slot="action" href="javascript:;" @click="getDelagent(record)">删除机构</a> -->
 
-        </template> -->
+          <template v-if="record.dkState == 0">
+            <a href="javascript:;" @click="byOpen(record, 1)">通过</a>
+            <a-divider type="vertical" />
+            <a href="javascript:;" @click="byOpen(record, 2)">拒绝</a>
+          </template>
+        </template>
       </a-table>
     </a-card>
     <!-- <editCapitalAgentdialog ref="editCapitalAgentdialog" :getinit="geteditinit"></editCapitalAgentdialog> -->
     <!-- <EditAgentinfodialog ref="EditAgentinfodialog" :getinit="geteditinit"></EditAgentinfodialog> -->
     <!-- <addagentdialog ref="addagentdialog" :getinit="getinit"></addagentdialog> -->
+
+    <a-modal
+      :title="optObj.state == 1 ? '通过审核' : '拒绝审核'"
+      :width="400"
+      :visible="byShow"
+      :confirmLoading="byloading"
+      @ok="by"
+      @cancel="canceBy"
+    >
+      <a-form :form="byFrom" ref="byFrom">
+        <a-form-item label="申请金额" v-if="optObj.state == 1" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <span>{{ optObj.dkMoney }}</span>
+        </a-form-item>
+        <a-form-item label="贷款金额" v-if="optObj.state == 1" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-input placeholder="请输入" v-decorator="['spMoney', { rules: [{ required: true, message: '请输入' }] }]" />
+        </a-form-item>
+        <a-form-item label="拒绝理由" v-if="optObj.state == 2" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-input placeholder="请输入" v-decorator="['message', { rules: [{ required: true, message: '请输入' }] }]" />
+        </a-form-item>
+      </a-form>
+    </a-modal>
   </page-header-wrapper>
 </template>
 <script>
-
 // import editCapitalAgentdialog from './agentcomponents/editCapitalAgentdialog'
 import EditAgentinfodialog from './agentcomponents/EditAgentinfodialog'
 import addagentdialog from './agentcomponents/addagentdialog'
-import { onedklist } from '@/api/home'
+import { onedklist, dksp } from '@/api/home'
 import moment from 'moment'
 export default {
-    // name: 'AgentList',
-    // components: {
-    //     // editCapitalAgentdialog,
-    //     EditAgentinfodialog,
-    //     addagentdialog
-    // },
-    data () {
-        return {
-            columns: [
-                {
-                    title: 'Id',
-                    scopedSlots: { customRender: 'id' },
-                    align: 'center'
-                },
-                {
-                    title: '机构名称',
-                    dataIndex: 'dkJgName',
-                    align: 'center'
-                }, {
-                    title: '贷款人Id',
-                    dataIndex: 'dkUserId',
-                    align: 'center'
-                },
-                {
-                    title: '贷款人姓名',
-                    dataIndex: 'dkUserName',
-                    align: 'center'
-                },
-                {
-                    title: '联系电话',
-                    dataIndex: 'dkPhone',
-                    align: 'center'
-                },
-                {
-                    title: '申请时间',
-                    dataIndex: 'createTime',
-                    align: 'center',
-                    customRender: (text, row, index) => {
-                        return moment(text).format('YYYY-MM-DD HH:mm:ss')
-                    }
-                }, {
-                    title: '贷款金额',
-                    dataIndex: 'dkMoney',
-                    align: 'center',
-                    scopedSlots: { customRender: 'dkMoney' }
-                }
-                // {
-                //     title: '贷款状态',
-                //     dataIndex: 'dkState',
-                //     align: 'center',
-                //     scopedSlots: { customRender: 'dkState' }
-                // },
-                // {
-                //     title: '代理手机号',
-                //     dataIndex: 'agentPhone',
-                //     align: 'center'
-                // },
+  // name: 'AgentList',
+  // components: {
+  //     // editCapitalAgentdialog,
+  //     EditAgentinfodialog,
+  //     addagentdialog
+  // },
+  data() {
+    return {
+      columns: [
+        {
+          title: 'Id',
+          scopedSlots: { customRender: 'id' },
+          align: 'center',
+        },
+        // {
+        //     title: '机构名称',
+        //     dataIndex: 'dkJgName',
+        //     align: 'center'
+        // },
+        {
+          title: '贷款人Id',
+          dataIndex: 'dkUserId',
+          align: 'center',
+        },
+        // {
+        //   title: '贷款人姓名',
+        //   dataIndex: 'dkUserName',
+        //   align: 'center',
+        // },
+        {
+          title: '贷款人账户',
+          dataIndex: 'dkUserName',
+          align: 'center',
+        },
+        {
+          title: '联系电话',
+          dataIndex: 'dkPhone',
+          align: 'center',
+        },
+        {
+          title: '申请时间',
+          dataIndex: 'createTime',
+          align: 'center',
+          customRender: (text, row, index) => {
+            return moment(text).format('YYYY-MM-DD HH:mm:ss')
+          },
+        },
+        {
+          title: '贷款金额',
+          dataIndex: 'dkMoney',
+          align: 'center',
+          scopedSlots: { customRender: 'dkMoney' },
+        },
+        {
+          title: '贷款状态',
+          dataIndex: 'dkState',
+          align: 'center',
+          scopedSlots: { customRender: 'dkState' },
+        },
+        {
+          title: '还款状态',
+          dataIndex: 'dkRefundState',
+          align: 'center',
+          scopedSlots: { customRender: 'dkRefundState' },
+        },
+        // {
+        //     title: '代理手机号',
+        //     dataIndex: 'agentPhone',
+        //     align: 'center'
+        // },
 
-                // {
-                //     title: '总资金',
-                //     dataIndex: 'totalMoney',
-                //     align: 'center',
-                //     customRender: (text, row, index) => {
-                //         return text
-                //     }
-                // },
-                // {
-                //     title: '代理状态',
-                //     dataIndex: 'isLock',
-                //     align: 'center',
-                //     scopedSlots: { customRender: 'isLock' }
-                // },
-                // {
-                //     title: '注册时间',
-                //     dataIndex: 'addTime',
-                //     align: 'center',
-                //     customRender: (text, row, index) => {
-                //         return moment(text).format('YYYY-MM-DD HH:mm:ss')
-                //     }
-                // },
-                // {
-                //     title: '操作',
-                //     key: 'action',
-                //     align: 'center',
-                //     scopedSlots: { customRender: 'action' }
-                // }
-            ],
-            // 表头
-            pagination: {
-                total: 0,
-                current: 1,
-                pageSize: 10, // 每页中显示10条数据
-                showSizeChanger: true,
-                pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据
-                onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示
-                onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件
-                showTotal: total => `共有 ${total} 条数据` // 分页中显示总的数据
-            },
-            loading: false,
-            agentqueryParam: {
-                id: undefined,
-                phone: '',
-                realName: '',
-                pageNum: 1,
-                pageSize: 10
-            },
-            agentloading: false,
-            agentlist: [],
-            clickagentlist: []
-        }
-    },
-    created () {
-        this.getagentlist()
-    },
-    methods: {
-        getDelagent (val) {
-            var that = this
-            this.$confirm({
-                title: '提示',
-                content: '确认删除机构?此操作不可恢复',
-                onOk () {
-                    var data = {
-                        id: val.id
-                    }
-                    dldkjg(data).then(res => {
-                        if (res.status == 0) {
-                            that.$message.success({ content: '删除成功', duration: 2 })
-                            that.getinit()
-                        } else {
-                            that.$message.error({ content: '删除失败' })
-                        }
-                    })
-                },
-                onCancel () {
-                    console.log('Cancel')
-                }
-            })
+        // {
+        //     title: '总资金',
+        //     dataIndex: 'totalMoney',
+        //     align: 'center',
+        //     customRender: (text, row, index) => {
+        //         return text
+        //     }
+        // },
+        // {
+        //     title: '代理状态',
+        //     dataIndex: 'isLock',
+        //     align: 'center',
+        //     scopedSlots: { customRender: 'isLock' }
+        // },
+        // {
+        //     title: '注册时间',
+        //     dataIndex: 'addTime',
+        //     align: 'center',
+        //     customRender: (text, row, index) => {
+        //         return moment(text).format('YYYY-MM-DD HH:mm:ss')
+        //     }
+        // },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' },
         },
-        getinit () {
-            this.queryParam = {
-                id: undefined,
-                phone: '',
-                realName: '',
-                pageNum: 1,
-                pageSize: 10
-            }
-            this.pagination.current = 1
-            this.getagentlist()
-        },
-        geteditinit () {
-            this.getagentlist()
-        },
-        getagentlist () {
-            var that = this
-            this.loading = true
-            // dklist(this.agentqueryParam).then(res => {
-              onedklist().then(res => {
-                this.agentlist = res.data
-                // this.pagination.total = res.data.total
-                setTimeout(() => {
-                    that.loading = false
-                }, 500)
-            })
-        },
-        getclickagentlist () {
-            var that = this
-            this.agentloading = true
-            var data = {
-                pageNum: 1,
-                pageSize: 100
-            }
-            nextagent(data).then(res => {
-                this.clickagentlist = res.data.list
-                setTimeout(() => {
-                    that.agentloading = false
-                }, 500)
-            })
-        },
-        onPageChange (page, pageSize) {
-            this.agentqueryParam.pageNum = page
-            this.pagination.current = page
-            this.getagentlist()
-        },
-        onSizeChange (current, pageSize) {
-            this.agentqueryParam.pageNum = current
-            this.pagination.current = page
-            this.agentqueryParam.pageSize = pageSize
-            this.getagentlist()
-        }
+      ],
+      // 表头
+      pagination: {
+        total: 0,
+        current: 1,
+        pageSize: 10, // 每页中显示10条数据
+        showSizeChanger: true,
+        pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据
+        onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示
+        onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件
+        showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据
+      },
+      loading: false,
+      agentqueryParam: {
+        id: undefined,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      labelCol: {
+        xs: { span: 8 },
+        sm: { span: 8 },
+        md: { span: 8 },
+      },
+      wrapperCol: {
+        xs: { span: 14 },
+        sm: { span: 14 },
+        md: { span: 14 },
+      },
+      agentloading: false,
+      agentlist: [],
+      clickagentlist: [],
+      byShow: false,
+      byloading: false,
+      optObj: {}, // 选择的对象
+      byFrom: this.$form.createForm(this), // 表单
     }
+  },
+  created() {
+    this.getagentlist()
+  },
+  methods: {
+    getDelagent(val) {
+      var that = this
+      this.$confirm({
+        title: '提示',
+        content: '确认删除机构?此操作不可恢复',
+        onOk() {
+          var data = {
+            id: val.id,
+          }
+          dldkjg(data).then((res) => {
+            if (res.status == 0) {
+              that.$message.success({ content: '删除成功', duration: 2 })
+              that.getinit()
+            } else {
+              that.$message.error({ content: '删除失败' })
+            }
+          })
+        },
+        onCancel() {
+          console.log('Cancel')
+        },
+      })
+    },
+    getinit() {
+      this.agentqueryParam = {
+        id: undefined,
+        pageNum: 1,
+        pageSize: 10,
+      }
+      this.pagination.current = 1
+      this.getagentlist()
+    },
+    geteditinit() {
+      this.getagentlist()
+    },
+    getagentlist() {
+      var that = this
+      this.loading = true
+      onedklist(this.agentqueryParam).then((res) => {
+        this.agentlist = res.data.list
+        this.pagination.total = res.data.total
+        setTimeout(() => {
+          that.loading = false
+        }, 500)
+      })
+    },
+    getclickagentlist() {
+      var that = this
+      this.agentloading = true
+      var data = {
+        pageNum: 1,
+        pageSize: 100,
+      }
+      nextagent(data).then((res) => {
+        this.clickagentlist = res.data.list
+        setTimeout(() => {
+          that.agentloading = false
+        }, 500)
+      })
+    },
+    onPageChange(page, pageSize) {
+      this.agentqueryParam.pageNum = page
+      this.pagination.current = page
+      this.getagentlist()
+    },
+    onSizeChange(current, pageSize) {
+      this.agentqueryParam.pageNum = current
+      this.pagination.current = page
+      this.agentqueryParam.pageSize = pageSize
+      this.getagentlist()
+    },
+    // 审核窗口打开
+    byOpen(val, state) {
+      this.optObj = { ...val, state }
+      this.byShow = true
+    },
+    // 关闭审核窗口
+    canceBy() {
+      this.byShow = false
+      const form = this.$refs.byFrom.form
+      form.resetFields()
+    },
+    // 审核通过||拒绝
+    by() {
+      const form = this.$refs.byFrom.form
+
+      form.validateFields((errors, values) => {
+        if (!errors) {
+          this.byloading = true
+          values.state = this.optObj.state
+          values.dkId = this.optObj.id
+
+          dksp(values).then((res) => {
+            if (res.status == 0) {
+              this.byShow = false
+              this.$message.success(res.msg)
+              form.resetFields()
+              this.getagentlist()
+            } else {
+              this.$message.error(res.msg)
+            }
+            this.byloading = false
+          })
+        }
+      })
+    },
+  },
 }
 </script>

--
Gitblit v1.9.3