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
<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>