| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="content"> |
| | | <view class="content_search"> |
| | | <Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true" placeholder="æç´¢ç©æåç§°/ç¼ç /å·¥åºåç§°"> |
| | | <template v-slot:content> |
| | | <view class="Search_item"> |
| | | <view class="Search_item_label">è®¡åæ¥æ</view> |
| | | <view class="Search_item_content" @click="openDate"> |
| | | <view class="Search_item_content_a" :style="listData.startDate ? 'color: #000' : ''">{{ listData.startDate ? listData.startDate : 'å¼å§æ¥æ'}}</view> |
| | | <text>-</text> |
| | | <view class="Search_item_content_a" :style="listData.endDate ? 'color: #000' : ''">{{ listData.endDate ? listData.endDate : 'ç»ææ¥æ'}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="Search_item"> |
| | | <view class="Search_item_label">ç产工å</view> |
| | | <view class="Search_item_content"> |
| | | <view class="tag"> |
| | | <view class="tag_item" :class="{'tag_active': item.isActive}" v-for="(item, i) in factoryList" :key="item.id" @click="changeTags(i, item.id)">{{item.name}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="Search_item"> |
| | | <view class="Search_item_label">å·¥åº</view> |
| | | <view class="Search_item_content"> |
| | | <view class="tag"> |
| | | <view class="tag_item" :class="{'tag_active': item.isActive}" v-for="(item, i) in data" :key="item.id" @click="changeTag(i)">{{item.name}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | </Search> |
| | | <view class="content_search_x"></view> |
| | | <LabelSelection :TagList="tagList" :isShow="true" @change="clickTag" /> |
| | | </view> |
| | | <view class="content_total" :style="{top: top}">å
±{{listData.total}}æ¡æ°æ®</view> |
| | | <view class="content_list"> |
| | | <scroll-view |
| | | :refresher-enabled="true" |
| | | :refresher-triggered="isLoading" |
| | | @refresherrefresh="onRefresh" |
| | | refresher-background="#fff" |
| | | @scrolltolower="getLists" |
| | | scroll-y |
| | | :style="{height: height}"> |
| | | <view class="content_list_item" v-for="item in lists" :key="item.id" @click="jump(item)"> |
| | | <view class="content_list_item_top"> |
| | | <view class="content_list_item_top_left"> |
| | | <text v-if="item.mmodel">{{item.mmodel.name}}</text> |
| | | <view class="content_list_item_top_left_tag" v-if="item.urgent">ä¼å
{{item.urgent}}</view> |
| | | <view class="content_list_item_top_left_tag warning" v-if="item.paused === 1">å</view> |
| | | </view> |
| | | <view class="content_list_item_top_right"> |
| | | <text v-if="item.status === 0">å·²çæ</text> |
| | | <text v-if="item.status === 1">å·²åå¸</text> |
| | | <text v-if="item.status === 2">å·²æ¤å</text> |
| | | <text v-if="item.status === 3">已忶</text> |
| | | <text v-if="item.status === 4">å·²åé
</text> |
| | | <text v-if="item.status === 5">å·²æå</text> |
| | | <text v-if="item.status === 6">å·²å®å·¥</text> |
| | | <text v-if="item.status === 7">å·²å
¥åº</text> |
| | | <text v-if="item.status === 8">å·²å
³é</text> |
| | | <!-- <text class="warning" v-if="item.status === 0">å¾
åå¸</text>--> |
| | | <!-- <text class="green" v-else-if="item.status === 1 || item.status === 4">ç产ä¸</text>--> |
| | | <!-- <text class="info" v-else-if="item.status === 6 || item.status === 7 || item.status === 3 || item.status === 8">已宿</text>--> |
| | | </view> |
| | | </view> |
| | | <view class="content_list_item_content"> |
| | | <view class="content_list_item_content_item" v-if="item.pmodel"> |
| | | <view class="content_list_item_content_item_label">å·¥åºåç§°ï¼</view> |
| | | <view class="content_list_item_content_item_nr">{{item.pmodel.name}}</view> |
| | | </view> |
| | | <view class="content_list_item_content_item"> |
| | | <view class="content_list_item_content_item_label">è®¡åæ¥æï¼</view> |
| | | <view class="content_list_item_content_item_nr">{{item.planDate}}</view> |
| | | </view> |
| | | <view class="content_list_item_content_item"> |
| | | <view class="content_list_item_content_item_label">ç©æç¼ç ï¼</view> |
| | | <view class="content_list_item_content_item_nr" v-if="item.mmodel">{{item.mmodel.code}}</view> |
| | | </view> |
| | | <view class="content_list_item_content_item"> |
| | | <view class="content_list_item_content_item_label">è®¡åæ°éï¼</view> |
| | | <view class="content_list_item_content_item_nr" v-if="item.umodel">{{item.num}}{{item.umodel.name}}</view> |
| | | </view> |
| | | <view class="content_list_item_content_item"> |
| | | <view class="content_list_item_content_item_label">çäº§æ¹æ¬¡ï¼</view> |
| | | <view class="content_list_item_content_item_nr">{{item.batch}}</view> |
| | | </view> |
| | | <view class="content_list_item_content_item"> |
| | | <view class="content_list_item_content_item_label">å叿¥æï¼</view> |
| | | <view class="content_list_item_content_item_nr">{{item.publishDate ? item.publishDate : '-'}}</view> |
| | | </view> |
| | | <view class="content_list_item_content_item"> |
| | | <view class="content_list_item_content_item_label">计å人åï¼</view> |
| | | <view class="content_list_item_content_item_nr">{{item.usermodel.realname}}</view> |
| | | </view> |
| | | <view class="content_list_item_content_item"> |
| | | <view class="content_list_item_content_item_label">ç产工åï¼</view> |
| | | <view class="content_list_item_content_item_nr">{{item.fmodel.name}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | <!-- éæ©æ¥æ --> |
| | | <!-- <u-calendar :show="timeShow" mode="range" @confirm="timeConfirm" @close="timeShow = false"></u-calendar> --> |
| | | <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5" |
| | | rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import Search from '@/components/Search.vue' |
| | | import LabelSelection from '@/components/LabelSelection.vue' |
| | | import { getList, pageCount } from '@/util/api/PlanningAPI' |
| | | import { getWorkingProcedure, getOrganization } from '@/util/api' |
| | | import { gsdate } from '@/util/utils.js' |
| | | export default { |
| | | components: { Search, LabelSelection }, |
| | | data() { |
| | | return { |
| | | height: '', |
| | | top: '', |
| | | listData: { |
| | | capacity: 10, |
| | | page: 0, |
| | | total: 0, |
| | | startDate: '', |
| | | endDate: '', |
| | | procedureIds: [], |
| | | departIds: '', |
| | | mixParam: '', |
| | | cateIds: null |
| | | }, |
| | | tagList: [ |
| | | { |
| | | id: '', |
| | | name: 'å
¨é¨', |
| | | num: '0' |
| | | }, |
| | | { |
| | | id: '0', |
| | | name: 'å¾
åå¸', |
| | | num: '0' |
| | | }, |
| | | { |
| | | id: '1,4', |
| | | name: 'ç产ä¸', |
| | | num: '0' |
| | | }, |
| | | { |
| | | id: '6, 7, 3, 8', |
| | | name: '已宿', |
| | | num: '0' |
| | | } |
| | | ], |
| | | data: [], // å·¥åºæ°æ® |
| | | factoryList: [], // å·¥å |
| | | finished: true, |
| | | loading: false, |
| | | refreshing: false, |
| | | timeShow: false, |
| | | lists: [], |
| | | isLoading: false |
| | | }; |
| | | }, |
| | | onReady() { |
| | | var that = this |
| | | this.$nextTick(() => { |
| | | uni.createSelectorQuery().in(this).select('.content_search').boundingClientRect((rect) => { |
| | | that.height = `calc(100vh - ${rect.height + 80}px)` |
| | | that.top = `${rect.height}px` |
| | | }).exec() |
| | | }) |
| | | }, |
| | | onLoad() { |
| | | this.getLists() |
| | | this.getOrganizations() |
| | | }, |
| | | methods: { |
| | | // åæ¢å·¥åº |
| | | changeTag(i) { |
| | | this.data[i].isActive = !this.data[i].isActive |
| | | }, |
| | | // 跳转 |
| | | jump(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/planDetails/planDetails?id=${item.id}` |
| | | }) |
| | | }, |
| | | // è·å头é¨ç»ä»¶é«åº¦ |
| | | getHeight(height) { |
| | | this.height = height |
| | | }, |
| | | // 䏿巿° |
| | | async onRefresh() { |
| | | if (this.isLoading) return; |
| | | this.isLoading = true; |
| | | await this.getLists() |
| | | await this.pageCounts() |
| | | this.isLoading = false; |
| | | }, |
| | | // éç½® |
| | | reset() { |
| | | this.listData.page = 0 |
| | | this.finished = false |
| | | this.lists = [] |
| | | this.listData.mixParam = '' |
| | | this.listData.startDate = '' |
| | | this.listData.endDate = '' |
| | | this.listData.procedureIds = [] |
| | | if (this.factoryList.length > 0) { |
| | | this.listData.departIds = this.factoryList[0].id |
| | | } |
| | | if (this.data.length > 0) { |
| | | this.data.forEach(item => { item.isActive = false }) |
| | | } |
| | | this.getLists() |
| | | this.pageCounts() |
| | | }, |
| | | // æ¥æç¡®å® |
| | | timeConfirm(val) { |
| | | this.listData.startDate = val.startDate |
| | | this.listData.endDate = val.endDate |
| | | this.timeShow = false |
| | | }, |
| | | // 忢工å |
| | | changeTags(i, id) { |
| | | this.listData.departIds = id |
| | | this.getWorkingProcedures(id) |
| | | this.factoryList.forEach((item, index) => { |
| | | if (index === i) { |
| | | item.isActive = true |
| | | } else { |
| | | item.isActive = false |
| | | } |
| | | }) |
| | | }, |
| | | // æå¼æ¥ææä»¶ |
| | | openDate() { |
| | | this.timeShow = true |
| | | }, |
| | | // æç´¢ |
| | | searchInput(val) { |
| | | this.listData.mixParam = val |
| | | this.listData.page = 0 |
| | | this.finished = false |
| | | this.lists = [] |
| | | this.getLists() |
| | | }, |
| | | // ç¹å»æ ç¾æç´¢ |
| | | clickTag(ids) { |
| | | // ids ? ids.split(',') : [] |
| | | this.listData.cateIds = ids ? ids.split(',') : [] |
| | | 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() |
| | | }, |
| | | // è·å计ååè¡¨æ°æ® |
| | | getLists() { |
| | | if (!this.finished) { |
| | | this.loading = true |
| | | this.listData.page = this.listData.page += 1 |
| | | getList({ |
| | | capacity: this.listData.capacity, |
| | | model: { |
| | | mixParam: this.listData.mixParam, |
| | | startDate: this.listData.startDate, |
| | | endDate: this.listData.endDate, |
| | | procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [], |
| | | factoryId: this.listData.departIds, |
| | | statusList: this.listData.cateIds |
| | | // this.listData.cateIds ? this.listData.cateIds.split(',') : [] |
| | | }, |
| | | page: this.listData.page, |
| | | sorts: [ |
| | | { |
| | | direction: 'ASC', |
| | | property: 'publishDate' |
| | | } |
| | | ] |
| | | }).then(res => { |
| | | this.loading = false |
| | | this.listData.total = res.data.total |
| | | if (this.refreshing) { |
| | | this.lists = [] |
| | | this.refreshing = false; |
| | | } |
| | | if (res.code === 200 && res.data.records.length !== 0) { |
| | | if (this.lists.length === 0) { |
| | | this.lists = res.data.records |
| | | } else { |
| | | this.lists.push(...res.data.records) |
| | | } |
| | | } else { |
| | | this.finished = true |
| | | } |
| | | }).catch(err => { |
| | | this.loading = false |
| | | this.finished = true |
| | | if (this.refreshing) { |
| | | this.lists = [] |
| | | this.refreshing = false; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .content { |
| | | .content_search { |
| | | width: 100%; |
| | | padding: 30rpx; |
| | | background: white; |
| | | position: sticky; |
| | | top: 0; |
| | | z-index: 999; |
| | | box-sizing: border-box; |
| | | .Search_item { |
| | | margin-bottom: 40rpx; |
| | | .Search_item_label { |
| | | font-size: 30rpx; |
| | | font-weight: 500; |
| | | color: #222222; |
| | | } |
| | | .Search_item_content { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-top: 30rpx; |
| | | .tag { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | .tag_active { |
| | | background: $nav-color !important; |
| | | color: #ffffff !important; |
| | | } |
| | | .tag_item { |
| | | padding: 22rpx 26rpx; |
| | | box-sizing: border-box; |
| | | background: #F2F2F2; |
| | | border-radius: 8rpx; |
| | | font-size: 26rpx; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-right: 22rpx; |
| | | margin-bottom: 22rpx; |
| | | } |
| | | } |
| | | text { |
| | | font-size: 26rpx; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | margin: 0 30rpx; |
| | | } |
| | | .Search_item_content_a { |
| | | padding: 20rpx 0; |
| | | flex: 1; |
| | | background: #F7F7F7; |
| | | border-radius: 8rpx; |
| | | border: 1rpx solid #EEEEEE; |
| | | font-size: 26rpx; |
| | | font-weight: 400; |
| | | color: #B2B2B2; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | } |
| | | .content_search_x { |
| | | height: 24rpx; |
| | | } |
| | | } |
| | | .content_list { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .content_list_item { |
| | | width: 100%; |
| | | background: white; |
| | | padding: 30rpx; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-direction: column; |
| | | border-bottom: 1rpx solid #ececec; |
| | | .content_list_item_top { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | .content_list_item_top_left { |
| | | display: flex; |
| | | align-items: center; |
| | | width: 80%; |
| | | text { |
| | | font-size: 32rpx; |
| | | font-weight: 500; |
| | | color: #333333; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | .warning { |
| | | background: $nav-stateColor5 !important; |
| | | } |
| | | .content_list_item_top_left_tag { |
| | | flex-shrink: 0; |
| | | padding: 5rpx 10rpx; |
| | | background: $nav-stateColor4; |
| | | border-radius: 8rpx; |
| | | font-size: 22rpx; |
| | | font-weight: 400; |
| | | color: #FFFFFF; |
| | | margin-left: 16rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | .content_list_item_top_right { |
| | | font-size: 26rpx; |
| | | font-weight: 400; |
| | | flex-shrink: 0; |
| | | margin-left: 10rpx; |
| | | .warning { |
| | | color: $nav-stateColor5 !important; |
| | | } |
| | | .green { |
| | | color: $nav-stateColor6 !important; |
| | | } |
| | | .info { |
| | | color: $nav-stateColor3 !important; |
| | | } |
| | | } |
| | | } |
| | | .content_list_item_content { |
| | | padding: 24rpx 30rpx; |
| | | background: #F7F7F7; |
| | | border-radius: 16rpx; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | margin-top: 32rpx; |
| | | .content_list_item_content_item { |
| | | width: 50%; |
| | | display: flex; |
| | | margin-top: 24rpx; |
| | | &:nth-child(1) { |
| | | margin-top: 0 !important; |
| | | } |
| | | &:nth-child(2) { |
| | | margin-top: 0 !important; |
| | | } |
| | | .content_list_item_content_item_label { |
| | | font-size: 24rpx; |
| | | font-weight: 400; |
| | | color: #666666; |
| | | flex-shrink: 0; |
| | | } |
| | | .content_list_item_content_item_nr { |
| | | font-size: 24rpx; |
| | | font-weight: 400; |
| | | color: #222222; |
| | | margin-right: 10rpx; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .content_total { |
| | | width: 100%; |
| | | height: 80rpx; |
| | | padding: 24rpx 30rpx; |
| | | background: #F7F7F7; |
| | | font-size: 24rpx; |
| | | font-weight: 400; |
| | | box-sizing: border-box; |
| | | color: #666666; |
| | | position: sticky; |
| | | z-index: 99; |
| | | } |
| | | } |
| | | </style> |