Commit 763ca4b6 authored by xiejb's avatar xiejb

高级搜索 商品 客户 切换erp接口

parent b65ba724
......@@ -8,7 +8,7 @@ export function getCustomerList(params) {
loading: true
})
}
// 获取商品列表
// 获取采购商品列表
export function getCgGoodsList(params) {
return fetch({
url: '/purchaseCommon/queryAllGoods',
......@@ -17,6 +17,15 @@ export function getCgGoodsList(params) {
loading: true
})
}
// 获取商品列表
export function getGoodsList(params) {
return fetch({
url: '/product/queryGoods_PS',
method: 'post',
data: params,
loading: true
})
}
// 获取供应商列表
export function getCgSupplyList(params) {
return fetch({
......
......@@ -50,13 +50,13 @@
</template>
<script>
import {getCgSupplyList} from '@/api/common'
import {getCustomerList} from '../api/common'
import {getResListNum} from '../utils/common'
import SearchResult from './SearchResult'
import { Dialog } from 'vant'
export default {
name: 'SearchInSupplier',
name: 'SearchInClient',
components: {SearchResult},
data() {
return {
......@@ -176,26 +176,23 @@ export default {
getPostData() {
let _this = this
let data = {
'dbSource':this.linkInfo.sysDbSource,
'pageNum': _this.currentPage,
'pageSize': _this.pageSize,
'erpUserId':this.linkInfo.sysUserId,
'invOwner':this.linkInfo.sysOrgId,
'goodsId':_this.chinfo.goodsId,
'supply':_this.keywords
'customer':_this.keywords,
'dbName': this.linkInfo.sysDbSource + '-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
'saler': this.linkInfo.sysUserId,
'start': _this.currentPage,
'length': _this.pageSize
}
getCgSupplyList(data).then(rt => {
if (rt.code === '00000') {
getCustomerList(data).then(rt => {
if (rt.code === '1') {
if (_this.currentPage === 1) {
_this.searchNum = rt.entity.total + ''
_this.searchNum = getResListNum(rt.msg)
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)
// 重置刷新提示
......@@ -203,14 +200,14 @@ export default {
// 重置加载更多提示
_this.loading = false
// 若当前加载的页数没有满足每页的数量代表完全加载
if (rt.entity.supplyList.length < 10) {
if (rt.data.length < 10) {
_this.finished = true
} else {
// 加载成功后下一页自增1
_this.currentPage++
}
} else {
_this.$toast(rt.message)
_this.$toast(rt.msg)
// _this.$toast('列表获取失败')
_this.isRefreshing = false
_this.error = true
......@@ -226,39 +223,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 !== '') {
......
......@@ -43,7 +43,7 @@
<van-cell :title="titleInitial(item)" clickable @click="itemClick(item,index)" v-for="(item,index) in postDataList"
:key="index">
<template #right-icon>
<van-checkbox :name="item.comPartyId" />
<van-checkbox :name="item.comGoodsId" />
</template>
</van-cell>
</van-cell-group>
......@@ -60,7 +60,7 @@
</template>
<script>
import {getCgSupplyList} from '@/api/common'
import {getGoodsList} from '@/api/common'
import {getResListNum} from '../utils/common'
import SearchResult from './SearchResult'
import { Dialog } from 'vant'
......@@ -119,7 +119,7 @@ export default {
// this.checked = !this.customer.comPartyId ? '' : this.customer.comPartyId
// console.log(this.checked)
this.customer.forEach((res)=>{
this.checkedList.push(res.comPartyId)
this.checkedList.push(res.comGoodsId)
})
this.currentPage = 1
this.onRefresh()
......@@ -135,7 +135,7 @@ export default {
methods: {
/// 标题拼接 <!-- 药厂码/SAP码)名称 -->
titleInitial(model) {
let titleStr = model.comPartyId + '/(' + model.partyOpcode + ')/' + model.partyName
let titleStr = model.comGoodsId + '/(' + model.goodsOpcode + ')' + model.goodsName + '/' + model.goodsDesc + '/' + model.partyName + '/' + model.packageNum + '/' + model.unitName
return titleStr
},
onSearch () {
......@@ -176,11 +176,11 @@ export default {
itemClick(item, index) {
// this.checked = item.comPartyId
// this.choosedPost = item
if(this.checkedList.indexOf(item.comPartyId) > -1) {
this.choosedPost.splice(this.checkedList.indexOf(item.comPartyId),1)
this.checkedList.splice(this.checkedList.indexOf(item.comPartyId),1)
if(this.checkedList.indexOf(item.comGoodsId) > -1) {
this.choosedPost.splice(this.checkedList.indexOf(item.comGoodsId),1)
this.checkedList.splice(this.checkedList.indexOf(item.comGoodsId),1)
} else {
this.checkedList.push(item.comPartyId)
this.checkedList.push(item.comGoodsId)
this.choosedPost.push(item)
}
},
......@@ -199,26 +199,24 @@ export default {
getPostData() {
let _this = this
let data = {
'dbSource':this.linkInfo.sysDbSource,
'pageNum': _this.currentPage,
'pageSize': _this.pageSize,
'erpUserId':this.linkInfo.sysUserId,
'invOwner':this.linkInfo.sysOrgId,
'goodsId':_this.chinfo.goodsId,
'supply':_this.keywords
'goods': _this.keywords,
'dbName': this.linkInfo.sysDbSource + '-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
'saler': this.linkInfo.sysUserId,
'start': _this.currentPage,
'length': _this.pageSize
}
getCgSupplyList(data).then(rt => {
getGoodsList(data).then(rt => {
if (rt.code === '00000') {
if (rt.code === '1') {
if (_this.currentPage === 1) {
_this.searchNum = rt.entity.total + ''
_this.searchNum = getResListNum(rt.msg)
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)
// 重置刷新提示
......@@ -226,7 +224,7 @@ export default {
// 重置加载更多提示
_this.loading = false
// 若当前加载的页数没有满足每页的数量代表完全加载
if (rt.entity.supplyList.length < 10) {
if (rt.data.length < 10) {
_this.finished = true
} else {
// 加载成功后下一页自增1
......@@ -249,39 +247,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 !== '') {
......
......@@ -85,12 +85,12 @@
@cancleclick="showPost"
@confirmclick="postConfirm"
></search-in-consignor>
<cg-search-goods
<search-goods
v-model="moreSearchDialog.goodsShow"
:customer="!moreSearchInfo.goods ? {}:moreSearchInfo.goods"
@cancleclick="showPost"
@confirmclick="postConfirm"
></cg-search-goods>
></search-goods>
<search-in-client
v-model="moreSearchDialog.clientShow"
:customer="!moreSearchInfo.client ? {}:moreSearchInfo.client"
......@@ -109,7 +109,7 @@ import SearchInSupplier from "@/components/SearchInSupplier";
// 货主
import SearchInConsignor from "@/components/SearchInConsignor";
// 商品
import CgSearchGoods from "@/components/CgSearchGoods";
import SearchGoods from "@/components/SearchGoods";
// 客户
import SearchInClient from "@/components/SearchInClient"
export default {
......@@ -117,7 +117,7 @@ export default {
components: {
TimeChoose,
SearchInSupplier,
CgSearchGoods,
SearchGoods,
SearchInConsignor,
SearchInClient
},
......@@ -287,7 +287,7 @@ export default {
},
// 商品信息拼接
consignorInfoStitching(model) {
return model.comPartyId + '/(' + model.partyOpcode + ')/' + model.partyName
return model.comGoodsId + '/(' + model.goodsOpcode + ')' + model.goodsName + '/' + model.goodsDesc + '/' + model.partyName + '/' + model.packageNum + '/' + model.unitName
}
}
}
......
......@@ -92,16 +92,16 @@ export default {
orderTypeColor (model) {
if (model.orderStatusCode === '100') {
// 待发货
return '#53BE00'
return '#06BF06'
} else if (model.orderStatusCode === '220') {
// 待收货
return '#E6C500'
return '#FFC861'
} else if (model.orderStatusCode === '400') {
// 已签收
return '#4b7902'
return '#929292'
} else if (model.orderStatusCode === '110') {
// 已取消
return '#D9001B'
return '#C17300'
}
},
onRefresh() {
......
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