| | |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import userInfo from "@/stores/userInfo" |
| | | import {useI18n} from 'vue-i18n' |
| | | import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | const route = useRoute() |
| | |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value, gridOptions) |
| | | }) |
| | | |
| | | //子组件接收参数 |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns: [ |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | { |
| | | field: 'basicName', |
| | | title: '班组名称', |
| | | title: t('productionBasicData.teamName'), |
| | | width: 600, |
| | | editRender: {name: 'input', attrs: {placeholder: ''}}, |
| | | |
| | | }, |
| | | { |
| | | field: 'basicCategory', |
| | | title: '所在工序', |
| | | title: t('productionBasicData.processInvolved'), |
| | | editRender: {}, |
| | | slots: {default: 'basicCategory_default', edit: 'basicCategory'} |
| | | }, |
| | |
| | | //表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'save', name: '保存', status: 'primary', icon: 'vxe-icon-save'}, |
| | | {code: 'removeRow', name: t('basicData.delete'), status: 'primary', icon: 'vxe-icon-delete'}, |
| | | {code: 'addRow', name: t('reportingWorks.increase'), status: 'primary', icon: 'vxe-icon-square-plus'}, |
| | | {code: 'save', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save'}, |
| | | ], |
| | | // import: false, |
| | | // export: true, |
| | |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return t('basicData.total') |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | |
| | | $grid.insertAt({}) |
| | | break |
| | | } |
| | | case 'removeRow': { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result) { |
| | | $grid.remove(result.row) |
| | | } |
| | | break |
| | | } |
| | | case 'save': { |
| | | const tableData = $grid.getTableData().fullData |
| | | //console.log(tableData) |
| | |
| | | }) |
| | | request.post("/basicDataProduce/saveTeamGroup", teamGroupData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("保存成功") |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | //router.push('/main/processCard/SplittingDetails?orderId=${orderId}') |
| | | router.push({ |
| | | path: '/main/productionBasicData/AddTeamGroup', |
| | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | </style> |