projects/mes-dy #60

Merged
gtz217 merged 2 commits from projects/mes-dy into projects/mes-test 2023-11-03 15:38:59 +08:00
16 changed files with 1999 additions and 3 deletions

View File

@ -1,8 +1,8 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2023-10-30 10:49:39
# @LastEditors: zhp
# @LastEditTime: 2023-11-03 11:16:12
# @LastEditors: DY
# @Description:
###
# 开发环境配置
@ -19,7 +19,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
# VUE_APP_BASE_API = 'http://192.168.2.159:48080'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-02 20:25:36
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建客户
export function createCustomer(data) {
return request({
url: '/base/core-customer/create',
method: 'post',
data: data
})
}
// 更新客户
export function updateCustomer(data) {
return request({
url: '/base/core-customer/update',
method: 'put',
data: data
})
}
// 删除客户
export function deleteCustomer(id) {
return request({
url: '/base/core-customer/delete?id=' + id,
method: 'delete'
})
}
// 获得客户
export function getCustomer(id) {
return request({
url: '/base/core-customer/get?id=' + id,
method: 'get'
})
}
// 获得客户code
export function getCode() {
return request({
url: '/base/core-customer/getCode',
method: 'get'
})
}
// 获得客户分页
export function getCustomerPage(query) {
return request({
url: '/base/core-customer/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCustomerList(query) {
return request({
url: '/base/core-customer/listAll',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-30 14:37:28
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建部门
export function createCoreDepartment(data) {
return request({
url: '/base/core-department/create',
method: 'post',
data: data
})
}
// 更新部门
export function updateCoreDepartment(data) {
return request({
url: '/base/core-department/update',
method: 'put',
data: data
})
}
// 删除部门
export function deleteCoreDepartment(id) {
return request({
url: '/base/core-department/delete?id=' + id,
method: 'delete'
})
}
// 获得部门
export function getCoreDepartment(id) {
return request({
url: '/base/core-department/get?id=' + id,
method: 'get'
})
}
// 获得部门code
export function getCode() {
return request({
url: '/base/core-department/getCode',
method: 'get'
})
}
// 获得部门分页
export function getCoreDepartmentPage(query) {
return request({
url: '/base/core-department/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreDepartmentList(query) {
return request({
url: '/base/core-department/listAll',
method: 'get',
params: query
})
}

68
src/api/base/coreMajor.js Normal file
View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-31 15:11:25
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建专业
export function createCoreMajor(data) {
return request({
url: '/base/core-major/create',
method: 'post',
data: data
})
}
// 更新专业
export function updateCoreMajor(data) {
return request({
url: '/base/core-major/update',
method: 'put',
data: data
})
}
// 删除专业
export function deleteCoreMajor(id) {
return request({
url: '/base/core-major/delete?id=' + id,
method: 'delete'
})
}
// 获得专业
export function getCoreMajor(id) {
return request({
url: '/base/core-major/get?id=' + id,
method: 'get'
})
}
// 获得专业code
export function getCode() {
return request({
url: '/base/core-major/getCode',
method: 'get'
})
}
// 获得专业分页
export function getCoreMajorPage(query) {
return request({
url: '/base/core-major/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreMajorList(query) {
return request({
url: '/base/core-major/listAll',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-03 10:39:44
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建供应商
export function createCoreSupplier(data) {
return request({
url: '/base/core-supplier/create',
method: 'post',
data: data
})
}
// 更新供应商
export function updateCoreSupplier(data) {
return request({
url: '/base/core-supplier/update',
method: 'put',
data: data
})
}
// 删除供应商
export function deleteCoreSupplier(id) {
return request({
url: '/base/core-supplier/delete?id=' + id,
method: 'delete'
})
}
// 获得供应商
export function getCoreSupplier(id) {
return request({
url: '/base/core-supplier/get?id=' + id,
method: 'get'
})
}
// 获得供应商code
export function getCode() {
return request({
url: '/base/core-supplier/getCode',
method: 'get'
})
}
// 获得供应商分页
export function getCoreSupplierPage(query) {
return request({
url: '/base/core-supplier/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreSupplierList(query) {
return request({
url: '/base/core-supplier/listAll',
method: 'get',
params: query
})
}

103
src/api/base/coreWorker.js Normal file
View File

@ -0,0 +1,103 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-02 19:49:52
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建员工
export function createCoreWorker(data) {
return request({
url: '/base/core-worker/create',
method: 'post',
data: data
})
}
// 更新员工
export function updateCoreWorker(data) {
return request({
url: '/base/core-worker/update',
method: 'put',
data: data
})
}
// 删除员工
export function deleteCoreWorker(id) {
return request({
url: '/base/core-worker/delete?id=' + id,
method: 'delete'
})
}
// 获得员工
export function getCoreWorker(id) {
return request({
url: '/base/core-worker/get?id=' + id,
method: 'get'
})
}
// 获得员工code
export function getCode() {
return request({
url: '/base/core-worker/getCode',
method: 'get'
})
}
// 获得员工分页
export function getCoreWorkerPage(query) {
return request({
url: '/base/core-worker/page',
method: 'get',
params: query
})
}
// 获得所有列表
export function getCoreWorkerList(query) {
return request({
url: '/base/core-worker/listAll',
method: 'get',
params: query
})
}
// 创建员工--专业
export function createWoBindMa(data) {
return request({
url: '/base/core-worker-bind-major/create',
method: 'post',
data: data
})
}
// 更新员工--专业
export function updateWoBindMa(data) {
return request({
url: '/base/core-worker-bind-major/update',
method: 'put',
data: data
})
}
// 删除员工--专业
export function deleteWoBindMa(id) {
return request({
url: '/base/core-worker-bind-major/delete?id=' + id,
method: 'delete'
})
}
// 获得员工--专业分页
export function getWoBindMaPage(query) {
return request({
url: '/base/core-worker-bind-major/page',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,103 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 10:53:43
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="客户编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入客户编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入客户名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="contact">
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="telephone">
<el-input
v-model="dataForm.telephone"
maxlength="11"
placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="地址" prop="address">
<el-input
v-model="dataForm.address"
placeholder="请输入地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCustomer, updateCustomer, getCustomer, getCode } from "@/api/base/coreCustomer";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCustomer,
updateURL: updateCustomer,
infoURL: getCustomer
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
telephone: undefined,
contact: undefined,
address: undefined,
remark: undefined
},
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
callback(new Error("手机号格式错误"));
}
} else {
callback();
}
}, trigger: "blur"
}
]
}
};
},
mounted() {},
methods: {}
};
</script>

View File

@ -0,0 +1,176 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCustomerPage,
deleteCustomer
} from '@/api/base/coreCustomer';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '客户名称'
},
{
prop: 'code',
label: '客户编码'
},
{
prop: 'contact',
label: '联系人'
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCustomerPage,
deleteURL: deleteCustomer
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-customer:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-customer:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '专业',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-customer:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,107 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-02 14:16:30
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="部门名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入部门名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门编码" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="上级部门" prop="parentId">
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreDepartment, updateCoreDepartment, getCoreDepartment, getCode, getCoreDepartmentList } from "@/api/base/coreDepartment";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
mixins: [basicAdd],
components: { Treeselect },
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreDepartment,
updateURL: updateCoreDepartment,
infoURL: getCoreDepartment,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
parentId: undefined,
remark: undefined,
},
departmentlList: [],
menuOptions: [],
dataRule: {
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
this.menuOptions = []
const res = await getCoreDepartmentList();
this.departmentlList = res.data.map(item => {
item.parentId = item.parentId ? item.parentId : 0
return item
});
const menu = { id: 0, name: '总部门', children: [] };
menu.children = this.handleTree(this.departmentlList, "id")
this.menuOptions.push(menu)
console.log('你好', this.menuOptions)
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
}
},
};
</script>

View File

@ -0,0 +1,168 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreDepartmentPage,
deleteCoreDepartment
} from '@/api/base/coreDepartment';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'name',
label: '部门名称'
},
{
prop: 'code',
label: '部门编码'
},
{
prop: 'parentName',
label: '上级部门'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreDepartmentPage,
deleteURL: deleteCoreDepartment
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-department:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-department:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '部门名',
placeholder: '部门名',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-department:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,77 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-02 14:24:12
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="专业编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入专业编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="专业名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入专业名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="缩写" prop="abbreviation">
<el-input v-model="dataForm.abbreviation" clearable placeholder="请输入缩写" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreMajor, updateCoreMajor, getCoreMajor, getCode } from "@/api/base/coreMajor";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreMajor,
updateURL: updateCoreMajor,
infoURL: getCoreMajor,
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
abbreviation: undefined,
remark: undefined,
},
departmentlList: [],
menuOptions: [],
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }]
}
};
},
mounted() {},
methods: {}
};
</script>

