init
This commit is contained in:
16
common/js/api/organizational.js
Normal file
16
common/js/api/organizational.js
Normal file
@ -0,0 +1,16 @@
|
||||
import request from "../request.js";
|
||||
|
||||
export const getOrganizational = (params) => {
|
||||
return request({
|
||||
url: "/organizational",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteOrganizational = (id) => {
|
||||
return request({
|
||||
url: `/organizational/${id}`,
|
||||
method: "delete",
|
||||
});
|
||||
};
|
29
common/js/api/projectCompany.js
Normal file
29
common/js/api/projectCompany.js
Normal file
@ -0,0 +1,29 @@
|
||||
import request from "../request.js";
|
||||
|
||||
export const getProjectCompany = (params) => {
|
||||
return request({
|
||||
url: "/project_company",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
};
|
||||
export const addProjectCompany = (data) => {
|
||||
return request({
|
||||
url: "/project_company",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
export const getProjectCompanyById = (id) => {
|
||||
return request({
|
||||
url: `/project_company/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
};
|
||||
export const deleteProjectCompany = (id) => {
|
||||
return request({
|
||||
url: `/project_company/${id}`,
|
||||
method: "delete",
|
||||
});
|
||||
};
|
5
common/js/request.js
Normal file
5
common/js/request.js
Normal file
@ -0,0 +1,5 @@
|
||||
const request = axios.create({
|
||||
baseURL: "http://localhost:8000",
|
||||
});
|
||||
|
||||
export default request;
|
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
1
lib/css/element-plus-index.css
Normal file
1
lib/css/element-plus-index.css
Normal file
File diff suppressed because one or more lines are too long
298
lib/css/modern-normalize.css
Normal file
298
lib/css/modern-normalize.css
Normal file
@ -0,0 +1,298 @@
|
||||
/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
|
||||
|
||||
/*
|
||||
Document
|
||||
========
|
||||
*/
|
||||
|
||||
/**
|
||||
Use a better box model (opinionated).
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/**
|
||||
Use a more readable tab size (opinionated).
|
||||
*/
|
||||
|
||||
html {
|
||||
-moz-tab-size: 4;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
/**
|
||||
1. Correct the line height in all browsers.
|
||||
2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
line-height: 1.15; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Sections
|
||||
========
|
||||
*/
|
||||
|
||||
/**
|
||||
Remove the margin in all browsers.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
|
||||
*/
|
||||
|
||||
body {
|
||||
font-family:
|
||||
system-ui,
|
||||
-apple-system, /* Firefox supports this but not yet `system-ui` */
|
||||
'Segoe UI',
|
||||
Roboto,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
'Apple Color Emoji',
|
||||
'Segoe UI Emoji';
|
||||
}
|
||||
|
||||
/*
|
||||
Grouping content
|
||||
================
|
||||
*/
|
||||
|
||||
/**
|
||||
1. Add the correct height in Firefox.
|
||||
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
||||
*/
|
||||
|
||||
hr {
|
||||
height: 0; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Text-level semantics
|
||||
====================
|
||||
*/
|
||||
|
||||
/**
|
||||
Add the correct text decoration in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
Add the correct font weight in Edge and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
|
||||
2. Correct the odd 'em' font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family:
|
||||
ui-monospace,
|
||||
SFMono-Regular,
|
||||
Consolas,
|
||||
'Liberation Mono',
|
||||
Menlo,
|
||||
monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/*
|
||||
Tabular data
|
||||
============
|
||||
*/
|
||||
|
||||
/**
|
||||
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
||||
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
||||
*/
|
||||
|
||||
table {
|
||||
text-indent: 0; /* 1 */
|
||||
border-color: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Forms
|
||||
=====
|
||||
*/
|
||||
|
||||
/**
|
||||
1. Change the font styles in all browsers.
|
||||
2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
line-height: 1.15; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the inheritance of text transform in Edge and Firefox.
|
||||
1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select { /* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
[type='button'],
|
||||
[type='reset'],
|
||||
[type='submit'] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the additional ':invalid' styles in Firefox.
|
||||
See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
|
||||
*/
|
||||
|
||||
:-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Add the correct vertical alignment in Chrome and Firefox.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
Correct the cursor style of increment and decrement buttons in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-inner-spin-button,
|
||||
::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
1. Correct the odd appearance in Chrome and Safari.
|
||||
2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type='search'] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Change font properties to 'inherit' in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Interactive
|
||||
===========
|
||||
*/
|
||||
|
||||
/*
|
||||
Add the correct display in Chrome and Safari.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
3
lib/js/axios.min.js
vendored
Normal file
3
lib/js/axios.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
lib/js/element-plus-icon-vue.js
Normal file
4
lib/js/element-plus-icon-vue.js
Normal file
File diff suppressed because one or more lines are too long
133
lib/js/element-plus-zh-cn.js
Normal file
133
lib/js/element-plus-zh-cn.js
Normal file
@ -0,0 +1,133 @@
|
||||
/*! Element Plus v2.2.14 */
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ElementPlusLocaleZhCn = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
|
||||
var zhCn = {
|
||||
name: "zh-cn",
|
||||
el: {
|
||||
colorpicker: {
|
||||
confirm: "\u786E\u5B9A",
|
||||
clear: "\u6E05\u7A7A"
|
||||
},
|
||||
datepicker: {
|
||||
now: "\u6B64\u523B",
|
||||
today: "\u4ECA\u5929",
|
||||
cancel: "\u53D6\u6D88",
|
||||
clear: "\u6E05\u7A7A",
|
||||
confirm: "\u786E\u5B9A",
|
||||
selectDate: "\u9009\u62E9\u65E5\u671F",
|
||||
selectTime: "\u9009\u62E9\u65F6\u95F4",
|
||||
startDate: "\u5F00\u59CB\u65E5\u671F",
|
||||
startTime: "\u5F00\u59CB\u65F6\u95F4",
|
||||
endDate: "\u7ED3\u675F\u65E5\u671F",
|
||||
endTime: "\u7ED3\u675F\u65F6\u95F4",
|
||||
prevYear: "\u524D\u4E00\u5E74",
|
||||
nextYear: "\u540E\u4E00\u5E74",
|
||||
prevMonth: "\u4E0A\u4E2A\u6708",
|
||||
nextMonth: "\u4E0B\u4E2A\u6708",
|
||||
year: "\u5E74",
|
||||
month1: "1 \u6708",
|
||||
month2: "2 \u6708",
|
||||
month3: "3 \u6708",
|
||||
month4: "4 \u6708",
|
||||
month5: "5 \u6708",
|
||||
month6: "6 \u6708",
|
||||
month7: "7 \u6708",
|
||||
month8: "8 \u6708",
|
||||
month9: "9 \u6708",
|
||||
month10: "10 \u6708",
|
||||
month11: "11 \u6708",
|
||||
month12: "12 \u6708",
|
||||
weeks: {
|
||||
sun: "\u65E5",
|
||||
mon: "\u4E00",
|
||||
tue: "\u4E8C",
|
||||
wed: "\u4E09",
|
||||
thu: "\u56DB",
|
||||
fri: "\u4E94",
|
||||
sat: "\u516D"
|
||||
},
|
||||
months: {
|
||||
jan: "\u4E00\u6708",
|
||||
feb: "\u4E8C\u6708",
|
||||
mar: "\u4E09\u6708",
|
||||
apr: "\u56DB\u6708",
|
||||
may: "\u4E94\u6708",
|
||||
jun: "\u516D\u6708",
|
||||
jul: "\u4E03\u6708",
|
||||
aug: "\u516B\u6708",
|
||||
sep: "\u4E5D\u6708",
|
||||
oct: "\u5341\u6708",
|
||||
nov: "\u5341\u4E00\u6708",
|
||||
dec: "\u5341\u4E8C\u6708"
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: "\u52A0\u8F7D\u4E2D",
|
||||
noMatch: "\u65E0\u5339\u914D\u6570\u636E",
|
||||
noData: "\u65E0\u6570\u636E",
|
||||
placeholder: "\u8BF7\u9009\u62E9"
|
||||
},
|
||||
cascader: {
|
||||
noMatch: "\u65E0\u5339\u914D\u6570\u636E",
|
||||
loading: "\u52A0\u8F7D\u4E2D",
|
||||
placeholder: "\u8BF7\u9009\u62E9",
|
||||
noData: "\u6682\u65E0\u6570\u636E"
|
||||
},
|
||||
pagination: {
|
||||
goto: "\u524D\u5F80",
|
||||
pagesize: "\u6761/\u9875",
|
||||
total: "\u5171 {total} \u6761",
|
||||
pageClassifier: "\u9875",
|
||||
deprecationWarning: "\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"
|
||||
},
|
||||
messagebox: {
|
||||
title: "\u63D0\u793A",
|
||||
confirm: "\u786E\u5B9A",
|
||||
cancel: "\u53D6\u6D88",
|
||||
error: "\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"
|
||||
},
|
||||
upload: {
|
||||
deleteTip: "\u6309 delete \u952E\u53EF\u5220\u9664",
|
||||
delete: "\u5220\u9664",
|
||||
preview: "\u67E5\u770B\u56FE\u7247",
|
||||
continue: "\u7EE7\u7EED\u4E0A\u4F20"
|
||||
},
|
||||
table: {
|
||||
emptyText: "\u6682\u65E0\u6570\u636E",
|
||||
confirmFilter: "\u7B5B\u9009",
|
||||
resetFilter: "\u91CD\u7F6E",
|
||||
clearFilter: "\u5168\u90E8",
|
||||
sumText: "\u5408\u8BA1"
|
||||
},
|
||||
tree: {
|
||||
emptyText: "\u6682\u65E0\u6570\u636E"
|
||||
},
|
||||
transfer: {
|
||||
noMatch: "\u65E0\u5339\u914D\u6570\u636E",
|
||||
noData: "\u65E0\u6570\u636E",
|
||||
titles: ["\u5217\u8868 1", "\u5217\u8868 2"],
|
||||
filterPlaceholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",
|
||||
noCheckedFormat: "\u5171 {total} \u9879",
|
||||
hasCheckedFormat: "\u5DF2\u9009 {checked}/{total} \u9879"
|
||||
},
|
||||
image: {
|
||||
error: "\u52A0\u8F7D\u5931\u8D25"
|
||||
},
|
||||
pageHeader: {
|
||||
title: "\u8FD4\u56DE"
|
||||
},
|
||||
popconfirm: {
|
||||
confirmButtonText: "\u786E\u5B9A",
|
||||
cancelButtonText: "\u53D6\u6D88"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return zhCn;
|
||||
|
||||
}));
|
54766
lib/js/element-plus.full.js
Normal file
54766
lib/js/element-plus.full.js
Normal file
File diff suppressed because one or more lines are too long
17112
lib/js/lodash.js
Normal file
17112
lib/js/lodash.js
Normal file
File diff suppressed because it is too large
Load Diff
15934
lib/js/vue.global.js
Normal file
15934
lib/js/vue.global.js
Normal file
File diff suppressed because it is too large
Load Diff
360
organizational_management/index.html
Normal file
360
organizational_management/index.html
Normal file
@ -0,0 +1,360 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
|
||||
<link rel="stylesheet" href="../lib/css/modern-normalize.css" />
|
||||
|
||||
<!-- element-plus style -->
|
||||
<link rel="stylesheet" href="../lib/css/element-plus-index.css" />
|
||||
|
||||
<style>
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
<title>组织管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
v-show="showSearch"
|
||||
:inline="true"
|
||||
>
|
||||
<el-form-item label="部门名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入部门名称"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态">
|
||||
<el-option label="启用" :value="1"></el-option>
|
||||
<el-option label="禁用" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="plus"
|
||||
size="default"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button type="warning" plain size="default" @click="handleAdd"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button type="danger" plain size="default" @click="handleAdd"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList" style="width: 100%">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column
|
||||
label="部门名称"
|
||||
prop="name"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="排序"
|
||||
prop="sort"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column label="状态" prop="status" align="center">
|
||||
<template #default="{row}">
|
||||
<el-switch
|
||||
v-model="row.status"
|
||||
style="
|
||||
--el-switch-on-color: #13ce66;
|
||||
--el-switch-off-color: #ff4949;
|
||||
"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="switchStatus(row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="{row}">
|
||||
<el-link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
@click="handleEdit(row.id)"
|
||||
>编辑</el-link
|
||||
>
|
||||
<el-link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-model:currentPage="queryParams.page"
|
||||
v-model:page-size="queryParams.limit"
|
||||
background
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
></el-pagination>
|
||||
<el-dialog title="查看" v-model="showEditDialog" width="500px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="部门名称:" prop="name">
|
||||
<el-input v-model="form.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序:" prop="sort">
|
||||
<el-input-number v-model="form.sort" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:" prop="status">
|
||||
<el-switch
|
||||
v-model="form.status"
|
||||
style="
|
||||
--el-switch-on-color: #13ce66;
|
||||
--el-switch-off-color: #ff4949;
|
||||
"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../lib/js/vue.global.js"></script>
|
||||
<script src="../lib/js/element-plus.full.js"></script>
|
||||
<script src="../lib/js/element-plus-zh-cn.js"></script>
|
||||
<!-- element-plus icon -->
|
||||
<script src="../lib/js/element-plus-icon-vue.js"></script>
|
||||
<script src="../lib/js/lodash.js"></script>
|
||||
<script src="../lib/js/axios.min.js"></script>
|
||||
<script type="module">
|
||||
const { createApp, ref, reactive, toRefs } = Vue;
|
||||
const { ElMessage, ElMessageBox } = ElementPlus;
|
||||
import {
|
||||
getOrganizational,
|
||||
deleteOrganizational,
|
||||
} from "/common/js/api/organizational.js";
|
||||
|
||||
const app = createApp({
|
||||
setup() {
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
name: [{ required: true, trigger: "blur", message: "角色必填" }],
|
||||
sort: [{ required: true, trigger: "blur", message: "姓名必填" }],
|
||||
status: [
|
||||
{ required: true, trigger: "blur", message: "性别必选" },
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, trigger: "blur", message: "省份证号必填" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const dataList = ref([]);
|
||||
const showSearch = ref(true);
|
||||
const showEditDialog = ref(false);
|
||||
const loading = ref(false);
|
||||
const formRef = ref();
|
||||
const total = ref(0);
|
||||
const genderDict = reactive({
|
||||
0: "男",
|
||||
1: "女",
|
||||
});
|
||||
// 取消按钮
|
||||
const cancel = () => {
|
||||
showEditDialog.value = false;
|
||||
reset();
|
||||
};
|
||||
// 表单重置
|
||||
const reset = () => {
|
||||
form.value = {};
|
||||
if (formRef.value) {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
};
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
const resetQuery = () => {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
getList();
|
||||
};
|
||||
const handleDelete = async (id) => {
|
||||
ElMessageBox.confirm(`是否删除id为${id}的项?`, "删除", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(async () => {
|
||||
try {
|
||||
await deleteOrganizational(id);
|
||||
ElMessage.success("删除成功");
|
||||
getList();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
ElMessage.error("删除失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
showEditDialog.value = true;
|
||||
};
|
||||
const handleEdit = async (id) => {
|
||||
reset();
|
||||
const resp = await axios.get(
|
||||
`http://localhost:8000/organizational/${id}`
|
||||
);
|
||||
form.value = resp.data.data;
|
||||
showEditDialog.value = true;
|
||||
};
|
||||
const submitForm = async () => {
|
||||
await formRef.value.validate();
|
||||
if (form.value.id) {
|
||||
fetch(`http://localhost:8000/organizational/${form.value.id}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(form.value),
|
||||
})
|
||||
.then((resp) => resp.json())
|
||||
.then(() => {
|
||||
cancel();
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
fetch(`http://localhost:8000/organizational`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(form.value),
|
||||
})
|
||||
.then((resp) => resp.json())
|
||||
.then(() => {
|
||||
cancel();
|
||||
getList();
|
||||
ElMessage.success("新增成功");
|
||||
});
|
||||
}
|
||||
};
|
||||
const getList = async () => {
|
||||
const resp = await getOrganizational(queryParams.value);
|
||||
dataList.value = resp.data.rows;
|
||||
total.value = resp.data.total;
|
||||
};
|
||||
const handleSizeChange = () => {};
|
||||
const handleCurrentChange = (value) => {
|
||||
queryParams.value.pageNum = value;
|
||||
getList();
|
||||
};
|
||||
const switchStatus = async (row) => {
|
||||
const orgData = _.cloneDeep(row);
|
||||
console.log(orgData.status);
|
||||
try {
|
||||
await axios.put(
|
||||
`http://localhost:8000/organizational/${orgData.id}`,
|
||||
orgData
|
||||
);
|
||||
getList();
|
||||
console.log("更改状态成功");
|
||||
} catch (error) {
|
||||
getList();
|
||||
console.log("更改状态失败");
|
||||
}
|
||||
};
|
||||
getList();
|
||||
return {
|
||||
cancel,
|
||||
reset,
|
||||
queryParams,
|
||||
dataList,
|
||||
showSearch,
|
||||
loading,
|
||||
form,
|
||||
rules,
|
||||
submitForm,
|
||||
handleQuery,
|
||||
resetQuery,
|
||||
handleDelete,
|
||||
handleAdd,
|
||||
showEditDialog,
|
||||
formRef,
|
||||
handleEdit,
|
||||
genderDict,
|
||||
total,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
switchStatus,
|
||||
};
|
||||
},
|
||||
});
|
||||
app.use(ElementPlus, { locale: ElementPlusLocaleZhCn });
|
||||
// 注册所有图标
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component);
|
||||
}
|
||||
app.mount("#app");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
341
personnel_information_management/index.html
Normal file
341
personnel_information_management/index.html
Normal file
@ -0,0 +1,341 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
|
||||
<link rel="stylesheet" href="../lib/css/modern-normalize.css" />
|
||||
<script src="../lib/js/vue.global.js"></script>
|
||||
<script src="../lib/js/element-plus.full.js"></script>
|
||||
<script src="../lib/js/element-plus-zh-cn.js"></script>
|
||||
<!-- element-plus icon -->
|
||||
<script src="../lib/js/element-plus-icon-vue.js"></script>
|
||||
<!-- element-plus style -->
|
||||
<link rel="stylesheet" href="../lib/css/element-plus-index.css" />
|
||||
|
||||
<style>
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
<title>人员信息管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
v-show="showSearch"
|
||||
:inline="true"
|
||||
>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="需求内容" prop="content">
|
||||
<el-input
|
||||
v-model="queryParams.content"
|
||||
placeholder="请输入需求内容"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="plus"
|
||||
size="default"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button type="warning" plain size="default" @click="handleAdd"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button type="danger" plain size="default" @click="handleAdd"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList" style="width: 100%">
|
||||
<el-table-column
|
||||
label="编号"
|
||||
prop="id"
|
||||
align="center"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="姓名"
|
||||
prop="nickname"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column label="性别" prop="gender" align="center">
|
||||
<template #default="{row}"> {{genderDict[row.gender]}} </template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="身份证号"
|
||||
prop="idCard"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="所属公司"
|
||||
prop="company"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="职务"
|
||||
prop="post"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="姓名"
|
||||
prop="role"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="{row}">
|
||||
<el-link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
@click="handleEdit(row.id)"
|
||||
>编辑</el-link
|
||||
>
|
||||
<el-link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-model:currentPage="queryParams.page"
|
||||
v-model:page-size="queryParams.limit"
|
||||
background
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
></el-pagination>
|
||||
<el-dialog title="查看" v-model="showEditDialog" width="500px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="姓名:" prop="nickname">
|
||||
<el-input v-model="form.nickname" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别:" prop="gender">
|
||||
<el-radio-group v-model="form.gender">
|
||||
<el-radio :label="0">男</el-radio>
|
||||
<el-radio :label="1">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="省份证号:" prop="idCard">
|
||||
<el-input v-model="form.idCard" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属公司:" prop="company">
|
||||
<el-input v-model="form.company" />
|
||||
</el-form-item>
|
||||
<el-form-item label="职务:" prop="post">
|
||||
<el-input v-model="form.post" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目角色:" prop="role">
|
||||
<el-input v-model="form.role" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const { createApp, ref, reactive, toRefs } = Vue;
|
||||
|
||||
const app = createApp({
|
||||
setup() {
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
role: [{ required: true, trigger: "blur", message: "角色必填" }],
|
||||
gender: [
|
||||
{ required: true, trigger: "blur", message: "性别必选" },
|
||||
],
|
||||
nickname: [
|
||||
{ required: true, trigger: "blur", message: "姓名必填" },
|
||||
],
|
||||
idCard: [
|
||||
{ required: true, trigger: "blur", message: "省份证号必填" },
|
||||
],
|
||||
company: [
|
||||
{ required: true, trigger: "blur", message: "所属公司必填" },
|
||||
],
|
||||
post: [{ required: true, trigger: "blur", message: "岗位必填" }],
|
||||
},
|
||||
});
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const dataList = ref([]);
|
||||
const showSearch = ref(true);
|
||||
const showEditDialog = ref(false);
|
||||
const loading = ref(false);
|
||||
const formRef = ref();
|
||||
const total = ref(0);
|
||||
const genderDict = reactive({
|
||||
0: "男",
|
||||
1: "女",
|
||||
});
|
||||
// 取消按钮
|
||||
const cancel = () => {
|
||||
showEditDialog.value = false;
|
||||
reset();
|
||||
};
|
||||
// 表单重置
|
||||
const reset = () => {
|
||||
form.value = {};
|
||||
if (formRef.value) {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
};
|
||||
const handleQuery = () => {};
|
||||
const resetQuery = () => {};
|
||||
const handleDelete = async (id) => {
|
||||
fetch(`http://localhost:8000/personnels/${id}`, {
|
||||
method: "DELETE",
|
||||
}).then(() => {
|
||||
console.log("删除成功");
|
||||
getList();
|
||||
});
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
showEditDialog.value = true;
|
||||
};
|
||||
const handleEdit = (id) => {
|
||||
reset();
|
||||
fetch(`http://localhost:8000/personnels/${id}`)
|
||||
.then((resp) => resp.json())
|
||||
.then((data) => {
|
||||
form.value = data.data;
|
||||
showEditDialog.value = true;
|
||||
});
|
||||
};
|
||||
const submitForm = async () => {
|
||||
await formRef.value.validate();
|
||||
if (form.value.id) {
|
||||
fetch(`http://localhost:8000/personnels/${form.value.id}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(form.value),
|
||||
})
|
||||
.then((resp) => resp.json())
|
||||
.then(() => {
|
||||
cancel();
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
fetch(`http://localhost:8000/personnels`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(form.value),
|
||||
})
|
||||
.then((resp) => resp.json())
|
||||
.then(() => {
|
||||
cancel();
|
||||
getList();
|
||||
// ElMessage.success("新增成功");
|
||||
// ELEMENT.message.success("下载成功");
|
||||
});
|
||||
}
|
||||
};
|
||||
const getList = async () => {
|
||||
const resp = fetch(
|
||||
`http://localhost:8000/personnels?pageNum=${queryParams.value.pageNum}&pageSize=${queryParams.value.pageSize}`
|
||||
)
|
||||
.then((resp) => resp.json())
|
||||
.then((data) => {
|
||||
console.log(data);
|
||||
dataList.value = data.rows;
|
||||
total.value = data.total;
|
||||
});
|
||||
};
|
||||
const handleSizeChange = () => {};
|
||||
const handleCurrentChange = (value) => {
|
||||
queryParams.value.pageNum = value;
|
||||
getList();
|
||||
};
|
||||
getList();
|
||||
return {
|
||||
cancel,
|
||||
reset,
|
||||
queryParams,
|
||||
dataList,
|
||||
showSearch,
|
||||
loading,
|
||||
form,
|
||||
rules,
|
||||
submitForm,
|
||||
handleQuery,
|
||||
resetQuery,
|
||||
handleDelete,
|
||||
handleAdd,
|
||||
showEditDialog,
|
||||
formRef,
|
||||
handleEdit,
|
||||
genderDict,
|
||||
total,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
};
|
||||
},
|
||||
});
|
||||
app.use(ElementPlus, { locale: ElementPlusLocaleZhCn });
|
||||
// 注册所有图标
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component);
|
||||
}
|
||||
app.mount("#app");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
460
project_company/index.html
Normal file
460
project_company/index.html
Normal file
@ -0,0 +1,460 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
|
||||
<link rel="stylesheet" href="../lib/css/modern-normalize.css" />
|
||||
|
||||
<!-- element-plus style -->
|
||||
<link rel="stylesheet" href="../lib/css/element-plus-index.css" />
|
||||
|
||||
<style>
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
<title>项目企业管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
v-show="showSearch"
|
||||
:inline="true"
|
||||
>
|
||||
<el-form-item label="建设单位" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入建设单位"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="统一社会信用代码" prop="creditCode">
|
||||
<el-input
|
||||
v-model="queryParams.creditCode"
|
||||
placeholder="请输入统一社会信用代码"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="search"
|
||||
size="default"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" size="default" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="plus"
|
||||
size="default"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button type="warning" plain size="default" @click="handleAdd"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button type="danger" plain size="default" @click="handleAdd"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList" style="width: 100%">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column
|
||||
label="单位名称"
|
||||
prop="name"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="注册地址"
|
||||
prop="address"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="法人"
|
||||
prop="legalPerson"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="法人电话"
|
||||
prop="legalPersonPhone"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="开户行账号"
|
||||
prop="bank"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="税号"
|
||||
prop="taxId"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="联系人"
|
||||
prop="contact"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="联系人电话"
|
||||
prop="contactPhone"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="统一社会信用代码"
|
||||
prop="creditCode"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="企业类型"
|
||||
prop="companyType"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="区域"
|
||||
prop="region"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column label="状态" prop="status" align="center">
|
||||
<template #default="{row}">
|
||||
<el-switch
|
||||
v-model="row.status"
|
||||
style="
|
||||
--el-switch-on-color: #13ce66;
|
||||
--el-switch-off-color: #ff4949;
|
||||
"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="switchStatus(row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="{row}">
|
||||
<el-link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
size="small"
|
||||
@click="handleEdit(row.id)"
|
||||
>编辑</el-link
|
||||
>
|
||||
<el-link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
size="small"
|
||||
@click="handleDelete(row.id)"
|
||||
>删除</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-model:currentPage="queryParams.page"
|
||||
v-model:page-size="queryParams.limit"
|
||||
background
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
></el-pagination>
|
||||
<el-dialog title="查看" v-model="showEditDialog" width="500px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="企业名称:" prop="name">
|
||||
<el-input v-model="form.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册地址:" prop="address">
|
||||
<el-input v-model="form.address" />
|
||||
</el-form-item>
|
||||
<el-form-item label="法人代表:" prop="legalPerson">
|
||||
<el-input v-model="form.legalPerson" />
|
||||
</el-form-item>
|
||||
<el-form-item label="法人代表电话:" prop="legalPersonPhone">
|
||||
<el-input
|
||||
v-model.number="form.legalPersonPhone"
|
||||
:maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开户行账号:" prop="bank">
|
||||
<el-input v-model.number="form.bank" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税号:" prop="taxId">
|
||||
<el-input v-model="form.taxId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人:" prop="contact">
|
||||
<el-input v-model="form.contact" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人电话:" prop="contactPhone">
|
||||
<el-input v-model.number="form.contactPhone" :maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="统一社会信用代码:" prop="creditCode">
|
||||
<el-input v-model="form.creditCode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公司类型:" prop="companyType">
|
||||
<el-input v-model="form.companyType" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地区:" prop="region">
|
||||
<el-input v-model="form.region" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:" prop="status">
|
||||
<el-switch
|
||||
v-model="form.status"
|
||||
style="
|
||||
--el-switch-on-color: #13ce66;
|
||||
--el-switch-off-color: #ff4949;
|
||||
"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../lib/js/vue.global.js"></script>
|
||||
<script src="../lib/js/element-plus.full.js"></script>
|
||||
<script src="../lib/js/element-plus-zh-cn.js"></script>
|
||||
<!-- element-plus icon -->
|
||||
<script src="../lib/js/element-plus-icon-vue.js"></script>
|
||||
<script src="../lib/js/lodash.js"></script>
|
||||
<script src="../lib/js/axios.min.js"></script>
|
||||
<script type="module">
|
||||
const { createApp, ref, reactive, toRefs } = Vue;
|
||||
const { ElMessage, ElMessageBox } = ElementPlus;
|
||||
import {
|
||||
getProjectCompany,
|
||||
addProjectCompany,
|
||||
getProjectCompanyById,
|
||||
deleteProjectCompany,
|
||||
} from "/common/js/api/projectCompany.js";
|
||||
|
||||
const app = createApp({
|
||||
setup() {
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
name: [{ required: true, trigger: "blur", message: "角色必填" }],
|
||||
address: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
legalPerson: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
legalPersonPhone: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
bank: [{ required: true, trigger: "blur", message: "角色必填" }],
|
||||
taxId: [{ required: true, trigger: "blur", message: "角色必填" }],
|
||||
contact: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
contactPhone: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
creditCode: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
companyType: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
region: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
status: [
|
||||
{ required: true, trigger: "blur", message: "角色必填" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const dataList = ref([]);
|
||||
const showSearch = ref(true);
|
||||
const showEditDialog = ref(false);
|
||||
const loading = ref(false);
|
||||
const formRef = ref();
|
||||
const total = ref(0);
|
||||
const genderDict = reactive({
|
||||
0: "男",
|
||||
1: "女",
|
||||
});
|
||||
// 取消按钮
|
||||
const cancel = () => {
|
||||
showEditDialog.value = false;
|
||||
reset();
|
||||
};
|
||||
// 表单重置
|
||||
const reset = () => {
|
||||
form.value = {};
|
||||
if (formRef.value) {
|
||||
formRef.value.resetFields();
|
||||
}
|
||||
};
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
const resetQuery = () => {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
getList();
|
||||
};
|
||||
const handleDelete = async (id) => {
|
||||
ElMessageBox.confirm(`是否删除id为${id}的项?`, "删除", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(async () => {
|
||||
try {
|
||||
await deleteProjectCompany(id);
|
||||
ElMessage.success("删除成功");
|
||||
getList();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
ElMessage.error("删除失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
showEditDialog.value = true;
|
||||
};
|
||||
const handleEdit = async (id) => {
|
||||
reset();
|
||||
const resp = await getProjectCompanyById(id);
|
||||
form.value = resp.data.data;
|
||||
showEditDialog.value = true;
|
||||
};
|
||||
const submitForm = async () => {
|
||||
await formRef.value.validate();
|
||||
if (form.value.id) {
|
||||
fetch(`http://localhost:8000/organizational/${form.value.id}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(form.value),
|
||||
})
|
||||
.then((resp) => resp.json())
|
||||
.then(() => {
|
||||
cancel();
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
await addProjectCompany(form.value);
|
||||
cancel();
|
||||
getList();
|
||||
ElMessage.success("新增成功");
|
||||
// fetch(`http://localhost:8000/organizational`, {
|
||||
// method: "POST",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json",
|
||||
// },
|
||||
// body: JSON.stringify(form.value),
|
||||
// })
|
||||
// .then((resp) => resp.json())
|
||||
// .then(() => {
|
||||
// cancel();
|
||||
// getList();
|
||||
// ElMessage.success("新增成功");
|
||||
// });
|
||||
}
|
||||
};
|
||||
const getList = async () => {
|
||||
const resp = await getProjectCompany(queryParams.value);
|
||||
dataList.value = resp.data.rows;
|
||||
total.value = resp.data.total;
|
||||
};
|
||||
const handleSizeChange = () => {};
|
||||
const handleCurrentChange = (value) => {
|
||||
queryParams.value.pageNum = value;
|
||||
getList();
|
||||
};
|
||||
const switchStatus = async (row) => {
|
||||
const orgData = _.cloneDeep(row);
|
||||
console.log(orgData.status);
|
||||
try {
|
||||
await axios.put(
|
||||
`http://localhost:8000/organizational/${orgData.id}`,
|
||||
orgData
|
||||
);
|
||||
getList();
|
||||
console.log("更改状态成功");
|
||||
} catch (error) {
|
||||
getList();
|
||||
console.log("更改状态失败");
|
||||
}
|
||||
};
|
||||
getList();
|
||||
return {
|
||||
cancel,
|
||||
reset,
|
||||
queryParams,
|
||||
dataList,
|
||||
showSearch,
|
||||
loading,
|
||||
form,
|
||||
rules,
|
||||
submitForm,
|
||||
handleQuery,
|
||||
resetQuery,
|
||||
handleDelete,
|
||||
handleAdd,
|
||||
showEditDialog,
|
||||
formRef,
|
||||
handleEdit,
|
||||
genderDict,
|
||||
total,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
switchStatus,
|
||||
};
|
||||
},
|
||||
});
|
||||
app.use(ElementPlus, { locale: ElementPlusLocaleZhCn });
|
||||
// 注册所有图标
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component);
|
||||
}
|
||||
app.mount("#app");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user