123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <view class="order-list content">
- <view class="swiper-box">
- <template v-if="content.materialShelves.length">
- <view class="order-card shelf-card" v-for="item in content.materialShelves" :key="item.id">
- <view class="order-info">
- <p class="info-line">
- <text class="label">货架:</text>
- <text class="info">{{item.shelf}}</text>
- </p>
- <p class="info-line">
- <text class="label">货层:</text>
- <text class="info">{{item.floor}}</text>
- </p>
- <p class="info-line">
- <text class="label">货位:</text>
- <text class="info">{{item.seat}}</text>
- </p>
- <p class="info-line">
- <text class="label">附加码:</text>
- <text class="info">{{item.sign}}</text>
- </p>
- <p class="info-line">
- <text class="label">当前库存:</text>
- <text class="info">{{item.shelfNum}}</text>
- </p>
- <p class="info-line">
- <text class="label">盘点数量:</text>
- <u-input class="info" type="number"
- suffixIcon="edit-pen"
- border="none"
- :clearable="false"
- v-model="item.inventoryNum">
- </u-input>
- </p>
- <p class="info-line">
- <text class="label">盘盈盘亏:</text>
- <text class="info">{{item.inventoryNum?(item.inventoryNum - item.shelfNum):''}}</text>
- </p>
- </view>
- </view>
- </template>
- <template v-else>
- <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
- </u-empty>
- </template>
- </view>
- <view class="btn-wrap" >
- <u-button type="primary" color='#4680F9' @click="submit">{{$t('base.common.submit')}}</u-button>
- </view>
- </view>
- </template>
- <script>
- import {saveInventory} from '../../api/stock'
- export default {
- components:{
- },
- data() {
- return {
- content:{},
- };
- },
- onLoad(options) {
- this.content = JSON.parse(options.content)
- this.content.materialShelves.forEach(item=>{
- item.inventoryNum = item.shelfNum
- })
- },
- methods: {
- submit(){
- let num = 0
- this.content.materialShelves.forEach(item=>{
- item.inventoryNum = Number(item.inventoryNum)
- num+=item.inventoryNum
- })
- this.content.totalNum = num
- saveInventory(this.content).then(res=>{
- if(res.data.code == 0){
- uni.showModal({
- title: '提示',
- content: '保存成功',
- showCancel: false,
- success: ({ confirm, cancel }) => {
- if(confirm){
- uni.navigateBack({ delta: 1 })
- }
- }
- })
- }
- })
- }
- },
- };
- </script>
- <style>
- /* #ifndef APP-NVUE */
- view {
- display: flex;
- box-sizing: border-box;
- flex-direction: column;
- }
- page {
- box-sizing: border-box;
- /* padding: 40rpx 40rpx 80rpx; */
- height: 100%;
- }
- /* #endif*/
- </style>
- <style lang="scss" scoped>
- @import '../../common/css/public.scss';
- .order-list {
- padding-bottom: 160rpx;
- background-color: #f8f8f8;
- .qrcode-wrap{
- padding: 24rpx;
- text-align: center;
- .info-line{
- text-align: center;
- font-size: 32rpx;
- margin-top: 24rpx;
- }
- }
- }
- .swiper-box{
- padding:24rpx;
- }
- .popupShow {
- overflow: hidden;
- position: fixed;
- }
- .picker-card{
- padding: 32rpx 32rpx 144rpx;
- position: relative;
- height: 100%;
- overflow-y: scroll;
- display: block;
- .card-oper{
- position: absolute;
- width: 100%;
- bottom: 0;
- left:0;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- padding: 24rpx;
- .btn{
- width: 100%;
- }
- }
- }
- .shelf-card{
- margin: 0 0 24rpx;
- display: block;
- .order-info{
- flex-direction: row;
- flex-wrap: wrap;
- .info-line{
- width: 50%;
- .label{
- width: 120rpx;
- }
- }
- }
- }
- .btn-wrap{
- position: fixed;
- bottom: 0;
- padding: 32rpx;
- width: 100%;
- z-index: 200;
- background-color: #fff;
- }
- </style>
|