Browse Source

客户删除

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

181
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,133 @@ 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: ids
};
this.$http.get(`oper/crm/customer/delete`, { params: params }).then(({ data: res }) => {
if (res.code === 0) {
return this.$message.info(res.data);
} 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 {

Loading…
Cancel
Save