View File

@ -0,0 +1,168 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreMajorPage,
deleteCoreMajor
} from '@/api/base/coreMajor';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '专业编码'
},
{
prop: 'name',
label: '专业名称'
},
{
prop: 'abbreviation',
label: '缩写'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreMajorPage,
deleteURL: deleteCoreMajor
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-major:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-major:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '专业',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-major:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,103 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 11:00:47
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="供应商编号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入供应商编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入供应商名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="contact">
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="telephone">
<el-input
v-model="dataForm.telephone"
maxlength="11"
placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="地址" prop="address">
<el-input
v-model="dataForm.address"
placeholder="请输入地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreSupplier, updateCoreSupplier, getCoreSupplier, getCode } from "@/api/base/coreSupplier";
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreSupplier,
updateURL: updateCoreSupplier,
infoURL: getCoreSupplier
},
dataForm: {
id: undefined,
code: undefined,
name: undefined,
telephone: undefined,
contact: undefined,
address: undefined,
remark: undefined
},
dataRule: {
code: [{ required: true, message: "专业编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "专业名称不能为空", trigger: "blur" }],
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
callback(new Error("手机号格式错误"));
}
} else {
callback();
}
}, trigger: "blur"
}
]
}
};
},
mounted() {},
methods: {}
};
</script>

