Browse Source

客户删除

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

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

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

Loading…
Cancel
Save