更新
This commit is contained in:
parent
99efbf969f
commit
930dc5048d
@ -43,49 +43,59 @@
|
|||||||
</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 { apiCompanyLists, apiCompanyDelete } from '@/api/company'
|
import { apiCompanyLists, apiCompanyDelete } from "@/api/company";
|
||||||
import { defineEmits } from 'vue'
|
import { defineEmits } from "vue";
|
||||||
|
|
||||||
|
// 当前类型
|
||||||
|
const props = defineProps({
|
||||||
|
type: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// 查询条件
|
// 查询条件
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
level_two: '',
|
level_two: "",
|
||||||
level_one: '',
|
level_one: "",
|
||||||
company_name: '',
|
company_name: "",
|
||||||
organization_code: '',
|
organization_code: "",
|
||||||
city: '',
|
city: "",
|
||||||
area: '',
|
area: "",
|
||||||
street: '',
|
street: "",
|
||||||
company_type: '',
|
company_type: "",
|
||||||
master_name: '',
|
master_name: "",
|
||||||
master_position: '',
|
master_position: "",
|
||||||
master_phone: '',
|
master_phone: "",
|
||||||
master_email: '',
|
master_email: "",
|
||||||
other_contacts: '',
|
other_contacts: "",
|
||||||
area_manager: '',
|
area_manager: "",
|
||||||
is_contract: '',
|
is_contract: "",
|
||||||
account: '',
|
account: "",
|
||||||
password: '',
|
password: "",
|
||||||
deposit: '',
|
deposit: "",
|
||||||
deposit_time: '',
|
deposit_time: "",
|
||||||
qualification: '',
|
qualification: "",
|
||||||
status: ''
|
status: "",
|
||||||
})
|
});
|
||||||
|
|
||||||
|
if (props.type) queryParams.company_type = props.type;
|
||||||
|
|
||||||
// 选中数据
|
// 选中数据
|
||||||
const emits = defineEmits(['customEvent'])
|
const emits = defineEmits(["customEvent"]);
|
||||||
|
|
||||||
// 选中数据子父传递
|
// 选中数据子父传递
|
||||||
const handleCurrentChange = (value: any) => {
|
const handleCurrentChange = (value: any) => {
|
||||||
emits('customEvent', value)
|
emits("customEvent", value);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 分页相关
|
// 分页相关
|
||||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
fetchFun: apiCompanyLists,
|
fetchFun: apiCompanyLists,
|
||||||
params: queryParams
|
params: queryParams,
|
||||||
})
|
});
|
||||||
|
|
||||||
getLists()
|
getLists();
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="edit-popup">
|
<div class="edit-popup">
|
||||||
<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> -->
|
<!-- <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>
|
||||||
@ -276,7 +281,10 @@
|
|||||||
<div class="tit">其他联系人</div>
|
<div class="tit">其他联系人</div>
|
||||||
|
|
||||||
<el-row>
|
<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-col :span="12">
|
||||||
<el-form-item label="姓名" prop="field120">
|
<el-form-item label="姓名" prop="field120">
|
||||||
<el-input
|
<el-input
|
||||||
@ -421,12 +429,31 @@
|
|||||||
placeholder="请选择签约方"
|
placeholder="请选择签约方"
|
||||||
clearable
|
clearable
|
||||||
:style="{ width: '100%' }"
|
:style="{ width: '100%' }"
|
||||||
:disabled="true"
|
:disabled="partyDisabled"
|
||||||
|
@click="openCompany"
|
||||||
></el-input>
|
></el-input>
|
||||||
|
<!-- <el-select
|
||||||
|
:disabled="partyDisabled"
|
||||||
|
v-model="formData.party_a_name"
|
||||||
|
placeholder="请选择签约方"
|
||||||
|
clearable
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in datas['dictTypeLists']"
|
||||||
|
:key="index"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label-width="100px" label="被签约公司" prop="field131">
|
<el-form-item
|
||||||
|
label-width="100px"
|
||||||
|
label="被签约公司"
|
||||||
|
prop="field131"
|
||||||
|
>
|
||||||
<el-input
|
<el-input
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
v-model="formData.company_name"
|
v-model="formData.company_name"
|
||||||
@ -437,7 +464,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label-width="100px" label="合同类型" prop="contract_type">
|
<el-form-item
|
||||||
|
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"
|
||||||
@ -492,10 +523,10 @@
|
|||||||
<el-col :span="24" class="el-card pt-6">
|
<el-col :span="24" class="el-card pt-6">
|
||||||
<el-form-item label prop="field139">
|
<el-form-item label prop="field139">
|
||||||
<el-button v-if="isEdit" type="primary" size="medium" @click="create"
|
<el-button v-if="isEdit" type="primary" size="medium" @click="create"
|
||||||
>修改</el-button
|
>完成</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="isDisabled == false"
|
v-if="isDisabled"
|
||||||
type="primary"
|
type="primary"
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
size="medium"
|
size="medium"
|
||||||
@ -506,7 +537,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-dialog v-model="isCompany" title="选择签约方" width="60%">
|
<el-dialog v-model="isCompany" title="选择签约方" width="60%">
|
||||||
<DialogIndex @customEvent="customEvent" />
|
<DialogIndex @customEvent="customEvent" :type="indexType" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="isMan" title="选择管理人员" width="60%">
|
<el-dialog v-model="isMan" title="选择管理人员" width="60%">
|
||||||
<DialogIndexMan @customEvent="customEventMan" />
|
<DialogIndexMan @customEvent="customEventMan" />
|
||||||
@ -518,105 +549,118 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="companyEdit">
|
<script lang="ts" setup name="companyEdit">
|
||||||
import type { FormInstance, UploadProps, ElMessage, UploadUserFile } from 'element-plus'
|
import type {
|
||||||
import Popup from '@/components/popup/index.vue'
|
FormInstance,
|
||||||
import { apiCompanyAdd, apiCompanyEdit, apiCompanyDetail, apiCompanyLists } from '@/api/company'
|
UploadProps,
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
let isEdit = ref(false)
|
// 公司类型
|
||||||
|
const indexType = ref(0);
|
||||||
|
|
||||||
|
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: [],
|
||||||
@ -626,326 +670,364 @@ const datas = reactive({
|
|||||||
villageOptions: [],
|
villageOptions: [],
|
||||||
brigadeOptions: [],
|
brigadeOptions: [],
|
||||||
dictTypeLists: [],
|
dictTypeLists: [],
|
||||||
contract_type: []
|
contract_type: [],
|
||||||
})
|
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);
|
||||||
|
|
||||||
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'] = (response, uploadFile) => {
|
const handleAvatarSuccess: UploadProps["onSuccess"] = (
|
||||||
|
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'] = (response, uploadFile) => {
|
const handleAvatarSuccessB: UploadProps["onSuccess"] = (
|
||||||
|
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'] = (response, uploadFile) => {
|
const handleAvatarSuccess_two: UploadProps["onSuccess"] = (
|
||||||
|
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'] = (response, uploadFile) => {
|
const handleAvatarSuccess_twoB: UploadProps["onSuccess"] = (
|
||||||
|
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'] = (response, uploadFile) => {
|
const handleAvatarSuccess_three: UploadProps["onSuccess"] = (
|
||||||
|
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 = "";
|
||||||
return true
|
partyDisabled.value = true;
|
||||||
|
indexType.value = 30;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (type != 16) {
|
||||||
|
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) {
|
||||||
|
indexType.value = 30;
|
||||||
|
partyDisabled.value = false;
|
||||||
|
}
|
||||||
Object.keys(formData).forEach((key) => {
|
Object.keys(formData).forEach((key) => {
|
||||||
const stringArr = ['province', 'city', 'area', 'street', 'village', 'brigade']
|
const stringArr = [
|
||||||
|
"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'] = (response, uploadFile) => {
|
const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
|
||||||
|
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)
|
data.qualification.bank_account = JSON.stringify(
|
||||||
|
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,7 +26,11 @@
|
|||||||
placeholder="请输入镇"
|
placeholder="请输入镇"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="公司类型" prop="company_type" v-show="company_type_show">
|
<el-form-item
|
||||||
|
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="请选择公司类型"
|
||||||
@ -72,8 +76,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">
|
||||||
@ -89,30 +93,68 @@
|
|||||||
path: getRoutePath('company/add:edit'),
|
path: getRoutePath('company/add:edit'),
|
||||||
query: {
|
query: {
|
||||||
id: userStore.userInfo.company_id,
|
id: userStore.userInfo.company_id,
|
||||||
read: true
|
read: true,
|
||||||
}
|
},
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-button type="primary" class="mb-4"> 我的公司 </el-button></router-link
|
<el-button type="primary" class="mb-4">
|
||||||
|
我的公司
|
||||||
|
</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 label="id" prop="id" show-overflow-tooltip width="60" />
|
<el-table-column
|
||||||
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip />
|
label="id"
|
||||||
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
|
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 />
|
<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 label="主联系人" prop="master_name" show-overflow-tooltip />
|
<el-table-column
|
||||||
<el-table-column label="联系方式" prop="master_phone" show-overflow-tooltip />
|
label="主联系人"
|
||||||
<el-table-column label="片区经理" prop="area_manager" show-overflow-tooltip />
|
prop="master_name"
|
||||||
<el-table-column label="是否签约" prop="is_contract" show-overflow-tooltip>
|
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>
|
<span v-if="row.is_contract == 1" style="color: #67c23a"
|
||||||
|
>已签约</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 label="操作" align="center" width="500" fixed="right">
|
<el-table-column
|
||||||
|
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>
|
||||||
@ -121,8 +163,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
|
||||||
>
|
>
|
||||||
@ -133,8 +175,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
|
||||||
>
|
>
|
||||||
@ -146,8 +188,8 @@
|
|||||||
query: {
|
query: {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
read: true,
|
read: true,
|
||||||
isshow: true
|
isshow: true,
|
||||||
}
|
},
|
||||||
}"
|
}"
|
||||||
>详情</router-link
|
>详情</router-link
|
||||||
>
|
>
|
||||||
@ -158,10 +200,10 @@
|
|||||||
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
|
||||||
>
|
>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@ -198,7 +240,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>
|
||||||
@ -211,7 +253,10 @@
|
|||||||
<pagination v-model="pager" @change="getLists" />
|
<pagination v-model="pager" @change="getLists" />
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog v-model="showInitiateContractPop" @close="offInitiateContractPop">
|
<el-dialog
|
||||||
|
v-model="showInitiateContractPop"
|
||||||
|
@close="offInitiateContractPop"
|
||||||
|
>
|
||||||
<h1>重要提醒</h1>
|
<h1>重要提醒</h1>
|
||||||
<div class="content">请确认信息是否有误</div>
|
<div class="content">请确认信息是否有误</div>
|
||||||
<p class="btn_menu">
|
<p class="btn_menu">
|
||||||
@ -230,10 +275,16 @@
|
|||||||
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
|
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
|
||||||
</div>
|
</div>
|
||||||
<p class="btn_menu">
|
<p class="btn_menu">
|
||||||
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
|
<el-button
|
||||||
|
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>
|
<el-button type="primary" size="large" v-else @click="sendMsg"
|
||||||
|
>确认</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>
|
||||||
@ -241,122 +292,124 @@
|
|||||||
</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,
|
||||||
apiCompanyDelete,
|
apiCompanyDelete,
|
||||||
generateGontract,
|
generateGontract,
|
||||||
sendMsgApi,
|
sendMsgApi,
|
||||||
authentication,
|
authentication,
|
||||||
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";
|
||||||
|
|
||||||
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 ShowInitiateContractPop = (row) => {
|
const ShowInitiateContractPop = (row) => {
|
||||||
;(InitiateContractPop.value = true),
|
(InitiateContractPop.value = true),
|
||||||
(showInitiateContractPop.value = true),
|
(showInitiateContractPop.value = true),
|
||||||
(contractId.value = row.id)
|
(contractId.value = row.id);
|
||||||
}
|
};
|
||||||
const showCreateConctPop = (row) => {
|
const showCreateConctPop = (row) => {
|
||||||
;(showPop.value = true), (showConctactPop.value = true), (contractId.value = row.id)
|
(showPop.value = true),
|
||||||
}
|
(showConctactPop.value = true),
|
||||||
|
(contractId.value = row.id);
|
||||||
|
};
|
||||||
const InitiateContract = () => {
|
const InitiateContract = () => {
|
||||||
initiate_contract({ id: contractId.value }).catch((res) => {
|
initiate_contract({ id: contractId.value }).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 {
|
||||||
|
@ -69,10 +69,6 @@ watch(
|
|||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
const test = (e: any) => {
|
|
||||||
console.log(e);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 加载
|
// 加载
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
@ -125,7 +121,7 @@ const initShowDate = (dateStr = "") => {
|
|||||||
initShowDate();
|
initShowDate();
|
||||||
|
|
||||||
// 获取字典数据
|
// 获取字典数据
|
||||||
const { dictData } = useDictData("");
|
// const { dictData } = useDictData("");
|
||||||
|
|
||||||
// 添加
|
// 添加
|
||||||
const handleAdd = async () => {
|
const handleAdd = async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user