廖井涛
5 天以前 a660db06773007b1be690e0674829c00a57aeb7b
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'},
    ],
  },
@@ -164,25 +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;
            }
            let a
            selectRecords.forEach((item) => {
              if(arr.length===0){
                let a='A1'
                a='A1'
                item.rack=a
                arr.push(a)
              }else{
                let a='A'+arr.length
                item.rack=a
                arr.push(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;
@@ -194,11 +237,7 @@
}
const checkBoxConfig = ({ records, row }) => {
  /*if(row.checked){
    console.log(111)
  }else{
    console.log(222)
  }*/
}
@@ -258,6 +297,6 @@
.main-table{
  width: 100%;
  height: 600px;
  height: 540px;
}
</style>