Ver código fonte

组织架构,选择企业

qymljy 2 anos atrás
pai
commit
0f6cf33b41

+ 2 - 2
src/operation/moduleNormal/userManage/detail/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div>
   <div>
-    <detail-template :headData="mainAreaData" :title="`${userData.name}(${userData.accountno})`" :tabs="['负责团队','参与团队']" ownertable="user" :delParam="{id:'20221031141202',content:{userids:[router.currentRoute.value.query.id]}}" :disable="utils.isDisabled(userData.status,['ACTIVE'])">
+    <detail-template :headData="mainAreaData" :title="`${userData.name}(${userData.accountno})`" :tabs="['负责团队','参与团队']" ownertable="user"  :disable="utils.isDisabled(userData.status,['ACTIVE'])">
       <template #operation>
       <template #operation>
         <edit :disabled="utils.isDisabled(userData.status,['ACTIVE'])" :data="userData" @onSuccess="mianData"></edit>
         <edit :disabled="utils.isDisabled(userData.status,['ACTIVE'])" :data="userData" @onSuccess="mianData"></edit>
         <a-button type="primary" @click="reloadPassword">密码重置</a-button>
         <a-button type="primary" @click="reloadPassword">密码重置</a-button>
@@ -112,4 +112,4 @@ onMounted (()=>{
 })
 })
 </script>
 </script>
 <style>
 <style>
-</style>
+</style>

+ 97 - 0
src/template/selectEnterprise/index.vue

@@ -0,0 +1,97 @@
+// 选择企业
+<template>
+  <div>
+    <div @click="showModel">
+      <a-space>
+        <home-outlined/>
+        <slot name="text"></slot>
+      </a-space>
+    </div>
+    <a-modal v-model:visible="visible" title="选择企业" :bodyStyle="{padding:'10px'}" width="900px" :footer="null" :afterClose="handleCancel">
+      <a-input class="search-panel" v-model:value="search" placeholder="搜索内容" @keyup.enter="searchData" allowClear></a-input>
+      <a-table class="ant-table-striped" :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)" :scroll="{x:'max-content',y:'500px'}" :dataSource="dataSource" :columns="props.columns || columns" size="small" :pagination="{defaultPageSize:20,total:total}" @change="onChange">
+        <template #bodyCell="{ column,record }">
+          <slot name="tb_cell" :data="{column, record}"></slot>
+          <template v-if="column.dataIndex === 'operation'">
+            <a @click="onSelect(column,record)">选 择</a>
+          </template>
+        </template>
+      </a-table>
+    </a-modal>
+  </div>
+</template>
+
+<script setup>
+import {ref,defineProps,defineEmits,defineExpose} from 'vue'
+import { HomeOutlined } from '@ant-design/icons-vue';
+import Api  from '@/api/api'
+const props = defineProps({
+  param: Object,
+  columns:Array
+})
+const emit = defineEmits(['onSelect'])
+const visible = ref(false)
+const search = ref('')
+const total = ref(0)
+const dataSource = ref([])
+const columns = ref([{
+  title: '企业名称',
+  dataIndex: 'enterprisename',
+  key: 'enterprisename',
+  width:250
+},
+{
+  title: '联系人',
+  dataIndex: 'contact',
+  key: 'contact',
+},
+{
+  title: '联系电话',
+  dataIndex: 'phonenumber',
+  key: 'phonenumber',
+},{
+  title: '操作',
+  dataIndex: 'operation',
+  key: 'operation',
+}])
+const showModel = ()=>{
+  visible.value = true
+  tableData()
+}
+
+const onChange = (pagination, filters, sorter, { currentDataSource })=>{
+  props.param.content.pageNumber = pagination.current
+  props.param.content.pageSize = pagination.pageSize
+  tableData()
+}
+
+const tableData = async ()=>{
+  const res = await Api.requested(props.param)
+  dataSource.value = res.data
+  total.value = res.total
+}
+const searchData = ()=>{
+  props.param.content.where.condition = search.value
+  props.param.content.pageNumber = 1
+  tableData()
+}
+const onSelect = (val,record)=>{
+  emit('onSelect',record)
+  visible.value = false
+}
+const handleCancel = () =>{
+  search.value = ''
+}
+defineExpose({
+  visible
+})
+</script>
+<style scoped>
+.search-panel{
+  width: 300px;
+  margin-bottom:10px;
+}
+.ant-table-striped :deep td{
+  font-size: 12px;
+}
+</style>