Commit f4e76772 by wangzhihui

```

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

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