入库库区功能添加

This commit is contained in:
2023-09-20 15:32:09 +08:00
parent 91fcaebddc
commit 1b6dbddd61
5 changed files with 76 additions and 16 deletions

View File

@@ -16,9 +16,9 @@
"autoclose" : true, "autoclose" : true,
"delay" : 0 "delay" : 0
}, },
"compatible":{ "compatible" : {
"ignoreVersion":true "ignoreVersion" : true
}, },
/* */ /* */
"modules" : {}, "modules" : {},
/* */ /* */

View File

@@ -110,7 +110,7 @@
isVirtual () { isVirtual () {
this.isV = this.isV === '0' ? '1' : '0' this.isV = this.isV === '0' ? '1' : '0'
}, },
/** 选择器2 */ /** 选择器1 */
selectChange1(e) { selectChange1(e) {
this.index1 = e this.index1 = e
}, },

View File

@@ -32,6 +32,12 @@
<view class="filter_input_wraper_inn_text">虚拟库</view> <view class="filter_input_wraper_inn_text">虚拟库</view>
</view> </view>
</view> </view>
<view v-show="isV === '1'" class="filter_item">
<view class="filter_label">库区</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
</view> </view>
<view class="zd_wrapper grid-wraper"> <view class="zd_wrapper grid-wraper">
<view class="slide_new"> <view class="slide_new">
@@ -59,7 +65,7 @@
</view> </view>
</view> </view>
<view class="submit-bar"> <view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button> <button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0 || (isV === '1' && index1 === '')}" :disabled="disabled" @tap="_stConfirm">入库确认</button>
<button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @tap="_stPrint">补码</button> <button class="submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @tap="_stPrint">补码</button>
<button class="submit-button" @tap="_boxQuery(val1)">查询</button> <button class="submit-button" @tap="_boxQuery(val1)">查询</button>
</view> </view>
@@ -70,7 +76,7 @@
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import SearchBoxMx from '@/components/SearchBoxMx.vue' import SearchBoxMx from '@/components/SearchBoxMx.vue'
import {boxQuery, stConfirm, stPrint} from '@/utils/getData2.js' import {boxQuery, stConfirm, stPrint, getStorSect} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -82,12 +88,17 @@
val1: '', val1: '',
val2: '', val2: '',
isV: '0', isV: '0',
options1: [],
index1: '',
dataList: [], dataList: [],
disabled: false, disabled: false,
disabled1: false, disabled1: false,
focused: true focused: true
}; };
}, },
created () {
this._getStorSect()
},
mounted () { mounted () {
setTimeout(() => { setTimeout(() => {
uni.hideKeyboard() uni.hideKeyboard()
@@ -98,6 +109,15 @@
isVirtual () { isVirtual () {
this.isV = this.isV === '0' ? '1' : '0' this.isV = this.isV === '0' ? '1' : '0'
}, },
/** 选择器1 */
selectChange1(e) {
this.index1 = e
},
/** 库区下拉框查询 */
async _getStorSect () {
let res = await getStorSect()
this.options1 = [...res.data]
},
/** 初始化查询 */ /** 初始化查询 */
async _boxQuery (e) { async _boxQuery (e) {
let res = await boxQuery(e, '4') let res = await boxQuery(e, '4')
@@ -106,12 +126,12 @@
/** 确认 */ /** 确认 */
async _stConfirm () { async _stConfirm () {
this.disabled = true this.disabled = true
if (!this.val1 || this.dataList.length === 0) { if (!this.val1 || this.dataList.length === 0 || (this.isV === '1' && this.index1 === '')) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await stConfirm(this.dataList, this.val2, '4', this.isV, '', this.val1) let res = await stConfirm(this.dataList, this.val2, '4', this.isV, '', this.val1, this.index1)
this.disabled = false this.disabled = false
// this._boxQuery(this.val1) // this._boxQuery(this.val1)
this.val1 = '' this.val1 = ''

View File

@@ -38,6 +38,12 @@
<input type="text" class="filter_input" v-model="val3"> <input type="text" class="filter_input" v-model="val3">
</view> </view>
</view> --> </view> -->
<view v-show="isV === '1'" class="filter_item">
<view class="filter_label">库区</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
</view> </view>
<view class="zd_wrapper grid-wraper"> <view class="zd_wrapper grid-wraper">
<view class="slide_new"> <view class="slide_new">
@@ -65,7 +71,7 @@
</view> </view>
</view> </view>
<view class="submit-bar"> <view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button> <button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0 || (isV === '1' && index1 === '')}" :disabled="disabled" @tap="_stConfirm">入库确认</button>
<button class="submit-button" @tap="_boxQuery(val1)">查询</button> <button class="submit-button" @tap="_boxQuery(val1)">查询</button>
</view> </view>
</view> </view>
@@ -75,7 +81,7 @@
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import SearchBoxMx from '@/components/SearchBoxMx.vue' import SearchBoxMx from '@/components/SearchBoxMx.vue'
import {boxQuery, stConfirm} from '@/utils/getData2.js' import {boxQuery, stConfirm, getStorSect} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -88,11 +94,16 @@
val2: '', val2: '',
val3: '', val3: '',
isV: '0', isV: '0',
options1: [],
index1: '',
dataList: [], dataList: [],
disabled: false, disabled: false,
focused: true focused: true
}; };
}, },
created () {
this._getStorSect()
},
mounted () { mounted () {
setTimeout(() => { setTimeout(() => {
uni.hideKeyboard() uni.hideKeyboard()
@@ -103,6 +114,15 @@
isVirtual () { isVirtual () {
this.isV = this.isV === '0' ? '1' : '0' this.isV = this.isV === '0' ? '1' : '0'
}, },
/** 选择器1 */
selectChange1(e) {
this.index1 = e
},
/** 库区下拉框查询 */
async _getStorSect () {
let res = await getStorSect()
this.options1 = [...res.data]
},
/** 初始化查询 */ /** 初始化查询 */
async _boxQuery (e) { async _boxQuery (e) {
console.log(11) console.log(11)
@@ -112,12 +132,12 @@
/** 确认 */ /** 确认 */
async _stConfirm () { async _stConfirm () {
this.disabled = true this.disabled = true
if (!this.val1 || this.dataList.length === 0) { if (!this.val1 || this.dataList.length === 0 || (this.isV === '1' && this.index1 === '')) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await stConfirm(this.dataList, this.val2, '3', this.isV, this.val3, this.val1) let res = await stConfirm(this.dataList, this.val2, '3', this.isV, this.val3, this.val1, this.index1)
this.disabled = false this.disabled = false
// this._boxQuery(this.val1) // this._boxQuery(this.val1)
this.val1 = '' this.val1 = ''

View File

@@ -32,6 +32,12 @@
<view class="filter_input_wraper_inn_text">虚拟库</view> <view class="filter_input_wraper_inn_text">虚拟库</view>
</view> </view>
</view> </view>
<view v-show="isV === '1'" class="filter_item">
<view class="filter_label">库区</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
</view> </view>
<view class="zd_wrapper grid-wraper"> <view class="zd_wrapper grid-wraper">
<view class="slide_new"> <view class="slide_new">
@@ -59,7 +65,7 @@
</view> </view>
</view> </view>
<view class="submit-bar"> <view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0}" :disabled="disabled" @tap="_stConfirm">入库确认</button> <button class="submit-button" :class="{'btn-disabled': !val1 || dataList.length === 0 || (isV === '1' && index1 === '')}" :disabled="disabled" @tap="_stConfirm">入库确认</button>
<button class="submit-button" @tap="_boxQuery(val1)">查询</button> <button class="submit-button" @tap="_boxQuery(val1)">查询</button>
</view> </view>
</view> </view>
@@ -69,7 +75,7 @@
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import SearchBoxMx from '@/components/SearchBoxMx.vue' import SearchBoxMx from '@/components/SearchBoxMx.vue'
import {boxQuery, stConfirm} from '@/utils/getData2.js' import {boxQuery, stConfirm, getStorSect} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -81,11 +87,16 @@
val1: '', val1: '',
val2: '', val2: '',
isV: '0', isV: '0',
options1: [],
index1: '',
dataList: [], dataList: [],
disabled: false, disabled: false,
focused: true focused: true
}; };
}, },
created () {
this._getStorSect()
},
mounted () { mounted () {
setTimeout(() => { setTimeout(() => {
uni.hideKeyboard() uni.hideKeyboard()
@@ -96,6 +107,15 @@
isVirtual () { isVirtual () {
this.isV = this.isV === '0' ? '1' : '0' this.isV = this.isV === '0' ? '1' : '0'
}, },
/** 选择器1 */
selectChange1(e) {
this.index1 = e
},
/** 库区下拉框查询 */
async _getStorSect () {
let res = await getStorSect()
this.options1 = [...res.data]
},
/** 初始化查询 */ /** 初始化查询 */
async _boxQuery (e) { async _boxQuery (e) {
let res = await boxQuery(e, '1') let res = await boxQuery(e, '1')
@@ -104,12 +124,12 @@
/** 确认 */ /** 确认 */
async _stConfirm () { async _stConfirm () {
this.disabled = true this.disabled = true
if (!this.val1 || this.dataList.length === 0) { if (!this.val1 || this.dataList.length === 0 || (this.isV === '1' && this.index1 === '')) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await stConfirm(this.dataList, this.val2, '1', this.isV, '', this.val1) let res = await stConfirm(this.dataList, this.val2, '1', this.isV, '', this.val1, this.index1)
this.disabled = false this.disabled = false
// this._boxQuery(this.val1) // this._boxQuery(this.val1)
this.val1 = '' this.val1 = ''