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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
| <template>
| <div class="box-card">
| <div class="details-center">
| <h3 class="fz-10 fw-bold mr-b-10" style="padding-top: 20px">
| {{ info_id ? "编辑" : "新增" }}{{ info_title }}清单
| </h3>
| <el-form
| :model="paramData"
| :rules="paramRules"
| ref="paramForm"
| label-width="250px"
| >
| <el-form-item label="需求描述" prop="">
| <el-input
| style="width: 350px"
| placeholder="请输入需求描述"
| size="small"
| type="textarea"
| resize="none"
| :rows="3"
| v-model="paramData.activityAddr"
| maxlength="50"
| ></el-input>
| </el-form-item>
| <el-form-item label="类型" prop="">
| <el-select
| filterable
| class="iw-220"
| v-model="paramData.belongTo"
| placeholder="请选择类型"
| >
| <el-option
| v-for="item in belongToList"
| :key="item.label"
| :label="item.label"
| :value="item.label"
| >
| </el-option>
| </el-select>
| </el-form-item>
| <el-form-item label="预计服务时长" prop="">
| <el-input
| class="iw-220"
| clearable
| maxlength="11"
| placeholder="请输入党组织负责人电话"
| v-model.trim="paramData.phone"
| ></el-input>
| </el-form-item>
| <el-form-item label="单位标识">
| <UploadImg
| :imgNum="1"
| formKey="logo"
| :imgShow="paramData.logo"
| @fileHandle="uploadHandleHealth"
| />
| </el-form-item>
| <el-form-item prop="password" label="">
| <el-button @click="handleAction('close')">取 消</el-button>
| <el-button
| type="primary"
| :loading="btnType"
| @click="handleAction('submit')"
| >提 交</el-button
| >
| </el-form-item>
| </el-form>
| </div>
| </div>
| </template>
| <script>
| import { objCopyPro } from "../../../utils/common";
| import { PHONE } from "@/utils/validation";
| import UploadImg from "../../../components/upload/uploadImg.vue";
| export default {
| components: {
| UploadImg,
| },
| data() {
| return {
| info_id: "",
| info_title: "",
| btnType: false,
| paramData: {
| natureName: "",
| name: "", // 姓名
| adminName: "",
| adminPhone: "",
| phone: "",
| contacts: "",
| logo: "",
| specialtyName: "",
| helpCommunityName: "",
| helpCommunityId: "",
| helpCommunityContactsName: "",
| helpCommunityContacts: "",
| otherRemark: "",
| villageName: "",
| belongTo: "",
| },
| paramRules: {
| natureName: [
| { required: true, message: "请选择单位性质", trigger: "change" },
| ],
| belongTo: [
| { required: true, message: "请选择单位归属", trigger: "change" },
| ],
| specialtyName: [
| {
| required: true,
| message: "请选择职能特长及服务意愿",
| trigger: "change",
| },
| ],
| helpCommunityName: [
| { required: true, message: "请选择服务社区", trigger: "change" },
| ],
| name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
| contacts: [
| { required: true, message: "请输入党组织负责人", trigger: "blur" },
| ],
| phone: [{ required: true, validator: PHONE, trigger: "blur" }],
| adminName: [
| { required: true, message: "请输入单位管理员", trigger: "blur" },
| ],
| adminPhone: [{ required: true, validator: PHONE, trigger: "blur" }],
| helpCommunityContactsName: [
| { required: true, message: "请输入社区联系人", trigger: "blur" },
| ],
| helpCommunityContacts: [
| { required: true, validator: PHONE, trigger: "blur" },
| ],
| villageName: [
| {
| required: true,
| message: "请输入下沉服务小区(网格)院落",
| trigger: "blur",
| },
| ],
| }, // 表单验证
| cityChooseList: [],
| propsCityTourst: {
| label: "value",
| value: "value",
| },
| communityListValue: [],
| villageList: [],
| specialtyNameValue: [],
| skillList: [
| { label: "统计调查", value: 1, checkType: false },
| { label: "法律援助", value: 2, checkType: false },
| { label: "志愿活动", value: 3, checkType: false },
| { label: "尊老爱幼", value: 4, checkType: false },
| { label: "宣讲宣教", value: 5, checkType: false },
| { label: "心理关爱", value: 6, checkType: false },
| { label: "设施维修", value: 7, checkType: false },
| { label: "其他", value: 8, checkType: false },
| ],
| skillOtherType: false,
| unitList: [],
| natureList: [
| {
| label: "机关单位",
| value: "机关单位",
| },
| {
| label: "企事业单位",
| value: "企事业单位",
| },
| {
| label: "国有国企",
| value: "国有国企",
| },
| ],
| belongToList: [
| {
| label: "市直属",
| },
| {
| label: "西区",
| },
| {
| label: "东区",
| },
| {
| label: "仁和区",
| },
| {
| label: "盐边县",
| },
| {
| label: "米易县",
| },
| {
| label: "钒钛高新区",
| },
| ],
| };
| },
| mounted() {
| this.info_id = this.$route.query.id;
| this.info_title = this.$route.query.title;
| if (this.info_id) {
| this.getDataInfo();
| }
| this.getAreaRequestList();
| this.getUnitList();
| },
| methods: {
| // 获取区域列表
| getAreaRequestList() {
| this.$api.get("comAreaTownCommunity/areaTownCommunityNew", {}, (res) => {
| this.cityChooseList = res;
| });
| },
| getUnitList() {
| this.$api.post(
| "checkUnit/list",
| {
| pageNum: 1,
| pageSize: 999,
| },
| (res) => {
| console.log(res);
| this.unitList = res.records;
| }
| );
| },
| getDataInfo() {
| // this.$api.get("/comAreaTownCommunity/areaTownCommunityNew", {}, (res) => {
| // this.areaChooseList = res;
| // });
| this.$api.get(`checkUnit/detail`, { id: this.info_id }, (res) => {
| const BACK_DATA_INFO = res;
| this.paramData = objCopyPro(this.paramData, BACK_DATA_INFO);
| this.specialtyNameValue = res.specialtyName
| ? res.specialtyName.split(",")
| : [];
| this.communityListValue = res.helpCommunityName
| ? res.helpCommunityName.split(",")
| : [];
| this.skillOtherType = this.specialtyNameValue.some((item) => {
| return item === "其他";
| });
| });
| },
| // 页面操作
| async handleAction(type, row) {
| switch (type) {
| case "close": {
| this.$router.back();
| break;
| }
| case "submit": {
| this.$refs.paramForm.validate((val) => {
| if (val) {
| // this.btnType = true;
| if (this.info_id) {
| this.$api.put("checkUnit/edit", this.paramData, () => {
| // this.btnType = false;
| demo.toast("提交成功");
| this.$router.back();
| });
| } else {
| this.$api.post("checkUnit/add", this.paramData, () => {
| // this.btnType = false;
| demo.toast("提交成功");
| this.$router.back();
| });
| }
| }
| });
| break;
| }
| default: {
| break;
| }
| }
| },
| skillChange(arr) {
| this.skillOtherType = arr.some((item) => {
| return item === "其他";
| });
| this.paramData.specialtyName = arr.join(",");
| },
| uploadHandleHealth({ type, val, key }) {
| if (type === "loading") {
| this.btnType = val;
| } else {
| this.paramData[key] = val;
| this.$refs.paramForm.validateField(key);
| }
| },
| communityChange(arr) {
| this.paramData.helpCommunityName = arr.join(",");
| },
| },
| };
| </script>
| <style scoped>
| .textarea-width {
| width: 400px;
| }
| .iw-220 {
| width: 250rpx !important;
| }
| </style>
|
|