| | |
| | | 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', |
| | |
| | | |
| | | 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'}, |
| | | ], |
| | | |
| | | }, |
| | |
| | | |
| | | |
| | | }) |
| | | |
| | | const arr=[] |
| | | |
| | | //表格按钮 |
| | | const gridEvents = { |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | } |
| | | const checkBoxConfig = ({ records, row }) => { |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | </script> |
| | |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | ref="xGrid" |
| | | :checkbox-config="checkBoxConfig" |
| | | @checkbox-change="checkBoxConfig" |
| | | class="mytable-scrollbar" |
| | | height="100%" |
| | | v-bind="gridOptions" |
| | |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: 600px; |
| | | height: 540px; |
| | | } |
| | | </style> |