<template>
|
<a-modal
|
:title="title"
|
:width="800"
|
:visible="visible"
|
:confirmLoading="confirmLoading"
|
@ok="handleOk"
|
@cancel="handleCancel"
|
>
|
<a-spin :spinning="confirmLoading">
|
<a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model" :rules="validatorRules">
|
<!-- 主表单区域 -->
|
<a-row class="form-row" :gutter="16">
|
<a-col :lg="24">
|
<a-form-model-item label="项目名称" prop="pro">
|
<j-search-select-tag
|
disabled
|
v-model='model.pro'
|
dict='pro_project,xmmc,id'
|
>
|
</j-search-select-tag>
|
</a-form-model-item>
|
</a-col>
|
<a-col :lg="24">
|
<a-form-model-item label="项目负责人" >
|
<j-search-select-tag
|
disabled
|
v-model='model.fzr'
|
dict='sys_user,realname,username'
|
>
|
</j-search-select-tag>
|
</a-form-model-item>
|
</a-col>
|
|
<a-col :lg="24">
|
<a-form-model-item label="项目奖励类型" prop="type">
|
<j-dict-select-tag disabled v-model="model.type" title="项目奖励类型" dictCode="bonus_type" placeholder="请选择项目奖励类型" />
|
</a-form-model-item>
|
</a-col>
|
|
<a-col :lg="24">
|
<a-form-model-item label="发放进度" prop="ffjd">
|
<j-dict-select-tag @input="changeFfjd" v-model="model.ffjd" title="发放进度" dictCode="bonus_ffjd_sc" placeholder="请选择项目奖励发放进度" />
|
</a-form-model-item>
|
</a-col>
|
<a-col :lg="24">
|
<a-form-model-item label="发放比例(%)" prop="ffjd">
|
<a-input disabled v-model="model.yfbl" title="发放比例" />
|
</a-form-model-item>
|
</a-col>
|
|
|
</a-row>
|
</a-form-model>
|
|
</a-spin>
|
|
<!-- 选择用户 -->
|
</a-modal>
|
</template>
|
|
<script>
|
import JSelectUserByDepModal from '@/components/jeecgbiz/modal/JSelectUserByDepModal'
|
import { postAction, putAction } from '@/api/manage'
|
|
export default {
|
name: 'HsScModal',
|
components: {
|
JSelectUserByDepModal,
|
},
|
data() {
|
return {
|
title: '新增项目奖金核算',
|
visible: false,
|
form: this.$form.createForm(this),
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 5 },
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 },
|
},
|
confirmLoading: false,
|
validatorRules: {
|
pro: [{ required: true, message: '项目不能为空', trigger: 'blur' }],
|
type: [{ required: true, message: '项目奖励类型不能为空', trigger: 'blur' }],
|
ffjd: [{ required: true, message: '项目奖励发放进度不能为空', trigger: 'blur' }],
|
yfbl: [{ required: true, message: '项目奖励发放比例不能为空', trigger: 'blur' }],
|
|
},
|
url: {
|
add: '/bon/item/addsc',
|
edit: '/bon/item/editsc',
|
},
|
}
|
},
|
watch: {
|
|
},
|
methods: {
|
edit(record) {
|
this.form.resetFields()
|
this.visible = true
|
this.model = Object.assign({}, record)
|
},
|
changeFfjd(value){
|
switch (Number(value)) {
|
case 11:
|
this.model.yfbl = 42.5
|
break
|
case 12:
|
this.model.yfbl = 42.5
|
break
|
case 13:
|
this.model.yfbl = 15
|
break
|
|
}
|
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
handleOk() {
|
let that = this
|
this.$refs.form.validate((valid) => {
|
if (valid) {
|
that.confirmLoading = true
|
//add
|
if (!this.model.id) {
|
postAction(this.url.add, that.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
|
})
|
|
//edit
|
} else {
|
/*putAction(this.url.edit, that.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
|
})*/
|
that.confirmLoading = false
|
that.close()
|
}
|
}
|
})
|
},
|
close() {
|
this.$emit('close')
|
this.visible = false
|
},
|
|
handleChangeUserCommon(v) {},
|
},
|
}
|
</script>
|
|
<style scoped>
|
</style>
|