Commit 9840e6eb authored by 邓春圆's avatar 邓春圆

修改客户类型

parent b2e681d7
......@@ -495,3 +495,11 @@ export function recycleUnconfirmedCustomer(data){
})
}
export function updatecustomerToOld(params){
return request({
url:'ecw/customer/update-customer-new-or-old',
method:'put',
params
})
}
......@@ -161,7 +161,7 @@
</template>
</el-table-column>
<el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<el-table-column width="200px" :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"-->
<!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
......@@ -175,6 +175,7 @@
<el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]" type="text" icon="el-icon-user" @click="complaint(scope.row)">{{$t('客诉')}}</el-button>
<el-button :disabled="scope.row.isInOpenSea" v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('延期')}}</el-button>
<el-button v-has-permi="['ecw:customer:treat-recovery']" v-if="scope.row.customerService !== null && scope.row.customerServiceAssignedTime !== null && !scope.row.isCustomerServiceConfirmed && !scope.row.isInOpenSea && path === '/customer/customer'" size="mini" type="text" @click="recovery(scope.row)" > {{$t('回收客户')}} </el-button>
<el-button v-has-permi="['ecw:customer:performanceType']" v-if="path === '/customer/customer'" size="mini" type="text" @click="dialogVisible = true; customData = scope.row;currentisNew = scope.row.isNew" > {{$t('业绩类型')}} </el-button>
</template>
</el-table-column>
</el-table>
......@@ -530,23 +531,44 @@
<customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
<transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
<add-potential-custom ref="potentialCustom" @change="getList" ></add-potential-custom>
<!--业绩类型 -->
<el-dialog
title="业绩类型"
:visible.sync="dialogVisible"
width="30%">
<div>
<el-form>
<el-form-item label="客户编号">{{customData.number}}</el-form-item>
<el-form-item label="客户名称">{{customData.name}}</el-form-item>
<el-form-item label="业绩类型">
<el-radio-group v-model="currentisNew">
<el-radio :label="true" >{{$t('新客户')}}</el-radio>
<el-radio :label="false" >{{$t('老客户')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button :disabled="customData.isNew === currentisNew" type="primary" @click="modifyCustomer">修改</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
createCustomer,
updateCustomer,
deleteCustomer,
getCustomer,
getCustomerPage,
exportCustomerExcel,
testEnterToOpenSea,
getCustomerDeptPage,
changeCustomerAir,
getPotential,
setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer
createCustomer,
updateCustomer,
deleteCustomer,
getCustomer,
getCustomerPage,
exportCustomerExcel,
testEnterToOpenSea,
getCustomerDeptPage,
changeCustomerAir,
getPotential,
setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer, updatecustomerToOld
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
......@@ -633,7 +655,12 @@ export default {
countryList: [],
creditList:[],
selectCustomerList:[],
transferShow:false
transferShow:false,
dialogVisible:false,
customData:{
},
currentisNew:false
};
},
computed:{
......@@ -949,7 +976,24 @@ export default {
this.getList();
});
});
}
}
},
// 修改客户类型
modifyCustomer(){
this.$confirm(this.$t('修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
}).then(() => {
updatecustomerToOld({customerId:this.customData.id,isNew:this.currentisNew}).then((r) =>{
this.$message.success(this.$t('修改成功'));
this.dialogVisible = false
this.getList()
})
}).catch(() => {
});
}
}
};
</script>
......@@ -520,9 +520,15 @@ export default {
},
// 修改客户
setCustom(row) {
// console.log(row,'row')
customerUpdateCustomerToOld({customerServiceId:row.customerServiceId}).then(r =>{
this.$message.success(this.$t('修改成功!'))
this.$confirm(this.$t('是否将当前用户下的客户变成老客户'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
}).then(r =>{
customerUpdateCustomerToOld({customerServiceId: row.customerServiceId}).then(r => {
this.$message.success(this.$t('修改成功!'))
})
})
},
// 表单重置
......
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