lijuncheng 12 months ago
parent
commit
a2189ad8a7
  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

@ -927,6 +927,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 * @param {*} id
@ -2682,10 +2697,3 @@ export function getBalanceByFilter(param) {
data: param, data: param,
}); });
} }

2
pages/issue/coms/comIssueRequestCreator.vue

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

32
pages/issue/coms/comIssueRequestPopup.vue

@ -34,8 +34,7 @@
</view> </view>
<view class=""> <view class="">
<image src="/static/search.svg" mode="" <image src="/static/search.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="itemCodeClick">
@click="itemCodeClick">
</image> </image>
</view> </view>
@ -107,6 +106,8 @@
itemCode: '请扫描物料信息', itemCode: '请扫描物料信息',
itemName: "", itemName: "",
qty: 0, qty: 0,
rawLocationCode: "",
fgLocationCode: "",
itemCodeFocus: false, itemCodeFocus: false,
requestInfo: null, requestInfo: null,
itemCodeList: [], itemCodeList: [],
@ -245,8 +246,11 @@
return return
} }
if (this.rawLocationCode == '') {
this.showErrorMessage(this.workStationName + "的原材料库位为空")
return
}
this.callback('add'); this.callback('add');
}, },
checkItemCode(itemCode) { checkItemCode(itemCode) {
@ -280,6 +284,8 @@
productionLineName: this.productionLineName, productionLineName: this.productionLineName,
workStationCode: this.workStationCode, // workStationCode: this.workStationCode, //
workStationName: this.workStationName, workStationName: this.workStationName,
rawLocationCode: this.rawLocationCode,
fgLocationCode: this.fgLocationCode,
itemCode: this.itemCode, itemCode: this.itemCode,
itemName: this.itemName, itemName: this.itemName,
uom: this.uom, uom: this.uom,
@ -326,11 +332,29 @@
this.productionLineName = e[1].label this.productionLineName = e[1].label
this.workStationName = e[2].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) { getScanCode(code) {
if (code == "") { if (code == "") {
this.showMessage('物料号不能为空') this.showErrorMessage('物料号不能为空')
return; return;
} }
this.itemCode = ""; this.itemCode = "";

181
pages/issue/record/issueRecord.vue

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

3
static/config.json

@ -18,9 +18,10 @@
"request_url": { "request_url": {
"name": "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", "dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.178: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", "dev": "http://dev.ccwin-in.com:25100/api/admin-api",
"local": "http://localhost:12080", "local": "http://localhost:12080",
"desc": "api请求地址" "desc": "api请求地址"

Loading…
Cancel
Save