修改下线入库接口

master
李靖 2 years ago
parent ba12697af1
commit ecc01913a9

@ -27,6 +27,7 @@ export type Lang = 'cn' | 'en';
export function setI18nLanguage(lang: string) {
i18n.locale = lang;
axios.defaults.headers.common['Accept-Language'] = lang;
// axios.defaults.headers.common['poolName'] = 'ds _1000';
document.querySelector('html')?.setAttribute('lang', lang);
return lang;
}

@ -20,9 +20,6 @@
</view> -->
</view>
<!-- 订单 -->
<!-- <u-form-item label="产品编码">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilist" />
</u-form-item> -->
<!-- 机台 -->
<!-- <u-form-item label="出库仓库"> 成品库 </u-form-item> -->
</u-form>
@ -30,29 +27,29 @@
<view class="list">
<view class="row-list">
<view class="list-item"> 生产订单: </view>
<view> {{ model.orderNoItemList.productOrder }} </view>
<view> {{ orderNoItemList && orderNoItemList.productOrder }} </view>
</view>
<view class="row-list">
<view class="list-item"> 产品编码: </view>
<view> {{ model.orderNoItemList.productCode }} </view>
<view> {{ orderNoItemList && orderNoItemList.productCode }} </view>
</view>
<view class="row-list">
<view class="list-item"> 产品名称: </view>
<view> {{ model.orderNoItemList.productName }} </view>
<view> {{ orderNoItemList && orderNoItemList.productName }} </view>
</view>
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 订单数量: </view>
<view> {{ model.orderNoItemList.planQuantity }} </view>
<view> {{ orderNoItemList && orderNoItemList.planQuantity }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 单位: </view>
<view> {{ model.orderNoItemList.unitOfMeasure }} </view>
<view> {{ orderNoItemList && orderNoItemList.unitOfMeasure }} </view>
</view>
</view>
<view class="row-list">
<view class="list-item">入库数量: </view>
<view> {{ model.orderNoItemList.putQuantity }} </view>
<view> {{ orderNoItemList && orderNoItemList.putQuantity }} </view>
</view>
</view>
</u-form>
@ -71,21 +68,21 @@
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 批次号: </view>
<view> 100/0 </view>
<view>{{ item.batchNumber }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> : </view>
<view> </view>
<view class="list-item"> : </view>
<view>{{ item.number }} </view>
</view>
</view>
<view class="row-list">
<view class="row-list-item">
<view class="list-item"> 库位码: </view>
<view> 100/0 </view>
<view>{{ item.wlCode }} </view>
</view>
<view class="row-list-item">
<view class="list-item"> 托盘码: </view>
<view> 123 </view>
<view>{{ item.sn }} </view>
</view>
</view>
</view>
@ -127,21 +124,16 @@
</view>
</view>
<view class="poupbutton">
<u-row>
<!-- 确定 -->
<u-col :span="6">
<u-button @click="onOk" size="mini" type="primary">确定</u-button>
</u-col>
<!-- 返回 -->
<u-col :span="6">
<u-button size="mini" type="error" @click="nopoup"></u-button>
</u-col>
</u-row>
<!-- 确定 -->
<u-button @click="onOk" type="primary">确定</u-button>
<!-- 返回 -->
<u-button type="error" @click="nopoup"></u-button>
</view>
</u-popup>
<view v-if="show" class="mask"></view>
</view>
<u-modal v-model="showmodal" @confirm="confirm" :content="content" show-cancel-button="true"></u-modal>
<u-modal v-model="showmodal" @confirm="confirm" :content="content" :show-cancel-button="true"></u-modal>
<u-toast ref="uToast" />
</view>
</template>
<script lang="ts">
@ -149,10 +141,6 @@ import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import model from './model';
interface OptionType {
label: string;
value: string;
}
//import { session } from '@/store/modules/session';
@Component({
components: {
@ -161,21 +149,12 @@ interface OptionType {
})
export default class OfflineStorage extends BasePage {
model = model;
list: any = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }, { id: 7 }, { id: 8 }];
aimWl = {} as OptionType;
list: any = [];
orderNoItemList: any = [];
show = false;
form5: any = {};
boxnumber: any = '';
materilist = [
{
label: '合格',
value: '1',
},
{
label: '不合格',
value: '0',
},
];
itemdetail: any = '';
showmodal = false;
content: any = '';
// remove: any = {};
@ -187,39 +166,37 @@ export default class OfflineStorage extends BasePage {
// this.remove = e.pickerName;
// }
orderNo: any = '';
orderNodetail: any = {};
border = true;
height = 100;
autoHeight = true;
imgList: any = [];
imgUrlList: any = [];
isqualified = [
{
label: '合格',
value: '1',
},
{
label: '不合格',
value: '0',
},
];
histroyItem: any = {};
barcode: any = '';
productCodeList: any = {};
bookTypeChange(e: any) {
this.aimWl = e.pickerName;
}
//
async onPassdelet(item) {
console.log('1234567', item);
// this.showmodal = true
// this.content = '?';
this.itemdetail = item;
this.showmodal = true;
this.content = '是否删除?';
// let params = {
// item
// }
await this.model.deleteTray(item);
}
// confirm(item) {
// }
async confirm() {
this.itemdetail.orderNo = this.orderNo;
console.log(this.itemdetail, this.orderNo);
await this.model.deleteTray(this.itemdetail);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '删除成功',
type: 'success',
});
this.getlist();
} else {
(this.$refs.uToast as any).show({
title: '删除失败',
type: 'error',
});
this.getlist();
}
}
//
nopoup() {
this.show = false;
@ -228,31 +205,115 @@ export default class OfflineStorage extends BasePage {
//
async query() {
if (this.orderNo == '' || this.orderNo.length == 0) {
this.customToast('请输入nficl');
(this.$refs.uToast as any).show({
title: '请输入工单号',
// url: '/pages/user/index'
});
return;
}
console.log(model.orderNoItemList);
await this.model.queryOrderNo(this.orderNo);
// this.orderNodetail = model.orderNoItemList;
if (model.orderNoItemList) {
this.orderNoItemList = model.orderNoItemList;
} else {
this.orderNoItemList = {};
}
this.getlist();
}
histroyItem: any = {};
barcode: any = '';
//
async onSubmit() {
console.log('1234567');
await this.model.handPut(this.list);
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入工单号',
// url: '/pages/user/index'
});
return;
}
if (this.list.length == 0 || this.list == '') {
(this.$refs.uToast as any).show({
title: '请先入库',
// url: '/pages/user/index'
});
return;
}
let insertTarynumber = 0;
this.list.forEach((item) => {
insertTarynumber = insertTarynumber + parseInt(item.number);
});
console.log(insertTarynumber, model.orderNoItemList.putQuantity, insertTarynumber == model.orderNoItemList.putQuantity);
if (insertTarynumber == model.orderNoItemList.putQuantity) {
await this.model.handPut(this.list);
this.getlist();
} else {
(this.$refs.uToast as any).show({
title: '入库数量不等于订单数量,请正确入库',
// url: '/pages/user/index'
});
}
}
rukubutn() {
this.show = true;
async getlist() {
await (this.model as any).list(this.orderNo);
if (model.productCodeList.length > 0) {
this.list = model.productCodeList;
} else {
this.list = [];
}
console.log(model.productCodeList);
}
async rukubutn() {
this.form5 = {};
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入工单号',
// url: '/pages/user/index'
});
return;
}
if (this.list.length > 0) {
let insertTarynumber = 0;
this.list.forEach((item) => {
insertTarynumber = insertTarynumber + parseInt(item.number);
});
let ordernumber = model.orderNoItemList.putQuantity;
if (insertTarynumber >= ordernumber) {
(this.$refs.uToast as any).show({
title: '入库数量大于订单数量,请先删除再入库',
// url: '/pages/user/index'
});
return;
}
this.show = true;
} else {
this.show = true;
}
}
//
async onOk() {
console.log('1234567');
// if (this.orderNo == '' || this.orderNo.length == 0) {
// this.customToast('nficl');
// return;
// }
console.log(this.form5);
if (this.form5.sn == '' || this.form5.wlCode == '' || this.form5.number == '') {
(this.$refs.uToast as any).show({
title: '不能为空',
// url: '/pages/user/index'
});
return;
}
await this.model.insertTary(this.form5);
if (this.model.SubmitCode == '200') {
(this.$refs.uToast as any).show({
title: '成功',
type: 'success',
});
this.show = false;
this.getlist();
} else {
(this.$refs.uToast as any).show({
title: '失败',
type: 'error',
});
this.show = false;
this.getlist();
}
// //
// await this.model.queryOrderNo(this.form5);
// this.list = model.orderNoItemList;
@ -405,6 +466,8 @@ export default class OfflineStorage extends BasePage {
margin-top: 2rpx;
display: flex;
justify-content: flex-end;
// margin-bottom: 5px;
padding-bottom: 5px;
.buttontostore {
margin-top: 5px;
background: red;
@ -415,7 +478,6 @@ export default class OfflineStorage extends BasePage {
/* margin: auto; */
color: #ffff;
line-height: 30px;
margin-bottom: 5px;
border-radius: 5px;
}
.u-input__input {

@ -9,6 +9,7 @@ import { session } from '@/store/modules/session';
store,
name: 'page.product.OfflineStorage',
})
// http.defaults.headers.common['poolName'] = session.PoolName;
export class OfflineStorage extends VuexModule {
WlList = [];
@MutationAction
@ -17,6 +18,7 @@ export class OfflineStorage extends VuexModule {
// factoryCode: session.factoryCode,
loginName: session.loginName,
});
const WlList = result.data.map((_: any) => ({
label: _.locationCode,
value: _.locationCode,
@ -24,18 +26,24 @@ export class OfflineStorage extends VuexModule {
return { WlList };
}
orderNoItemList: any = [];
productCodeList: any = [];
@MutationAction
async queryOrderNo(orderNo: any) {
const result: any = await http.get(url.lanjuwms.product.OfflineStorage.queryinformation, {
//loginName: session.loginName,
params: {
rfid: orderNo,
const result: any = await http.get(url.lanjuwms.product.OfflineStorage.queryinformation + orderNo, {
headers: {
poolName: session.PoolName,
},
});
// http.defaults.headers.common['Accept-Language'] = session.PoolName;
const orderNoItemList = result.data;
return { orderNoItemList };
}
productCodeList: any = [];
@MutationAction
async list(orderNo: any) {
const result: any = await http.get(url.lanjuwms.product.OfflineStorage.list + '/' + orderNo, {});
const productCodeList = result.data;
return { productCodeList };
}
SubmitCode: any = '';
@MutationAction
async insertTary(params: any) {
@ -44,22 +52,18 @@ export class OfflineStorage extends VuexModule {
return { SubmitCode };
}
@MutationAction
async deleteTray(params: any) {
const result: any = await http.delete(url.lanjuwms.product.OfflineStorage.deleteTray, params);
async deleteTray(item: any) {
console.log(item);
const result: any = await http.delete(url.lanjuwms.product.OfflineStorage.deleteTray + '/' + item.sn + '/' + item.orderNo);
const SubmitCode = result.code;
return { SubmitCode };
}
@MutationAction
async handPut(params: any) {
const result: any = await http.delete(url.lanjuwms.product.OfflineStorage.handPut, params);
const result: any = await http.post(url.lanjuwms.product.OfflineStorage.handPut, params);
const SubmitCode = result.code;
return { SubmitCode };
}
@MutationAction
async empty() {
const productCodeList = [];
return { productCodeList };
}
}
export default getModule(OfflineStorage);

@ -411,10 +411,11 @@ export const url = {
product: {
// 下线入库
OfflineStorage: {
queryinformation: '/api/dev-api/put/s',
insertTary: '/api/dev-api/tray/insertTary',
deleteTray: '/api/dev-api/tray/deleteTray',
handPut: '/api/dev-api/tray/handPut',
queryinformation: '/api/dev-api/wms/put/s/',
insertTary: '/api/dev-api/wms/tray/insertTary',
deleteTray: '/api/dev-api/wms/tray/deleteTray',
handPut: '/api/dev-api/wms/tray/wms/handPut',
list: '/api/dev-api/wms/tray/listTary',
},
},
},

Loading…
Cancel
Save