update
This commit is contained in:
parent
9270206010
commit
733e2900e2
@ -3,20 +3,9 @@
|
|||||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
|
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
|
||||||
@close="handleClose">
|
@close="handleClose">
|
||||||
<el-form ref="formRef" :model="formData" label-width="140px" :rules="formRules">
|
<el-form ref="formRef" :model="formData" label-width="140px" :rules="formRules">
|
||||||
<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-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="客户" prop="custom_id" @click="showDialog = true"
|
<el-form-item label="客户名称" prop="custom_id" @click="showDialog = true"
|
||||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
<el-input v-model="custom_name" readonly clearable placeholder="请选择客户"
|
<el-input v-model="custom_name" readonly clearable placeholder="请选择客户"
|
||||||
:disabled="project" />
|
:disabled="project" />
|
||||||
@ -262,8 +251,6 @@ const list1 = reactive([])
|
|||||||
const list2 = reactive([])
|
const list2 = reactive([])
|
||||||
const paymentList = reactive([{}])
|
const paymentList = reactive([{}])
|
||||||
const personnel = ref<any>()
|
const personnel = ref<any>()
|
||||||
import { deptAll } from '@/api/org/department'
|
|
||||||
import { getAll } from '@/api/org/organization'
|
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
//验证
|
//验证
|
||||||
@ -318,8 +305,6 @@ const delFileFn = (index: number) => {
|
|||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
dept_id: '',
|
|
||||||
org_id: '',
|
|
||||||
approve_id: 1,
|
approve_id: 1,
|
||||||
custom_id: '',
|
custom_id: '',
|
||||||
buy_bidding_document_id: '',
|
buy_bidding_document_id: '',
|
||||||
@ -414,34 +399,7 @@ const amountinput = (e) => {
|
|||||||
amount_daxie.value = toChinesNum(e)
|
amount_daxie.value = toChinesNum(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//获取所有组织
|
|
||||||
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 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 popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == 'edit' ? '编辑项目合同' : '新增项目合同'
|
return mode.value == 'edit' ? '编辑项目合同' : '新增项目合同'
|
||||||
@ -469,12 +427,6 @@ const setFormData = async (data: Record<any, any>) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (data.dept_id) {
|
|
||||||
getlist1(data.org_id)
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
@ -533,7 +485,6 @@ const handleSubmit = async () => {
|
|||||||
const open = (type = 'add') => {
|
const open = (type = 'add') => {
|
||||||
mode.value = type
|
mode.value = type
|
||||||
popupRef.value?.open()
|
popupRef.value?.open()
|
||||||
getlist()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭回调
|
// 关闭回调
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-card class="!border-none mb-4" shadow="never">
|
<el-card class="!border-none mb-4" shadow="never">
|
||||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||||
|
<el-form-item label="所属项目" prop="project_id">
|
||||||
|
<selectRemote :formData="queryParams" model="project_id" :api="apiProjectSearch" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户名称" prop="custom_id">
|
||||||
|
<selectRemote :formData="queryParams" model="custom_id" :api="apiCustomSearch" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="合同名称" prop="contract_name">
|
<el-form-item label="合同名称" prop="contract_name">
|
||||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -103,7 +109,8 @@
|
|||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import { useDictData } from '@/hooks/useDictOptions'
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
import { apiContractLists, apiContractDelete, apiContractDetail } from '@/api/contract'
|
import { apiContractLists, apiContractDelete, apiContractDetail } from '@/api/contract'
|
||||||
import { timeFormat } from '@/utils/util'
|
import { apiProjectSearch } from '@/api/project'
|
||||||
|
import { apiCustomSearch } from '@/api/custom'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
import EditPopup from './edit.vue'
|
import EditPopup from './edit.vue'
|
||||||
import DetailPopup from './detail.vue'
|
import DetailPopup from './detail.vue'
|
||||||
@ -117,6 +124,8 @@ const showDtail = ref(false)
|
|||||||
|
|
||||||
// 查询条件
|
// 查询条件
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
|
project_id: '',
|
||||||
|
custom_id: '',
|
||||||
contract_name: '',
|
contract_name: '',
|
||||||
contract_type: ''
|
contract_type: ''
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user