Commit f4e76772 by wangzhihui

```

feat(salary): 添加提成方案提交审批功能

- 新增submitConfigApprove API接口用于提成方案提交审批
- 修改preview组件中limit类型支持String或Number
- 在审批记录组件中添加isEdit属性控制编辑模式
- 更新审批查看组件增加编辑功能和表单验证规则
- 添加变更说明输入框和附件上传功能
- 增加表单项目信息提示样式和查找索引方法
```
1 parent 3f4ff3d9
...@@ -63,3 +63,9 @@ export function exportPerfRule(data) { ...@@ -63,3 +63,9 @@ export function exportPerfRule(data) {
data.method = `dj.staff.api.perf.rule.export` data.method = `dj.staff.api.perf.rule.export`
return request(data) return request(data)
} }
//提成方案提交审批
export function submitConfigApprove(data) {
data.method = `dj.staff.api.performance.config.approve.submit`
return request(data)
}
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
default: () => [] default: () => []
}, },
limit: { limit: {
type: String, type: String | Number,
default: "1" default: "1"
}, },
index: { index: {
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
v-if="detailVisible" v-if="detailVisible"
:detailVisible="detailVisible" :detailVisible="detailVisible"
:id="id" :id="id"
:isEdit="true"
@dialogClose="handleDetailClose" @dialogClose="handleDetailClose"
></detail-dialog> ></detail-dialog>
</div> </div>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
:config="config" :config="config"
:is-show.sync="visible" :is-show.sync="visible"
class="accountDailog" class="accountDailog"
@handleClick="handleClick"
> >
<div class="sun-dialog" v-loading="loading"> <div class="sun-dialog" v-loading="loading">
<div class="approve-info"> <div class="approve-info">
...@@ -19,7 +20,12 @@ ...@@ -19,7 +20,12 @@
>,审批人通过方案后,方案正式生效 >,审批人通过方案后,方案正式生效
</div> </div>
<template v-if="detailInfo"> <template v-if="detailInfo">
<detailComp :configData="configData" :detailInfo="detailInfo"> <detailComp
:configData="configData"
:detailInfo="detailInfo"
:rules="rules"
:isClose="true"
>
<template #merchantBrandRefList> <template #merchantBrandRefList>
<div <div
class="merchantBrand-box" class="merchantBrand-box"
...@@ -48,40 +54,42 @@ ...@@ -48,40 +54,42 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</detailComp> </detailComp>
<el-form label-width="150px" style="margin-top: -60px"> <template v-if="!isEdit">
<el-row <el-form label-width="150px" style="margin-top: -60px">
:gutter="20" <el-row
:key="index" :gutter="20"
v-for="(item, index) in detailInfo.approveOperationRecordList" :key="index"
> v-for="(item, index) in detailInfo.approveOperationRecordList"
<el-col :span="12"> >
<el-form-item label="审批人:"> <el-col :span="12">
<span>{{ item.approverName || "-" }}</span> <el-form-item label="审批人:">
</el-form-item> <span>{{ item.approverName || "-" }}</span>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="审批意见:"> <el-col :span="12">
<!-- 将 v-html 改为纯文本插值,并应用换行样式 --> <el-form-item label="审批意见:">
<span class="opinion-text">{{ <!-- 将 v-html 改为纯文本插值,并应用换行样式 -->
formatOpinionText(item.approveOpinion) || "-" <span class="opinion-text">{{
}}</span> formatOpinionText(item.approveOpinion) || "-"
</el-form-item> }}</span>
</el-col> </el-form-item>
</el-row> </el-col>
</el-form> </el-row>
<el-form label-width="150px" v-if="detailInfo.referData"> </el-form>
<el-row <el-form label-width="150px" v-if="detailInfo.referData">
:gutter="20" <el-row
:key="index" :gutter="20"
v-for="(item, index) in detailInfo.referData" :key="index"
> v-for="(item, index) in detailInfo.referData"
<el-col :span="24"> >
<el-form-item label="查阅人:"> <el-col :span="24">
<span>{{ item.approverName || "-" }}</span> <el-form-item label="查阅人:">
</el-form-item> <span>{{ item.approverName || "-" }}</span>
</el-col> </el-form-item>
</el-row> </el-col>
</el-form> </el-row>
</el-form>
</template>
</template> </template>
</div> </div>
</baseDialog> </baseDialog>
...@@ -91,7 +99,7 @@ ...@@ -91,7 +99,7 @@
import { interviewResultOpt, processResultOpt } from "@/common/constants.js" import { interviewResultOpt, processResultOpt } from "@/common/constants.js"
import { import {
getConfigApprovetDetail, getConfigApprovetDetail,
getApproveConfig submitConfigApprove
} from "@/api/salaryManagement.js" } from "@/api/salaryManagement.js"
import detailComp from "./detailComp.vue" import detailComp from "./detailComp.vue"
import { Util, deepClone, getStatusItem } from "@/common/util" import { Util, deepClone, getStatusItem } from "@/common/util"
...@@ -105,15 +113,25 @@ export default { ...@@ -105,15 +113,25 @@ export default {
detailInfo: {}, detailInfo: {},
approveConfigData: [], approveConfigData: [],
getStatusItem, getStatusItem,
rules: {}, rules: {
editApproveRemark: [
{
required: true,
message: "请填写变更、新增方案说明",
trigger: "blur"
}
]
},
dialogConfig: { dialogConfig: {
title: "审批查看", title: "审批查看",
width: "1080px" width: "1080px"
}, },
config: { config: {
isShowFooter: false isShowFooter: false,
cancel_name: "取 消",
confirm_name: "确 定"
}, },
loading: false, loading: true,
isShow: true, isShow: true,
configData: [ configData: [
{ {
...@@ -138,6 +156,7 @@ export default { ...@@ -138,6 +156,7 @@ export default {
{ {
title: "变更、新增方案说明", title: "变更、新增方案说明",
key: "approveRemark", key: "approveRemark",
isHidden: true,
col: 24 col: 24
}, },
{ {
...@@ -145,6 +164,26 @@ export default { ...@@ -145,6 +164,26 @@ export default {
key: "attachmentImgs", key: "attachmentImgs",
type: "imgList", type: "imgList",
col: 24 col: 24
},
{
title: "变更、新增方案说明",
isEdit: true,
type: "textarea",
key: "editApproveRemark",
placeholder: "请输入(500字以内)",
isHidden: true,
col: 24
},
{
title: "附图说明",
isHidden: true,
isEdit: true,
key: "editAttachmentImgs",
type: "imgList",
limit: 3,
info: "最多3张图片",
col: 24
} }
] ]
} }
...@@ -164,6 +203,10 @@ export default { ...@@ -164,6 +203,10 @@ export default {
id: { id: {
type: Number || String, type: Number || String,
default: "" default: ""
},
isEdit: {
type: Boolean,
default: false
} }
}, },
computed: { computed: {
...@@ -189,6 +232,25 @@ export default { ...@@ -189,6 +232,25 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
async handleClick() {
let params = {
performanceConfigId: this.detailInfo.id,
approveRemark: this.detailInfo.editApproveRemark,
approveAttachments: this.detailInfo.editAttachmentImgs.length
? this.detailInfo.editAttachmentImgs.join(",")
: ""
}
submitConfigApprove(params)
.then((res) => {
if (res) {
this.$message.success("操作成功")
}
})
.finally((err) => {
this.visible = false
})
},
getDetail() { getDetail() {
getConfigApprovetDetail({ id: this.id }).then((res) => { getConfigApprovetDetail({ id: this.id }).then((res) => {
res.attachmentImgs = this.formatterImg(res.attachment_imgs) res.attachmentImgs = this.formatterImg(res.attachment_imgs)
...@@ -204,7 +266,27 @@ export default { ...@@ -204,7 +266,27 @@ export default {
res.merchantBrandList = this.handleMerchantBrandRefList( res.merchantBrandList = this.handleMerchantBrandRefList(
res.merchantBrandRefList res.merchantBrandRefList
) )
if (this.isEdit) {
res.editApproveRemark = res.approveRemark
res.editAttachmentImgs = []
this.dialogConfig.title = "提交审批"
this.config.isShowFooter = true
}
this.loading = false
this.configData[0].infoData[
this.findAttrIdx("infoData", "approveRemark")
].isHidden = !this.isEdit ? false : true
this.configData[0].infoData[
this.findAttrIdx("infoData", "attachmentImgs")
].isHidden = !this.isEdit ? false : true
this.configData[0].infoData[
this.findAttrIdx("infoData", "editApproveRemark")
].isHidden = this.isEdit ? false : true
this.configData[0].infoData[
this.findAttrIdx("infoData", "editAttachmentImgs")
].isHidden = this.isEdit ? false : true
this.detailInfo = res this.detailInfo = res
// console.log(this.detailInfo, "this.detailInfo") // console.log(this.detailInfo, "this.detailInfo")
}) })
}, },
...@@ -246,6 +328,10 @@ export default { ...@@ -246,6 +328,10 @@ export default {
return result return result
}, },
findAttrIdx(formName, name) {
var index = this.configData[0][formName].findIndex((k) => k.key == name)
return index || 0
},
handleClose() { handleClose() {
console.log("handleClose") console.log("handleClose")
}, },
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
word-break: break-all; word-break: break-all;
line-height: 20px; line-height: 20px;
} }
::v-deep el-form-item--medium .el-form-item__label { ::v-deep el-form-item--medium .el-form-item__label {
line-height: 20px; line-height: 20px;
} }
...@@ -112,4 +112,13 @@ ...@@ -112,4 +112,13 @@
} }
} }
} }
.form_item {
position: relative;
.info {
position: absolute;
top: 102%;
color: #999999;
font-size: 12px;
}
}
} }
...@@ -16,12 +16,18 @@ ...@@ -16,12 +16,18 @@
<template v-for="(item, key) in item.infoData"> <template v-for="(item, key) in item.infoData">
<template v-if="item.isHidden ? !item.isHidden : true"> <template v-if="item.isHidden ? !item.isHidden : true">
<el-col :span="item.col ? item.col : 12" :key="key"> <el-col :span="item.col ? item.col : 12" :key="key">
<el-form-item :label="item.title + ':'" :prop="item.key"> <el-form-item
:label="item.title + ':'"
:prop="item.key"
class="form_item"
>
<template v-if="item.type == 'imgList'"> <template v-if="item.type == 'imgList'">
<div <div
class="photo-box" class="photo-box"
v-if=" v-if="
detailInfo[item.key] && detailInfo[item.key].length (detailInfo[item.key] &&
detailInfo[item.key].length) ||
item.isEdit
" "
> >
<glsx-preview <glsx-preview
...@@ -33,8 +39,9 @@ ...@@ -33,8 +39,9 @@
...picOptions, ...picOptions,
type: item.otherType type: item.otherType
}" }"
limit="1" :limit="item.limit ? item.limit : 1"
></glsx-preview> ></glsx-preview>
<div class="info">{{ item.info }}</div>
</div> </div>
<template v-else> - </template> <template v-else> - </template>
</template> </template>
...@@ -152,8 +159,8 @@ ...@@ -152,8 +159,8 @@
</template> </template>
</div> </div>
</template> </template>
</el-form-item></el-col </el-form-item>
> </el-col>
</template> </template>
</template> </template>
</el-row> </el-row>
...@@ -221,6 +228,20 @@ export default { ...@@ -221,6 +228,20 @@ export default {
rules: { rules: {
type: Object, type: Object,
default: () => {} default: () => {}
},
isClose: {
type: Boolean,
default: false
}
},
watch: {
isClose: {
handler(val) {
if (val) {
this.picOptions.isClose = val
}
},
immediate: true
} }
}, },
data() { data() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!