cosmoim-852 fix 新增备件入库功能

master
hou 3 years ago
parent f4631b7dcf
commit e5cf803cd7

@ -483,5 +483,11 @@ export default {
WPMInformation: 'WPM信息',
Container: '容器码',
returner: '退料人必须等于登录人',
Inbound: '备件入库',
InboundDetail: '入库明细',
orderNum: '订单数量',
totalNum: '累计数量',
Operation: '操作人',
StorageTime: '入库时间',
},
};

@ -488,5 +488,11 @@ export default {
WPMInformation: 'WPM-Information',
Container: 'Container Code',
returner: 'The returner must be equal to the login',
Inbound: 'Spare Inbound',
InboundDetail: 'Inbound Detail',
orderNum: 'Order Num',
totalNum: 'total Num',
Operation: 'Operation',
StorageTime: 'Storage Time',
},
};

@ -818,6 +818,38 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/ingoods/SpareInbound/index",
"style": {
"navigationBarTitleText": "备件管理",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/ingoods/SpareInbound/Inbound/index",
"style": {
"navigationBarTitleText": "备件入库",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/product/outbound/SpareDeliverGoods/index",
"style": {
"navigationBarTitleText": "备件发货",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/ingoods/SpareInbound/Inbound/Local-details",
"style": {
"navigationBarTitleText": "备件明细",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/demo/index",
"style": {

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

@ -0,0 +1,451 @@
<template>
<view class="page-raw-returning">
<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.deliver') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="150rpx">
<!-- 单号查询 -->
<u-form-item :required="true" :label="$t('message.dn_OddNumbers')" prop="orderNo">
<u-search :placeholder="$t('message.Commission_tips1')" v-model.trim="form.orderNo" @search="query" :show-action="false"></u-search>
<view class="single-right">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</view>
</u-form-item>
<!-- 单据总数 -->
<u-form-item :label="$t('message.product_TotalNumber')">
<u-input v-model="model.orderInInfo.stoAmount" :disabled="true" type="number" placeholder="" />
</u-form-item>
<!-- 成品编码 -->
<u-form-item :required="true" :label="$t('message.product_FGCode')">
<!-- <u-input v-model="form.rowItem" 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> -->
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="materialConfirm" showKey="value" valKey="value" :val="form.rowItem" class="search" :options="model.materielList" />
</u-form-item>
<!-- 成品描述 -->
<u-form-item :label="$t('message.product_FGDes')">
<u-input :disabled="true" v-model="form.productDescZh" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 行项目 -->
<u-form-item :label="$t('message.Line')">
<u-input :disabled="true" v-model="form.row" placeholder="" />
</u-form-item>
<!-- 物料总数 -->
<u-row gutter="0">
<u-col :span="6">
<u-form-item :label="$t('message.product_MaterilTotalNumber')">
<u-input v-model="form.orderAmount" placeholder="" :disabled="true" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item :label="$t('message.product_Swept')" label-width="80rpx">
<u-input v-model="form.scanAmount" :disabled="true" :placeholder="$t('message.po_PleaseInput')" type="number" />
</u-form-item>
</u-col>
</u-row>
<!-- 扫码 -->
<u-form-item :label="$t('message.product_BarCode')">
<u-search :placeholder="$t('message.po_PleaseInput')" v-model="form.barCode" @search="onOk" :focus="firstFocus" :show-action="false"></u-search>
</u-form-item>
<!-- <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>
</u-col> -->
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<!-- Guoshuang 详细跳转要改调接口 -->
<u-col :span="6">
<u-button type="warning" @click="detailed">{{ $t('message.detailed') }}</u-button>
</u-col>
<u-col :span="6">
<u-button type="primary" @click="Posting">{{ $t('message.Posting') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model';
import { session } from '@/store/modules/session';
import { headers } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
@Component({
components: {
jPicker,
},
})
export default class stoOutboundDom extends BasePage {
@Ref('form') readonly $form!: VForm;
@Ref('table') readonly $table: any;
model = model;
firstFocus = false;
headers = headers;
form = {
dockCode: null, // code
dockName: null, // name
orderNo: null,
qty: 0,
orderAmount: '',
productCode: '', // name
productDescZh: '',
scanAmount: 0,
rowItem: '',
row: '',
barCode: '',
};
wl: any = '';
rowItemIndex: any = null;
materialList: any = []; //
//
selectMaterielList: any = [];
/**
* 工位退料人名称
*/
operatorName = '';
/**
* 退料类型选择
*/
returningTypeSelect = false;
//
materialCodeSelect = false;
/**
* 表单验证规则
*/
rules: VFormRules<any> = {
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }],
};
// onReadyonLoad
async onReady() {
this.$form.setRules(this.rules);
await model.queryReturningTypeList();
if (uni.getStorageSync('SweepCode')) {
this.form.orderNo = JSON.parse(uni.getStorageSync('SweepCode'));
uni.removeStorageSync('SweepCode');
this.query();
}
}
back() {
this.form.barCode = '';
this.model.orderInInfo.stoAmount = 0;
this.selectMaterielList = [];
uni.navigateBack({ delta: 1 });
}
//
async detailed() {
if (!this.form.orderNo) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
await this.model.queryDetailed(this.form.orderNo);
this.toPage(this.page.product.outbound.stoOutboundDetail);
}
BackSweep() {
if (!this.form.orderNo) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
uni.setStorageSync('SweepCode', JSON.stringify(this.form.orderNo));
this.toPage(this.page.product.outbound.Back);
}
//
async query() {
if (!this.form.orderNo) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
await this.model.findProdInfoByDN(this.form.orderNo);
console.log('model.DNcode', this.model.DNcode);
if (this.model.DNcode == '1') {
uni.showToast({
//icon: 'success',
title: this.$t('message.successful') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
if (this.rowItemIndex == null) {
this.form.productCode = this.model.materielList[0].materialCode;
this.form.productDescZh = this.model.materielList[0].materialDesc;
this.form.rowItem = this.model.materielList[0].materialCode;
this.form.row = this.model.materielList[0].rowItem;
this.form.orderAmount = this.model.materielList[0].orderAmount;
this.form.scanAmount = parseFloat(this.model.materielList[0].outAmount);
this.rowItemIndex = this.model.materielList[0].rowItem;
} else {
let rowIndex: any = null;
this.model.materielList.forEach((item: any, index) => {
if (item.rowItem == this.rowItemIndex) {
rowIndex = index;
}
});
if (rowIndex == null) {
this.form.productCode = this.model.materielList[0].materialCode;
this.form.productDescZh = this.model.materielList[0].materialDesc;
this.form.rowItem = this.model.materielList[0].materialCode;
this.form.row = this.model.materielList[0].rowItem;
this.form.orderAmount = this.model.materielList[0].orderAmount;
this.form.scanAmount = parseFloat(this.model.materielList[0].outAmount);
this.rowItemIndex = this.model.materielList[0].rowItem;
} else {
this.form.productCode = this.model.materielList[rowIndex].materialCode;
this.form.productDescZh = this.model.materielList[rowIndex].materialDesc;
this.form.rowItem = this.model.materielList[rowIndex].materialCode;
this.form.row = this.model.materielList[rowIndex].rowItem;
this.form.orderAmount = this.model.materielList[rowIndex].orderAmount;
this.form.scanAmount = parseFloat(this.model.materielList[rowIndex].outAmount);
}
}
}
}
//
materialConfirm(v: any) {
this.model.materielList.forEach((item: any) => {
if (v.pickerName.materialCode == item.materialCode) {
this.form.productCode = item.materialCode;
this.form.productDescZh = item.materialDesc;
this.form.rowItem = item.materialCode;
this.form.row = item.rowItem;
this.rowItemIndex = item.rowItem;
this.form.orderAmount = item.orderAmount;
this.form.scanAmount = parseFloat(item.outAmount);
return;
}
});
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.rowItem = item.rowItem;
this.form.scanAmount = parseFloat(item.outAmount);
}
});
}
//
Posting() {
if (!this.form.orderNo) {
this.customToast(this.$t('message.Commission_tips1') as string);
return;
}
uni.showModal({
title: this.$t('message.ConfirmPosting') as string,
success: async (res) => {
if (res.confirm) {
let params = {
nxOutCode: this.form.orderNo,
rowItem: this.form.row,
materialCode: this.form.rowItem,
loginName: session.loginName,
factoryCode: session.factoryCode,
};
await this.model.Posting(params);
if (this.model.PostingCode == '1') {
uni.showToast({
title: this.$t('message.Warehouse_Tip9') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
this.empty();
}
} else if (res.cancel) {
return;
}
},
});
}
empty() {
this.form.dockCode = null;
this.form.dockName = null;
this.form.orderNo = null;
this.form.qty = 0;
this.form.orderAmount = '';
this.form.productCode = '';
this.form.productDescZh = '';
this.form.scanAmount = 0;
this.form.rowItem = '';
this.form.row = '';
this.form.barCode = '';
this.rowItemIndex = null;
this.model.empty();
}
onOk() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
if (parseInt(this.form.orderAmount) <= this.form.scanAmount) {
this.customToast(this.$t('message.product_Tip6') as string);
return;
}
if (this.form.barCode == '') {
this.customToast(this.$t('message.barcode') as string);
return;
}
const selctlist = {
barcode: this.form.barCode,
loginName: session.loginName,
factoryCode: session.factoryCode,
keepBy: session.loginName,
order3: this.form.orderNo,
orderItem: this.form.row,
type: 0,
orderType: 4,
productCode: this.form.productCode,
};
await this.model.confirmMove(selctlist).then(async () => {
if (this.model.code == '1') {
this.materialList = [];
uni.showToast({
//icon: 'success',
title: 'success',
duration: 2000,
image: '/static/icons/icon-51.png',
});
this.form.barCode = '';
this.form.productCode = '';
model.orderInInfo.stoAmount = 0;
this.form.scanAmount = 0;
this.form.orderAmount = '';
this.form.productDescZh = '';
this.selectMaterielList = [];
this.form.rowItem = '';
this.query();
}
if (this.model.code == '2') {
uni.showModal({
content: this.$t('message.sweep') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: async (res) => {
if (res.confirm) {
let params = {
barcode: this.form.barCode,
loginName: session.loginName,
keepBy: session.loginName,
factoryCode: session.factoryCode,
order3: this.form.orderNo,
};
await this.model.delCode(params);
this.form.barCode = '';
this.form.productCode = '';
model.orderInInfo.stoAmount = 0;
this.form.scanAmount = 0;
this.form.orderAmount = '';
this.form.productDescZh = '';
this.selectMaterielList = [];
this.form.rowItem = '';
this.query();
} else if (res.cancel) {
this.form.barCode = '';
}
},
});
}
});
});
}
// }
}
</script>
<style lang="scss" scoped>
.uni-input-input:disabled {
-webkit-text-fill-color: currentcolor;
background-color: #1753ea;
}
.page-raw-returning {
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;
}
}
.single-right {
button {
//margin-top: 15rpx;
width: 110rpx;
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 {
// }
}
.input[disabled] {
background-color: rgb(228, 143, 143); //
color: #666;
opacity: 1; //0.3
-webkit-text-fill-color: #666; //IOS
-webkit-opacity: 1; //IOS
}
.disabled {
background-color: rgb(228, 143, 143); //
color: #666;
opacity: 1; //0.3
-webkit-text-fill-color: #666; //IOS
-webkit-opacity: 1; //IOS
}
</style>

@ -0,0 +1,231 @@
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.SpareDeliverGoods',
})
export class ReturningModule extends VuexModule {
/**
*
*/
returningTypeList: any[] = [];
PostingCode: any = '';
/**
*
*/
materielList: any[] = [];
//条码扫描的返回的结果
oneMaterielDetail: any = {};
/**
*
*/
orderInInfo: OrderInInfo = new OrderInInfo();
resCode: any = '';
//记账按钮的code码
code = '';
DNcode: any = '';
/**
*
*/
@MutationAction
async queryReturningTypeList() {
const list: [] = await http.post(url.outbound.stoOutbound.yuetaiType, {
factoryCode: session.factoryCode,
whCode: session.warehouseCode,
loginName: session.loginName,
});
const returningTypeList = list.map((item: any) => ({
label: item.dockName,
value: item.dockCode,
}));
return { returningTypeList };
}
/**
*
* @param orderNo
*/
@MutationAction
async queryOrderInInfo(nxOutCode: string) {
const result = await http.post(url.outbound.stoOutbound.info, {
nxOutCode,
deleteFlag: 2,
finalState: 3,
loginName: session.loginName,
});
let stoAmount = 0;
result.data.records.forEach((item: any) => {
stoAmount += item.orderAmount;
});
const materielList = result.data.records.map((item: any) => ({
label: item.materialCode,
value: item.stoItem,
...item,
}));
console.log('materielList', materielList);
if (result.data.records[0]) {
result.data.records[0].stoAmount = stoAmount;
}
const orderInInfo = result.data.records[0] || {};
return { orderInInfo, materielList };
}
/**
*
*/
@MutationAction
async findProdInfoByDN(nxOutCode: string) {
const result: any = await http.post(url.outbound.stoOutbound.findProdInfoByDN, {
nxOutCode,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
console.log('resule>>>>>>>>>>>>>>>>>>>>>>>', result);
let stoAmount = 0;
const DNcode = result.code;
result.data.forEach((item: any) => {
stoAmount += item.orderAmount;
});
const materielList = result.data.map((item: any) => ({
value: item.materialCode,
rowItem: item.rowItem,
label: item.rowItem + '(' + item.materialCode + ')',
...item,
}));
console.log('materielList', materielList);
if (result.data[0]) {
result.data[0].stoAmount = stoAmount;
}
const orderInInfo = result.data[0] || {};
return { orderInInfo, materielList, DNcode };
}
//退扫
@MutationAction
async delCode(params: any = {}) {
const res: any = await http.post(url.outbound.stoOutbound.del, params);
const resCode = res.code;
return { resCode };
}
/**
*
*/
@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;
}
/**
*
*/
@Action
async getMaterialByCode(list: any = {}) {
let oneMaterielDetail: any = {};
const { data }: any = await http.post(url.outbound.stoOutbound.getMaterialByCode, list);
oneMaterielDetail = data.records[0];
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 };
}
/**
*
* @param orderNo
*/
@MutationAction
async confirmMove(list: any) {
const res: any = await http.post(url.outbound.stoOutbound.Bookkeeping, list);
console.log('res数据', res);
const code = res.code;
// if (code == '1') {
// uni.showToast({ icon: 'success', title: msg });
// } else {
// uni.showToast({ icon: 'none', title: msg });
// }
const materielList: any = [];
return { code, materielList };
}
/**
*
* @param orderNo
*/
@MutationAction
async queryDetailed(order1: string) {
const { code, data } = await http.post(url.outbound.stoOutbound.getDetailByorderNo, {
order1,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
console.log('res数据', data, code);
const materielList = data;
console.log('>>>>>>>', materielList);
return { code, materielList };
}
//退扫接口
@MutationAction
async BackSweep(params: any) {
const res: any = await http.post(url.outbound.stoOutbound.scanBarcodeDN, params);
console.log('res>>>>>>>>>>>>>>>>>>>>>>>>.', res);
const code = res.code;
return { code };
}
//退扫查询接口
@MutationAction
async queryAmount(params: any) {
const res: any = await http.post(url.outbound.stoOutbound.queryAmount, params);
console.log('退扫>>>>>>>>>>>>>>>>>>>>>>>>.', res);
return {};
}
//过账
@MutationAction
async Posting(params: any) {
const res: any = await http.post(url.outbound.stoOutbound.Posting, params);
const PostingCode = res.code;
return { PostingCode };
}
@MutationAction
async empty() {
const orderInInfo = {};
return { orderInInfo };
}
}
export default getModule(ReturningModule);

@ -0,0 +1,112 @@
<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>
<u-form class="form" ref="form" style="padding-left: 30px" label-width="180rpx">
<u-form-item :label="$t('message.Pi_OrderNo')">
<u-input v-model="prdOrder" placeholder="" class="Transfer" />
<u-button type="primary" style="height: 60rpx; margin-left: 20rpx" @click="generate">{{ $t('message.Query') }}</u-button>
</u-form-item>
</u-form>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="bjheaders" :contents="model.bjDetailList" :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 { bjheaders } from './config';
import model from './model';
import { session } from '@/store/modules/session';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
bjheaders = bjheaders;
prdOrder: any = '';
onLoad() {
this.model.bjDetailList.length = 0;
}
async generate() {
if (this.prdOrder == '') {
this.customToast(this.$t('message._tips6') as any);
return;
}
let content = {
loginName: session.loginName,
prdOrder: this.prdOrder,
factoryCode: session.factoryCode,
};
await this.model.querybjdetail(content);
}
}
</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;
}
}
.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: 180rpx;
height: 64rpx;
background: rgb(242, 242, 242);
border-radius: 110rpx;
}
}
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
// padding: 40rpx;
border-radius: 10rpx;
}
}
</style>

