Browse Source

修改发料记录

wms3.0_pda
niexiting 12 months ago
parent
commit
9461a42ce8
  1. 22
      api/request2.js
  2. 2
      pages/issue/coms/comIssueRequestCreator.vue
  3. 32
      pages/issue/coms/comIssueRequestPopup.vue
  4. 181
      pages/issue/record/issueRecord.vue
  5. 3
      static/config.json

22
api/request2.js

@ -864,6 +864,21 @@ export function getIssueJobDetail(id) {
}
/**
* 获取推荐明细接口
* @param {*} 任务id
* /wms/issue-request-main
*/
export function getBalanceByBatchOffShelf(itemCode, qty) {
return request({
url: baseApi + "/wms/issue-request-main/getBalanceByBatchOffShelf?itemCode=" + itemCode + "&&qty=" +
qty,
method: "get",
data: {},
});
}
/**
* 发料 任务承接
* @param {*} id
@ -2558,10 +2573,3 @@ export function getBalanceByFilter(param) {
data: param,
});
}

2
pages/issue/coms/comIssueRequestCreator.vue

@ -1,7 +1,5 @@
<template>
<view class="">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>

32
pages/issue/coms/comIssueRequestPopup.vue

@ -34,8 +34,7 @@
</view>
<view class="">
<image src="/static/search.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;"
@click="itemCodeClick">
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="itemCodeClick">
</image>
</view>
@ -107,6 +106,8 @@
itemCode: '请扫描物料信息',
itemName: "",
qty: 0,
rawLocationCode: "",
fgLocationCode: "",
itemCodeFocus: false,
requestInfo: null,
itemCodeList: [],
@ -245,8 +246,11 @@
return
}
if (this.rawLocationCode == '') {
this.showErrorMessage(this.workStationName + "的原材料库位为空")
return
}
this.callback('add');
},
checkItemCode(itemCode) {
@ -280,6 +284,8 @@
productionLineName: this.productionLineName,
workStationCode: this.workStationCode, //
workStationName: this.workStationName,
rawLocationCode: this.rawLocationCode,
fgLocationCode: this.fgLocationCode,
itemCode: this.itemCode,
itemName: this.itemName,
uom: this.uom,
@ -326,11 +332,29 @@
this.productionLineName = e[1].label
this.workStationName = e[2].label
let shop = this.positionList.find(shop => shop.value == this.workshopCode);
if (shop != undefined && shop.children != undefined) {
let prodLine = shop.children.find(line => line.value == this.productionLineCode);
if (prodLine != undefined && prodLine.children != undefined) {
let station = prodLine.children.find(r => r.value == this.workStationCode);
if (station.rawLocationCode == '' && station.rawLocationCode == null) {
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择")
return;
} else {
this.rawLocationCode = station.rawLocationCode;
this.fgLocationCode = station.fgLocationCode;
}
} else {
this.showErrorMessage("生产线-工位基础信息维护错误")
}
} else {
this.showErrorMessage("车间-生产线基础信息维护错误")
}
},
getScanCode(code) {
if (code == "") {
this.showMessage('物料号不能为空')
this.showErrorMessage('物料号不能为空')
return;
}
this.itemCode = "";

181
pages/issue/record/issueRecord.vue

@ -1,13 +1,22 @@
<template>
<view class="page-wraper">
<view class="" v-if='detailSource.subList.length==0'>
<view class="" v-if='detailSource.length==0'>
<com-blank-view @goScan='goScan(true)'></com-blank-view>
</view>
<view v-else class="page-wraper">
<view class="page-main">
<comIssueRequestCreator ref="issueRequest" :dataContent="detailSource">
</comIssueRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button>
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
<com-issue-request-info :workShopCode="workShopCode" :dataContent="toLocation">
</com-issue-request-info>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation"
@updateData='updateData'>
</com-issue-detail-card>
</view>
</scroll-view>
<!-- <comIssueRequestCreator ref="issueRequest" :dataContent="detailSource">
</comIssueRequestCreator> -->
<!-- <button class="btn_add" @click="goScan(false)">+去添加</button> -->
</view>
<div class="btn_bottom">
@ -17,16 +26,17 @@
</view>
</view>
</div>
<comMessage ref="comMessage"></comMessage>
</view>
</view>
<comMessage ref="comMessage"></comMessage>
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup>
</template>
<script>
import {
issueRequestSubmit,
issueRecordSubmit
issueRecordSubmit,
getBalanceByBatchOffShelf
} from '@/api/request2.js';
import {
@ -45,6 +55,8 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
export default {
name: 'issueRequestSubmit',
@ -53,18 +65,18 @@
comIssueRequestPopup,
jobDetailPopup,
comMessage,
comIssueRequestCreator
comIssueRequestCreator,
comIssueRequestInfo,
comIssueDetailCard
},
data() {
return {
subList: [], //subList
detailSource: {
subList: []
}, //
detailSource: [], //
detailOptions: [],
scanOptions: [],
fromType:""
fromType: "",
workShopCode: ""
}
},
mounted() {
@ -80,68 +92,112 @@
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
goScan(editPosition) {
this.$refs.comIssueRequestPopup.openRequestPopup(editPosition);
},
//
requestConfirm(action, item) {
if (this.detailSource.subList.length == 0) {
this.detailSource = {
workshopCode: item.workshopCode,
workShopName: item.workShopName,
totalQty: 0,
subList: []
}
var subItem = {
productionLineCode: item.productionLineCode,
productionLineName: item.productionLineName,
workStationCode: item.workStationCode,
workStationName: item.workStationName, //
itemCode: item.itemCode,
itemName: item.itemName,
qty: item.qty,
uom: item.uom
}
this.detailSource.subList.push(subItem)
if (item.itemCode == '' || item.itemCode == null) return;
let that = this;
uni.showLoading({
title: '加载中...',
mask: true
})
getBalanceByBatchOffShelf(item.itemCode, item.qty).then(res => {
if (res.data == null) {
that.showMessage('未获取到推荐信息');
} else {
var result = this.detailSource.subList.filter(res => {
if (res.itemCode == item.itemCode&&
res.productionLineCode==item.productionLineCode&&
res.workStationCode==item.workStationCode) {
return res
if (res.data.length > 0) {
this.workShopCode = item.workshopCode;
res.data.forEach(r => {
r.toLocationCode = item.rawLocationCode;
r.productionLineCode = item.productionLineCode;
r.workStationCode = item.workStationCode;
r.itemCode = item.itemCode;
r.uom = item.uom;
that.subList.push(r);
})
that.detailSource = getDataSource(that.detailSource, that.subList)
that.resizeCollapse();
} else {
that.showMessage('列表数据为0');
}
uni.hideLoading();
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
//
if (result.length == 0) {
var subItem = {
productionLineCode: item.productionLineCode,
productionLineName: item.productionLineName,
workStationCode: item.workStationCode,
workStationName: item.workStationName, //
itemCode: item.itemCode,
itemName: item.itemName,
qty: item.qty,
uom: item.uom
}
this.detailSource.subList.push(subItem)
// if (this.detailSource.subList.length == 0) {
// this.detailSource = {
// workshopCode: item.workshopCode,
// workShopName: item.workShopName,
} else {
//
result[0].qty += item.qty
// totalQty: 0,
// subList: []
// }
// var subItem = {
// productionLineCode: item.productionLineCode,
// productionLineName: item.productionLineName,
// workStationCode: item.workStationCode,
// workStationName: item.workStationName, //
// itemCode: item.itemCode,
// itemName: item.itemName,
// qty: item.qty,
// uom: item.uom
// }
// this.detailSource.subList.push(subItem)
// } else {
// var result = this.detailSource.subList.filter(res => {
// if (res.itemCode == item.itemCode &&
// res.productionLineCode == item.productionLineCode &&
// res.workStationCode == item.workStationCode) {
// return res
// }
// })
}
}
this.caclcQty();
if (this.$refs.issueRequest != undefined) {
this.$refs.issueRequest.update()
}
// //
// if (result.length == 0) {
// var subItem = {
// productionLineCode: item.productionLineCode,
// productionLineName: item.productionLineName,
// workStationCode: item.workStationCode,
// workStationName: item.workStationName, //
// itemCode: item.itemCode,
// itemName: item.itemName,
// qty: item.qty,
// uom: item.uom
// }
// this.detailSource.subList.push(subItem)
// } else {
// //
// result[0].qty += item.qty
// }
// }
// this.caclcQty();
// if (this.$refs.issueRequest != undefined) {
// this.$refs.issueRequest.update()
// }
},
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
@ -200,6 +256,13 @@
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}

3
static/config.json

@ -18,9 +18,10 @@
"request_url": {
"name": "request_url",
"value": "http://dev.ccwin-in.com:25100/api/admin-api",
"value": "http://192.168.0.230:12080/admin-api",
"dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.178:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api",
"dev": "http://dev.ccwin-in.com:25100/api/admin-api",
"local": "http://localhost:12080",
"desc": "api请求地址"

Loading…
Cancel
Save