Browse Source

修改发料记录

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

80
api/request2.js

@ -1,7 +1,7 @@
import request from '@/api/httpRequest3.js' import request from '@/api/httpRequest3.js'
// const baseApi = "/api/admin-api" // const baseApi = "/api/admin-api"
//公司地址 //公司地址
// 本地地址 // 本地地址
const baseApi = "" const baseApi = ""
/** /**
* 获取验证码 * 获取验证码
@ -65,7 +65,7 @@ export function getTenantInfo(name) {
return request({ return request({
url: baseApi + "/system/tenant/page", url: baseApi + "/system/tenant/page",
method: "get", method: "get",
data:params, data: params,
}); });
} }
@ -127,10 +127,10 @@ export function getBasicCustomerList() {
* *
*/ */
export function getBusinesstypeByCode(code) { export function getBusinesstypeByCode(code) {
var params ={ var params = {
code:code, code: code,
pageNo:1, pageNo: 1,
pageSize:100 pageSize: 100
} }
return request({ return request({
url: baseApi + "/wms/businesstype/page", url: baseApi + "/wms/businesstype/page",
@ -147,10 +147,10 @@ export function getBusinesstypeByCode(code) {
export function getBalanceByItemCode(params) { export function getBalanceByItemCode(params) {
return request({ return request({
url: baseApi + "/wms/balance/page", url: baseApi + "/wms/balance/page",
method: "get", method: "get",
data: params, data: params,
}); });
} }
/** /**
@ -256,7 +256,7 @@ export function getBalanceByContainerNumber(params) {
export function getLabelByHeader(header, version) { export function getLabelByHeader(header, version) {
var params = { var params = {
header: header, header: header,
version:version, version: version,
} }
return request({ return request({
url: baseApi + "/wms/labeltype/getDetailsByHeader", url: baseApi + "/wms/labeltype/getDetailsByHeader",
@ -291,10 +291,10 @@ export function getPackageByNumber(number) {
* *
*/ */
export function getBasicLocationByCode(code) { export function getBasicLocationByCode(code) {
var parmas ={ var parmas = {
code:code, code: code,
pageNo:1, pageNo: 1,
pageSize:100 pageSize: 100
} }
return request({ return request({
url: baseApi + "/wms/location/page", url: baseApi + "/wms/location/page",
@ -315,7 +315,7 @@ export function getBasicItemByCode(itemCode) {
pageSize: 100 pageSize: 100
} }
return request({ return request({
url: baseApi + "/wms/itembasic/page" , url: baseApi + "/wms/itembasic/page",
method: "get", method: "get",
data: params, data: params,
}); });
@ -354,7 +354,7 @@ export function getItempackagingByItemcode(itemCode) {
*/ */
export function getProductionlineItem(params) { export function getProductionlineItem(params) {
return request({ return request({
url: baseApi + "/wms/productionlineitem/page" , url: baseApi + "/wms/productionlineitem/page",
method: "get", method: "get",
data: params, data: params,
}); });
@ -367,7 +367,7 @@ export function getProductionlineItem(params) {
*/ */
export function getWorkShopLineStation() { export function getWorkShopLineStation() {
return request({ return request({
url: baseApi + "/wms/issue-request-main/get-workshop-productionline-workstation" , url: baseApi + "/wms/issue-request-main/get-workshop-productionline-workstation",
method: "get", method: "get",
data: {}, data: {},
}); });
@ -412,7 +412,7 @@ export function getSupplierDeliverRecordList(params) {
*/ */
export function getSupplierDeliverRecordDetail(id) { export function getSupplierDeliverRecordDetail(id) {
return request({ return request({
url: baseApi + "/wms/supplierdeliver-record-main/getSupplierdeliverRecordById?id="+id, url: baseApi + "/wms/supplierdeliver-record-main/getSupplierdeliverRecordById?id=" + id,
method: "get", method: "get",
data: {}, data: {},
}); });
@ -445,7 +445,7 @@ export function getInspectRequestList(params) {
*/ */
export function getInspectRequestDetail(id) { export function getInspectRequestDetail(id) {
return request({ return request({
url: baseApi + "/wms/inspect-request-main/getInspectRequestById?id="+id, url: baseApi + "/wms/inspect-request-main/getInspectRequestById?id=" + id,
method: "get", method: "get",
data: {}, data: {},
}); });
@ -581,7 +581,7 @@ export function cancleTakePurchasereturnJob(id) {
* 采购退货 任务提交 * 采购退货 任务提交
* @param {*} params * @param {*} params
*/ */
export function purchaseReturnJobsubmit (params) { export function purchaseReturnJobsubmit(params) {
return request({ return request({
url: baseApi + "/wms/purchasereturn-job-main/execute", url: baseApi + "/wms/purchasereturn-job-main/execute",
method: "put", method: "put",
@ -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 * @param {*} id
@ -1365,7 +1380,7 @@ export function cancleTakeProductReceiptJob(id) {
* 制品收货任务 提交 * 制品收货任务 提交
* @param {*} params * @param {*} params
*/ */
export function productReceiptJobsubmit( params) { export function productReceiptJobsubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit", url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit",
method: "put", method: "put",
@ -1377,7 +1392,7 @@ export function productReceiptJobsubmit( params) {
* 制品收货记录 提交 * 制品收货记录 提交
* @param {*} params * @param {*} params
*/ */
export function productReceiptRecordsubmit( params) { export function productReceiptRecordsubmit(params) {
return request({ return request({
url: baseApi + "/wms/productreceipt-record-main/create", url: baseApi + "/wms/productreceipt-record-main/create",
method: "post", method: "post",
@ -1615,7 +1630,7 @@ export function cancleTakeDeliverJob(id) {
* *
*/ */
export function deliverJobSubmit( params) { export function deliverJobSubmit(params) {
return request({ return request({
url: baseApi + "/wms/deliver-job-main/execute", url: baseApi + "/wms/deliver-job-main/execute",
method: "put", method: "put",
@ -1945,7 +1960,7 @@ export function cancleTakeTransferIssueJob(id) {
* @param {*} 任务id * @param {*} 任务id
* *
*/ */
export function transferIssueJobSubmit( params) { export function transferIssueJobSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit?id=" + id, url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit?id=" + id,
method: "post", method: "post",
@ -1958,7 +1973,7 @@ export function transferIssueJobSubmit( params) {
* @param {*} * @param {*}
* *
*/ */
export function transferIssueRecordSubmit( params) { export function transferIssueRecordSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit",
method: "put", method: "put",
@ -2026,7 +2041,7 @@ export function getIssueRequestList(params) {
*/ */
export function getIssueRequestDetail(id) { export function getIssueRequestDetail(id) {
return request({ return request({
url: baseApi + "/wms/issue-request-main/getIssueRequestById?id="+id, url: baseApi + "/wms/issue-request-main/getIssueRequestById?id=" + id,
method: "get", method: "get",
data: {}, data: {},
}); });
@ -2119,7 +2134,7 @@ export function cancleTakeProductionReturnJob(id) {
* @param {*} 任务id * @param {*} 任务id
* *
*/ */
export function productionReturnJobSubmit( params) { export function productionReturnJobSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit",
method: "put", method: "put",
@ -2312,7 +2327,7 @@ export function cancleTakeScrapJob(id) {
* @param {*} 任务id * @param {*} 任务id
* *
*/ */
export function scrapJobSubmit( params) { export function scrapJobSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit?id=" + id, url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit?id=" + id,
method: "put", method: "put",
@ -2558,10 +2573,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 = "";

193
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() {
@ -72,76 +84,120 @@
}, },
onLoad(option) { onLoad(option) {
this.fromType = option.fromType this.fromType = option.fromType
if(this.fromType=="requestType"){ if (this.fromType == "requestType") {
updateTitle("发料申请") updateTitle("发料申请")
}else { } else {
updateTitle("发料记录") updateTitle("发料记录")
} }
}, },
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;
let that = this;
uni.showLoading({
title: '加载中...',
mask: true
})
getBalanceByBatchOffShelf(item.itemCode, item.qty).then(res => {
if (res.data == null) {
that.showMessage('未获取到推荐信息');
} else {
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 (this.detailSource.subList.length == 0) {
this.detailSource = {
workshopCode: item.workshopCode,
workShopName: item.workShopName,
totalQty: 0, // if (this.detailSource.subList.length == 0) {
subList: [] // this.detailSource = {
} // workshopCode: item.workshopCode,
var subItem = { // workShopName: item.workShopName,
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
}
})
// // totalQty: 0,
if (result.length == 0) { // subList: []
var subItem = { // }
productionLineCode: item.productionLineCode, // var subItem = {
productionLineName: item.productionLineName, // productionLineCode: item.productionLineCode,
workStationCode: item.workStationCode, // productionLineName: item.productionLineName,
workStationName: item.workStationName, // // workStationCode: item.workStationCode,
itemCode: item.itemCode, // workStationName: item.workStationName, //
itemName: item.itemName, // itemCode: item.itemCode,
qty: item.qty, // itemName: item.itemName,
uom: item.uom // 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.detailSource.subList.push(subItem) // //
// 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
// }
} else { // this.detailSource.subList.push(subItem)
//
result[0].qty += item.qty
} // } else {
} // //
this.caclcQty(); // result[0].qty += item.qty
if (this.$refs.issueRequest != undefined) {
this.$refs.issueRequest.update() // }
} // }
// 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 => {
@ -159,7 +215,7 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
if(this.fromType =="requestType"){ if (this.fromType == "requestType") {
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
issueRequestSubmit(params).then(res => { issueRequestSubmit(params).then(res => {
@ -173,7 +229,7 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}else { } else {
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
issueRecordSubmit(params).then(res => { issueRecordSubmit(params).then(res => {
@ -192,7 +248,7 @@
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
if(this.fromType =="requestType"){ if (this.fromType == "requestType") {
uni.navigateTo({ uni.navigateTo({
url: './issueRequest' url: './issueRequest'
}) })
@ -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) {}

19
static/config.json

@ -18,11 +18,12 @@
"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",
"dev":"http://dev.ccwin-in.com:25100/api/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",
"local":"http://localhost:12080", "dev": "http://dev.ccwin-in.com:25100/api/admin-api",
"local": "http://localhost:12080",
"desc": "api请求地址" "desc": "api请求地址"
}, },
"tenantId": { "tenantId": {
@ -44,12 +45,12 @@
"value": true, "value": true,
"desc": "采购收货_允许编辑数量" "desc": "采购收货_允许编辑数量"
}, },
{ {
"name": "receipt_isHandleQtyGreaterRecommendQty", "name": "receipt_isHandleQtyGreaterRecommendQty",
"value": true, "value": true,
"desc": "采购收货_允许实际数量大于推荐数量" "desc": "采购收货_允许实际数量大于推荐数量"
}, },
{ {
"name": "receipt_isHandleQtyLessRecommendQty", "name": "receipt_isHandleQtyLessRecommendQty",
"value": true, "value": true,
"desc": "采购收货_允许实际数量小于推荐数量" "desc": "采购收货_允许实际数量小于推荐数量"
@ -82,12 +83,12 @@
"value": true, "value": true,
"desc": "发料_允许编辑数量" "desc": "发料_允许编辑数量"
}, },
{ {
"name": "feed_isHandleQtyGreaterRecommendQty", "name": "feed_isHandleQtyGreaterRecommendQty",
"value": true, "value": true,
"desc": "发料_允许实际数量大于推荐数量" "desc": "发料_允许实际数量大于推荐数量"
}, },
{ {
"name": "feed_isHandleQtyLessRecommendQty", "name": "feed_isHandleQtyLessRecommendQty",
"value": true, "value": true,
"desc": "发料_允许实际数量小于推荐数量" "desc": "发料_允许实际数量小于推荐数量"

Loading…
Cancel
Save