Commit 0179cf7f authored by 何远江's avatar 何远江

添加工厂别选择,增加仓位选择。

parent 24ad5a69
<template>
<view class="factoryBox">
<zxz-uni-data-select filterable v-model="warehouseCode" dataKey="label" placeholder="请选择仓库别" dataValue="value"
:localdata="warehouseData" @change='onWarehouseChange' />
</view>
</template>
<script>
export default {
model: {
prop: 'value',
event: 'update'
},
props: {
value: {
type: String,
defualt: ''
}
},
data() {
return {
warehouseData: []
}
},
computed: {
warehouseCode: {
get() {
return this.value
},
set(v) {
this.$emit('update', v)
}
}
},
created() {
this.getDepotLists()
},
methods: {
onWarehouseChange(e) {
this.$emit('change', e);
},
getDepotLists() {
this.$u.api.sapApi
.sapDict({
FIELDNAME: 'T001L'
})
.then((res) => {
if (res) {
res.forEach((ele) => {
ele.label = ele.LGORT + "-" + ele.LGOBE;
ele.value = ele.LGORT
});
this.warehouseData = res;
} else {
this.warehouseData = [];
}
});
},
}
}
</script>
<style lang="scss">
.factoryBox {
padding: 10rpx 20rpx 0;
.item-select {
margin-bottom: 20rpx;
}
}
</style>
<template> <template>
<view class="homePage" :style="'height:' + screenHeight + 'px;'"> <view class="homePage" :style="'height:' + screenHeight + 'px;'">
<view class="title">广州市宝绅科技应用</view> <view class="title">
<text>工厂别:</text>
<zxz-uni-data-select :clear='false' class="item-select" filterable v-model="factoryCode" placeholder="请选择工厂"
dataKey="label" dataValue="value" :localdata="factoryData" @change="factoryChange"/>
</view>
<view class="lines"></view> <view class="lines"></view>
<view class="boxs"> <view class="boxs">
<uni-section v-for="(item, index) in tableData" :key="index" :title="item.title" type="line"> <uni-section v-for="(item, index) in tableData" :key="index" :title="item.title" type="line">
...@@ -20,16 +24,23 @@ ...@@ -20,16 +24,23 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
screenHeight: 0, screenHeight: 0,
src: require('@/static/images/cgrk.png'), src: require('@/static/images/cgrk.png'),
tableData: [ factoryData: [{
label: '1000 - 广州市宝绅科技有限公司',
value: '1000'
},
{ {
label: '1010 - 广州市宝绅科技有限公司RFID工厂',
value: '1010'
},
],
tableData: [{
title: '仓库扫描作业', title: '仓库扫描作业',
list: [ list: [{
{
src: require('@/static/images/cgrk.png'), src: require('@/static/images/cgrk.png'),
text: '采购入库', text: '采购入库',
url: '/pages/purchaseStorage/purchaseStorage' url: '/pages/purchaseStorage/purchaseStorage'
...@@ -105,50 +116,66 @@ export default { ...@@ -105,50 +116,66 @@ export default {
url: '/pages/recoil/recoilMaterial' url: '/pages/recoil/recoilMaterial'
}, },
] ]
} }]
]
}; };
}, },
computed: {
factoryCode: {
get() {
return this.vuex_user_factory || 1000
},
set(e) {
this.$u.vuex('vuex_user_factory', e)
}
}
},
created() { created() {
this.screenHeight = uni.getSystemInfoSync().screenHeight; this.screenHeight = uni.getSystemInfoSync().screenHeight;
}, },
methods: { methods: {
handleClick(v) { handleClick(v) {
uni.nav; uni.nav;
},
factoryChange(e) {
console.log(e, 'factoryChange')
},
} }
} };
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.homePage { .homePage {
background: #fff; background: #fff;
.title { .title {
background: #fff; background: #fff;
padding-top: 20rpx; padding: 20rpx 32rpx;
height: 60rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
padding-left: 32rpx;
font-weight: 600; font-weight: 600;
display: flex;
flex-direction: row;
align-items: center;
} }
.lines { .lines {
height: 32rpx; height: 32rpx;
background: #f8f8f8; background: #f8f8f8;
} }
} }
.demo-layout { .demo-layout {
height: 164rpx; height: 164rpx;
border-radius: 4px; border-radius: 4px;
margin-bottom: 10px; margin-bottom: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
text { text {
margin-top: 24rpx; margin-top: 24rpx;
font-size: 24rpx; font-size: 24rpx;
color: #000; color: #000;
} }
} }
</style> </style>
<template> <template>
<view class="login"> <view class="login">
<u-form ref="loginForm" :modelValue="loginForm" :rules="loginRules" class="login-form"> <u-form ref="loginForm" :modelValue="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">MES作业端</h3> <h3 class="title">PDA作业端</h3>
<u-form-item prop="username"> <u-form-item prop="username">
<input <input
v-model="loginForm.username" v-model="loginForm.username"
...@@ -68,12 +68,6 @@ ...@@ -68,12 +68,6 @@
}, },
methods: { methods: {
submit(){ submit(){
// if(1){
// uni.reLaunch({
// url: '/pages/index/index'
// });
// return
// }
this.$refs.loginForm.validate().then(valid => { this.$refs.loginForm.validate().then(valid => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
...@@ -85,15 +79,16 @@ ...@@ -85,15 +79,16 @@
}) })
.then(res => { .then(res => {
this.loading = false; this.loading = false;
if(res.msg){ this.$u.vuex('vuex_token', res.token)
this.$u.toast(res.msg); this.$u.vuex('vuex_user', res.user)
}
if (res.code == '200') { if (res.code == '200') {
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, 500); }, 500);
} else {
this.$u.toast(res.msg);
} }
}); });
} }
......
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