| | |
| | | const route = useRoute() |
| | | let rowClickIndex = ref(null) |
| | | const xGrid = ref() |
| | | import {multiply,multiplyAuto,divideAuto} from '@/utils/decimal' |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | |
| | | // {field: 'buildingNumber',width:120, title: '楼号',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'alias', title:t('components.otherProcessing'),minWith:'130'}, |
| | | {field: 'price', title:t('order.price'),editRender: { name: 'input'}}, |
| | | {field: 'quantity', title:t('order.quantity'),editRender: { name: 'input'}}, |
| | | {field: 'quantity', title:t('order.quantity')}, |
| | | {field: 'money', slots:{default:'default'}, title:t('delivery.money')} |
| | | ], |
| | | //表单验证 |
| | |
| | | quantity: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9]\d*)$/ |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue) ) { |
| | | return new Error(t('basicData.msg.greater0') ) |
| | | return new Error(t('basicData.msg.range99999Dec2') ) |
| | | } |
| | | } |
| | | } |
| | |
| | | const countAmount = (row) => { |
| | | const price = row.price===null?0:row.price |
| | | const quantity = row.quantity===null?0:row.quantity |
| | | return parseFloat((row.price * row.quantity).toFixed(2)) || 0 |
| | | return parseFloat((row.price * row.quantity).toFixed(2)) |
| | | } |
| | | |
| | | |