提交
This commit is contained in:
parent
44bd6f336c
commit
274ab38926
|
@ -9,6 +9,18 @@ export function listCustomer(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据ID列表查询客户
|
||||||
|
export function listCustomerByIds(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/bst/customer/listByIds',
|
||||||
|
headers: {
|
||||||
|
repeatSubmit: true
|
||||||
|
},
|
||||||
|
method: 'post',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询客户详细
|
// 查询客户详细
|
||||||
export function getCustomer(id) {
|
export function getCustomer(id) {
|
||||||
return request({
|
return request({
|
||||||
|
|
156
src/components/Business/Customer/CustomerDialog.vue
Normal file
156
src/components/Business/Customer/CustomerDialog.vue
Normal file
|
@ -0,0 +1,156 @@
|
||||||
|
<template>
|
||||||
|
<check-dialog
|
||||||
|
:show.sync="dialogVisible"
|
||||||
|
:title="title"
|
||||||
|
:columns="columns"
|
||||||
|
:selected-ids="selectedIds"
|
||||||
|
:list-api="listApi"
|
||||||
|
:load-api="loadApi"
|
||||||
|
:query="queryParams"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
ref="checkDialog"
|
||||||
|
>
|
||||||
|
<template #search-form>
|
||||||
|
<el-form-item label="客户编号" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入客户编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入客户名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable @change="handleQuery">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.customer_status"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号" prop="mobile">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.mobile"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="微信号" prop="wechat">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.wechat"
|
||||||
|
placeholder="请输入微信号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="跟进人" prop="followId">
|
||||||
|
<user-select v-model="queryParams.followId" @change="handleQuery"/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #status="{row}">
|
||||||
|
<dict-tag :options="dict.type.customer_status" :value="row.status" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</check-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listCustomer, listCustomerByIds } from "@/api/bst/customer";
|
||||||
|
import CheckDialog from "@/components/CheckDialog/index.vue";
|
||||||
|
import UserSelect from "@/components/Business/User/UserSelect.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "CustomerDialog",
|
||||||
|
components: {
|
||||||
|
CheckDialog,
|
||||||
|
UserSelect
|
||||||
|
},
|
||||||
|
dicts: ['customer_status'],
|
||||||
|
props: {
|
||||||
|
// 弹窗标题
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "选择客户"
|
||||||
|
},
|
||||||
|
// 是否显示弹窗
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 默认选中的ID列表
|
||||||
|
selectedIds: {
|
||||||
|
type: [String, Array],
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
// 列表API
|
||||||
|
listApi: {
|
||||||
|
type: Function,
|
||||||
|
default: listCustomer
|
||||||
|
},
|
||||||
|
// 加载API
|
||||||
|
loadApi: {
|
||||||
|
type: Function,
|
||||||
|
default: listCustomerByIds
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
code: null,
|
||||||
|
name: null,
|
||||||
|
status: null,
|
||||||
|
intentLevel: null,
|
||||||
|
mobile: null,
|
||||||
|
wechat: null,
|
||||||
|
followId: null
|
||||||
|
},
|
||||||
|
// 字段列表
|
||||||
|
columns: [
|
||||||
|
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||||
|
{key: 'code', visible: true, label: '编号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'name', visible: true, label: '名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'mobile', visible: true, label: '手机号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'wechat', visible: true, label: '微信号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'followName', visible: true, label: '跟进人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
dialogVisible: {
|
||||||
|
get() {
|
||||||
|
return this.show;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$emit("update:show", val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 确认选择
|
||||||
|
handleConfirm(selection) {
|
||||||
|
this.$emit('confirm', selection);
|
||||||
|
},
|
||||||
|
// 处理查询
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.checkDialog.handleQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
57
src/components/Business/Customer/CustomerInput.vue
Normal file
57
src/components/Business/Customer/CustomerInput.vue
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
:value="text"
|
||||||
|
@focus="showDialog = true"
|
||||||
|
placeholder="点击选择客户"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<customer-dialog
|
||||||
|
:show.sync="showDialog"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:selectedIds="value"
|
||||||
|
:multiple="multiple"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CustomerDialog from '@/components/Business/Customer/CustomerDialog.vue';
|
||||||
|
export default {
|
||||||
|
components: { CustomerDialog },
|
||||||
|
props: {
|
||||||
|
// 选中数据
|
||||||
|
value: {
|
||||||
|
type: [String, Array],
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 文本
|
||||||
|
text: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
// 是否多选
|
||||||
|
multiple: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showDialog: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleConfirm(selection) {
|
||||||
|
if (this.multiple) {
|
||||||
|
this.$emit('input', selection.map(item => item.id));
|
||||||
|
this.$emit('update:text', selection.map(item => item.name).join(','));
|
||||||
|
} else {
|
||||||
|
this.$emit('input', selection?.id);
|
||||||
|
this.$emit('update:text', selection?.name);
|
||||||
|
}
|
||||||
|
this.$emit('confirm', selection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
247
src/components/CheckDialog/index.vue
Normal file
247
src/components/CheckDialog/index.vue
Normal file
|
@ -0,0 +1,247 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="title"
|
||||||
|
width="1080px"
|
||||||
|
append-to-body
|
||||||
|
@open="init"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<!-- 搜索区域 -->
|
||||||
|
<el-form :model="query" ref="queryForm" :inline="true" label-width="68px" size="small">
|
||||||
|
<slot name="search-form"></slot>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<!-- 数据列表 -->
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="list"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@row-click="handleRowClick"
|
||||||
|
@row-dblclick="handleRowDbClick"
|
||||||
|
:highlight-current-row="!multiple"
|
||||||
|
height="400"
|
||||||
|
ref="table"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" v-if="multiple" />
|
||||||
|
<template v-for="(column, index) in columns">
|
||||||
|
<el-table-column
|
||||||
|
:key="index"
|
||||||
|
:prop="column.key"
|
||||||
|
:label="column.label"
|
||||||
|
:align="column.align || 'center'"
|
||||||
|
:width="column.width"
|
||||||
|
:min-width="column.minWidth"
|
||||||
|
:show-overflow-tooltip="column.overflow"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<slot :name="column.key" :row="scope.row">
|
||||||
|
{{ scope.row[column.key] | dv }}
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="query.pageNum"
|
||||||
|
:limit.sync="query.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 底部按钮 -->
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleConfirm">确 定</el-button>
|
||||||
|
<el-button @click="handleClose">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "CheckDialog",
|
||||||
|
props: {
|
||||||
|
// 弹窗标题
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "选择数据"
|
||||||
|
},
|
||||||
|
// 是否显示弹窗
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 默认选中的ID列表
|
||||||
|
selectedIds: {
|
||||||
|
type: [String, Array],
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 表格列配置
|
||||||
|
columns: {
|
||||||
|
type: Array,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
// 获取列表数据的API
|
||||||
|
listApi: {
|
||||||
|
type: Function,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
// 获取详情数据的API
|
||||||
|
loadApi: {
|
||||||
|
type: Function,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
// 选中数据对应的ID字段
|
||||||
|
prop: {
|
||||||
|
type: String,
|
||||||
|
default: "id"
|
||||||
|
},
|
||||||
|
// 多选
|
||||||
|
multiple: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
// 查询条件
|
||||||
|
query: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
// 选中数据ID
|
||||||
|
selection: [],
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 表格数据
|
||||||
|
list: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
dialogVisible: {
|
||||||
|
get() {
|
||||||
|
return this.show;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$emit("update:show", val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化
|
||||||
|
async init() {
|
||||||
|
this.query.pageNum = 1;
|
||||||
|
this.query.pageSize = 20;
|
||||||
|
if (this.multiple) {
|
||||||
|
this.selection = [...this.selectedIds];
|
||||||
|
} else {
|
||||||
|
this.selection = [this.selectedIds];
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
// 查询列表
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
this.listApi(this.query).then(res => {
|
||||||
|
this.list = res.rows;
|
||||||
|
this.total = res.total;
|
||||||
|
this.loading = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// 回显数据
|
||||||
|
this.list.forEach(row => {
|
||||||
|
const index = this.selection.findIndex(item => item === row[this.prop]);
|
||||||
|
if (index !== -1) {
|
||||||
|
this.$refs.table.toggleRowSelection(this.list[index], true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 搜索按钮操作
|
||||||
|
handleQuery() {
|
||||||
|
this.query.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
// 重置按钮操作
|
||||||
|
resetQuery() {
|
||||||
|
this.$refs["queryForm"].resetFields();
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.selection = selection.map(item => item[this.prop]);
|
||||||
|
},
|
||||||
|
// 确认按钮
|
||||||
|
handleConfirm() {
|
||||||
|
if (this.loadApi) {
|
||||||
|
this.loading = true;
|
||||||
|
this.loadApi(this.selection).then((res) => {
|
||||||
|
this.confirm(res.data);
|
||||||
|
this.handleClose();
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.confirm(res.data);
|
||||||
|
this.handleClose();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirm(data) {
|
||||||
|
if (this.multiple) {
|
||||||
|
this.$emit("confirm", data);
|
||||||
|
} else {
|
||||||
|
if (data.length > 0) {
|
||||||
|
this.$emit("confirm", data[0]);
|
||||||
|
} else {
|
||||||
|
this.$emit("confirm", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 关闭弹窗
|
||||||
|
handleClose() {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
},
|
||||||
|
// 处理行点击
|
||||||
|
handleRowClick(row) {
|
||||||
|
if (this.multiple) {
|
||||||
|
if (this.selection.includes(row[this.prop])) {
|
||||||
|
this.$refs.table.toggleRowSelection(row, false);
|
||||||
|
} else {
|
||||||
|
this.$refs.table.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.selection = [row[this.prop]];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 处理行双击
|
||||||
|
handleRowDbClick(row) {
|
||||||
|
if (!this.multiple) {
|
||||||
|
this.selection = [row[this.prop]];
|
||||||
|
this.handleConfirm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.el-dialog {
|
||||||
|
.el-table {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -14,7 +14,7 @@
|
||||||
<image-upload v-model="form.picture" />
|
<image-upload v-model="form.picture" />
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col :span="span" label="客户" prop="customerId">
|
<form-col :span="span" label="客户" prop="customerId">
|
||||||
<el-input v-model="form.customerId" placeholder="请输入客户名称"/>
|
<customer-input v-model="form.customerId" :text.sync="form.customerName" />
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col :span="span" label="跟进方式" prop="type">
|
<form-col :span="span" label="跟进方式" prop="type">
|
||||||
<el-select v-model="form.type" placeholder="请选择跟进方式" style="width: 100%;">
|
<el-select v-model="form.type" placeholder="请选择跟进方式" style="width: 100%;">
|
||||||
|
@ -48,6 +48,7 @@
|
||||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||||
<el-button @click="handleClose">取 消</el-button>
|
<el-button @click="handleClose">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -55,11 +56,11 @@
|
||||||
import { getCustomerFollow, addCustomerFollow, updateCustomerFollow } from "@/api/bst/customerFollow";
|
import { getCustomerFollow, addCustomerFollow, updateCustomerFollow } from "@/api/bst/customerFollow";
|
||||||
import FormCol from "@/components/FormCol/index.vue";
|
import FormCol from "@/components/FormCol/index.vue";
|
||||||
import UserSelect from '@/components/Business/User/UserSelect.vue';
|
import UserSelect from '@/components/Business/User/UserSelect.vue';
|
||||||
|
import CustomerInput from '@/components/Business/Customer/CustomerInput.vue';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CustomerFollowEditDialog",
|
name: "CustomerFollowEditDialog",
|
||||||
components: { FormCol, UserSelect },
|
components: { FormCol, UserSelect, CustomerInput },
|
||||||
dicts: ['customer_follow_type'],
|
dicts: ['customer_follow_type'],
|
||||||
props: {
|
props: {
|
||||||
show: {
|
show: {
|
||||||
|
@ -81,16 +82,16 @@ export default {
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
customerId: [
|
customerId: [
|
||||||
{ required: true, message: "客户不能为空", trigger: "blur" }
|
{ required: true, message: "客户不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
type: [
|
type: [
|
||||||
{ required: true, message: "跟进方式不能为空", trigger: "change" }
|
{ required: true, message: "跟进方式不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
content: [
|
content: [
|
||||||
{ required: true, message: "跟进内容不能为空", trigger: "blur" }
|
{ required: true, message: "跟进内容不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
userId: [
|
userId: [
|
||||||
{ required: true, message: "跟进人不能为空", trigger: "blur" }
|
{ required: true, message: "跟进人不能为空", trigger: "change" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -128,7 +129,8 @@ export default {
|
||||||
content: null,
|
content: null,
|
||||||
picture: null,
|
picture: null,
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
nextFollowTime: null
|
nextFollowTime: null,
|
||||||
|
customerName: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
|
|
@ -56,22 +56,13 @@
|
||||||
:default-expand-all="isExpandAll"
|
:default-expand-all="isExpandAll"
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
>
|
>
|
||||||
<el-table-column prop="deptName" label="车间工序名称"/>
|
<el-table-column prop="deptName" label="部门名称"/>
|
||||||
<el-table-column prop="orderNum" label="排序" width="100" align="center"/>
|
<el-table-column prop="orderNum" label="排序" width="100" align="center"/>
|
||||||
<el-table-column prop="status" label="状态" width="100" align="center">
|
<el-table-column prop="status" label="状态" width="100" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="负责人" align="center" >
|
|
||||||
<template slot-scope="d">
|
|
||||||
<template v-if="!isEmpty(d.row.leaderList)">
|
|
||||||
<el-tag type="primary" size="mini" v-for="item of d.row.leaderList">
|
|
||||||
{{item.nickName | dv}}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
@ -108,11 +99,11 @@
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<!-- <form-col :span="span" label="上级部门" prop="parentId" v-if="form.parentId !== 0">
|
<form-col :span="span" label="上级部门" prop="parentId" v-if="form.parentId !== 0">
|
||||||
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
|
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
|
||||||
</form-col> -->
|
</form-col>
|
||||||
<form-col :span="span" label="名称" prop="deptName">
|
<form-col :span="span" label="名称" prop="deptName">
|
||||||
<el-input v-model="form.deptName" placeholder="请输入车间名称" />
|
<el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col :span="span" label="状态">
|
<form-col :span="span" label="状态">
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status">
|
||||||
|
@ -126,9 +117,6 @@
|
||||||
<form-col :span="span" label="显示排序" prop="orderNum">
|
<form-col :span="span" label="显示排序" prop="orderNum">
|
||||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" style="width: 100%" placeholder="请输入显示排序" />
|
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" style="width: 100%" placeholder="请输入显示排序" />
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col :span="span" label="负责人" prop="leaderId">
|
|
||||||
<user-input v-model="form.leaderIds" multiple/>
|
|
||||||
</form-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -267,7 +255,7 @@ export default {
|
||||||
this.form.parentId = row.deptId;
|
this.form.parentId = row.deptId;
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加车间";
|
this.title = "添加部门";
|
||||||
listDept().then(response => {
|
listDept().then(response => {
|
||||||
this.deptOptions = this.handleTree(response.data, "deptId");
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
||||||
});
|
});
|
||||||
|
@ -286,7 +274,7 @@ export default {
|
||||||
getDept(row.deptId).then(response => {
|
getDept(row.deptId).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改车间";
|
this.title = "修改部门";
|
||||||
listDeptExcludeChild(row.deptId).then(response => {
|
listDeptExcludeChild(row.deptId).then(response => {
|
||||||
this.deptOptions = this.handleTree(response.data, "deptId");
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
||||||
if (this.deptOptions.length == 0) {
|
if (this.deptOptions.length == 0) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!--部门数据-->
|
<!--部门数据-->
|
||||||
<!-- <el-col :span="4" :xs="24">
|
<el-col :span="4" :xs="24">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="deptName"
|
v-model="deptName"
|
||||||
|
@ -26,9 +26,9 @@
|
||||||
@node-click="handleNodeClick"
|
@node-click="handleNodeClick"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-col> -->
|
</el-col>
|
||||||
<!--用户数据-->
|
<!--用户数据-->
|
||||||
<el-col :span="24" >
|
<el-col :span="20" :xs="24">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="姓名" prop="nickName">
|
<el-form-item label="姓名" prop="nickName">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -154,12 +154,6 @@
|
||||||
<template v-else-if="column.key === 'employStatus'">
|
<template v-else-if="column.key === 'employStatus'">
|
||||||
<dict-tag :value="d.row.employStatus" :options="dict.type.user_employ_status"/>
|
<dict-tag :value="d.row.employStatus" :options="dict.type.user_employ_status"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="['birthday'].includes(column.key)">
|
|
||||||
{{calcBirthDay(d.row[column.key], new Date()) | dv}} 岁
|
|
||||||
</template>
|
|
||||||
<template v-else-if="['employDate'].includes(column.key)">
|
|
||||||
{{calcFullYear(d.row[column.key], new Date()) | dv}} 年
|
|
||||||
</template>
|
|
||||||
<template v-else-if="column.key === 'roles'">
|
<template v-else-if="column.key === 'roles'">
|
||||||
<template v-for="(role, index) in d.row.roles">
|
<template v-for="(role, index) in d.row.roles">
|
||||||
<el-tag :key="index" v-if="!isEmpty(role.roleName)">{{role.roleName}}</el-tag>
|
<el-tag :key="index" v-if="!isEmpty(role.roleName)">{{role.roleName}}</el-tag>
|
||||||
|
@ -216,15 +210,12 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 添加或修改用户配置对话框 -->
|
<!-- 添加或修改用户配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body :close-on-click-modal="false">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<!-- <form-col :span="24" label="归属部门" prop="deptId">
|
<form-col :span="24" label="归属部门" prop="deptId">
|
||||||
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
||||||
</form-col> -->
|
</form-col>
|
||||||
<!-- <form-col :span="12" label="工号" prop="userNo">-->
|
|
||||||
<!-- <el-input v-model="form.userNo" placeholder="请输入工号" maxlength="30" />-->
|
|
||||||
<!-- </form-col>-->
|
|
||||||
<form-col :span="12" label="姓名" prop="nickName">
|
<form-col :span="12" label="姓名" prop="nickName">
|
||||||
<el-input v-model="form.nickName" placeholder="请输入姓名" maxlength="30" />
|
<el-input v-model="form.nickName" placeholder="请输入姓名" maxlength="30" />
|
||||||
</form-col>
|
</form-col>
|
||||||
|
@ -254,39 +245,24 @@
|
||||||
>{{dict.label}}</el-radio>
|
>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</form-col>
|
</form-col>
|
||||||
<!-- <form-col :span="12" label="在职情况" prop="employStatus">-->
|
<form-col :span="12" label="手机号码" prop="phonenumber">
|
||||||
<!-- <el-radio-group v-model="form.employStatus">-->
|
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||||
<!-- <el-radio-->
|
</form-col>
|
||||||
<!-- v-for="dict in dict.type.user_employ_status"-->
|
<form-col :span="12" label="邮箱" prop="email">
|
||||||
<!-- :key="dict.value"-->
|
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||||
<!-- :label="dict.value"-->
|
</form-col>
|
||||||
<!-- >{{dict.label}}</el-radio>-->
|
<form-col :span="12" label="入职日期" prop="birthday">
|
||||||
<!-- </el-radio-group>-->
|
<el-date-picker style="width: 100%" clearable v-model="form.employDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"/>
|
||||||
<!-- </form-col>-->
|
</form-col>
|
||||||
<!-- <form-col :span="12" label="手机号码" prop="phonenumber">-->
|
<form-col :span="12" label="用户性别">
|
||||||
<!-- <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />-->
|
<el-radio-group v-model="form.sex">
|
||||||
<!-- </form-col>-->
|
<el-radio
|
||||||
<!-- <form-col :span="12" label="邮箱" prop="email">-->
|
v-for="dict in dict.type.sys_user_sex"
|
||||||
<!-- <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />-->
|
:key="dict.value"
|
||||||
<!-- </form-col>-->
|
:label="dict.value"
|
||||||
<!-- <form-col :span="12" label="出生日期" prop="birthday">-->
|
>{{dict.label}}</el-radio>
|
||||||
<!-- <el-date-picker style="width: 100%" clearable v-model="form.birthday" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"/>-->
|
</el-radio-group>
|
||||||
<!-- </form-col>-->
|
</form-col>
|
||||||
<!-- <form-col :span="12" label="入职日期" prop="birthday">-->
|
|
||||||
<!-- <el-date-picker style="width: 100%" clearable v-model="form.employDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"/>-->
|
|
||||||
<!-- </form-col>-->
|
|
||||||
<!-- <form-col :span="12" label="用户性别">-->
|
|
||||||
<!-- <el-radio-group v-model="form.sex">-->
|
|
||||||
<!-- <el-radio-->
|
|
||||||
<!-- v-for="dict in dict.type.sys_user_sex"-->
|
|
||||||
<!-- :key="dict.value"-->
|
|
||||||
<!-- :label="dict.value"-->
|
|
||||||
<!-- >{{dict.label}}</el-radio>-->
|
|
||||||
<!-- </el-radio-group>-->
|
|
||||||
<!-- </form-col>-->
|
|
||||||
<form-col :span="24" label="备注">
|
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
|
||||||
</form-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -404,9 +380,9 @@ export default {
|
||||||
{key: 'userId', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'userId', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'nickName', visible: true, label: '姓名', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'nickName', visible: true, label: '姓名', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'userName', visible: true, label: '登录账号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'userName', visible: true, label: '登录账号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'deptName', visible: true, label: '归属部门', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'roles', visible: true, label: '角色', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'roles', visible: true, label: '角色', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'status', visible: true, label: '账号状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'status', visible: true, label: '账号状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
|
||||||
{key: 'loginIp', visible: true, label: '最后登录IP', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'loginIp', visible: true, label: '最后登录IP', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'loginDate', visible: true, label: '最后登录时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'loginDate', visible: true, label: '最后登录时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
@ -421,7 +397,6 @@ export default {
|
||||||
{ min: 2, max: 20, message: '登录账号长度必须介于 2 和 20 之间', trigger: 'blur' }
|
{ min: 2, max: 20, message: '登录账号长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
phonenumber: [
|
phonenumber: [
|
||||||
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
|
||||||
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
|
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
|
||||||
],
|
],
|
||||||
deptId: [
|
deptId: [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user