zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<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>