Commit e496d6c1 authored by 邓春圆's avatar 邓春圆

设为空运客户按钮添加

parent 09069493
......@@ -370,3 +370,12 @@ export function testEnterToOpenSea(customerId) {
method:'get',
})
}
//设置空运客户
export function changeCustomerAir(data){
return request({
url:'/ecw/customer/change-customer-air',
method:'put',
data
})
}
......@@ -80,11 +80,11 @@
v-hasPermi="['ecw:customer:export']">{{$t('导出')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
<el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
v-hasPermi="['ecw:customer:transport']" >{{$t('设为空运客户')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
<el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(false)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
v-hasPermi="['ecw:customer:transport']">{{$t('设为非空运客户')}}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
......@@ -517,7 +517,7 @@
<script>
import {
createCustomer, updateCustomer, deleteCustomer, getCustomer,
getCustomerPage, exportCustomerExcel, testEnterToOpenSea, getCustomerDeptPage
getCustomerPage, exportCustomerExcel, testEnterToOpenSea, getCustomerDeptPage, changeCustomerAir
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
......@@ -535,19 +535,6 @@ import Template from "@/views/cms/template/index.vue";
export default {
name: "EcwCustomerIndex",
activated(){
this.getList();
},
computed:{
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
channel(){
return (val)=>{
return !!val ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE).filter(i => (val.split(',') || []).includes(i.value)).map(i => this.isChinese ? i.label : i.labelEn ).join('') :''
}
}
},
components: {
Template,
upload,
......@@ -615,6 +602,24 @@ export default {
transferShow:false
};
},
computed:{
channel(){
return (val)=>{
return !!val ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE).filter(i => (val.split(',') || []).includes(i.value)).map(i => this.isChinese ? i.label : i.labelEn ).join('') :''
}
},
isChinese(){
return this.$i18n.locale === 'zh_CN'
}
},
watch:{
selectCustomerList(val){
if(val.length === 0){
this.getList()
this.$refs.multipleTable.clearSelection();
}
},
},
created() {
getCreditPage({page:1,rows:999}).then(r => {
this.creditList = r.data.list
......@@ -630,11 +635,49 @@ export default {
this.countryList = r.data
})
},
activated(){
this.getList();
},
methods: {
// 设置空运客户
setChangeCustomerAir(isAir){
changeCustomerAir({
customerIdList:this.selectCustomerList,
isAir
}).then(r =>{
console.log(r)
if(r.code === 0){
this.$message.success(isAir ? '设为空运客户成功!' : '设为非空空运客户成功!')
this.selectCustomerList = []
this.getList()
}
})
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
complaint(row){
this.customerId = row.id;
this.$nextTick(()=>{
this.$refs.customerComplaints.handleAdd();
})
},
countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue)
return this.isChinese ? country?.nameZh : country?.nameEn
},
delay(row){
this.$router.push({path:'/customer/delay',query:{id:row.id}})
},
followUp(row){
this.customerId = row.id;
this.$nextTick(()=>{
this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
})
},
/** 查询列表 */
getList() {
console.log(this.$route.path,'path')
......@@ -653,16 +696,65 @@ export default {
}
},
setData(response){
console.log(response,'response')
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/customer/add-edit/0')
// this.reset();
// this.open = true;
// this.title = this.$t("添加客户");
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
const name = row.name;
const number = row.number;
this.$modal.confirm(this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?')).then(function() {
return deleteCustomer(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess(this.$t('删除成功'));
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出所有客户数据项?')).then(() => {
this.exportLoading = true;
return exportCustomerExcel(params);
}).then(response => {
this.$download.excel(response, `${this.$t('客户信息')}.xls`);
/* console.log(response,'response')
this.$download.excel(response, `${this.$t('全部客户信息')}.xls`); */
this.exportLoading = false;
}).catch(() => {});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
handleSelectionChange(val){
this.selectCustomerList = val.map(i => i.id);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push('/customer/edit/' + row.id)
// this.reset();
// const id = row.id;
// getCustomer(id).then(response => {
// this.form = { ...this.form, ...response.data };
// this.open = true;
// this.title = this.$t("修改客户");
// });
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
},
/** 表单重置 */
reset() {
......@@ -705,11 +797,6 @@ export default {
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
......@@ -729,17 +816,6 @@ export default {
}
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/customer/add-edit/0')
// this.reset();
// this.open = true;
// this.title = this.$t("添加客户");
},
/** 查看按钮操作 */
handleView(row) {
this.$router.push('/customer/query/' + row.id)
},
/** 调入公海池测试用 */
seasPond(row) {
testEnterToOpenSea(row.id).then(r => {
......@@ -749,16 +825,11 @@ export default {
}
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push('/customer/edit/' + row.id)
// this.reset();
// const id = row.id;
// getCustomer(id).then(response => {
// this.form = { ...this.form, ...response.data };
// this.open = true;
// this.title = this.$t("修改客户");
// });
setData(response){
console.log(response,'response')
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
},
/** 提交按钮 */
submitForm() {
......@@ -782,64 +853,7 @@ export default {
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
const name = row.name;
const number = row.number;
this.$modal.confirm(this.$t('是否确认删除客户编号为"') + number + this.$t('"的数据项?')).then(function() {
return deleteCustomer(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess(this.$t('删除成功'));
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出所有客户数据项?')).then(() => {
this.exportLoading = true;
return exportCustomerExcel(params);
}).then(response => {
this.$download.excel(response, `${this.$t('客户信息')}.xls`);
/* console.log(response,'response')
this.$download.excel(response, `${this.$t('全部客户信息')}.xls`); */
this.exportLoading = false;
}).catch(() => {});
},
followUp(row){
this.customerId = row.id;
this.$nextTick(()=>{
this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
})
},
delay(row){
this.$router.push({path:'/customer/delay',query:{id:row.id}})
},
complaint(row){
this.customerId = row.id;
this.$nextTick(()=>{
this.$refs.customerComplaints.handleAdd();
})
},
handleSelectionChange(val){
this.selectCustomerList = val.map(i => i.id);
}
},
watch:{
selectCustomerList(val){
if(val.length === 0){
this.getList()
this.$refs.multipleTable.clearSelection();
}
},
}
};
</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