|
|
|
@ -8,37 +8,50 @@
|
|
|
|
|
<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.Requisition') }}</view>
|
|
|
|
|
<u-search :placeholder="$t('message.collecting')" 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.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({ delta: 1 })">{{ $t('message.po_Return') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
@ -50,33 +63,27 @@ 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 jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
interface OptionType {
|
|
|
|
|
label: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
@Component
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
|
jPicker,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
export default class ProductCheckReceipt extends BasePage {
|
|
|
|
|
@Ref('form') readonly $form!: VForm;
|
|
|
|
|
model = model;
|
|
|
|
|
//表单
|
|
|
|
|
form = {
|
|
|
|
|
...this.model.orderInInfo,
|
|
|
|
|
originWl: {} as OptionType,
|
|
|
|
|
aimWl: {} as OptionType,
|
|
|
|
|
qty: {} as OptionType,
|
|
|
|
|
order3: '',
|
|
|
|
|
barcode: '',
|
|
|
|
|
};
|
|
|
|
|
originWlSelect = false;
|
|
|
|
|
aimWlSelect = false;
|
|
|
|
|
cboPlaceSelect = false;
|
|
|
|
|
rules: VFormRules<any> = {
|
|
|
|
|
documentNo: [{ required: true, message: this.$t('message.Warehouse_Tip1') as string }],
|
|
|
|
|
originWl: [{ required: true, message: this.$t('message.Warehouse_Tip2') as string }],
|
|
|
|
|
aimWl: [{ required: true, message: this.$t('message.Warehouse_Tip3') as string }],
|
|
|
|
|
cboPlace: [{ required: true, message: this.$t('message.Warehouse_Tip4') as string }],
|
|
|
|
|
};
|
|
|
|
|
value = '';
|
|
|
|
|
show = false;
|
|
|
|
|
wl: any = {};
|
|
|
|
|
Some: any = {};
|
|
|
|
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
|
|
|
|
onReady() {
|
|
|
|
|
this.model.orderInInfo.productDescZh = '';
|
|
|
|
@ -84,49 +91,107 @@ export default class ProductCheckReceipt extends BasePage {
|
|
|
|
|
this.model.orderInInfo.qty = '';
|
|
|
|
|
this.model.orderInInfo.locCode = '';
|
|
|
|
|
this.model.orderInInfo.costCenter = '';
|
|
|
|
|
this.$form.setRules(this.rules);
|
|
|
|
|
this.model.queryLocation();
|
|
|
|
|
}
|
|
|
|
|
onSubmit() {
|
|
|
|
|
this.$form.validate((valid: boolean) => {
|
|
|
|
|
if (!valid) return;
|
|
|
|
|
if (!this.form.productCode) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Warehouse_Tip5') as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
//单号查询
|
|
|
|
|
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: 'LY',
|
|
|
|
|
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];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//选择成品编码
|
|
|
|
|
materialChoice(e: any) {
|
|
|
|
|
this.wl = e.pickerName;
|
|
|
|
|
this.model.recordsList.forEach((item: any) => {
|
|
|
|
|
if (item.productCode == e.pickerName.value) {
|
|
|
|
|
this.Some = item;
|
|
|
|
|
}
|
|
|
|
|
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.form.originWl.value,
|
|
|
|
|
originWl: this.model.orderInInfo.locCode,
|
|
|
|
|
// aimWl: this.form.aimWl.value, custcode
|
|
|
|
|
type: '0',
|
|
|
|
|
orderType: '2',
|
|
|
|
|
keepBy: session.loginName,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
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 = '';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//条码扫码
|
|
|
|
|
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,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//确定
|
|
|
|
|
async onSubmit() {
|
|
|
|
|
const orderlist = [
|
|
|
|
|
{
|
|
|
|
|
...this.model.orderInInfo,
|
|
|
|
|
originWl: this.Some.originWl,
|
|
|
|
|
barCode: this.form.barcode,
|
|
|
|
|
aimWl: this.Some.aimWl,
|
|
|
|
|
type: '0',
|
|
|
|
|
orderType: '2',
|
|
|
|
|
keepBy: session.loginName as string,
|
|
|
|
|
factoryCode: session.factoryCode as string,
|
|
|
|
|
order3: this.form.order3,
|
|
|
|
|
costCenter: this.Some.costCenter,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
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 = '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@ -175,6 +240,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 {
|
|
|
|
|