guoyuji
2025-02-08 07c8bd5f0d9deac8a8026fd4abc1074dbac29330
north-glass-erp/northglass-erp/src/components/sd/order/OrderSizeCheck.vue
@@ -38,11 +38,11 @@
  keyboardConfig:{
    isArrow: true,
    isDel: true,
    isEnter: true,
    isTab: true,
    isEdit: true,
    isChecked: true,
    enterToTab:true
   // enterToTab:true,
    //isEnter: true,
  },
  customConfig: {
@@ -128,15 +128,41 @@
})
const editClosedEvent = ({ row, column,rowIndex}) => {
const editClosedEvent = ({ row, column,rowIndex,columnIndex}) => {
  const $table = props.OrderDetail
  let checkVal = row[column.property]*1
  const oldVal = $table.getTableData().fullData[rowIndex][column.property]*1
  if(checkVal!==oldVal){
    row[column.property]=null
  }
}
const handleKeyDown = (evnt) =>{
  const length = xGrid.value.getTableData().fullData.length
  if(evnt.$event.keyCode === 13 ){
    const { rowIndex,row,column } = xGrid.value.getSelectedCell() || xGrid.value.getEditRecord()
    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){
          return
        }
        const nextRow = xGrid.value.getTableData().fullData[nextRowIndex]
        xGrid.value.setCurrentRow(nextRow)
        xGrid.value.scrollToRow(nextRow)
        xGrid.value.setSelectCell(nextRow, 'width')
        break;
    }
  }
}
</script>
@@ -150,6 +176,7 @@
        v-bind="gridOptions"
        v-on="gridEvents"
        @edit-closed="editClosedEvent"
        @keydown="handleKeyDown"
    >
    </vxe-grid>
  </div>