Kaynağa Gözat

修改客户资料

huangbin 4 yıl önce
ebeveyn
işleme
3ec4a3aef7

+ 295 - 299
src/views/information/custom/compoments/add/index.vue

@@ -1,306 +1,305 @@
 <template>
-    <!-- 新增客户资料 -->
-    <a-modal class="add-custom"
-             title="新增客户资料"
-             v-model:visible="visible"
-             @cancel="cancel"
-             centered
-             :maskClosable="false"
-             width="890px">
-        <template #footer>
-            <a-button key="submit"
-                      class="cancelBtn"
-                      @click="submit(1)">保存草稿
-            </a-button>
-            <a-button key="submit"
-                      type="primary"
-                      :loading="loading"
-                      @click="submit(2)">提交审核
-            </a-button>
+  <!-- 新增客户资料 -->
+  <a-modal class="add-custom"
+           title="新增客户资料"
+           v-model:visible="visible"
+           @cancel="cancel"
+           centered
+           :maskClosable="false"
+           width="890px">
+    <template #footer>
+      <!-- <a-button key="submit"
+                class="cancelBtn"
+                @click="submit(1)">保存草稿
+      </a-button> -->
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit(2)">提交审核
+      </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="userinfotype">
+            <a-select class="typeSelect"
+                      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>
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <template v-if="!isPersonal()">
+          <a-col :span="12">
+            <a-form-item label="企业名称"
+                         name="customername">
+              <a-input class="dialogInput"
+                       v-model:value="formState.customername"
+                       style="width: 200px"
+                       placeholder="请输入企业名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="企业简称"
+                         name="nickname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.nickname"
+                       placeholder="请输入企业简称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="证件类型"
+                         name="cardtype">
+              <a-select class="inlineFormSelect"
+                        v-model:value="formState.cardtype"
+                        style="width: 200px"
+                        placeholder="请选择证件类型">
+                <a-select-option :value="item.enumitemname"
+                                 v-for="item in cardTypeList"
+                                 :key="item.autoid">
+                  {{ item.enumdicname }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="法定代表人"
+                         name="legalpersonname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.legalpersonname"
+                       placeholder="请输入法定代表人" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="证件号码"
+                         name="cardnum">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.cardnum"
+                       placeholder="请输入证件号码" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="纳税人识别号"
+                         name="taxpayernum">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.taxpayernum"
+                       placeholder="请输入纳税人识别号" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="营业执照">
+              <div class="upload">
+                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                          :transform-file="transformFile">
+                  <a-button class="uploadBtn">上传</a-button>
+                </a-upload>
+                <div class="look">查看附件</div>
+              </div>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系人"
+                         name="contactname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.contactname"
+                       placeholder="请输入联系人" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系人手机号"
+                         name="mobilephone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.mobilephone"
+                       placeholder="请输入联系人手机号" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系电话"
+                         name="telphone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.telphone"
+                       placeholder="请输入联系电话" />
+            </a-form-item>
+          </a-col>
         </template>
-        <a-form class="inlineForm"
-                ref="formRef"
-                :model="formState"
-                :rules="rules">
-            <a-row :gutter="24">
-                <a-col :span="12">
-                    <a-form-item label="客户类型"
-                                 name="userinfotype">
-                        <a-select class="typeSelect"
-                                  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>
-                        </a-select>
-                    </a-form-item>
-                </a-col>
-                <template v-if="!isPersonal()">
-                    <a-col :span="12">
-                        <a-form-item label="企业名称"
-                                     name="customername">
-                            <a-input class="dialogInput"
-                                     v-model:value="formState.customername"
-                                     style="width: 200px"
-                                     placeholder="请输入企业名称"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="企业简称"
-                                     name="nickname">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.nickname"
-                                     placeholder="请输入企业简称"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="证件类型"
-                                     name="cardtype">
-                            <a-select class="inlineFormSelect"
-                                      v-model:value="formState.cardtype"
-                                      style="width: 200px"
-                                      placeholder="请选择证件类型">
-                                <a-select-option :value="item.enumitemname"
-                                                 v-for="item in cardTypeList"
-                                                 :key="item.autoid">
-                                    {{ item.enumdicname }}
-                                </a-select-option>
-                            </a-select>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="法定代表人"
-                                     name="legalpersonname">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.legalpersonname"
-                                     placeholder="请输入法定代表人"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="证件号码"
-                                     name="cardnum">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.cardnum"
-                                     placeholder="请输入证件号码"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="纳税人识别号"
-                                     name="taxpayernum">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.taxpayernum"
-                                     placeholder="请输入纳税人识别号"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="营业执照">
-                            <div class="upload">
-                                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                                          :transform-file="transformFile">
-                                    <a-button class="uploadBtn">上传</a-button>
-                                </a-upload>
-                                <div class="look">查看附件</div>
-                            </div>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="联系人"
-                                     name="contactname">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.contactname"
-                                     placeholder="请输入联系人"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="联系人手机号"
-                                     name="mobilephone">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.mobilephone"
-                                     placeholder="请输入联系人手机号"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="联系电话"
-                                     name="telphone">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.telphone"
-                                     placeholder="请输入联系电话"/>
-                        </a-form-item>
-                    </a-col>
-                </template>
-                <template v-else>
-                    <a-col :span="12">
-                        <a-form-item label="姓名"
-                                     name="username">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.username"
-                                     placeholder="请输入姓名"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="身份证号码"
-                                     name="cardnum">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.cardnum"
-                                     placeholder="请输入身份证号码"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="手机号码"
-                                     name="mobilephone">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.mobilephone"
-                                     placeholder="请输入手机号码"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="身份证正面照"
-                                     name="cardbackphotourl">
-                            <div class="upload">
-                                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                                          :transform-file="transformFile">
-                                    <a-button class="uploadBtn">上传</a-button>
-                                </a-upload>
-                                <div class="look">查看附件</div>
-                            </div>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="邮箱"
-                                     name="email">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.email"
-                                     placeholder="请输入邮箱"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="24">
-                        <a-form-item label="身份证反面照"
-                                     name="cardfrontphotourl">
-                            <div class="upload">
-                                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                                          :transform-file="transformFile">
-                                    <a-button class="uploadBtn">上传</a-button>
-                                </a-upload>
-                                <div class="look">查看附件</div>
-                            </div>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="联系电话"
-                                     name="telphone">
-                            <a-input class="dialogInput"
-                                     style="width: 200px"
-                                     v-model:value="formState.telphone"
-                                     placeholder="请输入联系电话"/>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item>
-                            &nbsp;
-                        </a-form-item>
-                    </a-col>
-                </template>
-                <a-col :span="24">
-                    <a-form-item label="通讯地址">
-                        <a-select class="inlineFormSelect"
-                                  style="width: 205px"
-                                  v-model:value="formState.provinceid"
-                                  @change="getCityList"
-                                  placeholder="请选择省">
-                            <a-select-option v-for="item in provinceList"
-                                             :key="item.autoid"
-                                             :value="item.autoid">
-                                {{ item.divisionname }}
-                            </a-select-option>
-                        </a-select>
-                        <a-select class="inlineFormSelect ml9"
-                                  style="width: 205px"
-                                  v-model:value="formState.cityid"
-                                  @change="getDistrictList"
-                                  placeholder="请选择市">
-                            <a-select-option v-for="item in cityList"
-                                             :key="item.autoid"
-                                             :value="item.autoid">
-                                {{ item.divisionname }}
-                            </a-select-option>
-                        </a-select>
-                        <a-select class="inlineFormSelect ml9"
-                                  v-model:value="formState.districtid"
-                                  style="width: 205px"
-                                  placeholder="请选择县(区)">
-                            <a-select-option v-for="item in districtList"
-                                             :key="item.autoid"
-                                             :value="item.autoid">
-                                {{ item.divisionname }}
-                            </a-select-option>
-                        </a-select>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="24">
-                    <a-form-item label="&nbsp;"
-                                 name="cardaddress">
-                        <a-input class="dialogInput"
-                                 style="width: 635px"
-                                 v-model:value="formState.cardaddress"
-                                 placeholder="请输入详细地址"/>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="24">
-                    <a-form-item label="备注"
-                                 name="remark">
-                        <a-input class="dialogInput"
-                                 style="width: 635px"
-                                 v-model:value="formState.remark"
-                                 placeholder="请输入备注"/>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-        </a-form>
-    </a-modal>
+        <template v-else>
+          <a-col :span="12">
+            <a-form-item label="姓名"
+                         name="username">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.username"
+                       placeholder="请输入姓名" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="身份证号码"
+                         name="cardnum">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.cardnum"
+                       placeholder="请输入身份证号码" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="手机号码"
+                         name="mobilephone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.mobilephone"
+                       placeholder="请输入手机号码" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="身份证正面照"
+                         name="cardbackphotourl">
+              <div class="upload">
+                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                          :transform-file="transformFile">
+                  <a-button class="uploadBtn">上传</a-button>
+                </a-upload>
+                <div class="look">查看附件</div>
+              </div>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="邮箱"
+                         name="email">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.email"
+                       placeholder="请输入邮箱" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="身份证反面照"
+                         name="cardfrontphotourl">
+              <div class="upload">
+                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                          :transform-file="transformFile">
+                  <a-button class="uploadBtn">上传</a-button>
+                </a-upload>
+                <div class="look">查看附件</div>
+              </div>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系电话"
+                         name="telphone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.telphone"
+                       placeholder="请输入联系电话" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item>
+              &nbsp;
+            </a-form-item>
+          </a-col>
+        </template>
+        <a-col :span="24">
+          <a-form-item label="通讯地址">
+            <a-select class="inlineFormSelect"
+                      style="width: 205px"
+                      v-model:value="formState.provinceid"
+                      @change="getCityList"
+                      placeholder="请选择省">
+              <a-select-option v-for="item in provinceList"
+                               :key="item.autoid"
+                               :value="item.autoid">
+                {{ item.divisionname }}
+              </a-select-option>
+            </a-select>
+            <a-select class="inlineFormSelect ml9"
+                      style="width: 205px"
+                      v-model:value="formState.cityid"
+                      @change="getDistrictList"
+                      placeholder="请选择市">
+              <a-select-option v-for="item in cityList"
+                               :key="item.autoid"
+                               :value="item.autoid">
+                {{ item.divisionname }}
+              </a-select-option>
+            </a-select>
+            <a-select class="inlineFormSelect ml9"
+                      v-model:value="formState.districtid"
+                      style="width: 205px"
+                      placeholder="请选择县(区)">
+              <a-select-option v-for="item in districtList"
+                               :key="item.autoid"
+                               :value="item.autoid">
+                {{ item.divisionname }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="24">
+          <a-form-item label="&nbsp;"
+                       name="cardaddress">
+            <a-input class="dialogInput"
+                     style="width: 635px"
+                     v-model:value="formState.cardaddress"
+                     placeholder="请输入详细地址" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="24">
+          <a-form-item label="备注"
+                       name="remark">
+            <a-input class="dialogInput"
+                     style="width: 635px"
+                     v-model:value="formState.remark"
+                     placeholder="请输入备注" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+  </a-modal>
 </template>
 
 <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 {getCardType, handleForm} from './setup';
-import {AllEnums} from '@/services/go/commonService/interface';
-import {FormState} from './interface';
-import {ValidateErrorEntity} from 'ant-design-vue/es/form/interface';
-import {getAddress} from '@/services/go/adress';
-import {AddUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
-import {getUserId} from "@/services/bus/account";
-import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
-import {QueryAddUserInfoApply} from "@/services/go/ermcp/customInfo";
+import { closeModal } from '@/common/setup/modal/index';
+import { defineComponent, ref, toRaw } from 'vue';
+import { getCardType, handleForm } from './setup';
+import { AllEnums } from '@/services/go/commonService/interface';
+import { FormState } from './interface';
+import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+import { getAddress } from '@/services/go/adress';
+import { AddUserInfoApplyReq } from '@/services/go/ermcp/customInfo/interface';
+import { getUserId } from '@/services/bus/account';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { QueryAddUserInfoApply } from '@/services/go/ermcp/customInfo';
 
 export default defineComponent({
     name: 'add-custom',
     components: {},
-    setup(name, context) {
+    setup(props, context) {
         // 控制关闭弹窗
-        const {visible, cancel} = closeModal('custom_info_btn_add');
+        const { visible, cancel } = closeModal('custom_info_btn_add');
         const loading = ref<boolean>(false);
         // 证件类型
         const cardTypeList = ref<AllEnums[]>(getCardType());
         // 表单
-        const {formRef, formState, rules} = handleForm();
+        const { formRef, formState, rules } = handleForm();
         // 地址
-        const {cityList, districtList, provinceList, getCityList, getDistrictList} = getAddress();
+        const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
 
         function isPersonal(): boolean {
             return formState.userinfotype === '1';
@@ -312,8 +311,8 @@ export default defineComponent({
                 .then(() => {
                     const param = toRaw(formState);
                     const reqParam: AddUserInfoApplyReq = {
-                        customername: param.customername,   // 必填
-                        userid: 1,  // 写死 必填
+                        customername: param.customername, // 必填
+                        userid: 1, // 写死 必填
                         memberareaid: getUserId(),
                         userinfotype: Number(param.userinfotype),
                         username: param.customername,
@@ -327,17 +326,17 @@ export default defineComponent({
                         mobilephone: param.mobilephone, //  手机号码
                         telphone: param.telphone, // 电话
                         cardfrontphotourl: param.cardfrontphotourl, // 正面照片
-                        cardaddress: param.cardaddress,  // 证件地址
+                        cardaddress: param.cardaddress, // 证件地址
                         cityid: param.cityid, //
                         districtid: param.districtid, // 地区
                         // countryid: param.,9
                         provinceid: param.provinceid, //省
-                        contactname: param.contactname,  // 联系人
-                        legalpersonname: param.legalpersonname,  // 法人姓名(企业)
+                        contactname: param.contactname, // 联系人
+                        legalpersonname: param.legalpersonname, // 法人姓名(企业)
                         taxpayernum: param.taxpayernum, // 纳税人识别号
-                        email: param.email,  // email
-                    }
-                    requestResultLoadingAndInfo(QueryAddUserInfoApply, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
+                        email: param.email, // email
+                    };
+                    requestResultLoadingAndInfo(QueryAddUserInfoApply, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['修改客户资料成功', '修改客户资料失败:']).then(() => {
                         cancel();
                         context.emit('refresh');
                     });
@@ -347,9 +346,6 @@ export default defineComponent({
                     console.log('error', error);
                 });
         }
-
-        initData(() => {
-        });
         return {
             formState,
             rules,

+ 299 - 179
src/views/information/custom/compoments/modify/index.vue

@@ -9,180 +9,263 @@
            @cancel="cancel"
            width="890px">
     <template #footer>
-        <a-button key="submit"
-                  class="cancelBtn"
-                  @click="submit(1)">保存草稿
-        </a-button>
-        <a-button key="submit"
-                  type="primary"
-                  :loading="loading"
-                  @click="submit(2)">提交审核</a-button>
+      <a-button key="submit"
+                class="cancelBtn"
+                @click="submit(1)">保存草稿
+      </a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit(2)">提交审核</a-button>
     </template>
     <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
+            ref="formRef"
+            :model="formState"
+            :rules="rules">
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="客户类型">
+          <a-form-item label="客户类型"
+                       name="userinfotype">
             <a-select class="typeSelect"
                       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>
             </a-select>
           </a-form-item>
         </a-col>
-        <a-col :span="12">
-          <a-form-item label="企业名称">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入企业名称" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="企业简称">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入企业简称" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件类型">
-            <a-select class="inlineFormSelect"
-                      style="width: 200px"
-                      placeholder="请选择证件类型">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
-              </a-select-option>
-            </a-select>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="法定代表人">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入法定代表人" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件号码">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入证件号码" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="纳税人识别号">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入纳税人识别号" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="营业执照">
-            <div class="upload">
-              <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                        :transform-file="transformFile">
-                <a-button class="uploadBtn">上传</a-button>
-              </a-upload>
-              <div class="look">查看附件</div>
-            </div>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="联系人">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入联系人" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="联系人手机号">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入联系人手机号" />
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="联系电话">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     placeholder="请输入联系电话" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item>
-            &nbsp;
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        <template v-if="!isPersonal()">
+          <a-col :span="12">
+            <a-form-item label="企业名称"
+                         name="customername">
+              <a-input class="dialogInput"
+                       v-model:value="formState.customername"
+                       style="width: 200px"
+                       placeholder="请输入企业名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="企业简称"
+                         name="nickname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.nickname"
+                       placeholder="请输入企业简称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="证件类型"
+                         name="cardtype">
+              <a-select class="inlineFormSelect"
+                        v-model:value="formState.cardtype"
+                        style="width: 200px"
+                        placeholder="请选择证件类型">
+                <a-select-option :value="item.enumitemname"
+                                 v-for="item in cardTypeList"
+                                 :key="item.autoid">
+                  {{ item.enumdicname }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="法定代表人"
+                         name="legalpersonname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.legalpersonname"
+                       placeholder="请输入法定代表人" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="证件号码"
+                         name="cardnum">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.cardnum"
+                       placeholder="请输入证件号码" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="纳税人识别号"
+                         name="taxpayernum">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.taxpayernum"
+                       placeholder="请输入纳税人识别号" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="营业执照">
+              <div class="upload">
+                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                          :transform-file="transformFile">
+                  <a-button class="uploadBtn">上传</a-button>
+                </a-upload>
+                <div class="look">查看附件</div>
+              </div>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系人"
+                         name="contactname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.contactname"
+                       placeholder="请输入联系人" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系人手机号"
+                         name="mobilephone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.mobilephone"
+                       placeholder="请输入联系人手机号" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系电话"
+                         name="telphone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.telphone"
+                       placeholder="请输入联系电话" />
+            </a-form-item>
+          </a-col>
+        </template>
+        <template v-else>
+          <a-col :span="12">
+            <a-form-item label="姓名"
+                         name="username">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.username"
+                       placeholder="请输入姓名" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="身份证号码"
+                         name="cardnum">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.cardnum"
+                       placeholder="请输入身份证号码" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="手机号码"
+                         name="mobilephone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.mobilephone"
+                       placeholder="请输入手机号码" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="身份证正面照"
+                         name="cardbackphotourl">
+              <div class="upload">
+                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                          :transform-file="transformFile">
+                  <a-button class="uploadBtn">上传</a-button>
+                </a-upload>
+                <div class="look">查看附件</div>
+              </div>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="邮箱"
+                         name="email">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.email"
+                       placeholder="请输入邮箱" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="身份证反面照"
+                         name="cardfrontphotourl">
+              <div class="upload">
+                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                          :transform-file="transformFile">
+                  <a-button class="uploadBtn">上传</a-button>
+                </a-upload>
+                <div class="look">查看附件</div>
+              </div>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系电话"
+                         name="telphone">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.telphone"
+                       placeholder="请输入联系电话" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item>
+              &nbsp;
+            </a-form-item>
+          </a-col>
+        </template>
         <a-col :span="24">
           <a-form-item label="通讯地址">
             <a-select class="inlineFormSelect"
                       style="width: 205px"
+                      v-model:value="formState.provinceid"
+                      @change="getCityList"
                       placeholder="请选择省">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
+              <a-select-option v-for="item in provinceList"
+                               :key="item.autoid"
+                               :value="item.autoid">
+                {{ item.divisionname }}
               </a-select-option>
             </a-select>
-            <a-select class="inlineFormSelect ml10"
+            <a-select class="inlineFormSelect ml9"
                       style="width: 205px"
+                      v-model:value="formState.cityid"
+                      @change="getDistrictList"
                       placeholder="请选择市">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
+              <a-select-option v-for="item in cityList"
+                               :key="item.autoid"
+                               :value="item.autoid">
+                {{ item.divisionname }}
               </a-select-option>
             </a-select>
-            <a-select class="inlineFormSelect ml10"
+            <a-select class="inlineFormSelect ml9"
+                      v-model:value="formState.districtid"
                       style="width: 205px"
                       placeholder="请选择县(区)">
-              <a-select-option value="1">
-                客户一
-              </a-select-option>
-              <a-select-option value="2">
-                客户二
+              <a-select-option v-for="item in districtList"
+                               :key="item.autoid"
+                               :value="item.autoid">
+                {{ item.divisionname }}
               </a-select-option>
             </a-select>
           </a-form-item>
         </a-col>
-      </a-row>
-      <a-row :gutter="24">
         <a-col :span="24">
-          <a-form-item label="&nbsp;">
+          <a-form-item label="&nbsp;"
+                       name="cardaddress">
             <a-input class="dialogInput"
                      style="width: 635px"
+                     v-model:value="formState.cardaddress"
                      placeholder="请输入详细地址" />
           </a-form-item>
         </a-col>
-      </a-row>
-      <a-row :gutter="24">
         <a-col :span="24">
-          <a-form-item label="备注">
+          <a-form-item label="备注"
+                       name="remark">
             <a-input class="dialogInput"
                      style="width: 635px"
+                     v-model:value="formState.remark"
                      placeholder="请输入备注" />
           </a-form-item>
         </a-col>
@@ -192,68 +275,105 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
-import {AddUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
+import { defineComponent, PropType, ref, toRaw, watchEffect } from 'vue';
+import { getCardType, handleForm, initFormState } from '../add/setup';
+import { AllEnums } from '@/services/go/commonService/interface';
+import { FormState } from '../add/interface';
+import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+import { getAddress } from '@/services/go/adress';
+import { AddUserInfoApplyReq } from '@/services/go/ermcp/customInfo/interface';
+import { getUserId } from '@/services/bus/account';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { QueryAddUserInfoApply } from '@/services/go/ermcp/customInfo';
+import { mergeTwoObj } from '@/utils/objHandle';
 
 export default defineComponent({
     name: 'modify-custom',
     components: {},
     props: {
-        // selectedRow: {
-        //   type:
-        // }
+        selectedRow: {
+            default: initFormState,
+            type: Object as PropType<FormState>,
+        },
     },
-    setup(name,context) {
-        // const { visible, cancel } = closeModal('modifyCustomInfo');
+    setup(props, context) {
         const { visible, cancel } = closeModal('custom_info_btn_modify');
-
         const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
-        function submit(OperateType: 1 | 2) {
-            cancel();
-            const reqParam :AddUserInfoApplyReq = {
-                // customername: param.customername,   // 必填
-                // userid: 1,  // 写死 必填
-                // memberareaid: getUserId(),
-                // userinfotype: Number(param.userinfotype),
-                // username: param.customername,
-                // userstate: OperateType, // 1: 保存草稿 2: 新增
-                //
-                // // 以上必填
-                // cardtype: param.cardtype, // 证件类型
-                // cardnum: param.cardnum, // 证件号码
-                // nickname: param.nickname, // 昵称
-                // remark: param.remark, // 备注
-                // mobilephone: param.mobilephone, //  手机号码
-                // telphone: param.telphone, // 电话
-                // cardfrontphotourl: param.cardfrontphotourl, // 正面照片
-                // cardaddress: param.cardaddress,  // 证件地址
-                // cityid: param.cityid, //
-                // districtid: param.districtid, // 地区
-                // // countryid: param.,9
-                // provinceid: param.provinceid, //省
-                // contactname: param.contactname,  // 联系人
-                // legalpersonname: param.legalpersonname,  // 法人姓名(企业)
-                // taxpayernum: param.taxpayernum, // 纳税人识别号
-                // email: param.email,  // email
-            }
+        // 证件类型
+        const cardTypeList = ref<AllEnums[]>(getCardType());
+        // 表单
+        const { formRef, formState, rules } = handleForm();
+        // 地址
+        const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
 
-            // modifyUserInfo(OperateType, reqParam, loading)
-            //     .then(res => {
-            //         cancel()
-            //         context.emit('refresh')
-            //     })
+        function isPersonal(): boolean {
+            return formState.userinfotype === '1';
+        }
+        watchEffect(() => {
+            if (visible.value) {
+                mergeTwoObj(formState, props.selectedRow);
+                const { provinceid, cityid } = props.selectedRow;
+                provinceid ? getCityList(provinceid) : (formState.provinceid = undefined);
+                cityid ? getDistrictList(cityid) : ((formState.cityid = undefined), (formState.districtid = undefined));
+            }
+        });
+        function submit(OperateType: 1 | 2) {
+            formRef.value
+                .validate()
+                .then(() => {
+                    const param = toRaw(formState);
+                    const reqParam: AddUserInfoApplyReq = {
+                        customername: param.customername, // 必填
+                        userid: 1, // 写死 必填
+                        memberareaid: getUserId(),
+                        userinfotype: Number(param.userinfotype),
+                        username: param.customername,
+                        userstate: OperateType, // 1: 保存草稿 2: 新增
 
+                        // 以上必填
+                        cardtype: param.cardtype, // 证件类型
+                        cardnum: param.cardnum, // 证件号码
+                        nickname: param.nickname, // 昵称
+                        remark: param.remark, // 备注
+                        mobilephone: param.mobilephone, //  手机号码
+                        telphone: param.telphone, // 电话
+                        cardfrontphotourl: param.cardfrontphotourl, // 正面照片
+                        cardaddress: param.cardaddress, // 证件地址
+                        cityid: param.cityid, //
+                        districtid: param.districtid, // 地区
+                        // countryid: param.,9
+                        provinceid: param.provinceid, //省
+                        contactname: param.contactname, // 联系人
+                        legalpersonname: param.legalpersonname, // 法人姓名(企业)
+                        taxpayernum: param.taxpayernum, // 纳税人识别号
+                        email: param.email, // email
+                    };
+                    requestResultLoadingAndInfo(QueryAddUserInfoApply, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
+                        cancel();
+                        context.emit('refresh');
+                    });
+                    console.log('values', formState);
+                })
+                .catch((error: ValidateErrorEntity<FormState>) => {
+                    console.log('error', error);
+                });
         }
-        initData(() => {});
         return {
+            formState,
+            rules,
+            formRef,
+            cardTypeList,
+            isPersonal,
             visible,
             cancel,
             submit,
             loading,
-            maskClosableFlag,
+            cityList,
+            districtList,
+            provinceList,
+            getCityList,
+            getDistrictList,
         };
     },
 });

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

@@ -29,7 +29,7 @@
       </a-table>
     </contextMenu>
     <!-- 新增 -->
-    <AddCustom />
+    <AddCustom @refresh="queryTable" />
     <!-- 详情 -->
     <CustomDetail :selectedRow="selectedRow"
                   @refresh="queryTable" />

+ 2 - 3
src/views/information/warehouse-info/compoments/add/index.vue

@@ -135,14 +135,13 @@
 import { defineComponent, PropType, ref, toRaw } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { getAddress } from '@/services/go/adress';
-import { handleForm, FormState, warehouseApply, reqestAction } from '../setup';
+import { handleForm, FormState } from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { AllEnums } from '@/services/go/commonService/interface';
 import { WarehouseApplyReq } from '@/services/proto/warehouse/interface';
 import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
 import { getWarehouseTypeEnumList } from '@/common/constants/enumsList';
-import { getSelectedAccountId } from '@/services/bus/account';
-import { addWarehouseApply, warehouseStateChangeReq } from '@/services/proto/warehouse';
+import { addWarehouseApply } from '@/services/proto/warehouse';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 
 export default defineComponent({

+ 3 - 9
src/views/information/warehouse-info/compoments/modify/index.vue

@@ -134,7 +134,6 @@
 <script lang="ts">
 import { defineComponent, PropType, ref, toRaw, watchEffect } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
 import { getAddress } from '@/services/go/adress';
 import { handleForm, FormState, warehouseApply } from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
@@ -160,16 +159,11 @@ export default defineComponent({
         const warehouseType = ref<AllEnums[]>(getWarehouseTypeEnumList());
         const { formRef, formState, rules } = handleForm();
         watchEffect(() => {
-            if (props.selectedRow.warehousename) {
-                console.log('props.selectedRow,', props.selectedRow);
+            if (visible.value) {
                 mergeTwoObj(formState, props.selectedRow);
                 const { provinceid, cityid } = props.selectedRow;
-                if (provinceid) {
-                    getCityList(provinceid);
-                }
-                if (cityid) {
-                    getDistrictList(cityid);
-                }
+                provinceid ? getCityList(provinceid) : (formState.provinceid = undefined);
+                cityid ? getDistrictList(cityid) : ((formState.cityid = undefined), (formState.districtid = undefined));
             }
         });
         function submit() {