yu.jie 4 年 前
コミット
0458b9bf8a

+ 28 - 34
src/views/information/account_info/compoments/locked-business/index.vue

@@ -11,7 +11,7 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">完成</a-button>
+                @click="submit">锁定</a-button>
     </template>
 
   </a-modal>
@@ -19,45 +19,38 @@
 
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
-import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
-import { AllEnums } from '@/services/go/commonService/interface';
-import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+import {defineComponent, ref, reactive, toRaw, UnwrapRef, PropType} from 'vue';
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+import {loginAccountOperate} from "@/services/proto/accountinfo";
+import {LoginaccountOperateReq} from "@/services/proto/accountinfo/interface";
+import {ErmcpLoginUser} from "@/services/go/ermcp/account/interface";
 
 export default defineComponent({
     name: 'add-custom',
     components: {},
-    setup() {
+    props: {
+        selectedData: {
+            default: {},
+            type: Object as PropType<ErmcpLoginUser>,
+        },
+    },
+    setup(props, context) {
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_business_btn_locked');
-        // 证件类型
-        // const cardTypeList = ref<AllEnums[]>(getCardType());
-        // // 表单
-        // const formRef = ref();
-        // const formState: UnwrapRef<FormState> = reactive(initFormState());
-        // const rules = {
-        //     userinfotype: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
-        //     customername: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
-        //     nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
-        //     cardtype: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
-        // };
-        // // 下单方法
-        // const { loading, applyAction } = handleApply();
-        // function isPersonal(): boolean {
-        //     return formState.userinfotype === '1';
-        // }
-        // function submit() {
-        //     formRef.value
-        //         .validate()
-        //         .then(() => {
-        //             const param = toRaw(formState);
-        //             applyAction(param);
-        //             console.log('values', formState);
-        //         })
-        //         .catch((error: ValidateErrorEntity<FormState>) => {
-        //             console.log('error', error);
-        //         });
-        // }
+        const loading = ref<boolean>(false);
+        function submit() {
+            let reqParam: LoginaccountOperateReq = {
+                userid: props.selectedData.userid,
+                loginid: props.selectedData.loginid,
+                operatetype: 5,  // 5: 锁定 6:解锁
+                logintaaccounts: [],
+            }
+            debugger
+            requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['账户锁定成功', '账户锁定失败:']).then(() => {
+                cancel();
+                context.emit('refresh');
+            });
+        }
         return {
             // formState,
             // rules,
@@ -66,6 +59,7 @@ export default defineComponent({
             // isPersonal,
             visible,
             cancel,
+            submit,
             // submit,
             // loading,
         };

+ 85 - 87
src/views/information/account_info/compoments/reset-business/index.vue

@@ -1,74 +1,76 @@
 <template>
-  <!-- 重置登录账户密码 -->
-  <a-modal class="add-custom"
-           title="重置登录账户密码"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           :maskClosable="false"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">完成</a-button>
-    </template>
-    <a-form class="inlineForm"
-            ref="formRef"
-            :model="formState"
-            :rules="rules">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="登录账号"
-                       name="accountname">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     readonly
-                     v-model:value="formState.accountname"
-                     placeholder="请输入登录账号" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="原密码"
-                       name="oldPassword">
-            <a-input-password class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.oldPassword"
-                              placeholder="请输入原密码" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="新密码"
-                       name="password">
-            <a-input-password class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.password"
-                              placeholder="请输入8到20个字符的新密码" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="确认新密码"
-                       name="comfirePassword">
-            <a-input-password class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.comfirePassword"
-                              placeholder="请再次确认新密码" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
-  </a-modal>
+    <!-- 重置登录账户密码 -->
+    <a-modal class="add-custom"
+             title="重置登录账户密码"
+             v-model:visible="visible"
+             @cancel="cancel"
+             centered
+             :maskClosable="false"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">完成
+            </a-button>
+        </template>
+        <a-form class="inlineForm"
+                ref="formRef"
+                :model="formState"
+                :rules="rules">
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="登录账号"
+                                 name="accountname">
+                        <a-input class="dialogInput"
+                                 style="width: 200px"
+                                 readonly
+                                 v-model:value="formState.accountname"
+                                 placeholder="请输入登录账号"/>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="原密码"
+                                 name="oldPassword">
+                        <a-input-password class="dialogInput"
+                                          style="width: 200px"
+                                          v-model:value="formState.oldPassword"
+                                          placeholder="请输入原密码"/>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="新密码"
+                                 name="password">
+                        <a-input-password class="dialogInput"
+                                          style="width: 200px"
+                                          v-model:value="formState.password"
+                                          placeholder="请输入8到20个字符的新密码"/>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="确认新密码"
+                                 name="comfirePassword">
+                        <a-input-password class="dialogInput"
+                                          style="width: 200px"
+                                          v-model:value="formState.comfirePassword"
+                                          placeholder="请再次确认新密码"/>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, toRaw, PropType, watchEffect } from 'vue';
-import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
-import { handleBusinessForm } from './setup';
-import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
-import { BusinessFormState } from '../interface';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { loginAccountOperate } from '@/services/proto/accountinfo';
+import {closeModal} from '@/common/setup/modal/index';
+import {defineComponent, ref, toRaw, PropType, watchEffect} from 'vue';
+import {ValidateErrorEntity} from 'ant-design-vue/es/form/interface';
+import {handleBusinessForm} from './setup';
+import {ErmcpLoginUser} from '@/services/go/ermcp/account/interface';
+import {BusinessFormState} from '../interface';
+import {requestResultLoadingAndInfo} from '@/common/methods/request/resultInfo';
+import {loginAccountOperate} from '@/services/proto/accountinfo';
+import {LoginaccountOperateReq} from "@/services/proto/accountinfo/interface";
 
 export default defineComponent({
     name: 'account_info_business_btn_reset',
@@ -80,34 +82,30 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_business_btn_reset');
-        const { rules, formState, formRef } = handleBusinessForm();
+        const {visible, cancel} = closeModal('account_info_business_btn_reset');
+        const {rules, formState, formRef} = handleBusinessForm();
         const loading = ref<boolean>(false);
         watchEffect(() => {
             if (visible.value) {
                 formState.accountname = props.selectedData.accountname;
             }
         });
-        function submit() {
-            formRef.value
-                .validate()
-                .then(() => {
-                    const param = toRaw(formState);
-                    const reqParam = {
-                        operatetype: 9,
-                    };
-                    Object.assign(reqParam, param);
-                    console.log('reqParam', reqParam);
 
-                    requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['重置登录账户密码成功', '重置登录账户密码失败:']).then(() => {
-                        cancel();
-                        context.emit('refresh');
-                    });
-                })
-                .catch((error: ValidateErrorEntity<BusinessFormState>) => {
-                    console.log('error', error);
-                });
+        function submit() {
+            let reqParam: LoginaccountOperateReq = {
+                userid: props.selectedData.userid,
+                loginid: props.selectedData.loginid,
+                operatetype: 7,  // 5: 锁定 6:解锁
+                logintaaccounts: [],
+            }
+            debugger
+            console.log('reqParam', reqParam);
+            requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['重置登录账户密码成功', '重置登录账户密码失败:']).then(() => {
+                cancel();
+                context.emit('refresh');
+            });
         }
+
         return {
             formState,
             rules,