Commit f96005b9 by yangxiaolei

格式化金额

parent bf29f930
......@@ -143,6 +143,7 @@
:key="key"
:label="item.label"
:prop="item.prop"
:formatter="item.rounding"
></el-table-column>
<el-table-column fixed="right" prop="op" label="操作" width="140px">
<template slot="header">
......@@ -298,7 +299,7 @@ export default {
{
label: '金额',
prop: 'maxamt',
rounding:this.rounding
},
{
label: '余额',
......
......@@ -181,14 +181,14 @@ export default {
{ max: 35, message: '长度不能超过35' },
],
'lidgrp.cbs.nom1.amt': [
{ type: 'string', required: true, message: '必输项' },
{ max: 18, message: '整数位不能超过15位' },
{
pattern: /(^\d+$)|(^\.\d{1,2}$)|(^\d+\.\d{1,2}$)/,
message: '小数位不能超过2位',
},
],
// 'lidgrp.cbs.nom1.amt': [
// { type: 'string', required: true, message: '必输项' },
// { max: 18, message: '整数位不能超过15位' },
// {
// pattern: /(^\d+$)|(^\.\d{1,2}$)|(^\d+\.\d{1,2}$)/,
// message: '小数位不能超过2位',
// },
// ],
'lidgrp.apl.pts.adrblk': [
{ type: 'string', required: false, message: '必输项' },
......
......@@ -87,13 +87,21 @@
</c-select>
</el-form-item>
</c-col>
<c-col :span="9">
<c-col :span="9" >
<el-form-item
style="text-align: left; margin-left: 5px"
label-width="0px"
prop="lidgrp.cbs.nom1.amt"
>
<c-input-currency
<c-input-number v-if="model.lidgrp.cbs.nom1.cur =='JPY'"
v-model="model.lidgrp.cbs.nom1.amt"
style="text-align: left; width: 90%"
placeholder="请输入金额"
@change="nomtopChange"
></c-input-number>
<c-input-currency v-else
v-model="model.lidgrp.cbs.nom1.amt"
style="text-align: left; width: 90%"
placeholder="请输入金额"
......@@ -653,7 +661,15 @@ export default {
} else {
this.flag = true;
}
},
}
},
"model.lidgrp.cbs.nom1.cur":{
immediate: true,
handler(val, oldVal) {
if (val == "JPY") {
this.model.lidgrp.cbs.nom1.amt = Number(this.model.lidgrp.cbs.nom1.amt)
}
}
},
"model.lidgrp":{
immediate: true,
......@@ -695,7 +711,7 @@ export default {
return this.model.lidgrp.apl.pts.extkey == "";
},
},
};
}
</script>
<style>
.marginLable {
......
......@@ -36,10 +36,6 @@ export default {
}
},
props: {
red:{
type: Boolean,
default: false
},
value: {
default: ''
},
......@@ -60,6 +56,11 @@ export default {
default: undefined
}
},
data(){
return {
red:false
}
},
computed: {
model: {
get () {
......
......@@ -342,15 +342,16 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="应收金额" prop="ogiamt" width="110px">
<el-table-column label="应收金额" prop="ogiamt" :formatter="rounding" width="110px">
</el-table-column>
<el-table-column label="实收金额" prop="amt" width="auto">
<el-table-column label="实收金额" prop="amt" width="auto">
<template slot-scope="scope">
<el-form-item
label-width="0"
:prop="'setmod.setfeg.setfel.' + scope.$index + '.amt'"
>
{{ scope.row.amt }}
{{ parseFloat(scope.row.amt).toFixed(2) }}
</el-form-item>
</template>
</el-table-column>
......
......@@ -57,10 +57,22 @@ export function moneyFormat(value, precision = 2) {
return num = null;
}
}
export function rounding(row,column) {
let val = row[column.property]
return toThousandslsFilter(val, 2);
}
export function toThousandslsFilter(num, digits) {
num = (num + '').replace(/\,/g, '')
return (+num || 0).toFixed(digits).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
}
export default {
install(Vue){
Vue.prototype.findCodeLabel = findCodeLabel
Vue.prototype.dateFormat = dateFormat
Vue.prototype.moneyFormat = moneyFormat
Vue.prototype.rounding = rounding
}
}
......@@ -129,8 +129,10 @@ export default {
window.sessionStorage.setItem("bchnam", dd.bch_namcn);
}
});
this.$router.push("/home");
this.$router.push("/taskList");
}
}).catch((err)=>{
this.$router.push("/taskList");
});
} else {
console.log("error submit!!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment