cosmoim-852 fix 新增泰国虚拟补料

master
guoshuang 3 years ago
parent 36ae52556a
commit eb0a1e7296

@ -510,5 +510,11 @@ export default {
rejectsOffline: '不良品下线',
ResponsibleProcess: '责任工序',
PleaseThere: '请输入责任工序',
rawWasteJudgment: '原材料判废',
reason1: '原因',
ResponsibilityCategory: '责任大类',
Please_category: '请选择责任大类',
VirtualReplenishment: '虚拟补料',
VirtualInventory: '虚拟库存',
},
};

@ -510,5 +510,11 @@ export default {
rejectsOffline: 'Defective products offline',
ResponsibleProcess: 'Responsible process',
PleaseThere: 'Please enter the responsible operation',
rawWasteJudgment: 'Waste judgment of raw materials',
reason1: 'reason',
ResponsibilityCategory: 'Responsibility category',
Please_category: 'Please select the responsibility category',
VirtualReplenishment: 'Virtual replenishment',
VirtualInventory: 'Virtual inventory',
},
};

@ -510,5 +510,11 @@ export default {
rejectsOffline: 'нижняя линия дефекта',
ResponsibleProcess: 'ответственная операция',
PleaseThere: 'Введите ответственную операцию',
rawWasteJudgment: 'утилизация сырья',
reason1: 'причина',
ResponsibilityCategory: 'категория ответственности',
Please_category: 'Выберите категорию ответственности',
VirtualReplenishment: 'виртуальная добавка',
VirtualInventory: 'виртуальный запас',
},
};

