物料入库加功能

This commit is contained in:
2026-02-28 16:11:04 +08:00
parent 6d842b5377
commit 3503e76631
3 changed files with 72 additions and 13 deletions

View File

@@ -10,6 +10,7 @@
<view class="zd-col-17">
<search-box
v-model="val1"
@handleChange="handleChange1"
/>
</view>
</view>
@@ -94,7 +95,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {regionList, handheldBlanking, selectMaterial} from '@/utils/getData2.js'
import {regionList, getSD01GroupLog, handheldBlanking} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -111,7 +112,8 @@
index1: '',
index2: '',
disabled: false,
dataList: []
dataList: [],
flag: false
};
},
onLoad (options) {
@@ -121,9 +123,19 @@
methods: {
handleChange (e) {
if (e) {
this._selectMaterial()
if (this.val1) {
this._getSD01GroupLog(this.val1, e)
}
}
},
handleChange1 (e) {
if (e) {
if (this.val2) {
this._getSD01GroupLog(e, this.val2)
}
}
},
selectChange (e) {
this.dataList = []
this.index1 = ''
@@ -136,9 +148,29 @@
this.$set(el, 'text', el.label)
})
},
async _selectMaterial () {
let res = await selectMaterial(this.val2)
this.dataList = [...res.content]
async _getSD01GroupLog (v1, v2) {
if (v1 !== 'SD01') {
return
}
try {
let current = await getSD01GroupLog(v1, v2)
if (current && current?.material) {
uni.showModal({
title: '提示',
cancelText: '取消',
confirmText: '确定',
content: '已发现近期从SD01出库的组盘信息是否自动填充',
success: (res) => {
if (res.confirm) {
this.dataList.push(...current.material)
this.flag = true
}
}
})
}
} catch (e) {
console.log(e)
}
},
addRow () {
this.dataList.push({order_code: '', material_code: '', material_qty: 0, due_date: this.getCurrentDateTime()})
@@ -151,6 +183,7 @@
this.index1 = ''
this.index2 = ''
this.disabled = false
this.flag = false
},
async _handheldBlanking () {
this.disabled = true
@@ -165,7 +198,7 @@
}
})
try {
let res = await handheldBlanking(this.index, this.val1, this.index1, this.val2, arr, this.index2)
let res = await handheldBlanking(this.index, this.val1, this.index1, this.val2, arr, this.index2, this.flag)
this.clearUp()
uni.showToast({
title: res.message,

View File

@@ -60,9 +60,17 @@ export const handheldStorehouse = (code, type) => request({
// url:'api/handheld/getRegionCode',
// data: {orderCode: code}
// })
export const handheldBlanking = (type, code, rcode, vcode, material, reg) => request({
export const handheldBlanking = (type, code, rcode, vcode, material, reg, flag) => request({
url:'api/handheld/blanking',
data: {type: type, device_code: code, region_code: rcode, vehicle_code: vcode, material: material, regionCode: reg}
data: {
type: type,
device_code: code,
region_code: rcode,
vehicle_code: vcode,
material: material,
regionCode: reg,
reentry_flag: flag
}
})
// 修改订单工序
export const fabOrders = (code) => request({
@@ -118,10 +126,10 @@ export const generateStoreInTask = (code, pcode, scode, tcode) => request({
data: {vehicle_code: code, point_code: pcode, source_vehicle_code: scode, target_vehicle_code: tcode}
})
// 物料入库-查询组盘
export const selectMaterial = (code) => request({
url:'api/handheld/selectMaterial',
data: {pointCode: code}
// 物料入库-SD01出库后重入接口
export const getSD01GroupLog = (code, vcode) => request({
url:'api/handheld/getSD01GroupLog',
data: {pointCode: code, vehicle_code: vcode}
})
// 查询托盘物料信息

View File

@@ -13,6 +13,24 @@ export const regionList = () => {
}
return res
}
export const getSD01GroupLog = () => {
let res = {
"device_code": "SD01",
"regionCode": null,
"region_Code": null,
"vehicle_code": "VEH001",
"material": [
{
"order_code": "800035316873",
"material_code": "qqqq",
"material_qty": 33,
"due_date": "2025-04-17 15:01:04"
}
]
}
return res
}
export const fabOrders = (data) => {
let res = [