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

客户模块添加权限2

parent 45ed997c
......@@ -69,15 +69,15 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:customer:create']">{{$t('新增')}}</el-button>
v-hasPermi="[ selectAuthorityFn('ecw:customer:create')]">{{$t('新增')}}</el-button>
</el-col>
<el-col :span="1.5" >
<el-button :disabled="selectCustomerList.length === 0" type="primary" size="mini" @click="transferShow = true;"
v-hasPermi="['ecw:customer:batch-transfer']">{{$t('批量移交')}}</el-button>
v-hasPermi="[selectAuthorityFn('ecw:customer:batch-transfer')]">{{$t('批量移交')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">{{$t('导出')}}</el-button>
v-hasPermi="[selectAuthorityFn('ecw:customer:export')]">{{$t('导出')}}</el-button>
</el-col>
<el-col :span="1.5">
<el-button :disabled="!selectCustomerList.length" @click="setChangeCustomerAir(true)" v-if="$route.path === '/customer/customer'" type="primary" plain size="mini" :loading="exportLoading"
......@@ -149,14 +149,14 @@
<!-- <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>-->
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-hasPermi="['ecw:customer:query']">{{$t('查看')}}</el-button>
v-hasPermi="[selectAuthorityFn('ecw:customer:query')]">{{$t('查看')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:customer:update']">{{$t('修改')}}</el-button>
v-hasPermi="[selectAuthorityFn('ecw:customer:update')]">{{$t('修改')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:customer:delete']">{{$t('删除')}}</el-button>
<el-button size="mini" v-has-permi="['ecw:customer:follow-up']" type="text" icon="el-icon-collection" @click="followUp(scope.row)">{{$t('跟进')}}</el-button>
<el-button size="mini" v-has-permi="['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="['ecw:customer:postpone']" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('延期')}}</el-button>
v-hasPermi="[selectAuthorityFn('ecw:customer:delete')]">{{$t('删除')}}</el-button>
<el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:follow-up')]" type="text" icon="el-icon-collection" @click="followUp(scope.row)">{{$t('跟进')}}</el-button>
<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>
</template>
</el-table-column>
</el-table>
......@@ -610,6 +610,22 @@ export default {
},
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
authorityFn(){
let i = ''
switch (this.$route.path){
case '/customer/department-customers':
i = 'dep-'
break;
}
return i
},
selectAuthorityFn(){
return (val)=>{
let t = val.split(':')
t[t.length - 1] = this.authorityFn + t[t.length - 1]
return t.join(":")
}
}
},
watch:{
......
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