更新
This commit is contained in:
parent
12c3facf77
commit
2f934876b0
@ -1,11 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="edit-popup">
|
<div class="edit-popup">
|
||||||
<el-form
|
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||||
ref="formRef"
|
|
||||||
:model="formData"
|
|
||||||
label-width="90px"
|
|
||||||
:rules="formRules"
|
|
||||||
>
|
|
||||||
<!-- <div style="font-size: 1.2rem; margin: 10px 0">公司基本信息创建</div> -->
|
<!-- <div style="font-size: 1.2rem; margin: 10px 0">公司基本信息创建</div> -->
|
||||||
<el-col :span="24" class="el-card pt-6">
|
<el-col :span="24" class="el-card pt-6">
|
||||||
<div class="tit">公司基本信息创建</div>
|
<div class="tit">公司基本信息创建</div>
|
||||||
@ -281,10 +276,7 @@
|
|||||||
<div class="tit">其他联系人</div>
|
<div class="tit">其他联系人</div>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<template
|
<template v-for="(item, index) in formData.other_contacts" :key="index">
|
||||||
v-for="(item, index) in formData.other_contacts"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="姓名" prop="field120">
|
<el-form-item label="姓名" prop="field120">
|
||||||
<el-input
|
<el-input
|
||||||
@ -449,11 +441,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item label-width="100px" label="被签约公司" prop="field131">
|
||||||
label-width="100px"
|
|
||||||
label="被签约公司"
|
|
||||||
prop="field131"
|
|
||||||
>
|
|
||||||
<el-input
|
<el-input
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
v-model="formData.company_name"
|
v-model="formData.company_name"
|
||||||
@ -464,11 +452,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item label-width="100px" label="合同类型" prop="contract_type">
|
||||||
label-width="100px"
|
|
||||||
label="合同类型"
|
|
||||||
prop="contract_type"
|
|
||||||
>
|
|
||||||
<el-select
|
<el-select
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
v-model="formData.contract.contract_type"
|
v-model="formData.contract.contract_type"
|
||||||
@ -526,7 +510,7 @@
|
|||||||
>完成</el-button
|
>完成</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="isDisabled"
|
v-if="isDisabled == false && isEdit == false"
|
||||||
type="primary"
|
type="primary"
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
size="medium"
|
size="medium"
|
||||||
@ -549,118 +533,108 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="companyEdit">
|
<script lang="ts" setup name="companyEdit">
|
||||||
import type {
|
import type { FormInstance, UploadProps, ElMessage, UploadUserFile } from 'element-plus'
|
||||||
FormInstance,
|
import Popup from '@/components/popup/index.vue'
|
||||||
UploadProps,
|
import { apiCompanyAdd, apiCompanyEdit, apiCompanyDetail, apiCompanyLists } from '@/api/company'
|
||||||
ElMessage,
|
|
||||||
UploadUserFile,
|
|
||||||
} from "element-plus";
|
|
||||||
import Popup from "@/components/popup/index.vue";
|
|
||||||
import {
|
|
||||||
apiCompanyAdd,
|
|
||||||
apiCompanyEdit,
|
|
||||||
apiCompanyDetail,
|
|
||||||
apiCompanyLists,
|
|
||||||
} from "@/api/company";
|
|
||||||
import {
|
import {
|
||||||
apiCityList,
|
apiCityList,
|
||||||
apiAreaList,
|
apiAreaList,
|
||||||
apiStreetList,
|
apiStreetList,
|
||||||
apiProvinceList,
|
apiProvinceList,
|
||||||
apiVillageList,
|
apiVillageList,
|
||||||
apiBrigadeList,
|
apiBrigadeList
|
||||||
} from "@/api/common";
|
} from '@/api/common'
|
||||||
import { dictDataLists } from "@/api/setting/dict";
|
import { dictDataLists } from '@/api/setting/dict'
|
||||||
import { timeFormat } from "@/utils/util";
|
import { timeFormat } from '@/utils/util'
|
||||||
import DialogIndex from "./dialog_index.vue";
|
import DialogIndex from './dialog_index.vue'
|
||||||
import DialogIndexMan from "./dialog_index_man.vue";
|
import DialogIndexMan from './dialog_index_man.vue'
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from 'vue'
|
||||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
import useMultipleTabs from '@/hooks/useMultipleTabs'
|
||||||
import useUserStore from "@/stores/modules/user";
|
import useUserStore from '@/stores/modules/user'
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore()
|
||||||
const { removeTab } = useMultipleTabs();
|
const { removeTab } = useMultipleTabs()
|
||||||
const router = useRouter();
|
const router = useRouter()
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
let isshow = ref(true);
|
let isshow = ref(true)
|
||||||
let imgflag = ref(true);
|
let imgflag = ref(true)
|
||||||
let isDisabled = ref(false);
|
let isDisabled = ref(false)
|
||||||
if (route.query.flag) {
|
if (route.query.flag) {
|
||||||
isshow = false;
|
isshow = false
|
||||||
}
|
}
|
||||||
if (route.query.isshow) {
|
if (route.query.isshow) {
|
||||||
imgflag = false;
|
imgflag = false
|
||||||
isDisabled = true;
|
isDisabled = true
|
||||||
}
|
}
|
||||||
|
console.log(isDisabled)
|
||||||
// 公司类型
|
// 公司类型
|
||||||
const indexType = ref(0);
|
const indexType = ref(0)
|
||||||
|
|
||||||
let isEdit = ref(false);
|
let isEdit = ref(false)
|
||||||
defineProps({
|
defineProps({
|
||||||
dictData: {
|
dictData: {
|
||||||
type: Object as PropType<Record<string, any[]>>,
|
type: Object as PropType<Record<string, any[]>>,
|
||||||
default: () => ({}),
|
default: () => ({})
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
const emit = defineEmits(["success", "close"]);
|
const emit = defineEmits(['success', 'close'])
|
||||||
const formRef = shallowRef<FormInstance>();
|
const formRef = shallowRef<FormInstance>()
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
const mode = ref();
|
const mode = ref()
|
||||||
if (route.query.read) {
|
if (route.query.read) {
|
||||||
isDisabled = route.query.read;
|
isDisabled = route.query.read
|
||||||
}
|
}
|
||||||
if (route.query.edit) {
|
if (route.query.edit) {
|
||||||
isEdit = route.query.edit;
|
isEdit = route.query.edit
|
||||||
}
|
}
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
admin_id: "",
|
admin_id: '',
|
||||||
admin_name: "",
|
admin_name: '',
|
||||||
area_manager: "",
|
area_manager: '',
|
||||||
area_manager_name: "",
|
area_manager_name: '',
|
||||||
id: "",
|
id: '',
|
||||||
// level_two: '',
|
// level_two: '',
|
||||||
// level_one: '',
|
// level_one: '',
|
||||||
company_name: "",
|
company_name: '',
|
||||||
organization_code: "",
|
organization_code: '',
|
||||||
province: "",
|
province: '',
|
||||||
city: "",
|
city: '',
|
||||||
area: "",
|
area: '',
|
||||||
street: "",
|
street: '',
|
||||||
village: "",
|
village: '',
|
||||||
brigade: "",
|
brigade: '',
|
||||||
address: "",
|
address: '',
|
||||||
company_type: "",
|
company_type: '',
|
||||||
avatar: "",
|
avatar: '',
|
||||||
sex: "1",
|
sex: '1',
|
||||||
id_card: "",
|
id_card: '',
|
||||||
master_name: "",
|
master_name: '',
|
||||||
master_position: "",
|
master_position: '',
|
||||||
master_phone: "",
|
master_phone: '',
|
||||||
master_email: "",
|
master_email: '',
|
||||||
other_contacts: [],
|
other_contacts: [],
|
||||||
qualification: {
|
qualification: {
|
||||||
business_license: "",
|
business_license: '',
|
||||||
business_licenseB: "",
|
business_licenseB: '',
|
||||||
bank_account: [],
|
bank_account: [],
|
||||||
bank_accountB: [],
|
bank_accountB: []
|
||||||
},
|
},
|
||||||
contract: {
|
contract: {
|
||||||
contract_type: "",
|
contract_type: '',
|
||||||
party_a: 0,
|
party_a: 0,
|
||||||
file: "",
|
file: '',
|
||||||
contract_no: "系统自动生成",
|
contract_no: '系统自动生成',
|
||||||
type: 1,
|
type: 1
|
||||||
},
|
},
|
||||||
//签约方
|
//签约方
|
||||||
party_a_name: "",
|
party_a_name: '',
|
||||||
file_image: "",
|
file_image: ''
|
||||||
// status: ''
|
// status: ''
|
||||||
});
|
})
|
||||||
|
|
||||||
if (userStore.userInfo.root == 0) {
|
if (userStore.userInfo.root == 0) {
|
||||||
formData.contract.party_a = userStore.userInfo.company?.id;
|
formData.contract.party_a = userStore.userInfo.company?.id
|
||||||
formData.party_a_name = userStore.userInfo.company?.company_name;
|
formData.party_a_name = userStore.userInfo.company?.company_name
|
||||||
}
|
}
|
||||||
const datas = reactive({
|
const datas = reactive({
|
||||||
provinceOptions: [],
|
provinceOptions: [],
|
||||||
@ -671,363 +645,336 @@ const datas = reactive({
|
|||||||
brigadeOptions: [],
|
brigadeOptions: [],
|
||||||
dictTypeLists: [],
|
dictTypeLists: [],
|
||||||
contract_type: [],
|
contract_type: [],
|
||||||
company_list: [],
|
company_list: []
|
||||||
});
|
})
|
||||||
const fileList = ref<UploadUserFile[]>([]);
|
const fileList = ref<UploadUserFile[]>([])
|
||||||
// 表单验证
|
// 表单验证
|
||||||
const formRules = reactive<any>({
|
const formRules = reactive<any>({
|
||||||
company_name: [
|
company_name: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入公司名称",
|
message: '请输入公司名称',
|
||||||
trigger: ["blur"],
|
trigger: ['blur']
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
organization_code: [
|
organization_code: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入组织机构代码",
|
message: '请输入组织机构代码',
|
||||||
trigger: ["blur"],
|
trigger: ['blur']
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
master_name: [
|
master_name: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入主联系人姓名",
|
message: '请输入主联系人姓名',
|
||||||
trigger: ["blur"],
|
trigger: ['blur']
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
master_position: [
|
master_position: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入主联系人职务",
|
message: '请输入主联系人职务',
|
||||||
trigger: ["blur"],
|
trigger: ['blur']
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
master_phone: [
|
master_phone: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入主联系人手机",
|
message: '请输入主联系人手机',
|
||||||
trigger: ["blur"],
|
trigger: ['blur']
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
account: [
|
account: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入账号",
|
message: '请输入账号',
|
||||||
trigger: ["blur"],
|
trigger: ['blur']
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入密码",
|
message: '请输入密码',
|
||||||
trigger: ["blur"],
|
trigger: ['blur']
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
});
|
})
|
||||||
const isCompany = ref(false);
|
const isCompany = ref(false)
|
||||||
const isMan = ref(false);
|
const isMan = ref(false)
|
||||||
const isAreaManager = ref(false);
|
const isAreaManager = ref(false)
|
||||||
const isArea = ref(false);
|
const isArea = ref(false)
|
||||||
const isStreet = ref(false);
|
const isStreet = ref(false)
|
||||||
const isVillage = ref(false);
|
const isVillage = ref(false)
|
||||||
const isBrigade = ref(false);
|
const isBrigade = ref(false)
|
||||||
const partyDisabled = ref(true);
|
const partyDisabled = ref(true)
|
||||||
|
|
||||||
function customEvent(data: any) {
|
function customEvent(data: any) {
|
||||||
isCompany.value = false;
|
isCompany.value = false
|
||||||
formData.contract.party_a = data.id;
|
formData.contract.party_a = data.id
|
||||||
formData.party_a_name = data.company_name;
|
formData.party_a_name = data.company_name
|
||||||
}
|
}
|
||||||
function customEventMan(data: any) {
|
function customEventMan(data: any) {
|
||||||
isMan.value = false;
|
isMan.value = false
|
||||||
formData.admin_name = data.name;
|
formData.admin_name = data.name
|
||||||
formData.admin_id = data.id;
|
formData.admin_id = data.id
|
||||||
}
|
}
|
||||||
//区域管理人员
|
//区域管理人员
|
||||||
function EventAreaManager(data: any) {
|
function EventAreaManager(data: any) {
|
||||||
isAreaManager.value = false;
|
isAreaManager.value = false
|
||||||
formData.area_manager_name = data.name;
|
formData.area_manager_name = data.name
|
||||||
formData.area_manager = data.id;
|
formData.area_manager = data.id
|
||||||
}
|
}
|
||||||
function openCompany() {
|
function openCompany() {
|
||||||
isCompany.value = true;
|
isCompany.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取详情
|
// 获取详情
|
||||||
const setFormData = async (data: Record<any, any>) => {
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
console.log(formData);
|
console.log(formData)
|
||||||
|
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
formData[key] = data[key];
|
formData[key] = data[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
const getDetail = async (row: Record<string, any>) => {
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
const data = await apiCompanyDetail({
|
const data = await apiCompanyDetail({
|
||||||
id: row.id,
|
id: row.id
|
||||||
});
|
})
|
||||||
setFormData(data);
|
setFormData(data)
|
||||||
};
|
}
|
||||||
|
|
||||||
//上传图片1
|
//上传图片1
|
||||||
const handleAvatarSuccess: UploadProps["onSuccess"] = (
|
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||||
response,
|
|
||||||
uploadFile
|
|
||||||
) => {
|
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
ElMessage.error(response.msg);
|
ElMessage.error(response.msg)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
formData.qualification.business_license = response.data.uri;
|
formData.qualification.business_license = response.data.uri
|
||||||
};
|
}
|
||||||
const handleAvatarSuccessB: UploadProps["onSuccess"] = (
|
const handleAvatarSuccessB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||||
response,
|
|
||||||
uploadFile
|
|
||||||
) => {
|
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
ElMessage.error(response.msg);
|
ElMessage.error(response.msg)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
formData.qualification.business_licenseB = response.data.uri;
|
formData.qualification.business_licenseB = response.data.uri
|
||||||
};
|
}
|
||||||
//上传图片2
|
//上传图片2
|
||||||
const handleAvatarSuccess_two: UploadProps["onSuccess"] = (
|
const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||||
response,
|
|
||||||
uploadFile
|
|
||||||
) => {
|
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
ElMessage.error(response.msg);
|
ElMessage.error(response.msg)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
formData.qualification.bank_account.push(response.data.uri);
|
formData.qualification.bank_account.push(response.data.uri)
|
||||||
};
|
}
|
||||||
const handleAvatarSuccess_twoB: UploadProps["onSuccess"] = (
|
const handleAvatarSuccess_twoB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||||
response,
|
|
||||||
uploadFile
|
|
||||||
) => {
|
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
ElMessage.error(response.msg);
|
ElMessage.error(response.msg)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
formData.qualification.bank_accountB = response.data.uri;
|
formData.qualification.bank_accountB = response.data.uri
|
||||||
};
|
}
|
||||||
//上传文件3
|
//上传文件3
|
||||||
const handleAvatarSuccess_three: UploadProps["onSuccess"] = (
|
const handleAvatarSuccess_three: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||||
response,
|
|
||||||
uploadFile
|
|
||||||
) => {
|
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
ElMessage.error(response.msg);
|
ElMessage.error(response.msg)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
formData.file_image = response.data.uri;
|
formData.file_image = response.data.uri
|
||||||
formData.contract.file = response.data.uri;
|
formData.contract.file = response.data.uri
|
||||||
fileList.value[0].url = response.data.uri;
|
fileList.value[0].url = response.data.uri
|
||||||
fileList.value[0].name = "合同文件";
|
fileList.value[0].name = '合同文件'
|
||||||
};
|
}
|
||||||
|
|
||||||
//增加其他联系人
|
//增加其他联系人
|
||||||
function other() {
|
function other() {
|
||||||
formData.other_contacts.push({
|
formData.other_contacts.push({
|
||||||
name: "",
|
name: '',
|
||||||
position: "",
|
position: '',
|
||||||
phone: "",
|
phone: '',
|
||||||
email: "",
|
email: ''
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
function company_type_change(type: any) {
|
function company_type_change(type: any) {
|
||||||
//区
|
//区
|
||||||
const arr = [30, 14, 15];
|
const arr = [30, 14, 15]
|
||||||
if (arr.indexOf(type) > -1) {
|
if (arr.indexOf(type) > -1) {
|
||||||
isArea.value = true;
|
isArea.value = true
|
||||||
isStreet.value = false;
|
isStreet.value = false
|
||||||
isVillage.value = false;
|
isVillage.value = false
|
||||||
isBrigade.value = false;
|
isBrigade.value = false
|
||||||
formData.street = "";
|
formData.street = ''
|
||||||
formData.village = "";
|
formData.village = ''
|
||||||
formData.brigade = "";
|
formData.brigade = ''
|
||||||
return true;
|
return true
|
||||||
}
|
}
|
||||||
//镇
|
//镇
|
||||||
if (type == 16) {
|
if (type == 16) {
|
||||||
isArea.value = true;
|
isArea.value = true
|
||||||
isStreet.value = true;
|
isStreet.value = true
|
||||||
isVillage.value = false;
|
isVillage.value = false
|
||||||
isBrigade.value = false;
|
isBrigade.value = false
|
||||||
formData.village = "";
|
formData.village = ''
|
||||||
formData.brigade = "";
|
formData.brigade = ''
|
||||||
partyDisabled.value = true;
|
partyDisabled.value = true
|
||||||
indexType.value = 30;
|
indexType.value = 30
|
||||||
return true;
|
return true
|
||||||
}
|
}
|
||||||
if (type != 16) {
|
if (type != 16) {
|
||||||
partyDisabled.value = false;
|
partyDisabled.value = false
|
||||||
}
|
}
|
||||||
//村
|
//村
|
||||||
if (type == 17) {
|
if (type == 17) {
|
||||||
isArea.value = true;
|
isArea.value = true
|
||||||
isStreet.value = true;
|
isStreet.value = true
|
||||||
isVillage.value = true;
|
isVillage.value = true
|
||||||
isBrigade.value = false;
|
isBrigade.value = false
|
||||||
formData.brigade = "";
|
formData.brigade = ''
|
||||||
return true;
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
//队
|
//队
|
||||||
if (type == 18) {
|
if (type == 18) {
|
||||||
isArea.value = true;
|
isArea.value = true
|
||||||
isStreet.value = true;
|
isStreet.value = true
|
||||||
isVillage.value = true;
|
isVillage.value = true
|
||||||
isBrigade.value = true;
|
isBrigade.value = true
|
||||||
return true;
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//获取省份
|
//获取省份
|
||||||
function province_change(value: string) {
|
function province_change(value: string) {
|
||||||
getCityList();
|
getCityList()
|
||||||
}
|
}
|
||||||
function city_change(value: string) {
|
function city_change(value: string) {
|
||||||
getAreaList();
|
getAreaList()
|
||||||
}
|
}
|
||||||
function area_change(value: string) {
|
function area_change(value: string) {
|
||||||
getStreetList();
|
getStreetList()
|
||||||
}
|
}
|
||||||
function street_change(value: string) {
|
function street_change(value: string) {
|
||||||
getVillageList();
|
getVillageList()
|
||||||
}
|
}
|
||||||
function village_change(value: string) {
|
function village_change(value: string) {
|
||||||
getBrigadeList();
|
getBrigadeList()
|
||||||
}
|
}
|
||||||
// function brigade_change(value: string) {
|
// function brigade_change(value: string) {
|
||||||
// formData.brigade = value
|
// formData.brigade = value
|
||||||
// }
|
// }
|
||||||
const getProvinceList = async () => {
|
const getProvinceList = async () => {
|
||||||
const data = await apiProvinceList({});
|
const data = await apiProvinceList({})
|
||||||
datas["provinceOptions"] = data;
|
datas['provinceOptions'] = data
|
||||||
};
|
}
|
||||||
const getCityList = async () => {
|
const getCityList = async () => {
|
||||||
const data = await apiCityList({ city: formData.province });
|
const data = await apiCityList({ city: formData.province })
|
||||||
datas["cityOptions"] = data;
|
datas['cityOptions'] = data
|
||||||
};
|
}
|
||||||
const getAreaList = async () => {
|
const getAreaList = async () => {
|
||||||
const data = await apiAreaList({ area: formData.city });
|
const data = await apiAreaList({ area: formData.city })
|
||||||
datas["areaOptions"] = data;
|
datas['areaOptions'] = data
|
||||||
};
|
}
|
||||||
const getStreetList = async () => {
|
const getStreetList = async () => {
|
||||||
const data = await apiStreetList({ street: formData.area });
|
const data = await apiStreetList({ street: formData.area })
|
||||||
datas["streetOptions"] = data;
|
datas['streetOptions'] = data
|
||||||
};
|
}
|
||||||
const getVillageList = async () => {
|
const getVillageList = async () => {
|
||||||
const data = await apiVillageList({ village: formData.street });
|
const data = await apiVillageList({ village: formData.street })
|
||||||
datas["villageOptions"] = data;
|
datas['villageOptions'] = data
|
||||||
};
|
}
|
||||||
const getBrigadeList = async () => {
|
const getBrigadeList = async () => {
|
||||||
const data = await apiBrigadeList();
|
const data = await apiBrigadeList()
|
||||||
datas["brigadeOptions"] = data;
|
datas['brigadeOptions'] = data
|
||||||
};
|
}
|
||||||
getProvinceList();
|
getProvinceList()
|
||||||
|
|
||||||
const getcontract_type = async () => {
|
const getcontract_type = async () => {
|
||||||
const data = await dictDataLists({ type_id: 7 });
|
const data = await dictDataLists({ type_id: 7 })
|
||||||
datas["contract_type"] = data["lists"];
|
datas['contract_type'] = data['lists']
|
||||||
};
|
}
|
||||||
const getdictTypeLists = async () => {
|
const getdictTypeLists = async () => {
|
||||||
const data = await dictDataLists({ type_id: 6 });
|
const data = await dictDataLists({ type_id: 6 })
|
||||||
datas["dictTypeLists"] = data["lists"];
|
datas['dictTypeLists'] = data['lists']
|
||||||
};
|
}
|
||||||
|
|
||||||
const getDetails = async () => {
|
const getDetails = async () => {
|
||||||
const data = await apiCompanyDetail({
|
const data = await apiCompanyDetail({
|
||||||
id: route.query.id,
|
id: route.query.id
|
||||||
});
|
})
|
||||||
if (data.company_type == 16) {
|
if (data.company_type == 16) {
|
||||||
indexType.value = 30;
|
indexType.value = 30
|
||||||
partyDisabled.value = true;
|
partyDisabled.value = true
|
||||||
}
|
}
|
||||||
Object.keys(formData).forEach((key) => {
|
Object.keys(formData).forEach((key) => {
|
||||||
const stringArr = [
|
const stringArr = ['province', 'city', 'area', 'street', 'village', 'brigade']
|
||||||
"province",
|
|
||||||
"city",
|
|
||||||
"area",
|
|
||||||
"street",
|
|
||||||
"village",
|
|
||||||
"brigade",
|
|
||||||
];
|
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
formData[key] = data[key];
|
formData[key] = data[key]
|
||||||
if (key == "qualification" && formData.qualification.bank_account) {
|
if (key == 'qualification' && formData.qualification.bank_account) {
|
||||||
try {
|
try {
|
||||||
if (Array.isArray(JSON.parse(formData.qualification.bank_account))) {
|
if (Array.isArray(JSON.parse(formData.qualification.bank_account))) {
|
||||||
formData.qualification.bank_account = JSON.parse(
|
formData.qualification.bank_account = JSON.parse(
|
||||||
formData.qualification.bank_account
|
formData.qualification.bank_account
|
||||||
);
|
)
|
||||||
} else {
|
} else {
|
||||||
const str = formData.qualification.bank_account;
|
const str = formData.qualification.bank_account
|
||||||
formData.qualification.bank_account = [];
|
formData.qualification.bank_account = []
|
||||||
formData.qualification.bank_account.push(str);
|
formData.qualification.bank_account.push(str)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const str = formData.qualification.bank_account;
|
const str = formData.qualification.bank_account
|
||||||
formData.qualification.bank_account = [];
|
formData.qualification.bank_account = []
|
||||||
formData.qualification.bank_account.push(str);
|
formData.qualification.bank_account.push(str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stringArr.includes(key)) formData[key] = formData[key].toString();
|
if (stringArr.includes(key)) formData[key] = formData[key].toString()
|
||||||
});
|
})
|
||||||
await getCityList();
|
await getCityList()
|
||||||
await getAreaList();
|
await getAreaList()
|
||||||
await getStreetList();
|
await getStreetList()
|
||||||
await getVillageList();
|
await getVillageList()
|
||||||
await getBrigadeList();
|
await getBrigadeList()
|
||||||
formData["party_a_name"] = data.contract?.party_a_info.company_name;
|
formData['party_a_name'] = data.contract?.party_a_info.company_name
|
||||||
// formData['file_image'] = data.contract?.file
|
// formData['file_image'] = data.contract?.file
|
||||||
// if (data.contract?.file) {
|
// if (data.contract?.file) {
|
||||||
// fileList.value[0].url = data.contract?.file
|
// fileList.value[0].url = data.contract?.file
|
||||||
// fileList.value[0].name = '合同文件'
|
// fileList.value[0].name = '合同文件'
|
||||||
// }
|
// }
|
||||||
console.log(formData);
|
console.log(formData)
|
||||||
company_type_change(formData.company_type);
|
company_type_change(formData.company_type)
|
||||||
};
|
}
|
||||||
|
|
||||||
getdictTypeLists();
|
getdictTypeLists()
|
||||||
getcontract_type();
|
getcontract_type()
|
||||||
|
|
||||||
const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
|
const handleAvatarSuccessAvatar: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||||
response,
|
|
||||||
uploadFile
|
|
||||||
) => {
|
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
ElMessage.error(response.msg);
|
ElMessage.error(response.msg)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
formData.avatar = response.data.uri;
|
formData.avatar = response.data.uri
|
||||||
};
|
}
|
||||||
const create = async () => {
|
const create = async () => {
|
||||||
await formRef.value?.validate();
|
await formRef.value?.validate()
|
||||||
const data = JSON.parse(JSON.stringify({ ...formData }));
|
const data = JSON.parse(JSON.stringify({ ...formData }))
|
||||||
data.qualification.bank_account = JSON.stringify(
|
data.qualification.bank_account = JSON.stringify(data.qualification.bank_account)
|
||||||
data.qualification.bank_account
|
|
||||||
);
|
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
await apiCompanyEdit(data);
|
await apiCompanyEdit(data)
|
||||||
} else {
|
} else {
|
||||||
await apiCompanyAdd(data);
|
await apiCompanyAdd(data)
|
||||||
}
|
}
|
||||||
removeTab();
|
removeTab()
|
||||||
router.back();
|
router.back()
|
||||||
};
|
}
|
||||||
route.query.id && getDetails();
|
route.query.id && getDetails()
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
setFormData,
|
setFormData,
|
||||||
getDetail,
|
getDetail
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.tit {
|
.tit {
|
||||||
|
@ -26,11 +26,7 @@
|
|||||||
placeholder="请输入镇"
|
placeholder="请输入镇"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item label="公司类型" prop="company_type" v-show="company_type_show">
|
||||||
label="公司类型"
|
|
||||||
prop="company_type"
|
|
||||||
v-show="company_type_show"
|
|
||||||
>
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.company_type"
|
v-model="queryParams.company_type"
|
||||||
placeholder="请选择公司类型"
|
placeholder="请选择公司类型"
|
||||||
@ -76,8 +72,8 @@
|
|||||||
:to="{
|
:to="{
|
||||||
path: getRoutePath('company/add:edit'),
|
path: getRoutePath('company/add:edit'),
|
||||||
query: {
|
query: {
|
||||||
flag: true,
|
flag: true
|
||||||
},
|
}
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-button type="primary" class="mb-4">
|
<el-button type="primary" class="mb-4">
|
||||||
@ -87,8 +83,7 @@
|
|||||||
创建
|
创建
|
||||||
</el-button>
|
</el-button>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<!-- <router-link
|
||||||
<router-link
|
|
||||||
:to="{
|
:to="{
|
||||||
path: getRoutePath('company/add:edit'),
|
path: getRoutePath('company/add:edit'),
|
||||||
query: {
|
query: {
|
||||||
@ -99,62 +94,25 @@
|
|||||||
>
|
>
|
||||||
<el-button type="primary" class="mb-4">
|
<el-button type="primary" class="mb-4">
|
||||||
我的公司
|
我的公司
|
||||||
</el-button></router-link
|
</el-button></router-link -->
|
||||||
>
|
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||||
<el-table-column
|
<el-table-column label="id" prop="id" show-overflow-tooltip width="60" />
|
||||||
label="id"
|
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip />
|
||||||
prop="id"
|
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
|
||||||
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 />
|
<el-table-column label="区县" prop="area" show-overflow-tooltip />
|
||||||
<el-table-column label="乡镇" prop="street" show-overflow-tooltip />
|
<el-table-column label="乡镇" prop="street" show-overflow-tooltip />
|
||||||
<el-table-column
|
<el-table-column label="主联系人" prop="master_name" show-overflow-tooltip />
|
||||||
label="主联系人"
|
<el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip />
|
||||||
prop="master_name"
|
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip />
|
||||||
show-overflow-tooltip
|
<el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip>
|
||||||
/>
|
|
||||||
<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
|
|
||||||
>
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row.is_contract == 1" style="color: #67c23a"
|
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
|
||||||
>已签约</span
|
|
||||||
>
|
|
||||||
<span v-else style="color: #fe0000">未签约</span>
|
<span v-else style="color: #fe0000">未签约</span>
|
||||||
</template></el-table-column
|
</template></el-table-column
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column label="操作" align="center" width="500" fixed="right">
|
||||||
label="操作"
|
|
||||||
align="center"
|
|
||||||
width="500"
|
|
||||||
fixed="right"
|
|
||||||
>
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<el-button type="primary" link>
|
<el-button type="primary" link>
|
||||||
@ -163,8 +121,8 @@
|
|||||||
path: getRoutePath('auth.admin/lists'),
|
path: getRoutePath('auth.admin/lists'),
|
||||||
query: {
|
query: {
|
||||||
company_id: row.id,
|
company_id: row.id,
|
||||||
read: true,
|
read: true
|
||||||
},
|
}
|
||||||
}"
|
}"
|
||||||
>查看成员</router-link
|
>查看成员</router-link
|
||||||
>
|
>
|
||||||
@ -175,8 +133,8 @@
|
|||||||
path: getRoutePath('company/subordinate/lists'),
|
path: getRoutePath('company/subordinate/lists'),
|
||||||
query: {
|
query: {
|
||||||
company_id: row.id,
|
company_id: row.id,
|
||||||
read: true,
|
read: true
|
||||||
},
|
}
|
||||||
}"
|
}"
|
||||||
>下属公司</router-link
|
>下属公司</router-link
|
||||||
>
|
>
|
||||||
@ -188,8 +146,8 @@
|
|||||||
query: {
|
query: {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
read: true,
|
read: true,
|
||||||
isshow: true,
|
isshow: true
|
||||||
},
|
}
|
||||||
}"
|
}"
|
||||||
>详情</router-link
|
>详情</router-link
|
||||||
>
|
>
|
||||||
@ -200,8 +158,8 @@
|
|||||||
path: getRoutePath('company/add:edit'),
|
path: getRoutePath('company/add:edit'),
|
||||||
query: {
|
query: {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
edit: true,
|
edit: true
|
||||||
},
|
}
|
||||||
}"
|
}"
|
||||||
>合同签约</router-link
|
>合同签约</router-link
|
||||||
>
|
>
|
||||||
@ -240,7 +198,7 @@
|
|||||||
v-perms="['company/postsms']"
|
v-perms="['company/postsms']"
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
@click="(showPop = true), (contractId = row.id)"
|
@click=";(showPop = true), (contractId = row.id)"
|
||||||
>发送短信</el-button
|
>发送短信</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
@ -253,10 +211,7 @@
|
|||||||
<pagination v-model="pager" @change="getLists" />
|
<pagination v-model="pager" @change="getLists" />
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog
|
<el-dialog v-model="showInitiateContractPop" @close="offInitiateContractPop">
|
||||||
v-model="showInitiateContractPop"
|
|
||||||
@close="offInitiateContractPop"
|
|
||||||
>
|
|
||||||
<h1>重要提醒</h1>
|
<h1>重要提醒</h1>
|
||||||
<div>
|
<div>
|
||||||
<div class="content">请确认信息是否有误</div>
|
<div class="content">请确认信息是否有误</div>
|
||||||
@ -264,11 +219,7 @@
|
|||||||
<el-col :span="24" class="el-card pt-6">
|
<el-col :span="24" class="el-card pt-6">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item label-width="100px" label="签约方" prop="field130">
|
||||||
label-width="100px"
|
|
||||||
label="签约方"
|
|
||||||
prop="field130"
|
|
||||||
>
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="contractFormData.party_a"
|
v-model="contractFormData.party_a"
|
||||||
placeholder="请选择签约方"
|
placeholder="请选择签约方"
|
||||||
@ -322,11 +273,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item
|
<el-form-item label-width="100px" label="合同编号" prop="field133">
|
||||||
label-width="100px"
|
|
||||||
label="合同编号"
|
|
||||||
prop="field133"
|
|
||||||
>
|
|
||||||
<el-input
|
<el-input
|
||||||
placeholder="系统自动生成"
|
placeholder="系统自动生成"
|
||||||
v-model="contractFormData.contract_no"
|
v-model="contractFormData.contract_no"
|
||||||
@ -356,16 +303,10 @@
|
|||||||
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
|
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
|
||||||
</div>
|
</div>
|
||||||
<p class="btn_menu">
|
<p class="btn_menu">
|
||||||
<el-button
|
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
|
||||||
type="primary"
|
|
||||||
size="large"
|
|
||||||
v-if="showConctactPop"
|
|
||||||
@click="creContct"
|
|
||||||
>确认创建</el-button
|
>确认创建</el-button
|
||||||
>
|
>
|
||||||
<el-button type="primary" size="large" v-else @click="sendMsg"
|
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
|
||||||
>确认</el-button
|
|
||||||
>
|
|
||||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||||
</p>
|
</p>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -373,9 +314,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="companyLists">
|
<script lang="ts" setup name="companyLists">
|
||||||
import { usePaging } from "@/hooks/usePaging";
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import { useDictData } from "@/hooks/useDictOptions";
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
import useUserStore from "@/stores/modules/user";
|
import useUserStore from '@/stores/modules/user'
|
||||||
import {
|
import {
|
||||||
apiCompanyLists,
|
apiCompanyLists,
|
||||||
companyListTwo,
|
companyListTwo,
|
||||||
@ -384,159 +325,156 @@ import {
|
|||||||
sendMsgApi,
|
sendMsgApi,
|
||||||
authentication,
|
authentication,
|
||||||
apiCompanyDetail,
|
apiCompanyDetail,
|
||||||
initiate_contract,
|
initiate_contract
|
||||||
} from "@/api/company";
|
} from '@/api/company'
|
||||||
import { timeFormat } from "@/utils/util";
|
import { timeFormat } from '@/utils/util'
|
||||||
import feedback from "@/utils/feedback";
|
import feedback from '@/utils/feedback'
|
||||||
import { dictDataLists } from "@/api/setting/dict";
|
import { dictDataLists } from '@/api/setting/dict'
|
||||||
import { getRoutePath } from "@/router";
|
import { getRoutePath } from '@/router'
|
||||||
import DialogIndex from "./dialog_index.vue";
|
import DialogIndex from './dialog_index.vue'
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore()
|
||||||
console.log(userStore.userInfo.company_id);
|
console.log(userStore.userInfo.company_id)
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const company_type_show = ref(true);
|
const company_type_show = ref(true)
|
||||||
// 创建合同与发送短信
|
// 创建合同与发送短信
|
||||||
//弹窗
|
//弹窗
|
||||||
const showPop = ref(false);
|
const showPop = ref(false)
|
||||||
const showConctactPop = ref(false);
|
const showConctactPop = ref(false)
|
||||||
const offPop = () => {
|
const offPop = () => {
|
||||||
showPop.value = false;
|
showPop.value = false
|
||||||
showConctactPop.value = false;
|
showConctactPop.value = false
|
||||||
};
|
}
|
||||||
const InitiateContractPop = ref(false);
|
const InitiateContractPop = ref(false)
|
||||||
const showInitiateContractPop = ref(false);
|
const showInitiateContractPop = ref(false)
|
||||||
const offInitiateContractPop = () => {
|
const offInitiateContractPop = () => {
|
||||||
showPop.value = false;
|
showPop.value = false
|
||||||
showConctactPop.value = false;
|
showConctactPop.value = false
|
||||||
};
|
}
|
||||||
// 创建合同的id
|
// 创建合同的id
|
||||||
const contractId = ref("");
|
const contractId = ref('')
|
||||||
|
|
||||||
// 合同
|
// 合同
|
||||||
const contractFormData = ref({
|
const contractFormData = ref({
|
||||||
party_a: "",
|
party_a: '',
|
||||||
party_a_name: "",
|
party_a_name: '',
|
||||||
party_b: "",
|
party_b: '',
|
||||||
party_b_name: "",
|
party_b_name: '',
|
||||||
contract_type: "",
|
contract_type: '',
|
||||||
contract_no: "",
|
contract_no: ''
|
||||||
});
|
})
|
||||||
|
|
||||||
const company_list = ref([]);
|
const company_list = ref([])
|
||||||
const contract_type = ref([]);
|
const contract_type = ref([])
|
||||||
|
|
||||||
const getDetails = async (id: any) => {
|
const getDetails = async (id: any) => {
|
||||||
const data = await apiCompanyDetail({
|
const data = await apiCompanyDetail({
|
||||||
id: id,
|
id: id
|
||||||
});
|
})
|
||||||
companyListTwo().then((res) => {
|
companyListTwo().then((res) => {
|
||||||
company_list.value = res;
|
company_list.value = res
|
||||||
});
|
})
|
||||||
dictDataLists({ type_id: 7 }).then((res) => {
|
dictDataLists({ type_id: 7 }).then((res) => {
|
||||||
contract_type.value = res.lists;
|
contract_type.value = res.lists
|
||||||
});
|
})
|
||||||
contractFormData.value.party_b = data.id;
|
contractFormData.value.party_b = data.id
|
||||||
contractFormData.value.party_b_name = data.company_name;
|
contractFormData.value.party_b_name = data.company_name
|
||||||
if (userStore.userInfo.company.id) {
|
if (userStore.userInfo.company.id) {
|
||||||
contractFormData.value.party_a = userStore.userInfo.company.id;
|
contractFormData.value.party_a = userStore.userInfo.company.id
|
||||||
contractFormData.value.party_a_name =
|
contractFormData.value.party_a_name = userStore.userInfo.company.company_name
|
||||||
userStore.userInfo.company.company_name;
|
|
||||||
} else {
|
} else {
|
||||||
contractFormData.value.party_a = "";
|
contractFormData.value.party_a = ''
|
||||||
contractFormData.value.party_a_name = "";
|
contractFormData.value.party_a_name = ''
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
const showChangeCompany = (row: any) => {
|
const showChangeCompany = (row: any) => {
|
||||||
contractId.value = row.id;
|
contractId.value = row.id
|
||||||
getDetails(row.id);
|
getDetails(row.id)
|
||||||
showPop.value = true;
|
showPop.value = true
|
||||||
// ShowInitiateContractPop();
|
// ShowInitiateContractPop();
|
||||||
};
|
}
|
||||||
|
|
||||||
const ShowInitiateContractPop = () => {
|
const ShowInitiateContractPop = () => {
|
||||||
(InitiateContractPop.value = true), (showInitiateContractPop.value = true);
|
;(InitiateContractPop.value = true), (showInitiateContractPop.value = true)
|
||||||
};
|
}
|
||||||
const showCreateConctPop = (row) => {
|
const showCreateConctPop = (row) => {
|
||||||
(showPop.value = true),
|
;(showPop.value = true), (showConctactPop.value = true), (contractId.value = row.id)
|
||||||
(showConctactPop.value = true),
|
}
|
||||||
(contractId.value = row.id);
|
|
||||||
};
|
|
||||||
const InitiateContract = () => {
|
const InitiateContract = () => {
|
||||||
initiate_contract({
|
initiate_contract({
|
||||||
id: contractId.value,
|
id: contractId.value,
|
||||||
...contractFormData.value,
|
...contractFormData.value
|
||||||
}).catch((res) => {
|
}).catch((res) => {
|
||||||
console.log(res);
|
console.log(res)
|
||||||
});
|
})
|
||||||
offInitiateContractPop();
|
offInitiateContractPop()
|
||||||
};
|
}
|
||||||
const creContct = () => {
|
const creContct = () => {
|
||||||
generateGontract({ id: contractId.value }).catch((res) => {
|
generateGontract({ id: contractId.value }).catch((res) => {
|
||||||
console.log(res);
|
console.log(res)
|
||||||
});
|
})
|
||||||
offPop();
|
offPop()
|
||||||
};
|
}
|
||||||
const sendMsg = () => {
|
const sendMsg = () => {
|
||||||
sendMsgApi({ id: contractId.value });
|
sendMsgApi({ id: contractId.value })
|
||||||
offPop();
|
offPop()
|
||||||
};
|
}
|
||||||
// 创建合同与发送短信结束
|
// 创建合同与发送短信结束
|
||||||
// 查询条件
|
// 查询条件
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
company_name: "",
|
company_name: '',
|
||||||
area: "",
|
area: '',
|
||||||
street: "",
|
street: '',
|
||||||
company_type: "",
|
company_type: '',
|
||||||
area_manager: "",
|
area_manager: '',
|
||||||
// 是否签约
|
// 是否签约
|
||||||
is_contract: "",
|
is_contract: ''
|
||||||
});
|
})
|
||||||
|
|
||||||
if (route.query.company_type) {
|
if (route.query.company_type) {
|
||||||
company_type_show.value = false;
|
company_type_show.value = false
|
||||||
queryParams["company_type"] = route.query.company_type?.toString() || "";
|
queryParams['company_type'] = route.query.company_type?.toString() || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const datas = reactive({
|
const datas = reactive({
|
||||||
dictTypeLists: [],
|
dictTypeLists: []
|
||||||
});
|
})
|
||||||
const getdictTypeLists = async () => {
|
const getdictTypeLists = async () => {
|
||||||
const data = await dictDataLists({ type_id: 6 });
|
const data = await dictDataLists({ type_id: 6 })
|
||||||
datas["dictTypeLists"] = data["lists"];
|
datas['dictTypeLists'] = data['lists']
|
||||||
};
|
}
|
||||||
getdictTypeLists();
|
getdictTypeLists()
|
||||||
// 选中数据
|
// 选中数据
|
||||||
const selectData = ref<any[]>([]);
|
const selectData = ref<any[]>([])
|
||||||
|
|
||||||
// 表格选择后回调事件
|
// 表格选择后回调事件
|
||||||
const handleSelectionChange = (val: any[]) => {
|
const handleSelectionChange = (val: any[]) => {
|
||||||
selectData.value = val.map(({ id }) => id);
|
selectData.value = val.map(({ id }) => id)
|
||||||
};
|
}
|
||||||
|
|
||||||
// 获取字典数据
|
// 获取字典数据
|
||||||
const { dictData } = useDictData("");
|
const { dictData } = useDictData('')
|
||||||
|
|
||||||
// 分页相关
|
// 分页相关
|
||||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
fetchFun: apiCompanyLists,
|
fetchFun: apiCompanyLists,
|
||||||
params: queryParams,
|
params: queryParams
|
||||||
});
|
})
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const handleDelete = async (id: number | any[]) => {
|
const handleDelete = async (id: number | any[]) => {
|
||||||
await feedback.confirm("确定要删除?");
|
await feedback.confirm('确定要删除?')
|
||||||
await apiCompanyDelete({ id });
|
await apiCompanyDelete({ id })
|
||||||
getLists();
|
getLists()
|
||||||
};
|
}
|
||||||
const handleAuthentication = async (id: number | any[]) => {
|
const handleAuthentication = async (id: number | any[]) => {
|
||||||
await feedback.confirm("确定要认证?");
|
await feedback.confirm('确定要认证?')
|
||||||
await authentication({ id });
|
await authentication({ id })
|
||||||
getLists();
|
getLists()
|
||||||
};
|
}
|
||||||
|
|
||||||
getLists();
|
getLists()
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.btn {
|
.btn {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user