完善 补料 退料 委外

master
hou 4 years ago
parent 373e650ac3
commit b10c8adea7

@ -416,6 +416,14 @@
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/feeding/Location",
"style": {
"navigationBarTitleText": "补料明细",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/returning/index",

@ -1,394 +1,297 @@
<template>
<view class="page-raw-returning">
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view class="page-raw-receipt">
<!-- 头部 -->
<view
class="header"
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
>
<view class="left">
<u-icon class="icon" name="arrow-left" @click="back" />
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.CommissionEntrant') }}</view>
<view class="title">{{ $t("message.dn_ReceivingGoods") }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="150rpx">
<u-form-item :required="true" :label="$t('message.CommissionedSingleNumber')" prop="orderNo">
<u-search
:placeholder="$t('message.po_PleaseInput')"
v-model="form.orderNo"
@search="model.queryOrderInInfo"
:show-action="false"
></u-search>
</u-form-item>
<u-row gutter="0">
<u-col :span="6">
<u-form-item :required="true" :label="$t('message.CommissionedMaterielNo')">
<u-input
v-model="form.orderNo"
type="select"
@click="materialCodeSelect = true"
:placeholder="$t('message.po_PleaseInput')"
/>
<u-select
:confirm-text="$t('message.product_Confirm')"
:cancel-text="$t('message.product_Cancel')"
v-model="materialCodeSelect"
:list="model.materielList"
@confirm="materialConfirm"
></u-select>
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedMaterielDesc')">
<u-input v-model="form.productCode" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row gutter="0">
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedDemandData')">
<u-input v-model="form.productDescZh" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedCumulativeData')">
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row gutter="0">
<u-col :span="6">
<u-form-item :required="true" :label="$t('message.CommissionedLocation')">
<u-input
v-model="form.qty"
type="select"
@click="materialCodeSelect = true"
:placeholder="$t('message.po_PleaseInput')"
/>
<u-select
:confirm-text="$t('message.product_Confirm')"
:cancel-text="$t('message.product_Cancel')"
v-model="materialCodeSelect"
:list="model.materielList"
@confirm="materialConfirm"
></u-select>
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedThisNumber')">
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col :span="8"></u-col>
<u-col :span="4">
<u-button :style="{margin:'24rpx 0'}" type="primary" size="medium" class="confirm" @click="confirm">{{$t('message.product_add')}}</u-button>
</u-col>
</u-row>
<u-col :span="12">
<view class="table-wrapper">
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t("message.po_MaterielNo") }}</u-th>
<u-th class="u-th">{{ $t("message.po_MaterielDes") }}</u-th>
<u-th class="u-th">{{ $t("message.operation") }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.productCode }}</u-td>
<u-td class="u-td">{{ item.productDescZh }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t("message.product_Delete") }}
</div>
</u-td>
</u-tr>
</u-table>
<!-- <wyb-table
class="table"
ref="table"
width="100%"
enable-check="multiple"
show-left-and-right-border
:headers="headers"
:contents="materialList"
:show-vert-border="false"
@onCheck="onCheck"
></wyb-table> -->
<view class="content">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>{{ $t("message.dn_OddNumbers") }}</view>
<u-search
:placeholder="$t('message.dn_PleaseScan')"
v-model="form.documentNo"
@search="query"
:show-action="false"
></u-search>
</view>
</u-col>
</u-form>
<view class="single-right">
<u-button type="primary" @click="query"></u-button>
</view>
</view>
<!-- 物料 -->
<view class="material">
<view class="material-left">
<view>物料号</view>
<jPicker
sureColor="#ff0000"
style="width: 260rpx"
@bindpicker="materialChoice"
showKey="value"
valKey="value"
:val="wlCode"
class="search"
:options="materialList"
/>
</view>
<view class="material-right">
<view class="material-right-title">物料描述</view>
<view class="material-right-code">{{ every.materialDesc }}</view>
</view>
</view>
<!-- 需求数量 -->
<view class="number">
<view class="number-left">
<view class="number-left-title">需求数量</view>
<u-input
v-model="every.poAmount"
placeholder=" "
:type="type"
:border="border"
class="input"
disabled
/>
</view>
<view class="number-right">
<view class="number-right-title">累计数量</view>
<u-input
v-model="every.receiptAmount"
:type="type"
:border="border"
class="input"
disabled
/>
</view>
</view>
<!-- 库位 -->
<view class="library">
<view class="library-left">
<view>库位</view>
<jPicker
sureColor="#ff0000"
style="width: 230rpx"
@bindpicker="LocationChoice"
showKey="value"
valKey="value"
:val="wlCode"
class="search"
:options="Location"
/>
</view>
<view class="library-right">
<view class="library-right-title">本次数量</view>
<u-input
v-model="nowAmount"
:type="type"
:border="border"
class="input"
/>
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add"></u-button>
</view>
<!-- 表格 -->
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t("message.product_Location") }}</u-th>
<u-th class="u-th">{{ $t("message.product_Number") }}</u-th>
<u-th class="u-th">{{ $t("message.operation") }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in list" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.nowAmount }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t("message.product_Delete") }}
</div>
</u-td>
</u-tr>
</u-table>
</view>
<!-- 底部按钮 -->
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="toPage(page.raw.commission.entrant.detail)">
{{
$t('message.CommissionedEntrantDetails')
}}
</u-button>
<u-button type="primary" @click="bill"></u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="resetHandle">{{ $t('message.product_Upload') }}</u-button>
<u-button type="primary" @click="onSubmit"></u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="onOk">{{ $t('message.po_Return') }}</u-button>
<u-button type="error" @click="back"></u-button>
</u-col>
<!-- <u-col :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
<!-- </u-col>-->
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model';
import { session } from '@/store/modules/session';
import { headers } from './config';
@Component
export default class stoOutboundDom extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
/**
* 表格引用
*/
@Ref('table') readonly $table: any;
LocationList: any = [];
/**
* 页面Module
*/
import { Component, Ref } from "vue-property-decorator";
import { BasePage } from "@/components/base/page";
import jPicker from "@/components/J-Picker/jPicker.vue";
import { session } from "@/store/modules/session";
import { VForm, VFormRules } from "vue/types/form";
import model from "./model";
@Component({
components: {
jPicker,
},
})
export default class dnReceiptDom extends BasePage {
model = model;
/**
* search焦点获取
*/
firstFocus = false;
/**
* 表头
*/
headers = headers;
/**
* 表单数据
*/
form = {
dockCode: null, // code
dockName: null, // name
orderNo: null,
qty: 0,
orderAmount: '',
productCode: 'test', // name
productDescZh: 'test',
scanAmount: '',
barCode: '',
form: any = {
documentNo: "",
};
materialList: any = []; //
//
selectMaterielList: any = [];
/**
* 工位退料人名称
*/
operatorName = '';
/**
* 退料类型选择
*/
returningTypeSelect = false;
//
materialCodeSelect = false;
/**
* 表单验证规则
*/
rules: VFormRules<any> = {
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }],
};
confirm() {
// if (this.wlCode == "" || this.number == "") {
// uni.showToast({
// icon: "none",
// title: "",
// });
// return;
// }
this.LocationList.push(this.form)
material: any = {};
materialList: any = [];
list: any = [];
every: any = "";
value = "";
type = "text";
border = true;
nowAmount: any = "";
//
Location: any = [];
//
wlCode: any = "";
//
async onShow() {
//
let means: any = JSON.parse(
localStorage.getItem("__GWMS_APP_STATE_DATA__") as any
);
let user: any = session.user;
let sendSpot = JSON.parse(localStorage.getItem("sendSpot") as any);
let content = {
loginName: means.session.user.loginName,
sendSpot: sendSpot,
factoryCode: means.session.user.factoryCode,
workArea: user.list[0].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);
});
}
//
async query() {
if (this.form.documentNo == "") {
uni.showToast({
icon: "none",
title: "请输入单号",
});
return;
}
let res = await this.model.queryOutsourcing(this.form.documentNo);
this.material = res.data;
this.material.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.materialCode;
pickerName.value = item.materialCode;
this.materialList.push(pickerName);
});
}
// receiptAmount requestAmount
materialChoice(e: any) {
this.material.forEach((item: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
return;
}
});
}
//
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
//
Add() {
if (this.nowAmount == "" || this.wlCode == "") {
uni.showToast({
icon: "none",
title: "请输入正确的库位和数量" as any,
});
return;
}
if (parseFloat(this.nowAmount) <= 0) {
uni.showToast({
icon: "none",
title: "请输入大于0的数量" as any,
});
return;
}
if (parseFloat(this.nowAmount) > this.every.poAmount) {
uni.showToast({
icon: "none",
title: "不能大于需求数量,请重新输入" as any,
});
return;
}
let arr = {
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.business();
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
this.list.splice(index, 1);
this.business();
}
// onReadyonLoad
async onReady() {
this.$form.setRules(this.rules);
model.queryReturningTypeList();
}
onCheck(e: any) {
console.log('e.data', e.data);
this.selectMaterielList = [];
e.data.forEach((line: any) => {
const { lineData: item } = line;
this.selectMaterielList.push(item);
});
}
back() {
this.form.barCode = '';
this.model.orderInInfo.stoAmount = 0;
this.selectMaterielList = [];
uni.navigateBack({ delta: 1 });
this.$table.onEmpty();
}
materialConfirm(v: any) {
console.log('v[0].value', v[0]);
// this.form.productCode = v[0].value;
this.model.materielList.forEach((item: any) => {
if (v[0].value == item.stoItem) {
this.form.productCode = item.materialCode;
this.form.productDescZh = item.materialDesc;
this.form.orderAmount = item.orderAmount;
this.form.scanAmount = item.scanAmount;
}
});
console.log('this.form', this.form);
}
/**
* 清空
*/
resetHandle() {
this.materialList = [];
this.$table.onCheckAllTap();
this.model.materielList.forEach((item: any) => {
if (this.form.productCode == item.label) {
this.form.productDescZh = item.materialDesc;
this.form.orderAmount = item.orderAmount;
this.form.scanAmount = item.scanAmount;
}
});
}
/**
* 条码回车
*/
onSubmit() {
this.$form.validate(async (valid: boolean) => {
if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip5') as string });
return;
}
if (parseInt(this.form.orderAmount) <= parseInt(this.form.scanAmount)) {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
return;
}
let list = [
{
order3: this.form.orderNo,
productCode: this.form.productCode,
productDescZh: this.form.productDescZh,
barCode: this.form.barCode,
dockCode: this.form.dockCode,
dockName: this.form.dockName,
orderType: 3,
type: 0,
keepBy: session.loginName as string,
loginName: session.loginName as string,
},
];
if (valid) {
const res = await this.model.tluSubmit(list);
console.log('fanhui ', res);
// if (res.barcode) {
// // this.materialList.push(res);
// this.form.scanAmount = res.scanAmount;
// }
if (this.materialList.length == 0) {
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
let flag = 0;
for (let i = 0; i < this.materialList.length; i++) {
console.log('11111', this.materialList[i]);
if (this.form.barCode == this.materialList[i].barcode) {
flag = 1;
break;
}
}
if (flag == 0) {
await this.$table.onCheckAllTap();
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip7') as string });
}
}
}
});
const item = {
...this.form,
barCode: String(''),
};
this.firstFocus = false;
setTimeout(() => {
this.form = item;
this.firstFocus = true;
}, 0);
}
onOk() {
// if (this.selectMaterielList.length == 0) {
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip2') as string });
// } else {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
let selctlist: any = [];
this.selectMaterielList.forEach((item: any, index: any) => {
// item.originWl = item.locCode;
selctlist[index] = {
barCode: item.barcode,
keepBy: session.loginName,
loginName: session.loginName,
order3: this.form.orderNo,
orderType: 3,
type: 0,
productCode: item.productCode,
productDescZh: item.productDescZh,
originWl: item.locCode,
dockCode: item.dockCode,
dockName: item.dockName,
whCode: item.whCode,
regionCode: item.regionCode,
};
async onSubmit() {
if (this.list == null || this.list.length == 0) {
uni.showToast({
icon: "none",
title: "请确保所选物料已分配库位" as any,
});
await this.model.confirm(selctlist);
// this.$form.resetFields();
// // this.form.barCode = '';
// this.selectMaterielList = [];
console.log('aaaaaaa', this.model);
if (this.model.code == '1') {
this.materialList = [];
// this.model.materielList = [];
this.$table.onCheckAllTap();
uni.showToast({ icon: 'success', title: 'success' });
}
});
this.form.barCode = '';
this.form.productCode = '';
// this.form.orderNo = null;
this.form.scanAmount = '';
this.form.orderAmount = '';
this.form.productDescZh = '';
this.selectMaterielList = [];
this.$table.onEmpty();
}
let upload = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: session.loginName,
factoryCode: session.factoryCode,
list: this.list,
};
await this.model.submitOutsourcing(upload);
this.list = [];
this.wlCode = "";
this.nowAmount = "";
this.every = "";
this.materialList = [];
}
bill() {
this.redirectTo(this.page.raw.ingoods.dnReceipt.bill);
}
//
business() {
let num: number = 0;
this.list.forEach((item: any) => {
num += parseFloat(item.nowAmount);
});
this.every.receiptAmount = num;
}
// }
}
</script>
<style lang="scss" scoped>
.page-raw-returning {
.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;
@ -417,19 +320,139 @@ LocationList: any = [];
height: 88rpx;
}
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 30rpx 0;
line-height: 35rpx;
.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: 50%;
height: 100%;
display: flex;
view {
width: 100rpx;
line-height: 100rpx;
}
}
.material-right {
width: 50%;
height: 100%;
display: flex;
.material-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.material-right-code {
width: 190rpx;
height: 100%;
// 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;
}
.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;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.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 {
position: fixed;
bottom: 0;
@ -440,8 +463,5 @@ LocationList: any = [];
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.button-bar {
}
}
</style>

@ -1,8 +1,14 @@
import { Action, getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
import {
Action,
getModule,
Module,
MutationAction,
VuexModule,
} from "vuex-module-decorators";
import store from "@/store";
import http from "@/utils/request";
import { url } from "@/utils/url";
import { session } from "@/store/modules/session";
// import vm from '@/main';
class OrderInInfo {
@ -17,7 +23,7 @@ class OrderInInfo {
namespaced: true,
dynamic: true,
store,
name: 'product.outbound.stoOutbound',
name: "product.outbound.stoOutbound",
})
export class ReturningModule extends VuexModule {
/**
@ -36,7 +42,7 @@ export class ReturningModule extends VuexModule {
*/
orderInInfo: OrderInInfo = new OrderInInfo();
//记账按钮的code码
code = '';
code = "";
/**
*
*/
@ -75,7 +81,7 @@ export class ReturningModule extends VuexModule {
value: item.stoItem,
...item,
}));
console.log('materielList', materielList);
console.log("materielList", materielList);
if (result.data.records[0]) {
result.data.records[0].stoAmount = stoAmount;
}
@ -93,12 +99,15 @@ export class ReturningModule extends VuexModule {
loginName: session.loginName,
};
let oneMaterielDetail: any = {};
const { data }: any = await http.post(url.outbound.stoOutbound.checkScan, obj);
console.log('shneme a ', data.records);
const { data }: any = await http.post(
url.outbound.stoOutbound.checkScan,
obj
);
console.log("shneme a ", data.records);
oneMaterielDetail = data.records[0];
data.records[0].materialCode = list[0].productCode;
data.records[0].materialDesc = list[0].productDescZh;
console.log('aaaaa', oneMaterielDetail);
console.log("aaaaa", oneMaterielDetail);
return oneMaterielDetail;
}
/**
@ -107,8 +116,11 @@ export class ReturningModule extends VuexModule {
*/
@MutationAction
async confirm(list: any[]) {
const { code, data } = await http.post(url.outbound.stoOutbound.Bookkeeping, list);
console.log('res数据', data, code);
const { code, data } = await http.post(
url.outbound.stoOutbound.Bookkeeping,
list
);
console.log("res数据", data, code);
// if (code == '1') {
// uni.showToast({ icon: 'success', title: msg });
// } else {
@ -117,6 +129,30 @@ export class ReturningModule extends VuexModule {
const materielList: any = [];
return { code, materielList };
}
@Action({ commit: "updateCheckedOrderInInfoListKw" })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
let res = await http.post(
"/wmspda/fg/queryByFactoryCodeAndWorkAreaCode",
content
);
return res;
}
@Action
async queryOutsourcing(poNo: any) {
let res = await http.post(url.outbound.stoOutbound.queryOrder, {
poNo,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
return res;
}
@Action
async submitOutsourcing(upload: any) {
let res = await http.post(url.outbound.stoOutbound.submit, upload);
return res;
}
}
export default getModule(ReturningModule);

@ -1,365 +1,297 @@
<template>
<view class="page-raw-returning">
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view class="page-raw-receipt">
<!-- 头部 -->
<view
class="header"
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
>
<view class="left">
<u-icon class="icon" name="arrow-left" @click="back" />
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.CommissionGoOut') }}</view>
<view class="title">{{ $t("message.dn_ReceivingGoods") }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="150rpx">
<u-form-item :required="true" :label="$t('message.CommissionedSingleNumber')" prop="orderNo">
<u-search
:placeholder="$t('message.po_PleaseInput')"
v-model="form.orderNo"
@search="model.queryOrderInInfo"
:show-action="false"
></u-search>
</u-form-item>
<u-row gutter="0">
<u-col :span="6">
<u-form-item :required="true" :label="$t('message.CommissionedMaterielNo')">
<u-input
v-model="form.productCode"
type="select"
@click="materialCodeSelect = true"
:placeholder="$t('message.po_PleaseInput')"
/>
<u-select
:confirm-text="$t('message.product_Confirm')"
:cancel-text="$t('message.product_Cancel')"
v-model="materialCodeSelect"
:list="model.materielList"
@confirm="materialConfirm"
></u-select>
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedMaterielDesc')">
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row gutter="0">
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedDemandData')">
<u-input v-model="form.orderAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedCumulativeData')">
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row gutter="0">
<u-col :span="6">
<u-form-item :required="true" :label="$t('message.CommissionedLocation')">
<u-input
v-model="form.productCode"
type="select"
@click="materialCodeSelect = true"
:placeholder="$t('message.po_PleaseInput')"
/>
<u-select
:confirm-text="$t('message.product_Confirm')"
:cancel-text="$t('message.product_Cancel')"
v-model="materialCodeSelect"
:list="model.materielList"
@confirm="materialConfirm"
></u-select>
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedThisNumber')">
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col :span="8"></u-col>
<u-col :span="4">
<u-button :style="{margin:'24rpx 0'}" type="primary">{{$t('message.product_add')}}</u-button>
</u-col>
</u-row>
<u-col :span="12">
<view class="table-wrapper">
<wyb-table
class="table"
ref="table"
width="100%"
enable-check="multiple"
show-left-and-right-border
:headers="headers"
:contents="materialList"
:show-vert-border="false"
@onCheck="onCheck"
></wyb-table>
<view class="content">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>{{ $t("message.dn_OddNumbers") }}</view>
<u-search
:placeholder="$t('message.dn_PleaseScan')"
v-model="form.documentNo"
@search="query"
:show-action="false"
></u-search>
</view>
</u-col>
</u-form>
<view class="single-right">
<u-button type="primary" @click="query"></u-button>
</view>
</view>
<!-- 物料 -->
<view class="material">
<view class="material-left">
<view>物料号</view>
<jPicker
sureColor="#ff0000"
style="width: 260rpx"
@bindpicker="materialChoice"
showKey="value"
valKey="value"
:val="wlCode"
class="search"
:options="materialList"
/>
</view>
<view class="material-right">
<view class="material-right-title">物料描述</view>
<view class="material-right-code">{{ every.materialDesc }}</view>
</view>
</view>
<!-- 需求数量 -->
<view class="number">
<view class="number-left">
<view class="number-left-title">需求数量</view>
<u-input
v-model="every.orderAmount"
placeholder=" "
:type="type"
:border="border"
class="input"
disabled
/>
</view>
<view class="number-right">
<view class="number-right-title">累计数量</view>
<u-input
v-model="every.outAmount"
:type="type"
:border="border"
class="input"
disabled
/>
</view>
</view>
<!-- 库位 -->
<view class="library">
<view class="library-left">
<view>库位</view>
<jPicker
sureColor="#ff0000"
style="width: 230rpx"
@bindpicker="LocationChoice"
showKey="value"
valKey="value"
:val="wlCode"
class="search"
:options="Location"
/>
</view>
<view class="library-right">
<view class="library-right-title">本次数量</view>
<u-input
v-model="nowAmount"
:type="type"
:border="border"
class="input"
/>
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add"></u-button>
</view>
<!-- 表格 -->
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t("message.product_Location") }}</u-th>
<u-th class="u-th">{{ $t("message.product_Number") }}</u-th>
<u-th class="u-th">{{ $t("message.operation") }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in list" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.nowAmount }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t("message.product_Delete") }}
</div>
</u-td>
</u-tr>
</u-table>
</view>
<!-- 底部按钮 -->
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="toPage(page.raw.commission.goOut.detail)">
{{
$t('message.CommissionedGoOutDetails')
}}
</u-button>
<u-button type="primary" @click="bill"></u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="resetHandle">{{ $t('message.product_Upload') }}</u-button>
<u-button type="primary" @click="onSubmit"></u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="onOk">{{ $t('message.po_Return') }}</u-button>
<u-button type="error" @click="back"></u-button>
</u-col>
<!-- <u-col :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
<!-- </u-col>-->
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model';
import { session } from '@/store/modules/session';
import { headers } from './config';
@Component
export default class stoOutboundDom extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
/**
* 表格引用
*/
@Ref('table') readonly $table: any;
/**
* 页面Module
*/
import { Component, Ref } from "vue-property-decorator";
import { BasePage } from "@/components/base/page";
import jPicker from "@/components/J-Picker/jPicker.vue";
import { session } from "@/store/modules/session";
import { VForm, VFormRules } from "vue/types/form";
import model from "./model";
@Component({
components: {
jPicker,
},
})
export default class dnReceiptDom extends BasePage {
model = model;
/**
* search焦点获取
*/
firstFocus = false;
/**
* 表头
*/
headers = headers;
/**
* 表单数据
*/
form = {
dockCode: null, // code
dockName: null, // name
orderNo: null,
qty: 0,
orderAmount: '',
productCode: '', // name
productDescZh: '',
scanAmount: '',
barCode: '',
form: any = {
documentNo: "",
};
materialList: any = []; //
//
selectMaterielList: any = [];
/**
* 工位退料人名称
*/
operatorName = '';
/**
* 退料类型选择
*/
returningTypeSelect = false;
//
materialCodeSelect = false;
/**
* 表单验证规则
*/
rules: VFormRules<any> = {
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }],
};
// onReadyonLoad
async onReady() {
this.$form.setRules(this.rules);
model.queryReturningTypeList();
}
onCheck(e: any) {
console.log('e.data', e.data);
this.selectMaterielList = [];
e.data.forEach((line: any) => {
const { lineData: item } = line;
this.selectMaterielList.push(item);
});
}
back() {
this.form.barCode = '';
this.model.orderInInfo.stoAmount = 0;
this.selectMaterielList = [];
uni.navigateBack({ delta: 1 });
this.$table.onEmpty();
}
materialConfirm(v: any) {
console.log('v[0].value', v[0]);
// this.form.productCode = v[0].value;
this.model.materielList.forEach((item: any) => {
if (v[0].value == item.stoItem) {
this.form.productCode = item.materialCode;
this.form.productDescZh = item.materialDesc;
this.form.orderAmount = item.orderAmount;
this.form.scanAmount = item.scanAmount;
}
});
console.log('this.form', this.form);
}
/**
* 清空
*/
resetHandle() {
this.materialList = [];
this.$table.onCheckAllTap();
this.model.materielList.forEach((item: any) => {
if (this.form.productCode == item.label) {
this.form.productDescZh = item.materialDesc;
this.form.orderAmount = item.orderAmount;
this.form.scanAmount = item.scanAmount;
}
});
}
/**
* 条码回车
*/
onSubmit() {
this.$form.validate(async (valid: boolean) => {
if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip5') as string });
return;
}
if (parseInt(this.form.orderAmount) <= parseInt(this.form.scanAmount)) {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
return;
}
let list = [
{
order3: this.form.orderNo,
productCode: this.form.productCode,
productDescZh: this.form.productDescZh,
barCode: this.form.barCode,
dockCode: this.form.dockCode,
dockName: this.form.dockName,
orderType: 3,
type: 0,
keepBy: session.loginName as string,
loginName: session.loginName as string,
},
];
if (valid) {
const res = await this.model.tluSubmit(list);
console.log('fanhui ', res);
// if (res.barcode) {
// // this.materialList.push(res);
// this.form.scanAmount = res.scanAmount;
// }
if (this.materialList.length == 0) {
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
let flag = 0;
for (let i = 0; i < this.materialList.length; i++) {
console.log('11111', this.materialList[i]);
if (this.form.barCode == this.materialList[i].barcode) {
flag = 1;
break;
}
}
if (flag == 0) {
await this.$table.onCheckAllTap();
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip7') as string });
}
}
}
});
const item = {
...this.form,
barCode: String(''),
material: any = {};
materialList: any = [];
list: any = [];
every: any = "";
value = "";
type = "text";
border = true;
nowAmount: any = "";
//
Location: any = [];
//
wlCode: any = "";
//
async onShow() {
//
let means: any = JSON.parse(
localStorage.getItem("__GWMS_APP_STATE_DATA__") as any
);
let user: any = session.user;
let sendSpot = JSON.parse(localStorage.getItem("sendSpot") as any);
let content = {
loginName: means.session.user.loginName,
sendSpot: sendSpot,
factoryCode: means.session.user.factoryCode,
workArea: user.list[0].workareaCode,
};
this.firstFocus = false;
setTimeout(() => {
this.form = item;
this.firstFocus = true;
}, 0);
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);
});
}
onOk() {
// if (this.selectMaterielList.length == 0) {
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip2') as string });
// } else {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
let selctlist: any = [];
this.selectMaterielList.forEach((item: any, index: any) => {
// item.originWl = item.locCode;
selctlist[index] = {
barCode: item.barcode,
keepBy: session.loginName,
loginName: session.loginName,
order3: this.form.orderNo,
orderType: 3,
type: 0,
productCode: item.productCode,
productDescZh: item.productDescZh,
originWl: item.locCode,
dockCode: item.dockCode,
dockName: item.dockName,
whCode: item.whCode,
regionCode: item.regionCode,
};
//
async query() {
if (this.form.documentNo == "") {
uni.showToast({
icon: "none",
title: "请输入单号",
});
await this.model.confirm(selctlist);
// this.$form.resetFields();
// // this.form.barCode = '';
// this.selectMaterielList = [];
console.log('aaaaaaa', this.model);
if (this.model.code == '1') {
this.materialList = [];
// this.model.materielList = [];
this.$table.onCheckAllTap();
uni.showToast({ icon: 'success', title: 'success' });
return;
}
let res = await this.model.queryOutsourcing(this.form.documentNo);
this.material = res.data;
this.material.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.materialCode;
pickerName.value = item.materialCode;
this.materialList.push(pickerName);
});
}
// receiptAmount requestAmount
materialChoice(e: any) {
this.material.forEach((item: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
return;
}
});
this.form.barCode = '';
this.form.productCode = '';
// this.form.orderNo = null;
this.form.scanAmount = '';
this.form.orderAmount = '';
this.form.productDescZh = '';
this.selectMaterielList = [];
this.$table.onEmpty();
}
// }
//
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
//
Add() {
if (this.nowAmount == "" || this.wlCode == "") {
uni.showToast({
icon: "none",
title: "请输入正确的库位和数量" as any,
});
return;
}
if (parseFloat(this.nowAmount) <= 0) {
uni.showToast({
icon: "none",
title: "请输入大于0的数量" as any,
});
return;
}
if (parseFloat(this.nowAmount) > this.every.orderAmount) {
uni.showToast({
icon: "none",
title: "不能大于需求数量,请重新输入" as any,
});
return;
}
let arr = {
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.business();
}
deleteItem(index: any) {
this.list.splice(index, 1);
this.business();
}
async onSubmit() {
if (this.list == null || this.list.length == 0) {
uni.showToast({
icon: "none",
title: "请确保所选物料已分配库位" as any,
});
}
let upload = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: session.loginName,
factoryCode: session.factoryCode,
list: this.list,
};
await this.model.submitOutsourcing(upload);
this.list = [];
this.wlCode = "";
this.nowAmount = "";
this.every = "";
this.materialList = [];
}
bill() {
this.redirectTo(this.page.raw.ingoods.dnReceipt.bill);
}
//
business() {
let num: number = 0;
this.list.forEach((item: any) => {
num += parseFloat(item.nowAmount);
});
this.every.outAmount = num;
}
}
</script>
<style lang="scss" scoped>
.page-raw-returning {
.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;
@ -388,19 +320,139 @@ export default class stoOutboundDom extends BasePage {
height: 88rpx;
}
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 30rpx 0;
line-height: 35rpx;
.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: 50%;
height: 100%;
display: flex;
view {
width: 100rpx;
line-height: 100rpx;
}
}
.material-right {
width: 50%;
height: 100%;
display: flex;
.material-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.material-right-code {
width: 190rpx;
height: 100%;
// 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;
}
.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;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.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 {
position: fixed;
bottom: 0;
@ -411,8 +463,5 @@ export default class stoOutboundDom extends BasePage {
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.button-bar {
}
}
</style>

@ -1,8 +1,14 @@
import { Action, getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
import {
Action,
getModule,
Module,
MutationAction,
VuexModule,
} from "vuex-module-decorators";
import store from "@/store";
import http from "@/utils/request";
import { url } from "@/utils/url";
import { session } from "@/store/modules/session";
// import vm from '@/main';
class OrderInInfo {
@ -17,7 +23,7 @@ class OrderInInfo {
namespaced: true,
dynamic: true,
store,
name: 'product.outbound.stoOutbound',
name: "product.outbound.stoOutbound",
})
export class ReturningModule extends VuexModule {
/**
@ -36,7 +42,7 @@ export class ReturningModule extends VuexModule {
*/
orderInInfo: OrderInInfo = new OrderInInfo();
//记账按钮的code码
code = '';
code = "";
/**
*
*/
@ -75,7 +81,7 @@ export class ReturningModule extends VuexModule {
value: item.stoItem,
...item,
}));
console.log('materielList', materielList);
console.log("materielList", materielList);
if (result.data.records[0]) {
result.data.records[0].stoAmount = stoAmount;
}
@ -93,12 +99,15 @@ export class ReturningModule extends VuexModule {
loginName: session.loginName,
};
let oneMaterielDetail: any = {};
const { data }: any = await http.post(url.outbound.stoOutbound.checkScan, obj);
console.log('shneme a ', data.records);
const { data }: any = await http.post(
url.outbound.stoOutbound.checkScan,
obj
);
console.log("shneme a ", data.records);
oneMaterielDetail = data.records[0];
data.records[0].materialCode = list[0].productCode;
data.records[0].materialDesc = list[0].productDescZh;
console.log('aaaaa', oneMaterielDetail);
console.log("aaaaa", oneMaterielDetail);
return oneMaterielDetail;
}
/**
@ -107,8 +116,11 @@ export class ReturningModule extends VuexModule {
*/
@MutationAction
async confirm(list: any[]) {
const { code, data } = await http.post(url.outbound.stoOutbound.Bookkeeping, list);
console.log('res数据', data, code);
const { code, data } = await http.post(
url.outbound.stoOutbound.Bookkeeping,
list
);
console.log("res数据", data, code);
// if (code == '1') {
// uni.showToast({ icon: 'success', title: msg });
// } else {
@ -117,6 +129,34 @@ export class ReturningModule extends VuexModule {
const materielList: any = [];
return { code, materielList };
}
@Action({ commit: "updateCheckedOrderInInfoListKw" })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
let res = await http.post(
"/wmspda/fg/queryByFactoryCodeAndWorkAreaCode",
content
);
return res;
}
@Action
async queryOutsourcing(poNo: any) {
let res = await http.post(url.outbound.stoOutbound.outsourcingQueryOrder, {
poNo,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
return res;
}
@Action
async submitOutsourcing(upload: any) {
let res = await http.post(
url.outbound.stoOutbound.materialComplete,
upload
);
return res;
}
}
export default getModule(ReturningModule);

@ -2,9 +2,10 @@
<view class="page-picking-order">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="index" />
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t("message.Pi_ByOrderPicking") }}</view>
<!-- <view class="title">{{ $t("message.Pi_ByOrderPicking") }}</view> -->
<view class="title">补料</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
@ -28,7 +29,7 @@
</view>
<view class="Exhibition-right">
<view class="Exhibition-right-title">已拣数量:</view>
<view class="Exhibition-right-data">{{ some.totalMoAmount }}</view>
<view class="Exhibition-right-data">{{ some.totalFillAmount }}</view>
</view>
</view>
<!-- 添加库位 -->
@ -78,11 +79,42 @@
<u-row class="bottom-info"> </u-row>
</u-form>
</div>
<u-form
ref="form2"
:model="form2"
:error-type="['toast']"
style="background: rgb(242, 242, 242)"
>
<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"
@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"
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="appoint"
>拣配明细</u-button
>补料明细</u-button
>
</u-col>
<u-col :span="4">
@ -105,6 +137,7 @@ import { session } from "@/store/modules/session";
import { VForm, VFormRules } from "vue/types/form";
import jPicker from "@/components/J-Picker/jPicker.vue";
import { headers } from "./config";
import { auth } from "@/store/modules/auth";
@Component({
components: {
jPicker,
@ -116,6 +149,7 @@ export default class RawReceiptDetail extends BasePage {
*/
@Ref("form") readonly $form!: VForm;
@Ref("submitForm") readonly $submitForm!: VForm;
@Ref("form2") readonly $form2!: VForm;
submitForm = {
receiver: "",
receiverName: "",
@ -128,6 +162,7 @@ export default class RawReceiptDetail extends BasePage {
type = "text";
wlCode: any = "";
border = true;
operatorName = "";
//
LocationList: any = [];
//
@ -142,18 +177,14 @@ export default class RawReceiptDetail extends BasePage {
// locationCode: null,
amount: null,
};
index() {
this.toPage(this.page.raw.ingoods.dnReturnGoods.index);
}
form2 = {
operatorPass: "", //
};
/**
* 表单校验
*/
rules: VFormRules<any> = {
// locationCode: [{ required: true, message: '' }],
amount: [
{ required: true, message: this.$t("message.Pi_tip1") as string },
// { type: 'integer', min: 1, transform: Number, message: this.$t('message.Pi_tip2') as string },
],
amount: [{ required: true, message: this.$t("message.Pi_tip1") as string }],
};
/**
@ -166,12 +197,22 @@ export default class RawReceiptDetail extends BasePage {
*/
headers = headers;
LocationChoice(e: any) {
console.log("e>>>>>>>>>>>>>>>>>>>>>>>>", e);
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 = "";
}
}
handleRow({ data }: any) {
this.someIndex = data[0].index;
this.some = data[0].lineData;
this.model.blDetailList[this.someIndex].wlList = [];
}
Add() {
if (this.qty == "" || this.wlCode == "") {
@ -188,9 +229,7 @@ export default class RawReceiptDetail extends BasePage {
});
return;
}
if (
parseFloat(this.qty) > model.blDetailList[this.someIndex].receiptAmount
) {
if (parseFloat(this.qty) > model.blDetailList[this.someIndex].amount) {
uni.showToast({
icon: "none",
title: "不能大于需求数量,请重新输入" as any,
@ -201,8 +240,7 @@ export default class RawReceiptDetail extends BasePage {
this.LocationList.forEach((item: any) => {
num += parseFloat(item.qty);
});
console.log(num);
if (num > this.model.blDetailList[this.someIndex].receiptAmount) {
if (num > this.model.blDetailList[this.someIndex].amount) {
uni.showToast({
icon: "none",
title: "不能大于需求数量,请重新输入" as any,
@ -239,21 +277,15 @@ export default class RawReceiptDetail extends BasePage {
let TEM = JSON.parse(objString);
TEM.wlList = null;
TEM.wlCode = this.wlCode.label;
TEM.hvAmount = this.qty;
this.model.blDetailList[this.someIndex].wlQTyList.push(TEM);
this.model.blDetailList[this.someIndex].receiptAmount += parseFloat(
this.qty
);
console.log(
"this.model.blDetailList",
this.model.blDetailList[this.someIndex]
);
TEM.qty = this.qty;
this.model.blDetailList[this.someIndex].wlList.push(TEM);
this.qty = "";
this.business();
}
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
this.model.blDetailList[this.someIndex].wlQTyList.splice(index, 1);
this.model.blDetailList[this.someIndex].wlList.splice(index, 1);
this.business();
}
business() {
@ -261,14 +293,9 @@ export default class RawReceiptDetail extends BasePage {
this.LocationList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.blDetailList[this.someIndex].receiptAmount = num;
console.log(
"this.model.blDetailList",
this.model.blDetailList[this.someIndex]
);
this.model.blDetailList[this.someIndex].fillAmount = num;
}
async onShow() {
//
let means: any = JSON.parse(
localStorage.getItem("__GWMS_APP_STATE_DATA__") as any
);
@ -292,15 +319,17 @@ export default class RawReceiptDetail extends BasePage {
item.receiptAmount = 0;
item.wlQTyList = [];
});
console.log("this.model.blDetailList", this.model.blDetailList);
}
appoint() {}
/**
* 提交
*/
async onSubmit() {
// await this.model.submitOrderInEnter();
let dataList = this.model.blDetailList;
const params = {
dataList,
...this.form2,
};
await this.model.saveBlDetailUpload(params).then(() => {
this.toPage(this.page.raw.handover.feeding.Location);
});
}
}
</script>

@ -1,33 +1,33 @@
/**
*
*/
import vm from '@/main';
import vm from "@/main";
export const headers = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
label: vm.$t("message.po_MaterielNo"),
key: "materialCode",
width: 220,
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
label: vm.$t("message.po_MaterielDes"),
key: "materialDesc",
width: 350,
},
{
label: vm.$t('message.po_ActualQuantity'),
key: 'fillAmount',
label: vm.$t("message.po_ActualQuantity"),
key: "fillAmount",
},
{
label: vm.$t('message.Summary_Number'),
key: 'amount',
label: vm.$t("message.Summary_Number"),
key: "amount",
},
{
label: vm.$t('message.Feeding_ReplenishedQuantity'),
key: 'totalFillAmount',
label: vm.$t("message.Feeding_ReplenishedQuantity"),
key: "totalFillAmount",
},
{
label: vm.$t('message.po_Location'),
key: 'locationCode',
label: vm.$t("message.po_Location"),
key: "locationCode",
},
// {
// label: '工位',

@ -1,10 +1,15 @@
<template>
<view class="page-raw-feeding-detail">
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view
class="header"
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
>
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.Feeding_ReplenishmentDetails') }}</view>
<view class="title">{{
$t("message.Feeding_ReplenishmentDetails")
}}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
@ -21,30 +26,37 @@
</view>
<view class="bottom-bar">
<div class="extra">
<u-form ref="form1" :model="form1" :error-type="['toast']">
<!-- <u-form ref="form1" :model="form1" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="12">
<u-form-item
>{{ $t('message.po_Total') }} {{ model.blDetailList.length }}
{{ $t('message.po_Records') }}</u-form-item
>{{ $t("message.po_Total") }} {{ model.blDetailList.length }}
{{ $t("message.po_Records") }}</u-form-item
>
</u-col>
<!-- <u-col :span="6">-->
<!-- <u-form-item prop="locationCode" label="库存地点" label-width="120rpx">-->
<!-- <u-input-->
<!-- v-model="form1.locationCode"-->
<!-- type="select"-->
<!-- @click="locationCodeSelect = true"-->
<!-- />-->
<!-- <u-select-->
<!-- v-model="locationCodeSelect"-->
<!-- :list="model.locationList"-->
<!-- @confirm="(v) => (form1.locationCode = v[0].value)"-->
<!-- ></u-select>-->
<!-- </u-form-item>-->
<!-- </u-col>-->
<u-col :span="6">
<u-form-item prop="amount" :label="this.$t('message.Summary_Number')">
<u-form-item
prop="locationCode"
label="库存地点"
label-width="120rpx"
>
<u-input
v-model="form1.locationCode"
type="select"
@click="locationCodeSelect = true"
/>
<u-select
v-model="locationCodeSelect"
:list="model.locationList"
@confirm="(v) => (form1.locationCode = v[0].value)"
></u-select>
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item
prop="amount"
:label="this.$t('message.Summary_Number')"
>
<u-input
v-model="form1.amount"
type="number"
@ -54,7 +66,7 @@
</u-form-item>
</u-col>
</u-row>
</u-form>
</u-form> -->
<u-form ref="form2" :model="form2" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="6">
@ -71,7 +83,10 @@
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item prop="rfPwd" :label="this.$t('message.Summary_Password')">
<u-form-item
prop="rfPwd"
:label="this.$t('message.Summary_Password')"
>
<u-input
v-model="form2.rfPwd"
type="password"
@ -85,14 +100,18 @@
<div class="container">
<u-row>
<u-col :span="4">
<u-button type="primary" @click="onSubmit"> {{ $t('message.dn_Confirm') }} </u-button>
<u-button type="primary" @click="onSubmit">
{{ $t("message.dn_Confirm") }}
</u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onUpload"> {{ $t('message.po_Submit') }} </u-button>
<u-button type="success" @click="onUpload">
{{ $t("message.po_Submit") }}
</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="uni.navigateBack()">
{{ $t('message.po_Return') }}
{{ $t("message.po_Return") }}
</u-button>
</u-col>
</u-row>
@ -102,20 +121,20 @@
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { VForm, VFormRules } from 'vue/types/form';
import { auth } from '@/store/modules/auth';
import model from './model';
import { headers } from './config';
import { Component, Ref } from "vue-property-decorator";
import { BasePage } from "@/components/base/page";
import { VForm, VFormRules } from "vue/types/form";
import { auth } from "@/store/modules/auth";
import model from "./model";
import { headers } from "./config";
@Component
export default class feedingDel extends BasePage {
/**
* 表单引用
*/
@Ref('form1') readonly $form1!: VForm;
@Ref('form2') readonly $form2!: VForm;
@Ref("form1") readonly $form1!: VForm;
@Ref("form2") readonly $form2!: VForm;
/**
* 页面Module
@ -132,15 +151,15 @@ export default class feedingDel extends BasePage {
*/
form1 = {
locationCode: null,
amount: '',
amount: "",
};
form2 = {
operatorPass: '', //
operatorPass: "", //
};
/**
* 接收人名称
*/
operatorName = '';
operatorName = "";
/**
* 库存地点选择
*/
@ -151,18 +170,22 @@ export default class feedingDel extends BasePage {
*/
rules1: VFormRules<any> = {
amount: [
{ required: true, message: this.$t('message.Feeding_Tip1') as string },
{ required: true, message: this.$t("message.Feeding_Tip1") as string },
{
type: 'integer',
type: "integer",
min: 1,
transform: Number,
message: this.$t('message.Feeding_Tip2') as string,
message: this.$t("message.Feeding_Tip2") as string,
},
],
};
rules2: VFormRules<any> = {
rfPwd: [{ required: true, message: this.$t('message.Feeding_Tip3') as string }],
operatorPass: [{ required: true, message: this.$t('message.Feeding_Tip4') as string }],
rfPwd: [
{ required: true, message: this.$t("message.Feeding_Tip3") as string },
],
operatorPass: [
{ required: true, message: this.$t("message.Feeding_Tip4") as string },
],
};
onReady() {
@ -180,63 +203,81 @@ export default class feedingDel extends BasePage {
*/
async onUpload() {
if (!this.model.hasBlDetailFillAmount) {
uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip10') as string });
uni.showToast({
icon: "none",
title: this.$t("message.Pi_tip10") as string,
});
return;
}
const dataList = this.model.blDetailUploadList;
if (dataList.length === 0) {
uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip4') as string });
uni.showToast({
icon: "none",
title: this.$t("message.Pi_tip4") as string,
});
return;
}
this.$form2.validate(async (valid) => {
if (!valid) return;
const params = {
dataList,
...this.form2,
};
await this.model.saveBlDetailUpload(params);
// uni.navigateBack({ delta: 1 });
setTimeout(() => {
uni.navigateBack({ delta: 1 });
}, 2000);
// uni.showModal({
// title: this.$t('message.Pi_tip') as string,
// content: this.$t('message.Pi_tip5') as string,
// confirmText: this.$t('message.workArea_Confirm') as string,
// showCancel: false,
// success: () => {
// uni.navigateBack({ delta: 1 });
// },
// });
});
const params = {
dataList,
...this.form2,
};
await this.model.saveBlDetailUpload(params);
// this.$form2.validate(async (valid) => {
// if (!valid) return;
// const params = {
// dataList,
// ...this.form2,
// };
// await this.model.saveBlDetailUpload(params);
// // uni.navigateBack({ delta: 1 });
// setTimeout(() => {
// uni.navigateBack({ delta: 1 });
// }, 2000);
// uni.showModal({
// title: this.$t('message.Pi_tip') as string,
// content: this.$t('message.Pi_tip5') as string,
// confirmText: this.$t('message.workArea_Confirm') as string,
// showCancel: false,
// success: () => {
// uni.navigateBack({ delta: 1 });
// },
// });
// });
}
/**
* 提交
*/
async onSubmit() {
if (!this.model.hasBlDetailChecked) {
uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip7') as string });
return;
}
this.$form1.validate((valid) => {
if (!valid) return;
const list = this.model.checkedBlDetailList;
// const needLocationCode = list.findIndex((_: any) => !_.wkposCodeP) > -1;
// if (needLocationCode && !this.form1.locationCode) {
// uni.showToast({ icon: 'none', title: '' });
// return;
// }
const amount = Number(this.form1.amount);
for (const item of list) {
if (amount + item.totalFillAmount > item.amount) {
uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip9') as string });
return;
}
}
const locationCode: any = this.form1.locationCode;
this.model.confirmCheckedBlDetailList({ amount, locationCode });
});
// if (!this.model.hasBlDetailChecked) {
// uni.showToast({
// icon: "none",
// title: this.$t("message.Pi_tip7") as string,
// });
// return;
// }
// this.$form1.validate((valid) => {
// if (!valid) return;
// const list = this.model.checkedBlDetailList;
// // const needLocationCode = list.findIndex((_: any) => !_.wkposCodeP) > -1;
// // if (needLocationCode && !this.form1.locationCode) {
// // uni.showToast({ icon: 'none', title: '' });
// // return;
// // }
// const amount = Number(this.form1.amount);
// for (const item of list) {
// if (amount + item.totalFillAmount > item.amount) {
// uni.showToast({
// icon: "none",
// title: this.$t("message.Pi_tip9") as string,
// });
// return;
// }
// }
// const locationCode: any = this.form1.locationCode;
// this.model.confirmCheckedBlDetailList({ amount, locationCode });
// });
this.toPage(this.page.raw.handover.feeding.Location);
}
/**
@ -248,8 +289,8 @@ export default class feedingDel extends BasePage {
this.form2.operatorPass = loginName;
this.operatorName = userName;
} catch {
this.form2.operatorPass = '';
this.operatorName = '';
this.form2.operatorPass = "";
this.operatorName = "";
}
}
}
@ -257,7 +298,8 @@ export default class feedingDel extends BasePage {
<style lang="scss" scoped>
.page-raw-feeding-detail {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background: #f2f2f2
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;

@ -1,43 +1,76 @@
<template>
<view class="page-raw-feeding">
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view
class="header"
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
>
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.FillingMaterials') }}</view>
<view class="title">{{ $t("message.FillingMaterials") }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="150rpx">
<u-form
class="form"
ref="form"
:model="form"
:error-type="['toast']"
label-width="150rpx"
>
<u-form-item :required="true" label="MRP" prop="inMrpCodeList">
<u-input v-model="form.inMrpCodeList" :placeholder="this.$t('message.po_PleaseInput')" />
<u-input
v-model="form.inMrpCodeList"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
<u-form-item :label="this.$t('message.Feeding_VoucherNo')">
<u-input v-model="form.credNo" :placeholder="this.$t('message.po_PleaseInput')" />
<u-input
v-model="form.credNo"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
<!-- <u-form-item :label="this.$t('message.Feeding_VoucherDate')">
<u-input v-model="form.credDateStr" :placeholder="this.$t('message.po_PleaseInput')" />
</u-form-item> -->
<u-form-item :label="this.$t('message.Pi_materielNo')">
<u-input v-model="form.materialCodeList" :placeholder="this.$t('message.po_PleaseInput')" />
<u-input
v-model="form.materialCodeList"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
<u-form-item :required="true" :label="this.$t('message.Pi_factory')" prop="sapFactoryCode">
<u-input v-model="form.sapFactoryCode" :placeholder="this.$t('message.po_PleaseInput')" />
<u-form-item
:required="true"
:label="this.$t('message.Pi_factory')"
prop="sapFactoryCode"
>
<u-input
v-model="form.sapFactoryCode"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
<u-form-item :label="this.$t('message.Pi_Station')">
<u-input v-model="form.sendSpotList" :placeholder="this.$t('message.po_PleaseInput')" />
<u-input
v-model="form.sendSpotList"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
<u-form-item :label="this.$t('message.Pi_OrderNo')">
<u-input v-model="form.inPrdOrderList" :placeholder="this.$t('message.po_PleaseInput')" />
<u-input
v-model="form.inPrdOrderList"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="6">
<u-button type="primary" @click="onQuery">{{ $t('message.Pi_order') }}</u-button>
<u-button type="primary" @click="onQuery">{{
$t("message.Pi_order")
}}</u-button>
</u-col>
<u-col :span="6">
<u-button type="error" @click="uni.navigateBack()">{{
$t('message.po_Return')
$t("message.po_Return")
}}</u-button>
</u-col>
</u-row>
@ -46,18 +79,18 @@
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model';
import { session } from '@/store/modules/session';
import { Component, Ref } from "vue-property-decorator";
import { BasePage } from "@/components/base/page";
import { VForm, VFormRules } from "vue/types/form";
import model from "./model";
import { session } from "@/store/modules/session";
@Component
export default class feedingDom extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
@Ref("form") readonly $form!: VForm;
/**
* 页面Module
@ -68,15 +101,19 @@ export default class feedingDom extends BasePage {
* 表单数据
*/
form: any = {
sapFactoryCode: '',
sapFactoryCode: "",
};
/**
* 表单校验规则
*/
rules: VFormRules<any> = {
inMrpCodeList: [{ required: true, message: this.$t('message.Pi_InputMrp') as string }],
sapFactoryCode: [{ required: true, message: this.$t('message.Pi_InputFactory') as string }],
inMrpCodeList: [
{ required: true, message: this.$t("message.Pi_InputMrp") as string },
],
sapFactoryCode: [
{ required: true, message: this.$t("message.Pi_InputFactory") as string },
],
};
// onReadyonLoad
@ -93,39 +130,44 @@ export default class feedingDom extends BasePage {
if (!valid) return;
const params = { ...this.form };
if (this.form.inMrpCodeList) {
params.inMrpCodeList = this.form.inMrpCodeList.split(',');
params.inMrpCodeList = this.form.inMrpCodeList.split(",");
} else {
delete params.inMrpCodeList;
}
if (this.form.materialCodeList) {
params.materialCodeList = this.form.materialCodeList.split(',');
params.materialCodeList = this.form.materialCodeList.split(",");
} else {
delete params.materialCodeList;
}
if (this.form.sendSpotList) {
params.sendSpotList = this.form.sendSpotList.split(',');
params.sendSpotList = this.form.sendSpotList.split(",");
} else {
delete params.sendSpotList;
}
if (this.form.inPrdOrderList) {
params.inPrdOrderList = this.form.inPrdOrderList.split(',');
params.inPrdOrderList = this.form.inPrdOrderList.split(",");
} else {
delete params.inPrdOrderList;
}
await this.model.queryBlDetailList(params);
if (this.model.blDetailList.length === 0) {
uni.showToast({ icon: 'none', title: this.$t('message.Pi_NoDataFound') as string });
uni.showToast({
icon: "none",
title: this.$t("message.Pi_NoDataFound") as string,
});
return;
}
this.toPage(this.page.raw.handover.feeding.detail);
this.toPage(this.page.raw.handover.feeding.Location);
});
// this.toPage(this.page.raw.handover.feeding.Location);
}
}
</script>
<style lang="scss" scoped>
.page-raw-feeding {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background: #f2f2f2
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;

@ -100,6 +100,10 @@ export const url = {
yuetaiType: "/wmspda/fg/queryDocksUnderWareHouse",
Bookkeeping: "/wmspda/fg/confirmMove",
checkScan: "/wmspda/fg/getMaterialByCode",
queryOrder: "/material/outsourcing/into/queryOrder",
submit: "/material/outsourcing/into/materialComplete",
materialComplete: "/material/outsourcing/materialComplete",
outsourcingQueryOrder: "/material/outsourcing/queryOrder",
},
},
inbound: {

Loading…
Cancel
Save