Commit a5c8013a authored by zhengke's avatar zhengke

修改

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