| | |
| | | |
| | | <script> |
| | | import Search from '@/components/Search.vue' |
| | | import { getList } from "@/util/api/PlanningAPI" |
| | | |
| | | export default { |
| | | components: { |
| | | Search |
| | |
| | | }).exec() |
| | | }) |
| | | }, |
| | | onLoad() { |
| | | this.getLists() |
| | | }, |
| | | methods: { |
| | | clickItem(obj) { |
| | | uni.$emit('update', {obj}) |
| | | uni.navigateBack({ delta: 1 }); |
| | | }, |
| | | // 获取头部组件高度 |
| | |
| | | this.lists = [] |
| | | this.getLists() |
| | | }, |
| | | // 点击标签搜索 |
| | | clickTag(ids) { |
| | | this.listData.cateIds = ids |
| | | this.listData.page = 0 |
| | | this.finished = false |
| | | this.lists = [] |
| | | // this.getLists() |
| | | }, |
| | | // 获取列表统计 |
| | | pageCounts() { |
| | | pageCount({ |
| | | factoryId: this.listData.departIds, |
| | | procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [], |
| | | startDate: this.listData.startDate, |
| | | endDate: this.listData.endDate, |
| | | statusList: this.listData.cateIds |
| | | }).then(res => { |
| | | if (res.code === 200 && res.data) { |
| | | this.tagList[0].num = res.data.allNum.toString() |
| | | this.tagList[1].num = res.data.startNum.toString() |
| | | this.tagList[2].num = res.data.ingNum.toString() |
| | | this.tagList[3].num = res.data.endNum.toString() |
| | | } |
| | | }) |
| | | }, |
| | | // 获取工厂数据 |
| | | getOrganizations() { |
| | | getOrganization({ |
| | | type: 1 |
| | | }).then(res => { |
| | | if (res.code === 200 && res.data && res.data.length !== 0) { |
| | | res.data.forEach((item, i) => { |
| | | item.isActive = i === 0; |
| | | }) |
| | | if (res.data.length > 0) { |
| | | this.factoryList = res.data |
| | | this.listData.departIds = this.factoryList[0].id |
| | | this.listData.procedureIds = '' |
| | | this.finished = false |
| | | this.getWorkingProcedures(this.factoryList[0].id) |
| | | this.getLists() |
| | | this.pageCounts() |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 获取工序数据 |
| | | getWorkingProcedures(orgId) { |
| | | this.data = [] |
| | | getWorkingProcedure({ |
| | | orgId |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200 && res.data && res.data.length !== 0) { |
| | | res.data.forEach((item, i) => { |
| | | item.isActive = false; |
| | | }) |
| | | this.data = res.data |
| | | } |
| | | }) |
| | | }, |
| | | // 搜索弹框提交 |
| | | submit() { |
| | | let pmodelOrgId = [] |
| | | this.data.forEach((item) => { |
| | | if (item.isActive) { |
| | | pmodelOrgId.push(item.id) |
| | | } |
| | | }) |
| | | this.listData.procedureIds = pmodelOrgId |
| | | this.listData.page = 0 |
| | | this.finished = false |
| | | this.lists = [] |
| | | // this.getLists() |
| | | // this.pageCounts() |
| | | this.pageData.page = 0 |
| | | this.finished.value = false |
| | | this.listData.value = [] |
| | | this.getLists() |
| | | }, |
| | | // 获取计划列表数据 |
| | | getLists() { |
| | | console.log('getLists') |
| | | if (!this.finished) { |
| | | this.pageData.page = this.pageData.page + 1 |
| | | this.loading = true |