更新目录结构

This commit is contained in:
2023-10-21 17:45:00 +08:00
parent 59cc869bb2
commit 664295167d
55 changed files with 1856 additions and 6329 deletions

View File

@@ -0,0 +1,42 @@
import config from "@/config"
import http from "@/utils/request"
export default {
company:{
list: {
url: `${config.API_URL}customer/company/index`,
name: "企业列表",
get: function(params){
return http.get(this.url, params);
}
},
detail: {
url: `${config.API_URL}customer/company/detail`,
name: "企业详情",
get: function(params){
return http.get(this.url, params);
}
},
insert: {
url: `${config.API_URL}customer/company/insert`,
name: "导入公司信息",
post: async function(data={}){
return await http.post(this.url, data);
}
},
add: {
url: `${config.API_URL}customer/company/add`,
name: "添加信息",
post: async function(data={}){
return await http.post(this.url, data);
}
},
edit: {
url: `${config.API_URL}customer/company/edit`,
name: "修改信息",
post: async function(data={}){
return await http.post(this.url, data);
}
}
},
}

View File

@@ -12,7 +12,7 @@ const DEFAULT_CONFIG = {
CORE_VER: "1.6.6",
//接口地址
API_URL: "http://127.0.0.1/",
API_URL: "http://127.0.0.1:8000/",
// API_URL: "http://q.dxpd.cn/",
//请求超时

View File

@@ -0,0 +1,38 @@
<template>
<div class="tool">
<el-icon-minus class="btn" @click="minimizeWin" :size="10">最小化</el-icon-minus>
<el-icon-full-screen class="btn" @click="maximizeWin" :size="8">最大化</el-icon-full-screen>
<el-icon-close class="btn" @click="closeWin" :size="10">关闭窗口</el-icon-close>
</div>
</template>
<script>
import { ipcRenderer } from "electron"
export default {
name: 'HelloWorld',
props: {
msg: String
},
created(){
},
methods: {
closeWin(){
ipcRenderer.send('controller.system.closeWin')
},
minimizeWin(){
ipcRenderer.send('controller.system.minimizeWin')
},
maximizeWin(){
ipcRenderer.send('controller.system.maximizeWin')
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.tool{display: flex; flex-direction: row; align-items: center; justify-content: end; gap: 8px; -webkit-app-region: drag; padding-right: 10px;}
.tool .btn{-webkit-app-region: no-drag; width: 14px; height: 14px;}
</style>

View File

@@ -0,0 +1,67 @@
<template>
<el-container>
<el-header>
<el-page-header :content="detail.name" @back="goBack" />
</el-header>
<el-main>
<el-card shadow="never" header="公司信息">
<el-descriptions border :column="2">
<el-descriptions-item label="统一社会信用代码">{{detail.org_code}}</el-descriptions-item>
<el-descriptions-item label="公司名称">{{detail.name}}</el-descriptions-item>
<el-descriptions-item label="注册资金">{{detail.reg_capital}}</el-descriptions-item>
<el-descriptions-item label="登记状态">{{detail.status}}</el-descriptions-item>
<el-descriptions-item label="成立日期">{{detail.reg_date}}</el-descriptions-item>
<el-descriptions-item label="人员规模">{{detail.staff_num}}</el-descriptions-item>
<el-descriptions-item label="营收规模">{{detail.turnover}}</el-descriptions-item>
<el-descriptions-item label="参保人数">{{detail.social_insurance}}</el-descriptions-item>
<el-descriptions-item label="所属区域">{{detail.area_t}}</el-descriptions-item>
<el-descriptions-item label="所属行业">{{detail.industry_t}}</el-descriptions-item>
<el-descriptions-item label="是否上市">{{detail.is_ipo}}</el-descriptions-item>
<el-descriptions-item label="融资信息">{{detail.finance_info}}</el-descriptions-item>
<el-descriptions-item label="网址">{{detail.website}}</el-descriptions-item>
<el-descriptions-item label="注册地址">{{detail.reg_address}}</el-descriptions-item>
<el-descriptions-item label="经营范围">{{detail.business}}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card shadow="never" header="成员信息" style="margin-top: 10px">
<el-table :data="detail.contact" style="width: 100%">
<el-table-column prop="name" label="姓名" width="180" />
<el-table-column prop="sex" label="性别" width="180" />
<el-table-column prop="job" label="职务" />
<el-table-column prop="mobile" label="手机号码" />
<el-table-column prop="phone" label="单位电话" />
<el-table-column prop="phone" label="是否法人" />
</el-table>
</el-card>
</el-main>
</el-container>
</template>
<script>
import useTabs from '@/utils/useTabs'
export default {
data() {
return {
detail: {}
}
},
mounted(){
this.getCompanyDetail();
},
methods:{
async getCompanyDetail(){
let id = this.$router.currentRoute.value.query.id;
let res = await this.$API.customer.company.detail.get({id: id});
if(res.code == 1){
this.detail = res.data;
useTabs.setTitle(this.detail.name)
}
},
goBack(){
this.$router.go(-1)
}
}
}
</script>

View File

@@ -0,0 +1,112 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'addCompany'"></el-button>
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del" v-auth="'deleteCompany'"></el-button>
<div style="padding: 10px;" v-auth="'insertCompany'"><el-upload :before-upload="beforeUpload" :show-file-list="false"><el-button type="primary" icon="el-icon-upload">导入</el-button></el-upload></div>
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input v-model="search.name" placeholder="公司名称" style="width:150px" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
<el-button type="primary" icon="el-icon-arrow-down-bold" @click="moreSearch"></el-button>
<el-button type="primary" icon="el-icon-download" @click="upsearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" :column="columnList" row-key="id" @selection-change="selectionChange" stripe>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button type="text" size="small" @click="table_show(scope.row, scope.$index)" v-auth="'showDetail'">查看</el-button>
<el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)" v-auth="'editCompany'">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button type="text" size="small" v-auth="'deleteCompany'">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
<search v-if="dialog.search" ref="searchBox" @success="moreUpsearch" @closed="dialog.search=false"></search>
<save-box v-if="dialog.save" ref="saveBox"></save-box>
</el-container>
</template>
<script>
import search from './search.vue';
import saveBox from './save.vue';
import imports from '@/mixin/import';
export default{
components:{
search,
saveBox
},
mixins: [imports],
data(){
return {
dialog: {
search: false
},
apiObj: this.$API.customer.company.list,
selection: [],
columnList: [
{label: "公司名称", prop: "name", width: "150"},
{label: "区域", prop: "area_t", width: "150"},
{label: "行业", prop: "industry_t", width: "150"},
{label: "注册资金", prop: "reg_capital", width: "150"},
{label: "员工人数", prop: "staff_num", width: "150", hide: true},
{label: "社保人数", prop: "social_insurance", width: "150"},
{label: "上市状态", prop: "is_ipo", width: "150"},
{label: "营收规模", prop: "turnover", width: "150"},
{label: "企业状态", prop: "status", width: "150"},
],
search: {}
}
},
methods:{
upsearch(){
this.$refs.table.reload(this.search);
},
moreUpsearch(search){
this.search = search;
this.upsearch();
},
moreSearch(){
this.dialog.search = true
this.$nextTick(() => {
this.$refs.searchBox.open().setData(this.search)
})
},
//表格选择后回调事件
selectionChange(selection){
this.selection = selection;
},
batch_del(){
},
table_show(row){
this.$router.push('/company/detail?id='+row.id)
},
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveBox.open()
})
},
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveBox.open('edit').setData(row)
})
},
table_del(){
}
}
}
</script>

