Commit cec828c1 authored by xiejb's avatar xiejb

我的订单 添加 查看请货单 页面

parent 29f61456
......@@ -52,6 +52,15 @@ const myOrder = [
auth: false
},
component: resolve => require(['@/views/myOrder/orderInvoice/orderInvoiecDetail'], resolve)
},
{
path: '/clearance',
name: 'clearance',
meta: {
title: '请货单查询',
auth: false
},
component: resolve => require(['@/views/myOrder/clearance'], resolve)
}
]
export default myOrder
<template>
<div id="clearanceList">
<div class="content">
<van-pull-refresh class="list" ref="supplierList" v-model="isRefreshing" @refresh="onRefresh">
<van-list
v-model="isLoading"
:finished="finished"
finished-text="没有更多了"
:error.sync="error"
error-text="请求失败,点击重新加载"
@load="onLoad">
<div class="invoiceItem"
v-for="(item, index) in invoiceList"
:key="index">
<clearance-list-item :item="item"/>
</div>
</van-list>
</van-pull-refresh>
</div>
</div>
</template>
<script>
// 引入接口
import { getMyInvoiceList } from '@/api/myInvoice'
import clearanceListItem from './clearanceListItem.vue'
export default {
name: 'ClearanceList',
components: {
clearanceListItem
},
data() {
return {
currentPage: 1,
pageSize: 10,
isRefreshing: false,
isLoading: false,
finished: false,
error: false,
logInfoShow: false,
invoiceList: [],
invoiceItem: {},
sphImage: require('@/assets/img/u48.png'),
}
},
computed: {
linkInfo () {
return this.$store.state.linkInfo
},
routKey() {
return this.$route.path
},
searchTime() {
let time = this.time.start + '/' + this.time.end
return time
}
},
mounted() {
// this.onLoad()
},
methods: {
gotoDetail(model) {
// console.log(model)
this.$emit('gotoDetail', model)
},
onRefresh() {
this.currentPage = 1
this.isRefreshing = true
this.getPostData()
},
onLoad() {
this.isLoading = true
this.getPostData()
},
getPostData() {
let _this = this
let data = {
'dbName': 'erp_test_shaphar-上药控股有限公司-204-23528', // 'erp_ogg_shaphar',
'start': _this.currentPage,
'length': _this.pageSize,
'goods': ''
}
getMyInvoiceList(data).then(rt => {
if (rt.code === 1 || rt.code === '1') {
if (_this.isRefreshing) {
_this.invoiceList = rt.data
} else if (rt.data || rt.data.length > 0) {
_this.invoiceList = _this.invoiceList.concat(rt.data)
}
// 重置刷新提示
_this.isRefreshing = false
// 重置加载更多提示
_this.isLoading = false
if (rt.data.length < 10) {
_this.finished = true
} else {
// 加载成功后下一页自增1
_this.currentPage++
}
} else {
_this.$toast(rt.message)
_this.isRefreshing = false
_this.error = true
_this.finished = false
}
// 加载状态结束
_this.isLoading = false
}).catch(e => {
this.$toast('获取信息失败!')
_this.isRefreshing = false
_this.isLoading = false
_this.error = true
_this.finished = true
})
}
}
}
</script>
<style lang="scss" scoped>
#clearanceList {
height: 100%;
.content{
height: 100%;
overflow-x: hidden;
overflow-y: auto;
padding: 10PX;
.invoiceItem{
// height: 145PX;
background-color: white;
margin-bottom: 10PX;
border-radius: 10PX;
font-size: 14PX;
color: #333333;
padding: 0PX 10PX 10PX 10PX;
}
}
}
</style>
<template>
<div id="clearanceListItem">
<div class="clearanceInfo">
<div class="clearanceHead">
<van-image fit="contain" width="50" height="55" :src="sphImage"/>
<div class="num">
<div class="numBer">请货单号:34678649876</div>
</div>
<div class="numType"><van-button class="numBtn" plain size="mini" type="info">药事所</van-button></div>
</div>
<div class="divider"></div>
<div class="orderInfo">
<div class="company">
<span style="width: 83%">药品部</span>
</div>
<div class="info">
<div class="headImage">
<van-image width="55" height="55"
src="https://img01.yzcdn.cn/vant/cat.jpeg"/>
</div>
<div class="details">
<div class="titleInfo">
[132521]阿西匹林/0.25g*s/上海市浦东新区金科路长泰广场负一楼
</div>
</div>
</div>
<div class="goodsNum">
来源商品编码:XN19280003837282
</div>
<div class="quantity">
<div class="clearanceNum">
请货数量:1000
</div>
<div class="billingNum">
开单数量:90
</div>
</div>
<van-divider :style="{ color: '#999999', borderColor: '#999999', margin: '10PX 0 10PX 0'}"/>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ClearanceListItem',
components: {
},
data() {
return {
sphImage: require('@/assets/img/u48.png'),
}
},
props: {
item: {
type: Object,
default: () => {
return {
}
}
}
},
computed: {
linkInfo () {
return this.$store.state.linkInfo
},
routKey() {
return this.$route.path
},
searchTime() {
let time = this.time.start + '/' + this.time.end
return time
}
},
mounted() {
// this.onLoad()
},
methods: {
onRefresh() {
}
}
}
</script>
<style lang="scss" scoped>
#clearanceListItem {
height: 100%;
.clearanceInfo{
font-size: 15PX;
.clearanceHead{
display: flex;
line-height: 50PX;
height: 50PX;
// margin: 0PX 10PX;
.num{
width: 77%;
padding-left: 5PX;
}
.numBer{
height: 16PX;
// line-height: 15PX;
}
// .numBtn{
// height: 13PX;
// line-height: 13PX;
// min-width: 35PX;
// font-size: 8PX;
// }
.dian{
width: 12PX;
height: 10PX;
border-radius: 10PX;
background-color: red;
margin: auto 5PX
}
.numType{
width: 17%;
text-align: right
}
}
.divider{
width: 100%;
height: 1PX;
background: linear-gradient(to right, #ccc 0%, #ccc 50%, transparent 50%);
background-size: 10PX 1PX;
background-repeat: repeat-x;
}
.orderInfo{
// margin: 0PX 10PX;
// display: flex;
// height: 105PX;
.company {
height: 45PX;
line-height: 45PX;
width: 100%;
display: flex;
font-weight: 600;
font-size: 16PX;
}
.info{
height: 65PX;
display: flex;
.headImage{
// width: 55PX;
padding-right: 10PX;
}
.details{
float: right;
width: calc(100vw - 105PX);
.titleInfo{
width: 100%;
overflow:hidden;
// white-space: nowrap;
text-overflow:ellipsis;
// line-height: 30PX;
}
}
}
.goodsNum{
}
.quantity{
display: flex;
height: 30PX;
line-height: 30PX;
.clearanceNum{
width: 50%;
}
.billingNum{
width: 50%;
}
}
}
}
}
</style>
<template>
<div id="clearance">
<clearance-list @gotoDetail="gotoDetail"/>
<!-- <high-search v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/> -->
</div>
</template>
<script>
// import HighSearch from './components/HighSearch.vue'
import {getFormateDate} from '@/utils/common'
import clearanceList from './clearanceList.vue'
export default {
name: 'Clearance',
components: {
// HighSearch,
clearanceList
},
data() {
return {
tabsTitle: [],
moreSearchShow: false,
activeTab: 'home',
moreSearchInfo: {
//接收搜索更多回传的数据
supplier: { comPartyId: "" }, //供应商ID
goods: { comGoodsId: "" }, //商品ID
orderNo: "", //订单编号
time: {
//起始时间
start: getFormateDate(new Date(), "yyyy-MM-dd"),
end: getFormateDate(new Date(), "yyyy-MM-dd"),
},
},
invoiceList: []
}
},
computed: {
linkInfo () {
return this.$store.state.linkInfo
},
routKey() {
return this.$route.path
},
searchTime() {
let time = this.time.start + '/' + this.time.end
return time
}
},
mounted() {
// 设置标题栏关闭返回按钮
this.$store.commit('setNavBar', {
show: true,
leftArrow: true,
rightIcon: true,
title: '请货单查询',
leftText: '',
leftClick: this.onBrowserBack,
rightClick: this.onMoreSearch
})
// 给window添加一个popstate事件,拦截返回键,执行this.onBrowserBack事件,addEventListener需要指向一个方法
window.addEventListener('popstate', this.onBrowserBack, false)
},
destroyed() {
// 当页面销毁必须要移除这个事件,vue不刷新页面,不移除会重复执行这个事件
window.removeEventListener('popstate', this.onBrowserBack, false)
},
methods: {
// 跳转详情
gotoDetail(model) {
},
onBrowserBack() {
this.$router.go(-1)
},
onSearch() {
},
onMoreSearch() {
this.moreSearchShow = !this.moreSearchShow
if (this.moreSearchShow) {
window.history.pushState(null, null, document.URL)
}
},
// 高级搜索查询
moreSearchConfirm(data) {
console.log('000000000')
},
// 高级搜索取消
moreSearchClean(data) {
this.moreSearchInfo = data;
},
closeAppPage() {
console.log('关闭页面')
bridge.closeWindow_c()
}
}
}
</script>
<style lang="scss" scoped>
#clearance {
height: 100%;
}
</style>
......@@ -101,13 +101,14 @@ export default {
switch (true) {
case model.actionType === "invoice":
//查看发票
this.gotoOrderInvoice();
this.gotoOrderInvoice(model);
break;
case model.actionType === "logistics":
// 查看物流
break;
case model.actionType === "clearance":
// 清货单
this.gotoOrderClearance(model)
break;
case model.actionType === "details":
// 订单详情
......@@ -122,6 +123,14 @@ export default {
query: this.$store.state.linkInfo
});
},
// 查看 清货单
gotoOrderClearance(model) {
// console.log(window.location.href.split('?')[1])
this.$router.push({
path: '/clearance',
query: this.$store.state.linkInfo
});
},
onBrowserBack() {
if (this.moreSearchShow) {
this.moreSearchShow = false
......
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