Commit 376bdc92 authored by 1483922988@qq.com's avatar 1483922988@qq.com

6

parent 5a79881f
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item :label="$t('编号')" prop="searchNumber">
<el-input v-model.trim="queryParams.searchNumber" :placeholder="$t('请输入报价单号、订单号')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
......@@ -10,6 +10,14 @@
<el-input v-model.trim="queryParams.searchCustomer" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('联系方式')" prop="relationPhone">
<el-input v-model.trim="queryParams.relationPhone" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery" @input="queryParams.relationPhone = queryParams.relationPhone.replace(/\s+/g, '')" />
</el-form-item>
<el-form-item :label="$t('区号')" prop="relationAreaCode">
<el-input v-model.trim="queryParams.relationAreaCode" :placeholder="$t('请输入客户')" clearable @keyup.enter.native="handleQuery" @input="queryParams.relationAreaCode = queryParams.relationAreaCode.replace(/\s+/g, '')" />
</el-form-item>
<el-form-item :label="$t('创建时间')" prop="orderNo"> <el-date-picker type="datetime" v-model="queryParams.beginCreateTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>{{ $t("") }}<el-date-picker v-model="queryParams.endCreateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> </el-form-item>
<el-form-item :label="$t('始发地')" prop="departureId">
......@@ -17,33 +25,69 @@
<el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的地')" prop="objectiveId">
<el-select v-model="queryParams.objectiveId" :placeholder="$t('请选择目的地')" clearable>
<el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
<div>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select v-model="destCountryId" multiple :label="destCountryId" :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="objectiveId" multiple :placeholder="$t('请选择目的城市')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="destWarehouseId" multiple :placeholder="$t('请选择目的仓')" style="width: 200px" clearable @change="handleQuery">
<el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"></el-option>
</el-select>
</el-form-item>
</div>
<el-form-item :label="$t('客户经理')" prop="salesmanIds">
<user-selector v-model="queryParams.salesmanIds" multiple clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('销售阶段')" prop="statusList">
<dict-selector :type="DICT_TYPE.ECW_OFFER_STATUS" multiple v-model="queryParams.statusList" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('重要程度')" prop="importances">
<el-select v-model="queryParams.importances" multiple :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option v-for="item in [1, 2, 3, 4, 5]" :label="item" :value="item" :key="item"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" multiple formatter="number" clearable />
<el-form-item :label="$t('运输方式')" prop="transportId" v-show="showSearch">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportId" multiple formatter="number" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('出货渠道')" prop="channelIds">
<selector :clearable="true" :options="channelList" :label-field="$l('name')" value-field="channelId" v-model="queryParams.channelIds" multiple @change="handleQuery"></selector>
</el-form-item>
<el-form-item :label="$t('商品')" prop="prodTitle">
<el-form-item :label="$t('商品')" prop="prodTitle" v-show="showSearch">
<el-input v-model.trim="queryParams.prodTitle" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('控货')" prop="control">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.control" clearable />
<el-form-item :label="$t('控货')" prop="control" v-show="showSearch">
<dict-selector :type="DICT_TYPE.INFRA_BOOLEAN_STRING" v-model="queryParams.control" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="followUpSalesmanId">
<user-selector v-model="queryParams.followUpSalesmanId" multiple clearable />
<el-form-item :label="$t('报关方式')" prop="customsType" v-show="showSearch">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('销售阶段')" prop="status" style="width: 600px">
<dict-selector :type="DICT_TYPE.ECW_OFFER_STATUS" multiple v-model="queryParams.status" clearable />
<el-form-item :label="$t('增值服务')" prop="serviceType" v-show="showSearch">
<el-select v-model="queryParams.serviceType" :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option :label="$t('普通订单')" :value="0"></el-option>
<el-option :label="$t('集运服务')" :value="1"></el-option>
<el-option :label="$t('海外仓')" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('报关方式')" prop="customsType">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable />
<el-form-item :label="$t('客户来源')" prop="sourceIds" v-show="showSearch">
<dict-selector :type="DICT_TYPE.CUSTOMER_SOURCE" multiple v-model="queryParams.sourceIds" clearable @change="handleQuery" />
</el-form-item>
<div>
<el-form-item :label="$t('预计结束时间')" prop="orderNo"> <el-date-picker type="datetime" v-model="queryParams.beginStopTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>{{ $t("") }}<el-date-picker type="datetime" v-model="queryParams.endStopTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> </el-form-item>
<el-form-item :label="$t('预计结束时间')" prop="orderNo">
<el-date-picker type="datetime" v-model="queryParams.beginStopTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>{{ $t("") }}
<el-date-picker type="datetime" v-model="queryParams.endStopTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t("搜索") }}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t("重置") }}</el-button>
......@@ -150,12 +194,16 @@
<script>
import { deleteOffer, getOfferPage, exportOfferExcel, cancel, recovery, offerDeptPage, exportDeptOfferExcel } from "@/api/ecw/offer"
import { getChannelList } from "@/api/ecw/channel"
import { getRegionList } from "@/api/ecw/order"
import { getCurrencyList } from "@/api/ecw/currency"
import { getTradeCityList } from "@/api/ecw/region"
import UserSelector from "@/components/UserSelector"
import Selector from "@/components/Selector"
export default {
name: "EcwOfferIndex",
components: {
Selector,
UserSelector
},
data() {
......@@ -172,12 +220,31 @@ export default {
list: [],
// 查询参数
queryParams: {
status: [],
salesmanIds: [],
statusList: [],
importances: [],
channelIds: [],
sourceIds: [],
pageNo: 1,
pageSize: 10
},
currencyList: [],
tradeCityList: [],
channelList: [],
AddressCity: [],
AddressProvince: [],
AddressTown: [],
destCountryId: null,
objectiveId: null,
destWarehouseId: null,
// 选中数组
ids: [],
//目的国
countryList: [],
//目的城市
cityList: [],
//目的仓
destWarehouseList: [],
dept: false // 是否部门订单
}
},
......@@ -221,18 +288,219 @@ export default {
})
this.getList()
getChannelList().then((res) => (this.channelList = res.data))
this.init()
},
watch: {
destCountryId: {
//监听当前地区值的变化,于与上方地区值进行了双向绑定
deep: true, //深度监听
handler() {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = []
this.AddressTown = []
this.objectiveId = ""
this.destWarehouseId = ""
this.findByprovinceCode()
if (this.destCountryId == "") {
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
}
//重新加载目的城市
//目的城市
// getRegionList(4, 4).then(({data}) => {
// this.AddressCity = data;
// })
// .catch(error => {
// console.log(error);
// });
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// })
// .catch(error => {
// console.log(error);
// });
}
},
objectiveId: {
deep: true, //深度监听
handler() {
this.AddressTown = []
this.destWarehouseId = ""
this.findBycityCode()
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId == "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
}
}
},
destWarehouseId: {
deep: true, //深度监听
handler() {
if (this.objectiveId != "" && this.destCountryId != "" && this.destWarehouseId == "") {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
} else if (this.destCountryId != "" && this.objectiveId == "" && this.destWarehouseId == "") {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
}
}
}
},
methods: {
init() {
//加载时发起请求获取所有省份值
getRegionList(1, 1)
.then(({ data }) => {
this.AddressProvince = data
console.log(this.AddressProvince)
})
.catch((error) => {
console.log(error)
})
//目的城市
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
//目的仓
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data
})
.catch((error) => {
console.log(error)
})
},
findByprovinceCode() {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data
})
.catch((error) => {
console.log(error)
})
},
findBycityCode() {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data
// 去重
// let uniqueDataList = data.filter((item, index, self) => {
// // 返回第一个匹配项的索引,用于判断当前项是否为第一个匹配项
// const firstIndex = self.findIndex((obj) => obj.guojia === item.guojia);
// // 如果当前项是第一个匹配项,则保留,否则过滤掉
// return index === firstIndex;
// });
// this.AddressProvince = uniqueDataList
})
.catch((error) => {
console.log(error)
})
},
/** 查询列表 */
getList() {
this.loading = true
let func = this.dept ? offerDeptPage : getOfferPage
let obj = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
obj.destCountryIds = this.destCountryId
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
obj.objectiveIds = this.objectiveId
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
obj.destWarehouseIds = this.destWarehouseId
}
// 执行查询
func({
...this.queryParams,
status: this.queryParams.status.join(","),
followUpSalesmanId: this.queryParams.followUpSalesmanId.join(","),
transportId: this.queryParams.transportId.join(",")
...obj
}).then((response) => {
this.list = response.data.list
this.total = response.data.total
......
......@@ -317,7 +317,6 @@ export default {
specialProducts: [],
// priceStepList: [{},{}], // 阶梯价格
// specialList:[], // 特殊需求,默认四个
rules() {},
product: null,
/* productType: null, */
currencyList: [],
......
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