diff --git a/src/views/system/businessArea/index.vue b/src/views/system/businessArea/index.vue
index a27c20a..1cc41b8 100644
--- a/src/views/system/businessArea/index.vue
+++ b/src/views/system/businessArea/index.vue
@@ -3,23 +3,23 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
+
@@ -50,11 +50,11 @@
-
-
-
-
-
+
+
+
+
+
{{ parseTime(scope.row.createTime) }}
@@ -79,24 +79,24 @@
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
+
@@ -117,6 +117,7 @@
import { onMounted, ref } from 'vue';
import { Search } from '@element-plus/icons-vue'
import { busTradingAreaPage, addBusTradingArea, updateBusTradingArea, getBusTradingArea, deleteBusTradingArea } from "@/api/system/businessArea"
+import { sysRegionListByPid } from "@/api/system/administrativeRegion"
import { useBackgroundStore } from '@/store/modules/background'
import otherbg from '@/assets/images/otherbg.png'
const bgStore = useBackgroundStore()
@@ -135,6 +136,11 @@ const province = ref([])
const city = ref([])
const county = ref([])
const town = ref([])
+
+const province1 = ref([])
+const city1 = ref([])
+const county1 = ref([])
+const town1 = ref([])
const data = reactive({
form: {},
queryParams: {
@@ -163,13 +169,82 @@ const getbusinessAreaList = () => {
loading.value = true
busTradingAreaPage(queryParams.value).then(res => {
if (res.code == 200) {
- businessAreaList.value = res.list
- total.value = res.total
+ businessAreaList.value = res.data.list
+ total.value = res.data.total
loading.value = false
}
})
}
+
+// 获取省/直辖市数据
+const getProvinceList = () => {
+ sysRegionListByPid({ parentId: '0' }).then(res => {
+ province.value = res.data
+ })
+}
+
+// 获取地级市/区数据
+const getCityList = (value) => {
+ sysRegionListByPid({ parentId: value }).then(res => {
+ queryParams.value.cityId = undefined
+ queryParams.value.countyId = undefined
+ queryParams.value.townId = undefined
+ city.value = res.data
+ })
+}
+
+// 获取区/县数据
+const getCountyList = (value) => {
+ sysRegionListByPid({ parentId: value }).then(res => {
+ queryParams.value.countyId = undefined
+ queryParams.value.townId = undefined
+ county.value = res.data
+ })
+}
+
+// 获取镇数据
+const getTownList = (value) => {
+ sysRegionListByPid({ parentId: value }).then(res => {
+ queryParams.value.townId = undefined
+ town.value = res.data
+ })
+}
+
+// 获取省/直辖市数据
+const getProvinceList1 = () => {
+ sysRegionListByPid({ parentId: '0' }).then(res => {
+ province1.value = res.data
+ })
+}
+
+// 获取地级市/区数据
+const getCityList1 = (value) => {
+ sysRegionListByPid({ parentId: value }).then(res => {
+ form.value.cityId = undefined
+ form.value.countyId = undefined
+ form.value.townId = undefined
+ city1.value = res.data
+ })
+}
+
+// 获取区/县数据
+const getCountyList1 = (value) => {
+ sysRegionListByPid({ parentId: value }).then(res => {
+ form.value.countyId = undefined
+ form.value.townId = undefined
+ county1.value = res.data
+ })
+}
+
+// 获取镇数据
+const getTownList1 = (value) => {
+ sysRegionListByPid({ parentId: value }).then(res => {
+ form.value.townId = undefined
+ town1.value = res.data
+ })
+}
+
/** 表单重置 */
const reset = () => {
form.value = {
@@ -204,7 +279,8 @@ const resetQuery = () => {
/** 新增按钮操作 */
const handleAdd = () => {
- reset()
+ reset()
+ getProvinceList1()
open.value = true
title.value = "添加商圈"
}
@@ -212,6 +288,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = (row) => {
reset()
+ getProvinceList1()
getBusTradingArea(row.id).then(response => {
form.value = response.data
open.value = true
@@ -261,5 +338,6 @@ function handleDelete(row) {
onMounted(() => {
bgStore.setBgImage(otherbg)
getbusinessAreaList()
+ getProvinceList()
});
\ No newline at end of file