This commit is contained in:
weiz 2024-03-20 10:22:32 +08:00
parent d6b518a538
commit b52e733bdf
8 changed files with 1 additions and 245 deletions

View File

@ -2,12 +2,7 @@
<div class="detail-popup">
<popup ref="popupRef" title="竞争对手详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px">
<el-descriptions :column="2" border>
<el-descriptions-item label="组织名称" label-align="left" align="left" label-class-name="my-label">{{
formData.org_name }}</el-descriptions-item>
<el-descriptions-item label="部门名称" label-align="left" align="left" label-class-name="my-label">{{
formData.dept_name }}</el-descriptions-item>
<el-descriptions-item label="客户名称" label-align="left" align="left" label-class-name="my-label">{{
formData.custom_name }}</el-descriptions-item>
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label"> {{
@ -91,7 +86,6 @@
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
@ -103,11 +97,6 @@ const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//
@ -151,11 +140,6 @@ const handleClose = () => {
defineExpose({
open,
setFormData,

View File

@ -3,19 +3,6 @@
<popup ref="popupRef" :title="popupTitle" :async="true" width="650px" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-form-item label="组织" prop="org_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-select class="flex-1" v-model="formData.org_id" clearable placeholder="请选择组织"
@change="area_change">
<el-option v-for="(item, index) in orglist" :key="index" :label="item.name"
:value="parseInt(item.id)" />
</el-select>
</el-form-item>
<el-form-item label="部门" prop="dept_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-select class="flex-1" v-model="formData.dept_id" clearable placeholder="请选择部门">
<el-option v-for="(item, index) in jobs" :key="index" :label="item.name"
:value="parseInt(item.id)" />
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-input v-model="project_name" clearable readonly placeholder="请输入项目名称" :disabled="project" />
@ -90,17 +77,9 @@
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCompetitorAdd, apiCompetitorEdit, apiCompetitorDetail } from '@/api/competitor'
import { timeFormat } from '@/utils/util'
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
import projectTable from "@/components/project/index.vue"
import customerdemand from "@/components/customerdemand/index.vue"
import type { PropType } from 'vue'
let props = defineProps({
// dictData: {
// type: Object as PropType<Record<string, any[]>>,
// default: () => ({})
// }
project: Object
})
const emit = defineEmits(['success', 'close'])
@ -147,8 +126,6 @@ const delFileFn = (index: number) => {
//
const formData = reactive({
id: '',
org_id: '',
dept_id: '',
project_id: '',
customer_demand_id: '',
competitor_name: '',
@ -182,22 +159,7 @@ const customEvent1 = (e: any) => {
showDialog1.value = false;
};
const getlista = () => {
getAll().then((res) => {
// orglist = res.data
Object.assign(orglist, res)
})
}
const area_change = (e: any) => {
formData.org_id = e
let data = { 'org_id': e }
deptAll(data).then((res) => {
Object.assign(jobs, res)
})
}
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑竞争对手' : '新增竞争对手'
@ -229,9 +191,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
deptAll({ 'org_id': data.org_id }).then((res) => {
Object.assign(jobs, res)
})
if (data.annex && data.annex.length > 0) {
const arry1 = data.annex.map((item: any, index: any) => {
return {
@ -289,8 +248,6 @@ const handleClose = () => {
emit('close')
}
getlista()
defineExpose({
open,
setFormData,

View File

@ -4,10 +4,6 @@
<el-descriptions :column="2" border>
<el-descriptions-item label="组织名称" label-align="left" align="left" label-class-name="my-label">{{
formData.org_name }}</el-descriptions-item>
<el-descriptions-item label="部门名称" label-align="left" align="left" label-class-name="my-label">{{
formData.dept_name }}</el-descriptions-item>
<el-descriptions-item label="客户名称" label-align="left" align="left" label-class-name="my-label">{{
formData.custom_name }}</el-descriptions-item>
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label"> {{
@ -25,11 +21,7 @@
}}</el-descriptions-item>
<el-descriptions-item label="方案内容" label-align="left" align="left" label-class-name="my-label"> {{
formData.solution_content
}}</el-descriptions-item>
<el-descriptions-item label="添加人" label-align="left" align="left" label-class-name="my-label"> {{
formData.add_user_name
@ -39,17 +31,10 @@
}}</el-descriptions-item>
<el-descriptions-item label="更新人" label-align="left" align="left" label-class-name="my-label"> {{
formData.update_user_name
}}</el-descriptions-item>
<el-descriptions-item label="更新日期" label-align="left" align="left" label-class-name="my-label"> {{
formData.update_time
}}</el-descriptions-item>
<el-descriptions-item label="附件" label-align="left" align="left" label-class-name="my-label">
<div v-if="formData.annex?.length > 0">
<div v-for="(item, index) in formData.annex" style="margin-left: 5px;display: block;">
@ -73,7 +58,6 @@
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
@ -91,20 +75,14 @@ const datas = reactive({
areaOptions: [],
});
//
const formData = reactive({
})
//
const setFormData = async (data: Record<any, any>) => {
Object.assign(formData, data)
}
const getDetail = async (row: Record<string, any>) => {
@ -114,7 +92,6 @@ const getDetail = async (row: Record<string, any>) => {
setFormData(data)
}
//
const handleSubmit = async () => {
popupRef.value?.close()
@ -131,13 +108,6 @@ const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,

View File

@ -3,19 +3,6 @@
<popup ref="popupRef" :title="popupTitle" :async="true" width="650px" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-form-item label="组织" prop="org_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-select class="flex-1" v-model="formData.org_id" clearable placeholder="请选择组织"
@change="area_change">
<el-option v-for="(item, index) in orglist" :key="index" :label="item.name"
:value="parseInt(item.id)" />
</el-select>
</el-form-item>
<el-form-item label="部门" prop="dept_id" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-select class="flex-1" v-model="formData.dept_id" clearable placeholder="请选择部门">
<el-option v-for="(item, index) in jobs" :key="index" :label="item.name"
:value="parseInt(item.id)" />
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-input v-model="project_name" readonly clearable placeholder="请输入项目名称" :disabled="project" />
@ -69,8 +56,6 @@
<script lang="ts" setup name="customerDemandSolutionEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
import projectTable from "@/components/project/index.vue"
import customerdemand from "@/components/customerdemand/index.vue"
import { apiCustomerDemandSolutionAdd, apiCustomerDemandSolutionEdit, apiCustomerDemandSolutionDetail } from '@/api/customer_demand_solution'
@ -80,8 +65,6 @@ import type { PropType } from 'vue'
//
const formData = reactive({
id: '',
org_id: '',
dept_id: '',
project_id: '',
customer_demand_id: '',
theme: '',
@ -137,22 +120,6 @@ const customEvent1 = (e: any) => {
showDialog1.value = false;
};
const getlista = () => {
getAll().then((res) => {
// orglist = res.data
Object.assign(orglist, res)
})
}
const area_change = (e: any) => {
formData.org_id = e
let data = { 'org_id': e }
deptAll(data).then((res) => {
Object.assign(jobs, res)
})
}
//
const popupTitle = computed(() => {
@ -169,9 +136,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
deptAll({ 'org_id': data.org_id }).then((res) => {
Object.assign(jobs, res)
})
if (data.annex && data.annex.length > 0) {
const arry1 = data.annex.map((item: any, index: any) => {
return {
@ -229,8 +193,6 @@ const handleClose = () => {
emit('close')
}
getlista()
defineExpose({
open,
setFormData,

View File

@ -2,10 +2,6 @@
<div class="detail-popup">
<popup ref="popupRef" title="项目概算详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-descriptions :column="2" border>
<el-descriptions-item label="组织名称" label-align="left" align="left" label-class-name="my-label">{{
formData.org_name }}</el-descriptions-item>
<el-descriptions-item label="部门名称" label-align="left" align="left" label-class-name="my-label">{{
formData.dept_name }}</el-descriptions-item>
<el-descriptions-item label="客户名称" label-align="left" align="left" label-class-name="my-label">{{
formData.custom_name }}</el-descriptions-item>
<el-descriptions-item label="项目名称" label-align="left" align="left" label-class-name="my-label"> {{
@ -93,10 +89,8 @@
<script lang="ts" setup name="customdetail">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCustomDetail } from '@/api/custom'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
@ -105,14 +99,7 @@ defineProps({
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formDataannex = reactive([])
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
});
//

View File

@ -5,22 +5,6 @@
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
<el-row>
<el-col :span="12">
<el-form-item label="组织" prop="org_id"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-select class="flex-1" readonly v-model="formData.org_id" clearable placeholder="请选择组织"
@change="area_change">
<el-option v-for="(item, index) in orglist" :key="index" :label="item.name"
:value="parseInt(item.id)" />
</el-select>
</el-form-item> </el-col><el-col :span="12">
<el-form-item label="部门" readonly prop="dept_id"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-select class="flex-1" v-model="formData.dept_id" clearable placeholder="请选择部门"
@change="area_change1">
<el-option v-for="(item, index) in jobs" :key="index" :label="item.name"
:value="parseInt(item.id)" />
</el-select>
</el-form-item></el-col><el-col :span="12">
<el-form-item label="项目名称" prop="project_id" @click="showDialog = true"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-input v-model="project_name" readonly clearable placeholder="请输入项目名称"
@ -127,8 +111,6 @@
<script lang="ts" setup name="projectEstimateEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
import projectTable from "@/components/project/index.vue"
import contactsTable from "@/components/contacts/index.vue"
import { useDictData } from '@/hooks/useDictOptions'
@ -184,8 +166,6 @@ const delFileFn = (index: number) => {
//
const formData = reactive({
id: '',
org_id: '',
dept_id: '',
project_id: '',
customer_demand_id: '',
estimate_source: '',
@ -229,30 +209,6 @@ const customEvent2 = (e: any) => {
contact_phone.value = e.phone
showDialog2.value = false;
};
const getlista = () => {
getAll().then((res) => {
// orglist = res.data
Object.assign(orglist, res)
})
}
const area_change = (e: any) => {
formData.org_id = e
let data = { 'org_id': e }
deptAll(data).then((res) => {
Object.assign(jobs, res)
})
}
const area_change1 = (e: any) => {
formData.dept_id = e
let data = { 'dept_id': e }
getAdminsByDept(data).then((res) => {
Object.assign(jlist, res)
})
}
//
const demandclck = () => {
@ -289,10 +245,6 @@ const formRules = reactive<any>({
//
const setFormData = async (data: Record<any, any>) => {
deptAll({ 'org_id': data.org_id }).then((res) => {
Object.assign(jobs, res)
})
contact_name.value = data.contact_name
contact_phone.value = data.contact_phone
project_name.value = data.project_name
@ -351,8 +303,6 @@ const handleClose = () => {
emit('close')
}
getlista()
defineExpose({
open,
setFormData,

View File

@ -61,7 +61,6 @@
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
<el-table-column label="客户名称" prop="custom_name" show-overflow-tooltip />
<el-table-column label="需求" prop="customer_demand_name" show-overflow-tooltip />
<el-table-column label="概算来源" prop="estimate_source">
<template #default="{ row }">

View File

@ -3,20 +3,9 @@
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules" inline>
<div
style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
</el-select>
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织"
@change="deptrmt">
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
</el-select>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="客户" prop="custom_id"
<el-form-item label="客户名称" prop="custom_id"
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-input v-model="customer_name" clearable placeholder="点击选择客户" readonly
@click="showDialog = true" />
@ -128,7 +117,6 @@
<el-table :data="tableData">
<el-table-column label="序号">
<template #default="{ row }">
<!-- <el-button @click="handleAdd(row)" size="small">+</el-button> -->
<el-button @click="handleDelete(row)" size="small">-</el-button>
</template>
</el-table-column>
@ -204,9 +192,6 @@
</el-table-column>
</el-table>
</div>
<!-- <div>
<reviewprocess></reviewprocess>
</div> -->
</el-form>
</popup>
@ -225,14 +210,10 @@
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiQuotationAdd, apiQuotationEdit, apiQuotationDetail } from '@/api/quotation'
import { timeFormat, convertToChinese } from '@/utils/util'
import { toChinesNum } from "@/utils/util";
import customDialog1 from '@/components/product/index.vue'
import reviewprocess from '@/components/reviewprocess/index.vue'
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
import type { PropType } from 'vue'
import { computed, watch } from "vue"
@ -281,22 +262,6 @@ const delFileFn = (index: number) => {
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑报价单' : '新增报价单'
})
//
const getlist = () => {
getAll().then((res) => {
Object.assign(list1, res)
if (res.length > 0 && !formData.org_id) {
formData.org_id = res[0].id
deptAll({ 'org_id': res[0].id }).then((res) => {
if (res.length > 0) {
Object.assign(list2, res)
formData.dept_id = res[0].id
}
})
}
})
}
//
const amountinput = (e) => {
if (e && e > 0) {
@ -309,23 +274,9 @@ const amountinput1 = (e) => {
}
}
//
const deptrmt = (e: any) => {
formData.dept_id = ''
getlist1(e)
}
//
const getlist1 = (id: any) => {
deptAll({ 'org_id': id }).then((res) => {
list2.splice(0, list2.length, ...res)
})
}
//
const formData = reactive({
id: '',
dept_id: '',
org_id: '',
approve_id: 1,
custom_id: '',
quotation_date: '',
@ -398,9 +349,6 @@ const setFormData = async (data: Record<any, any>) => {
});
Object.assign(formDataannex, arry1)
}
if (data.dept_id) {
getlist1(data.org_id)
}
if (data.total_amount && data.total_amount > 0) {
amountinput1(data.total_amount)
}
@ -464,7 +412,6 @@ const handleSubmit = async () => {
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
getlist()
}
//