|
|
@@ -0,0 +1,299 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-button size="small" type="primary" @click="addBtn(drawerFormVisible = true)">新 建</el-button>
|
|
|
+ <el-drawer
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="drawerFormVisible"
|
|
|
+ size="700px"
|
|
|
+ direction="rtl"
|
|
|
+ append-to-body
|
|
|
+ :show-close="false"
|
|
|
+ @close="onClose">
|
|
|
+ <div class="drawer__panel">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-form :model="form" ref="form" :rules="rules" label-width="125px" label-position="right" size="mini">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="合同标题:" prop="title" :rules="{ required: true, message: '请填写合同标题', trigger: 'change' }">
|
|
|
+ <el-input v-model="form.title" placeholder="合同标题"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="居间商:" :rules="{ required: false, message: '请选择居间商', trigger: 'change' }">
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ trigger="manual"
|
|
|
+ v-model="agentVisible"
|
|
|
+ width="500">
|
|
|
+ <selectAgentNew ref="member" type="22" :param="agentListPrams" :radio="true" @onSelect="centerChange" @onCancel="agentVisible = false" ></selectAgentNew>
|
|
|
+ <el-input readonly type="text" slot="reference" size="small" @focus="showChange('agentVisible')" v-model="ascription.enterprisename" placeholder="请选择居间商" >
|
|
|
+ <template slot="append">
|
|
|
+ <el-button size="small" @click="agentVisible = false;ascription.enterprisename = '';agentListPrams.content.where.condition = '';$refs.member.selected = []" style="width:100%" type="primary">清空</el-button>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-popover>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="合同:" prop="ascription_contractid" :rules="{ required: true, message: '请输入合同', trigger: 'change' }">
|
|
|
+ <el-input v-model="ascription.ascription_title" placeholder="合同" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="项目名称:" prop="projectname">
|
|
|
+ <el-input v-model="ascription.projectname" placeholder="项目名称" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="项目编号:" prop="projectnum">
|
|
|
+ <el-input v-model="ascription.projectnum" placeholder="项目编号" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="客户名称:" prop="customername">
|
|
|
+ <el-input v-model="ascription.customername" placeholder="客户名称" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="业务员:" prop="saler_hrid" :rules="{ required: true, message: '请填写业务员', trigger: 'change' }">
|
|
|
+ <el-input v-model="ascription.salername" placeholder="业务员" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="签约日期:" prop="signdate" :rules="{ required: true, message: '请选择签约日期', trigger: 'change' }">
|
|
|
+ <el-input v-model="form.signdate" placeholder="签约日期" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="有效期:" prop="begdate" :rules="{ required: true, message: '请选择有效期', trigger: 'change' }">
|
|
|
+ <el-input v-model="ascription.expiration_date" placeholder="有效期" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="订单金额比例:" prop="orderratio" >
|
|
|
+ <el-input v-model="form.orderratio" placeholder="请填写比例,百分数%" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="合同描述:" prop="remarks">
|
|
|
+ <el-input v-model="form.remarks" placeholder="请填写描述" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="fixed__btn__panel">
|
|
|
+ <el-button size="small" @click="onClose" class="normal-btn-width inline-16">取 消</el-button>
|
|
|
+ <el-button size="small" type="primary" :loading="loading" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ <el-dialog :visible.sync="dialogTableVisible" append-to-body center width="780px">
|
|
|
+ <template slot="title">
|
|
|
+ <span style="float: left" >居间费调整确认</span>
|
|
|
+ </template>
|
|
|
+ <p style="color: red" class="mt-10">以下是居间费调整前后情况,若确认调整,系统自动将业务员提成重新计算并生成新的收入凭证</p>
|
|
|
+ <div class="mt-10">
|
|
|
+ <span>合计</span>
|
|
|
+ <span style="margin-left: 20px">调整前提成:<span style="color: red;margin-left: 10px">{{totalrewardamount == 0?'¥ '+tool.formatAmount(0,2):'¥ '+tool.formatAmount(totalrewardamount,2)}}</span></span>
|
|
|
+ <span style="margin-left: 20px">调整后提成:<span style="color: red;margin-left: 10px">{{totaladjustrewardamount == 0?'¥ '+tool.formatAmount(0,2):'¥ '+tool.formatAmount(totaladjustrewardamount,2)}}</span></span>
|
|
|
+ <span style="margin-left: 20px">差额:<span style="color: red;margin-left: 10px">{{totalsubamount == 0?'¥ '+tool.formatAmount(0,2):'¥ '+tool.formatAmount(totalsubamount,2)}}</span></span>
|
|
|
+ </div>
|
|
|
+ <table-detail :layout="adjustTable" :data="adjustList" :custom="true" :width="true" :height="tableHieght">
|
|
|
+ <template v-slot:customcol="scope" >
|
|
|
+ <div v-if="scope.column.columnname == 'rewardamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname == 'adjustrewardamount'" style="color: red">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname == 'subamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ {{ scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation' ? scope.column.data[[scope.column.columnname]] : '--' }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </table-detail>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogTableVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="dialogTableVisible = false">确定调整</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import selectAgentNew from '../selectAgentNew.vue'
|
|
|
+export default {
|
|
|
+ name: "addPriceDiff",
|
|
|
+ props:["data"],
|
|
|
+ components:{selectAgentNew},
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ title:'新建居间协议',
|
|
|
+ drawerFormVisible:false,
|
|
|
+ dialogTableVisible:false,
|
|
|
+ agentVisible:false,
|
|
|
+ loading:false,
|
|
|
+ tableHieght:'calc(100vh - 380px)',
|
|
|
+ form:{
|
|
|
+ "sa_contractid": 0,//合同id
|
|
|
+ "sys_enterpriseid": "",//居间商id
|
|
|
+ "begdate": "",//有效期开始时间
|
|
|
+ "enddate": "",//有效期截止时间
|
|
|
+ "sa_projectid": "",//项目id选择项目合同时传
|
|
|
+ "type": "居间",
|
|
|
+ "saler_hrid": "",//业务员id
|
|
|
+ "signdate": "",//签约时间
|
|
|
+ "remarks": "",//备注
|
|
|
+ "title": "",//标题
|
|
|
+ "calculatemodel": "",
|
|
|
+ "orderratio": "",//订单金额比例
|
|
|
+ "ascription_contractid": "",//归属合同ID,关联合同ID
|
|
|
+ "billno": "",
|
|
|
+ },
|
|
|
+ ascription:{
|
|
|
+ "enterprisename":"",
|
|
|
+ "ascription_title":"",
|
|
|
+ "projectname":"",
|
|
|
+ "projectnum":"",
|
|
|
+ "customername":"",
|
|
|
+ "salername":"",
|
|
|
+ "expiration_date":""
|
|
|
+ },
|
|
|
+ agentListPrams: {
|
|
|
+ "id": 20220920083901,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "type":5,
|
|
|
+ "typemx":"",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ orderratio: [
|
|
|
+ { pattern:/^[0-9]+\.{0,1}[0-9]{0,4}$/,message: '输入不合法,请输入数值',trigger: 'blur'},
|
|
|
+ { required: true, message: '请填写比例,百分数%', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ adjustParam:{
|
|
|
+ "id": 20240828165904,
|
|
|
+ "content": {
|
|
|
+ "sa_contractid": "0",
|
|
|
+ "orderratio": "",
|
|
|
+ "isadd": true, //新建时请求确认列表传true
|
|
|
+ "ascription_contractid": "",// 来源合同id
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ adjustList:[],
|
|
|
+ adjustTable:[],
|
|
|
+ adjustTotal:0,
|
|
|
+ adjustCurrentPage:0,
|
|
|
+ totalrewardamount:0,
|
|
|
+ totaladjustrewardamount:0,
|
|
|
+ totalsubamount:0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ addBtn(){
|
|
|
+ this.form.title = this.data.enterprisename + '/' + this.data.title + '_居间费'
|
|
|
+ this.form.ascription_contractid = this.data.sa_contractid
|
|
|
+ this.form.sa_projectid = this.data.sa_projectid
|
|
|
+ this.form.saler_hrid = this.data.saler_hrid
|
|
|
+ this.form.begdate = this.data.begdate
|
|
|
+ this.form.enddate = this.data.enddate
|
|
|
+ this.form.signdate = this.data.signdate
|
|
|
+ this.ascription = {
|
|
|
+ "ascription_title":this.data.title,
|
|
|
+ "projectname":this.data.projectname,
|
|
|
+ "projectnum":this.data.projectnum,
|
|
|
+ "customername":this.data.enterprisename,
|
|
|
+ "salername":this.data.salername,
|
|
|
+ "expiration_date":this.data.begdate + '至' + this.data.enddate
|
|
|
+ }
|
|
|
+ },
|
|
|
+ editBtn(data){
|
|
|
+ this.title = '编辑居间协议'
|
|
|
+ this.form.title = data.title
|
|
|
+ this.form.sa_contractid = data.sa_contractid
|
|
|
+ this.form.sys_enterpriseid = data.sys_enterpriseid == -1 ? '':data.sys_enterpriseid
|
|
|
+ this.form.orderratio = Math.round((data.orderratio * 100)*100)/100
|
|
|
+ this.form.ascription_contractid = this.data.sa_contractid
|
|
|
+ this.form.sa_projectid = this.data.sa_projectid
|
|
|
+ this.form.saler_hrid = this.data.saler_hrid
|
|
|
+ this.form.begdate = this.data.begdate
|
|
|
+ this.form.enddate = this.data.enddate
|
|
|
+ this.form.signdate = this.data.signdate
|
|
|
+ this.ascription = {
|
|
|
+ "ascription_title":this.data.title,
|
|
|
+ "enterprisename":data.sys_enterpriseid == -1 ? '':data.enterprisename,
|
|
|
+ "projectname":this.data.projectname,
|
|
|
+ "projectnum":this.data.projectnum,
|
|
|
+ "customername":this.data.enterprisename,
|
|
|
+ "salername":this.data.salername,
|
|
|
+ "expiration_date":this.data.begdate + '至' + this.data.enddate
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSubmit(){
|
|
|
+ this.$refs.form.validate(async (valid)=>{
|
|
|
+ this.loading = true
|
|
|
+ if (!valid) return false
|
|
|
+ this.form.orderratio = (this.form.orderratio / 100).toFixed(4)
|
|
|
+ let res = await this.$api.requested({
|
|
|
+ "id": 20221121185302,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ if (res.code == 0){
|
|
|
+ this.form.orderratio = this.form.orderratio * 100
|
|
|
+ this.loading = false
|
|
|
+ }else {
|
|
|
+ this.dialogTableVisible = true
|
|
|
+ this.onAdjust(res.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async onAdjust(data){
|
|
|
+ console.log(data,'data3333')
|
|
|
+ this.adjustParam.content.sa_contractid = data.sa_contractid
|
|
|
+ this.adjustParam.content.orderratio = data.orderratio
|
|
|
+ this.adjustParam.content.ascription_contractid = data.ascription_contractid
|
|
|
+ const res = await this.$api.requested(this.adjustParam)
|
|
|
+ this.adjustList = res.data
|
|
|
+ this.adjustTotal = res.total
|
|
|
+ this.adjustCurrentPage = res.pageNumber
|
|
|
+ this.totaladjustrewardamount = res.data[0].totaladjustrewardamount
|
|
|
+ this.totalrewardamount = res.data[0].totalrewardamount
|
|
|
+ this.totalsubamount = res.data[0].totalsubamount
|
|
|
+ },
|
|
|
+ showChange(){
|
|
|
+ this.agentVisible = true
|
|
|
+ this.$refs.member.listData(this.$refs.member.param.content.pageNumber = 1)
|
|
|
+ },
|
|
|
+ centerChange (data) {
|
|
|
+ this.ascription.enterprisename = data[0].enterprisename
|
|
|
+ this.form.sys_enterpriseid = data[0].sys_enterpriseid
|
|
|
+ this.agentVisible = false
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ this.drawerFormVisible = false
|
|
|
+ this.form.orderratio = ''
|
|
|
+ this.$refs.form.resetFields()
|
|
|
+ this.form.remarks = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.adjustTable = this.tool.tabelCol(this.$route.name).adjustTable.tablecols
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|