|
|
|
|
@ -10,6 +10,21 @@
|
|
|
|
|
@close="$emit('update:isShow', false)"
|
|
|
|
|
>
|
|
|
|
|
<section class="drawer-container">
|
|
|
|
|
<div class="drawer-container__form-salary">
|
|
|
|
|
<el-form ref="salaryForm" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-form-item label="护工工资" prop="nurse_salary">
|
|
|
|
|
<el-input-number
|
|
|
|
|
v-model="form.nurse_salary"
|
|
|
|
|
:precision="2"
|
|
|
|
|
:step="0.01"
|
|
|
|
|
:min="0"
|
|
|
|
|
placeholder="请输入护工工资"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<vxe-table
|
|
|
|
|
ref="table"
|
|
|
|
|
class="drawer-container__form"
|
|
|
|
|
@ -222,7 +237,15 @@ export default {
|
|
|
|
|
idcardOptions: [{ data: '' }],
|
|
|
|
|
row: {},
|
|
|
|
|
loading: false,
|
|
|
|
|
visible: false
|
|
|
|
|
visible: false,
|
|
|
|
|
form: {
|
|
|
|
|
nurse_salary: null
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
nurse_salary: [
|
|
|
|
|
{ required: true, message: '请输入护工工资', trigger: 'blur' }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
@ -244,6 +267,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
visible(newVal) {
|
|
|
|
|
this.$emit('update:isShow', newVal)
|
|
|
|
|
if (!newVal) {
|
|
|
|
|
// 关闭时重置表单
|
|
|
|
|
this.resetForm()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -261,26 +288,46 @@ export default {
|
|
|
|
|
this.$confirm('确定关闭窗口?')
|
|
|
|
|
.then((_) => {
|
|
|
|
|
this.$refs['table'].clearRadioRow()
|
|
|
|
|
this.resetForm()
|
|
|
|
|
done()
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => {})
|
|
|
|
|
},
|
|
|
|
|
resetForm() {
|
|
|
|
|
if (this.$refs['salaryForm']) {
|
|
|
|
|
this.$refs['salaryForm'].resetFields()
|
|
|
|
|
}
|
|
|
|
|
this.form.nurse_salary = null
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
this.$confirm('确定分配?')
|
|
|
|
|
.then((_) => {
|
|
|
|
|
if (this.row.id && this.$refs['table'].getRadioRecord(true)) {
|
|
|
|
|
// 验证表单
|
|
|
|
|
this.$refs['salaryForm'].validate((valid) => {
|
|
|
|
|
if (!valid) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查是否选择了护工
|
|
|
|
|
if (!this.row.id || !this.$refs['table'].getRadioRecord(true)) {
|
|
|
|
|
this.$message.warning('请先选择护工')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$confirm('确定分配?')
|
|
|
|
|
.then((_) => {
|
|
|
|
|
save({
|
|
|
|
|
id: this.row.id,
|
|
|
|
|
nurse_id: this.$refs['table'].getRadioRecord(true).id,
|
|
|
|
|
nurse_salary: this.form.nurse_salary,
|
|
|
|
|
status: 0
|
|
|
|
|
}).then((_) => {
|
|
|
|
|
this.$message.success('分配成功!')
|
|
|
|
|
this.$emit('update:visible', false)
|
|
|
|
|
this.resetForm()
|
|
|
|
|
this.visible = false
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => {})
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => {})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -293,7 +340,8 @@ export default {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
&__form {
|
|
|
|
|
&__form-salary {
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&__footer {
|
|
|
|
|
|