Browse Source

完善物料变更功能及按计划完工

hella_online_20240829
niexiting 2 months ago
parent
commit
2c7a88ee40
  1. 2
      .env.development
  2. 21
      src/api/request2.js
  3. 7
      src/common/style/new_style.css
  4. 4
      src/mycomponents/balance/balance.vue
  5. 39
      src/mycomponents/balance/light.vue
  6. 32
      src/mycomponents/scan/winComScanBalance.vue
  7. 289
      src/pages/fg/fgChange.vue
  8. 14
      src/pages/fg/receiptByPlan.vue
  9. 13
      src/pages/fg/receiptNoPlan.vue

2
.env.development

@ -1,4 +1,4 @@
VITE_BASE_URL=http://192.168.0.128:12080/admin-api
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
# 租户配置

21
src/api/request2.js

@ -4367,6 +4367,27 @@ export function getProductionlineAndWorkStation() {
});
}
//获取物料变更信息
export function getSpareitemcode(params) {
return request({
url: baseApi + "/wms/productionitemcode-spareitemcode/getRelation",
method: "get",
data: params,
});
}
//获取物料变更信息
export function getProductreceiptDetailbByPackingNumber(packingNumber) {
return request({
url: baseApi + "/wms/productreceipt-detailb/getProductreceiptDetailbByPackingNumber?packingNumber=" +
packingNumber,
method: "get",
data: {},
});
}
/**
* 打印机列表
*/

7
src/common/style/new_style.css

@ -2070,7 +2070,7 @@ button::after {
.card_content {
font-size: 35rpx;
font-weight: bold;
padding: 5px;
/* padding: 5px; */
}
.card_big_content {
@ -2109,6 +2109,11 @@ button::after {
font-size: 30rpx;
}
.card_light {
color: #0076F6;
padding: 5px;
font-size: 30rpx;
}
.card_container_content {
font-size: 32rpx;

4
src/mycomponents/balance/balance.vue

@ -20,9 +20,9 @@
:isShowStatus='isShowStatus'>
</compare-qty>
<view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<!-- <view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; width: 20px;" @click="copy">复制</text>
</view>
</view> -->
</view>
<!-- <view class="" v-if="isShowStatus && dataContent.inventoryStatus">
<move-status :fromInventoryStatus="dataContent.inventoryStatus">

39
src/mycomponents/balance/light.vue

@ -0,0 +1,39 @@
<template>
<view class="card_view">
<text class="card_light ">{{title}}</text>
<text class="card_content ">{{lightCode}}</text>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
}
},
props: {
lightCode: {
type: String,
default: ''
},
title:
{
type:String,
default: '灯码'
}
},
watch: {
},
methods: {
}
}
</script>
<style>
</style>

32
src/mycomponents/scan/winComScanBalance.vue

