huangbin пре 4 година
родитељ
комит
868b6d7514
1 измењених фајлова са 28 додато и 33 уклоњено
  1. 28 33
      src/views/information/account_info/compoments/business-detail/index.vue

+ 28 - 33
src/views/information/account_info/compoments/business-detail/index.vue

@@ -10,24 +10,21 @@
     <template #footer>
       <a-button key="submit"
                 type="primary"
-                :loading="loading.loading"
-                @click="submit">关闭</a-button>
+                @click="cancel">关闭</a-button>
     </template>
-     <a-form class="inlineForm"
-            ref="formRef"
-            :model="formState"
-            :rules="rules">
+    <a-form class="inlineForm"
+            :model="formState">
       <a-row :gutter="24">
         <a-col :span="12">
           <a-form-item label="登录账号"
                        name="">
-            <span class="white">Y001</span>
+            <span class="white">{{formState.accountname}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="账户名称"
                        name="">
-            <span class="white">业务跟单员</span>
+            <span class="white">{{formState.logincode}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -36,25 +33,27 @@
             <a-input-password class="dialogInput"
                               style="width: 200px"
                               value="2323423"
+                              v-model:value="formState.password"
                               readonly />
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="手机号码"
                        name="">
-            <span class="white">13263529568</span>
+            <span class="white">{{formState.mobile}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="24">
           <a-form-item label="账户角色"
                        name="userinfotype">
-            <a-checkbox-group class="commonCheckboxGroup">
+            <a-checkbox-group class="commonCheckboxGroup"
+                              v-model:value="formState.roleids">
               <a-row>
                 <a-col :span="12">
-                  <a-checkbox value="A">业务员</a-checkbox>
+                  <a-checkbox :value="22">业务员</a-checkbox>
                 </a-col>
                 <a-col :span="12">
-                  <a-checkbox value="B">跟单员</a-checkbox>
+                  <a-checkbox :value="23">跟单员</a-checkbox>
                 </a-col>
               </a-row>
             </a-checkbox-group>
@@ -66,40 +65,36 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
+import { defineComponent, PropType, watchEffect } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { mergeObj } from '@/utils/objHandle';
-import { getStatusName } from '@/common/constants/enumsName';
-import { formatValue, formatTime } from '@/common/methods';
-import { getCardTypeEnumItemName } from '@/common/constants/enumsName';
+import { mergeTwoObj } from '@/utils/objHandle';
+import { handleBusinessForm } from '../setup';
+import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
 
 export default defineComponent({
-    name: 'custom-detail',
+    name: 'business-detail',
     components: {},
     props: {
-        selectedRow: {
-            type: Object as PropType<QueryCustomInfoType>,
+        selectedData: {
+            type: Object as PropType<ErmcpLoginUser>,
             default: {},
         },
     },
     setup(props) {
-        console.log('props', props.selectedRow);
         const { visible, cancel } = closeModal('detail');
-        const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
-        function submit() {
-            cancel();
-        }
+        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);
+            }
+        });
         return {
             visible,
             cancel,
-            submit,
-            loading,
-            formatValue,
-            getStatusName,
-            maskClosableFlag,
-            getCardTypeEnumItemName,
+            formState,
+            maskClosableFlag: false,
         };
     },
 });