<template>
|
<div class="edit-selClient-box">
|
<el-dialog
|
:title="editCommonConfig.title"
|
:visible.sync="editConfig.editVisible"
|
:width="dialogWidth"
|
:before-close="handleClose"
|
:append-to-body="true"
|
:close-on-click-modal="false"
|
>
|
<div class="bg-view">
|
<div class="query-bg">
|
<el-input placeholder="请输入内容" v-model="queryInput" size="mini" class="input-with-select">
|
<el-select v-model="select" slot="prepend" placeholder="请选择">
|
<el-option v-for="item in commonOptions" :key="item.id" :label="item.name" :value="item.name">
|
</el-option>
|
</el-select>
|
</el-input>
|
<div class="btn">
|
<el-button type="primary" size="mini" disabled>设置字段</el-button>
|
<el-button type="primary" size="mini" disabled>快速创建</el-button>
|
</div>
|
</div>
|
<TableCommonView ref="tableListRef" :table-list="tableList" :select-box="false" @selCommonClick="selNameClick">
|
</TableCommonView>
|
<div slot="footer" class="dialog-footer">
|
<div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div>
|
</div>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: "EditSelCommonDialog",
|
props: {
|
editCommonConfig: {
|
type: Object,
|
default: () => {
|
return {
|
editVisible: false,
|
title: "",
|
tableInfomation: []
|
}
|
}
|
}
|
},
|
components: {},
|
computed: {},
|
data() {
|
return {
|
dialogWidth: "50%",
|
editConfig: this.editCommonConfig,
|
queryInput: "",
|
select: "全部字段",
|
tableData: [],
|
searchSelOptions: [],
|
loading: false,
|
tableList: {},
|
commonOptions: []
|
}
|
},
|
created() {
|
this.setTable()
|
},
|
methods: {
|
setTable() {
|
if (this.editConfig.title === "销售总单") {
|
this.tableList = {
|
tableInfomation: this.editConfig.tableInfomation,
|
tableColumn: [
|
{ label: "单据编号", prop: "number", isClick: true }, // 单据编号
|
{ label: "负责人", prop: "member_id" } // 负责人
|
]
|
}
|
} else if (this.editConfig.title === "服务合同") {
|
this.tableList = {
|
tableInfomation: this.editConfig.tableInfomation,
|
tableColumn: [
|
{ label: "客户名称", prop: "clientId" }, // 客户名称
|
{ label: "服务合同编号", prop: "number", isClick: true }, // 服务合同编号
|
{ label: "负责人", prop: "memberId" }, // 负责人
|
{ label: "合计", prop: "total" }, // 合计
|
{ label: "签约日期", prop: "signTime", isTime: true }, // 签约日期
|
{ label: "合同状态", prop: "serviceContractStatusId" } // 合同状态
|
]
|
}
|
} else if (this.editConfig.title === "销售明细单") {
|
this.tableList = {
|
tableInfomation: this.editConfig.tableInfomation,
|
tableColumn: [
|
{ label: "客户名称", prop: "clientId" }, // 客户名称
|
{ label: "订单编号", prop: "number", isClick: true }, // 订单编号
|
{ label: "签约日期", prop: "signTime" }, // 签约日期
|
{ label: "销售负责人", prop: "memberId" }, // 销售负责人
|
{ label: "合计", prop: "tptal" } // 合计
|
]
|
}
|
}
|
|
this.commonOptions = [{ id: 1, name: "全部字段" }]
|
for (let i = 1; i < this.tableList.tableColumn.length; i++) {
|
const label = this.tableList.tableColumn[i].label
|
this.commonOptions.push({ id: (i + 1).toString(), name: label })
|
}
|
},
|
handleClose() {
|
this.editConfig.editVisible = false
|
},
|
selNameClick(row) {
|
this.editConfig.editVisible = false
|
if (this.editConfig.title === "销售总单") {
|
this.$emit("selClient", row, "master")
|
} else if (this.editConfig.title === "服务合同") {
|
this.$emit("selClient", row, "serviceContract")
|
} else if (this.editConfig.title === "销售明细单") {
|
this.$emit("selClient", row, "contract")
|
}
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.bg-view {
|
margin: 10px;
|
.query-bg {
|
margin-bottom: 10px;
|
display: flex;
|
justify-content: space-between;
|
.el-input {
|
width: 310px;
|
.el-select {
|
width: 100px;
|
}
|
}
|
.btn {
|
float: right;
|
}
|
}
|
}
|
.sel-name {
|
color: $color-primary;
|
cursor: pointer;
|
}
|
.dialog-footer {
|
height: 40px;
|
line-height: 40px;
|
color: red;
|
}
|
::v-deep {
|
.input-with-select .el-input-group__prepend {
|
background-color: #fff;
|
}
|
}
|
</style>
|