@ -21,8 +21,6 @@
</view>
</uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<!-- 模拟扫描功能 -->
</view>
<comMessage ref="comMessage"></comMessage>
</template>
@ -75,9 +73,11 @@
bussinessCode: {
type: String,
default: ''
},
verifyCategory: {
type: Boolean,
default: false
}
},
data() {
return {
@ -178,11 +178,21 @@
getBasicItemByCode(itemCode).then(res => {
if (res.data != null && res.data.list.length > 0) {
var result = res.data.list[0];
var status = result.status;
var status = result.available;
var type = result.type;
if (status == "ENABLE") {
if (status == "TRUE") {
if (checkDirectoryItemExist(this.itemTypesList, type)) {
if (this.verifyCategory) {
if (result.category == 'LCJ' || result.category == 'BJ') {
callBack()
}
else
{
this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】")
}
} else {
callBack()
}
} else {
var hint = getListItemTypeDesc(this.itemTypesList);
uni.hideLoading()
@ -223,12 +233,12 @@
if (this.$refs.comscan) {
this.$refs.comscan.getfocus()
}
},
losefocus() {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus()
}
}
}
}
</script>

289
src/pages/fg/fgChange.vue

@ -6,42 +6,20 @@
<view class="page-wraper" v-if="currentPackage!=null">
<view class="page-main">
<uni-collapse>
<uni-collapse-item>
<uni-collapse-item :open="true">
<template v-slot:title>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx;">
变更前包装信息
变更信息
</view>
</template>
<PackageAndItemCard :dataContent='currentPackage'></PackageAndItemCard>
</uni-collapse-item>
</uni-collapse>
<view>
<scroll-view scroll-y="true" class="">
<view class="" v-for="(item, index) in fgList" :key="index">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options">
<view class="uni-flex uni-row "
style="margin-left: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx;">
<!-- scan_view -->
<view class="auto-wrap"
style="font-size: 35rpx;font-weight: bold; width: 100%;">
<text style="font-size: 30rpx;color: #B66463;">唯一码 </text>
{{item.remark}}
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</scroll-view>
<view class="">
<view class="uni-flex uni-row u-col-center padding_10 "> <text
style="font-size: 28rpx;">变更前物料</text>
<view class="card_itemCode" style="margin-left: 20rpx; ">
{{currentPackage.itemCode}}
</view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<view class="uni-flex uni-row u-col-center">
<view class="uni-flex uni-row u-col-center padding_10">
<text style="font-size: 28rpx;">变更后物料</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="card_itemCode" style="margin-left: 20rpx; color: blue;">
@ -49,26 +27,53 @@
</view>
<view class="">
<image src="/static/icons/down.svg" mode=""
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;" @click="showSelect">
style=" width: 40rpx;height: 40rpx;margin-left: 20rpx;">
</image>
</view>
<u-select v-model="show" mode="single-column" :list="toItemList"
@confirm="confirmSelect"></u-select>
</view>
</view>
<view class="uni-flex uni-row u-col-center padding_10"><text
style="font-size: 28rpx;">变更原因</text>
<view class="uni-flex uni-row">
<uni-easyinput style=" margin-left: 20px;" v-model="reason"></uni-easyinput>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
<balance style="margin-top: 5px;" :dataContent='currentPackage' :isShowFromLocation='false'></balance>
<view style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx;"
v-for="(item, index) in fgList" :key="index">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options">
<view :class="item.scaned==true?'scan_view':'auto-wrap'">
<light :lightCode='item.remark'></light>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view></view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-button @goScan='openScanFgPopup'></win-scan-button>
</view>
<win-com-scan-balance ref="scanPopup" @getBalance='getPackScanResult' :bussinessCode="bussinessCode">
<win-com-scan-balance ref="scanPopup" @getBalance='getPackScanResult' :bussinessCode="bussinessCode" :verifyCategory='true'>
</win-com-scan-balance>
<win-scan-fg-label ref="scanPopup" @getResult='getFgScanResult' title='制品标签'></win-scan-fg-label>
<win-scan-fg-label ref="scanFgPopup" @getResult='getFgScanResult' title='灯码'></win-scan-fg-label>
<!-- <win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签" headerType="HMQ"></win-scan-pack> -->
<comMessage ref="comMessage"></comMessage>
</view>
@ -114,6 +119,8 @@
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import balance from '@/mycomponents/balance/balance.vue'
import light from '@/mycomponents/balance/light.vue'
export default {
components: {
@ -123,24 +130,20 @@
comBlankView,
PackageAndItemCard,
winComScanBalance,
winScanFgLabel
winScanFgLabel,
balance,
light
},
data() {
return {
detailSource: [], //
toLocationCode: "",
fromLocationTypeList: [],
fromLocationCode: "",
bussinessCode: "Relegate",
businessType: {},
dataContent: {},
managementList: [],
show: false,
toItemCode: "请选择变更后物料",
toItemList: [],
fgList: [],
options: [],
currentPackage: null,
bussinessCode: "Relegate"
reason: ''
};
},
mounted() {
@ -179,7 +182,6 @@
});
},
getPackScanResult(result) {
let label = result.label;
let pack = result.package;
@ -218,6 +220,7 @@
getProductreceiptDetailbByPackingNumber(pack.number).then(res => {
if (res.data.length > 0) {
this.fgList = res.data;
let pack = result.package;
let balance = result.balance;
this.currentPackage = result.package;
@ -231,9 +234,6 @@
}).catch(res => {
this.showErrorMessage(res.message);
})
}
}).catch(res => {
this.showErrorMessage(res.message);
@ -241,36 +241,38 @@
},
getFgScanResult(result) {
let that = this;
var itemIndex = this.allList.findIndex(r =>
r.content == result.content);
var item = this.fgList.find(r =>
r.remark == result.content);
//
if (itemIndex == -1) {
// if (this.allList.length > this.dataContent.packQty) {
// this.showErrorMessage("")
// return;
// }
result.countTime = new Date();
this.allList.push(result);
this.allList.sort(compare('countTime')); //
this.initList()
this.scanPopupGetFocus();
this.calcFgQty();
} else {
this.$refs.comMessage.showQuestionMessage("唯一码【" + result.content +
if (item != undefined) {
var index = this.fgList.findIndex(r =>
r.remark == result.content);
if (item.scaned == true) {
this.$refs.comMessage.showQuestionMessage("灯码【" + result.content +
'】已经扫描,是否移除',
res => {
if (res) {
this.allList.splice(itemIndex, 1)
this.allList.sort(compare('countTime')); //
this.initList()
that.calcFgQty();
item.scaned = false;
this.fgList.splice(index, 1)
this.fgList.push(item); //();
}
})
} else {
item.scaned = true;
this.fgList.unshift(this.fgList.splice(index, 1)[0]); //();
}
this.calcHandleQty();
} else {
this.showErrorMessage("扫描的灯码不在灯码列表中")
}
},
calcHandleQty() {
if (this.fgList.length > 0) {
this.currentPackage.handleQty =
this.fgList.filter(r => r.scaned == true).length
}
},
openScanPopup() {
setTimeout(r => {
@ -279,118 +281,45 @@
})
},
openScanFgPopup() {
setTimeout(r => {
this.$refs.scanFgPopup.openScanPopup(this.currentPackage.itemCode);
this.scanFgPopupGetFocus();
})
},
commit() {
if (this.positionInfo == "请选择位置") {
this.showMessage("请先选择位置")
if (this.toItemCode == "请选择变更后物料") {
this.showMessage("请选择变更后物料")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
productionReceiptRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
if (this.currentPackage.handleQty == null) {
this.$refs.comMessage.showQuestionMessage('是否要将全部灯码进行变更?', res => {
if (res) {
this.commitRecord();
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
this.$refs.comMessage.showQuestionMessage('是否要将已扫描的【' + this.currentPackage.handleQty + '】个灯码进行变更?',
res => {
if (res) {
this.commitRecord();
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.fgLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
commitRecord() {
// this.showCommitSuccessMessage('')
},
setParams() {
let scanedList = this.fgList.filter(r => r.scaned == true)
if (this.currentPackage.handleQty > 0) {
scanedList = this.fgList.filter(r => r.scaned == true)
}
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var submitItem = deepCopyData(detail)
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode;
submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.workshopCode = this.workshopCode;
return this.dataContent;
},
@ -426,6 +355,12 @@
}
},
scanFgPopupGetFocus() {
if (this.$refs.scanFgPopup != undefined) {
this.$refs.scanFgPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus();
@ -443,29 +378,17 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
this.openScanPopup();
})
},
clearData() {
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {};
this.positionInfo = "请选择位置";
this.fgLocationCode = ""
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
this.toItemCode = "请选择变更后物料";
this.toItemList = [];
this.fgList = [];
this.currentPackage = null;
this.reason = '';
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
showSelect() {
this.show = !this.show

14
src/pages/fg/receiptByPlan.vue

@ -47,7 +47,7 @@
</view>
<view style="word-break: break-all; font-size: 35rpx; font-weight: bold;">
<text v-if="dataContent.handleQty>0" style="color: #FFA500;">{{dataContent.handleQty}}/</text>
{{dataContent.packQtyHint}}
<text class="text_recommend">{{dataContent.packQtyHint}}</text>
</view>
</view>
<view class='split_line' v-if="dataContent"></view>
@ -61,15 +61,15 @@
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" @click="swipeClick($event,item,index)">
<view class="uni-flex uni-row "
style="margin-left: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx;">
<view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx;" >
<light :lightCode='item.content'></light>
<!-- <view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
<text style="font-size: 30rpx;color: #B66463;">唯一码 </text>
{{item.content}}
</view>
</view> -->
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</scroll-view>
@ -122,6 +122,7 @@
import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import light from '@/mycomponents/balance/light.vue'
import {
Exception
} from 'sass';
@ -135,7 +136,8 @@
pack,
winScanButton,
winScanFgLabel,
comFgCard
comFgCard,
light
},
data() {
return {

13
src/pages/fg/receiptNoPlan.vue

@ -34,7 +34,8 @@
</view>
<view style="word-break: break-all; font-size: 35rpx; font-weight: bold;">
<text v-if="dataContent.handleQty>0" style="color: #FFA500;">{{dataContent.handleQty}}/</text>
{{dataContent.packQtyHint}}
<!-- {{dataContent.packQtyHint}} -->
<text class="text_recommend" >{{dataContent.packQtyHint}}</text>
</view>
</view>
</view>
@ -46,11 +47,12 @@
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" @click="swipeClick($event,item,index)">
<view class="uni-flex uni-row "
style="margin-left: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx;">
<view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx;" >
<light :lightCode='item.content'></light>
<!-- <view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
<text style="font-size: 30rpx;color: #B66463;">唯一码 </text>
{{item.content}}
</view>
</view> -->
</view>
</uni-swipe-action-item>
</uni-swipe-action>
@ -108,6 +110,7 @@
import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from "@/mycomponents/scan/winScanFgLabel.vue"
import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import light from '@/mycomponents/balance/light.vue'
import {
Exception
} from 'sass';
@ -121,7 +124,7 @@
pack,
winScanButton,
winScanFgLabel,
comFgCard
comFgCard,light
},
data() {
return {

Loading…
Cancel
Save