diff --git a/src/api/company.ts b/src/api/company.ts index ca99e62..89b5e75 100644 --- a/src/api/company.ts +++ b/src/api/company.ts @@ -44,3 +44,8 @@ export function generateGontract(params: any) { export function authentication(params: any) { return request.get({ url: '/company/authentication', params }) } + +// 平台公司 +export function companyListTwo(params: any) { + return request.get({ url: '/company/list_two', params }) +} \ No newline at end of file diff --git a/src/views/company/dialog_index.vue b/src/views/company/dialog_index.vue index 9af4cf7..84b1fbf 100644 --- a/src/views/company/dialog_index.vue +++ b/src/views/company/dialog_index.vue @@ -1,91 +1,101 @@ diff --git a/src/views/company/edit.vue b/src/views/company/edit.vue index 8f2b11a..377d352 100644 --- a/src/views/company/edit.vue +++ b/src/views/company/edit.vue @@ -422,8 +422,23 @@ placeholder="请选择签约方" clearable :style="{ width: '100%' }" - :disabled="true" + :disabled="!partyDisabled || isDisabled" + @click="openCompany" > + @@ -493,10 +508,10 @@ 修改完成 - + @@ -551,6 +566,9 @@ if (route.query.isshow) { imgflag = false isDisabled = true } +console.log(isDisabled) +// 公司类型 +const indexType = ref(0) let isEdit = ref(false) defineProps({ @@ -627,7 +645,8 @@ const datas = reactive({ villageOptions: [], brigadeOptions: [], dictTypeLists: [], - contract_type: [] + contract_type: [], + company_list: [] }) const fileList = ref([]) // 表单验证 @@ -689,6 +708,7 @@ const isArea = ref(false) const isStreet = ref(false) const isVillage = ref(false) const isBrigade = ref(false) +const partyDisabled = ref(true) function customEvent(data: any) { isCompany.value = false @@ -801,8 +821,13 @@ function company_type_change(type: any) { isBrigade.value = false formData.village = '' formData.brigade = '' + partyDisabled.value = true + indexType.value = 30 return true } + if (type != 16) { + partyDisabled.value = false + } //村 if (type == 17) { isArea.value = true @@ -880,6 +905,10 @@ const getDetails = async () => { const data = await apiCompanyDetail({ id: route.query.id }) + if (data.company_type == 16) { + indexType.value = 30 + partyDisabled.value = true + } Object.keys(formData).forEach((key) => { const stringArr = ['province', 'city', 'area', 'street', 'village', 'brigade'] if (data[key] != null && data[key] != undefined) { diff --git a/src/views/company/index.vue b/src/views/company/index.vue index 745ba34..27a9d64 100644 --- a/src/views/company/index.vue +++ b/src/views/company/index.vue @@ -83,18 +83,18 @@ 创建 -     - - 我的公司 +
@@ -161,7 +161,7 @@ edit: true } }" - >编辑合同签约 生成合同

重要提醒

-
请确认信息是否有误
+
+
请确认信息是否有误
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

确认创建 - 返回 + 返回

@@ -246,16 +319,19 @@ import { useDictData } from '@/hooks/useDictOptions' import useUserStore from '@/stores/modules/user' import { apiCompanyLists, + companyListTwo, apiCompanyDelete, generateGontract, sendMsgApi, authentication, + apiCompanyDetail, initiate_contract } from '@/api/company' import { timeFormat } from '@/utils/util' import feedback from '@/utils/feedback' import { dictDataLists } from '@/api/setting/dict' import { getRoutePath } from '@/router' +import DialogIndex from './dialog_index.vue' const userStore = useUserStore() console.log(userStore.userInfo.company_id) @@ -272,22 +348,64 @@ const offPop = () => { const InitiateContractPop = ref(false) const showInitiateContractPop = ref(false) const offInitiateContractPop = () => { - showPop.value = false - showConctactPop.value = false + showInitiateContractPop.value = false + InitiateContractPop.value = false } // 创建合同的id const contractId = ref('') -const ShowInitiateContractPop = (row) => { - ;(InitiateContractPop.value = true), - (showInitiateContractPop.value = true), - (contractId.value = row.id) +// 合同 +const contractFormData = ref({ + party_a: '', + party_a_name: '', + party_b: '', + party_b_name: '', + contract_type: '', + contract_no: '' +}) + +const company_list = ref([]) +const contract_type = ref([]) + +const getDetails = async (id: any) => { + const data = await apiCompanyDetail({ + id: id + }) + companyListTwo().then((res) => { + company_list.value = res + }) + dictDataLists({ type_id: 7 }).then((res) => { + contract_type.value = res.lists + }) + contractFormData.value.party_b = data.id + contractFormData.value.party_b_name = data.company_name + if (userStore.userInfo.company.id) { + contractFormData.value.party_a = userStore.userInfo.company.id + contractFormData.value.party_a_name = userStore.userInfo.company.company_name + } else { + contractFormData.value.party_a = '' + contractFormData.value.party_a_name = '' + } +} + +const showChangeCompany = (row: any) => { + contractId.value = row.id + getDetails(row.id) + // showPop.value = true + ShowInitiateContractPop() +} + +const ShowInitiateContractPop = () => { + ;(InitiateContractPop.value = true), (showInitiateContractPop.value = true) } const showCreateConctPop = (row) => { ;(showPop.value = true), (showConctactPop.value = true), (contractId.value = row.id) } const InitiateContract = () => { - initiate_contract({ id: contractId.value }).catch((res) => { + initiate_contract({ + id: contractId.value, + ...contractFormData.value + }).catch((res) => { console.log(res) }) offInitiateContractPop() diff --git a/src/views/task/taskCalendar.vue b/src/views/task/taskCalendar.vue index 928e133..a3d493a 100644 --- a/src/views/task/taskCalendar.vue +++ b/src/views/task/taskCalendar.vue @@ -70,10 +70,6 @@ watch( ); // apiTaskList() -const test = (e: any) => { - console.log(e); -}; - // 加载 const loading = ref(true); @@ -126,7 +122,7 @@ const initShowDate = (dateStr = "") => { initShowDate(); // 获取字典数据 -const { dictData } = useDictData(""); +// const { dictData } = useDictData(""); // 添加 const handleAdd = async () => {