收、入库页面接口绑定

master
zhoulei 4 years ago
parent 1779a0faf8
commit 2e9e10ce0e

@ -213,6 +213,7 @@ export default {
CommissionedThisNumber:'本次数量',
CommissionedNumber:'入库数量',
CommissionedEntrantDetails:'入库明细',
CommissionedReceiptQuantity:'收货数量',
// 委外-出库
CommissionGoOut:'委外出库',

@ -215,11 +215,14 @@ export default {
CommissionedCumulativeData:'累计数据',
CommissionedLocation:'库位',
CommissionedThisNumber:'本次数量',
CommissionedNumber:'入库数量',
CommissionedEntrantDetails:'入库明细',
CommissionedReceiptQuantity:'收货数量',
// 委外-出库
CommissionGoOut:'委外出库',
CommissionedGoOutDetails:'出库明细',
CommissionedGoOutNumber:'出库数量',
//移库
Warehouse_QueryCriteria: "Query criteria",

@ -1,21 +1,40 @@
/*
* @Author: zhou lei
* @Date: 2021-11-10 17:14:44
* @LastEditTime: 2021-11-22 17:43:40
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/commission/entrant/config.ts
* :910592680@qq.com 18669792120
*/
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.product_barCode'),
key: 'barcode',
width: 300,
label: vm.$t('message.CommissionedSingleNumber'),
key: 'poNo',
width: 200,
},
{
label: vm.$t('message.product_FGCode'),
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 300,
},
{
label: vm.$t('message.product_FGDes'),
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc',
width: 300,
},
{
label: vm.$t('message.CommissionedReceiptQuantity'),
key: 'amount',
width: 200,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 200,
}
];

