<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-form-model-item label="奖金基数(默认5万元)" prop="base">
|
<a-input-number v-model="model.base" placeholder="请输入奖金基数" />
|
</a-form-model-item>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-card>
|
|
<div v-show="showModel1">
|
<a-tabs v-model="curPage" @change="tabCallback">
|
<a-tab-pane key="1" tab="市场机会系数">
|
|
<a-collapse v-model="marketKey" 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.3~0.5)" class="customStyle">
|
|
<a-form-model-item label="该产品在行业中所处的位置:" prop="scHyhj">
|
<a-radio-group v-model="model.scHyhj">
|
|
<a-radio class="m5" :value="0.5">
|
处于业内国际领先水平,具有极强的竞争力,生命周期5年以上,预计销售额5千万以上(0.5)
|
</a-radio>
|
|
<a-radio class="m5" :value="0.4">
|
处于业内国际领先水平,具有较强的竞争力,生命周期5年以上,预计销售额2千万以上(0.4)
|
</a-radio>
|
<a-radio class="m5" :value="0.3">
|
具有较强的竞争力,生命周期5年以上,预计销售额500万以上(0.3)
|
</a-radio>
|
</a-radio-group>
|
</a-form-model-item>
|
<!-- <a-icon slot="extra" type="setting" />-->
|
<label slot="extra" style="background: transparent" type="setting"> {{ model.scHyhj}}</label>
|
|
</a-collapse-panel>
|
<a-collapse-panel key="2" header="战略意义(0.2~0.5)" class="customStyle" force-render>
|
<a-form-model-item label="该产品的开发对公司战略的影响:" prop="scZlyy">
|
<a-radio-group v-model="model.scZlyy">
|
|
<a-radio class="m5" :value="0.5">
|
战略急需,对公司品牌地位有较大的影响(0.5)
|
</a-radio>
|
|
<a-radio class="m5" :value="0.3">
|
战略发展执行,产品线扩充(0.3)
|
</a-radio>
|
<a-radio class="m5" :value="0.2">
|
与公司战略接近,市场需求程度高(0.2)
|
</a-radio>
|
</a-radio-group>
|
</a-form-model-item>
|
<!-- <a-icon slot="extra" type="setting" />-->
|
<label slot="extra" style="background: transparent" type="setting"> {{model.scZlyy}}</label>
|
</a-collapse-panel>
|
<a-collapse-panel key="3" header="利润率(0.2~0.5)" class="customStyle" force-render>
|
<a-form-model-item label="该产品利润率:" prop="scLrl">
|
<a-radio-group v-model="model.scLrl">
|
|
<a-radio class="m5" :value="0.5">
|
毛利率80%以上(0.5)
|
</a-radio>
|
|
<a-radio class="m5" :value="0.4">
|
毛利率50%~80%(0.4)
|
</a-radio>
|
<a-radio class="m5" :value="0.3">
|
毛利率30%~50%(0.3)
|
</a-radio>
|
<a-radio class="m5" :value="0.2">
|
毛利率30%以下,但能满足盈利需求(0.2)
|
</a-radio>
|
</a-radio-group>
|
</a-form-model-item>
|
<!-- <a-icon slot="extra" type="setting" />-->
|
<label slot="extra" style="background: transparent" type="setting"> {{model.scLrl}}</label>
|
</a-collapse-panel>
|
<a-collapse-panel key="4" header="需求紧急度(0.2~0.5)" class="customStyle" force-render>
|
<a-form-model-item label="该产品需求紧急度:" prop="scXqjj">
|
<a-radio-group v-model="model.scXqjj" @change="finishPage(1)">
|
|
<a-radio class="m5" :value="0.5">
|
销售预期非常好,需求强烈,加急开发,项目周期非常紧张(0.5)
|
</a-radio>
|
|
<a-radio class="m5" :value="0.4">
|
销售预期较好,需求紧急,尽快开发,项目周期稍紧(0.4)
|
</a-radio>
|
<a-radio class="m5" :value="0.3">
|
销售预期较好,需求紧急度一般,正常项目周期开发(0.3)
|
</a-radio>
|
<a-radio class="m5" :value="0.2">
|
有一定销售预期,但不紧急,可接受一定延期(0.2)
|
</a-radio>
|
</a-radio-group>
|
</a-form-model-item>
|
<!-- <a-icon slot="extra" type="setting" />-->
|
<label slot="extra" style="background: transparent" type="setting"> {{model.scXqjj}}</label>
|
</a-collapse-panel>
|
</a-collapse>
|
|
</a-tab-pane>
|
<a-tab-pane key="2" tab="技术成熟度系数" force-render>
|
<a-collapse v-model="technologyKey" 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~2)" class="customStyle">
|
|
<a-form-model-item label="技术成熟度系数由开发部门提供:" prop="scJscs">
|
<a-radio-group v-model="model.scJscs" @change="finishPage(2)">
|
|
<a-radio class="m5" :value="2">
|
A:国内外无参考竞品或可参考性较低,具有5项及以上难点/风险点(2)
|
</a-radio>
|
<a-radio class="m5" :value="1.5">
|
B:公司无该技术基础,国内外有可参考竞品,具有3项及以上难点/风险点(1.5)
|
</a-radio>
|
<a-radio class="m5" :value="1.2">
|
C:具有可借鉴基础的产品参考,但技术难度或风险有明显提升(具有1项及以上难点/风险点。)。(比如结构空间变小,技术标准明显提升)(1.2)
|
</a-radio>
|
<a-radio class="m5" :value="1">
|
D:具有可借鉴基础的产品延伸开发,基于现有产品系列技术延伸的新产品系列(1)
|
</a-radio>
|
<a-radio class="m5" :value="0.8">
|
E:已有基础的产品延伸开发,如基于现有结构增加产品规格,设计工作量一般(0.8)
|
</a-radio>
|
<a-radio class="m5" :value="0.5">
|
F:公司成熟技术产品,如技改型、产品性能优化(0.5)
|
</a-radio>
|
</a-radio-group>
|
</a-form-model-item>
|
<!-- <a-icon slot="extra" type="setting" />-->
|
<label slot="extra" style="background: transparent" type="setting"> {{model.scJscs}}</label>
|
|
</a-collapse-panel>
|
</a-collapse>
|
</a-tab-pane>
|
<a-tab-pane key="3" tab="项目工作量系数" force-render>
|
<div style="width: 50%;float: left ; ">
|
<img src="~@/assets/workcoe.png" class="logo" alt="logo">
|
</div>
|
<div style="width: 50%; float: right;">
|
<a-form-model-item prop="scGzxs"
|
label="项目工作量系数">
|
<a-input
|
@change="workCoeChange"
|
addonBefore="项目工作量系数 = "
|
addonAfter=" ÷ 10 "
|
placeholder="项目工作量"
|
v-model="model.scGzxs"
|
/>
|
</a-form-model-item>
|
<label style="margin-left: 10px"> 项目工作量系数:</label>
|
<label>{{ model.scGzxs == null ? 0 : (model.scGzxs/10.0).toFixed(2) }}</label>
|
</div>
|
|
|
</a-tab-pane>
|
</a-tabs>
|
</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: 'DeScModal',
|
components: {
|
JSelectUserByDepModal
|
},
|
|
data() {
|
|
return {
|
title: '项目定额',
|
visible: false,
|
form: this.$form.createForm(this),
|
showModel1: true, //根据选择的奖励方式显示UI 默认为model1
|
marketKey: ['1'], //折叠面板默认打开第一个
|
technologyKey: ['1'], //折叠面板默认打开第一个
|
curPage: '1',
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 5 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 }
|
},
|
confirmLoading: false,
|
validatorRules: {
|
scHyhj: [{ required: true, message: '请选择该产品在行业中所处的位置!' }],
|
|
scZlyy: [{ required: true, message: '请选择该产品的开发对公司战略的影响!' }],
|
|
scLrl: [{ required: true, message: '请选择该产品的利润率!' }],
|
|
scXqjj: [{ required: true, message: '请选择该产品需求紧急度!' }],
|
|
scGzxs: [{
|
required: true,
|
pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/,
|
message: '请输入项目工作量(数字)!'
|
}],
|
|
scJscs: [{ required: true, message: '请选择技术成熟度系数!' }],
|
type: [{ required: true, message: '请选择奖励方式!' }],
|
base: [{ required: true, message: '请输入奖金基数!' }]
|
|
},
|
url: {
|
sc: '/bon/quota/sc',
|
query: '/bon/quota/query',
|
}
|
}
|
},
|
created() {
|
|
},
|
computed: {},
|
watch: {},
|
methods: {
|
|
edit(id) {
|
this.visible = true
|
let res = {}
|
res.id = id
|
res.base = 50000//奖金基数默认为5万元
|
res.type = 1 //默认奖励方式为项目产品市场型
|
this.model = Object.assign({}, res)
|
console.info(this.model)
|
|
getAction(this.url.query, { id: this.model.id }).then((res) => {
|
if (res.success) {
|
this.loading = false
|
console.info(res)
|
this.model = res.result
|
}
|
}).finally(() => {
|
this.loading = false
|
})
|
|
},
|
changeRewardType(value) {
|
//显示第一种奖励方案的
|
if (value == 1) {
|
this.showModel1 = true
|
} else {
|
this.showModel1 = false
|
}
|
console.info(this.showModel1)
|
//this.model.environment = 0.5
|
// this.$nextTick(() => {
|
// // this.form.getFieldDecorator('status', {initialValue: "1"})
|
// this.form.setFieldsValue(pick(this.model, 'market'))
|
// })
|
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
|
handleOk() {
|
let that = this
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
console.info(this.model)
|
putAction(this.url.sc,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
|
|
})
|
|
|
//市场机会系数= 以上各项分值之和
|
/* let market = this.model.environment + this.model.strategy + this.model.profit + this.model.demand
|
market = market.toFixed(1)
|
// 项目奖金定额 = 市场机会系数*技术成熟度系数(technology)*项目工作量系数* 5万元
|
let quantum = market * this.model.technology * this.model.workcoe * this.model.normalBonus * 1000
|
quantum = quantum.toFixed(0)
|
/!*console.info('市场机会系数:'+market);
|
console.info('技术成熟度系数:'+this.model.technology );
|
console.info('项目工作量系数:'+this.model.workcoe);
|
console.info('项目工作量系数:'+this.model.workcoe /10);
|
console.info('奖金基数:'+this.model.normalBonus);
|
console.info('项目奖金定额:'+quantum);*!/
|
that.model.quantum = quantum
|
that.handleRequest()*/
|
} else {
|
that.$message.warning('请先完成表格填写!')
|
}
|
|
})
|
|
},
|
close() {
|
this.$emit('close')
|
this.visible = false
|
},
|
workCoeChange(value) {
|
|
},
|
finishPage(page) {
|
let that = this
|
setTimeout(function() {
|
that.curPage = page + 1 + ''
|
}, 1000)
|
},
|
tabCallback(key) {
|
|
}
|
|
}
|
}
|
</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>
|