Commit 29b22942 by wangchunyang

日常管理功能菜单添加

parent 18656f01
......@@ -71,5 +71,3 @@ export const getInboundById = (param) => {
data: param
})
}
......@@ -71,5 +71,3 @@ export const getBorrowById = (param) => {
data: param
})
}
......@@ -89,5 +89,3 @@ export const getLeaveStats = (param) => {
data: param
})
}
......@@ -33,5 +33,3 @@ export const getWorkloadDetails = (param) => {
data: param
})
}
......@@ -26,5 +26,3 @@ export const saveDmUser = (param) => {
data: param
})
}
......@@ -116,4 +116,3 @@ export const deleteMaterial = (param) => {
data: param
})
}
......@@ -206,5 +206,53 @@ export default [
title: '居住外地人员管理'
},
component: () => import('@/view/people-info/personManageTabs')
},
{
path: '/key-person/dmConf',
name: 'dmConf',
meta: {
title: '日常管理配置'
},
component: () => import('@/view/key-person/key_dm_conf/index')
},
{
path: '/key-person/dmUser',
name: 'dmUser',
meta: {
title: '日常管理用户信息'
},
component: () => import('@/view/key-person/key_dm_user/index')
},
{
path: '/key-person/dmLeave',
name: 'dmLeave',
meta: {
title: '日常管理请假'
},
component: () => import('@/view/key-person/key_dm_leave/index')
},
{
path: '/key-person/dmInventoryApply',
name: 'dmInventoryApply',
meta: {
title: '日常管理用品管理'
},
component: () => import('@/view/key-person/key_dm_inventory/index')
},
{
path: '/key-person/dmInventoryInbound',
name: 'dmInventoryInbound',
meta: {
title: '日常管理用品入库'
},
component: () => import('@/view/key-person/key_dm_inventory/inbound')
},
{
path: '/key-person/dmInventoryStats',
name: 'dmInventoryStats',
meta: {
title: '日常管理统计'
},
component: () => import('@/view/key-person/key_dm_inventory/stats')
}
]
......@@ -533,10 +533,14 @@ export default {
{ title: '规格型号', key: 'material_spec', align: 'center' },
{ title: '单位', key: 'unit', align: 'center', width: 80 },
{ title: '单价', key: 'unit_price', align: 'center', width: 100 },
{ title: '物料状态', key: 'status', align: 'center', width: 100, render: (h, { row }) => {
const statusMap = { 0: '报废', 1: '使用', 2: '待修' }
return h('span', statusMap[row.status] || '-')
}},
{ title: '物料状态',
key: 'status',
align: 'center',
width: 100,
render: (h, { row }) => {
const statusMap = { 0: '报废', 1: '使用', 2: '待修' }
return h('span', statusMap[row.status] || '-')
} },
{ title: '操作', slot: 'action', align: 'center', width: 180, fixed: 'right' }
]
}
......@@ -793,4 +797,3 @@ export default {
text-align: right;
}
</style>
......@@ -181,11 +181,11 @@ export default {
activeTab: 'inbound',
filters: { inbound: { inbound_no: '' }, return: { key: '' }, inventory: { material_name: '' } },
tables: { inbound: [], return: [], inventory: [] },
pagers: { inbound: { pageNo:1,pageSize:10,totalRecord:0 }, return: { pageNo:1,pageSize:10,totalRecord:0 }, inventory: { pageNo:1,pageSize:10,totalRecord:0 } },
loading: { inbound:false, return:false, inventory:false },
inboundModal: { visible:false,isEdit:false,saving:false,form:{},details:[] },
returnModal: { visible:false,record:{},details:[],saving:false },
detailModal: { visible:false,loading:false,data:{},details:[],logs:[] }
pagers: { inbound: { pageNo: 1, pageSize: 10, totalRecord: 0 }, return: { pageNo: 1, pageSize: 10, totalRecord: 0 }, inventory: { pageNo: 1, pageSize: 10, totalRecord: 0 } },
loading: { inbound: false, return: false, inventory: false },
inboundModal: { visible: false, isEdit: false, saving: false, form: {}, details: [] },
returnModal: { visible: false, record: {}, details: [], saving: false },
detailModal: { visible: false, loading: false, data: {}, details: [], logs: [] }
}
},
created () { this.fetchList('inbound') },
......@@ -204,18 +204,18 @@ export default {
if (ret.data && ret.data.errcode === 0) {
const data = ret.data.data || {}
this.tables[tab] = data.results || []
if (data.totalRecord !== undefined) (this.pagers[tab]||{}).totalRecord = data.totalRecord
} else this.$Notice.error({ title:'查询失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.loading[tab]=false })
if (data.totalRecord !== undefined) (this.pagers[tab] || {}).totalRecord = data.totalRecord
} else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.loading[tab] = false })
},
handleSearch (tab) { (this.pagers[tab]||{}).pageNo=1; this.fetchList(tab) },
handleReset (tab) { this.filters[tab] = {}; (this.pagers[tab]||{}).pageNo=1; this.fetchList(tab) },
pageChange (tab,pageNo) { (this.pagers[tab]||{}).pageNo=pageNo; this.fetchList(tab) },
sizeChange (tab,size) { (this.pagers[tab]||{}).pageSize=size; (this.pagers[tab]||{}).pageNo=1; this.fetchList(tab) },
handleSearch (tab) { (this.pagers[tab] || {}).pageNo = 1; this.fetchList(tab) },
handleReset (tab) { this.filters[tab] = {}; (this.pagers[tab] || {}).pageNo = 1; this.fetchList(tab) },
pageChange (tab, pageNo) { (this.pagers[tab] || {}).pageNo = pageNo; this.fetchList(tab) },
sizeChange (tab, size) { (this.pagers[tab] || {}).pageSize = size; (this.pagers[tab] || {}).pageNo = 1; this.fetchList(tab) },
openInboundModal () {
this.inboundModal.isEdit = false
this.inboundModal.form = { inbound_no:'', batch_no:'', inbound_date:'', inbound_type:1, storage_location:'', remark:'' }
this.inboundModal.form = { inbound_no: '', batch_no: '', inbound_date: '', inbound_type: 1, storage_location: '', remark: '' }
this.inboundModal.details = []
this.inboundModal.visible = true
},
......@@ -232,12 +232,12 @@ export default {
saveInbound () {
this.inboundModal.saving = true
saveInbound(Object.assign({}, this.inboundModal.form, { details: this.inboundModal.details })).then(ret => {
if (ret.data && ret.data.errcode === 0) { this.$Message.success('保存成功'); this.inboundModal.visible=false; this.fetchList('inbound') } else this.$Notice.error({ title:'保存失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.inboundModal.saving=false })
if (ret.data && ret.data.errcode === 0) { this.$Message.success('保存成功'); this.inboundModal.visible = false; this.fetchList('inbound') } else this.$Notice.error({ title: '保存失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.inboundModal.saving = false })
},
canEdit (row) { return row.inbound_status === 0 },
deleteInbound (row) { deleteInbound({ id: row.id }).then(ret => { if (ret.data && ret.data.errcode === 0) { this.$Message.success('删除成功'); this.fetchList('inbound') } else this.$Notice.error({ title:'删除失败', desc: ret.data && ret.data.errmsg }) }) },
doInbound (row) { doInbound({ id: row.id }).then(ret=>{ if (ret.data && ret.data.errcode === 0) { this.$Message.success('入库成功'); this.fetchList('inbound'); this.fetchList('inventory') } else this.$Notice.error({ title:'入库失败', desc: ret.data && ret.data.errmsg }) }) },
deleteInbound (row) { deleteInbound({ id: row.id }).then(ret => { if (ret.data && ret.data.errcode === 0) { this.$Message.success('删除成功'); this.fetchList('inbound') } else this.$Notice.error({ title: '删除失败', desc: ret.data && ret.data.errmsg }) }) },
doInbound (row) { doInbound({ id: row.id }).then(ret => { if (ret.data && ret.data.errcode === 0) { this.$Message.success('入库成功'); this.fetchList('inbound'); this.fetchList('inventory') } else this.$Notice.error({ title: '入库失败', desc: ret.data && ret.data.errmsg }) }) },
openReturnModal (row) {
this.returnModal.record = Object.assign({}, row)
......@@ -250,8 +250,8 @@ export default {
confirmReturn () {
this.returnModal.saving = true
processReturn({ id: this.returnModal.record.id }).then(ret => {
if (ret.data && ret.data.errcode === 0) { this.$Message.success('归还已入库并更新库存'); this.returnModal.visible=false; this.fetchList('return'); this.fetchList('inventory') } else this.$Notice.error({ title:'归还失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.returnModal.saving=false })
if (ret.data && ret.data.errcode === 0) { this.$Message.success('归还已入库并更新库存'); this.returnModal.visible = false; this.fetchList('return'); this.fetchList('inventory') } else this.$Notice.error({ title: '归还失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.returnModal.saving = false })
},
openDetail (row) {
......@@ -262,8 +262,8 @@ export default {
this.detailModal.data = ret.data.data || {}
this.detailModal.details = ret.data.data.details || []
this.detailModal.logs = ret.data.data.logs || []
} else this.$Notice.error({ title:'查询失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.detailModal.loading=false })
} else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.detailModal.loading = false })
}
}
}
......@@ -277,5 +277,3 @@ export default {
.page_style { margin-top: 12px; text-align: right; }
.mt8 { margin-top: 8px; }
</style>
......@@ -173,11 +173,11 @@ export default {
activeTab: 'apply',
filters: { apply: { applicant_name: '' } },
tables: { apply: [], pending: [], history: [] },
pagers: { apply: { pageNo:1,pageSize:10,totalRecord:0 }, pending: { pageNo:1,pageSize:10,totalRecord:0 }, history: { pageNo:1,pageSize:10,totalRecord:0 } },
loading: { apply:false,pending:false,history:false },
applyModal: { visible:false,isEdit:false,saving:false,form:{},details:[] },
approveModal: { visible:false,record:{},details:[],opinion:'',submitting:false },
detailModal: { visible:false,loading:false,data:{},details:[],logs:[] }
pagers: { apply: { pageNo: 1, pageSize: 10, totalRecord: 0 }, pending: { pageNo: 1, pageSize: 10, totalRecord: 0 }, history: { pageNo: 1, pageSize: 10, totalRecord: 0 } },
loading: { apply: false, pending: false, history: false },
applyModal: { visible: false, isEdit: false, saving: false, form: {}, details: [] },
approveModal: { visible: false, record: {}, details: [], opinion: '', submitting: false },
detailModal: { visible: false, loading: false, data: {}, details: [], logs: [] }
}
},
created () { this.fetchList('apply') },
......@@ -196,18 +196,18 @@ export default {
if (ret.data && ret.data.errcode === 0) {
const data = ret.data.data || {}
this.tables[tab] = data.results || []
if (data.totalRecord !== undefined) (this.pagers[tab]||{}).totalRecord = data.totalRecord
} else this.$Notice.error({ title:'查询失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.loading[tab]=false })
if (data.totalRecord !== undefined) (this.pagers[tab] || {}).totalRecord = data.totalRecord
} else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.loading[tab] = false })
},
handleSearch (tab) { (this.pagers[tab]||{}).pageNo=1; this.fetchList(tab) },
handleReset (tab) { this.filters[tab] = {}; (this.pagers[tab]||{}).pageNo=1; this.fetchList(tab) },
pageChange (tab,pageNo) { (this.pagers[tab]||{}).pageNo=pageNo; this.fetchList(tab) },
sizeChange (tab,size) { (this.pagers[tab]||{}).pageSize=size; (this.pagers[tab]||{}).pageNo=1; this.fetchList(tab) },
handleSearch (tab) { (this.pagers[tab] || {}).pageNo = 1; this.fetchList(tab) },
handleReset (tab) { this.filters[tab] = {}; (this.pagers[tab] || {}).pageNo = 1; this.fetchList(tab) },
pageChange (tab, pageNo) { (this.pagers[tab] || {}).pageNo = pageNo; this.fetchList(tab) },
sizeChange (tab, size) { (this.pagers[tab] || {}).pageSize = size; (this.pagers[tab] || {}).pageNo = 1; this.fetchList(tab) },
openApplyModal () {
this.applyModal.isEdit = false
this.applyModal.form = { applicant_id:'', applicant_name:'', department_id:'', department_name:'', borrow_purpose:'', expected_return_date:'', approval_status:0 }
this.applyModal.form = { applicant_id: '', applicant_name: '', department_id: '', department_name: '', borrow_purpose: '', expected_return_date: '', approval_status: 0 }
this.applyModal.details = []
this.applyModal.visible = true
},
......@@ -226,18 +226,20 @@ export default {
this.applyModal.saving = true
const payload = Object.assign({}, this.applyModal.form, { details: this.applyModal.details })
saveBorrowApplication(payload).then(ret => {
if (ret.data && ret.data.errcode === 0) { this.$Message.success('保存成功'); this.applyModal.visible=false; this.fetchList('apply') } else this.$Notice.error({ title:'保存失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.applyModal.saving=false })
if (ret.data && ret.data.errcode === 0) { this.$Message.success('保存成功'); this.applyModal.visible = false; this.fetchList('apply') } else this.$Notice.error({ title: '保存失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.applyModal.saving = false })
},
canEdit (row) { return row.approval_status === 0 || row.approval_status === -1 },
canSubmit (row) { return row.approval_status === 0 || row.approval_status === -1 },
canRevoke (row) { return row.approval_status === 1 },
submit (row) {
this.$Modal.confirm({ title:'确认提交', content:'提交后进入审批流程,是否继续?', onOk: () => {
submitBorrow({ id: row.id }).then(ret => { if (ret.data && ret.data.errcode === 0) { this.$Message.success('提交成功'); this.fetchList('apply') } else this.$Notice.error({ title:'提交失败', desc: ret.data && ret.data.errmsg }) })
}})
this.$Modal.confirm({ title: '确认提交',
content: '提交后进入审批流程,是否继续?',
onOk: () => {
submitBorrow({ id: row.id }).then(ret => { if (ret.data && ret.data.errcode === 0) { this.$Message.success('提交成功'); this.fetchList('apply') } else this.$Notice.error({ title: '提交失败', desc: ret.data && ret.data.errmsg }) })
} })
},
revoke (row) { revokeBorrow({ id: row.id }).then(ret=>{ if (ret.data && ret.data.errcode === 0){ this.$Message.success('撤回成功'); this.fetchList('apply') } else this.$Notice.error({ title:'撤回失败', desc: ret.data && ret.data.errmsg }) }) },
revoke (row) { revokeBorrow({ id: row.id }).then(ret => { if (ret.data && ret.data.errcode === 0) { this.$Message.success('撤回成功'); this.fetchList('apply') } else this.$Notice.error({ title: '撤回失败', desc: ret.data && ret.data.errmsg }) }) },
openApproveModal (row) {
this.approveModal.record = Object.assign({}, row)
......@@ -253,15 +255,15 @@ export default {
confirmApprove () {
this.approveModal.submitting = true
approveBorrow({ id: this.approveModal.record.id }).then(ret => {
if (ret.data && ret.data.errcode === 0) { this.$Message.success('已通过,已生成出库并更新库存'); this.approveModal.visible=false; this.fetchList('pending'); this.fetchList('apply') } else this.$Notice.error({ title:'操作失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.approveModal.submitting=false })
if (ret.data && ret.data.errcode === 0) { this.$Message.success('已通过,已生成出库并更新库存'); this.approveModal.visible = false; this.fetchList('pending'); this.fetchList('apply') } else this.$Notice.error({ title: '操作失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.approveModal.submitting = false })
},
confirmReject () {
if (!this.approveModal.opinion || !this.approveModal.opinion.trim()) { this.$Message.warning('请输入驳回原因'); return }
this.approveModal.submitting = true
rejectBorrow({ id: this.approveModal.record.id, comment: this.approveModal.opinion }).then(ret => {
if (ret.data && ret.data.errcode === 0) { this.$Message.success('已驳回'); this.approveModal.visible=false; this.fetchList('pending') } else this.$Notice.error({ title:'驳回失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.approveModal.submitting=false })
if (ret.data && ret.data.errcode === 0) { this.$Message.success('已驳回'); this.approveModal.visible = false; this.fetchList('pending') } else this.$Notice.error({ title: '驳回失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.approveModal.submitting = false })
},
openDetail (row) {
......@@ -272,8 +274,8 @@ export default {
this.detailModal.data = ret.data.data || {}
this.detailModal.details = ret.data.data.details || []
this.detailModal.logs = ret.data.data.logs || []
} else this.$Notice.error({ title:'查询失败', desc: ret.data && ret.data.errmsg })
}).finally(()=>{ this.detailModal.loading=false })
} else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.detailModal.loading = false })
}
}
}
......@@ -287,5 +289,3 @@ export default {
.page_style { margin-top: 12px; text-align: right; }
.mt8 { margin-top: 8px; }
</style>
......@@ -143,5 +143,3 @@ export default {
.page_style { margin-top: 12px; text-align: right; }
.mt8 { margin-top: 8px; }
</style>
......@@ -268,7 +268,10 @@ export default {
sizeChange (tab, size) { (this.pagers[tab] || {}).pageSize = size; (this.pagers[tab] || {}).pageNo = 1; this.fetchList(tab) },
loadLeaveTypes () {
getDictList({ type: 'leave_type' }).then(res => {
const list = res.data && (res.data.data || res.data.results) || []
let list = res.data
if (list) {
list = (res.data.data || res.data.results) || []
}
this.leaveTypes = Array.isArray(list) ? list.map(it => ({ id: it.value || it.dictValue, type_name: it.label || it.name })) : []
})
},
......@@ -296,11 +299,13 @@ export default {
canSubmit (row) { return row.status === 0 || row.status === -1 },
canRevoke (row) { return row.status === 1 },
submit (row) {
this.$Modal.confirm({ title: '确认提交', content: '确认提交此请假申请进入审批流程?', onOk: () => {
submitLeaveApplication({ id: row.id }).then(ret => {
if (ret.data && ret.data.errcode === 0) { this.$Message.success('提交成功'); this.fetchList('apply') } else this.$Notice.error({ title: '提交失败', desc: ret.data && ret.data.errmsg })
})
}})
this.$Modal.confirm({ title: '确认提交',
content: '确认提交此请假申请进入审批流程?',
onOk: () => {
submitLeaveApplication({ id: row.id }).then(ret => {
if (ret.data && ret.data.errcode === 0) { this.$Message.success('提交成功'); this.fetchList('apply') } else this.$Notice.error({ title: '提交失败', desc: ret.data && ret.data.errmsg })
})
} })
},
revoke (row) {
revokeLeaveApplication({ id: row.id }).then(ret => {
......@@ -337,15 +342,27 @@ export default {
},
openHistoryDetail (row) { this.openDetail(row) },
renderApproveResult (h, { row }) { return row.approver_result === 1 ? '通过' : (row.approver_result === -1 ? '驳回' : '未处理') },
formatDatetime (val) { if (!val) return '-'; return String(val).replace('T',' ') },
formatDatetime (val) { if (!val) return '-'; return String(val).replace('T', ' ') },
loadStats () {
this.loading.stats = true
const params = { start: this.statsRange && this.statsRange[0], end: this.statsRange && this.statsRange[1], department: this.statsDept }
const params = {
start: this.statsRange && this.statsRange[0],
end: this.statsRange && this.statsRange[1],
department: this.statsDept
}
getLeaveStats({ params }).then(ret => {
if (ret.data && ret.data.errcode === 0) this.tables.stats = ret.data.data || [] else this.$Notice.error({ title: '统计失败', desc: ret.data && ret.data.errmsg })
if (ret.data && ret.data.errcode === 0) {
this.tables.stats = ret.data.data || []
} else {
this.$Notice.error({ title: '统计失败', desc: ret.data && ret.data.errmsg })
}
}).finally(() => { this.loading.stats = false })
},
resetStats () { this.statsRange = []; this.statsDept = ''; this.tables.stats = [] }
resetStats () {
this.statsRange = []
this.statsDept = ''
this.tables.stats = []
}
}
}
</script>
......@@ -358,5 +375,3 @@ export default {
.page_style { margin-top: 12px; text-align: right; }
.mt8 { margin-top: 8px; }
</style>
......@@ -192,5 +192,3 @@ export default {
.mr10 { margin-right: 10px; }
.page_style { margin-top: 12px; text-align: right; }
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论