完善 补料 退料 委外

master
hou 4 years ago
parent 373e650ac3
commit b10c8adea7

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

@ -1,394 +1,297 @@
<template> <template>
<view class="page-raw-returning"> <view class="page-raw-receipt">
<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"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="back" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view> </view>
<view class="title">{{ $t('message.CommissionEntrant') }}</view> <view class="title">{{ $t("message.dn_ReceivingGoods") }}</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="150rpx"> <view class="content">
<u-form-item :required="true" :label="$t('message.CommissionedSingleNumber')" prop="orderNo"> <!-- 单号 -->
<u-search <view class="single">
:placeholder="$t('message.po_PleaseInput')" <view class="single-left">
v-model="form.orderNo" <view>{{ $t("message.dn_OddNumbers") }}</view>
@search="model.queryOrderInInfo" <u-search
:show-action="false" :placeholder="$t('message.dn_PleaseScan')"
></u-search> v-model="form.documentNo"
</u-form-item> @search="query"
<u-row gutter="0"> :show-action="false"
<u-col :span="6"> ></u-search>
<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> </view>
</u-col> <view class="single-right">
</u-form> <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"> <view class="bottom-bar">
<u-row class="button-bar"> <u-row class="button-bar">
<u-col :span="4"> <u-col :span="4">
<u-button type="primary" @click="toPage(page.raw.commission.entrant.detail)"> <u-button type="primary" @click="bill"></u-button>
{{
$t('message.CommissionedEntrantDetails')
}}
</u-button>
</u-col> </u-col>
<u-col :span="4"> <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>
<u-col :span="4"> <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>
<!-- <u-col :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
<!-- </u-col>-->
</u-row> </u-row>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from 'vue-property-decorator'; import { Component, Ref } from "vue-property-decorator";
import { BasePage } from '@/components/base/page'; import { BasePage } from "@/components/base/page";
import { VForm, VFormRules } from 'vue/types/form'; import jPicker from "@/components/J-Picker/jPicker.vue";
import model from './model'; import { session } from "@/store/modules/session";
import { session } from '@/store/modules/session'; import { VForm, VFormRules } from "vue/types/form";
import { headers } from './config'; import model from "./model";
@Component @Component({
export default class stoOutboundDom extends BasePage { components: {
/** jPicker,
* 表单引用 },
*/ })
@Ref('form') readonly $form!: VForm; export default class dnReceiptDom extends BasePage {
/**
* 表格引用
*/
@Ref('table') readonly $table: any;
LocationList: any = [];
/**
* 页面Module
*/
model = model; model = model;
/** form: any = {
* search焦点获取 documentNo: "",
*/
firstFocus = false;
/**
* 表头
*/
headers = headers;
/**
* 表单数据
*/
form = {
dockCode: null, // code
dockName: null, // name
orderNo: null,
qty: 0,
orderAmount: '',
productCode: 'test', // name
productDescZh: 'test',
scanAmount: '',
barCode: '',
}; };
materialList: any = []; // material: any = {};
// materialList: any = [];
selectMaterielList: any = []; list: any = [];
/** every: any = "";
* 工位退料人名称 value = "";
*/ type = "text";
operatorName = ''; border = true;
/** nowAmount: any = "";
* 退料类型选择 //
*/ Location: any = [];
returningTypeSelect = false; //
// wlCode: any = "";
materialCodeSelect = false; //
/** async onShow() {
* 表单验证规则 //
*/ let means: any = JSON.parse(
rules: VFormRules<any> = { localStorage.getItem("__GWMS_APP_STATE_DATA__") as any
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }], );
}; let user: any = session.user;
confirm() { let sendSpot = JSON.parse(localStorage.getItem("sendSpot") as any);
// if (this.wlCode == "" || this.number == "") { let content = {
// uni.showToast({ loginName: means.session.user.loginName,
// icon: "none", sendSpot: sendSpot,
// title: "", factoryCode: means.session.user.factoryCode,
// }); workArea: user.list[0].workareaCode,
// return; };
// } let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
this.LocationList.push(this.form) 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) { deleteItem(index: any) {
this.LocationList.splice(index, 1); this.list.splice(index, 1);
this.business();
} }
async onSubmit() {
// onReadyonLoad if (this.list == null || this.list.length == 0) {
async onReady() { uni.showToast({
this.$form.setRules(this.rules); icon: "none",
model.queryReturningTypeList(); title: "请确保所选物料已分配库位" as any,
}
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,
};
}); });
await this.model.confirm(selctlist); }
// this.$form.resetFields(); let upload = {
// // this.form.barCode = ''; poNo: this.form.documentNo,
// this.selectMaterielList = []; materialCode: this.every.materialCode,
console.log('aaaaaaa', this.model); loginName: session.loginName,
if (this.model.code == '1') { factoryCode: session.factoryCode,
this.materialList = []; list: this.list,
// this.model.materielList = []; };
this.$table.onCheckAllTap(); await this.model.submitOutsourcing(upload);
uni.showToast({ icon: 'success', title: 'success' }); this.list = [];
} this.wlCode = "";
}); this.nowAmount = "";
this.form.barCode = ''; this.every = "";
this.form.productCode = ''; this.materialList = [];
// this.form.orderNo = null; }
this.form.scanAmount = ''; bill() {
this.form.orderAmount = ''; this.redirectTo(this.page.raw.ingoods.dnReceipt.bill);
this.form.productDescZh = ''; }
this.selectMaterielList = []; //
this.$table.onEmpty(); business() {
let num: number = 0;
this.list.forEach((item: any) => {
num += parseFloat(item.nowAmount);
});
this.every.receiptAmount = num;
} }
// }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-raw-returning { .page-raw-receipt {
background: #f2f2f2 background: #f2f2f2
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat; linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx; background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx; padding: 118rpx 30rpx 162rpx;
min-height: 100%; min-height: 100%;
.header { .header {
position: fixed; position: fixed;
top: 36rpx; top: 36rpx;
@ -417,19 +320,139 @@ LocationList: any = [];
height: 88rpx; height: 88rpx;
} }
} }
.content {
.form { width: 100%;
background-color: #fff; background: white;
padding: 40rpx; border-radius: 15rpx;
border-radius: 10rpx; padding: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2); .single {
width: 100%;
.u-form-item { height: 100rpx;
padding: 30rpx 0; display: flex;
line-height: 35rpx; .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 { .bottom-bar {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@ -440,8 +463,5 @@ LocationList: any = [];
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2); box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx; padding: 20rpx;
} }
.button-bar {
}
} }
</style> </style>

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

