Commit 499ee3b5 authored by xiangzj's avatar xiangzj

要货

parent 07615af2
<template> <template>
<view class="lists"> <view class="lists">
<view class="status_bar" :style="navHeight"> <!-- <view class="status_bar" :style="navHeight">
</view> </view> -->
<scroll-view class="scroll-area view" :scroll-top="scrollTop" show-scrollbar='false' scroll-y="true"> <scroll-view class="scroll-area view" :scroll-top="scrollTop" show-scrollbar='false' scroll-y="true">
<view class="main"> <view class="main">
<view class="middle view"> <view class="middle view">
...@@ -130,16 +130,16 @@ ...@@ -130,16 +130,16 @@
export default { export default {
data() { data() {
return { return {
orderItem: { // orderItem: {
ticketTypeVal: '', // ticketTypeVal: '',
deliveryPlanCode: '', // deliveryPlanCode: '',
deliveryPlanName: ' ', // deliveryPlanName: ' ',
channelTypeCode: '', // channelTypeCode: '',
channelTypeName: ' ', // channelTypeName: ' ',
marketPlaceCode: '', // marketPlaceCode: '',
marketPlaceName: ' ', // marketPlaceName: ' ',
quantity: '' // quantity: ''
}, // },
index: 0, index: 0,
scrollTop: 0, scrollTop: 0,
deliveryPlanArr : [], deliveryPlanArr : [],
...@@ -148,6 +148,14 @@ ...@@ -148,6 +148,14 @@
marketPlaceArr : [], marketPlaceArr : [],
} }
}, },
props: {
orderItem: {
type: Object,
default () {
return {}
}
},
},
computed: { computed: {
navHeight() { navHeight() {
return { return {
...@@ -170,12 +178,17 @@ ...@@ -170,12 +178,17 @@
// }); // });
}, },
onLoad(option) { // onLoad(option) {
this.orderItem = { // this.orderItem = {
...this.orderItem, // ...this.orderItem,
...JSON.parse(option.order) // ...JSON.parse(option.order)
} // }
}, // },
// onBackPress(event) {
// uni.switchTab({
// url: "pages/puchase/puchase"
// })
// },
created() { created() {
// 发货计划类型:A0002 // 发货计划类型:A0002
// 制票类型:A0022 // 制票类型:A0022
...@@ -223,9 +236,10 @@ ...@@ -223,9 +236,10 @@
} }
}, },
nextStep() { nextStep() {
uni.navigateTo({ this.$emit('click', 'purchaseReceive')
url: `/pages/purchase-receive/purchase-receive?order=${JSON.stringify(this.orderItem)}` // uni.navigateTo({
}) // url: `/pages/purchase-receive/purchase-receive?order=${JSON.stringify(this.orderItem)}`
// })
}, },
getSelectDictDataOrigin(dictcode) { getSelectDictDataOrigin(dictcode) {
querySysDictionaryDetailsByCode({'code': dictcode}) querySysDictionaryDetailsByCode({'code': dictcode})
...@@ -370,6 +384,7 @@ ...@@ -370,6 +384,7 @@
} }
.bottom { .bottom {
margin-top: 68rpx; margin-top: 68rpx;
padding: 0 16rpx; padding: 0 16rpx;
justify-content: space-between; justify-content: space-between;
......
<template> <template>
<view class="lists"> <view class="lists">
<view class="status_bar" :style="navHeight"> <!-- <view class="status_bar" :style="navHeight">
</view> </view> -->
<scroll-view class="scroll-area view" :scroll-top="scrollTop" show-scrollbar='false' scroll-y="true"> <scroll-view class="scroll-area view" :scroll-top="scrollTop" show-scrollbar='false' scroll-y="true">
<view class="main"> <view class="main">
<view class="middle view"> <view class="middle view">
...@@ -155,18 +155,18 @@ ...@@ -155,18 +155,18 @@
export default { export default {
data() { data() {
return { return {
orderItem: { // orderItem: {
shuntTypeCode: '', // shuntTypeCode: '',
shuntTypeName: ' ', // shuntTypeName: ' ',
shuntCode: '', // shuntCode: '',
shuntName: ' ', // shuntName: ' ',
receiveUnitName: ' ', // receiveUnitName: ' ',
contactNumber: '', // contactNumber: '',
contacPerson: '', // contacPerson: '',
receiveAddress: '', // receiveAddress: '',
shuntingCustomer: '', // shuntingCustomer: '',
shuntingCustomerAdress: '' // shuntingCustomerAdress: ''
}, // },
receiveUnitArr: [], receiveUnitArr: [],
shuntArr: [], shuntArr: [],
shuntTypeArr: [], shuntTypeArr: [],
...@@ -179,6 +179,23 @@ ...@@ -179,6 +179,23 @@
scrollTop: 0 scrollTop: 0
} }
}, },
props: {
orderItem: {
type: Object,
default () {
return {}
}
},
},
watch: {
'orderItem.shuntCode' :function (newName,oldName){
console.log(newName,'newName')
if(newName - 0 === 0){
this.orderItem.shuntTypeName = ''
this.orderItem.shuntingCustomerAdress = ''
}
}
},
computed: { computed: {
navHeight() { navHeight() {
return { return {
...@@ -196,18 +213,18 @@ ...@@ -196,18 +213,18 @@
}, },
...mapState(['sysinfo', 'userInfo']) ...mapState(['sysinfo', 'userInfo'])
}, },
onLoad(option) { // onLoad(option) {
this.orderItem = { // this.orderItem = {
...this.orderItem, // ...this.orderItem,
...JSON.parse(option.order) // ...JSON.parse(option.order)
} // }
}, // },
onBackPress(event) { // onBackPress(event) {
uni.switchTab({ // uni.switchTab({
url: `/pages/purchase-main/purchase-main?order=${JSON.stringify(this.orderItem)}` // url: `/pages/purchase-main/purchase-main?order=${JSON.stringify(this.orderItem)}`
}) // })
return false // return false
}, // },
mounted() { mounted() {
console.log('监听到事件来自 update'); console.log('监听到事件来自 update');
let _this = this let _this = this
...@@ -355,9 +372,10 @@ ...@@ -355,9 +372,10 @@
console.log('上传失败:', e) console.log('上传失败:', e)
}, },
preStep() { preStep() {
uni.switchTab({ // uni.switchTab({
url: '/pages/purchase-main/purchase-main' // url: '/pages/purchase-main/purchase-main'
}) // })
this.$emit('click', 'purchaseMain')
} }
} }
} }
......
<template>
<view class="apply-history view" :style="winHeight">
<view class="status_bar" :style="navHeight"></view>
<view class="apply-history-wrapper view">
<component :style="componentHeight" :orderItem='orderItem' :is="currentTabComponent" @click="changeComponent" @submit="submit"></component>
</view>
</view>
</template>
<script>
import {
mapState
} from 'vuex'
import purchaseMain from '../purchase-main/purchase-main'
import purchaseReceive from '../purchase-receive/purchase-receive'
// #ifdef APP-PLUS
const dom = weex.requireModule('dom');
// #endif
export default {
components: {
purchaseMain,
purchaseReceive,
},
data() {
return {
currentTabComponent: 'purchaseMain',
topHeight: '',
orderItem: {
ticketTypeVal: '',
deliveryPlanCode: '',
deliveryPlanName: ' ',
channelTypeCode: '',
channelTypeName: ' ',
marketPlaceCode: '',
marketPlaceName: ' ',
quantity: '',
shuntTypeCode: '',
shuntTypeName: ' ',
shuntCode: '',
shuntName: ' ',
receiveUnitName: ' ',
contactNumber: '',
contacPerson: '',
receiveAddress: '',
shuntingCustomer: '',
shuntingCustomerAdress: ''
},
}
},
computed: {
componentHeight(){
console.log('componentHeight',`${this.sysinfo.safeArea.height - 44 - this.topHeight}px`,this.sysinfo);
return {
'height':`${this.sysinfo.safeArea.height - 44 - this.topHeight}px`
}
},
winHeight(){
return {
'height':`${this.sysinfo.safeArea.height}px`
}
},
navHeight(){
return {
'height':`${this.sysinfo.safeArea.top + 44}px`
}
},
...mapState(['sysinfo'])
},
onReady() {
// this.winHeight = `height:${this.sysinfo.safeArea.height}px`;
// this.navHeight = `height:${this.sysinfo.safeArea.top + 44}px`;
// #ifdef APP-NVUE
let queryTabSize = uni.createSelectorQuery().in(this);
queryTabSize.select('#top').boundingClientRect();
queryTabSize.exec(rects => {
console.log('rects',rects);
rects.forEach((rect) => {
this.topHeight = rect.height;
})
});
// #endif
// #ifdef H5
uni.createSelectorQuery().in(this).select('#top').boundingClientRect( (res) => {
this.topHeight = res.height;
}).exec();
// #endif
},
onBackPress(event) {
console.log('event--quota', event, this.currentTabComponent)
// uni.navigateBack({
// delta: 1
// })
if (this.currentTabComponent === 'purchaseReceive') {
uni.navigateTo({
url: `/pages/purchase/purchase-apply`
});
this.currentTabComponent = 'purchaseMain'
return false
} else {
uni.switchTab({
url: "pages/purchase/purchase"
})
}
return false
},
onLoad(option) {
this.orderItem = {
...this.orderItem,
...JSON.parse(option.order)
}
},
methods: {
changeComponent(com) {
this.currentTabComponent = com;
},
submit() {
console.log('submit')
}
}
}
</script>
<style lang="scss" scoped>
.view {
flex-direction: column;
}
.apply-history {
width: 750rpx;
flex: 1;
background: $background-color-1;
}
.apply-history-wrapper {
margin-top: 18rpx;
}
.top {
position: relative;
background: $background-color-1;
}
.steps {
flex: 1;
flex-direction: column;
margin: 28rpx 0 32rpx;
}
.steps__row-text-container {
align-items: flex-end;
flex-direction: row;
}
.steps__row-text {
flex: 1;
flex-direction: column;
}
.steps__row-title {
font-size: 12px;
line-height: 16px;
text-align: center;
color: $text-base-color;
}
.steps__row-container {
margin-bottom: 16rpx;
}
.steps__row-line-item {
flex: 1;
height: 14px;
line-height: 14px;
align-items: center;
justify-content: center;
}
.steps__row-line--before {
transform: translateX(-1px);
}
.steps__row-line {
flex: 1;
height: 1px;
background-color: #999;
}
.icon-dot {
width: 16rpx;
height: 16rpx;
background: #E5E5E5;
border-radius: 50%;
}
.icon-dot-active {
background: #ff1d32;
}
.steps__row-line--after {
transform: translateX(1px);
}
.steps__row-line {
flex: 1;
height: 1px;
background-color: #e5e5e5;
}
.steps__row-line--active {
background: #ff3e61;
border-radius: 1px;
}
.steps__row-circle {
background: #E5E5E5;
}
.steps__row-line--hide {
background-color: transparent;
}
</style>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
methods: { methods: {
purchaseBtn(item) { purchaseBtn(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/purchase-main/purchase-main?order=${JSON.stringify(item)}` url: `/pages/purchase/purchase-apply?order=${JSON.stringify(item)}`
}) })
}, },
async getSalesPlan(isRefresh) { async getSalesPlan(isRefresh) {
......
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