From 99e916d3b2fa3c48c87c194436a12f3217114494 Mon Sep 17 00:00:00 2001
From: hou <1601990943@qq.com>
Date: Wed, 5 Jan 2022 18:24:43 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E6=8E=A5=E5=B0=8F=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=20=20=E9=87=8D=E6=9E=84=E6=88=90=E5=93=81=E6=8A=A5=E5=BA=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/i18n/lang/cn.ts | 6 +-
src/i18n/lang/en.ts | 4 +
.../warehouse/wholeLnventory/index.vue | 20 ++
.../product/warehouse/wholeScrap/index.vue | 221 ++++++++++++------
.../product/warehouse/wholeScrap/model.ts | 87 +++----
src/pages/raw/handover/aggregating/model.ts | 1 -
src/pages/raw/handover/aggregating/order.vue | 19 +-
.../raw/handover/aggregating/summary.vue | 19 +-
src/utils/url.ts | 2 +-
9 files changed, 244 insertions(+), 135 deletions(-)
diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts
index 3644efb..d26df54 100644
--- a/src/i18n/lang/cn.ts
+++ b/src/i18n/lang/cn.ts
@@ -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: '单号不能为空',
diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts
index aafa0c9..a9b85e4 100644
--- a/src/i18n/lang/en.ts
+++ b/src/i18n/lang/en.ts
@@ -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',
diff --git a/src/pages/product/warehouse/wholeLnventory/index.vue b/src/pages/product/warehouse/wholeLnventory/index.vue
index f762e8a..d640e7b 100644
--- a/src/pages/product/warehouse/wholeLnventory/index.vue
+++ b/src/pages/product/warehouse/wholeLnventory/index.vue
@@ -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]);
+ // 获取现有的 spQty、ypQty 总数
+ 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);
// 获取现有的 spQty、ypQty 总数
const total = storeList.reduce(
(total, item) => {
diff --git a/src/pages/product/warehouse/wholeScrap/index.vue b/src/pages/product/warehouse/wholeScrap/index.vue
index be20c34..3fa6143 100644
--- a/src/pages/product/warehouse/wholeScrap/index.vue
+++ b/src/pages/product/warehouse/wholeScrap/index.vue
@@ -8,34 +8,54 @@
-
-
-
+
+
+
+ {{ $t('message.Scrap_ScrapNo') }}
+
+
+
+ {{ $t('message.Query') }}
+
+
+
-
+
+
-
+
+
-
+
-
-
+
+
+
+
-
+
+
-
+
+
+
+
+
-
- {{ $t('message.workArea_Confirm') }}
+
+ {{ $t('message.detailed') }}
-
+
+ {{ $t('message.InventoryFinish') }}
+
+
{{ $t('message.po_Return') }}
@@ -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 = {
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 {
diff --git a/src/pages/product/warehouse/wholeScrap/model.ts b/src/pages/product/warehouse/wholeScrap/model.ts
index 0a17d69..7f1954a 100644
--- a/src/pages/product/warehouse/wholeScrap/model.ts
+++ b/src/pages/product/warehouse/wholeScrap/model.ts
@@ -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,
diff --git a/src/pages/raw/handover/aggregating/model.ts b/src/pages/raw/handover/aggregating/model.ts
index 6e6148a..e814937 100644
--- a/src/pages/raw/handover/aggregating/model.ts
+++ b/src/pages/raw/handover/aggregating/model.ts
@@ -236,7 +236,6 @@ export class AggregatingModule extends VuexModule {
const orderList = cloneDeep(proOrderResultList);
return { orderList };
}
-
/**
* 查询结果-辅料列表
* @param params
diff --git a/src/pages/raw/handover/aggregating/order.vue b/src/pages/raw/handover/aggregating/order.vue
index 405b2f5..aa2d307 100644
--- a/src/pages/raw/handover/aggregating/order.vue
+++ b/src/pages/raw/handover/aggregating/order.vue
@@ -8,7 +8,7 @@
-
+
-
+