子卷出入站

This commit is contained in:
2022-11-09 13:30:32 +08:00
parent 4d19700411
commit ed086b9bd5
13 changed files with 306 additions and 178 deletions

View File

@@ -78,16 +78,39 @@
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !checkArr.length}" :disabled="disabled" @tap="_outConfirm">子卷出站</button>
<button class="submit-button" :class="{'btn-disabled': !index1 || !checkArr.length}" :disabled="disabled1" @tap="_outConfirm">子卷出站</button>
<button class="submit-button" @tap="showModal">出站配送</button>
<button class="submit-button" @tap="_queryMaterialInfo">查询</button>
</view>
<view v-if="active" class="msg_wrapper">
<view class="msg_box">
<view class="filter_item">
<view class="filter_label">区域</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index3" :localdata="options3" @change="selectChange3"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_label">缓存点位</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index4" :localdata="options4" @change="selectChange4"></uni-data-select>
</view>
<view class="filter_search" @tap="_conveyPointQuery">查询</view>
</view>
<view class="msg_btns">
<button class="submit-button msg_btn" @tap="cancleModal">取消</button>
<button class="submit-button msg_btn" :class="{'btn-disabled': !index4}" :disabled="disabled2" @tap="_conveyConfirm">确认</button>
</view>
</view>
</view>
<view v-if="active" class="msg_mask"></view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {devicePointQuery, queryProductArea, queryMaterialInfo4, outConfirm} from '@/utils/getData2.js'
import {devicePointQuery, queryProductArea, queryMaterialInfo4, outConfirm, conveyPointQuery, conveyConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -100,10 +123,16 @@
index1: '',
options2: [],
index2: '',
options3: [],
index3: '',
options4: [],
index4: '',
isV: '0',
dataList: [],
disabled: false,
checkArr: []
disabled1: false,
disabled2: false,
checkArr: [],
active: false
};
},
created () {
@@ -122,6 +151,12 @@
selectChange2(e) {
this.index2 = e
},
selectChange3(e) {
this.index3 = e
},
selectChange4(e) {
this.index4 = e
},
/** 点位下拉框查询 */
async _devicePointQuery () {
if (!this.val1) {
@@ -138,20 +173,29 @@
async _queryProductArea () {
let res = await queryProductArea()
this.options2 = [...res.data]
this.options3 = [...res.data]
},
/** 初始化查询 */
async _queryMaterialInfo () {
let res = await queryMaterialInfo4(this.val1, this.index2)
let res = await queryMaterialInfo4(this.index2)
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.data]
},
/** 确认 */
/** 子卷出站 */
async _outConfirm () {
this.disabled = true
this.disabled1 = true
if (!this.index1) {
uni.showToast({
title: '点位不能为空',
icon: 'none'
})
this.disabled1 = false
return
}
if (!this.checkArr.length) {
this.disabled = false
this.disabled1 = false
return
}
try {
@@ -160,17 +204,61 @@
title: res.message,
icon: 'none'
})
this.disabled = false
this.disabled1 = false
this.checkArr = []
this.isV = '0'
this._queryMaterialInfo()
} catch (e) {
this.disabled = false
this.disabled1 = false
}
},
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
},
/** 缓存点位查询 */
async _conveyPointQuery () {
let res = await conveyPointQuery(this.index3)
this.options4 = [...res.data]
},
/** 显示弹窗 */
showModal () {
this.active = true
this.index3 = this.index2
},
cancleModal () {
this.disabled2 = false
this.index3 = ''
this.index4 = ''
this.active = false
},
/** 出站配送接口 */
async _conveyConfirm () {
this.disabled2 = true
if (!this.index4) {
uni.showToast({
title: '请选择缓存点位',
icon: 'none'
})
this.disabled2 = false
return
}
try {
let res = await conveyConfirm(this.index4)
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled2 = false
this.index3 = ''
this.index4 = ''
this.active = false
} catch (e) {
this.disabled2 = false
this.index3 = ''
this.index4 = ''
this.active = false
}
}
}
}