cosmoim-852 fix 新增半成品下线入库

master
hou 3 years ago
parent eed2a7a378
commit 5c7956f2da

@ -496,5 +496,7 @@ export default {
Pi_tipqty: '请确保等于需求数量', Pi_tipqty: '请确保等于需求数量',
SemiFinished: '半成品', SemiFinished: '半成品',
SemiFinished_SO: '半成品SO', SemiFinished_SO: '半成品SO',
SemiFinishedOffline: '半成品下线',
sweepCode: '请先扫码',
}, },
}; };

@ -503,5 +503,7 @@ export default {
Pi_tipqty: 'Please make sure it is equal to the required quantity', Pi_tipqty: 'Please make sure it is equal to the required quantity',
SemiFinished: 'Semi-finished', SemiFinished: 'Semi-finished',
SemiFinished_SO: 'Semi-finished SO', SemiFinished_SO: 'Semi-finished SO',
SemiFinishedOffline: 'Semi-finished offline',
sweepCode: 'Please sweep the code first',
}, },
}; };

@ -962,6 +962,14 @@
"navigationBarTextStyle": "white" // white-black- "navigationBarTextStyle": "white" // white-black-
} }
}, },
{
"path": "pages/raw/Semi-finished/Semi-finished-offline/index",
"style": {
"navigationBarTitleText": "半成品下线",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{ {
"path": "pages/raw/ingoods/SpareInbound/Inbound/index", "path": "pages/raw/ingoods/SpareInbound/Inbound/index",
"style": { "style": {

@ -8,12 +8,12 @@
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="table-wrapper"> <view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" enable-check="multiple" show-left-and-right-border :headers="headers" :contents="model.materielList" :show-vert-border="false"></wyb-table> <wyb-table class="table" ref="table" width="100%" enable-check="multiple" show-left-and-right-border :headers="headers" :contents="model.detailmaterielList" :show-vert-border="false"></wyb-table>
</view> </view>
<view class="bottom-bar"> <view class="bottom-bar">
<div class="extra"> <div class="extra">
<u-row class="bottom-info"> <u-row class="bottom-info">
<u-col :span="12">{{ $t('message.po_Total') }} {{ model.materielList.length }} {{ $t('message.po_Records') }}</u-col> <u-col :span="12">{{ $t('message.po_Total') }} {{ model.detailmaterielList.length }} {{ $t('message.po_Records') }}</u-col>
</u-row> </u-row>
</div> </div>
</view> </view>

@ -29,6 +29,7 @@ export class ReturningModule extends VuexModule {
* *
*/ */
materielList: any[] = []; materielList: any[] = [];
detailmaterielList: any = [];
//条码扫描的返回的结果 //条码扫描的返回的结果
oneMaterielDetail: any = {}; oneMaterielDetail: any = {};
@ -194,9 +195,9 @@ export class ReturningModule extends VuexModule {
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
}); });
console.log('res数据', data, code); console.log('res数据', data, code);
const materielList = data; const detailmaterielList = data;
console.log('>>>>>>>', materielList); console.log('>>>>>>>', detailmaterielList);
return { code, materielList }; return { code, detailmaterielList };
} }
//退扫接口 //退扫接口

@ -0,0 +1,21 @@
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.product_barCode'),
key: 'barcode',
width: 320,
},
{
label: vm.$t('message.product_FGCode'),
key: 'productCode',
width: 300,
},
{
label: vm.$t('message.product_Location'),
key: 'locCode',
width: 300,
},
];

