修改功能

This commit is contained in:
2025-06-24 16:25:43 +08:00
parent 9beb17b531
commit ae24e7283b
4 changed files with 64 additions and 30 deletions

View File

@@ -9,7 +9,7 @@
<span class="filter_label">仓库</span>
</view>
<view class="zd-col-17 filter_select">
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
<uni-data-select v-model="formData.storCode" :localdata="options"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
@@ -17,7 +17,7 @@
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-17 filter_select">
<input type="text" class="filter_input" v-model="val1">
<input type="text" class="filter_input" v-model="formData.materialCode">
</view>
</view>
<view class="zd-row border-bottom">
@@ -25,7 +25,7 @@
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-17 filter_select">
<input type="text" class="filter_input" v-model="val3">
<input type="text" class="filter_input" v-model="formData.vehicleCode">
</view>
</view>
<view class="zd-row border-bottom">
@@ -33,7 +33,7 @@
<span class="filter_label">仓位编码</span>
</view>
<view class="zd-col-17 filter_select">
<input type="text" class="filter_input" v-model="val4">
<input type="text" class="filter_input" v-model="formData.structCode">
</view>
</view>
<view class="zd-row border-bottom">
@@ -41,7 +41,7 @@
<span class="filter_label">物料批次</span>
</view>
<view class="zd-col-17 filter_select">
<input type="text" class="filter_input" v-model="val2">
<input type="text" class="filter_input" v-model="formData.pcsn">
</view>
</view>
</view>
@@ -93,12 +93,14 @@
data() {
return {
title: '',
val1: '',
formData: {
storCode: 'FStockId',
materialCode: '',
vehicleCode: '',
structCode: '',
pcsn: ''
},
options: [{value: 'FStockPallet', text: '托盘库'}, {value: 'FStockId', text: '料箱库'}],
index: 'FStockId',
val2: '',
val3: '',
val4: '',
dataList: [],
pkId: '',
pkObj: {},
@@ -116,6 +118,9 @@
},
onLoad (options) {
this.title = options.title
if (this.$store.getters.formData !== '') {
this.formData = this.$store.getters.formData
}
},
methods: {
searchList () {
@@ -124,7 +129,7 @@
this._structattrPage()
},
async _structattrPage () {
let res = await structattrPage(this.pageNum + '', this.pageSize + '', this.index, this.val1, true, this.val2, this.val3, this.val4)
let res = await structattrPage(this.pageNum + '', this.pageSize + '', this.formData.storCode, this.formData.materialCode, true, this.formData.pcsn, this.formData.vehicleCode, this.formData.structCode)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
@@ -156,8 +161,14 @@
this.pkObj = this.pkId === e.id ? e : {}
},
toEmpty () {
this.index = ''
this.val1 = ''
this.formData = {
storCode: 'FStockId',
materialCode: '',
vehicleCode: '',
structCode: '',
pcsn: ''
}
this.$store.dispatch('setFormData', '')
this.dataList = []
this.pageNum = 1
this.pkId = ''
@@ -165,6 +176,7 @@
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
this.$store.dispatch('setFormData', this.formData)
uni.navigateBack()
}
}

View File

@@ -98,8 +98,9 @@
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1|| !val2 || !val3 || (val2 === val3)}" :disabled="disabled" @tap="toSure">拣选确认</button>
<button :class="isChecked1 ? 'zd-col-5' : 'zd-col-6'" class="button-default" @tap="clearUp">清空</button>
<button v-if="isChecked1" class="zd-col-8 button-primary" :class="{'button-info': !val1|| !val2 || !val3 || (val2 === val3)}" :disabled="disabled" @tap="handlePrint">标签打印</button>
<button class="button-primary" :class="{'button-info': !val1|| !val2 || !val3 || (val2 === val3) || (isChecked1 && !isPrintSuccessful), 'zd-col-8': isChecked1,'zd-col-16': !isChecked1}" :disabled="disabled" @tap="toSure">拣选确认</button>
</view>
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="pop-line"></view>
@@ -142,7 +143,8 @@
isChecked1: true,
data: {},
disabled: false,
show: false
show: false,
isPrintSuccessful: false
};
},
onLoad (options) {
@@ -194,9 +196,27 @@
this.isChecked1 = true
this.disabled = false
this.show = false
this.isPrintSuccessful = false
},
handlePrint () {
this.disabled = true
if (!this.val1|| !this.val2 || !this.val3) {
this.disabled = false
return
}
if (this.val2 === this.val3) {
uni.showToast({
title: '出库和入库料箱不能相同',
icon: 'none'
})
this.disabled = false
return
}
let data = Object.assign({}, this.data, {lxCode: this.val2})
this.toPrint(data)
},
toSure () {
if (!this.val1|| !this.val2 || !this.val3) {
if (!this.val1|| !this.val2 || !this.val3 || (this.isChecked1 && !this.isPrintSuccessful)) {
return
}
if (this.val2 === this.val3) {
@@ -209,13 +229,7 @@
this.show = true
},
toConfirm () {
if (this.isChecked1) {
this.disabled = true
let data = Object.assign({}, this.data, {lxCode: this.val2})
this.toPrint(data)
} else {
this._savePickTask()
}
this._savePickTask()
},
async _savePickTask () {
this.disabled = true
@@ -281,9 +295,8 @@
title: '打印成功',
icon: 'none'
})
if (this.isChecked1) {
this._savePickTask()
}
this.disabled = false
this.isPrintSuccessful = true
}
}
}

View File

@@ -1,11 +1,13 @@
import * as types from '../types'
const state = {
publicObj: '',
publicArr: ''
publicArr: '',
formData: ''
}
const getters = {
publicObj: state => state.publicObj,
publicArr: state => state.publicArr
publicArr: state => state.publicArr,
formData: state => state.formData
}
const actions = {
setPublicObj ({commit}, res) {
@@ -13,6 +15,9 @@ const actions = {
},
setPublicArr ({commit}, res) {
commit(types.PUBLIC_ARR, res)
},
setFormData ({commit}, res) {
commit(types.FORM_DATA, res)
}
}
const mutations = {
@@ -21,6 +26,9 @@ const mutations = {
},
[types.PUBLIC_ARR] (state, res) {
state.publicArr = res
},
[types.FORM_DATA] (state, res) {
state.formData = res
}
}
export default {

View File

@@ -11,4 +11,5 @@ export const SAVE_TOKEN = 'SAVE_TOKEN'
* data
*/
export const PUBLIC_OBJ = 'PUBLIC_OBJ'
export const PUBLIC_ARR = 'PUBLIC_ARR'
export const PUBLIC_ARR = 'PUBLIC_ARR'
export const FORM_DATA = 'FORM_DATA'