bugfix and performance improves

This commit is contained in:
quantulr
2023-08-04 17:27:34 +08:00
parent fec49d35bc
commit 2177189c34
8 changed files with 351 additions and 341 deletions

View File

@ -2,10 +2,10 @@
<template>
<el-dialog title="基本信息" :model-value="isShow" @close="close">
<el-form
ref="formRef"
:model="modelValue"
:label-width="labelWidth + 'px'"
disabled
ref="formRef"
:model="modelValue"
:label-width="labelWidth + 'px'"
disabled
>
<p><b>基本信息</b></p>
<el-row>
@ -22,10 +22,11 @@
<el-form-item label="需求类别:">
<el-checkbox-group v-model="modelValue.kinds">
<el-checkbox
v-for="item in checkList"
:key="item.id"
:label="item.name"
>{{ item.name }}</el-checkbox
v-for="item in checkList"
:key="item.id"
:label="item.name"
>{{ item.name }}
</el-checkbox
>
</el-checkbox-group>
</el-form-item>
@ -37,39 +38,39 @@
<el-form-item label="需求描述:" prop="introduce">
<!-- <Editor v-model="modelValue.add" :minHeight="150" /> -->
<WangEditor
v-model="modelValue.introduce"
width="100%"
min-height="150px"
readOnly
v-model="modelValue.introduce"
width="100%"
min-height="150px"
readOnly
></WangEditor>
</el-form-item>
</el-col>
</el-row>
<FieldOptions
v-model="modelValue"
:labelWidth="labelWidth"
disabled
ref="fieldFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
disabled
ref="fieldFormRef"
/>
<CityOptions
disabled
v-model="modelValue"
:labelWidth="labelWidth"
ref="cityFormRef"
disabled
v-model="modelValue"
:labelWidth="labelWidth"
ref="cityFormRef"
/>
<el-row>
<el-col :span="12">
<el-form-item
label="技术需求预算:"
:prop="modelValue.budgetMode == 1 ? 'budget' : ''"
label="技术需求预算:"
:prop="modelValue.budgetMode == 1 ? 'budget' : ''"
>
<el-input
v-model="modelValue.budget"
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"
placeholder="请输入技术需求预算"
v-model="modelValue.budget"
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"
placeholder="请输入技术需求预算"
>
<template #append>万元</template>
</el-input>
@ -78,10 +79,11 @@
<el-col :span="12">
<el-form-item label-width="50px">
<el-checkbox
false-label="1"
true-label="2"
v-model="modelValue.budgetMode"
>面议</el-checkbox
false-label="1"
true-label="2"
v-model="modelValue.budgetMode"
>面议
</el-checkbox
>
</el-form-item>
</el-col>
@ -91,11 +93,11 @@
<el-col :span="12">
<el-form-item label="截止时间:" prop="deadline">
<el-date-picker
style="width: 100%"
v-model="modelValue.deadline"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择截止时间"
style="width: 100%"
v-model="modelValue.deadline"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择截止时间"
>
</el-date-picker>
</el-form-item>
@ -106,16 +108,16 @@
<el-col :span="12">
<el-form-item label="需求联系人:" prop="name">
<el-input
v-model="modelValue.name"
placeholder="请输入需求联系人"
v-model="modelValue.name"
placeholder="请输入需求联系人"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人手机号:" prop="mobile">
<el-input
v-model="modelValue.mobile"
placeholder="请输入联系人手机号"
v-model="modelValue.mobile"
placeholder="请输入联系人手机号"
></el-input>
</el-form-item>
</el-col>
@ -143,13 +145,13 @@
<el-row>
<el-col :span="24">
<InputBoxAdd
:labelWidth="labelWidth"
v-model="modelValue"
title="想合作的单位及模式"
placeholder=""
disabled
fieldKey="wants"
ref="directionsFormRef"
:labelWidth="labelWidth"
v-model="modelValue"
title="想合作的单位及模式"
placeholder=""
disabled
fieldKey="wants"
ref="directionsFormRef"
/>
</el-col>
</el-row>
@ -161,15 +163,16 @@
</el-dialog>
</template>
<script setup>
import { updateTechnologyDemand } from "@/api/dataApproval/enterpriseTechnologyDemand";
import { demandCategoryList } from "@/utils/parameter";
import {demandCategoryList} from "@/utils/parameter";
import WangEditor from "@/components/WangEditor";
import CityOptions from "@/views/components/CityOptions";
import FieldOptions from "@/views/components/FieldOptions";
import InputBoxAdd from "@/views/components/InputBoxAdd";
import { ElMessage } from "element-plus";
import { ref, toRefs } from "vue";
import {ElMessage} from "element-plus";
import {toRefs} from "vue";
import useUserStore from "@/store/modules/user";
import {batchTechnologyDemand} from "@/api/dataApproval/enterpriseTechnologyDemand";
const userStore = useUserStore();
const emit = defineEmits(["update-list"]);
const props = defineProps({
@ -182,12 +185,13 @@ const props = defineProps({
required: true,
},
});
const { isShow, modelValue } = toRefs(props);
const {isShow, modelValue} = toRefs(props);
const labelWidth = 160;
const checkList = reactive(demandCategoryList);
const approve = async (status) => {
let title = status == 1 ? "通过" : "驳回";
await updateTechnologyDemand({ id: modelValue.value.id, status });
// await updateTechnologyDemand({ id: modelValue.value.id, status });
await batchTechnologyDemand(modelValue.value.id, status)
userStore.getUnApprovedTechnology();
ElMessage.success(`${title}需求`);
emit("update:isShow", false);