Commit 2d0e97fd authored by xiejb's avatar xiejb

更换货主接口 高级搜索折叠效果

parent 70cdd80d
...@@ -76,9 +76,17 @@ export function getGoodsSetList(params) { ...@@ -76,9 +76,17 @@ export function getGoodsSetList(params) {
} }
// ====================高级搜索==================== // ====================高级搜索====================
// 获取货主列表 // 获取货主列表
// export function getConsignorSetList(params) {
// return fetch({
// url: '/RoleCompanyName/EmployeeOrgQuery',
// method: 'post',
// data: params,
// loading: true
// })
// }
export function getConsignorSetList(params) { export function getConsignorSetList(params) {
return fetch({ return fetch({
url: '/RoleCompanyName/EmployeeOrgQuery', url: '/CompanyOrderLife/EmployeeOrgQuery',
method: 'post', method: 'post',
data: params, data: params,
loading: true loading: true
......
...@@ -160,7 +160,17 @@ export default { ...@@ -160,7 +160,17 @@ export default {
}, },
/// 标题拼接 <!-- 药厂码/SAP码)名称 --> /// 标题拼接 <!-- 药厂码/SAP码)名称 -->
titleInitial(model) { titleInitial(model) {
return model.companyname + '/(' + model.erp_user + ')' let str = ''
if (this.isJudgeStrNull(model.companyname)) {
str = model.companyname
}
if (this.isJudgeStrNull(model.erp_user)) {
str = str + '/('+ model.erp_user + ')'
}
if (this.isJudgeStrNull(model.partyOpcode)) {
str = str + '/' + model.partyOpcode
}
return str
}, },
onSearch () { onSearch () {
// if (!this.isJudgeStrNull(this.keywords)) { // if (!this.isJudgeStrNull(this.keywords)) {
...@@ -287,13 +297,6 @@ export default { ...@@ -287,13 +297,6 @@ export default {
_this.finished = true _this.finished = true
}) })
}, },
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
return true
}
return false
},
postDataListAction(httpList) { postDataListAction(httpList) {
const array = [] const array = []
httpList.forEach(item => { httpList.forEach(item => {
...@@ -302,6 +305,13 @@ export default { ...@@ -302,6 +305,13 @@ export default {
array.push(removeItem) array.push(removeItem)
}) })
return httpList return httpList
},
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
return true
}
return false
} }
} }
} }
......
...@@ -13,27 +13,7 @@ ...@@ -13,27 +13,7 @@
</van-row> </van-row>
<time-choose :startTime="moreSearchInfo.time.start" :endTime="moreSearchInfo.time.end" @confirm="timeConfirm"></time-choose> <time-choose :startTime="moreSearchInfo.time.start" :endTime="moreSearchInfo.time.end" @confirm="timeConfirm"></time-choose>
<div class="high-info-list"> <div class="high-info-list">
<!-- <div class="high-info" @click="showPost('consignor')"> -->
<!-- <van-collapse v-model="consignorNames">
<van-collapse-item name="1">
<template #title>
<div class="title font-bold font-16"><span style="color: red;">* </span>货主</div>
</template>
<div v-if="moreSearchInfo.consignor.length === 0 " @click="showPost('consignor')"
style="background-color: #EFF5F9;" contenteditable="false" placeholder="请选择货主" class="inputInfo">
{{consignor}}</div>
<div v-for="(item,index) in moreSearchInfo.consignor" :key="index" @click="showPost('consignor')"
style="background-color: #EFF5F9;" contenteditable="false" placeholder="请选择货主" class="inputInfo">
{{consignorInfoStitching(item)}}</div>
</van-collapse-item>
</van-collapse> -->
<!-- <div class="high-info" @click="showPost('consignor')">
<div class="title font-bold font-16"><span style="color: red;">* </span>货主</div>
<div style="background-color: #EFF5F9;" contenteditable="false" placeholder="请选择货主" class="inputInfo">{{consignor}}</div>
</div> -->
<div class="high-info"> <div class="high-info">
<!-- <div class="title font-bold font-16"><span style="color: red;">* </span>货主</div> -->
<!-- <div style="background-color: #EFF5F9;" contenteditable="false" placeholder="请选择货主" class="inputInfo">{{consignor}}</div> -->
<van-collapse v-model="consignorNames"> <van-collapse v-model="consignorNames">
<van-collapse-item name="1"> <van-collapse-item name="1">
<template #title> <template #title>
...@@ -387,7 +367,18 @@ export default { ...@@ -387,7 +367,18 @@ export default {
}, },
// 货主信息拼接 // 货主信息拼接
consignorInfoStitching(model) { consignorInfoStitching(model) {
return model.companyname + '/(' + model.erp_user + ')' // return model.companyname + '/(' + model.erp_user + ')'
let str = ''
if (this.isJudgeStrNull(model.companyname)) {
str = model.companyname
}
if (this.isJudgeStrNull(model.erp_user)) {
str = str + '/('+ model.erp_user + ')'
}
if (this.isJudgeStrNull(model.partyOpcode)) {
str = str + '/' + model.partyOpcode
}
return str
}, },
// 供应商字段拼接 // 供应商字段拼接
supplierStitching() { supplierStitching() {
...@@ -492,39 +483,6 @@ export default { ...@@ -492,39 +483,6 @@ export default {
}, },
// 获取当月的开始与结束日期 // 获取当月的开始与结束日期
getCurrentMonth () { getCurrentMonth () {
// 起止日期数组
// var startStop = []
// 获取当前时间
// var currentDate = new Date()
// // 获得当前月份0-11
// var currentMonth = currentDate.getMonth()
// // 获得当前年份4位年
// var currentYear = currentDate.getFullYear()
// // 求出本月第一天
// var firstDay = new Date(currentYear, currentMonth, 1)
// // 当为12月的时候年份需要加1
// // 月份需要更新为0 也就是下一年的第一个月
// if (currentMonth == 11) {
// currentYear++
// currentMonth = 0 // 就为
// } else {
// // 否则只是月份增加,以便求的下一月的第一天
// currentMonth++
// }
// // 一天的毫秒数
// var millisecond = 1000 * 60 * 60 * 24
// // 下月的第一天
// var nextMonthDayOne = new Date(currentYear, currentMonth, 1)
// // 求出上月的最后一天
// // var lastDay = new Date(nextMonthDayOne.getTime() - millisecond)
// var lastDay = new Date()
// // 添加至数组中返回
// // startStop.push(firstDay)
// // startStop.push(lastDay)
// this.moreSearchInfo.time.start = getFormateDate(firstDay, 'yyyy-MM-dd')
// this.moreSearchInfo.time.end = getFormateDate(lastDay, 'yyyy-MM-dd')
this.moreSearchInfo.time.start = this.getDay(getFormateDate(new Date(), 'yyyy-MM-dd'), -30) this.moreSearchInfo.time.start = this.getDay(getFormateDate(new Date(), 'yyyy-MM-dd'), -30)
this.moreSearchInfo.time.end = getFormateDate(new Date(), 'yyyy-MM-dd') this.moreSearchInfo.time.end = getFormateDate(new Date(), 'yyyy-MM-dd')
// 返回 // 返回
...@@ -532,18 +490,6 @@ export default { ...@@ -532,18 +490,6 @@ export default {
}, },
// 获得当前星期的开始与结束日期 // 获得当前星期的开始与结束日期
getCurrentWeek () { getCurrentWeek () {
// 获取当前时间
// var currentDate = new Date()
// // 返回date是一周中的某一天
// var week = currentDate.getDay()
// // 一天的毫秒数
// var millisecond = 1000 * 60 * 60 * 24
// // 减去的天数
// var minusDay = week != 0 ? week - 1 : 6
// // alert(minusDay);
// // 本周 周一
// var monday = new Date(currentDate.getTime() - (minusDay * millisecond))
var sunday = new Date() var sunday = new Date()
this.moreSearchInfo.time.start = this.getDay(getFormateDate(sunday, 'yyyy-MM-dd'), -7) this.moreSearchInfo.time.start = this.getDay(getFormateDate(sunday, 'yyyy-MM-dd'), -7)
this.moreSearchInfo.time.end = getFormateDate(sunday, 'yyyy-MM-dd') this.moreSearchInfo.time.end = getFormateDate(sunday, 'yyyy-MM-dd')
...@@ -590,6 +536,13 @@ export default { ...@@ -590,6 +536,13 @@ export default {
}   }  
return m; return m;
}, },
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
return true
}
return false
}
} }
} }
</script> </script>
......
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