bug修复
This commit is contained in:
parent
1b8b4ece88
commit
338a313da1
7407
package-lock.json
generated
7407
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,9 @@ const config = {
|
||||
terminal: 1, //终端
|
||||
title: '后台管理系统', //网站默认标题
|
||||
version: '1.6.0', //版本号
|
||||
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ''}/`, //请求接口域名
|
||||
baseUrl: `${
|
||||
import.meta.env.VITE_APP_BASE_URL || "https://worker_task.lihaink.cn"
|
||||
}/`, //请求接口域名
|
||||
urlPrefix: 'adminapi', //请求默认前缀
|
||||
timeout: 10 * 1000 //请求超时时长
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
v-model="formData.company_name"
|
||||
placeholder="请输入公司名称"
|
||||
clearable
|
||||
:disabled="isDisabled"
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
@ -18,6 +19,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="社会代码" prop="organization_code">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.organization_code"
|
||||
placeholder="请输入社会代码"
|
||||
clearable
|
||||
@ -28,6 +30,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.company_type"
|
||||
placeholder="请选择公司类型"
|
||||
clearable
|
||||
@ -45,6 +48,7 @@
|
||||
<el-col :span="3">
|
||||
<el-form-item label="省" prop="province">
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.province"
|
||||
placeholder="请选择省"
|
||||
clearable
|
||||
@ -63,6 +67,7 @@
|
||||
<el-col :span="3">
|
||||
<el-form-item label="市" prop="city">
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.city"
|
||||
placeholder="请选择市"
|
||||
clearable
|
||||
@ -81,6 +86,7 @@
|
||||
<el-col :span="3">
|
||||
<el-form-item label="区" prop="area">
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.area"
|
||||
placeholder="请选择区"
|
||||
clearable
|
||||
@ -99,6 +105,7 @@
|
||||
<el-col :span="3">
|
||||
<el-form-item label="镇" prop="street">
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.street"
|
||||
placeholder="请选择镇"
|
||||
clearable
|
||||
@ -117,6 +124,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.address"
|
||||
placeholder="请输入地址"
|
||||
clearable
|
||||
@ -132,6 +140,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="master_name">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@ -142,6 +151,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职务" prop="master_position">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_position"
|
||||
placeholder="请输入职务"
|
||||
clearable
|
||||
@ -152,6 +162,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机" prop="master_phone">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_phone"
|
||||
placeholder="请输入手机"
|
||||
clearable
|
||||
@ -162,6 +173,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="master_email">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.master_email"
|
||||
placeholder="请输入邮箱"
|
||||
clearable
|
||||
@ -178,6 +190,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="field120">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@ -188,6 +201,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职务" prop="field121">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.position"
|
||||
placeholder="请输入职务"
|
||||
clearable
|
||||
@ -198,6 +212,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机" prop="field122">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.phone"
|
||||
placeholder="请输入手机"
|
||||
clearable
|
||||
@ -208,6 +223,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="field123">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="item.email"
|
||||
placeholder="请输入邮箱"
|
||||
clearable
|
||||
@ -219,7 +235,7 @@
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="" prop="field126">
|
||||
<el-button type="primary" size="medium" @click="other">
|
||||
<el-button type="primary" :disabled="isDisabled" size="medium" @click="other">
|
||||
其他联系人
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@ -249,11 +265,30 @@
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.business_licenseB"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessB"
|
||||
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.business_licenseB"
|
||||
:src="formData.qualification.business_licenseB"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="对公银行" required>
|
||||
<el-upload
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.qualification.bank_account"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
@ -271,6 +306,25 @@
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.qualification.bank_accountB"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess_twoB"
|
||||
:before-upload="beforeAvatarUpload_two"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.bank_accountB"
|
||||
:src="formData.qualification.bank_accountB"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -281,6 +335,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签约方" prop="field130">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.party_a_name"
|
||||
placeholder="请选择签约方"
|
||||
clearable
|
||||
@ -292,6 +347,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="被签约公司" prop="field131">
|
||||
<el-input
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.company_name"
|
||||
placeholder="请输入被签约公司"
|
||||
clearable
|
||||
@ -302,6 +358,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="合同类型" prop="contract_type">
|
||||
<el-select
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.contract.contract_type"
|
||||
placeholder="请选择合同类型"
|
||||
clearable
|
||||
@ -316,9 +373,16 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="合同编号" prop="field133">
|
||||
<el-input
|
||||
|
||||
placeholder="系统自动生成"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
@ -332,7 +396,8 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="合同文件" required>
|
||||
<el-upload
|
||||
<!-- <el-upload
|
||||
:disabled="isDisabled"
|
||||
class="avatar-uploader"
|
||||
v-model="formData.contract.file"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
@ -340,20 +405,27 @@
|
||||
: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-button size="small" :disabled="isDisabled" type="primary">点击上传</el-button>
|
||||
</el-upload> -->
|
||||
<el-upload
|
||||
v-model="formData.contract.file"
|
||||
class="upload-demo"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
multiple
|
||||
:limit="1"
|
||||
|
||||
>
|
||||
<el-button :disabled="isDisabled" type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-form-item label="" prop="field139">
|
||||
<el-button type="primary" size="medium" @click="create"> 创建 </el-button>
|
||||
<el-button type="primary" :disabled="isDisabled" size="medium" @click="create"> 创建 </el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
@ -377,6 +449,7 @@ import useMultipleTabs from '@/hooks/useMultipleTabs'
|
||||
const { removeTab } = useMultipleTabs()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
let isDisabled=ref(false)
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
@ -388,7 +461,9 @@ const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref()
|
||||
|
||||
if(route.query.read){
|
||||
isDisabled=true
|
||||
}
|
||||
// 弹窗标题
|
||||
// const popupTitle = computed(() => {
|
||||
// return mode.value == 'edit' ? '编辑公司' : '新增公司'
|
||||
@ -427,7 +502,10 @@ const formData = reactive({
|
||||
// deposit_time: '',
|
||||
qualification: {
|
||||
business_license: '',
|
||||
bank_account: ''
|
||||
business_licenseB: '',
|
||||
bank_account: '',
|
||||
bank_accountB: ''
|
||||
|
||||
},
|
||||
contract: {
|
||||
contract_type: '',
|
||||
@ -539,7 +617,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.business_license = response.data.uri
|
||||
}
|
||||
|
||||
const handleAvatarSuccessB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
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!')
|
||||
@ -554,7 +634,9 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.bank_account = response.data.uri
|
||||
}
|
||||
|
||||
const handleAvatarSuccess_twoB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
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!')
|
||||
@ -675,6 +757,9 @@ defineExpose({
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
width: 170px;
|
||||
height: 108px;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
@ -687,6 +772,14 @@ defineExpose({
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-icon.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
|
@ -26,14 +26,30 @@
|
||||
placeholder="请输入镇"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型" prop="company_type">
|
||||
<!-- <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-form-item label="公司类型" prop="company_type">
|
||||
<el-select
|
||||
v-model="queryParams.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-form-item label="片区经理" prop="area_manager">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
@ -43,12 +59,21 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否签约" prop="is_contract">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.is_contract"
|
||||
clearable
|
||||
placeholder="请输入是否签约"
|
||||
/>
|
||||
<el-select
|
||||
v-model="queryParams.is_contract"
|
||||
placeholder="是否签约"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
label="已签约"
|
||||
value="1"
|
||||
></el-option>
|
||||
<el-option
|
||||
label="未签约"
|
||||
value="0"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
@ -73,19 +98,11 @@
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
发布文章
|
||||
创建
|
||||
</el-button>
|
||||
</router-link>
|
||||
<el-button
|
||||
v-perms="['company/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</router-link>
|
||||
<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 />
|
||||
@ -96,8 +113,23 @@
|
||||
<el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip />
|
||||
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip />
|
||||
<el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<el-table-column label="操作" width="140" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div style="display:flex;">
|
||||
<el-button
|
||||
v-perms="['company/edit', 'company/add']"
|
||||
type="primary"
|
||||
link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
read:true
|
||||
}
|
||||
}"
|
||||
> 查看</router-link>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['company/edit', 'company/add']"
|
||||
type="primary"
|
||||
@ -122,6 +154,8 @@
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -146,6 +180,7 @@ import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiCompanyLists, apiCompanyDelete } from '@/api/company'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { dictDataLists } from '@/api/setting/dict'
|
||||
import EditPopup from './edit.vue'
|
||||
import { getRoutePath } from '@/router'
|
||||
|
||||
@ -169,6 +204,7 @@ const queryParams = reactive({
|
||||
master_email: '',
|
||||
other_contacts: '',
|
||||
area_manager: '',
|
||||
// 是否签约
|
||||
is_contract: '',
|
||||
account: '',
|
||||
password: '',
|
||||
@ -177,7 +213,15 @@ const queryParams = reactive({
|
||||
qualification: '',
|
||||
status: ''
|
||||
})
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
|
||||
})
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 })
|
||||
datas['dictTypeLists'] = data['lists']
|
||||
}
|
||||
getdictTypeLists()
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
@ -219,3 +263,9 @@ const handleDelete = async (id: number | any[]) => {
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn{
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
@ -142,7 +142,7 @@ const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑管理员' : '新增管理员'
|
||||
return mode.value == 'edit' ? '编辑管理员' : '员'
|
||||
})
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
|
@ -10,6 +10,14 @@
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
|
||||
<div style="font-size: 1.2rem; margin: 10px 0">基本信息创建</div>
|
||||
<el-form-item label="头像">
|
||||
<div>
|
||||
<div>
|
||||
<material-picker v-model="formData.avatar" :limit="1" />
|
||||
</div>
|
||||
<div class="form-tips">建议尺寸:100*100px,支持jpg,jpeg,png格式</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-col :span="24" class="pt-6 !border-none">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@ -25,13 +33,18 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input
|
||||
<!-- <el-input
|
||||
v-model="formData.sex"
|
||||
placeholder="请输入性别"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
</el-input>
|
||||
</el-input> -->
|
||||
<el-select v-model="formData.sex" placeholder="请选择性别" :style="{ width: '100%' }">
|
||||
<el-option label="男" value="1" />
|
||||
<el-option label="女" value="2" />
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@ -148,7 +161,7 @@
|
||||
v-model="formData.role_id"
|
||||
:disabled="formData.root == 1"
|
||||
class="flex-1"
|
||||
multiple
|
||||
|
||||
placeholder="请选择授权身份"
|
||||
clearable
|
||||
>
|
||||
@ -167,7 +180,7 @@
|
||||
<el-col :span="24">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="身份证" prop="id_card" required>
|
||||
<el-form-item label="身份证" prop="id_card" >
|
||||
<el-upload
|
||||
v-model="formData.qualification.id_card"
|
||||
class="avatar-uploader"
|
||||
@ -186,10 +199,28 @@
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.id_card_b"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessB"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.id_card_b"
|
||||
:src="formData.qualification.id_card_b"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="行驶证" prop="car_card" required>
|
||||
<el-form-item label="行驶证" prop="car_card" >
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card"
|
||||
class="avatar-uploader"
|
||||
@ -208,10 +239,28 @@
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_cardb"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess_twoB"
|
||||
:before-upload="beforeAvatarUpload_two"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_cardb"
|
||||
:src="formData.qualification.car_cardb"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行卡号" prop="bank_account" required>
|
||||
<el-form-item label="银行卡号" prop="bank_account" >
|
||||
<el-upload
|
||||
v-model="formData.qualification.bank_account"
|
||||
class="avatar-uploader"
|
||||
@ -226,7 +275,27 @@
|
||||
:src="formData.qualification.bank_account"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon"> </el-icon>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
<el-upload
|
||||
v-model="formData.qualification.car_card_b"
|
||||
class="avatar-uploader"
|
||||
:data="{ cid: 1 }"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess_threeB"
|
||||
:before-upload="beforeAvatarUpload_three"
|
||||
>
|
||||
<img
|
||||
v-if="formData.qualification.car_card_b"
|
||||
:src="formData.qualification.car_card_b"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -248,12 +317,13 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input
|
||||
v-model="formData.sex"
|
||||
placeholder="请输入性别"
|
||||
:disabled="true"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
:value="formData.sex==1?'男':'女'"
|
||||
></el-input>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -279,6 +349,49 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="合同类型" prop="contract_type">
|
||||
<el-select
|
||||
@change="getcontract"
|
||||
v-model="formData.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="合同" prop="contract">
|
||||
<el-select
|
||||
v-model="formData.contract"
|
||||
placeholder="请选择合同"
|
||||
clearable
|
||||
@change="street_change"
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in datas.contract"
|
||||
: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="field124">
|
||||
<el-input
|
||||
v-model="formData.field124"
|
||||
@ -309,62 +422,45 @@
|
||||
:style="{ width: '100%' }"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上传" prop="field127" required>
|
||||
<el-upload ref="field127">
|
||||
<el-form-item label="上传" prop="field127" >
|
||||
<!-- <el-upload ref="field127">
|
||||
<el-button size="small" type="primary" icon="el-icon-upload"
|
||||
>点击上传</el-button
|
||||
>
|
||||
</el-upload> -->
|
||||
<el-upload
|
||||
v-model="formData.file"
|
||||
class="upload-demo"
|
||||
action="https://worker-task.lihaink.cn/api/upload/image"
|
||||
:on-success="handleAvatarSuccess_four"
|
||||
multiple
|
||||
:limit="1"
|
||||
|
||||
>
|
||||
<el-button type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 账号输入框 -->
|
||||
<el-form-item label="账号" prop="account">
|
||||
<el-input
|
||||
v-model="formData.account"
|
||||
:disabled="formData.root == 1"
|
||||
placeholder="请输入账号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 管理员头像 -->
|
||||
<el-form-item label="头像">
|
||||
<div>
|
||||
<div>
|
||||
<material-picker v-model="formData.avatar" :limit="1" />
|
||||
</div>
|
||||
<div class="form-tips">建议尺寸:100*100px,支持jpg,jpeg,png格式</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- 密码输入框 -->
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input
|
||||
v-model="formData.password"
|
||||
show-password
|
||||
clearable
|
||||
placeholder="请输入密码"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 确认密码输入框 -->
|
||||
<el-form-item label="确认密码" prop="password_confirm">
|
||||
<el-input
|
||||
v-model="formData.password_confirm"
|
||||
show-password
|
||||
clearable
|
||||
placeholder="请输入确认密码"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<!-- 管理员状态 -->
|
||||
<el-form-item label="管理员状态" v-if="formData.root != 1">
|
||||
<el-switch v-model="formData.disable" :active-value="0" :inactive-value="1" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
@ -378,6 +474,7 @@ import { roleAll } from '@/api/perms/role'
|
||||
import { jobsAll } from '@/api/org/post'
|
||||
import { deptAll } from '@/api/org/department'
|
||||
import { apiCityList, apiAreaList, apiStreetList, apiProvinceList } from '@/api/common'
|
||||
import { dictDataLists } from '@/api/setting/dict'
|
||||
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
@ -388,8 +485,7 @@ const popupTitle = computed(() => {
|
||||
})
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
account: '',
|
||||
sex: 1,
|
||||
sex: '',
|
||||
id_card: '',
|
||||
name: '',
|
||||
province: '',
|
||||
@ -400,13 +496,20 @@ const formData = reactive({
|
||||
phone: '',
|
||||
qualification: {
|
||||
id_card: '',
|
||||
id_card_b: '',
|
||||
car_card: '',
|
||||
bank_account: ''
|
||||
car_card_b: '',
|
||||
bank_account: '',
|
||||
bank_account_b: ''
|
||||
|
||||
},
|
||||
// 合同类型
|
||||
contract_type:"",
|
||||
// 合同
|
||||
contract:"",
|
||||
file:'',
|
||||
is_contract: 0,
|
||||
dept_id: [],
|
||||
jobs_id: [],
|
||||
role_id: [],
|
||||
role_id: '',
|
||||
avatar: '',
|
||||
password: '',
|
||||
password_confirm: '',
|
||||
@ -420,15 +523,29 @@ const datas = reactive({
|
||||
areaOptions: [],
|
||||
streetOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: []
|
||||
contract_type: [],
|
||||
contract:[]
|
||||
})
|
||||
const passwordConfirmValidator = (rule: object, value: string, callback: any) => {
|
||||
if (formData.password) {
|
||||
if (!value) callback(new Error('请再次输入密码'))
|
||||
if (value !== formData.password) callback(new Error('两次输入密码不一致!'))
|
||||
}
|
||||
callback()
|
||||
const getcontract_type = async () => {
|
||||
const data = await dictDataLists({ type_id: 7 })
|
||||
datas['contract_type'] = data['lists']
|
||||
}
|
||||
// 获取合同
|
||||
const getcontract=async ()=>{
|
||||
const data=await dictDataLists({ type_id: formData.contract_type })
|
||||
// console.log(data)
|
||||
// console.log(formData.contract_type)
|
||||
|
||||
}
|
||||
// const passwordConfirmValidator = (rule: object, value: string, callback: any) => {
|
||||
// if (formData.password) {
|
||||
// if (!value) callback(new Error('请再次输入密码'))
|
||||
// if (value !== formData.password) callback(new Error('两次输入密码不一致!'))
|
||||
// }
|
||||
// callback()
|
||||
// }
|
||||
getcontract_type()
|
||||
getcontract()
|
||||
const formRules = reactive({
|
||||
account: [
|
||||
{
|
||||
@ -437,6 +554,30 @@ const formRules = reactive({
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
id_card:[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入身份证账号',
|
||||
trigger: ['blur']
|
||||
}
|
||||
|
||||
],
|
||||
phone:[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入电话号码',
|
||||
trigger: ['blur']
|
||||
}
|
||||
|
||||
],
|
||||
sex:[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择性别',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
@ -446,7 +587,7 @@ const formRules = reactive({
|
||||
],
|
||||
role_id: [
|
||||
{
|
||||
type: 'array',
|
||||
|
||||
required: true,
|
||||
message: '请选择角色',
|
||||
trigger: ['blur']
|
||||
@ -465,12 +606,17 @@ const formRules = reactive({
|
||||
message: '请输入确认密码',
|
||||
trigger: ['blur']
|
||||
},
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
// {
|
||||
// validator: passwordConfirmValidator,
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
] as any[]
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { optionsData } = useDictOptions<{
|
||||
role: any[]
|
||||
jobs: any[]
|
||||
@ -489,6 +635,8 @@ const { optionsData } = useDictOptions<{
|
||||
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
console.log(formData)
|
||||
return
|
||||
mode.value == 'edit' ? await adminEdit(formData) : await adminAdd(formData)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
@ -502,21 +650,30 @@ const open = (type = 'add') => {
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.id_card = response.data.uri
|
||||
}
|
||||
|
||||
const handleAvatarSuccessB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.id_card_b = response.data.uri
|
||||
}
|
||||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
return true
|
||||
}
|
||||
const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.car_card = response.data.uri
|
||||
}
|
||||
|
||||
const handleAvatarSuccess_twoB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.car_card_b = response.data.uri
|
||||
}
|
||||
const beforeAvatarUpload_two: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
return true
|
||||
}
|
||||
const handleAvatarSuccess_three: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.bank_account = response.data.uri
|
||||
}
|
||||
|
||||
const handleAvatarSuccess_threeB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.qualification.car_card_b = response.data.uri
|
||||
}
|
||||
const handleAvatarSuccess_four: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
formData.file = response.data.uri
|
||||
}
|
||||
const beforeAvatarUpload_three: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
return true
|
||||
}
|
||||
@ -555,15 +712,10 @@ const getStreetList = async (id: any) => {
|
||||
}
|
||||
const setFormData = async (row: any) => {
|
||||
formRules.password = []
|
||||
formRules.password_confirm = [
|
||||
{
|
||||
validator: passwordConfirmValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
const data = await adminDetail({
|
||||
id: row.id
|
||||
})
|
||||
console.log(row)
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
@ -583,6 +735,7 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.avatar-uploader .avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
@ -592,6 +745,9 @@ defineExpose({
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
width: 170px;
|
||||
height: 108px;
|
||||
background-color: #fff;
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
|
@ -154,6 +154,7 @@ const handleAdd = async () => {
|
||||
}
|
||||
|
||||
const handleEdit = async (data: any) => {
|
||||
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
|
Loading…
x
Reference in New Issue
Block a user