guoyujie
2025-11-12 a4342d24b522328d7181e4ca525bca7a4a2a7488
north-glass-erp/northglass-erp/src/components/pp/SelectProcessCardDetail.vue
@@ -117,7 +117,7 @@
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'}
    },
    {field: 'rack',width:100, title: t('架号'), editRender: {name: 'input', attrs: {placeholder: ''}},  slots: {filter: 'num1_filter'}},
    {field: 'rack',width:100, title:t('processCard.shelfNumber'),  slots: {filter: 'num1_filter'}},
    {field: 'technology_number', title: t('processCard.technologyNumber'),},
    {
      field: 'product_id',
@@ -143,7 +143,9 @@
  toolbarConfig: {
    buttons: [
      {code: 'update', name: t('合架'), status: 'primary'},
      {code: 'update', name: t('processCard.combinedFrame'), status: 'primary'},
      {code: 'save', name: t('basicData.save'), status: 'primary'},
      {code: 'clear', name: t('basicData.empty'), status: 'primary'},
    ],
  },
@@ -152,7 +154,7 @@
})
const arr=[]
//表格按钮
const gridEvents = {
@@ -164,17 +166,66 @@
          const $table = xGrid.value
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            if (selectRecords.length == 0) {
            if (selectRecords.length === 0) {
              ElMessage.warning(t('processCard.pleaseCheckTheRequiredData'))
              return;
            }
            for (let i = 0; i < selectRecords.length; i++) {
              console.log(selectRecords[i])
            let a
            selectRecords.forEach((item) => {
              if(arr.length===0){
                a='A1'
                item.rack=a
              }else{
                if(item.rack==null){
                  a='A'+(arr.length+1)
                  item.rack=a
                }
              }
            })
            if(!arr.includes(a)){
              arr.push(a)
            }
          }
          return;
        }
        case 'clear': {
          const $table = xGrid.value
          if ($table) {
            $table.getTableData().fullData.forEach((item) => {
                item.rack=null
            })
          }
          return;
        }
        case 'save': {
          const $table = xGrid.value
          if ($table) {
            const selectRecords = $table.getCheckboxRecords()
            if (selectRecords.length === 0) {
              ElMessage.warning(t('processCard.pleaseCheckTheRequiredData'))
              return;
            }
            let composingData = ref({
              composing: selectRecords,
            })
            request.post("/processCard/updateProcessCardRack", composingData.value).then((res) => {
              if (res.code == 200 && res.data === true) {
                ElMessage.success(t('basicData.msg.saveSuccess'))
                router.push({
                  path: '/main/processCard/SelectProcessCard',
                  query: {random: Math.random()}
                })
              } else {
                ElMessage.warning(t('basicData.msg.deleteFail'))
              }
            })
          }
          return;
@@ -184,7 +235,10 @@
    }
  }
}
const checkBoxConfig = ({ records, row }) => {
}
</script>
@@ -195,7 +249,7 @@
    <div class="main-table">
      <vxe-grid
          ref="xGrid"
          :checkbox-config="checkBoxConfig"
          @checkbox-change="checkBoxConfig"
          class="mytable-scrollbar"
          height="100%"
          v-bind="gridOptions"
@@ -243,6 +297,6 @@
.main-table{
  width: 100%;
  height: 600px;
  height: 540px;
}
</style>