123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896 |
- <!--结算-->
- <template>
- <div class="center">
- <el-row>
- <el-col :span="12">
- <h2 class="bg-left titleup">{{information}}信息</h2>
- </el-col>
- <el-col :span="12" class="bg-right">
- <el-button
- class="bg-bottom"
- type="primary"
- size="small"
- @click="cancel"
- ><img
- width="6"
- height="10"
- style="vertical-align: bottom; margin-right: 3px"
- src="../../../public/img/lujing.png"
- alt=""
- />返回</el-button
- >
- </el-col>
- </el-row>
- <div class="substance">
- <ws-form>
- <div style="width: 50%; margin: 0 auto">
- <div class="titles">基本信息</div>
- <ws-info-table>
- <ws-form-item label="编号" span="1" prop="paymentNo">
- <ws-input
- v-model="paymentList.paymentNo"
- placeholder="请输入编号"
- maxlength="100"
- disabled
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="仓位号" span="1" prop="waterContent">
- <ws-input
- v-model="paymentList.qualityInspectionManagement.binNumber"
- placeholder="请输入仓位号"
- maxlength="100"
- disabled
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="客户" span="1" prop="waterContent">
- <ws-input
- v-model="paymentList.customerName"
- placeholder="请输入仓位号"
- maxlength="100"
- disabled
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="囤位号" span="1" prop="waterContent">
- <ws-input v-model="paymentList.qualityInspectionManagement.storageTagNo" placeholder="请输入囤位号" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="车牌号" span="1" prop="waterContent">
- <ws-input v-model="paymentList.carNo" placeholder="请输入车牌号" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="货名" span="1" prop="waterContent">
- <ws-input v-model="paymentList.goodsName" placeholder="请输入货名" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="类型" span="1" prop="waterContent">
- <ws-input v-model="paymentList.type" placeholder="请输入类型" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="购粮性质" span="1" prop="waterContent">
- <ws-input v-model="paymentList.qualityInspectionManagement.natureOfGrainPurchase" placeholder="请输入购粮性质" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="干粮"' label="干粮单价(元/公斤)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.qualityInspectionManagement.dryGrainPrice" placeholder="请输入干粮单价" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="干粮"' label="净重(公斤)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.netWeight" placeholder="请输入净重" maxlength="100" size="small" disabled />
- </ws-form-item>
- </ws-info-table>
- <div class="titles">质检数据</div>
- <ws-info-table>
- <ws-form-item label="等级" span="1" prop="waterContent">
- <ws-input v-model="paymentList.qualityInspectionManagement.grade" placeholder="请输入等级" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="杂质(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.impurity"
- placeholder="请输入杂质占比"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item label="水分(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.waterContent"
- placeholder="请输入水分占比"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item label="霉变粒(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.mildewGrain"
- placeholder="请输入霉变粒占比"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item label="容重(克/升)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.qualityInspectionManagement.bulkDensity" placeholder="请输入容重" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="热损伤(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.jiaorenli"
- placeholder="请输入热损伤占比"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item label="不完善粒(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.imperfectGrain"
- placeholder="请输入不完善粒占比"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- </ws-info-table>
- <div v-if='paymentList.type=="潮粮"' class="titles">单价核算</div>
- <ws-info-table v-if='paymentList.type=="潮粮"'>
- <ws-form-item label="潮粮水分(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.waterContent"
- placeholder="请输入潮粮水分"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item v-if="paymentList.type=='潮粮' && paymentList.qualityInspectionManagement.paramType != '1'" label="扣重比" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='buckleWeightRatiochange'
- v-model="paymentList.buckleWeightRatio"
- placeholder="请输入扣重比"
- maxlength="100"
- size="small"
- :disabled='disabled'
- />
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"' label="干粮水分(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.waterMin"
- placeholder="请输入干粮水分"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮" && paymentList.qualityInspectionManagement.paramType == "1"' label="扣重" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.qualityInspectionManagement.weightDeduction" placeholder="请输入扣重" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮" && paymentList.qualityInspectionManagement.paramType != 1' label="掉水(%)" span="1" prop="waterContent" >
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.qualityInspectionManagement.waterContent-paymentList.qualityInspectionManagement.waterMin" placeholder="请输入掉水" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮" && paymentList.qualityInspectionManagement.paramType != 1' label="基数" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.base" placeholder="请输入基数" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"' label="毛重(公斤)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.weighingManagement.grossWeight" placeholder="请输入毛重" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"' label="纯重(公斤)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.pureWeight" placeholder="请输入纯重" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"' label="皮重(公斤)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.weighingManagement.tare" placeholder="请输入皮重" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"'
- label="净重单价(元/公斤)"
- span="1"
- prop="waterContent"
- >
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.qualityInspectionManagement.tidalGrainPrice"
- placeholder="请输入净重单价"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"' label="扣杂" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.qualityInspectionManagement.buckleMiscellaneous" placeholder="请输入扣杂" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item label="扣单价(元/公斤)" span="1" prop="unitDeduction">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.unitDeduction" @input="grainMoney" placeholder="请输入扣单价" maxlength="100" size="small" :disabled="disabled"/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"'
- label="纯重单价(元/公斤)"
- span="1"
- prop="waterContent"
- >
- <!-- v-model="paymentList.solidGrainPrice" -->
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.solidGrainPrice"
- placeholder="请输入纯重单价"
- maxlength="100"
- size="small"
- disabled
- />
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="潮粮"' label="净重(公斤)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent v-model="paymentList.weighingManagement.netWeight" placeholder="请输入净重" maxlength="100" size="small" disabled/>
- </ws-form-item>
- </ws-info-table>
- <div class="titles">结算金额(元)</div>
- <ws-info-table>
- <ws-form-item v-if='paymentList.type=="潮粮"'
- label="粮款 = 净重 x (净重单价 - 扣单价) ="
- span="1"
- prop="waterContent"
- class="formItem"
- >
- <ws-input type="number" @mousewheel.native.prevent @input='grainMoney' v-model="paymentList.grainMoney" placeholder="请输入粮款" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item v-if='paymentList.type=="干粮"'
- label="粮款 = 净重 x (干粮单价 - 扣单价) ="
- span="1"
- prop="waterContent"
- class="formItem"
- >
- <ws-input type="number" @mousewheel.native.prevent @input='grainMoney' v-model="paymentList.grainMoney" placeholder="请输入粮款" maxlength="100" size="small" disabled/>
- </ws-form-item>
- <ws-form-item label="称重扣款" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.weighingDeduction"
- placeholder="请输入称重扣款"
- maxlength="100"
- size="small"
- :disabled="disabled"
- />
- </ws-form-item>
- <ws-form-item label="称重补助" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.weighingSubsidy"
- placeholder="请输入称重补助"
- maxlength="100"
- size="small"
- :disabled="disabled"
- />
- </ws-form-item>
-
- <ws-form-item label="运费扣款" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.freightDeduction"
- placeholder="请输入运费扣款"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="运费补助" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.freightSubsidy"
- placeholder="请输入运费补助"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="卸车扣款" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.unloadDeduction"
- placeholder="请输入卸车扣款"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="卸车补助" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.unloadSubsidy"
- placeholder="请输入卸车补助"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="质量扣款" span="1" prop="qualityDeduction">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.qualityDeduction"
- placeholder="请输入质量扣款"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="其他补助" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.otherSubsidy"
- placeholder="请输入其他补助"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
-
- <ws-form-item label="其他扣款" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @input='grainMoney'
- @focus="inputFocus($event)"
- v-model="paymentList.otherDeduction"
- placeholder="请输入其他扣款"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- <ws-form-item
- label="计算应付 = 粮款 + 补助- 扣款 ="
- span="1"
- prop="waterContent"
- class="formItem"
- >
- <ws-input type="number" @mousewheel.native.prevent
- v-model="paymentList.calculationPayable"
- placeholder="请输入计算应付"
- maxlength="100"
- disabled
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="实际付款" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent
- @change='actualPayment'
- v-model="paymentList.actualPayment"
- placeholder="请输入实际付款"
- maxlength="100"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="人民币大写" span="1" prop="waterContent">
- <ws-input
- v-model="paymentList.capitalize"
- placeholder="请输入人民币大写"
- maxlength="100"
- disabled
- size="small"
- />
- </ws-form-item>
- <ws-form-item label="记事(选填)" span="1" prop="waterContent">
- <ws-input
- v-model="paymentList.remarks"
- placeholder="备注信息,不超过20个字"
- maxlength="20"
- :disabled="disabled"
- size="small"
- />
- </ws-form-item>
- </ws-info-table>
- <div class="but">
- <el-button @click="cancel" v-if="this.types == 1" type="primary">取消</el-button>
- <el-button @click="print" v-if="this.types == 1" type="primary">保存并打印</el-button>
- <el-button @click="cancel" v-if="this.types == 2" type="primary">关闭</el-button>
- </div>
- </div>
- </ws-form>
- </div>
- <el-dialog
- width="70%"
- class="table-content"
- center
- :visible.sync="isShowPrint"
- :title="printData.compName+'结算凭证'"
- @close="closeDialog"
- :modal-append-to-body = "false"
- >
- <paymentPrint :printData="printData" ref="saveImg"></paymentPrint>
- <div style="text-align:center">
- <el-button type="primary" @click="closePrint">关闭</el-button>
- <!-- <el-button type="primary" @click="printSmall">打印小票</el-button> -->
- <el-button type="primary" @click="printBig">打印单据</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {getpaymentexamine,postpaymentedit,settlementEdit} from '@/model/houseSelfCollect/index'
- import paymentPrint from './component/paymentPrint.vue'
- import html2canvas from 'html2canvas'
- import axios from 'axios'
- export default {
- components: {
- paymentPrint
- },
- watch: {},
- data() {
- return {
- paymentList: {
- qualityInspectionManagement:{
- waterContent:'',
- buckleWeightRatio:0,
- grainMoney:0,
- waterMin:0,
- },
- unitDeduction:0
- },
- disabled:false,
- types:'',
- isShowPrint:false,
- information:'结算',
- printData:{},
- imgUrl:'',
- }
- },
- activated() {
- this.types = this.$route.query.type
- if( this.types == 2){
- this.disabled=true
- this.information = '查看'
- }else if(this.types == 1){
- this.disabled=false
- this.information = '结算'
- }
- this.getList()
- },
- methods: {
- inputFocus(event){
- event.currentTarget.select()
- },
- closeDialog(){
- html2canvas(this.$refs.saveImg.$el).then((canvas) => {
- let dataURL = canvas.toDataURL('image/png')
- this.imgUrl = dataURL
- if (this.imgUrl !== '' ) {
- let b = this.dataURLtoFile(this.imgUrl, 'printImage')
- let formdata = new FormData()
- formdata.append('file', b)
- axios({
- method: 'post',
- url: 'https://www.zthymaoyi.com/upload/admin',
- data: formdata,
- }).then((response) => {
- //编辑接口
- this.paymentList.pictureAddress = response.data.url
- settlementEdit(this.paymentList)
- .toPromise()
- .then((response) => {})
- this.paymentList = []
- })
- this.dialogTableVisible = true
-
- }
- })
- this.isShowPrint = false
- this.$router.push({path:'paymentManagement'})
- },
- printSmall() {
- window.open('../../../../../static/payprint.html?type=1&dataList=' +JSON.stringify(this.printData))
- },
- printBig() {
- window.open('../../../../../static/payprint.html?type=2&dataList=' +JSON.stringify(this.printData))
- },
- getList(){
- getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {
- this.paymentList = response
- if(!this.paymentList.unitDeduction){
- this.paymentList.unitDeduction = 0
- }
- this.paymentList.buckleWeightRatio = this.paymentList.qualityInspectionManagement.buckleWeightRatio
- this.paymentList.tidalGrainPrice = this.paymentList.tidalGrainPrice.toFixed(4)
- if(this.paymentList.qualityInspectionManagement.paramType == '2'){
- this.paymentList.qualityInspectionManagement.weightDeduction=(this.paymentList.qualityInspectionManagement.waterContent-this.paymentList.qualityInspectionManagement.waterMin)*this.paymentList.buckleWeightRatio
- this.paymentList.qualityInspectionManagement.weightDeduction=this.paymentList.qualityInspectionManagement.weightDeduction.toFixed(2)
- this.paymentList.base=(100-this.paymentList.qualityInspectionManagement.weightDeduction)/100
- this.paymentList.base = this.paymentList.base.toFixed(3)
- this.paymentList.pureWeight=this.paymentList.base*this.paymentList.weighingManagement.netWeight
- this.paymentList.pureWeight = this.paymentList.pureWeight.toFixed(2)
- }
- else{
- this.paymentList.pureWeight=this.paymentList.weighingManagement.netWeight * (100 - this.paymentList.param)/100
- this.paymentList.pureWeight = this.paymentList.pureWeight.toFixed(2)
- }
- if(!this.paymentList.dryGrainPrice){
- this.paymentList.dryGrainPrice=this.paymentList.qualityInspectionManagement.tidalGrainPrice/this.paymentList.base
- }
- this.grainMoney()
- })
-
- },
- actualPayment(e){
- this.paymentList.capitalize=this.convertCurrency(e)
- },
- grainMoney(){
- if(this.paymentList.type =='潮粮'){
- this.paymentList.grainMoney=(this.paymentList.qualityInspectionManagement.tidalGrainPrice - this.paymentList.unitDeduction)*this.paymentList.weighingManagement.netWeight
- this.paymentList.solidGrainPrice = (Number(this.paymentList.grainMoney)/Number(this.paymentList.pureWeight)).toFixed(4)
- this.paymentList.calculationPayable=Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy)-Number(this.paymentList.weighingDeduction)-this.paymentList.freightDeduction-Number(this.paymentList.unloadDeduction)-Number(this.paymentList.otherDeduction)-Number(this.paymentList.qualityDeduction)
- this.paymentList.calculationPayable = this.paymentList.calculationPayable.toFixed(2)
-
- this.paymentList.actualPayment = this.paymentList.calculationPayable
- this.actualPayment( this.paymentList.actualPayment)
- }else{
- this.paymentList.grainMoney=(this.paymentList.qualityInspectionManagement.dryGrainPrice - this.paymentList.unitDeduction)*this.paymentList.weighingManagement.netWeight
- this.paymentList.calculationPayable=Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy)-Number(this.paymentList.weighingDeduction)-this.paymentList.freightDeduction-Number(this.paymentList.unloadDeduction)-Number(this.paymentList.otherDeduction)-Number(this.paymentList.qualityDeduction)
- this.paymentList.calculationPayable = this.paymentList.calculationPayable.toFixed(2)
- this.paymentList.actualPayment = this.paymentList.calculationPayable
- this.actualPayment( this.paymentList.actualPayment)
- }
- this.paymentList.grainMoney = this.paymentList.grainMoney.toFixed(2)
- },
- /**
- * 将金额数字转为汉字大写
- * 12.42 -> 壹拾贰元肆角贰分
- * @param {Number} money - 数字金额
- * @return String
- */
- convertCurrency(money)
- {
- //汉字的数字
- var cnNums = new Array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
- //基本单位
- var cnIntRadice = new Array('', '拾', '佰', '仟');
- //对应整数部分扩展单位
- var cnIntUnits = new Array('', '万', '亿', '兆');
- //对应小数部分单位
- var cnDecUnits = new Array('角', '分', '毫', '厘');
- //整数金额时后面跟的字符
- var cnInteger = '整';
- //整型完以后的单位
- var cnIntLast = '元';
- //最大处理的数字
- var maxNum = 999999999999999.9999;
- //金额整数部分
- var integerNum;
- //金额小数部分
- var decimalNum;
- //输出的中文金额字符串
- var chineseStr = '';
- //分离金额后用的数组,预定义
- var parts;
- if (money == '') { return ''; }
- money = parseFloat(money);
- if (money >= maxNum) {
- //超出最大处理数字
- return '';
- }
- if (money == 0) {
- chineseStr = cnNums[0] + cnIntLast + cnInteger;
- return chineseStr;
- }
- //转换为字符串
- money = money.toString();
- if (money.indexOf('.') == -1) {
- integerNum = money;
- decimalNum = '';
- } else {
- parts = money.split('.');
- integerNum = parts[0];
- decimalNum = parts[1].substr(0, 4);
- }
- //获取整型部分转换
- if (parseInt(integerNum, 10) > 0) {
- var zeroCount = 0;
- var IntLen = integerNum.length;
- for (var i = 0; i < IntLen; i++) {
- var n = integerNum.substr(i, 1);
- var p = IntLen - i - 1;
- var q = p / 4;
- var m = p % 4;
- if (n == '0') {
- zeroCount++;
- } else {
- if (zeroCount > 0) {
- chineseStr += cnNums[0];
- }
- //归零
- zeroCount = 0;
- chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
- }
- if (m == 0 && zeroCount < 4) {
- chineseStr += cnIntUnits[q];
- }
- }
- chineseStr += cnIntLast;
- }
- //小数部分
- if (decimalNum != '') {
- var decLen = decimalNum.length;
- for (var i = 0; i < decLen; i++) {
- var n = decimalNum.substr(i, 1);
- if (n != '0') {
- chineseStr += cnNums[Number(n)] + cnDecUnits[i];
- }
- }
- }
- if (chineseStr == '') {
- chineseStr += cnNums[0] + cnIntLast + cnInteger;
- } else if (decimalNum == '') {
- chineseStr += cnInteger;
- }
- return chineseStr;
- },
- print() {
- if(this.paymentList.type == '潮粮' && this.paymentList.qualityInspectionManagement.paramType != 1){
- if (!this.paymentList.buckleWeightRatio) {
- this.$message({
- message: '扣重比不能为空',
- type: 'warning',
- })
- return
- }
- if (this.paymentList.buckleWeightRatio < 0 || this.paymentList.buckleWeightRatio > 2) {
- this.$message({
- message: '扣重比输入错误',
- type: 'warning',
- })
- return
- }
- }
- if (this.paymentList.weighingSubsidy < 0 || this.paymentList.weighingSubsidy > 100000) {
- this.$message({
- message: '称重补助范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.weighingDeduction < 0 || this.paymentList.weighingDeduction > 100000) {
- this.$message({
- message: '称重扣款范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.freightSubsidy < 0 || this.paymentList.freightSubsidy > 100000) {
- this.$message({
- message: '运费补助范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.freightDeduction < 0 || this.paymentList.freightDeduction > 100000) {
- this.$message({
- message: '运费扣款范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.unloadSubsidy < 0 || this.paymentList.unloadSubsidy > 100000) {
- this.$message({
- message: '卸车补助范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.unloadDeduction < 0 || this.paymentList.unloadDeduction > 100000) {
- this.$message({
- message: '卸车扣款范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.otherSubsidy < 0 || this.paymentList.unloadDeduction > 100000) {
- this.$message({
- message: '其他补助范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.qualityDeduction < 0 || this.paymentList.qualityDeduction > 100000) {
- this.$message({
- message: '质量扣款范围应在0-100000内',
- type: 'warning',
- })
- return
- }
-
- if (this.paymentList.otherDeduction < 0 || this.paymentList.otherDeduction > 100000) {
- this.$message({
- message: '其他扣款范围应在0-100000内',
- type: 'warning',
- })
- return
- }
- if (this.paymentList.actualPayment < 0 || this.paymentList.otherDeduction > 100000) {
- this.$message({
- message: '实际付款范围应在0-100000内',
- type: 'warning',
- })
- return
- }
- if (this.paymentList.remarks&&this.paymentList.remarks.length > 20) {
- this.$message({
- message: '记事字数应在0-20个字',
- type: 'warning',
- })
- return
- }
- this.paymentList.id=this.$route.query.id
- this.paymentList.amountIngPayable = this.paymentList.actualPayment
- this.paymentList.settlementClerk = sessionStorage.getItem('ws-pf_staffName')
- postpaymentedit(this.paymentList).toPromise().then((response) => {
- getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {
- this.printData= response
- console.log(this.printData,'结算打印')
- })
- this.isShowPrint = true
- },
- )
- },
- buckleWeightRatiochange(e){
- if(this.paymentList.buckleWeightRatio >= 0 && this.paymentList.buckleWeightRatio <= 2){
- this.paymentList.qualityInspectionManagement.weightDeduction=(this.paymentList.qualityInspectionManagement.waterContent-this.paymentList.qualityInspectionManagement.waterMin)*this.paymentList.buckleWeightRatio
- this.paymentList.qualityInspectionManagement.weightDeduction = this.paymentList.qualityInspectionManagement.weightDeduction.toFixed(2)
- this.paymentList.base=(100-this.paymentList.qualityInspectionManagement.weightDeduction)/100
- this.paymentList.base = this.paymentList.base.toFixed(3)
- this.paymentList.pureWeight=this.paymentList.base*this.paymentList.weighingManagement.netWeight
- this.paymentList.solidGrainPrice = (Number(this.paymentList.grainMoney)/Number(this.paymentList.pureWeight)).toFixed(4)
- this.paymentList.pureWeight = this.paymentList.pureWeight.toFixed(2)
-
- }else{
- this.$message({
- message: '扣重比输入错误',
- type: 'warning',
- })
- }
-
- },
- cancel() {
- this.isShowPrint = false
- this.paymentList = []
- this.$router.push({ path: 'paymentManagement' })
- },
- closePrint(){
- this.isShowPrint = false
- this.$router.push({path:'paymentManagement'})
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .center {
- background: #f6f7fc;
- }
- .ws-info-table {
- border: none;
- }
- .ws-info-table .el-form-item {
- width: 50%;
- border: none;
- }
- /deep/.ws-info-table .el-form-item .el-form-item__label {
- width: 40%;
- text-align: center;
- background: #ffffff;
- font-size: 14px;
- color: #8890b1;
- }
- /deep/.ws-info-table .el-form-item .el-form-item__content {
- border: none;
- }
- .titles {
- font-size: 16px;
- font-weight: 600;
- margin: 10px;
- }
- .titles::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 15px;
- background: #8890b1;
- margin-right: 5px;
- }
- .substance {
- background: #ffffff;
- width: 100%;
- border-radius: 4px;
- margin: 0 auto;
- padding-top: 20px;
- }
- .formItem {
- width: 70% !important;
- }
- /deep/.ws-info-table .formItem .el-form-item__label{
- width: 260px;
- }
- /deep/.el-table .el-table__header .cell,
- .el-table .el-table__body .cell {
- text-align: center;
- }
- /deep/.el-table--enable-row-transition .el-table__body td {
- text-align: center;
- }
- .bg-left {
- padding-left: 30px;
- }
- .bg-right {
- padding-right: 10px;
- text-align: right;
- }
- .bg-bottom {
- margin: 15px 0px;
- }
- .titleup {
- position: relative;
- }
- .titleup::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- .but {
- text-align: center;
- margin: 20px auto;
- }
- .el-form{
- overflow: scroll;
- height: 86vh;
- }
- /deep/.el-table .el-table__header .cell,
- .el-table .el-table__body .cell {
- text-align: center;
- }
- /deep/.el-table--enable-row-transition .el-table__body td {
- text-align: center;
- }
- .title{
- padding:10px;
- text-align:center;
- }
- /deep/.el-dialog__title {
- font-size: 24px !important;
- }
- /deep/.el-dialog__header {
- text-align: center !important;
- padding: 10px 0 !important;
- height: auto !important;
- }
- .title {
- font-size: 16px;
- font-weight: 600;
- }
- table,
- table tr th,
- table tr td {
- border: 2px solid #333333;
- padding: 5px 0;
- }
- table {
- width: 100%;
- min-height: 25px;
- line-height: 25px;
- text-align: center;
- border-collapse: collapse;
- border: 3px solid #333333;
- }
- </style>
|