@ -26,41 +26,8 @@
>{{ $t('message.po_Total') }} {{ model.materielList.length }}
{{ $t('message.po_Records') }}</u-col
>
<!-- <u-col :span="2">数量</u-col>-->
<!-- <u-col :span="4"><u-input v-model="locationCode"></u-input></u-col>-->
<!-- <u-col :span="3">-->
<!-- <u-button-->
<!-- size="mini"-->
<!-- type="warning"-->
<!-- :loading="$wait.is('*changeOrderInLocation')"-->
<!-- @click="changeLocation"-->
<!-- >-->
<!-- 拒收-->
<!-- </u-button>-->
<!-- </u-col>-->
</u-row>
</div>
<!-- <div class="container">-->
<!-- <u-row>-->
<!-- <u-col :span="4">-->
<!-- <u-button type="primary" @click="model.checkAllOrderInInfoList(!model.isCheckedAll)">-->
<!-- {{-->
<!-- model.isCheckedAll-->
<!-- ? this.$t('message.po_noSelectAll')-->
<!-- : this.$t('message.po_SelectAll')-->
<!-- }}-->
<!-- </u-button>-->
<!-- </u-col>-->
<!-- <u-col :span="4">-->
<!-- <u-button type="success" :loading="$wait.is('*submitOrderInEnter')" @click="onSubmit">-->
<!-- {{ $t('message.po_Submit') }}-->
<!-- </u-button>-->
<!-- </u-col>-->
<!-- <u-col :span="4">-->
<!-- <u-button @click="uni.navigateBack()">{{ $t('message.po_Return') }}</u-button>-->
<!-- </u-col>-->
<!-- </u-row>-->
<!-- </div>-->
</view>
</view>
</template>
@ -72,7 +39,7 @@ import model from './model';
import { headers } from './config';
@Component
export default class RawReceiptDetail extends BasePage {
export default class RawCommissionEntrantDetail extends BasePage {
/**
* 页面Module
*/
@ -87,6 +54,9 @@ export default class RawReceiptDetail extends BasePage {
* 表头
*/
headers = headers;
onLoad(params:any){
this.model.info(params.poNo)
}
/**
* 逐条修改

@ -8,68 +8,63 @@
<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.CommissionedSingleNumber')" prop="orderNo">
<u-form-item :required="true" :label="$t('message.CommissionedSingleNumber')" prop="poNo">
<!-- 单号 -->
<u-search
:placeholder="$t('message.po_PleaseInput')"
v-model="form.orderNo"
@search="model.queryOrderInInfo"
v-model="form.poNo"
@search="queryOrder"
:show-action="false"
></u-search>
</u-form-item>
<u-row gutter="0">
<!-- 物料号 -->
<u-col :span="6">
<u-form-item :required="true" :label="$t('message.CommissionedMaterielNo')">
<u-input
v-model="form.orderNo"
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>
<u-form-item :label="$t('message.CommissionedMaterielNo')">
<u-input v-model="form.materialCode" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<!-- 物料描述 -->
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedMaterielDesc')">
<u-input v-model="form.productCode" :placeholder="$t('message.po_PleaseInput')" />
<u-input v-model="form.materialDesc" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row gutter="0">
<!-- 需求数量 -->
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedDemandData')">
<u-input v-model="form.productDescZh" :placeholder="$t('message.po_PleaseInput')" />
<u-input v-model="form.poAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<!-- 累计出库数量 -->
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedCumulativeData')">
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
<u-input v-model="form.receiptAmount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
<u-row gutter="0">
<!-- 库位 -->
<u-col :span="6">
<u-form-item :required="true" :label="$t('message.CommissionedLocation')">
<u-input
v-model="form.qty"
v-model="form.locationCode"
type="select"
@click="materialCodeSelect = true"
@click="locationCodeSelect = 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"
v-model="locationCodeSelect"
:list="model.locationCodeList"
@confirm="locationCodeConfirm"
></u-select>
</u-form-item>
</u-col>
<!-- 本次数量 -->
<u-col :span="6">
<u-form-item :label="$t('message.CommissionedThisNumber')">
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
@ -86,13 +81,13 @@
<view class="table-wrapper">
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t("message.po_MaterielNo") }}</u-th>
<u-th class="u-th">{{ $t("message.po_MaterielDes") }}</u-th>
<u-th class="u-th">{{ $t("message.CommissionedLocation") }}</u-th>
<u-th class="u-th">{{ $t("message.CommissionedGoOutNumber") }}</u-th>
<u-th class="u-th">{{ $t("message.operation") }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.productCode }}</u-td>
<u-td class="u-td">{{ item.productDescZh }}</u-td>
<u-td class="u-td">{{ item.locationCode }}</u-td>
<u-td class="u-td">{{ item.scanAmount }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t("message.product_Delete") }}
@ -106,17 +101,17 @@
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="toPage(page.raw.commission.entrant.detail)">
<u-button type="primary" @click="gooutInfo">
{{
$t('message.CommissionedEntrantDetails')
$t('message.CommissionedGoOutDetails')
}}
</u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="resetHandle">{{ $t('message.product_Upload') }}</u-button>
<u-button type="primary" @click="onSubmit">{{ $t('message.product_Upload') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="onOk">{{ $t('message.po_Return') }}</u-button>
<u-button type="error" @click="back">{{ $t('message.po_Return') }}</u-button>
</u-col>
<!-- <u-col :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
@ -143,7 +138,8 @@ export default class stoOutboundDom extends BasePage {
* 表格引用
*/
@Ref('table') readonly $table: any;
LocationList: any = [];
LocationList: any = [];
/**
* 页面Module
*/
@ -161,13 +157,26 @@ LocationList: any = [];
* 表单数据
*/
form = {
// poNo
poNo:null,
//
materialCode:null,
//
materialDesc:null,
poLine:null,
unit:null,
//
receiptAmount:null,
//
poAmount: '',
locationCode:null,//
dockCode: null, // code
dockName: null, // name
orderNo: null,
qty: 0,
orderAmount: '',
productCode: 'test', // name
productDescZh: 'test',
productCode: '', // name
productDescZh: '',
scanAmount: '',
barCode: '',
};
@ -184,30 +193,30 @@ LocationList: any = [];
returningTypeSelect = false;
//
materialCodeSelect = false;
locationCodeSelect = false;
/**
* 表单验证规则
*/
rules: VFormRules<any> = {
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }],
};
confirm() {
// if (this.wlCode == "" || this.number == "") {
// uni.showToast({
// icon: "none",
// title: "",
// });
// return;
// }
this.LocationList.push(this.form)
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
}
// onReadyonLoad
async onReady() {
this.$form.setRules(this.rules);
model.queryReturningTypeList();
model.queryByFactoryCodeAndWorkAreaCode();
}
gooutInfo(){
if(this.form.poNo){
this.toPage(`${this.page.raw.commission.entrant.detail}?poNo=${this.form.poNo}`)
}else{
let tip = this.$t('message.borrow_Tip')
uni.showToast({
icon: "none",
title: tip as string,
});
}
}
onCheck(e: any) {
console.log('e.data', e.data);
@ -218,11 +227,15 @@ LocationList: any = [];
});
}
back() {
this.form.barCode = '';
this.model.orderInInfo.stoAmount = 0;
this.selectMaterielList = [];
uni.navigateBack({ delta: 1 });
this.$table.onEmpty();
}
//
async queryOrder(poNo:string){
const {orderInInfo} = await model.queryOrder(poNo)
Object.assign(this.form,{
orderInInfo
})
}
materialConfirm(v: any) {
console.log('v[0].value', v[0]);
@ -231,12 +244,24 @@ LocationList: any = [];
if (v[0].value == item.stoItem) {
this.form.productCode = item.materialCode;
this.form.productDescZh = item.materialDesc;
this.form.orderAmount = item.orderAmount;
this.form.poAmount = item.poAmount;
this.form.scanAmount = item.scanAmount;
}
});
console.log('this.form', this.form);
}
locationCodeConfirm(v: any) {
console.log('v[0].value', v[0]);
// this.form.productCode = v[0].value;
this.model.locationCodeList.forEach((item: any) => {
console.log('item',item)
if (v[0].value == item.value) {
this.form.locationCode = item.value;
}
});
console.log('this.form', this.form);
}
/**
* 清空
*/
@ -246,68 +271,81 @@ LocationList: any = [];
this.model.materielList.forEach((item: any) => {
if (this.form.productCode == item.label) {
this.form.productDescZh = item.materialDesc;
this.form.orderAmount = item.orderAmount;
this.form.poAmount = item.poAmount;
this.form.scanAmount = item.scanAmount;
}
});
}
confirm() {
// if (this.wlCode == "" || this.number == "") {
// uni.showToast({
// icon: "none",
// title: "",
// });
// return;
// }
console.log('123')
this.LocationList.push(this.form)
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
}
/**
* 条码回车
* 提交
*/
onSubmit() {
this.$form.validate(async (valid: boolean) => {
if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip5') as string });
return;
}
if (parseInt(this.form.orderAmount) <= parseInt(this.form.scanAmount)) {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
return;
}
let list = [
{
order3: this.form.orderNo,
productCode: this.form.productCode,
productDescZh: this.form.productDescZh,
barCode: this.form.barCode,
dockCode: this.form.dockCode,
dockName: this.form.dockName,
orderType: 3,
type: 0,
keepBy: session.loginName as string,
loginName: session.loginName as string,
},
];
// if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip5') as string });
// return;
// }
// if (parseInt(this.form.poAmount) <= parseInt(this.form.scanAmount)) {
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
// return;
// }
const list = this.LocationList.map( (item:any) =>({
wlCode:item.locationCode,
nowAmount:item.scanAmount,
}))
if (valid) {
const res = await this.model.tluSubmit(list);
const res = await this.model.materialComplete({
poNo:this.form.poNo,
materialCode:this.form.materialCode,
list
});
console.log('fanhui ', res);
// if (res.barcode) {
// // this.materialList.push(res);
// this.form.scanAmount = res.scanAmount;
// }
if (this.materialList.length == 0) {
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
let flag = 0;
for (let i = 0; i < this.materialList.length; i++) {
console.log('11111', this.materialList[i]);
if (this.form.barCode == this.materialList[i].barcode) {
flag = 1;
break;
}
}
if (flag == 0) {
await this.$table.onCheckAllTap();
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
uni.showToast({ icon: 'none', title: this.$t('message.product_Tip7') as string });
}
}
// if (this.materialList.length == 0) {
// await this.materialList.push(res);
// this.form.scanAmount += 1;
// this.$table.onCheckAllTap();
// } else {
// let flag = 0;
// for (let i = 0; i < this.materialList.length; i++) {
// console.log('11111', this.materialList[i]);
// if (this.form.barCode == this.materialList[i].barcode) {
// flag = 1;
// break;
// }
// }
// if (flag == 0) {
// await this.$table.onCheckAllTap();
// await this.materialList.push(res);
// this.form.scanAmount += 1;
// this.$table.onCheckAllTap();
// } else {
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip7') as string });
// }
// }
}
});
const item = {
@ -361,7 +399,7 @@ LocationList: any = [];
this.form.productCode = '';
// this.form.orderNo = null;
this.form.scanAmount = '';
this.form.orderAmount = '';
this.form.poAmount = '';
this.form.productDescZh = '';
this.selectMaterielList = [];
this.$table.onEmpty();

@ -24,10 +24,12 @@ export class ReturningModule extends VuexModule {
*
*/
returningTypeList: any[] = [];
/**
/**
*
*/
materielList: any[] = [];
materielList: any[] = [];
locationCodeList: any[] =[];
//条码扫描的返回的结果
oneMaterielDetail: any = {};
@ -37,6 +39,69 @@ export class ReturningModule extends VuexModule {
orderInInfo: OrderInInfo = new OrderInInfo();
//记账按钮的code码
code = '';
/**
*
* @param orderNo
*/
@Action
async queryOrder(form:any) {
const result = await http.post(url.material.commission.entrant.queryOrder, {
...form,
loginName: session.loginName,
factoryCode:session.factoryCode
});
const orderInInfo = result.data.records[0] || {};
return { orderInInfo };
}
/**
*
*/
@MutationAction
async queryByFactoryCodeAndWorkAreaCode() {
const list: [] = await http.post(url.material.commission.goOut.queryByFactoryCodeAndWorkAreaCode, {
factoryCode: session.factoryCode,
whCode: session.warehouseCode,
loginName: session.loginName,
});
const locationCodeList = list.map((item: any) => ({
label: item.locationCode,
value: item.locationCode,
}));
return { locationCodeList };
}
/**
*
*/
@Action
async materialComplete(form:any) {
const res = await http.post(url.material.commission.goOut.materialComplete, {
factoryCode: session.factoryCode,
loginName: session.loginName,
...form
});
console.log(res,'>>>>>res')
}
/**
*
*
* @returns
* @memberof ReturningModule
*/
@MutationAction
async info(poNo:string) {
const list: [] = await http.post(url.material.commission.entrant.info, {
factoryCode: session.factoryCode,
poNo: poNo,
loginName: session.loginName,
});
const locationCodeList = list.map((item: any) => ({
label: item.locationCode,
value: item.locationCode,
}));
return { locationCodeList };
}
/**
*
*/
@ -54,6 +119,7 @@ export class ReturningModule extends VuexModule {
return { returningTypeList };
}
/**
*
* @param orderNo

@ -1,7 +1,7 @@
/*
* @Author: zhou lei
* @Date: 2021-11-11 11:09:57
* @LastEditTime: 2021-11-22 10:06:58
* @LastEditTime: 2021-11-22 15:16:21
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/commission/goOut/config.ts
@ -13,18 +13,28 @@
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.CommissionedLocation'),
key: 'locationCode',
label: vm.$t('message.CommissionedSingleNumber'),
key: 'poNo',
width: 200,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 300,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc',
width: 300,
},
{
label: vm.$t('message.CommissionedGoOutNumber'),
key: 'scanAmount',
width: 300,
key: 'outAmount',
width: 200,
},
{
label: vm.$t('message.operation'),
key: 'materialDesc',
width: 300,
},
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 200,
}
];

@ -26,41 +26,8 @@
>{{ $t('message.po_Total') }} {{ model.materielList.length }}
{{ $t('message.po_Records') }}</u-col
>
<!-- <u-col :span="2">数量</u-col>-->
<!-- <u-col :span="4"><u-input v-model="locationCode"></u-input></u-col>-->
<!-- <u-col :span="3">-->
<!-- <u-button-->
<!-- size="mini"-->
<!-- type="warning"-->
<!-- :loading="$wait.is('*changeOrderInLocation')"-->
<!-- @click="changeLocation"-->
<!-- >-->
<!-- 拒收-->
<!-- </u-button>-->
<!-- </u-col>-->
</u-row>
</div>
<!-- <div class="container">-->
<!-- <u-row>-->
<!-- <u-col :span="4">-->
<!-- <u-button type="primary" @click="model.checkAllOrderInInfoList(!model.isCheckedAll)">-->
<!-- {{-->
<!-- model.isCheckedAll-->
<!-- ? this.$t('message.po_noSelectAll')-->
<!-- : this.$t('message.po_SelectAll')-->
<!-- }}-->
<!-- </u-button>-->
<!-- </u-col>-->
<!-- <u-col :span="4">-->
<!-- <u-button type="success" :loading="$wait.is('*submitOrderInEnter')" @click="onSubmit">-->
<!-- {{ $t('message.po_Submit') }}-->
<!-- </u-button>-->
<!-- </u-col>-->
<!-- <u-col :span="4">-->
<!-- <u-button @click="uni.navigateBack()">{{ $t('message.po_Return') }}</u-button>-->
<!-- </u-col>-->
<!-- </u-row>-->
<!-- </div>-->
</view>
</view>
</template>
@ -72,7 +39,7 @@ import model from './model';
import { headers } from './config';
@Component
export default class RawReceiptDetail extends BasePage {
export default class RawCommissionGoOutDetail extends BasePage {
/**
* 页面Module
*/
@ -87,6 +54,9 @@ export default class RawReceiptDetail extends BasePage {
* 表头
*/
headers = headers;
onLoad(params:any){
this.model.outInfo(params.poNo)
}
/**
* 逐条修改

@ -118,7 +118,7 @@
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="toPage(page.raw.commission.goOut.detail)">
<u-button type="primary" @click="gooutInfo">
{{
$t('message.CommissionedGoOutDetails')
}}
@ -128,7 +128,7 @@
<u-button type="primary" @click="onSubmit">{{ $t('message.product_Upload') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="onOk">{{ $t('message.po_Return') }}</u-button>
<u-button type="error" @click="back">{{ $t('message.po_Return') }}</u-button>
</u-col>
<!-- <u-col :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
@ -223,6 +223,18 @@ export default class stoOutboundDom extends BasePage {
this.$form.setRules(this.rules);
model.queryByFactoryCodeAndWorkAreaCode();
}
gooutInfo(){
if(this.form.poNo){
this.toPage(`${this.page.raw.commission.goOut.detail}?poNo=${this.form.poNo}`)
}else{
let tip = this.$t('message.borrow_Tip')
uni.showToast({
icon: "none",
title: tip as string,
});
}
}
onCheck(e: any) {
console.log('e.data', e.data);
this.selectMaterielList = [];
@ -232,18 +244,14 @@ export default class stoOutboundDom extends BasePage {
});
}
back() {
this.form.barCode = '';
this.model.orderInInfo.stoAmount = 0;
this.selectMaterielList = [];
uni.navigateBack({ delta: 1 });
this.$table.onEmpty();
}
//
async queryOrder(poNo:string){
const {orderInInfo} = await model.queryOrder(poNo)
Object.assign(this.form,{
...orderInInfo
orderInInfo
})
}
materialConfirm(v: any) {

@ -69,6 +69,25 @@ export class ReturningModule extends VuexModule {
}));
return { locationCodeList };
}
/**
*
*
* @returns
* @memberof ReturningModule
*/
@MutationAction
async outInfo(poNo:string) {
const list: [] = await http.post(url.material.commission.goOut.outInfo, {
factoryCode: session.factoryCode,
poNo: poNo,
loginName: session.loginName,
});
const locationCodeList = list.map((item: any) => ({
label: item.locationCode,
value: item.locationCode,
}));
return { locationCodeList };
}
/**
*

@ -97,6 +97,17 @@ export const url = {
// 出库明细查询
outInfo: "/material/outsourcing/outInfo",
},
entrant:{
// 单号查询
queryOrder:'/material/outsourcing/into/queryOrder',
// 库位下拉列表
queryByFactoryCodeAndWorkAreaCode: "/wmspda/fg/queryByFactoryCodeAndWorkAreaCode",
// 提交
materialComplete:'/material/outsourcing/into/materialComplete',
// 明细查询
info:'/material/outsourcing/into/info',
}
},
},
SFG: {

Loading…
Cancel
Save