This commit is contained in:
2025-08-19 17:35:29 +08:00
parent ba34cfb459
commit 65fb5633a1
6 changed files with 39 additions and 31 deletions

View File

@@ -40,7 +40,8 @@ export default {
setJxtTime: this.$store.getters.setJxtTime,
pageNo: this.$store.getters.pageNo,
iskb: '',
secCode: this.$store.getters.secCode
secCode: this.$store.getters.secCode,
selSecArr: this.$store.getters.selSecArr
}
this.$store.dispatch('setConfig', obj)
this.$router.push('/setup')

View File

@@ -15,20 +15,16 @@ export const updateMaterialInfo = (code, w) => post('api/bmMaterial/updateMateri
single_weight: w
})
// export const getSect = () => {
// let res = {
// data: [
// { value: '01', label: 'code1' },
// { value: '02', label: 'code2' },
// { value: '03', label: 'code3' },
// { value: '04', label: 'code4' }
// ]
// }
// return res
// }
export const getStorageList = () => {
let res = {
data: [
{ value: '01', label: 'code1' },
{ value: '02', label: 'code2' },
{ value: '03', label: 'code3' },
{ value: '04', label: 'code4' }
]
}
return res
}
// 仓库列表 - 配置页
export const getSect = (code, w) => post('api/pda/iosIn/getSect', {
page: '1',
size: '10',
stor_code: 'XB'
})
// export const getStorageList = () => post('api/pda/iosIn/getStorageList', {})

View File

@@ -46,7 +46,7 @@
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:label="item.text"
:value="item.value"
:disabled="isOptionDisabled(item.value)"
>
@@ -66,7 +66,7 @@
</template>
<script>
import { getSect } from '@js/getData2.js'
import { getStorageList } from '@js/getData2.js'
export default {
data () {
return {
@@ -84,7 +84,7 @@ export default {
// { value: '03', label: 'code3' },
// { value: '04', label: 'code4' }
// ],
selectedValues: [], // 存储选中的value值
selectedValues: this.$store.getters.selSecArr || [], // 存储选中的value值
value: this.$store.getters.pageNo,
secCode: this.$store.getters.secCode || ''
}
@@ -94,7 +94,7 @@ export default {
displayText () {
return this.selectedValues.map(value => {
const item = this.options2.find(opt => opt.value === value)
return item ? item.label : ''
return item ? item.value : ''
}).filter(Boolean).join(', ')
},
// 检查选项是否禁用已选满2个且当前未选中时禁用
@@ -106,7 +106,10 @@ export default {
}
},
created () {
this._getSect()
this._getStorageList()
// if (this.$store.getters.secCode === '') {
// this._getStorageList()
// }
if (this.$store.getters.iskb === '02') {
console.log(this.$store.getters.iskb, 1)
if (this.value === '01' || !this.secCode) {
@@ -120,13 +123,14 @@ export default {
// this._config()
},
methods: {
async _getSect () {
console.log(111)
async _getStorageList () {
try {
let res = await getSect()
let res = await getStorageList()
if (res) {
this.options2 = res.data
// console.log(this.options2, 666)
if (this.$store.getters.secCode) {
return
}
if (this.options2.length >= 2) {
this.selectedValues = [this.options2[0].value, this.options2[1].value]
} else if (this.options2.length > 0) {
@@ -166,7 +170,8 @@ export default {
setJxtTime: this.setJxtTime * 1000,
pageNo: this.value,
iskb: '1',
secCode: this.displayText
secCode: this.displayText,
selSecArr: this.selectedValues
}
console.log()
this.$store.dispatch('setConfig', obj)

View File

@@ -238,7 +238,8 @@ export default {
setJxtTime: this.$store.getters.setJxtTime,
pageNo: this.$store.getters.pageNo,
iskb: '02',
secCode: this.$store.getters.secCode
secCode: this.$store.getters.secCode,
selSecArr: this.$store.getters.selSecArr
}
this.$store.dispatch('setConfig', obj)
this._synthesizeInfo()

View File

@@ -113,7 +113,8 @@ export default {
setJxtTime: this.$store.getters.setJxtTime,
pageNo: this.$store.getters.pageNo,
iskb: '02',
secCode: this.$store.getters.secCode
secCode: this.$store.getters.secCode,
selSecArr: this.$store.getters.selSecArr
}
this.$store.dispatch('setConfig', obj)
this._synthesizeInfo()

View File

@@ -11,7 +11,8 @@ const state = {
setJxtTime: getStore('setJxtTime') || 3000,
pageNo: getStore('pageNo') || '01',
iskb: getStore('iskb') || '',
secCode: getStore('secCode') || ''
secCode: getStore('secCode') || '',
selSecArr: getStore('selSecArr') || []
}
const actions = {
@@ -22,6 +23,7 @@ const actions = {
setStore('pageNo', res.pageNo)
setStore('iskb', res.iskb)
setStore('secCode', res.secCode)
setStore('selSecArr', res.selSecArr)
commit(types.COM_CONFIG, res)
}
}
@@ -32,7 +34,8 @@ const getters = {
setJxtTime: state => state.setJxtTime,
pageNo: state => state.pageNo,
iskb: state => state.iskb,
secCode: state => state.secCode
secCode: state => state.secCode,
selSecArr: state => state.selSecArr
}
const mutations = {
@@ -43,6 +46,7 @@ const mutations = {
state.pageNo = res.pageNo
state.iskb = res.iskb
state.secCode = res.secCode
state.selSecArr = res.selSecArr
}
}