Commit 919c7174 authored by yujinyao's avatar yujinyao

客户详情订单tag优化

parent 7c7c739a
......@@ -88,24 +88,33 @@
range-separator="-"
:start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('目的国')">
<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 countryList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
>
</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('目的地')">
<el-select v-model="destCityId" clearable @change="handleQuery">
<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"
......@@ -114,8 +123,16 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')">
<el-select v-model="destWarehouseId" clearable @change="handleQuery">
<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"
......@@ -132,6 +149,15 @@
</el-form-item>
</el-form>
</div>
<el-descriptions :column="2">
<el-descriptions-item :label="$t('海空联运/海运拼柜/海运整柜/专线空运')">{{orderStatisticsObj.hklyTotal || 0}}/{{orderStatisticsObj.hypgTotal || 0 }}/{{orderStatisticsObj.hyzgTotal || 0}}/{{orderStatisticsObj.zxkyTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易日期')">{{orderStatisticsObj.lastBusinessDate}}</el-descriptions-item>
<el-descriptions-item :label="$t('全部订单/控货订单')">{{orderStatisticsObj.allOrderTotal || 0}}/{{orderStatisticsObj.controlOrderTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易单号')">{{orderStatisticsObj.lastBusinessOrderNo}}</el-descriptions-item>
<el-descriptions-item :label="$t('报价/下单/入仓')">{{orderStatisticsObj.offerOrderTotal || 0}}/{{orderStatisticsObj.pickOrderTotal || 0}}/{{orderStatisticsObj.wareHousingTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('储存量')">{{orderStatisticsObj.stock || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('已出货订单')">{{orderStatisticsObj.shipmentTotal || 0}}</el-descriptions-item>
</el-descriptions>
<el-table :data="orderList">
<el-table-column :label="$t('订单编号')" width="120px" align="center" prop="orderNo" >
<template slot-scope="scope">
......@@ -202,7 +228,7 @@
</el-table-column>
<el-table-column :label="$t('客户经理')" align="center" prop="customerName" />
<el-table-column :label="$t('业绩归属客户方')" align="center" prop="customerName" />
</el-table>
</el-table>
<pagination @pagination="getorderList" :page.sync="queryParams.page" :limit.sync="queryParams.rows" :total="orderTotal" ></pagination>
</el-card>
</el-tab-pane>
......@@ -210,24 +236,33 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form :inline="true" size="small">
<el-form-item :label="$t('目的国')">
<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 countryList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
>
</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('目的地')">
<el-select v-model="destCityId" clearable @change="handleQuery">
<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"
......@@ -236,8 +271,16 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')">
<el-select v-model="destWarehouseId" clearable @change="handleQuery">
<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"
......@@ -249,7 +292,7 @@
<el-form-item>
<el-button type="primary" @click="getInfoListOfferPage">{{$t('搜索')}}</el-button>
<el-button type="primary" @click="()=>{
queryParams = { rows:10,page:1}; getInfoListOfferPage();rucangtime = [];
infoListOfferFrom = { pageNo:1,pageSize:10}; getInfoListOfferPage();rucangtime = [];
}">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
......@@ -349,6 +392,33 @@
:label="$t('创建时间')"
>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width" v-if="false">
<template slot-scope="scope">
<!--
0 取消 恢复
1 特价审批 编辑、跟进、 取消 删除
2 草稿 编辑、 删除
3 需求确认 编辑、跟进、结果、特价、取消 删除
4 赢单 删除
5 输单 删除
6 完成 删除
7 跟进中 编辑、跟进、结果、特价、取消、 删除
-->
<el-dropdown>
<el-button icon="el-icon-plus" circle type="primary"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="$router.push('/offer/detail?offerId=' + scope.row.offerId)" v-hasPermi="['ecw:offer:show']">{{$t('详情')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/edit?id=' + scope.row.offerId)" v-if="[1,2,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{$t('编辑')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/logList?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:loglist']">{{$t('跟进')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push(`/offer/result?offerId=${scope.row.offerId}&number=${scope.row.number}`)" v-if="[3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:result']">{{$t('结果')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/special?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:discount','ecw:offer:commission']">{{$t('特价')}}</el-dropdown-item>
<el-dropdown-item @click.native="cancel(scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:cancel']">{{$t('取消')}}</el-dropdown-item>
<el-dropdown-item @click.native="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">{{$t('恢复')}}</el-dropdown-item>
<el-dropdown-item @click.native="deleteOffer(scope.row.offerId)" v-if="[0,1,2,3,4,5,6,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:delete']">{{$t('删除')}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination>
</el-card>
......@@ -713,6 +783,7 @@ import {checkPermi} from "@/utils/permission";
import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue";
import { getListTree } from "@/api/ecw/region";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer";
export default {
name: 'query',
components: {
......@@ -759,30 +830,27 @@ export default {
// this.creditLogPage()//等级日志
this.getorderList()//订单
// this.getInfoListOfferPage()//报价
// this.getOrderStatistics()//数据
this.getOrderStatistics()//数据
// this.creditScoreStatisticFn() //信用日志
// this.infoListReceiptFn()//账单
this.getData();
//获取城市列表
this.getCountryList();
this.getWarehouseList()
},
watch:{
activeName(val){
switch (val) {
case 'order':
this.destCountryId = ''
this.destCityId = ''
this.destWarehouseId = ''
this.queryParams = { rows:10, page:1}
this.destCountryId = null
this.destWarehouseId = null
this.objectiveId = null
this.queryParams.page = 1
this.getorderList()//订单
break
case 'quote':
this.destCountryId = ''
this.destCityId = ''
this.destWarehouseId = ''
this.queryParams = { rows:10, page:1}
this.destCountryId = null
this.destWarehouseId = null
this.objectiveId = null
this.infoListOfferFrom.pageNo = 1
this.getInfoListOfferPage()//报价
break
case 'bill':
......@@ -805,7 +873,6 @@ export default {
}
},
destCountryId: {
//监听当前地区值的变化,于与上方地区值进行了双向绑定
deep: true, //深度监听
......@@ -813,11 +880,10 @@ export default {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = [];
this.AddressTown = [];
this.objectiveId = "";
this.destWarehouseId = "";
this.destCityId = "";
this.findByprovinceCode();
if (this.destCountryId == "") {
//1 是所有区域,2 国家,3是市,
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data;
......@@ -835,7 +901,7 @@ export default {
});
} else if (
this.destCountryId != "" &&
this.destCityId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
/*getRegionList(2, this.destCountryId)
......@@ -853,21 +919,38 @@ export default {
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);
// });
},
},
destCityId: {
deep: true, //深度监听 目的仓
objectiveId: {
deep: true, //深度监听
handler() {
this.AddressTown = [];
this.destWarehouseId = "";
this.findBycityCode();
if (
this.destCityId != "" &&
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
/*getRegionList(3, this.destCityId)
/*getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
})
......@@ -876,7 +959,7 @@ export default {
});*/
} else if (
this.destCountryId == "" &&
this.destCityId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
getRegionList(5, 5)
......@@ -888,16 +971,17 @@ export default {
});
} else if (
this.destCountryId != "" &&
this.destCityId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
getRegionList(2, this.destCountryId)
/*getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});
});*/
this.findByprovinceCode()
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
......@@ -905,32 +989,27 @@ export default {
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId == "" &&
this.destCityId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.destCityId)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
}
// else if(this.objectiveId!="" && this.objectiveId=="" ){
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// }).catch(error => {
// console.log(error);
// });
// }
},
},
destWarehouseId: {
deep: true, //深度监听
handler() {
if (
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destCityId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.destCityId)
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
})
......@@ -939,7 +1018,7 @@ export default {
});
} else if (
this.destCountryId != "" &&
this.destCityId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
getRegionList(5, 5)
......@@ -949,19 +1028,15 @@ export default {
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId == "" &&
this.destCityId != "" &&
this.destWarehouseId == ""
) {
getRegionList(3, this.destCityId)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
}
// else if(this.objectiveId=="" && this.destWarehouseId==""){
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// })
// .catch(error => {
// console.log(error);
// });
// }
},
},
},
......@@ -1070,14 +1145,12 @@ export default {
infoListReceiptTotal:0,
country: '',
showMore: true,
countryList: [], //目的国
AddressCity: [], //目的城市
AddressTown: [], //目的仓
destCountryId: null,
// objectiveId: null,
destCityId: null,
destWarehouseId: null,
warehouseList: [],
AddressCity: [],
AddressProvince: [],
AddressTown: [],
destCountryId: [],
objectiveId: [],
destWarehouseId: "",
}
},
computed: {
......@@ -1087,7 +1160,7 @@ export default {
customerId(){
return this.$route.params.customerId;
},
isChinese(){
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
pickupPoint(){
......@@ -1175,7 +1248,20 @@ export default {
},
//订单
getorderList(){
infoListOrderPage({customerDetailId:this.id,...this.queryParams}).then(r => {
let queryParams = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryId = this.destCountryId;
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
queryParams.objectiveId = this.objectiveId;
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseId = this.destWarehouseId;
}
infoListOrderPage({customerDetailId:this.id,...this.queryParams,...queryParams}).then(r => {
if(r.code === 0){
this.orderList = r.data.list
this.orderTotal = r.data.total
......@@ -1184,10 +1270,22 @@ export default {
},
// 客户报价
getInfoListOfferPage(){
infoListOfferPage({...this.infoListOfferFrom,customerId:this.id}).then(r => {
let queryParams = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryId = this.destCountryId;
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
queryParams.objectiveId = this.objectiveId;
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseId = this.destWarehouseId;
}
infoListOfferPage({...this.infoListOfferFrom,customerId:this.id,...queryParams}).then(r => {
this.infoListOfferList = r.data.list;
this.infoListOfferTotal = r.data.total;
}).catch(r => {
})
},
// 数据
......@@ -1238,33 +1336,42 @@ export default {
},
findByprovinceCode() {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
getRegionList(2, this.destCountryId)
if (this.destCountryId != null && this.destCountryId != "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});
}
},
findBycityCode() {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.destCityId)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
if (this.objectiveId != null && this.objectiveId != "") {
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
})
}
},
getData() {
//加载时发起请求获取所有省份值
/*getRegionList(1, 1)
getRegionList(1, 1)
.then(({ data }) => {
this.AddressProvince = data;
console.log(this.AddressProvince);
})
.catch((error) => {
console.log(error);
});*/
});
//目的城市
getRegionList(4, 4)
.then(({ data }) => {
......@@ -1282,24 +1389,13 @@ export default {
console.log(error);
});
},
/* 国家 */
getCountryList() {
getListTree({ treeType: 1 }).then((response) => {
this.countryList = response.data;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
//目的国
this.queryParams.destCountryId = this.destCountryId;
//目的城市
this.queryParams.objectiveId = this.destCityId;
//目的仓
this.queryParams.destWarehouseId = this.destWarehouseId;
if (this.activeName == 'order') {
this.queryParams.page = 1
this.getorderList()
} else if (this.activeName == 'quote') {
this.infoListOfferFrom.pageNo = 1
this.getInfoListOfferPage()
}
},
......@@ -1319,6 +1415,23 @@ export default {
return warehouseName
},
},
cancel(id){
this.doAction(this.$t('确定要取消此报价单么?'), cancel, id);
},
recovery(id){
this.doAction(this.$t('确定要恢复此报价单么?'), recovery, id);
},
deleteOffer(id){
this.doAction(this.$t('确定要删除此报价单么?'), deleteOffer, id);
},
doAction(tips, action, id){
this.$confirm(tips).then(res => {
return action(id)
})
.then(() => {
this.$message.success('操作成功')
this.handleQuery()
})
}
}
</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