| | |
| | | deliveryAddress:'', |
| | | otherMoney:'', |
| | | otherMoneyRemarks:'', |
| | | processingNote:'', |
| | | processingNote:t('order.processingNote')+':', |
| | | createOrder:0, |
| | | creatorId:userStore.user.userId, |
| | | creator:userStore.user.userName, |
| | |
| | | computeArea: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | const decValue = company.decValue*1 |
| | | const regex =new RegExp(`^(0(\\.\\d{1,${decValue}})?|([1-9]\\d{0,4})(\\.\\d{1,${decValue}})?|99999(\\.9{1,${decValue}})?)$`) |
| | | if (!regex.test(cellValue)) { |
| | | return new Error(t('basicData.msg.range99999Dec2')) |
| | | } |
| | |
| | | ElMessage.error( t('order.msg.tableLengthNot')) |
| | | return |
| | | } |
| | | computedMoney() |
| | | computedMoney(null) |
| | | if(!gridOptions.menuConfig.body.options[0][5].disabled){ |
| | | ElMessage.error(t('order.msg.amountReset')) |
| | | return |
| | |
| | | } |
| | | }) |
| | | } |
| | | computedMoney() |
| | | computedMoney(null) |
| | | break |
| | | } |
| | | case 'copyChecked' :{ |
| | |
| | | }) |
| | | } |
| | | } |
| | | computedMoney() |
| | | computedMoney(result.cell) |
| | | gridOptions.menuConfig.body.options[0][5].disabled=false |
| | | break |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | computedMoney() |
| | | computedMoney(result.cell) |
| | | gridOptions.menuConfig.body.options[0][5].disabled=false |
| | | break |
| | | } |
| | |
| | | } |
| | | }) |
| | | } |
| | | computedMoney() |
| | | computedMoney(result.cell) |
| | | gridOptions.menuConfig.body.options[0][5].disabled=false |
| | | break |
| | | } |
| | | case 'computedMoney' :{ |
| | | computedMoney() |
| | | computedMoney(null) |
| | | |
| | | break |
| | | } |
| | |
| | | } |
| | | }) |
| | | } |
| | | const computedMoney = () => { |
| | | const computedMoney = (cell) => { |
| | | const dataList = xGrid.value.getTableData().fullData |
| | | dataList.forEach((item,index) =>{ |
| | | item.area = area(item) |
| | | item.grossArea = countArea(item) |
| | | item.computeArea = item.area |
| | | item.computeGrossArea = item.grossArea |
| | | if(['width', 'height', 'quantity'].includes(cell)){ |
| | | item.area = area(item) |
| | | item.grossArea = countArea(item) |
| | | item.computeArea = item.area |
| | | item.computeGrossArea = item.grossArea |
| | | }else if(cell==='computeArea'){ |
| | | item.computeGrossArea = item.computeArea * item.quantity |
| | | } |
| | | |
| | | if(titleUploadData.value.calculateType===3){ |
| | | item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2)) |
| | | }else{ |
| | |
| | | } |
| | | |
| | | const area = (row) => { |
| | | return parseFloat((row.width * row.height/1000000).toFixed(2)) |
| | | return parseFloat((row.width * row.height/1000000).toFixed(company.decValue)) |
| | | } |
| | | const countArea = (row) => { |
| | | const area = parseFloat((row.width * row.height/1000000).toFixed(2)) |
| | | const area = parseFloat((row.width * row.height/1000000).toFixed(company.decValue)) |
| | | let areaSum = 0 |
| | | // 获取保留面积 |
| | | const decValue = company.decValue |
| | | switch (titleUploadData.value.calculateType){ |
| | | |
| | | case 2:{ |
| | | areaSum = parseFloat((row.width * row.height * row.quantity/1000000).toFixed(2)) |
| | | areaSum = parseFloat((row.width * row.height * row.quantity/1000000).toFixed(decValue)) |
| | | break |
| | | } |
| | | default :{ |
| | | areaSum = parseFloat((row.computeArea * row.quantity).toFixed(2)) |
| | | areaSum = parseFloat((row.computeArea * row.quantity).toFixed(decValue)) |
| | | break |
| | | } |
| | | } |
| | |
| | | } |
| | | item.area = area(item) |
| | | item.grossArea = countArea(item) |
| | | const decValue = company.decValue |
| | | |
| | | if(item.computeGrossArea === undefined){ |
| | | if(titleUploadData.value.calculateType===1){ |
| | | item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2)) |
| | | }else if(titleUploadData.value.calculateType===2){ |
| | | item.computeGrossArea = item.grossArea |
| | | } |
| | | if(titleUploadData.value.calculateType===3){ |
| | | item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2)) |
| | | }else{ |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | } |
| | | if(titleUploadData.value.calculateType===1){ |
| | | item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(decValue)) |
| | | }else if(titleUploadData.value.calculateType===2){ |
| | | item.computeGrossArea = item.grossArea |
| | | } |
| | | if(titleUploadData.value.calculateType===3){ |
| | | item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2)) |
| | | }else{ |
| | | item.grossAmount=parseFloat((item.price * 1 * item.computeGrossArea).toFixed(2)) |
| | | } |
| | | |
| | | }) |