|
|
|
@ -12,7 +12,7 @@
|
|
|
|
|
<u-form-item label="时间" prop="name">
|
|
|
|
|
<view style="display: flex; flex-direction: row; justify-content: space-between; width: 100%">
|
|
|
|
|
<picker mode="date" :value="startdate" @change="startchange">
|
|
|
|
|
<view class="uni-input">{{ startdate }}</view>
|
|
|
|
|
<view class="uni-input">{{ startdate }}</view>
|
|
|
|
|
</picker>
|
|
|
|
|
<view> 至 </view>
|
|
|
|
|
<picker mode="date" :value="enddate" @change="endchange">
|
|
|
|
@ -20,14 +20,18 @@
|
|
|
|
|
</picker>
|
|
|
|
|
</view>
|
|
|
|
|
<uni-icons type="closeempty" size="20" @click="mepty"></uni-icons>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <button size="default" type="default" @click="mepty">重制</button> -->
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="采购单" prop="name">
|
|
|
|
|
<u-input placeholder="请输入单号" v-model="procureCode" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="物料号" prop="name">
|
|
|
|
|
<u-input placeholder="请输入物料号" v-model="materialCode" />
|
|
|
|
|
<jPicker sureColor="#ff0000" @bindpicker="selectMattCodeType" showKey="label" valKey="value" :val="aimWl.value" :options="matlist" />
|
|
|
|
|
|
|
|
|
|
<!-- <u-input placeholder="请输入物料号" v-model="materialCode" /> -->
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="采购单" prop="name">
|
|
|
|
|
<jPicker sureColor="#ff0000" @bindpicker="selectProductCodeType" showKey="value" valKey="value" :val="bimWl.value" :options="prodlist" />
|
|
|
|
|
|
|
|
|
|
<!-- <u-input placeholder="请输入单号" v-model="procureCode" /> -->
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-form>
|
|
|
|
|
</view>
|
|
|
|
@ -62,7 +66,6 @@
|
|
|
|
|
<view class="list-item"> 时间: </view>
|
|
|
|
|
<view>{{ item.lastUpdateDate }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</u-form>
|
|
|
|
|
</view>
|
|
|
|
@ -87,15 +90,13 @@
|
|
|
|
|
import { Component } from 'vue-property-decorator';
|
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
|
import model from './model';
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
interface OptionType {
|
|
|
|
|
label: string;
|
|
|
|
|
value: string;
|
|
|
|
|
}
|
|
|
|
|
//import { session } from '@/store/modules/session';
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
|
jPicker,
|
|
|
|
|
//MxDatePicker
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
@ -106,48 +107,135 @@ export default class ArrivalRecord extends BasePage {
|
|
|
|
|
enddate = dayjs().format('YYYY-MM-DD');
|
|
|
|
|
procureCode = '';
|
|
|
|
|
materialCode = '';
|
|
|
|
|
receivedlist= [];
|
|
|
|
|
receivedlist = [];
|
|
|
|
|
border = true;
|
|
|
|
|
async onReady() {}
|
|
|
|
|
aimWl: any = {};
|
|
|
|
|
bimWl: any = {};
|
|
|
|
|
matlist = [];
|
|
|
|
|
prodlist = [];
|
|
|
|
|
|
|
|
|
|
startchange(e) {
|
|
|
|
|
this.startdate = e.detail.value;
|
|
|
|
|
this.materialCode = '';
|
|
|
|
|
this.procureCode = '';
|
|
|
|
|
this.aimWl = {};
|
|
|
|
|
this.bimWl = {};
|
|
|
|
|
}
|
|
|
|
|
endchange(e) {
|
|
|
|
|
this.enddate = e.detail.value;
|
|
|
|
|
this.materialCode = '';
|
|
|
|
|
this.procureCode = '';
|
|
|
|
|
this.aimWl = {};
|
|
|
|
|
this.bimWl = {};
|
|
|
|
|
}
|
|
|
|
|
selectMattCodeType(e) {
|
|
|
|
|
this.materialCode = e.pickerName.value;
|
|
|
|
|
this.aimWl = e.pickerName;
|
|
|
|
|
this.bimWl = {};
|
|
|
|
|
this, (this.procureCode = '');
|
|
|
|
|
this.onSubmit();
|
|
|
|
|
}
|
|
|
|
|
selectProductCodeType(e) {
|
|
|
|
|
this.procureCode = e.pickerName.value;
|
|
|
|
|
this.bimWl = e.pickerName;
|
|
|
|
|
this.onSubmit();
|
|
|
|
|
}
|
|
|
|
|
async onSubmit() {
|
|
|
|
|
if (this.procureCode == '' || this.procureCode.length == 0) {
|
|
|
|
|
(this.$refs.uToast as any).show({
|
|
|
|
|
title: '请输入采购单号',
|
|
|
|
|
type: 'default',
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (this.procureCode == '' || this.procureCode.length == 0) {
|
|
|
|
|
// (this.$refs.uToast as any).show({
|
|
|
|
|
// title: '请输入采购单号',
|
|
|
|
|
// type: 'default',
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
let params = {
|
|
|
|
|
factoryCode:session.FactoryCode,
|
|
|
|
|
...(this.materialCode!==''&&{materialCode:this.materialCode}) ,
|
|
|
|
|
procureCode:this.procureCode,
|
|
|
|
|
factoryCode: session.FactoryCode,
|
|
|
|
|
...(this.materialCode !== '' && { materialCode: this.materialCode }),
|
|
|
|
|
...(this.procureCode !== '' && { procureCode: this.procureCode }),
|
|
|
|
|
// procureCode:this.procureCode,
|
|
|
|
|
...(this.startdate !== '请选择' && { lastUpdateDateMIN: this.startdate }),
|
|
|
|
|
...(this.enddate !== '请选择' && { lastUpdateDateMAX: this.enddate })
|
|
|
|
|
}
|
|
|
|
|
...(this.enddate !== '请选择' && { lastUpdateDateMAX: this.enddate }),
|
|
|
|
|
};
|
|
|
|
|
await this.model.getArrivalRecord(params);
|
|
|
|
|
if(this.model.responseCode == '200'){
|
|
|
|
|
this.receivedlist
|
|
|
|
|
let showlist = model.responseData;
|
|
|
|
|
this.receivedlist = showlist.map(item=>{
|
|
|
|
|
let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
materialCode:newmaterialCode
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (this.model.responseCode == '200') {
|
|
|
|
|
let showlist = model.responseData;
|
|
|
|
|
|
|
|
|
|
if (this.materialCode == '' && this.procureCode == '') {
|
|
|
|
|
this.receivedlist = showlist.map((item) => {
|
|
|
|
|
let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
materialCode: newmaterialCode,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let uniqueMaterialCodes = {}; // 用于跟踪唯一的materialCode
|
|
|
|
|
|
|
|
|
|
this.matlist = showlist
|
|
|
|
|
.filter((item) => {
|
|
|
|
|
// 检查newmaterialCode是否已经在uniqueMaterialCodes中
|
|
|
|
|
if (!uniqueMaterialCodes[item.materialCode]) {
|
|
|
|
|
// 如果不在,将其添加到uniqueMaterialCodes中,并返回true以保留在filter结果中
|
|
|
|
|
uniqueMaterialCodes[item.materialCode] = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
// 如果已经在uniqueMaterialCodes中,返回false以从filter结果中排除
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
.map((item) => {
|
|
|
|
|
// 对于filter后保留的项,进行映射操作
|
|
|
|
|
// let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
value: item.materialCode,
|
|
|
|
|
label: item.materialDesc,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.materialCode != '' && this.procureCode == '') {
|
|
|
|
|
this.receivedlist = showlist.map((item) => {
|
|
|
|
|
let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
materialCode: newmaterialCode,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
let uniqueprocureCode = {}; // 用于跟踪唯一的materialCode
|
|
|
|
|
this.prodlist = showlist
|
|
|
|
|
.filter((item) => {
|
|
|
|
|
if (!uniqueprocureCode[item.procureCode]) {
|
|
|
|
|
uniqueprocureCode[item.procureCode] = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
.map((item) => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
value: item.procureCode,
|
|
|
|
|
label: item.procureCode,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.materialCode != '' && this.procureCode != '') {
|
|
|
|
|
this.receivedlist = showlist.map((item) => {
|
|
|
|
|
let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
materialCode: newmaterialCode,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mepty() {
|
|
|
|
|
this.startdate = '请选择';
|
|
|
|
|
this.enddate = '请选择';
|
|
|
|
|
this.startdate = '请选择';
|
|
|
|
|
this.enddate = '请选择';
|
|
|
|
|
this.materialCode = '';
|
|
|
|
|
this.procureCode = '';
|
|
|
|
|
this.aimWl = {};
|
|
|
|
|
this.bimWl = {};
|
|
|
|
|
this.receivedlist = [];
|
|
|
|
|
//this.startdateValue = dayjs().format('YYYY-MM-DD');
|
|
|
|
|
//this.model.mepty();
|
|
|
|
|
}
|
|
|
|
@ -262,7 +350,7 @@ body {
|
|
|
|
|
height: 780rpx;
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 92%;
|
|
|
|
|
top:444rpx;
|
|
|
|
|
top: 444rpx;
|
|
|
|
|
/* bottom: 40px; */
|
|
|
|
|
overflow: auto;
|
|
|
|
|
// background-color: #f2f2f2;
|
|
|
|
@ -275,21 +363,18 @@ body {
|
|
|
|
|
.list {
|
|
|
|
|
// display: flex;
|
|
|
|
|
// flex-direction: cloumn;
|
|
|
|
|
|
|
|
|
|
.row-list {
|
|
|
|
|
|
|
|
|
|
.row-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
.list-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
.list-item{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
width: 40%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
width: 40%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -307,6 +392,5 @@ body {
|
|
|
|
|
|
|
|
|
|
.button-bar {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|