出入库

This commit is contained in:
2023-04-12 20:07:02 +08:00
parent a22f301eff
commit ccd0c28b84
8 changed files with 243 additions and 184 deletions

View File

@@ -121,8 +121,8 @@ uni-button:after {
}
.grid-table thead tr th{
font-size: 15px;
line-height: 35px;
padding: 0 5px;
line-height: 18px;
padding: 5px 5px;
background-color: #e1e1e1;
}
.grid-table thead tr th:first-child{
@@ -141,10 +141,10 @@ uni-button:after {
border-left: 1px solid #e1e1e1;
}
.grid-table td {
height: 35px;
line-height: 35px;
/* height: 35px; */
line-height: 18px;
font-size: 15px;
padding: 0 5px;
padding: 5px 5px;
}
.status-wrap {
width: 100%;
@@ -228,3 +228,20 @@ uni-button:after {
color: #fff;
overflow: hidden;
}
.icon_unchecked {
color: #fff;
width: 24px;
height: 24px;
background-color: #fff;
font-size: 20px;
line-height: 24px;
text-align: center;
border: 1px solid #bbb;
}
.icon_checked {
color: #ff6a00;
border: 1px solid #ff6a00;
}
.bgr{
border-color: #ff6a00;
}

View File

@@ -89,7 +89,9 @@
{
"path": "pages/management/MaterList",
"style": {
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
}
}
],

View File

@@ -20,8 +20,8 @@
</view>
</view>
<view class="confirm-button-wrap confirm-button-wrap-c">
<button class="confirm-button" @tap="toSearch">点位解绑</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !index1}" :disabled="disabled" @tap="toSure">全部解绑</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !index1}" :disabled="disabled1" @tap="toSure1">点位解绑</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !index1}" :disabled="disabled2" @tap="toSure2">全部解绑</button>
</view>
</view>
</view>
@@ -31,7 +31,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getCacheLine, inOutExceptionInstQuery, inOutExceptionInstConfirm} from '@/utils/getData2.js'
import {getCacheLine, releasepoint} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -39,12 +39,12 @@
},
data() {
return {
options1: [{text: 'A1', value: 'A1'}, {text: 'A2', value: 'A2'}],
index1: 'A1',
options1: [],
index1: '',
val1: '',
dataList: [],
pkId: '',
disabled: false
disabled1: false,
disabled2: false
};
},
methods: {
@@ -52,67 +52,37 @@
selectChange1(e) {
this.index1 = e
},
toSearch () {
this.dataList = []
this.pkId = ''
this._inOutExceptionInstQuery()
toSure1 () {
this.disabled1 = true
if (!this.index1 || !this.val1) {
this.disabled1 = false
return
}
this._releasepoint('one')
},
async _getCacheLine (id) {
let res = await getCacheLine(id)
this.options2 = [...res]
toSure2 () {
this.disabled2 = true
if (!this.index1 || !this.val1) {
this.disabled2 = false
return
}
this._releasepoint('all')
},
async _inOutExceptionInstQuery () {
let res = await inOutExceptionInstQuery(this.index2)
this.dataList = [...res]
},
async toSure () {
this.disabled = true
if (!this.pkId) {
uni.showToast({
title: '请选择',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index2) {
uni.showToast({
title: '请选择缓存线',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index3) {
uni.showToast({
title: '请选择位置类型',
icon: 'none'
})
this.disabled = false
return
}
if (!this.val1) {
uni.showToast({
title: '请扫满箱码',
icon: 'none'
})
this.disabled = false
return
}
async _releasepoint (type) {
try {
let res = await inOutExceptionInstConfirm(this.index2, this.val1, this.pkId, this.index3)
this.disabled = false
this.toSearch()
let res = await inOutExceptionInstConfirm(this.index1, this.val1, type)
this.disabled1 = false
this.disabled2 = false
this.index1 = ''
this.val1 = ''
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
this.disabled1 = false
this.disabled2 = false
}
},
toRadio (e) {
this.pkId = this.pkId === e.position_code ? '' : e.position_code
}
}
}

View File

@@ -19,16 +19,15 @@
</view>
</view>
<view class="confirm-button-wrap">
<button class="confirm-button" @tap="toSearch">查询</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !pkId}" :disabled="disabled" @tap="toSelect">选择订单</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !pkId || !index2 || !val1 || !index3}" :disabled="disabled" @tap="toSure">入库确认</button>
<button class="confirm-button" @tap="toDelect">清空</button>
<button class="confirm-button" @tap="toSelect">选择订单</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !index1 || !val1 || dataList.length === 0}" :disabled="disabled" @tap="toSure">入库确认</button>
</view>
</view>
<view class="grid-wrap">
<table class="grid-table">
<thead>
<tr>
<th>选择</th>
<th>订单行号</th>
<th>规格</th>
<th>入库数量</th>
@@ -37,15 +36,12 @@
</tr>
</thead>
<tbody>
<tr v-for="e in dataList" :key="e.position_code" @click="toRadio(e)">
<td>
<view class="iconfont icon-check" :class="{'icon-checked': pkId === e.position_code}"></view>
</td>
<td>{{e.cacheline_code}}</td>
<td>{{e.position_code}}</td>
<td>{{e.vehicle_code}}</td>
<td></td>
<td></td>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.order_line_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.in_qty}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
</tr>
</tbody>
</table>
@@ -56,7 +52,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getCacheLine, inOutExceptionInstQuery, inOutExceptionInstConfirm} from '@/utils/getData2.js'
import {getCacheLine, InstoreOrder} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -72,21 +68,20 @@
disabled: false
};
},
created() {
onLoad() {
if (this.$store.getters.publicArr) {
this.dataList = this.$store.getters.publicArr
}
},
methods: {
/** 选择器1 */
selectChange1(e) {
this.index1 = e
},
toSearch () {
toDelect () {
this.dataList = []
this.pkId = ''
this._inOutExceptionInstQuery()
},
async _getCacheLine (id) {
let res = await getCacheLine(id)
this.options2 = [...res]
this.$store.dispatch('setPublicArr', '')
},
async _inOutExceptionInstQuery () {
let res = await inOutExceptionInstQuery(this.index2)
@@ -94,25 +89,9 @@
},
async toSure () {
this.disabled = true
if (!this.pkId) {
if (!this.index1) {
uni.showToast({
title: '请选择',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index2) {
uni.showToast({
title: '请选择缓存线',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index3) {
uni.showToast({
title: '请选择位置类型',
title: '请选择入库点',
icon: 'none'
})
this.disabled = false
@@ -120,16 +99,26 @@
}
if (!this.val1) {
uni.showToast({
title: '请扫满箱码',
title: '请输入载具号',
icon: 'none'
})
this.disabled = false
return
}
if (this.dataList.length === 0) {
uni.showToast({
title: '请选择订单信息',
icon: 'none'
})
this.disabled = false
return
}
try {
let res = await inOutExceptionInstConfirm(this.index2, this.val1, this.pkId, this.index3)
let res = await InstoreOrder(this.index1, this.val1, this.dataList)
this.disabled = false
this.toSearch()
this.index1 = ''
this.val1 = ''
this.toDelect()
uni.showToast({
title: res.message,
icon: 'none'
@@ -138,15 +127,10 @@
this.disabled = false
}
},
toRadio (e) {
this.pkId = this.pkId === e.position_code ? '' : e.position_code
},
toSelect () {
if (!this.pkId) {
uni.navigateTo({
url: '/pages/management/MaterList'
})
}
uni.navigateTo({
url: '/pages/management/MaterList'
})
}
}
}

View File

@@ -11,7 +11,7 @@
</view>
<view class="search-item search-item-btns">
<button class="confirm-button" @tap="toSearch">查询</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !pkId || !index2 || !val1}" :disabled="disabled" @tap="toSure">确认</button>
<button class="confirm-button" :class="{'confirm-button_disabled': checkArr.length === 0}" :disabled="disabled" @tap="toSure">确认</button>
</view>
</view>
</view>
@@ -29,27 +29,28 @@
</tr>
</thead>
<tbody>
<tr v-for="e in dataList" :key="e.position_code" @click="toRadio(e)">
<tr v-for="e in dataList" :key="e.sale_code" :class="{'checked': e.checked}">
<td>
<view class="iconfont icon-check" :class="{'icon-checked': pkId === e.position_code}"></view>
<view class="iconfont icon_unchecked" :class="{'icon_checked': e.checked}" @tap="toCheck(e)">&#xe608;</view>
</td>
<td>{{e.cacheline_code}}</td>
<td>{{e.position_code}}</td>
<td>{{e.vehicle_code}}</td>
<td></td>
<td></td>
<td></td>
<td>{{e.order_line_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.sale_qty}}</td>
<td><input type="number" class="search-input-l" :class="{'bgr': e.bgr === true}" v-model="e.in_qty"></td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
</tr>
</tbody>
</table>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getCacheLine, inOutExceptionInstQuery, inOutExceptionInstConfirm} from '@/utils/getData2.js'
import {orderSearch} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -60,71 +61,79 @@
val1: '',
dataList: [],
pkId: '',
disabled: false
disabled: false,
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
checkArr: []
};
},
methods: {
toSearch () {
this.dataList = []
this.pkId = ''
this._inOutExceptionInstQuery()
this.pageNum = 1
this._orderSearch()
},
async _getCacheLine (id) {
let res = await getCacheLine(id)
this.options2 = [...res]
/** 初始化查询 */
async _orderSearch () {
let res = await orderSearch(this.val1, this.pageNum + '', this.pageSize + '')
this.totalCount = res.totalElements
if (res.totalElements > 0) {
res.content.map(el => {
this.$set(el, 'checked', false)
this.$set(el, 'bgr', false)
this.$set(el, 'in_qty', '0.000')
})
const dataMap = res.content
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.reload = false
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
},
async _inOutExceptionInstQuery () {
let res = await inOutExceptionInstQuery(this.index2)
this.dataList = [...res]
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._orderSearch()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
async toSure () {
this.disabled = true
if (!this.pkId) {
uni.showToast({
title: '请选择',
icon: 'none'
let flag = false
this.dataList.map(el => {
if (el.checked && (Number(el.in_qty) < 0 || el.in_qty === '')) {
this.$set(el, 'bgr', true)
flag = true
}
})
this.disabled = false
return
}
if (!this.index2) {
uni.showToast({
title: '请选择缓存线',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index3) {
uni.showToast({
title: '请选择位置类型',
icon: 'none'
})
this.disabled = false
return
}
if (!this.val1) {
uni.showToast({
title: '请扫满箱码',
icon: 'none'
})
this.disabled = false
return
}
try {
let res = await inOutExceptionInstConfirm(this.index2, this.val1, this.pkId, this.index3)
this.disabled = false
this.toSearch()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
if (flag) {
return
}
if (this.checkArr.length) {
this.$store.dispatch('setPublicArr', this.checkArr)
uni.redirectTo({
url: '/pages/management/FinishedInStore'
})
}
},
toRadio (e) {
this.pkId = this.pkId === e.position_code ? '' : e.position_code
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
},
goIn () {
uni.redirectTo({

View File

@@ -109,3 +109,74 @@ export const deleteBox = (obj) => request({
url:'api/cacheLineHand/deleteBox',
data: obj
})
/** 物料列表 */
// 根据订单获取订单信息
// export const orderSearch = (page, size, order) => request({
// url:'api/pda/finishproduct/order',
// data: {
// order: order,
// page: page,
// size: size
// }
// })
export const orderSearch = (page, size, order) => {
let res = {
"content": [
{
"sale_id": "1638477659967197184",
"plandeliver_date": "",
"sale_type": "YBO1",
"produce_seq": "1",
"order_line_code": "abe23eb6-d906-11ed-aaf6-20283eb8db7f",
"remark": "",
"is_success": "0",
"update_time": "2023-03-22 17:48:10",
"material_spec": "M1/2",
"update_optname": "管理员",
"create_id": "1",
"sale_qty": "2060",
"sale_code": "0022058857",
"cust_name": "",
"material_name": "紫铜直通连接帽\\CG\\M1/2\\ZM-BA40104",
"seq_no": "100",
"qty_unit_id": "1638470541201510400",
"create_time": "2023-03-22 17:48:10",
"unit_name": "PC",
"cust_code": "",
"material_id": "1528699594626699264",
"cust_id": "",
"status": "10",
"create_name": "管理员",
"update_optid": "1",
"material_code": "24005459",
"in_qty": '0.000',
"checked": true
}, {sale_code: '1'}
],
"totalElements": 14
}
return res
}
/** 成品入库 */
// 入库
export const InstoreOrder = (point, code, arr) => request({
url:'api/pda/finishproduct/in',
data: {
point: point,
vehicle_code: code,
arr: arr
}
})
/** 发货确认 */
// 解绑
export const releasepoint = (point, code, option) => request({
url:'api/pda/finishproduct/releasepoint',
data: {
point: point,
vehicle_code: code,
option: option
}
})

View File

@@ -1,18 +1,23 @@
import * as types from '../types'
const state = {
publicObj: ''
publicObj: '',
publicArr: ''
}
const getters = {
publicObj: state => state.publicObj
publicObj: state => state.publicObj,
publicArr: state => state.publicArr
}
const actions = {
setPublicObj ({commit}, res) {
commit(types.PUBLIC_OBJ, res)
},
setPublicArr ({commit}, res) {
commit(types.PUBLIC_ARR, res)
}
}
const mutations = {
[types.PUBLIC_OBJ] (state, res) {
state.publicObj = res
[types.PUBLIC_ARR] (state, res) {
state.publicArr = res
}
}
export default {

View File

@@ -7,4 +7,5 @@ export const COM_CONFIG = 'COM_CONFIG'
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
export const DEL_USER_INFO = 'DEL_USER_INFO'
export const PUBLIC_OBJ = 'PUBLIC_OBJ'
export const PUBLIC_ARR = 'PUBLIC_ARR'
export const SAVE_TOKEN = 'SAVE_TOKEN'