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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<template>
<div class="card-container">
<a-tabs type="card" @change="tabChange">
<a-tab-pane key="1" tab="市州(含辖区所有医疗机构)">
<div class="from-table">
<a-row>
<a-col style="text-align:center;">
<span style="font-size:20pt">{{year}}年度州市医疗行政单位配比</span>
</a-col>
</a-row>
<a-row>
<a-col :span="24/colCounts[colCountKey]/2" class="bg-light_blue">
名额配比数量批量设置:
</a-col>
<a-col :span="24/colCounts[colCountKey]/2">
<a-input-number v-model="batchValueCount" :min="0" :max="1000" />
</a-col>
<a-col :span="24/colCounts[colCountKey]/2">
<a-button type="primary" @click="setBatchUnitCount">批量设置</a-button>
</a-col>
<a-col :span="6">
州市行政机构数:<span style="color:red">{{unitGovCount}}</span>
</a-col>
<a-col :span="9">
</a-col>
</a-row>
<a-row>
<unit-count v-for="unit in unitGovInfo" :key="unit.id" :Unit="unit" :colCount="24/colCounts[colCountKey]" @valueChange="valueChange" />
</a-row>
<a-row>
<a-col style="text-align:center;">
<a-button type="primary" @click="saveUnitCount">保存</a-button>
</a-col>
</a-row>
</div>
</a-tab-pane>
<a-tab-pane key="2" tab="省直属单位名额配比">
<div class="from-table">
<a-row>
<a-col style="text-align:center;">
<span style="font-size:20pt">{{year}}年度省直医疗机构配比设置</span>
</a-col>
</a-row>
<a-row>
<a-col :span="24/colCounts[colCountKey]/2" class="bg-light_blue">
名额配比数量批量设置:
</a-col>
<a-col :span="24/colCounts[colCountKey]/2">
<a-input-number v-model="batchValueCount" :min="0" :max="1000" />
</a-col>
<a-col :span="24/colCounts[colCountKey]/2">
<a-button type="primary" @click="setBatchUnitCount">批量设置</a-button>
</a-col>
<a-col :span="6">
省直医疗机构数:<span style="color:red">{{unitComCount}}</span>
</a-col>
<a-col :span="9">
</a-col>
</a-row>
<a-row>
<unit-count v-for="unit in unitComInfo" :key="unit.id" :Unit="unit" :colCount="24/colCounts[colCountKey]" />
</a-row>
<a-row>
<a-col style="text-align:center;">
<a-button type="primary" @click="saveUnitCount">保存</a-button>
</a-col>
</a-row>
</div>
</a-tab-pane>
</a-tabs>
</div>
<!-- <a-row>
<a-col></a-col>
</a-row> -->
</template>
<script>
import { isEmptyParams } from "@/views/utils/common"
import UnitCount from "@/views/unit/components/unitCount.vue"
import moment from "moment"
export default {
name: "projAcountSet",
components: {
UnitCount,
},
data () {
const colCounts = {};
[2, 3, 4, 6, 8, 12].forEach((value, i) => {
colCounts[i] = value;
});
return {
unitGovInfo: [],
unitComInfo: [],
colCounts,
colCountKey: 1,
queryType: 1,
batchValueCount: 0,
year: moment().format('YYYY'),
unitGovCount: 0,
unitComCount: 0,
};
},
created () {
this.unitCount()
},
methods: {
moment,
tabChange (key) {
this.queryType = key
this.unitCount()
},
unitCount () {
let pars = { queryType: this.queryType }
let par = {
...pars,
}
this.$api.systemManage.getUnitProjLimit(par).then(({ data = {} }) => {
if (data) {
if (this.queryType == 1) {
this.unitGovInfo = data
this.unitGovCount = data.length
}
else {
this.unitComInfo = data
this.unitComCount = data.length
}
}
})
},
valueChange (unit) {
if (this.queryType == 1) {
let arr = this.unitGovInfo.filter(p => p.id === unit.id)
arr[0].projLimit = unit.projLimit
} else {
let arr = this.unitComInfo.filter(p => p.id === unit.id)
arr[0].projLimit = unit.projLimit
}
},
setBatchUnitCount () {
if (this.queryType == 1)
this.unitGovInfo.forEach(p => {
p.projLimit = this.batchValueCount
})
else
this.unitComInfo.forEach(p => {
p.projLimit = this.batchValueCount
})
},
saveUnitCount () {
if (this.queryType == 1) {
let unitGovList = this.unitGovInfo.filter(p => p.projLimit !== null)
let pars = unitGovList
this.$api.systemManage.updateUnitProjLimit(pars).then(({ data = {} }) => {
if (data) {
this.unitGovInfo = []
this.$message.info(data)
this.unitCount()
}
})
} else {
let unitComList = this.unitComInfo.filter(p => p.projLimit !== null)
let pars = unitComList
this.$api.systemManage.updateUnitProjLimit(pars).then(({ data = {} }) => {
if (data) {
this.unitComInfo = []
this.$message.info(data)
this.unitCount()
}
})
}
}
}
};
</script>
<style>
.card-container {
background: #f5f5f5;
overflow: hidden;
padding: 24px;
}
.card-container > .ant-tabs-card > .ant-tabs-content {
height: 100vh;
margin-top: -16px;
}
.card-container > .ant-tabs-card > .ant-tabs-content > .ant-tabs-tabpane {
background: #fff;
padding: 16px;
}
.card-container > .ant-tabs-card > .ant-tabs-bar {
border-color: #fff;
}
.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab {
border-color: transparent;
background: transparent;
}
.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
border-color: #fff;
background: #fff;
}
</style>