|
|
@@ -28,9 +28,10 @@
|
|
|
@resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 304)"
|
|
|
@saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 304)" @on-load="onLoad">
|
|
|
<template slot="cnName" slot-scope="scope">
|
|
|
- <div style="color: #1e9fff;cursor: pointer;" @click.stop="editOpen(scope.row)">
|
|
|
+ <div v-if="permission.edit" style="color: #1e9fff;cursor: pointer;" @click.stop="editOpen(scope.row)">
|
|
|
{{scope.row.cnName}}
|
|
|
</div>
|
|
|
+ <span v-else>{{scope.row.cnName}}</span>
|
|
|
</template>
|
|
|
<template slot="status" slot-scope="scope">
|
|
|
<div v-for="(item,index) of ifInvoiceData" :key="index" v-if="scope.row.status == item.dictKey"
|
|
|
@@ -38,24 +39,24 @@
|
|
|
</template>
|
|
|
|
|
|
<template slot="menuLeft">
|
|
|
- <el-button type="warning" size="small" icon="el-icon-printer" @click="excelBox = true">导入</el-button>
|
|
|
- <el-button type="success" size="small" @click="handleExport" icon="el-icon-printer">导出</el-button>
|
|
|
+ <el-button v-if="permission.add" type="warning" size="small" icon="el-icon-printer" @click="excelBox = true">导入</el-button>
|
|
|
+ <el-button v-if="this.isAdmin" type="success" size="small" @click="handleExport" icon="el-icon-printer">导出</el-button>
|
|
|
<!--<el-button type="primary" size="small" icon="el-icon-turn-off" @click="Deactivatefun" >批量停用</el-button>-->
|
|
|
<!--<el-button type="success" size="small" @click="handleReportDesigner" icon="el-icon-printer">设计报表</el-button>-->
|
|
|
<!--<el-button type="success" size="small" @click="handleReportPreview" icon="el-icon-printer">预览报表</el-button>-->
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="menu">
|
|
|
- <el-button icon="el-icon-edit" type="text" size="small" @click.stop="editOpen(row)">
|
|
|
+ <el-button v-if="permission.edit" icon="el-icon-edit" type="text" size="small" @click.stop="editOpen(row)">
|
|
|
编辑
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-delete" type="text" size="small" @click.stop="rowDel(row, index)">
|
|
|
+ <el-button v-if="permission.delete" icon="el-icon-delete" type="text" size="small" @click.stop="rowDel(row, index)">
|
|
|
删除
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-turn-off" v-if="row.status == 1" type="text" style="color: #85e967" size="small"
|
|
|
+ <el-button v-if="row.status==1 && permission.edit" icon="el-icon-turn-off" type="text" style="color: #85e967" size="small"
|
|
|
@click.stop="statusfun(row.id,0)">
|
|
|
启用
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-turn-off" v-if="row.status == 0" type="text" style="color: #e83c3a" size="small"
|
|
|
+ <el-button v-if="row.status==0 && permission.edit" icon="el-icon-turn-off" type="text" style="color: #e83c3a" size="small"
|
|
|
@click.stop="statusfun(row.id,1)">
|
|
|
停用
|
|
|
</el-button>
|
|
|
@@ -67,7 +68,7 @@
|
|
|
|
|
|
<reportContainer ref="reportContainer"></reportContainer>
|
|
|
|
|
|
- <detailPage v-if="!isShow" ref="detail" @goBack="goBack" @copyOrder="copyOrder" :detailData="detailData"></detailPage>
|
|
|
+ <detailPage v-if="!isShow" ref="detail" @goBack="goBack" :detailData="detailData"></detailPage>
|
|
|
|
|
|
<!--类别弹窗-->
|
|
|
<el-dialog title="类别" v-dialogdrag :visible.sync="corpTypeVisible" append-to-body width="60%" :before-close="corpTypeClose">
|
|
|
@@ -168,7 +169,9 @@ export default {
|
|
|
customTypeData: [],
|
|
|
excelBox: false,
|
|
|
form: {},
|
|
|
- query: {},
|
|
|
+ query: {
|
|
|
+ corpType: undefined,
|
|
|
+ },
|
|
|
detailData: {},
|
|
|
isShow: true,
|
|
|
loading: true,
|
|
|
@@ -192,7 +195,7 @@ export default {
|
|
|
index: true,
|
|
|
viewBtn: true,
|
|
|
selection: true,
|
|
|
- addBtnText: '新建往来单位',
|
|
|
+ addBtnText: '新建 PS 客户',
|
|
|
dialogClickModal: false,
|
|
|
menuWidth: 220,
|
|
|
column: [
|
|
|
@@ -203,7 +206,7 @@ export default {
|
|
|
search: true,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- message: "请输入单位编码",
|
|
|
+ message: "请输入 PS 客户编码",
|
|
|
trigger: "blur"
|
|
|
}],
|
|
|
overHidden:true,
|
|
|
@@ -237,7 +240,7 @@ export default {
|
|
|
prop: "uscc",
|
|
|
width: 160,
|
|
|
rules: [{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: "请输入统一社会信用代码",
|
|
|
trigger: "blur"
|
|
|
}],
|
|
|
@@ -295,7 +298,7 @@ export default {
|
|
|
width: "200",
|
|
|
search: true,
|
|
|
rules: [{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: "请输入中文地址",
|
|
|
trigger: "blur"
|
|
|
}],
|
|
|
@@ -307,7 +310,7 @@ export default {
|
|
|
width: "200",
|
|
|
search: true,
|
|
|
rules: [{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: "请输入英文地址",
|
|
|
trigger: "blur"
|
|
|
}],
|
|
|
@@ -414,8 +417,15 @@ export default {
|
|
|
designer: null,
|
|
|
},
|
|
|
data: [],
|
|
|
- // 字典数据
|
|
|
- ifInvoiceData:[],
|
|
|
+ // 字典数据
|
|
|
+ ifInvoiceData:[],
|
|
|
+ roleName: [], // 当前登录人的角色权限
|
|
|
+ permission:{
|
|
|
+ add: false,
|
|
|
+ edit: false,
|
|
|
+ delete: false,
|
|
|
+ },
|
|
|
+ isAdmin: false, // 当前登录人是否有系统管理员角色
|
|
|
};
|
|
|
},
|
|
|
props:{
|
|
|
@@ -428,12 +438,21 @@ export default {
|
|
|
computed: {
|
|
|
...mapGetters(["permission"]),
|
|
|
permissionList() {
|
|
|
- return {
|
|
|
+ let permission = {
|
|
|
// addBtn: this.vaildData(this.permission.bcorps_add, false),
|
|
|
- viewBtn: this.vaildData(this.permission.bcorps_view, false),
|
|
|
- delBtn: this.vaildData(this.permission.bcorps_delete, false),
|
|
|
- editBtn: this.vaildData(this.permission.bcorps_edit, false)
|
|
|
+ // viewBtn: this.vaildData(this.permission.bcorps_view, false),
|
|
|
+ // delBtn: this.vaildData(this.permission.bcorps_delete, false),
|
|
|
+ // editBtn: this.vaildData(this.permission.bcorps_edit, false)
|
|
|
+ addBtn: this.permission.add,
|
|
|
+ // viewBtn: true,
|
|
|
+ // delBtn: this.permission.delete,
|
|
|
+ // editBtn: this.permission.edit,
|
|
|
+ viewBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ editBtn: false,
|
|
|
};
|
|
|
+
|
|
|
+ return permission;
|
|
|
},
|
|
|
ids() {
|
|
|
let ids = [];
|
|
|
@@ -444,6 +463,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
|
+ this.roleName = localStorage.getItem('roleName').split(',') // 获取角色数据
|
|
|
+ this.isAdmin = this.roleName.indexOf('admin') >= 0;
|
|
|
+ this.permission.add = this.roleName.indexOf('PS 客户新增')>=0
|
|
|
+ this.permission.edit = this.roleName.indexOf('PS 客户修改')>=0
|
|
|
+ this.permission.delete = this.roleName.indexOf('PS 客户删除')>=0
|
|
|
+
|
|
|
this.option = await this.getColumnData(this.getColumnName(304), this.optionBack);
|
|
|
// 这个是从海运出口跳进来的
|
|
|
if (this.$route.query.corpType) {
|
|
|
@@ -479,7 +504,6 @@ export default {
|
|
|
const arrIds = this.selectionList.map(item=>{
|
|
|
return item.id
|
|
|
})
|
|
|
- console.log(arrIds,482)
|
|
|
},
|
|
|
// 获取国家数据
|
|
|
bcountrysListfun(){
|
|
|
@@ -505,12 +529,19 @@ export default {
|
|
|
let obj = res.data.data;
|
|
|
obj.status = status
|
|
|
updateBcorps(obj).then(res=>{
|
|
|
+ this.loading = false
|
|
|
this.onLoad(this.page);
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "操作成功!"
|
|
|
});
|
|
|
- })
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log(err);
|
|
|
+ this.loading = false
|
|
|
+ });
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log(err);
|
|
|
+ this.loading = false
|
|
|
});
|
|
|
})
|
|
|
|
|
|
@@ -589,7 +620,7 @@ export default {
|
|
|
},
|
|
|
// 获取客户类别
|
|
|
bcorpstypedefineListfun() {
|
|
|
- bcorpstypedefineList(1,30,{cnName:'PS客户'}).then(res => {
|
|
|
+ bcorpstypedefineList(1,30,{type: 1, cnName:'PS客户'}).then(res => {
|
|
|
this.customTypeData = res.data.data.records
|
|
|
})
|
|
|
},
|
|
|
@@ -597,6 +628,7 @@ export default {
|
|
|
this.detailData = {
|
|
|
id: row.id
|
|
|
};
|
|
|
+ // roleName.indexOf('PS 客户修改')>=0
|
|
|
this.isShow = false;
|
|
|
},
|
|
|
rowSave(row, done, loading) {
|
|
|
@@ -676,6 +708,7 @@ export default {
|
|
|
if (this.query.corpType != null) {
|
|
|
this.detailData.corpType = this.query.corpType
|
|
|
}
|
|
|
+ console.log("beforeOpen", this.detailData)
|
|
|
this.isShow = false;
|
|
|
// if (["edit", "view"].includes(type)) {
|
|
|
// getBcorpsDetail(this.form.id).then(res => {
|
|
|
@@ -720,10 +753,8 @@ export default {
|
|
|
this.query.type='1'
|
|
|
BcorpsList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
const data = res.data.data;
|
|
|
- console.log(res.data.data)
|
|
|
this.page.total = data.total;
|
|
|
this.data = data.records;
|
|
|
- console.log(data)
|
|
|
this.loading = false;
|
|
|
this.selectionClear();
|
|
|
});
|