| | |
| | | let sizeCheckVisible = ref(false) |
| | | let orderIdVisible = ref(false) |
| | | const maxTableLen =ref(500) |
| | | let errorArea = ref(0.4) |
| | | const userStore = useUserInfoStore() |
| | | const company = companyInfo() |
| | | let errorArea = ref(company.errorArea) |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const xGrid = ref() |
| | |
| | | keyboardConfig:{ |
| | | isArrow: true, |
| | | isDel: true, |
| | | isEnter: true, |
| | | //isEnter: true, |
| | | isTab: true, |
| | | isEdit: true, |
| | | isChecked: true |
| | |
| | | {field: 'grossArea',width:160, title: t('order.trueGrossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'computeArea',width:180, title: t('order.computeArea'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'computeGrossArea',width:200, title: t('order.computeGrossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'monolithicPerimeter',width:200, title: t('order.perimeter'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'shape',width:120, |
| | | title: t('order.shape'), |
| | | editRender: { name: 'input'}, |
| | |
| | | } |
| | | |
| | | const project = titleUploadData.value.project |
| | | if(project === null || project === undefined || project === ''){ |
| | | ElMessage.error(t('order.msg.projectCheck')) |
| | | return |
| | | if(project === null || project === undefined ){ |
| | | titleUploadData.value.project='' |
| | | } |
| | | const customer = titleUploadData.value.customerId |
| | | if(customer === null || customer === undefined || customer === ''){ |
| | |
| | | return |
| | | } |
| | | |
| | | const project = titleUploadData.value.project |
| | | if(project === null || project === undefined || project === ''){ |
| | | ElMessage.error(t('order.msg.projectCheck')) |
| | | return |
| | | } |
| | | const customer = titleUploadData.value.customerId |
| | | if(customer === null || customer === undefined || customer === ''){ |
| | | ElMessage.error(t('order.msg.customerCheck')) |
| | |
| | | |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value,gridOptions) |
| | | let productData = route.query.produceList |
| | | if (!(typeof productData === 'undefined' || productData == null || productData === '' || productData === '\n' || productData === '\r')){ |
| | | xGrid.value.insertAt(JSON.parse(productData)) |
| | | } |
| | | |
| | | const str = route.query.orderId || history.state.orderId |
| | | if (typeof str === 'undefined' || str === null || str === '' || str === '\n' || str === '\r'){ |
| | | |
| | | gridOptions.menuConfig.body.options[0][11].disabled = true |
| | | gridOptions.loading = false |
| | | return |
| | | } |
| | |
| | | |
| | | if(history.state.type=='copy'){ |
| | | xGrid.value.reloadData(orderDetails) |
| | | gridOptions.menuConfig.body.options[0][11].disabled = true |
| | | } |
| | | if(history.state.type=='copyTitle'){ |
| | | gridOptions.menuConfig.body.options[0][11].disabled = true |
| | | } |
| | | |
| | | gridOptions.loading = false |
| | |
| | | gridOptions.editRules[`otherColumns.${item.column}`] = [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | const regex = /^(0(\.\d{1,3})?|([1-9]\d{0,4})(\.\d{1,3})?|99999(\.9{1,3})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error(t('basicData.msg.range99999Dec2')) |
| | | return new Error(t('basicData.msg.range99999Dec3')) |
| | | } |
| | | } |
| | | } |
| | |
| | | const updateOrderId = () => { |
| | | let orderId ={ |
| | | oldOrderId:titleUploadData.value.orderId, |
| | | newOrderId:newOrderId.value |
| | | newOrderId:newOrderId.value, |
| | | orderIdType:company.orderIdType, |
| | | creator:userStore.user.userName, |
| | | } |
| | | request.post(`/order/updateOrderId`,orderId).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | |
| | | ElMessage.warning("输入订单号长度不符") |
| | | }else if(res.data==="false5"){ |
| | | ElMessage.warning("请输入数字") |
| | | }else if(res.data==="false6"){ |
| | | ElMessage.warning("不能修改第一个单子") |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | |
| | | // 审核订单 |
| | | const reviewOrder = (state) => { |
| | | const reviewOrder = async (state) => { |
| | | let differentSize = null |
| | | if(state===0){ |
| | | await request.post(`/order/selectDifferentSize/${titleUploadData.value.orderId}`).then(res =>{ |
| | | differentSize = res.data |
| | | }) |
| | | } |
| | | let orderGlassState = null |
| | | if(differentSize===true){ |
| | | await ElMessageBox.confirm( |
| | | t('order.msg.differentSize'), |
| | | t('order.msg.warning'), |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(async () => { |
| | | |
| | | }) |
| | | .catch(async () => { |
| | | orderGlassState = false |
| | | }) |
| | | } |
| | | if (orderGlassState===false){ |
| | | return |
| | | } |
| | | |
| | | request.post(`/order/reviewOrderById/${titleUploadData.value.orderId}/${state}/${userStore.user.userId}/${userStore.user.userName}`).then(res =>{ |
| | | if(res.code==200){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | |
| | | } |
| | | if(evnt.$event.keyCode === 13 ){ |
| | | const { rowIndex,row,column } = xGrid.value.getSelectedCell() || xGrid.value.getEditRecord() |
| | | let nextRowIndex = xGrid.value.getRowIndex(row) + 1; |
| | | if (nextRowIndex < xGrid.value.getTableData().fullData.length) { |
| | | let nextRowIndex = xGrid.value.getRowIndex(row) + 1 |
| | | |
| | | |
| | | switch (column.field){ |
| | | case 'width': |
| | | xGrid.value.setSelectCell(row, 'height') |
| | | break; |
| | | case 'height': |
| | | xGrid.value.setSelectCell(row, 'quantity') |
| | | break; |
| | | case 'quantity': |
| | | if(nextRowIndex === length){ |
| | | xGrid.value.insertAt({}, xGrid.value.getTableData.length || -1) |
| | | } |
| | | const nextRow = xGrid.value.getTableData().fullData[nextRowIndex] |
| | | xGrid.value.setCurrentRow(nextRow) |
| | | xGrid.value.scrollToRow(nextRow) |
| | | xGrid.value.setSelectCell(nextRow, 'width') |
| | | break; |
| | | default: |
| | | if(nextRowIndex === length){ |
| | | xGrid.value.insertAt({}, xGrid.value.getTableData.length || -1) |
| | | } |
| | | const nextRow1 = xGrid.value.getTableData().fullData[nextRowIndex] |
| | | xGrid.value.setCurrentRow(nextRow1) |
| | | xGrid.value.scrollToRow(nextRow1) |
| | | xGrid.value.setSelectCell(nextRow1, column.field) |
| | | break; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /*if (nextRowIndex < xGrid.value.getTableData().fullData.length) { |
| | | xGrid.value.setCurrentRow(xGrid.value.getTableData().fullData[nextRowIndex]); |
| | | } |
| | | if(rowIndex === length-1){ |
| | | xGrid.value.insertAt({}, xGrid.value.getTableData.length || -1) |
| | | } |
| | | }*/ |
| | | |
| | | } |
| | | if(evnt.$event.keyCode === 38 ){ |
| | |
| | | <div class="order-primary" style="background-color: white"> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>*{{$t('order.project')}}:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.project"/></el-col> |
| | | <el-col :span="2"><el-input v-model.trim="titleUploadData.project"/></el-col> |
| | | <el-col :span="2"><el-text>*{{$t('order.customers')}}:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.customerId" |
| | |
| | | <input type="text" |
| | | v-model="option.data" |
| | | @focus="inputFocus" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |