Compare commits

...

3 Commits

  1. 5
      src/api/home/salary.js
  2. 2
      src/views/Basic/Dept/DeptForm.vue
  3. 31
      src/views/Home/Salary/index.vue
  4. 22
      src/views/OKR/Management/Components/AllTarget.vue
  5. 1
      src/views/OKR/Management/Components/DialogOkrInfo.vue
  6. 43
      src/views/OKR/Management/Components/ObjectList.vue

@ -54,3 +54,8 @@ export const getLinkHistorySalary = async () => {
export const getCommissionDetail = async (params) => { export const getCommissionDetail = async (params) => {
return await request.get({ url: '/admin-api/oa/user-salary-grant/detail', params }) return await request.get({ url: '/admin-api/oa/user-salary-grant/detail', params })
} }
// 发送工资条通知
export const sendSalaryNotice = (data) => {
return request.post({ url: '/admin-api/oa/user-salary-grant/pushUserSalaryGrantDetail', data })
}

@ -197,7 +197,7 @@ const resetForm = () => {
/** 获得部门树 */ /** 获得部门树 */
const getTree = async () => { const getTree = async () => {
deptTree.value = [] deptTree.value = []
const data = await DeptApi.getSimpleDeptList({ allFlag: false }) const data = await DeptApi.getSimpleDeptList({ allFlag: true })
let dept: Tree = { id: 0, name: '顶级部门', children: [] } let dept: Tree = { id: 0, name: '顶级部门', children: [] }
dept.children = handleTree(data) dept.children = handleTree(data)
deptTree.value.push(dept) deptTree.value.push(dept)

@ -308,9 +308,24 @@
<span v-if="row.status == 0">封存</span> <span v-if="row.status == 0">封存</span>
<span v-else-if="row.status == 1">已封存</span> <span v-else-if="row.status == 1">已封存</span>
</el-button> </el-button>
<el-button type="primary" v-if="row.grantId" text @click="handleDetail(row)"> <el-button
type="primary"
v-if="row.grantId"
style="padding: 0"
text
@click="handleDetail(row)"
>
提成明细 提成明细
</el-button> </el-button>
<el-button
type="primary"
text
v-hasPermi="['home:salary:send']"
style="padding: 0"
@click="handelSendNotic(row)"
>
发送工资条
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -468,6 +483,20 @@ async function handleDetail(row) {
console.log(error) console.log(error)
} }
} }
function handelSendNotic(row) {
const name = row.grantId ? row.name : row.period
const params = row.grantId ? { grantId: row.grantId } : { period: row.period }
message.confirm('确认要发送"' + name + '"工资条吗?').then(async () => {
try {
await SalaryApi.sendSalaryNotice(params)
message.success('发送成功!')
} catch (error) {
message.error(error)
console.log(error)
}
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -86,16 +86,18 @@ function handleSearchPeroid() {
} }
function nodeChange(nodeId) { function nodeChange(nodeId) {
searchForm.value.nodeId = nodeId if (nodeId) {
getOkrList() searchForm.value.nodeId = nodeId
const currentNode = findNode(peroidList.value, (node) => { getOkrList()
return node.nodeId == nodeId const currentNode = findNode(peroidList.value, (node) => {
}) return node.nodeId == nodeId
searchForm.value.creatorId = currentNode.creatorId })
if (!currentNode.children || currentNode.children.length == 0) { searchForm.value.creatorId = currentNode.creatorId
isCurrentLeafNode.value = true if (!currentNode.children || currentNode.children.length == 0) {
} else { isCurrentLeafNode.value = true
isCurrentLeafNode.value = false } else {
isCurrentLeafNode.value = false
}
} }
} }

@ -521,6 +521,7 @@ async function handleSave() {
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
if (!valid) return if (!valid) return
form.value.executor = form.value.executor || []
if (form.value.executor.length > 1) { if (form.value.executor.length > 1) {
message message
.confirm('是否按照当前节点所选的多个执行人自动新增对应的员工节点?', { .confirm('是否按照当前节点所选的多个执行人自动新增对应的员工节点?', {

@ -30,9 +30,11 @@
</div> </div>
<vue3-tree-org <vue3-tree-org
ref="treeOrgRef"
:data="dataList" :data="dataList"
center center
collapsable collapsable
:default-expand-keys="lastExpendKeys"
:props="treeProps" :props="treeProps"
@on-node-click="handleClickNode" @on-node-click="handleClickNode"
> >
@ -74,7 +76,7 @@
</template> </template>
</vue3-tree-org> </vue3-tree-org>
<DialogOkr ref="dialogOkr" @edit="handleEditOkr" /> <DialogOkr ref="dialogOkr" @edit="handleEditOkr" />
<DialogOkrInfo ref="dialogOkrInfo" @close="openOkr" /> <DialogOkrInfo ref="dialogOkrInfo" @close="openOkr" @success="resetTreeData" />
</div> </div>
</template> </template>
@ -89,6 +91,7 @@ import { listToTree } from '@/utils/tree'
const dataList = ref({}) const dataList = ref({})
const helpDataList = ref([]) const helpDataList = ref([])
const lastExpendKeys = ref([])
const treeProps = { const treeProps = {
children: 'children', children: 'children',
label: 'nodeName', label: 'nodeName',
@ -106,6 +109,7 @@ const peroidList = ref([])
handleSearchPeroid() handleSearchPeroid()
function handleSearchPeroid() { function handleSearchPeroid() {
lastExpendKeys.value = []
getOkrRelationTree().then((resp) => { getOkrRelationTree().then((resp) => {
peroidList.value = resp peroidList.value = resp
if (resp && resp.length && !searchForm.value.nodeId) { if (resp && resp.length && !searchForm.value.nodeId) {
@ -116,6 +120,43 @@ function handleSearchPeroid() {
}) })
} }
const treeOrgRef = ref(null)
function resetTreeData() {
if (treeOrgRef.value) {
lastExpendKeys.value = treeOrgRef.value.getExpandKeys()
}
// tree
getOkrRelationTree().then((resp) => {
peroidList.value = resp
if (resp && resp.length) {
if (!searchForm.value.nodeId) {
searchForm.value.nodeId = resp[0].nodeId
searchForm.value.nodeName = resp[0].nodeName
}
getOkrRelationTreeChildren({
nodeId: searchForm.value.nodeId
}).then((resp) => {
const tree = listToTree(resp, {
id: 'nodeId',
pid: 'parentId',
children: 'children'
})
// // keys
// if (treeOrgRef.value) {
// treeOrgRef.value.setExpandKeys(lastExpendKeys.value)
// }
helpDataList.value = resp
if (tree && tree.length) {
dataList.value = tree[0]
} else {
dataList.value = {}
}
})
}
})
}
function getOkrList() { function getOkrList() {
getOkrRelationTreeChildren({ getOkrRelationTreeChildren({
nodeId: searchForm.value.nodeId nodeId: searchForm.value.nodeId

Loading…
Cancel
Save