@ -0,0 +1,132 @@
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.InventoryOrderNo'),
key: 'prdOrder', //单号
width: 220,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode', //物料号
width: 220,
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc', //物料描述
width: 350,
},
{
label: vm.$t('message.po_ActualQuantity'),
key: 'fillAmount', //实际数量
},
{
label: vm.$t('message.Summary_Number'),
key: 'amount', //可退数量
},
{
label: vm.$t('message.Feeding_ReplenishedQuantity'),
key: 'totalFillAmount', //已拣数量
},
{
label: vm.$t('message.po_Location'),
key: 'locationCode', //库存地点
},
];
export const bjheaders = [
{
label: vm.$t('message.InventoryOrderNo'),
key: 'prdOrder', //单号
width: 220,
},
{
label: vm.$t('message.CommissionedMaterielNo'),
key: 'materialCode', //物料号
width: 220,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc', //物料描述
width: 450,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'userDefined1', //库位
},
{
label: vm.$t('message.CommissionedNumber'),
key: 'amount', //入库数量
},
{
label: vm.$t('message.Operation'),
key: 'createBy', //操作人
},
{
label: vm.$t('message.StorageTime'),
key: 'gmtCreate', //入库时间
width: 550,
},
];
export const detailHeader = [
{
label: vm.$t('message.Pi_OrderNo'),
key: 'prdOrder',
width: 270,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 270,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
},
{
label: vm.$t('message.CommissionedNumber'),
key: 'qty',
},
];
export const PropoHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 300,
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 450,
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
width: 300,
},
{
label: vm.$t('message.Production'),
key: 'prdOrder',
width: 300,
},
];
export const CreteListHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 200,
},
{
label: vm.$t('message.receiveAStation'),
key: 'sendSpot',
},
{
label: vm.$t('message.Production'),
key: 'prdOrder',
},
{
label: vm.$t('message.quantityNum'),
key: 'amount',
},
];

