Overseamom-518 feat 增加委外退货

master
mabaoyan 2 years ago
parent b2d0734a9e
commit e396cf9d67

@ -280,6 +280,7 @@ export default {
CommissionedReceiptQuantity: '收货数量',
subcontract: '委外',
CommissionGoOut: '委外出库',
CommissionReturn: '委外退料',
Outbound: '出库库位',
Warehousing: '入库库位',
PleaseQuantity: '请输入本次数量',

@ -280,6 +280,7 @@ export default {
CommissionedReceiptQuantity: 'Receipt quantity',
subcontract: 'Subcontract',
CommissionGoOut: 'Subcontracting issue',
CommissionReturn: 'Subcontracting return',
Outbound: 'Outbound location',
Warehousing: 'Warehouse location',
PleaseQuantity: 'Please enter this quantity',

@ -276,6 +276,7 @@ export default {
CommissionedReceiptQuantity: 'Количество поступления товара',
subcontract: 'Аутсорсинг',
CommissionGoOut: 'Склад на аутсорсинге',
CommissionReturn: 'Subcontracting return',
Outbound: 'Место выхода со склада',
Warehousing: 'Место входа на склад',
PleaseQuantity: 'Пожалуйста, введите данное количество',

@ -1058,6 +1058,14 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/commission/return/index",
"style": {
"navigationBarTitleText": "委外退料",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/commission/goOut/detail",
"style": {

@ -0,0 +1,58 @@
/*
* @Author: zhou lei
* @Date: 2021-11-11 11:09:57
* @LastEditTime: 2021-12-14 10:13:18
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/commission/goOut/config.ts
* :910592680@qq.com 18669792120
*/
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.CommissionedSingleNumber'),
key: 'poNo',
width: 200,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 300,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc',
width: 300,
},
{
label: vm.$t('message.CommissionedGoOutNumber'),
key: 'outAmount',
width: 200,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 200,
},
];
export const detailHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 301,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 186,
},
{
label: vm.$t('message.product_Number'),
key: 'nowAmount',
width: 186,
},
];

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

@ -0,0 +1,510 @@
<template>
<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="uni.navigateBack({})" />
</view>
<view class="title">{{ $t('message.CommissionGoOut') }}</view>
<view class="right"></view>
</view>
<view class="content">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.CommissionedSingleNumber') }}</view>
<u-search :placeholder="$t('message.InventoryPleaseScan')" v-model.trim="form.documentNo" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</view>
</view>
<!-- 供应商 -->
<view class="number">
<view class="number-left">
<view class="number-left-title">{{ $t('message.supplierCode') }}</view>
<u-input v-model="every.supplyCode" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'; flex: 0.9" />
</view>
<view class="number-right">
<view class="number-right-title">{{ $t('message.supplierName') }}</view>
<u-input placeholder=" " v-model="every.supplyName" :type="type" :border="border" class="input" style="padding: '0'" disabled />
</view>
</view>
<!-- 物料 -->
<view class="material">
<view class="material-left">
<view>{{ $t('message.CommissionedMaterielNo') }}</view>
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="materialChoice" showKey="value" valKey="value" :val="every.materialCode" class="search" :options="materialList" />
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.CommissionedMaterielDesc') }}</view>
<view class="material-right-code" style="overflow: hidden">{{ every.materialDesc }}</view>
</view>
</view>
<!-- 需求数量 -->
<view class="number">
<view class="number-left">
<view class="number-left-title">{{ $t('message.CommissionedDemandData') }}</view>
<u-input v-model="every.orderAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'; flex: 0.9" />
</view>
<view class="number-right">
<view class="number-right-title">{{ $t('message.Cumulative') }}</view>
<u-input placeholder=" " v-model="every.outAmount" :type="type" :border="border" class="input" style="padding: '0'" disabled />
</view>
</view>
<!-- 库位 -->
<view class="library">
<view class="library-left">
<view>{{ $t('message.CommissionedLocation') }}</view>
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode.value" class="search" :options="Loc" />
</view>
<view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view>
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="nowAmount" type="number" :border="border" class="input" />
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view>
<!-- 表格 -->
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeader" :contents="list" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view>
<!-- 底部按钮 -->
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="detail">{{ $t('message.CommissionedDetails') }}</u-button>
</u-col>
<!-- <u-col :span="3">
<u-button type="primary" @click="close">{{ $t('message.Closed') }}</u-button>
</u-col> -->
<u-col :span="4">
<u-button type="primary" @click="submit">{{ $t('message.product_Upload') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component } 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 { detailHeader } from './config';
import model from './model';
@Component({
components: {
jPicker,
},
})
export default class dnReceiptDom extends BasePage {
model = model;
detailHeader = detailHeader;
form: any = {
documentNo: '',
};
material: any = {};
materialList: any = [];
list: any = [];
every: any = '';
value = '';
type = 'text';
border = true;
nowAmount: any = '';
//
Loc: any = [];
//
wlCode: any = '';
materialIndex: any = null;
async QueryLoc() {
await this.model.queryLocList({
workArea: session.workareaCode,
loginName: session.loginName,
sendSpot: null,
factoryCode: session.factoryCode,
});
this.Loc = [];
this.wlCode = '';
if (this.model.LocList.length == 0) {
uni.showModal({
content: this.$t('message.selected') as any,
showCancel: false,
confirmText: this.$t('message.workArea_Confirm') as any,
});
} else {
this.Loc = this.model.LocList;
this.wlCode = this.Loc[0];
}
}
empty() {
this.list = [];
this.wlCode = '';
this.nowAmount = '';
this.every = '';
this.materialList = [];
this.Loc = [];
}
async close() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
uni.showModal({
content: this.$t('message.closing') as any,
cancelText: this.$t('message.product_Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: async (res) => {
if (res.confirm) {
await this.model.closeCode(this.form.documentNo);
if (this.model.code == '1') {
this.customToast(this.$t('message.Warehouse_Tip9') as any);
this.empty();
this.form.documentNo == '';
}
} else if (res.cancel) {
return;
}
},
});
}
//
async query() {
this.list = [];
//this.wlCode = '';
this.nowAmount = '';
this.every = '';
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
let res = await this.model.querySubcontractInfo(this.form.documentNo);
this.material = res.data;
this.materialList = [];
this.material.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.materialCode;
pickerName.value = item.materialCode;
this.materialList.push(pickerName);
});
this.every = this.material[0];
this.materialIndex = 0;
await this.QueryLoc();
}
// receiptAmount requestAmount
materialChoice(e: any) {
this.nowAmount = '';
this.material.forEach(async (item: any, index: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
this.materialIndex = index;
await this.QueryLoc();
return;
}
});
}
//
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
//
Add() {
if (!this.every) {
this.customToast(this.$t('message.Commission_tips6') as any);
return;
}
if (this.nowAmount == '' || this.wlCode == '') {
this.customToast(this.$t('message.Commission_tips2') as any);
return;
}
if (parseFloat(this.nowAmount) <= 0) {
this.customToast(this.$t('message.Commission_tips3') as any);
return;
}
let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount);
if (num > parseFloat(this.every.orderAmount)) {
uni.showModal({
title: this.$t('message.Pi_tip') as any,
content: this.$t('message.demandQuantity') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '';
} else if (res.cancel) {
return;
}
},
});
} else {
let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '';
}
}
deleteItem(e: any) {
uni.showModal({
content: this.$t('message.product_Delete') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
this.list.splice(e.contentIndex, 1);
let i: any;
this.material.forEach((item: any, index: any) => {
if (item.materialCode == e.lineData.materialCode) {
i = index;
}
});
this.material[i].outAmount -= parseFloat(e.lineData.nowAmount);
} else if (res.cancel) {
return;
}
},
});
}
async submit() {
if (this.list == null || this.list.length == 0) {
this.customToast(this.$t('message.Commission_tips5') as any);
}
await this.model.submitSubcontractReturn(this.list);
this.empty();
await this.query();
}
async detail() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message._tips6') as any);
return;
}
let person = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: person.session.user.loginName,
poNo: this.form.documentNo,
factoryCode: person.session.user.factoryCode,
};
await this.model.querydetaildlistSubcontractReturn(content);
this.toPage(this.page.raw.commission.goOut.detail);
}
}
</script>
<style lang="scss" scoped>
.page-raw-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 88rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.content {
width: 100%;
background: white;
border-radius: 15rpx;
padding: 10rpx;
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 130rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-left {
width: 100%;
height: 100%;
display: flex;
view {
width: 140rpx;
line-height: 100rpx;
}
.search {
padding-left: 9px;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right {
width: 100%;
height: 100%;
display: flex;
.material-right-title {
width: 140rpx;
height: 100%;
line-height: 100rpx;
}
.material-right-code {
width: 80%;
height: 100%;
line-height: 100rpx;
text-align: left;
padding-left: 10px;
// line-height: 100rpx;
}
}
}
.number {
height: 100rpx;
display: flex;
.number-left {
width: 50%;
height: 100%;
display: flex;
.number-left-title {
width: 182rpx;
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: 144rpx;
height: 100%;
line-height: 100rpx;
text-align: center;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 30rpx;
}
}
}
.library {
width: 100%;
height: 100rpx;
display: flex;
.library-left {
width: 50%;
height: 100%;
display: flex;
view {
width: 70rpx;
line-height: 100rpx;
}
.search {
padding-left: 1px;
text-align: center;
white-space: nowrap;
overflow: scroll;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
text-align: center;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 30rpx;
}
}
}
.add {
width: 100%;
height: 100rpx;
position: relative;
button {
position: absolute;
top: 10rpx;
right: 20rpx;
}
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
}
</style>

@ -0,0 +1,185 @@
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 {
stoAmount?: 0;
stoNo?: string; //STO采购单号
orderAmount?: string; //单据总数
Allocated?: string; //已分配
Unallocated?: string; //未分配
}
@Module({
namespaced: true,
dynamic: true,
store,
name: 'product.outbound.stoOut',
})
export class ReturningModule extends VuexModule {
/**
*
*/
returningTypeList: any[] = [];
detailedList: any;
/**
*
*/
materielList: any[] = [];
locationCodeList: any[] = [];
LocList: any[] = [];
//条码扫描的返回的结果
oneMaterielDetail: any = {};
/**
*
*/
orderInInfo: OrderInInfo = new OrderInInfo();
//记账按钮的code码
code = '';
/**
*
* @param orderNo
*/
@Action
async queryOrder(form: any) {
const result = await http.post(url.material.commission.goOut.queryOrder, {
...form,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
const orderInInfo = result.data.records[0] || {};
return { orderInInfo };
}
/**
*
*/
// @MutationAction
// async queryByFactoryCodeAndWorkAreaCode() {
// const list: [] = await http.post(url.material.commission.goOut.queryByFactoryCodeAndWorkAreaCode, {
// factoryCode: session.factoryCode,
// whCode: session.warehouseCode,
// loginName: session.loginName,
// });
// const locationCodeList = list.map((item: any) => ({
// label: item.locationCode,
// value: item.locationCode,
// }));
// return { locationCodeList };
// }
/**
*
*
* @returns
* @memberof ReturningModule
*/
@MutationAction
async outInfo(poNo: string) {
const list: [] = await http.post(url.material.commission.goOut.outInfo, {
factoryCode: session.factoryCode,
poNo: poNo,
loginName: session.loginName,
});
const locationCodeList = list.map((item: any) => ({
label: item.locationCode,
value: item.locationCode,
}));
return { locationCodeList };
}
/**
*
*/
@Action
async materialComplete(form: any) {
const res = await http.post(url.material.commission.goOut.materialComplete, {
factoryCode: session.factoryCode,
loginName: session.loginName,
...form,
});
console.log(res, '>>>>>res');
}
/**
*
*/
@Action
async tluSubmit(list: any[]) {
const obj = {
barcode: list[0].barCode,
loginName: session.loginName,
};
let oneMaterielDetail: any = {};
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);
return oneMaterielDetail;
}
/**
*
* @param orderNo
*/
@MutationAction
async confirm(list: any[]) {
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 {
// uni.showToast({ icon: 'none', title: msg });
// }
const materielList: any = [];
return { code, materielList };
}
//委外出库 关闭订单
@MutationAction
async closeCode(poNo: any) {
const res: any = await http.post(url.outbound.stoOutbound.close, {
poNo,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
const code: any = res.code;
return { code };
}
//委外出库 初始化获取库位
// @Action({ commit: 'updateCheckedOrderInInfoListKw' })
@MutationAction
async queryLocList(content: any) {
const res: any = await http.post(url.Subcontract.base.queryLocList, content);
const LocList = res;
return { LocList };
}
//订单信息查询
@Action
async querySubcontractInfo(poNo: any) {
const res = await http.post(url.Subcontract.matReturn.queryOrderInfo, {
poNo,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
return res;
}
//submit
@Action
async submitSubcontractReturn(upload: any) {
const res = await http.post(url.Subcontract.matReturn.submit, upload);
return res;
}
//查询明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlistSubcontractReturn(content: any) {
const res: any = await http.post(url.Subcontract.matReturn.detail, content);
console.log('明细》》》》》》》》》', res.list);
this.detailedList = res.data;
return res;
}
}
export default getModule(ReturningModule);

@ -257,6 +257,10 @@ export const page = {
index: '/pages/raw/commission/goOut/index',
detail: '/pages/raw/commission/goOut/detail',
},
return: {
index: '/pages/raw/commission/return/index',
detail: '/pages/raw/commission/return/detail',
},
RUSentrant: {
index: '/pages/raw/commission/RUS-entrant/index',
detail: '/pages/raw/commission/RUS-entrant/detail',

@ -152,6 +152,18 @@ export const url = {
},
soInbound: {},
},
Subcontract: {
base: {
queryLocList: '/wmspda/subcontractRf/queryLocList',
},
matReturn: {
queryOrderInfo: '/wmspda/subcontractRf/return/queryOrderInfo',
submit: '/wmspda/subcontractRf/return/submit',
detail: '/wmspda/subcontractRf/return/detail',
},
matOut: {},
matIn: {},
},
//出库
outbound: {
stoOutbound: {

Loading…
Cancel
Save