You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

330 lines
9.3 KiB
Vue

<template>
<view class="page-kan-dan-index">
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">{{ $t('message.newsemifinishedWasteJudgment') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :error-type="['toast']" label-width="150rpx">
<!-- 条码 -->
<u-form-item :required="true" :label="$t('message.product_barCode')" prop="orderNo">
<u-search :placeholder="$t('message.barcode')" v-model.trim="barcode" @search="query" :show-action="false"></u-search>
</u-form-item>
<!-- 订单号 -->
<u-form-item :label="$t('message.Pi_OrderNo')">
<u-input :disabled="true" v-model="every.cpRef5" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 物料编码 -->
<u-form-item :label="$t('message.matcode')">
<u-input :disabled="true" v-model="every.productCode" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 物料描述 -->
<u-form-item :label="$t('message.po_MaterielDes')">
<u-input :disabled="true" v-model="every.productDescZh" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 库位 -->
<u-form-item :label="$t('message.CommissionedLocation')">
<u-input :disabled="true" v-model="every.locCode" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 缺陷 -->
<u-form-item :required="true" :label="$t('message.defect')">
<u-search placeholder="" v-model.trim="reason" @search="queryreason" :show-action="false"></u-search>
<!-- <u-input v-model="reason" :border="border" :placeholder="$t('message.po_PleaseInput')" /> -->
</u-form-item>
<u-form-item :label="$t('message.DefectName')">
<u-input :disabled="true" v-model="reasonList.dicName" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 责任人 -->
<u-form-item :label="$t('message.personLiable')">
<u-input v-model="responsibleUser" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
<!-- 责任区域 -->
<u-form-item :required="true" :label="$t('message.ResponsibleProcess')">
<u-search placeholder="" v-model.trim="responsibleProcess" @search="queryProcess" :show-action="false"></u-search>
<!-- <u-input v-model="responsibleProcess" :border="border" :placeholder="$t('message.po_PleaseInput')" /> -->
</u-form-item>
<u-form-item :label="$t('message.workArea_RegionName')">
<u-input :disabled="true" v-model="ProcessList.dicName" placeholder="" style="overflow: hidden" />
</u-form-item>
<!-- 备注 -->
<u-form-item :label="$t('message.Note')">
<u-input v-model="Note" placeholder="" />
</u-form-item>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<!-- 确定 -->
<u-col :span="6">
<u-button type="primary" @click="submit">{{ $t('message.product_Confirm') }}</u-button>
</u-col>
<!-- 返回 -->
<u-col :span="6">
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
//import { TargetTitle } from './config';
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
@Component({
components: {
jPicker,
},
})
export default class KanDanHandOver extends BasePage {
//TargetTitle = TargetTitle;
border = true;
model = model;
barcode = '';
reason = '';
responsibleUser = '';
responsibleProcess = '';
every: any = {};
reasonList: any = {};
ProcessList: any = {};
Note = '';
async query() {
if (this.barcode == '' || this.barcode.length == 0) {
this.customToast(this.$t('message.barcode') as string);
return;
}
await this.model.searchBarcode(this.barcode);
if (this.model.SearchCode == '1') {
uni.showToast({
title: this.$t('message.successful') as string,
duration: 2000,
image: '/static/icons/icon-51.png',
});
this.every = this.model.CodeDetail;
}
}
async queryreason() {
if (this.reason == '' || this.reason.length == 0) {
this.customToast(this.$t('message.Pleasedefects') as string);
return;
}
await this.model.checkDicCode(this.reason);
if (this.model.code == '1') {
uni.showToast({
title: this.$t('message.successful') as string,
duration: 2000,
image: '/static/icons/icon-51.png',
});
this.reasonList = this.model.resdata;
}
}
async queryProcess() {
if (this.responsibleProcess == '' || this.responsibleProcess.length == 0) {
this.customToast(this.$t('message.PleaseResponsibleArea') as string);
return;
}
await this.model.checkDicCode(this.responsibleProcess);
if (this.model.code == '1') {
uni.showToast({
title: this.$t('message.successful') as string,
duration: 2000,
image: '/static/icons/icon-51.png',
});
this.ProcessList = this.model.resdata;
}
}
costCenter = '';
async submit() {
if (this.barcode == '' || this.barcode.length == 0) {
this.customToast(this.$t('message.barcode') as string);
return;
}
if (this.every == {} || !this.every.barcode) {
this.customToast(this.$t('message.barcode') as string);
return;
}
if (this.reason == '') {
this.customToast(this.$t('message.Pleasedefects') as string);
return;
}
// if (this.responsibleUser == '') {
// this.customToast(this.$t('message.PleaseOne') as string);
// return;
// }
if (this.responsibleProcess == '') {
this.customToast(this.$t('message.PleaseResponsibleArea') as string);
return;
}
// if (this.every.qty != 0) {
// this.customToast(this.$t('message.scrapped') as string);
// return;
// }
let params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode: this.every.barcode,
orderNo: this.every.cpRef5,
productCode: this.every.productCode,
productDesc: this.every.productDescZh,
locCode: this.every.locCode,
reason: this.reason,
reasonDesc: this.reasonList.dicName,
responsibleUser: this.responsibleUser,
responsibleProcess: this.responsibleProcess,
responsibleAreaName: this.ProcessList.dicName,
add2: this.Note,
};
await this.model.submit(params);
if (this.model.submitCode == '1') {
this.customToast(this.$t('message.success') as string);
this.barcode = '';
this.every = {};
this.reason = '';
this.responsibleUser = '';
this.responsibleProcess = '';
this.Note = '';
this.reasonList = {};
this.ProcessList = {};
}
}
}
</script>
<style lang="scss" scoped>
.page-kan-dan-index {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 67px;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
padding-top: 19px;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
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: 30rpx;
z-index: 10000;
display: flex;
align-items: center;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
.add {
width: 100%;
height: 100rpx;
position: absolute;
top: 442px;
left: 0;
button {
position: absolute;
top: 3rpx;
right: 35rpx;
z-index: 10000;
}
}
.NumAdd {
width: 100%;
height: 100rpx;
position: relative;
// top: 496px;
// left: 0;
button {
position: absolute;
top: 3rpx;
right: 35rpx;
z-index: 10000;
}
}
.newly {
display: flex;
}
}
.single-right {
button {
//margin-top: 15rpx;
width: 110rpx;
height: 70rpx;
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
}
</style>