上传
This commit is contained in:
@@ -13,22 +13,22 @@
|
||||
<el-divider direction="horizontal" content-position="left">应发</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="基本工资" prop="dixin">
|
||||
<el-input-number v-model="formData.dixin" :min="0" :controls="false" />
|
||||
<el-form-item label="基本工资" prop="baseSalary">
|
||||
<el-input-number v-model="formData.baseSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="奖金" prop="jiangjin">
|
||||
<el-input-number v-model="formData.jiangjin" :min="0" :controls="false" />
|
||||
<el-form-item label="奖金" prop="rewardSalary">
|
||||
<el-input-number v-model="formData.rewardSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="提成方案" prop="tichengfangan">
|
||||
<el-select v-model="formData.tichengfangan" placeholder="请选择" filterable>
|
||||
<el-form-item label="提成方案" prop="planId">
|
||||
<el-select v-model="formData.planId" placeholder="请选择" filterable>
|
||||
<el-option
|
||||
v-for="item in tichengfanganOptions"
|
||||
v-for="item in planOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -49,39 +49,39 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="其他应发" prop="qitayingfa">
|
||||
<el-input-number v-model="formData.qitayingfa" :min="0" :controls="false" />
|
||||
<el-form-item label="其他应发" prop="extraSalary">
|
||||
<el-input-number v-model="formData.extraSalary" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider direction="horizontal" content-position="left">应扣</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="绩效" prop="jixiao">
|
||||
<el-form-item label="绩效">
|
||||
<el-input placeholder="生成后录入" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="考勤" prop="kaoqin">
|
||||
<el-form-item label="考勤">
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="社保" prop="shebao">
|
||||
<el-input-number v-model="formData.shebao" :min="0" :controls="false" />
|
||||
<el-form-item label="社保" prop="socialDeduct">
|
||||
<el-input-number v-model="formData.socialDeduct" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="公积金" prop="gongjijin">
|
||||
<el-input-number v-model="formData.gongjijin" :min="0" :controls="false" />
|
||||
<el-form-item label="公积金" prop="accumulationFundDeduct">
|
||||
<el-input-number v-model="formData.accumulationFundDeduct" :min="0" :controls="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="税额" prop="shuie">
|
||||
<el-form-item label="税额">
|
||||
<el-input placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -103,7 +103,8 @@
|
||||
</template>
|
||||
|
||||
<script setup name="DialogSalarySetting">
|
||||
// const message = useMessage() // 消息弹窗
|
||||
import * as SalaryApi from '@/api/finance/salary'
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('工资条设置')
|
||||
@@ -112,41 +113,40 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||
const formData = ref({})
|
||||
|
||||
const rules = {
|
||||
dixin: { required: true, message: '基本工资不可为空', trigger: 'blur' }
|
||||
baseSalary: { required: true, message: '基本工资不可为空', trigger: 'blur' }
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (row) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = `工资条设置-【${row.nickname}】`
|
||||
dialogTitle.value = `工资条设置-【${row.name}】`
|
||||
resetForm()
|
||||
getOptions()
|
||||
formLoading.value = true
|
||||
try {
|
||||
// formData.value = await UserApi.getUser(id)
|
||||
formData.value = await SalaryApi.getSalaryDetail(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const tichengfanganOptions = ref([])
|
||||
const planOptions = ref([])
|
||||
function getOptions() {
|
||||
tichengfanganOptions.value = []
|
||||
planOptions.value = []
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
dixin: 0,
|
||||
tichengfangan: undefined,
|
||||
jiangjin: 0,
|
||||
qitayingfa: 0,
|
||||
jixiao: 0,
|
||||
kaoqin: 0,
|
||||
shebao: 0,
|
||||
gongjijin: 0,
|
||||
shuie: 0,
|
||||
baseSalary: 0,
|
||||
planId: undefined,
|
||||
rewardSalary: 0,
|
||||
butie: 0,
|
||||
manqin: 0,
|
||||
extraSalary: 0,
|
||||
socialDeduct: 0,
|
||||
accumulationFundDeduct: 0,
|
||||
qitayingkou: 0
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
@@ -162,13 +162,13 @@ const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
// const data = formData.value as unknown as UserApi.UserVO
|
||||
// if (formType.value === 'create') {
|
||||
// await UserApi.createUser(data)
|
||||
// message.success(t('common.createSuccess'))
|
||||
// } else {
|
||||
// await UserApi.updateUser(data)
|
||||
// }
|
||||
const data = formData.value
|
||||
if (formType.value === 'create') {
|
||||
await SalaryApi.createSalary(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await SalaryApi.updateSalary(data)
|
||||
}
|
||||
message.success('配置成功')
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
|
||||
Reference in New Issue
Block a user