This commit is contained in:
mkm 2024-07-30 22:24:46 +08:00
parent 5b075e02a1
commit b78e1e2b31
4 changed files with 738 additions and 538 deletions

View 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>

View File

@ -548,7 +548,7 @@ const customEvent = (e) => {
formData.contract = e.id
formData.contract_name = e.contract_name
formData.project_name = e.contract_name
formData.nature = e.industry_nature
formData.nature = e.industry_nature
formData.industry = e.business_nature
formData.project_manager = e.project_director
formData.part_a = e.part_a
@ -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

View File

@ -1,152 +1,151 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="135px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="合同名称" prop="contract_name">
<el-input v-model="formData.contract_name" clearable placeholder="点击选择合同"
@click="showDialog = true" readonly />
</el-form-item>
</el-col>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="135px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="合同名称" prop="contract_name">
<el-input v-model="formData.contract_name" clearable placeholder="点击选择合同"
@click="showDialog = true" readonly/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同类型">
<el-input v-model="formData.contract_type" clearable placeholder="系统自动获取" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方签约单位">
<el-input v-model="formData.part_a" clearable placeholder="系统自动获取" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="乙方签约单位">
<el-input v-model="formData.part_b" clearable placeholder="系统自动获取" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订金额(元)">
<el-input v-model="formData.sign_money" clearable placeholder="系统自动获取" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同签订日期">
<el-input v-model="formData.sign_time" clearable placeholder="系统自动获取" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计已开票(元)">
<el-input v-model="formData.total_invoice_amount" clearable placeholder="系统自动获取" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计已到账(元)">
<el-input v-model="formData.total_refund_amount" clearable placeholder="系统自动获取" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同类型">
<el-input v-model="formData.contract_type" clearable placeholder="系统自动获取" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方签约单位">
<el-input v-model="formData.part_a" clearable placeholder="系统自动获取" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="乙方签约单位">
<el-input v-model="formData.part_b" clearable placeholder="系统自动获取" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订金额(元)">
<el-input v-model="formData.sign_money" clearable placeholder="系统自动获取" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同签订日期">
<el-input v-model="formData.sign_time" clearable placeholder="系统自动获取" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计已开票(元)">
<el-input v-model="formData.total_invoice_amount" clearable placeholder="系统自动获取" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="累计已到账(元)">
<el-input v-model="formData.total_refund_amount" clearable placeholder="系统自动获取" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票编号">
<el-input v-model="formData.invoice_code" clearable placeholder="系统自动生成" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型" prop="invoice_type">
<el-select class="flex-1" v-model="formData.invoice_type" clearable placeholder="请选择发票类型">
<el-option v-for="(item, index) in dictData.zjzx_invoice_type" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
<el-col :span="8">
<el-form-item label="开票编号">
<el-input v-model="formData.invoice_code" clearable placeholder="系统自动生成" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票类型" prop="invoice_type">
<el-select class="flex-1" v-model="formData.invoice_type" clearable placeholder="请选择发票类型">
<el-option v-for="(item, index) in dictData.zjzx_invoice_type" :key="index"
:label="item.name" :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票申请金额" prop="apply_amount">
<el-input v-model="formData.apply_amount" clearable placeholder="请输入开票申请金额" type="number" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票单位名称" prop="apply_company">
<el-input v-model="formData.apply_company" clearable placeholder="请输入开票单位名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
<el-input v-model="formData.apply_company_number" clearable placeholder="请输入纳税人识别号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票单位注册地址">
<el-input v-model="formData.apply_company_address" clearable placeholder="请输入开票单位注册地址" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票单位电话">
<el-input v-model="formData.apply_company_telephone" clearable placeholder="请输入开票单位电话" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
<el-input v-model="formData.apply_company_bank" clearable placeholder="请输入开户银行" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户账号">
<el-input v-model="formData.apply_company_account" clearable placeholder="请输入开户账号"
v-type="'account'" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票联系人">
<el-input v-model="formData.apply_contact" clearable placeholder="请输入开票联系人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票接收邮箱" prop="apply_email">
<el-input v-model="formData.apply_email" clearable placeholder="请输入发票接收邮箱" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="对应付款方式">
<el-input v-model="formData.pay_type" clearable placeholder="请输入对应付款方式" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
<el-input v-model="formData.invoice_content" clearable placeholder="请输入开票内容" />
</el-form-item>
</el-col>
<createUserLable flag :formData="formData" />
<el-col :span="8">
<el-form-item label="发票上传">
<UploadAnnex :formData="formData"></UploadAnnex>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 1 }">
</dialogTable>
</el-dialog>
</popup>
</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票申请金额" prop="apply_amount">
<el-input v-model="formData.apply_amount" clearable placeholder="请输入开票申请金额" type="number"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票单位名称" prop="apply_company">
<el-input v-model="formData.apply_company" clearable placeholder="请输入开票单位名称"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别号">
<el-input v-model="formData.apply_company_number" clearable placeholder="请输入纳税人识别号"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票单位注册地址">
<el-input v-model="formData.apply_company_address" clearable placeholder="请输入开票单位注册地址"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票单位电话">
<el-input v-model="formData.apply_company_telephone" clearable placeholder="请输入开票单位电话"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户银行">
<el-input v-model="formData.apply_company_bank" clearable placeholder="请输入开户银行"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户账号">
<el-input v-model="formData.apply_company_account" clearable placeholder="请输入开户账号"
v-type="'account'"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票联系人">
<el-input v-model="formData.apply_contact" clearable placeholder="请输入开票联系人"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票接收邮箱" prop="apply_email">
<el-input v-model="formData.apply_email" clearable placeholder="请输入发票接收邮箱"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="对应付款方式">
<el-input v-model="formData.pay_type" clearable placeholder="请输入对应付款方式"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开票内容">
<el-input v-model="formData.invoice_content" clearable placeholder="请输入开票内容"/>
</el-form-item>
</el-col>
<createUserLable flag :formData="formData"/>
<el-col :span="8">
<el-form-item label="发票上传">
<UploadAnnex :formData="formData"></UploadAnnex>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-dialog v-model="showDialog" title="选择合同" width="70%">
<dialogTable :config="cost_approved_projects" @customEvent="customEvent" :query="{ status: 1 }">
</dialogTable>
</el-dialog>
</popup>
</div>
</template>
<script lang="ts" setup name="financialInvoiceEdit">
import type { FormInstance } from 'element-plus'
import type {FormInstance} from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiFinancialInvoiceAdd, apiFinancialInvoiceEdit, apiFinancialInvoiceDetail } from '@/api/financial_invoice'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
import { cost_approved_projects } from "@/components/dialogTable/dialogTableConfig";
import {apiFinancialInvoiceAdd, apiFinancialInvoiceEdit, apiFinancialInvoiceDetail} from '@/api/financial_invoice'
import {timeFormat} from '@/utils/util'
import type {PropType} from 'vue'
import {cost_approved_projects} from "@/components/dialogTable/dialogTableConfig";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
@ -157,186 +156,193 @@ const showDialog = ref(false)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑财务管理--开票台账' : '新增财务管理--开票台账'
return mode.value == 'edit' ? '编辑财务管理--开票台账' : '新增财务管理--开票台账'
})
//
const formData = reactive({
id: '',
contract_id: '',
contract_name: "",
invoice_code: '',
invoice_type: '',
apply_amount: '',
apply_company: '',
apply_company_number: '',
apply_company_address: '',
apply_company_telephone: '',
apply_company_bank: '',
apply_company_account: '',
apply_contact: '',
apply_email: '',
pay_type: '',
invoice_content: '',
create_user: '',
create_time: '',
"contract_type": "",
"part_a": "",
"part_b": "",
"sign_money": "",
"sign_time": "",
"total_invoice_amount": 0,
"total_refund_amount": 0,
annex: []
id: '',
contract_id: '',
contract_name: "",
invoice_code: '',
invoice_type: '',
apply_amount: '',
apply_company: '',
apply_company_number: '',
apply_company_address: '',
apply_company_telephone: '',
apply_company_bank: '',
apply_company_account: '',
apply_contact: '',
apply_email: '',
pay_type: '',
invoice_content: '',
create_user: '',
create_time: '',
"contract_type": "",
"part_a": "",
"part_b": "",
"sign_money": "",
"sign_time": "",
"total_invoice_amount": 0,
"total_refund_amount": 0,
annex: []
})
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_b = e.part_b
formData.sign_money = e.money
formData.sign_time = e.sign_date
formData.total_invoice_amount = e.total_invoice_amount
formData.total_refund_amount = e.total_refund_amount
showDialog.value = false
formData.contract_id = e.id
formData.contract_name = e.contract_name
formData.contract_type = e.contract_type_text
formData.part_a = e.part_a_name
formData.part_b = e.part_b
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
}
//
const formRules = reactive<any>({
contract_name: [{
required: true,
message: '请选择合同',
trigger: ['blur']
}],
invoice_code: [{
required: true,
message: '请输入开票编号',
trigger: ['blur']
}],
invoice_type: [{
required: true,
message: '请输入发票类型',
trigger: ['blur']
}],
apply_amount: [{
required: true,
message: '请输入开票申请金额',
trigger: ['blur']
}],
apply_company: [{
required: true,
message: '请输入开票单位名称',
trigger: ['blur']
}],
apply_company_number: [{
required: true,
message: '请输入纳税人识别号',
trigger: ['blur']
}],
apply_company_address: [{
required: true,
message: '请输入开票单位注册地址',
trigger: ['blur']
}],
apply_company_telephone: [{
required: true,
message: '请输入开票单位电话',
trigger: ['blur']
}],
apply_company_bank: [{
required: true,
message: '请输入开户银行',
trigger: ['blur']
}],
apply_company_account: [{
required: true,
message: '请输入开户账号',
trigger: ['blur']
}],
apply_contact: [{
required: true,
message: '请输入开票联系人',
trigger: ['blur']
}],
apply_email: [
{
required: true,
message: '请输入邮箱',
trigger: 'blur',
},
{
type: 'email',
message: '请输入正确的邮箱',
trigger: ['blur', 'change'],
},
],
pay_type: [{
required: true,
message: '请输入对应付款方式',
trigger: ['blur']
}],
invoice_content: [{
required: true,
message: '请输入开票内容',
trigger: ['blur']
}],
create_user: [{
required: true,
message: '请输入开票申请人',
trigger: ['blur']
}]
contract_name: [{
required: true,
message: '请选择合同',
trigger: ['blur']
}],
invoice_code: [{
required: true,
message: '请输入开票编号',
trigger: ['blur']
}],
invoice_type: [{
required: true,
message: '请输入发票类型',
trigger: ['blur']
}],
apply_amount: [{
required: true,
message: '请输入开票申请金额',
trigger: ['blur']
}],
apply_company: [{
required: true,
message: '请输入开票单位名称',
trigger: ['blur']
}],
apply_company_number: [{
required: true,
message: '请输入纳税人识别号',
trigger: ['blur']
}],
apply_company_address: [{
required: true,
message: '请输入开票单位注册地址',
trigger: ['blur']
}],
apply_company_telephone: [{
required: true,
message: '请输入开票单位电话',
trigger: ['blur']
}],
apply_company_bank: [{
required: true,
message: '请输入开户银行',
trigger: ['blur']
}],
apply_company_account: [{
required: true,
message: '请输入开户账号',
trigger: ['blur']
}],
apply_contact: [{
required: true,
message: '请输入开票联系人',
trigger: ['blur']
}],
apply_email: [
{
required: true,
message: '请输入邮箱',
trigger: 'blur',
},
{
type: 'email',
message: '请输入正确的邮箱',
trigger: ['blur', 'change'],
},
],
pay_type: [{
required: true,
message: '请输入对应付款方式',
trigger: ['blur']
}],
invoice_content: [{
required: true,
message: '请输入开票内容',
trigger: ['blur']
}],
create_user: [{
required: true,
message: '请输入开票申请人',
trigger: ['blur']
}]
})
//
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]
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiFinancialInvoiceDetail({
id: row.id
})
setFormData(data)
const data = await apiFinancialInvoiceDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiFinancialInvoiceEdit(data)
: await apiFinancialInvoiceAdd(data)
popupRef.value?.close()
emit('success')
await formRef.value?.validate()
const data = {...formData,}
mode.value == 'edit'
? await apiFinancialInvoiceEdit(data)
: await apiFinancialInvoiceAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
open,
setFormData,
getDetail
})
</script>

