123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <template>
- <view class="uni-column" style="padding: 24rpx">
- <view class="box-bg uni-row">
- <view class="input-view uni-row">
- <uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
- <input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
- </view>
- <view class="search" @click="handleSearch">
- 搜索
- </view>
- </view>
- <view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)" class="list-item">
- <view class="title-container uni-row">
- <view class="title uni-row">
- <text class="label">生产计划单号</text>
- <text class="label code">{{ item['productionPlanNo'] }}</text>
- </view>
- <view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
- <view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
- </view>
- <view class="item-info uni-row">
- <text class="label">产品描述</text>
- <text class="label right">{{ item['productDescription'] }}</text>
- </view>
- <view class="item-info uni-row">
- <text class="label">总批数</text>
- <text class="label right">{{ item['totalLotNumber'] }}</text>
- </view>
- <!-- <view class="item-info uni-row">
- <text class="label">完成批数</text>
- <text class="label right">{{ item['equiment'] }}</text>
- </view> -->
- <view class="item-info uni-row">
- <text class="label">投产数</text>
- <text class="label right">{{ item['productionQuantity'] }}</text>
- </view>
- <view class="item-info uni-row">
- <text class="label">单批量</text>
- <text class="label right">{{ item['oneLotQuantity'] }}</text>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { getPlanDetailsList } from '@/api/business/planDetails.js'
- import {
- ref
- } from 'vue'
- import {
- onReady,
- onLoad,
- onUnload,
- onPullDownRefresh
- } from '@dcloudio/uni-app'
- import {
- getToken
- } from '@/utils/auth'
- import {
- store
- } from '@/store/index.js'
- import {
- getUserProcess
- } from '@/api/process/process.js'
- const listData = ref([])
- const keywords = ref('')
- const initReqParam = ref({})
- onLoad(() => {
- console.log(store.curDeptDetails)
- initReqParam.value = {
- deptId: store.curDeptDetails
- }
- init(initReqParam.value);
- // dayworkItem数据更改后刷新数据
- uni.$on('dayworkItemUpdate', reflush);
- })
- onUnload(() => {
- // uni.$off('dayworkItemUpdate', reflush)
- })
- /**
- * 监听下拉刷新
- */
- onPullDownRefresh(() => {
- init(initReqParam.value);
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 3000);
- })
- function reflush() {
- init(initReqParam.value);
- }
- function init(data) {
- uni.showLoading({
- title: '加载中'
- });
- getPlanDetailsList({
- deptId: Number(store.curDeptDetails)
- }).then(res => {
- if(res.code == 200){
- listData.value = res.data;
- uni.hideLoading();
- }
- uni.hideLoading();
- })
- }
- function handleToBatchReporting(item) {
- store.planDetails = item
- uni.navigateTo({
- url: '/pages/batchReporting/index'
- })
- }
- function handleSearch() {
- let reqParam = {
- keywords: keywords.value
- }
- reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
- init(reqParam)
- }
- </script>
- <style lang="scss">
- $nav-height: 60rpx;
- .box-bg {
- width: 100%;
- background-color: #F5F5F5;
- padding: 5rpx 0;
- justify-content: space-around;
- align-items: center;
- .input-view {
- width: 100%;
- flex: 4;
- background-color: #f8f8f8;
- height: $nav-height;
- border: 1rpx solid #999;
- border-radius: 15rpx;
- padding: 0 15rpx;
- flex-wrap: nowrap;
- margin: 20rpx 10rpx;
- line-height: $nav-height;
- .input-uni-icon {
- line-height: $nav-height;
- }
- .nav-bar-input {
- width: 80%;
- height: $nav-height;
- line-height: $nav-height;
- padding: 0 5rpx;
- background-color: #f8f8f8;
- }
- }
- .search {
- width: 20%;
- text-align: center;
- color: #808080;
- }
- }
- .uni-column {
- background-color: rgba(245, 245, 245, 1);
- height: 100%;
- overflow: auto;
- }
- .list-item {
- background-color: #fff;
- position: relative;
- padding: 16rpx;
- padding-bottom: 24rpx;
- border-radius: 24rpx;
- margin-bottom: 24rpx;
- .title-container {
- justify-content: space-between;
- margin-top: 8rpx;
- margin-bottom: 16rpx;
- .title {
- height: 48rpx;
- align-items: center;
- .label {
- font-size: 32rpx;
- font-weight: bold;
- &.code {
- margin-left: 8rpx;
- }
- }
- }
- .tag {
- border: 1px solid #1ce5b0;
- background-color: #f6fffd;
- padding: 8rpx;
- border-radius: 8rpx;
- .label {
- color: #1ce5b0;
- font-size: 24rpx;
- }
- &.not-start {
- border: 1px solid #bbbbbb;
- background-color: #f5f5f5;
- .label {
- color: #bbbbbb;
- }
- }
- }
- }
- .item-info {
- margin-bottom: 8rpx;
- .label {
- font-size: 28rpx;
- width: 220rpx;
- color: #808080;
- &.right {
- flex: 1;
- color: #000000;
- }
- }
- }
- }
- </style>
|