Commit 0a2b5837 authored by 李苏's avatar 李苏 💬

选择分类

parent 8653614a
...@@ -131,6 +131,13 @@ const routes = [ ...@@ -131,6 +131,13 @@ const routes = [
title: '选择物料', title: '选择物料',
}, },
}, },
{
path: '/pages/dl_cmaterial/xzph',
name: 'xzph',
meta: {
title: '选择批号',
},
},
{ {
path: '/pages/dl_cmaterial/xzppdh', path: '/pages/dl_cmaterial/xzppdh',
name: 'xzppdh', name: 'xzppdh',
......
...@@ -98,6 +98,15 @@ ...@@ -98,6 +98,15 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path" : "pages/dl_cmaterial/xzph",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, },
{ {
"path" : "pages/dl_cmaterial/xzwlxx", "path" : "pages/dl_cmaterial/xzwlxx",
......
...@@ -32,8 +32,10 @@ ...@@ -32,8 +32,10 @@
{{ppdName}} {{ppdName}}
</view> </view>
<view class="infoBody"> <view class="infoBody">
<view class="infoBodyItemFull" > <view class="infoBodyItemFull" @tap="nextTo('/pages/dl_cmaterial/xzph')" >
<span class="cardKeyFull">批次信息:</span><span>{{ppdInfo.ph}}</span> <span class="cardKeyFull">批次信息:</span><span>{{ppdInfo.ph}}</span>
<text class="lg text-gray" style="float: right;margin-right: 2vw;"
:class="'cuIcon-' + 'right'"></text>
</view> </view>
<view class="infoBodyItemFull" @tap="nextTo('/pages/dl_cmaterial/xzppdh')" > <view class="infoBodyItemFull" @tap="nextTo('/pages/dl_cmaterial/xzppdh')" >
<span class="cardKeyFull">配盘单号:</span><span>{{ppdInfo.djid}}</span> <span class="cardKeyFull">配盘单号:</span><span>{{ppdInfo.djid}}</span>
...@@ -105,9 +107,9 @@ ...@@ -105,9 +107,9 @@
name=this.gwinfor[this.gwSelcetdIndex].ppdName||'null' name=this.gwinfor[this.gwSelcetdIndex].ppdName||'null'
} }
return name return name
},
}
}, },
data() { data() {
return { return {
...@@ -212,6 +214,7 @@ ...@@ -212,6 +214,7 @@
}, },
}, },
methods: { methods: {
emptyPpdInfo(){ emptyPpdInfo(){
this.ppdInfo={ this.ppdInfo={
ph:'', ph:'',
...@@ -251,7 +254,51 @@ ...@@ -251,7 +254,51 @@
} }
this.ppdInfo.upptzdList=records.upptzdList||[] this.ppdInfo.upptzdList=records.upptzdList||[]
this.ppdInfo.wlxxList=records.wlxxList||[] this.ppdInfo.wlxxList=records.wlxxList||[]
console.log(this.ppdInfo,'this.ppdInfo') this.ppdInfo.psjhList=records.psjhList||[]
/* ---初始化--- */
/* upptzdList */
let ph=this.ppdInfo.ph
let newArr=this.ppdInfo.upptzdList.filter(item=>{
if(item.ph==ph){
return item
}
})
this.ppdInfo.newupptzdList=newArr
/* 判定选中的是否存在 */
let iscf=false
newArr.forEach(item=>{
if(item.id==this.ppdInfo.pptzdid){
iscf=true
console.log('已选配盘点存在过滤后的数组不改变')
}
})
if(iscf==false){
this.ppdInfo.djid=''
this.ppdInfo.pptzdid=''
/* 初始化单号和单号id */
if(newArr.length!=0){
this.ppdInfo.djid=newArr[0].djid
this.ppdInfo.pptzdid=newArr[0].id
}
}
/* -初始化end- */
/* 物料初始化 */
/* 开始过滤 */
let mid= this.ppdInfo.pptzdid
let newArr1=this.ppdInfo.wlxxList.filter(item=>{
if(item.mid==mid){
return item
}
})
this.ppdInfo.newwlxxList=newArr1
/* 初始化物料信息 */
this.ppdInfo.wlName=''
// this.ppdInfo.wlName=''
if(newArr1.length>0){
this.ppdInfo.wlName=newArr1[0].wlname
}
/* -end- */
} }
}) })
...@@ -550,22 +597,70 @@ ...@@ -550,22 +597,70 @@
onLoad(e) { onLoad(e) {
this.f5Gw() this.f5Gw()
/* 配盘单号无法选中,暂时取消 */ /* 配盘单号无法选中,暂时取消 */
// eventBus.$on('sendInfo', function(data) { eventBus.$on('sendInfo', function(data) {
// if(data.type=='xzppdh'){ if(data.type=='xzppdh'){
// this.ppdInfo.djid=data.data.djid this.ppdInfo.djid=data.data.djid
// this.ppdInfo.pptzdid=data.data.id this.ppdInfo.pptzdid=data.data.id
// } /* 开始过滤 */
// console.log(data,'bySendInfo') let mid= this.ppdInfo.pptzdid
// }.bind(this)); let newArr1=this.ppdInfo.wlxxList.filter(item=>{
if(item.mid==mid){
return item
}
})
this.ppdInfo.newwlxxList=newArr1
/* 初始化物料信息 */
this.ppdInfo.wlName=''
// this.ppdInfo.wlName=''
if(newArr1.length>0){
this.ppdInfo.wlName=newArr1[0].wlname
}
}
if(data.type=="xzph"){
this.ppdInfo.ph=data.data.ph
/* upptzdList */
let ph=this.ppdInfo.ph
let newArr=this.ppdInfo.upptzdList.filter(item=>{
if(item.ph==ph){
return item
}
})
this.ppdInfo.newupptzdList=newArr
/* 判定选中的是否存在 */
let iscf=false
newArr.forEach(item=>{
if(item.id==this.ppdInfo.pptzdid){
iscf=true
console.log('已选配盘点存在过滤后的数组不改变')
}
})
if(iscf==false){
this.ppdInfo.djid=''
this.ppdInfo.pptzdid=''
/* 初始化单号和单号id */
if(newArr.length!=0){
this.ppdInfo.djid=newArr[0].djid
this.ppdInfo.pptzdid=newArr[0].id
}
}
/* 赋值最新列表 */
}
console.log(data,'bySendInfo')
}.bind(this));
if (!e.query) { if (!e.query) {
return return
} }
let einfor = JSON.parse(e.query) let einfor = JSON.parse(e.query)
}, },
onShow() { onShow() {
clearInterval(this.interval_gwinfor)
this.interval_gwinfor = setInterval(() => { this.interval_gwinfor = setInterval(() => {
this.f5Gw() this.f5Gw()
}, 5000) }, 8000)
console.log('onshow') console.log('onshow')
}, },
onUnload() { onUnload() {
......
<template>
<view>
<!-- <view class="cu-bar bg-white search fixed" :style="[{top:70 + 'px'}]">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input type="text" placeholder="输入搜索的信息" confirm-type="search" @confirm="searchFood"
v-model="serachName" />
</view>
<view class="action">
<button class="cu-btn bg-gradual-green shadow-blur round" @tap="searchFood">搜索</button>
</view>
</view> -->
<view class="bg-white">
<cu-custom bgColor="bg-gradual-blue" :isBack="true">
<block slot="content">选择批号</block>
</cu-custom>
</view>
<!-- <view class="cu-bar bg-white solid-bottom">
<view class="action">
<text class="cuIcon-title text-orange "></text>订单列表
</view>
</view> -->
<view v-for="(item,index) in psjhList" :key="index" class="infoCard" @tap.native="nextTo(item)" >
<view class="infoCardTitle">
#{{index+1}}
</view>
<view class="infoBody">
<!-- <view class="infoBodyItemFull" >
<span class="cardKeyFull">配盘单号:</span><span>{{item.djid}}</span>
</view> -->
<view class="infoBodyItemFull" >
<span class="cardKeyFull">批号:</span><span>{{item.ph}}</span>
</view>
<!-- <view class="infoBodyItemFull" >
<span class="cardKeyFull">物料信息:</span><span>{{item.wlName}}</span>
</view> -->
<!-- <view class="infoBodyItemFull" >
<span class="cardKeyFull">状态:</span><span>{{item.zt}}</span>
</view> -->
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
import {
queryWlList
} from '@/api/dlapi.js'
import InfoCard from '@/components/InfoCard/InfoCard.vue'
import eventBus from '@/common/util/eventBus.js'
export default {
data() {
return {
psjhList:[],
serachName: "",
status: "",
gwjlinfor: {},
wlinfor: [
]
}
},
onPullDownRefresh() {
setTimeout(() => {
uni.stopPullDownRefresh()
}, 2500)
},
methods: {
nextTo(item) {
let info = {
type:'xzph',
data: item
}
eventBus.$emit('sendInfo', info);
uni.navigateBack({
delta: 1
});
},
apiGetwl() {
queryWlList({
condition: this.serachName
}).then(e => {
this.wlinfor = e.records
})
},
searchFood() {
this.apiGetwl()
},
gotoBackPage() {
this.$router.go(-1)
}
},
onLoad(e) {
if(e.query){
const {ppdInfo}=JSON.parse(e.query)
this.psjhList=ppdInfo.psjhList
}
}
}
</script>
<style lang="scss" scoped>
.wid50 {
width: 50%;
}
.noinfoCard{
width: 100%;
height: 80px;
line-height: 80px;
text-align: center;
font-size: 16px;
color: #666;
}
.cardKey{
display: inline-block;
width: 60px;
text-align: right;
}
.cardKeyFull{
display: inline-block;
// width: 50%;
text-align: center;
}
.infoCard{
background-color: white;
border-radius: 5px;
margin: 5px 4px 5px 4px;
border: 1px #ddd solid;
padding: 5px 0px 5px 0px;
box-shadow: 1px 1px 1px #888888;
.infoCardTitle{
font-size: 15px;
padding: 0px 20px 0px 20px;
border-bottom: 1px solid #ddd;
text-align: center;
line-height: 30px;
height: 30px;
font-weight: 550;
background-color: #a7a7a7;
color: #fff;
}
.infoBody{
display: flex;
flex-wrap: wrap;
overflow: auto;
.infoBodyItem{
width: 50%;
padding-left: 10px;
font-size: 14px;
height: 25px;
line-height: 25px;
}
.infoBodyItemFull{
text-align: left;
width: 100%;
padding-left: 10px;
font-size: 14px;
height: 25px;
line-height: 25px;
}
}
}
</style>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<text class="cuIcon-title text-orange "></text>订单列表 <text class="cuIcon-title text-orange "></text>订单列表
</view> </view>
</view> --> </view> -->
<view v-for="(item,index) in upptzdList" :key="item.id" class="infoCard" @tap="nextTo(item)" > <view v-for="(item,index) in upptzdList" :key="index" class="infoCard" @tap="nextTo(item)" >
<view class="infoCardTitle"> <view class="infoCardTitle">
#{{index+1}} #{{index+1}}
</view> </view>
...@@ -70,16 +70,16 @@ ...@@ -70,16 +70,16 @@
}, 2500) }, 2500)
}, },
methods: { methods: {
// nextTo(item) { nextTo(item) {
// let info = { let info = {
// type:'xzppdh', type:'xzppdh',
// data: item data: item
// } }
// eventBus.$emit('sendInfo', info); eventBus.$emit('sendInfo', info);
// uni.navigateBack({ uni.navigateBack({
// delta: 1 delta: 1
// }); });
// }, },
apiGetwl() { apiGetwl() {
queryWlList({ queryWlList({
condition: this.serachName condition: this.serachName
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
if(e.query){ if(e.query){
const {ppdInfo}=JSON.parse(e.query) const {ppdInfo}=JSON.parse(e.query)
this.upptzdList=ppdInfo.upptzdList this.upptzdList=ppdInfo.newupptzdList
} }
} }
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
onLoad(e) { onLoad(e) {
if(e.query){ if(e.query){
const {ppdInfo}=JSON.parse(e.query) const {ppdInfo}=JSON.parse(e.query)
this.wlxxList=ppdInfo.wlxxList this.wlxxList=ppdInfo.newwlxxList
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment