Browse Source

【EQI】查询条件格式更改

web
安虹睿 2 weeks ago
parent
commit
341097ef6f
  1. 11
      Web/src/utils/common/index.js
  2. 21
      Web/src/views/logisticsPlan/supplierMrpMonth/index.vue
  3. 40
      Web/src/views/logisticsPlan/supplierProPlaning/index.vue
  4. 21
      Web/src/views/logisticsPlan/supplierSaWeek/index.vue

11
Web/src/utils/common/index.js

@ -0,0 +1,11 @@
// filter中空字符转义
export function getPageParamsForFilter(pageParams){
if(pageParams.filters && JSON.stringify(pageParams.filters) != "{}"){
for(let i in pageParams.filters){
if(pageParams.filters[i] == ""){
pageParams.filters[i] = null
}
}
}
return pageParams
}

21
Web/src/views/logisticsPlan/supplierMrpMonth/index.vue

@ -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:'cherysuppliermrpmonth',
loading: false,
queryParams: {
materialCode: ''
},
pageParams: {
page: 1,
pageSize: 10,
total: 1
total: 1,
filters: {
materialCode: null
},
},
tableColumns: [
{prop:'releaseEdition',title:'需求发布版次',width:120},
@ -85,10 +90,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.pageParams.total = resp.data.totalPages
})
.finally(() => (state.loading = false))
}
@ -96,7 +101,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')
})

40
Web/src/views/logisticsPlan/supplierProPlaning/index.vue

@ -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')
})

21
Web/src/views/logisticsPlan/supplierSaWeek/index.vue

@ -4,7 +4,11 @@
<el-card class="search-container">
<el-form :inline="true">
<el-form-item label="计划协议号">
<el-input v-model="state.queryParams.scheduleAgreement" placeholder="计划协议号" clearable />
<el-input
v-model="state.pageParams.filters.scheduleAgreement"
placeholder="计划协议号"
clearable
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery(1)" icon="Search" v-auth="state.apiName + ':page'">查询</el-button>
@ -33,6 +37,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()
@ -40,13 +45,13 @@ const route = useRoute()
const state = reactive({
apiName:'cherysuppliersaweek',
loading: false,
queryParams: {
scheduleAgreement: ''
},
pageParams: {
page: 1,
pageSize: 10,
total: 1
total: 1,
filters: {
scheduleAgreement: null
},
},
tableColumns: [
{prop:'scheduleAgreement',title:'计划协议号',width:120},
@ -75,10 +80,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.pageParams.total = resp.data.totalPages
})
.finally(() => (state.loading = false))
}
@ -86,7 +91,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')
})

Loading…
Cancel
Save