@ -1,365 +1,297 @@
<template> <template>
<view class="page-raw-returning"> <view class="page-raw-receipt">
<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"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="back" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view> </view>
<view class="title">{{ $t('message.CommissionGoOut') }}</view> <view class="title">{{ $t("message.dn_ReceivingGoods") }}</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="150rpx"> <view class="content">
<u-form-item :required="true" :label="$t('message.CommissionedSingleNumber')" prop="orderNo"> <!-- 单号 -->
<u-search <view class="single">
:placeholder="$t('message.po_PleaseInput')" <view class="single-left">
v-model="form.orderNo" <view>{{ $t("message.dn_OddNumbers") }}</view>
@search="model.queryOrderInInfo" <u-search
:show-action="false" :placeholder="$t('message.dn_PleaseScan')"
></u-search> v-model="form.documentNo"
</u-form-item> @search="query"
<u-row gutter="0"> :show-action="false"
<u-col :span="6"> ></u-search>
<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> </view>
</u-col> <view class="single-right">
</u-form> <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"> <view class="bottom-bar">
<u-row class="button-bar"> <u-row class="button-bar">
<u-col :span="4"> <u-col :span="4">
<u-button type="primary" @click="toPage(page.raw.commission.goOut.detail)"> <u-button type="primary" @click="bill"></u-button>
{{
$t('message.CommissionedGoOutDetails')
}}
</u-button>
</u-col> </u-col>
<u-col :span="4"> <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>
<u-col :span="4"> <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>
<!-- <u-col :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
<!-- </u-col>-->
</u-row> </u-row>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from 'vue-property-decorator'; import { Component, Ref } from "vue-property-decorator";
import { BasePage } from '@/components/base/page'; import { BasePage } from "@/components/base/page";
import { VForm, VFormRules } from 'vue/types/form'; import jPicker from "@/components/J-Picker/jPicker.vue";
import model from './model'; import { session } from "@/store/modules/session";
import { session } from '@/store/modules/session'; import { VForm, VFormRules } from "vue/types/form";
import { headers } from './config'; import model from "./model";
@Component @Component({
export default class stoOutboundDom extends BasePage { components: {
/** jPicker,
* 表单引用 },
*/ })
@Ref('form') readonly $form!: VForm; export default class dnReceiptDom extends BasePage {
/**
* 表格引用
*/
@Ref('table') readonly $table: any;
/**
* 页面Module
*/
model = model; model = model;
/** form: any = {
* search焦点获取 documentNo: "",
*/
firstFocus = false;
/**
* 表头
*/
headers = headers;
/**
* 表单数据
*/
form = {
dockCode: null, // code
dockName: null, // name
orderNo: null,
qty: 0,
orderAmount: '',
productCode: '', // name
productDescZh: '',
scanAmount: '',
barCode: '',
}; };
materialList: any = []; // material: any = {};
// materialList: any = [];
selectMaterielList: any = []; list: any = [];
/** every: any = "";
* 工位退料人名称 value = "";
*/ type = "text";
operatorName = ''; border = true;
/** nowAmount: any = "";
* 退料类型选择 //
*/ Location: any = [];
returningTypeSelect = false; //
// wlCode: any = "";
materialCodeSelect = false; //
/** async onShow() {
* 表单验证规则 //
*/ let means: any = JSON.parse(
rules: VFormRules<any> = { localStorage.getItem("__GWMS_APP_STATE_DATA__") as any
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }], );
}; let user: any = session.user;
let sendSpot = JSON.parse(localStorage.getItem("sendSpot") as any);
// onReadyonLoad let content = {
async onReady() { loginName: means.session.user.loginName,
this.$form.setRules(this.rules); sendSpot: sendSpot,
model.queryReturningTypeList(); factoryCode: means.session.user.factoryCode,
} workArea: user.list[0].workareaCode,
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; let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
setTimeout(() => { res.forEach((item: any) => {
this.form = item; let pickerName: any = {};
this.firstFocus = true; pickerName.label = item.locationCode;
}, 0); pickerName.value = item.locationCode + "(" + item.sendSpot + ")";
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
} }
onOk() { //
// if (this.selectMaterielList.length == 0) { async query() {
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip2') as string }); if (this.form.documentNo == "") {
// } else { uni.showToast({
this.$form.validate(async (valid: boolean) => { icon: "none",
if (!valid) return; title: "请输入单号",
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,
};
}); });
await this.model.confirm(selctlist); return;
// this.$form.resetFields(); }
// // this.form.barCode = ''; let res = await this.model.queryOutsourcing(this.form.documentNo);
// this.selectMaterielList = []; this.material = res.data;
console.log('aaaaaaa', this.model); this.material.forEach((item: any) => {
if (this.model.code == '1') { let pickerName: any = {};
this.materialList = []; pickerName.label = item.materialCode;
// this.model.materielList = []; pickerName.value = item.materialCode;
this.$table.onCheckAllTap(); this.materialList.push(pickerName);
uni.showToast({ icon: 'success', title: 'success' }); });
}
// 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-raw-returning { .page-raw-receipt {
background: #f2f2f2 background: #f2f2f2
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat; linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx; background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx; padding: 118rpx 30rpx 162rpx;
min-height: 100%; min-height: 100%;
.header { .header {
position: fixed; position: fixed;
top: 36rpx; top: 36rpx;
@ -388,19 +320,139 @@ export default class stoOutboundDom extends BasePage {
height: 88rpx; height: 88rpx;
} }
} }
.content {
.form { width: 100%;
background-color: #fff; background: white;
padding: 40rpx; border-radius: 15rpx;
border-radius: 10rpx; padding: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2); .single {
width: 100%;
.u-form-item { height: 100rpx;
padding: 30rpx 0; display: flex;
line-height: 35rpx; .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 { .bottom-bar {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@ -411,8 +463,5 @@ export default class stoOutboundDom extends BasePage {
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2); box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx; padding: 20rpx;
} }
.button-bar {
}
} }
</style> </style>

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

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

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

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

@ -1,43 +1,76 @@
<template> <template>
<view class="page-raw-feeding"> <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"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view> </view>
<view class="title">{{ $t('message.FillingMaterials') }}</view> <view class="title">{{ $t("message.FillingMaterials") }}</view>
<view class="right"></view> <view class="right"></view>
</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-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>
<u-form-item :label="this.$t('message.Feeding_VoucherNo')"> <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>
<!-- <u-form-item :label="this.$t('message.Feeding_VoucherDate')"> <!-- <u-form-item :label="this.$t('message.Feeding_VoucherDate')">
<u-input v-model="form.credDateStr" :placeholder="this.$t('message.po_PleaseInput')" /> <u-input v-model="form.credDateStr" :placeholder="this.$t('message.po_PleaseInput')" />
</u-form-item> --> </u-form-item> -->
<u-form-item :label="this.$t('message.Pi_materielNo')"> <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>
<u-form-item :required="true" :label="this.$t('message.Pi_factory')" prop="sapFactoryCode"> <u-form-item
<u-input v-model="form.sapFactoryCode" :placeholder="this.$t('message.po_PleaseInput')" /> :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>
<u-form-item :label="this.$t('message.Pi_Station')"> <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>
<u-form-item :label="this.$t('message.Pi_OrderNo')"> <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-item>
</u-form> </u-form>
<view class="bottom-bar"> <view class="bottom-bar">
<u-row class="button-bar"> <u-row class="button-bar">
<u-col :span="6"> <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>
<u-col :span="6"> <u-col :span="6">
<u-button type="error" @click="uni.navigateBack()">{{ <u-button type="error" @click="uni.navigateBack()">{{
$t('message.po_Return') $t("message.po_Return")
}}</u-button> }}</u-button>
</u-col> </u-col>
</u-row> </u-row>
@ -46,18 +79,18 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from 'vue-property-decorator'; import { Component, Ref } from "vue-property-decorator";
import { BasePage } from '@/components/base/page'; import { BasePage } from "@/components/base/page";
import { VForm, VFormRules } from 'vue/types/form'; import { VForm, VFormRules } from "vue/types/form";
import model from './model'; import model from "./model";
import { session } from '@/store/modules/session'; import { session } from "@/store/modules/session";
@Component @Component
export default class feedingDom extends BasePage { export default class feedingDom extends BasePage {
/** /**
* 表单引用 * 表单引用
*/ */
@Ref('form') readonly $form!: VForm; @Ref("form") readonly $form!: VForm;
/** /**
* 页面Module * 页面Module
@ -68,15 +101,19 @@ export default class feedingDom extends BasePage {
* 表单数据 * 表单数据
*/ */
form: any = { form: any = {
sapFactoryCode: '', sapFactoryCode: "",
}; };
/** /**
* 表单校验规则 * 表单校验规则
*/ */
rules: VFormRules<any> = { rules: VFormRules<any> = {
inMrpCodeList: [{ required: true, message: this.$t('message.Pi_InputMrp') as string }], inMrpCodeList: [
sapFactoryCode: [{ required: true, message: this.$t('message.Pi_InputFactory') as string }], { required: true, message: this.$t("message.Pi_InputMrp") as string },
],
sapFactoryCode: [
{ required: true, message: this.$t("message.Pi_InputFactory") as string },
],
}; };
// onReadyonLoad // onReadyonLoad
@ -93,39 +130,44 @@ export default class feedingDom extends BasePage {
if (!valid) return; if (!valid) return;
const params = { ...this.form }; const params = { ...this.form };
if (this.form.inMrpCodeList) { if (this.form.inMrpCodeList) {
params.inMrpCodeList = this.form.inMrpCodeList.split(','); params.inMrpCodeList = this.form.inMrpCodeList.split(",");
} else { } else {
delete params.inMrpCodeList; delete params.inMrpCodeList;
} }
if (this.form.materialCodeList) { if (this.form.materialCodeList) {
params.materialCodeList = this.form.materialCodeList.split(','); params.materialCodeList = this.form.materialCodeList.split(",");
} else { } else {
delete params.materialCodeList; delete params.materialCodeList;
} }
if (this.form.sendSpotList) { if (this.form.sendSpotList) {
params.sendSpotList = this.form.sendSpotList.split(','); params.sendSpotList = this.form.sendSpotList.split(",");
} else { } else {
delete params.sendSpotList; delete params.sendSpotList;
} }
if (this.form.inPrdOrderList) { if (this.form.inPrdOrderList) {
params.inPrdOrderList = this.form.inPrdOrderList.split(','); params.inPrdOrderList = this.form.inPrdOrderList.split(",");
} else { } else {
delete params.inPrdOrderList; delete params.inPrdOrderList;
} }
await this.model.queryBlDetailList(params); await this.model.queryBlDetailList(params);
if (this.model.blDetailList.length === 0) { 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; 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-raw-feeding { .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; background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx; padding: 118rpx 30rpx 162rpx;
min-height: 100%; min-height: 100%;

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

Loading…
Cancel
Save