pull/781/head
parent
1dd341393a
commit
3fc90c00b7
|
|
@ -9,3 +9,13 @@ export const getAreaTree = async () => {
|
|||
export const getAreaByIp = async (ip: string) => {
|
||||
return await request.get({ url: '/system/area/get-by-ip?ip=' + ip })
|
||||
}
|
||||
|
||||
// 获得选择的地区
|
||||
export const getChooseAreaTree = async () => {
|
||||
return await request.get({ url: '/crm/area/getChooseAreaTree' })
|
||||
}
|
||||
|
||||
// 获得选择的地区
|
||||
export const setChooseAreaTree = async (data: any) => {
|
||||
return await request.put({ url: 'crm/area/update', data })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,7 +336,6 @@ const submitForm = async () => {
|
|||
|
||||
const changeCustomerId = (val) => {
|
||||
let arr = customerList.value.filter(v => v.id === val)
|
||||
console.log('%csrc/views/crm/contact/ContactForm.vue:341 arr', 'color: #007acc;', arr,customerList.value);
|
||||
if(arr.length) formData.value.registeredAddress = arr[0]['registeredAddress']
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@
|
|||
v-hasPermi="['crm:contact:update']"
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
@click="openForm('update', scope.row.id, scope.row.customerId)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
|
@ -269,8 +269,8 @@ const handleTabClick = (tab: TabsPaneContext) => {
|
|||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
const openForm = (type: string, id?: number, customerId?: number) => {
|
||||
formRef.value.open(type, id, customerId)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
|
|||
|
|
@ -106,14 +106,14 @@
|
|||
<ContentWrap>
|
||||
<ContractAuthPersonInfo
|
||||
ref="personDataRef"
|
||||
:products="formData.contractAAuthorizedPersons"
|
||||
:products="JSON.parse(JSON.stringify(formData.contractAAuthorizedPersons))"
|
||||
/>
|
||||
</ContentWrap>
|
||||
<ContentWrap style="border: none">
|
||||
甲方授权人
|
||||
</ContentWrap>
|
||||
<ContentWrap>
|
||||
<ContractBAuthorizedPersonForm ref="ContractBAuthorizedPersonFormRef" :formFields="formFields" :customerId="formData.customerId" :contract-id="formData.id" />
|
||||
<ContractBAuthorizedPersonForm ref="ContractBAuthorizedPersonFormRef" :data="formData.contractAAuthorizedCompanysHis" :formFields="formFields" :customerId="formData.customerId" :contract-id="formData.id" />
|
||||
</ContentWrap>
|
||||
</div>
|
||||
<ContracExtension ref="contractExtensionFormRef" :formFields="formFields" v-if="formData.changeItem == 3" :data="formData" />
|
||||
|
|
@ -245,7 +245,8 @@ const formData = ref({
|
|||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
changeItem: 1,
|
||||
products: []
|
||||
products: [],
|
||||
contractAAuthorizedCompanysHis: []
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||
|
|
@ -290,6 +291,7 @@ const open = async (type: string) => {
|
|||
try {
|
||||
let data = await ContractApi.getContract(type)
|
||||
data.agreementDeadline = moment(data.endTime).format('YYYY-MM-DD')
|
||||
formData.value.contractAAuthorizedCompanysHis = JSON.parse(JSON.stringify(data.contractAAuthorizedPersons))
|
||||
|
||||
if(!route.query.id) delete data.customerId
|
||||
|
||||
|
|
@ -390,11 +392,11 @@ if(contractFormRef.value) {
|
|||
data.changeAmount = dataFormList.changeAmount
|
||||
data.changeAmountDeadline = dataFormList.changeAmountDeadline
|
||||
} else if(formData.value.changeItem == 2) {
|
||||
let ids = []
|
||||
dataFormList.map(item => {
|
||||
ids.push(item.customerContactId)
|
||||
})
|
||||
data.afterAuthorizerId = ids.join(',')
|
||||
// let ids = []
|
||||
// dataFormList.map(item => {
|
||||
// ids.push(item.customerContactId)
|
||||
// })
|
||||
data.afterAuthorizerId = JSON.stringify(dataFormList)
|
||||
} else if(formData.value.changeItem == 3) {
|
||||
data.agreementDeadline = dataFormList.agreementDeadline
|
||||
data.extensionYears = dataFormList.extensionYears
|
||||
|
|
@ -407,7 +409,7 @@ if(contractFormRef.value) {
|
|||
} else if(formData.value.changeItem == 5) {
|
||||
let ids = []
|
||||
dataFormList.map(item => {
|
||||
ids.push(item.id)
|
||||
ids.push(item.customerCompanyId)
|
||||
})
|
||||
data.afterAffiliateCompanyId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 6) {
|
||||
|
|
|
|||
|
|
@ -901,7 +901,8 @@ const handleQuotationChange = async (quotationId: number) => {
|
|||
if (!quotationId) return
|
||||
try {
|
||||
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||
formData.value.products = quotation.products;
|
||||
|
||||
if(!formType.value) formData.value.products = quotation.products;
|
||||
// formData.value.customerId = quotation.customerId;
|
||||
|
||||
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ const getList = async (val) => {
|
|||
companyBank: v.companyBank,
|
||||
companyAccount: v.companyAccount,
|
||||
companyAddress: v.companyAddress,
|
||||
id: v.id
|
||||
// id: v.id,
|
||||
customerCompanyId: v.id
|
||||
})
|
||||
})
|
||||
formData.value = newList
|
||||
|
|
|
|||
|
|
@ -1,18 +1,22 @@
|
|||
<template>
|
||||
<el-table :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="是否授权人" prop="authPersonType" min-width="150" />
|
||||
<el-table-column label="姓名" prop="customerName" min-width="150" />
|
||||
<el-table-column label="手机号" prop="phoneNumber" min-width="150" />
|
||||
<el-table-column label="微信号" prop="wechat" min-width="150" />
|
||||
<el-table-column label="单位名称" prop="customerName" min-width="150" />
|
||||
<el-table-column label="职务" prop="name" min-width="150" />
|
||||
<el-table-column label="联系地址" prop="name" min-width="150" />
|
||||
<el-table-column label="类别" prop="name" min-width="150" />
|
||||
<el-table-column label="邮箱" prop="email" min-width="150" />
|
||||
<el-table-column label="身份证号" prop="name" min-width="150" />
|
||||
<el-table-column label="生日" prop="name" min-width="150" />
|
||||
<el-table-column label="性别" prop="name" min-width="150" />
|
||||
<!-- <el-table-column label="是否授权人" prop="authPersonType" align="center" min-width="150" /> -->
|
||||
<el-table-column label="姓名" prop="customerName" align="center" min-width="150" />
|
||||
<el-table-column label="手机号" prop="phoneNumber" align="center" min-width="150" />
|
||||
<el-table-column label="微信号" prop="wechat" align="center" min-width="150" />
|
||||
<!-- <el-table-column label="单位名称" prop="customerName" min-width="150" /> -->
|
||||
<el-table-column label="职务" prop="post" align="center" min-width="150" />
|
||||
<el-table-column label="家庭地址" prop="detailAddress" align="center" min-width="150" />
|
||||
<el-table-column label="类别" prop="name" align="center" min-width="150" />
|
||||
<el-table-column label="邮箱" prop="email" align="center" min-width="150" />
|
||||
<el-table-column label="身份证号" prop="idNumber" align="center" min-width="180" />
|
||||
<el-table-column label="生日" prop="birthday" align="center" min-width="150" />
|
||||
<el-table-column label="性别" prop="sex" align="center" min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
<ContentWrap style="border: none">
|
||||
甲方授权人
|
||||
</ContentWrap>
|
||||
<ContractBAuthorizedPersonForm :formFields="formFields" :type="1" ref="ContractBAuthorizedPersonFormRef" :customerId="formData.customerId" :contract-id="formData.id" />
|
||||
<ContractBAuthorizedPersonForm :formFields="formFields" :type="1" :data="formData.contractAAuthorizedCompanysHis" ref="ContractBAuthorizedPersonFormRef" :customerId="formData.customerId" :contract-id="formData.id" />
|
||||
</div>
|
||||
<ContracExtension ref="contractExtensionFormRef" :isTrue="isTrue" :formFields="formFields" v-if="formData.changeItem == 3" :data="formData" />
|
||||
<el-col :span="24">
|
||||
|
|
@ -257,7 +257,8 @@ const formData = ref({
|
|||
deptId: undefined,
|
||||
quotationTimes: undefined,
|
||||
changeItem: 1,
|
||||
products: []
|
||||
products: [],
|
||||
contractAAuthorizedCompanysHis: []
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '合同名称不能为空', trigger: 'blur' }],
|
||||
|
|
@ -302,6 +303,7 @@ const open = async (type: string) => {
|
|||
// formData.value = Object.assign(formData.value, data)
|
||||
let data = await ContractApi.getChangeContract(type)
|
||||
formData.value = data.contractDetail
|
||||
formData.value.contractAAuthorizedCompanysHis = JSON.parse(JSON.stringify(data.contractAAuthorizedPersons))
|
||||
formData.value.contractAAuthorizedCompanys = data.contractAAuthorizedCompanys
|
||||
|
||||
//重签拿contractDetail字段
|
||||
|
|
@ -415,11 +417,11 @@ if(contractFormRef.value) {
|
|||
data.changeAmount = dataFormList.changeAmount
|
||||
data.changeAmountDeadline = dataFormList.changeAmountDeadline
|
||||
} else if(formData.value.changeItem == 2) {
|
||||
let ids = []
|
||||
dataFormList.map(item => {
|
||||
ids.push(item.id)
|
||||
})
|
||||
data.afterAuthorizerId = ids.join(',')
|
||||
// let ids = []
|
||||
// dataFormList.map(item => {
|
||||
// ids.push(item.id)
|
||||
// })
|
||||
data.afterAuthorizerId = JSON.stringify(dataFormList)
|
||||
} else if(formData.value.changeItem == 3) {
|
||||
data.agreementDeadline = dataFormList.agreementDeadline
|
||||
data.extensionYears = dataFormList.extensionYears
|
||||
|
|
@ -432,7 +434,7 @@ if(contractFormRef.value) {
|
|||
} else if(formData.value.changeItem == 5) {
|
||||
let ids = []
|
||||
dataFormList.map(item => {
|
||||
ids.push(item.id)
|
||||
ids.push(item.customerCompanyId)
|
||||
})
|
||||
data.afterAffiliateCompanyId = ids.join(',')
|
||||
} else if(formData.value.changeItem == 6) {
|
||||
|
|
|
|||
|
|
@ -1032,7 +1032,7 @@ const handleQuotationChange = async (quotationId: number) => {
|
|||
if (!quotationId) return
|
||||
try {
|
||||
const quotation = await QuotationApi.getQuotation(quotationId)
|
||||
formData.value.products = quotation.products;
|
||||
// formData.value.products = quotation.products;
|
||||
formData.value.customerId = quotation.customerId;
|
||||
|
||||
formData.value.invoiceTemplateId = quotation.invoiceTemplateId;
|
||||
|
|
|
|||
|
|
@ -11,30 +11,59 @@
|
|||
<!-- 操作 -->
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<CardTitle title="行业设置" />
|
||||
<el-button type="primary" @click="onSubmit" v-hasPermi="['crm:contract-config:update']">
|
||||
<CardTitle title="额度设置" />
|
||||
<el-button type="primary" @click="onSubmit" v-hasPermi="['crm:contract-industry:update']">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 表单 -->
|
||||
<el-form-item label="提前提醒设置" prop="notifyEnabled">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
v-model="formData.deptId"
|
||||
:data="list"
|
||||
|
||||
:props="props"
|
||||
filterable
|
||||
@check="nodeClick"
|
||||
:cache-data="cacheData"
|
||||
node-key="id"
|
||||
multiple
|
||||
:render-after-expand="false"
|
||||
show-checkbox
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="禁授行业" prop="notifyEnabled">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
v-model="formData.deptId"
|
||||
:data="list"
|
||||
|
||||
:props="props"
|
||||
filterable
|
||||
@check="nodeClick"
|
||||
:cache-data="cacheData"
|
||||
node-key="id"
|
||||
multiple
|
||||
:render-after-expand="false"
|
||||
show-checkbox
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="禁授地区" prop="notifyEnabled">
|
||||
<div style="width: 100%; height: 700px">
|
||||
<el-auto-resizer>
|
||||
<template #default="{ height, width }">
|
||||
<el-tree-v2
|
||||
ref="treeAreaRef"
|
||||
:width="width"
|
||||
:height="height"
|
||||
v-model="formData.areaId"
|
||||
:data="areaList"
|
||||
:props="props"
|
||||
filterable
|
||||
@check="nodeClickArea"
|
||||
node-key="id"
|
||||
multiple
|
||||
:render-after-expand="false"
|
||||
show-checkbox
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</template>
|
||||
</el-auto-resizer>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
|
@ -45,6 +74,7 @@ import download from '@/utils/download'
|
|||
import { IndustryApi, IndustryVO } from '@/api/crm/industry'
|
||||
import IndustryForm from './IndustryForm.vue'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import * as AreaApi from '@/api/system/area'
|
||||
|
||||
/** 行业 列表 */
|
||||
defineOptions({ name: 'Industry' })
|
||||
|
|
@ -53,10 +83,12 @@ const message = useMessage() // 消息弹窗
|
|||
const { t } = useI18n() // 国际化
|
||||
|
||||
const formData = reactive({
|
||||
deptId: undefined
|
||||
deptId: undefined,
|
||||
areaId: undefined
|
||||
})
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<IndustryVO[]>([]) // 列表的数据
|
||||
const areaList = ref([])
|
||||
const total = ref(0) // 列表的总页数
|
||||
const props = ref({
|
||||
label: 'name',
|
||||
|
|
@ -74,7 +106,9 @@ const queryParams = reactive({
|
|||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const treeRef = ref('')
|
||||
const treeAreaRef = ref('')
|
||||
const cacheDataList = ref([])
|
||||
const cacheDataAreaList = ref([])
|
||||
const formLoading = ref(false)
|
||||
|
||||
|
||||
|
|
@ -92,16 +126,22 @@ const load = (node, resolve) => {
|
|||
}, 400)
|
||||
}
|
||||
|
||||
//行业
|
||||
const nodeClick = (checkedNodes,checkedKeys,halfCheckedNodes,halfCheckedKeys) => {
|
||||
// console.log('%csrc/views/crm/industry/index.vue:96 node', 'color: #007acc;', checkedKeys);
|
||||
cacheDataList.value = [...checkedKeys.checkedKeys, ...checkedKeys.halfCheckedKeys]
|
||||
}
|
||||
|
||||
//地区
|
||||
const nodeClickArea = (checkedNodes,checkedKeys,halfCheckedNodes,halfCheckedKeys) => {
|
||||
cacheDataAreaList.value = [...checkedKeys.checkedKeys, ...checkedKeys.halfCheckedKeys]
|
||||
}
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
formLoading.value = true
|
||||
try {
|
||||
list.value = await IndustryApi.getIndustryPage()
|
||||
areaList.value = await AreaApi.getAreaTree()
|
||||
// getIds(list.value)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
|
|
@ -110,14 +150,24 @@ const getList = async () => {
|
|||
// 查询选中的树
|
||||
const getCheckNodes = async () => {
|
||||
let data = await IndustryApi.getIndustry()
|
||||
cacheDataList.value =
|
||||
setCheckedKeys(data.chooseIds)
|
||||
|
||||
let dataArea = await AreaApi.getChooseAreaTree()
|
||||
setCheckedAreaKeys(dataArea.chooseIds)
|
||||
}
|
||||
|
||||
const onSubmit = async () => {
|
||||
try {
|
||||
const checkedNodes = treeRef.value.getCheckedNodes();
|
||||
const checkedIds = checkedNodes.map(node => node.id);
|
||||
await IndustryApi.updateIndustry({
|
||||
ids: cacheDataList.value
|
||||
ids: checkedIds
|
||||
})
|
||||
const checkedAreaNodes = treeAreaRef.value.getCheckedNodes();
|
||||
const checkedAreaIds = checkedAreaNodes.map(node => node.id);
|
||||
await AreaApi.setChooseAreaTree({
|
||||
ids: checkedAreaIds
|
||||
})
|
||||
message.success(t('common.updateSuccess'))
|
||||
} finally {
|
||||
|
|
@ -132,11 +182,16 @@ const onSubmit = async () => {
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//行业
|
||||
const setCheckedKeys = (data) => {
|
||||
treeRef.value!.setCheckedKeys(data, false)
|
||||
}
|
||||
|
||||
//地区
|
||||
const setCheckedAreaKeys = (data) => {
|
||||
treeAreaRef.value!.setCheckedKeys(data, false)
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<template #cooperationType>
|
||||
<!-- <template #cooperationType>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合作类型" prop="cooperationType">
|
||||
<el-select v-model="formData.cooperationType" disabled placeholder="" filterable clearable class="w-1/1">
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #regType>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="regType">
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="cooperationType">
|
||||
<el-select v-model="formData.cooperationType" disabled filterable clearable placeholder="" class="w-1/1">
|
||||
<el-option
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司类型" prop="regType">
|
||||
<el-input v-model="formData.regType" disabled placeholder="" clearable />
|
||||
|
|
@ -114,8 +114,6 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="企业类型" prop="enterpriseType">
|
||||
<el-input v-model="formData.enterpriseType" clearable />
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<div style="width: 100%; height: 700px">
|
||||
<div style="width: 100%; height: 500px">
|
||||
<!-- AutoResizer 自动调节大小 -->
|
||||
<el-auto-resizer>
|
||||
<template #default="{ height, width }">
|
||||
|
|
|
|||
Loading…
Reference in New Issue