Commit 42eddb45 authored by xiejb's avatar xiejb

货主和供应商如果只有一个的逻辑

parent fee9320e
......@@ -106,7 +106,7 @@ export default {
this.postDataList = []
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
this.checked = !this.customer.comGoodsId ? '' : this.customer.comGoodsId
console.log(this.checked)
// console.log(this.checked)
this.currentPage = 1
this.onLoad()
}
......
......@@ -115,7 +115,7 @@ export default {
this.postDataList = []
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
this.checked = !this.customer.comPartyId ? '' : this.customer.comPartyId
console.log(this.checked)
// console.log(this.checked)
this.currentPage = 1
this.onLoad()
}
......
......@@ -185,7 +185,6 @@ export default {
}
companyList.push(removeItem)
})
console.log(companyList)
let data = {
'list': [
{
......
......@@ -175,7 +175,7 @@ export default {
computed: {
// 供应商
supplier () {
if (this.moreSearchInfo.supplier.org) {
if (this.moreSearchInfo.supplier) {
return !this.moreSearchInfo.supplier ? '' : this.moreSearchInfo.supplier.partyName
} else {
return ''
......@@ -360,7 +360,7 @@ export default {
},
// 商品信息拼接
consignorInfoStitching(model) {
return model.companyname
return model.companyname + '/(' + model.erp_userid[0] + ')'
// return model.comGoodsId + '/(' + model.goodsOpcode + ')' + model.goodsName + '/' + model.goodsDesc + '/' + model.partyName + '/' + model.packageNum + '/' + model.unitName
},
onQuickDateChoose(index, tag) {
......
......@@ -32,6 +32,7 @@
<script>
import myOrderList from './myOrderList.vue'
import HighSearch from './components/HighSearch.vue'
import {getEmployeeOrgQueryList, getConsignorSetList} from '@/api/common'
import {getFormateDate} from '@/utils/common'
import { bridge } from "@/utils";
const allTabsTitle = [
......@@ -96,12 +97,96 @@ export default {
window.removeEventListener('popstate', this.onBrowserBack, false)
},
mounted() {
this.moreSearchShow = true
// this.moreSearchShow = true
this.getConsignorPostData()
// this.tabsTitleData()
},
destroyed() {
},
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.list.length !== 1) {
this.moreSearchShow = true
} else if (rt.data.list.length === 1) {
this.moreSearchInfo.consignor.push(rt.data.list[0])
this.getEmployeeOrgPostData(rt.data.list[0])
} else if (rt.data.list.length === 0) {
_this.$toast('暂无货主!')
}
} else {
_this.$toast(rt.message)
}
}).catch(e => {
_this.$toast('列表获取失败')
})
},
getEmployeeOrgPostData(item) {
let _this = this
const companyList = []
const removeItem = {
'length': '100',
'attr': {
'empid': this.linkInfo.userId + ',1',
'userid': item.erp_userid[0],
'sysname': item.sysname,
'companyname': item.companyname
},
'dbName': '',
'start': '1'
}
companyList.push(removeItem)
// let data = {
// list: companyList
// }
let data = {
'list': [
{
'length': '1',
'attr': {
'empid': '199476,1',
'userid': '23528',
'sysname': 'ERP',
'companyname': '上药控股有限公司'
},
'dbName': '',
'start': '1'
}
]
}
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[0]
} else if (rt.data.length === 0) {
this.moreSearchShow = true
}
} else {
_this.$toast(rt.message)
}
}).catch(e => {
_this.$toast('列表获取失败')
})
},
// 单个发票点击事件
orderItemAction(model) {
console.log(model)
......
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