View File

@ -1,190 +1,193 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="协议名称" prop="contract_name">
<el-input v-model="formData.contract_name" clearable placeholder="请输入协议名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="协议性质" prop="agreement_nature">
<el-select class=' flex-1' v-model="formData.agreement_nature">
<el-option v-for="(item, index) in dictData.agreement_nature " :key="index"
:label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方签订单位" prop="part_a">
<el-input v-model="formData.part_a_name" clearable placeholder="点击选择甲方签约单位"
@click="showDialog1 = true, isPartb = false" readonly />
</el-form-item>
</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-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="业主地址" prop="part_a_address">
<el-input v-model="formData.part_a_address" clearable placeholder="请输入业主地址" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="乙方签约单位" prop="part_b">
<el-input v-model="formData.part_b" @click="showDialog1 = true, isPartb = true" clearable
placeholder="点击选择乙方签约单位" />
</el-form-item>
</el-col>
<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')" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="业务性质" prop="business_nature">
<el-select class=' flex-1' v-model="formData.business_nature">
<el-option v-for="(item, index) in dictData.cost_consultation_business_nature "
:key="index" :label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="暂估签订金额" prop="signed_amount">
<el-input v-model="formData.signed_amount" clearable placeholder="请输入暂估签订金额" type="number" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订费率(%)" prop="signed_rate">
<el-input v-model="formData.signed_rate" clearable placeholder="请输入签订费率" type="number" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="协议有效期" prop="service_duration">
<el-input v-model="formData.service_duration" clearable placeholder="请输入协议有效期" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="取消规则" prop="payment_method">
<el-input v-model="formData.payment_method" clearable placeholder="请输入取消规则" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="协议主要内容" prop="content">
<el-input v-model="formData.content" clearable placeholder="请输入协议主要内容" type="textarea" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件" prop="">
<upload-annex :form-data="formData"></upload-annex>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订部门" prop="signed_dept">
<el-select v-model="formData.signed_dept" placeholder="请选择部门" class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订负责人" prop="signed_head">
<el-input v-model="formData.signed_head_name" readonly clearable placeholder="点击选择签订负责人"
@click="userclick('signed_head')" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盖章名称" prop="seal_name">
<el-select class=' flex-1' v-model="formData.seal_name">
<el-option v-for="(item, index) in dictData.cost_consultation_seal_name " :key="index"
:label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否限制次数" prop="is_limit">
<el-select class=' flex-1' v-model="formData.is_limit">
<el-option label="是" :value="parseInt(1)"></el-option>
<el-option label="否" :value="parseInt(0)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if='formData.is_limit'>
<el-form-item label="限制次数" prop="limit_num">
<el-input v-model="formData.limit_num" clearable placeholder="请输入限制次数" type='number' />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="文件类型" prop="file_type">
<el-select class=' flex-1' v-model="formData.file_type">
<el-option v-for="(item, index) in dictData.cost_consultation_file_type " :key="index"
:label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盖章份数" prop="seal_num">
<el-input v-model="formData.seal_num" clearable placeholder="请输入盖章份数" type='number' />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盖章人" prop="seal_user_name">
<el-input v-model="formData.seal_user_name" clearable placeholder="点击选择盖章人" readonly
@click="userclick('seal_user')" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="骑缝盖章" prop="plance_seal">
<el-select class=' flex-1' v-model="formData.plance_seal">
<el-option v-for="(item, index) in dictData.isqfgz " :key="index" :label="item.name"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发出日期" prop="send_date">
<el-date-picker class="flex-1 !flex" v-model="formData.send_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择发生日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄编号" prop="mailing_number">
<el-input v-model="formData.mailing_number" clearable placeholder="请输入邮寄编号" type='number' />
</el-form-item>
</el-col>
<createUserLable :form-data='formData' name='录入' flag></createUserLable>
</el-row>
</el-form>
<div v-if="showDialog">
<personnelselector ref="personnel" @confirm="submituser" type="1">
</personnelselector>
</div>
<el-dialog v-model="showDialog1" title="选择甲方签订单位" width="70%">
<dialogTable :config="marketing_custom" @customEvent="customEvent">
</dialogTable>
</el-dialog>
</popup>
</div>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="协议名称" prop="contract_name">
<el-input v-model="formData.contract_name" clearable placeholder="请输入协议名称"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="协议性质" prop="agreement_nature">
<el-select class=' flex-1' v-model="formData.agreement_nature">
<el-option v-for="(item, index) in dictData.agreement_nature " :key="index"
:label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方签订单位" prop="part_a">
<el-input v-model="formData.part_a_name" clearable placeholder="点击选择甲方签约单位"
@click="showDialog1 = true, isPartb = false" readonly/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系人" prop="part_a_contact">
<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">
<el-form-item label="业主地址" prop="part_a_address">
<el-input v-model="formData.part_a_address" clearable placeholder="请输入业主地址"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="乙方签约单位" prop="part_b">
<el-input v-model="formData.part_b" @click="showDialog1 = true, isPartb = true" clearable
placeholder="点击选择乙方签约单位"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="乙方签约人" prop="part_b_signatory">
<el-input v-model="formData.part_b_signatory_name" clearable placeholder="请输入乙方签约人"
@click="custom_contacts_click('part_b_signatory')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="业务性质" prop="business_nature">
<el-select class=' flex-1' v-model="formData.business_nature">
<el-option v-for="(item, index) in dictData.cost_consultation_business_nature "
:key="index" :label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="暂估签订金额" prop="signed_amount">
<el-input v-model="formData.signed_amount" clearable placeholder="请输入暂估签订金额" type="number"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订费率(%)" prop="signed_rate">
<el-input v-model="formData.signed_rate" clearable placeholder="请输入签订费率" type="number"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="协议有效期" prop="service_duration">
<el-input v-model="formData.service_duration" clearable placeholder="请输入协议有效期"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="取消规则" prop="payment_method">
<el-input v-model="formData.payment_method" clearable placeholder="请输入取消规则"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="协议主要内容" prop="content">
<el-input v-model="formData.content" clearable placeholder="请输入协议主要内容" type="textarea"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件" prop="">
<upload-annex :form-data="formData"></upload-annex>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订部门" prop="signed_dept">
<el-select v-model="formData.signed_dept" placeholder="请选择部门" class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签订负责人" prop="signed_head">
<el-input v-model="formData.signed_head_name" readonly clearable placeholder="点击选择签订负责人"
@click="userclick('signed_head')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盖章名称" prop="seal_name">
<el-select class=' flex-1' v-model="formData.seal_name">
<el-option v-for="(item, index) in dictData.cost_consultation_seal_name " :key="index"
:label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否限制次数" prop="is_limit">
<el-select class=' flex-1' v-model="formData.is_limit">
<el-option label="是" :value="parseInt(1)"></el-option>
<el-option label="否" :value="parseInt(0)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" v-if='formData.is_limit'>
<el-form-item label="限制次数" prop="limit_num">
<el-input v-model="formData.limit_num" clearable placeholder="请输入限制次数" type='number'/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="文件类型" prop="file_type">
<el-select class=' flex-1' v-model="formData.file_type">
<el-option v-for="(item, index) in dictData.cost_consultation_file_type " :key="index"
:label="item.name" :value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盖章份数" prop="seal_num">
<el-input v-model="formData.seal_num" clearable placeholder="请输入盖章份数" type='number'/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="盖章人" prop="seal_user_name">
<el-input v-model="formData.seal_user_name" clearable placeholder="点击选择盖章人" readonly
@click="userclick('seal_user')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="骑缝盖章" prop="plance_seal">
<el-select class=' flex-1' v-model="formData.plance_seal">
<el-option v-for="(item, index) in dictData.isqfgz " :key="index" :label="item.name"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发出日期" prop="send_date">
<el-date-picker class="flex-1 !flex" v-model="formData.send_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="选择发生日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮寄编号" prop="mailing_number">
<el-input v-model="formData.mailing_number" clearable placeholder="请输入邮寄编号" type='number'/>
</el-form-item>
</el-col>
<createUserLable :form-data='formData' name='录入' flag></createUserLable>
</el-row>
</el-form>
<div v-if="showDialog">
<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>
</el-dialog>
</popup>
</div>
</template>
<script lang="ts" setup name="marketingContractEdit">
import type { FormInstance } from 'element-plus'
import type {FormInstance} from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apimketingFrameworkAgreementAdd, apimketingFrameworkAgreementEdit } from '@/api/marketing_framework_agreement'
import { marketing_custom } from "@/components/dialogTable/dialogTableConfig";
import {apimketingFrameworkAgreementAdd, apimketingFrameworkAgreementEdit} from '@/api/marketing_framework_agreement'
import {marketing_custom} from "@/components/dialogTable/dialogTableConfig";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
},
deptList: Array
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
},
deptList: Array
})
const emit = defineEmits(['success', 'close'])
@ -193,130 +196,155 @@ 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('')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑市场经营--框架协议' : '新增市场经营--框架协议'
return mode.value == 'edit' ? '编辑市场经营--框架协议' : '新增市场经营--框架协议'
})
//
const formData = reactive({
id: "",
"contract_name": "",
"agreement_nature": '',
"part_a": '',
"part_a_name": '',
"part_a_contact": "",
"part_a_address": "",
"part_b": "",
"part_b_signatory": '',
"part_b_signatory_name": '',
"business_nature": '',
"signed_amount": '',
"signed_rate": '',
"service_duration": "",
"payment_method": "",
"content": "",
"annex": [],
"signed_dept": '',
"signed_head": '',
"signed_head_name": '',
"seal_name": '',
"is_limit": '',
"limit_num": '',
"file_type": '',
"seal_num": '',
"seal_user": '',
seal_user_name: "",
"plance_seal": '',
"send_date": "",
"mailing_number": "",
"create_user": "",
"create_time": ""
id: "",
"contract_name": "",
"agreement_nature": '',
"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": '',
"signed_amount": '',
"signed_rate": '',
"service_duration": "",
"payment_method": "",
"content": "",
"annex": [],
"signed_dept": '',
"signed_head": '',
"signed_head_name": '',
"seal_name": '',
"is_limit": '',
"limit_num": '',
"file_type": '',
"seal_num": '',
"seal_user": '',
seal_user_name: "",
"plance_seal": '',
"send_date": "",
"mailing_number": "",
"create_user": "",
"create_time": ""
})
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
} else {
formData.part_a = e.id
formData.part_a_name = e.name
formData.part_a_contact = e.invoice_contact_name
formData.part_a_address = e.invoice_company_address
}
showDialog1.value = false
if (isPartb.value) {
formData.part_b = e.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
// 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;
const userclick = async (val) => {
showDialog.value = true
value = val
await nextTick()
personnel.value.open()
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
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>({})
//
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]
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apimketingFrameworkAgreementEdit(data)
: await apimketingFrameworkAgreementAdd(data)
popupRef.value?.close()
emit('success')
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)
: await apimketingFrameworkAgreementAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
emit('close')
}
defineExpose({
open,
setFormData,
open,
setFormData,
})
</script>