Commit b09847f3 authored by 李苏's avatar 李苏 💬

优化界面

组件化
parent a214aa51
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
{ {
"launchtype" : "local" "launchtype" : "local"
}, },
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud" "type" : "uniCloud"
} }
] ]
......
<template>
<view class="infoCard">
<view class="infoCardTitle" v-if="title">
{{title}}
</view>
<view class="infoBody">
<view :class="itemWidth" v-for="(item,key) in info" :key="key">
<span :class="keyWidth">{{key|getKeys}}:</span><span>{{item||'暂无信息'}}</span>
</view>
<view class="noinfoCard" v-if="Object.keys(info).length==0" >
暂无信息
</view>
</view>
</view>
</template>
<script>
export default {
filters:{
getKeys: function(e) {
let keyList = {
"wlname":"物料名称",
"wlgg": "物料规格",
"wlph": "物料批号",
"tpcode":"托盘号",
"ztsl":"数量",
"wlcode":"物料编码",
"rwdh":"任务单号",
"rwzt":"任务状态",
"agvrwdh":"agv任务单号",
"agvrwzt":"agv任务状态",
};
return keyList[e]
},
},
props:{
keyWidth:{
default:"cardKey"
},
itemWidth:{
default:"infoBodyItem"
},
title:{
default:""
},
info:{
default:()=>{
return {
}
}
}
},
name:"InfoCard",
data() {
return {
};
}
}
</script>
<style lang="scss" scoped>
.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: right;
}
.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;
.infoBodyItem{
width: 50%;
padding-left: 10px;
font-size: 14px;
height: 25px;
line-height: 25px;
}
.infoBodyItemFull{
width: 100%;
padding-left: 10px;
font-size: 14px;
height: 25px;
line-height: 25px;
}
}
}
</style>
\ No newline at end of file
<template> <template>
<view style="overflow: auto;"> <view style="overflow: auto">
<view class="location_body" :style="bodyWidth" > <view class="location_body" :style="bodyWidth" >
<view class="xList" v-for="(xitem,xindex) in xList" :key="xindex"> <view class="xList" v-for="(xitem,xindex) in xList" :key="xindex">
<!-- <view class="yList">
{{xindex+1}}
</view> -->
<view class="yList" :class="{qhkw:yitem&&yitem[0]&&searchSign(yitem).sign=='Y'}" v-for="(yitem,yindex) in xitem" :key="yindex"> <view class="yList" :class="{qhkw:yitem&&yitem[0]&&searchSign(yitem).sign=='Y'}" v-for="(yitem,yindex) in xitem" :key="yindex">
<span> <span>
{{(yitem&&yitem[0])?(searchSign(yitem)?searchSign(yitem).code:yitem[yitem.length-1].code):"空位"}} {{(yitem&&yitem[0])?(searchSign(yitem)?searchSign(yitem).code:yitem[yitem.length-1].code):"空位"}}
</span> </span>
</view> </view>
</view> </view>
...@@ -17,11 +14,10 @@ ...@@ -17,11 +14,10 @@
</template> </template>
<script> <script>
import LocationMain from '@/components/LocationInfo/LocationMain.vue'
export default { export default {
name:"LocationInfo", name:"LocationInfo",
components:{ components:{
LocationMain
}, },
props:{ props:{
xList:{ xList:{
......
<template>
<view class="main_body">
<view :class="{existItem:item==7}" class="mainItem" v-for="(item,index) in kwnum" :key="index">
<span >{{item==7?'7(3层)':item+"仓"}}</span>
</view>
</view>
</template>
<script>
export default {
name:"LocationMain",
props:{
kwnum:{
default:10
}
},
data() {
return {
};
}
}
</script>
<style lang="scss">
.main_body{
height: 100%;
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
.mainItem{
border: 1px solid #eee;
height: 40px;
line-height: 40px;
width: 41.3px;
}
.existItem{
color: #fff;
background-color:red;
}
}
</style>
\ No newline at end of file
<template>
<view class="stationAll">
<view class="stationBody" :class="{status1:itemInfo.status==1,status2:itemInfo.status==2,status3:itemInfo.status==3}">
<view class="item">{{itemInfo.stationname}}</view>
<view class="item">{{itemInfo.name}}</view>
<view class="item">{{itemInfo.status|getstatus}}</view>
</view>
<view class="stationSelect">
<view class="checkBody" v-if="isSelected">
<text class="lg text-gray checkItem" :class="'cuIcon-check'"></text>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
isSelected:{
default:false
},
itemInfo:{
default:{
status:1,
stationname: "数据字段错误",
name: "数据字段错误"
}
}
},
name:"Station",
data() {
return {
};
},
filters: {
getstate: function(e) {
let state = {
"C": "完成",
"F": "确认",
"I": "初始"
}
return state[e]
},
getstatus: function(e) {
let ztList = {
"1": "正常",
"2": "已占用",
"3": "锁定"
};
return ztList[e]
},
getColor: function(e) {
let ztList = {
"1": "bg-green",
"2": "bg-red",
"3": "bg-orange"
};
return ztList[e]
},
formatTime: function(time) {
if (time != null && time != "") {
var date = new Date(time);
return date.Format("MM-dd hh:mm")
} else {
return "";
}
},
ztTrans: function(a) {
const ztList = {
"1": "空闲",
"2": "已占用",
"3": "锁定"
};
return ztList[a]
},
},
}
</script>
<style lang="scss" scoped>
.checkBody{
background-color:royalblue;
border-radius: 50%;
padding: 2px;
.checkItem{
color: #fff;
font-size: 14px;
}
}
.stationAll{
border: 0.5px solid #eee;
min-height: 130px;
padding: 10px;
}
.stationSelect{
height: 25%;
display: flex;
align-items: center;
justify-content: center;
}
.stationBody{
height: 75%;
padding: 10px;
display: flex;
flex-wrap: wrap;
flex-direction:column;
.item{
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}
}
.stationBody:nth-child(1)
{
color: #fff;
border-radius: 5px;
}
.status1{
background-color: limegreen;
}
.status2{
background-color: crimson;
}
.status3{
background-color: orange;
}
</style>
\ No newline at end of file
This diff is collapsed.
...@@ -17,22 +17,15 @@ ...@@ -17,22 +17,15 @@
<text class="cuIcon-title text-orange "></text> 物料列表 <text class="cuIcon-title text-orange "></text> 物料列表
</view> </view>
</view> </view>
<view class="bg-white " v-for="(item,index) in wlinfor" :key="index" @tap="nextTo(item)"> <InfoCard :info="item" :title="'序号:#'+(index+1)" v-for="(item,index) in wlinfor" :key="index+'keys'" @tap.native="nextTo(item)"></InfoCard>
<view class="flex flex-wrap margin-bottom-xs padding bg-grey white radio">
<view class="wid50 margin-top-xs margin-bottom-xs radius">物料:<span>{{item.wlcode}} </span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">名称:<span>{{item.wlname}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">规格:<span>{{item.wlgg}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">托盘号:<span>{{item.tpcode}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">批号:<span>{{item.wlph}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">剩余数量:<span>{{item.ztsl}}</span></view>
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import api from '@/api/api.js'; import api from '@/api/api.js';
import InfoCard from '@/components/InfoCard/InfoCard.vue'
import eventBus from '@/common/util/eventBus.js' import eventBus from '@/common/util/eventBus.js'
export default { export default {
data() { data() {
...@@ -58,7 +51,6 @@ ...@@ -58,7 +51,6 @@
apiGetwl(){ apiGetwl(){
let _self=this; let _self=this;
api.postData("xgwms/tpmx/queryWlxx",{ api.postData("xgwms/tpmx/queryWlxx",{
"ckid":_self.$ckid,
"condition":_self.serachName "condition":_self.serachName
}).then((resp) => { }).then((resp) => {
if(resp.data.success){ if(resp.data.success){
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
} }
checkKwcode({code:this.code,kwid:this.rkdjlist[this.index].kwid}).then(e=>{ checkKwcode({code:this.code,kwid:this.rkdjlist[this.index].kwid}).then(e=>{
if(e){ if(e){
if(that.code==that.rkdjlist[that.index].kwname&&e.records.zt=="L"){ if(that.code.toLowerCase()==that.rkdjlist[that.index].kwname.toLowerCase()&&e.records.zt=="L"){
return {rwid:that.rkdjlist[that.index].id,destKwid:e.records.id,text:"是否确认入库"} return {rwid:that.rkdjlist[that.index].id,destKwid:e.records.id,text:"是否确认入库"}
}else if(e.code!=that.code&&e.records.zt=="E"){ }else if(e.code!=that.code&&e.records.zt=="E"){
return {rwid:that.rkdjlist[that.index].id,destKwid:e.records.id,text:"当前库位和已输库位不一致,是否入库"} return {rwid:that.rkdjlist[that.index].id,destKwid:e.records.id,text:"当前库位和已输库位不一致,是否入库"}
......
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