收货入库
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -103,7 +103,6 @@
|
||||
bagCode: '',
|
||||
num: null,
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
@@ -149,11 +148,18 @@
|
||||
async _getPalletAssemblyOK () {
|
||||
try {
|
||||
let res = await getPalletAssemblyOK(this.bagCode)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
if (res) {
|
||||
const existingItem = this.dataList.find(item => item.bag_code === res.data.bag_code)
|
||||
if (!existingItem) {
|
||||
this.dataList.push(res.data)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '袋码已存在,不能重复插入',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -76,8 +77,8 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button> -->
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_productionLine">呼叫agv</button>
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_productionLine">出料</button>
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_productionLine('1')">呼叫agv</button>
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_productionLine('0')">下料</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -98,7 +99,6 @@
|
||||
val2: '',
|
||||
num: null,
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
@@ -108,12 +108,19 @@
|
||||
methods: {
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.num = null
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._getGroupBucketInfo()
|
||||
}
|
||||
},
|
||||
async _getGroupBucketInfo () {
|
||||
try {
|
||||
let res = await getGroupBucketInfo(this.val1)
|
||||
@@ -127,14 +134,14 @@
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
async _productionLine () {
|
||||
async _productionLine (type) {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await productionLine(this.val1, this.val2)
|
||||
let res = await productionLine(this.val1, this.val2, type)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -66,7 +67,8 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_leftoverMaterialBack">回库</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_leftoverMaterialBack" v-if="!flag">回库</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_leftoverMaterialBack" v-if="flag">空盘退回</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -85,8 +87,8 @@
|
||||
title: '',
|
||||
val1: '',
|
||||
num: null,
|
||||
flag: false,
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
@@ -96,6 +98,8 @@
|
||||
methods: {
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.num = null
|
||||
this.flag = false
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
@@ -118,12 +122,20 @@
|
||||
// })
|
||||
}
|
||||
},
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._getGroupInfo()
|
||||
}
|
||||
},
|
||||
async _getGroupInfo () {
|
||||
try {
|
||||
let res = await getGroupInfo(this.val1)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||
if(!res.data.length) {
|
||||
this.flag = true
|
||||
}
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_code === pkId}" @tap="toCheck(e)">
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.group_id === pkId}" @tap="toCheck(e)">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{e.struct_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
@@ -64,7 +64,7 @@
|
||||
<td>{{e.qty}}</td>
|
||||
<td>{{e.qty_unit_name}}</td>
|
||||
<td>{{e.supp_name}}</td>
|
||||
<td>{{e.material_type_id}}</td>
|
||||
<td>{{e.class_name}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.material_model}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
@@ -84,7 +84,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPointInDownload, getStockGroupInfo, confirmCallMaterial} from '@/utils/getData3.js'
|
||||
import {getStockGroupInfo, confirmCallMaterial} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -102,13 +102,11 @@
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
// this._queryPointInDownload()
|
||||
},
|
||||
onShow () {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
@@ -118,8 +116,8 @@
|
||||
},
|
||||
methods: {
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.material_code ? '' : e.material_code
|
||||
this.pkObj = this.pkId === e.material_code ? e : {}
|
||||
this.pkId = this.pkId === e.group_id ? '' : e.group_id
|
||||
this.pkObj = this.pkId === e.group_id ? e : {}
|
||||
},
|
||||
toJump (name) {
|
||||
uni.navigateTo({
|
||||
@@ -134,24 +132,12 @@
|
||||
this.allCheck = false
|
||||
this.disabled = false
|
||||
},
|
||||
async _queryPointInDownload () {
|
||||
try {
|
||||
let res = await queryPointInDownload()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
async _getStockGroupInfo () {
|
||||
try {
|
||||
let res = await getStockGroupInfo('', this.materialData.material_code, this.val1)
|
||||
let res = await getStockGroupInfo('', this.materialData.material_id, this.val1)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
@@ -168,7 +154,7 @@
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await confirmCallMaterial(this.val2, '', this.pkObj)
|
||||
let res = await confirmCallMaterial(this.val2, this.pkObj)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
@@ -262,9 +262,9 @@ export const confirmCallMaterial = (pcode, row) => request({
|
||||
|
||||
// 点位取货
|
||||
// 扫码插入
|
||||
export const getPalletAssemblyOK = (search) => request({
|
||||
export const getPalletAssemblyOK = (bcode) => request({
|
||||
url:'api/pdaProduction/getPalletAssemblyOK',
|
||||
data: {search: search}
|
||||
data: {bag_code: bcode}
|
||||
})
|
||||
// 取物料
|
||||
export const takePalletMaterial = (search, rows) => request({
|
||||
@@ -295,9 +295,9 @@ export const getGroupBucketInfo = (vcode) => request({
|
||||
data: {vehicle_code: vcode}
|
||||
})
|
||||
// 下料
|
||||
export const productionLine = (vcode, pcode) => request({
|
||||
export const productionLine = (vcode, pcode, iswait) => request({
|
||||
url:'api/pdaProduction/productionLine',
|
||||
data: {vehicle_code: vcode, point_code: pcode}
|
||||
data: {vehicle_code: vcode, point_code: pcode, is_wait: iswait}
|
||||
})
|
||||
|
||||
// 收货入库
|
||||
|
||||
Reference in New Issue
Block a user