页面样式修改

This commit is contained in:
THK3121 2023-07-21 17:54:11 +08:00
parent 25630b489b
commit c7aa6ae0b5
8 changed files with 1682 additions and 1289 deletions

View File

@ -1,31 +1,39 @@
import request from '@/utils/request'
import request from "@/utils/request";
// 公司列表
export function apiCompanyLists(params: any) {
return request.get({ url: '/company/lists', params })
return request.get({ url: "/company/lists", params });
}
// 添加公司
export function apiCompanyAdd(params: any) {
return request.post({ url: '/company/add', params })
return request.post({ url: "/company/add", params });
}
// 编辑公司
export function apiCompanyEdit(params: any) {
return request.post({ url: '/company/edit', params })
return request.post({ url: "/company/edit", params });
}
// 删除公司
export function apiCompanyDelete(params: any) {
return request.post({ url: '/company/delete', params })
return request.post({ url: "/company/delete", params });
}
// 公司详情
export function apiCompanyDetail(params: any) {
return request.get({ url: '/company/detail', params })
return request.get({ url: "/company/detail", params });
}
// 下属公司详情
export function apiSubordinateList(params: any) {
return request.get({ url: '/company/subordinate', params })
return request.get({ url: "/company/subordinate", params });
}
// 生成合同
export function generateGontract(params: any) {
return request.get({ url: "/company/Draftingcontracts", params });
}
// 发送短信
export function sendMsgApi(params: any) {
return request.get({ url: "/company/postsms", params });
}

View File

@ -27,11 +27,3 @@ 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: '/company/Draftingcontracts', params })
}
// 发送短信
export function sendMsgApi(params: any) {
return request.get({ url: '/company/postsms', params })
}

View File

