客户端产品匹配
This commit is contained in:
@ -109,13 +109,19 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { insertDemand } from "@/api/admin/enterprise";
|
||||
// import { insertDemand } from "@/api/admin/enterprise";
|
||||
import {
|
||||
insertDemand,
|
||||
getDemand,
|
||||
updateDemand,
|
||||
} from "@/api/admin/enterprise/demand";
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { onActivated } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const data = reactive({
|
||||
form: {
|
||||
check: [],
|
||||
@ -169,16 +175,14 @@ const submitForm = () => {
|
||||
formRef.value.validate(async (valid) => {
|
||||
const cityFormValid = cityFormRef.value.validateForm(); // 城市
|
||||
if (valid && cityFormValid) {
|
||||
console.log(form.value);
|
||||
if (form.value.id != undefined) {
|
||||
// updatePost(form.value).then((response) => {
|
||||
// proxy.$modal.msgSuccess("修改成功");
|
||||
// proxy.$router.go(-1);
|
||||
// });
|
||||
await updateDemand(form.value);
|
||||
ElMessage.success("修改成功");
|
||||
router.back();
|
||||
} else {
|
||||
await insertDemand(form.value);
|
||||
ElMessage.success("新增服务需求成功");
|
||||
router.go(-1);
|
||||
router.back();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -198,5 +202,11 @@ function addCheck() {
|
||||
}
|
||||
}
|
||||
|
||||
onActivated(() => {});
|
||||
onActivated(() => {
|
||||
if (route.query.id) {
|
||||
getDemand({ id: route.query.id }).then((resp) => {
|
||||
form.value = resp.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user