| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <template>
- <ele-modal
- title="选择业务员"
- custom-class="ele-dialog-form long-dialog-form"
- :visible.sync="visible"
- :before-close="handleClose"
- :close-on-click-modal="false"
- top="5vh"
- :close-on-press-escape="false"
- append-to-body
- width="70%"
- :maxable="true"
- >
- <el-card shadow="never">
- <contentSearch @search="reload"></contentSearch>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- row-key="id"
- class="dict-table"
- @cell-click="cellClick"
- >
- <!-- 表头工具栏 -->
- <template v-slot:action="{ row }">
- <el-radio class="radio" v-model="radio" :label="row.id"
- ><i></i
- ></el-radio>
- </template>
- </ele-pro-table>
- </el-card>
- <div slot="footer">
- <el-button type="primary" size="small" @click="selected">选择</el-button>
- <el-button size="small" @click="handleClose">关闭</el-button>
- </div>
- </ele-modal>
- </template>
- <script>
- import { getUserPage } from '@/api/system/organization';
- import contentSearch from './contentSearch.vue';
- export default {
- components: { contentSearch },
- props: {
- classType: {
- type: Number | String,
- default: 1
- }
- },
- data() {
- return {
- visible: false,
- statusOptions: [
- { value: 1, label: '全职' },
- { value: 2, label: '兼职' },
- { value: 3, label: '实习' },
- { value: 4, label: '正式' },
- { value: 5, label: '试用' },
- { value: 6, label: '离职' }
- ],
- columns: [
- {
- action: 'action',
- slot: 'action',
- align: 'center',
- label: '选择',
- width: 60
- },
- {
- columnKey: 'index',
- type: 'index',
- width: 60,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left',
- label: '序号'
- },
- {
- prop: 'name',
- label: '姓名',
- slot: 'name',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'jobNumber',
- label: '工号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'postName',
- label: '岗位',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- // {
- // prop: 'factoryId',
- // label: '所属工厂',
- // sortable: 'custom',
- // showOverflowTooltip: true,
- // minWidth: 110,
- // formatter: (_row, _column, cellValue) => {
- // return this.factoryList.find((item) => item.id == cellValue)
- // ?.name;
- // }
- // },
- {
- prop: 'loginName',
- label: '用户账号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'sex',
- label: '性别',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 80,
- formatter: (_row, _column, cellValue) => {
- return cellValue == 1 ? '男' : cellValue == 2 ? '女' : '';
- }
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- width: 80,
- formatter: (_row, _column, cellValue) => {
- const dom = this.statusOptions.find((item) => {
- return item.value == cellValue;
- });
- return dom ? dom.label : '';
- }
- },
- {
- prop: 'isEnabled',
- align: 'center',
- label: '是否启用',
- showOverflowTooltip: true,
- formatter: (row, column) => {
- return row.isEnabled === 0
- ? '停用'
- : row.isEnabled === 1
- ? '启用'
- : '';
- }
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110,
- formatter: (_row, _column, cellValue) => {
- return this.$util.toDateString(cellValue);
- }
- }
- ],
- radio: null
- };
- },
- watch: {},
- methods: {
- open(item) {
- if (item) {
- this.radio = item.id;
- }
- this.visible = true;
- },
- // /* 表格数据源 */
- // datasource({ page, limit, where, order }) {
- // return contactPageUsages({
- // pageNum: page,
- // size: limit,
- // ...where,
- // status: '1'
- // });
- // },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return getUserPage({
- ...where,
- pageNum: page,
- size: limit,
- // groupId: this.organizationId,
- isQueryLZ: 0
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ page: 1, where });
- },
- // 单击获取id
- cellClick(row) {
- this.current = row;
- this.radio = row.id;
- },
- handleClose() {
- this.visible = false;
- this.current = null;
- this.radio = '';
- },
- selected() {
- if (!this.current) {
- return this.$message.warning('请选择业务员');
- }
- this.$emit('changePersonnel', this.current);
- this.handleClose();
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|