交接小问题 重构成品报废

master
hou 4 years ago
parent 1c66c2140e
commit 99e916d3b2

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

@ -222,6 +222,10 @@ export default {
CommissionedSingleNumber: 'single',
CommissionedMaterielNo: 'code',
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',
CommissionedCumulativeData: 'total',
CommissionedLocation: 'Location',

@ -132,11 +132,31 @@ export default class productCheckReceipt extends BasePage {
icon: 'none',
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) {
//
const storeList = this.model.WlListaa.filter((item) => item.locCode === e[0].value);
console.log(storeList);
// spQtyypQty
const total = storeList.reduce(
(total, item) => {

@ -8,34 +8,54 @@
<view class="right"></view>
</view>
<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>
</u-form-item>
<!-- 报废单 -->
<view class="single">
<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-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 :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 :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 :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 :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 :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>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="6">
<u-button type="primary" @click="onSubmit">{{ $t('message.workArea_Confirm') }}</u-button>
<u-col :span="4">
<u-button type="primary" @click="onSubmit">{{ $t('message.detailed') }}</u-button>
</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-col>
</u-row>
@ -76,23 +96,55 @@ export default class productCheckReceipt extends BasePage {
* 表单数据
*/
form = {
// originWl: {} as OptionType,
aimWl: {} as OptionType,
qty: {} as OptionType,
productCode: '',
costCenter: '',
order3: '',
barcode: '',
};
// originWlSelect = false;
aimWlSelect1 = false;
aimWlSelect = false;
cboPlaceSelect = false;
bookTypeChange(e: any) {
console.log('you select bookType', e);
this.form.aimWl = e.pickerName;
console.log('aaaaaaa', this.form.aimWl);
wl: any = {};
Some: any = {};
materialChoice(e: any) {
this.wl = e.pickerName;
this.model.recordsList.forEach((item: any) => {
if (item.productCode == e.pickerName.value) {
this.Some = item;
}
});
}
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> = {
documentNo: [{ required: true, message: this.$t('message.Warehouse_Tip1') as string }],
// originWl: [{ required: true, message: '' }],
@ -111,68 +163,61 @@ export default class productCheckReceipt extends BasePage {
this.model.orderInInfo.locCode = '';
this.model.orderInInfo.costCenter = '';
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() {
this.$form.validate((valid: boolean) => {
this.$form.validate(async (valid: boolean) => {
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 = [
{
...this.model.orderInInfo,
originWl: this.model.orderInInfo.locCode,
barCode: this.model.orderInInfo.barcode,
aimWl: this.form.aimWl.value,
originWl: this.Some.originWl,
barCode: this.form.barcode,
aimWl: this.Some.aimWl,
type: '0',
orderType: '1',
keepBy: session.loginName as string,
factoryCode: session.factoryCode as string,
order3: this.form.order3,
costCenter: this.Some.costCenter,
},
];
console.log('orderlist', orderlist);
this.model.onTakeoutConfirm(orderlist);
this.model.orderInInfo.productDescZh = '';
this.model.orderInInfo.productCode = '';
this.model.orderInInfo.qty = '';
this.model.orderInInfo.locCode = '';
this.model.orderInInfo.costCenter = '';
this.form.productCode = '';
await this.model.onTakeoutConfirm(orderlist);
if (this.model.code == '1') {
uni.showToast({
icon: 'none',
title: this.$t('message.success') as string,
});
}
this.Some = {};
this.wl = {};
this.form.order3 = '';
this.form.barcode = '';
});
}
}
@ -224,6 +269,28 @@ export default class productCheckReceipt extends BasePage {
padding: 30rpx 0;
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 {

@ -1,15 +1,9 @@
import {
Action,
getModule,
Module,
MutationAction,
VuexModule,
} 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 { Action, getModule, Module, MutationAction, VuexModule } 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';
class OrderInInfo {
@ -27,14 +21,16 @@ class OrderInInfo {
namespaced: true,
dynamic: true,
store,
name: "product.warehouse.wholeScrap",
name: 'product.warehouse.wholeScrap',
})
export class wholeScrap extends VuexModule {
/**
*
*/
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
*/
@MutationAction
async getProductCode(barcode: string) {
const res: any = await http.post(url.warehouse.wholeTransfer.content, {
barcode,
factoryCode: session.factoryCode,
// factoryCode: '1999',
loginName: session.loginName,
// loginName: '1999',
});
console.log("获取来的数据", res.data.records);
async getProductCode(params: any) {
const res: any = await http.post(url.warehouse.wholeTransfer.content, params);
const orderInInfo = res.data.records[0];
if (orderInInfo.custCode == "0") {
orderInInfo.custCodeName = vm.$t("message.Warehouse_NX") as any;
} 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 };
const code = res.code;
return { code, orderInInfo };
}
@MutationAction
async onTakeoutConfirm(list: any) {
const records: any = await http.post(
url.warehouse.rowTransfer.commit,
list
);
if (records.code == 1) {
uni.showToast({
icon: "success",
title: "success",
});
// uni.navigateTo({ url: page.product.warehouse.index });
}
return {};
const records: any = await http.post(url.warehouse.rowTransfer.commit, list);
const code = records.code;
return { code };
}
@MutationAction
async queryScrapList(param: any) {
const res: any = await http.post(url.warehouse.rowTransfer.list, param);
const code = res.code;
console.log('res', res);
const recordsList = res.data.records;
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) {
await http.post("/wmspda/material/orderin/enter", {
await http.post('/wmspda/material/orderin/enter', {
loginName: session.loginName,
// loginName: '1999',
warehouseCode: "",
warehouseCode: '',
factoryCode: session.factoryCode,
// factoryCode: '1999',
locationCode: kw,

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

@ -8,7 +8,7 @@
<view class="right"></view>
</view>
<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 class="bottom-bar">
<view class="extra">
@ -88,6 +88,7 @@ export default class AggregatingOrder extends BasePage {
* 表头
*/
headers = orderHeaders;
spliceItem: any;
/**
* 交接完成
@ -153,7 +154,9 @@ export default class AggregatingOrder extends BasePage {
onSelectAll() {
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.password = '';
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.queryOrderList({
queryParams: this.model.orderOutIdListParams,
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.$submitForm.setRules(this.submitFormRules);
}

@ -8,7 +8,7 @@
<view class="right"></view>
</view>
<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 class="bottom-bar">
<view class="extra">
@ -88,6 +88,7 @@ export default class AggregatingSummary extends BasePage {
* 表头
*/
headers = summaryHeaders;
spliceItem: any;
/**
* 交接完成
@ -140,7 +141,9 @@ export default class AggregatingSummary extends BasePage {
this.$submitForm.setRules(this.submitFormRules);
this.isBusinessFinished = false;
}
clickIndex(e: any) {
this.spliceItem = e.data[0].lineData.materialCode;
}
beforeDestroy() {
if (model.aggregateList.length > 0 && !this.isBusinessFinished) {
this.unlock();
@ -297,9 +300,19 @@ export default class AggregatingSummary extends BasePage {
this.submitForm.receiverName = '';
this.submitForm.password = '';
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.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.$submitForm.setRules(this.submitFormRules);
}

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

Loading…
Cancel
Save