@ -1,71 +1,140 @@
<template>
<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">
<el-form
ref="formRef"
:model="formData"
label-width="90px"
:rules="formRules"
>
<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 :disabled="isDisabled"
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.company_name"
placeholder="请输入公司名称"
clearable
:disabled="isDisabled"
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="社会代码" prop="organization_code">
<el-input :disabled="isDisabled" v-model="formData.organization_code" placeholder="请输入社会代码"
clearable :style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="isDisabled" 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
:disabled="isDisabled"
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 :disabled="isDisabled" 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
:disabled="isDisabled"
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 :disabled="isDisabled" 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
:disabled="isDisabled"
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 :disabled="isDisabled" 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
:disabled="isDisabled"
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 :disabled="isDisabled" 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
:disabled="isDisabled"
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 :disabled="isDisabled" v-model="formData.address" placeholder="请输入地址" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
v-model="formData.address"
placeholder="请输入地址"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
</el-row>
@ -75,32 +144,70 @@
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="master_name">
<el-input :disabled="isDisabled" v-model="formData.master_name" placeholder="请输入姓名" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="isDisabled" v-model="formData.master_position" placeholder="请输入职务"
clearable :style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="isDisabled" v-model="formData.master_phone" placeholder="请输入手机" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="isDisabled" v-model="formData.master_email" placeholder="请输入邮箱" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
v-model="formData.master_email"
placeholder="请输入邮箱"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="选择人员" prop="man">
<el-input :disabled="isDisabled" v-model="formData.man" placeholder="请选择人员" clearable
:style="{ width: '100%' }" @click="isMan = true"></el-input>
<el-col :span="12">
<el-form-item label="管理人员" prop="admin_name">
<el-input
:disabled="isDisabled"
v-model="formData.admin_name"
placeholder="设置当前公司管理人员"
clearable
:style="{ width: '100%' }"
@click="isMan = true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="片区经理" prop="area_manager_name">
<el-input
:disabled="isDisabled"
v-model="formData.area_manager_name"
placeholder="选择片区经理"
clearable
:style="{ width: '100%' }"
@click="isAreaManager = true"
></el-input>
</el-form-item>
</el-col>
</el-row>
@ -108,36 +215,65 @@
<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">
<template
v-for="(item, index) in formData.other_contacts"
:key="index"
>
<el-col :span="12">
<el-form-item label="姓名" prop="field120">
<el-input :disabled="isDisabled" v-model="item.name" placeholder="请输入姓名" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="isDisabled" v-model="item.position" placeholder="请输入职务" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="isDisabled" v-model="item.phone" placeholder="请输入手机" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="isDisabled" v-model="item.email" placeholder="请输入邮箱" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isDisabled"
v-model="item.email"
placeholder="请输入邮箱"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
</template>
<el-col :span="24">
<el-form-item label prop="field126">
<el-button type="primary" :disabled="isDisabled" size="medium" @click="other">其他联系人</el-button>
<el-button
type="primary"
:disabled="isDisabled"
size="medium"
@click="other"
>其他联系人</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -147,22 +283,38 @@
<el-row>
<el-col :span="12">
<el-form-item label="营业执照" required>
<el-upload :disabled="isDisabled" 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-upload
:disabled="isDisabled"
v-model="formData.qualification.business_license"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccess"
>
<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>
</el-upload>
<el-upload :disabled="isDisabled" 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-upload
:disabled="isDisabled"
v-model="formData.qualification.business_licenseB"
class="avatar-uploader pl-3"
: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>
@ -171,22 +323,38 @@
</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 }"
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-upload
:disabled="isDisabled"
v-model="formData.qualification.bank_account"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccess_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>
</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-upload
:disabled="isDisabled"
v-model="formData.qualification.bank_accountB"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccess_twoB"
>
<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>
@ -195,89 +363,136 @@
</el-col>
</el-row>
</el-col>
<template v-if="userStore.userInfo.root == 1">
<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 :disabled="isDisabled" v-model="formData.party_a_name" placeholder="请选择签约方" clearable
:style="{ width: '100%' }" @click="openCompany"></el-input>
<el-input
:disabled="isDisabled"
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 :disabled="true" v-model="formData.company_name" placeholder="请输入被签约公司" clearable
:style="{ width: '100%' }"></el-input>
<el-form-item
label-width="100px"
label="被签约公司"
prop="field131"
>
<el-input
:disabled="true"
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="合同类型" prop="contract_type">
<el-select :disabled="isDisabled" 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-form-item
label-width="100px"
label="合同类型"
prop="contract_type"
>
<el-select
:disabled="isDisabled"
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 placeholder="系统自动生成" clearable :style="{ width: '100%' }" :disabled="true"></el-input>
<el-form-item
label-width="100px"
label="合同编号"
prop="field133"
>
<el-input
placeholder="系统自动生成"
v-model="formData.contract.contract_no"
clearable
:style="{ width: '100%' }"
:disabled="true"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="24" class="el-card pt-6">
<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"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:headers="{ Token: userStore.token }"
class="upload-demo"
action="https://worker-task.lihaink.cn/adminapi/upload/file"
multiple
:limit="1"
:on-success="handleAvatarSuccess_three"
>
<el-button :disabled="isDisabled" type="primary"
>上传</el-button
>
<el-button size="small" :disabled="isDisabled" type="primary">点击上传</el-button>
</el-upload>-->
<el-upload :disabled="isDisabled" v-model="formData.contract.file"
:headers="{ 'Token': userStore.token }" class="upload-demo"
action="https://worker-task.lihaink.cn/adminapi/upload/file" multiple :limit="1">
<el-button :disabled="isDisabled" type="primary">上传</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-col>
</template>
<el-col :span="24" class="el-card pt-6">
<el-form-item label prop="field139">
<el-button v-if="isEdit" type="primary" size="medium" @click="create">修改</el-button>
<el-button v-else type="primary" :disabled="isDisabled" size="medium" @click="create">创建</el-button>
<el-button v-if="isEdit" type="primary" size="medium" @click="create"
>修改</el-button
>
<el-button
v-else
type="primary"
:disabled="isDisabled"
size="medium"
@click="create"
>创建</el-button
>
</el-form-item>
</el-col>
</el-form>
<el-dialog v-model="isCompany" title="选择签约方" width="60%">
<DialogIndex @customEvent="customEvent" />
</el-dialog>
<el-dialog v-model="isMan" title="选择人员" width="60%">
<el-dialog v-model="isMan" title="选择管理人员" width="60%">
<DialogIndexMan @customEvent="customEventMan" />
</el-dialog>
<el-dialog v-model="isAreaManager" title="选择片区经理" width="60%">
<DialogIndexMan @customEvent="EventAreaManager" />
</el-dialog>
</div>
</template>
<script lang="ts" setup name="companyEdit">
import type { FormInstance, UploadProps, ElMessage } from "element-plus";
import type {
FormInstance,
UploadProps,
ElMessage,
UploadUserFile,
} from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
apiCompanyAdd,
@ -294,12 +509,11 @@ import {
import { dictDataLists } from "@/api/setting/dict";
import { timeFormat } from "@/utils/util";
import DialogIndex from "./dialog_index.vue";
import DialogIndexMan from "./dialog_index_personnel.vue";
import DialogIndexMan from "./dialog_index_man.vue";
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();
@ -317,14 +531,13 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref();
isDisabled = route.query.read;
isEdit = route.query.edit;
//
// const popupTitle = computed(() => {
// return mode.value == 'edit' ? '' : ''
// })
//
const formData = reactive({
man: "",
admin_id: "",
admin_name: "",
area_manager: "",
area_manager_name: "",
id: "",
// level_two: '',
// level_one: '',
@ -365,6 +578,7 @@ const formData = reactive({
contract_type: "",
party_a: "",
file: "",
contract_no: "系统自动生成",
},
//
party_a_name: "",
@ -379,6 +593,12 @@ const datas = reactive({
dictTypeLists: [],
contract_type: [],
});
const fileList = ref<UploadUserFile[]>([
{
name: "",
url: "",
},
]);
//
const formRules = reactive<any>({
company_name: [
@ -439,7 +659,8 @@ const formRules = reactive<any>({
],
});
const isCompany = ref(false);
const isMan = ref(false)
const isMan = ref(false);
const isAreaManager = ref(false);
function customEvent(data: any) {
isCompany.value = false;
@ -448,9 +669,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;
@ -478,67 +704,59 @@ 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
) => {
formData.file_image = response.data.uri;
formData.contract.file = response.data.uri;
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 = ''
console.log(response);
};
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({
@ -593,18 +811,20 @@ const getDetails = async () => {
id: route.query.id,
});
Object.keys(formData).forEach((key) => {
let stringArr = ["province", "city", "area", "street"];
const stringArr = ["province", "city", "area", "street"];
//@ts-ignore
formData[key] = data[key];
if (stringArr.includes(key)) {
formData[key] = formData[key].toString();
getCityList();
getAreaList();
getStreetList();
}
if (stringArr.includes(key)) formData[key] = formData[key].toString();
});
apiCityList({ city: formData.province }).then(() => {
apiAreaList({ area: formData.city }).then(() => {
apiStreetList({ street: formData.area });
});
});
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();

View File

@ -21,7 +21,7 @@
<el-form-item label="片区经理" prop="area_manager">
<el-input class="w-[280px]" v-model="queryParams.area_manager" clearable placeholder="请输入片区经理" />
</el-form-item>
<el-form-item label="是否签约" prop="is_contract">
<el-form-item label="是否签约" class="w-[308px]" prop="is_contract">
<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>
@ -52,8 +52,7 @@
</router-link>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="查看成员" prop="company_name" show-overflow-tooltip />
<el-table-column label="id" prop="id" show-overflow-tooltip width="60" />
<el-table-column label="签约公司" prop="company_name" show-overflow-tooltip />
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
<el-table-column label="区县" prop="area" show-overflow-tooltip />
@ -62,9 +61,27 @@
<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="操作" align="center" width="330" fixed="right">
<el-table-column label="操作" align="center" width="450" fixed="right">
<template #default="{ row }">
<div style="display: flex">
<el-button type="primary" link>
<router-link :to="{
path: getRoutePath('auth.admin/lists'),
query: {
company_id: row.id,
read: true
}
}">查看成员</router-link>
</el-button>
<el-button type="primary" link>
<router-link :to="{
path: getRoutePath('company/subordinate/lists'),
query: {
company_id: row.id,
read: true
}
}">下属公司</router-link>
</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link>
<router-link :to="{
path: getRoutePath('company/add:edit'),
@ -72,7 +89,7 @@
id: row.id,
read: true
}
}">查看</router-link>
}">详情</router-link>
</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link>
<router-link :to="{
@ -86,9 +103,9 @@
<el-button v-perms="['company/delete']" type="danger" link
@click="handleDelete(row.id)">删除</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link
@click="showCreateConctPop(row)">生成个人合同</el-button>
@click="showCreateConctPop(row)">生成合同</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link
@click=" showPop = true, contractId = row.id">发送短信</el-button>
@click="; (showPop = true), (contractId = row.id)">发送短信</el-button>
</div>
</template>
</el-table-column>
@ -100,8 +117,12 @@
</el-card>
<el-dialog v-model="showPop" @close="offPop">
<h1>重要提醒</h1>
<div class="content" v-if="showConctactPop">请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.</div>
<div class="content" v-else>确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约</div>
<div class="content" v-if="showConctactPop">
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
</div>
<div class="content" v-else>
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
@ -112,44 +133,37 @@
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
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";
// import EditPopup from './edit.vue'
import { getRoutePath } from "@/router";
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiCompanyLists, apiCompanyDelete, generateGontract, sendMsgApi } from '@/api/company'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import { dictDataLists } from '@/api/setting/dict'
import { getRoutePath } from '@/router'
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const route = useRoute();
const company_type_show = ref(true);
const route = useRoute()
const company_type_show = ref(true)
//
//
const showPop = ref(false);
const showConctactPop = ref(false);
const showPop = ref(false)
const showConctactPop = ref(false)
const offPop = () => {
showPop.value = false;
showConctactPop.value = false;
};
showPop.value = false
showConctactPop.value = false
}
// id
const contractId = ref("");
const contractId = ref('')
const showCreateConctPop = (row) => {
(showPop.value = true),
(showConctactPop.value = true),
(contractId.value = row.id);
};
const creContct = async () => {
let res = await generateGontract({ id: contractId.value });
feedback.msgSuccess("发送成功");
offPop();
};
const sendMsg = async () => {
let res = await sendMsgApi({ id: contractId.value });
feedback.msgSuccess("发送成功");
offPop();
};
; (showPop.value = true), (showConctactPop.value = true), (contractId.value = row.id)
}
const creContct = () => {
generateGontract({ id: contractId.value })
offPop()
}
const sendMsg = () => {
sendMsgApi({ id: contractId.value })
offPop()
}
//
//
const queryParams = reactive({

View File

@ -16,70 +16,38 @@
<template #default="{ row }">
<div style="display: flex">
<el-button type="primary" link>
<router-link
:to="{
<router-link :to="{
path: getRoutePath('auth.admin/lists'),
query: {
company_id: row.id,
read: true
}
}"
>查看成员</router-link
>
}">查看成员</router-link>
</el-button>
<el-button
v-perms="['company/edit', 'company/add']"
type="primary"
link
>
<router-link
:to="{
<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
>
}">详情</router-link>
</el-button>
<el-button
v-perms="['company/edit', 'company/add']"
type="primary"
link
>
<router-link
:to="{
<el-button v-perms="['company/edit', 'company/add']" type="primary" link>
<router-link :to="{
path: getRoutePath('company/add:edit'),
query: {
id: row.id,
edit: true
}
}"
>编辑</router-link
>
}">编辑</router-link>
</el-button>
<el-button
v-perms="['company/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>删除</el-button
>
<el-button
v-perms="['company/edit', 'company/add']"
type="primary"
link
@click="showCreateConctPop(row)"
>生成合同</el-button
>
<el-button
v-perms="['company/edit', 'company/add']"
type="primary"
link
@click=";(showPop = true), (contractId = row.id)"
>发送短信</el-button
>
<el-button v-perms="['company/delete']" type="danger" link
@click="handleDelete(row.id)">删除</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link
@click="showCreateConctPop(row)">生成合同</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link
@click="; (showPop = true), (contractId = row.id)">发送短信</el-button>
</div>
</template>
</el-table-column>
@ -98,9 +66,7 @@
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
>确认创建</el-button
>
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
@ -111,8 +77,8 @@
<script lang="ts" setup name="companyLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiCompanyLists, apiCompanyDelete, apiSubordinateList } from '@/api/company'
import { generateGontract, sendMsgApi } from '@/api/perms/admin'
import { apiCompanyLists, apiCompanyDelete, apiSubordinateList, generateGontract, sendMsgApi } from '@/api/company'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import { dictDataLists } from '@/api/setting/dict'
@ -201,6 +167,7 @@ getLists()
.btn {
position: absolute;
}
h1 {
text-align: center;
font-weight: bold;

View File

@ -5,6 +5,8 @@
<el-input v-model="formData.company_id" :disabled="true" clearable placeholder="请输入公司" />
</el-form-item>
<el-form-item label="合同类型" prop="contract_type">
<el-input v-model="formData.contract_type" :disabled="true" clearable placeholder="请输入合同类型" />
</el-form-item>
<el-form-item label="合同编号" prop="contract_no">
@ -61,6 +63,7 @@ const setFormData = async (data) => {
formData[key] = data[key];
}
}
console.log(formData)
};
defineExpose({

View File

@ -1,13 +1,31 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="80%"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form
ref="formRef"
:model="formData"
label-width="84px"
:rules="formRules"
>
<div style="font-size: 1.2rem; margin: 10px 0">基本信息创建</div>
<div class="headimg">
<el-upload :disabled="isCheck" v-model="formData.avatar" class="avatar-uploader-head"
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
:on-success="handleAvatarSuccessAvatar">
<el-upload
:disabled="isCheck"
v-model="formData.avatar"
class="avatar-uploader-head"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessAvatar"
>
<img v-if="formData.avatar" :src="formData.avatar" class="avatar" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
@ -15,19 +33,27 @@
</el-upload>
</div>
<el-col style="flex: 8" class="pt-6 !border-none">
<el-col class="pt-6 !border-none">
<el-row>
<el-col :span="12">
<el-col :span="11">
<el-form-item label="姓名" prop="name">
<el-input :disabled="isCheck" v-model="formData.name" placeholder="请输入姓名" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isCheck"
v-model="formData.name"
placeholder="请输入姓名"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="13">
<el-form-item label="性别" prop="sex">
<el-select v-model="formData.sex" placeholder="请选择性别" :disabled="isCheck"
:style="{ width: '100%' }">
<el-select
v-model="formData.sex"
placeholder="请选择性别"
:disabled="isCheck"
:style="{ width: '100%' }"
>
<el-option label="男" value="1" />
<el-option label="女" value="2" />
</el-select>
@ -35,216 +61,409 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="11">
<el-form-item label="身份证号" prop="id_card">
<el-input :disabled="isCheck" v-model="formData.id_card" placeholder="请输入身份证号" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isCheck"
v-model="formData.id_card"
placeholder="请输入身份证号"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="13">
<el-form-item label="联系电话" prop="account">
<el-input :disabled="isCheck" v-model="formData.account" placeholder="请输入联系电话" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isCheck"
v-model="formData.account"
placeholder="请输入联系电话"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="省" prop="province" style="flex: 1">
<el-select :disabled="isCheck" 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
:disabled="isCheck"
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-form-item label="市" prop="city" style="flex: 1">
<el-select :disabled="isCheck" 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
:disabled="isCheck"
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-form-item label="区" prop="area" style="flex: 1">
<el-select :disabled="isCheck" 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
:disabled="isCheck"
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-form-item label="镇" prop="street" style="flex: 1">
<el-select :disabled="isCheck" 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
:disabled="isCheck"
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-form-item label="村社小队" prop="address" style="flex: 1.5">
<el-input :disabled="isCheck" v-model="formData.address" placeholder="请输入村社小队" clearable
:style="{ width: '100%' }"></el-input>
<el-input
:disabled="isCheck"
v-model="formData.address"
placeholder="请输入村社小队"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-row>
</el-col>
<el-col :span="24">
<el-col :span="24" style="margin-top: 1vh">
<el-row>
<el-col :span="12">
<el-col :span="12" v-if="userStore.userInfo.root == 0">
<el-form-item label="授权身份" prop="role_id">
<el-select v-model="formData.role_id" :disabled="formData.root == 1 || isCheck"
placeholder="请选择授权身份" :style="{ width: '100%' }" clearable>
<el-option v-if="formData.root == 1" label="系统管理员" :value="0" />
<el-option v-for="(item, index) in optionsData.role" :key="index" :label="item.name"
:value="item.id" />
<el-select
v-model="formData.role_id"
:disabled="formData.root == 1 || isCheck"
placeholder="请选择授权身份"
:style="{ width: '100%' }"
clearable
>
<el-option
v-if="formData.root == 1"
label="系统管理员"
:value="0"
/>
<el-option
v-for="(item, index) in optionsData.role"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="24" v-else>
<el-form-item label="授权身份" prop="role_id">
<el-select
v-model="formData.role_id"
:disabled="formData.root == 1 || isCheck"
placeholder="请选择授权身份"
:style="{ width: '100%' }"
clearable
>
<el-option
v-if="formData.root == 1"
label="系统管理员"
:value="0"
/>
<el-option
v-for="(item, index) in optionsData.role"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="userStore.userInfo.root == 0">
<!-- <el-col :span="12" v-if="true"> -->
<el-form-item label="签约方" prop="field130">
<el-input :disabled="isCheck" v-model="formData.party_a_name" placeholder="请选择签约方" clearable
:style="{ width: '100%' }" @click="isCompany = true"></el-input>
<el-input
:disabled="isCheck"
v-model="formData.party_a_name"
placeholder="请选择签约方"
clearable
:style="{ width: '100%' }"
@click="isCompany = true"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-col>
<div style="font-size: 1.2rem; margin: 10px 0">资质信息</div>
<el-col :span="24">
<el-row>
<el-col :span="8">
<div style="display: flex; justify-content: space-between">
<div>
<el-form-item label="身份证" prop="id_card">
<el-upload :disabled="isCheck" v-model="formData.qualification.id_card"
class="avatar-uploader" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
:on-success="handleAvatarSuccessIdA">
<img v-if="formData.qualification.id_card" :src="formData.qualification.id_card"
class="avatar" />
<el-upload
:disabled="isCheck"
v-model="formData.qualification.id_card"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessIdA"
>
<img
v-if="formData.qualification.id_card"
:src="formData.qualification.id_card"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
<el-upload :disabled="isCheck" 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="handleAvatarSuccessIdB">
<img v-if="formData.qualification.id_card_b" :src="formData.qualification.id_card_b"
class="avatar" />
<el-upload
:disabled="isCheck"
v-model="formData.qualification.id_card_b"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessIdB"
>
<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">
</div>
<div>
<el-form-item label="行驶证" prop="car_card">
<el-upload :disabled="isCheck" v-model="formData.qualification.car_card"
class="avatar-uploader" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
:on-success="handleAvatarSuccessCarA">
<img v-if="formData.qualification.car_card" :src="formData.qualification.car_card"
class="avatar" />
<el-upload
:disabled="isCheck"
v-model="formData.qualification.car_card"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessCarA"
>
<img
v-if="formData.qualification.car_card"
:src="formData.qualification.car_card"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
<el-upload :disabled="isCheck" 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="handleAvatarSuccessCarB" :before-upload="beforeAvatarUpload_two">
<img v-if="formData.qualification.car_card_b" :src="formData.qualification.car_card_b"
class="avatar" />
<el-upload
:disabled="isCheck"
v-model="formData.qualification.car_card_b"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessCarB"
:before-upload="beforeAvatarUpload_two"
>
<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>
<el-col :span="8">
</div>
<div>
<el-form-item label="银行卡号" prop="bank_account">
<el-upload :disabled="isCheck" 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="handleAvatarSuccessBankA" :before-upload="beforeAvatarUpload_three">
<img v-if="formData.qualification.bank_account"
:src="formData.qualification.bank_account" class="avatar" />
<el-upload
:disabled="isCheck"
v-model="formData.qualification.bank_account"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessBankA"
:before-upload="beforeAvatarUpload_three"
>
<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>
</el-upload>
<el-upload :disabled="isCheck" v-model="formData.qualification.bank_account_b"
class="avatar-uploader" :data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image" :show-file-list="false"
:on-success="handleAvatarSuccessBankB" :before-upload="beforeAvatarUpload_three">
<img v-if="formData.qualification.bank_account_b"
:src="formData.qualification.bank_account_b" class="avatar" />
<el-upload
:disabled="isCheck"
v-model="formData.qualification.bank_account_b"
class="avatar-uploader pl-3"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessBankB"
:before-upload="beforeAvatarUpload_three"
>
<img
v-if="formData.qualification.bank_account_b"
:src="formData.qualification.bank_account_b"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-col>
</div>
</div>
<template v-if="userStore.userInfo.root == 0">
<!-- <template v-if="true"> -->
<el-col :span="24">
<el-row>
<el-col :span="12">
<el-form-item label="签约姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入签约姓名" :disabled="true" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.name"
placeholder="请输入签约姓名"
:disabled="true"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别" prop="sex">
<el-input placeholder="请输入性别" :disabled="true" clearable :style="{ width: '100%' }"
:value="formData.sex == 1 ? '男' : '女'"></el-input>
<el-input
placeholder="请输入性别"
:disabled="true"
clearable
:style="{ width: '100%' }"
:value="formData.sex == 1 ? '男' : '女'"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="身份证号" prop="id_card">
<el-input v-model="formData.id_card" placeholder="请输入身份证号" :disabled="true" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.id_card"
placeholder="请输入身份证号"
:disabled="true"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="account">
<el-input v-model="formData.account" placeholder="请输入联系电话" :disabled="true" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.account"
placeholder="请输入联系电话"
:disabled="true"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="formData.name">
<el-form-item label="账号" prop="account">
<el-input v-model="formData.account" :disabled="true" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.account"
:disabled="true"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="formData.name">
<el-form-item label="密码" prop="password">
<el-input v-model="formData.account" :disabled="true" clearable
:style="{ width: '100%' }"></el-input>
<el-input
v-model="formData.account"
:disabled="true"
clearable
:style="{ width: '100%' }"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="合同类型" prop="contract_type">
<el-col :span="24">
<el-select :disabled="isCheck" 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
:disabled="isCheck"
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-col>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="24" v-if="!isCheck">
<el-form-item label="合同上传" prop="field127">
<el-upload :headers="{ Token: userStore.token }" v-model="formData.file" class="upload-demo"
<el-upload
:headers="{ Token: userStore.token }"
v-model="formData.file"
class="upload-demo"
action="https://worker-task.lihaink.cn/adminapi/upload/file"
:on-success="handleAvatarSuccess_four" multiple :limit="1">
:on-success="handleAvatarSuccess_four"
multiple
:limit="1"
>
<el-button type="primary">上传</el-button>
</el-upload>
</el-form-item>
</el-col>
</template>
</el-form>
</popup>
<el-dialog v-model="isCompany" title="选择签约方" width="60%">
@ -256,12 +475,7 @@
import type { FormInstance, UploadProps } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { useDictOptions } from "@/hooks/useDictOptions";
import {
adminAdd,
adminDetail,
adminEdit,
generateGontract,
} from "@/api/perms/admin";
import { adminAdd, adminDetail, adminEdit } from "@/api/perms/admin";
import { roleAll } from "@/api/perms/role";
import { jobsAll } from "@/api/org/post";
import { deptAll } from "@/api/org/department";
@ -274,15 +488,14 @@ import {
import { dictDataLists } from "@/api/setting/dict";
import DialogIndex from "./dialog_index.vue";
import useUserStore from "@/stores/modules/user";
defineProps({
isCheck: {},
});
const isCheck = ref(false);
const isCheckFn = (flag: boolean) => {
isCheck.value = flag;
};
const emit = defineEmits(["success", "close"]);
const formRef = shallowRef<FormInstance>();
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
console.log(mode);
const popupTitle = computed(() => {
return mode.value == "edit" ? "编辑管理员" : "新增管理员";
});
@ -310,46 +523,13 @@ const formData = reactive({
},
//
contract_type: "",
party_a: "",
file: "",
//
role_id: "",
avatar: "",
multipoint_login: 1,
root: 0,
});
// const formData = reactive({
// id: '',
// sex: '1',
// id_card: '513701200012105613',
// name: 'zmj',
// province: '',
// city: '',
// area: '',
// street: '',
// address: '',
// phone: '15884967539',
// // v-model="formData.party_a_name"
// party_a_name:"",
// qualification: {
// id_card: '',
// id_card_b: '',
// car_card: '',
// car_card_b: '',
// bank_account: '',
// bank_account_b: ''
// },
// //
// contract_type: '',
// //
// contract: '',
// file: '',
// is_contract: 0,
// role_id: "",
// avatar: '',
// multipoint_login: 1,
// root: 0
// })
//
const datas: any = reactive({
provinceOptions: [],
@ -370,8 +550,7 @@ getcontract_type();
const isCompany = ref(false);
function customEvent(data: any) {
isCompany.value = false;
// formData.contract.party_a = data.id
console.log(data);
formData.party_a = data.id;
formData.party_a_name = data.company_name;
}
//
@ -492,8 +671,11 @@ const { optionsData } = useDictOptions<{
api: deptAll,
},
});
const handleSubmit = async () => {
if (isCheck.value) {
popupRef.value?.close();
return;
}
await formRef.value?.validate();
mode.value == "edit"
? await adminEdit(formData)
@ -501,7 +683,6 @@ const handleSubmit = async () => {
popupRef.value?.close();
emit("success");
};
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
@ -598,20 +779,20 @@ const setFormData = async (row: any) => {
id: row.id,
});
for (const key in formData) {
let stringArr = ["sex", "province", "city", "area", "street"];
const stringArr = ["sex", "province", "city", "area", "street"];
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
key == "role_id"
? (formData[key] = data[key][0])
: (formData[key] = data[key]);
if (stringArr.includes(key)) {
formData[key] = formData[key].toString();
getCityList();
getAreaList();
getStreetList();
}
if (stringArr.includes(key)) formData[key] = formData[key].toString();
}
}
apiCityList({ city: formData.province }).then(() => {
apiAreaList({ area: formData.city }).then(() => {
apiStreetList({ street: formData.area });
});
});
};
const handleClose = () => {
@ -620,21 +801,22 @@ const handleClose = () => {
defineExpose({
open,
setFormData,
isCheckFn,
});
</script>
<style lang="scss">
.headimg {
width: 6.5vw;
height: 8vw;
overflow: hidden;
float: left;
margin-top: 24px;
width: 6.2vw;
height: 7.2vw;
float: left;
overflow: hidden;
}
.avatar-uploader-head .el-upload {
width: 7vw;
height: 8.5vw;
width: 6.2vw;
height: 7.2vw;
background-color: #fff;
border: 1px dashed var(--el-border-color);
border-radius: 6px;
@ -645,7 +827,7 @@ defineExpose({
}
.avatar-uploader .el-upload {
width: 10vw;
width: 9.9vw;
height: 6.3vw;
background-color: #fff;
border: 1px dashed var(--el-border-color);

View File

@ -56,10 +56,13 @@
@click="handleEdit(row)">编辑</el-button>
<el-button v-if="row.root != 1" v-perms="['auth.admin/delete']" type="danger" link
@click="handleDelete(row.id)">删除</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link @click="
; (showPop = true),
(showConctactPop = true),
(contractId = row.id)
">生成合同</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link
@click="showPop = true, showConctactPop = true, contractId = row.id">生成个人合同</el-button>
<el-button v-perms="['company/edit', 'company/add']" type="primary" link
@click=" showPop = true, contractId = row.id">发送短信</el-button>
@click="; (showPop = true), (contractId = row.id)">发送短信</el-button>
</div>
</template>
</el-table-column>
@ -72,8 +75,12 @@
<edit-popup v-if="showEdit" ref="editRef" :isCheck="isCheck" @success="getLists" @close="showEdit = false" />
<el-dialog v-model="showPop" @close="offPop">
<h1>重要提醒</h1>
<div class="content" v-if="showConctactPop">请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.</div>
<div class="content" v-else>确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约</div>
<div class="content" v-if="showConctactPop">
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
</div>
<div class="content" v-else>
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct">确认创建</el-button>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
@ -84,47 +91,42 @@
</template>
<script lang="ts" setup name="admin">
import {
adminEdit,
adminLists,
adminDelete,
generateGontract,
sendMsgApi,
} from "@/api/perms/admin";
import { roleAll } from "@/api/perms/role";
import { useDictOptions } from "@/hooks/useDictOptions";
import { usePaging } from "@/hooks/usePaging";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
import { adminEdit, adminLists, adminDelete } from '@/api/perms/admin'
import { generateGontract, sendMsgApi } from '@/api/company'
import { roleAll } from '@/api/perms/role'
import { useDictOptions } from '@/hooks/useDictOptions'
import { usePaging } from '@/hooks/usePaging'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const route = useRoute()
//
const formData = reactive({
name: "",
role_id: "",
});
const contractId = ref("");
name: '',
role_id: '',
company_id: route.query.company_id || ''
})
const contractId = ref('')
//
const showPop = ref(false);
const showConctactPop = ref(false);
const showPop = ref(false)
const showConctactPop = ref(false)
const offPop = () => {
showPop.value = false;
showConctactPop.value = false;
};
showPop.value = false
showConctactPop.value = false
}
const creContct = () => {
// feedback.msgSuccess("");
generateGontract({ id: contractId.value }).then(() => {
feedback.msgSuccess("发送成功");
});
offPop();
};
generateGontract({ id: contractId.value })
offPop()
}
const sendMsg = () => {
sendMsgApi({ id: contractId.value }).then((res) => {
feedback.msgSuccess("发送成功");
});
offPop();
};
console.log(res)
})
offPop()
}
//
const showEdit = ref(false);
const showEdit = ref(false)
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: adminLists,
params: formData,
@ -143,34 +145,39 @@ const changeStatus = (data: any) => {
});
};
//
const isCheck = ref(false);
const isCheck = ref(false)
const handleCheck = async (data: any) => {
isCheck.value = true;
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
isCheck.value = true
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
editRef.value?.isCheckFn(true)
}
const handleAdd = async () => {
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('add')
editRef.value?.isCheckFn(false)
}
const handleEdit = async (data: any) => {
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
editRef.value?.isCheckFn(false)
}
const handleDelete = async (id: number) => {
await feedback.confirm("确定要删除?");
await adminDelete({ id });
getLists();
};
await feedback.confirm('确定要删除?')
await adminDelete({ id })
getLists()
}
const { optionsData } = useDictOptions<{
role: any[];