Преглед изворни кода

commit 信息 - 账户管理 删除

xkwg пре 4 година
родитељ
комит
1f8191f00e

+ 8 - 1
src/services/go/ermcp/customInfo/index.ts

@@ -3,7 +3,7 @@
 import { BaseResponse, commonSearch_go, commonUpdate_go } from '@/services/go/index';
 import APP from '@/services';
 import { QueryCustomInfoEnum } from './type';
-import { AddUserInfoApplyReq, ModifyUserInfoApplyReq, QueryCustomInfoType } from './interface';
+import {AddUserInfoApplyReq, ModifyUserInfoApplyReq, ModifyUserInfoReq, QueryCustomInfoType} from './interface';
 /** ================================= 信息 客户资料 ================================**/
 /**
  * 查询客户资料
@@ -44,6 +44,13 @@ export function QueryModifyUserInfoApply(userInfoApply: ModifyUserInfoApplyReq):
     });
 }
 
+export function QueryModifyUserInfo(req: ModifyUserInfoReq): Promise<BaseResponse> {
+    return commonUpdate_go('/Erms3/ModifyUserInfoApply', req).catch((err) => {
+        throw new Error(`修改客户申请状态: ${err.message}`);
+    });
+}
+
+
 /**
  * 删除客户申请
  * @param userId 用户id  只可删除 UserState = 1 (未提交)状态的申请信息

+ 7 - 0
src/services/go/ermcp/customInfo/interface.ts

@@ -109,6 +109,13 @@ export interface AddUserInfoApplyReq {
     wechat?: string;//微信号 (加密存储)
 }
 
+// 客户信息状态更变
+export interface ModifyUserInfoReq {
+    userid: number;//用户ID(自增ID) (必填)
+    userstate: number;//  保存草稿(撤回)- { "userid": int, "userstate": 1 } 提交审核 - { "userid": int, "userstate": 2 }
+}
+
+
 // 修改客户申请
 export interface ModifyUserInfoApplyReq {
     userid: number;//用户ID(自增ID) (必填)

+ 4 - 8
src/views/information/custom/compoments/cancel/index.vue

@@ -113,7 +113,7 @@
 import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { Modal } from 'ant-design-vue';
-import {ModifyUserInfoApplyReq, QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
+import {ModifyUserInfoApplyReq, ModifyUserInfoReq, QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
 import {formatValue} from "@/common/methods";
 import {getStatusName} from "@/views/information/custom/setup";
 import {cancelCustomInfo} from "@/views/information/custom/compoments/setup";
@@ -140,14 +140,11 @@ export default defineComponent({
                 cancelText: '取消',
                 onOk() {
                     console.log('OK');
-                    const req : ModifyUserInfoApplyReq = {
-                        userid: getUserId(),//用户ID
-                        userinfotype: Number(props.selectedRow.userinfotype), //用户信息类型 - 1:个人 2:企业 (必填)
-                        username: props.selectedRow.customername,         //用户姓名 (必填) 用的企业名称
+                    const req : ModifyUserInfoReq = {
+                        userid: props.selectedRow.userid,//用户ID
                         userstate: 1,       //开户状态 - 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过 (必填)
-                        customername: props.selectedRow.customername, //客户名称(企业名称)  (必填)
                     }
-                    ModifyUserInfo(req)
+                    ModifyUserInfo(req, cancel)
                 },
                 onCancel() {
                     console.log('Cancel');
@@ -157,7 +154,6 @@ export default defineComponent({
             });
             // setTimeout(() => {
             //     loading.value = false;
-            //     cancel();
             // }, 2000);
         }
 

+ 8 - 8
src/views/information/custom/compoments/setup.ts

@@ -1,29 +1,29 @@
-import {QueryModifyUserInfoApply} from "@/services/go/ermcp/customInfo";
-import {ModifyUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
+import {QueryModifyUserInfo } from "@/services/go/ermcp/customInfo";
+import { ModifyUserInfoReq} from "@/services/go/ermcp/customInfo/interface";
 import {ref} from "vue";
 import { message } from 'ant-design-vue';
-
 /**
  *  撤销客户资料 撤销后的数据会进入草稿(未提交)
  */
 export function cancelCustomInfo(){
     const loading = ref<boolean>(false);
     // 这里调用的是修改客户申请接口
-    function ModifyUserInfo(req: ModifyUserInfoApplyReq){
-        QueryModifyUserInfoApply(req)
+    function ModifyUserInfo(req: ModifyUserInfoReq, callback: Function){
+        QueryModifyUserInfo(req)
             .then((res) => {
-                loading.value = false
                 if(res.result){
                     message.success("撤销成功")
                     console.log('撤销客户资料成功');
+                    callback()
                 }else{
                     message.error("撤销失败:" + res.message)
                 }
             })
             .catch((err) => {
-                loading.value = false
                 message.error("撤销失败")
-            });
+            }).finally(() => {
+                loading.value = false
+        })
     }
     return {loading, ModifyUserInfo}
 }