|
@@ -9,19 +9,37 @@
|
|
|
</a-card>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { configData } from '@/api/upms/config'
|
|
|
+import {
|
|
|
+ joinHoliday,
|
|
|
+ cancelHoliday
|
|
|
+} from '@/api/repair/application-form'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
- date: []
|
|
|
+ date: [],
|
|
|
+ configMap: null
|
|
|
}
|
|
|
},
|
|
|
+ created () {
|
|
|
+ configData().then(res => {
|
|
|
+ this.configMap = res.data['config:open:value']
|
|
|
+ this.date = JSON.parse(this.configMap[this.DictCache.TYPE.REPAIR_HOLIDAY])
|
|
|
+ console.log(this.date)
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
handleSelect (value) {
|
|
|
- const info = this.BaseTool.Date.formatter(value, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
|
- if (this.date.includes(info)) {
|
|
|
- this.date = this.date.filter(item => item !== info)
|
|
|
+ const that = this
|
|
|
+ const info = that.BaseTool.Date.formatter(value, that.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
|
+ if (that.date.includes(info)) {
|
|
|
+ cancelHoliday(info).then(res => {
|
|
|
+ that.date = that.date.filter(item => item !== info)
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.date.push(info)
|
|
|
+ joinHoliday(info).then(res => {
|
|
|
+ that.date.push(info)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|