Selaa lähdekoodia

添加我的客户列表页编辑学校弹窗

lm 1 kuukausi sitten
vanhempi
commit
17410e03e9

+ 1 - 1
src/layout/components/AppMain.vue

@@ -22,7 +22,7 @@ export default {
 
 <style scoped lang="scss">
 .container {
-    /* border:solid blue 2px; */
+    // border:solid blue 2px; 
     flex: 1 1;
     overflow: auto;
     position: relative;

+ 63 - 0
src/views/myCustomer/formDialog.ts

@@ -0,0 +1,63 @@
+import { ref } from "vue";
+
+export const formItemList = ref([
+  {
+    key: 'schoolName',
+    label: '学校名称',
+    type: 'input',
+    placeholder: '学校名称',
+    style: {  }
+  },
+  {
+    key: 'schoolStage',
+    label: '学校学段',
+    type: 'radio',
+    selectList: [
+      { label: '幼儿园', value: 'kindergarten' },
+      { label: '小学', value: 'primary' },
+      { label: '初中', value: 'middle' },
+      { label: '高中', value: 'senior' },
+      { label: '完中', value: 'secondary' },
+      { label: '九年一贯', value: 'nine_years' },
+      { label: '十二年一贯', value: 'twelve_years' },
+      { label: '职高', value: 'vocational' },
+      { label: '大学', value: 'university' },
+    ],
+    style: { }
+  },
+  {
+    key: 'provinceArea',
+    label: '省份地区',
+    type: 'unionSelect',
+    unionSelectList: [
+      {
+        key: 'province',
+        type: 'select',
+        placeholder: '请选择省份',
+        disabled: false,
+        style: { },
+        selectList: [
+          { label: '北京', value: 'beijing' }
+        ]
+      },
+      {
+        key: 'district',
+        type: 'select',
+        placeholder: '请选择地区',
+        disabled: false,
+        style: { },
+        selectList: [
+          { label: '东城区', value: 'dongcheng' }
+        ]
+      }
+    ],
+    style: { display: 'flex' }
+  },
+  {
+    key: 'detailAddress',
+    label: '详细地址',
+    type: 'input',
+    placeholder: '通州北苑',
+    style: { }
+  }
+]);

+ 53 - 9
src/views/myCustomer/index.vue

@@ -32,7 +32,7 @@
 
                 <template #operation="{row}">
                     <div class="table_row_option">
-                        <span class="option_button_editor">编辑</span>
+                        <span class="option_button_editor" @click="OpenFormDialog(row)">编辑</span>
                         <span class="option_button_editor" @click="GoToDetail(row)">详情</span>
                     </div>
                 </template>
@@ -40,6 +40,14 @@
 
         </div>
     </div>
+
+    <FormDialog width="640px" title="编辑学校" :visible="editFormDialogVisible" 
+        :submitLoading="editFormDialogSubmitLoading"
+        :defaultFormData="editFormDefaultFormData"
+        :formItemList="formItemList"
+        @close="CloseFormDialog"
+        @confirm="HandleConfirmFormDialog">
+    </FormDialog>
 </template>
 
 
@@ -51,7 +59,9 @@ import {headerSearchList} from './searchBlock'
 import Table from '@/baseComponents/Table.vue';
 import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
 import {tableColumns} from './table'
+import FormDialog from '@/baseComponents/FormDialog.vue';
 
+import {formItemList} from './formDialog'
 
 const router = useRouter()
 /**
@@ -62,21 +72,28 @@ const tableData = ref([
         id: 1,
         customerType: '首单客户',
         schoolName: '流星花园学校',
-        educationStage: '中学',
+        schoolStage: 'middle',
+        province:'beijing',
         provinceName: '北京市',
-        cityName: '西城区',
+        city:'dongcheng',
+        cityName: '东城区',
+        detailAddress:'通州北苑',
         groupName: '小组',
         owner: '张三',
         claimTime: '2026-03-11',
-        lastFollowUpTime: '2026-03-11'
+        lastFollowUpTime: '2026-03-11',
     },
     {
         id: 2,
         customerType: '首单客户',
         schoolName: '北京师达',
-        educationStage: '中学',
+        schoolStage: 'primary',
+        province:'beijing',
         provinceName: '北京市',
-        cityName: '西城区',
+        city:'dongcheng',
+        cityName: '东城区',
+        detailAddress:'通州北苑',
+
         groupName: '小组',
         owner: '张三',
         claimTime: '2026-03-11',
@@ -86,9 +103,12 @@ const tableData = ref([
         id: 3,
         customerType: '首单客户',
         schoolName: '北京五十七中学',
-        educationStage: '中学',
+        schoolStage: 'senior',
+        province:'beijing',
         provinceName: '北京市',
-        cityName: '西城区',
+        city:'dongcheng',
+        cityName: '东城区',
+        detailAddress:'通州北苑',
         groupName: '小组',
         owner: '张三',
         claimTime: '2025-11-01',
@@ -119,8 +139,32 @@ const HandleBlurSearchChange = (params,key)=>{
 }
 
 /**
- * 3. 表格操作
+ * 3. 编辑学校弹窗有关操作
  */
+const editFormDialogVisible = ref(false)
+const editFormDialogSubmitLoading = ref(false)
+const editFormDefaultFormData = ref({})
+
+const OpenFormDialog = (row)=>{
+    editFormDialogVisible.value = true
+    editFormDefaultFormData.value = {
+        ...row,
+        provinceArea:{
+            province:row.province,
+            district:row.city,
+        }
+    }
+}
+const CloseFormDialog = ()=>{
+    editFormDialogVisible.value = false
+    editFormDefaultFormData.value = {}
+}
+const HandleConfirmFormDialog = ()=>{
+    CloseFormDialog()
+}
+
+
+/** 跳转详情 */
 const GoToDetail = (row)=>{
     router.push(`myCustomerDetail?id=${row.id}`)
 }

+ 1 - 1
src/views/myCustomer/myCustomerDetail/index.vue

@@ -250,7 +250,7 @@ const totalNum = ref(0)
     gap:16px;
     padding: 20px;
     flex: 1 1;
-
+    overflow: auto;
 
     :deep(.top_right){
         flex: 1 1;

+ 1 - 1
src/views/myCustomer/table.ts

@@ -30,7 +30,7 @@ export const tableColumns = ref([
         custom: false,
     },
     {
-        name: 'educationStage',
+        name: 'schoolStage',
         label: '学段',
         width: '80',
         fixed: '',