@ -1250,6 +1250,14 @@
"navigationBarTextStyle": "white" // white-black-
}
},
// {
// "path": "pages/raw/LineSide/rawWasteJudgment/index",
// "style": {
// "navigationBarTitleText": "原材料判废",
// "navigationStyle": "custom", //
// "navigationBarTextStyle": "white" // white-black-
// }
// },
{
"path": "pages/product/STO-Outbound/index",
"style": {
@ -1263,6 +1271,22 @@
"style": {
"navigationBarTitleText": "演示"
}
},
{
"path": "pages/raw/handover/VirtualReplenishment/Location",
"style": {
"navigationBarTitleText": "虚拟补料",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/VirtualReplenishment/Local-details",
"style": {
"navigationBarTitleText": "虚拟补料详细页面",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
}
],
"globalStyle": {

@ -0,0 +1,78 @@
<template>
<view class="page-receipt-detail">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="go" />
</view>
<view class="title">{{ $t('message.Pi_QueryResults') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="model.detailedList" :show-vert-border="false"></wyb-table>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { headers } from './config';
import model from './model';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
headers = headers;
go() {
this.redirectTo(this.page.raw.handover.feeding.Location);
}
}
</script>
<style lang="scss" scoped>
.page-receipt-detail {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 30rpx;
min-height: 100%;
padding-top: 118rpx;
padding-bottom: 162rpx;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
display: flex;
height: 88rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
}
</style>
function go() { throw new Error('Function not implemented.'); }

@ -0,0 +1,658 @@
<template>
<view class="page-raw-receipt">
<view class="top"></view>
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="back" />
</view>
<view class="title">{{ $t('message.VirtualReplenishment') }}</view>
<view class="right"></view>
</view>
<view class="content">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.InventoryOrderNo') }}:</view>
<u-search :placeholder="$t('message.InventoryPleaseScan')" v-model="form.documentNo" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</view>
</view>
<!-- 物料 -->
<view class="material">
<view class="material-left">
<view>{{ $t('message.CommissionedMaterielNo') }}:</view>
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="materialChoice" showKey="value" valKey="value" :val="some.materialCode" class="search" :options="materialList" />
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.CommissionedMaterielDesc') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.materialDesc }}</view>
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.Feeding_ReplenishedQuantity') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.totalFillAmount }}</view>
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.Replenishment_Number') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.amount }}</view>
</view>
</view>
<!-- 列表展示数据 -->
<view class="number">
<view class="number-left">
<view class="number-left-title">{{ $t('message.Pi_Station') }}:</view>
<u-input v-model="some.sendSpot" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'" />
</view>
<view class="number-right">
<view class="number-right-title">{{ $t('message.total') }}:</view>
<u-input placeholder=" " v-model="some.fillAmount" :type="type" :border="border" class="input" style="padding: '0'" disabled />
</view>
</view>
<!-- 库位 -->
<view class="library">
<view class="library-left">
<view>{{ $t('message.VirtualInventory') }}:</view>
<!-- <u-input :placeholder="$t('message.po_PleaseInput')" v-model="wlCode" disabled :border="border" class="input" /> -->
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode.value" class="search" :options="Location" />
</view>
<view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}:</view>
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="qty" type="number" :border="border" class="input" />
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view>
<!-- 表格 -->
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeader" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view>
<view class="bottom-bar">
<div class="extra">
<u-form ref="form" :model="form" :error-type="['toast']">
<u-row class="bottom-info"> </u-row>
</u-form>
</div>
<u-form ref="form2" :model="form2" :error-type="['toast']" style="background: rgb(255, 255, 255)">
<u-row class="bottom-info">
<u-col :span="6">
<u-form-item prop="operatorPass" :label="$t('message.Summary_Receiver')" label-width="120rpx">
<u-input v-model="operatorName" :border="border" @confirm="onOperatorConfirm" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item prop="rfPwd" :label="$t('message.Summary_Password')">
<u-input v-model="form2.rfPwd" :border="border" type="password" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
</u-form>
<div class="container">
<u-row>
<u-col :span="4">
<u-button type="primary" class="appoint" @click="bill">{{ $t('message.Feeding_ReplenishmentDetails') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onSubmit">
{{ $t('message.product_Upload') }}
</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="uni.navigateBack({})">
{{ $t('message.po_Return') }}
</u-button>
</u-col>
</u-row>
</div>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { session } from '@/store/modules/session';
import { VForm, VFormRules } from 'vue/types/form';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { detailHeader } from './config';
import { auth } from '@/store/modules/auth';
@Component({
components: {
jPicker,
},
})
export default class RawReceiptDetail extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
@Ref('form2') readonly $form2!: VForm;
submitForm = {
receiver: '',
receiverName: '',
password: '',
};
model = model;
materialList: any = [];
type = 'text';
wlCode: any = {};
border = true;
operatorName = '';
//
LocationList: any = [];
//
Location: any = [];
someIndex = 0;
some: any = {};
qty: any = '';
form: any = {
documentNo: '',
amount: null,
};
form2 = {
operatorPass: '', //
rfPwd: '',
};
rules: VFormRules<any> = {
amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }],
};
detailHeader = detailHeader;
sapSupplyIdList: any = [];
empty() {
this.some = {};
this.someIndex = 0;
this.qty = '';
this.Location = [];
this.wlCode = '';
this.materialList = [];
this.model.blDetailList.length = 0;
}
LocEmpty() {
this.some = {};
this.someIndex = 0;
this.qty = '';
this.wlCode = '';
this.materialList = [];
this.model.blDetailList.length = 0;
this.LocationList = [];
}
async back() {
if (this.sapSupplyIdList.length != 0) {
await this.lock();
}
uni.navigateBack({ delta: 1 });
}
async lock() {
await this.model.lock(this.sapSupplyIdList);
}
async query() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as string);
}
if (this.sapSupplyIdList.length != 0) {
await this.lock();
this.sapSupplyIdList = [];
}
this.LocEmpty();
//this.wlCode = this.Location[0];
let inPrdOrderList = this.form.documentNo.split(',');
let params = {
inPrdOrderList,
};
await this.model.queryBlDetailList(params).then(() => {
this.model.blDetailList.forEach((item: any) => {
let arr = {
label: item.materialCode,
value: item.materialCode,
sapSupplyId: item.sapSupplyId,
};
this.materialList.push(arr);
item.wlList = [];
this.sapSupplyIdList.push(item.sapSupplyId);
});
console.log('this.sapSupplyIdList', this.sapSupplyIdList);
this.some = this.model.blDetailList[0];
this.someIndex = 0;
});
await this.model.queryVirtual({
loginName: session.loginName,
sendSpot: this.some.sendSpot,
mrpCode: this.some.mrpCode,
materialCode: this.some.materialCode,
factoryCode: session.factoryCode,
});
if (this.model.LocList.length != 0) {
this.Location = [];
this.Location = this.model.LocList;
this.wlCode = this.Location[0];
} else {
console.log('1');
}
}
async materialChoice(e: any) {
this.model.blDetailList.forEach((item: any, index: any) => {
if (item.sapSupplyId == e.pickerName.sapSupplyId) {
this.some = item;
this.someIndex = index;
}
});
await this.model.queryVirtual({
loginName: session.loginName,
sendSpot: this.some.sendSpot,
mrpCode: this.some.mrpCode,
materialCode: this.some.materialCode,
factoryCode: session.factoryCode,
});
if (this.model.LocList.length != 0) {
this.Location = [];
this.Location = this.model.LocList;
this.wlCode = this.Location[0];
} else {
console.log('1');
// this.Location = [];
// let content = {
// loginName: session.loginName,
// sendSpot: null,
// factoryCode: session.factoryCode,
// workArea: session.workareaCode,
// };
// let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
// res.forEach((item: any) => {
// let pickerName: any = {};
// pickerName.label = item.locationCode;
// pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
// pickerName.sendSpot = item.sendSpot;
// this.Location.push(pickerName);
// });
// this.wlCode = this.Location[0];
}
this.qty = '';
}
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
async onOperatorConfirm(loginName: string) {
try {
const { userName } = await auth.getUserInfo({ loginName });
this.form2.operatorPass = loginName;
this.operatorName = userName;
} catch {
this.form2.operatorPass = '';
this.operatorName = '';
}
}
Add() {
if (this.qty == '' || this.wlCode == '') {
this.customToast(this.$t('message.AppendMateriel1') as string);
return;
}
if (parseFloat(this.qty) <= 0) {
this.customToast(this.$t('message.AppendMateriel2') as string);
return;
}
if (parseFloat(this.qty) > model.blDetailList[this.someIndex].amount) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
let num = parseFloat(this.qty);
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
num += parseFloat(item.qty);
});
if (num > this.model.blDetailList[this.someIndex].amount) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
let isTrue = true;
if (this.LocationList.length != 0) {
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
if (this.wlCode.sendSpot != item.Code) {
this.customToast(this.$t('message.AppendMateriel4') as string);
return (isTrue = false);
}
});
}
if (this.some == {}) {
this.customToast(this.$t('message.AppendMateriel5') as string);
return;
}
if (isTrue == true) {
let arr = {
wlCode: this.wlCode.label,
qty: this.qty,
Code: this.wlCode.sendSpot,
...this.some,
};
this.LocationList.push(arr);
this.model.blDetailList[this.someIndex].wlList.push(arr);
this.qty = '';
this.business();
}
}
deleteItem(e: any): void {
uni.showModal({
content: this.$t('message.product_Delete') as string,
cancelText: this.$t('message.Cancel') as string,
confirmText: this.$t('message.workArea_Confirm') as string,
success: (res) => {
if (res.confirm) {
let lineData = e.lineData;
let i: any;
this.model.blDetailList.forEach((item: any, index: any) => {
if (item.materialCode == lineData.materialCode && item.sendSpot == lineData.sendSpot) {
i = index;
}
});
let NextIndex: any;
this.model.blDetailList[i].wlList.forEach((item: any, index: any) => {
if (item.wlCode == lineData.wlCode && item.qty == lineData.qty) {
NextIndex = index;
}
});
this.model.blDetailList[i].wlList.splice(NextIndex, 1);
this.LocationList.splice(e.contentIndex, 1);
let num: any = 0;
this.model.blDetailList[i].wlList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.blDetailList[i].fillAmount = num;
console.log('this.model.blDetailList', this.model.blDetailList);
} else if (res.cancel) {
return;
}
},
});
}
business() {
let num = 0;
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.blDetailList[this.someIndex].fillAmount = num;
this.some.fillAmount = num;
console.log('this.model.blDetailList', this.model.blDetailList);
}
async onReady() {
let content = {
loginName: session.loginName,
sendSpot: null,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
console.log('res>>>>>>>>>>>>>>>>>>>>>>', res);
res.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.model.blDetailList.forEach((item: any) => {
item.receiptAmount = 0;
item.wlQTyList = [];
});
this.model.blDetailList.length = 0;
this.wlCode = this.Location[0];
}
async bill() {
if (this.some == {} || this.some.prdOrder == null) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.Commission_tips6') as string,
// });
this.customToast(this.$t('message.Commission_tips6') as string);
return;
}
let person = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: person.session.user.loginName,
prdOrder: this.some.prdOrder,
};
await this.model.querydetaildlist(content);
this.redirectTo(this.page.raw.handover.feeVirtualReplenishmentding.Local);
}
async onSubmit() {
this.model.blDetailList.forEach((item: any) => {
item.wlList.forEach((item: any) => {
item.wlList = null;
});
});
let dataList = this.model.blDetailList;
const params = {
dataList,
...this.form2,
factoryCode: this.session.factoryCode,
loginName: this.session.loginName,
};
console.log(params);
await this.model.saveBl(params).then(() => {
this.qty = '';
this.LocationList = [];
this.sapSupplyIdList = [];
this.query();
});
}
}
</script>
<style lang="scss" scoped>
.page-raw-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 88rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.content {
width: 100%;
background: white;
border-radius: 15rpx;
padding: 10rpx;
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 110rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-left {
width: 100%;
height: 100%;
display: flex;
view {
width: 145rpx;
line-height: 100rpx;
}
.search {
padding-left: 12px;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right {
width: 100%;
height: 100%;
display: flex;
.material-right-title {
width: 145rpx;
height: 100%;
line-height: 100rpx;
}
.material-right-code {
width: 80%;
height: 100%;
line-height: 100rpx;
text-align: left;
padding-left: 10px;
// line-height: 100rpx;
}
}
}
.number {
height: 100rpx;
display: flex;
.number-left {
width: 50%;
height: 100%;
display: flex;
.number-left-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
.number-right {
width: 50%;
height: 100%;
display: flex;
.number-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
text-align: center;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
}
.library {
width: 100%;
height: 100rpx;
display: flex;
.library-left {
width: 50%;
height: 100%;
display: flex;
view {
width: 100rpx;
line-height: 100rpx;
}
.search {
padding-left: 19px;
text-align: left;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
text-align: center;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
}
.add {
width: 100%;
height: 100rpx;
position: relative;
button {
position: absolute;
top: 10rpx;
right: 20rpx;
}
}
}
.bottom-bar {
z-index: 21;
position: fixed;
bottom: 0;
left: 0;
right: 0;
.container {
background: #ffffff;
// box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.extra {
background-color: #fff;
margin: 5px;
border-radius: 5px;
padding: 0 10px;
}
.bottom-info {
.u-form-item {
padding: 0;
}
}
}
}
</style>

@ -0,0 +1,153 @@
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.InventoryOrderNo'),
key: 'prdOrder', //单号
width: 220,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode', //物料号
width: 220,
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc', //物料描述
width: 350,
},
{
label: vm.$t('message.po_ActualQuantity'),
key: 'fillAmount', //实际数量
},
{
label: vm.$t('message.Summary_Number'),
key: 'amount', //可退数量
},
{
label: vm.$t('message.Feeding_ReplenishedQuantity'),
key: 'totalFillAmount', //已拣数量
},
{
label: vm.$t('message.po_Location'),
key: 'locationCode', //库存地点
},
// {
// label: '工位',
// key: 'sendSpot',
// },
// {
// label: '行项目',
// key: 'groupId',
// },
// {
// label: '单位',
// key: 'unit',
// },
// {
// label: '凭证号',
// key: 'credNo',
// },
// {
// label: '发货地点',
// key: 'wkposCodeP',
// },
// {
// label: '工厂',
// key: 'sapFactoryCode',
// },
// {
// label: 'MRP',
// key: 'mrpCode',
// },
// {
// label: '生产订单',
// key: 'prdOrder',
// },
];
export const detailHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 260,
},
{
label: vm.$t('message.receiveAStation'),
key: 'sendSpot',
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
},
{
label: vm.$t('message.quantityNum'),
key: 'qty',
},
];
export const RUSdetailHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 260,
},
{
label: vm.$t('message.receiveAStation'),
key: 'sendSpot',
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
},
{
label: vm.$t('message.quantityNum'),
key: 'qty',
},
{
label: vm.$t('message.Container'),
key: 'barcode',
width: 700,
},
];
export const PropoHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 300,
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 450,
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
width: 300,
},
{
label: vm.$t('message.Production'),
key: 'prdOrder',
width: 300,
},
];
export const CreteListHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 200,
},
{
label: vm.$t('message.receiveAStation'),
key: 'sendSpot',
},
{
label: vm.$t('message.Production'),
key: 'prdOrder',
},
{
label: vm.$t('message.quantityNum'),
key: 'amount',
},
];

