Browse Source

修改发料任务

wms3.0_pda
lijuncheng 1 year 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) {
return request({
url: baseApi + "/wms/purchasereceipt-job-main/accept?id=" + id,
url: baseApi + "/wms/issue-job-main/accept?id=" + id,
method: "put",
data: {},
});
@ -820,12 +820,24 @@ export function takeIssueJob(id) {
*/
export function cancleTakeIssueJob(id) {
return request({
url: baseApi + "/wms/purchasereceipt-job-main/abandon?id=" + id,
method: "get",
url: baseApi + "/wms/issue-job-main/abandon?id=" + id,
method: "put",
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) {
return request({
url: baseApi + "/wms/purchasereturn-request-main/submit",
method: "put",
url: baseApi + "/wms/issue-record-main/create",
method: "post",
data: params,
});
}

2
mycomponents/balance/handleBalance.vue

@ -8,7 +8,7 @@
<view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<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>

2
mycomponents/balance/recommendBalance.vue

@ -8,7 +8,7 @@
<view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<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>

2
mycomponents/package/packageBalance.vue

@ -8,7 +8,7 @@
<view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<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>

2
mycomponents/package/packageHandle.vue

@ -9,7 +9,7 @@
<view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<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>

2
mycomponents/recommend/recommendBalance.vue

@ -4,7 +4,7 @@
<view>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<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>
<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();
},
selectedItem(item) {
if (item.locationCode != this.FromLocationCode) {
this.showErrorMessage("来源库位[" + this.FromLocationCode + "]无库存")
if (item.locationCode != this.fromLocationCode) {
this.showErrorMessage("来源库位[" + this.fromLocationCode + "]无库存")
return;
}
},

4
pages/demo/demo.vue

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

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

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

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

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

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

@ -132,9 +132,9 @@
if (location != undefined) {
location.Items.forEach(item => {
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;
} else {

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

@ -207,7 +207,7 @@
} else {
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) {
location = that.createLocationInfo(detail);
item.Locations.push(location);
@ -240,7 +240,7 @@
createLocationInfo(detail) {
let location = {
FromLocationCode: detail.FromLocationCode,
fromLocationCode: detail.fromLocationCode,
qty: detail.qty,
uom: detail.uom,
handleQty: 0,
@ -357,7 +357,7 @@
})
} 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)
if (batch == undefined || batch == null) {
if (jobContent.AllowModifyBach == 1) {

21
pages/issue/coms/comIssueDetailCard.vue

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

2
pages/issue/coms/comIssueRecommend.vue

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

14
pages/issue/coms/comIssueRequestCreator.vue

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

111
pages/issue/coms/comIssueRequestPopup.vue

@ -94,13 +94,12 @@
data() {
return {
// itemCode: 'CE115F11161AG',
workShopCode: "", //
workshopCode: "", //
workShopName: "",
productionLineCode: "",//线
productionLineName:"",
workStationCode: "",//
workStationName:"",
itemCode: '',
itemName: "",
qty: 0,
@ -115,102 +114,7 @@
positionInfo: "请选择位置",
show: false,
isModifiedPosition: true,
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"
}
],
positionList:[],
list: [{
value: 1,
label: '车间1',
@ -287,7 +191,7 @@
openRequestPopup(editPosition) {
if(this.positionList.length==0){
getWorkShopLineStation().then(res=>{
// this.positionList =res
this.positionList =res
}).catch(error=>{
})
@ -370,7 +274,7 @@
callback(action) {
let item = {
positionInfo: this.positionInfo,
workShopCode: this.workShopCode,//
workshopCode: this.workshopCode,//
workShopName: this.workShopName,
productionLineCode: this.productionLineCode,//线
productionLineName:this.productionLineName,
@ -416,19 +320,14 @@
},
confirmSelect(e) {
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("位置value",positionInfoValue)
this.workShopCode = e[0].value
this.workshopCode = e[0].value
this.productionLineCode = e[1].value
this.workStationCode = e[2].value
this.workShopName= e[0].label
this.productionLineName = e[1].label
this.workStationName = e[2].label
},
getItemCodeListByProLine(lineCode) {

76
pages/issue/coms/comScanIssuePack.vue

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

6
pages/issue/js/issue.js

@ -25,7 +25,7 @@ export function createDetailInfo(location, detail) {
} else {
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) {
location = createLocationInfo(detail);
item.Locations.push(location);
@ -46,6 +46,8 @@ export function createItemInfo(detail) {
let item = {
itemCode: detail.itemCode,
itemName: detail.itemName,
productionLineCode:detail.productionLineCode,
workStationCode:detail.workStationCode,
stdPackQty: detail.stdPackQty,
stdPackUnit: detail.stdPackUnit,
qty: detail.qty,
@ -60,7 +62,7 @@ export function createItemInfo(detail) {
export function createLocationInfo(detail) {
let location = {
FromLocationCode: detail.FromLocationCode,
fromLocationCode: detail.fromLocationCode,
qty: detail.qty,
uom: detail.uom,
handleQty: 0,

402
pages/issue/record/issueRecord.vue

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

38
pages/purchaseReturn/record/returnRecord.vue

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

Loading…
Cancel
Save