| | |
| | | import {useRouter,useRoute} from "vue-router" |
| | | import {useI18n} from "vue-i18n" |
| | | import WarehouseCreateBasicData from "@/views/mm/basicData/WarehouseCreateBasicData.vue"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | const { t } = useI18n() |
| | | |
| | | const userStore = useUserInfoStore() |
| | | let dialogTableVisible = ref(false) |
| | | const router = useRouter() |
| | | const xGrid = ref() |
| | |
| | | //表头参数 |
| | | columns:[ |
| | | {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left",}, |
| | | {type: 'seq', title: '序号', width: 80 ,fixed:"left",}, |
| | | {field:'operateTypeName',title: '名称'}, |
| | | {field:'operateType',title: '别称'}, |
| | | {field:'type',title: '类型'}, |
| | | {field:'createTime',title: '创建日期'}, |
| | | {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left",}, |
| | | {field:'operateTypeName',title: t('warehouseBasicData.operateTypeName')}, |
| | | {field:'operateType',title: t('warehouseBasicData.operateType')}, |
| | | {field:'type',title: t('warehouseBasicData.type')}, |
| | | {field:'createTime',title: t('basicData.creationTime')}, |
| | | |
| | | |
| | | ], |
| | |
| | | //表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'add', 'name': '新增',status: 'primary'}, |
| | | {'code': 'add', 'name': t('basicData.insert'),status: 'primary'}, |
| | | ], |
| | | |
| | | // import: false, |
| | |
| | | } |
| | | } |
| | | |
| | | request.get('/BasicWarehouse/getBasicWarehouse').then(res => { |
| | | const options = ref({ |
| | | originalFilm: t('ingredients.originalFilm'), |
| | | accessories: t('ingredients.accessories') |
| | | }) |
| | | |
| | | |
| | | request.post(`/BasicWarehouse/getBasicWarehouse`,options.value).then(res => { |
| | | if(res.code==='200'){ |
| | | xGrid.value.reloadData(res.data) |
| | | } |
| | |
| | | } |
| | | case 'delete': { |
| | | request.post(`/BasicWarehouse/deleteBasicWarehouse`,row).then((res) => { |
| | | if(res.code==200){ |
| | | if(res.code==200 && res.data===true){ |
| | | ElMessage.success(t('searchOrder.msgDeleteSuccess')) |
| | | router.push({ |
| | | path:'/main/warehouseBasicData/warehouseSearchBasicData', |
| | |
| | | }else{ |
| | | ElMessage.warning(t('searchOrder.msgDeleteFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <vxe-grid |
| | | style="width: 40vw;" |
| | | class="mytable-scrollbar" |
| | | max-height="500px" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('basicData.edit') }}</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" title="确定删除数据?"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | class="mytable-scrollbar" |
| | | height="100%" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" |
| | | v-if="userStore.user.permissions.indexOf('warehouseSearchBasicData.edit') > -1" |
| | | link type="primary" size="small">{{ $t('basicData.edit') }}</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </vxe-grid> |
| | | </div> |
| | | <el-dialog |
| | | v-model="dialogTableVisible" |
| | | destroy-on-close |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .head{ |
| | | width: 100%; |
| | | height: 70px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 0px); |
| | | } |
| | | </style> |