| | |
| | | import downLoadFile from "@/hook/downLoadFile" |
| | | import footSum from "@/hook/footSum" |
| | | import {useI18n} from "vue-i18n" |
| | | import {multiply} from '@/utils/decimal' |
| | | const { t } = useI18n() |
| | | |
| | | let dialogTableVisible = ref(false) |
| | |
| | | let errorAreaVisible = ref(false) |
| | | let otherMoneyVisible = ref(false) |
| | | let sizeCheckVisible = ref(false) |
| | | const maxTableLen =ref(150) |
| | | const maxTableLen =ref(500) |
| | | let errorArea = ref(0.4) |
| | | const userStore = useUserInfoStore() |
| | | const company = companyInfo() |
| | |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if ( !regex.test(cellValue) ) { |
| | | return new Error(t('basicData.msg.range99999Dec2') ) |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | quantity: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^[1-9]\d*$/ |
| | | if ( !regex.test(cellValue) ) { |
| | | return new Error(t('basicData.msg.greater0') ) |
| | | } |
| | | } |
| | | } |
| | |
| | | item.computeArea = item.area |
| | | item.computeGrossArea = item.grossArea |
| | | }) |
| | | computedMoney(null) |
| | | selectOrder(order) |
| | | } |
| | | |
| | |
| | | let result = toolbarButtonClickEvent() |
| | | if(result){ |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | const val = getNestedProperty(dataList[result.start],result.cell) |
| | | const val = getNestedProperty(dataList[result.start],result.cell)+"" |
| | | |
| | | const numbersArr = [] |
| | | const regex = /\d+/g |
| | |
| | | let result = toolbarButtonClickEvent() |
| | | if (result) { |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | const val = getNestedProperty(dataList[result.start], result.cell) |
| | | const val = getNestedProperty(dataList[result.start], result.cell)+"" |
| | | const numbersArr = [] |
| | | const regex = /\d+/g |
| | | let match |
| | |
| | | |
| | | request.post(`/order/getOrderById/${str}`).then((res) => { |
| | | if(res.code==200){ |
| | | console.log(res.data.order) |
| | | titleUploadData.value = res.data.order |
| | | if(history.state.orderId!=null){ |
| | | titleUploadData.value.orderId='' |
| | |
| | | gridOptions.loading = false |
| | | return |
| | | } |
| | | const buttonTitle = {'code': 'saveOrderTitle', |
| | | status: 'primary', |
| | | 'name': t('order.saveHeader')} |
| | | gridOptions.toolbarConfig.buttons.push(buttonTitle) |
| | | //取消工艺按钮禁用 |
| | | gridOptions.toolbarConfig.buttons[1].disabled = false |
| | | //工艺审核后保存按钮禁用 |
| | |
| | | status: 'primary', |
| | | 'name': (res.data.order.orderReview>0?t('basicData.cancel'):t('basicData.restore'))} |
| | | gridOptions.toolbarConfig.buttons.push(button) |
| | | const buttonTitle = {'code': 'saveOrderTitle', |
| | | status: 'primary', |
| | | 'name': t('order.saveHeader')} |
| | | gridOptions.toolbarConfig.buttons.push(buttonTitle) |
| | | |
| | | if(res.data.order.orderReview===-2){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | gridOptions.toolbarConfig.buttons[3].disabled = true |
| | |
| | | } |
| | | |
| | | if(titleUploadData.value.calculateType===3){ |
| | | item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2)) |
| | | item.grossAmount=multiply(item.price,item.quantity) |
| | | }else{ |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | item.grossAmount=multiply(item.price,item.computeGrossArea) |
| | | } |
| | | |
| | | }) |
| | |
| | | titleUploadData.value.icon = titleSelectJson.value.icon[0].basicName |
| | | titleUploadData.value.packType = titleSelectJson.value.packType[0].basicName |
| | | titleUploadData.value.alType = titleSelectJson.value.alType[0].basicName |
| | | titleUploadData.value.calculateType = 1 |
| | | titleUploadData.value.calculateType = company.calculateType |
| | | const today = new Date |
| | | today.setTime(today.getTime() + (7 * 24 * 60 * 60 * 1000)) |
| | | titleUploadData.value.deliveryDate = today.getFullYear() + |
| | |
| | | const countArea = (row) => { |
| | | const area = parseFloat((row.width * row.height/1000000).toFixed(company.decValue)) |
| | | let areaSum = 0 |
| | | // 获取保留面积 |
| | | // 获取保留面积, |
| | | const decValue = company.decValue |
| | | switch (titleUploadData.value.calculateType){ |
| | | case 2:{ |
| | |
| | | item.computeGrossArea = item.grossArea |
| | | } |
| | | if(titleUploadData.value.calculateType===3){ |
| | | item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2)) |
| | | item.grossAmount=multiply(item.price , item.quantity) |
| | | }else{ |
| | | item.grossAmount=parseFloat((item.price * 1 * item.computeGrossArea).toFixed(2)) |
| | | item.grossAmount=multiply(item.price * 1 , item.computeGrossArea) |
| | | } |
| | | |
| | | }) |
| | |
| | | row.computeGrossArea = row.grossArea |
| | | } |
| | | if(titleUploadData.value.calculateType===3){ |
| | | row.grossAmount=parseFloat((row.price * row.quantity).toFixed(2)) |
| | | row.grossAmount=multiply(row.price ,row.quantity) |
| | | }else{ |
| | | row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2)) |
| | | row.grossAmount=multiply(row.price , row.computeGrossArea) |
| | | } |
| | | |
| | | }else if(column.property === 'computeArea'){ |
| | |
| | | if(titleUploadData.value?.orderReview!==2){ |
| | | row.computeGrossArea = row.computeArea * row.quantity |
| | | } |
| | | row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2)) |
| | | row.grossAmount=multiply(row.price , row.computeGrossArea) |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | const cellStyle = ({ row, column }) => { |
| | | 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' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | }; |
| | | |
| | | //误差面积计算方法 |
| | | const errorAreaComputed = () => { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if (!regex.test(errorArea.value)) { |
| | | if (!regex.test(errorArea.value.toString())) { |
| | | ElMessage.warning(t('basicData.msg.range99999Dec2')) |
| | | return |
| | | } |
| | |
| | | fullData.forEach((item,index) => { |
| | | let trueArea = item.width*item.height/1000000 |
| | | 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)) |
| | |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | errorAreaVisible.value= false |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | if(evnt.$event.keyCode === 38 ){ |
| | | const { rowIndex,row,column } = xGrid.value.getSelectedCell() || xGrid.value.getEditRecord() |
| | | let nextRowIndex = xGrid.value.getRowIndex(row) - 1; |
| | | console.log(xGrid.value.getTableData().fullData.length) |
| | | console.log(nextRowIndex) |
| | | if (nextRowIndex < xGrid.value.getTableData().fullData.length && nextRowIndex>=0) { |
| | | xGrid.value.setCurrentRow(xGrid.value.getTableData().fullData[nextRowIndex]); |
| | | } |
| | |
| | | v-on="gridEvents" |
| | | @keydown="handleKeyDown" |
| | | @edit-closed="editClosedEvent" |
| | | :cell-style="cellStyle" |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |