Browse Source

申请出库提交拦截未输入出库数量

master
邓平艺 5 years ago
parent
commit
9cab6b5cc3
  1. 18
      canteen/pages/delivery/apply.vue
  2. 2
      supplier/pages/gonghuo/order.vue

18
canteen/pages/delivery/apply.vue

@ -191,15 +191,18 @@
if(this.contents.length <= 0) {
return this.$msg('您未选择物资')
}
let is_empty = false;
console.log("总的", this.contents)
let list = this.contents.map(item => {
if(!item.delivery_number.value){
is_empty = true;
}
if(Number(item.delivery_number.value) > item.stock) {
console.log('循环几次')
uni.showModal({
title: '温馨提示',
content: `物资:${item.material_name},仅剩${item.stock}单位库存,已超出您申请的数量,是否直接修改成出库${item.stock}单位`,
cancelColor: '#11D189',
confirmColor: '#FF0000',
confirmColor: '#11D189',
success: result => {
if(result.confirm){
this.isStock = true
@ -251,6 +254,15 @@
_api = this.API.API_EDITOUTORDER;
}
let state = ['待确认', '已确认'][_t]; //
if(is_empty){
uni.showModal({
title: '温馨提示',
content: '您有物资未填写出库数量, 请填写',
showCancel: false,
confirmColor: '#11D189'
})
return;
}
this.$http(_api, {
data: list,
state: state

2
supplier/pages/gonghuo/order.vue

@ -1,7 +1,7 @@
<template>
<view>
<view class="tabs">
<u-tabs :list="tab_list" :is-scroll="false" :current="current" bg-color="#f6f6f6" active-color="#1833F2" @change="tabsChange"></u-tabs>
<u-tabs :list="tab_list" :is-scroll="true" :current="current" bg-color="#f6f6f6" active-color="#1833F2" @change="tabsChange"></u-tabs>
</view>
<swiper :style="{height: 'calc('+ windowHeight +'px - 110rpx)', width: '750rpx'}"
:current="current" @change="swiperChange">

Loading…
Cancel
Save