更新文件

This commit is contained in:
shengchanzhe 2023-07-16 22:44:02 +08:00
parent 09f21041d9
commit 1f80c08c4f
4 changed files with 488 additions and 156 deletions

@ -0,0 +1,93 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="公司名称" prop="company_name">
<el-input
class="w-[280px]"
v-model="queryParams.company_name"
clearable
placeholder="请输入公司名称"
/>
</el-form-item>
<el-form-item label="公司类型" prop="company_type">
<el-input
class="w-[280px]"
v-model="queryParams.company_type"
clearable
placeholder="请输入公司类型"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
<el-table-column label="签约公司" property="company_name" />
<el-table-column label="公司类型" property="company_type" />
<el-table-column label="区县" property="area" />
<el-table-column label="乡镇" property="street" />
<el-table-column label="主联系人" property="master_name" />
<el-table-column label="联系方式" property="master_phone" />
<el-table-column label="片区经理" property="area_manager" />
<el-table-column label="是否签约" property="is_contract" />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiCompanyLists, apiCompanyDelete } from '@/api/company'
import { defineEmits } from 'vue'
//
const queryParams = reactive({
level_two: '',
level_one: '',
company_name: '',
organization_code: '',
city: '',
area: '',
street: '',
company_type: '',
master_name: '',
master_position: '',
master_phone: '',
master_email: '',
other_contacts: '',
area_manager: '',
is_contract: '',
account: '',
password: '',
deposit: '',
deposit_time: '',
qualification: '',
status: ''
})
//
const emits = defineEmits(['customEvent'])
//
const handleCurrentChange = (value: any) => {
emits('customEvent', value)
}
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCompanyLists,
params: queryParams
})
getLists()
</script>

