新增查询规范
This commit is contained in:
parent
22cf49a6b3
commit
df9bdab0a6
|
@ -1584,13 +1584,12 @@ const routes = [
|
|||
"name": "hrm",
|
||||
"path": "/hrm",
|
||||
"meta": {
|
||||
"title": "人事",
|
||||
"title": "人事管理",
|
||||
"icon": "el-icon-platform",
|
||||
"type": "menu",
|
||||
"perms": ["hrm"]
|
||||
},
|
||||
"children": [
|
||||
|
||||
{
|
||||
"name": "employee",
|
||||
"path": "/hrm/employee",
|
||||
|
@ -1600,8 +1599,27 @@ const routes = [
|
|||
"perms": ["employee"]
|
||||
},
|
||||
"component": "hrm/employee"
|
||||
}
|
||||
,
|
||||
},
|
||||
{
|
||||
"name": "employee_photon",
|
||||
"path": "/hrm/employee_photon",
|
||||
"meta": {
|
||||
"title": "人员信息",
|
||||
"icon": "el-icon-user",
|
||||
"perms": ["employee_photon"]
|
||||
},
|
||||
"component": "hrm/employee_photon"
|
||||
},
|
||||
{
|
||||
"name": "team_photon",
|
||||
"path": "/hrm/team_photon",
|
||||
"meta": {
|
||||
"title": "班组管理",
|
||||
"icon": "el-icon-user",
|
||||
"perms": ["team_photon"]
|
||||
},
|
||||
"component": "hrm/team_photon"
|
||||
},
|
||||
{
|
||||
"name": "certificate",
|
||||
"path": "/hrm/certificate",
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
|
@ -14,9 +17,6 @@
|
|||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
|
@ -14,9 +17,6 @@
|
|||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
icon="el-icon-plus"
|
||||
@click="addAttendance"
|
||||
>新增</el-button>
|
||||
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-select
|
||||
|
@ -55,18 +54,28 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="所属部门" prop="belong_dept_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="工作日期" prop="work_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="到岗状态">
|
||||
<template #default="scope">
|
||||
<el-tag :type="states[scope.row.state].color">{{states[scope.row.state].label}}</el-tag>
|
||||
<el-tag :type="states[scope.row.state].type">{{states[scope.row.state].label}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="170">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="table_edit(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
@click="handleForm(scope.row)"
|
||||
v-auth="'attendance.delete'"
|
||||
@click="table_del(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -80,7 +89,57 @@
|
|||
@closed="dialog.save = false"
|
||||
>
|
||||
</save-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="到岗状态修改"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="姓名">
|
||||
<span>{{ form.employee_name }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="工作日期">
|
||||
<span>{{ form.work_date }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="到岗状态" prop="state">
|
||||
<el-select
|
||||
v-model="form.state"
|
||||
filterable
|
||||
placeholder="到岗状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stateOptions"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.note" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -95,6 +154,7 @@
|
|||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
visible:false,
|
||||
apiObj: this.$API.hrm.attendance.list,
|
||||
deptData: [],
|
||||
tableData:[],
|
||||
|
@ -103,15 +163,28 @@
|
|||
userList:[],
|
||||
dLoading: false,
|
||||
cLoading:false,
|
||||
isSaveing:false,
|
||||
ElLoading:null,
|
||||
deptSearch:{},
|
||||
states:{
|
||||
'pending': {"label": "待定", "color": "info"},
|
||||
'normal': {"label": "正常", "color": "success"},
|
||||
'late': {"label": "迟到", "color": "danger"},
|
||||
'early_leave': {"label": "早退", "color": "danger"},
|
||||
'absent': {"label": "未到岗", "color": "danger"},
|
||||
'leave': {"label": "请假", "color": "warning"},
|
||||
'pending': {"label": "待定", "type": "info"},
|
||||
'normal': {"label": "正常", "type": "success"},
|
||||
'late': {"label": "迟到", "type": "danger"},
|
||||
'early_leave': {"label": "早退", "type": "danger"},
|
||||
'absent': {"label": "未到岗", "type": "danger"},
|
||||
'leave': {"label": "请假", "type": "warning"},
|
||||
},
|
||||
stateOptions:[
|
||||
{label: "待定", id: "pending"},
|
||||
{label: "正常", id: "normal"},
|
||||
{label: "迟到", id: "late"},
|
||||
{label: "早退", id: "early_leave"},
|
||||
{label: "未到岗", id: "absent"},
|
||||
{label: "请假", id: "leave"},
|
||||
],
|
||||
form:{},
|
||||
rules:{
|
||||
state:[{required:true,message:"请选择到岗状态"}]
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@ -140,7 +213,27 @@
|
|||
this.$refs.saveDialog.open('add')
|
||||
})
|
||||
},
|
||||
handleForm(row){
|
||||
//编辑
|
||||
table_edit(row){
|
||||
this.form = row;
|
||||
this.visible = true;
|
||||
// let obj = {};
|
||||
// obj.work_date = row.work_date;
|
||||
// obj.state = row.state;
|
||||
// obj.note = row.note;
|
||||
// obj.employee = row.employee;
|
||||
// obj.shift = row.shift;
|
||||
},
|
||||
//提交编辑
|
||||
submit(){
|
||||
this.$API.hrm.attendance.update.req(this.form.id,this.form).then((res) => {
|
||||
this.$message.success("修改成功");
|
||||
this.visible = false;
|
||||
this.$refs.table.refresh();
|
||||
}).catch((err) => {});
|
||||
},
|
||||
//删除
|
||||
table_del(row){
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
placeholder="有无定位卡"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
v-if="sysName&&sysName!=='photon'"
|
||||
style="margin-left: 2px; width: 120px"
|
||||
style="margin-left: 2px; width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in bltOptions"
|
||||
|
@ -22,8 +21,7 @@
|
|||
placeholder="人员类型"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
v-if="sysName&&sysName!=='photon'"
|
||||
style="margin-left: 2px; width: 120px"
|
||||
style="margin-left: 2px; width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
|
@ -37,8 +35,7 @@
|
|||
placeholder="人员状态"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
v-if="sysName&&sysName!=='photon'"
|
||||
style="margin-left: 2px; width: 120px"
|
||||
style="margin-left: 2px; width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in jobOptions2"
|
||||
|
@ -91,7 +88,7 @@
|
|||
>
|
||||
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="人员类型" prop="type" width="160" v-if="sysName&&sysName!=='photon'">
|
||||
<el-table-column label="人员类型" prop="type" width="160">
|
||||
<template #default="scope">
|
||||
<span
|
||||
v-if="
|
||||
|
@ -116,7 +113,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="性别" prop="gender" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="证件照" prop="photo" width="120" v-if="sysName&&sysName!=='photon'">
|
||||
<el-table-column label="证件照" prop="photo" width="120">
|
||||
<template #default="scope">
|
||||
<el-avatar :size="50" :src="scope.row.photo" shape="square" />
|
||||
</template>
|
||||
|
@ -149,7 +146,7 @@
|
|||
<span v-if="scope.row.user">{{ scope.row.user_.username }}</span>
|
||||
</template></el-table-column
|
||||
>
|
||||
<el-table-column label="定位卡号" prop="blt_" width="180" :show-overflow-tooltip="true" v-if="sysName&&sysName!=='photon'">
|
||||
<el-table-column label="定位卡号" prop="blt_" width="180" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.blt_">
|
||||
<div>{{ scope.row.blt_.code }}</div>
|
||||
|
@ -193,8 +190,7 @@
|
|||
@click="handleForm('edit', scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<div v-if="sysName&&sysName =='photon'" style="display:inline-block">
|
||||
<el-button
|
||||
<el-button
|
||||
v-if="scope.row.blt_"
|
||||
link
|
||||
type="danger"
|
||||
|
@ -210,8 +206,7 @@
|
|||
@click="handleBindBlt(10, scope.row)"
|
||||
>绑卡
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
|
@ -270,7 +265,9 @@ import ScBind from "@/components/scBind/index.vue";
|
|||
import { genTree } from "@/utils/verificate";
|
||||
import config from "@/config"
|
||||
import data from './../../../src/utils/baseJson';
|
||||
const sysName = data[data.current].base.name;
|
||||
const baseInFo = data[data.current];
|
||||
|
||||
console.log(baseInFo);
|
||||
export default {
|
||||
name: "employee",
|
||||
components: {
|
||||
|
@ -334,9 +331,7 @@ export default {
|
|||
mounted() {
|
||||
// this.getBltList();
|
||||
this.getDept();
|
||||
console.log(sysName);
|
||||
debugger;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async getDept() {
|
||||
let res = await this.$API.system.dept.list.req({
|
||||
|
|
|
@ -0,0 +1,262 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-select
|
||||
v-model="query.belong_dept"
|
||||
clearable>
|
||||
<el-option v-for="item in deptData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="姓名/手机号"
|
||||
clearable
|
||||
style="margin-left: 4px; width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
@selection-change="selectionChange"
|
||||
stripe
|
||||
@resetQuery="resetQuery"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="姓名" prop="name" width="120">
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" prop="gender" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="证件照" prop="photo" width="120">
|
||||
<template #default="scope">
|
||||
<el-avatar :size="50" :src="scope.row.photo" shape="square" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="手机号"
|
||||
prop="phone"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="部门/单位"
|
||||
prop="belong_dept"
|
||||
width="180"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.belong_dept_">{{
|
||||
scope.row.belong_dept_.name
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="身份证号"
|
||||
prop="id_number"
|
||||
width="180"
|
||||
:show-overflow-tooltip="true"
|
||||
></el-table-column>
|
||||
<el-table-column label="系统账号" prop="user" width="180"
|
||||
><template #default="scope">
|
||||
<span v-if="scope.row.user">{{ scope.row.user_.username }}</span>
|
||||
</template></el-table-column
|
||||
>
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
width="180"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="170">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
size="small"
|
||||
@click="table_show('show', scope.row)"
|
||||
>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
@click="table_edit('edit', scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
</save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./ep_form.vue";
|
||||
import config from "@/config";
|
||||
export default {
|
||||
name: "employee",
|
||||
components: {
|
||||
saveDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
deptData: [],
|
||||
apiObj: this.$API.hrm.employee.list,
|
||||
query: {},
|
||||
tdevice: [],
|
||||
selection: [],
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
dis: false,
|
||||
bltList: [],
|
||||
form: {
|
||||
blt: "",
|
||||
employee: "",
|
||||
},
|
||||
jobOptions: {
|
||||
10: "在职",
|
||||
20: "离职",
|
||||
30: "退休",
|
||||
},
|
||||
jobOptions2: [
|
||||
{ label: "在职", value: 10 },
|
||||
{ label: "离职", value: 20 },
|
||||
{ label: "退休", value: 30 },
|
||||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDept();
|
||||
},
|
||||
methods: {
|
||||
getDept() {
|
||||
this.$API.system.dept.list.req({ page: 0,type:'dept'}).then(res=>{
|
||||
let data = [];
|
||||
res.forEach(item => {
|
||||
if(item.parent=='3423856735881117696'){
|
||||
data.push(item)
|
||||
}
|
||||
});
|
||||
console.log(data)
|
||||
this.deptData = data;
|
||||
});
|
||||
},
|
||||
//添加
|
||||
add(){
|
||||
this.dialog.save = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open('add')
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
table_edit(row){
|
||||
this.dialog.save = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open('edit').setData(row)
|
||||
})
|
||||
},
|
||||
//查看
|
||||
table_show(row){
|
||||
this.dialog.save = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open('show').setData(row)
|
||||
})
|
||||
},
|
||||
|
||||
//删除
|
||||
async table_del(row) {
|
||||
await this.$API.hrm.employee.create.req(row.id).then((res) => {
|
||||
if (res.err_msg) {
|
||||
this.$message.error(res.err_msg);
|
||||
} else {
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功");
|
||||
}
|
||||
});
|
||||
},
|
||||
//批量删除
|
||||
async batch_del() {
|
||||
this.$confirm(
|
||||
`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`,
|
||||
"提示",
|
||||
{
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
const loading = this.$loading();
|
||||
this.$refs.table.refresh();
|
||||
loading.close();
|
||||
this.$message.success("操作成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
//表格内开关
|
||||
changeSwitch(val, row) {
|
||||
row.status = row.status == "1" ? "0" : "1";
|
||||
row.$switch_status = true;
|
||||
setTimeout(() => {
|
||||
delete row.$switch_status;
|
||||
row.status = val;
|
||||
this.$message.success("操作成功");
|
||||
}, 500);
|
||||
},
|
||||
//搜索
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
//根据ID获取树结构
|
||||
filterTree(id) {
|
||||
var target = null;
|
||||
function filter(tree) {
|
||||
tree.forEach((item) => {
|
||||
if (item.id == id) {
|
||||
target = item;
|
||||
}
|
||||
if (item.children) {
|
||||
filter(item.children);
|
||||
}
|
||||
});
|
||||
}
|
||||
filter(this.$refs.table.tableData);
|
||||
return target;
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,193 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-auth="'team.create'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-select
|
||||
v-model="query.belong_dept"
|
||||
clearable>
|
||||
<el-option v-for="item in deptData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" hidePagination>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="名称" prop="name" min-width="100"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name" min-width="100"></el-table-column>
|
||||
<el-table-column label="所属部门" prop="belong_dept_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="handleEdit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="handleDel(scope.row, scope.$index)">
|
||||
<template #reference>
|
||||
<el-button link size="small" v-auth="'team.delete'" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<el-dialog :title="titleMap[type]" v-model="limitedVisible">
|
||||
<el-form :model="form" :rules="rules" ref="addForm" label-width="80px" style="padding: 0 10px;">
|
||||
<el-form-item label="班组名称" prop="name">
|
||||
<el-input v-model="form.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组班长" prop="leader_name">
|
||||
<span style="display:flex">
|
||||
<el-input readonly v-model="form.leader_name"></el-input>
|
||||
<ehsUserSelect :multiple="false" @submit="getReceptionist"/>
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门">
|
||||
<el-select
|
||||
v-model="form.belong_dept"
|
||||
placeholder="所属部门"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="limitedVisible=false" >取 消</el-button>
|
||||
<el-button v-if="type!=='show'" type="primary" :loading="isSaving" @click="submitHandle()">保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
const defaultForm = {
|
||||
id:"",
|
||||
name: "",
|
||||
leader:'',
|
||||
leader_name:'',
|
||||
belong_dept:'',
|
||||
};
|
||||
export default {
|
||||
name: 'dept',
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.mtm.team.list,
|
||||
search: {
|
||||
keyword: null
|
||||
},
|
||||
query: {},
|
||||
isSaving: false,
|
||||
limitedVisible : false,
|
||||
checkStrictly:true,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: '新增班组',
|
||||
edit: '编辑班组',
|
||||
show: '查看班组'
|
||||
},
|
||||
|
||||
//表单数据
|
||||
form: defaultForm,
|
||||
//验证规则
|
||||
rules: {
|
||||
name: [{required: true, message: '请输入班组名称'}],
|
||||
leader_name: [{required: true, message: '请输入班组班长'}],
|
||||
belong_dept: [{required: true, message: '请选择所属部门'}],
|
||||
},
|
||||
deptData: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getDeptData();
|
||||
},
|
||||
methods: {
|
||||
//部门数据
|
||||
getDeptData() {
|
||||
this.$API.system.dept.list.req({ page: 0,type:'dept'}).then(res=>{
|
||||
let data = [];
|
||||
res.forEach(item => {
|
||||
if(item.parent=='3423856735881117696'){
|
||||
data.push(item)
|
||||
}
|
||||
});
|
||||
console.log(data)
|
||||
this.deptData = data;
|
||||
});
|
||||
},
|
||||
//添加班组
|
||||
handleAdd(){
|
||||
this.limitedVisible = true;
|
||||
this.type = "add";
|
||||
this.form = Object.assign({}, defaultForm);
|
||||
},
|
||||
getReceptionist(data) {
|
||||
this.form.leader=data.id;
|
||||
this.form.leader_name=data.name
|
||||
},
|
||||
submitHandle(){
|
||||
let that = this;
|
||||
this.$refs.addForm.validate( (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
let res;
|
||||
if(this.type==='add'){
|
||||
res = this.$API.mtm.team.create.req(that.form);
|
||||
}else{
|
||||
res = this.$API.mtm.team.update.req(that.form.id,that.form);
|
||||
}
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg);
|
||||
}else{
|
||||
this.isSaveing = false;
|
||||
this.limitedVisible = false;
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//编辑班组
|
||||
handleEdit(row){
|
||||
this.type='edit';
|
||||
this.form=row;
|
||||
this.limitedVisible = true;
|
||||
},
|
||||
//删除班组
|
||||
async handleDel(row){
|
||||
var id = row.id;
|
||||
var res = await this.$API.mtm.team.delete.req(id);
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
}else{
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功")
|
||||
}
|
||||
},
|
||||
//搜索
|
||||
handleQuery(){
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(){
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
|
||||
</style>
|
|
@ -2,7 +2,7 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<!-- <el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'mgroup.create'"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'mgroup.create'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input style="margin-right: 5px;" v-model="query.search" placeholder="名称" clearable></el-input>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'route.create'"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'route.create'">新增</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_order.create'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_order.create'"></el-button>
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addLinkPlanItem"
|
||||
<el-button type="primary" @click="addLinkPlanItem"
|
||||
v-auth="'pu_orderitem.create'">计划明细变更采购明细</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'pu_orderitem.create'">新增</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card>
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<div>
|
||||
<el-card style="width: 100%" header="计划明细" shadow="hover">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add">新增</el-button>
|
||||
</div>
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination>
|
||||
<el-table-column type="index" width="50" />
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
|
@ -14,9 +18,6 @@
|
|||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "新增采购详情",
|
||||
edit: "编辑采购详情",
|
||||
show: "查看采购详情",
|
||||
add: "新增供应商",
|
||||
edit: "编辑供应商",
|
||||
show: "查看供应商",
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-date-picker
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'contract.create'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'contract.create'"></el-button>
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
|
@ -14,9 +17,6 @@
|
|||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.delete'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'order.delete'"></el-button>
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
|
Loading…
Reference in New Issue