|
|
@ -4,7 +4,11 @@ |
|
|
|
<el-card class="search-container"> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-form-item label="零件号"> |
|
|
|
<el-input v-model="state.queryParams.materialCode" placeholder="零件号" clearable /> |
|
|
|
<el-input |
|
|
|
v-model="state.pageParams.filters.materialCode" |
|
|
|
placeholder="零件号" |
|
|
|
clearable |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="handleQuery(1)" icon="Search" v-auth="state.apiName + ':page'">查询</el-button> |
|
|
@ -32,6 +36,7 @@ import { downloadByData } from '@/utils/download' |
|
|
|
import { ElMessageBox, ElMessage } from 'element-plus' |
|
|
|
import tablePage from '@/components/tablePage/index.vue' |
|
|
|
import EnumList from '@/utils/common/enumList' |
|
|
|
import { getPageParamsForFilter } from '@/utils/common/index' |
|
|
|
|
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
const route = useRoute() |
|
|
@ -39,13 +44,13 @@ const route = useRoute() |
|
|
|
const state = reactive({ |
|
|
|
apiName:'supplierproplaning', |
|
|
|
loading: false, |
|
|
|
queryParams: { |
|
|
|
materialCode: '' |
|
|
|
}, |
|
|
|
pageParams: { |
|
|
|
page: 1, |
|
|
|
pageSize: 10, |
|
|
|
total: 1 |
|
|
|
total: 1, |
|
|
|
filters: { |
|
|
|
materialCode: null |
|
|
|
}, |
|
|
|
}, |
|
|
|
tableColumns: [ |
|
|
|
{prop:'releaseEdition',title:'需求发布版次',width:120}, |
|
|
@ -83,29 +88,10 @@ onMounted(() => { |
|
|
|
function handleQuery(page) { |
|
|
|
state.loading = true |
|
|
|
state.pageParams.page = page |
|
|
|
getCommonPaged(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|
|
|
getCommonPaged(state.apiName,Object.assign({}, getPageParamsForFilter(state.pageParams))) |
|
|
|
.then((resp) => { |
|
|
|
state.tableData = resp.data.data |
|
|
|
state.pageParams.total = resp.data.total |
|
|
|
// state.tableData = [ |
|
|
|
// {id:1,isDelete:1,plant:'p'+page}, |
|
|
|
// {id:2,isDelete:0,plant:page}, |
|
|
|
// {id:3,isDelete:1,plant:page}, |
|
|
|
// {id:4,isDelete:1,plant:page}, |
|
|
|
// {id:5,isDelete:1,plant:page}, |
|
|
|
// {id:6,isDelete:1,plant:page}, |
|
|
|
// {id:7,isDelete:1,plant:page}, |
|
|
|
// {id:8,isDelete:1,plant:page}, |
|
|
|
// {id:9,isDelete:1,plant:page}, |
|
|
|
// {id:10,isDelete:1,plant:page}, |
|
|
|
// {id:11,isDelete:1,plant:page}, |
|
|
|
// {id:12,isDelete:1,plant:page}, |
|
|
|
// {id:13,isDelete:1,plant:page}, |
|
|
|
// {id:14,isDelete:1,plant:page}, |
|
|
|
// {id:15,isDelete:1,plant:page}, |
|
|
|
// {id:16,isDelete:1,plant:page}, |
|
|
|
// ] |
|
|
|
// state.pageParams.total = state.tableData.length |
|
|
|
state.pageParams.total = resp.data.totalPages |
|
|
|
}) |
|
|
|
.finally(() => (state.loading = false)) |
|
|
|
} |
|
|
@ -113,7 +99,7 @@ function handleQuery(page) { |
|
|
|
// 导出 |
|
|
|
function handleExport(){ |
|
|
|
state.loading = true |
|
|
|
postCommonExport(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|
|
|
postCommonExport(state.apiName,Object.assign({}, getPageParamsForFilter(state.pageParams))) |
|
|
|
.then((res) => { |
|
|
|
downloadByData(res.data,route.meta.title+'.xlsx') |
|
|
|
}) |
|
|
|