<template>
|
<a-modal
|
:title="title"
|
:width="1200"
|
:visible="visible"
|
:confirmLoading="confirmLoading"
|
:maskClosable="false"
|
@ok="handleOk"
|
@cancel="handleCancel">
|
|
<template slot="footer">
|
<a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
|
<a-button style="margin-right: .8rem">取消</a-button>
|
</a-popconfirm>
|
|
<a-button type="primary" :loading="confirmLoading" @click="handleOk()">
|
保存
|
</a-button>
|
</template>
|
|
<a-spin :spinning="confirmLoading">
|
<a-form-model ref="form" :model="model" :rules="validatorRules">
|
<!-- 主表单区域 -->
|
<a-card :bordered="false" size="small" title="技术研发贡献奖金系数确定">
|
|
<a-row class="form-row" :gutter="16">
|
|
<a-col :lg="8">
|
|
<a-form-model-item label="奖励方式" prop="type">
|
<j-dict-select-tag disabled @input="changeRewardType" :value="Number" v-model="model.type"
|
placeholder="请选奖励方式"
|
dictCode="bonus_type" />
|
</a-form-model-item>
|
</a-col>
|
|
</a-row>
|
|
</a-card>
|
|
<div v-show="showModel1">
|
<a-collapse v-model="percentageKey" style="margin-top: 20px" accordion>
|
<template #expandIcon="props">
|
<a-icon type="caret-right" :rotate="props.isActive ? 90 : 0" />
|
</template>
|
<a-collapse-panel key="1" header="标准成本系数(0.8~1.2)" class="customStyle">
|
|
<a-form-model-item label="每年进行一次核算,奖励范围研发部门参与该项目的全部项目组成员:" prop="gxCbxs">
|
<a-radio-group v-model="model.gxCbxs">
|
|
<a-radio class="m5" :value="1.2">
|
A:基于标准成本的毛利率大于60%,标准成本系数(1.2)
|
</a-radio>
|
<a-radio class="m5" :value="1">
|
B:基于标准成本的毛利率为45-60%(含),标准成本系数(1)
|
</a-radio>
|
<a-radio class="m5" :value="0.8">
|
C:基于标准成本的毛利率低于45%(含),标准成本系数(0.8)
|
</a-radio>
|
|
</a-radio-group>
|
</a-form-model-item>
|
<!-- <a-icon slot="extra" type="setting" />-->
|
<label slot="extra" style="background: transparent" type="setting"> {{model.gxCbxs}}</label>
|
|
</a-collapse-panel>
|
</a-collapse>
|
</div>
|
|
|
</a-form-model>
|
</a-spin>
|
|
|
</a-modal>
|
</template>
|
|
<script>
|
import JSelectUserByDepModal from '@/components/jeecgbiz/modal/JSelectUserByDepModal'
|
import { httpAction, getAction, postAction, putAction } from '@/api/manage'
|
import pick from 'lodash.pick'
|
|
export default {
|
name: 'DeGxModal',
|
components: {
|
JSelectUserByDepModal
|
},
|
|
data() {
|
|
return {
|
title: '项目定额',
|
visible: false,
|
form: this.$form.createForm(this),
|
showModel1: true, //根据选择的奖励方式显示UI 默认为model1
|
marketKey: ['1'], //折叠面板默认打开第一个
|
percentageKey: ['1'], //折叠面板默认打开第一个
|
curPage: '1',
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 5 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 }
|
},
|
confirmLoading: false,
|
validatorRules: {
|
gxCbxs: [{ required: true, message: '请选择基准提成系数!' }],
|
type: [{ required: true, message: '请选择奖励方式!' }],
|
base: [{ required: true, message: '请输入奖金基数!' }]
|
|
},
|
url: {
|
gx: '/bon/quota/gx',
|
query: '/bon/quota/query'
|
}
|
}
|
},
|
created() {
|
|
},
|
computed: {},
|
watch: {},
|
methods: {
|
edit(id) {
|
this.visible = true
|
let res = {}
|
res.id = id
|
res.type =4
|
this.model = Object.assign({}, res)
|
getAction(this.url.query, { id: this.model.id }).then((res) => {
|
if (res.success) {
|
this.loading = false
|
this.model = res.result
|
}
|
}).finally(() => {
|
this.loading = false
|
})
|
},
|
changeRewardType(value) {
|
//显示第一种奖励方案的
|
if (value == 1) {
|
this.showModel1 = true
|
} else {
|
this.showModel1 = false
|
}
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
handleOk() {
|
let that = this
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
console.info(this.model)
|
putAction(this.url.gx, this.model).then((res) => {
|
that.confirmLoading = false
|
if (res.success) {
|
that.$message.success(res.message)
|
that.$emit('ok', res.result)
|
that.close()
|
} else {
|
that.$message.warning(res.message)
|
}
|
}).finally(() => {
|
that.confirmLoading = false
|
|
})
|
|
} else {
|
that.$message.warning('请先完成表格填写!')
|
}
|
|
})
|
|
},
|
close() {
|
this.$emit('close')
|
this.visible = false
|
}
|
|
}
|
}
|
</script>
|
|
<style lang="less" scoped>
|
.m5 {
|
margin-top: 5px;
|
}
|
|
.customStyle {
|
background: #ffffff;
|
border-radius: 4px;
|
|
|
}
|
|
.ant-radio-wrapper {
|
width: 100%;
|
}
|
|
.logo {
|
height: 300px;
|
vertical-align: top;
|
margin-right: 16px;
|
border-style: none;
|
}
|
|
</style>
|