Commit 5aabfb0e authored by xiejb's avatar xiejb

添加发票 列表页面与发票高级搜索页面

parent f3c03256
import { fetch } from '@/utils'
// 获取商品列表
export function getMyInvoiceList(params) {
return fetch({
url: '/product/queryGoods_PS',
method: 'post',
data: params,
loading: true
})
}
......@@ -6,6 +6,8 @@ import todo from './todo'
import saleSituation from './saleSituation'
// 我的订单
import myOrder from './myOrder'
// 我的发票
import myInvoice from './myInvoice'
import { GetQueryString } from '@/utils/common'
// http://mobileportal.shaphar.com:8020/SYERP/newerp/#/requireGoods
Vue.use(Router)
......@@ -17,7 +19,8 @@ const routerList = [
},
...todo,
...saleSituation,
...myOrder
...myOrder,
...myInvoice
]
const router = new Router({
......
const myInvoice = [
{
path: '/myInvoice',
name: 'myInvoice',
meta: {
title: '我的订单',
auth: false
},
component: resolve => require(['@/views/myInvoice'], resolve)
}
]
export default myInvoice
<template>
<div class="h100">
<van-popup
v-model="moreSearchShow"
class="more-search"
position="right"
:style="{ width: '75%',height: '100%', overflow: 'hidden' }">
<div class="title font-bold font-16">下单时间</div>
<time-choose :startTime="moreSearchInfo.time.start" :endTime="moreSearchInfo.time.end" @confirm="timeConfirm"></time-choose>
<div class="high-info-list">
<div class="high-info" @click="showPost('consignor')">
<div class="title font-bold font-16">货主</div>
<!-- <textarea :value="consignor" class="inputInfo" type="text"></textarea> -->
<div contenteditable="true" class="inputInfo">{{consignor}}</div>
</div>
<div class="high-info">
<div class="title font-bold font-16">请输入订单号</div>
<!-- <div contenteditable="true" class="inputInfo">{{orderNo}}</div> -->
<input :value="orderNo" class="input" type="text">
</div>
<div class="high-info" @click="showPost('supplier')">
<div class="title font-bold font-16">供应商</div>
<div contenteditable="true" class="inputInfo">{{supplier}}</div>
</div>
<div class="high-info" @click="showPost('goods')">
<div class="title font-bold font-16">商品</div>
<div contenteditable="true" class="inputInfo">{{goods}}</div>
</div>
<div class="high-info" @click="showPost('client')">
<div class="title font-bold font-16">客户</div>
<div contenteditable="true" class="inputInfo">{{client}}</div>
</div>
</div>
<!-- <van-cell-group class="high-info">
<van-cell class="flex4" is-link
:value="consignor"
@click="showPost('consignor')">
<template #title>
<span type="danger" class="font-bold">货主</span>
</template>
</van-cell>
<van-field class="common" placeholder="请输入订单号" v-model="moreSearchInfo.orderNo">
<template #label>
<span type="danger" class="font-bold">订单号</span>
</template>
</van-field>
<van-cell class="flex4" is-link
:value="supplier"
@click="showPost('supplier')">
<template #title>
<span type="danger" class="font-bold">供应商</span>
</template>
</van-cell>
<van-cell class="flex4" is-link
:value="goods"
@click="showPost('goods')">
<template #title>
<span type="danger" class="font-bold">商品</span>
</template>
</van-cell>
<van-cell class="flex4" is-link
:value="client"
@click="showPost('client')">
<template #title>
<span type="danger" class="font-bold">客户</span>
</template>
</van-cell>
</van-cell-group> -->
<div class="action-bottom">
<van-button type="default" @click="onCleanClick">重置</van-button>
<van-button type="info" class="submit" @click="onSearchClick">查询</van-button>
</div>
</van-popup>
<search-in-supplier
v-model="moreSearchDialog.supplierShow"
:customer="!moreSearchInfo.supplier ? {}:moreSearchInfo.supplier"
:chinfo="chinfo"
@cancleclick="showPost"
@confirmclick="postConfirm"
></search-in-supplier>
<search-in-consignor
v-model="moreSearchDialog.consignorShow"
:customer="!moreSearchInfo.consignor ? {}:moreSearchInfo.consignor"
:chinfo="chinfo"
@cancleclick="showPost"
@confirmclick="postConfirm"
></search-in-consignor>
<cg-search-goods
v-model="moreSearchDialog.goodsShow"
:customer="!moreSearchInfo.goods ? {}:moreSearchInfo.goods"
@cancleclick="showPost"
@confirmclick="postConfirm"
></cg-search-goods>
<search-in-client
v-model="moreSearchDialog.clientShow"
:customer="!moreSearchInfo.client ? {}:moreSearchInfo.client"
:chinfo="chinfo"
@cancleclick="showPost"
@confirmclick="postConfirm"
></search-in-client>
</div>
</template>
<script>
import TimeChoose from '@/components/TimeChoose'
import {getFormateDate} from '@/utils/common'
// 供应商
import SearchInSupplier from "@/components/SearchInSupplier";
// 货主
import SearchInConsignor from "@/components/SearchInConsignor";
// 商品
import CgSearchGoods from "@/components/CgSearchGoods";
// 客户
import SearchInClient from "@/components/SearchInClient"
export default {
name: 'HighSearch',
components: {
TimeChoose,
SearchInSupplier,
CgSearchGoods,
SearchInConsignor,
SearchInClient
},
data() {
return {
moreSearchShow: false,
moreSearchDialog: {
consignorShow: false,
goodsShow: false,
supplierShow: false,
goodsShow: false,
clientShow: false
},
moreSearchInfo: {
supplier: '', // 供应商
consignor: '', // 货主
goods: '', // 商品
client: '', // 客户
orderNo: '', // 订单号
time: {
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
end: getFormateDate(new Date(), 'yyyy-MM-dd')
},
},
chinfo: {
goodsId: '',
supplier: ''
}
}
},
computed: {
// 供应商
supplier () {
if (this.moreSearchInfo.supplier.comPartyId) {
return !this.moreSearchInfo.supplier ? '' : (this.moreSearchInfo.supplier.comPartyId + '/(' + this.moreSearchInfo.supplier.partyOpcode + ')' + this.moreSearchInfo.supplier.partyName)
} else {
return ''
}
},
// 货主
consignor () {
if (this.moreSearchInfo.consignor.comPartyId) {
return !this.moreSearchInfo.consignor ? '' : (this.moreSearchInfo.consignor.comPartyId + '/(' + this.moreSearchInfo.consignor.partyOpcode + ')' + this.moreSearchInfo.consignor.partyName)
} else {
return ''
}
},
// 商品
goods () {
if (this.moreSearchInfo.goods.comGoodsId) {
return !this.moreSearchInfo.goods ? '' : (this.moreSearchInfo.goods.comGoodsId + '/(' + this.moreSearchInfo.goods.goodsOpcode + ')' + this.moreSearchInfo.goods.goodsName + '/' + this.moreSearchInfo.goods.goodsDesc + '/' + this.moreSearchInfo.goods.productLocation + '/' + this.moreSearchInfo.goods.packageNum + '/' + this.moreSearchInfo.goods.unitName)
} else {
return ''
}
},
// 客户
client () {
if (this.moreSearchInfo.client.comPartyId) {
return !this.moreSearchInfo.client ? '' : (this.moreSearchInfo.client.comPartyId + '/(' + this.moreSearchInfo.client.partyOpcode + ')' + this.moreSearchInfo.client.partyName)
} else {
return ''
}
},
// 订单号
orderNo () {
if (this.moreSearchInfo.orderNo) {
return !this.moreSearchInfo.orderNo ? '' : this.moreSearchInfo.orderNo
} else {
return ''
}
}
},
props: {
value: {
type: Boolean,
default: false
},
choosetime: {
type: Object,
default: () => {}
}
},
watch: {
value (val) {
this.moreSearchShow = val
// this.time = JSON.parse(JSON.stringify(this.choosetime))
},
moreSearchShow (val) {
this.$emit('input', val)
}
},
methods: {
timeConfirm (data) {
this.time = data
},
onSearchClick() {
this.moreSearchShow = false
console.log(this.moreSearchInfo)
this.$emit('onsearch', this.moreSearchInfo)
},
onCleanClick() {
this.moreSearchInfo = {
supplier: '', // 供应商
consignor: '', // 货主
goods: '', // 商品
client: '', // 客户
orderNo: '',
time: {
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
end: getFormateDate(new Date(), 'yyyy-MM-dd')
},
}
console.log(this.moreSearchInfo)
// this.moreSearchShow = false
// this.$emit('onsearch', this.moreSearchInfo)
},
showPost(type) {
switch (true) {
case type === 'supplier':
this.moreSearchDialog.supplierShow = !this.moreSearchDialog.supplierShow;
break;
case type === 'consignor':
this.moreSearchDialog.consignorShow = !this.moreSearchDialog.consignorShow;
break;
case type === 'goods':
this.moreSearchDialog.goodsShow = !this.moreSearchDialog.goodsShow
break;
case type === 'client':
this.moreSearchDialog.clientShow = !this.moreSearchDialog.clientShow
break;
}
window.history.pushState(null, null, document.URL);
},
postConfirm(data) {
console.log(data)
switch (true) {
case data.page === 'supplier':
this.moreSearchInfo.supplier = data.value;
this.chinfo.supplier = this.moreSearchInfo.supplier.comPartyId
break;
case data.page === 'goods':
this.moreSearchInfo.goods = data.value
break;
case data.page === 'consignor':
this.moreSearchInfo.consignor = data.value
break;
case data.page === 'client':
this.moreSearchInfo.client = data.value
break;
}
this.showPost(data.page);
},
}
}
</script>
<style lang="scss" scoped>
* {
box-sizing: border-box;
}
.more-search {
.title {
margin: 30PX 0 0 15PX
}
.high-info-list{
height: calc(100vh - 156px);
overflow-x: hidden;
overflow-y: auto;
.high-info{
margin: 0PX 15PX;
font-size: 14PX;
.title {
margin: auto
}
.inputInfo {
color: #666666;
width: 100%;
max-height: 100%;
// height: 40PX;
margin: 10PX auto;
border-radius: 5PX;
border:0.5px solid #bbbbbb;
min-height: 35PX;
line-height: 24px;
outline: 0;
word-wrap: break-word;
overflow-x: hidden;
overflow-y: auto;
padding: 5PX;
}
.input {
color: #666666;
width: 100%;
max-height: 100%;
// height: 40PX;
margin: 10PX auto;
border-radius: 5PX;
border:0.5px solid #bbbbbb;
min-height: 35PX;
line-height: 24px;
outline: 0;
word-wrap: break-word;
overflow-x: hidden;
overflow-y: auto;
padding: 5PX;
}
}
}
.search-value {
margin-top: 45PX;
}
.flex4 {
/deep/ .van-cell__title {
flex: none;
}
}
.action-bottom {
position: absolute;
bottom: 0;
width: 100%;
display: flex;
button {
flex: 1;
}
}
}
</style>
<template>
<div id="myInvoice">
<my-invoice-list/>
<high-search v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/>
</div>
</template>
<script>
import HighSearch from './components/HighSearch.vue'
import {getFormateDate} from '@/utils/common'
import myInvoiceList from './myInvoiceList.vue'
export default {
name: 'MyInvoice',
components: {
HighSearch,
myInvoiceList
},
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.closeAppPage,
rightClick: this.onMoreSearch
})
// 给window添加一个popstate事件,拦截返回键,执行this.onBrowserBack事件,addEventListener需要指向一个方法
window.addEventListener('popstate', this.onBrowserBack, false)
},
destroyed() {
// 当页面销毁必须要移除这个事件,vue不刷新页面,不移除会重复执行这个事件
window.removeEventListener('popstate', this.onBrowserBack, false)
},
methods: {
onBrowserBack() {
if (this.moreSearchShow) {
this.moreSearchShow = false
return
}
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>
#myInvoice {
height: 100%;
}
</style>
<template>
<div id="invoiecListItem">
<div class="itemInfo">
<div class="invoiecrNum">
<div class="company">浙江恒瑞制药公司</div>
<div class="time"><span>2020-11-13 09:00</span></div>
</div>
<div class="divider"></div>
<div class="invoiecrInfo">
<div class="cellInfo">
<div class="title">发票金额:</div>
<div class="info"><span class="price">377,899.00</span></div>
<div class="btn">
<van-button round plain size="mini" type="info">预览</van-button>
</div>
</div>
<div class="cellInfo">
<div class="title">发票号:</div>
<div class="info">XS837418787438178</div>
</div>
<div class="cellInfo">
<div class="title">发票代号:</div>
<div class="info">837418787438178</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InvoiecListItem',
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>
#invoiecListItem {
height: 100%;
.itemInfo{
height: 100%;
.divider{
width: 100%;
height: 1PX;
background: linear-gradient(to right, #ccc 0%, #ccc 50%, transparent 50%);
background-size: 10PX 1PX;
background-repeat: repeat-x;
}
.invoiecrNum{
display: flex;
line-height: 40PX;
height: 40PX;
margin: 0PX 10PX;
.company{
width: 60%;
padding-left: 5PX;
font-weight: 600;
}
.time{
width: 40%;
text-align: right
}
}
.invoiecrInfo{
margin: 5PX 10PX;
// display: flex;
height: 110PX;
font-size: 15PX;
.cellInfo{
display: flex;
line-height: 30PX;
.title{
width: 25%;
text-align: right;
}
.info{
width: 60%;
.price{
font-size: 16PX;
font-weight: 600;
color: red;
}
}
.btn {
width: 10%;
}
}
}
}
}
</style>
<template>
<div id="myInvoiceList">
<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">
<invoiec-list-item :item="item"/>
</div>
</van-list>
</van-pull-refresh>
</div>
</div>
</template>
<script>
// 引入接口
import { getMyInvoiceList } from '@/api/myInvoice'
import invoiecListItem from './invoiecListItem.vue'
export default {
name: 'MyInvoiceList',
components: {
invoiecListItem
},
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: {
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>
#myInvoiceList {
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;
}
}
}
</style>
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