@ -0,0 +1,421 @@
<template>
<view class="page-raw-receipt">
<view class="top"></view>
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="back" />
</view>
<view class="title">{{ $t('message.Inbound') }}</view>
<view class="right"></view>
</view>
<view class="content">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.InventoryOrderNo') }}:</view>
<u-search :placeholder="$t('message.InventoryPleaseScan')" v-model="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="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.CommissionedMaterielNo') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.materialCode }}</view>
</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">{{ some.materialDesc }}</view>
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.orderNum') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.amount }}</view>
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.totalNum') }}:</view>
<view class="material-right-code" style="overflow: hidden" disabled>{{ some.totalProductAmount }}</view>
<!-- <u-input placeholder=" " v-model="some.fillAmount" :type="type" :border="border" class="input" style="margin-top: 8px;padding: 0;height: 38px;" 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="Location" />
</view>
<view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}:</view>
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="qty" 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="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view>
<view class="bottom-bar">
<div class="container">
<u-row>
<u-col :span="4">
<u-button type="primary" class="appoint" @click="bill">{{ $t('message.InboundDetail') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onSubmit">
{{ $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>
</div>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { session } from '@/store/modules/session';
import { VForm } from 'vue/types/form';
import { detailHeader } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
@Component({
components: {
jPicker,
},
})
export default class RawReceiptDetail extends BasePage {
@Ref('form') readonly $form!: VForm;
detailHeader = detailHeader;
model = model;
type = 'text';
wlCode: any = '';
border = true;
LocationList: any = [];
Location: any = [];
some: any = {};
qty: any = '';
form: any = {
documentNo: '',
};
async back() {
uni.navigateBack({ delta: 1 });
}
async onReady() {
let content = {
loginName: session.loginName,
sendSpot: null,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.model.blDetailList.length = 0;
this.wlCode = this.Location[0];
}
async query() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as string);
}
await this.model.queryBlDetailList(this.form.documentNo);
this.some = this.model.blDetailList;
}
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
Add() {
if (this.qty == '' || this.wlCode == '') {
this.customToast(this.$t('message.AppendMateriel1') as string);
return;
}
if (parseFloat(this.qty) <= 0) {
this.customToast(this.$t('message.AppendMateriel2') as string);
return;
}
if (parseFloat(this.qty) > parseFloat(this.some.amount)) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
if (parseFloat(this.qty) + parseFloat(this.some.totalProductAmount) > parseFloat(this.some.amount)) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
let arr = {
prdOrder: this.some.prdOrder,
materialCode: this.some.materialCode,
wlCode: this.wlCode.label,
qty: this.qty,
};
this.LocationList.push(arr);
this.some.wlList.push({
wlCode: this.wlCode.label,
qty: this.qty,
});
this.some.totalProductAmount += parseFloat(this.qty);
}
deleteItem(e: any): void {
uni.showModal({
content: this.$t('message.product_Delete') as string,
cancelText: this.$t('message.Cancel') as string,
confirmText: this.$t('message.workArea_Confirm') as string,
success: (res) => {
if (res.confirm) {
let lineData = e.lineData;
let i: number;
this.LocationList.forEach((item: any, index: any) => {
if (item.wlCode == lineData.wlCode && item.qty == lineData.qty) {
i = index;
}
});
this.LocationList.splice(i, 1);
this.some.wlList.splice(i, 1);
} else if (res.cancel) {
return;
}
},
});
}
async onSubmit() {
await this.model.saveBlDetailUpload(this.some).then(() => {
this.qty = '';
this.LocationList = [];
this.query();
});
}
async bill() {
this.toPage(this.page.raw.ingoods.SpareInboun.details);
}
}
</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: 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: 100%;
height: 100%;
display: flex;
view {
width: 145rpx;
line-height: 100rpx;
}
.search {
padding-left: 12px;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right {
width: 100%;
height: 100%;
display: flex;
.material-right-title {
width: 145rpx;
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: 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;
// text-align: center;
}
.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;
}
.search {
padding-left: 19px;
text-align: left;
}
}
.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: 15rpx;
}
}
}
.add {
width: 100%;
height: 100rpx;
position: relative;
button {
position: absolute;
top: 10rpx;
right: 20rpx;
}
}
}
.bottom-bar {
z-index: 21;
position: fixed;
bottom: 0;
left: 0;
right: 0;
.container {
background: #ffffff;
// box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.extra {
background-color: #fff;
margin: 5px;
border-radius: 5px;
padding: 0 10px;
}
.bottom-info {
.u-form-item {
padding: 0;
}
}
}
}
</style>

