移动系统liao
昨天 9f3ead22a8198d33891a0f8f23faec15dcfc731a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<script lang="ts" setup name="fBS_EnterpriseType">
import { ref, reactive, onMounted } from "vue";
import { auth } from '/@/utils/authFunction';
import { ElMessageBox, ElMessage } from "element-plus";
import { downloadStreamFile } from "/@/utils/download";
import { useFBS_EnterpriseTypeApi } from '/@/api/Customer/fBS_EnterpriseType';
import editDialog from '/@/views/Customer/fBS_EnterpriseType/component/editDialog.vue'
import printDialog from '/@/views/system/print/component/hiprint/preview.vue'
import ModifyRecord from '/@/components/table/modifyRecord.vue';
import ImportData from "/@/components/table/importData.vue";
import { chdir } from "node:process";
 
const fBS_EnterpriseTypeApi = useFBS_EnterpriseTypeApi();
const printDialogRef = ref();
const editDialogRef = ref();
const importDataRef = ref();
const state = reactive({
  exportLoading: false,
  tableLoading: false,
  stores: {},
  showAdvanceQueryUI: false,
  dropdownData: {} as any,
  selectData: [] as any[],
  tableQueryParams: {} as any,
  tableParams: {
    page: 1,
    pageSize: 20,
    total: 0,
    field: 'createTime', // 默认的排序字段
    order: 'descending', // 排序方向
    descStr: 'descending', // 降序排序的关键字符
  },
  tableData: [],
  tableDataCopy:[] //拷贝
});
 
// 页面加载时
onMounted(async () => {
});
 
// 查询操作
const handleQuery = async (params: any = {}) => {
 
  const result = await fBS_EnterpriseTypeApi.tree().then(res => res.data.result);
  state.tableParams.total = result?.total;
  state.tableData = result ?? [];
  state.tableLoading = false;
};
 
 
handleQuery();
const treeProps = reactive({
  checkStrictly: false,
  children: 'child',
 
})
 
// 删除
const delFBS_ExRole = (row: any) => {
  ElMessageBox.confirm(`确定要删除吗?`, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  }).then(async () => {
    await fBS_EnterpriseTypeApi.delete({ id: row.id });
    handleQuery();
    ElMessage.success("删除成功");
  }).catch(() => {});
};
 
</script>
<template>
  <div class="fBS_EnterpriseType-container" v-loading="state.exportLoading">
    <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
      <el-form :model="state.tableQueryParams" ref="queryForm" labelWidth="90">
        <el-row>         
          <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
            <el-form-item>
              <el-button-group style="display: flex; align-items: center;">
                <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="editDialogRef.openDialog(null,state.tableData, '新增企业分类')" v-auth="'fBS_EnterpriseType:add'"> 新增 </el-button>
                <el-button type="warning" style="margin-left:5px;" icon="ele-MostlyCloudy"
                  @click="importDataRef.openDialog()" v-auth="'fBS_EnterpriseType:import'"> 导入 </el-button>
              </el-button-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-card>
    
    <el-card>
      <el-table :data="state.tableData" :tree-props="treeProps" lazy row-key="id"          
       >
        <el-table-column type="selection" width="55" />
        <el-table-column prop="name" label="名称" />
        <el-table-column prop="code" label="编码" />
        <el-table-column prop="description" label="描述" />
        <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip v-if="auth('fBS_EnterpriseType:update') || auth('fBS_EnterpriseType:delete')">
          <template #default="scope">
            <el-button icon="ele-Edit" size="small" text type="primary" @click="editDialogRef.openDialog(scope.row, state.tableData,'编辑')" v-auth="'fBS_EnterpriseType:update'"> 编辑 </el-button>
            <el-button icon="ele-Delete" size="small" text type="primary" @click="delFBS_ExRole(scope.row)" v-auth="'fBS_EnterpriseType:delete'"> 删除 </el-button>
          </template>
        </el-table-column>
       
      </el-table>
      <editDialog ref="editDialogRef" @reloadTable="handleQuery" />
    </el-card>
  </div>
 
</template>
<style scoped>
:deep(.el-input),
:deep(.el-select),
:deep(.el-input-number) {
  width: 100%;
}
</style>