Commit 31f6a7eb authored by 邓春圆's avatar 邓春圆

国际化优化2

parent f5af7e5b
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('信用等级')" prop="creditLevelNameZh"></el-table-column> <el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column>
<el-table-column :label="$t('客户状态')" align="center" prop="status"> <el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
...@@ -522,9 +522,12 @@ import Template from "@/views/cms/template/index.vue"; ...@@ -522,9 +522,12 @@ import Template from "@/views/cms/template/index.vue";
export default { export default {
name: "Customer", name: "Customer",
computed:{ computed:{
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
channel(){ channel(){
return (val)=>{ return (val)=>{
return !!val ? this.getDictDatas(this.DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE).filter(i => (val.split(',') || []).includes(i.value)).map(i => i.label).join('') :'' 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('') :''
} }
} }
}, },
...@@ -612,7 +615,7 @@ export default { ...@@ -612,7 +615,7 @@ export default {
methods: { methods: {
countryFormatter(row, column, cellValue) { countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue) const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh return this.isChinese ? country?.nameZh : country?.nameEn
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item> <el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item> <el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item>
<el-descriptions-item :label="$t('出货渠道')"> <el-descriptions-item :label="$t('出货渠道')">
{{ getDictDatas2(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE, (customer.transportType||'').split(',')).map(e => e.label).join(', ') }} {{ getDictDatas2(DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE, (customer.transportType||'').split(',')).map(e => isChinese ? e.label : e.labelEn).join(', ') }}
<!-- <dict-tag v-if="customer.transportType" v-for="item in (customer.transportType || '').split(',')" :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" :value="item"></dict-tag>--> <!-- <dict-tag v-if="customer.transportType" v-for="item in (customer.transportType || '').split(',')" :type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE" :value="item"></dict-tag>-->
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('资源类型')"> <el-descriptions-item :label="$t('资源类型')">
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('信用等级')" prop="creditLevelNameZh"></el-table-column> <el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column>
<el-table-column :label="$t('客户状态')" align="center" prop="status"> <el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
...@@ -361,6 +361,11 @@ import {getCreditPage} from "@/api/customer/credit"; ...@@ -361,6 +361,11 @@ import {getCreditPage} from "@/api/customer/credit";
export default { export default {
name: "Customer", name: "Customer",
computed:{
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
},
components: { components: {
}, },
data() { data() {
...@@ -429,7 +434,7 @@ export default { ...@@ -429,7 +434,7 @@ export default {
methods: { methods: {
countryFormatter(row, column, cellValue) { countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue) const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh return this.isChinese ? country?.nameZh : country?.nameEn
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('信用等级')" prop="creditLevelNameZh"></el-table-column> <el-table-column :label="$t('信用等级')" :prop=" isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn' "></el-table-column>
<el-table-column :label="$t('客户状态')" align="center" prop="status"> <el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
...@@ -255,7 +255,7 @@ export default { ...@@ -255,7 +255,7 @@ export default {
methods: { methods: {
countryFormatter(row, column, cellValue) { countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue) const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh return this.isChinese ? country?.nameZh : country?.nameEn
}, },
handleSelectionChange(val){ handleSelectionChange(val){
this.selectCustomerList = val.map(i => i.id); this.selectCustomerList = val.map(i => i.id);
...@@ -444,6 +444,11 @@ export default { ...@@ -444,6 +444,11 @@ export default {
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
} }
}, },
},
computed:{
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
} }
}; };
</script> </script>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('信用等级')" prop="creditLevelNameZh"></el-table-column> <el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn' "></el-table-column>
<el-table-column :label="$t('客户状态')" align="center" prop="status"> <el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
...@@ -162,6 +162,11 @@ export default { ...@@ -162,6 +162,11 @@ export default {
customerComplaints, customerComplaints,
transferCustomer transferCustomer
}, },
computed:{
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
},
data() { data() {
return { return {
show:false, show:false,
...@@ -243,7 +248,7 @@ export default { ...@@ -243,7 +248,7 @@ export default {
}, },
countryFormatter(row, column, cellValue) { countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue) const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh return this.isChinese ? country?.nameZh : country?.nameEn
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('信用等级')" prop="creditLevelNameZh"></el-table-column> <el-table-column :label="$t('信用等级')" :prop="isChinese ? 'creditLevelNameZh' : 'creditLevelNameEn'"></el-table-column>
<el-table-column :label="$t('客户状态')" align="center" prop="status"> <el-table-column :label="$t('客户状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
...@@ -245,10 +245,15 @@ export default { ...@@ -245,10 +245,15 @@ export default {
// this.nodeList = r.data // this.nodeList = r.data
// }) // })
}, },
computed:{
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
},
methods: { methods: {
countryFormatter(row, column, cellValue) { countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue) const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh return this.isChinese ? country?.nameZh : country?.nameEn
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
......
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