View File

@ -0,0 +1,176 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreSupplierPage,
deleteCoreSupplier
} from '@/api/base/coreSupplier';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime
},
{
prop: 'code',
label: '供应商编码'
},
{
prop: 'name',
label: '供应商名称'
},
{
prop: 'contact',
label: '联系人'
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreSupplierPage,
deleteURL: deleteCoreSupplier
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-supplier:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-supplier:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '关键字',
placeholder: '供应商名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-supplier:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,339 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-03 11:01:24
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="员工姓名" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入员工姓名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="员工照片" prop="fileUrl">
<imageUpload v-model="dataForm.fileUrl" :limit="1"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="员工号" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入员工号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="性别" prop="sex">
<el-select
v-model="dataForm.sex"
filterable
placeholder="请选择性别">
<el-option
v-for="dict in sexList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话" prop="telephone">
<el-input v-model="dataForm.telephone" maxlength="11" clearable placeholder="请输入电话" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="部门" prop="departmentId">
<treeselect v-model="dataForm.departmentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择部门"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职位" prop="position">
<el-input v-model="dataForm.position" clearable placeholder="请输入职位" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="专业" prop="majorIdList">
<el-select
v-model="majorIdList"
filterable
multiple
placeholder="请选择专业">
<el-option
v-for="dict in majorList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入职时间" prop="entryTime">
<el-date-picker
v-model="dataForm.entryTime"
type="date"
format='yyyy-MM-dd'
value-format='timestamp'
placeholder="选择入职时间" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="dataForm.status" @input="setOut">
<el-radio :label="1">在职</el-radio>
<el-radio :label="2">离职</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="离职时间" prop="outTime">
<el-date-picker
v-model="dataForm.outTime"
type="date"
:disabled="isOut"
format='yyyy-MM-dd'
value-format='timestamp'
placeholder="选择离职时间" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="教育程度" prop="education">
<el-select
v-model="dataForm.education"
filterable
placeholder="请选择教育程度">
<el-option
v-for="dict in educationList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="劳务成本(元/班次)" prop="workCost">
<el-input type="number" v-model.number="dataForm.workCost" clearable placeholder="请输入劳务成本" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import { createCoreWorker, updateCoreWorker, getCoreWorker, getCode, createWoBindMa, getWoBindMaPage, deleteWoBindMa } from "@/api/base/coreWorker";
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { getCoreMajorList } from "@/api/base/coreMajor";
import ImageUpload from '@/components/ImageUpload';
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
mixins: [basicAdd],
components: {
ImageUpload,
Treeselect
},
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createCoreWorker,
updateURL: updateCoreWorker,
infoURL: getCoreWorker,
},
sexList: [
{ id: 0, name: '男' },
{ id: 1, name: '女' }
],
educationList: [
{ id: '1', name: '初中' },
{ id: '2', name: '高中' },
{ id: '3', name: '中专' },
{ id: '5', name: '大专' },
{ id: '6', name: '大学本科' },
{ id: '7', name: '研究生及以上' }
],
departmentList: [],
majorList: [],
isOut: true,
dataForm: {
id: undefined,
code: undefined,
name: undefined,
fileUrl: undefined,
sex: 0,
telephone: undefined,
departmentId: undefined,
position: undefined,
entryTime: new Date().getTime(),
status: 1,
outTime: undefined,
education: undefined,
workCost: undefined,
remark: undefined,
},
majorIdList: undefined,
departmentlList: [],
menuOptions: [],
bindIds: [],
workerId: '',
dataRule: {
code: [{ required: true, message: "员工编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "员工姓名不能为空", trigger: "blur" }],
telephone: [
{ required: false, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (value) {
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
callback(new Error("手机号格式错误"));
}
} else {
callback();
}
}, trigger: "blur"
}
],
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
this.menuOptions = []
const res = await getCoreDepartmentList();
this.departmentlList = res.data.map(item => {
item.parentId = item.parentId ? item.parentId : 0
return item
});
// const menu = { id: 0, name: '', children: [] };
// menu.children = this.handleTree(this.departmentlList, "id")
this.menuOptions = this.handleTree(this.departmentlList, "id")
//
const majorRes = await getCoreMajorList();
this.majorList = majorRes.data;
},
setOut(val) {
if (val === 1) {
this.isOut = true
} else {
this.isOut = false
}
},
//
dataFormSubmit() {
console.log('111', this.dataForm)
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// --
this.bindIds.forEach(id => {
deleteWoBindMa(id).then(res => {})
});
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
this.majorIdList.forEach(majorId => {
createWoBindMa({
workerId: this.dataForm.id,
majorId: majorId
}).then(res => {})
});
return;
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
// response.data = id
this.workerId = response.data
this.majorIdList.forEach(majorId => {
createWoBindMa({
workerId: this.workerId,
majorId: majorId
}).then(res => {})
});
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
});
// --
getWoBindMaPage({
pageSize: 99,
pageNo: 1,
workerId: id
}).then(res => {
this.majorIdList = res.data.list.map(item => {
return item.majorId
})
this.bindIds = res.data.list.map(item => {
return item.id
})
})
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
}
}
};
</script>

