交接小问题 重构成品报废

master
hou 4 years ago
parent 1c66c2140e
commit 99e916d3b2

@ -118,6 +118,8 @@ export default {
Pi_order: '订单查询', Pi_order: '订单查询',
Query: '查询', Query: '查询',
time: '请先选择时间', time: '请先选择时间',
scrapForm: '请先扫描报废单',
finishedProduct: '请先选择成品编码',
Pi_InputMrp: '请输入MRP', Pi_InputMrp: '请输入MRP',
Pi_InputFactory: '请输入工厂代码', Pi_InputFactory: '请输入工厂代码',
Pi_OrderNoNotSelected: '未选中订单号', Pi_OrderNoNotSelected: '未选中订单号',
@ -274,7 +276,7 @@ export default {
Access_type: '出入类型', Access_type: '出入类型',
//报废 //报废
Scrap_ScrapNo: '报废单', Scrap_ScrapNo: '报废单',
Scrap_Tip: '请输入报废单号', Scrap_Tip: '请输入报废单号',
Scrap_ScrapDetails: '报废明细', Scrap_ScrapDetails: '报废明细',
@ -307,6 +309,7 @@ export default {
//成品下线 //成品下线
product_Location: '库位', product_Location: '库位',
product_barCode: '条码', product_barCode: '条码',
barcode: '请输入条码',
product_TransferCar: '周转车', product_TransferCar: '周转车',
product_MaterialCode: '物料条码', product_MaterialCode: '物料条码',
product_FGCode: '成品编码', product_FGCode: '成品编码',
@ -350,6 +353,7 @@ export default {
product_Swept: '已扫', product_Swept: '已扫',
product_MaterilTotalNumber: '物料总数', product_MaterilTotalNumber: '物料总数',
product_BarCode: '条码', product_BarCode: '条码',
SourceLocation: '源库位',
product_PickingDetails: '拣货明细', product_PickingDetails: '拣货明细',
product_Bookkeeping: '记账', product_Bookkeeping: '记账',
product_Tip4: '单号不能为空', product_Tip4: '单号不能为空',

@ -222,6 +222,10 @@ export default {
CommissionedSingleNumber: 'single', CommissionedSingleNumber: 'single',
CommissionedMaterielNo: 'code', CommissionedMaterielNo: 'code',
CommissionedMaterielDesc: 'describe', CommissionedMaterielDesc: 'describe',
SourceLocation: 'Source location',
barcode: 'Please enter barcode',
scrapForm: 'Please scan the scrap form first',
finishedProduct: 'Please select finished product code first',
CommissionedDemandData: 'Demand', CommissionedDemandData: 'Demand',
CommissionedCumulativeData: 'total', CommissionedCumulativeData: 'total',
CommissionedLocation: 'Location', CommissionedLocation: 'Location',

@ -132,11 +132,31 @@ export default class productCheckReceipt extends BasePage {
icon: 'none', icon: 'none',
title: this.$t('message.product_Tip8') as string, title: this.$t('message.product_Tip8') as string,
}); });
//
const storeList = [];
storeList.push(this.model.WlListaa[0]);
// spQtyypQty
const total = storeList.reduce(
(total, item) => {
return {
spQty: total.spQty + item.spQty,
ypQty: total.ypQty + item.ypQty,
};
},
{ spQty: 0, ypQty: 0 },
);
const originWl = this.model.WlListaa[0];
// form
Object.assign(this.form, {
originWl: originWl,
...total,
});
} }
} }
onchange(e: any) { onchange(e: any) {
// //
const storeList = this.model.WlListaa.filter((item) => item.locCode === e[0].value); const storeList = this.model.WlListaa.filter((item) => item.locCode === e[0].value);
console.log(storeList);
// spQtyypQty // spQtyypQty
const total = storeList.reduce( const total = storeList.reduce(
(total, item) => { (total, item) => {

@ -8,34 +8,54 @@
<view class="right"></view> <view class="right"></view>
</view> </view>
<u-form class="form" ref="form" :model="form" label-width="180rpx"> <u-form class="form" ref="form" :model="form" label-width="180rpx">
<u-form-item :required="true" :label="$t('message.product_barCode')" prop="productCode"> <!-- 报废单 -->
<u-search :placeholder="$t('message.po_PleaseInput')" v-model="form.productCode" @search="model.getProductCode" :show-action="false"></u-search> <view class="single">
</u-form-item> <view class="single-left">
<view>{{ $t('message.Scrap_ScrapNo') }}</view>
<u-search :placeholder="$t('message.Scrap_Tip')" v-model="form.order3" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</view>
</view>
<!-- 成品编码 -->
<u-form-item :label="$t('message.product_FGCode')"> <u-form-item :label="$t('message.product_FGCode')">
<u-input :disabled="true" v-model="model.orderInInfo.productCode" placeholder="" /> <jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="materialChoice" showKey="value" valKey="value" :val="wl.value" class="search" :options="model.choiceCodeList" />
</u-form-item> </u-form-item>
<!-- 成品描述 -->
<u-form-item :label="$t('message.product_FGDes')"> <u-form-item :label="$t('message.product_FGDes')">
<u-input :disabled="true" v-model="model.orderInInfo.productDescZh" placeholder="" /> <u-input :disabled="true" v-model="Some.productDescZh" placeholder="" />
</u-form-item> </u-form-item>
<!-- 数量 -->
<u-form-item :label="$t('message.product_Number')"> <u-form-item :label="$t('message.product_Number')">
<u-input :disabled="true" v-model="model.orderInInfo.qty" placeholder="" /> <u-input :disabled="true" v-model="Some.qty" placeholder="" />
</u-form-item> </u-form-item>
<u-form-item :label="$t('message.product_Location')"> <!-- 源库位 -->
<u-input :disabled="true" v-model="model.orderInInfo.locCode" placeholder="" /> <u-form-item :label="$t('message.SourceLocation')">
<u-input :disabled="true" v-model="Some.originWl" placeholder="" />
</u-form-item> </u-form-item>
<!-- 目标库位 -->
<u-form-item :required="true" :label="$t('message.Warehouse_TargetLocation')" prop="aimWl"> <u-form-item :required="true" :label="$t('message.Warehouse_TargetLocation')" prop="aimWl">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.WlList" /> <u-input :disabled="true" v-model="Some.aimWl" placeholder="" />
</u-form-item> </u-form-item>
<!-- 成本中心 -->
<u-form-item :required="true" :label="$t('message.product_costCenter')"> <u-form-item :required="true" :label="$t('message.product_costCenter')">
<u-input v-model="model.orderInInfo.costCenter" :placeholder="$t('message.po_PleaseInput')" /> <u-input v-model="Some.costCenter" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
<!-- 条码 -->
<u-form-item :label="$t('message.product_BarCode')">
<u-search :placeholder="$t('message.barcode')" v-model="form.barcode" @search="scanning" :show-action="false"></u-search>
</u-form-item> </u-form-item>
</u-form> </u-form>
<view class="bottom-bar"> <view class="bottom-bar">
<u-row class="button-bar"> <u-row class="button-bar">
<u-col :span="6"> <u-col :span="4">
<u-button type="primary" @click="onSubmit">{{ $t('message.workArea_Confirm') }}</u-button> <u-button type="primary" @click="onSubmit">{{ $t('message.detailed') }}</u-button>
</u-col> </u-col>
<u-col :span="6"> <u-col :span="4">
<u-button type="primary" @click="onSubmit">{{ $t('message.InventoryFinish') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="uni.navigateBack()">{{ $t('message.po_Return') }}</u-button> <u-button type="error" @click="uni.navigateBack()">{{ $t('message.po_Return') }}</u-button>
</u-col> </u-col>
</u-row> </u-row>
@ -76,23 +96,55 @@ export default class productCheckReceipt extends BasePage {
* 表单数据 * 表单数据
*/ */
form = { form = {
// originWl: {} as OptionType,
aimWl: {} as OptionType,
qty: {} as OptionType,
productCode: '', productCode: '',
costCenter: '', order3: '',
barcode: '',
}; };
// originWlSelect = false; wl: any = {};
aimWlSelect1 = false; Some: any = {};
aimWlSelect = false; materialChoice(e: any) {
cboPlaceSelect = false; this.wl = e.pickerName;
this.model.recordsList.forEach((item: any) => {
bookTypeChange(e: any) { if (item.productCode == e.pickerName.value) {
console.log('you select bookType', e); this.Some = item;
this.form.aimWl = e.pickerName; }
console.log('aaaaaaa', this.form.aimWl); });
}
async scanning() {
if (!this.form.order3) {
uni.showToast({
icon: 'none',
title: this.$t('message.scrapForm') as string,
});
}
if (!this.Some) {
uni.showToast({
icon: 'none',
title: this.$t('message.finishedProduct') as string,
});
}
if (!this.form.barcode) {
uni.showToast({
icon: 'none',
title: this.$t('message.barcode') as string,
});
return;
}
let params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode: this.form.barcode,
productCode: this.wl.value,
locCode: this.Some.originWl,
};
await this.model.getProductCode(params);
if (this.model.code == '1') {
uni.showToast({
icon: 'none',
title: this.$t('message.product_Tip8') as string,
});
}
} }
rules: VFormRules<any> = { rules: VFormRules<any> = {
documentNo: [{ required: true, message: this.$t('message.Warehouse_Tip1') as string }], documentNo: [{ required: true, message: this.$t('message.Warehouse_Tip1') as string }],
// originWl: [{ required: true, message: '' }], // originWl: [{ required: true, message: '' }],
@ -111,68 +163,61 @@ export default class productCheckReceipt extends BasePage {
this.model.orderInInfo.locCode = ''; this.model.orderInInfo.locCode = '';
this.model.orderInInfo.costCenter = ''; this.model.orderInInfo.costCenter = '';
this.$form.setRules(this.rules); this.$form.setRules(this.rules);
this.model.queryLocation(); }
async query() {
if (!this.form.order3) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips1') as string,
});
return;
}
let param = {
factoryCode: session.factoryCode,
loginName: session.loginName,
order3: this.form.order3,
orderType: 'BF',
page: '1',
rows: '50',
};
await this.model.queryScrapList(param);
if (this.model.code == '1') {
uni.showToast({
icon: 'none',
title: this.$t('message.product_Tip8') as string,
});
this.wl.value = this.model.choiceCodeList[0].value;
this.Some = this.model.recordsList[0];
}
} }
onSubmit() { onSubmit() {
this.$form.validate((valid: boolean) => { this.$form.validate(async (valid: boolean) => {
if (!valid) return; if (!valid) return;
if (!this.form.productCode) {
uni.showToast({
icon: 'none',
title: this.$t('message.Warehouse_Tip5') as string,
});
return;
}
// if (!this.form.cboPlace.value) {
// uni.showToast({
// icon: 'none',
// title: '!',
// });
// return;
// }
// if (!this.form.originWl.value) {
// uni.showToast({
// icon: 'none',
// title: '!',
// });
// return;
// }
if (!this.form.aimWl.value) {
uni.showToast({
icon: 'none',
title: this.$t('message.Warehouse_Tip3') as string,
});
return;
}
if (!this.model.orderInInfo.costCenter) {
uni.showToast({
icon: 'none',
title: this.$t('message.Warehouse_Tip8') as string,
});
return;
}
console.log('orderlist');
const orderlist = [ const orderlist = [
{ {
...this.model.orderInInfo, ...this.model.orderInInfo,
originWl: this.model.orderInInfo.locCode, originWl: this.Some.originWl,
barCode: this.model.orderInInfo.barcode, barCode: this.form.barcode,
aimWl: this.form.aimWl.value, aimWl: this.Some.aimWl,
type: '0', type: '0',
orderType: '1', orderType: '1',
keepBy: session.loginName as string, keepBy: session.loginName as string,
factoryCode: session.factoryCode as string, factoryCode: session.factoryCode as string,
order3: this.form.order3,
costCenter: this.Some.costCenter,
}, },
]; ];
console.log('orderlist', orderlist); await this.model.onTakeoutConfirm(orderlist);
this.model.onTakeoutConfirm(orderlist); if (this.model.code == '1') {
this.model.orderInInfo.productDescZh = ''; uni.showToast({
this.model.orderInInfo.productCode = ''; icon: 'none',
this.model.orderInInfo.qty = ''; title: this.$t('message.success') as string,
this.model.orderInInfo.locCode = ''; });
this.model.orderInInfo.costCenter = ''; }
this.form.productCode = ''; this.Some = {};
this.wl = {};
this.form.order3 = '';
this.form.barcode = '';
}); });
} }
} }
@ -224,6 +269,28 @@ export default class productCheckReceipt extends BasePage {
padding: 30rpx 0; padding: 30rpx 0;
line-height: 35rpx; line-height: 35rpx;
} }
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 110rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
} }
.bottom-bar { .bottom-bar {

@ -1,15 +1,9 @@
import { import { Action, getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
Action, import store from '@/store';
getModule, import http from '@/utils/request';
Module, import { url } from '@/utils/url';
MutationAction, import { session } from '@/store/modules/session';
VuexModule, import vm from '@/main';
} 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 { page } from '@/utils/page'; // import { page } from '@/utils/page';
class OrderInInfo { class OrderInInfo {
@ -27,14 +21,16 @@ class OrderInInfo {
namespaced: true, namespaced: true,
dynamic: true, dynamic: true,
store, store,
name: "product.warehouse.wholeScrap", name: 'product.warehouse.wholeScrap',
}) })
export class wholeScrap extends VuexModule { export class wholeScrap extends VuexModule {
/** /**
* *
*/ */
WlList = []; WlList = [];
code: any = '';
recordsList: any = [];
choiceCodeList: any = [];
/** /**
* *
*/ */
@ -47,7 +43,7 @@ export class wholeScrap extends VuexModule {
/** /**
* *
*/ */
dnNo = ""; dnNo = '';
/** /**
* *
*/ */
@ -92,42 +88,35 @@ export class wholeScrap extends VuexModule {
* @param dnNo * @param dnNo
*/ */
@MutationAction @MutationAction
async getProductCode(barcode: string) { async getProductCode(params: any) {
const res: any = await http.post(url.warehouse.wholeTransfer.content, { const res: any = await http.post(url.warehouse.wholeTransfer.content, params);
barcode,
factoryCode: session.factoryCode,
// factoryCode: '1999',
loginName: session.loginName,
// loginName: '1999',
});
console.log("获取来的数据", res.data.records);
const orderInInfo = res.data.records[0]; const orderInInfo = res.data.records[0];
if (orderInInfo.custCode == "0") { const code = res.code;
orderInInfo.custCodeName = vm.$t("message.Warehouse_NX") as any; return { code, orderInInfo };
} else if (orderInInfo.custCode == "1") {
orderInInfo.custCodeName = vm.$t("message.Warehouse_WX") as any;
} else if (orderInInfo.custCode == "2") {
orderInInfo.custCodeName = vm.$t("message.Warehouse_YJ") as any;
} else if (orderInInfo.custCode == "4") {
orderInInfo.custCodeName = vm.$t("message.Warehouse_BCP") as any;
}
return { orderInInfo };
} }
@MutationAction @MutationAction
async onTakeoutConfirm(list: any) { async onTakeoutConfirm(list: any) {
const records: any = await http.post( const records: any = await http.post(url.warehouse.rowTransfer.commit, list);
url.warehouse.rowTransfer.commit, const code = records.code;
list return { code };
); }
if (records.code == 1) {
uni.showToast({ @MutationAction
icon: "success", async queryScrapList(param: any) {
title: "success", const res: any = await http.post(url.warehouse.rowTransfer.list, param);
}); const code = res.code;
// uni.navigateTo({ url: page.product.warehouse.index }); console.log('res', res);
} const recordsList = res.data.records;
return {}; const choiceCodeList = [];
recordsList.forEach((item: any) => {
let arr: any = {};
arr.label = item.productCode;
arr.value = item.productCode;
choiceCodeList.push(arr);
});
console.log('choiceCodeList', choiceCodeList);
return { code, recordsList, choiceCodeList };
} }
// /** // /**
// * 提交看单明细 // * 提交看单明细
@ -158,12 +147,12 @@ export class wholeScrap extends VuexModule {
/** /**
* *
*/ */
@Action({ commit: "updateCheckedOrderInInfoListKw" }) @Action({ commit: 'updateCheckedOrderInInfoListKw' })
async changeOrderInLocation(kw: string) { async changeOrderInLocation(kw: string) {
await http.post("/wmspda/material/orderin/enter", { await http.post('/wmspda/material/orderin/enter', {
loginName: session.loginName, loginName: session.loginName,
// loginName: '1999', // loginName: '1999',
warehouseCode: "", warehouseCode: '',
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
// factoryCode: '1999', // factoryCode: '1999',
locationCode: kw, locationCode: kw,

@ -236,7 +236,6 @@ export class AggregatingModule extends VuexModule {
const orderList = cloneDeep<any>(proOrderResultList); const orderList = cloneDeep<any>(proOrderResultList);
return { orderList }; return { orderList };
} }
/** /**
* - * -
* @param params * @param params

@ -8,7 +8,7 @@
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="table-wrapper"> <view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="single" :headers="headers" :contents="model.orderList" :show-vert-border="false"></wyb-table> <wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="single" :headers="headers" @onCheck="clickIndex" :contents="model.orderList" :show-vert-border="false"></wyb-table>
</view> </view>
<view class="bottom-bar"> <view class="bottom-bar">
<view class="extra"> <view class="extra">
@ -88,6 +88,7 @@ export default class AggregatingOrder extends BasePage {
* 表头 * 表头
*/ */
headers = orderHeaders; headers = orderHeaders;
spliceItem: any;
/** /**
* 交接完成 * 交接完成
@ -153,7 +154,9 @@ export default class AggregatingOrder extends BasePage {
onSelectAll() { onSelectAll() {
model.checkAllOrderList(!model.isOrderCheckedAll); model.checkAllOrderList(!model.isOrderCheckedAll);
} }
clickIndex(e: any) {
this.spliceItem = e.data[0].lineData.orderOutId;
}
/** /**
* 接收人确认 * 接收人确认
*/ */
@ -289,12 +292,22 @@ export default class AggregatingOrder extends BasePage {
this.submitForm.receiverName = ''; this.submitForm.receiverName = '';
this.submitForm.password = ''; this.submitForm.password = '';
this.amountForm.amount = ''; this.amountForm.amount = '';
await this.model.queryProOrder(this.model.isFormChange); // await this.model.queryProOrder(this.model.isFormChange);
await this.model.queryProOrderResult(this.model.param); await this.model.queryProOrderResult(this.model.param);
await this.model.queryOrderList({ await this.model.queryOrderList({
queryParams: this.model.orderOutIdListParams, queryParams: this.model.orderOutIdListParams,
proOrderResultList: this.model.proOrderResultList, proOrderResultList: this.model.proOrderResultList,
}); });
// model.orderList.forEach((item: any, index: any) => {
// if (item.orderOutId == this.spliceItem) {
// model.orderList.splice(index, 1);
// }
// });
// model.proOrderResultList.forEach((item: any, index: any) => {
// if (item.orderOutId == this.spliceItem) {
// model.proOrderResultList.splice(index, 1);
// }
// });
this.$amountForm.setRules(this.amountFormRules); this.$amountForm.setRules(this.amountFormRules);
this.$submitForm.setRules(this.submitFormRules); this.$submitForm.setRules(this.submitFormRules);
} }

@ -8,7 +8,7 @@
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="table-wrapper"> <view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="single" :headers="headers" :contents="model.aggregateList" :show-vert-border="false"></wyb-table> <wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="single" :headers="headers" @onCheck="clickIndex" :contents="model.aggregateList" :show-vert-border="false"></wyb-table>
</view> </view>
<view class="bottom-bar"> <view class="bottom-bar">
<view class="extra"> <view class="extra">
@ -88,6 +88,7 @@ export default class AggregatingSummary extends BasePage {
* 表头 * 表头
*/ */
headers = summaryHeaders; headers = summaryHeaders;
spliceItem: any;
/** /**
* 交接完成 * 交接完成
@ -140,7 +141,9 @@ export default class AggregatingSummary extends BasePage {
this.$submitForm.setRules(this.submitFormRules); this.$submitForm.setRules(this.submitFormRules);
this.isBusinessFinished = false; this.isBusinessFinished = false;
} }
clickIndex(e: any) {
this.spliceItem = e.data[0].lineData.materialCode;
}
beforeDestroy() { beforeDestroy() {
if (model.aggregateList.length > 0 && !this.isBusinessFinished) { if (model.aggregateList.length > 0 && !this.isBusinessFinished) {
this.unlock(); this.unlock();
@ -297,9 +300,19 @@ export default class AggregatingSummary extends BasePage {
this.submitForm.receiverName = ''; this.submitForm.receiverName = '';
this.submitForm.password = ''; this.submitForm.password = '';
this.isBusinessFinished = true; this.isBusinessFinished = true;
await this.model.queryProOrder(this.model.isFormChange); // await this.model.queryProOrder(this.model.isFormChange);
await this.model.queryProOrderResult(this.model.param); await this.model.queryProOrderResult(this.model.param);
await this.model.queryAggregateList(this.model.orderOutIdListParams); await this.model.queryAggregateList(this.model.orderOutIdListParams);
// model.aggregateList.forEach((item: any, index: any) => {
// if (item.materialCode == this.spliceItem) {
// model.aggregateList.splice(index, 1);
// }
// });
// model.proOrderResultList.forEach((item: any, index: any) => {
// if (item.materialCode == this.spliceItem) {
// model.proOrderResultList.splice(index, 1);
// }
// });
this.$amountForm.setRules(this.amountFormRules); this.$amountForm.setRules(this.amountFormRules);
this.$submitForm.setRules(this.submitFormRules); this.$submitForm.setRules(this.submitFormRules);
} }

@ -177,7 +177,7 @@ export const url = {
list: '/wmspda/sumscan/lock/list', list: '/wmspda/sumscan/lock/list',
}, },
unlock: { unlock: {
list: '/wmspdasumscan/unlock/list', list: '/wmspda/sumscan/unlock/list',
}, },
u: { u: {
order: '/wmspda/sumscan/u/order', order: '/wmspda/sumscan/u/order',

Loading…
Cancel
Save