From b5f83dab8f1d761289cb8db1f7856f7cad800e1d Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Sat, 12 Aug 2023 18:24:08 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=87=BA=E5=A4=9A=E9=80=89?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/company/edit.vue | 39 ++++++++++++++++++++++++++++++++++++--
1 file changed, 37 insertions(+), 2 deletions(-)
diff --git a/src/views/company/edit.vue b/src/views/company/edit.vue
index 6b98d0a..0f608fd 100644
--- a/src/views/company/edit.vue
+++ b/src/views/company/edit.vue
@@ -32,7 +32,7 @@
>
-
+
+
+
+
+ {{ city[regionType + "_name"] }}
+
+
+
@@ -777,6 +792,22 @@ function openCompany() {
isCompany.value = true;
}
+// 当前选择的负责区域列表
+const regionList = ref([]);
+// 当前应当显示的区域
+const regionType = ref("");
+watch(
+ () => formData[regionType.value],
+ (newValue, oldValue) => {
+ regionList.value = [];
+ regionList.value.push(newValue);
+ }
+);
+// 多选区域
+const handleCheckedCitiesChange = (value: string[]) => {
+ console.log(value);
+};
+
// 获取详情
const setFormData = async (data: Record) => {
console.log(formData);
@@ -883,6 +914,7 @@ function company_type_change(type: any) {
formData.street = "";
formData.village = "";
formData.brigade = "";
+ regionType.value = "area";
return true;
}
//镇
@@ -895,6 +927,7 @@ function company_type_change(type: any) {
formData.brigade = "";
partyDisabled.value = true;
indexType.value = 30;
+ regionType.value = "street";
return true;
}
if (type != 16) {
@@ -907,6 +940,7 @@ function company_type_change(type: any) {
isVillage.value = true;
isBrigade.value = false;
formData.brigade = "";
+ regionType.value = "village";
return true;
}
@@ -916,6 +950,7 @@ function company_type_change(type: any) {
isStreet.value = true;
isVillage.value = true;
isBrigade.value = true;
+ regionType.value = "brigade";
return true;
}
}
@@ -1030,7 +1065,6 @@ const getDetails = async () => {
// fileList.value[0].url = data.contract?.file
// fileList.value[0].name = '合同文件'
// }
- console.log(formData);
company_type_change(formData.company_type);
};
const clickdelete = (index) => {
@@ -1058,6 +1092,7 @@ const create = async () => {
data.qualification.other_qualifications = JSON.stringify(
data.qualification.other_qualifications
);
+ data[regionType.value] = regionList.value;
if (route.query.id) {
await apiCompanyEdit(data);
} else {