需求省市区

This commit is contained in:
cxc
2022-11-22 17:31:02 +08:00
parent 7dc27a03ea
commit 28808f6024
18 changed files with 452 additions and 95 deletions

View File

@ -111,7 +111,7 @@
</template>
<script setup>
// import { insertDemand } from "@/api/admin/enterprise";
import tab from "../../../../plugins/tab";
import tab from "@/plugins/tab";
import {
insertDemand,
getDemand,
@ -128,7 +128,7 @@ const route = useRoute();
const data = reactive({
form: {
check: [],
status: 1,
status: 0,
},
queryParams: {
pageNum: 1,
@ -173,21 +173,22 @@ const checkList = reactive([
},
]);
const checkInput = ref("");
const cityFormRef = ref();
// const cityFormRef = ref();
const formRef = ref();
const submitForm = () => {
formRef.value.validate(async (valid) => {
const cityFormValid = cityFormRef.value.validateForm(); // 城市
if (valid && cityFormValid) {
// const cityFormValid = cityFormRef.value.validateForm(); // 城市
if (valid) {
if (form.value.id != undefined) {
await updateDemand(form.value);
ElMessage.success("修改成功");
router.back();
// router.back();
} else {
await insertDemand(form.value);
ElMessage.success("新增服务需求成功");
router.back();
// router.back();
}
backToList();
}
});
};
@ -230,7 +231,7 @@ onMounted(() => {
} else {
form.value = {
check: [],
status: 1,
status: 0,
};
if (formRef.value) {
formRef.value.resetFields();