|
|
@@ -30,7 +30,7 @@
|
|
|
</el-select>
|
|
|
<selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
|
|
|
<el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
- <el-input type="age" v-else-if="item.prop === 'debitAmount'" v-model="form[item.prop]" @change="debitChange" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
|
|
|
+ <el-input type="age" v-else-if="item.type === 'unit'" v-model="form[item.prop]" @change="debitChange" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
<el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" size="small" value="0" autocomplete="off" placeholder="请输入">
|
|
|
@@ -92,6 +92,39 @@
|
|
|
<span style="margin-left: 12px;padding-top: 2px">{{ row.userName }}</span>
|
|
|
<el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="selectUser(row)">选择</el-button>
|
|
|
</template>
|
|
|
+ <template slot="amount" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.amount"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="totalChange(row,'金额')"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.amount }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="serviceCharge" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.serviceCharge"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="totalChange(row,'服务')"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.serviceCharge }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="matMoney" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.matMoney"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="totalChange(row,'代垫')"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.matMoney }}</span>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<containerTitle title="附件上传"></containerTitle>
|
|
|
@@ -230,6 +263,7 @@
|
|
|
import examineApprove from "@/components/examineApprove/index";
|
|
|
//对象数组比较
|
|
|
import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
+ import _ from "lodash";
|
|
|
|
|
|
|
|
|
export default {
|
|
|
@@ -301,6 +335,7 @@
|
|
|
},{
|
|
|
label: '合同金额',
|
|
|
prop: 'debitAmount',
|
|
|
+ type:'unit',
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -317,6 +352,7 @@
|
|
|
{
|
|
|
label: '首付金额',
|
|
|
prop: 'advanceAmount',
|
|
|
+ type:'unit',
|
|
|
rules: [
|
|
|
{
|
|
|
pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
@@ -329,6 +365,7 @@
|
|
|
label: '已收金额',
|
|
|
prop: 'settlmentAmount',
|
|
|
disabled: true,
|
|
|
+ type:'unit',
|
|
|
rules: [
|
|
|
{
|
|
|
pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
@@ -339,6 +376,7 @@
|
|
|
},
|
|
|
{
|
|
|
label: '未收金额',
|
|
|
+ type:'unit',
|
|
|
prop: 'balanceAmount',
|
|
|
disabled: true,
|
|
|
rules: [
|
|
|
@@ -350,6 +388,32 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
+ label: '总服务费',
|
|
|
+ prop: 'serviceCharge',
|
|
|
+ type:'unit',
|
|
|
+ disabled: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '总代垫费',
|
|
|
+ prop: 'matMoney',
|
|
|
+ type:'unit',
|
|
|
+ disabled: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '责任人',
|
|
|
prop: 'corpAttn',
|
|
|
}, {
|
|
|
@@ -533,15 +597,51 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ //合计
|
|
|
+ totalChange(row,type){
|
|
|
+ let amountList = this.data.map(item => {
|
|
|
+ if(item.amount){
|
|
|
+ return parseFloat(item.amount);
|
|
|
+ }else return 0
|
|
|
+ });
|
|
|
+ let serviceChargeList = this.data.map(item => {
|
|
|
+ if(item.serviceCharge){
|
|
|
+ return parseFloat(item.serviceCharge);
|
|
|
+ }else return 0
|
|
|
+ });
|
|
|
+ let matMoneyList = this.data.map(item => {
|
|
|
+ if(item.matMoney){
|
|
|
+ return parseFloat(item.matMoney);
|
|
|
+ }else return 0
|
|
|
+ });
|
|
|
+ if(type==='金额'){
|
|
|
+ if(this.form.debitAmount){
|
|
|
+ if(this.form.debitAmount < amountList.reduce((n,m) => n + m)){
|
|
|
+ this.$message.error("明细列表合同金额不能大于总金额!")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(type==='服务'){
|
|
|
+ this.form.serviceCharge = serviceChargeList.reduce((n,m) => n + m)
|
|
|
+ }
|
|
|
+ if(type==='代垫'){
|
|
|
+ this.form.matMoney = matMoneyList.reduce((n,m) => n + m)
|
|
|
+ }
|
|
|
+ if(row.serviceCharge && row.matMoney){
|
|
|
+ if(row.amount < _.add(parseFloat(row.serviceCharge),parseFloat(row.matMoney))){
|
|
|
+ this.$message.error("服务费代垫费不能超过合同金额!")
|
|
|
+ row.serviceCharge = 0;
|
|
|
+ row.matMoney = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//查询明细
|
|
|
getProjectDetail(pleaseCheck){
|
|
|
if(this.id){
|
|
|
projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
|
|
|
this.form = res.data.data;
|
|
|
this.oldForm = Object.assign({},res.data.data);
|
|
|
- if(res.data.data.corpName){
|
|
|
- this.configuration.dicData = res.data.data.corpName; //给客户名称赋值
|
|
|
- }
|
|
|
+ this.configuration.dicData = res.data.data.corpName; //给客户名称赋值
|
|
|
if(res.data.data.filesList){
|
|
|
this.upLoadData = res.data.data.filesList
|
|
|
this.oldUpLoadData = this.deepClone(res.data.data.filesList)
|
|
|
@@ -600,6 +700,25 @@
|
|
|
this.$set(this.form,"balanceAmount",val)
|
|
|
}
|
|
|
}
|
|
|
+ // if(this.form.debitAmount){
|
|
|
+ // if(this.form.serviceCharge && parseFloat(this.form.serviceCharge) > parseFloat(this.form.debitAmount)){
|
|
|
+ // this.$message.warning('服务费不得大于合同金额!')
|
|
|
+ // this.$set(this.form,"serviceCharge","");
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(this.form.matMoney && parseFloat(this.form.matMoney) > parseFloat(this.form.debitAmount)){
|
|
|
+ // this.$message.warning('代垫费费不得大于合同金额!')
|
|
|
+ // this.$set(this.form,"matMoney","");
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(this.form.serviceCharge && this.form.matMoney){
|
|
|
+ // if(_.add(parseFloat(this.form.serviceCharge),parseFloat(this.form.matMoney))> parseFloat(this.form.debitAmount)){
|
|
|
+ // this.$message.warning('服务费代垫费总和不得大于合同金额!')
|
|
|
+ // this.$set(this.form,"serviceCharge","");
|
|
|
+ // this.$set(this.form,"matMoney","");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
//新单
|
|
|
addMainProject(){
|