Browse Source

修改发料任务

wms3.0_pda
lijuncheng 12 months ago
parent
commit
6fee836447
  1. 22
      api/request2.js
  2. 2
      mycomponents/balance/handleBalance.vue
  3. 2
      mycomponents/balance/recommendBalance.vue
  4. 2
      mycomponents/package/packageBalance.vue
  5. 2
      mycomponents/package/packageHandle.vue
  6. 2
      mycomponents/recommend/recommendBalance.vue
  7. 4
      pages/count/record/countRecord.vue
  8. 4
      pages/demo/demo.vue
  9. 2
      pages/issue-按批次推荐/coms/comIssueDetailCard.vue
  10. 2
      pages/issue-按批次推荐/coms/comIssueRecommend.vue
  11. 4
      pages/issue-按批次推荐/coms/comScanIssuePack.vue
  12. 6
      pages/issue-按批次推荐/job/issueDetail.vue
  13. 21
      pages/issue/coms/comIssueDetailCard.vue
  14. 2
      pages/issue/coms/comIssueRecommend.vue
  15. 14
      pages/issue/coms/comIssueRequestCreator.vue
  16. 111
      pages/issue/coms/comIssueRequestPopup.vue
  17. 76
      pages/issue/coms/comScanIssuePack.vue
  18. 6
      pages/issue/job/issueDetail.vue
  19. 6
      pages/issue/js/issue.js
  20. 402
      pages/issue/record/issueRecord.vue
  21. 5
      pages/issue/request/issueRequest.vue
  22. 51
      pages/issue/request/issueRequestSubmit.vue
  23. 38
      pages/purchaseReturn/record/returnRecord.vue

22
api/request2.js

