机具供应展示增加查询条件
This commit is contained in:
parent
282e8e78c0
commit
31af9bf89b
|
|
@ -0,0 +1,10 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取卡片列表信息
|
||||||
|
export const getCardListApi = data => {
|
||||||
|
return request({
|
||||||
|
url: '/***',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -18,29 +18,35 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item prop="company">
|
<el-form-item prop="unitId">
|
||||||
<el-select
|
<treeselect
|
||||||
clearable
|
:options="unitList"
|
||||||
filterable
|
:show-count="true"
|
||||||
style="width: 95%"
|
style="width: 95%"
|
||||||
placeholder="选择公司"
|
:normalizer="normalizer"
|
||||||
v-model="queryParams.company"
|
v-model="queryParams.unitId"
|
||||||
>
|
:disable-branch-nodes="true"
|
||||||
<el-option label="全部" value="1" />
|
noChildrenText="没有数据了"
|
||||||
</el-select>
|
noOptionsText="没有数据"
|
||||||
|
noResultsText="没有搜索结果"
|
||||||
|
placeholder="请选择公司"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item prop="project">
|
<el-form-item prop="projectId">
|
||||||
<el-select
|
<treeselect
|
||||||
clearable
|
v-model="queryParams.projectId"
|
||||||
filterable
|
:options="projectList"
|
||||||
|
:normalizer="normalizer"
|
||||||
|
:show-count="true"
|
||||||
style="width: 95%"
|
style="width: 95%"
|
||||||
placeholder="选择工程"
|
:disable-branch-nodes="true"
|
||||||
v-model="queryParams.project"
|
noChildrenText="没有数据了"
|
||||||
>
|
noOptionsText="没有数据"
|
||||||
<el-option label="全部" value="1" />
|
noResultsText="没有搜索结果"
|
||||||
</el-select>
|
placeholder="请选择领工程"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
|
|
@ -111,12 +117,18 @@ import CardModel from './components/card-model' // 卡片组件
|
||||||
import CardModelSpace from './components/card-model-space' // 第一行右侧小卡片组件
|
import CardModelSpace from './components/card-model-space' // 第一行右侧小卡片组件
|
||||||
import ChartModelBox from './components/chart-model-box' // 图表组件
|
import ChartModelBox from './components/chart-model-box' // 图表组件
|
||||||
import TableModel from './components/table-model' // 二级页面列表组件
|
import TableModel from './components/table-model' // 二级页面列表组件
|
||||||
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
|
||||||
|
import { getCardListApi } from '@/api/home/equipment-supply.js'
|
||||||
|
import { getListProject, getListUnite } from '@/api/lease/apply'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CardModel,
|
CardModel,
|
||||||
CardModelSpace,
|
CardModelSpace,
|
||||||
ChartModelBox,
|
ChartModelBox,
|
||||||
TableModel
|
TableModel,
|
||||||
|
Treeselect
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -124,15 +136,20 @@ export default {
|
||||||
isHome: false,
|
isHome: false,
|
||||||
// 二级页面标题
|
// 二级页面标题
|
||||||
levelTwoTitle: '',
|
levelTwoTitle: '',
|
||||||
|
// 公司列表
|
||||||
|
unitList: [],
|
||||||
|
// 工程列表
|
||||||
|
projectList: [],
|
||||||
|
// 日期查询条件
|
||||||
|
queryDate: [],
|
||||||
// 表单查询条件
|
// 表单查询条件
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
company: '',
|
unitId: undefined,
|
||||||
project: ''
|
projectId: undefined
|
||||||
},
|
},
|
||||||
// 日期查询条件
|
|
||||||
queryDate: [],
|
|
||||||
cardList_1: [
|
cardList_1: [
|
||||||
{
|
{
|
||||||
title: '需求量',
|
title: '需求量',
|
||||||
|
|
@ -225,8 +242,27 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取卡片列表信息
|
||||||
|
async getCardListFun() {
|
||||||
|
const queryParams = {
|
||||||
|
...this.queryParams,
|
||||||
|
startTime: this.queryDate && this.queryDate.length > 0 ? this.queryDate[0] : '',
|
||||||
|
endTime: this.queryDate && this.queryDate.length > 0 ? this.queryDate[1] : ''
|
||||||
|
}
|
||||||
|
const res = await getCardListApi()
|
||||||
|
console.log(res, '--')
|
||||||
|
},
|
||||||
|
// 获取公司和工程
|
||||||
|
async getCompanyAndProjectFun() {
|
||||||
|
const comRes = await getListUnite({ projectId: null })
|
||||||
|
this.unitList = comRes.data
|
||||||
|
const proRes = await getListProject({ unitId: null })
|
||||||
|
this.projectList = proRes.data
|
||||||
|
},
|
||||||
// 查询
|
// 查询
|
||||||
onHandleSearch() {},
|
onHandleSearch() {
|
||||||
|
console.log('this.queryParams', this.queryParams)
|
||||||
|
},
|
||||||
// 重置
|
// 重置
|
||||||
onHandleReset() {
|
onHandleReset() {
|
||||||
this.queryDate = []
|
this.queryDate = []
|
||||||
|
|
@ -240,7 +276,21 @@ export default {
|
||||||
// 自定义事件 关闭二级页面
|
// 自定义事件 关闭二级页面
|
||||||
onCloseLevelTwoPages() {
|
onCloseLevelTwoPages() {
|
||||||
this.isHome = false
|
this.isHome = false
|
||||||
|
},
|
||||||
|
// 转换菜单数据结构
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children
|
||||||
}
|
}
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.name,
|
||||||
|
children: node.children
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCompanyAndProjectFun()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue