Commit fcdea7fd authored by xiejb's avatar xiejb

高级搜索 供应商接口

parent 8daf1cdc
......@@ -74,6 +74,7 @@ export function getGoodsSetList(params) {
loading: true
})
}
// ====================高级搜索====================
// 获取货主列表
export function getConsignorSetList(params) {
return fetch({
......@@ -83,3 +84,12 @@ export function getConsignorSetList(params) {
loading: true
})
}
// 获取供应商
export function getEmployeeOrgQueryList(params) {
return fetch({
url: '/CompanyOrderLife/checkCompanyNum',
method: 'post',
data: params,
loading: true
})
}
\ No newline at end of file
......@@ -84,9 +84,10 @@ export default {
type: Boolean,
default: false
},
customer: {
type: Object,
default: () => {}
// 货主
consignor: {
type: Array,
default: () => []
}
},
watch: {
......@@ -166,10 +167,17 @@ export default {
},
getPostData() {
let _this = this
// let data = {
// 'goods': _this.keywords,
// 'dbName': this.linkInfo.sysDbSource + '-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
// 'saler': this.linkInfo.sysUserId,
// 'start': _this.currentPage,
// 'length': _this.pageSize
// }
let data = {
'goods': _this.keywords,
'dbName': this.linkInfo.sysDbSource + '-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
'saler': this.linkInfo.sysUserId,
'dbName': 'erp_test_shaphar-app_test_shaphar-200',
'saler': '22998',
'start': _this.currentPage,
'length': _this.pageSize
}
......
......@@ -88,6 +88,11 @@ export default {
type: Object,
default: () => {}
},
// 货主
consignor: {
type: Array,
default: () => []
},
chinfo: {
type: Object,
default: ()=> {
......@@ -175,10 +180,17 @@ export default {
},
getPostData() {
let _this = this
// let data = {
// 'customer':_this.keywords,
// 'dbName': this.linkInfo.sysDbSource + '-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
// 'saler': this.linkInfo.sysUserId,
// 'start': _this.currentPage,
// 'length': _this.pageSize
// }
let data = {
'customer':_this.keywords,
'dbName': this.linkInfo.sysDbSource + '-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
'saler': this.linkInfo.sysUserId,
'dbName': 'erp_test_shaphar-app_test_shaphar-508',
'saler': '23528',
'start': _this.currentPage,
'length': _this.pageSize
}
......
......@@ -199,15 +199,15 @@ export default {
getPostData() {
let _this = this
let data = {
'attr': {
'empid': '199476'
},
'filters': [],
'logic': 'or',
'sort': 'desc',
'orderby': 'createon',
'pageNum': _this.currentPage,
'pageSize': _this.pageSize
'attr': {
'empid': this.linkInfo.userId
},
'filters': [],
'logic': 'or',
'sort': 'desc',
'orderby': 'createon',
'pageNum': _this.currentPage,
'pageSize': _this.pageSize
}
getConsignorSetList(data).then(rt => {
if (rt.code === 200) {
......
......@@ -33,7 +33,7 @@
<van-cell :title="titleInitial(item)" clickable @click="itemClick(item,index)" v-for="(item,index) in postDataList"
:key="index">
<template #right-icon>
<van-radio :name="item.comPartyId" />
<van-radio :name="item.org" />
</template>
</van-cell>
</van-cell-group>
......@@ -50,7 +50,7 @@
</template>
<script>
import {getCgSupplyList} from '@/api/common'
import {getEmployeeOrgQueryList} from '@/api/common'
import {getResListNum} from '../utils/common'
import SearchResult from './SearchResult'
import { Dialog } from 'vant'
......@@ -100,8 +100,9 @@ export default {
if (val) {
this.postDataList = []
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
this.checked = !this.customer.comPartyId ? '' : this.customer.comPartyId
this.checked = !this.customer.org ? '' : this.customer.org
console.log(this.checked)
console.log(this.consignor)
this.currentPage = 1
this.onLoad()
}
......@@ -116,8 +117,8 @@ export default {
methods: {
/// 标题拼接 <!-- 药厂码/SAP码)名称 -->
titleInitial(model) {
let titleStr = model.comPartyId + '/(' + model.partyOpcode + ')/' + model.partyName
return titleStr
// let titleStr = model.org + '/(' + model.partyOpcode + ')/' + model.partyName
return model.partyName
},
onSearch () {
// if (!this.isJudgeStrNull(this.keywords)) {
......@@ -139,7 +140,7 @@ export default {
this.$emit('cancleclick')
},
onConfirmClick() {
if (!this.choosedPost.comPartyId) {
if (!this.choosedPost.org) {
Dialog.alert({
title: '温馨提示',
message: '请选择选项!'
......@@ -154,7 +155,7 @@ export default {
})
},
itemClick(item, index) {
this.checked = item.comPartyId
this.checked = item.org
this.choosedPost = item
},
onRefresh() {
......@@ -171,29 +172,48 @@ export default {
},
getPostData() {
let _this = this
const companyList = []
_this.consignor.forEach(item => {
const removeItem = {
'length': '100',
'attr': {
'empid': this.linkInfo.userId + ',1',
'userid': '23528',
'sysname': item.sysname,
'companyname': item.companyname
},
'dbName': '',
'start': '1'
}
companyList.push(removeItem)
})
console.log(companyList)
let data = {
// 'dbSource':this.linkInfo.sysDbSource,
'dbSource':'erp_test_shaphar',
'pageNum': _this.currentPage,
'pageSize': _this.pageSize,
// 'erpUserId':this.linkInfo.sysUserId,
'erpUserId': '23528',
'invOwner':'200',
'goodsId':'',
'supply':_this.keywords
'list': [
{
'length': '100',
'attr': {
'empid': '199476,1',
'userid': '23528',
'sysname': 'ERP',
'companyname': '上药控股有限公司'
},
'dbName': '',
'start': '1'
}
]
}
getCgSupplyList(data).then(rt => {
if (rt.code === '00000') {
getEmployeeOrgQueryList(data).then(rt => {
if (rt.code === 200) {
if (_this.currentPage === 1) {
_this.searchNum = rt.entity.total + ''
// _this.searchNum = rt.entity.total + ''
this.postDataList = []
}
if (this.isRefreshing) {
this.postDataList = rt.entity.supplyList
this.postDataList = rt.data
}
else if (!!rt.entity.supplyList || rt.entity.supplyList.length > 0) {
this.postDataList = this.postDataList.concat(rt.entity.supplyList)
else if (!!rt.data || rt.data.length > 0) {
this.postDataList = this.postDataList.concat(rt.data)
}
// _this.postDataListSetAction(rt.data)
// 重置刷新提示
......@@ -201,12 +221,12 @@ export default {
// 重置加载更多提示
_this.loading = false
// 若当前加载的页数没有满足每页的数量代表完全加载
if (rt.entity.supplyList.length < 10) {
// if (rt.data.length < 10) {
_this.finished = true
} else {
// } else {
// 加载成功后下一页自增1
_this.currentPage++
}
// }
} else {
_this.$toast(rt.message)
// _this.$toast('列表获取失败')
......@@ -224,39 +244,6 @@ export default {
_this.finished = true
})
},
// 数据处理
postDataListSetAction(array) {
array.forEach((res)=>{
this.postDataList.push({
assigneeFactoryId: res.assigneeFactoryId,
catagory: res.catagory,
comGoodsFormId: res.comGoodsFormId,
comGoodsId: res.comGoodsId,
comGoodsVarietyId: res.comGoodsVarietyId,
comUnitId: res.comUnitId,
defaultExpireDate: res.defaultExpireDate,
factoryId: res.factoryId,
goodsDesc: res.goodsDesc,
goodsName: res.goodsName,
goodsOpcode: res.goodsOpcode,
goodsSpell: res.goodsSpell,
goodsStatus: res.goodsStatus,
midPacknum: res.midPacknum,
packageNum: res.packageNum,
partyName: res.partyName,
partyName1: res.partyName1,
partyOpcode: res.partyOpcode,
productLocation: res.productLocation,
unitName: res.unitName,
goodsForm: res.goodsForm,
partyOpcode1: res.partyOpcode1,
priceCode: res.priceCode,
retailPrice: res.retailPrice,
taxRate: res.taxRate,
varietyName: res.varietyName,
})
})
},
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
......
......@@ -96,6 +96,7 @@
<search-goods
v-model="moreSearchDialog.goodsShow"
:customer="!moreSearchInfo.goods ? {}:moreSearchInfo.goods"
:consignor="moreSearchInfo.consignor"
@cancleclick="showPost"
@confirmclick="postConfirm"
></search-goods>
......@@ -103,6 +104,7 @@
<search-in-client
v-model="moreSearchDialog.clientShow"
:customer="!moreSearchInfo.client ? {}:moreSearchInfo.client"
:consignor="moreSearchInfo.consignor"
:chinfo="chinfo"
@cancleclick="showPost"
@confirmclick="postConfirm"
......@@ -140,17 +142,6 @@ export default {
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: ''
......@@ -182,8 +173,8 @@ export default {
computed: {
// 供应商
supplier () {
if (this.moreSearchInfo.supplier.comPartyId) {
return !this.moreSearchInfo.supplier ? '' : (this.moreSearchInfo.supplier.comPartyId + '/(' + this.moreSearchInfo.supplier.partyOpcode + ')' + this.moreSearchInfo.supplier.partyName)
if (this.moreSearchInfo.supplier.org) {
return !this.moreSearchInfo.supplier ? '' : this.moreSearchInfo.supplier.partyName
} else {
return ''
}
......@@ -241,6 +232,22 @@ export default {
choosetime: {
type: Object,
default: () => {}
},
moreSearchInfo: {
type: Object,
default: () => {
return {
supplier: '', // 供应商
consignor: [], // 货主
goods: '', // 商品
client: '', // 客户
orderNo: '', // 订单号
time: {
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
end: getFormateDate(new Date(), 'yyyy-MM-dd')
}
}
}
}
},
watch: {
......
......@@ -25,7 +25,7 @@
<my-order-list :more-search-info="moreSearchInfo" :ref="item.name" :orderTypeCode="item.orderTypeCode" :activeTab="activeTab" @orderItemAction="orderItemAction"/>
</van-tab>
</van-tabs>
<high-search v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/>
<high-search :more-search-info="moreSearchInfo" v-model="moreSearchShow" @onsearch="moreSearchConfirm" @onclean="moreSearchClean"/>
</div>
</template>
......
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