Commit a40793a2 authored by xiejb's avatar xiejb

我的发票 复用订单高级搜搜

parent 56bdaccb
<template>
<div id="myInvoice">
<my-invoice-list ref="invoiceList" @gotoDetail="gotoDetail"/>
<high-search v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/>
<my-invoice-list v-show="invoiceListShow" ref="invoiceList" @gotoDetail="gotoDetail"/>
<!-- <high-search v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/> -->
<high-search :more-search-info="moreSearchInfo" v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/>
</div>
</template>
<script>
import HighSearch from './components/HighSearch.vue'
// import HighSearch from './components/HighSearch.vue'
import HighSearch from '@/views/myOrder/components/HighSearchNewDelete.vue'
import {getFormateDate} from '@/utils/common'
import myInvoiceList from './myInvoiceList.vue'
import invoiecDetail from './invoiecDetail.vue'
import {getEmployeeOrgQueryList, getConsignorSetList} from '@/api/common'
import { bridge } from "@/utils";
export default {
name: 'MyInvoice',
......@@ -23,17 +26,18 @@ export default {
moreSearchShow: false,
activeTab: 'home',
moreSearchInfo: {
//接收搜索更多回传的数据
supplier: { comPartyId: "" }, //供应商ID
goods: { comGoodsId: "" }, //商品ID
orderNo: "", //订单编号
supplier: [], // 供应商
consignor: [], // 货主
goods: '', // 商品
client: [], // 客户
orderNo: '',
time: {
//起始时间
start: getFormateDate(new Date(), "yyyy-MM-dd"),
end: getFormateDate(new Date(), "yyyy-MM-dd"),
},
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
end: getFormateDate(new Date(), 'yyyy-MM-dd')
}
},
invoiceList: []
invoiceList: [],
invoiceListShow: false
}
},
computed: {
......@@ -80,7 +84,123 @@ export default {
// 当页面销毁必须要移除这个事件,vue不刷新页面,不移除会重复执行这个事件
window.removeEventListener('popstate', this.onBrowserBack, false)
},
mounted() {
// this.moreSearchShow = true
this.getConsignorPostData()
// this.tabsTitleData()
},
methods: {
// 查询是否货主为单个
getConsignorPostData() {
let _this = this
let data = {
'attr': {
'empid': this.linkInfo.userId
},
'filters': [],
'logic': 'or',
'sort': 'desc',
'orderby': 'createon',
'pageNum': 1,
'pageSize': 10
}
getConsignorSetList(data).then(rt => {
if (rt.code === 200) {
// this.postDataList = rt.data.list
if (rt.data.length !== 1) {
this.moreSearchShow = true
} else if (rt.data.length === 1) {
this.moreSearchInfo.consignor.push(this.postDataListAction(rt.data[0]))
this.getEmployeeOrgPostData(rt.data[0])
} else if (rt.data.length === 0) {
_this.$toast('暂无货主!')
}
} else {
_this.$toast(rt.message)
}
}).catch(e => {
_this.$toast('列表获取失败')
})
},
postDataListAction(item) {
const removeItem = item
removeItem.cellId = item.id + item.erp_user
return item
},
// 获取供应商
getEmployeeOrgPostData(item) {
let _this = this
const companyList = []
const removeItem = {
'length': '100',
'attr': {
'empid': this.linkInfo.userId + ',1',
'userid': item.erp_user,
'sysname': item.sysname,
'companyname': item.companyname
},
'dbName': '',
'start': '1'
}
companyList.push(removeItem)
let data = {
list: companyList
}
getEmployeeOrgQueryList(data).then(rt => {
if (rt.code === 200) {
// this.postDataList = rt.data
if (rt.data.length !== 0 && rt.data.length > 1) {
this.moreSearchShow = true
} else if (rt.data.length === 1) {
this.moreSearchInfo.supplier = rt.data
this.getClienPostData(item,rt.data[0])
} else if (rt.data.length === 0) {
this.moreSearchShow = true
}
} else {
_this.$toast(rt.message)
}
}).catch(e => {
_this.$toast('列表获取失败')
})
},
// 判断客户是否为一个
getClienPostData(consignorModel,clienItem) {
let _this = this
const companyList = []
const removeItem = {
'beforeP': consignorModel.db_source,
'middleP': process.env.appRealDb,
'afterP': [clienItem.org],
'saler': consignorModel.erp_user,
'companyname': consignorModel.companyname,
'companynameId': consignorModel.id
}
companyList.push(removeItem)
let data = {
'customer': _this.keywords,
'list': companyList,
'start': _this.currentPage,
'length': _this.pageSize
}
_this.loading = true
getOrderCustomerSetList(data).then(rt => {
if (rt.code === '1') {
if (rt.data.length !== 0 && rt.data.length > 1) {
this.moreSearchShow = true
} else if (rt.data.length === 1) {
this.moreSearchInfo.client = rt.data
this.moreSearchConfirm(this.moreSearchInfo)
} else if (rt.data.length === 0) {
this.moreSearchShow = true
}
} else {
_this.$toast(rt.msg)
}
}).catch(e => {
_this.$toast('列表获取失败')
})
},
// 跳转发票详情
gotoDetail(model) {
console.log(model)
......@@ -108,12 +228,15 @@ export default {
// 高级搜索查询
moreSearchConfirm(data) {
console.log(data)
this.$refs.invoiceList[0].httpAction(this.moreSearchInfo)
this.invoiceListShow = true
this.moreSearchInfo = JSON.parse(JSON.stringify(data))
console.log(this.$refs.invoiceList)
this.$refs.invoiceList.httpAction(this.moreSearchInfo)
},
// 高级搜索取消
moreSearchClean(data) {
this.moreSearchInfo = data;
this.$refs.invoiceList[0].httpAction(this.moreSearchInfo)
this.moreSearchInfo = JSON.parse(JSON.stringify(data))
this.$refs.invoiceList.httpAction(this.moreSearchInfo)
},
closeAppPage() {
console.log('关闭页面')
......
<template>
<div id="myInvoice">
<my-invoice-list ref="invoiceList" @gotoDetail="gotoDetail"/>
<!-- <high-search v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/> -->
<high-search :more-search-info="moreSearchInfo" v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/>
</div>
</template>
<script>
// import HighSearch from './components/HighSearch.vue'
import HighSearch from '@/views/myOrder/components/HighSearchNewDelete.vue'
import {getFormateDate} from '@/utils/common'
import myInvoiceList from './myInvoiceList.vue'
import invoiecDetail from './invoiecDetail.vue'
import { bridge } from "@/utils";
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
}
},
activated() {
// 设置标题栏关闭返回按钮
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)
},
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: {
// 跳转发票详情
gotoDetail(model) {
console.log(model)
this.$router.push({
path: '/invoiecDetail',
query: model
});
},
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(data)
this.$refs.invoiceList[0].httpAction(this.moreSearchInfo)
},
// 高级搜索取消
moreSearchClean(data) {
this.moreSearchInfo = data;
this.$refs.invoiceList[0].httpAction(this.moreSearchInfo)
},
closeAppPage() {
console.log('关闭页面')
bridge.closeWindow_c()
}
}
}
</script>
<style lang="scss" scoped>
#myInvoice {
height: 100%;
}
</style>
......@@ -41,16 +41,27 @@ export default {
logInfoShow: false,
invoiceList: [],
invoiceItem: {},
// moreSearchInfo: {
// //接收搜索更多回传的数据
// supplier: { comPartyId: "" }, //供应商ID
// goods: { comGoodsId: "" }, //商品ID
// orderNo: "", //订单编号
// time: {
// //起始时间
// start: getFormateDate(new Date(), "yyyy-MM-dd"),
// end: getFormateDate(new Date(), "yyyy-MM-dd"),
// },
// },
moreSearchInfo: {
//接收搜索更多回传的数据
supplier: { comPartyId: "" }, //供应商ID
goods: { comGoodsId: "" }, //商品ID
orderNo: "", //订单编号
supplier: [], // 供应商
consignor: [], // 货主
goods: '', // 商品
client: [], // 客户
orderNo: '',
time: {
//起始时间
start: getFormateDate(new Date(), "yyyy-MM-dd"),
end: getFormateDate(new Date(), "yyyy-MM-dd"),
},
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
end: getFormateDate(new Date(), 'yyyy-MM-dd')
}
},
sphImage: require('@/assets/img/u48.png'),
}
......@@ -167,6 +178,9 @@ export default {
overflow-y: auto;
padding: 10PX;
-webkit-overflow-scrolling: touch;
.list {
min-height: 100%;
}
.invoiceItem{
// height: 145PX;
background-color: white;
......
......@@ -455,7 +455,7 @@ export default {
// 供应商字段拼接
supplierStitching() {
let str = ''
console.log(this.moreSearchInfo)
// console.log(this.moreSearchInfo)
if (this.moreSearchInfo.supplier.length === 1) {
str = this.supplierInfoStitching(this.moreSearchInfo.supplier[0])
} else if (this.moreSearchInfo.supplier.length > 1) {
......
......@@ -143,6 +143,7 @@ export default {
removeItem.cellId = item.id + item.erp_user
return item
},
// 获取供应商
getEmployeeOrgPostData(item) {
let _this = this
const companyList = []
......
......@@ -242,7 +242,7 @@ export default {
let _this = this
const sourceDbList = []
const dataList = []
// console.log(_this.moreSearchInfo)
console.log(_this.moreSearchInfo)
_this.moreSearchInfo.consignor.forEach(item => {
if(sourceDbList.indexOf(item.ownerid) > -1) {
return
......
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