Browse Source

客户删除

wxz_dy_form_config
tianq 2 years ago
parent
commit
1f998f85e9
  1. 371
      epmet-oper-web/src/views/modules/customer/manage/CustomerList.vue

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

@ -1,187 +1,222 @@
<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" :model="tableParams" @keyup.enter.native="loadData()">
<el-form :inline="true" <el-form-item><el-input v-model="tableParams.customerName" placeholder="客户名称"></el-input></el-form-item>
:model="tableParams"
@keyup.enter.native="loadData()">
<el-form-item>
<el-input v-model="tableParams.customerName"
placeholder="客户名称">
</el-input>
</el-form-item>
<el-form-item> <el-form-item><el-button @click="loadData()">查询</el-button></el-form-item>
<el-button @click="loadData()">查询</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-button type="primary" <el-form-item><el-button type="danger" @click="del('')">删除</el-button></el-form-item>
@click="addOrUpdateHandle()">{{ $t('add') }}</el-button> </el-form>
</el-form-item>
</el-form>
<c-table column-type="" <c-table
ref="table" column-type="selection"
:url="tableUrl" ref="table"
:params="tableParams" :url="tableUrl"
keyword="CustomerList" :params="tableParams"
:operations="operations" keyword="CustomerList"
:tableHeight="tableHeight" :operations="operations"
:operationWidth="80" :tableHeight="tableHeight"
@config="config" :operationWidth="80"
@edit="edit" @config="config"
@init="init"> @edit="edit"
</c-table> @init="init"
<!-- 弹窗, 新增 / 修改 --> @del="del"
<add-or-update v-if="addOrUpdateVisible" @select="select"
ref="addOrUpdate" ></c-table>
@refreshDataList="getDataList"></add-or-update> <!-- 弹窗, 新增 / 修改 -->
</div> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-card> </div>
<edit-form ref="ref_edit_form" </el-card>
@refresh="loadData"></edit-form> <edit-form ref="ref_edit_form" @refresh="loadData"></edit-form>
<config-form ref="ref_config_form" <config-form ref="ref_config_form" @refresh="loadData"></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',
// tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/crm/customer/customerlist', // tableUrl: 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/crm/customer/customerlist',
tableParams: { tableParams: {
customerName: '' customerName: ''
}, },
// //
operations: [ operations: [
{ {
lable: '修改', // lable: '修改', //
size: 'mini', size: 'mini',
style: 'margin: 0 6px;', style: 'margin: 0 6px;',
type: 'text', type: 'text',
slot: '', slot: '',
plain: false, plain: false,
methodName: 'edit', // methodName: 'edit', //
isShow: (row) => { isShow: row => {
return true return true;
} }
}, },
{ {
lable: '配置', // lable: '配置', //
size: 'mini', size: 'mini',
style: 'margin: 0 6px;', style: 'margin: 0 6px;',
type: 'text', type: 'text',
slot: '', slot: '',
plain: false, plain: false,
methodName: 'config', // methodName: 'config', //
isShow: (row) => { isShow: row => {
return true return true;
} }
}, },
{ {
lable: '数字社区初始化', // lable: '数字社区初始化', //
size: 'mini', size: 'mini',
style: 'margin: 0 6px;', style: 'margin: 0 6px;',
type: 'text', type: 'text',
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: []
};
},
components: {
CTable,
EditForm,
ConfigForm,
AddOrUpdate
},
activated() {
this.$nextTick(() => {
this.$refs.table.doLayout(); //
});
},
mounted() {
// eslint-disable-next-line
console.log(this);
this.loadData();
},
computed: {
tableHeight() {
return this.clientHeight - 60 - 80 - 80 - 70;
},
...mapGetters(['clientHeight', 'env'])
},
methods: {
select(row) {
this.multipleSelection = row.map(item => {
return item.customerId;
});
console.log(this.multipleSelection);
},
//
loadData() {
this.$refs.table.loadData();
},
//
edit(row) {
this.$refs['ref_edit_form'].initData(row);
},
], //
addOrUpdateVisible: false // visible init(row) {
} let params = {
}, customerId: row.customerId,
components: { areaCode: row.rootAgencyAreaCode
CTable, EditForm, ConfigForm,AddOrUpdate };
},
activated () {
this.$nextTick(() => {
this.$refs.table.doLayout() //
})
},
mounted () {
// eslint-disable-next-line
console.log(this)
this.loadData()
},
computed: {
tableHeight () {
return this.clientHeight - 60 - 80 - 80 - 70
},
...mapGetters(['clientHeight', 'env'])
},
methods: {
// this.$http.get(`/oper/customize/icform/initCustomerForm/resi_base_info/`, { params: params }).then(({ data: res }) => {
loadData () { if (res.code === 0) {
this.$refs.table.loadData() return this.$message.info(res.data);
}, } else {
// return this.$message.error(res.internalMsg);
edit (row) { }
this.$refs['ref_edit_form'].initData(row) });
}, },
// del(row) {
init (row) { console.log('this.multipleSelection', row);
let params = { let ids = [];
customerId: row.customerId,
areaCode: row.rootAgencyAreaCode,
}
this.$http.get(`/oper/customize/icform/initCustomerForm/resi_base_info/`, {params: params}).then(({ data: res }) => { if (row != '') {
if (res.code === 0) { ids = [row.customerId];
return this.$message.info(res.data) } else {
} else { if (this.multipleSelection.length > 0) {
return this.$message.error(res.internalMsg) ids = this.multipleSelection;
} } else {
}) return this.$message.error('请选择菜单');
}, }
}
let params = {
ids: ids
};
// this.$http.get(`oper/crm/customer/delete`, { params: params }).then(({ data: res }) => {
config (row) { if (res.code === 0) {
this.$refs['ref_config_form'].initData(row) return this.$message.info(res.data);
}, } else {
return this.$message.error(res.internalMsg);
}
});
},
// //
startLoading () { config(row) {
loading = Loading.service({ this.$refs['ref_config_form'].initData(row);
lock: true, // },
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' // //
}) startLoading() {
}, loading = Loading.service({
// lock: true, //
endLoading () { text: '正在加载……', //
// clearTimeout(timer); background: 'rgba(0,0,0,.7)' //
if (loading) { });
loading.close() },
} //
} endLoading() {
} // clearTimeout(timer);
} if (loading) {
loading.close();
}
}
}
};
</script> </script>
<style lang="css"> <style lang="css">
.aaa { .aaa {

Loading…
Cancel
Save