|
|
|
@ -1,122 +1,63 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="page-raw-returning">
|
|
|
|
|
<view
|
|
|
|
|
class="header"
|
|
|
|
|
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
|
|
|
|
|
>
|
|
|
|
|
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="back" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title">{{ $t("message.deliver") }}</view>
|
|
|
|
|
<view class="title">{{ $t('message.deliver') }}</view>
|
|
|
|
|
<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.dn_OddNumbers')"
|
|
|
|
|
prop="orderNo"
|
|
|
|
|
>
|
|
|
|
|
<u-search
|
|
|
|
|
:placeholder="$t('message.Commission_tips1')"
|
|
|
|
|
v-model="form.orderNo"
|
|
|
|
|
@search="model.findProdInfoByDN"
|
|
|
|
|
:show-action="false"
|
|
|
|
|
></u-search>
|
|
|
|
|
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="150rpx">
|
|
|
|
|
<!-- 单号查询 -->
|
|
|
|
|
<u-form-item :required="true" :label="$t('message.dn_OddNumbers')" prop="orderNo">
|
|
|
|
|
<u-search :placeholder="$t('message.Commission_tips1')" v-model="form.orderNo" @search="query" :show-action="false"></u-search>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item :label="$t('message.product_TotalNumber')">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="model.orderInInfo.stoAmount"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-input v-model="model.orderInInfo.stoAmount" :placeholder="$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item :required="true" :label="$t('message.product_FGCode')">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="form.productCode"
|
|
|
|
|
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 :required="true" :label="$t('message.Line')">
|
|
|
|
|
<u-input v-model="form.rowItem" 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>
|
|
|
|
|
<u-form-item :label="$t('message.product_FGDes')">
|
|
|
|
|
<u-input :disabled="true" v-model="form.productDescZh" placeholder="" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item :label="$t('message.Line')">
|
|
|
|
|
<u-input :disabled="true" v-model="form.rowItem" placeholder="" />
|
|
|
|
|
<!-- 成品编码 -->
|
|
|
|
|
<u-form-item :label="$t('message.product_FGCode')">
|
|
|
|
|
<u-input :disabled="true" v-model="form.productCode" placeholder="" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-row gutter="0">
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item :label="$t('message.product_MaterilTotalNumber')">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="form.orderAmount"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-input v-model="form.orderAmount" :placeholder="$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item :label="$t('message.product_Swept')" label-width="80rpx">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="form.scanAmount"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-input v-model="form.scanAmount" :placeholder="$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
<u-form-item :label="$t('message.product_BarCode')">
|
|
|
|
|
<u-search
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
v-model="form.barCode"
|
|
|
|
|
@search="onSubmit"
|
|
|
|
|
:focus="firstFocus"
|
|
|
|
|
:show-action="false"
|
|
|
|
|
></u-search>
|
|
|
|
|
<u-search :placeholder="$t('message.po_PleaseInput')" v-model="form.barCode" @search="onSubmit" :focus="firstFocus" :show-action="false"></u-search>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-col :span="12">
|
|
|
|
|
<view class="table-wrapper">
|
|
|
|
|
<wyb-table
|
|
|
|
|
class="table"
|
|
|
|
|
ref="table"
|
|
|
|
|
width="100%"
|
|
|
|
|
enable-check="multiple"
|
|
|
|
|
show-left-and-right-border
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:contents="materialList"
|
|
|
|
|
:show-vert-border="false"
|
|
|
|
|
@onCheck="onCheck"
|
|
|
|
|
></wyb-table>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" enable-check="multiple" show-left-and-right-border :headers="headers" :contents="materialList" :show-vert-border="false" @onCheck="onCheck"></wyb-table>
|
|
|
|
|
</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-form>
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<u-row class="button-bar">
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-button
|
|
|
|
|
type="warning"
|
|
|
|
|
@click="toPage(page.product.outbound.stoOutboundDetail)"
|
|
|
|
|
>{{ $t("message.detailed") }}</u-button
|
|
|
|
|
>
|
|
|
|
|
<u-button type="warning" @click="toPage(page.product.outbound.stoOutboundDetail)">{{ $t('message.detailed') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-button type="error" @click="resetHandle">{{
|
|
|
|
|
$t("message.product_Empty")
|
|
|
|
|
}}</u-button>
|
|
|
|
|
<u-button type="error" @click="resetHandle">{{ $t('message.product_Empty') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-button type="primary" @click="onOk">{{
|
|
|
|
|
$t("message.po_Submit")
|
|
|
|
|
}}</u-button>
|
|
|
|
|
<u-button type="primary" @click="onOk">{{ $t('message.po_Submit') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<!-- <u-col :span="3">-->
|
|
|
|
|
<!-- <u-button type="success" @click="uni.navigateBack()">重提</u-button>-->
|
|
|
|
@ -127,22 +68,22 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { Component, Ref } from "vue-property-decorator";
|
|
|
|
|
import { BasePage } from "@/components/base/page";
|
|
|
|
|
import { VForm, VFormRules } from "vue/types/form";
|
|
|
|
|
import model from "./model";
|
|
|
|
|
import { session } from "@/store/modules/session";
|
|
|
|
|
import { headers } from "./config";
|
|
|
|
|
import { Component, Ref } from 'vue-property-decorator';
|
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
|
import { VForm, VFormRules } from 'vue/types/form';
|
|
|
|
|
import model from './model';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
import { headers } from './config';
|
|
|
|
|
@Component
|
|
|
|
|
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
|
|
|
|
@ -165,12 +106,12 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
dockName: null, // 月台类型name
|
|
|
|
|
orderNo: null,
|
|
|
|
|
qty: 0,
|
|
|
|
|
orderAmount: "",
|
|
|
|
|
productCode: "", // 物料类型name
|
|
|
|
|
productDescZh: "",
|
|
|
|
|
orderAmount: '',
|
|
|
|
|
productCode: '', // 物料类型name
|
|
|
|
|
productDescZh: '',
|
|
|
|
|
scanAmount: 0,
|
|
|
|
|
rowItem: "",
|
|
|
|
|
barCode: "",
|
|
|
|
|
rowItem: '',
|
|
|
|
|
barCode: '',
|
|
|
|
|
};
|
|
|
|
|
materialList: any = []; //物料列表
|
|
|
|
|
//被选中的表格数据
|
|
|
|
@ -178,7 +119,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
/**
|
|
|
|
|
* 工位退料人名称
|
|
|
|
|
*/
|
|
|
|
|
operatorName = "";
|
|
|
|
|
operatorName = '';
|
|
|
|
|
/**
|
|
|
|
|
* 退料类型选择
|
|
|
|
|
*/
|
|
|
|
@ -189,9 +130,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
* 表单验证规则
|
|
|
|
|
*/
|
|
|
|
|
rules: VFormRules<any> = {
|
|
|
|
|
orderNo: [
|
|
|
|
|
{ required: true, message: this.$t("message.product_Tip4") as string },
|
|
|
|
|
],
|
|
|
|
|
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
|
|
|
@ -200,7 +139,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
model.queryReturningTypeList();
|
|
|
|
|
}
|
|
|
|
|
onCheck(e: any) {
|
|
|
|
|
console.log("e.data", e.data);
|
|
|
|
|
console.log('e.data', e.data);
|
|
|
|
|
this.selectMaterielList = [];
|
|
|
|
|
e.data.forEach((line: any) => {
|
|
|
|
|
const { lineData: item } = line;
|
|
|
|
@ -208,14 +147,35 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
back() {
|
|
|
|
|
this.form.barCode = "";
|
|
|
|
|
this.form.barCode = '';
|
|
|
|
|
this.model.orderInInfo.stoAmount = 0;
|
|
|
|
|
this.selectMaterielList = [];
|
|
|
|
|
uni.navigateBack({ delta: 1 });
|
|
|
|
|
this.$table.onEmpty();
|
|
|
|
|
}
|
|
|
|
|
async query() {
|
|
|
|
|
if (!this.form.orderNo) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Commission_tips1') as any,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await this.model.findProdInfoByDN(this.form.orderNo);
|
|
|
|
|
if (model.DNcode == '1') {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.successful') as any,
|
|
|
|
|
});
|
|
|
|
|
this.form.productCode = this.model.materielList[0].materialCode;
|
|
|
|
|
this.form.productDescZh = this.model.materielList[0].materialDesc;
|
|
|
|
|
this.form.rowItem = this.model.materielList[0].rowItem;
|
|
|
|
|
this.form.orderAmount = this.model.materielList[0].orderAmount;
|
|
|
|
|
this.form.scanAmount = parseFloat(this.model.materielList[0].outAmount);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
materialConfirm(v: any) {
|
|
|
|
|
console.log("v[0].value", v[0]);
|
|
|
|
|
console.log('v[0].value', v[0]);
|
|
|
|
|
// this.form.productCode = v[0].value;
|
|
|
|
|
// this.model.materielList.forEach((item: any) => {
|
|
|
|
|
// if (v[0].value == item.stoItem) {
|
|
|
|
@ -227,8 +187,8 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
this.model.materielList.forEach((item: any) => {
|
|
|
|
|
if (v[0].label == item.materialCode) {
|
|
|
|
|
console.log("item", item);
|
|
|
|
|
if (v[0].label == item.rowItem) {
|
|
|
|
|
console.log('item', item);
|
|
|
|
|
this.form.productCode = item.materialCode;
|
|
|
|
|
this.form.productDescZh = item.materialDesc;
|
|
|
|
|
this.form.rowItem = item.rowItem;
|
|
|
|
@ -237,7 +197,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log("this.form", this.form);
|
|
|
|
|
console.log('this.form', this.form);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 清空
|
|
|
|
@ -269,8 +229,8 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
// }
|
|
|
|
|
if (parseInt(this.form.orderAmount) <= this.form.scanAmount) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.product_Tip6") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.product_Tip6') as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -297,7 +257,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
};
|
|
|
|
|
const res = await this.model.getMaterialByCode(list);
|
|
|
|
|
console.log("fanhui", res);
|
|
|
|
|
console.log('fanhui', res);
|
|
|
|
|
// if (res.barcode) {
|
|
|
|
|
// // this.materialList.push(res);
|
|
|
|
|
// this.form.scanAmount = res.scanAmount;
|
|
|
|
@ -309,7 +269,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
} else {
|
|
|
|
|
let flag = 0;
|
|
|
|
|
for (let i = 0; i < this.materialList.length; i++) {
|
|
|
|
|
console.log("11111", this.materialList[i]);
|
|
|
|
|
console.log('11111', this.materialList[i]);
|
|
|
|
|
if (this.form.barCode == this.materialList[i].barcode) {
|
|
|
|
|
flag = 1;
|
|
|
|
|
break;
|
|
|
|
@ -322,8 +282,8 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
this.$table.onCheckAllTap();
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.product_Tip7") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.product_Tip7') as string,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -331,7 +291,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
const item = {
|
|
|
|
|
...this.form,
|
|
|
|
|
barCode: String(""),
|
|
|
|
|
barCode: String(''),
|
|
|
|
|
};
|
|
|
|
|
this.firstFocus = false;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -369,23 +329,23 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
// this.$form.resetFields();
|
|
|
|
|
// // this.form.barCode = '';
|
|
|
|
|
// this.selectMaterielList = [];
|
|
|
|
|
console.log("aaaaaaa", this.model);
|
|
|
|
|
if (this.model.code == "1") {
|
|
|
|
|
console.log('aaaaaaa', this.model);
|
|
|
|
|
if (this.model.code == '1') {
|
|
|
|
|
this.materialList = [];
|
|
|
|
|
// this.model.materielList = [];
|
|
|
|
|
this.$table.onCheckAllTap();
|
|
|
|
|
uni.showToast({ icon: "success", title: "success" });
|
|
|
|
|
uni.showToast({ icon: 'success', title: 'success' });
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.form.barCode = "";
|
|
|
|
|
this.form.productCode = "";
|
|
|
|
|
this.form.barCode = '';
|
|
|
|
|
this.form.productCode = '';
|
|
|
|
|
model.orderInInfo.stoAmount = 0;
|
|
|
|
|
// this.form.orderNo = null;
|
|
|
|
|
this.form.scanAmount = 0;
|
|
|
|
|
this.form.orderAmount = "";
|
|
|
|
|
this.form.productDescZh = "";
|
|
|
|
|
this.form.orderAmount = '';
|
|
|
|
|
this.form.productDescZh = '';
|
|
|
|
|
this.selectMaterielList = [];
|
|
|
|
|
(this.form.rowItem = ""), this.$table.onEmpty();
|
|
|
|
|
(this.form.rowItem = ''), this.$table.onEmpty();
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
@ -393,8 +353,7 @@ export default class stoOutboundDom extends BasePage {
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.page-raw-returning {
|
|
|
|
|
background: #f2f2f2
|
|
|
|
|
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
|
|
|
|
|
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
|
|
|
|
|
background-size: 100% 600rpx;
|
|
|
|
|
padding: 118rpx 30rpx 162rpx;
|
|
|
|
|
min-height: 100%;
|
|
|
|
|