|
|
|
@ -1,37 +1,17 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="page-raw-receipt">
|
|
|
|
|
<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.product_item1") }}</view>
|
|
|
|
|
<view class="title">{{ $t('message.product_item1') }}</view>
|
|
|
|
|
<view class="right"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-form
|
|
|
|
|
class="form"
|
|
|
|
|
ref="form"
|
|
|
|
|
:model="form"
|
|
|
|
|
:error-type="['toast']"
|
|
|
|
|
label-width="120rpx"
|
|
|
|
|
>
|
|
|
|
|
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="120rpx">
|
|
|
|
|
<u-row align="top">
|
|
|
|
|
<u-col :span="12">
|
|
|
|
|
<u-form-item
|
|
|
|
|
:required="true"
|
|
|
|
|
:label="this.$t('message.product_Location')"
|
|
|
|
|
prop="dockName"
|
|
|
|
|
>
|
|
|
|
|
<jPicker
|
|
|
|
|
sureColor="#ff0000"
|
|
|
|
|
@bindpicker="bookTypeChange"
|
|
|
|
|
showKey="value"
|
|
|
|
|
valKey="value"
|
|
|
|
|
:val="form.aimWl.value"
|
|
|
|
|
:options="model.returningTypeList"
|
|
|
|
|
/>
|
|
|
|
|
<u-form-item :required="true" :label="this.$t('message.product_Location')" prop="dockName">
|
|
|
|
|
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.returningTypeList" />
|
|
|
|
|
<!-- <u-input v-model="form.dockName" type="select" @click="returningTypeSelect = true" />-->
|
|
|
|
|
<!-- <u-select-->
|
|
|
|
|
<!-- v-model="returningTypeSelect"-->
|
|
|
|
@ -45,28 +25,12 @@
|
|
|
|
|
<!-- ></u-select>-->
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item :label="this.$t('message.product_barCode')">
|
|
|
|
|
<u-search
|
|
|
|
|
:placeholder="this.$t('message.po_PleaseInput')"
|
|
|
|
|
v-model="form.barCode"
|
|
|
|
|
@search="getBarcode"
|
|
|
|
|
:focus="firstFocus"
|
|
|
|
|
:show-action="false"
|
|
|
|
|
></u-search>
|
|
|
|
|
<u-search :placeholder="this.$t('message.po_PleaseInput')" v-model="form.barCode" @search="getBarcode" :focus="firstFocus" :show-action="false"></u-search>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
<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="materielList"
|
|
|
|
|
: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="materielList" :show-vert-border="false" @onCheck="onCheck"></wyb-table>
|
|
|
|
|
</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
@ -74,24 +38,20 @@
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<u-row class="button-bar">
|
|
|
|
|
<u-col :span="3">
|
|
|
|
|
<u-button type="error" @click="onDelete">{{
|
|
|
|
|
$t("message.product_Delete")
|
|
|
|
|
}}</u-button>
|
|
|
|
|
<u-button type="error" @click="onDelete">{{ $t('message.product_Delete') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="3">
|
|
|
|
|
<u-button type="primary" @click="clearList">
|
|
|
|
|
{{ $t("message.product_Empty") }}
|
|
|
|
|
{{ $t('message.product_Empty') }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="3">
|
|
|
|
|
<u-button type="warning" @click="onSelectAll">
|
|
|
|
|
{{ $t("message.product_AllSelect") }}
|
|
|
|
|
{{ $t('message.product_AllSelect') }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="3">
|
|
|
|
|
<u-button type="success" @click="onOk">{{
|
|
|
|
|
$t("message.product_Confirm")
|
|
|
|
|
}}</u-button>
|
|
|
|
|
<u-button type="success" @click="onOk">{{ $t('message.product_Confirm') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
</view>
|
|
|
|
@ -99,13 +59,13 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { Component, Ref, Watch } from "vue-property-decorator";
|
|
|
|
|
import { BasePage } from "@/components/base/page";
|
|
|
|
|
import { VForm, VFormRules } from "vue/types/form";
|
|
|
|
|
import model from "./model";
|
|
|
|
|
import { headers } from "./config";
|
|
|
|
|
import { session } from "@/store/modules/session";
|
|
|
|
|
import jPicker from "@/components/J-Picker/jPicker.vue";
|
|
|
|
|
import { Component, Ref, Watch } from 'vue-property-decorator';
|
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
|
import { VForm, VFormRules } from 'vue/types/form';
|
|
|
|
|
import model from './model';
|
|
|
|
|
import { headers } from './config';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
|
interface OptionType {
|
|
|
|
|
label: string;
|
|
|
|
|
value: string;
|
|
|
|
@ -119,13 +79,13 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
/**
|
|
|
|
|
* 表格引用
|
|
|
|
|
*/
|
|
|
|
|
@Ref("table") readonly $table: any;
|
|
|
|
|
@Ref('table') readonly $table: any;
|
|
|
|
|
/**
|
|
|
|
|
* 表单引用
|
|
|
|
|
*/
|
|
|
|
|
@Ref("form") readonly $form!: VForm;
|
|
|
|
|
@Ref('form') readonly $form!: VForm;
|
|
|
|
|
|
|
|
|
|
@Watch("form", { immediate: true, deep: true })
|
|
|
|
|
@Watch('form', { immediate: true, deep: true })
|
|
|
|
|
onPersonChanged() {
|
|
|
|
|
this.isFormChange = true;
|
|
|
|
|
}
|
|
|
|
@ -158,8 +118,8 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
orderNo: null,
|
|
|
|
|
dockCode: null, // 库位类型code
|
|
|
|
|
dockName: null, // 库位类型name
|
|
|
|
|
Location: "",
|
|
|
|
|
barCode: "",
|
|
|
|
|
Location: '',
|
|
|
|
|
barCode: '',
|
|
|
|
|
aimWl: {} as OptionType,
|
|
|
|
|
};
|
|
|
|
|
//表格数据
|
|
|
|
@ -173,9 +133,7 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
* 表单校验
|
|
|
|
|
*/
|
|
|
|
|
rules: VFormRules<any> = {
|
|
|
|
|
dockName: [
|
|
|
|
|
{ required: false, message: this.$t("message.product_Tip1") as string },
|
|
|
|
|
],
|
|
|
|
|
dockName: [{ required: false, message: this.$t('message.product_Tip1') as string }],
|
|
|
|
|
};
|
|
|
|
|
bookTypeChange(e: any) {
|
|
|
|
|
this.form.aimWl = e.pickerName;
|
|
|
|
@ -190,7 +148,7 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
* 处理选择行 选中一条执行一次
|
|
|
|
|
*/
|
|
|
|
|
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;
|
|
|
|
@ -198,7 +156,7 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
back() {
|
|
|
|
|
this.form.barCode = "";
|
|
|
|
|
this.form.barCode = '';
|
|
|
|
|
this.selectMaterielList = [];
|
|
|
|
|
uni.navigateBack({ delta: 1 });
|
|
|
|
|
this.$table.onEmpty();
|
|
|
|
@ -215,10 +173,16 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
console.log("indexs", indexs);
|
|
|
|
|
for (let i = 0; i < indexs.length; i++) {
|
|
|
|
|
this.materielList.splice(indexs[i], 1);
|
|
|
|
|
delete this.materielList[indexs[i]];
|
|
|
|
|
}
|
|
|
|
|
let newList = [];
|
|
|
|
|
this.materielList.forEach((item: any) => {
|
|
|
|
|
if (item.barcode) {
|
|
|
|
|
newList.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.materielList = newList;
|
|
|
|
|
this.selectMaterielList = [];
|
|
|
|
|
this.$table.onEmpty();
|
|
|
|
|
}
|
|
|
|
@ -232,7 +196,7 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
//清空列表
|
|
|
|
|
clearList() {
|
|
|
|
|
this.$form.resetFields();
|
|
|
|
|
this.form.barCode = "";
|
|
|
|
|
this.form.barCode = '';
|
|
|
|
|
this.selectMaterielList = [];
|
|
|
|
|
this.materielList = [];
|
|
|
|
|
this.$table.onEmpty();
|
|
|
|
@ -243,8 +207,8 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
onOk() {
|
|
|
|
|
if (this.selectMaterielList.length == 0) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.product_Tip2") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.product_Tip2') as string,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$form.validate(async (valid: boolean) => {
|
|
|
|
@ -268,10 +232,10 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
await this.model.confirm(this.selectMaterielList);
|
|
|
|
|
this.$form.resetFields();
|
|
|
|
|
this.form.barCode = "";
|
|
|
|
|
this.form.barCode = '';
|
|
|
|
|
this.selectMaterielList = [];
|
|
|
|
|
this.isFormChange = false;
|
|
|
|
|
if (this.model.code == "1") {
|
|
|
|
|
if (this.model.code == '1') {
|
|
|
|
|
this.materielList = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.materielList = this.model.data;
|
|
|
|
@ -283,12 +247,12 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
getBarcode() {
|
|
|
|
|
if (this.form.aimWl.value == undefined) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.product_Tip3") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.product_Tip3') as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
console.log("this.form", this.form);
|
|
|
|
|
console.log('this.form', this.form);
|
|
|
|
|
if (this.materielList.length == 0) {
|
|
|
|
|
this.model.queryOrderInInfo(this.form).then(async () => {
|
|
|
|
|
await this.materielList.push(this.model.materielList[0]);
|
|
|
|
@ -297,7 +261,7 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
} else {
|
|
|
|
|
let flag = 0;
|
|
|
|
|
for (let i = 0; i < this.materielList.length; i++) {
|
|
|
|
|
console.log("11111", this.materielList[i]);
|
|
|
|
|
console.log('11111', this.materielList[i]);
|
|
|
|
|
if (this.form.barCode == this.materielList[i].barcode) {
|
|
|
|
|
flag = 1;
|
|
|
|
|
break;
|
|
|
|
@ -311,14 +275,14 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.product_Tip7") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.product_Tip7') as string,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const item = {
|
|
|
|
|
...this.form,
|
|
|
|
|
barCode: String(""),
|
|
|
|
|
barCode: String(''),
|
|
|
|
|
};
|
|
|
|
|
this.firstFocus = false;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -331,8 +295,7 @@ export default class finishProductOfflineDom extends BasePage {
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.page-raw-receipt {
|
|
|
|
|
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%;
|
|
|
|
|