<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-col :lg='8'>
|
|
</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.5%~3.5%)' class='customStyle'>
|
<a-form-model-item label='提成比例主要由基准提成系数、产品销售额等因素确定:' prop='khTcxs'>
|
<a-radio-group v-model='model.khTcxs'>
|
<a-radio class='m5' :value='3.5'>
|
A:国内外无参考竞品或可参考性较低,具有5项及以上难点/风险点。(3.5%)
|
</a-radio>
|
<a-radio class='m5' :value='2.5'>
|
B:公司无该技术基础,国内外有可参考竞品,具有3项及以上难点/风险点。(2.5%)
|
</a-radio>
|
<a-radio class='m5' :value='2'>
|
C:具有可借鉴基础的产品参考,但技术难度或风险有明显提升(具有1项及以上难点/风险点。)。(比如结构空间变小,技术标准明显提升)(2%)
|
</a-radio>
|
<a-radio class='m5' :value='1.5'>
|
D:具有可借鉴基础的产品延伸开发,基于现有产品系列技术延伸的新产品系列(1.5%)
|
</a-radio>
|
<a-radio class='m5' :value='1'>
|
E:已有基础的产品延伸开发,如基于现有结构增加产品规格,设计工作量一般(1%)
|
</a-radio>
|
<a-radio class='m5' :value='0.5'>
|
F:公司成熟技术产品,如技改型、产品性能优化(0.5%)
|
</a-radio>
|
</a-radio-group>
|
</a-form-model-item>
|
<label slot='extra' style='background: transparent' type='setting'> {{ model.khTcxs }}</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: 'DeKhModal',
|
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: {
|
keTcxs: [{ required: true, message: '请选择基准提成系数!' }],
|
type: [{ required: true, message: '请选择奖励方式!' }],
|
base: [{ required: true, message: '请输入奖金基数!' }]
|
|
},
|
url: {
|
kh: '/bon/quota/kh',
|
query: '/bon/quota/query'
|
}
|
}
|
},
|
created() {
|
|
},
|
computed: {},
|
watch: {},
|
methods: {
|
|
edit(id) {
|
this.visible = true
|
let res = {}
|
res.id = id
|
res.type = 2 //默认奖励方式为项目产品客户型
|
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) {
|
putAction(this.url.kh, this.model).then((res) => {
|
that.confirmLoading = false
|
if (res.success) {
|
that.close()
|
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>
|