| New file |
| | |
| | | <template> |
| | | <view> |
| | | <view class="header" id="list_header"> |
| | | <view class="form"> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="right"> |
| | | <input name="HBillNo" v-model="hform.HBillNo" placeholder="请输入单据号" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">开始时间:</view> |
| | | <view class="right"> |
| | | <picker mode="date" :value="hform.HBeginDate" @change="HBeginDateChange"> |
| | | <view class="picker-overlay"></view> |
| | | <input name="HBeginDate" disabled :value="hform.HBeginDate" placeholder="请选择" /> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">结束时间:</view> |
| | | <view class="right"> |
| | | <picker mode="date" :value="hform.HEndDate" @change="HEndDateChange"> |
| | | <view class="picker-overlay"></view> |
| | | <input name="HEndDate" disabled :value="hform.HEndDate" placeholder="请选择" /> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="buttons"> |
| | | <button class="btn-a" size="mini" type="default" @tap="clear">重置</button> |
| | | <button class="btn-b" size="mini" type="default" @tap="creat">新增</button> |
| | | <button class="btn-c" size="mini" type="default" @tap="search">查询</button> |
| | | </view> |
| | | </view> |
| | | <scroll-view scroll-y="true" @scroll="scrollHandler" :scroll-top="contentScrollTop" |
| | | :style="{height: calcHeight + 'px'}" class="content"> |
| | | <view class="over" v-if="billList.length == 0"> |
| | | 暂无数据 |
| | | </view> |
| | | |
| | | <view v-else class="list" v-for="(item,index) in billList" :key="index"> |
| | | <uni-card style="margin: 10px;"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>单据号:</text>{{item["单据号"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>物料代码:</text>{{item["物料代码"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>物料名称:</text>{{item["物料名称"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>规格型号:</text>{{item["规格型号"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>计量单位:</text>{{item["计量单位"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>合格数量:</text>{{item["合格数量"]}} |
| | | </view> |
| | | <view class="detail"> |
| | | <text>不合格数量:</text>{{item["不合格数量"]}} |
| | | </view> |
| | | </view> |
| | | </uni-card> |
| | | </view> |
| | | </scroll-view> |
| | | <uni-pagination id="pagination" v-model="curPage" :pageSize="size" :total="length"></uni-pagination> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from 'dayjs'; |
| | | import { |
| | | CommonUtils |
| | | } from '../../../utils/common'; |
| | | import { |
| | | getUserInfo |
| | | } from '../../../utils/auth'; |
| | | |
| | | export default { |
| | | name: "InStockCheckBillList", |
| | | data() { |
| | | return { |
| | | contentScrollTop: 0, |
| | | contentScrollTopOld: 0, |
| | | headerHeight: 0, |
| | | paginationHeight: 0, |
| | | |
| | | curPage: 1, |
| | | size: 50, |
| | | length: 0, |
| | | |
| | | hform: { |
| | | HBillNo: "", |
| | | HBeginDate: dayjs(new Date()).subtract(30, "d").format("YYYY-MM-DD"), |
| | | HEndDate: dayjs(new Date()).format("YYYY-MM-DD") |
| | | }, |
| | | |
| | | billList: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | calcHeight: { |
| | | get() { |
| | | console.log('this.paginationHeight - this.headerHeight: ', this.paginationHeight - this |
| | | .headerHeight); |
| | | return this.paginationHeight - this.headerHeight |
| | | } |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.getDisplayPage() |
| | | }, |
| | | onReady() { |
| | | this.getScrollHeight() |
| | | }, |
| | | methods: { |
| | | getScrollHeight() { |
| | | const query = uni.createSelectorQuery().in(this) |
| | | query |
| | | .select("#list_header") |
| | | .boundingClientRect() |
| | | .select("#pagination") |
| | | .boundingClientRect() |
| | | .exec(res => { |
| | | this.headerHeight = Math.ceil(res[0].bottom) |
| | | this.paginationHeight = Math.floor(res[1].top) |
| | | }) |
| | | |
| | | }, |
| | | scrollToTop() { |
| | | this.contentScrollTop = this.contentScrollTopOld; |
| | | this.$nextTick(() => { |
| | | this.contentScrollTop = 0 |
| | | }); |
| | | }, |
| | | scrollHandler(e) { |
| | | this.contentScrollTopOld = e.detail.scrollTop |
| | | }, |
| | | creat() { |
| | | uni.navigateTo({ |
| | | url: "/pages/ZLGL/zaikujianyandan/InStockCheckBill?operationType=1" |
| | | }) |
| | | }, |
| | | search() { |
| | | getDisplayPage() |
| | | }, |
| | | clear() { |
| | | this.hform.HBillNo = "" |
| | | this.hform.HBeginDate = dayjs(new Date()).subtract(7, 'd').format("YYYY-MM-DD") |
| | | this.hform.HEndDate = dayjs(new Date()).format("YYYY-MM-DD") |
| | | }, |
| | | async getDisplayPage() { |
| | | let sWhere = ` and 日期 |
| | | BETWEEN CAST('${this.hform.HBeginDate}' AS DATE) |
| | | AND CAST('${this.hform.HEndDate}' AS DATE) |
| | | ` |
| | | if(this.hform.HBillNo){ |
| | | sWhere += ` and 单据号 like '${this.hform.HBillNo}'` |
| | | } |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: 'QC_InStockCheckBillController/getListPage', |
| | | data: { |
| | | sWhere: sWhere, |
| | | user: getUserInfo()['Czymc'], |
| | | page: this.curPage, |
| | | size: this.size |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | count, |
| | | data, |
| | | Message |
| | | } = res.data |
| | | if (count >= 0) { |
| | | console.log('data: ',data); |
| | | this.length = count |
| | | this.billList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: '获取在库检验单失败: ' + Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: '获取在库检验单失败: ' + err |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .header { |
| | | padding: 20rpx 20rpx; |
| | | } |
| | | |
| | | .form { |
| | | width: 640rpx; |
| | | } |
| | | |
| | | .form-item { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 28rpx; |
| | | padding: 6rpx 0; |
| | | |
| | | .title { |
| | | width: 180rpx; |
| | | |
| | | text { |
| | | color: red; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | |
| | | .right { |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | position: relative; |
| | | } |
| | | |
| | | .righton { |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #e4e4e4; |
| | | background-color: #e4e4e4; |
| | | } |
| | | |
| | | input { |
| | | width: 100%; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | } |
| | | |
| | | .buttons { |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | padding-top: 20rpx; |
| | | |
| | | button { |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-a { |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-b { |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-c { |
| | | background-color: #3a78ff; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | #pagination { |
| | | position: fixed; |
| | | bottom: 0; |
| | | width: 100%; |
| | | padding: 20rpx 0; |
| | | } |
| | | |
| | | .list { |
| | | width: 100%; |
| | | |
| | | .card-detail { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | line-height: 120%; |
| | | gap: 10rpx 0; |
| | | |
| | | input { |
| | | font-size: 26rpx; |
| | | } |
| | | |
| | | .detail { |
| | | // width: 50%; |
| | | box-sizing: border-box; |
| | | font-size: 26rpx; |
| | | color: #555; |
| | | padding-right: 20rpx; |
| | | |
| | | text { |
| | | color: #999; |
| | | font-size: 26rpx; |
| | | } |
| | | } |
| | | |
| | | .editable { |
| | | width: 50%; |
| | | display: inline-flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | |
| | | text { |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .sampleDestory { |
| | | border: 1px solid #acacac; |
| | | border-radius: 5rpx; |
| | | padding: 0 12rpx; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |