huangbin 4 سال پیش
والد
کامیت
8c64d23028

+ 11 - 7
src/views/platinum/platinum_customer_info/compoments/add/index.vue

@@ -62,11 +62,10 @@
                       style="width: 200px"
                       v-model:value="formState.userinfotype"
                       placeholder="请选择客户类型">
-              <a-select-option value="1">
-                个人
-              </a-select-option>
-              <a-select-option value="2">
-                企业
+              <a-select-option v-for="item in userinfotypeList"
+                               :value="item.key"
+                               :key="item.key">
+                {{item.name}}
               </a-select-option>
             </a-select>
           </a-form-item>
@@ -307,7 +306,7 @@ import UploadImg from '@/common/components/uploadImg/index.vue';
 import { getUploadImg } from '@/common/setup/upload';
 import { CustomerInfoOperateReq } from '@/services/proto/accountinfo/interface';
 import { initData } from '@/common/methods';
-import {toBase64, toBase64String} from "@/utils/storage/base64";
+import { toBase64, toBase64String } from '@/utils/storage/base64';
 
 export default defineComponent({
     name: 'add-custom',
@@ -315,6 +314,10 @@ export default defineComponent({
     setup(props, context) {
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('platinum_custom_info_add');
+        const userinfotypeList = [
+            { name: '个人', key: 1 },
+            { name: '企业', key: 2 },
+        ];
         const loading = ref<boolean>(false);
         // 证件类型
         const cardTypeList = ref<AllEnums[]>(getCardType());
@@ -332,7 +335,7 @@ export default defineComponent({
         //查询所属机构列表
         const { areaList, getAreaList } = handleAreaList();
         function isPersonal(): boolean {
-            return formState.userinfotype === '1';
+            return formState.userinfotype === 1;
         }
         initData(() => {
             getAreaList(loading);
@@ -375,6 +378,7 @@ export default defineComponent({
         }
 
         return {
+            userinfotypeList,
             formState,
             rules,
             formRef,

+ 1 - 1
src/views/platinum/platinum_customer_info/compoments/add/interface.ts

@@ -2,7 +2,7 @@ export interface FormState {
     areaid: number | undefined; //所属机构
     logincode: string // string 登录帐号
     loginpwd: string  // string 登录密码
-    userinfotype: string; //客户类型
+    userinfotype: number; //客户类型
     customername: string; //客户名称(企业名称)
     nickname: string; //企业简称
     cardtype: number | undefined; //证件类型

+ 2 - 2
src/views/platinum/platinum_customer_info/compoments/add/setup.ts

@@ -28,7 +28,7 @@ export function handleForm() {
         return validateCommon(value, '请选择证件类型')
     }
     const rules = {
-        userinfotype: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
+        userinfotype: [{ required: true, message: '请选择客户类型', type: 'number' }],
         customername: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
         nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
         cardtype: [{ required: true, validator: v_cardtype, trigger: 'change' }],
@@ -48,7 +48,7 @@ export function initFormState(): FormState {
         areaid: undefined,
         logincode: '',
         loginpwd: '',
-        userinfotype: '2',
+        userinfotype: 2,
         customername: '',
         nickname: '',
         cardtype: undefined,

+ 25 - 16
src/views/platinum/platinum_customer_info/compoments/modify/index.vue

@@ -5,14 +5,14 @@
            v-if="visible"
            v-model:visible="visible"
            centered
-           :maskClosable="maskClosableFlag"
+           :maskClosable="false"
            @cancel="cancel"
            width="890px">
     <template #footer>
-      <a-button key="submit"
+      <!-- <a-button key="submit"
                 class="cancelBtn"
                 @click="submit(1)">保存草稿
-      </a-button>
+      </a-button> -->
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
@@ -62,11 +62,10 @@
                       style="width: 200px"
                       v-model:value="formState.userinfotype"
                       placeholder="请选择客户类型">
-              <a-select-option value="1">
-                个人
-              </a-select-option>
-              <a-select-option value="2">
-                企业
+              <a-select-option v-for="item in userinfotypeList"
+                               :value="item.key"
+                               :key="item.key">
+                {{item.name}}
               </a-select-option>
             </a-select>
           </a-form-item>
@@ -312,6 +311,7 @@ import UploadImg from '@/common/components/uploadImg/index.vue';
 import { getUploadImg } from '@/common/setup/upload';
 import { CustomerInfoOperateReq } from '@/services/proto/accountinfo/interface';
 import { initData } from '@/common/methods';
+import { QhjCustomer } from '@/services/go/ermcp/qhj/interface';
 
 export default defineComponent({
     name: 'modify-custom',
@@ -319,11 +319,15 @@ export default defineComponent({
     props: {
         selectedRow: {
             default: initFormState,
-            type: Object as PropType<CustomerInfoOperateReq>,
+            type: Object as PropType<QhjCustomer>,
         },
     },
-    setup(props, context) {
+    setup(props: { selectedRow: QhjCustomer }, context: { emit: (arg0: string) => void }) {
         const { visible, cancel } = closeModal('platinum_custom_info_normal_modify');
+        const userinfotypeList = [
+            { name: '个人', key: 1 },
+            { name: '企业', key: 2 },
+        ];
         const loading = ref<boolean>(false);
         // 证件类型
         const cardTypeList = ref<AllEnums[]>(getCardType());
@@ -340,7 +344,7 @@ export default defineComponent({
         //查询所属机构列表
         const { areaList, getAreaList } = handleAreaList();
         function isPersonal(): boolean {
-            return formState.userinfotype === '1';
+            return formState.userinfotype === 1;
         }
 
         const userid = ref<number>(0);
@@ -348,22 +352,26 @@ export default defineComponent({
         watchEffect(() => {
             if (visible.value) {
                 getAreaList(loading);
+                console.log('props.selectedRow', props.selectedRow);
+
                 userid.value = props.selectedRow.userid;
                 mergeTwoObj(formState, props.selectedRow);
-                const { provinceid, cityid, proxystatementurl, cardfrontphotourl, cardbackphotourl } = props.selectedRow;
+                const { provinceid, cityid, attachment1, cardfrontphotourl, cardbackphotourl, parentuserid, userinfotype } = props.selectedRow;
                 provinceid ? getCityList(provinceid) : (formState.provinceid = undefined);
                 cityid ? getDistrictList(cityid) : ((formState.cityid = undefined), (formState.districtid = undefined));
-                if (proxystatementurl) {
+                parentuserid ? (formState.areaid = parentuserid) : (formState.areaid = undefined);
+                // userinfotype ? (formState.userinfotype = userinfotype) : (formState.userinfotype = undefined);
+                if (attachment1) {
                     // 营业执照
-                    attachmentImgList.value = attachmentHandle(proxystatementurl);
+                    attachmentImgList.value = attachmentHandle(attachment1);
                 }
                 if (cardbackphotourl) {
                     // 背面证件照地址
                     cardbackImgList.value = cardbackHandle(cardbackphotourl);
                 }
-                if (cardbackphotourl) {
+                if (cardfrontphotourl) {
                     // 正面证件照地址
-                    cardfrontImgList.value = cardfrontHandle(cardbackphotourl);
+                    cardfrontImgList.value = cardfrontHandle(cardfrontphotourl);
                 }
             }
         });
@@ -402,6 +410,7 @@ export default defineComponent({
             });
         }
         return {
+            userinfotypeList,
             formState,
             rules,
             formRef,