This commit is contained in:
2025-09-10 11:05:41 +08:00
parent 6f7e10fa3f
commit eae62dfc4c
4 changed files with 261 additions and 171 deletions

View File

@@ -405,6 +405,13 @@
"navigationStyle": "custom"
}
}
,{
"path" : "pages/Material/hw-check",
"style" :
{
"navigationStyle": "custom"
}
}
,{
"path" : "pages/General/warehouse-box",
"style" :

View File

@@ -11,6 +11,7 @@
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
@@ -34,18 +35,18 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_code === pkId}">
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.task_type}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
<td>{{e.produce_time}}</td>
<td>{{e.supp_code}}</td>
<td>{{e.supp_name}}</td>
<td>{{e.bake_num}}</td>
</tr>
</tbody>
</table>
@@ -61,7 +62,8 @@
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
v-model="val2"
@handleChange="handleChange2"
/>
</view>
</view>
@@ -85,27 +87,26 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList2" :key="i" @click="toCheck(e)" :class="{'checked': e.task_code === pkId}">
<tr v-for="(e, i) in dataList2" :key="i">
<td>{{i+1}}</td>
<td>{{e.task_type}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
<td>{{e.produce_time}}</td>
<td>{{e.supp_code}}</td>
<td>{{e.supp_name}}</td>
<td>{{e.bake_num}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">确认移库</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !dataList.length || !dataList2.length}" :disabled="disabled" @tap="_materialBoxMoveConfirm">确认移库</button>
<!-- <button class="zd-col-6 button-primary" @tap="searchList">查询</button> -->
</view>
</view>
@@ -114,7 +115,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getMoveDocumentInfo, materialBoxMoveConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -127,17 +128,7 @@
val2: '',
dataList: [],
dataList2: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
mdid: '',
disabled: false
};
},
@@ -145,64 +136,60 @@
this.title = options.title
},
methods: {
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
handleChange (e) {
if (e) {
this.dataList = []
this._getMoveDocumentInfo()
}
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, this.val1)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
const dataMap = res.content
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.reload = false
handleChange2 (e) {
if (e && !this.mdid && this.dataList.length) {
this.dataList2 = []
this._getMoveDocumentInfo2()
}
},
async _getMoveDocumentInfo () {
try {
let res = await getMoveDocumentInfo('1', this.val1, this.mdid)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
this.mdid = ths.dataList[0].moveinvdtl_id
if (this.dataList.length && this.mdid) {
this._getMoveDocumentInfo2()
}
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
} catch (e) {
this.dataList = []
}
},
async _getMoveDocumentInfo2 () {
try {
let res = await getMoveDocumentInfo('2', this.val2, this.mdid)
if (res && res.data.length > 0) {
this.dataList2 = [...res.data]
} else {
this.dataList2 = []
}
} catch (e) {
this.dataList2 = []
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
},
async toSure (status) {
async _materialBoxMoveConfirm () {
this.disabled = true
if (!this.pkId) {
if (!this.dataList.length || !this.dataList2.length) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
let res = await materialBoxMoveConfirm(this.dataList, this.dataList2)
if (res) {
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.clearUp()
}
this.disabled = false
} catch (e) {

View File

@@ -1,18 +1,17 @@
<template>
<view class="zd_container">
<!-- 大料箱 - 大料箱 -->
<!-- 大料箱 - 大料箱 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-5">
<span class="filter_label">单据</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
/>
<view class="zd-col-14">
<input type="text" placeholder="输入物料关键字" class="filter_input" v-model="keyword">
</view>
<button class="mini-btn" type="primary" size="mini" @tap="_getCheckDocumentInfo">查询</button>
</view>
</view>
<view class="zd_wrapper grid-wraper">
@@ -36,30 +35,28 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_code === pkId}">
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.check_id === pkId}" @tap="toCheck(e)">
<td>{{i+1}}</td>
<td>{{e.task_type}}</td>
<td>{{e.task_type}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.check_result}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.base_qty}}</td>
<td>{{e.fac_qty}}</td>
<td>{{e.produce_time}}</td>
<td>{{e.supp_code}}</td>
<td>{{e.supp_name}}</td>
<td>{{e.bake_num}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">扫码盘点</button>
<button class="zd-col-6 button-primary" @tap="searchList">查询</button>
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">扫码盘点</button>
</view>
</view>
</template>
@@ -67,7 +64,8 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getDate} from '@/utils/utils.js'
import {getCheckDocumentInfo} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -76,89 +74,39 @@
data() {
return {
title: '',
val1: '',
val2: '',
keyword: '',
dataList: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
disabled: false
pkObj: {}
};
},
onLoad (options) {
this.title = options.title
this._getCheckDocumentInfo()
},
methods: {
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, this.val1)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
const dataMap = res.content
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.reload = false
async _getCheckDocumentInfo () {
try {
let res = await getCheckDocumentInfo(this.keyword, '1')
if (res && res.data.length > 0) {
this.dataList = [...res.data]
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
}, 1000)
} else { //停止加载
this.status = 'noMore'
} catch (e) {
this.dataList = []
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
this.pkId = this.pkId === e.check_id ? '' : e.check_id
this.pkObj = this.pkId === e.check_id ? e : {}
},
async toSure (status) {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
this.disabled = false
} catch (e) {
this.disabled = false
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateTo({
url: 'pages/Material/hw-check'
})
}
}
}

148
pages/Material/hw-check.vue Normal file
View File

@@ -0,0 +1,148 @@
<template>
<view class="zd_container">
<!-- 大料箱盘库 - 货位盘点 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">单据号</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.check_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位/载具</span>
</view>
<view class="zd-col-17">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">点位</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.struct_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料编码</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料名称</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">库存数量</span>
</view>
<view class="zd-col-16">
<input type="number" v-model="materialData.qty1" class="filter_input" disabled>
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">盘点数量</span>
</view>
<view class="zd-col-16">
<input type="number" v-model="materialData.fac_qty" class="filter_input">
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-24 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_materialBoxInventoryConfirm">确认盘点</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getInvInfoQty, materialBoxInventoryConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
materialData: {},
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
onShow () {
if (this.$store.getters.publicObj !== '') {
this.materialData = this.$store.getters.publicObj
this.$store.dispatch('setPublicObj', '')
}
},
methods: {
handleChange (e) {
if (e) {
this._getInvInfoQty()
}
},
clearUp () {
this.val1 = ''
this.disabled = false
},
async _getInvInfoQty () {
let res = await getInvInfoQty(this.val1)
this.materialData.qty1 = res.data.base_qty
this.materialData.fac_qty = res.data.base_qty
},
async _materialBoxInventoryConfirm () {
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await materialBoxInventoryConfirm(this.materialData)
if (res.code === '200') {
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
}
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
</style>