cosmoim-852 fix 新增半成品下线入库
parent
eed2a7a378
commit
5c7956f2da
@ -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);
|
Loading…
Reference in New Issue