@ -0,0 +1,250 @@
import { Action, getModule, Module, Mutation, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { auth } from '@/store/modules/auth';
import { session } from '@/store/modules/session';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'raw.handover.VirtualReplenishment',
})
export class VirtualReplenishment extends VuexModule {
/**
*
*/
blDetailList: any[] = [];
detailedList: any;
LocList: any = [];
submitListCode: any = '';
// 容器码
ContainerCode: any = '';
/**
*
*/
locationList = [];
MaterialList: any = [];
/**
*
*/
get hasBlDetailChecked() {
return this.checkedBlDetailList.length > 0;
}
/**
*
*/
get checkedBlDetailList() {
return this.blDetailList.filter((_: any) => _.checked);
}
/**
*
*/
get hasBlDetailFillAmount() {
return this.blDetailList.findIndex((_: any) => _.fillAmount) > -1;
}
/**
*
*/
get blDetailUploadList() {
return this.blDetailList.map((item: any) => {
if (!item.checked) {
item.fillAmount = 0;
}
return item;
});
}
/**
*
*/
@Mutation
clearState() {
this.blDetailList = [];
}
/**
*
* @param params
*/
@Mutation
confirmCheckedBlDetailList(params: { locationCode: string; amount: number }) {
this.blDetailList
.filter((_: any) => _.checked)
.forEach((item: any) => {
if (params.locationCode) {
item.wkposCodeP = params.locationCode;
}
if (params.amount) {
item.fillAmount = params.amount;
}
});
}
@MutationAction
async queryVirtual(params: any = {}) {
const res: any = await http.post(url.sortscan.save.queryVirtualOrderAmountBl, params);
const LocList = [];
console.log('res', res);
const arr: any = {
label: res.data.sendSpot,
value: res.data.sendSpot + '(' + res.data.amount + ')',
};
LocList.push(arr);
console.log('LocList', LocList);
return { LocList };
}
/**
*
*/
@Action({ commit: 'clearState' })
async saveBl(params: any) {
await auth.checkPassword({
factoryCode: session.factoryCode as string,
loginName: params.operatorPass as string,
rfPwd: params.rfPwd,
});
await http.post(url.bl.virtual, {
factoryCode: session.factoryCode,
loginName: session.loginName,
...params,
});
uni.showToast({
//icon: "success",
title: 'success',
duration: 2000,
image: '/static/icons/icon-51.png',
});
}
/**
*
*/
@Action
async unlockBlDetailList() {
try {
const sapSupplyIdList = this.blDetailList.map((_) => _.sapSupplyId);
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
sapSupplyIdList,
};
await http.post(url.bl.unlock, params, {
custom: { hideError: true },
} as any);
} catch {
//
}
}
/**
*
*/
@MutationAction
async queryBlDetailList(params: any) {
const { list: blDetailList } = await http.post(url.bl.query, {
factoryCode: session.factoryCode,
loginName: session.loginName,
...params,
});
return { blDetailList };
}
//查询明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) {
const res: any = await http.post('/wmspda/tl/getBlListSn', content);
console.log('明细》》》》》》》》》', res.list);
this.detailedList = res.list;
return res;
}
/**
*
*/
@MutationAction
async queryLocationList() {
const result: any = await http.post(url.auth.query.location, {
factoryCode: session.factoryCode,
loginName: session.loginName,
workareaCode: session.workareaCode,
});
const locationList = result.list.map((_: any) => ({
label: _.locationCode,
value: _.locationCode,
}));
return { locationList };
}
@MutationAction
async queryMaterialList(params: any) {
const res: any = await http.post(url.auth.query.queryAppendDetail, {
factoryCode: session.factoryCode,
loginName: session.loginName,
prdOrder: params.prdOrder,
materialCode: params.materialCode,
});
const MaterialList = res.list;
return { MaterialList };
}
@MutationAction
async submitList(params: any) {
const res: any = await http.post(url.auth.query.createAppendList, params);
const submitListCode = res.code;
return { submitListCode };
}
//补料解锁
@MutationAction
async lock(sapSupplyIdList: any) {
const res: any = await http.post(url.auth.query.lock, {
factoryCode: session.factoryCode,
loginName: session.loginName,
sapSupplyIdList,
});
console.log(res);
return {};
}
//俄罗斯补料扫描容器码
@MutationAction
async searchBarcode(params: any) {
const res: any = await http.post(url.auth.query.barcode, {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode: params.barcode,
productCode: params.productCode,
});
const ContainerCode = res.data;
return { ContainerCode };
}
//俄罗斯补料提交
@Action({ commit: 'clearState' })
async saveBlDetailSubmit(params: any) {
await auth.checkPassword({
factoryCode: session.factoryCode as string,
loginName: params.operatorPass as string,
rfPwd: params.rfPwd,
});
await http.post(url.bl.uRussia, {
factoryCode: session.factoryCode,
loginName: session.loginName,
...params,
});
uni.showToast({
//icon: "success",
title: 'success',
duration: 2000,
image: '/static/icons/icon-51.png',
});
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
return res;
}
}
export default getModule(VirtualReplenishment);

@ -120,6 +120,10 @@ export const page = {
result: '/pages/raw/handover/virtual/result',
summary: '/pages/raw/handover/virtual/summary',
},
feeVirtualReplenishmentding: {
Location: '/pages/raw/handover/feeVirtualReplenishmentding/Location',
Local: '/pages/raw/handover/feeVirtualReplenishmentding/Local-details',
},
},
ingoods: {
index: '/pages/raw/ingoods/index',

@ -199,6 +199,7 @@ export const url = {
orderRussia: 'wmspda/sortscan/save/order/russia',
queryWlByMat: '/wmspda/sortscan/queryWlByMat',
queryWlByMatBL: '/wmspda/sortscan/queryWlByMatBL',
queryVirtualOrderAmountBl: '/wmspda/bl/queryVirtualOrderAmountBl',
},
unlock: {
list: '/wmspda/sortscan/unlock/list',
@ -303,6 +304,7 @@ export const url = {
u: '/wmspda/bl/u',
uRussia: '/wmspda/bl/uRussia',
unlock: '/wmspda/bl/unlock',
virtual: '/wmspda/bl/u/virtual',
},
bj: {
query: '/wmspda/material/hei/spareIn/queryOrder',

Loading…
Cancel
Save