仓库编码接口

This commit is contained in:
2024-08-16 10:55:26 +08:00
parent bc29ddb26f
commit e7f045da19
2 changed files with 33 additions and 4 deletions

View File

@@ -72,8 +72,9 @@
<view class="zd-col-7"> <view class="zd-col-7">
<span class="filter_label">仓库编码</span> <span class="filter_label">仓库编码</span>
</view> </view>
<view class="zd-col-24"> <view class="zd-col-24 filter_select">
<search-box v-model="currentData.stor_code"/> <!-- <search-box v-model="currentData.stor_code"/> -->
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view> </view>
</view> </view>
</view> </view>
@@ -88,7 +89,7 @@
<script> <script>
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 {groupMaterIn} from '@/utils/getData2.js' import {storList, groupMaterIn} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -98,19 +99,41 @@
return { return {
title: '', title: '',
currentData: {}, currentData: {},
options: [],
index: '',
disabled: false disabled: false
}; };
}, },
onLoad (options) { onLoad (options) {
this.title = options.title this.title = options.title
this._storList()
}, },
onShow () { onShow () {
if (this.$store.getters.publicObj !== '') { if (this.$store.getters.publicObj !== '') {
this.currentData = this.$store.getters.publicObj this.currentData = this.$store.getters.publicObj
if(this.currentData.stor_code !== '' && this.currentData.stor_code !== null && this.currentData.stor_code !== undefined) {
this.options.map(el => {
if (el.value === this.currentData.stor_code) {
this.index = el.value
}
})
}
this.$store.dispatch('setPublicObj', '') this.$store.dispatch('setPublicObj', '')
} }
}, },
methods: { methods: {
selectChange (e) {
this.index = e
},
async _storList () {
let res = await storList()
if (res.code === '200') {
this.options = [...res.content]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
}
},
toJump () { toJump () {
uni.navigateTo({ uni.navigateTo({
url: '/pages/common/mater-list?title=查询物料' url: '/pages/common/mater-list?title=查询物料'
@@ -118,6 +141,7 @@
}, },
toEmpty () { toEmpty () {
this.currentData = {} this.currentData = {}
this.index = ''
this.disabled = false this.disabled = false
}, },
async _groupMaterIn () { async _groupMaterIn () {
@@ -127,7 +151,8 @@
return return
} }
try { try {
let res = await groupMaterIn(this.currentData.stor_code, this.currentData) this.currentData.stor_code = this.index
let res = await groupMaterIn(this.index, this.currentData)
if (res.code === '200') { if (res.code === '200') {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,

View File

@@ -24,6 +24,10 @@ export const handLogin = (user, password) => request({
/** /**
* 物料组盘入库 * 物料组盘入库
*/ */
export const storList = () => request({
url:'api/pda/common/storList',
data: {}
})
export const groupMaterList = (page, size, search) => request({ export const groupMaterList = (page, size, search) => request({
url:'api/groupMater/maters', url:'api/groupMater/maters',
data: {page: page, size: size, search: search} data: {page: page, size: size, search: search}