@ -0,0 +1,219 @@
import { Action, getModule, Module, Mutation, 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';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'raw.ingoods.SpareInbound.Inbound',
})
export class FeedingModule extends VuexModule {
/**
*
*/
blDetailList: any[] = [];
detailedList: any;
LocList: any = [];
submitListCode: any = '';
/**
*
*/
locationList = [];
MaterialList: any = [];
bjDetailList: any = [];
/**
*
*/
get hasBlDetailChecked() {
return this.checkedBlDetailList.length > 0;
}
/**
*
*/
get checkedBlDetailList() {
return this.blDetailList.filter((_: any) => _.checked);
}
/**
*
*/
get hasBlDetailFillAmount() {
return this.blDetailList.findIndex((_: any) => _.fillAmount) > -1;
}
/**
*
*/
get blDetailUploadList() {
return this.blDetailList.map((item: any) => {
if (!item.checked) {
item.fillAmount = 0;
}
return item;
});
}
/**
*
*/
@Mutation
clearState() {
this.blDetailList = [];
}
/**
*
* @param params
*/
@Mutation
confirmCheckedBlDetailList(params: { locationCode: string; amount: number }) {
this.blDetailList
.filter((_: any) => _.checked)
.forEach((item: any) => {
if (params.locationCode) {
item.wkposCodeP = params.locationCode;
}
if (params.amount) {
item.fillAmount = params.amount;
}
});
}
@MutationAction
async queryItemLoc(params: any = {}) {
const res: any = await http.post(url.sortscan.save.queryWlByMatBL, params);
const LocList = [];
res.forEach((item: any) => {
const arr: any = {
label: item.locationCode,
value: item.locationCode + '(' + item.sendSpot + ')',
};
LocList.push(arr);
});
console.log('res', res);
console.log('LocList', LocList);
return { LocList };
}
/**
*
*/
@Action({ commit: 'clearState' })
async saveBlDetailUpload(params: any) {
await http.post(url.bj.submit, {
...params,
factoryCode: session.factoryCode,
loginName: session.loginName,
});
uni.showToast({
title: 'success',
duration: 2000,
image: '/static/icons/icon-51.png',
});
}
/**
*
*/
@Action
async unlockBlDetailList() {
try {
const sapSupplyIdList = this.blDetailList.map((_) => _.sapSupplyId);
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
sapSupplyIdList,
};
await http.post(url.bl.unlock, params, {
custom: { hideError: true },
} as any);
} catch {
//
}
}
/**
*
*/
@MutationAction
async queryBlDetailList(order: any) {
const res: any = await http.post(url.bj.query, {
factoryCode: session.factoryCode,
loginName: session.loginName,
prdOrder: order,
});
res.data.wlList = [];
const blDetailList: any = res.data;
return { blDetailList };
}
//查询明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) {
const res: any = await http.post('/wmspda/tl/getBlListSn', content);
console.log('明细》》》》》》》》》', res.list);
this.detailedList = res.list;
return res;
}
/**
*
*/
@MutationAction
async queryLocationList() {
const result: any = await http.post(url.auth.query.location, {
factoryCode: session.factoryCode,
loginName: session.loginName,
workareaCode: session.workareaCode,
});
const locationList = result.list.map((_: any) => ({
label: _.locationCode,
value: _.locationCode,
}));
return { locationList };
}
@MutationAction
async queryMaterialList(params: any) {
const res: any = await http.post(url.auth.query.queryAppendDetail, {
factoryCode: session.factoryCode,
loginName: session.loginName,
prdOrder: params.prdOrder,
materialCode: params.materialCode,
});
const MaterialList = res.list;
return { MaterialList };
}
@MutationAction
async submitList(params: any) {
const res: any = await http.post(url.auth.query.createAppendList, params);
const submitListCode = res.code;
return { submitListCode };
}
//补料解锁
@MutationAction
async lock(sapSupplyIdList: any) {
const res: any = await http.post(url.auth.query.lock, {
factoryCode: session.factoryCode,
loginName: session.loginName,
sapSupplyIdList,
});
console.log(res);
return {};
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
return res;
}
@MutationAction
async querybjdetail(prdOrder) {
const res: any = await http.post(url.bj.detail, prdOrder);
const bjDetailList: any = res.data;
return { bjDetailList };
}
}
export default getModule(FeedingModule);

