浏览代码

修改业务账号

huangbin 4 年之前
父节点
当前提交
0237bd5712

+ 4 - 56
src/views/information/account_info/compoments/cancel-business/index.vue

@@ -19,62 +19,23 @@
                 @click="submit">注销
       </a-button>
     </template>
-    <a-form class="inlineForm"
-            :model="formState">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="登录账号"
-                       name="">
-            <span class="white">{{formState.logincode}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="">
-            <span class="white">{{formState.accountname}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="手机号码"
-                       name="">
-            <span class="white">{{formState.mobile}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户角色"
-                       name="userinfotype">
-            <a-checkbox-group class="commonCheckboxGroup"
-                              v-model:value="formState.roleids">
-              <a-row>
-                <a-col :span="12">
-                  <a-checkbox :value="22">业务员</a-checkbox>
-                </a-col>
-                <a-col :span="12">
-                  <a-checkbox :value="23">跟单员</a-checkbox>
-                </a-col>
-              </a-row>
-            </a-checkbox-group>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
+    <Detail :selectedData="selectedData" />
   </a-modal>
 </template>
 
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, PropType, watchEffect } from 'vue';
+import { defineComponent, ref, PropType } from 'vue';
 import { Modal } from 'ant-design-vue';
 import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { loginAccountOperate } from '@/services/proto/accountinfo';
 import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
-import { handleBusinessForm } from '../setup';
-import { mergeTwoObj } from '@/utils/objHandle';
+import Detail from '../detail-commom-business/index.vue';
 
 export default defineComponent({
     name: 'account_info_business_btn_cancel',
-    components: {},
+    components: { Detail },
     props: {
         selectedData: {
             default: {},
@@ -85,14 +46,6 @@ export default defineComponent({
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_business_btn_cancel');
         const loading = ref<boolean>(false);
-        const { formState } = handleBusinessForm();
-        watchEffect(() => {
-            if (visible.value) {
-                mergeTwoObj(formState, props.selectedData);
-                // roletype	:string;//角色类型(逗号隔开,如22,23), 22:业务员 23:跟单员 24:交易员
-                formState.roleids = props.selectedData.roletype.split(',').map((e) => +e);
-            }
-        });
         function submit() {
             Modal.confirm({
                 title: '是否确认注销该账户',
@@ -115,11 +68,6 @@ export default defineComponent({
         }
 
         return {
-            formState,
-            // rules,
-            // formRef,
-            // cardTypeList,
-            // isPersonal,
             visible,
             cancel,
             submit,

+ 4 - 38
src/views/information/account_info/compoments/detail-business/index.vue

@@ -12,36 +12,20 @@
                 type="primary"
                 @click="cancel">关闭</a-button>
     </template>
-    <Des :list="desList"
-         :slotDesName="'账户角色'">
-      <a-checkbox-group class="commonCheckboxGroup"
-                        v-model:value="selectedRole">
-        <a-row>
-          <a-col :span="12"
-                 v-for="item in roleTypeList"
-                 :key="item.key">
-            <a-checkbox disabled
-                        :value="item.key">
-              {{item.value}}
-            </a-checkbox>
-          </a-col>
-        </a-row>
-      </a-checkbox-group>
-    </Des>
+    <Detail :selectedData="selectedData" />
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, watchEffect } from 'vue';
+import { defineComponent, PropType } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
-import { Des, handleDesList } from '@/common/components/commonDes';
-import { handleRoles } from '../setup';
+import Detail from '../detail-commom-business/index.vue';
 
 export default defineComponent({
     name: 'business-detail',
     components: {
-        Des,
+        Detail,
     },
     props: {
         selectedData: {
@@ -51,27 +35,9 @@ export default defineComponent({
     },
     setup(props) {
         const { visible, cancel } = closeModal('detail');
-        const { desList, getDesList } = handleDesList();
-        // 账户角色
-        const { roleTypeList, selectedRole, getSelectedRole } = handleRoles();
-        watchEffect(() => {
-            if (visible.value) {
-                const data = props.selectedData;
-                getDesList([
-                    { label: '登录账号', value: data.logincode },
-                    { label: '账户名称', value: data.accountname },
-                    { label: '手机号码', value: data.mobile },
-                ]);
-                // 选中的角色
-                getSelectedRole(props.selectedData.roletype);
-            }
-        });
         return {
             visible,
             cancel,
-            roleTypeList,
-            selectedRole,
-            desList,
             maskClosableFlag: false,
         };
     },

+ 64 - 0
src/views/information/account_info/compoments/detail-commom-business/index.vue

@@ -0,0 +1,64 @@
+<template>
+  <!-- 账号详情-->
+  <Des :list="desList"
+       :slotDesName="'账户角色'">
+    <a-checkbox-group class="commonCheckboxGroup"
+                      v-model:value="selectedRole">
+      <a-row>
+        <a-col :span="12"
+               v-for="item in roleTypeList"
+               :key="item.key">
+          <a-checkbox disabled
+                      :value="item.key">
+            {{item.value}}
+          </a-checkbox>
+        </a-col>
+      </a-row>
+    </a-checkbox-group>
+  </Des>
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType, watchEffect } from 'vue';
+import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
+import { Des, handleDesList } from '@/common/components/commonDes';
+import { handleRoles } from '../setup';
+
+export default defineComponent({
+    name: 'business-comom-detail',
+    components: {
+        Des,
+    },
+    props: {
+        selectedData: {
+            type: Object as PropType<ErmcpLoginUser>,
+            default: {},
+        },
+    },
+    setup(props) {
+        const { desList, getDesList } = handleDesList();
+        // 账户角色
+        const { roleTypeList, selectedRole, getSelectedRole } = handleRoles();
+        watchEffect(() => {
+            if (props.selectedData.roletype) {
+                const data = props.selectedData;
+                getDesList([
+                    { label: '登录账号', value: data.logincode },
+                    { label: '账户名称', value: data.accountname },
+                    { label: '手机号码', value: data.mobile },
+                ]);
+                // 选中的角色
+                getSelectedRole(props.selectedData.roletype);
+            }
+        });
+        return {
+            roleTypeList,
+            selectedRole,
+            desList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 3 - 37
src/views/information/account_info/compoments/locked-business/index.vue

@@ -13,22 +13,7 @@
                 :loading="loading"
                 @click="submit">锁定</a-button>
     </template>
-    <Des :list="desList"
-         :slotDesName="'账户角色'">
-      <a-checkbox-group class="commonCheckboxGroup"
-                        v-model:value="selectedRole">
-        <a-row>
-          <a-col :span="12"
-                 v-for="item in roleTypeList"
-                 :key="item.key">
-            <a-checkbox disabled
-                        :value="item.key">
-              {{item.value}}
-            </a-checkbox>
-          </a-col>
-        </a-row>
-      </a-checkbox-group>
-    </Des>
+    <Detail :selectedData="selectedData" />
   </a-modal>
 </template>
 
@@ -40,12 +25,11 @@ import { loginAccountOperate } from '@/services/proto/accountinfo';
 import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
 import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
 import { Modal } from 'ant-design-vue';
-import { handleRoles } from '../setup';
-import { Des, handleDesList } from '@/common/components/commonDes';
+import Detail from '../detail-commom-business/index.vue';
 
 export default defineComponent({
     name: 'account_info_business_btn_locked',
-    components: { Des },
+    components: { Detail },
     props: {
         selectedData: {
             default: {},
@@ -56,21 +40,6 @@ export default defineComponent({
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_business_btn_locked');
         const loading = ref<boolean>(false);
-        const { desList, getDesList } = handleDesList();
-        // 账户角色
-        const { roleTypeList, selectedRole, getSelectedRole } = handleRoles();
-        watchEffect(() => {
-            if (visible.value) {
-                const data = props.selectedData;
-                getDesList([
-                    { label: '登录账号', value: data.logincode },
-                    { label: '账户名称', value: data.accountname },
-                    { label: '手机号码', value: data.mobile },
-                ]);
-                // 选中的角色
-                getSelectedRole(props.selectedData.roletype);
-            }
-        });
         function submit() {
             Modal.confirm({
                 title: '是否确认锁定该账户',
@@ -92,9 +61,6 @@ export default defineComponent({
             });
         }
         return {
-            roleTypeList,
-            selectedRole,
-            desList,
             visible,
             cancel,
             submit,

+ 5 - 53
src/views/information/account_info/compoments/unlocked-business/index.vue

@@ -11,64 +11,25 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">锁</a-button>
+                @click="submit">锁</a-button>
     </template>
-    <a-form class="inlineForm"
-            :model="formState">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="登录账号"
-                       name="">
-            <span class="white">{{formState.logincode}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="">
-            <span class="white">{{formState.accountname}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="手机号码"
-                       name="">
-            <span class="white">{{formState.mobile}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户角色"
-                       name="userinfotype">
-            <a-checkbox-group class="commonCheckboxGroup"
-                              v-model:value="formState.roleids">
-              <a-row>
-                <a-col :span="12">
-                  <a-checkbox :value="22">业务员</a-checkbox>
-                </a-col>
-                <a-col :span="12">
-                  <a-checkbox :value="23">跟单员</a-checkbox>
-                </a-col>
-              </a-row>
-            </a-checkbox-group>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
+    <Detail :selectedData="selectedData" />
   </a-modal>
 </template>
 
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, PropType, watchEffect } from 'vue';
+import { defineComponent, ref, 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';
 import { Modal } from 'ant-design-vue';
-import { mergeTwoObj } from '@/utils/objHandle';
-import { handleBusinessForm } from '../setup';
+import Detail from '../detail-commom-business/index.vue';
 
 export default defineComponent({
     name: 'account_info_business_btn_unlocked',
-    components: {},
+    components: { Detail },
     props: {
         selectedData: {
             default: {},
@@ -79,14 +40,6 @@ export default defineComponent({
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('account_info_business_btn_unlocked');
         const loading = ref<boolean>(false);
-        const { formState } = handleBusinessForm();
-        watchEffect(() => {
-            if (visible.value) {
-                mergeTwoObj(formState, props.selectedData);
-                // roletype	:string;//角色类型(逗号隔开,如22,23), 22:业务员 23:跟单员 24:交易员
-                formState.roleids = props.selectedData.roletype.split(',').map((e) => +e);
-            }
-        });
         function submit() {
             Modal.confirm({
                 title: '是否确认解锁该账户',
@@ -108,7 +61,6 @@ export default defineComponent({
             });
         }
         return {
-            formState,
             visible,
             cancel,
             submit,