123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- <template>
- <view v-if="isMaskShow" class="mask">
- </view>
- <view class="uni-column"
- style="height: 100%; background-color: #f5f5f5;padding: 8px;position: fixed;left: 0;right: 0;">
- <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-if="listData.length == 0" style="color: #999;margin: 50% auto;">
- <text>暂无批次</text>
- </view>
- <view v-else class="scroll-container" style="padding-bottom: 150rpx">
- <view v-for="(item, index) in listData" :key="index" class="list-item"
- @click="handleToreportingForWork(item)">
- <view class="item-info uni-row">
- <text class="label">外协单:</text>
- <text class="label right">{{ item.formCode }}</text>
- </view>
- <view class="item-info uni-row">
- <text class="label">外协商:</text>
- <text class="label right">{{ item.supplierName }}</text>
- </view>
- <view class="item-info uni-row">
- <text class="label">带箱方式:</text>
- <text class="label right">{{ item.packagingMethod == '0' ? '原箱' : '新箱' }}</text>
- </view>
- <view class="item-info uni-row">
- <text class="label">箱子数量:</text>
- <text class="label right">{{ item.carrierCount }}</text>
- </view>
- <view class="status-btn uni-row">
- <view class=" uni-row">
- <button class="reporting-tag" size="mini" @click.stop="handleCarriers(item)">箱号详情</button>
- </view>
- </view>
- </view>
- <uni-load-more v-if="total > 0" iconType="auto" :content-text="contentText" :status="status"
- @clickLoadMore="clickLoadMore" />
- </view>
- <!-- <uni-section title="外协单列表" type="line">
- <uni-list border-full>
- <uni-list-item v-for="(item, index) in listData" :key="index" class="list-item"
- @click="handleToreportingForWork(item)">
- </uni-list-item>
- </uni-list>
- </uni-section> -->
- </view>
- </template>
- <script setup>
- import {
- normalizeProps,
- reactive,
- onMounted,
- ref
- } from 'vue'
- import {
- onLoad,
- onReady,
- onUnload,
- onShow
- } from '@dcloudio/uni-app'
- import {
- getOutsourceOrderList
- } from '@/api/business/outsource.js'
- import {
- store
- } from '@/store/index.js'
- import {
- toHHmmss
- } from '@/utils/common.js'
- import {
- onPullDownRefresh
- } from "@dcloudio/uni-app"
- const turnoverApplicationDialog = ref(null)
- const selectProduction = ref(null)
- const lotDialog = ref(null)
- const listData = ref([])
- const curPlan = ref(null)
- const bizDayworkObj = ref({})
- const bottomStatus = ref(false) // 底部按钮显示
- const paging = ref();
- const reqParam = ref(null);
- const total = ref(0)
- const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态
- const keywords = ref(null)
- const contentText = ref({
- contentdown: '查看更多',
- contentrefresh: '加载中',
- contentnomore: '没有更多'
- })
- const status = ref("more")
- // 在数据中定义一个变量来控制遮罩层的显示
- const isMaskShow = ref(false);
- const queryParams = ref({
- orderByColumn: 'createTime',
- isAsc: 'descending',
- pageNum: 1,
- pageSize: 10,
- })
- onLoad(() => {
- })
- // 页面下拉刷新操作
- onPullDownRefresh(() => {
- uni.stopPullDownRefresh();
- reflush();
- })
- onShow(() => {
- reflush();
- });
- function reflush() {
- getList()
- }
- function handleCarriers(item) {
- uni.navigateTo({
- url: "/pages/outsourcedReturnCheck/carriers",
- success: (res) => {
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- data: item
- })
- }
- })
- }
- function clickLoadMore() {
- console.log('clickLoadMore')
- loadMore()
- }
- function loadMore() {
- console.log('loadMore')
- if (keywords.value != null && keywords.value != '') {
- queryParams.value.keywords = keywords.value
- } else {
- queryParams.value.keywords = null;
- }
- if ((queryParams.value.pageNum * queryParams.value.pageSize) >= total.value) {
- status.value = 'no-more'
- return
- }
- queryParams.value.pageNum = queryParams.value.pageNum + 1
- getOutsourceOrderList(queryParams.value).then(res => {
- if (res.code === 200) {
- // console.log(res)
- listData.value.push(...res.rows)
- total.value = res.total
- console.log(res.rows.length)
- if (res.rows.length === 0) {
- status.value = 'no-more'
- queryParams.value.pageNum = queryParams.value.pageNum - 1
- }
- console.log(queryParams.value.pageNum)
- } else {
- total.value = 0
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- }
- }).catch(err => {
- console.log(err)
- })
- }
- function getList() {
- if (keywords.value != null && keywords.value != '') {
- queryParams.value.keywords = keywords.value
- } else {
- queryParams.value.keywords = null;
- }
- queryParams.value.pageNum = 1;
- getOutsourceOrderList(queryParams.value).then(res => {
- // console.log(res)
- if (res.code === 200) {
- listData.value = res.rows
- total.value = res.total
- if (total.value > listData.value.length) {
- status.value = 'more'
- }
- } else {
- total.value = 0
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- }
- }).catch(err => {
- console.log(err)
- })
- }
- function handleSearch() {
- getList()
- }
- </script>
- <style lang="scss">
- $nav-height: 60rpx;
- /* 遮罩层样式 */
- .mask {
- position: fixed;
- /* 固定定位,覆盖整个屏幕 */
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.3);
- /* 黑色背景,透明度30% */
- display: flex;
- justify-content: center;
- /* 水平居中 */
- align-items: center;
- /* 垂直居中 */
- z-index: 1000;
- /* 确保遮罩层在其他元素之上 */
- }
- .box-bg {
- width: 94%;
- background-color: #F5F5F5;
- padding: 5rpx 16rpx;
- justify-content: space-around;
- align-items: center;
- margin: 24rpx auto 0;
- .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: 0 10rpx 0;
- 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;
- }
- }
- .list-title {
- width: 100%;
- margin-top: 16rpx;
- height: 64rpx;
- line-height: 64rpx;
- align-items: center;
- margin-left: 32rpx;
- .label {
- font-size: 32rpx;
- margin-right: 24rpx;
- }
- .icon-gear {
- font-size: 56rpx;
- }
- }
- .switch {
- margin-top: -8rpx;
- transform: scale(0.7);
- }
- .scroll-container {
- width: 92%;
- margin: 24rpx auto 0 auto;
- height: calc(90% - 100rpx);
- overflow: auto;
- }
- .list-item {
- background-color: #fff;
- position: relative;
- padding: 16rpx;
- padding-bottom: 24rpx;
- margin-bottom: 24rpx;
- border-radius: 24rpx;
- .title-container {
- 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;
- }
- &.finished {
- border: 1px solid #BBBBBB;
- background-color: #F5F5F5;
- .label {
- color: #BBBBBB;
- }
- }
- &.turnover {
- border: 1px solid #FF7901;
- background-color: #F6FFFD;
- .label {
- color: #FF7901;
- }
- }
- }
- }
- .item-info {
- margin-bottom: 8rpx;
- .label {
- font-size: 28rpx;
- width: 220rpx;
- color: #808080;
- &.right {
- flex: 1;
- color: #000000;
- }
- }
- }
- .status-btn {
- justify-content: flex-end;
- align-items: center;
- .turnover-tag {
- padding-right: 12rpx;
- padding-left: 12rpx;
- border-radius: 8rpx;
- border: 1rpx solid #FF7901;
- background-color: #FF7901;
- font-size: 28rpx;
- color: #FFFFFF;
- }
- .reporting-tag {
- padding-right: 12rpx;
- padding-left: 12rpx;
- border-radius: 8rpx;
- margin-left: 16rpx;
- border: 1rpx solid #1684fc;
- background-color: #1684fc;
- font-size: 28rpx;
- color: #FFFFFF;
- }
- }
- }
- .bottom {
- height: 10%;
- position: fixed;
- right: 0;
- bottom: 0;
- left: 0;
- height: 100rpx;
- border-top: 1px solid #999999;
- padding: 16rpx 32rpx;
- align-items: center;
- background-color: #fff;
- justify-content: space-evenly;
- .start-batch-btn {
- flex: 1;
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 8rpx;
- color: #FFFFFF;
- font-size: 28rpx;
- }
- }
- </style>
|