解决冲突

This commit is contained in:
THK3121 2023-07-22 10:05:06 +08:00
parent 62780e0328
commit 2b0b343544
2 changed files with 1065 additions and 992 deletions

File diff suppressed because it is too large Load Diff

View File

@ -15,12 +15,12 @@
: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"
:data="{ cid: 1 }"
action="https://worker-task.lihaink.cn/api/upload/image"
:show-file-list="false"
:on-success="handleAvatarSuccessAvatar"
@ -32,9 +32,9 @@
</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"
@ -45,7 +45,7 @@
></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"
@ -60,7 +60,7 @@
</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"
@ -71,7 +71,7 @@
></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"
@ -119,7 +119,6 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="区" prop="area" style="flex: 1">
<el-select
:disabled="isCheck"
@ -166,9 +165,10 @@
</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"
@ -191,7 +191,32 @@
</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"
@ -206,236 +231,238 @@
</el-row>
</el-col>
<div style="font-size: 1.2rem; margin: 10px 0">资质信息</div>
<el-col :span="24">
<el-row>
<el-col :span="8">
<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-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-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">
<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-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-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">
<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-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-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-col>
<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-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-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-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-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-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-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="请选择合同类型"
<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 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 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>
</div>
<div>
<el-form-item label="行驶证" prop="car_card">
<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 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>
</div>
<div>
<el-form-item label="银行卡号" prop="bank_account">
<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 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>
</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-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"
action="https://worker-task.lihaink.cn/adminapi/upload/file"
:on-success="handleAvatarSuccess_four"
multiple
:limit="1"
>
<el-button type="primary">上传</el-button>
</el-upload>
</el-form-item>
</el-col>
></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-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-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-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-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-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>
</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"
action="https://worker-task.lihaink.cn/adminapi/upload/file"
: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%">
@ -447,12 +474,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";
@ -465,15 +487,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" ? "编辑管理员" : "新增管理员";
});
@ -482,7 +503,7 @@ const formData = reactive({
sex: "",
id_card: "",
name: "",
province: "120000",
province: "",
city: "",
area: "",
street: "",
@ -528,8 +549,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;
}
//
@ -650,8 +670,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)
@ -659,7 +682,6 @@ const handleSubmit = async () => {
popupRef.value?.close();
emit("success");
};
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
@ -776,21 +798,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;
@ -801,7 +824,7 @@ defineExpose({
}
.avatar-uploader .el-upload {
width: 10vw;
width: 9.9vw;
height: 6.3vw;
background-color: #fff;
border: 1px dashed var(--el-border-color);