| | |
| | | import downLoadFile from "@/hook/downLoadFile" |
| | | import footSum from "@/hook/footSum" |
| | | import {useI18n} from "vue-i18n" |
| | | import {multiply} from '@/utils/decimal' |
| | | import {multiply,multiplyAuto,divideAuto} from '@/utils/decimal' |
| | | const { t } = useI18n() |
| | | |
| | | let dialogTableVisible = ref(false) |
| | |
| | | item=>item.grossArea === 0 |
| | | ) |
| | | const errorAreaList = $grid.getTableData().fullData.filter( |
| | | item=>item.width*item.height/1000000 < errorArea.value*1 |
| | | item=>(item.width*item.height/1000000 < errorArea.value*1) |
| | | ) |
| | | if(grossAreaList.length>0){ |
| | | alert(t('order.msg.grossAreaIsNot0')) |
| | |
| | | ElMessage.error(t('basicData.msg.checkoutLose')) |
| | | return |
| | | } |
| | | |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | let order ={ |
| | | title:titleUploadData.value, |
| | | } |
| | |
| | | dataList.forEach((item,index) =>{ |
| | | if(index>=result.start ){ |
| | | let newStr = subStr1.replace(reg, number); |
| | | if(parseInt(newStr)>9){ |
| | | newStr=parseInt(newStr) |
| | | } |
| | | setNestedValue(item,result.cell,subStr2+newStr) |
| | | number=number+1 |
| | | } |
| | |
| | | dataList.forEach((item,index) =>{ |
| | | if(index >= result.start && index <= result.end){ |
| | | let newStr = subStr1.replace(reg, number); |
| | | if(parseInt(newStr)>9){ |
| | | newStr=parseInt(newStr) |
| | | } |
| | | setNestedValue(item,result.cell,subStr2+newStr) |
| | | number=number+1 |
| | | } |
| | |
| | | |
| | | //更新金额重置 |
| | | const updateMoney = () => { |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | const updateData = { |
| | | order: titleUploadData.value, |
| | | detail: xGrid.value.getTableData().fullData, |
| | |
| | | } |
| | | |
| | | const area = (row) => { |
| | | return parseFloat((row.width * row.height/1000000).toFixed(company.decValue)) |
| | | return parseFloat(divideAuto(row.width * row.height,1000000,company.decValue)) |
| | | } |
| | | const countArea = (row) => { |
| | | const area = parseFloat((row.width * row.height/1000000).toFixed(company.decValue)) |
| | | const area = parseFloat(divideAuto(row.width * row.height,1000000,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(decValue)) |
| | | areaSum = parseFloat(divideAuto(row.width * row.height* row.quantity,1000000,company.decValue)) |
| | | break |
| | | } |
| | | default :{ |
| | | areaSum = parseFloat((area * row.quantity).toFixed(decValue)) |
| | | areaSum = parseFloat(multiplyAuto(area ,row.quantity,company.decValue)) |
| | | break |
| | | } |
| | | } |
| | |
| | | const decValue = company.decValue |
| | | |
| | | if(titleUploadData.value.calculateType===1){ |
| | | item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(decValue)) |
| | | item.computeGrossArea = parseFloat(multiplyAuto(item.computeArea,item.quantity,decValue)) |
| | | }else if(titleUploadData.value.calculateType===2){ |
| | | item.computeGrossArea = item.grossArea |
| | | } |
| | |
| | | } |
| | | |
| | | const cellStyle = ({ row, column }) => { |
| | | if (column.field === 'width') { |
| | | if (row.width > parseInt(company.longSide)) { |
| | | return { |
| | | backgroundColor: '#ec6969' |
| | | if(company.longSide!=null){ |
| | | if (column.field === 'width') { |
| | | if (row.width > parseInt(company.longSide)) { |
| | | return { |
| | | backgroundColor: '#ec6969' |
| | | } |
| | | } |
| | | } |
| | | if (column.field === 'height') { |
| | | if (row.height > parseInt(company.longSide)) { |
| | | return { |
| | | backgroundColor: '#ec6969' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (column.field === 'height') { |
| | | if (row.height > parseInt(company.longSide)) { |
| | | return { |
| | | backgroundColor: '#ec6969' |
| | | } |
| | | } |
| | | } |
| | | |
| | | }; |
| | | |
| | | //误差面积计算方法 |
| | |
| | | if( !isNaN(item.computeArea*1) && item.computeArea != null && trueArea < errorArea.value){ |
| | | |
| | | item.computeArea = errorArea.value |
| | | item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2)) |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | item.computeGrossArea = parseFloat(multiply(item.computeArea,item.quantity)) |
| | | item.grossAmount=parseFloat(multiply(item.price , item.computeGrossArea)) |
| | | } |
| | | }) |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | |
| | | |
| | | if( !isNaN(item.computeArea*1) && item.computeArea != null ){ |
| | | if(titleUploadData.value.calculateType===3){ |
| | | item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2)) |
| | | item.grossAmount=parseFloat(multiply(item.price , item.quantity)) |
| | | }else{ |
| | | item.grossArea = countArea(item) |
| | | item.computeGrossArea = item.grossArea |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | item.grossAmount=parseFloat(multiply(item.price , item.computeGrossArea)) |
| | | } |
| | | } |
| | | }) |