|
|
@@ -1,170 +1,226 @@
|
|
|
<template>
|
|
|
-<view class="app-content">
|
|
|
- <view class="ex-page">
|
|
|
- <scroll-view scroll-y scroll-with-animation class="main-view">
|
|
|
- <view class="space-view ex-table">
|
|
|
- <block v-if="!$util.isEmpty(list.data)">
|
|
|
- <t-table :headerBackgroundColor="'#F0F2F6'">
|
|
|
- <t-tr header>
|
|
|
- <t-th><view style="width:150upx;">时间</view></t-th>
|
|
|
- <t-th>名称</t-th>
|
|
|
- <t-th><view style="width:180upx;">事项</view></t-th>
|
|
|
- <t-th>变动</t-th>
|
|
|
- <t-th>剩余</t-th>
|
|
|
- </t-tr>
|
|
|
- <t-tr v-for="(item, index) in list.data" :key="index">
|
|
|
- <t-td>
|
|
|
- <view style="width:150upx;">
|
|
|
- <view>{{ item.addTime.substr(5,11) }}</view>
|
|
|
- <view>{{item.ptStyle==1?'零售':'批发'}}</view>
|
|
|
- </view>
|
|
|
- </t-td>
|
|
|
- <t-td><view>{{item.relateName}}</view></t-td>
|
|
|
- <t-td><view style="width:180upx;">{{item.typeName}}</view></t-td>
|
|
|
- <t-td>
|
|
|
- <view>
|
|
|
- <text v-if="item.io == 1">+</text>
|
|
|
- <text v-if="item.io == 0">-</text>
|
|
|
- {{parseFloat(item.itemNum)}}
|
|
|
- </view>
|
|
|
- </t-td>
|
|
|
- <t-td><view>{{parseFloat(item.newStock)}}</view></t-td>
|
|
|
- </t-tr>
|
|
|
- </t-table>
|
|
|
- </block>
|
|
|
- <block v-else>
|
|
|
- <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
|
- </block>
|
|
|
+ <view class="app-content">
|
|
|
+ <view class="ex-page">
|
|
|
+ <view class="top-bar">
|
|
|
+ <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='选日期' />
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
+ <scroll-view scroll-y scroll-with-animation class="main-view">
|
|
|
+ <view class="space-view ex-table">
|
|
|
+ <block v-if="!$util.isEmpty(list.data)">
|
|
|
+ <t-table :headerBackgroundColor="'#F0F2F6'">
|
|
|
+ <view style="width:100%;">
|
|
|
+ <t-tr header>
|
|
|
+ <t-th><view style="width:130upx;color:#333333;font-size:30upx;font-weight:bold;">时间</view></t-th>
|
|
|
+ <t-th><view style="width:120upx;color:#333333;font-size:30upx;font-weight:bold;">名称</view></t-th>
|
|
|
+ <t-th><view style="width:190upx;color:#333333;font-size:30upx;font-weight:bold;">事项</view></t-th>
|
|
|
+ <t-th><view style="color:#333333;font-size:30upx;font-weight:bold;">变动</view></t-th>
|
|
|
+ <t-th><view style="color:#333333;font-size:30upx;font-weight:bold;">剩余</view></t-th>
|
|
|
+ </t-tr>
|
|
|
+ </view>
|
|
|
+ <view style="margin-top:20upx;">
|
|
|
+ <view v-for="(item, index) in list.data" :key="index">
|
|
|
+ <t-tr>
|
|
|
+ <t-td align="center" color="info">
|
|
|
+ <view style="width:130upx;color:#333333;font-size:28upx;" @click="goDetail(item)">
|
|
|
+ <view>{{ item.addTime.substr(5,11) }}</view>
|
|
|
+ <view>{{item.ptStyle==1?'零售':'批发'}}</view>
|
|
|
+ </view>
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <view @click="goDetail(item)"
|
|
|
+ style="width:120upx;color:#333333;font-size:25upx;word-break:break-all;">
|
|
|
+ {{item.relateName}}
|
|
|
+ </view>
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <view @click="goDetail(item)"
|
|
|
+ style="width:190upx;color:#333333;font-size:28upx;word-break:break-all;">
|
|
|
+ {{item.typeName}}
|
|
|
+ </view>
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <view style="color:#333333;font-size:30upx;" @click="goDetail(item)">
|
|
|
+ <text v-if="item.io == 1">+</text>
|
|
|
+ <text v-if="item.io == 0">-</text>
|
|
|
+ {{parseFloat(item.itemNum)}}
|
|
|
+ </view>
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <view @click="goDetail(item)" style="color:#333333;font-size:30upx;">
|
|
|
+ {{parseFloat(item.newStock)}}
|
|
|
+ </view>
|
|
|
+ </t-td>
|
|
|
+ </t-tr>
|
|
|
+ <t-tr v-if="!$util.isEmpty(item.remark)">
|
|
|
+ <td><view style="color:green;margin-left:50upx;">备注:{{ item.remark }}</view></td>
|
|
|
+ </t-tr>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </t-table>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
-</view>
|
|
|
-</template>
|
|
|
-<script>
|
|
|
-const Month = (new Date().getMonth()+1)<10?'0'+(new Date().getMonth()+1):new Date().getMonth()+1
|
|
|
-const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
|
|
|
-import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
-import SelectList from "@/components/plugin/selectList";
|
|
|
-import { getStockDetailApi } from "@/api/storehouse/stock";
|
|
|
-import { list,selectShop } from "@/mixins";
|
|
|
-import {mapActions, mapGetters} from "vuex";
|
|
|
-export default {
|
|
|
- components: { SelectList, AppWrapperEmpty},
|
|
|
- mixins: [list,selectShop],
|
|
|
- computed: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
|
|
|
- data() {
|
|
|
- return {
|
|
|
-
|
|
|
- };
|
|
|
- },
|
|
|
- onPullDownRefresh() {
|
|
|
- this.resetList();
|
|
|
- this.getStockChangeList().then(res => {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- });
|
|
|
- },
|
|
|
- onReachBottom() {
|
|
|
- if (!this.list.finished) {
|
|
|
- this.getStockChangeList().then((res) => {
|
|
|
+ </template>
|
|
|
+ <script>
|
|
|
+ const Month = (new Date().getMonth()+1)<10?'0'+(new Date().getMonth()+1):new Date().getMonth()+1
|
|
|
+ const time = `${new Date().getFullYear()}-${Month}-${new Date().getDate()}`;
|
|
|
+ import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
+ import SelectList from "@/components/plugin/selectList";
|
|
|
+ import { getStockDetailApi } from "@/api/storehouse/stock";
|
|
|
+ import { getInfoByOrderSn } from "@/api/order";
|
|
|
+ import { list,selectShop } from "@/mixins";
|
|
|
+ import {mapActions, mapGetters} from "vuex";
|
|
|
+ import DateSelect from "@/components/module/dateSelect";
|
|
|
+ export default {
|
|
|
+ components: { SelectList, AppWrapperEmpty,DateSelect},
|
|
|
+ mixins: [list,selectShop],
|
|
|
+ computed: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchTime:'',
|
|
|
+ startTime: "",
|
|
|
+ endTime: ""
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onPullDownRefresh() {
|
|
|
+ this.resetList();
|
|
|
+ this.getStockList().then(res => {
|
|
|
uni.stopPullDownRefresh();
|
|
|
});
|
|
|
- } else {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- ...mapActions(['setUserShopAll']),
|
|
|
- init() {
|
|
|
- if(this.option.name){
|
|
|
- uni.setNavigationBarTitle({ title: this.option.name })
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this.getStockList().then((res) => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
}
|
|
|
- this.getStockChangeList();
|
|
|
},
|
|
|
- getStockChangeList() {
|
|
|
- return getStockDetailApi({id:this.option.id,page: this.list.page,}).then(res => {
|
|
|
- this.completes(res);
|
|
|
- });
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['setUserShopAll']),
|
|
|
+ selectDateFn(val){
|
|
|
+ this.resetList()
|
|
|
+ this.searchTime = val.searchTime
|
|
|
+ this.startTime = val.startTime
|
|
|
+ this.endTime = val.endTime
|
|
|
+ this.getStockList()
|
|
|
+ },
|
|
|
+ init(){
|
|
|
+ if(this.option.name){
|
|
|
+ uni.setNavigationBarTitle({ title: this.option.name })
|
|
|
+ }
|
|
|
+ this.getStockList()
|
|
|
+ },
|
|
|
+ goDetail(item){
|
|
|
+ let that = this
|
|
|
+ if(item.recordType == 1){
|
|
|
+ that.pageTo({ url: '/pagesPurchase/info?orderSn='+item.orderSn})
|
|
|
+ }else if(item.recordType == 4){
|
|
|
+ that.pageTo({ url: '/pagesStorehouse/inventory/details?orderSn='+item.orderSn})
|
|
|
+ }else if(item.recordType == 5){
|
|
|
+ uni.showLoading()
|
|
|
+ getInfoByOrderSn({orderSn:item.orderSn}).then(res=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ let id = res.data.info.id ? res.data.info.id : 0
|
|
|
+ that.pageTo({ url: '/pagesOrder/detail?id='+id})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getStockList() {
|
|
|
+ return getStockDetailApi({id:this.option.id,page: this.list.page,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then(res => {
|
|
|
+ this.completes(res)
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
-</script>
|
|
|
-<style lang="scss" scoped>
|
|
|
-.ex-page {
|
|
|
- height: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- .top-bar {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
+ };
|
|
|
+ </script>
|
|
|
+ <style lang="scss" scoped>
|
|
|
+ .ex-page {
|
|
|
+ background: white;
|
|
|
+ padding-top:20upx;
|
|
|
+ height: 100%;
|
|
|
display: flex;
|
|
|
- width: 100%;
|
|
|
- // box-shadow: 0 5upx 5upx 5upx rgba($color: #000000, $alpha: 0.2);
|
|
|
- z-index: 20;
|
|
|
- .bar{
|
|
|
- width: 50%;
|
|
|
- height: 100%;
|
|
|
- text-align: center;
|
|
|
- &:nth-child(1){
|
|
|
- border-right: 1upx solid #eeeeec;
|
|
|
+ flex-direction: column;
|
|
|
+ .top-bar {
|
|
|
+ margin-bottom:30px;
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ z-index: 20;
|
|
|
+ .bar{
|
|
|
+ width: 50%;
|
|
|
+ height: 100%;
|
|
|
+ text-align: center;
|
|
|
+ &:nth-child(1){
|
|
|
+ border-right: 1upx solid #eeeeec;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .main-view {
|
|
|
- /*margin-top: 80upx;*/
|
|
|
- flex: 1;
|
|
|
- background-color: #f9fbfc;
|
|
|
- .space-view {
|
|
|
- background-color: #fff;
|
|
|
- }
|
|
|
- .ex-info {
|
|
|
- padding: 30upx;
|
|
|
- .info-cell {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 28upx;
|
|
|
- &:not(:first-child) {
|
|
|
- margin-top: 20upx;
|
|
|
- }
|
|
|
- .cell-label {
|
|
|
- width: 110upx;
|
|
|
- color: #666666;
|
|
|
- }
|
|
|
- .cell-value {
|
|
|
- margin-left: 40upx;
|
|
|
- color: #333;
|
|
|
- &.warning {
|
|
|
- color: #ffaf1d;
|
|
|
+ .main-view {
|
|
|
+ /*margin-top: 80upx;*/
|
|
|
+ flex: 1;
|
|
|
+ background-color: #f9fbfc;
|
|
|
+ .space-view {
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ .ex-info {
|
|
|
+ padding: 30upx;
|
|
|
+ .info-cell {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 28upx;
|
|
|
+ &:not(:first-child) {
|
|
|
+ margin-top: 20upx;
|
|
|
+ }
|
|
|
+ .cell-label {
|
|
|
+ width: 110upx;
|
|
|
+ color: #666666;
|
|
|
}
|
|
|
- &.success {
|
|
|
- color: #27c325;
|
|
|
+ .cell-value {
|
|
|
+ margin-left: 40upx;
|
|
|
+ color: #333;
|
|
|
+ &.warning {
|
|
|
+ color: #ffaf1d;
|
|
|
+ }
|
|
|
+ &.success {
|
|
|
+ color: #27c325;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .ex-table {
|
|
|
- ::v-deep.icon-info {
|
|
|
- color: #333333;
|
|
|
+ .ex-table {
|
|
|
+ ::v-deep.icon-info {
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .bar-view {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- padding: 0 30upx;
|
|
|
- width: 100%;
|
|
|
- height: 100upx;
|
|
|
-
|
|
|
- box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
|
- .info-view {
|
|
|
- font-size: 26upx;
|
|
|
- }
|
|
|
- .btn-view {
|
|
|
+ .bar-view {
|
|
|
display: flex;
|
|
|
- .admin-button-com {
|
|
|
- margin: 0 10upx;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 30upx;
|
|
|
+ width: 100%;
|
|
|
+ height: 100upx;
|
|
|
+
|
|
|
+ box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
|
+ .info-view {
|
|
|
+ font-size: 26upx;
|
|
|
+ }
|
|
|
+ .btn-view {
|
|
|
+ display: flex;
|
|
|
+ .admin-button-com {
|
|
|
+ margin: 0 10upx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-</style>
|
|
|
+ </style>
|