cosmoim-852 fix 新增线边库原材料移库

master
guoshuang 3 years ago
parent 7e7eaa1dbf
commit d4c285eae7

@ -500,5 +500,6 @@ export default {
LineSide: '线边库',
DNLine_PleaseSelect: '请选择DN行项目',
semi_finished_Transfer: '线边库半成品移库',
Lineedge_raw_transfer: '线边库原材料移库',
},
};

@ -500,5 +500,6 @@ export default {
LineSide: 'Line side warehouse',
DNLine_PleaseSelect: 'Please select DN line item',
semi_finished_Transfer: 'Transfer of semi-finished products',
Lineedge_raw_transfer: 'Line edge raw material transfer',
},
};

@ -500,5 +500,6 @@ export default {
LineSide: 'линейный склад',
DNLine_PleaseSelect: 'Выберите пункт в строке DN',
semi_finished_Transfer: 'складирование полуфабрикатов',
Lineedge_raw_transfer: 'транзитный склад',
},
};

@ -1226,6 +1226,14 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/LineSide/Lineedge-raw-transfer/index",
"style": {
"navigationBarTitleText": "线边库原材料移库",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/product/STO-Outbound/index",
"style": {

@ -0,0 +1,321 @@
<template>
<view class="page-product-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.Lineedge_raw_transfer') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" label-width="180rpx">
<!-- 移库码 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.Batch') }}</view>
<u-search :placeholder="$t('message.batch')" class="Transfer" v-model.trim="userDefined4" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" style="height: 60rpx; width: 140rpx" @click="generate">{{ $t('message.generate') }}</u-button>
</view>
</view>
<u-form-item :required="true" :label="$t('message.po_MaterielNo')">
<u-input v-model="productCode" :required="true" :placeholder="$t('message.materialCode')" />
<!-- <jPicker sureColor="#ff0000" @bindpicker="selectItem" showKey="value" valKey="value" :val="remove.value" :options="model.removeMaterialList" /> -->
</u-form-item>
<!-- 数量 -->
<u-form-item :required="true" :label="$t('message.product_Number')">
<u-input v-model="histroyItem.proNum" :required="true" :placeholder="$t('message.Summary_PleaseInputNumber')" />
</u-form-item>
<!-- 条码 -->
<u-form-item :required="true" :label="$t('message.product_barCode')" prop="productCode">
<u-search :placeholder="$t('message.po_PleaseInput')" v-model.trim="form.productCode" @search="query" :show-action="false"></u-search>
</u-form-item>
<!-- 原库位 -->
<u-form-item :required="true" :label="$t('message.product_Location')">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChangeold" showKey="value" valKey="value" :val="form.oldaimWl.value" :options="model.WlList" />
<!-- <u-input :disabled="true" v-model="model.orderInInfo.locCode" placeholder="" /> -->
</u-form-item>
<!-- 目标库位 -->
<u-form-item :required="true" :label="$t('message.Warehouse_TargetLocation')" prop="aimWl">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.WlList" />
</u-form-item>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<!-- 移库明细 -->
<!-- <u-col :span="4">
<u-button type="primary" @click="bill">{{ $t('message.detailed') }}</u-button>
</u-col> -->
<!-- 确定 -->
<u-col :span="6">
<u-button type="primary" @click="onSubmit">{{ $t('message.workArea_Confirm') }}</u-button>
</u-col>
<!-- 返回 -->
<u-col :span="6">
<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, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model';
import { session } from '@/store/modules/session';
interface OptionType {
label: string;
value: string;
}
@Component({
components: {
jPicker,
},
})
export default class productCheckReceipt extends BasePage {
//
@Ref('form') readonly $form!: VForm;
model = model;
form = {
aimWl: {} as OptionType,
oldaimWl: {} as OptionType,
productCode: '',
};
productCode: any = '';
remove: any = {};
allNum = 0;
userDefined4: any = '';
histroyItem: any = {};
aimWlSelect = false;
cboPlaceSelect = false;
rules: VFormRules<any> = {
documentNo: [{ required: true, message: this.$t('message.Warehouse_Tip1') as string }],
aimWl: [{ required: true, message: this.$t('message.Warehouse_Tip3') as string }],
oldaimWl: [{ required: true, message: this.$t('message.product_Tip3') as string }],
cboPlace: [{ required: true, message: this.$t('message.Warehouse_Tip4') as string }],
};
value = '';
show = false;
//
bookTypeChangeold(e: any) {
this.form.oldaimWl = e.pickerName;
}
//
bookTypeChange(e: any) {
this.form.aimWl = e.pickerName;
}
// selectItem(e: any) {
// this.remove = e.pickerName;
// this.model.removeList.forEach((item: any) => {
// if (item.materialCode == this.remove.value) {
// this.histroyItem = item;
// console.log('this.histroyItem', this.histroyItem);
// }
// });
// }
//
async query() {
if (this.form.productCode == ' ' || this.form.productCode.length == 0) {
this.customToast(this.$t('message.product_unit7') as string);
return;
}
if (this.productCode == '' || this.productCode == 0) {
this.customToast(this.$t('message.materialCode') as string);
return;
}
if (this.userDefined4 == '' || this.userDefined4.length == 0) {
this.customToast(this.$t('message.Warehouse_Tip') as string);
return;
}
let params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode: this.form.productCode,
productCode: this.productCode,
};
await model.getProductCode(params);
if (this.model.code == '1') {
uni.showToast({
//icon: 'success',
title: this.$t('message.successful') as string,
duration: 2000,
image: '/static/icons/icon-51.png',
});
}
}
//
async onReady() {
this.$form.setRules(this.rules);
this.model.empty();
await this.model.queryLocation();
this.form.aimWl = this.model.WlList[0];
this.form.oldaimWl = this.model.WlList[0];
}
// async onShow() {
// await this.model.queryLocation();
// this.form.aimWl = this.model.WlList[0];
// this.form.oldaimWl = this.model.WlList[0];
// }
//
async generate() {
let params = {
loginName: session.loginName,
factoryCode: session.factoryCode,
};
await this.model.getCpMoveBatchNo(params);
this.userDefined4 = model.userDefined;
}
//
onSubmit() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
if (this.userDefined4 == ' ' || this.userDefined4.length == 0) {
this.customToast(this.$t('message.LibraryCode') as string);
return;
}
if (!this.form.productCode) {
this.customToast(this.$t('message.Warehouse_Tip5') as string);
return;
}
if (!this.histroyItem.proNum) {
this.customToast(this.$t('message.Summary_PleaseInputNumber') as string);
return;
}
if (!this.form.aimWl.value) {
this.customToast(this.$t('message.Warehouse_Tip3') as string);
return;
}
if (!this.form.oldaimWl.value) {
this.customToast(this.$t('message.Warehouse_Tip3') as string);
return;
}
// if (this.form.aimWl.value == model.orderInInfo.locCode) {
// this.customToast(this.$t('message.TargetLocation') as string);
// return;
// }
const orderlist = [
{
...this.model.orderInInfo,
originWl: this.form.oldaimWl.value,
barCode: this.model.orderInInfo.barcode,
aimWl: this.form.aimWl.value,
qty: this.histroyItem.proNum,
type: '2',
orderType: '6',
keepBy: session.loginName as string,
factoryCode: session.factoryCode as string,
userDefined4: this.userDefined4,
},
];
await this.model.onTakeoutConfirm(orderlist);
if (model.code == '1') {
this.customToast(this.$t('message.Warehouse_Tip9') as string);
// this.form.productCode = '';
this.model.empty();
// this.query()
this.form.productCode = '';
this.histroyItem.proNum = '';
this.productCode = '';
this.allNum = 0;
//this.QueryHistory();
// setTimeout(() => {
// this.$forceUpdate();
// }, 2000);
}
});
}
}
</script>
<style lang="scss" scoped>
.page-product-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: 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 30rpx 0;
line-height: 35rpx;
.Transfer {
width: 280rpx;
height: 64rpx;
background: rgb(242, 242, 242);
border-radius: 110rpx;
}
}
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 170rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 140rpx;
height: 70rpx;
}
}
}
}
.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;
}
.button-bar {
}
}
</style>

