更新
This commit is contained in:
parent
11a6f0e6ea
commit
86d0fd06ca
2
package-lock.json
generated
2
package-lock.json
generated
@ -64,7 +64,7 @@
|
||||
},
|
||||
"node_modules/@amap/amap-jsapi-loader": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
|
||||
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
|
@ -1,11 +1,6 @@
|
||||
<template>
|
||||
<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> -->
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<div class="tit">公司基本信息创建</div>
|
||||
@ -35,9 +30,7 @@
|
||||
<el-col :span="7">
|
||||
<el-form-item
|
||||
label="公司类型"
|
||||
:rules="[
|
||||
{ required: true, message: '不可为空', trigger: 'blur' },
|
||||
]"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
|
||||
prop="company_type"
|
||||
>
|
||||
<el-select
|
||||
@ -60,9 +53,7 @@
|
||||
<el-col :span="3">
|
||||
<el-form-item
|
||||
label="省"
|
||||
:rules="[
|
||||
{ required: true, message: '不可为空', trigger: 'blur' },
|
||||
]"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
|
||||
prop="province"
|
||||
>
|
||||
<el-select
|
||||
@ -85,9 +76,7 @@
|
||||
<el-col :span="3">
|
||||
<el-form-item
|
||||
label="市"
|
||||
:rules="[
|
||||
{ required: true, message: '不可为空', trigger: 'blur' },
|
||||
]"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
|
||||
prop="city"
|
||||
>
|
||||
<el-select
|
||||
@ -110,9 +99,7 @@
|
||||
<el-col :span="3" v-if="isArea">
|
||||
<el-form-item
|
||||
label="区"
|
||||
:rules="[
|
||||
{ required: true, message: '不可为空', trigger: 'blur' },
|
||||
]"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
|
||||
prop="area"
|
||||
>
|
||||
<el-select
|
||||
@ -135,9 +122,7 @@
|
||||
<el-col :span="3" v-if="isStreet">
|
||||
<el-form-item
|
||||
label="镇"
|
||||
:rules="[
|
||||
{ required: true, message: '不可为空', trigger: 'blur' },
|
||||
]"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
|
||||
prop="street"
|
||||
>
|
||||
<el-select
|
||||
@ -160,9 +145,7 @@
|
||||
<el-col :span="3" v-if="isVillage">
|
||||
<el-form-item
|
||||
label="村"
|
||||
:rules="[
|
||||
{ required: true, message: '不可为空', trigger: 'blur' },
|
||||
]"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
|
||||
prop="village"
|
||||
>
|
||||
<el-select
|
||||
@ -185,9 +168,7 @@
|
||||
<el-col :span="3" v-if="isBrigade">
|
||||
<el-form-item
|
||||
label="队"
|
||||
:rules="[
|
||||
{ required: true, message: '不可为空', trigger: 'blur' },
|
||||
]"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
|
||||
prop="brigade"
|
||||
>
|
||||
<el-select
|
||||
@ -237,7 +218,7 @@
|
||||
? city.id + ''
|
||||
: city[regionType + '_code'] + ''
|
||||
"
|
||||
>{{ city[regionType + "_name"] }}</el-checkbox
|
||||
>{{ city[regionType + '_name'] }}</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
@ -258,11 +239,7 @@
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccessAvatar"
|
||||
>
|
||||
<img
|
||||
v-if="formData.avatar"
|
||||
:src="formData.avatar"
|
||||
class="avatar"
|
||||
/>
|
||||
<img v-if="formData.avatar" :src="formData.avatar" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon">
|
||||
<Plus />
|
||||
</el-icon>
|
||||
@ -359,10 +336,7 @@
|
||||
<div class="tit">其他联系人</div>
|
||||
|
||||
<el-row>
|
||||
<template
|
||||
v-for="(item, index) in formData.other_contacts"
|
||||
:key="index"
|
||||
>
|
||||
<template v-for="(item, index) in formData.other_contacts" :key="index">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="field120">
|
||||
<el-input
|
||||
@ -537,11 +511,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label-width="100px"
|
||||
label="被签约公司"
|
||||
prop="field131"
|
||||
>
|
||||
<el-form-item label-width="100px" label="被签约公司" prop="field131">
|
||||
<el-input
|
||||
:disabled="true"
|
||||
v-model="formData.company_name"
|
||||
@ -552,11 +522,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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
|
||||
:disabled="isDisabled"
|
||||
v-model="formData.contract.contract_type"
|
||||
@ -637,121 +603,116 @@
|
||||
</template>
|
||||
1
|
||||
<script lang="ts" setup name="companyEdit">
|
||||
import type {
|
||||
FormInstance,
|
||||
UploadProps,
|
||||
ElMessage,
|
||||
UploadUserFile,
|
||||
} from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import type { FormInstance, UploadProps, ElMessage, UploadUserFile } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import {
|
||||
apiCompanyAdd,
|
||||
apiCompanyEdit,
|
||||
apiCompanyDetail,
|
||||
apiCompanyLists,
|
||||
companyResponsibleArea,
|
||||
} from "@/api/company";
|
||||
companyResponsibleArea
|
||||
} from '@/api/company'
|
||||
import {
|
||||
apiCityList,
|
||||
apiAreaList,
|
||||
apiStreetList,
|
||||
apiProvinceList,
|
||||
apiVillageList,
|
||||
apiBrigadeList,
|
||||
} from "@/api/common";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import DialogIndex from "./dialog_index.vue";
|
||||
import DialogIndexMan from "./dialog_index_man.vue";
|
||||
import type { PropType } from "vue";
|
||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
const userStore = useUserStore();
|
||||
const { removeTab } = useMultipleTabs();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
let isshow = ref(true);
|
||||
let imgflag = ref(true);
|
||||
let isDisabled = ref(false);
|
||||
apiBrigadeList
|
||||
} from '@/api/common'
|
||||
import { dictDataLists } from '@/api/setting/dict'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import DialogIndex from './dialog_index.vue'
|
||||
import DialogIndexMan from './dialog_index_man.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import useMultipleTabs from '@/hooks/useMultipleTabs'
|
||||
import useUserStore from '@/stores/modules/user'
|
||||
const userStore = useUserStore()
|
||||
const { removeTab } = useMultipleTabs()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
let isshow = ref(true)
|
||||
let imgflag = ref(true)
|
||||
let isDisabled = ref(false)
|
||||
if (route.query.flag) {
|
||||
isshow = false;
|
||||
isshow = false
|
||||
}
|
||||
if (route.query.isshow) {
|
||||
imgflag = false;
|
||||
isDisabled = true;
|
||||
imgflag = false
|
||||
isDisabled = true
|
||||
}
|
||||
console.log(isDisabled);
|
||||
console.log(isDisabled)
|
||||
// 公司类型
|
||||
const indexType = ref(0);
|
||||
const indexType = ref(0)
|
||||
|
||||
let isEdit = ref(false);
|
||||
let isEdit = ref(false)
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref();
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref()
|
||||
if (route.query.read) {
|
||||
isDisabled = route.query.read;
|
||||
isDisabled = route.query.read
|
||||
}
|
||||
if (route.query.edit) {
|
||||
isEdit = route.query.edit;
|
||||
isEdit = route.query.edit
|
||||
}
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
admin_id: "",
|
||||
admin_name: "",
|
||||
area_manager: "",
|
||||
area_manager_name: "",
|
||||
id: "",
|
||||
admin_id: '',
|
||||
admin_name: '',
|
||||
area_manager: '',
|
||||
area_manager_name: '',
|
||||
id: '',
|
||||
// level_two: '',
|
||||
// level_one: '',
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
province: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
village: "",
|
||||
brigade: "",
|
||||
address: "",
|
||||
company_name: '',
|
||||
organization_code: '',
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
village: '',
|
||||
brigade: '',
|
||||
address: '',
|
||||
responsible_area: [],
|
||||
company_type: "",
|
||||
avatar: "",
|
||||
sex: "1",
|
||||
id_card: "",
|
||||
master_name: "",
|
||||
master_position: "",
|
||||
master_phone: "",
|
||||
master_email: "",
|
||||
company_type: '',
|
||||
avatar: '',
|
||||
sex: '1',
|
||||
id_card: '',
|
||||
master_name: '',
|
||||
master_position: '',
|
||||
master_phone: '',
|
||||
master_email: '',
|
||||
other_contacts: [],
|
||||
qualification: {
|
||||
business_license: "",
|
||||
business_licenseB: "",
|
||||
business_license: '',
|
||||
business_licenseB: '',
|
||||
other_qualifications: [],
|
||||
bank_accountB: [],
|
||||
bank_account: [],
|
||||
bank_account: []
|
||||
},
|
||||
contract: {
|
||||
contract_type: "",
|
||||
contract_type: '',
|
||||
party_a: 0,
|
||||
file: "",
|
||||
contract_no: "系统自动生成",
|
||||
type: 1,
|
||||
file: '',
|
||||
contract_no: '系统自动生成',
|
||||
type: 1
|
||||
},
|
||||
//签约方
|
||||
party_a_name: "",
|
||||
file_image: "",
|
||||
party_a_name: '',
|
||||
file_image: ''
|
||||
// status: ''
|
||||
});
|
||||
})
|
||||
|
||||
if (userStore.userInfo.root == 0) {
|
||||
formData.contract.party_a = userStore.userInfo.company?.id;
|
||||
formData.party_a_name = userStore.userInfo.company?.company_name;
|
||||
formData.contract.party_a = userStore.userInfo.company?.id
|
||||
formData.party_a_name = userStore.userInfo.company?.company_name
|
||||
}
|
||||
const datas = reactive({
|
||||
provinceOptions: [],
|
||||
@ -762,107 +723,107 @@ const datas = reactive({
|
||||
brigadeOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: [],
|
||||
company_list: [],
|
||||
});
|
||||
const fileList = ref<UploadUserFile[]>([]);
|
||||
company_list: []
|
||||
})
|
||||
const fileList = ref<UploadUserFile[]>([])
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
company_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入公司名称",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入公司名称',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
organization_code: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入组织机构代码",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入组织机构代码',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
master_name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主联系人姓名",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入主联系人姓名',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
master_position: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主联系人职务",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入主联系人职务',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
master_phone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入主联系人手机",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入主联系人手机',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
account: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入账号",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
message: '请输入账号',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
],
|
||||
});
|
||||
const isCompany = ref(false);
|
||||
const isMan = ref(false);
|
||||
const isAreaManager = ref(false);
|
||||
const isArea = ref(false);
|
||||
const isStreet = ref(false);
|
||||
const isVillage = ref(false);
|
||||
const isBrigade = ref(false);
|
||||
const partyDisabled = ref(true);
|
||||
message: '请输入密码',
|
||||
trigger: ['blur']
|
||||
}
|
||||
]
|
||||
})
|
||||
const isCompany = ref(false)
|
||||
const isMan = ref(false)
|
||||
const isAreaManager = ref(false)
|
||||
const isArea = ref(false)
|
||||
const isStreet = ref(false)
|
||||
const isVillage = ref(false)
|
||||
const isBrigade = ref(false)
|
||||
const partyDisabled = ref(true)
|
||||
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false;
|
||||
formData.contract.party_a = data.id;
|
||||
formData.party_a_name = data.company_name;
|
||||
isCompany.value = false
|
||||
formData.contract.party_a = data.id
|
||||
formData.party_a_name = data.company_name
|
||||
}
|
||||
function customEventMan(data: any) {
|
||||
isMan.value = false;
|
||||
formData.admin_name = data.name;
|
||||
formData.admin_id = data.id;
|
||||
isMan.value = false
|
||||
formData.admin_name = data.name
|
||||
formData.admin_id = data.id
|
||||
}
|
||||
//区域管理人员
|
||||
function EventAreaManager(data: any) {
|
||||
isAreaManager.value = false;
|
||||
formData.area_manager_name = data.name;
|
||||
formData.area_manager = data.id;
|
||||
isAreaManager.value = false
|
||||
formData.area_manager_name = data.name
|
||||
formData.area_manager = data.id
|
||||
}
|
||||
function openCompany() {
|
||||
isCompany.value = true;
|
||||
isCompany.value = true
|
||||
}
|
||||
|
||||
// 当前选择的负责区域列表
|
||||
// const formData.responsible_area = ref([]);
|
||||
// 当前应当显示的区域
|
||||
const regionType = ref("");
|
||||
const wathcFlag = ref(0); //标记第一次页面刷新的数据更新
|
||||
const regionType = ref('')
|
||||
const wathcFlag = ref(0) //标记第一次页面刷新的数据更新
|
||||
watch(
|
||||
() => formData[regionType.value],
|
||||
(newValue, oldValue) => {
|
||||
if (wathcFlag.value == 0) return wathcFlag.value++;
|
||||
formData.responsible_area = [];
|
||||
formData.responsible_area.push(newValue + "");
|
||||
if (wathcFlag.value == 0) return wathcFlag.value++
|
||||
formData.responsible_area = []
|
||||
formData.responsible_area.push(newValue + '')
|
||||
}
|
||||
);
|
||||
)
|
||||
// 多选区域
|
||||
const handleCheckedCitiesChange = (value: string[]) => {
|
||||
// console.log("选的值", value);
|
||||
};
|
||||
}
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
@ -871,243 +832,218 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
//上传图片1
|
||||
const handleAvatarSuccess: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
ElMessage.error(response.msg)
|
||||
return
|
||||
}
|
||||
formData.qualification.business_license = response.data.uri;
|
||||
};
|
||||
const handleAvatarSuccessB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
formData.qualification.business_license = response.data.uri
|
||||
}
|
||||
const handleAvatarSuccessB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
ElMessage.error(response.msg)
|
||||
return
|
||||
}
|
||||
formData.qualification.business_licenseB = response.data.uri;
|
||||
};
|
||||
formData.qualification.business_licenseB = response.data.uri
|
||||
}
|
||||
//上传图片2
|
||||
const handleAvatarSuccess_two: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
const handleAvatarSuccess_two: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
ElMessage.error(response.msg)
|
||||
return
|
||||
}
|
||||
formData.qualification.other_qualifications.push(response.data.uri);
|
||||
formData.qualification.other_qualifications.push(response.data.uri)
|
||||
// console.log(formData.qualification.other_qualifications);
|
||||
};
|
||||
const handleAvatarSuccess_twoB: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
}
|
||||
const handleAvatarSuccess_twoB: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
ElMessage.error(response.msg)
|
||||
return
|
||||
}
|
||||
formData.qualification.bank_accountB = response.data.uri;
|
||||
};
|
||||
formData.qualification.bank_accountB = response.data.uri
|
||||
}
|
||||
//上传文件3
|
||||
const handleAvatarSuccess_three: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
const handleAvatarSuccess_three: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
ElMessage.error(response.msg)
|
||||
return
|
||||
}
|
||||
formData.file_image = response.data.uri;
|
||||
formData.contract.file = response.data.uri;
|
||||
fileList.value[0].url = response.data.uri;
|
||||
fileList.value[0].name = "合同文件";
|
||||
};
|
||||
formData.file_image = response.data.uri
|
||||
formData.contract.file = response.data.uri
|
||||
fileList.value[0].url = response.data.uri
|
||||
fileList.value[0].name = '合同文件'
|
||||
}
|
||||
|
||||
//增加其他联系人
|
||||
function other() {
|
||||
formData.other_contacts.push({
|
||||
name: "",
|
||||
position: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
});
|
||||
name: '',
|
||||
position: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
})
|
||||
}
|
||||
//删除其他联系人
|
||||
function otherdelete() {
|
||||
formData.other_contacts.pop({
|
||||
name: "",
|
||||
position: "",
|
||||
phone: "",
|
||||
email: "",
|
||||
});
|
||||
name: '',
|
||||
position: '',
|
||||
phone: '',
|
||||
email: ''
|
||||
})
|
||||
}
|
||||
function company_type_change(type: any) {
|
||||
//区
|
||||
const arr = [30, 14, 15];
|
||||
const arr = [30, 14, 15]
|
||||
if (arr.indexOf(type) > -1) {
|
||||
isArea.value = true;
|
||||
isStreet.value = false;
|
||||
isVillage.value = false;
|
||||
isBrigade.value = false;
|
||||
formData.street = "";
|
||||
formData.village = "";
|
||||
formData.brigade = "";
|
||||
regionType.value = "area";
|
||||
return true;
|
||||
isArea.value = true
|
||||
isStreet.value = false
|
||||
isVillage.value = false
|
||||
isBrigade.value = false
|
||||
formData.street = ''
|
||||
formData.village = ''
|
||||
formData.brigade = ''
|
||||
regionType.value = 'area'
|
||||
return true
|
||||
}
|
||||
//镇
|
||||
if (type == 16) {
|
||||
isArea.value = true;
|
||||
isStreet.value = true;
|
||||
isVillage.value = false;
|
||||
isBrigade.value = false;
|
||||
formData.village = "";
|
||||
formData.brigade = "";
|
||||
partyDisabled.value = true;
|
||||
indexType.value = 30;
|
||||
regionType.value = "street";
|
||||
return true;
|
||||
isArea.value = true
|
||||
isStreet.value = true
|
||||
isVillage.value = false
|
||||
isBrigade.value = false
|
||||
formData.village = ''
|
||||
formData.brigade = ''
|
||||
partyDisabled.value = true
|
||||
indexType.value = 30
|
||||
regionType.value = 'street'
|
||||
return true
|
||||
}
|
||||
if (type != 16) {
|
||||
partyDisabled.value = false;
|
||||
partyDisabled.value = false
|
||||
}
|
||||
//村
|
||||
if (type == 17) {
|
||||
isArea.value = true;
|
||||
isStreet.value = true;
|
||||
isVillage.value = true;
|
||||
isBrigade.value = false;
|
||||
formData.brigade = "";
|
||||
regionType.value = "village";
|
||||
return true;
|
||||
isArea.value = true
|
||||
isStreet.value = true
|
||||
isVillage.value = true
|
||||
isBrigade.value = false
|
||||
formData.brigade = ''
|
||||
regionType.value = 'village'
|
||||
return true
|
||||
}
|
||||
|
||||
//队
|
||||
if (type == 18) {
|
||||
isArea.value = true;
|
||||
isStreet.value = true;
|
||||
isVillage.value = true;
|
||||
isBrigade.value = true;
|
||||
regionType.value = "brigade";
|
||||
return true;
|
||||
isArea.value = true
|
||||
isStreet.value = true
|
||||
isVillage.value = true
|
||||
isBrigade.value = true
|
||||
regionType.value = 'brigade'
|
||||
return true
|
||||
}
|
||||
}
|
||||
//获取省份
|
||||
function province_change(value: string) {
|
||||
getCityList();
|
||||
getCityList()
|
||||
}
|
||||
function city_change(value: string) {
|
||||
getAreaList();
|
||||
getAreaList()
|
||||
}
|
||||
function area_change(value: string) {
|
||||
getStreetList();
|
||||
getStreetList()
|
||||
}
|
||||
function street_change(value: string) {
|
||||
getVillageList();
|
||||
getVillageList()
|
||||
}
|
||||
function village_change(value: string) {
|
||||
getBrigadeList();
|
||||
getBrigadeList()
|
||||
}
|
||||
// function brigade_change(value: string) {
|
||||
// formData.brigade = value
|
||||
// }
|
||||
const getProvinceList = async () => {
|
||||
let data = await apiProvinceList({});
|
||||
datas["provinceOptions"] = data;
|
||||
};
|
||||
const data = await apiProvinceList({})
|
||||
datas['provinceOptions'] = data
|
||||
}
|
||||
const getCityList = async () => {
|
||||
let data = await apiCityList({ city: formData.province });
|
||||
datas["cityOptions"] = data;
|
||||
};
|
||||
const data = await apiCityList({ city: formData.province })
|
||||
datas['cityOptions'] = data
|
||||
}
|
||||
const getAreaList = async () => {
|
||||
let data = await apiAreaList({ area: formData.city });
|
||||
datas["areaOptions"] = data;
|
||||
};
|
||||
const data = await apiAreaList({ area: formData.city })
|
||||
datas['areaOptions'] = data
|
||||
}
|
||||
const getStreetList = async () => {
|
||||
let data = await apiStreetList({ street: formData.area });
|
||||
// let f = await companyResponsibleArea({
|
||||
// key: "area",
|
||||
// value: formData.area,
|
||||
// });
|
||||
// data.forEach((item: any) => {
|
||||
// if (f.find((t: any) => item.area_code == t)) item.disabled = true;
|
||||
// else item.disabled = false;
|
||||
// });
|
||||
datas["streetOptions"] = data;
|
||||
};
|
||||
const data = await apiStreetList({ street: formData.area })
|
||||
if (formData.company_type == 16) {
|
||||
ResponsibleArea('area', formData.area)
|
||||
}
|
||||
datas['streetOptions'] = data
|
||||
}
|
||||
const getVillageList = async () => {
|
||||
let data = await apiVillageList({ village: formData.street });
|
||||
// let f = await companyResponsibleArea({
|
||||
// key: "street",
|
||||
// value: formData.street,
|
||||
// });
|
||||
// data.forEach((item: any) => {
|
||||
// if (f.find((t: any) => item.street_code == t)) item.disabled = true;
|
||||
// else item.disabled = false;
|
||||
// });
|
||||
datas["villageOptions"] = data;
|
||||
};
|
||||
const data = await apiVillageList({ village: formData.street })
|
||||
if (formData.company_type == 17) {
|
||||
ResponsibleArea('street', formData.street)
|
||||
}
|
||||
datas['villageOptions'] = data
|
||||
}
|
||||
const getBrigadeList = async () => {
|
||||
let data = await apiBrigadeList();
|
||||
// // 获取已选择的小队
|
||||
// let f = await companyResponsibleArea({
|
||||
// key: "village",
|
||||
// value: formData.village,
|
||||
// });
|
||||
// data.forEach((item: any) => {
|
||||
// if (f.find((t: any) => item.id == t + "")) item.disabled = true;
|
||||
// else item.disabled = false;
|
||||
// });
|
||||
datas["brigadeOptions"] = data;
|
||||
};
|
||||
getProvinceList();
|
||||
const data = await apiBrigadeList()
|
||||
if (formData.company_type == 18) {
|
||||
ResponsibleArea('village', formData.village)
|
||||
}
|
||||
|
||||
// // 获取已选择的小队
|
||||
|
||||
datas['brigadeOptions'] = data
|
||||
}
|
||||
getProvinceList()
|
||||
|
||||
const ResponsibleArea = async (key: any, value: any) => {
|
||||
const f = await companyResponsibleArea({
|
||||
key: key,
|
||||
value: value
|
||||
})
|
||||
f.forEach((item: any) => {
|
||||
if (f.find((t: any) => item.id == t + '')) item.disabled = true
|
||||
else item.disabled = false
|
||||
})
|
||||
}
|
||||
const getcontract_type = async () => {
|
||||
const data = await dictDataLists({ type_id: 7 });
|
||||
datas["contract_type"] = data["lists"];
|
||||
};
|
||||
const data = await dictDataLists({ type_id: 7 })
|
||||
datas['contract_type'] = data['lists']
|
||||
}
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
const data = await dictDataLists({ type_id: 6 })
|
||||
datas['dictTypeLists'] = data['lists']
|
||||
}
|
||||
|
||||
const getDetails = async () => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: route.query.id,
|
||||
});
|
||||
id: route.query.id
|
||||
})
|
||||
if (data.company_type == 16) {
|
||||
indexType.value = 30;
|
||||
partyDisabled.value = true;
|
||||
indexType.value = 30
|
||||
partyDisabled.value = true
|
||||
}
|
||||
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) {
|
||||
formData[key] = data[key];
|
||||
formData[key] = data[key]
|
||||
// if (
|
||||
// key == "qualification" &&
|
||||
// formData.qualification.other_qualifications
|
||||
@ -1133,60 +1069,57 @@ const getDetails = async () => {
|
||||
// }
|
||||
// }
|
||||
}
|
||||
if (stringArr.includes(key)) formData[key] = formData[key].toString();
|
||||
});
|
||||
await getCityList();
|
||||
await getAreaList();
|
||||
await getStreetList();
|
||||
await getVillageList();
|
||||
await getBrigadeList();
|
||||
formData["party_a_name"] = data.contract?.party_a_info.company_name;
|
||||
if (stringArr.includes(key)) formData[key] = formData[key].toString()
|
||||
})
|
||||
await getCityList()
|
||||
await getAreaList()
|
||||
await getStreetList()
|
||||
await getVillageList()
|
||||
await getBrigadeList()
|
||||
formData['party_a_name'] = data.contract?.party_a_info.company_name
|
||||
// formData['file_image'] = data.contract?.file
|
||||
// if (data.contract?.file) {
|
||||
// fileList.value[0].url = data.contract?.file
|
||||
// fileList.value[0].name = '合同文件'
|
||||
// }
|
||||
company_type_change(formData.company_type);
|
||||
};
|
||||
company_type_change(formData.company_type)
|
||||
}
|
||||
const clickdelete = (index) => {
|
||||
if (!route.query.read) {
|
||||
formData.qualification.other_qualifications.splice(index, 1);
|
||||
formData.qualification.other_qualifications.splice(index, 1)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
getdictTypeLists();
|
||||
getcontract_type();
|
||||
getdictTypeLists()
|
||||
getcontract_type()
|
||||
|
||||
const handleAvatarSuccessAvatar: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
) => {
|
||||
const handleAvatarSuccessAvatar: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.error(response.msg);
|
||||
return;
|
||||
ElMessage.error(response.msg)
|
||||
return
|
||||
}
|
||||
formData.avatar = response.data.uri;
|
||||
};
|
||||
formData.avatar = response.data.uri
|
||||
}
|
||||
const create = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = JSON.parse(JSON.stringify({ ...formData }));
|
||||
await formRef.value?.validate()
|
||||
const data = JSON.parse(JSON.stringify({ ...formData }))
|
||||
data.qualification.other_qualifications = JSON.stringify(
|
||||
data.qualification.other_qualifications
|
||||
);
|
||||
)
|
||||
if (route.query.id) {
|
||||
await apiCompanyEdit(data);
|
||||
await apiCompanyEdit(data)
|
||||
} else {
|
||||
await apiCompanyAdd(data);
|
||||
await apiCompanyAdd(data)
|
||||
}
|
||||
removeTab();
|
||||
router.back();
|
||||
};
|
||||
route.query.id && getDetails();
|
||||
removeTab()
|
||||
router.back()
|
||||
}
|
||||
route.query.id && getDetails()
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.tit {
|
||||
@ -1256,12 +1189,15 @@ defineExpose({
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tit {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.others {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
@ -26,11 +26,7 @@
|
||||
placeholder="请输入镇"
|
||||
/>
|
||||
</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
|
||||
v-model="queryParams.company_type"
|
||||
placeholder="请选择公司类型"
|
||||
@ -76,8 +72,8 @@
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
flag: true,
|
||||
},
|
||||
flag: true
|
||||
}
|
||||
}"
|
||||
>
|
||||
<el-button type="primary" class="mb-4">
|
||||
@ -102,67 +98,31 @@
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
label="id"
|
||||
prop="id"
|
||||
show-overflow-tooltip
|
||||
width="60"
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司名称"
|
||||
prop="company_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="公司类型"
|
||||
prop="company_type"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="id" prop="id" show-overflow-tooltip width="60" />
|
||||
<el-table-column label="公司名称" prop="company_name" show-overflow-tooltip />
|
||||
<el-table-column label="公司类型" prop="company_type" show-overflow-tooltip />
|
||||
<el-table-column label="区县" prop="area" show-overflow-tooltip />
|
||||
<el-table-column label="乡镇" prop="street" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="主联系人"
|
||||
prop="master_name"
|
||||
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
|
||||
>
|
||||
<el-table-column label="主联系人" prop="master_name" 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 }">
|
||||
<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>
|
||||
</template></el-table-column
|
||||
>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="510"
|
||||
fixed="right"
|
||||
>
|
||||
<el-table-column label="操作" align="center" width="510" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex">
|
||||
<el-button type="primary" link>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('auth.admin/lists'),
|
||||
path: getRoutePath('user.user/lists'),
|
||||
query: {
|
||||
company_id: row.id,
|
||||
read: true,
|
||||
},
|
||||
read: true
|
||||
}
|
||||
}"
|
||||
>查看成员</router-link
|
||||
>
|
||||
@ -173,8 +133,8 @@
|
||||
path: getRoutePath('company/subordinate/lists'),
|
||||
query: {
|
||||
company_id: row.id,
|
||||
read: true,
|
||||
},
|
||||
read: true
|
||||
}
|
||||
}"
|
||||
>下属公司</router-link
|
||||
>
|
||||
@ -186,8 +146,8 @@
|
||||
query: {
|
||||
id: row.id,
|
||||
read: true,
|
||||
isshow: true,
|
||||
},
|
||||
isshow: true
|
||||
}
|
||||
}"
|
||||
>详情</router-link
|
||||
>
|
||||
@ -198,8 +158,8 @@
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: row.id,
|
||||
edit: true,
|
||||
},
|
||||
edit: true
|
||||
}
|
||||
}"
|
||||
>编辑</router-link
|
||||
>
|
||||
@ -251,7 +211,7 @@
|
||||
v-perms="['company/postsms']"
|
||||
type="primary"
|
||||
link
|
||||
@click="(showPop = true), (contractId = row.id)"
|
||||
@click=";(showPop = true), (contractId = row.id)"
|
||||
>发送短信</el-button
|
||||
>
|
||||
</template>
|
||||
@ -264,10 +224,7 @@
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog
|
||||
v-model="showInitiateContractPop"
|
||||
@close="offInitiateContractPop"
|
||||
>
|
||||
<el-dialog v-model="showInitiateContractPop" @close="offInitiateContractPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div>
|
||||
<div class="content">请确认信息是否有误</div>
|
||||
@ -275,11 +232,7 @@
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label-width="100px"
|
||||
label="签约方"
|
||||
prop="field130"
|
||||
>
|
||||
<el-form-item label-width="100px" label="签约方" prop="field130">
|
||||
<el-select
|
||||
v-model="contractFormData.party_a"
|
||||
placeholder="请选择签约方"
|
||||
@ -333,11 +286,7 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label-width="100px"
|
||||
label="合同编号"
|
||||
prop="field133"
|
||||
>
|
||||
<el-form-item label-width="100px" label="合同编号" prop="field133">
|
||||
<el-input
|
||||
placeholder="系统自动生成"
|
||||
v-model="contractFormData.contract_no"
|
||||
@ -355,9 +304,7 @@
|
||||
<el-button type="primary" size="large" @click="InitiateContract"
|
||||
>确认创建</el-button
|
||||
>
|
||||
<el-button type="info" size="large" @click="offInitiateContractPop"
|
||||
>返回</el-button
|
||||
>
|
||||
<el-button type="info" size="large" @click="offInitiateContractPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
@ -369,16 +316,10 @@
|
||||
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
|
||||
</div>
|
||||
<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 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>
|
||||
</p>
|
||||
</el-dialog>
|
||||
@ -386,9 +327,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import useUserStore from '@/stores/modules/user'
|
||||
import {
|
||||
apiCompanyLists,
|
||||
companyListTwo,
|
||||
@ -397,164 +338,161 @@ import {
|
||||
sendMsgApi,
|
||||
authentication,
|
||||
apiCompanyDetail,
|
||||
initiate_contract,
|
||||
} from "@/api/company";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { getRoutePath } from "@/router";
|
||||
import DialogIndex from "./dialog_index.vue";
|
||||
initiate_contract
|
||||
} from '@/api/company'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { dictDataLists } from '@/api/setting/dict'
|
||||
import { getRoutePath } from '@/router'
|
||||
import DialogIndex from './dialog_index.vue'
|
||||
|
||||
const userStore = useUserStore();
|
||||
console.log(userStore.userInfo.company_id);
|
||||
const route = useRoute();
|
||||
const company_type_show = ref(true);
|
||||
const userStore = useUserStore()
|
||||
console.log(userStore.userInfo.company_id)
|
||||
const route = useRoute()
|
||||
const company_type_show = ref(true)
|
||||
// 创建合同与发送短信
|
||||
//弹窗
|
||||
const showPop = ref(false);
|
||||
const showConctactPop = ref(false);
|
||||
const showPop = ref(false)
|
||||
const showConctactPop = ref(false)
|
||||
const offPop = () => {
|
||||
showPop.value = false;
|
||||
showConctactPop.value = false;
|
||||
};
|
||||
const InitiateContractPop = ref(false);
|
||||
const showInitiateContractPop = ref(false);
|
||||
showPop.value = false
|
||||
showConctactPop.value = false
|
||||
}
|
||||
const InitiateContractPop = ref(false)
|
||||
const showInitiateContractPop = ref(false)
|
||||
const offInitiateContractPop = () => {
|
||||
showInitiateContractPop.value = false;
|
||||
InitiateContractPop.value = false;
|
||||
};
|
||||
showInitiateContractPop.value = false
|
||||
InitiateContractPop.value = false
|
||||
}
|
||||
// 创建合同的id
|
||||
const contractId = ref("");
|
||||
const contractId = ref('')
|
||||
|
||||
// 合同
|
||||
const contractFormData = ref({
|
||||
party_a: "",
|
||||
party_a_name: "",
|
||||
party_b: "",
|
||||
party_b_name: "",
|
||||
contract_type: "",
|
||||
contract_no: "",
|
||||
});
|
||||
party_a: '',
|
||||
party_a_name: '',
|
||||
party_b: '',
|
||||
party_b_name: '',
|
||||
contract_type: '',
|
||||
contract_no: ''
|
||||
})
|
||||
|
||||
const company_list = ref([]);
|
||||
const contract_type = ref([]);
|
||||
const company_list = ref([])
|
||||
const contract_type = ref([])
|
||||
|
||||
const getDetails = async (id: any) => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: id,
|
||||
});
|
||||
id: id
|
||||
})
|
||||
companyListTwo().then((res) => {
|
||||
company_list.value = res;
|
||||
});
|
||||
company_list.value = res
|
||||
})
|
||||
dictDataLists({ type_id: 7 }).then((res) => {
|
||||
contract_type.value = res.lists;
|
||||
});
|
||||
contractFormData.value.party_b = data.id;
|
||||
contractFormData.value.party_b_name = data.company_name;
|
||||
contract_type.value = res.lists
|
||||
})
|
||||
contractFormData.value.party_b = data.id
|
||||
contractFormData.value.party_b_name = data.company_name
|
||||
if (userStore.userInfo.company.id) {
|
||||
contractFormData.value.party_a = userStore.userInfo.company.id;
|
||||
contractFormData.value.party_a_name =
|
||||
userStore.userInfo.company.company_name;
|
||||
contractFormData.value.party_a = userStore.userInfo.company.id
|
||||
contractFormData.value.party_a_name = userStore.userInfo.company.company_name
|
||||
} else {
|
||||
contractFormData.value.party_a = "";
|
||||
contractFormData.value.party_a_name = "";
|
||||
contractFormData.value.party_a = ''
|
||||
contractFormData.value.party_a_name = ''
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const showChangeCompany = (row: any) => {
|
||||
contractId.value = row.id;
|
||||
getDetails(row.id);
|
||||
contractId.value = row.id
|
||||
getDetails(row.id)
|
||||
// showPop.value = true
|
||||
ShowInitiateContractPop();
|
||||
};
|
||||
ShowInitiateContractPop()
|
||||
}
|
||||
|
||||
const ShowInitiateContractPop = () => {
|
||||
(InitiateContractPop.value = true), (showInitiateContractPop.value = true);
|
||||
};
|
||||
;(InitiateContractPop.value = true), (showInitiateContractPop.value = true)
|
||||
}
|
||||
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 = () => {
|
||||
initiate_contract({
|
||||
id: contractId.value,
|
||||
...contractFormData.value,
|
||||
...contractFormData.value
|
||||
}).catch((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
offInitiateContractPop();
|
||||
};
|
||||
console.log(res)
|
||||
})
|
||||
offInitiateContractPop()
|
||||
}
|
||||
const creContct = () => {
|
||||
generateGontract({ id: contractId.value }).catch((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
offPop();
|
||||
};
|
||||
console.log(res)
|
||||
})
|
||||
offPop()
|
||||
}
|
||||
const sendMsg = () => {
|
||||
sendMsgApi({ id: contractId.value });
|
||||
offPop();
|
||||
};
|
||||
sendMsgApi({ id: contractId.value })
|
||||
offPop()
|
||||
}
|
||||
// 创建合同与发送短信结束
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
company_name: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
area_manager: "",
|
||||
company_name: '',
|
||||
area: '',
|
||||
street: '',
|
||||
company_type: '',
|
||||
area_manager: '',
|
||||
// 是否签约
|
||||
is_contract: "",
|
||||
});
|
||||
is_contract: ''
|
||||
})
|
||||
|
||||
if (route.query.company_type) {
|
||||
company_type_show.value = false;
|
||||
queryParams["company_type"] = route.query.company_type?.toString() || "";
|
||||
company_type_show.value = false
|
||||
queryParams['company_type'] = route.query.company_type?.toString() || ''
|
||||
}
|
||||
|
||||
const datas = reactive({
|
||||
dictTypeLists: [],
|
||||
});
|
||||
dictTypeLists: []
|
||||
})
|
||||
const getdictTypeLists = async () => {
|
||||
const data = await dictDataLists({ type_id: 6 });
|
||||
datas["dictTypeLists"] = data["lists"];
|
||||
};
|
||||
getdictTypeLists();
|
||||
const data = await dictDataLists({ type_id: 6 })
|
||||
datas['dictTypeLists'] = data['lists']
|
||||
}
|
||||
getdictTypeLists()
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
const selectData = ref<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({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams,
|
||||
});
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiCompanyDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiCompanyDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handleAuthentication = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要认证?");
|
||||
await authentication({ id });
|
||||
getLists();
|
||||
};
|
||||
await feedback.confirm('确定要认证?')
|
||||
await authentication({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
// 审核中
|
||||
const auditing = () => {
|
||||
ElMessage.warning("请等待合同审核完成!");
|
||||
};
|
||||
ElMessage.warning('请等待合同审核完成!')
|
||||
}
|
||||
|
||||
getLists();
|
||||
getLists()
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.btn {
|
||||
|
@ -165,13 +165,18 @@ import { getRoutePath } from '@/router'
|
||||
import { getUserList, creatContact, sendMsgApi } from '@/api/consumer'
|
||||
import { ClientMap } from '@/enums/appEnums'
|
||||
import feedback from '@/utils/feedback'
|
||||
const route = useRoute()
|
||||
|
||||
const queryParams = reactive({
|
||||
keyword: '',
|
||||
channel: '',
|
||||
create_time_start: '',
|
||||
create_time_end: ''
|
||||
create_time_end: '',
|
||||
company_id: ''
|
||||
})
|
||||
if (route.query.company_id) {
|
||||
queryParams.company_id = route.query.company_id
|
||||
}
|
||||
const contractId = ref(0)
|
||||
const showPop = ref(false)
|
||||
const showConctactPop = ref(false)
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
"@amap/amap-jsapi-loader@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz"
|
||||
resolved "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz"
|
||||
integrity sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==
|
||||
|
||||
"@ampproject/remapping@^2.1.0":
|
||||
|
Loading…
x
Reference in New Issue
Block a user