@ -0,0 +1,319 @@
<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="back" />
</view>
<view class="title">{{ $t('message.SemiFinishedOffline') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="120rpx">
<u-row>
<u-col :span="12">
<u-form-item :label="$t('message.product_barCode')">
<u-search :placeholder="$t('message.po_PleaseInput')" v-model.trim="form.barCode" @search="getBarcode" maxlength="20" :show-action="false"></u-search>
</u-form-item>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.Pi_OrderNo') }}</view>
<view class="material-right-code" style="overflow: hidden">{{ every.orderNo }}</view>
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.ModelName') }}</view>
<view class="material-right-code" style="overflow: hidden">{{ every.productDesc }}</view>
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.ModelCode') }}</view>
<view class="material-right-code" style="overflow: hidden">{{ every.productCode }}</view>
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.product_Number') }}</view>
<view class="material-right-code" style="overflow: hidden">{{ every.qty }}</view>
</view>
</view>
<u-form-item :required="true" :label="$t('message.product_Location')" prop="dockName">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="wlcodeList" :focus="true" />
<u-col :span="3">
<u-button type="success" @click="add">{{ $t('message.product_add') }}</u-button>
</u-col>
</u-form-item>
</u-col>
<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="materielList" :show-vert-border="false" @onCheck="onCheck"></wyb-table>
</view>
</u-col>
</u-row>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="3">
<u-button type="error" @click="onDelete">{{ $t('message.product_Delete') }}</u-button>
</u-col>
<u-col :span="3">
<u-button type="primary" @click="clearList">
{{ $t('message.product_Empty') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="warning" @click="onSelectAll">
{{ $t('message.product_AllSelect') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="success" @click="onOk">{{ $t('message.product_Confirm') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref, Watch } from 'vue-property-decorator';
import { VForm } from 'vue/types/form';
import { BasePage } from '@/components/base/page';
import model from './model';
import { headers } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
interface OptionType {
label: string;
value: string;
}
@Component({
components: {
jPicker,
},
})
export default class finishProductOfflineDom extends BasePage {
@Ref('table') readonly $table: any;
@Ref('form') readonly $form!: VForm;
@Watch('form', { immediate: true, deep: true })
model = model;
headers = headers;
form = {
barCode: '',
aimWl: {} as OptionType,
};
materielList: any = [];
every: any = {};
selectMaterielList: any = [];
wlcodeList: any = [];
async onReady() {
await this.model.queryReturningTypeList();
this.wlcodeList = this.model.returningTypeList;
this.form.aimWl = this.model.firstLocation;
}
back() {
this.form.barCode = '';
this.selectMaterielList = [];
uni.navigateBack({ delta: 1 });
this.$table.onEmpty();
}
async getBarcode() {
if (!this.form.barCode) {
this.customToast(this.$t('message.barcode') as string);
return;
}
await this.model.queryOrderInInfo(this.form.barCode);
if (this.model.searchCode == '1') {
uni.showToast({
title: this.$t('message.product_Tip8') as string,
image: '/static/icons/icon-51.png',
});
}
this.every = this.model.materielList[this.model.materielList.length - 1];
console.log(this.form.aimWl);
let list: any = [];
this.wlcodeList.forEach((item: any) => {
if (item.sendSpot == this.every.sendSpot) {
list.push(item);
}
});
if (list.length == 0) {
return;
} else {
this.wlcodeList = list;
}
}
bookTypeChange(e: any) {
this.form.aimWl = e.pickerName;
}
add() {
if (!this.form.barCode) {
this.customToast(this.$t('message.barcode') as string);
return;
}
if (!this.every) {
this.customToast(this.$t('message.sweepCode') as string);
return;
}
if (!this.form.aimWl) {
this.customToast(this.$t('message.product_Tip3') as string);
return;
}
this.materielList.push(this.every);
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
}
onCheck(e: any) {
this.selectMaterielList = [];
e.data.forEach((line: any) => {
const { lineData: item } = line;
this.selectMaterielList.push(item);
});
console.log('this.selectMaterielList', this.selectMaterielList);
}
onDelete() {
let indexs: any = [];
this.materielList.forEach((item: any, index: any) => {
this.selectMaterielList.forEach((item2: any) => {
if (item.barcode == item2.barcode) {
indexs.push(index);
}
});
});
for (let i = 0; i < indexs.length; i++) {
delete this.materielList[indexs[i]];
}
let newList = [];
this.materielList.forEach((item: any) => {
if (item.barcode) {
newList.push(item);
}
});
this.materielList = newList;
this.selectMaterielList = [];
this.$table.onEmpty();
}
clearList() {
this.$form.resetFields();
this.form.barCode = '';
this.selectMaterielList = [];
this.materielList = [];
this.every = '';
this.$table.onEmpty();
}
onSelectAll() {
this.$table.onCheckAllTap();
this.selectMaterielList = this.materielList;
}
async onOk() {
if (this.selectMaterielList.length == 0) {
this.customToast(this.$t('message.product_Tip2') as string);
} else {
this.selectMaterielList.forEach((item: any) => {
item.factoryCode = session.factoryCode;
item.warehouseCode = session.warehouseCode; //
item.regionCode = session.regionCode; //
item.areaCode = session.regionCode; //
item.operator = session.loginName; //
item.loginName = session.loginName; //
});
await this.model.confirm(this.selectMaterielList);
if (this.model.code == '1') {
this.materielList = [];
this.$form.resetFields();
this.form.barCode = '';
this.selectMaterielList = [];
this.every = '';
}
this.$table.onEmpty();
}
}
}
</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;
}
}
.form {
background-color: #fff;
padding: 30rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 30rpx 0;
line-height: 35rpx;
}
.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;
}
}
}
}
.table-wrapper {
padding: 10rpx 0;
}
.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,121 @@
import { 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';
// import { order } from '@/pages/raw/handover/kan-dan/model';
class OrderInInfo {
stoAmount?: 0;
stoNo?: string; //STO采购单号
orderAmount?: string; //单据总数
Allocated?: string; //已分配
Unallocated?: string; //未分配
}
@Module({
namespaced: true,
dynamic: true,
store,
name: 'Semi-finished-offline',
})
export class PickingModule extends VuexModule {
/**
*
*/
returningTypeList: any[] = [];
firstLocation: any = {};
searchCode: any = '';
/**
*
*/
materielList: any = [];
/**
*
*/
orderInInfo: OrderInInfo = new OrderInInfo();
//确认按钮的code码
code = '';
//data
data: any = {};
/**
*
*/
@MutationAction
async queryReturningTypeList() {
const data: any = await http.get(url.inbound.finishProductOffline.kuwei, {
params: {
factoryCode: session.factoryCode,
loginName: session.loginName,
warehouseCode: session.warehouseCode, //仓库编码
},
});
console.log('data', data.data);
const returningTypeList = data.data.map((item: any) => ({
label: item.locationCode,
value: item.locationCode + '(' + item.sendSpot + ')',
}));
const firstLocation = returningTypeList[0];
// const firstLocation = data.data[0];
// firstLocation.label = firstLocation.locationCode;
// firstLocation.value = firstLocation.locationCode + '(' + firstLocation.sendSpot + ')';
return { returningTypeList, firstLocation };
}
//根据扫描的条码推荐库位
@MutationAction
async queryTypeList(prodCode: any) {
const res: any = await http.post(url.inbound.finishProductOffline.SearchKuwei, {
factoryCode: session.factoryCode,
loginName: session.loginName,
prodCode: prodCode,
});
console.log('data', res.data);
const returningTypeList = res.data.map((item: any) => ({
label: item.locationCode,
value: item.locationCode + '(' + item.sendSpot + ')',
}));
const firstLocation = returningTypeList[0];
return { returningTypeList, firstLocation };
}
/**
*
* @param orderNo
*/
@MutationAction
async queryOrderInInfo(barcode: any) {
const { data, code }: any = await http.post(url.inbound.finishProductOffline.finished, {
barcode,
loginName: session.loginName,
});
const searchCode = code;
const materielList2 = [];
materielList2.push(data);
const materielList = materielList2;
return { searchCode, materielList };
}
@MutationAction
async setSearchCode() {
const searchCode = '';
return { searchCode };
}
/**
*
* @param orderNo
*/
@MutationAction
async confirm(list: any[]) {
const { code, data, msg } = (await http.post(url.inbound.finishProductOffline.batchOffline, list)) as any;
console.log('res数据', code, data, msg);
if (code == '1') {
uni.showToast({
title: msg,
duration: 2000,
image: '/static/icons/icon-51.png',
});
} else {
vm.customToast(msg);
}
return { code, data };
}
}
export default getModule(PickingModule);

@ -22,6 +22,7 @@
> >
<u-icon size="80" :name="item.iconClass"></u-icon> <u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text> <text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
<!-- <text class="name"> {{ $t('message.' + item.engResourceName) }}</text> -->
</u-button> </u-button>
</u-col> </u-col>
<!-- <u-col :span="12"> <!-- <u-col :span="12">
@ -64,6 +65,7 @@ import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page'; import { BasePage } from '@/components/base/page';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import model from './model'; import model from './model';
import { session } from '@/store/modules/session';
@Component @Component
export default class RawHome extends BasePage { export default class RawHome extends BasePage {
@ -71,6 +73,7 @@ export default class RawHome extends BasePage {
today = dayjs().format('YYYY-MM-DD dddd'); today = dayjs().format('YYYY-MM-DD dddd');
onLoad() { onLoad() {
this.model.getMenuList(); this.model.getMenuList();
console.log(session.lang);
} }
} }
</script> </script>

@ -52,7 +52,7 @@ export const detailHeaders = [
}, },
{ {
label: vm.$t('message.Container'), label: vm.$t('message.Container'),
key: 'sn', //数量 key: 'sn', //容器码
width: 600, width: 600,
}, },
]; ];

@ -162,6 +162,8 @@ export const url = {
SearchKuwei: '/wmspda/fg/getMdLocationProd', SearchKuwei: '/wmspda/fg/getMdLocationProd',
barcode: '/wmspda/product/finished/show-info', barcode: '/wmspda/product/finished/show-info',
confirm: '/wmspda/product/finished/batch-offline', confirm: '/wmspda/product/finished/batch-offline',
batchOffline: '/wmspda/product/finished/batch-offline/russia',
finished: '/wmspda/product/finished/show-info/russia',
}, },
semiFinishProductOfflineRefrigerator: { semiFinishProductOfflineRefrigerator: {
kuwei: '/wmspda/fg/getMdLocation', kuwei: '/wmspda/fg/getMdLocation',

Loading…
Cancel
Save