|
@@ -1,11 +1,26 @@
|
|
|
<template>
|
|
|
+ <span>
|
|
|
+ <el-select
|
|
|
+ v-model="value"
|
|
|
+ :placeholder="configuration.placeholder"
|
|
|
+ style="width: 80%;border-right: none"
|
|
|
+ :disabled="disabled?disabled:false"
|
|
|
+ :multiple="configuration.multiple"
|
|
|
+ :collapse-tags="configuration.collapseTags">
|
|
|
+ <el-option
|
|
|
+ v-for="item in configuration.dicData.length !== 0?configuration.dicData:dicData"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.cname"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-button icon="el-icon-edit" @click="dialogVisible = true" style="width: 20%"></el-button>
|
|
|
<el-dialog
|
|
|
title="导入客户"
|
|
|
:visible.sync="dialogVisible"
|
|
|
class="el-dialogDeep"
|
|
|
append-to-body
|
|
|
width="80%">
|
|
|
-
|
|
|
<el-row style="margin-top: -5px;height: 0">
|
|
|
<el-col :span="5">
|
|
|
<div class="box">
|
|
@@ -23,40 +38,14 @@
|
|
|
ref="crud"
|
|
|
v-model="form"
|
|
|
:page.sync="page"
|
|
|
- @row-del="rowDel"
|
|
|
- @row-update="rowUpdate"
|
|
|
:before-open="beforeOpen"
|
|
|
:before-close="beforeClose"
|
|
|
- @row-save="rowSave"
|
|
|
@search-change="searchChange"
|
|
|
@search-reset="searchReset"
|
|
|
@refresh-change="refreshChange"
|
|
|
@selection-change="selectionChange"
|
|
|
@on-load="onLoad"
|
|
|
@tree-load="treeLoad">
|
|
|
- <template slot-scope="scope" slot="menu">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-view"
|
|
|
- size="small"
|
|
|
- @click.stop="beforeOpenPage(scope.row,scope.index)"
|
|
|
- >查看
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- size="small"
|
|
|
- @click.stop="editOpen(scope.row,scope.index)"
|
|
|
- >编辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="small"
|
|
|
- @click.stop="rowDel(scope.row,scope.index)"
|
|
|
- >删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</el-col>
|
|
@@ -66,6 +55,7 @@
|
|
|
<el-button type="primary" @click="confirmSelection" :disabled="configuration.multipleChoices === true?false:selection.length === 1?false:true">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ </span>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -74,11 +64,21 @@ import {customerList, typeSave, deleteDetails, getDeptLazyTree} from "@/api/basi
|
|
|
|
|
|
export default {
|
|
|
name: "customerInformation",
|
|
|
- props:['configuration'],
|
|
|
+ props:{
|
|
|
+ disabled:Boolean,
|
|
|
+ value:String,
|
|
|
+ configuration:Object,
|
|
|
+ },
|
|
|
+ model:{
|
|
|
+ prop:'value',
|
|
|
+ event:'returnBack'
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
form: {},
|
|
|
+ dicData:[],
|
|
|
dialogVisible: false,
|
|
|
+ value:'',
|
|
|
option: option,
|
|
|
parentId: 0,
|
|
|
dataList: [],
|
|
@@ -128,7 +128,21 @@ export default {
|
|
|
},
|
|
|
//确认导出触发
|
|
|
confirmSelection(){
|
|
|
- this.$emit('selectionChange',this.selection)
|
|
|
+ if (this.configuration.multipleChoices === true){
|
|
|
+ let value = []
|
|
|
+ for (let item in this.selection){
|
|
|
+ this.dicData.push({id:this.selection[item].id,cname:this.selection[item].cname})
|
|
|
+ value.push(this.selection[item].id)
|
|
|
+ }
|
|
|
+ this.value = value
|
|
|
+ }else {
|
|
|
+ this.dicData.push({id:this.selection[0].id,cname:this.selection[0].cname})
|
|
|
+ this.value = this.selection[0].id
|
|
|
+ }
|
|
|
+ console.log(this.dicData)
|
|
|
+ console.log(this.value)
|
|
|
+ this.selection = []
|
|
|
+ this.$emit('returnBack',this.value)
|
|
|
this.dialogVisible = false
|
|
|
},
|
|
|
//选中触发
|
|
@@ -140,44 +154,6 @@ export default {
|
|
|
this.page.currentPage = 1;
|
|
|
this.onLoad(this.page);
|
|
|
},
|
|
|
- //删除列表后面的删除按钮触发触发(row, index, done)
|
|
|
- rowDel(row, index, done) {
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- return deleteDetails(row.id);
|
|
|
- }).then(() => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.onLoad(this.page, {parentId: 0});
|
|
|
- });
|
|
|
- },
|
|
|
- //修改时的修改按钮点击触发
|
|
|
- rowUpdate(row, index, done, loading) {
|
|
|
- typeSave(row).then(() => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- // 数据回调进行刷新
|
|
|
- done(row);
|
|
|
- }, error => {
|
|
|
- window.console.log(error);
|
|
|
- loading();
|
|
|
- });
|
|
|
- },
|
|
|
- //新增修改时保存触发
|
|
|
- rowSave(row, done, loading) {
|
|
|
- typeSave(row).then(res => {
|
|
|
- console.log(res)
|
|
|
- done()
|
|
|
- })
|
|
|
- },
|
|
|
//查询全部
|
|
|
initData() {
|
|
|
customerList().then(res => {
|
|
@@ -194,13 +170,6 @@ export default {
|
|
|
column.addDisabled = true;
|
|
|
this.$refs.crud.rowAdd();
|
|
|
},
|
|
|
- //查看跳转页面
|
|
|
- beforeOpenPage(row, index) {
|
|
|
- this.$router.push({
|
|
|
- path: "/detailsPageEdit",
|
|
|
- query: {id: JSON.stringify(row.id)},
|
|
|
- });
|
|
|
- },
|
|
|
//新增跳转页面
|
|
|
beforeOpen(row, index) {
|
|
|
this.$router.push({
|
|
@@ -208,12 +177,6 @@ export default {
|
|
|
query: {id: JSON.stringify(row.id)},
|
|
|
});
|
|
|
},
|
|
|
- editOpen(row, index) {
|
|
|
- this.$router.push({
|
|
|
- path: "/detailsPageEdit",
|
|
|
- query: {id: JSON.stringify(row.id)},
|
|
|
- });
|
|
|
- },
|
|
|
//点击新增时触发
|
|
|
beforeClose(done) {
|
|
|
this.parentId = "";
|