@ -2,129 +2,217 @@
<div class="edit-popup">
<!-- <popup ref="popupRef" :title="popupTitle" :async="true" width="70%" @confirm="handleSubmit" @close="handleClose"> -->
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<div style="font-size: 1.2rem; margin-bottom: 10px">公司基本信息创建</div>
<el-col :span="24">
<div style="font-size: 1.2rem; margin: 10px 0">公司基本信息创建</div>
<el-col :span="24" class="el-card pt-6">
<el-row>
<el-col :span="8">
<el-form-item label="公司名称" prop="company_name">
<el-input v-model="formData.company_name" placeholder="请输入公司名称" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.company_name"
placeholder="请输入公司名称"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="社会代码" prop="organization_code">
<el-input v-model="formData.organization_code" placeholder="请输入社会代码" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.organization_code"
placeholder="请输入社会代码"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="公司类型" prop="company_type">
<el-select v-model="formData.company_type" placeholder="请选择公司类型" clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.dictTypeLists" :key="index" :label="item.name"
:value="item.id"></el-option>
<el-select
v-model="formData.company_type"
placeholder="请选择公司类型"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.dictTypeLists"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="省" prop="province">
<el-select v-model="formData.province" placeholder="请选择省" clearable @change="province_change"
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.provinceOptions" :key="index"
:label="item.province_name" :value="item.province_code"></el-option>
<el-select
v-model="formData.province"
placeholder="请选择省"
clearable
@change="province_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.provinceOptions"
:key="index"
:label="item.province_name"
:value="item.province_code"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="市" prop="city">
<el-select v-model="formData.city" placeholder="请选择市" clearable @change="city_change"
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.cityOptions" :key="index" :label="item.city_name"
:value="item.city_code"></el-option>
<el-select
v-model="formData.city"
placeholder="请选择市"
clearable
@change="city_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.cityOptions"
:key="index"
:label="item.city_name"
:value="item.city_code"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="区" prop="area">
<el-select v-model="formData.area" placeholder="请选择区" clearable @change="area_change"
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.areaOptions" :key="index" :label="item.area_name"
:value="item.area_code"></el-option>
<el-select
v-model="formData.area"
placeholder="请选择区"
clearable
@change="area_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.areaOptions"
:key="index"
:label="item.area_name"
:value="item.area_code"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="镇" prop="street">
<el-select v-model="formData.street" placeholder="请选择镇" clearable @change="street_change"
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.streetOptions" :key="index"
:label="item.street_name" :value="item.street_code"></el-option>
<el-select
v-model="formData.street"
placeholder="请选择镇"
clearable
@change="street_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.streetOptions"
:key="index"
:label="item.street_name"
:value="item.street_code"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地址" prop="address">
<el-input v-model="formData.address" placeholder="请输入地址" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.address"
placeholder="请输入地址"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<div style="font-size: 1.2rem; margin-bottom: 10px">主要联系人</div>
<el-col :span="24">
<div style="font-size: 1.2rem; margin: 10px 0">主要联系人</div>
<el-col :span="24" class="el-card pt-6">
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="master_name">
<el-input v-model="formData.master_name" placeholder="请输入姓名" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.master_name"
placeholder="请输入姓名"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务" prop="master_position">
<el-input v-model="formData.master_position" placeholder="请输入职务" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.master_position"
placeholder="请输入职务"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机" prop="master_phone">
<el-input v-model="formData.master_phone" placeholder="请输入手机" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.master_phone"
placeholder="请输入手机"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱" prop="master_email">
<el-input v-model="formData.master_email" placeholder="请输入邮箱" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.master_email"
placeholder="请输入邮箱"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<div style="font-size: 1.2rem; margin-bottom: 10px">其他联系人</div>
<el-col :span="24">
<div style="font-size: 1.2rem; margin: 10px 0">其他联系人</div>
<el-col :span="24" class="el-card pt-6">
<el-row>
<template v-for="(item, index) in formData.other_contacts" :key="index">
<el-col :span="12">
<el-form-item label="姓名" prop="field120">
<el-input v-model="item.name" placeholder="请输入姓名" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="item.name"
placeholder="请输入姓名"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务" prop="field121">
<el-input v-model="item.position" placeholder="请输入职务" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="item.position"
placeholder="请输入职务"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机" prop="field122">
<el-input v-model="item.phone" placeholder="请输入手机" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="item.phone"
placeholder="请输入手机"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱" prop="field123">
<el-input v-model="item.email" placeholder="请输入邮箱" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="item.email"
placeholder="请输入邮箱"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
</template>
@ -138,16 +226,25 @@
</el-col>
</el-row>
</el-col>
<div style="font-size: 1.2rem; margin-bottom: 10px">资质信息</div>
<el-col :span="24">
<div style="font-size: 1.2rem; margin: 10px 0">资质信息</div>
<el-col :span="24" class="el-card pt-6">
<el-row>
<el-col :span="12">
<el-form-item label="营业执照" prop="field128" required>
<el-upload class="avatar-uploader" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<img v-if="formData.qualification.business_license"
:src="formData.qualification.business_license" class="avatar" />
<el-form-item label="营业执照" required>
<el-upload
v-model="formData.qualification.business_license"
class="avatar-uploader"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img
v-if="formData.qualification.business_license"
:src="formData.qualification.business_license"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
@ -155,12 +252,21 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="对公银行" prop="field127" required>
<el-upload class="avatar-uploader" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
:on-success="handleAvatarSuccess_two" :before-upload="beforeAvatarUpload_two">
<img v-if="formData.qualification.bank_account" :src="formData.qualification.bank_account"
class="avatar" />
<el-form-item label="对公银行" required>
<el-upload
v-model="formData.qualification.bank_account"
class="avatar-uploader"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccess_two"
:before-upload="beforeAvatarUpload_two"
>
<img
v-if="formData.qualification.bank_account"
:src="formData.qualification.bank_account"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
@ -169,65 +275,109 @@
</el-col>
</el-row>
</el-col>
<div style="font-size: 1.2rem; margin-bottom: 10px">电子合同</div>
<el-col :span="24">
<div style="font-size: 1.2rem; margin: 10px 0">电子合同</div>
<el-col :span="24" class="el-card pt-6">
<el-row>
<el-col :span="12">
<el-form-item label="签约方" prop="field130">
<el-input v-model="showModa" placeholder="请选择签约方" clearable :style="{ width: '100%' }"
@click="openCompany"></el-input>
<el-input
v-model="formData.party_a_name"
placeholder="请选择签约方"
clearable
:style="{ width: '100%' }"
@click="openCompany"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="100px" label="被签约公司" prop="field131">
<el-input v-model="formData.company_name" placeholder="请输入被签约公司" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.company_name"
placeholder="请输入被签约公司"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="100px" label="合同类型" prop="field132">
<el-select v-model="formData.field132" placeholder="请选择合同类型" clearable
:style="{ width: '100%' }"></el-select>
<el-form-item label-width="100px" label="合同类型" prop="contract_type">
<el-select
v-model="formData.contract.contract_type"
placeholder="请选择合同类型"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.contract_type"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="100px" label="合同编号" prop="field133">
<el-input v-model="formData.field133" placeholder="请输入合同编号" clearable
:style="{ width: '100%' }"></el-input>
<el-input
placeholder="系统自动生成"
clearable
:style="{ width: '100%' }"
disabled="disabled"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="24">
<el-col :span="24" class="el-card pt-6">
<el-row>
<el-col :span="24">
<el-form-item label="上传" prop="field138" required>
<el-upload ref="field138" :file-list="field138fileList" :action="field138Action"
:before-upload="field138BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
<el-form-item label="合同文件" required>
<el-upload
class="avatar-uploader"
v-model="formData.contract.file"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccess_three"
:before-upload="beforeAvatarUpload_three"
>
<img
v-if="formData.file_image"
:src="formData.file_image"
class="avatar"
/>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="24">
<el-col :span="24" class="el-card pt-6">
<el-form-item label="" prop="field139">
<el-button type="primary" size="medium"> 创建 </el-button>
<el-button type="primary" size="medium" @click="create"> 创建 </el-button>
</el-form-item>
</el-col>
</el-form>
<!-- </popup> -->
<el-dialog v-model="isCompany" title="选择签约方" width="60%">
<DialogIndex @customEvent="customEvent" />
</el-dialog>
</div>
</template>
<script lang="ts" setup name="companyEdit">
import type { FormInstance, UploadProps } from 'element-plus'
import type { FormInstance, UploadProps, ElMessage } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCompanyAdd, apiCompanyEdit, apiCompanyDetail } from '@/api/company'
import { apiCompanyAdd, apiCompanyEdit, apiCompanyDetail, apiCompanyLists } from '@/api/company'
import { apiCityList, apiAreaList, apiStreetList, apiProvinceList } from '@/api/common'
import { dictDataLists } from '@/api/setting/dict'
import { timeFormat } from '@/utils/util'
import DialogIndex from './dialog_index.vue'
import type { PropType } from 'vue'
import useMultipleTabs from '@/hooks/useMultipleTabs'
const { removeTab } = useMultipleTabs()
const router = useRouter()
const route = useRoute()
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -237,24 +387,25 @@ defineProps({
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const mode = ref()
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑公司' : '新增公司'
})
// const popupTitle = computed(() => {
// return mode.value == 'edit' ? '' : ''
// })
//
const formData = reactive({
id: '',
level_two: '',
level_one: '',
// level_two: '',
// level_one: '',
company_name: '',
organization_code: '',
province: '',
city: '',
area: '',
street: '',
address: '',
company_type: '',
master_name: '',
master_position: '',
@ -268,25 +419,32 @@ const formData = reactive({
email: ''
}
],
area_manager: '',
is_contract: '',
account: '',
password: '',
deposit: '',
deposit_time: '',
// area_manager: '',
// is_contract: '',
// account: '',
// password: '',
// deposit: '',
// deposit_time: '',
qualification: {
business_license: '',
bank_account: ''
},
party_a: '',
status: ''
contract: {
contract_type: '',
party_a: '',
file: ''
},
party_a_name: '',
file_image: ''
// status: ''
})
const datas = reactive({
provinceOptions: [],
cityOptions: [],
areaOptions: [],
streetOptions: [],
dictTypeLists: []
dictTypeLists: [],
contract_type: []
})
//
const formRules = reactive<any>({
@ -347,17 +505,19 @@ const formRules = reactive<any>({
}
]
})
let isCompany = false
const showModa = false
const isCompany = ref(false)
function openCompany () {
isCompany = true
console.log(isCompany)
}
function closeCompany () {
isCompany = false
function customEvent(data: any) {
isCompany.value = false
formData.contract.party_a = data.id
formData.party_a_name = data.company_name
}
function openCompany() {
isCompany.value = true
console.log(isCompany)
}
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
@ -377,8 +537,7 @@ const getDetail = async (row: Record<string, any>) => {
//1
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
const image = URL.createObjectURL(uploadFile.raw!)
formData.qualification.business_license = image
formData.qualification.business_license = response.data.uri
}
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
@ -393,8 +552,7 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
}
//2
const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => {
const image = URL.createObjectURL(uploadFile.raw!)
formData.qualification.bank_account = image
formData.qualification.bank_account = response.data.uri
}
const beforeAvatarUpload_two: UploadProps['beforeUpload'] = (rawFile) => {
@ -407,8 +565,25 @@ const beforeAvatarUpload_two: UploadProps['beforeUpload'] = (rawFile) => {
// }
return true
}
//3
const handleAvatarSuccess_three: UploadProps['onSuccess'] = (response, uploadFile) => {
formData.file_image = response.data.uri
formData.contract.file = response.data.uri
}
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 () {
function other() {
formData.other_contacts.push({
name: '',
position: '',
@ -417,24 +592,26 @@ function other () {
})
}
//
function province_change (value: string) {
function province_change(value: string) {
formData.province = value
getCityList(value)
}
function city_change (value: string) {
function city_change(value: string) {
formData.city = value
getAreaList(value)
}
function area_change (value: string) {
function area_change(value: string) {
formData.area = value
getStreetList(value)
}
function street_change (value: string) {
function street_change(value: string) {
formData.street = value
}
// function dictTypeLists_change (value: string) {
// formData.company_type = value
// }
const getcontract_type = async () => {
const data = await dictDataLists({ type_id: 7 })
datas['contract_type'] = data['lists']
}
const getdictTypeLists = async () => {
const data = await dictDataLists({ type_id: 6 })
datas['dictTypeLists'] = data['lists']
@ -455,26 +632,31 @@ const getStreetList = async (id: any) => {
const data = await apiStreetList({ street: id })
datas['streetOptions'] = data
}
const getDetails = async () => {
const data = await apiCompanyDetail({
id: route.query.id
})
if (route.query.id == 0 || undefined) {
return false
}
Object.keys(formData).forEach((key) => {
//@ts-ignore
formData[key] = data[key]
})
formData['party_a_name'] = data['contract']['party_a_name']
formData['file_image'] = data['contract']['file']
}
getProvinceList()
getdictTypeLists()
//
const handleSubmit = async () => {
getcontract_type()
getDetails()
const create = async () => {
await formRef.value?.validate()
const data = { ...formData }
mode.value == 'edit' ? await apiCompanyEdit(data) : await apiCompanyAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
route.query.id != 0 ? await apiCompanyEdit(data) : await apiCompanyAdd(data)
removeTab()
router.back()
}
defineExpose({

@ -3,22 +3,52 @@
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="公司名称" prop="company_name">
<el-input class="w-[280px]" v-model="queryParams.company_name" clearable placeholder="请输入公司名称" />
<el-input
class="w-[280px]"
v-model="queryParams.company_name"
clearable
placeholder="请输入公司名称"
/>
</el-form-item>
<el-form-item label="区" prop="area">
<el-input class="w-[280px]" v-model="queryParams.area" clearable placeholder="请输入区" />
<el-input
class="w-[280px]"
v-model="queryParams.area"
clearable
placeholder="请输入区"
/>
</el-form-item>
<el-form-item label="镇" prop="street">
<el-input class="w-[280px]" v-model="queryParams.street" clearable placeholder="请输入镇" />
<el-input
class="w-[280px]"
v-model="queryParams.street"
clearable
placeholder="请输入镇"
/>
</el-form-item>
<el-form-item label="公司类型" prop="company_type">
<el-input class="w-[280px]" v-model="queryParams.company_type" clearable placeholder="请输入公司类型" />
<el-input
class="w-[280px]"
v-model="queryParams.company_type"
clearable
placeholder="请输入公司类型"
/>
</el-form-item>
<el-form-item label="片区经理" prop="area_manager">
<el-input class="w-[280px]" v-model="queryParams.area_manager" clearable placeholder="请输入片区经理" />
<el-input
class="w-[280px]"
v-model="queryParams.area_manager"
clearable
placeholder="请输入片区经理"
/>
</el-form-item>
<el-form-item label="是否签约" prop="is_contract">
<el-input class="w-[280px]" v-model="queryParams.is_contract" clearable placeholder="请输入是否签约" />
<el-input
class="w-[280px]"
v-model="queryParams.is_contract"
clearable
placeholder="请输入是否签约"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
@ -33,9 +63,12 @@
</template>
新增
</el-button> -->
<router-link :to="{
path: 'company/add'
}">
<router-link
v-perms="['company/add', 'company/edit']"
:to="{
path: getRoutePath('company/add:edit')
}"
>
<el-button type="primary" class="mb-4">
<template #icon>
<icon name="el-icon-Plus" />
@ -43,12 +76,17 @@
发布文章
</el-button>
</router-link>
<el-button v-perms="['company/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
<el-button
v-perms="['company/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="查看成员" prop="company_name" show-overflow-tooltip />
<el-table-column label="签约公司" prop="company_name" show-overflow-tooltip />
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
@ -60,10 +98,28 @@
<el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['company/edit']" type="primary" link @click="handleEdit(row)">
编辑
<el-button
v-perms="['company/edit', 'company/add']"
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('company/add:edit'),
query: {
id: row.id
}
}"
>
编辑
</router-link>
</el-button>
<el-button v-perms="['company/delete']" type="danger" link @click="handleDelete(row.id)">
<el-button
v-perms="['company/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
@ -74,7 +130,13 @@
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template>

@ -1802,9 +1802,9 @@
"d" "^1.0.1"
"ext" "^1.1.2"
"esbuild-darwin-64@0.14.53":
"integrity" "sha512-gE7P5wlnkX4d4PKvLBUgmhZXvL7lzGRLri17/+CmmCzfncIgq8lOBvxGMiQ4xazplhxq+72TEohyFMZLFxuWvg=="
"resolved" "https://registry.npmmirror.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.53.tgz"
"esbuild-windows-64@0.14.53":
"integrity" "sha512-s9skQFF0I7zqnQ2K8S1xdLSfZFsPLuOGmSx57h2btSEswv0N0YodYvqLcJMrNMXh6EynOmWD7rz+0rWWbFpIHQ=="
"resolved" "https://registry.npmmirror.com/esbuild-windows-64/-/esbuild-windows-64-0.14.53.tgz"
"version" "0.14.53"
"esbuild@^0.14.47":
@ -2223,11 +2223,6 @@
"resolved" "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz"
"version" "1.0.0"
"fsevents@~2.3.2":
"integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
"resolved" "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz"
"version" "2.3.2"
"function-bind@^1.1.1":
"integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
"resolved" "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.1.tgz"