From 806061cbbc797741b1a99ec7c3df76f8ed85448e Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 21 Jul 2023 18:11:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/company/edit.vue | 145 ++++++++++++++++++++---------------- src/views/company/index.vue | 24 ++---- 2 files changed, 85 insertions(+), 84 deletions(-) diff --git a/src/views/company/edit.vue b/src/views/company/edit.vue index 7a3fabc..d3e2882 100644 --- a/src/views/company/edit.vue +++ b/src/views/company/edit.vue @@ -1,6 +1,5 @@ - 公司基本信息创建 @@ -181,18 +180,30 @@ > - - + + + + + + + 其他联系人 @@ -266,12 +277,11 @@ - + 电子合同 @@ -396,6 +404,7 @@ - 上传 + - + + + + @@ -475,6 +478,7 @@ import type { PropType } from 'vue' import useMultipleTabs from '@/hooks/useMultipleTabs' import useUserStore from '@/stores/modules/user' const userStore = useUserStore() + const { removeTab } = useMultipleTabs() const router = useRouter() const route = useRoute() @@ -492,10 +496,12 @@ const popupRef = shallowRef>() const mode = ref() isDisabled = route.query.read isEdit = route.query.edit - // 表单数据 const formData = reactive({ - man: '', + admin_id: '', + admin_name: '', + area_manager: '', + area_manager_name: '', id: '', // level_two: '', // level_one: '', @@ -511,7 +517,6 @@ const formData = reactive({ master_position: '', master_phone: '', master_email: '', - other_contacts: [ { name: '', @@ -534,7 +539,7 @@ const formData = reactive({ }, contract: { contract_type: '', - party_a: '', + party_a: 0, file: '', contract_no: '系统自动生成' }, @@ -543,6 +548,11 @@ const formData = reactive({ file_image: '' // status: '' }) + +if (userStore.userInfo.root == 0) { + formData.contract.party_a = userStore.userInfo.company?.id + formData.party_a_name = userStore.userInfo.company?.company_name +} const datas = reactive({ provinceOptions: [], cityOptions: [], @@ -551,6 +561,12 @@ const datas = reactive({ dictTypeLists: [], contract_type: [] }) +const fileList = ref([ + { + name: '', + url: '' + } +]) // 表单验证 const formRules = reactive({ company_name: [ @@ -612,6 +628,7 @@ const formRules = reactive({ }) const isCompany = ref(false) const isMan = ref(false) +const isAreaManager = ref(false) function customEvent(data: any) { isCompany.value = false @@ -620,9 +637,14 @@ function customEvent(data: any) { } function customEventMan(data: any) { isMan.value = false - console.log(data) - // formData.contract.party_a = data.id; - formData.man = data.name + formData.admin_name = data.name + formData.admin_id = data.id +} +//区域管理人员 +function EventAreaManager(data: any) { + isAreaManager.value = false + formData.area_manager_name = data.name + formData.area_manager = data.id } function openCompany() { isCompany.value = true @@ -647,55 +669,46 @@ const getDetail = async (row: Record) => { //上传图片1 const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => { + if (response.code == 0) { + ElMessage.error(response.msg) + return + } formData.qualification.business_license = response.data.uri } const handleAvatarSuccessB: UploadProps['onSuccess'] = (response, uploadFile) => { + if (response.code == 0) { + ElMessage.error(response.msg) + return + } formData.qualification.business_licenseB = response.data.uri } -const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => { - // if (rawFile.type !== 'image/jpeg') { - // ElMessage.error('Avatar picture must be JPG format!') - // return false - // } else if (rawFile.size / 1024 / 1024 > 2) { - // ElMessage.error('Avatar picture size can not exceed 2MB!') - // return false - // } - return true -} //上传图片2 const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => { + if (response.code == 0) { + ElMessage.error(response.msg) + return + } formData.qualification.bank_account = response.data.uri } const handleAvatarSuccess_twoB: UploadProps['onSuccess'] = (response, uploadFile) => { + if (response.code == 0) { + ElMessage.error(response.msg) + return + } formData.qualification.bank_accountB = response.data.uri } -const beforeAvatarUpload_two: UploadProps['beforeUpload'] = (rawFile) => { - // if (rawFile.type !== 'image/jpeg') { - // ElMessage.error('Avatar picture must be JPG format!') - // return false - // } else if (rawFile.size / 1024 / 1024 > 2) { - // ElMessage.error('Avatar picture size can not exceed 2MB!') - // return false - // } - return true -} //上传文件3 const handleAvatarSuccess_three: UploadProps['onSuccess'] = (response, uploadFile) => { + if (response.code == 0) { + ElMessage.error(response.msg) + return + } formData.file_image = response.data.uri formData.contract.file = response.data.uri + fileList.value[0].url = response.data.uri + fileList.value[0].name = '合同文件' } -const beforeAvatarUpload_three: UploadProps['beforeUpload'] = (rawFile) => { - // if (rawFile.type !== 'application/msword') { - // ElMessage.error('请选择word格式的文件!') - // return false - // } - // else if (rawFile.size / 1024 / 1024 > 2) { - // ElMessage.error('Avatar picture size can not exceed 2MB!') - // return false - // } - return true -} //增加其他联系人 function other() { formData.other_contacts.push({ @@ -762,6 +775,8 @@ const getDetails = async () => { }) formData['party_a_name'] = data['contract']['party_a_name'] formData['file_image'] = data['contract']['file'] + fileList.value[0].url = data['contract']['file'] + fileList.value[0].name = '合同文件' } getProvinceList() getdictTypeLists() diff --git a/src/views/company/index.vue b/src/views/company/index.vue index 3b763f4..224108f 100644 --- a/src/views/company/index.vue +++ b/src/views/company/index.vue @@ -67,14 +67,8 @@ - 下属公司 - + + 生成合同 Date: Fri, 21 Jul 2023 18:25:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/perms/admin.ts | 8 + src/views/company/index.vue | 33 +- src/views/company/subordinate.vue | 101 +- src/views/contract/contractDetil.vue | 109 +- src/views/permission/admin/edit.vue | 1488 ++++++++++++-------------- src/views/permission/admin/index.vue | 127 ++- 6 files changed, 896 insertions(+), 970 deletions(-) diff --git a/src/api/perms/admin.ts b/src/api/perms/admin.ts index 8b15305..6f82a55 100644 --- a/src/api/perms/admin.ts +++ b/src/api/perms/admin.ts @@ -27,3 +27,11 @@ export function adminDelete(params: any) { export function adminDetail(params: any) { return request.get({ url: '/auth.admin/detail', params }) } +// 生成合同 +export function generateGontract(params: any) { + return request.get({ url: '/auth.admin/Draftingcontracts', params }) +} +// 发送短信 +export function sendMsgApi(params: any) { + return request.get({ url: '/auth.admin/postsms', params }) +} diff --git a/src/views/company/index.vue b/src/views/company/index.vue index fb927a0..224108f 100644 --- a/src/views/company/index.vue +++ b/src/views/company/index.vue @@ -49,7 +49,7 @@ placeholder="请输入片区经理" /> - + 下属公司 - - 详情 - - - 下属公司 - import { usePaging } from '@/hooks/usePaging' import { useDictData } from '@/hooks/useDictOptions' -import { apiCompanyLists, apiCompanyDelete, generateGontract, sendMsgApi } from '@/api/company' +import { apiCompanyLists, apiCompanyDelete } from '@/api/company' +import { generateGontract, sendMsgApi } from '@/api/perms/admin' import { timeFormat } from '@/utils/util' import feedback from '@/utils/feedback' import { dictDataLists } from '@/api/setting/dict' diff --git a/src/views/company/subordinate.vue b/src/views/company/subordinate.vue index 8810870..77a03f2 100644 --- a/src/views/company/subordinate.vue +++ b/src/views/company/subordinate.vue @@ -16,38 +16,70 @@ - 查看成员 + 查看成员 - - 详情 + + 详情 - - 编辑 + + 编辑 - 删除 - 生成合同 - 发送短信 + 删除 + 生成合同 + 发送短信 @@ -66,7 +98,9 @@ 确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约 - 确认创建 + 确认创建 确认 返回 @@ -77,8 +111,8 @@ \ No newline at end of file diff --git a/src/views/permission/admin/edit.vue b/src/views/permission/admin/edit.vue index 3778252..0df978a 100644 --- a/src/views/permission/admin/edit.vue +++ b/src/views/permission/admin/edit.vue @@ -1,852 +1,774 @@ - - - - 基本信息创建 + + + + 基本信息创建 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 资质信息 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - + + + + + + - - - - 上传 - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 资质信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 上传 + + + + + + + + + diff --git a/src/views/permission/admin/index.vue b/src/views/permission/admin/index.vue index 6847507..6c8d6e8 100644 --- a/src/views/permission/admin/index.vue +++ b/src/views/permission/admin/index.vue @@ -56,13 +56,10 @@ @click="handleEdit(row)">编辑 删除 - 生成合同 发送短信 + @click="showPop = true, showConctactPop = true, contractId = row.id">生成个人合同 + 发送短信 @@ -75,12 +72,8 @@ 重要提醒 - - 请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送. - - - 确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约 - + 请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送. + 确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约 确认创建 确认 @@ -91,42 +84,47 @@
- 确认创建 + 确认创建 确认 返回
确认创建 确认 @@ -91,42 +84,47 @@