1
This commit is contained in:
parent
5b075e02a1
commit
b78e1e2b31
160
src/components/custom_contacts/index.vue
Normal file
160
src/components/custom_contacts/index.vue
Normal file
@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<el-dialog v-model="dialogVisible" title="人员选择器" width="400px" :before-close="handleClose">
|
||||
<div>
|
||||
<div style="margin-bottom: 20px">
|
||||
<div style="margin-top: 20px">
|
||||
<el-radio-group v-model="radionum">
|
||||
<el-radio :label="item" v-for="(item, i) in uesrlist" :key="i" style="margin-bottom: 40px;">
|
||||
<div class="radio-con">
|
||||
<!-- <div class="radioa">-->
|
||||
<!-- <img :src="item.avatar" alt=""/>-->
|
||||
<!-- </div>-->
|
||||
<div class="radiob">
|
||||
<div class="radiob_a">{{ item.name }}<div class="ml-4 inline-block"><text v-if="item.job">职务:{{ item.job }}</text>
|
||||
<text v-if="item.dept">/{{ item.dept }}</text></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-radio>
|
||||
<br/>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="userclick" >确认</el-button>
|
||||
<!-- <el-button type="primary" @click="userclick" v-else> {{ radiolist.length > 0 ? '已选' : '未选' }}-->
|
||||
<!-- <text v-if="radiolist.length > 0">{{ radiolist.length }}</text></el-button>-->
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="projectPreSalesMembersEdit">
|
||||
import {reactive} from 'vue'
|
||||
import {apiMarketingCustomContactsLists} from '@/api/marketing_custom'
|
||||
import {defineEmits} from "vue"
|
||||
|
||||
const leixin = ref('0')
|
||||
const props = defineProps({
|
||||
type: {
|
||||
custom_id: '',//客户id
|
||||
default: () => ({})
|
||||
},
|
||||
// query: {
|
||||
// type: Object,
|
||||
// }
|
||||
})
|
||||
const emits = defineEmits(['confirm'])
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const uesrlist = reactive([])
|
||||
const isshow = ref(true);
|
||||
const radiolist = ref([])
|
||||
const radionum = ref([])
|
||||
|
||||
// 获取全部人员
|
||||
const getlist = () => {
|
||||
apiMarketingCustomContactsLists({'custom_id':props.type}).then((res) => {
|
||||
Object.assign(uesrlist, res.lists)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//打开弹窗
|
||||
const open = (e: any) => {
|
||||
getlist()
|
||||
|
||||
leixin.value = e
|
||||
dialogVisible.value = true
|
||||
|
||||
}
|
||||
//获取选择的数据
|
||||
const userclick = () => {
|
||||
dialogVisible.value = false
|
||||
emits("confirm", radionum.value);
|
||||
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
userclick
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.userlist {
|
||||
display: flex;
|
||||
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
text-align: center;
|
||||
|
||||
.userlist-con {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.user {
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.radio-con {
|
||||
display: flex;
|
||||
width: 500px;
|
||||
align-items: center;
|
||||
|
||||
.radioa {
|
||||
img {
|
||||
margin-right: 20px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.radiob {
|
||||
.radiob_a {
|
||||
margin-bottom: 10px;
|
||||
margin-top: 3px;
|
||||
|
||||
}
|
||||
|
||||
.radiob_b {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.lad {
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #f7f7f7;
|
||||
|
||||
div {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.Collapsebj {
|
||||
background-color: #3e8ef7;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
color: #f7f7f7;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -557,6 +557,12 @@ const customEvent = (e) => {
|
||||
formData.total_investment = e.project_money
|
||||
formData.supervision_department = e.supervise_dept
|
||||
formData.contract_amount = e.signed_amount
|
||||
formData.company_name = e.part_b
|
||||
formData.company = e.part_b
|
||||
formData.contract_content = e.content
|
||||
formData.consult_user_name = e.part_a_contact
|
||||
formData.consult_user = e.part_a
|
||||
formData.telephone = e.part_a_telephone
|
||||
|
||||
formData.project_overview = e.project_scale
|
||||
|
||||
|
@ -141,7 +141,6 @@ import type { PropType } from 'vue'
|
||||
import {cost_approved_projects} from "@/components/dialogTable/dialogTableConfig";
|
||||
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
@ -194,12 +193,20 @@ const customEvent = (e) => {
|
||||
formData.contract_id = e.id
|
||||
formData.contract_name = e.contract_name
|
||||
formData.contract_type = e.contract_type_text
|
||||
formData.part_a = e.part_a
|
||||
formData.part_a = e.part_a_name
|
||||
formData.part_b = e.part_b
|
||||
formData.sign_money = e.money
|
||||
formData.sign_money = e.signed_amount
|
||||
formData.sign_time = e.sign_date
|
||||
formData.total_invoice_amount = e.total_invoice_amount
|
||||
formData.total_refund_amount = e.total_refund_amount
|
||||
formData.apply_company = e.marketing_custom?.invoice_company
|
||||
formData.apply_company_number = e.marketing_custom?.taxpayer_identification_number
|
||||
formData.apply_company_address = e.marketing_custom?.invoice_company_address
|
||||
formData.apply_company_telephone = e.marketing_custom?.invoice_company_telephone
|
||||
formData.apply_company_bank = e.marketing_custom?.opening_bank
|
||||
formData.apply_company_account = e.marketing_custom?.opening_bank_account
|
||||
formData.apply_contact = e.marketing_custom?.invoice_contact
|
||||
formData.apply_email = e.marketing_custom?.email
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
@ -333,7 +340,6 @@ const handleClose = () => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
|
@ -24,7 +24,8 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人" prop="part_a_contact">
|
||||
<el-input v-model="formData.part_a_contact" clearable placeholder="请输入联系人" />
|
||||
<el-input v-model="formData.part_a_contact" clearable placeholder="请输入联系人"
|
||||
@click="custom_contacts_click('part_a_contact')"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -41,7 +42,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="乙方签约人" prop="part_b_signatory">
|
||||
<el-input v-model="formData.part_b_signatory_name" clearable placeholder="请输入乙方签约人"
|
||||
@click="userclick('part_b_signatory')" />
|
||||
@click="custom_contacts_click('part_b_signatory')"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -163,6 +164,9 @@
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1">
|
||||
</personnelselector>
|
||||
</div>
|
||||
<div v-if="showDialog2">
|
||||
<custom_contacts ref="personnel2" @confirm="submituser2" :type="custom_id"></custom_contacts>
|
||||
</div>
|
||||
<el-dialog v-model="showDialog1" title="选择甲方签订单位" width="70%">
|
||||
<dialogTable :config="marketing_custom" @customEvent="customEvent">
|
||||
</dialogTable>
|
||||
@ -178,7 +182,6 @@ import { apimketingFrameworkAgreementAdd, apimketingFrameworkAgreementEdit } fro
|
||||
import {marketing_custom} from "@/components/dialogTable/dialogTableConfig";
|
||||
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
@ -193,7 +196,10 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
const showDialog2 = ref(false)
|
||||
const personnel = ref(null)
|
||||
const personnel2 = ref(null)
|
||||
const custom_id = ref('')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
@ -209,8 +215,10 @@ const formData = reactive({
|
||||
"part_a": '',
|
||||
"part_a_name": '',
|
||||
"part_a_contact": "",
|
||||
"part_a_contact_name": "",
|
||||
"part_a_address": "",
|
||||
"part_b": "",
|
||||
"part_b_name": "",
|
||||
"part_b_signatory": '',
|
||||
"part_b_signatory_name": '',
|
||||
"business_nature": '',
|
||||
@ -242,38 +250,58 @@ const isPartb = ref(false)
|
||||
const customEvent = (e) => {
|
||||
if (isPartb.value) {
|
||||
formData.part_b = e.name
|
||||
formData.part_b_signatory = e.id
|
||||
formData.part_b_signatory_name = e.invoice_contact_name
|
||||
// formData.part_b = e.id
|
||||
// custom_id.value = e.id
|
||||
// formData.part_b_signatory_name = e.invoice_contact_name
|
||||
} else {
|
||||
formData.part_a = e.id
|
||||
formData.part_a_name = e.name
|
||||
formData.part_a_contact = e.invoice_contact_name
|
||||
// custom_id.value = e.id
|
||||
|
||||
// formData.part_a_contact = e.invoice_contact_name
|
||||
formData.part_a_address = e.invoice_company_address
|
||||
}
|
||||
showDialog1.value = false
|
||||
}
|
||||
|
||||
let value;
|
||||
let value2;
|
||||
const custom_contacts_click = async (val) => {
|
||||
if(val=='part_a_contact'){
|
||||
custom_id.value= formData.part_a
|
||||
}else{
|
||||
custom_id.value= formData.part_b
|
||||
}
|
||||
showDialog2.value = true
|
||||
value2 = val
|
||||
await nextTick()
|
||||
personnel2.value.open()
|
||||
}
|
||||
const userclick = async (val) => {
|
||||
showDialog.value = true
|
||||
value = val
|
||||
await nextTick()
|
||||
personnel.value.open()
|
||||
|
||||
}
|
||||
|
||||
//确认
|
||||
const submituser = (e: any) => {
|
||||
formData[value + '_name'] = e.name
|
||||
formData[value] = e.id
|
||||
showDialog.value = false
|
||||
}
|
||||
const submituser2 = (e: any) => {
|
||||
if(value2=='part_a_contact'){
|
||||
formData[value2] = e.name
|
||||
}else{
|
||||
formData[value2 + '_name'] = e.name
|
||||
formData[value2] = e.id
|
||||
}
|
||||
|
||||
showDialog2.value = false
|
||||
}
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
const formRules = reactive<any>({})
|
||||
|
||||
|
||||
// 获取详情
|
||||
@ -289,11 +317,12 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
if(formData.part_a_contact_name){
|
||||
formData.part_a_contact=formData.part_a_contact_name
|
||||
}
|
||||
const data = {...formData,}
|
||||
mode.value == 'edit'
|
||||
? await apimketingFrameworkAgreementEdit(data)
|
||||
@ -314,7 +343,6 @@ const handleClose = () => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
|
Loading…
x
Reference in New Issue
Block a user