cosmoim-852 fix 新增成本中心回收物料&&原材料报废去掉目标库位
parent
d4c285eae7
commit
c41327758d
@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<view class="page-product-receipt">
|
||||
<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.CostCenter') }}</view>
|
||||
<view class="right"></view>
|
||||
</view>
|
||||
<u-form class="form" ref="form" :model="form" label-width="180rpx">
|
||||
<!-- 物料号 -->
|
||||
<u-form-item :required="true" :label="$t('message.po_MaterielNo')" prop="productCode">
|
||||
<u-input v-model="productCode" :required="true" :placeholder="$t('message.materialCode')" />
|
||||
<!-- <jPicker sureColor="#ff0000" @bindpicker="selectItem" showKey="value" valKey="value" :val="remove.value" :options="model.removeMaterialList" /> -->
|
||||
</u-form-item>
|
||||
<!-- 数量 -->
|
||||
<u-form-item :required="true" :label="$t('message.product_Number')" prop="proNum">
|
||||
<u-input v-model="histroyItem.proNum" :required="true" :placeholder="$t('message.Summary_PleaseInputNumber')" />
|
||||
</u-form-item>
|
||||
<!-- 成本中心 -->
|
||||
<u-form-item :required="true" :label="$t('message.product_costCenter')" prop="costCenter">
|
||||
<u-input v-model="costCenter" :required="true" :placeholder="$t('message.Warehouse_Tip8')" />
|
||||
</u-form-item>
|
||||
<!-- 原库位 -->
|
||||
<u-form-item :required="true" :label="$t('message.product_Location')" prop="oldaimWl">
|
||||
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChangeold" showKey="value" valKey="value" :val="form.oldaimWl.value" :options="aWlList" />
|
||||
<!-- <u-input :disabled="true" v-model="model.orderInInfo.locCode" placeholder="" /> -->
|
||||
</u-form-item>
|
||||
<!-- 目标库位 -->
|
||||
<!-- <u-form-item :required="true" :label="$t('message.Warehouse_TargetLocation')" prop="aimWl">
|
||||
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.WlList" />
|
||||
</u-form-item>-->
|
||||
</u-form>
|
||||
<view class="bottom-bar">
|
||||
<u-row class="button-bar">
|
||||
<!-- 移库明细 -->
|
||||
<!-- <u-col :span="4">
|
||||
<u-button type="primary" @click="bill">{{ $t('message.detailed') }}</u-button>
|
||||
</u-col> -->
|
||||
<!-- 确定 -->
|
||||
<u-col :span="6">
|
||||
<u-button type="primary" @click="onSubmit">{{ $t('message.recovery') }}</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 { Component, Ref } from 'vue-property-decorator';
|
||||
import { BasePage } from '@/components/base/page';
|
||||
import jPicker from '@/components/J-Picker/jPicker.vue';
|
||||
import { VForm, VFormRules } from 'vue/types/form';
|
||||
import model from './model';
|
||||
import { session } from '@/store/modules/session';
|
||||
interface OptionType {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
@Component({
|
||||
components: {
|
||||
jPicker,
|
||||
},
|
||||
})
|
||||
export default class productCheckReceipt extends BasePage {
|
||||
//表单引用
|
||||
@Ref('form') readonly $form!: VForm;
|
||||
model = model;
|
||||
form = {
|
||||
aimWl: {} as OptionType,
|
||||
oldaimWl: {} as OptionType,
|
||||
productCode: '',
|
||||
};
|
||||
aWlList = [
|
||||
{ value: 'L1CA', label: 'L1CA' },
|
||||
{ value: 'L1DA', label: 'L1CA' },
|
||||
{ value: 'L1FA', label: 'L1CA' },
|
||||
];
|
||||
costCenter: any = '';
|
||||
productCode: any = '';
|
||||
remove: any = {};
|
||||
allNum = 0;
|
||||
userDefined4: any = '';
|
||||
histroyItem: any = {};
|
||||
aimWlSelect = false;
|
||||
cboPlaceSelect = false;
|
||||
rules: VFormRules<any> = {
|
||||
oldaimWl: [{ required: true, message: this.$t('message.product_Tip3') as string }],
|
||||
productCode: [{ required: true, message: this.$t('message.materialCode') as string }],
|
||||
proNum: [{ required: true, message: this.$t('message.Summary_PleaseInputNumber') as string }],
|
||||
costCenter: [{ required: true, message: this.$t('message.Warehouse_Tip8') as string }],
|
||||
};
|
||||
value = '';
|
||||
show = false;
|
||||
//选择原库位回调函数
|
||||
bookTypeChangeold(e: any) {
|
||||
this.form.oldaimWl = e.pickerName;
|
||||
}
|
||||
//页面初始化
|
||||
async onReady() {
|
||||
this.form.oldaimWl = this.aWlList[0];
|
||||
}
|
||||
// async onShow() {
|
||||
// this.form.oldaimWl = this.aWlList[0];
|
||||
// console.log('//////////', this.aWlList);
|
||||
// }
|
||||
//移库确认
|
||||
onSubmit() {
|
||||
this.$form.validate(async (valid: boolean) => {
|
||||
if (!valid) return;
|
||||
if (!this.productCode) {
|
||||
this.customToast(this.$t('message.materialCode') as string);
|
||||
return;
|
||||
}
|
||||
if (!this.histroyItem.proNum) {
|
||||
this.customToast(this.$t('message.Summary_PleaseInputNumber') as string);
|
||||
return;
|
||||
}
|
||||
if (!this.form.oldaimWl.value) {
|
||||
this.customToast(this.$t('message.Warehouse_Tip3') as string);
|
||||
return;
|
||||
}
|
||||
if (!this.costCenter) {
|
||||
this.customToast(this.$t('message.Warehouse_Tip8') as string);
|
||||
return;
|
||||
}
|
||||
const orderlist = {
|
||||
productCode: this.productCode,
|
||||
qty: this.histroyItem.proNum,
|
||||
costCenter: this.costCenter,
|
||||
wlCode: this.form.oldaimWl.value,
|
||||
loginName: session.loginName,
|
||||
factoryCode: session.factoryCode,
|
||||
};
|
||||
await this.model.centerRecordTableRecovery(orderlist);
|
||||
if (model.code == '1') {
|
||||
this.customToast(this.$t('message.Warehouse_Tip9') as string);
|
||||
// this.form.productCode = '';
|
||||
//this.model.empty();
|
||||
// this.query()
|
||||
this.productCode = '';
|
||||
this.histroyItem.proNum = '';
|
||||
this.costCenter = '';
|
||||
//this.allNum = 0;
|
||||
//this.QueryHistory();
|
||||
// setTimeout(() => {
|
||||
// this.$forceUpdate();
|
||||
// }, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.page-product-receipt {
|
||||
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: 36rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
|
||||
.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;
|
||||
|
||||
.Transfer {
|
||||
width: 280rpx;
|
||||
height: 64rpx;
|
||||
background: rgb(242, 242, 242);
|
||||
border-radius: 110rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.single {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
|
||||
.single-left {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
||||
view {
|
||||
width: 170rpx;
|
||||
height: 100%;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.single-right {
|
||||
button {
|
||||
margin-top: 15rpx;
|
||||
width: 140rpx;
|
||||
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>
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* @Author: zhou lei
|
||||
* @Date: 2022-10-13 16:05:30
|
||||
* @LastEditTime: 2022-10-14 10:28:51
|
||||
* @LastEditors: zhou lei
|
||||
* @Description:
|
||||
* @FilePath: \hgwms-factory-app\src\pages\raw\LineSide\CostCenter\model.ts
|
||||
* 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司
|
||||
*/
|
||||
import { 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 request from '@/utils/request';
|
||||
import { stringify } from 'query-string';
|
||||
// import { page } from '@/utils/page';
|
||||
|
||||
class OrderInInfo {
|
||||
productDescZh?: string;
|
||||
qty?: string;
|
||||
custCode?: string;
|
||||
custCodeName?: string;
|
||||
productCode?: string;
|
||||
locCode?: string;
|
||||
barcode?: string;
|
||||
// actualQty?: string;
|
||||
}
|
||||
|
||||
@Module({
|
||||
namespaced: true,
|
||||
dynamic: true,
|
||||
store,
|
||||
name: 'row.LineSide.CostCenter.index',
|
||||
})
|
||||
export class wholeTransfer extends VuexModule {
|
||||
/**
|
||||
* 库位地点列表
|
||||
*/
|
||||
WlList = [];
|
||||
userDefined: any = '';
|
||||
detailedList: any;
|
||||
code = '';
|
||||
delCode = '';
|
||||
removeList: any = [];
|
||||
removeMaterialList: any = [];
|
||||
dnNo = '';
|
||||
orderInInfo: OrderInInfo = new OrderInInfo();
|
||||
@MutationAction
|
||||
async centerRecordTableRecovery(list: any) {
|
||||
const records: any = await request.post(url.warehouse.center.centerRecordTableRecovery, stringify(list));
|
||||
const code = records.code;
|
||||
return { code };
|
||||
}
|
||||
}
|
||||
|
||||
export default getModule(wholeTransfer);
|
Loading…
Reference in New Issue