fix: 优化人员管理和三码校验记录页面业务逻辑
This commit is contained in:
@@ -64,7 +64,7 @@ export function addDepartmentName(num1, num2, num3) {
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_部门关系_增加节点',
|
name: '人事档案管理_部门关系_增加节点',
|
||||||
param: '父节点=' + num1 + '=int&节点名称=' + num2 + '=string&子节点=' + num3
|
param: '父节点=' + num1 + '=int&节点名称=' + num2 + '=string&子节点=' + num3
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ export function delList(num1) {
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_部门关系_删除节点',
|
name: '人事档案管理_部门关系_删除节点',
|
||||||
param: '子节点=' + num1 + '=int'
|
param: '子节点=' + num1 + '=int'
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ export function editList(num1, num2) {
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_部门关系_修改节点',
|
name: '人事档案管理_部门关系_修改节点',
|
||||||
param: '子节点=' + num1 + '=int&节点名称=' + num2 + '=string'
|
param: '子节点=' + num1 + '=int&节点名称=' + num2 + '=string'
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ export function delPeopleList(num1) {
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_人员名单_删除数据_MESWORK',
|
name: '人事档案管理_人员名单_删除数据_MESWORK',
|
||||||
param: '人员编号=' + num1 + '=int'
|
param: '人员编号=' + num1 + '=int'
|
||||||
}
|
}
|
||||||
@@ -202,7 +202,7 @@ export function addPeople(id, Sex, Education, Address, Nation, Post, AccountNumb
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_人员名单_增加数据_MESWORK',
|
name: '人事档案管理_人员名单_增加数据_MESWORK',
|
||||||
param: '考核部门编号=' + id + '=int&性别编号=' + Sex + '=int&学历编号=' + Education + '=int&家庭住址=' + Address + '&民族=' + Nation + '&岗位编号=' + Post + '=int&考勤编号=' + AccountNumber + '=string&密码=' + Password + '=string&姓名=' + Name + '=string&身份证号=' + IDcard + '=string&入公司时间=' + TimeOfEntry + '=string&出生日期=' + Birthday + '=string&联系电话=' + ContactInformation + '=string&班组=' + TeamValue
|
param: '考核部门编号=' + id + '=int&性别编号=' + Sex + '=int&学历编号=' + Education + '=int&家庭住址=' + Address + '&民族=' + Nation + '&岗位编号=' + Post + '=int&考勤编号=' + AccountNumber + '=string&密码=' + Password + '=string&姓名=' + Name + '=string&身份证号=' + IDcard + '=string&入公司时间=' + TimeOfEntry + '=string&出生日期=' + Birthday + '=string&联系电话=' + ContactInformation + '=string&班组=' + TeamValue
|
||||||
}
|
}
|
||||||
@@ -215,7 +215,7 @@ export function editPeople(id, Sex, Education, Address, Nation, Post, AccountNum
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_人员名单_修改数据_MESWORK',
|
name: '人事档案管理_人员名单_修改数据_MESWORK',
|
||||||
param: '人员编号=' + id + '=int&性别编号=' + Sex + '=int&学历编号=' + Education + '=int&家庭住址=' + Address + '&民族=' + Nation + '&岗位编号=' + Post + '=int&考勤编号=' + AccountNumber + '=string&密码=' + Password + '=string&姓名=' + Name + '=string&身份证号=' + IDcard + '=string&入公司时间=' + TimeOfEntry + '=string&出生日期=' + Birthday + '=string&联系电话=' + ContactInformation + '=string&班组=' + TeamValue
|
param: '人员编号=' + id + '=int&性别编号=' + Sex + '=int&学历编号=' + Education + '=int&家庭住址=' + Address + '&民族=' + Nation + '&岗位编号=' + Post + '=int&考勤编号=' + AccountNumber + '=string&密码=' + Password + '=string&姓名=' + Name + '=string&身份证号=' + IDcard + '=string&入公司时间=' + TimeOfEntry + '=string&出生日期=' + Birthday + '=string&联系电话=' + ContactInformation + '=string&班组=' + TeamValue
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ export function moveGroups(num1, num2) {
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_人员名单_移动数据_MESWORK',
|
name: '人事档案管理_人员名单_移动数据_MESWORK',
|
||||||
param: '人员编号=' + num1 + '=int&考核部门编号=' + num2 + '=int'
|
param: '人员编号=' + num1 + '=int&考核部门编号=' + num2 + '=int'
|
||||||
}
|
}
|
||||||
@@ -397,12 +397,25 @@ export function quit(num1) {
|
|||||||
data: {
|
data: {
|
||||||
UserID: state.state.user.id,
|
UserID: state.state.user.id,
|
||||||
ModularID: router.currentRoute.path,
|
ModularID: router.currentRoute.path,
|
||||||
type: 2,
|
type: '11',
|
||||||
name: '人事档案管理_人员_离职操作',
|
name: '人事档案管理_人员_离职操作',
|
||||||
param: '人员编号=' + num1 + '=int'
|
param: '人员编号=' + num1 + '=int'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function reinstate(num1) {
|
||||||
|
return request({
|
||||||
|
url: '',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
UserID: state.state.user.id,
|
||||||
|
ModularID: router.currentRoute.path,
|
||||||
|
type: '11',
|
||||||
|
name: '人事档案管理_人员_复职操作',
|
||||||
|
param: '人员编号=' + num1 + '=int'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
export function searchLeavingList(pageCurrent, pageSize) {
|
export function searchLeavingList(pageCurrent, pageSize) {
|
||||||
return request({
|
return request({
|
||||||
url: '',
|
url: '',
|
||||||
|
|||||||
@@ -380,9 +380,17 @@
|
|||||||
<!-- {{ scope.row.家庭住址 }}-->
|
<!-- {{ scope.row.家庭住址 }}-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column label="操作" align="center" width="170">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="danger" icon="el-icon-circle-close-outline"
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="reinstatePeople(scope.row)">复职</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-circle-close-outline"
|
||||||
@click="deletePeople(scope.row)">删除</el-button>
|
@click="deletePeople(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -408,7 +416,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fetchteamviwer, moveGroups, getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, fetchEducationData, fetchPostData, addPeople, editPeople, quit, searchLeavingList } from '@/api/BasicData/PersonnelManagement'
|
import { fetchteamviwer, moveGroups, getTree, tree, getTablePeople, getTablePeopleForName, addDepartmentName, delList, editList, fetchEducationData, fetchPostData, addPeople, editPeople, quit, reinstate, searchLeavingList } from '@/api/BasicData/PersonnelManagement'
|
||||||
import { uploadPerson } from '@/utils/request'
|
import { uploadPerson } from '@/utils/request'
|
||||||
import { readFile } from '@/utils/request'
|
import { readFile } from '@/utils/request'
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
@@ -554,6 +562,13 @@ export default {
|
|||||||
this.fetchTeamViwer()
|
this.fetchTeamViwer()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getBusinessResult(response) {
|
||||||
|
const result = response && response.data && response.data[0] ? response.data[0] : {}
|
||||||
|
return {
|
||||||
|
success: result.result === 1 || result.result === '1',
|
||||||
|
message: result.msg || result.message
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取班组信息
|
// 获取班组信息
|
||||||
fetchTeamViwer() {
|
fetchTeamViwer() {
|
||||||
fetchteamviwer().then(response => {
|
fetchteamviwer().then(response => {
|
||||||
@@ -574,13 +589,14 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
var param = []
|
var param = []
|
||||||
param[0] = ['考勤编号', row.考勤编号]
|
param[0] = ['考勤编号', row.考勤编号]
|
||||||
var Data = this.CreateData('12', '人事档案管理_离职人员_删除数据', param)
|
var Data = this.CreateData('11', '人事档案管理_离职人员_删除数据', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
this.$message.success('删除成功')
|
if (result.success) {
|
||||||
|
this.$message.success(result.message || '删除成功')
|
||||||
this.searchLeavingList()
|
this.searchLeavingList()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('删除失败')
|
this.$message.error(result.message || '删除失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -737,22 +753,24 @@ export default {
|
|||||||
this.department_DFV = false
|
this.department_DFV = false
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
addDepartmentName(this.id, this.department_Form.DepartmentName, 0).then(response => {
|
addDepartmentName(this.id, this.department_Form.DepartmentName, 0).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
this.getTreeData()
|
this.getTreeData()
|
||||||
this.$message.success('添加成功')
|
this.$message.success(result.message || '添加成功')
|
||||||
this.i = 0
|
this.i = 0
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('添加失败')
|
this.$message.error(result.message || '添加失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
addDepartmentName(0, this.department_Form.DepartmentName, 0).then(response => {
|
addDepartmentName(0, this.department_Form.DepartmentName, 0).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
this.getTreeData()
|
this.getTreeData()
|
||||||
this.$message.success('添加成功')
|
this.$message.success(result.message || '添加成功')
|
||||||
this.i = 1
|
this.i = 1
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('添加失败')
|
this.$message.error(result.message || '添加失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -767,11 +785,12 @@ export default {
|
|||||||
this.handleAdd_disable = true
|
this.handleAdd_disable = true
|
||||||
this.department_DFV = false
|
this.department_DFV = false
|
||||||
editList(this.id, this.department_Form.DepartmentName).then(response => {
|
editList(this.id, this.department_Form.DepartmentName).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
this.getTreeData()
|
this.getTreeData()
|
||||||
this.$message.success('编辑成功')
|
this.$message.success(result.message || '编辑成功')
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('编辑失败')
|
this.$message.error(result.message || '编辑失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -787,14 +806,17 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
delList(this.id).then(response => {
|
delList(this.id).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
this.getTreeData()
|
this.getTreeData()
|
||||||
this.i = 1
|
this.i = 1
|
||||||
this.id = ''
|
this.id = ''
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '已被成功删除',
|
message: result.message || '已被成功删除',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.error(result.message || '删除失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -847,15 +869,20 @@ export default {
|
|||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation, this.people_form.TeamValue).then(response => {
|
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation, this.people_form.TeamValue).then(response => {
|
||||||
this.btnLoading = false
|
this.btnLoading = false
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
this.people_DFV = false
|
this.people_DFV = false
|
||||||
this.i = 0
|
this.i = 0
|
||||||
this.handleNodeClick()
|
this.handleNodeClick()
|
||||||
this.$message.success('添加成功')
|
this.$message.success(result.message || '添加成功')
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('添加失败')
|
this.$message.error(result.message || '添加失败')
|
||||||
this.addPeople_disable = false
|
this.addPeople_disable = false
|
||||||
}
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.btnLoading = false
|
||||||
|
this.addPeople_disable = false
|
||||||
|
this.$message.error('添加异常')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
@@ -898,18 +925,23 @@ export default {
|
|||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
editPeople(this.people_form.PeopleID, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation, this.people_form.TeamValue).then(response => {
|
editPeople(this.people_form.PeopleID, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation, this.people_form.TeamValue).then(response => {
|
||||||
this.btnLoading = false
|
this.btnLoading = false
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
if (this.id !== '' && this.Name === '') {
|
if (this.id !== '' && this.Name === '') {
|
||||||
this.handleNodeClick()
|
this.handleNodeClick()
|
||||||
} else {
|
} else {
|
||||||
this.feathPeopleForName()
|
this.fetchPeopleForName()
|
||||||
}
|
}
|
||||||
this.$message.success('编辑成功')
|
this.$message.success(result.message || '编辑成功')
|
||||||
this.people_DFV = false
|
this.people_DFV = false
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('编辑失败')
|
this.$message.error(result.message || '编辑失败')
|
||||||
this.addPeople_disable = false
|
this.addPeople_disable = false
|
||||||
}
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.btnLoading = false
|
||||||
|
this.addPeople_disable = false
|
||||||
|
this.$message.error('编辑异常')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
@@ -955,13 +987,14 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||||
quit(this.multipleSelection[i].人员编号).then(response => {
|
quit(this.multipleSelection[i].人员编号).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
this.$message.success('离职成功')
|
if (result.success) {
|
||||||
|
this.$message.success(result.message || '离职成功')
|
||||||
getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => {
|
getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => {
|
||||||
this.List = response.data.rows
|
this.List = response.data.rows
|
||||||
this.total = response.data.total
|
this.total = response.data.total
|
||||||
})
|
})
|
||||||
} else { this.$message.error('离职失败') }
|
} else { this.$message.error(result.message || '离职失败') }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -976,17 +1009,46 @@ export default {
|
|||||||
this.LeavingListVisiable = true
|
this.LeavingListVisiable = true
|
||||||
this.getTable(searchLeavingList, [this.PageCurrentN, this.PageSizeN], ['LeavingList', 'totalN'])
|
this.getTable(searchLeavingList, [this.PageCurrentN, this.PageSizeN], ['LeavingList', 'totalN'])
|
||||||
},
|
},
|
||||||
|
reinstatePeople(row) {
|
||||||
|
this.$confirm('确认将该员工复职?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
reinstate(row.人员编号).then(response => {
|
||||||
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
|
this.$message.success(result.message || '复职成功')
|
||||||
|
this.searchLeavingList()
|
||||||
|
if (this.id) {
|
||||||
|
getTablePeople(this.id, this.PageCurrent, this.PageSize).then(response => {
|
||||||
|
this.List = response.data.rows
|
||||||
|
this.total = response.data.total
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(result.message || '复职失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消复职操作'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
moveGroupConfim() {
|
moveGroupConfim() {
|
||||||
this.id = this.node
|
this.id = this.node
|
||||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||||
moveGroups(this.multipleSelection[i].人员编号, this.node).then(response => {
|
moveGroups(this.multipleSelection[i].人员编号, this.node).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
|
if (result.success) {
|
||||||
if (i === this.multipleSelection.length - 1) {
|
if (i === this.multipleSelection.length - 1) {
|
||||||
this.$message.success('移组成功')
|
this.$message.success(result.message || '移组成功')
|
||||||
this.handleNodeClick()
|
this.handleNodeClick()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('更新失败')
|
this.$message.error(result.message || '更新失败')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,6 +210,13 @@ export default {
|
|||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getBusinessResult(response) {
|
||||||
|
const result = response && response.data && response.data[0] ? response.data[0] : {}
|
||||||
|
return {
|
||||||
|
success: result.result === 1 || result.result === '1',
|
||||||
|
message: result.msg || result.message
|
||||||
|
}
|
||||||
|
},
|
||||||
handelAdd() {
|
handelAdd() {
|
||||||
this.department = ''
|
this.department = ''
|
||||||
this.attendanceNumber = ''
|
this.attendanceNumber = ''
|
||||||
@@ -290,16 +297,23 @@ export default {
|
|||||||
param[1] = ['角色编号', this.form1.roleName]
|
param[1] = ['角色编号', this.form1.roleName]
|
||||||
param[2] = ['项目编号', 10]
|
param[2] = ['项目编号', 10]
|
||||||
console.log('param', param)
|
console.log('param', param)
|
||||||
var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_增加数据', param)
|
var Data = this.CreateData('11', '菜单系统模块_项目角色员工综合_增加数据', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
this.$message.success('增加成功')
|
if (result.success) {
|
||||||
|
this.$message.success(result.message || '增加成功')
|
||||||
this.department = ''
|
this.department = ''
|
||||||
this.form1.staffName = ''
|
this.form1.staffName = ''
|
||||||
this.form1.roleName = ''
|
this.form1.roleName = ''
|
||||||
this.searchData()
|
this.searchData()
|
||||||
this.dialogFormVisible1 = false
|
this.dialogFormVisible1 = false
|
||||||
} else { this.$message.error('增加失败') }
|
} else {
|
||||||
|
this.$message.error(result.message || '增加失败')
|
||||||
|
this.handelAdd_disable = false
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.handelAdd_disable = false
|
||||||
|
this.$message.error('增加异常')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log('error submit!!')
|
console.log('error submit!!')
|
||||||
@@ -315,14 +329,21 @@ export default {
|
|||||||
param[0] = ['人员角色流水号', this.personnelStream]
|
param[0] = ['人员角色流水号', this.personnelStream]
|
||||||
param[1] = ['人员编号', this.personnelNumber]
|
param[1] = ['人员编号', this.personnelNumber]
|
||||||
param[2] = ['角色编号', this.form2.roleName]
|
param[2] = ['角色编号', this.form2.roleName]
|
||||||
var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_修改数据', param)
|
var Data = this.CreateData('11', '菜单系统模块_项目角色员工综合_修改数据', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
this.$message.success('修改成功')
|
if (result.success) {
|
||||||
|
this.$message.success(result.message || '修改成功')
|
||||||
this.department = ''
|
this.department = ''
|
||||||
this.searchData()
|
this.searchData()
|
||||||
this.dialogFormVisible2 = false
|
this.dialogFormVisible2 = false
|
||||||
} else { this.$message.error('修改失败') }
|
} else {
|
||||||
|
this.$message.error(result.message || '修改失败')
|
||||||
|
this.handelAdd_disable = false
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.handelAdd_disable = false
|
||||||
|
this.$message.error('修改异常')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log('error submit!!')
|
console.log('error submit!!')
|
||||||
@@ -347,11 +368,12 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
var param = []
|
var param = []
|
||||||
param[0] = ['人员角色流水号', row.人员角色流水号]
|
param[0] = ['人员角色流水号', row.人员角色流水号]
|
||||||
var Data = this.CreateData('12', '菜单系统模块_项目角色员工综合_删除数据', param)
|
var Data = this.CreateData('11', '菜单系统模块_项目角色员工综合_删除数据', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
if (response.data[0].result === '1') {
|
const result = this.getBusinessResult(response)
|
||||||
this.$message.success('删除成功')
|
if (result.success) {
|
||||||
} else { this.$message.error('删除失败') }
|
this.$message.success(result.message || '删除成功')
|
||||||
|
} else { this.$message.error(result.message || '删除失败') }
|
||||||
this.searchData()
|
this.searchData()
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -385,4 +407,3 @@ export default {
|
|||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
|
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
||||||
|
<el-tab-pane label="校验记录" name="verifyRecord">
|
||||||
<div class="topDiv">
|
<div class="topDiv">
|
||||||
<span style="margin-left: 10px">产品编号:</span>
|
<span style="margin-left: 10px">产品编号:</span>
|
||||||
<el-input v-model="productNoValue" placeholder="请输入产品编号" clearable size="small" style="width: 190px" @keyup.enter.native="handleSearch" />
|
<el-input v-model="productNoValue" placeholder="请输入产品编号" clearable size="small" style="width: 190px" @keyup.enter.native="handleSearch" />
|
||||||
@@ -84,6 +86,109 @@
|
|||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange" />
|
@current-change="handleCurrentChange" />
|
||||||
</div>
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="下线产品校验核对" name="offlineProduct">
|
||||||
|
<div class="topDiv">
|
||||||
|
<div class="filter-line">
|
||||||
|
<span style="margin-left: 10px">下线时间:</span>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="offlineDateTime"
|
||||||
|
:clearable="false"
|
||||||
|
size="small"
|
||||||
|
type="datetimerange"
|
||||||
|
align="center"
|
||||||
|
style="width: 360px"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
range-separator="~"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间" />
|
||||||
|
|
||||||
|
<span style="margin-left: 10px">产品编号:</span>
|
||||||
|
<el-input v-model="offlineProductNoValue" placeholder="请输入产品编号" clearable size="small" style="width: 180px" @keyup.enter.native="handleOfflineSearch" />
|
||||||
|
|
||||||
|
<span style="margin-left: 10px">产品型号:</span>
|
||||||
|
<el-input v-model="offlineProductTypeValue" placeholder="请输入产品型号" clearable size="small" style="width: 140px" @keyup.enter.native="handleOfflineSearch" />
|
||||||
|
|
||||||
|
<span style="margin-left: 10px">校验情况:</span>
|
||||||
|
<el-select v-model="offlineVerifyStatusValue" placeholder="请选择" clearable size="small" style="width: 120px">
|
||||||
|
<el-option label="全部" value="" />
|
||||||
|
<el-option label="已完成" value="done" />
|
||||||
|
<el-option label="未完成" value="undone" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="filter-line">
|
||||||
|
<span style="margin-left: 10px">PACK码:</span>
|
||||||
|
<el-input v-model="offlinePackCodeValue" placeholder="请输入PACK码" clearable size="small" style="width: 180px" @keyup.enter.native="handleOfflineSearch" />
|
||||||
|
|
||||||
|
<span style="margin-left: 10px">模组码:</span>
|
||||||
|
<el-input v-model="offlineModuleCodeValue" placeholder="请输入模组码" clearable size="small" style="width: 180px" @keyup.enter.native="handleOfflineSearch" />
|
||||||
|
|
||||||
|
<span style="margin-left: 10px">箱体码:</span>
|
||||||
|
<el-input v-model="offlineBoxCodeValue" placeholder="请输入箱体码" clearable size="small" style="width: 180px" @keyup.enter.native="handleOfflineSearch" />
|
||||||
|
|
||||||
|
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="handleOfflineSearch">查询</el-button>
|
||||||
|
<el-button :loading="offlineExportLoading" :disabled="offlineExportLoading" type="info" size="small" icon="el-icon-download" style="margin-left: 5px" @click="exportOfflineExcel">Excel</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="offlineLoading"
|
||||||
|
:data="offlineTableData"
|
||||||
|
:header-cell-style="{ background: '#eef1f6', color: '#606266' }"
|
||||||
|
element-loading-text="数据加载中"
|
||||||
|
highlight-current-row
|
||||||
|
border
|
||||||
|
size="mini"
|
||||||
|
height="620px"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column width="60" label="序号" type="index" align="center" />
|
||||||
|
<el-table-column label="校验情况" width="100" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="getOfflineVerifyType(scope.row)" size="mini">{{ getOfflineVerifyText(scope.row) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="产品编号" width="200" align="center" prop="产品编号" show-overflow-tooltip />
|
||||||
|
<el-table-column label="产品型号" width="120" align="center" prop="产品型号" show-overflow-tooltip />
|
||||||
|
<el-table-column label="机型代码" width="90" align="center" prop="机型代码" show-overflow-tooltip />
|
||||||
|
<el-table-column label="下线时间" width="160" align="center" prop="下线时间" show-overflow-tooltip />
|
||||||
|
<el-table-column label="PACK码" width="200" align="center" prop="PACK码" show-overflow-tooltip />
|
||||||
|
<el-table-column label="模组码" width="200" align="center" prop="模组码" show-overflow-tooltip />
|
||||||
|
<el-table-column label="计划箱体码" width="220" align="center" prop="计划箱体码" show-overflow-tooltip />
|
||||||
|
<el-table-column label="扫描箱体码" width="220" align="center" prop="扫描箱体码" show-overflow-tooltip />
|
||||||
|
<el-table-column label="扫描客户标签码" width="220" align="center" prop="扫描客户标签码" show-overflow-tooltip />
|
||||||
|
<el-table-column label="箱体码结果" width="100" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="hasVerifyRecord(scope.row)" :type="getResultType(scope.row.箱体码校验结果)" size="mini">{{ getResultText(scope.row.箱体码校验结果) }}</el-tag>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="客户标签结果" width="110" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="hasVerifyRecord(scope.row)" :type="getResultType(scope.row.客户标签码校验结果)" size="mini">{{ getResultText(scope.row.客户标签码校验结果) }}</el-tag>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作人" width="110" align="center" prop="操作人" show-overflow-tooltip />
|
||||||
|
<el-table-column label="记录创建时间" width="160" align="center" prop="记录创建时间" show-overflow-tooltip />
|
||||||
|
<el-table-column label="完成时间" width="160" align="center" prop="完成时间" show-overflow-tooltip />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<div class="block" style="margin-top: 10px">
|
||||||
|
<el-pagination
|
||||||
|
v-if="!offlineLoading"
|
||||||
|
:current-page="offlinePageCurrent"
|
||||||
|
:page-sizes="[50, 100, 200]"
|
||||||
|
:page-size="offlinePageSize"
|
||||||
|
:total="offlineTotal"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleOfflineSizeChange"
|
||||||
|
@current-change="handleOfflineCurrentChange" />
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -92,6 +197,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
activeTab: 'verifyRecord',
|
||||||
loading: false,
|
loading: false,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
productNoValue: '',
|
productNoValue: '',
|
||||||
@@ -102,11 +208,26 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 50,
|
pageSize: 50,
|
||||||
pageCurrent: 1,
|
pageCurrent: 1,
|
||||||
exportLoading: false
|
exportLoading: false,
|
||||||
|
offlineLoaded: false,
|
||||||
|
offlineLoading: false,
|
||||||
|
offlineTableData: [],
|
||||||
|
offlineDateTime: [],
|
||||||
|
offlineProductNoValue: '',
|
||||||
|
offlineProductTypeValue: '',
|
||||||
|
offlinePackCodeValue: '',
|
||||||
|
offlineModuleCodeValue: '',
|
||||||
|
offlineBoxCodeValue: '',
|
||||||
|
offlineVerifyStatusValue: '',
|
||||||
|
offlineTotal: 0,
|
||||||
|
offlinePageSize: 50,
|
||||||
|
offlinePageCurrent: 1,
|
||||||
|
offlineExportLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initDateTime()
|
this.initDateTime()
|
||||||
|
this.initOfflineDateTime()
|
||||||
this.searchTable()
|
this.searchTable()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -115,11 +236,18 @@ export default {
|
|||||||
const start = new Date(end.getTime() - 7 * 24 * 60 * 60 * 1000)
|
const start = new Date(end.getTime() - 7 * 24 * 60 * 60 * 1000)
|
||||||
this.dateTime = [this.formatDateTime(start, '00:00:00'), this.formatDateTime(end, '23:59:59')]
|
this.dateTime = [this.formatDateTime(start, '00:00:00'), this.formatDateTime(end, '23:59:59')]
|
||||||
},
|
},
|
||||||
|
initOfflineDateTime() {
|
||||||
|
const today = new Date()
|
||||||
|
this.offlineDateTime = [this.formatDateTime(today, '00:00:00'), this.formatDateTime(today, '23:59:59')]
|
||||||
|
},
|
||||||
formatDateTime(date, timeText) {
|
formatDateTime(date, timeText) {
|
||||||
|
return `${this.formatDate(date)} ${timeText}`
|
||||||
|
},
|
||||||
|
formatDate(date) {
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
const day = String(date.getDate()).padStart(2, '0')
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
return `${year}-${month}-${day} ${timeText}`
|
return `${year}-${month}-${day}`
|
||||||
},
|
},
|
||||||
getParam(pageCurrent, pageSize) {
|
getParam(pageCurrent, pageSize) {
|
||||||
const param = []
|
const param = []
|
||||||
@@ -135,6 +263,22 @@ export default {
|
|||||||
param[9] = ['ItemCount', '1111', 'int', '1']
|
param[9] = ['ItemCount', '1111', 'int', '1']
|
||||||
return param
|
return param
|
||||||
},
|
},
|
||||||
|
getOfflineParam(pageCurrent, pageSize) {
|
||||||
|
const param = []
|
||||||
|
param[0] = ['开始时间', this.offlineDateTime && this.offlineDateTime[0] ? this.offlineDateTime[0] : '']
|
||||||
|
param[1] = ['结束时间', this.offlineDateTime && this.offlineDateTime[1] ? this.offlineDateTime[1] : '']
|
||||||
|
param[2] = ['产品编号', this.offlineProductNoValue || '']
|
||||||
|
param[3] = ['产品型号', this.offlineProductTypeValue || '']
|
||||||
|
param[4] = ['PACK码', this.offlinePackCodeValue || '']
|
||||||
|
param[5] = ['模组码', this.offlineModuleCodeValue || '']
|
||||||
|
param[6] = ['箱体码', this.offlineBoxCodeValue || '']
|
||||||
|
param[7] = ['校验情况', this.offlineVerifyStatusValue || '']
|
||||||
|
param[8] = ['PageCurrent', pageCurrent]
|
||||||
|
param[9] = ['PageSize', pageSize]
|
||||||
|
param[10] = ['PageCount', '1111', 'int', '1']
|
||||||
|
param[11] = ['ItemCount', '1111', 'int', '1']
|
||||||
|
return param
|
||||||
|
},
|
||||||
searchTable() {
|
searchTable() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
@@ -149,11 +293,42 @@ export default {
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
searchOfflineTable() {
|
||||||
|
if (!Array.isArray(this.offlineDateTime) || this.offlineDateTime.length !== 2) {
|
||||||
|
this.$message.warning('请选择下线时间')
|
||||||
|
this.offlineTableData = []
|
||||||
|
this.offlineTotal = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.offlineLoading = true
|
||||||
|
this.offlineLoaded = true
|
||||||
|
this.offlineTableData = []
|
||||||
|
const Data = this.CreateData('11', 'PACK下线三码校验_下线产品覆盖_分页查询', this.getOfflineParam(this.offlinePageCurrent, this.offlinePageSize))
|
||||||
|
this.ExecDatabase(Data).then(response => {
|
||||||
|
this.offlineTableData = response.data && response.data.result ? response.data.result : []
|
||||||
|
this.offlineTotal = response.data && response.data.output && response.data.output[0] ? parseInt(response.data.output[0].ItemCount) || 0 : 0
|
||||||
|
this.offlineLoading = false
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('查询下线产品三码校验核对失败:', error)
|
||||||
|
this.$message.error('查询下线产品三码校验核对失败')
|
||||||
|
this.offlineLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleTabClick(tab) {
|
||||||
|
if (tab.name === 'offlineProduct' && !this.offlineLoaded) {
|
||||||
|
this.searchOfflineTable()
|
||||||
|
}
|
||||||
|
},
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
this.pageCurrent = 1
|
this.pageCurrent = 1
|
||||||
this.pageSize = 50
|
this.pageSize = 50
|
||||||
this.searchTable()
|
this.searchTable()
|
||||||
},
|
},
|
||||||
|
handleOfflineSearch() {
|
||||||
|
this.offlinePageCurrent = 1
|
||||||
|
this.offlinePageSize = 50
|
||||||
|
this.searchOfflineTable()
|
||||||
|
},
|
||||||
exportExcel() {
|
exportExcel() {
|
||||||
if (this.tableData.length === 0) {
|
if (this.tableData.length === 0) {
|
||||||
this.$message.warning('暂无数据')
|
this.$message.warning('暂无数据')
|
||||||
@@ -165,6 +340,26 @@ export default {
|
|||||||
const Data = JSON.stringify(exportData)
|
const Data = JSON.stringify(exportData)
|
||||||
this.runExcelExport(Data, 'exportLoading')
|
this.runExcelExport(Data, 'exportLoading')
|
||||||
},
|
},
|
||||||
|
exportOfflineExcel() {
|
||||||
|
if (this.offlineTableData.length === 0) {
|
||||||
|
this.$message.warning('暂无数据')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const exportData = JSON.parse(this.CreateData('2005', 'PACK下线三码校验_下线产品覆盖_分页查询', this.getOfflineParam(1, 99999999)))
|
||||||
|
exportData.exportFileName = '下线产品三码校验核对'
|
||||||
|
exportData.exportColumns = '校验情况,产品编号,产品型号,机型代码,上线时间,下线时间,PACK码,模组码,计划箱体码,扫描箱体码,扫描客户标签码,箱体码校验结果=箱体码结果,客户标签码校验结果=客户标签结果,操作人,记录创建时间,完成时间'
|
||||||
|
const Data = JSON.stringify(exportData)
|
||||||
|
this.runExcelExport(Data, 'offlineExportLoading')
|
||||||
|
},
|
||||||
|
hasVerifyRecord(row) {
|
||||||
|
return row.校验记录ID !== null && row.校验记录ID !== undefined && row.校验记录ID !== ''
|
||||||
|
},
|
||||||
|
getOfflineVerifyType(row) {
|
||||||
|
return row.校验情况 === '已完成' ? 'success' : 'danger'
|
||||||
|
},
|
||||||
|
getOfflineVerifyText(row) {
|
||||||
|
return row.校验情况 || '未完成'
|
||||||
|
},
|
||||||
getResultType(value) {
|
getResultType(value) {
|
||||||
const status = Number(value)
|
const status = Number(value)
|
||||||
if (status === 1) return 'success'
|
if (status === 1) return 'success'
|
||||||
@@ -191,6 +386,15 @@ export default {
|
|||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.pageCurrent = val
|
this.pageCurrent = val
|
||||||
this.searchTable()
|
this.searchTable()
|
||||||
|
},
|
||||||
|
handleOfflineSizeChange(val) {
|
||||||
|
this.offlinePageCurrent = 1
|
||||||
|
this.offlinePageSize = val
|
||||||
|
this.searchOfflineTable()
|
||||||
|
},
|
||||||
|
handleOfflineCurrentChange(val) {
|
||||||
|
this.offlinePageCurrent = val
|
||||||
|
this.searchOfflineTable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,6 +409,10 @@ export default {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter-line {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|||||||
214
中控参数维护模块.sql
214
中控参数维护模块.sql
@@ -1,214 +0,0 @@
|
|||||||
-- 中控参数维护模块注册及存储过程脚本
|
|
||||||
-- 执行前请确认当前数据库为 AMES_PDC。
|
|
||||||
|
|
||||||
IF NOT EXISTS (
|
|
||||||
SELECT 1
|
|
||||||
FROM 基础表_模块信息
|
|
||||||
WHERE path = 'ProcessParameterMaintenance/CentralControlParameterMaintenance'
|
|
||||||
)
|
|
||||||
BEGIN
|
|
||||||
INSERT INTO 基础表_模块信息 (path, component, name, title, icon, 是否禁用)
|
|
||||||
VALUES ('ProcessParameterMaintenance/CentralControlParameterMaintenance', '/ProcessParameterMaintenance/CentralControlParameterMaintenance', 'CentralControlParameterMaintenance', N'中控参数维护模块', 'BasicDataManagement', 0)
|
|
||||||
END
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位定义_分页查询]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位定义_分页查询]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位定义_分页查询]
|
|
||||||
@类型 nvarchar(50) = null,
|
|
||||||
@工位列表 nvarchar(50) = null,
|
|
||||||
@PageCurrent int = null,
|
|
||||||
@PageSize int = null,
|
|
||||||
@PageCount int = null output,
|
|
||||||
@ItemCount int = null output
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
declare @tbname sysname
|
|
||||||
declare @fieldkey sysname
|
|
||||||
declare @where nvarchar(1000)
|
|
||||||
declare @fieldshow nvarchar(1000)
|
|
||||||
declare @fieldOrder nvarchar(1000)
|
|
||||||
|
|
||||||
set @tbname = 'MES_特殊工位定义表'
|
|
||||||
set @fieldkey = 'type'
|
|
||||||
set @fieldOrder = 'type'
|
|
||||||
set @fieldshow = '[type],[opList]'
|
|
||||||
|
|
||||||
set @where = '1 = 1'
|
|
||||||
if @类型 != '' set @where = @where + ' and type like ''%' + @类型 + '%'''
|
|
||||||
if @工位列表 != '' set @where = @where + ' and opList like ''%' + @工位列表 + '%'''
|
|
||||||
|
|
||||||
exec sp_xt_pagesplit @tbname, @fieldkey, @where, @fieldshow, @fieldOrder, @PageCurrent, @PageSize, @PageCount out, @ItemCount out
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位定义_增加]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位定义_增加]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位定义_增加]
|
|
||||||
@类型 nvarchar(50) = null,
|
|
||||||
@工位列表 nvarchar(500) = null
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
IF (SELECT COUNT(1) FROM MES_特殊工位定义表 WHERE [type] = @类型) > 0
|
|
||||||
BEGIN
|
|
||||||
SELECT 2 as result, N'类型已存在' as msg
|
|
||||||
RETURN
|
|
||||||
END
|
|
||||||
|
|
||||||
INSERT INTO MES_特殊工位定义表 ([type], [opList])
|
|
||||||
VALUES (@类型, @工位列表)
|
|
||||||
|
|
||||||
SELECT 1 as result, N'' as msg
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位定义_编辑]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位定义_编辑]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位定义_编辑]
|
|
||||||
@类型 nvarchar(50) = null,
|
|
||||||
@工位列表 nvarchar(500) = null
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
UPDATE MES_特殊工位定义表 SET
|
|
||||||
[opList] = @工位列表
|
|
||||||
WHERE [type] = @类型
|
|
||||||
|
|
||||||
SELECT 1 as result, N'' as msg
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位定义_删除]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位定义_删除]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位定义_删除]
|
|
||||||
@类型 nvarchar(50) = null
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
IF (SELECT COUNT(1) FROM MES_特殊工位规则配置表 WHERE [type] = @类型) > 0
|
|
||||||
BEGIN
|
|
||||||
SELECT 2 as result, N'该类型已配置规则,不能删除' as msg
|
|
||||||
RETURN
|
|
||||||
END
|
|
||||||
|
|
||||||
DELETE FROM MES_特殊工位定义表 WHERE [type] = @类型
|
|
||||||
|
|
||||||
SELECT 1 as result, N'' as msg
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位规则_分页查询]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位规则_分页查询]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位规则_分页查询]
|
|
||||||
@类型 nvarchar(50) = null,
|
|
||||||
@工位 nvarchar(50) = null,
|
|
||||||
@规则键 nvarchar(50) = null,
|
|
||||||
@启用 nvarchar(10) = null,
|
|
||||||
@PageCurrent int = null,
|
|
||||||
@PageSize int = null,
|
|
||||||
@PageCount int = null output,
|
|
||||||
@ItemCount int = null output
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
declare @tbname sysname
|
|
||||||
declare @fieldkey sysname
|
|
||||||
declare @where nvarchar(1000)
|
|
||||||
declare @fieldshow nvarchar(1000)
|
|
||||||
declare @fieldOrder nvarchar(1000)
|
|
||||||
|
|
||||||
set @tbname = 'MES_特殊工位规则配置表'
|
|
||||||
set @fieldkey = 'id'
|
|
||||||
set @fieldOrder = 'id'
|
|
||||||
set @fieldshow = '[id],[type],[opName],[ruleKey],[ruleValue],[enable],[remark]'
|
|
||||||
|
|
||||||
set @where = '1 = 1'
|
|
||||||
if @类型 != '' set @where = @where + ' and type = ''' + @类型 + ''''
|
|
||||||
if @工位 != '' set @where = @where + ' and opName like ''%' + @工位 + '%'''
|
|
||||||
if @规则键 != '' set @where = @where + ' and ruleKey like ''%' + @规则键 + '%'''
|
|
||||||
if @启用 != '' set @where = @where + ' and enable = ' + @启用
|
|
||||||
|
|
||||||
exec sp_xt_pagesplit @tbname, @fieldkey, @where, @fieldshow, @fieldOrder, @PageCurrent, @PageSize, @PageCount out, @ItemCount out
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位规则_增加]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位规则_增加]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位规则_增加]
|
|
||||||
@ID nvarchar(50) = null,
|
|
||||||
@类型 nvarchar(50) = null,
|
|
||||||
@工位 nvarchar(50) = null,
|
|
||||||
@规则键 nvarchar(50) = null,
|
|
||||||
@规则值 nvarchar(500) = null,
|
|
||||||
@启用 bit = null,
|
|
||||||
@备注 nvarchar(200) = null
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
IF (SELECT COUNT(1) FROM MES_特殊工位规则配置表 WHERE [type] = @类型 AND [opName] = @工位 AND [ruleKey] = @规则键) > 0
|
|
||||||
BEGIN
|
|
||||||
SELECT 2 as result, N'该类型、工位、规则键已存在' as msg
|
|
||||||
RETURN
|
|
||||||
END
|
|
||||||
|
|
||||||
INSERT INTO MES_特殊工位规则配置表 ([type], [opName], [ruleKey], [ruleValue], [enable], [remark])
|
|
||||||
VALUES (@类型, @工位, @规则键, @规则值, ISNULL(@启用, 1), @备注)
|
|
||||||
|
|
||||||
SELECT 1 as result, N'' as msg
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位规则_编辑]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位规则_编辑]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位规则_编辑]
|
|
||||||
@ID int = null,
|
|
||||||
@类型 nvarchar(50) = null,
|
|
||||||
@工位 nvarchar(50) = null,
|
|
||||||
@规则键 nvarchar(50) = null,
|
|
||||||
@规则值 nvarchar(500) = null,
|
|
||||||
@启用 bit = null,
|
|
||||||
@备注 nvarchar(200) = null
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
IF (SELECT COUNT(1) FROM MES_特殊工位规则配置表 WHERE [type] = @类型 AND [opName] = @工位 AND [ruleKey] = @规则键 AND [id] != @ID) > 0
|
|
||||||
BEGIN
|
|
||||||
SELECT 2 as result, N'该类型、工位、规则键已存在' as msg
|
|
||||||
RETURN
|
|
||||||
END
|
|
||||||
|
|
||||||
UPDATE MES_特殊工位规则配置表 SET
|
|
||||||
[type] = @类型,
|
|
||||||
[opName] = @工位,
|
|
||||||
[ruleKey] = @规则键,
|
|
||||||
[ruleValue] = @规则值,
|
|
||||||
[enable] = ISNULL(@启用, 1),
|
|
||||||
[remark] = @备注
|
|
||||||
WHERE [id] = @ID
|
|
||||||
|
|
||||||
SELECT 1 as result, N'' as msg
|
|
||||||
GO
|
|
||||||
|
|
||||||
IF OBJECT_ID(N'[dbo].[中控参数维护_特殊工位规则_删除]', N'P') IS NOT NULL
|
|
||||||
DROP PROCEDURE [dbo].[中控参数维护_特殊工位规则_删除]
|
|
||||||
GO
|
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[中控参数维护_特殊工位规则_删除]
|
|
||||||
@ID int = null
|
|
||||||
AS
|
|
||||||
SET NOCOUNT ON
|
|
||||||
|
|
||||||
DELETE FROM MES_特殊工位规则配置表 WHERE [id] = @ID
|
|
||||||
|
|
||||||
SELECT 1 as result, N'' as msg
|
|
||||||
GO
|
|
||||||
565
人员管理业务修复.sql
Normal file
565
人员管理业务修复.sql
Normal file
@@ -0,0 +1,565 @@
|
|||||||
|
USE [AMES_PDC]
|
||||||
|
GO
|
||||||
|
|
||||||
|
SET ANSI_NULLS ON
|
||||||
|
GO
|
||||||
|
SET QUOTED_IDENTIFIER ON
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_部门关系_增加节点]
|
||||||
|
@父节点 int = null,
|
||||||
|
@节点名称 nvarchar(100) = null,
|
||||||
|
@子节点 int out
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF ISNULL(@节点名称, '') = ''
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'部门名称不能为空' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF ISNULL(@父节点, 0) <> 0
|
||||||
|
AND NOT EXISTS (SELECT 1 FROM 人事档案管理_基础表_部门 WHERE 考核部门编号 = @父节点)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'上级部门不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
BEGIN TRY
|
||||||
|
BEGIN TRAN
|
||||||
|
|
||||||
|
INSERT INTO [人事档案管理_部门关系]([父节点], 节点排序)
|
||||||
|
SELECT ISNULL(@父节点, 0), ISNULL(MAX(节点排序), 0) + 1
|
||||||
|
FROM 人事档案管理_部门关系
|
||||||
|
WHERE 父节点 = ISNULL(@父节点, 0)
|
||||||
|
|
||||||
|
SET @子节点 = SCOPE_IDENTITY()
|
||||||
|
|
||||||
|
INSERT INTO 人事档案管理_基础表_部门 (考核部门编号, 部门名称)
|
||||||
|
VALUES(@子节点, @节点名称)
|
||||||
|
|
||||||
|
COMMIT TRAN
|
||||||
|
SELECT 1 AS result, N'添加成功' AS msg
|
||||||
|
END TRY
|
||||||
|
BEGIN CATCH
|
||||||
|
IF @@TRANCOUNT > 0 ROLLBACK TRAN
|
||||||
|
SELECT 0 AS result, ERROR_MESSAGE() AS msg
|
||||||
|
END CATCH
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_部门关系_修改节点]
|
||||||
|
@子节点 int,
|
||||||
|
@节点名称 nvarchar(100)
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF ISNULL(@节点名称, '') = ''
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'部门名称不能为空' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_基础表_部门 WHERE 考核部门编号 = @子节点)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'部门不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
UPDATE 人事档案管理_基础表_部门
|
||||||
|
SET [部门名称] = @节点名称
|
||||||
|
WHERE [考核部门编号] = @子节点
|
||||||
|
|
||||||
|
SELECT 1 AS result, N'编辑成功' AS msg
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_部门关系_删除节点]
|
||||||
|
@子节点 int = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_部门关系 WHERE 子节点 = @子节点)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'部门不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (SELECT 1 FROM 人事档案管理_部门关系 WHERE 父节点 = @子节点)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该部门存在下级部门,请先删除或调整下级部门' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM 人事档案管理_人员名单
|
||||||
|
WHERE 考核部门编号 = @子节点
|
||||||
|
AND ISNULL(是否离职, 0) = 0
|
||||||
|
AND ISNULL(岗位状态编号, 1) = 1
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该部门下存在在职人员,请先移动、离职或删除人员' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
BEGIN TRY
|
||||||
|
BEGIN TRAN
|
||||||
|
DELETE FROM 人事档案管理_基础表_部门 WHERE [考核部门编号] = @子节点
|
||||||
|
DELETE FROM [人事档案管理_部门关系] WHERE [子节点] = @子节点
|
||||||
|
COMMIT TRAN
|
||||||
|
SELECT 1 AS result, N'删除成功' AS msg
|
||||||
|
END TRY
|
||||||
|
BEGIN CATCH
|
||||||
|
IF @@TRANCOUNT > 0 ROLLBACK TRAN
|
||||||
|
SELECT 0 AS result, ERROR_MESSAGE() AS msg
|
||||||
|
END CATCH
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_人员名单_增加数据_MESWORK]
|
||||||
|
@考核部门编号 int = null,
|
||||||
|
@性别编号 int = null,
|
||||||
|
@学历编号 int = null,
|
||||||
|
@岗位编号 int = null,
|
||||||
|
@考勤编号 nvarchar(50) = null,
|
||||||
|
@密码 nvarchar(50) = null,
|
||||||
|
@姓名 nvarchar(50) = null,
|
||||||
|
@身份证号 nvarchar(50) = null,
|
||||||
|
@入公司时间 datetime = null,
|
||||||
|
@出生日期 datetime = null,
|
||||||
|
@联系电话 nvarchar(50) = null,
|
||||||
|
@家庭住址 nvarchar(50) = null,
|
||||||
|
@民族 nvarchar(10) = null,
|
||||||
|
@班组 int = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
DECLARE @人员编号 int
|
||||||
|
|
||||||
|
IF ISNULL(@姓名, '') = ''
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'姓名不能为空' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF ISNULL(@考勤编号, '') = ''
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'工号不能为空' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF TRY_CONVERT(int, @考勤编号) IS NULL
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'工号格式不正确' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_基础表_部门 WHERE 考核部门编号 = @考核部门编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'所属部门不存在,请重新选择部门' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 序号 = TRY_CONVERT(int, @考勤编号))
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'工号已存在,不能重复新增' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
BEGIN TRY
|
||||||
|
BEGIN TRAN
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[人事档案管理_人员名单](
|
||||||
|
[序号], [考勤编号], 姓名, 身份证号, 性别编号, 学历编号, 入公司时间,
|
||||||
|
出生日期, 联系电话, 考核部门编号, 密码, 家庭住址, 民族, 班组流水号)
|
||||||
|
VALUES(
|
||||||
|
TRY_CONVERT(int, @考勤编号), @考勤编号, @姓名, @身份证号, @性别编号, @学历编号, @入公司时间,
|
||||||
|
@出生日期, @联系电话, @考核部门编号, @密码, @家庭住址, @民族, @班组)
|
||||||
|
|
||||||
|
SET @人员编号 = SCOPE_IDENTITY()
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[人事档案管理_部门与人员](部门编号, 人员编号, 岗位编号)
|
||||||
|
VALUES(@考核部门编号, @人员编号, @岗位编号)
|
||||||
|
|
||||||
|
COMMIT TRAN
|
||||||
|
SELECT 1 AS result, N'添加成功' AS msg
|
||||||
|
END TRY
|
||||||
|
BEGIN CATCH
|
||||||
|
IF @@TRANCOUNT > 0 ROLLBACK TRAN
|
||||||
|
SELECT 0 AS result, ERROR_MESSAGE() AS msg
|
||||||
|
END CATCH
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_人员名单_修改数据_MESWORK]
|
||||||
|
@人员编号 int = null,
|
||||||
|
@性别编号 nvarchar(50) = null,
|
||||||
|
@学历编号 nvarchar(50) = null,
|
||||||
|
@毕业院校编号 int = null,
|
||||||
|
@专业编号 int = null,
|
||||||
|
@外语及熟练程度编号 int = null,
|
||||||
|
@职称编号 nvarchar(50) = null,
|
||||||
|
@岗位状态编号 int = null,
|
||||||
|
@岗位编号 int = null,
|
||||||
|
@考勤编号 nvarchar(50) = null,
|
||||||
|
@密码 nvarchar(50) = null,
|
||||||
|
@姓名 nvarchar(50) = null,
|
||||||
|
@身份证号 nvarchar(50) = null,
|
||||||
|
@入公司时间 datetime = null,
|
||||||
|
@出生日期 datetime = null,
|
||||||
|
@联系电话 nvarchar(50) = null,
|
||||||
|
@家庭住址 nvarchar(50) = null,
|
||||||
|
@民族 nvarchar(10) = null,
|
||||||
|
@班组 nvarchar(50) = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF ISNULL(@姓名, '') = ''
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'姓名不能为空' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF ISNULL(@考勤编号, '') = ''
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'工号不能为空' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF TRY_CONVERT(int, @考勤编号) IS NULL
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'工号格式不正确' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM 人事档案管理_人员名单
|
||||||
|
WHERE 序号 = TRY_CONVERT(int, @考勤编号)
|
||||||
|
AND 人员编号 <> @人员编号
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'工号已存在,不能重复保存' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF(@学历编号 = 'NAN') SET @学历编号 = null
|
||||||
|
IF(@性别编号 = 'NAN') SET @性别编号 = null
|
||||||
|
IF(@职称编号 = 'NAN') SET @职称编号 = null
|
||||||
|
IF(@班组 = 'NAN') SET @班组 = null
|
||||||
|
|
||||||
|
BEGIN TRY
|
||||||
|
BEGIN TRAN
|
||||||
|
|
||||||
|
UPDATE [dbo].[人事档案管理_人员名单]
|
||||||
|
SET 序号 = TRY_CONVERT(int, @考勤编号),
|
||||||
|
考勤编号 = @考勤编号,
|
||||||
|
姓名 = @姓名,
|
||||||
|
身份证号 = @身份证号,
|
||||||
|
性别编号 = TRY_CONVERT(int, @性别编号),
|
||||||
|
学历编号 = TRY_CONVERT(int, @学历编号),
|
||||||
|
入公司时间 = @入公司时间,
|
||||||
|
出生日期 = @出生日期,
|
||||||
|
联系电话 = @联系电话,
|
||||||
|
密码 = @密码,
|
||||||
|
家庭住址 = @家庭住址,
|
||||||
|
民族 = @民族,
|
||||||
|
班组流水号 = TRY_CONVERT(int, @班组)
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
UPDATE [dbo].[人事档案管理_部门与人员]
|
||||||
|
SET 岗位编号 = @岗位编号
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
COMMIT TRAN
|
||||||
|
SELECT 1 AS result, N'编辑成功' AS msg
|
||||||
|
END TRY
|
||||||
|
BEGIN CATCH
|
||||||
|
IF @@TRANCOUNT > 0 ROLLBACK TRAN
|
||||||
|
SELECT 0 AS result, ERROR_MESSAGE() AS msg
|
||||||
|
END CATCH
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_人员名单_移动数据_MESWORK]
|
||||||
|
@考核部门编号 int = null,
|
||||||
|
@人员编号 int = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_基础表_部门 WHERE 考核部门编号 = @考核部门编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'目标部门不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
BEGIN TRY
|
||||||
|
BEGIN TRAN
|
||||||
|
UPDATE [dbo].[人事档案管理_人员名单]
|
||||||
|
SET 考核部门编号 = @考核部门编号
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
UPDATE [dbo].[人事档案管理_部门与人员]
|
||||||
|
SET 部门编号 = @考核部门编号
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
COMMIT TRAN
|
||||||
|
SELECT 1 AS result, N'移组成功' AS msg
|
||||||
|
END TRY
|
||||||
|
BEGIN CATCH
|
||||||
|
IF @@TRANCOUNT > 0 ROLLBACK TRAN
|
||||||
|
SELECT 0 AS result, ERROR_MESSAGE() AS msg
|
||||||
|
END CATCH
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_人员名单_删除数据_MESWORK]
|
||||||
|
@人员编号 int = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
UPDATE 人事档案管理_人员名单
|
||||||
|
SET 是否离职 = 1,
|
||||||
|
岗位状态编号 = 2
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
DELETE FROM 菜单系统模块_人员与角色
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
SELECT 1 AS result, N'删除成功' AS msg
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_人员_离职操作]
|
||||||
|
@人员编号 int
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号 AND ISNULL(岗位状态编号, 1) = 2)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该员工已离职' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
UPDATE 人事档案管理_人员名单
|
||||||
|
SET 岗位状态编号 = 2
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
SELECT 1 AS result, N'离职成功' AS msg
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE OR ALTER PROCEDURE [dbo].[人事档案管理_人员_复职操作]
|
||||||
|
@人员编号 int
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号 AND ISNULL(是否离职, 0) <> 0)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该员工已被删除,不能复职' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号 AND ISNULL(岗位状态编号, 1) = 1)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该员工已是在职状态' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
UPDATE 人事档案管理_人员名单
|
||||||
|
SET 岗位状态编号 = 1,
|
||||||
|
是否离职 = 0
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
|
||||||
|
SELECT 1 AS result, N'复职成功' AS msg
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[人事档案管理_离职人员_删除数据]
|
||||||
|
@考勤编号 nvarchar(50) = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
DECLARE @人员编号 int
|
||||||
|
|
||||||
|
SELECT @人员编号 = 人员编号
|
||||||
|
FROM 人事档案管理_人员名单
|
||||||
|
WHERE 考勤编号 = @考勤编号
|
||||||
|
|
||||||
|
IF @人员编号 IS NULL
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM 人事档案管理_人员名单
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
AND ISNULL(岗位状态编号, 1) <> 2
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'只能删除离职人员' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
BEGIN TRY
|
||||||
|
BEGIN TRAN
|
||||||
|
DELETE FROM 菜单系统模块_人员与角色 WHERE 人员编号 = @人员编号
|
||||||
|
DELETE FROM 人事档案管理_部门与人员 WHERE 人员编号 = @人员编号
|
||||||
|
DELETE FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号
|
||||||
|
COMMIT TRAN
|
||||||
|
SELECT 1 AS result, N'删除成功' AS msg
|
||||||
|
END TRY
|
||||||
|
BEGIN CATCH
|
||||||
|
IF @@TRANCOUNT > 0 ROLLBACK TRAN
|
||||||
|
SELECT 0 AS result, ERROR_MESSAGE() AS msg
|
||||||
|
END CATCH
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[菜单系统模块_项目角色员工综合_增加数据]
|
||||||
|
@人员编号 int = null,
|
||||||
|
@角色编号 int = null,
|
||||||
|
@项目编号 int = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 人事档案管理_人员名单 WHERE 人员编号 = @人员编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM 人事档案管理_人员名单
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
AND (ISNULL(是否离职, 0) <> 0 OR ISNULL(岗位状态编号, 1) <> 1)
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该员工不是在职状态,不能分配角色' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 菜单系统模块_项目角色 WHERE 角色编号 = @角色编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'角色不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (SELECT 1 FROM 菜单系统模块_人员与角色 WHERE 人员编号 = @人员编号 AND 角色编号 = @角色编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该员工已分配该角色,不能重复新增' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
INSERT INTO [菜单系统模块_人员与角色](人员编号, 角色编号, 操作时间)
|
||||||
|
VALUES(@人员编号, @角色编号, GETDATE())
|
||||||
|
|
||||||
|
SELECT 1 AS result, N'增加成功' AS msg
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[菜单系统模块_项目角色员工综合_修改数据]
|
||||||
|
@人员角色流水号 int = null,
|
||||||
|
@人员编号 int = null,
|
||||||
|
@角色编号 int = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 菜单系统模块_人员与角色 WHERE 人员角色流水号 = @人员角色流水号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员角色关系不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 菜单系统模块_项目角色 WHERE 角色编号 = @角色编号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'角色不存在' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM 菜单系统模块_人员与角色
|
||||||
|
WHERE 人员编号 = @人员编号
|
||||||
|
AND 角色编号 = @角色编号
|
||||||
|
AND 人员角色流水号 <> @人员角色流水号
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'该员工已分配该角色,不能重复保存' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
UPDATE [菜单系统模块_人员与角色]
|
||||||
|
SET [角色编号] = @角色编号,
|
||||||
|
操作时间 = GETDATE()
|
||||||
|
WHERE [人员角色流水号] = @人员角色流水号
|
||||||
|
|
||||||
|
SELECT 1 AS result, N'修改成功' AS msg
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[菜单系统模块_项目角色员工综合_删除数据]
|
||||||
|
@人员角色流水号 int = null
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM 菜单系统模块_人员与角色 WHERE 人员角色流水号 = @人员角色流水号)
|
||||||
|
BEGIN
|
||||||
|
SELECT 0 AS result, N'人员角色关系不存在或已删除' AS msg
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
DELETE FROM 菜单系统模块_人员与角色
|
||||||
|
WHERE 人员角色流水号 = @人员角色流水号
|
||||||
|
|
||||||
|
SELECT 1 AS result, N'删除成功' AS msg
|
||||||
|
END
|
||||||
|
GO
|
||||||
Reference in New Issue
Block a user