|
|
@@ -0,0 +1,332 @@
|
|
|
+<template>
|
|
|
+<view class="app-content">
|
|
|
+ <view class="order-page">
|
|
|
+ <view class="top-view">
|
|
|
+ <view class="top-row">
|
|
|
+ <view class="info-item">
|
|
|
+ </view>
|
|
|
+ <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='时间' />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="shop-list">
|
|
|
+ <block v-if="!$util.isEmpty(inOrderList)">
|
|
|
+ <inItemData v-for="(item, index) in inOrderList" :key="index" :info="item" :isEdit="true" :isCheck="item.checked" @click="checkItemEvent" ></inItemData>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(inOrderList)" />
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+ <view :class="device == 'ios' ? 'ios-bar-view':'android-bar-view'">
|
|
|
+ <template>
|
|
|
+ <view class="info-view">
|
|
|
+ <view class="details-select" @click="checkAll()" >
|
|
|
+ <button class="admin-button-com blue middle" v-if="isAllCheck">全不选</button>
|
|
|
+ <button class="admin-button-com blue middle" v-else>全选</button>
|
|
|
+ </view>
|
|
|
+ 已选 <text class="price">{{ selectList.length }}</text>笔
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <view class="btn-view">
|
|
|
+ <button :class="['admin-button-com', 'blue']" @click="confirmData">提交盘点</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import AppWrapperEmpty from "@/components/app-wrapper-empty"
|
|
|
+import inItemData from "./inSelectItem"
|
|
|
+import { getStockInListApi,createStockInPdItem } from "@/api/storehouse/stock"
|
|
|
+import DateSelect from "@/components/module/dateSelect"
|
|
|
+import ModalModule from "@/components/plugin/modal"
|
|
|
+import { list } from "@/mixins"
|
|
|
+import { mapGetters} from "vuex";
|
|
|
+export default {
|
|
|
+ components: { AppWrapperEmpty, ModalModule,inItemData,DateSelect },
|
|
|
+ mixins: [list],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ inOrderList: [],
|
|
|
+ listLoading: false,
|
|
|
+ isAllCheck: false,
|
|
|
+ isModel: false,
|
|
|
+ payWayindex:0,
|
|
|
+ payWay:0,
|
|
|
+ searchTime:'',
|
|
|
+ startTime:'',
|
|
|
+ endTime:'',
|
|
|
+ device:'android'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onPullDownRefresh() {
|
|
|
+ this.initData().then(res => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this.initData().then(res => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad(){
|
|
|
+ this.initData().then(res => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ this.device = uni.getSystemInfoSync().platform
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getLoginInfo"]),
|
|
|
+ selectList() {
|
|
|
+ let list = [];
|
|
|
+ if (this.inOrderList) {
|
|
|
+ for (const item of this.inOrderList) {
|
|
|
+ if (item.checked) {
|
|
|
+ list.push(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ selectList () {
|
|
|
+ if (this.selectList.length === this.inOrderList.length) {
|
|
|
+ this.isAllCheck = true
|
|
|
+ } else {
|
|
|
+ this.isAllCheck = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ selectDateFn(val){
|
|
|
+ this.searchTime = val.searchTime
|
|
|
+ this.startTime = val.startTime
|
|
|
+ this.endTime = val.endTime
|
|
|
+ this.initData().then(res => {
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async initData() {
|
|
|
+ const {data: { list,moreData }} = await getStockInListApi({status:'',page: this.list.page})
|
|
|
+ if (moreData == 0) {
|
|
|
+ this.list.finished = true
|
|
|
+ } else {
|
|
|
+ ++this.list.page
|
|
|
+ }
|
|
|
+ this.inOrderList = list.map(ele => {
|
|
|
+ return {...ele,checked: false}
|
|
|
+ })
|
|
|
+ },
|
|
|
+ checkAll() {
|
|
|
+ this.isAllCheck = !this.isAllCheck
|
|
|
+ if (this.isAllCheck) {
|
|
|
+ this.inOrderList.map(ele => { ele.checked = true })
|
|
|
+ } else {
|
|
|
+ this.inOrderList.map(ele => { ele.checked = false })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkItemEvent(item) {
|
|
|
+ for (let index = 0; index < this.inOrderList.length; index++) {
|
|
|
+ const element = this.inOrderList[index].id;
|
|
|
+ if (element == item.id) {
|
|
|
+ this.$set(this.inOrderList, index, {...this.inOrderList[index],checked: !this.inOrderList[index].checked})
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmData() {
|
|
|
+ if (this.$util.isEmpty(this.selectList)){
|
|
|
+ this.$msg('请选择入库单')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let ids = this.selectList.map(ele => {
|
|
|
+ return {id:ele.id};
|
|
|
+ });
|
|
|
+ let that = this
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ createStockInPdItem({ids:JSON.stringify(ids)}).then(res=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$util.pageTo({ url: '/pagesStorehouse/inventory/select?pdType=stockInPd&shopId='+this.getLoginInfo.shopId})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.order-page {
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ background-color: #f9fbfc;
|
|
|
+ overflow: scroll;
|
|
|
+ .top-view {
|
|
|
+ padding: 30upx;
|
|
|
+ position:fixed;
|
|
|
+ width:100%;
|
|
|
+ background-color: #fff;
|
|
|
+ .top-row {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ &:not(:last-child) {
|
|
|
+ margin-bottom: 10upx;
|
|
|
+ }
|
|
|
+ .header-item {
|
|
|
+ font-size: 24upx;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+ .info-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .logo {
|
|
|
+ margin-right: 10upx;
|
|
|
+ width: 32upx;
|
|
|
+ height: 32upx;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ .name {
|
|
|
+ font-size: 28upx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .price-item {
|
|
|
+ font-size: 34upx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .shop-list {
|
|
|
+ margin-top:98upx;
|
|
|
+ padding: 20upx 30upx;
|
|
|
+ flex: 1;
|
|
|
+ padding-bottom: 190upx;
|
|
|
+ }
|
|
|
+ .ios-bar-view {
|
|
|
+ bottom: 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 30upx;
|
|
|
+ width: 100%;
|
|
|
+ height: 100upx;
|
|
|
+ background: #fff;
|
|
|
+ box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
|
+ .info-view {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #333;
|
|
|
+ font-size: 24upx;
|
|
|
+ .iconfont {
|
|
|
+ font-size: 32upx;
|
|
|
+ color: #dddddd;
|
|
|
+ }
|
|
|
+ .price {
|
|
|
+ margin: 0 3upx;
|
|
|
+ color: $redColor;
|
|
|
+ font-size: 30upx;
|
|
|
+ }
|
|
|
+ .unit {
|
|
|
+ margin: 0 3upx;
|
|
|
+ color: $redColor;
|
|
|
+ font-size: 30upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn-view {
|
|
|
+ display: flex;
|
|
|
+ .admin-button-com {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin: 0 6upx;
|
|
|
+ width: 200upx;
|
|
|
+ height: 70upx;
|
|
|
+ font-size: 30upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .android-bar-view {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 30upx;
|
|
|
+ width: 100%;
|
|
|
+ height: 100upx;
|
|
|
+ background: #fff;
|
|
|
+ box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
|
+ .info-view {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #333;
|
|
|
+ font-size: 24upx;
|
|
|
+ .iconfont {
|
|
|
+ font-size: 32upx;
|
|
|
+ color: #dddddd;
|
|
|
+ }
|
|
|
+ .price {
|
|
|
+ margin: 0 3upx;
|
|
|
+ color: $redColor;
|
|
|
+ font-size: 30upx;
|
|
|
+ }
|
|
|
+ .unit {
|
|
|
+ margin: 0 3upx;
|
|
|
+ color: $redColor;
|
|
|
+ font-size: 30upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn-view {
|
|
|
+ display: flex;
|
|
|
+ .admin-button-com {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin: 0 6upx;
|
|
|
+ width: 200upx;
|
|
|
+ height: 70upx;
|
|
|
+ font-size: 30upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .details-select {
|
|
|
+ margin-right: 20upx;
|
|
|
+ display: inline-block;
|
|
|
+ .iconweixuanzhong,
|
|
|
+ .iconxuanzhong {
|
|
|
+ font-size: 40upx !important;
|
|
|
+ }
|
|
|
+ .iconxuanzhong {
|
|
|
+ color: $mainColor !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .select-cmd_bx {
|
|
|
+ .num_bx {
|
|
|
+ margin-top:30upx;
|
|
|
+ margin-bottom:50upx;
|
|
|
+ margin-left:80upx;
|
|
|
+ view{
|
|
|
+ height: 80upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ }
|
|
|
+ input {
|
|
|
+ height: 70upx;
|
|
|
+ border: 1upx solid #dddddd;
|
|
|
+ border-radius: 4upx;
|
|
|
+ text-align: left;
|
|
|
+ margin-right: 24upx;
|
|
|
+ font-size: 35upx;
|
|
|
+ width:300upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|