@ -0,0 +1,129 @@
<template>
<view class="page-raw-warehouse">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.RowWarehouse') }}</view>
<view class="right"></view>
</view>
<view class="container">
<u-row :gutter="30">
<u-col :span="12" v-for="(item, index) in childData" :key="index">
<u-button
@click.native="
uni.navigateTo({
url: item.href,
})
"
>
<u-icon size="80" :name="item.iconClass"></u-icon>
<text class="name"> {{ session.lang == 'en' ? index + 1 + ' ' + item.engResourceName : index + 1 + ' ' + item.resourceName }}</text>
</u-button>
</u-col>
<!-- <u-col :span="12">
<u-button @click="toPage(page.raw.warehouse.rowInventory.index)">
<u-icon size="80" name="/static/icons/icon-14.png"></u-icon>
<text class="name">4.{{ '原材料盘点' }}</text>
</u-button>
</u-col> -->
<!--
<u-col :span="12">
<u-button @click="toPage(page.raw.warehouse.rowScrap.index)">
<u-icon size="80" name="/static/icons/icon-14.png"></u-icon>
<text class="name">2.{{ $t('message.RowScrap') }}</text>
</u-button>
</u-col>
<u-col :span="12">
<u-button @click="toPage(page.raw.warehouse.rowCollect.index)">
<u-icon size="80" name="/static/icons/icon-14.png"></u-icon>
<text class="name">3.{{ $t('message.RowCollectionAndBorrowing') }}</text>
</u-button>
</u-col> -->
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
@Component
export default class RawAppointment extends BasePage {
childData: any;
onLoad(option: { childData: any }) {
this.childData = JSON.parse(option.childData);
}
}
</script>
<style lang="scss" scoped>
.page-raw-warehouse {
background-color: #f4f7fc;
padding-top: 88rpx;
min-height: 100%;
.header {
position: fixed;
top: 0;
padding-top: 18px;
left: 0;
right: 0;
z-index: 99;
display: -webkit-box;
display: -webkit-flex;
display: flex;
background-color: #255cea;
/* height: 46px; */
line-height: 46px;
color: #fff;
font-size: 17px;
font-weight: 500;
text-align: center;
box-shadow: 0 1px 2px #6b90ef;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.container {
margin-top: 36rpx;
padding: 30rpx 15rpx 0;
.u-row {
}
.u-col {
margin-bottom: 30rpx;
}
.u-btn {
height: 160rpx;
padding: 0 28rpx;
border: 1px solid #f0f5fc;
color: #42465a;
font-size: 30rpx;
font-weight: 400;
&:after {
border-color: #f0f5fc;
border-radius: 4rpx;
}
.name {
flex: 1;
margin-left: 28rpx;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
</style>

@ -141,6 +141,9 @@ export const page = {
detailEx: '/pages/raw/ingoods/dnReturnGoods/detail-ex',
idetailed: '/pages/raw/ingoods/dnReturnGoods/idetailed',
},
SpareInboun: {
details: '/pages/raw/ingoods/SpareInbound/Inbound/Local-details',
},
},
warehouse: {
index: '/pages/raw/warehouse/index',

@ -248,6 +248,11 @@ export const url = {
u: '/wmspda/bl/u',
unlock: '/wmspda/bl/unlock',
},
bj: {
query: '/wmspda/material/hei/spareIn/queryOrder',
submit: '/wmspda/material/hei/spareIn/complete',
detail: '/wmspda/material/hei/spareIn/queryOrder/detail',
},
tl: {
get: {
type: '/wmspda/tl/get/type',

Loading…
Cancel
Save