View File

@@ -0,0 +1,118 @@
<template>
<el-drawer :title="titleMap[mode]" v-model="visible" size="80%" destroy-on-close @closed="$emit('closed')">
<el-form :model="form" ref="dialogForm" label-width="150px" style="padding: 10px">
<el-form-item label="公司名称">
<el-input v-model="form.name" placeholder="公司名称" clearable></el-input>
</el-form-item>
<el-form-item label="营业执照编号">
<el-input v-model="form.reg_code" placeholder="营业执照编号" clearable></el-input>
</el-form-item>
<el-form-item label="联系人" prop="contact">
<sc-form-table v-model="form.contact" :addTemplate="addTemplate" >
<el-table-column prop="name" label="姓名" width="180">
<template #default="scope"><el-input v-model="scope.row.name" placeholder="请输入姓名"></el-input></template>
</el-table-column>
<el-table-column prop="name" label="性别" width="180">
<template #default="scope"><el-input v-model="scope.row.sex" placeholder="请输入姓名"></el-input></template>
</el-table-column>
<el-table-column prop="name" label="电话" width="180">
<template #default="scope"><el-input v-model="scope.row.mobile" placeholder="请输入姓名"></el-input></template>
</el-table-column>
<el-table-column prop="name" label="电子邮箱" width="180">
<template #default="scope"><el-input v-model="scope.row.email" placeholder="请输入姓名"></el-input></template>
</el-table-column>
<el-table-column prop="name" label="职位" width="180">
<template #default="scope"><el-input v-model="scope.row.job" placeholder="请输入姓名"></el-input></template>
</el-table-column>
</sc-form-table>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click="submit()">确认提交</el-button>
</template>
</el-drawer>
</template>
<script>
export default {
emits: ['success', 'closed'],
data() {
return {
mode: "add",
titleMap: {
add: '新增',
edit: '编辑',
show: '查看'
},
visible: false,
isSaveing: false,
//表单数据
form: {
contact: [{ name: ''}]
},
//验证规则
rules: {
sort: [
{required: true, message: '请输入排序', trigger: 'change'}
],
label: [
{required: true, message: '请输入角色名称'}
],
alias: [
{required: true, message: '请输入角色别名'}
]
},
addTemplate: {
id: '',
name: '',
email: '',
mobile: '',
job: '',
sex: ''
}
}
},
mounted() {
},
methods: {
//显示
open(mode='add'){
this.mode = mode;
this.visible = true;
return this
},
//加载树数据
async getGroup(){
var res = await this.$API.user.department.list.get();
this.groups = res.data;
},
//表单提交方法
submit(){
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
var res = {}
if(this.mode == 'add'){
res = await this.$API.customer.company.add.post(this.form);
}else{
res = await this.$API.customer.company.edit.post(this.form);
}
this.isSaveing = false;
if(res.code == 1){
this.$emit('success', this.form, this.mode)
this.visible = false;
this.$message.success("操作成功")
}else{
this.$alert(res.msg, "提示", {type: 'error'})
}
}
})
},
//表单注入数据
setData(data){
//可以和上面一样单个注入,也可以像下面一样直接合并进去
Object.assign(this.form, data)
}
}
}
</script>

