Commit a5c8013a authored by zhengke's avatar zhengke

修改

parent eb61266f
......@@ -72,7 +72,7 @@
</div>
<div class="info-content">
<div class="detail-info">
<baseInfo :Data="detailData" @confirm="saveBaseInfo"></baseInfo>
<baseInfo :Data="detailData" :isCanEdit="isCanEdit" @confirm="saveBaseInfo"></baseInfo>
</div>
<div class="detail-log">
<right :Id="rowId" :tabId="tabId"></right>
......@@ -113,6 +113,10 @@ export default {
tabId: {
type: Number,
default: 1
},
isCanEdit: {
type: Boolean,
default: null
}
},
data() {
......@@ -213,6 +217,8 @@ export default {
}
},
saveBaseInfo(obj) {
// console.log(obj,'obj');
// return
this.detailData[obj.field] = obj.val;
SetCustomer(this.detailData).then(res => {
if (res.Code == 1) {
......
......@@ -175,6 +175,10 @@
Data: {
type: Object,
default: null
},
isCanEdit: {
type: Boolean,
default: null
}
},
data() {
......@@ -199,7 +203,9 @@
},
methods: {
showEdit(field) {
if(this.isCanEdit){
this.editField = field
}
},
save(field,val,Validate=false){
if(Validate){
......
......@@ -79,7 +79,7 @@
</customerEdit-form>
<customerReview-form v-if="isShowRightForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion"></customerReview-form>
<customerInfo v-if="isShowDetailForm" :rowId="curRowId" :tabId="tabId" :empList="employeeList"
<customerInfo v-if="isShowDetailForm" :rowId="curRowId" :isCanEdit="isCanEdit" :tabId="tabId" :empList="employeeList"
@close="closeCustomForm" :auth="AuthorityObj" @success="refreshQuestion"></customerInfo>
</div>
</template>
......@@ -241,7 +241,8 @@
//员工列表
employeeList: [],
myEmployeeList: [],
isShowTrans: false
isShowTrans: false,
isCanEdit: false
};
},
created() {
......@@ -311,6 +312,21 @@
showDetail(row, tabId = 1) {
this.curRowId = row.CustomerId;
this.tabId = tabId;
let UserInfo = this.getLocalStorage();
let isHavePer=false;
if (UserInfo.ActionMenuList && UserInfo.ActionMenuList.length > 0) {
UserInfo.ActionMenuList.forEach((x) => {
if (x.FunctionCode == "Is_EditContact") {
isHavePer = true;
}else{
isHavePer = false;
}
});
}
//创建者为本人或者有权限 才能修改
if(UserInfo.Id==row.CreateBy||isHavePer){
this.isCanEdit = true;
}
this.isShowDetailForm = true;
},
//删除客户
......
......@@ -7,6 +7,7 @@
cursor: pointer;
color: var(--q-color-primary);
}
</style>
<template>
<div class="b2bcustomlist">
......@@ -16,8 +17,8 @@
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="EditCustom(null)" label="新增客户" />
<q-btn v-if="authObj&&authObj.isShowDownload" color="accent" class="q-mr-md" size="sm" icon="download" label="下载"
@click="downLoadCustomer" />
<q-btn v-if="authObj&&authObj.isShowDownload" color="accent" class="q-mr-md" size="sm" icon="download"
label="下载" @click="downLoadCustomer" />
</div>
</template>
<template v-slot:body-cell-CategoryName="props">
......@@ -43,10 +44,12 @@
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<template v-if="props.row.isCanEdit">
<q-btn flat size="xs" icon="edit" color="accent" @click="EditCustom(props.row)" style="font-weight:400"
label="修改" />
<q-btn flat size="xs" icon="delete" @click="RemoveCustomer(props.row)" color="negative"
style="font-weight:400" label="删除" />
</template>
</q-td>
</template>
<template v-slot:bottom>
......@@ -56,8 +59,8 @@
<categoryEdit-form v-if="isShowCategoryForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion">
</categoryEdit-form>
<peerRight v-if="isShowDetailForm" :CategoryId="CategoryId" @close="closeCustomForm" :auth="AuthorityObj"
@success="refreshQuestion"></peerRight>
<peerRight v-if="isShowDetailForm" :CategoryId="CategoryId" :isCanEdit="isCanEdit" @close="closeCustomForm"
:auth="AuthorityObj" @success="refreshQuestion"></peerRight>
</div>
</template>
<script>
......@@ -155,7 +158,8 @@
isShowRebate: false //是否显示返佣
},
isShowDetailForm: false,
CategoryId: 0
CategoryId: 0,
isCanEdit: false
};
},
created() {
......@@ -232,8 +236,22 @@
//客户详情
showDetail(row) {
this.CategoryId = row.CategoryId;
let UserInfo = this.getLocalStorage();
let isHavePer = false;
if (UserInfo.ActionMenuList && UserInfo.ActionMenuList.length > 0) {
UserInfo.ActionMenuList.forEach(x => {
if (x.FunctionCode == "Is_EditPeer") {
isHavePer = true;
}
});
}
//创建者为本人或者有权限 才能修改
if (UserInfo.Id == row.CreateBy || isHavePer) {
this.isCanEdit = true;
}
this.isShowDetailForm = true;
}
}
};
</script>
......@@ -371,10 +371,8 @@
return
}
if (!this.$refs.CustomerName.hasError) {
this.saveCustomLoading = true;
SetCustomer(this.objOption).then(res => {
if (res.Code == 1) {
this.saveCustomLoading = false;
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
......
......@@ -50,6 +50,10 @@
Data: {
type: Object,
default: null
},
isCanEdit: {
type: Boolean,
default: null
}
},
data() {
......@@ -71,7 +75,9 @@
},
methods: {
showEdit(field) {
if(this.isCanEdit){
this.editField = field
}
},
save(field,val,Validate=false){
if(Validate){
......
......@@ -13,7 +13,7 @@
</div>
<div class="info-content">
<div class="detail-info">
<baseInfo :Data="detailData" @confirm="saveBaseInfo"></baseInfo>
<baseInfo :Data="detailData" :isCanEdit="isCanEdit" @confirm="saveBaseInfo"></baseInfo>
</div>
<div class="detail-log">
<right :Id="CategoryId"></right>
......@@ -52,6 +52,10 @@
auth: {
type: Object,
default: null
},
isCanEdit: {
type: Boolean,
default: null
}
},
data() {
......
......@@ -10,6 +10,7 @@
white-space: nowrap;
width: 400px;
}
</style>
<template>
<div class="page-body">
......@@ -25,17 +26,20 @@
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" dense filled clearable v-model="msg.CustomerName" label="联系人" maxlength="20" />
<q-input @input="resetSearch" dense filled clearable v-model="msg.CustomerName" label="联系人"
maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" dense filled clearable v-model="msg.CategoryName" label="同行名称" maxlength="20" />
<q-input @input="resetSearch" dense filled clearable v-model="msg.CategoryName" label="同行名称"
maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" dense filled clearable v-model="msg.ContactNumber" label="电话" maxlength="20" />
<q-input @input="resetSearch" dense filled clearable v-model="msg.ContactNumber" label="电话"
maxlength="20" />
</div>
<div class="col-3">
<q-select @input="resetSearch" dense clearable filled v-model="msg.ApproveState" :options="ApproveStateList"
emit-value map-options label="审核状态" />
<q-select @input="resetSearch" dense clearable filled v-model="msg.ApproveState"
:options="ApproveStateList" emit-value map-options label="审核状态" />
</div>
</div>
</div>
......@@ -48,7 +52,8 @@
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" dense filled clearable v-model="categoryMsg.CategoryName" label="同业名称" maxlength="20" />
<q-input @input="resetSearch" dense filled clearable v-model="categoryMsg.CategoryName" label="同业名称"
maxlength="20" />
</div>
</div>
</div>
......@@ -90,7 +95,7 @@
ContactNumber: "", //联系电话
ApproveState: "", //审核状态
QCustomerState: "", //账号状态
CategoryName:"",//同业名称
CategoryName: "", //同业名称
},
loading: false,
visibleColumns: [
......@@ -132,7 +137,7 @@
CategoryName: "", //客户名称
CatetoryType: "", //类型
pageCount: 0,
IsQueryAll: 0
IsQueryAll: 1
},
};
},
......@@ -176,12 +181,34 @@
this.dataList = res.Data.PageData;
this.loading = false;
this.categoryMsg.pageCount = res.Data.PageCount;
if (this.dataList && this.dataList.length > 0) {
var UserInfo = this.getLocalStorage();
var isHavePer = false;
if (UserInfo.ActionMenuList && UserInfo.ActionMenuList.length > 0) {
UserInfo.ActionMenuList.forEach(y=> {
if (y.FunctionCode == "Is_EditPeer") {
isHavePer = true;
}
});
}
this.dataList.forEach(x => {
//创建者为本人或者有权限 才能修改
if (UserInfo.Id == x.CreateBy || isHavePer) {
x.isCanEdit = true;
} else {
x.isCanEdit = false;
}
})
}
});
}
}
}
};
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
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