View File

@ -0,0 +1,204 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreWorkerPage,
deleteCoreWorker
} from '@/api/base/coreWorker';
import moment from 'moment';
const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
{
prop: 'name',
label: '姓名'
},
{
prop: 'code',
label: '员工号'
},
{
prop: 'sex',
label: '性别',
filter: (val) => ['男', '女'][val]
},
{
prop: 'entryTime',
label: '入职时间',
filter: (val) => val ? moment(val).format('yyyy-MM-DD') : '',
},
{
prop: 'telephone',
label: '联系电话'
},
{
prop: 'status',
label: '状态',
filter: (val) => ['', '在职', '离职'][val]
},
{
prop: 'departmentName',
label: '部门'
},
{
prop: 'majorName',
label: '专业'
},
{
prop: 'remark',
label: '备注'
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCoreWorkerPage,
deleteURL: deleteCoreWorker
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-worker:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:core-worker:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '员工姓名',
placeholder: '员工姓名',
param: 'name',
},
{
type: 'select',
label: '状态',
placeholder: '请选择状态',
param: 'status',
selectOptions: [
{ id: 1, name: '在职' },
{ id: 2, name: '离职' }
],
filterable: true
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:core-worker:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
//
// getDataList() {
// this.dataListLoading = true;
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.tableData = response.data.list;
// this.listQuery.total = response.data.total;
// this.dataListLoading = false;
// });
// },
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined;
this.listQuery.status = val.status ? val.status : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>