fixed
This commit is contained in:
@ -42,7 +42,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="text">
|
||||
<b style="color: #000">总订单金额:¥2044</b>
|
||||
@ -52,7 +52,7 @@
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column label="订单号" align="center" prop="orderNumber" />
|
||||
|
@ -81,7 +81,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="需求提交人:" prop="commitUserName">
|
||||
@ -99,7 +99,7 @@
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="$router.go(-1)">取消</el-button>
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<!-- <el-checkbox label="0" @change="handleCheck">其他</el-checkbox> -->
|
||||
<el-form-item label="需求类别:">
|
||||
<el-checkbox-group v-model="form.kinds">
|
||||
<el-checkbox
|
||||
@ -27,7 +28,6 @@
|
||||
:label="item.name"
|
||||
>{{ item.name }}</el-checkbox
|
||||
>
|
||||
<!-- <el-checkbox label="0" @change="handleCheck">其他</el-checkbox> -->
|
||||
</el-checkbox-group>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
@ -129,7 +129,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="需求提交人:" prop="commitUserName">
|
||||
<el-input
|
||||
@ -146,7 +146,7 @@
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@ -170,13 +170,19 @@
|
||||
</template>
|
||||
<script setup>
|
||||
// import { expert } from "@/api/identity/index";
|
||||
import { insertTechnologyDemand } from "@/api/admin/enterprise";
|
||||
// import { insertTechnologyDemand } from "@/api/admin/enterprise";
|
||||
import CityOptions from "@/views/components/CityOptions";
|
||||
import FieldOptions from "@/views/components/FieldOptions";
|
||||
import InputBoxAdd from "@/views/components/InputBoxAdd";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import {
|
||||
getTechnologyDemand,
|
||||
updateTechnologyDemand,
|
||||
insertTechnologyDemand,
|
||||
} from "@/api/admin/enterprise/demand";
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const data = reactive({
|
||||
form: {
|
||||
check: [],
|
||||
@ -241,7 +247,6 @@ const fieldFormRef = ref(null);
|
||||
const directionsFormRef = ref(null);
|
||||
const checkInput = ref("");
|
||||
const submitForm = async () => {
|
||||
// await formRef.value.validate();
|
||||
let formValid;
|
||||
try {
|
||||
formValid = await formRef.value.validate();
|
||||
@ -251,8 +256,13 @@ const submitForm = async () => {
|
||||
const fieldFormValid = await fieldFormRef.value.validateForm();
|
||||
const directionsFormValid = await directionsFormRef.value.validateForm();
|
||||
if (formValid && fieldFormValid && directionsFormValid) {
|
||||
await insertTechnologyDemand(form.value);
|
||||
ElMessage.success("新增企业需求成功");
|
||||
if (route.query.id) {
|
||||
await updateTechnologyDemand(form.value);
|
||||
ElMessage.success("修改企业需求成功");
|
||||
} else {
|
||||
await insertTechnologyDemand(form.value);
|
||||
ElMessage.success("新增企业需求成功");
|
||||
}
|
||||
router.go(-1);
|
||||
} else {
|
||||
console.log("校验未通过");
|
||||
@ -293,4 +303,16 @@ function addCheck() {
|
||||
checkInput.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (route.query.id) {
|
||||
getTechnologyDemand({ id: route.query.id }).then((resp) => {
|
||||
form.value = resp.data;
|
||||
if (!form.value.kinds) {
|
||||
form.value.kinds = resp.data.kind?.split(",") ?? [];
|
||||
}
|
||||
if (!form.value.wants) {
|
||||
form.value.wants = resp.data.want?.split(",") ?? [];
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<el-table v-loading="loading" :data="dataList" style="margin-top: 20px">
|
||||
<el-table-column label="需求名称" align="center" prop="title" />
|
||||
<el-table-column label="需求类别" align="center" prop="kind" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<!-- <el-table-column label="状态" align="center" prop="status" /> -->
|
||||
<el-table-column label="联系人" align="center" prop="name" />
|
||||
<el-table-column label="手机号" align="center" prop="mobile" />
|
||||
<el-table-column
|
||||
@ -163,7 +163,7 @@ function handleDelete(id) {
|
||||
.catch(() => {});
|
||||
}
|
||||
function handleEdit(id) {
|
||||
router.push({ path: "./release", query: { id } });
|
||||
router.push({ path: "./releaseService", query: { id } });
|
||||
}
|
||||
getList();
|
||||
onActivated(() => {
|
||||
|
@ -53,7 +53,7 @@
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<router-link
|
||||
:to="{ path: './released', query: { id: row.id } }"
|
||||
:to="{ path: './releaseTechnology', query: { id: row.id } }"
|
||||
v-if="queryParams.status == 0"
|
||||
>
|
||||
<el-button size="small" type="text" icon="Edit">编辑</el-button>
|
||||
@ -64,7 +64,7 @@
|
||||
size="small"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
@ -72,7 +72,7 @@
|
||||
size="small"
|
||||
type="text"
|
||||
icon="View"
|
||||
@click="handleResults(scope.row.id)"
|
||||
@click="handleResults(row.id)"
|
||||
>查看匹配结果</el-button
|
||||
>
|
||||
<el-button
|
||||
@ -97,7 +97,10 @@
|
||||
</template>
|
||||
|
||||
<script setup name="technologyDemand">
|
||||
import { technologyDemandList } from "@/api/admin/enterprise";
|
||||
import {
|
||||
technologyDemandList,
|
||||
deleteTechnologyDemand,
|
||||
} from "@/api/admin/enterprise/demand";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
@ -167,13 +170,16 @@ function handleQuery() {
|
||||
function handleDelete(id) {
|
||||
ElMessageBox.confirm('是否确认删除数据编号为"' + id + '"的需求项?')
|
||||
.then(function () {
|
||||
return achievementDelete({ id });
|
||||
console.log("delete");
|
||||
return deleteTechnologyDemand(id);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
ElMessage.success("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
function handleShelf(row) {
|
||||
let text = row.shelf_status == 2 ? "上架" : "下架";
|
||||
|
@ -42,9 +42,9 @@
|
||||
v-if="queryParams.status == 1"
|
||||
size="small"
|
||||
type="text"
|
||||
icon="Download"
|
||||
:icon="row.shelfStatus == 2 ? 'Upload' : 'Download'"
|
||||
@click="handleShelf(row)"
|
||||
>下架</el-button
|
||||
>{{ row.shelfStatus == 2 ? "上架" : "下架" }}</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="queryParams.status != 1"
|
||||
@ -75,6 +75,7 @@
|
||||
size="small"
|
||||
type="text"
|
||||
icon="Close"
|
||||
@click="releaseCancel(row.id)"
|
||||
>取消发布</el-button
|
||||
>
|
||||
</template>
|
||||
@ -92,8 +93,13 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Product">
|
||||
import { getEnterpriseProduct } from "@/api/admin/enterprise";
|
||||
import {
|
||||
getEnterpriseProduct,
|
||||
deleteEnterpriseProduct,
|
||||
updateEnterpriseProduct,
|
||||
} from "@/api/admin/enterprise/product";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { onActivated } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
@ -127,9 +133,9 @@ const getList = async () => {
|
||||
const handleDelete = (id) => {
|
||||
ElMessageBox.confirm('是否确认删除数据编号为"' + id + '"的产品项?')
|
||||
.then(async () => {
|
||||
// delete product
|
||||
//await deleteProduct(id);
|
||||
// ElMessage.success("删除成功");
|
||||
await deleteEnterpriseProduct(id);
|
||||
ElMessage.success("删除成功");
|
||||
getList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("已取消");
|
||||
@ -141,14 +147,25 @@ function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
// 取消发布
|
||||
const releaseCancel = (id) => {
|
||||
ElMessageBox.confirm('确认要取消发布id为"' + id + '"的产品吗?')
|
||||
.then(async () => {
|
||||
await updateEnterpriseProduct({ id, status: 3 });
|
||||
ElMessage.success("取消发布成功");
|
||||
getList();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
// 下架和上架
|
||||
const handleShelf = (row) => {
|
||||
let text = row.shelf_status == 2 ? "上架" : "下架";
|
||||
let text = row.shelfStatus == 2 ? "上架" : "下架";
|
||||
ElMessageBox.confirm('确认要"' + text + '""' + row.id + '"的产品吗?')
|
||||
.then(function () {
|
||||
let status = row.shelf_status == 1 ? 2 : 1;
|
||||
// return achievementShelf({ id: row.id, status });
|
||||
let status = row.shelfStatus == 1 ? 2 : 1;
|
||||
return updateEnterpriseProduct({ id: row.id, shelfStatus: status });
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
@ -162,5 +179,8 @@ const handleResults = (id) => {
|
||||
const checkEnterpriseInfo = (id) => {
|
||||
router.push({ path: "./business" });
|
||||
};
|
||||
getList();
|
||||
|
||||
onActivated(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
@ -18,7 +18,11 @@
|
||||
import ReleaseForm from "@/views/components/ReleaseForm";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { getProductById, insertEnterpriseProduct } from "@/api/admin/enterprise";
|
||||
import {
|
||||
getProductById,
|
||||
insertEnterpriseProduct,
|
||||
updateEnterpriseProduct,
|
||||
} from "@/api/admin/enterprise/product";
|
||||
import { reactive, toRefs } from "vue";
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@ -34,8 +38,13 @@ const submitForm = async (is_submit) => {
|
||||
console.log(await releaseFormRef.value.validateForm());
|
||||
const isValid = await releaseFormRef.value.validateForm();
|
||||
if (isValid) {
|
||||
await insertEnterpriseProduct(form.value);
|
||||
ElMessage.success("新增产品成功");
|
||||
if (route.query.id) {
|
||||
await updateEnterpriseProduct(form.value);
|
||||
ElMessage.success("修改产品成功");
|
||||
} else {
|
||||
await insertEnterpriseProduct(form.value);
|
||||
ElMessage.success("新增产品成功");
|
||||
}
|
||||
router.go(-1);
|
||||
} else {
|
||||
console.log("验证未通过");
|
||||
|
Reference in New Issue
Block a user