@ -807,7 +807,7 @@ export function getIssueJobDetail(id) {
*/ */
export function takeIssueJob(id) { export function takeIssueJob(id) {
return request({ return request({
url: baseApi + "/wms/purchasereceipt-job-main/accept?id=" + id, url: baseApi + "/wms/issue-job-main/accept?id=" + id,
method: "put", method: "put",
data: {}, data: {},
}); });
@ -820,12 +820,24 @@ export function takeIssueJob(id) {
*/ */
export function cancleTakeIssueJob(id) { export function cancleTakeIssueJob(id) {
return request({ return request({
url: baseApi + "/wms/purchasereceipt-job-main/abandon?id=" + id, url: baseApi + "/wms/issue-job-main/abandon?id=" + id,
method: "get", method: "put",
data: {}, data: {},
}); });
} }
/**
* 发料任务 提交
* @param {*} params
*/
export function issueJobSubmit(params) {
return request({
url: baseApi + "/wms/issue-job-main/execute",
method: "put",
data: params,
});
}
/** /**
* 生产收料 任务列表 * 生产收料 任务列表
@ -1958,8 +1970,8 @@ export function issueRequestSubmit(params) {
*/ */
export function issueRecordSubmit(params) { export function issueRecordSubmit(params) {
return request({ return request({
url: baseApi + "/wms/purchasereturn-request-main/submit", url: baseApi + "/wms/issue-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }

2
mycomponents/balance/handleBalance.vue

@ -8,7 +8,7 @@
<view> <view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.FromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
</view> </view>
<view> <view>

2
mycomponents/balance/recommendBalance.vue

@ -8,7 +8,7 @@
<view> <view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.FromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
</view> </view>
<view> <view>

2
mycomponents/package/packageBalance.vue

@ -8,7 +8,7 @@
<view> <view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.FromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
</view> </view>
<view> <view>

2
mycomponents/package/packageHandle.vue

@ -9,7 +9,7 @@
<view> <view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.FromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
</view> </view>
<view> <view>

2
mycomponents/recommend/recommendBalance.vue

@ -4,7 +4,7 @@
<view> <view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.FromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
<view> <view>
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail" :isShowStdPack="false"></recommend-qty> <recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail" :isShowStdPack="false"></recommend-qty>

4
pages/count/record/countRecord.vue

@ -162,8 +162,8 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
selectedItem(item) { selectedItem(item) {
if (item.locationCode != this.FromLocationCode) { if (item.locationCode != this.fromLocationCode) {
this.showErrorMessage("来源库位[" + this.FromLocationCode + "]无库存") this.showErrorMessage("来源库位[" + this.fromLocationCode + "]无库存")
return; return;
} }
}, },

4
pages/demo/demo.vue

@ -226,7 +226,7 @@
<view class="title-2">库位 location</view> <view class="title-2">库位 location</view>
<view class="view-com"> <view class="view-com">
<location :locationCode="detailDataContent.FromLocationCode"></location> <location :locationCode="detailDataContent.fromLocationCode"></location>
</view> </view>
@ -459,7 +459,7 @@
packingNumber: "516456579", packingNumber: "516456579",
batch: "20230510", batch: "20230510",
FromLocationCode: "B0101", fromLocationCode: "B0101",
locationCode: "B0101", locationCode: "B0101",
record: { record: {
qty: 1000 qty: 1000

2
pages/issue-按批次推荐/coms/comIssueDetailCard.vue

@ -16,7 +16,7 @@
<view> <view>
<view class="uni-flex uni-row space-between"> <view class="uni-flex uni-row space-between">
<!-- 推荐库位 --> <!-- 推荐库位 -->
<location :locationCode="loacation.FromLocationCode"> <location :locationCode="loacation.fromLocationCode">
</location> </location>
</view> </view>
<view v-for="(batch,index) in loacation.Batchs"> <view v-for="(batch,index) in loacation.Batchs">

2
pages/issue-按批次推荐/coms/comIssueRecommend.vue

@ -4,7 +4,7 @@
<view> <view>
<view> <view>
<view class="uni-flex uni-row space-between"> <view class="uni-flex uni-row space-between">
<location :locationCode="detail.FromLocationCode"> <location :locationCode="detail.fromLocationCode">
</location> </location>
</view> </view>
<view v-for="(batch,index) in detail.Batchs"> <view v-for="(batch,index) in detail.Batchs">

4
pages/issue-按批次推荐/coms/comScanIssuePack.vue

@ -132,9 +132,9 @@
if (location != undefined) { if (location != undefined) {
location.Items.forEach(item => { location.Items.forEach(item => {
item.Locations.forEach(f => { item.Locations.forEach(f => {
list.push(f.FromLocationCode) list.push(f.fromLocationCode)
}) })
this.fromLocationCode = item.Locations[0].FromLocationCode; this.fromLocationCode = item.Locations[0].fromLocationCode;
}) })
return list; return list;
} else { } else {

6
pages/issue-按批次推荐/job/issueDetail.vue

@ -207,7 +207,7 @@
} else { } else {
item.qty += detail.qty item.qty += detail.qty
// //
let location = item.Locations.find(r => r.FromLocationCode == detail.FromLocationCode); let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode);
if (location == undefined) { if (location == undefined) {
location = that.createLocationInfo(detail); location = that.createLocationInfo(detail);
item.Locations.push(location); item.Locations.push(location);
@ -240,7 +240,7 @@
createLocationInfo(detail) { createLocationInfo(detail) {
let location = { let location = {
FromLocationCode: detail.FromLocationCode, fromLocationCode: detail.fromLocationCode,
qty: detail.qty, qty: detail.qty,
uom: detail.uom, uom: detail.uom,
handleQty: 0, handleQty: 0,
@ -357,7 +357,7 @@
}) })
} else { } else {
let fromLocation = item.Locations.find(r => r.FromLocationCode == locationCode); let fromLocation = item.Locations.find(r => r.fromLocationCode == locationCode);
let batch = fromLocation.Batchs.find(r => r.Bacth == result.label.batch) let batch = fromLocation.Batchs.find(r => r.Bacth == result.label.batch)
if (batch == undefined || batch == null) { if (batch == undefined || batch == null) {
if (jobContent.AllowModifyBach == 1) { if (jobContent.AllowModifyBach == 1) {

21
pages/issue/coms/comIssueDetailCard.vue

@ -1,15 +1,20 @@
<template> <template>
<view> <view>
<!-- 需求库位 --> <!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
<requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode" :isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation>
<u-line />
<view v-for="(item,index) in dataContent.Items"> <view v-for="(item,index) in dataContent.Items">
<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>
<!-- 物品 --> <!-- 物品 -->
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty> <item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
<view class="" style="margin-left: 30rpx;font-size: 30rpx;">
生产线 : {{item.productionLineCode}}
</view>
<view class="" style="margin-left: 30rpx;font-size: 30rpx;">
工位 : {{item.workStationCode}}
</view>
</template> </template>
<u-line /> <u-line />
<view v-for="(loacation,index) in item.Locations"> <view v-for="(loacation,index) in item.Locations">
@ -22,7 +27,7 @@
<view v-for="(batch,index) in loacation.Batchs"> <view v-for="(batch,index) in loacation.Batchs">
<view> <view>
<recommend-balance style='margin-left: 20px;' :detail="batch" <recommend-balance style='margin-left: 20px;' :detail="batch"
:isShowLocation="false" :isShowPack="batch.packingNumber!=''"> :isShowLocation="false" :isShowPack="false">
</recommend-balance> </recommend-balance>
</view> </view>
@ -47,7 +52,7 @@
</view> </view>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> <balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage> <comMessage ref="message"></comMessage>
</template> </template>
@ -63,14 +68,14 @@
import location from '@/mycomponents/balance/location.vue' import location from '@/mycomponents/balance/location.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import { import {
getDetailOption, getDetailOption,
getEditRemoveOption getEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
emits:['updateData'], emits: ['updateData'],
components: { components: {
itemQty, itemQty,
recommend, recommend,

2
pages/issue/coms/comIssueRecommend.vue

@ -4,7 +4,7 @@
<view> <view>
<view> <view>
<view class="uni-flex uni-row space-between"> <view class="uni-flex uni-row space-between">
<location :locationCode="detail.FromLocationCode"> <location :locationCode="detail.fromLocationCode">
</location> </location>
</view> </view>
<view v-for="(batch,index) in detail.Batchs"> <view v-for="(batch,index) in detail.Batchs">

14
pages/issue/coms/comIssueRequestCreator.vue

@ -7,13 +7,11 @@
<template v-slot:title> <template v-slot:title>
<view class="" style="font-size: 32rpx;"> <view class="" style="font-size: 32rpx;">
<view class="" > <view class="" >
车间 : {{dataContent.workShopName}} ({{dataContent.workShopCode}}) 车间 : {{dataContent.workShopName}} ({{dataContent.workshopCode}})
</view> </view>
<view class=""> <view class="">
生产线 : {{dataContent.productionLineName}}({{dataContent.productionLineCode}}) 总数量 : {{dataContent.totalQty}}
</view>
<view class="">
工位 : {{dataContent.workStationName}} ({{dataContent.workStationCode}})
</view> </view>
</view> </view>
@ -23,6 +21,12 @@
<view v-for="(item, index) in dataContent.subList" :key="index"> <view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item> <uni-swipe-action-item>
<view class="" style="font-size: 32rpx;margin: 10rpx;"> <view class="" style="font-size: 32rpx;margin: 10rpx;">
<view class="">
生产线 : {{item.productionLineName}}({{item.productionLineCode}})
</view>
<view class="">
工位 : {{item.workStationName}} ({{item.workStationCode}})
</view>
<view class=""> <view class="">
物品代码 : {{item.itemCode}} 物品代码 : {{item.itemCode}}
</view> </view>

111
pages/issue/coms/comIssueRequestPopup.vue

@ -94,13 +94,12 @@
data() { data() {
return { return {
// itemCode: 'CE115F11161AG', // itemCode: 'CE115F11161AG',
workShopCode: "", // workshopCode: "", //
workShopName: "", workShopName: "",
productionLineCode: "",//线 productionLineCode: "",//线
productionLineName:"", productionLineName:"",
workStationCode: "",// workStationCode: "",//
workStationName:"", workStationName:"",
itemCode: '', itemCode: '',
itemName: "", itemName: "",
qty: 0, qty: 0,
@ -115,102 +114,7 @@
positionInfo: "请选择位置", positionInfo: "请选择位置",
show: false, show: false,
isModifiedPosition: true, isModifiedPosition: true,
positionList:[ positionList:[],
{
"children": [
{
"children": [
{
"label": "",
"value": ""
}
],
"label": "生产线1",
"value": "111"
}
],
"label": "车间1",
"value": "111"
},
{
"children": [
{
"children": [
{
"label": "测试",
"value": "测试111"
}
],
"label": "222",
"value": "222"
}
],
"label": "333",
"value": "222"
},
{
"children": [
{
"children": [
{
"label": "",
"value": ""
}
],
"label": "",
"value": ""
}
],
"label": "3333",
"value": "333"
},
{
"children": [
{
"children": [
{
"label": "",
"value": ""
}
],
"label": "",
"value": ""
}
],
"label": "测试1111",
"value": "测试111"
},
{
"children": [
{
"children": [
{
"label": "工位1",
"value": "station1"
},
{
"label": "工位2",
"value": "station2"
}
],
"label": "车间1-生产线1",
"value": "line1"
},
{
"children": [
{
"label": "",
"value": ""
}
],
"label": "车间1-生产线2",
"value": "line2"
}
],
"label": "车间1",
"value": "work1"
}
],
list: [{ list: [{
value: 1, value: 1,
label: '车间1', label: '车间1',
@ -287,7 +191,7 @@
openRequestPopup(editPosition) { openRequestPopup(editPosition) {
if(this.positionList.length==0){ if(this.positionList.length==0){
getWorkShopLineStation().then(res=>{ getWorkShopLineStation().then(res=>{
// this.positionList =res this.positionList =res
}).catch(error=>{ }).catch(error=>{
}) })
@ -370,7 +274,7 @@
callback(action) { callback(action) {
let item = { let item = {
positionInfo: this.positionInfo, positionInfo: this.positionInfo,
workShopCode: this.workShopCode,// workshopCode: this.workshopCode,//
workShopName: this.workShopName, workShopName: this.workShopName,
productionLineCode: this.productionLineCode,//线 productionLineCode: this.productionLineCode,//线
productionLineName:this.productionLineName, productionLineName:this.productionLineName,
@ -416,19 +320,14 @@
}, },
confirmSelect(e) { confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
var positionInfoValue = e[0].value + "-" + e[1].value + "-" + e[2].value
console.log("位置",this.positionInfo) console.log("位置",this.positionInfo)
console.log("位置value",positionInfoValue) this.workshopCode = e[0].value
this.workShopCode = e[0].value
this.productionLineCode = e[1].value this.productionLineCode = e[1].value
this.workStationCode = e[2].value this.workStationCode = e[2].value
this.workShopName= e[0].label this.workShopName= e[0].label
this.productionLineName = e[1].label this.productionLineName = e[1].label
this.workStationName = e[2].label this.workStationName = e[2].label
}, },
getItemCodeListByProLine(lineCode) { getItemCodeListByProLine(lineCode) {

76
pages/issue/coms/comScanIssuePack.vue

@ -11,24 +11,31 @@
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
padding:20rpx;
border-radius: 8rpx;"> border-radius: 8rpx;">
<view class="uni-center" style="width: 25%; "> <view class="uni-center" style="width: 25%; ">
需求库 :
</view> </view>
<view class="" style="width: 75%;padding: 8rpx"> <view class="" style="width: 75%;padding: 0rpx">
<uni-combox ref="toLocationCombox" :candidates="requestLocationList" placeholder="请选择需求库位" <view class="uni-flex u-col-center uni-row" @click="showSelect">
v-model="requestLocationCode" @confirm="toLocationUpdate" <view class="" style="margin-left: 15rpx;font-size: 30rpx;">
@update:modelValue="toLocationUpdate"></uni-combox> {{positionInfo}}
</view>
<!-- <u-select v-model="show" mode="mutil-column-auto" :list="positionList" :defaultValue="defaultValueList"
@confirm="confirmSelect"></u-select> -->
</view>
</view> </view>
</view> </view>
<u-line class='line_color'></u-line>
<view class="uni-flex uni-row" style="align-items: center; <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
margin-top: 8rpx;
border-radius: 8rpx;"> border-radius: 8rpx;">
<view class="uni-center" style="width: 25%; "> <view class="uni-center" style="width: 25%; ">
发料库位 来源库位
</view> </view>
<view class="" style="width: 75%; padding: 8rpx;"> <view class="" style="width: 75%; padding: 8rpx;">
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位" <uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位"
@ -93,6 +100,9 @@
getDetailOption, getDetailOption,
getDetailEditRemoveOption getDetailEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
import {
getWorkShopLineStation
} from '@/api/request2.js';
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
@ -120,16 +130,18 @@
expendIcon: 'arrow-down', expendIcon: 'arrow-down',
show: false, show: false,
scanList: [], scanList: [],
requestLocationList: [], toLocation: null,
requestLocation: null, toLocationCode: '',
requestLocationCode: '',
fromLocationList: [], fromLocationList: [],
fromLocationCode: '', fromLocationCode: '',
fromLocation: null, fromLocation: null,
issueRecord: [], // issueRecord: [], //
expand: true, expand: true,
scanOptions: {}, scanOptions: {},
editItem: {} editItem: {},
positionInfo: "请选择位置",
positionList:[],
defaultValueList:[]
} }
}, },
created() { created() {
@ -142,10 +154,12 @@
}, },
methods: { methods: {
openScanPopup(content, jobcontent) { openScanPopup(content, jobcontent) {
debugger
this.issueRecord = []; this.issueRecord = [];
this.dataContent = content; this.dataContent = content;
this.jobContent = jobcontent; this.jobContent = jobcontent;
this.initData(); this.initData();
this.positionInfo =this.jobContent.workShopCode+"-"+this.jobContent.subList[0].productionLineCode+"-"+this.jobContent.subList[0].workStationCode
this.$refs.popup.open('bottom'); this.$refs.popup.open('bottom');
}, },
@ -157,27 +171,23 @@
}, },
initData() { initData() {
debugger
let that = this; let that = this;
that.requestLocationList = [];
that.fromLocationList = []; that.fromLocationList = [];
if (that.dataContent != null) { if (that.dataContent != null) {
that.requestLocation = that.dataContent[0]; that.toLocation = that.dataContent[0];
that.requestLocationCode = that.dataContent[0].toLocationCode; that.toLocationCode = that.dataContent[0].toLocationCode;
that.dataContent.forEach(res => {
that.requestLocationList.push(res.toLocationCode)
})
that.fromLocationList = that.getFromLocationList(); that.fromLocationList = that.getFromLocationList();
} }
}, },
getFromLocationList() { getFromLocationList() {
let list = []; let list = [];
let location = this.dataContent.find(r => r.toLocationCode == this.requestLocationCode); let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode);
if (location != undefined) { if (location != undefined) {
location.Items.forEach(item => { location.Items.forEach(item => {
item.Locations.forEach(f => { item.Locations.forEach(f => {
list.push(f.FromLocationCode) list.push(f.fromLocationCode)
}) })
}) })
this.fromLocationCode = list[0]; this.fromLocationCode = list[0];
@ -197,28 +207,12 @@
} }
}, },
toLocationUpdate(tolocation) {
let toLocation = this.requestLocationList.find(r => r == tolocation);
if (toLocation == undefined) {
this.requestLocation = null;
this.requestLocationCode = '';
this.showErrorMessage('需求库位【' + tolocation + '】不存在')
} else {
this.getFromLocationList();
}
},
onScan(result) { onScan(result) {
try { try {
let that = this; let that = this;
if (that.requestLocation == null) {
that.showErrorMessage('请选择需求库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
if (that.fromLocationCode == '') { if (that.fromLocationCode == '') {
that.showErrorMessage('请选择发料库位', res => { that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus(); that.$refs.toLocationCombox.onFocus();
}); });
return; return;
@ -226,7 +220,7 @@
let itemCode = result.label.itemCode; let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber; let packingCode = result.label.packingNumber;
let lot = result.label.batch; let lot = result.label.batch;
let item = that.requestLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) { if (item == undefined) {
that.showErrorMessage('未查找到零件【' + itemCode + '】的发料明细', that.showErrorMessage('未查找到零件【' + itemCode + '】的发料明细',
res => { res => {
@ -272,7 +266,7 @@
let itemCode = label.itemCode; let itemCode = label.itemCode;
let packingCode = label.packingNumber; let packingCode = label.packingNumber;
let lot = label.batch; let lot = label.batch;
let item = that.requestLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) { if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
@ -364,7 +358,7 @@
uom: balance.uom, uom: balance.uom,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
toLocationCode: this.requestLocationCode toLocationCode: this.toLocationCode
} }
return record; return record;
}, },
@ -427,7 +421,7 @@
record.qty = 0; record.qty = 0;
this.issueRecord.splice(index, 1) this.issueRecord.splice(index, 1)
let item = this.requestLocation.Items.find(r => r.itemCode == record.itemCode); let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) { if (item != undefined) {
item.Locations.forEach(l => { item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b

6
pages/issue/job/issueDetail.vue

@ -2,6 +2,10 @@
<!-- <page-meta root-font-size="18px"></page-meta> --> <!-- <page-meta root-font-size="18px"></page-meta> -->
<view class="page-wraper"> <view class="page-wraper">
<view class="page-main"> <view class="page-main">
<view class="" style="padding: 15rpx;font-size: 35rpx; ">
车间代码 : {{jobContent.workShopCode}}
</view>
<u-line />
<scroll-view scroll-y="true" class=""> <scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource"> <view v-for="(toLocation, index) in detailSource">
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'> <com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
@ -142,7 +146,7 @@
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)
// that.fromLocationCode = that.subList[0].FromLocationCode // that.fromLocationCode = that.subList[0].fromLocationCode
// that.toLocationCode = that.subList[0].toLocationCode // that.toLocationCode = that.subList[0].toLocationCode
// that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) // that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.resizeCollapse(); that.resizeCollapse();

6
pages/issue/js/issue.js

@ -25,7 +25,7 @@ export function createDetailInfo(location, detail) {
} else { } else {
item.qty += detail.qty item.qty += detail.qty
//在零件下查找库位 //在零件下查找库位
let location = item.Locations.find(r => r.FromLocationCode == detail.FromLocationCode); let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode);
if (location == undefined) { if (location == undefined) {
location = createLocationInfo(detail); location = createLocationInfo(detail);
item.Locations.push(location); item.Locations.push(location);
@ -46,6 +46,8 @@ export function createItemInfo(detail) {
let item = { let item = {
itemCode: detail.itemCode, itemCode: detail.itemCode,
itemName: detail.itemName, itemName: detail.itemName,
productionLineCode:detail.productionLineCode,
workStationCode:detail.workStationCode,
stdPackQty: detail.stdPackQty, stdPackQty: detail.stdPackQty,
stdPackUnit: detail.stdPackUnit, stdPackUnit: detail.stdPackUnit,
qty: detail.qty, qty: detail.qty,
@ -60,7 +62,7 @@ export function createItemInfo(detail) {
export function createLocationInfo(detail) { export function createLocationInfo(detail) {
let location = { let location = {
FromLocationCode: detail.FromLocationCode, fromLocationCode: detail.fromLocationCode,
qty: detail.qty, qty: detail.qty,
uom: detail.uom, uom: detail.uom,
handleQty: 0, handleQty: 0,

402
pages/issue/record/issueRecord.vue

@ -1,184 +1,218 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class="" v-if='detailSource.length==0'> <view class="" v-if='detailSource.subList.length==0'>
<com-blank-view @goScan='goScan()'></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">
<scroll-view scroll-y="true" class=""> <comIssueRequestCreator ref="issueRequest" :dataContent="detailSource">
<view v-for="(toLocation, index) in detailSource"> </comIssueRequestCreator>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" <button class="btn_add" @click="goScan(false)">+去添加</button>
@updateData='updateData'> </view>
</com-issue-detail-card>
</view> <div class="btn_bottom">
</scroll-view> <view class="" style="display: flex;flex-direction: row;">
<button class="btn_add" @click="goScan()">+去添加</button> <view class="">
</view> <button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
<div class="btn_bottom"> </view>
<view class="" style="display: flex;flex-direction: row;"> </div>
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button> <com-scan-issue-pack ref="comScanIssuePack">
</view> </com-scan-issue-pack>
</view> <comMessage ref="comMessage"></comMessage>
</div> </view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> <com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScanPopup' @updateData='updateData'> </template>
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage> <script>
</view> import {
</view> issueRequestSubmit,
<com-issue-request-popup ref="comIssueRequestPopup" @confirm='requestConfirm'></com-issue-request-popup> issueRecordSubmit
</template> } from '@/api/request2.js';
<script> import {
// import { goHome,
// getIssueJobDetail, updateTitle,
// } from '@/api/request.js'; getRemoveOption,
getISODateTime
import { } from '@/common/basic.js';
// getIssueJobDetail,
issueRequestSubmit, import {
issueRecordSubmit getDataSource
} from '@/api/request2.js'; } from '@/pages/issue/js/issue.js';
import { import comBlankView from '@/mycomponents/common/comBlankView.vue'
goHome, import comIssueRequestPopup from '@/pages/issue/coms/comIssueRequestPopup.vue'
getRemoveOption, import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
getISODateTime import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
} from '@/common/basic.js'; import comMessage from '@/mycomponents/common/comMessage.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import {
getDataSource export default {
} from '@/pages/issue/js/issue.js'; name: 'issueRequestSubmit',
components: {
import comBlankView from '@/mycomponents/common/comBlankView.vue' comBlankView,
import comIssueRequestPopup from '@/pages/issue/coms/comIssueRequestPopup.vue' comIssueRequestPopup,
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' jobDetailPopup,
import winScanButton from '@/mycomponents/scan/winScanButton.vue' comScanIssuePack,
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue' comMessage,
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' comIssueRequestCreator
import comMessage from '@/mycomponents/common/comMessage.vue' },
data() {
export default { return {
name: 'issueDetail', subList: [], //subList
components: { detailSource: {
comBlankView, subList: []
comIssueRequestPopup, }, //
jobDetailPopup, detailOptions: [],
winScanButton, scanOptions: [],
comIssueDetailCard, fromType:""
comScanIssuePack,
comMessage }
}, },
data() { mounted() {
return { this.goScan(true)
id: '1689889453461090304', },
jobContent: {}, // onLoad(option) {
subList: [], //subList this.fromType = option.fromType
detailSource: [], // if(this.fromType=="requestType"){
detailOptions: [], updateTitle("发料申请")
scanOptions: [], }else {
requestList: [] ,// updateTitle("发料记录")
fromType:"" }
}
}, },
mounted() { methods: {
this.goScan() goScan(editPosition) {
}, this.$refs.comIssueRequestPopup.openRequestPopup(editPosition);
onLoad(option) { },
this.fromType = option.fromType
if(this.fromType=="requestType"){ updateTitle("发料申请") }else { updateTitle("发料记录") } //
}, requestConfirm(action, item) {
methods: {
goScan() { if (this.detailSource.subList.length == 0) {
this.$refs.comIssueRequestPopup.openRequestPopup(this.detailSource[0]); this.detailSource = {
}, workshopCode: item.workshopCode,
workShopName: item.workShopName,
//
requestConfirm(action, item) { totalQty: 0,
// subList: []
this.getDetail(action, item); }
}, var subItem = {
productionLineCode: item.productionLineCode,
getDetail(action, item) { productionLineName: item.productionLineName,
var that = this; workStationCode: item.workStationCode,
uni.showLoading({ workStationName: item.workStationName, //
title: "加载中....", itemCode: item.itemCode,
mask: true itemName: item.itemName,
}); qty: item.qty,
getIssueJobDetail(this.id).then(res => { uom: item.uom
if (res.data[0].subList.length > 0) { }
that.subList = res.data[0].subList; this.detailSource.subList.push(subItem)
if (action == 'update') //, } else {
{ var result = this.detailSource.subList.filter(res => {
let index = that.detailSource[0].Items.findIndex(r => r.itemCode == item.itemCode); if (res.itemCode == item.itemCode&&
if (index >= 0) { res.productionLineCode==item.productionLineCode&&
that.detailSource[0].Items.splice(index, 1); res.workStationCode==item.workStationCode) {
} return res
} }
that.detailSource = getDataSource(that.detailSource, that.subList) })
that.resizeCollapse();
} //
uni.hideLoading(); if (result.length == 0) {
}).catch(error => { var subItem = {
uni.hideLoading() productionLineCode: item.productionLineCode,
this.showErrorMessage(error) productionLineName: item.productionLineName,
}) workStationCode: item.workStationCode,
}, workStationName: item.workStationName, //
itemCode: item.itemCode,
itemName: item.itemName,
updateData(record) { qty: item.qty,
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); uom: item.uom
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); }
let itemHandleQty = 0;
if (item != undefined) { this.detailSource.subList.push(subItem)
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b } else {
.packingNumber == '') && b.batch == //
record.batch); result[0].qty += item.qty
let handleQty = 0; }
batch.Records.forEach(res => { }
handleQty += Number(res.qty) this.caclcQty();
}) if (this.$refs.issueRequest != undefined) {
batch.handleQty = handleQty; this.$refs.issueRequest.update()
itemHandleQty += handleQty; }
}) },
}
// item.handleQty=itemHandleQty; caclcQty() {
}, var totalQty = 0;
this.detailSource.subList.forEach(res => {
openScanDetailPopup() { totalQty += res.qty
var datacontent = {} })
// this.detailSource.totalQty = totalQty;
// Object.assign(datacontent, this.detailSource); },
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
},
setParams() {
closeScanPopup() { return this.detailSource
this.resizeCollapse(); },
}, submit() {
uni.showLoading({
resizeCollapse() { title: "提交中....",
this.$nextTick(r => { mask: true
this.$refs.comIssueDetailCard.forEach(r => { });
r.resizeCollapse(); if(this.fromType =="requestType"){
}) var params = this.setParams()
}); console.log("提交参数", JSON.stringify(params));
}, issueRequestSubmit(params).then(res => {
submit(){ uni.hideLoading()
if(this.fromType=="requestType"){ if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料申请" + res.data)
}else { } else {
this.showErrorMessage("提交失败" + res.msg)
} }
}).catch(error => {
} uni.hideLoading()
} this.showErrorMessage(error)
} })
</script> }else {
var params = this.setParams()
<style> console.log("提交参数", JSON.stringify(params));
</style> issueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料记录" + res.data)
} else {
this.showErrorMessage("提交失败" + res.msg)
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
if(this.fromType =="requestType"){
uni.navigateTo({
url: './issueRequest'
})
}
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
}
}
</script>
<style>
</style>

5
pages/issue/request/issueRequest.vue

@ -193,8 +193,11 @@
}, },
openScanDetailPopup() { openScanDetailPopup() {
// uni.navigateTo({
// url: "../request/issueRequestSubmit?fromType=" + this.fromType
// })
uni.navigateTo({ uni.navigateTo({
url: "../request/issueRequestSubmit?fromType=" + this.fromType url: "../record/issueRecord?fromType=" + this.fromType
}) })
}, },

51
pages/issue/request/issueRequestSubmit.vue

@ -18,7 +18,7 @@
</view> </view>
</div> </div>
<com-scan-issue-pack ref="comScanIssuePack" > <com-scan-issue-pack ref="comScanIssuePack">
</com-scan-issue-pack> </com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -27,7 +27,6 @@
</template> </template>
<script> <script>
import { import {
issueRequestSubmit, issueRequestSubmit,
issueRecordSubmit issueRecordSubmit
@ -91,12 +90,13 @@
if (this.detailSource.subList.length == 0) { if (this.detailSource.subList.length == 0) {
this.detailSource = { this.detailSource = {
workShopCode: item.workShopCode, workshopCode: item.workshopCode,
workShopName: item.workShopName, workShopName: item.workShopName,
productionLineCode:item.productionLineCode, productionLineCode: item.productionLineCode,
productionLineName:item.productionLineName, productionLineName: item.productionLineName,
workStationCode:item.workStationCode, workStationCode: item.workStationCode,
workStationName: item.workStationName,// workStationName: item.workStationName, //
totalQty: 0,
subList: [] subList: []
} }
var subItem = { var subItem = {
@ -131,14 +131,26 @@
} else { } else {
// //
result[0].qty += item.qty result[0].qty += item.qty
} }
}
this.caclcQty();
if (this.$refs.issueRequest != undefined) {
this.$refs.issueRequest.update() this.$refs.issueRequest.update()
} }
}, },
caclcQty() {
var totalQty = 0;
this.detailSource.subList.forEach(res => {
totalQty += res.qty
})
this.detailSource.totalQty = totalQty;
},
setParams() { setParams() {
return this.detailSource return this.detailSource
}, },
submit() { submit() {
uni.showLoading({ uni.showLoading({
@ -147,18 +159,17 @@
}); });
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 => {
// uni.hideLoading() uni.hideLoading()
// if (res.data) { if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data) this.showCommitSuccessMessage("提交成功<br>生成发料申请" + res.data)
// } else { } else {
// this.showErrorMessage("" + res.msg) this.showErrorMessage("提交失败" + res.msg)
// } }
// }).catch(error => { }).catch(error => {
// uni.hideLoading() uni.hideLoading()
// this.showErrorMessage(error) this.showErrorMessage(error)
// }) })
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {

38
pages/purchaseReturn/record/returnRecord.vue

@ -83,11 +83,8 @@
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
fromLocationCode: "", fromLocationCode: "",
fromLocationInfo: {},
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {}, // businessType: {}, //
poNumber: '', poNumber: '',
fromType: "" fromType: ""
@ -230,7 +227,7 @@
// purchaseReturnRequestSubmit(params).then(res => { // purchaseReturnRequestSubmit(params).then(res => {
// uni.hideLoading() // uni.hideLoading()
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, ) // this.showCommitSuccessMessage("<br>退" + res.data, )
// } else { // } else {
// this.showErrorMessage(""+res.msg) // this.showErrorMessage(""+res.msg)
// } // }
@ -252,10 +249,10 @@
var params = this.setParams(true) var params = this.setParams(true)
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// putawayRecordSubmit(params).then(res => { // purchaseReturnRecordSubmit(params).then(res => {
// uni.hideLoading() // uni.hideLoading()
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data ) // this.showCommitSuccessMessage("<br>退" + res.data )
// } else { // } else {
// this.showErrorMessage(""+res.msg) // this.showErrorMessage(""+res.msg)
// } // }
@ -268,18 +265,7 @@
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}); });
// purchaseReturnRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data )
// } else {
// this.showErrorMessage(""+res.msg)
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} }
} else { } else {
@ -358,17 +344,23 @@
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
// if (this.fromType == "requestType") {
this.subList = []; uni.navigateTo({
this.detailSource = []; url: '../request/issueRequest'
this.toLocationInfo = {} })
}else {
//
this.subList = [];
this.detailSource = [];
this.toLocationInfo = {}
}
}) })
} }
} }

Loading…
Cancel
Save