修改下线入库接口

master
李靖 2 years ago
parent ba12697af1
commit ecc01913a9

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

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

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

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

Loading…
Cancel
Save