瀏覽代碼

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

huangbin 4 年之前
父節點
當前提交
cf0f0fd68b

+ 2 - 2
src/services/go/ermcp/customInfo/index.ts

@@ -61,8 +61,8 @@ export function QueryModifyUserInfo(req: ModifyUserInfoReq): Promise<BaseRespons
  * @param userId 用户id  只可删除 UserState = 1 (未提交)状态的申请信息
  * @constructor
  */
-export function QueryDeleteUserInfoApply(userId: number): Promise<BaseResponse> {
-    return commonUpdate_go('/Erms3/DeleteUserInfoApply', { userId }, 'get').catch((err) => {
+export function QueryDeleteUserInfoApply(userID: number): Promise<string> {
+    return commonSearch_go('/Erms3/DeleteUserInfoApply', { userID }, ).catch((err) => {
         throw new Error(`删除客户申请: ${err.message}`);
     });
 }

+ 31 - 6
src/views/information/custom/compoments/check/index.vue

@@ -122,6 +122,7 @@ import { getCardTypeName, getStatusName } from '@/views/information/custom/setup
 import { cancelCustomInfo, checkCustomInfo } from '@/views/information/custom/compoments/setup';
 import { UserInfoCheckMangeReq } from '@/services/proto/accountinfo/interface';
 import { getSelectedAccountId, getUserId } from '@/services/bus/account';
+import {Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'custom_info_btn_check',
@@ -141,15 +142,39 @@ export default defineComponent({
             auditflag: 1,
             remark: '',
         };
+        // 审核通过
         function submit() {
-            req.auditflag = 1;
-            req.userid = props.selectedRow.userid;
-            checkCustomerInfo(req, cancel);
+            Modal.confirm({
+                title: '是否确认审核通过',
+                okText: '确认通过',
+                cancelText: '取消',
+                onOk() {
+                    console.log('OK');
+                    req.auditflag = 1;
+                    req.userid = props.selectedRow.userid;
+                    checkCustomerInfo(req, cancel);
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
+        // 审核拒绝
         function refuseSubmit() {
-            req.auditflag = 2;
-            req.userid = props.selectedRow.userid;
-            checkCustomerInfo(req, cancel);
+            Modal.confirm({
+                title: '是否确认审核拒绝',
+                okText: '确认拒绝',
+                cancelText: '取消',
+                onOk() {
+                    console.log('OK');
+                    req.auditflag = 2;
+                    req.userid = props.selectedRow.userid;
+                    checkCustomerInfo(req, cancel);
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,

+ 17 - 2
src/views/information/custom/compoments/delete/index.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 删除客户资料-->
   <a-modal class="recover-custom"
-           title="恢复客户资料"
+           title="删除客户资料"
            v-model:visible="visible"
            @cancel="cancel"
            width="890px">
@@ -109,6 +109,9 @@ import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import {deleteUserInfo} from "@/views/information/custom/compoments/setup";
 import {QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
+import {formatValue} from "@/common/methods";
+import {getStatusName} from "@/views/information/custom/setup";
+import {Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'recover-custom',
@@ -123,13 +126,25 @@ export default defineComponent({
         const { visible, cancel } = closeModal('custom_info_btn_delete');
         const {loading, deleteCustomerInfo} = deleteUserInfo();
         function submit(){
-            deleteCustomerInfo(props.selectedRow.userid, cancel)
+            Modal.confirm({
+                title: '是否确认删除客户资料',
+                okText: '确认删除',
+                cancelText: '取消',
+                onOk() {
+                    deleteCustomerInfo(props.selectedRow.userid, cancel)
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,
             cancel,
             submit,
             loading,
+            formatValue,
+            getStatusName,
         };
     },
 });

+ 12 - 1
src/views/information/custom/compoments/disable/index.vue

@@ -116,6 +116,7 @@ import {updateUserAccount} from "@/views/information/custom/compoments/setup";
 import {QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
 import {formatValue} from "@/common/methods";
 import {getStatusName} from "@/views/information/custom/setup";
+import {Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'custom-disable',
@@ -131,7 +132,17 @@ export default defineComponent({
         const maskClosableFlag = ref<boolean>(false);
         const  {loading, ModifyUserInfo} = updateUserAccount();
         function submit() {
-            ModifyUserInfo(props.selectedRow.userid, 6, cancel);
+            Modal.confirm({
+                title: '是否确认停用客户资料',
+                okText: '确认停用',
+                cancelText: '取消',
+                onOk() {
+                    ModifyUserInfo(props.selectedRow.userid, 6, cancel);
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,

+ 12 - 1
src/views/information/custom/compoments/recover/index.vue

@@ -118,6 +118,7 @@ import {QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
 import {formatValue} from "@/common/methods";
 import {getStatusName} from "@/views/information/custom/setup";
 import {updateUserAccount} from "@/views/information/custom/compoments/setup";
+import {Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'modify-custom',
@@ -133,7 +134,17 @@ export default defineComponent({
         const {loading, ModifyUserInfo} = updateUserAccount();
         // 恢复方法
         function recover(){
-            ModifyUserInfo(props.selectedRow.userid, 4, cancel);
+            Modal.confirm({
+                title: '是否确认恢复客户资料',
+                okText: '确认恢复',
+                cancelText: '取消',
+                onOk() {
+                    ModifyUserInfo(props.selectedRow.userid, 4, cancel);
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,

+ 40 - 28
src/views/information/custom/compoments/setup.ts

@@ -1,32 +1,36 @@
 import {QueryDeleteUserInfoApply, QueryModifyUserInfo, UpdateUserAccountStatus} from "@/services/go/ermcp/customInfo";
-import { ModifyUserInfoReq} from "@/services/go/ermcp/customInfo/interface";
+import {ModifyUserInfoReq} from "@/services/go/ermcp/customInfo/interface";
 import {ref} from "vue";
-import { message } from 'ant-design-vue';
+import {message} from 'ant-design-vue';
 import {userInfoCheck} from "@/services/proto/accountinfo";
 import {UserInfoCheckMangeReq} from "@/services/proto/accountinfo/interface";
+
 /**
  *  撤销客户资料 撤销后的数据会进入草稿(未提交)
  */
-export function cancelCustomInfo(){
+export function cancelCustomInfo() {
     const loading = ref<boolean>(false);
+
     // 这里调用的是修改客户申请接口
-    function ModifyUserInfo(req: ModifyUserInfoReq, callback: Function){
+    function ModifyUserInfo(req: ModifyUserInfoReq, callback: Function) {
         QueryModifyUserInfo(req)
             .then((res) => {
-                if(res.result){
+                if (res.result) {
                     message.success("撤销成功")
                     console.log('撤销客户资料成功');
                     callback()
-                }else{
+                } else {
                     message.error("撤销失败:" + res.message)
                 }
             })
-            .catch((err) => {cancelCustomInfo
+            .catch((err) => {
+                cancelCustomInfo
                 message.error("撤销失败")
             }).finally(() => {
-                loading.value = false
+            loading.value = false
         })
     }
+
     return {loading, ModifyUserInfo}
 }
 
@@ -34,51 +38,55 @@ export function cancelCustomInfo(){
  * 更新用户状态 用在停用或是启用
  * 4:正常 6:注销(停用)
  */
-export function updateUserAccount(){
+export function updateUserAccount() {
     const loading = ref<boolean>(false);
+
     // 这里调用的是修改客户申请接口
-    function ModifyUserInfo(userID: number, accountStatus: number, callback: Function){
+    function ModifyUserInfo(userID: number, accountStatus: number, callback: Function) {
         UpdateUserAccountStatus(userID, accountStatus)
             .then((res) => {
-                if(res.result){
-                    if(accountStatus === 4){
+                if (res.result) {
+                    if (accountStatus === 4) {
                         message.success("恢复成功")
-                    }else{
+                    } else {
                         message.success("停用成功")
                     }
                     console.log('更新用户资料成功 accountStatus = ' + accountStatus);
                     callback()
-                }else{
-                    if(accountStatus === 4){
+                } else {
+                    if (accountStatus === 4) {
                         message.error("恢复失败:" + res.message)
-                    }else{
+                    } else {
                         message.error("停用失败:" + res.message)
                     }
                 }
             })
-            .catch((err) => {cancelCustomInfo
+            .catch((err) => {
+                cancelCustomInfo
                 message.error("请求失败")
             }).finally(() => {
             loading.value = false
         })
     }
+
     return {loading, ModifyUserInfo}
 }
 
 /**
  * 审核客户资料 这里是走proto接口
  */
-export function checkCustomInfo(){
+export function checkCustomInfo() {
     const loading = ref<boolean>(false);
+
     // 这里调用的是修改客户申请接口
-    function checkCustomerInfo(req: UserInfoCheckMangeReq, callback: Function){
+    function checkCustomerInfo(req: UserInfoCheckMangeReq, callback: Function) {
         userInfoCheck(req)
             .then((res) => {
-                if(res.RetCode == 200){
+                if (res.RetCode == 200) {
                     debugger
                     message.success("审核成功")
                     console.log('审核客户资料成功');
-                }else{
+                } else {
                     message.success("审核成功:" + res.RetDesc)
                 }
                 callback()
@@ -89,32 +97,36 @@ export function checkCustomInfo(){
             loading.value = false
         })
     }
+
     return {loading, checkCustomerInfo}
 }
 
 /**
  * 删除客户资料
  */
-export function deleteUserInfo(){
+export function deleteUserInfo() {
     const loading = ref<boolean>(false);
+
     // 这里调用的是修改客户申请接口
-    function deleteCustomerInfo(userId: number, callback: Function){
-        QueryDeleteUserInfoApply(userId)
+    function deleteCustomerInfo(userID: number, callback: Function) {
+        QueryDeleteUserInfoApply(userID)
             .then((res) => {
-                if(res.result){
+                if (res === 'OK') {
                     message.success("删除成功")
                     console.log('撤销客户资料成功');
                     callback()
-                }else{
-                    message.error("删除失败:" + res.message)
+                } else {
+                    message.error("删除失败:" + res)
                 }
             })
-            .catch((err) => {cancelCustomInfo
+            .catch((err) => {
+                cancelCustomInfo
                 message.error("删除失败")
             }).finally(() => {
             loading.value = false
         })
     }
+
     return {loading, deleteCustomerInfo}
 }
 

+ 5 - 3
src/views/information/custom/list/unsubmit/index.vue

@@ -34,8 +34,8 @@
         <CustomDetail :selectedRow="selectedRow"/>
         <!-- 修改 -->
         <ModifyCustom :selectedRow="selectedRow"/>
-        <!-- 停用 -->
-        <DisableCustom/>
+        <!-- 删除 -->
+        <DeleteCustom :selectedRow="selectedRow"/>
 
     </div>
 </template>
@@ -51,7 +51,7 @@ import {
     BtnList
 } from '@/common/export/table';
 
-import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom} from '../../compoments';
+import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom, DeleteCustom} from '../../compoments';
 import {queryTableList, getFilterTableCB, QueryCustomInfoType} from '../index';
 import {getCardTypeName, getStatusName} from "@/views/information/custom/setup";
 
@@ -64,6 +64,7 @@ export default defineComponent({
         ModifyCustom,
         DisableCustom,
         AddCustom,
+        DeleteCustom,
         BtnList,
     },
     setup() {
@@ -100,6 +101,7 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            DeleteCustom,
             getStatusName,
             getCardTypeName,
         };