View File

@@ -0,0 +1,83 @@
<template>
<el-drawer title="更多查询" v-model="visible" direction="ttb" :size="600" destroy-on-close @closed="$emit('closed')">
<el-form :model="search" label-width="150px" style="padding: 10px">
<el-form-item label="关键词">
<el-input v-model="search.keyword" placeholder="关键词" clearable></el-input>
</el-form-item>
<el-form-item label="行业">
<el-input v-model="search.keyword" placeholder="行业" clearable></el-input>
</el-form-item>
<el-form-item label="省份城市">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="成立年限">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="注册资本">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="企业状态">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="企业类型">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="资本类型">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="联系方式">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="参保人数">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="融资信息">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
<el-form-item label="上市状态">
<el-input v-model="search.keyword" placeholder="省份城市" clearable></el-input>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" icon="el-icon-search" @click="submit()"></el-button>
</template>
</el-drawer>
</template>
<script>
export default {
emits: ['success', 'closed', 'output', 'delete'],
data() {
return {
visible: false,
//表单数据
search: {user: []},
}
},
mounted() {
},
methods: {
//显示
open(){
this.visible = true;
return this
},
//表单提交方法
submit(){
this.visible = false;
this.$emit('success', this.search)
},
//表单注入数据
setData(data){
data.page = 1;
data.pagesize = 100;
Object.assign(this.search, data)
}
}
}
</script>
<style scoped>
.code {background: #848484;padding:15px;color: #fff;font-size: 12px;border-radius: 4px;}
.el-row{padding: 5px 0;}
</style>