cosmoim-852 fix 补料新增解锁功能&&成品出库功能优化

master
hou 3 years ago
parent 14fb8b7104
commit f1a0420cc7

@ -85,31 +85,11 @@ import { session } from '@/store/modules/session';
import { headers } from './config'; import { headers } from './config';
@Component @Component
export default class stoOutboundDom extends BasePage { export default class stoOutboundDom extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm; @Ref('form') readonly $form!: VForm;
/**
* 表格引用
*/
@Ref('table') readonly $table: any; @Ref('table') readonly $table: any;
/**
* 页面Module
*/
model = model; model = model;
/**
* search焦点获取
*/
firstFocus = false; firstFocus = false;
/**
* 表头
*/
headers = headers; headers = headers;
/**
* 表单数据
*/
form = { form = {
dockCode: null, // code dockCode: null, // code
dockName: null, // name dockName: null, // name
@ -123,6 +103,7 @@ export default class stoOutboundDom extends BasePage {
row: '', row: '',
barCode: '', barCode: '',
}; };
rowItemIndex: any = null;
materialList: any = []; // materialList: any = []; //
// //
selectMaterielList: any = []; selectMaterielList: any = [];
@ -193,12 +174,38 @@ export default class stoOutboundDom extends BasePage {
duration: 2000, duration: 2000,
image: '/static/icons/icon-51.png', image: '/static/icons/icon-51.png',
}); });
this.form.productCode = this.model.materielList[0].materialCode; if (this.rowItemIndex == null) {
this.form.productDescZh = this.model.materielList[0].materialDesc; this.form.productCode = this.model.materielList[0].materialCode;
this.form.rowItem = this.model.materielList[0].materialCode; this.form.productDescZh = this.model.materielList[0].materialDesc;
this.form.row = this.model.materielList[0].rowItem; this.form.rowItem = this.model.materielList[0].materialCode;
this.form.orderAmount = this.model.materielList[0].orderAmount; this.form.row = this.model.materielList[0].rowItem;
this.form.scanAmount = parseFloat(this.model.materielList[0].outAmount); 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);
}
}
} }
} }
// //
@ -211,6 +218,7 @@ export default class stoOutboundDom extends BasePage {
this.form.productDescZh = item.materialDesc; this.form.productDescZh = item.materialDesc;
this.form.rowItem = item.materialCode; this.form.rowItem = item.materialCode;
this.form.row = item.rowItem; this.form.row = item.rowItem;
this.rowItemIndex = item.rowItem;
this.form.orderAmount = item.orderAmount; this.form.orderAmount = item.orderAmount;
this.form.scanAmount = parseFloat(item.outAmount); this.form.scanAmount = parseFloat(item.outAmount);
return; return;
@ -277,6 +285,7 @@ export default class stoOutboundDom extends BasePage {
this.form.rowItem = ''; this.form.rowItem = '';
this.form.row = ''; this.form.row = '';
this.form.barCode = ''; this.form.barCode = '';
this.rowItemIndex = null;
this.model.empty(); this.model.empty();
} }
onOk() { onOk() {

@ -3,7 +3,7 @@
<view class="top"></view> <view class="top"></view>
<view class="header"> <view class="header">
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" /> <u-icon class="icon" name="arrow-left" @click="back" />
</view> </view>
<view class="title">{{ $t('message.FillingMaterials') }}</view> <view class="title">{{ $t('message.FillingMaterials') }}</view>
<view class="right"></view> <view class="right"></view>
@ -165,6 +165,7 @@ export default class RawReceiptDetail extends BasePage {
amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }], amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }],
}; };
detailHeader = detailHeader; detailHeader = detailHeader;
sapSupplyIdList: any = [];
empty() { empty() {
this.some = {}; this.some = {};
this.someIndex = 0; this.someIndex = 0;
@ -183,10 +184,23 @@ export default class RawReceiptDetail extends BasePage {
this.model.blDetailList.length = 0; this.model.blDetailList.length = 0;
this.LocationList = []; this.LocationList = [];
} }
async back() {
if (this.sapSupplyIdList.length != 0) {
await this.lock();
}
uni.navigateBack({ delta: 1 });
}
async lock() {
await this.model.lock(this.sapSupplyIdList);
}
async query() { async query() {
if (this.form.documentNo == '') { if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as string); this.customToast(this.$t('message.Commission_tips1') as string);
} }
if (this.sapSupplyIdList.length != 0) {
await this.lock();
this.sapSupplyIdList = [];
}
this.LocEmpty(); this.LocEmpty();
this.wlCode = this.Location[0]; this.wlCode = this.Location[0];
let inPrdOrderList = this.form.documentNo.split(','); let inPrdOrderList = this.form.documentNo.split(',');
@ -202,7 +216,9 @@ export default class RawReceiptDetail extends BasePage {
}; };
this.materialList.push(arr); this.materialList.push(arr);
item.wlList = []; item.wlList = [];
this.sapSupplyIdList.push(item.sapSupplyId);
}); });
console.log('this.sapSupplyIdList', this.sapSupplyIdList);
this.some = this.model.blDetailList[0]; this.some = this.model.blDetailList[0];
this.someIndex = 0; this.someIndex = 0;
}); });
@ -435,6 +451,7 @@ export default class RawReceiptDetail extends BasePage {
await this.model.saveBlDetailUpload(params).then(() => { await this.model.saveBlDetailUpload(params).then(() => {
this.qty = ''; this.qty = '';
this.LocationList = []; this.LocationList = [];
this.sapSupplyIdList = [];
this.query(); this.query();
}); });
} }

@ -196,6 +196,17 @@ export class FeedingModule extends VuexModule {
const submitListCode = res.code; const submitListCode = res.code;
return { submitListCode }; 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' }) @Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) { async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);

@ -27,6 +27,7 @@ export const url = {
location1: '/wmspda/material/orderin/receiveloc', location1: '/wmspda/material/orderin/receiveloc',
queryAppendDetail: '/wmspda/bl/queryAppendDetail', queryAppendDetail: '/wmspda/bl/queryAppendDetail',
createAppendList: '/wmspda/bl/createAppendList', createAppendList: '/wmspda/bl/createAppendList',
lock: '/wmspda/bl/unlock',
}, },
systime: '/wmspda/auth/systime', systime: '/wmspda/auth/systime',
userInfo: '/wmspda/auth/userinfo', userInfo: '/wmspda/auth/userinfo',

Loading…
Cancel
Save