@ -0,0 +1,146 @@
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 { page } from '@/utils/page';
class OrderInInfo {
productDescZh?: string;
qty?: string;
custCode?: string;
custCodeName?: string;
productCode?: string;
locCode?: string;
barcode?: string;
// actualQty?: string;
}
@Module({
namespaced: true,
dynamic: true,
store,
name: 'row.LineSide.Lineedge-raw-transfer',
})
export class wholeTransfer extends VuexModule {
/**
*
*/
WlList = [];
userDefined: any = '';
detailedList: any;
code = '';
delCode = '';
removeList: any = [];
removeMaterialList: any = [];
dnNo = '';
orderInInfo: OrderInInfo = new OrderInInfo();
@MutationAction
async queryLocation() {
const result: any = await http.get(url.warehouse.wholeTransfer.getMdLocationRawAndLine, {
params: {
factoryCode: session.factoryCode,
loginName: session.loginName,
},
});
console.log('库位数据', result);
const WlList = result.data.map((_: any) => ({
label: _.locationCode,
value: _.locationCode,
}));
return { WlList };
}
/**
*
* DN
* @param dnNo
*/
@MutationAction
async getProductCode(params: any) {
const res: any = await http.post(url.warehouse.container.getRawStorageSnNew, params);
const code = res.code;
const orderInInfo = res.data;
// if (orderInInfo.custCode == '0') {
// orderInInfo.custCodeName = vm.$t('message.Warehouse_NX') as any;
// } else if (orderInInfo.custCode == '1') {
// orderInInfo.custCodeName = vm.$t('message.Warehouse_WX') as any;
// } else if (orderInInfo.custCode == '2') {
// orderInInfo.custCodeName = vm.$t('message.Warehouse_YJ') as any;
// } else if (orderInInfo.custCode == '4') {
// orderInInfo.custCodeName = vm.$t('message.Warehouse_BCP') as any;
// }
return { orderInInfo, code };
}
//退扫
@MutationAction
async codeDel(params: any) {
const res: any = await http.post(url.warehouse.wholeTransfer.del, params);
const delCode = res.code;
return { delCode };
}
//清除数据
@MutationAction
async empty() {
const orderInInfo: any = [];
// const userDefined = '';
// const WlList = [];
const code = '';
return { orderInInfo, code };
}
@MutationAction
async onTakeoutConfirm(list: any) {
const records: any = await http.post(url.warehouse.rowTransfer.confirmMoveRussia, list);
const code = records.code;
return { code };
}
//生成移库码
@MutationAction
async getCpMoveBatchNo(params: any = {}) {
const res: any = await http.post(url.warehouse.rowTransfer.getCode, params);
const userDefined: any = res.data;
return { userDefined };
}
//查询已扫物料
@MutationAction
async QueryHistory(params: any = {}) {
const res: any = await http.post(url.warehouse.rowTransfer.queryGroupListByMoveCode, params);
const removeList: any = res.data;
const removeMaterialList: any = [];
res.data.forEach((item: any) => {
const arr: any = {
value: item.materialCode,
laber: item.materialCode,
};
removeMaterialList.push(arr);
});
return { removeList, removeMaterialList };
}
//查询明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
//@MutationAction
async querydetaildle(userDefined4: any) {
const res: any = await http.post(url.warehouse.rowTransfer.queryListByMoveCode, {
loginName: session.loginName,
factoryCode: session.factoryCode,
proMoveCode: userDefined4,
});
console.log('明细》》》》》》》》》', res.data);
this.detailedList = res.data;
return res;
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async changeOrderInLocation(kw: string) {
await http.post('/wmspda/material/orderin/enter', {
loginName: session.loginName,
// loginName: '1999',
warehouseCode: '',
factoryCode: session.factoryCode,
// factoryCode: '1999',
locationCode: kw,
});
return kw;
}
}
export default getModule(wholeTransfer);

@ -217,6 +217,9 @@ export const page = {
index: '/pages/raw/LineSide/semi-finished-Transfer/index',
detail: '/pages/raw/LineSide/semi-finished-Transfer/details',
},
Lineedgerawtransfer: {
index: '/pages/raw/LineSide/Lineedge-raw-transfer/index',
},
},
},
SemiProduct: {

@ -276,6 +276,7 @@ export const url = {
del: '/wmspda/fg/scanBarcodeStock/del',
getMdLocationSfgLine: '/wmspda/fg/getMdLocationSfgLine',
getMdLocationSfg: '/wmspda/fg/getMdLocationSfg',
getMdLocationRawAndLine: '/wmspda/fg/getMdLocationRawAndLine',
getSpareMdLocation: '/wmspda/sparePart/getSpareMdLocation',
queryOnshelfOrder: '/wmspda/sparePart/queryOnshelfOrder',
queryDownshelfOrder: '/wmspda/sparePart/queryDownshelfOrder',

Loading…
Cancel
Save