|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div>
|
|
|
|
<div class="tab-header webtop">
|
|
|
|
<div>{{ viewTitle }}</div>
|
|
|
|
<div>
|
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveEdit()">保存</el-button>
|
|
|
|
<el-button type="primary" size="small" @click="submitVehicleApply()">提交</el-button>
|
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="listconadd">
|
|
|
|
<div class="titwu"><span>车辆入账申请单</span></div>
|
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd">
|
|
|
|
<el-row class="rowStyle">
|
|
|
|
<el-col :span="20" class="colOneStyle"></el-col>
|
|
|
|
<el-col :span="4" class="tleftb colOneStyle">
|
|
|
|
<span style="font-size: 16px">金额单位:元</span>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row style="border-top: 1px solid #E0E3EB">
|
|
|
|
<el-col :span="3" class="tleftb"><span>分公司</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item>{{ formobj.useOrgName }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>申请日期</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item>{{ formobj.applicationDate }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>申请人</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item>{{ formobj.applicationName }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>采购订单编号</span></el-col>
|
|
|
|
<el-col :span="9">
|
|
|
|
<el-form-item>{{ formobj.purchaseOrderNo }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>内部编码</span></el-col>
|
|
|
|
<el-col :span="9">
|
|
|
|
<el-form-item>{{ formobj.insideCode }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>车型</span></el-col>
|
|
|
|
<el-col :span="21">
|
|
|
|
<el-form-item>{{ formobj.modelName }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>常用配置</span></el-col>
|
|
|
|
<el-col :span="21" class="tlineheightb">
|
|
|
|
<el-form-item>{{ formobj.configName }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>厂家合同价</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item>{{ formobj.contractPrice }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>其中上装价格</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item><el-input v-model="formobj.amongSzPrice" @keyup.native="formobj.amongSzPrice = oninput(formobj.amongSzPrice,2)" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>上装价格计算依据</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item><el-input v-model="formobj.szPriceCalBasis" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="8" class="tcenterb"><span>其中含运费</span></el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>一次运费</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item><el-input @input="inputOnceFreight" v-model="formobj.onceFreight" placeholder="" clearable @keyup.native="formobj.onceFreight = oninput(formobj.onceFreight,2)" class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>二次运费</span></el-col>
|
|
|
|
<el-col :span="5">
|
|
|
|
<el-form-item><el-input @input="inputSecondaryFreight" v-model="formobj.secondaryFreight" placeholder="" clearable @keyup.native="formobj.secondaryFreight = oninput(formobj.secondaryFreight,2)" class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<div class="title">
|
|
|
|
<div>政策详情(含签单折让、开票下浮等)</div>
|
|
|
|
<el-checkbox @change="changeFreight" v-model="freightChecked"><span style="color: #FFFFFF">扣减运费</span></el-checkbox>
|
|
|
|
</div>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>政策1</span></el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item><el-input v-model="formobj.policyOne" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>可享受金额</span></el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item><el-input @input="inputEligibleAmountOne" @keyup.native="formobj.eligibleAmountOne = oninput(formobj.eligibleAmountOne,2)" v-model="formobj.eligibleAmountOne" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12" class="tcenterb"><span>计算政策2时:<el-checkbox @change="changePolicyOne" style="padding-left: 5px" v-model="policyOneChecked">扣减政策1</el-checkbox></span><span style="padding-left: 15px">计算政策3时:<el-checkbox @change="changePolicyTwo" style="padding-left: 5px" v-model="policyTwoChecked">扣减政策1</el-checkbox><el-checkbox @change="changePolicyThree" v-model="policyThreeChecked">扣减政策2</el-checkbox></span></el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>政策2</span></el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item><el-input v-model="formobj.policyTwo" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>可享受比例(%)</span></el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item><el-input @input="inputEligibleProportionTwo" v-model="formobj.eligibleProportionTwo" @keyup.native="formobj.eligibleProportionTwo = UpNumberRatio(formobj.eligibleProportionTwo,2)" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>对应金额</span></el-col>
|
|
|
|
<el-col :span="9">
|
|
|
|
<el-form-item>{{ formobj.corrMoneyTwo }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>政策3</span></el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item><el-input v-model="formobj.policyThree" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>可享受比例(%)</span></el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item><el-input @input="inputEligibleProportionThree" v-model="formobj.eligibleProportionThree" @keyup.native="formobj.eligibleProportionThree = UpNumberRatio(formobj.eligibleProportionThree,2)" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>对应金额</span></el-col>
|
|
|
|
<el-col :span="9">
|
|
|
|
<el-form-item>{{ formobj.corrMoneyThree }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>金额合计</span></el-col>
|
|
|
|
<el-col :span="3">
|
|
|
|
<el-form-item><el-input v-model="formobj.moneyCount" @keyup.native="formobj.moneyCount = UpNumberRatio(formobj.moneyCount,2)" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>政策备注</span></el-col>
|
|
|
|
<el-col :span="15">
|
|
|
|
<el-form-item><el-input v-model="formobj.policyRemarks" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>厂家政策截图</span></el-col>
|
|
|
|
<el-col :span="21">
|
|
|
|
<upload_picture ref="imgUpload" v-model="imgList" bucket="map" :upload-data="{type:'0001'}"/>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>厂家结算价</span></el-col>
|
|
|
|
<el-col :span="21">
|
|
|
|
<el-form-item>{{ inputMoneyCount() }}</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<div class="title">
|
|
|
|
<div>车辆列表</div>
|
|
|
|
</div>
|
|
|
|
<el-table :key="tableKey" :data="formobj.vehicleList" :index="index" border style="width: 100%">
|
|
|
|
<el-table-column fixed width="60px" label="序号" type="index" :index="index + 1" align="center" />
|
|
|
|
<el-table-column label="车架号" align="left" header-align="center">
|
|
|
|
<template slot-scope="scope" prop="vehicleName">
|
|
|
|
<el-input v-model="scope.row.vinNo" placeholder="" class="addinputw" clearable />
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="备注" header-align="center">
|
|
|
|
<template slot-scope="scope" prop="remarks">
|
|
|
|
<el-input v-model="scope.row.remarks" placeholder="" class="addinputw" clearable />
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>厂家入库日期</span></el-col>
|
|
|
|
<el-col :span="9">
|
|
|
|
<el-form-item><el-date-picker value-format="yyyy-MM-dd" v-model="formobj.priceDate" clearable type="date" placeholder="开始日期"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="3" class="tleftb"><span>厂家发车日期</span></el-col>
|
|
|
|
<el-col :span="9">
|
|
|
|
<el-form-item><el-date-picker value-format="yyyy-MM-dd" v-model="formobj.departureDate" clearable type="date" placeholder="开始日期"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="3" class="tleftb"><span>备注</span></el-col>
|
|
|
|
<el-col :span="21">
|
|
|
|
<el-form-item><el-input v-model="formobj.remarks" placeholder="" clearable class="addinputw"/></el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import req from '@/api/ruzhang/scmapplyinbound'
|
|
|
|
import upload_picture from '@/components/uploadFile/upload_picture'
|
|
|
|
import { getPathSidByUserSid, fetchBySid } from '@/api/cheliang/dictcommons'
|
|
|
|
export default {
|
|
|
|
name: 'RuzhangAdd',
|
|
|
|
components: {
|
|
|
|
upload_picture
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
viewTitle: '',
|
|
|
|
index: 0,
|
|
|
|
tableKey: 0,
|
|
|
|
freightChecked: false, // 扣减运费
|
|
|
|
policyOneChecked: false, // 计算政策2: 扣减政策1
|
|
|
|
policyTwoChecked: false, // 计算政策3: 扣减政策1
|
|
|
|
policyThreeChecked: false, // 计算政策3: 扣减政策2
|
|
|
|
imgList: [],
|
|
|
|
// 表单数据
|
|
|
|
formobj: {
|
|
|
|
amongSzPrice: '',
|
|
|
|
applicationCode: '',
|
|
|
|
applicationDate: '',
|
|
|
|
applicationName: '',
|
|
|
|
applicationSid: '',
|
|
|
|
configName: '',
|
|
|
|
configSid: '',
|
|
|
|
contractPrice: '',
|
|
|
|
corrMoneyThree: '',
|
|
|
|
corrMoneyTwo: '',
|
|
|
|
costPrice: '',
|
|
|
|
departureDate: '',
|
|
|
|
eligibleAmountOne: '',
|
|
|
|
eligibleProportionThree: '',
|
|
|
|
eligibleProportionTwo: '',
|
|
|
|
insideCode: '',
|
|
|
|
modelName: '',
|
|
|
|
modelSid: '',
|
|
|
|
moneyCount: '',
|
|
|
|
nodeState: '',
|
|
|
|
num: '',
|
|
|
|
onceFreight: '',
|
|
|
|
policyOne: '',
|
|
|
|
policyRemarks: '',
|
|
|
|
policyThree: '',
|
|
|
|
policyTwo: '',
|
|
|
|
priceDate: '',
|
|
|
|
purchaseOrderNo: '',
|
|
|
|
remarks: '',
|
|
|
|
secondaryFreight: '',
|
|
|
|
userSid: '',
|
|
|
|
useOrgName: '',
|
|
|
|
useOrgSid: '',
|
|
|
|
deductionFreight: '',
|
|
|
|
deductionPolicyThreeOne: '',
|
|
|
|
deductionPolicyThreeTwo: '',
|
|
|
|
deductionPolicyTwoOne: '',
|
|
|
|
scmFiles: [],
|
|
|
|
vehicleList: [],
|
|
|
|
vehicleOrderSid: ''
|
|
|
|
},
|
|
|
|
rules: {},
|
|
|
|
submitdisabled: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
init() {
|
|
|
|
getPathSidByUserSid({ userSid: window.sessionStorage.getItem('userSid') }).then((resp) => {
|
|
|
|
if (resp.success) {
|
|
|
|
this.formobj.useOrgSid = resp.data
|
|
|
|
fetchBySid(this.formobj.useOrgSid).then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
this.formobj.useOrgName = res.data.name
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 输入数字正则
|
|
|
|
oninput(val, limit = 0) {
|
|
|
|
val = val.replace(/[^\d]/g, '') // 保留数字
|
|
|
|
val = val.replace(/^00/, '0'); // 开头不能有两个0
|
|
|
|
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0
|
|
|
|
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
|
|
|
|
const reg = new RegExp(str)
|
|
|
|
if (limit === 0) {
|
|
|
|
// 不需要小数点
|
|
|
|
val = val.replace(reg, '$1')
|
|
|
|
} else {
|
|
|
|
// 通过正则保留小数点后指定的位数
|
|
|
|
val = val.replace(reg, '$1.$2')
|
|
|
|
}
|
|
|
|
return val
|
|
|
|
},
|
|
|
|
UpNumberRatio(val, limit = 2) {
|
|
|
|
val = val.replace(/[^\d.]/g, '') // 保留数字
|
|
|
|
val = val.replace(/^00/, '0.') // 开头不能有两个0
|
|
|
|
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0.
|
|
|
|
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个
|
|
|
|
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点
|
|
|
|
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0
|
|
|
|
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
|
|
|
|
const reg = new RegExp(str)
|
|
|
|
if (limit === 0) {
|
|
|
|
// 不需要小数点
|
|
|
|
val = val.replace(reg, '$1')
|
|
|
|
} else {
|
|
|
|
// 通过正则保留小数点后指定的位数
|
|
|
|
val = val.replace(reg, '$1.$2')
|
|
|
|
}
|
|
|
|
return val
|
|
|
|
},
|
|
|
|
inputOnceFreight() {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
},
|
|
|
|
inputSecondaryFreight() {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
},
|
|
|
|
changeFreight() {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
},
|
|
|
|
changePolicyOne() {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
},
|
|
|
|
changePolicyTwo() {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
},
|
|
|
|
changePolicyThree() {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
},
|
|
|
|
inputEligibleAmountOne() {
|
|
|
|
if (this.formobj.eligibleAmountOne !== '') {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
} else {
|
|
|
|
this.inputEligibleProportionTwo()
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
inputEligibleProportionTwo() {
|
|
|
|
if (this.formobj.eligibleProportionTwo !== '') {
|
|
|
|
if (this.policyOneChecked) {
|
|
|
|
if (this.freightChecked) {
|
|
|
|
if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
} else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
} else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (this.freightChecked) {
|
|
|
|
if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
} else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
} else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication(parseFloat(this.formobj.contractPrice), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyTwo = this.multiplication(parseFloat(this.formobj.contractPrice), (parseFloat(this.formobj.eligibleProportionTwo) / 100))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyTwo = 0
|
|
|
|
}
|
|
|
|
if (this.formobj.eligibleAmountOne === '') {
|
|
|
|
this.formobj.moneyCount = parseFloat(0) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree)
|
|
|
|
} else {
|
|
|
|
this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountOne) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree)
|
|
|
|
}
|
|
|
|
if (this.formobj.eligibleProportionThree !== '') {
|
|
|
|
this.inputEligibleProportionThree()
|
|
|
|
}
|
|
|
|
return this.formobj.corrMoneyTwo
|
|
|
|
},
|
|
|
|
inputEligibleProportionThree() {
|
|
|
|
if (this.formobj.eligibleProportionThree !== '') {
|
|
|
|
if (this.policyTwoChecked && this.policyThreeChecked) {
|
|
|
|
if (this.freightChecked) {
|
|
|
|
if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else if (this.policyTwoChecked && !this.policyThreeChecked) {
|
|
|
|
if (this.freightChecked) {
|
|
|
|
if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.eligibleAmountOne)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else if (!this.policyTwoChecked && this.policyThreeChecked) {
|
|
|
|
if (this.freightChecked) {
|
|
|
|
if (this.policyOneChecked) {
|
|
|
|
if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.corrMoneyTwo)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (this.freightChecked) {
|
|
|
|
if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight !== '' && this.formobj.secondaryFreight === '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.onceFreight)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else if (this.formobj.onceFreight === '' && this.formobj.secondaryFreight !== '') {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.secondaryFreight)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = this.multiplication((parseFloat(this.formobj.contractPrice)), (parseFloat(this.formobj.eligibleProportionThree) / 100))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
this.formobj.corrMoneyThree = 0
|
|
|
|
}
|
|
|
|
if (this.formobj.eligibleAmountOne === '') {
|
|
|
|
this.formobj.moneyCount = parseFloat(0) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree)
|
|
|
|
} else {
|
|
|
|
this.formobj.moneyCount = parseFloat(this.formobj.eligibleAmountOne) + parseFloat(this.formobj.corrMoneyTwo) + parseFloat(this.formobj.corrMoneyThree)
|
|
|
|
}
|
|
|
|
return this.formobj.corrMoneyThree
|
|
|
|
},
|
|
|
|
inputMoneyCount() {
|
|
|
|
if (this.formobj.moneyCount === '') {
|
|
|
|
this.formobj.moneyCount = 0
|
|
|
|
}
|
|
|
|
this.formobj.costPrice = parseFloat(this.formobj.contractPrice) - parseFloat(this.formobj.moneyCount)
|
|
|
|
return this.formobj.costPrice
|
|
|
|
},
|
|
|
|
multiplication(arg1, arg2) {
|
|
|
|
var m = 0
|
|
|
|
var s1 = arg1.toString()
|
|
|
|
var s2 = arg2.toString()
|
|
|
|
try {
|
|
|
|
m += s1.split('.')[1].length
|
|
|
|
} catch (e) {}
|
|
|
|
try {
|
|
|
|
m += s2.split('.')[1].length
|
|
|
|
} catch (e) {}
|
|
|
|
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m)
|
|
|
|
},
|
|
|
|
showEdit(sid, row) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs['form_obj'].clearValidate()
|
|
|
|
})
|
|
|
|
this.viewTitle = '【编辑】入账单'
|
|
|
|
console.log('编辑回显', sid, row)
|
|
|
|
req.fetchBySid(sid).then(resp => {
|
|
|
|
const data = resp.data
|
|
|
|
this.formobj = data
|
|
|
|
this.formobj.userSid = window.sessionStorage.getItem('userSid')
|
|
|
|
if (this.formobj.scmFiles.length > 0) {
|
|
|
|
this.formobj.scmFiles.forEach((e) => {
|
|
|
|
this.imgList.push({
|
|
|
|
name: e.fileName,
|
|
|
|
filePath: e.filePath,
|
|
|
|
size: e.fileSize,
|
|
|
|
url: e.filePath
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if (this.formobj.deductionFreight === '0') {
|
|
|
|
this.freightChecked = true
|
|
|
|
} else {
|
|
|
|
this.freightChecked = false
|
|
|
|
}
|
|
|
|
if (this.formobj.deductionPolicyTwoOne === '0') {
|
|
|
|
this.policyOneChecked = true
|
|
|
|
} else {
|
|
|
|
this.policyOneChecked = false
|
|
|
|
}
|
|
|
|
if (this.formobj.deductionPolicyTwoOne === '0') {
|
|
|
|
this.policyTwoChecked = true
|
|
|
|
} else {
|
|
|
|
this.policyTwoChecked = false
|
|
|
|
}
|
|
|
|
if (this.formobj.deductionPolicyThreeTwo === '0') {
|
|
|
|
this.policyThreeChecked = true
|
|
|
|
} else {
|
|
|
|
this.policyThreeChecked = false
|
|
|
|
}
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.init()
|
|
|
|
})
|
|
|
|
}).catch(e => {
|
|
|
|
this.formobj = row
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getUrl() {
|
|
|
|
if (this.imgList.length > 0) {
|
|
|
|
const aa = []
|
|
|
|
for (var i = 0; i < this.imgList.length; i++) {
|
|
|
|
aa.push({
|
|
|
|
attachType: '',
|
|
|
|
fileName: this.imgList[i].name,
|
|
|
|
filePath: this.imgList[i].filePath,
|
|
|
|
fileSize: this.imgList[i].size,
|
|
|
|
fileType: this.imgList[i].name.substr(this.imgList[i].name.lastIndexOf('.')),
|
|
|
|
linkSid: '',
|
|
|
|
name: window.sessionStorage.getItem('name'),
|
|
|
|
sid: ''
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.formobj.scmFiles = aa
|
|
|
|
}
|
|
|
|
},
|
|
|
|
saveEdit() {
|
|
|
|
this.getUrl()
|
|
|
|
if (this.formobj.departureDate === '') {
|
|
|
|
alert('厂家发车日期不能为空!')
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (this.freightChecked) {
|
|
|
|
this.formobj.deductionFreight = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionFreight = 1
|
|
|
|
}
|
|
|
|
if (this.policyOneChecked) {
|
|
|
|
this.formobj.deductionPolicyTwoOne = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionPolicyTwoOne = 1
|
|
|
|
}
|
|
|
|
if (this.policyTwoChecked) {
|
|
|
|
this.formobj.deductionPolicyThreeOne = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionPolicyThreeOne = 1
|
|
|
|
}
|
|
|
|
if (this.policyThreeChecked) {
|
|
|
|
this.formobj.deductionPolicyThreeTwo = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionPolicyThreeTwo = 1
|
|
|
|
}
|
|
|
|
this.$refs['form_obj'].validate(valid => {
|
|
|
|
if (valid) {
|
|
|
|
this.submitdisabled = true
|
|
|
|
req.saveOrUpdate(this.formobj).then(resp => {
|
|
|
|
this.submitdisabled = false
|
|
|
|
/* this.$message({
|
|
|
|
showClose: true,
|
|
|
|
type: 'success',
|
|
|
|
message: resp.msg
|
|
|
|
})*/
|
|
|
|
if (resp.success) {
|
|
|
|
this.handleReturn('true')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
this.submitdisabled = false
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
submitVehicleApply() {
|
|
|
|
this.getUrl()
|
|
|
|
if (this.formobj.departureDate === '') {
|
|
|
|
alert('厂家发车日期不能为空!')
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (this.freightChecked) {
|
|
|
|
this.formobj.deductionFreight = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionFreight = 1
|
|
|
|
}
|
|
|
|
if (this.policyOneChecked) {
|
|
|
|
this.formobj.deductionPolicyTwoOne = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionPolicyTwoOne = 1
|
|
|
|
}
|
|
|
|
if (this.policyTwoChecked) {
|
|
|
|
this.formobj.deductionPolicyThreeOne = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionPolicyThreeOne = 1
|
|
|
|
}
|
|
|
|
if (this.policyThreeChecked) {
|
|
|
|
this.formobj.deductionPolicyThreeTwo = 0
|
|
|
|
} else {
|
|
|
|
this.formobj.deductionPolicyThreeTwo = 1
|
|
|
|
}
|
|
|
|
req.submitVehicleApply(this.formobj).then(res => {
|
|
|
|
if (res.success) {
|
|
|
|
this.$message({
|
|
|
|
showClose: true,
|
|
|
|
type: 'success',
|
|
|
|
message: '提交成功'
|
|
|
|
})
|
|
|
|
this.handleReturn('true')
|
|
|
|
} else {
|
|
|
|
this.$message({
|
|
|
|
showClose: true,
|
|
|
|
type: 'error',
|
|
|
|
message: '提交失败'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 返回(===既判断又赋值)
|
|
|
|
handleReturn(isreload) {
|
|
|
|
if (isreload === 'true') this.$emit('reloadlist')
|
|
|
|
this.$refs['form_obj'].resetFields()
|
|
|
|
this.imgList = []
|
|
|
|
this.$emit('doback')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.title {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.tcenterb {
|
|
|
|
text-align: center;
|
|
|
|
font-size: 14px;
|
|
|
|
color: #606266;
|
|
|
|
line-height: 40px !important;
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
.rowStyle {
|
|
|
|
border-left: 0px;
|
|
|
|
}
|
|
|
|
.colOneStyle {
|
|
|
|
border-right: 0px !important;
|
|
|
|
border-bottom: 0px !important;
|
|
|
|
}
|
|
|
|
.tlineheightb {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
/deep/ .tlineheightb .el-form-item__content {
|
|
|
|
line-height: 15px !important;
|
|
|
|
}
|
|
|
|
</style>
|