Explorar o código

修改取消客户资料

huangbin %!s(int64=4) %!d(string=hai) anos
pai
achega
ac3668a76d

+ 56 - 5
src/views/information/custom/compoments/add/index.vue

@@ -21,12 +21,13 @@
           <a-form-item label="客户类型">
             <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>
@@ -34,6 +35,7 @@
         <a-col :span="12">
           <a-form-item label="企业名称">
             <a-input class="dialogInput"
+                     v-model:value="formState.customername"
                      style="width: 200px"
                      placeholder="请输入企业名称" />
           </a-form-item>
@@ -44,6 +46,7 @@
           <a-form-item label="企业简称">
             <a-input class="dialogInput"
                      style="width: 200px"
+                     v-model:value="formState.nickname"
                      placeholder="请输入企业简称" />
           </a-form-item>
         </a-col>
@@ -187,15 +190,63 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods/index';
+import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
+
+interface FormState {
+    userinfotype: string; //客户类型
+    customername: string; //客户名称(企业名称)
+    nickname: string; //企业简称
+    cardtype: number; //证件类型
+    cardnum: string; //证件号码 (加密存储)
+    legalpersonname: string; //法人姓名(企业)
+    attachment1: string; //附件1
+    attachment2: string; //附件2
+    attachment3: string; //附件3
+    attachment4: string; //附件4
+    attachment5: string; //附件5
+    contactname: string; //联系人
+    mobilephone: string; //手机号码 (加密存储)
+    telphone: string; //联系电话(加密存储)
+    provinceid: number; //省
+    cityid: number; //市
+    districtid: number; //地区
+    remark: string; //备注
+    cardaddress: string; //证件地址 (加密存储)
+}
 
 export default defineComponent({
     name: 'add-custom',
     components: {},
     setup() {
         const { visible, cancel } = closeModal('custom_info_btn_add');
+        const formState: UnwrapRef<FormState> = reactive({
+            userinfotype: '',
+            customername: '',
+            nickname: '',
+            cardtype: 2,
+            cardnum: '',
+            legalpersonname: '',
+            attachment1: '',
+            attachment2: '',
+            attachment3: '',
+            attachment4: '',
+            attachment5: '',
+            contactname: '',
+            mobilephone: '',
+            telphone: '',
+            provinceid: 0,
+            cityid: 0,
+            districtid: 0,
+            cardaddress: '',
+            remark: '',
+        });
+        const rules = {
+            userinfotype: [{ type: 'array', required: true, message: '请选择客户类型', trigger: 'change' }],
+            customername: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
+            nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
+        };
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
@@ -207,11 +258,12 @@ export default defineComponent({
         }
         initData(() => {});
         return {
+            formState,
             visible,
             cancel,
             submit,
             loading,
-            maskClosableFlag
+            maskClosableFlag,
         };
     },
 });
@@ -219,7 +271,6 @@ export default defineComponent({
 
 <style lang="less">
 .add-custom {
-  
 }
 </style
 >;

+ 21 - 5
src/views/information/custom/compoments/cancel/index.vue

@@ -8,6 +8,9 @@
     <template #footer>
       <a-button key="submit"
                 type="primary"
+                @click="cancel">取消</a-button>
+      <a-button key="submit"
+                type="primary"
                 :loading="loading"
                 @click="submit">完成</a-button>
     </template>
@@ -17,6 +20,7 @@
 <script lang="ts">
 import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import { Modal } from 'ant-design-vue';
 
 export default defineComponent({
     name: 'custom_info_btn_cancel',
@@ -25,12 +29,24 @@ export default defineComponent({
         const { visible, cancel } = closeModal('custom_info_btn_cancel');
         const loading = ref<boolean>(false);
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            // loading.value = true;
+            Modal.confirm({
+                title: 'Do you Want to delete these items?',
+                content: '是否取消',
+                onOk() {
+                    console.log('OK');
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+                class: 'test',
+            });
+            // setTimeout(() => {
+            //     loading.value = false;
+            //     cancel();
+            // }, 2000);
         }
+
         return {
             visible,
             cancel,