123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <template>
- <view class="ground-wrap">
- <qs-scanlistener @scan="scan"></qs-scanlistener>
- <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入或扫描入库单号" @iconClick="iconClick" :focus="true"
- @input="input" @blur="blur" @confirm="confirm">
- </uni-easyinput>
- <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
- <view class="list-item" v-for="(item,index) in dataList" :key="index" @click="itemDetails(item)">
- <view class="list-data">
- <text class="text-label">单据编号:</text>
- <text class="text-cont">{{item.id_instock}}</text>
- </view>
- <view class="list-data">
- <text class="text-label">供应商:</text>
- <text class="text-cont">{{item.lykf}}</text>
- </view>
- <view class="list-data">
- <text class="text-label">商品数量:</text>
- <text class="text-cont">{{item.qty}}</text>
- </view>
- <view class="list-data">
- <text class="text-label">单据时间:</text>
- <text class="text-cont">{{item.rq}}</text>
- </view>
- <!-- <view class="list-data">
- <text class="text-label">到货时间:</text>
- <text class="text-cont">{{item.daohuoTime}}</text>
- </view> -->
- <view class="status-text">{{item.flag}}</view>
- <!-- <view class="time-text">1小时前</view> -->
- </view>
- </z-paging>
- </view>
- </template>
- <script>
- import {
- listData
- } from "../home/list.js";
- import {
- mapState,
- mapMutations,
- mapActions
- } from 'vuex';
- import {
- debounced
- } from '@/utils/debounced.js';
- import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js'
- export default {
- mixins: [ZPMixin],
- data() {
- return {
- title: 'Hello',
- value1: "",
- value: "",
- dataList: [],
- inputVal: "",
- codeVal: "",
- confirmVal: "",
- changeVal: "",
- listData: listData
- }
- },
- onLoad() {
- },
- computed: {
- ...mapState(['groundData'])
- },
- onShow() {
- uni.$once('update', function(data) {
- // uni.redirectTo({
- // url: '/pages/grounding/grounding' //写你的路径
- // });
- })
- },
- mounted() {
- },
- methods: {
- ...mapActions(['getGroundData']),
- ...mapMutations(['setMentItemData']),
- queryList(pageNo, pageSize) {
- this.getGroundData({
- type: ""
- });
- },
- //跳转上架详情
- itemDetails(item) {
- this.setMentItemData([item]);
- uni.navigateTo({
- url: '/pages/groundetials/groundetials',
- success: function(res) {}
- });
- },
- input(e) {
- this.$nextTick(() => {
- this.value = e;
- this.inputVal = e;
- })
- this.getGroundData({
- id_instock: e,
- type: ""
- })
- },
- iconClick(e) {
- console.log(e, '点击搜索拿到的数据');
- },
- blur(e) {
- this.$nextTick(() => {
- this.value = e.target.value;
- })
- },
- confirm(e) {
- this.$nextTick(() => {
- this.value = e;
- this.confirmVal = e;
- })
- },
- scan(code) {
- this.codeVal = code;
- this.$nextTick(() => {
- this.value = code;
- this.$debounced(this.getGroundData({
- id_instock: code,
- type: ""
- }), 2000)
- })
- }
- },
- watch: {
- groundData(newData, flodData) {
- this.$refs.paging.complete(newData);
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .ground-wrap {
- width: 100%;
- height: 100%;
- padding: 20rpx;
- box-sizing: border-box;
- background-color: #F1F1F1;
- .list-item {
- width: 100%;
- height: 260rpx;
- margin-top: 10rpx;
- border: 2rpx solid #BDBDBD;
- padding: 20rpx 20rpx 20rpx 50rpx;
- box-sizing: border-box;
- position: relative;
- background-color: #fff;
- border-radius: 20rpx;
- .list-data {
- width: 70%;
- height: 40rpx;
- line-height: 40rpx;
- margin-top: 10rpx;
- .text-label {
- color: rgba(16, 16, 16, 1);
- font-size: 28rpx;
- font-family: PingFangSC-medium;
- }
- .text-cont {
- color: rgba(16, 16, 16, 1);
- font-size: 28rpx;
- font-family: PingFangSC-regular;
- }
- }
- .status-text {
- width: 100rpx;
- height: 40rpx;
- position: absolute;
- right: 20rpx;
- top: 30rpx;
- font-family: PingFangSC-semiBold;
- font-size: 28rpx;
- color: rgba(71, 73, 161, 0.86);
- }
- .time-text {
- width: 100rpx;
- height: 40rpx;
- position: absolute;
- right: 20rpx;
- bottom: 25rpx;
- font-family: PingFangSC-semiBold;
- font-size: 28rpx;
- color: rgba(71, 73, 161, 0.86);
- }
- }
- }
- uni-page-body {
- width: 100%;
- height: 100%;
- }
- </style>
|