Browse Source

Merge branch 'menu_customer' into dev

preview
lichao 2 years ago
parent
commit
89de941c3b
  1. 1
      epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue
  2. 20
      epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue
  3. 16
      epmet-oper-web/src/views/modules/customer/customize/menuDataCustomer.vue
  4. 182
      epmet-oper-web/src/views/modules/customer/manage/CustomerList.vue
  5. 4
      epmet-oper-web/src/views/modules/workPc/dataMenu.vue
  6. 4
      epmet-oper-web/src/views/modules/workPc/menu.vue

1
epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue

@ -214,7 +214,6 @@ export default {
// //
showMenu(customerId, customerName) { showMenu(customerId, customerName) {
this.showType = 'menuCustomer'; this.showType = 'menuCustomer';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['ref_menu_customer'].initData(customerId, customerName); this.$refs['ref_menu_customer'].initData(customerId, customerName);
}); });

20
epmet-oper-web/src/views/modules/customer/customize/menuCustomer.vue

@ -66,7 +66,7 @@ export default {
tableParams: { tableParams: {
customerId: '' customerId: ''
}, },
search: '',
dataList: [], dataList: [],
selection: [], selection: [],
selAllFlag: false, selAllFlag: false,
@ -74,7 +74,8 @@ export default {
dataListLoading: false, dataListLoading: false,
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/customerMenuList' getDataListURL: '/gov/access/menu/customerMenuList',
createdIsNeed:false
} }
}; };
}, },
@ -83,15 +84,15 @@ export default {
components: { components: {
AddOrUpdate AddOrUpdate
}, },
created() {},
methods: { methods: {
search() { search() {
if (this.menuName != '') { if (this.menuName != '') {
let saveList = []; let saveList = [];
this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList); this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList);
this.$refs.form.data = saveList; this.dataList = [...saveList];
} else { } else {
this.$refs.form.data = this.dataList; this.query();
} }
}, },
@ -174,6 +175,7 @@ export default {
.then(({ data: res }) => { .then(({ data: res }) => {
return this.$message.success('操作成功'); return this.$message.success('操作成功');
}); });
this.query(); this.query();
}, },
query() { query() {
@ -198,12 +200,15 @@ export default {
}, },
initData(customerId, customerName) { initData(customerId, customerName) {
if (customerId != '') {
this.customerId = customerId; this.customerId = customerId;
this.customerName = customerName; this.customerName = customerName;
// if (this.mixinViewModuleOptions.createdIsNeed) { // if (this.mixinViewModuleOptions.createdIsNeed) {
// console.log(this.customerId+"22222"); // console.log(this.customerId+"22222");
this.query(); this.query();
// } // }
}
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -225,8 +230,9 @@ export default {
.div_btn { .div_btn {
margin: 0 0 20px 0; margin: 0 0 20px 0;
} }
.little-head{ .little-head {
border-bottom: dashed 1px #ccc; line-height: 50px; border-bottom: dashed 1px #ccc;
line-height: 50px;
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>

16
epmet-oper-web/src/views/modules/customer/customize/menuDataCustomer.vue

@ -30,8 +30,8 @@
<el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column> <el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column>
<el-table-column prop="useFlag" :label="$t('menu.status')" header-align="center" align="center"> <el-table-column prop="useFlag" :label="$t('menu.status')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.useFlag === '0'" size="small">{{ $t('menu.status0') }}</el-tag> <el-tag v-if="scope.row.useFlag === '0'" size="small" type="info">{{ $t('menu.status0') }}</el-tag>
<el-tag v-else size="small" type="info">{{ $t('menu.status1') }}</el-tag> <el-tag v-else size="small">{{ $t('menu.status1') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -73,7 +73,8 @@ export default {
dataListLoading: false, dataListLoading: false,
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/gov/access/menu/customerMenuList' getDataListURL: '/gov/access/menu/customerMenuList',
createdIsNeed: false
} }
}; };
}, },
@ -88,9 +89,9 @@ export default {
if (this.menuName != '') { if (this.menuName != '') {
let saveList = []; let saveList = [];
this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList); this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList);
this.$refs.form.data = saveList; this.dataList = [...saveList];
} else { } else {
this.$refs.form.data = this.dataList; this.query();
} }
}, },
@ -221,8 +222,9 @@ export default {
.div_btn { .div_btn {
margin: 0 0 20px 0; margin: 0 0 20px 0;
} }
.little-head{ .little-head {
border-bottom: dashed 1px #ccc; line-height: 50px; border-bottom: dashed 1px #ccc;
line-height: 50px;
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>

182
epmet-oper-web/src/views/modules/customer/manage/CustomerList.vue

@ -1,27 +1,19 @@
<template> <template>
<div class="registerList"> <div class="registerList">
<el-card shadow="never" <el-card shadow="never" class="aui-card--fill">
class="aui-card--fill">
<div class="mod-demo__demo}"> <div class="mod-demo__demo}">
<el-form :inline="true" <el-form :inline="true" :model="tableParams" @keyup.enter.native="loadData()">
:model="tableParams" <el-form-item><el-input v-model="tableParams.customerName" placeholder="客户名称"></el-input></el-form-item>
@keyup.enter.native="loadData()">
<el-form-item>
<el-input v-model="tableParams.customerName"
placeholder="客户名称">
</el-input>
</el-form-item>
<el-form-item><el-button @click="loadData()">查询</el-button></el-form-item>
<el-form-item> <el-form-item>
<el-button @click="loadData()">查询</el-button> <el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item><el-button type="danger" @click="del('')">删除</el-button></el-form-item>
</el-form> </el-form>
<c-table column-type="" <c-table
column-type="selection"
ref="table" ref="table"
:url="tableUrl" :url="tableUrl"
:params="tableParams" :params="tableParams"
@ -31,34 +23,32 @@
:operationWidth="80" :operationWidth="80"
@config="config" @config="config"
@edit="edit" @edit="edit"
@init="init"> @init="init"
</c-table> @del="del"
@select="select"
></c-table>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
ref="addOrUpdate"
@refreshDataList="getDataList"></add-or-update>
</div> </div>
</el-card> </el-card>
<edit-form ref="ref_edit_form" <edit-form ref="ref_edit_form" @refresh="loadData"></edit-form>
@refresh="loadData"></edit-form> <config-form ref="ref_config_form" @refresh="loadData"></config-form>
<config-form ref="ref_config_form"
@refresh="loadData"></config-form>
</div> </div>
</template> </template>
<script> <script>
import CTable from '@c/CTable' import CTable from '@c/CTable';
import EditForm from './EditForm' import EditForm from './EditForm';
import ConfigForm from './ConfigForm' import ConfigForm from './ConfigForm';
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex';
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui'; // Loading
import AddOrUpdate from './customer-add-or-update.vue' import AddOrUpdate from './customer-add-or-update.vue';
import mixinViewModule from "@/mixins/view-module"; import mixinViewModule from '@/mixins/view-module';
let loading // let loading; //
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
// //
tableUrl: '/oper/crm/customer/customerlist', tableUrl: '/oper/crm/customer/customerlist',
@ -76,8 +66,8 @@ export default {
slot: '', slot: '',
plain: false, plain: false,
methodName: 'edit', // methodName: 'edit', //
isShow: (row) => { isShow: row => {
return true return true;
} }
}, },
{ {
@ -88,8 +78,8 @@ export default {
slot: '', slot: '',
plain: false, plain: false,
methodName: 'config', // methodName: 'config', //
isShow: (row) => { isShow: row => {
return true return true;
} }
}, },
{ {
@ -100,88 +90,134 @@ export default {
slot: '', slot: '',
plain: false, plain: false,
methodName: 'init', // methodName: 'init', //
isShow: (row) => { isShow: row => {
return true return true;
}
},
{
lable: '删除', //
size: 'mini',
style: 'margin: 0 6px;',
type: 'text',
slot: '',
plain: false,
methodName: 'del', //
isShow: row => {
return true;
} }
} }
], ],
// //
tableData: [ tableData: [],
addOrUpdateVisible: false, // visible
], multipleSelection: []
addOrUpdateVisible: false // visible };
}
}, },
components: { components: {
CTable, EditForm, ConfigForm,AddOrUpdate CTable,
EditForm,
ConfigForm,
AddOrUpdate
}, },
activated () { activated() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.table.doLayout() // this.$refs.table.doLayout(); //
}) });
}, },
mounted () { mounted() {
// eslint-disable-next-line // eslint-disable-next-line
console.log(this) console.log(this);
this.loadData() this.loadData();
}, },
computed: { computed: {
tableHeight () { tableHeight() {
return this.clientHeight - 60 - 80 - 80 - 70 return this.clientHeight - 60 - 80 - 80 - 70;
}, },
...mapGetters(['clientHeight', 'env']) ...mapGetters(['clientHeight', 'env'])
}, },
methods: { methods: {
select(row) {
this.multipleSelection = row.map(item => {
return item.customerId;
});
console.log(this.multipleSelection);
},
// //
loadData () { loadData() {
this.$refs.table.loadData() this.$refs.table.loadData();
}, },
// //
edit (row) { edit(row) {
this.$refs['ref_edit_form'].initData(row) this.$refs['ref_edit_form'].initData(row);
}, },
// //
init (row) { init(row) {
let params = { let params = {
customerId: row.customerId, customerId: row.customerId,
areaCode: row.rootAgencyAreaCode, areaCode: row.rootAgencyAreaCode
} };
this.$http.get(`/oper/customize/icform/initCustomerForm/resi_base_info/`, {params: params}).then(({ data: res }) => { this.$http.get(`/oper/customize/icform/initCustomerForm/resi_base_info/`, { params: params }).then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
return this.$message.info(res.data) return this.$message.info(res.data);
} else { } else {
return this.$message.error(res.internalMsg) return this.$message.error(res.internalMsg);
} }
}) });
}, },
del(row) {
console.log('this.multipleSelection', row);
let ids = [];
if (row != '') {
ids = [row.customerId];
} else {
if (this.multipleSelection.length > 0) {
ids = this.multipleSelection;
} else {
return this.$message.error('请选择菜单');
}
}
// let params = {
// ids
// };
this.$http.post('oper/crm/customer/delete', ids).then(({ data: res }) => {
console.log(res);
if (res.code === 0) {
this.$message.info("操作成功");
this.$refs.table.loadData();
} else {
return this.$message.error(res.internalMsg);
}
});
},
// //
config (row) { config(row) {
this.$refs['ref_config_form'].initData(row) this.$refs['ref_config_form'].initData(row);
}, },
// //
startLoading () { startLoading() {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: '正在加载……', //
background: 'rgba(0,0,0,.7)' // background: 'rgba(0,0,0,.7)' //
}) });
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() loading.close();
} }
} }
} }
} };
</script> </script>
<style lang="css"> <style lang="css">
.aaa { .aaa {

4
epmet-oper-web/src/views/modules/workPc/dataMenu.vue

@ -111,9 +111,9 @@ export default {
if (this.menuName != '') { if (this.menuName != '') {
let saveList = []; let saveList = [];
this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList); this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList);
this.$refs.form.data = saveList; this.dataList = [...saveList];
} else { } else {
this.$refs.form.data = this.dataList; this.getDataList();
} }
}, },

4
epmet-oper-web/src/views/modules/workPc/menu.vue

@ -107,9 +107,9 @@ export default {
if (this.menuName != '') { if (this.menuName != '') {
let saveList = []; let saveList = [];
this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList); this.onFuzzyTreeList('name', this.menuName, this.dataList, saveList);
this.$refs.form.data = saveList; this.dataList = [...saveList];
} else { } else {
this.$refs.form.data = this.dataList; this.getDataList();
} }
}, },

Loading…
Cancel
Save