TblSalaryCalculationFormTime.vue
2.4 KB
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
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" slot="detail">
<a-row>
<a-col :span="12">
<a-form-model-item label="工资月份" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="salaryMonth">
<a-month-picker
v-model="model.salaryMonth"
placeholder="请选择工资月份"
format="YYYY-MM"
@change="handleMonthChange"
/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { message } from 'ant-design-vue'
import { selectUp } from '../../../api/manage'
export default {
name: 'TblSalaryCalculationFormTime',
components: {},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false,
},
},
data() {
return {
model: {
salaryMonth: '', //工时
},
flg: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
url: {
selectup: '/salary/calculation/selectup',
},
}
},
computed: {
formDisabled() {
return this.disabled
},
},
methods: {
handleMonthChange(value) {
this.model.salaryMonth = value ? value.format('YYYY-MM') : null
},
selectup() {},
submitForm() {
const that = this
// 触发表单验证
this.$refs.form.validate((valid) => {
if (valid) {
that.confirmLoading = true
selectUp(this.url.selectup, this.model)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
if (res.message === '操作失败,null') {
that.$message.warning('计算错误')
} else {
that.$message.warning(res.message)
}
}
})
.finally(() => {
that.confirmLoading = false
})
}
})
},
},
}
</script>
<style lang="less" scoped>
.input_dis {
border-color: #91d5ff;
background-color: #e6f7ff;
}
</style>