Quellcode durchsuchen

单位信息新增字段

meidi vor 5 Monaten
Ursprung
Commit
3b6617f59a
1 geänderte Dateien mit 386 neuen und 480 gelöschten Zeilen
  1. 386 480
      src/views/basic.info/unitInfo/detailedList.vue

+ 386 - 480
src/views/basic.info/unitInfo/detailedList.vue

@@ -1,229 +1,124 @@
1 1
 <template>
2 2
 	<div>
3
-		<a-modal
4
-			class="btn-box"
5
-			v-model:visible="visible"
6
-			width="80%"
7
-			:footer="null"
8
-			:closable="false"
9
-			:maskClosable="false"
10
-			:title="titleText"
11
-		>
3
+		<a-modal class="btn-box" v-model:visible="visible" width="80%" :footer="null" :closable="false" :maskClosable="false"
4
+			:title="titleText">
12 5
 			<a-form ref="formRef" :model="formState" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
13 6
 				<a-row>
14
-					<a-col :span="8"
15
-						><a-form-item label="统一单位编码" name="tydwbm">
16
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.tydwbm" /> </a-form-item
17
-					></a-col>
18
-					<a-col :span="8"
19
-						><a-form-item label="企业名称" name="dwmc">
20
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.dwmc" /> </a-form-item
21
-					></a-col>
22
-					<a-col :span="8"
23
-						><a-form-item label="统一社会信用代码" name="dwdm">
24
-							<a-input
25
-								autocomplete="off"
26
-								placeholder="请输入18位统一社会信用代码"
27
-								:disabled="showLock"
28
-								v-model:value="formState.dwdm"
29
-							/> </a-form-item
30
-					></a-col>
7
+					<a-col :span="8"><a-form-item label="统一单位编码" name="tydwbm">
8
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.tydwbm" /> </a-form-item></a-col>
9
+					<a-col :span="8"><a-form-item label="企业名称" name="dwmc">
10
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.dwmc" /> </a-form-item></a-col>
11
+					<a-col :span="8"><a-form-item label="统一社会信用代码" name="dwdm">
12
+							<a-input autocomplete="off" placeholder="请输入18位统一社会信用代码" :disabled="showLock"
13
+								v-model:value="formState.dwdm" /> </a-form-item></a-col>
31 14
 				</a-row>
32 15
 				<a-row>
33
-					<a-col :span="8"
34
-						><a-form-item label="注册日期" name="zcrq">
35
-							<a-date-picker
36
-								:disabled="showLock"
37
-								v-model:value="formState['zcrq']"
38
-								value-format="YYYY-MM-DD 00:00:00"
39
-							/> </a-form-item
40
-					></a-col>
41
-					<a-col :span="8"
42
-						><a-form-item label="注册资本(万元)" name="zczb">
43
-							<a-input
44
-								class="int-box"
45
-								@input="onInput"
46
-								autocomplete="off"
47
-								:disabled="showLock"
48
-								v-model:value="formState.zczb"
49
-							>
16
+					<a-col :span="8"><a-form-item label="注册日期" name="zcrq">
17
+							<a-date-picker :disabled="showLock" v-model:value="formState['zcrq']" value-format="YYYY-MM-DD 00:00:00" />
18
+						</a-form-item></a-col>
19
+					<a-col :span="8"><a-form-item label="注册资本(万元)" name="zczb">
20
+							<a-input class="int-box" @input="onInput" autocomplete="off" :disabled="showLock"
21
+								v-model:value="formState.zczb">
50 22
 								<!-- <template #suffix>万元</template> -->
51
-							</a-input></a-form-item
52
-						></a-col
53
-					>
54
-					<a-col :span="8"
55
-						><a-form-item label="资产总额(万元)" name="zcze">
56
-							<a-input
57
-								class="int-box"
58
-								@input="onChangeInput"
59
-								autocomplete="off"
60
-								:disabled="showLock"
61
-								v-model:value="formState.zcze"
62
-							>
23
+							</a-input></a-form-item></a-col>
24
+					<a-col :span="8"><a-form-item label="资产总额(万元)" name="zcze">
25
+							<a-input class="int-box" @input="onChangeInput" autocomplete="off" :disabled="showLock"
26
+								v-model:value="formState.zcze">
63 27
 								<!-- <template #suffix>万元</template> -->
64
-							</a-input></a-form-item
65
-						></a-col
66
-					>
28
+							</a-input></a-form-item></a-col>
67 29
 				</a-row>
68 30
 				<a-row>
69
-					<a-col :span="8"
70
-						><a-form-item label="法定代表人" name="fddbr">
71
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.fddbr" /> </a-form-item
72
-					></a-col>
73
-					<a-col :span="8"
74
-						><a-form-item label="法人身份证号" name="frsfzh">
75
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.frsfzh" /> </a-form-item
76
-					></a-col>
77
-					<a-col :span="8"
78
-						><a-form-item label="法人联系方式" name="frlxfs" :rules="[{ validator: isMobileData, trigger: 'blur' }]">
79
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.frlxfs" /> </a-form-item
80
-					></a-col>
31
+					<a-col :span="8"><a-form-item label="法定代表人" name="fddbr">
32
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.fddbr" /> </a-form-item></a-col>
33
+					<a-col :span="8"><a-form-item label="法人身份证号" name="frsfzh">
34
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.frsfzh" /> </a-form-item></a-col>
35
+					<a-col :span="8"><a-form-item label="法人联系方式" name="frlxfs"
36
+							:rules="[{ validator: isMobileData, trigger: 'blur' }]">
37
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.frlxfs" /> </a-form-item></a-col>
81 38
 				</a-row>
82 39
 				<a-row>
83
-					<a-col :span="8"
84
-						><a-form-item label="企业联系人" name="qylxr">
85
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.qylxr" /> </a-form-item
86
-					></a-col>
87
-					<a-col :span="8"
88
-						><a-form-item label="办公电话" name="bgdh">
89
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.bgdh" /> </a-form-item
90
-					></a-col>
91
-					<a-col :span="8"
92
-						><a-form-item label="电子邮箱" name="dzyx" :rules="[{ validator: isEmail, trigger: 'blur' }]">
93
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.dzyx" /> </a-form-item
94
-					></a-col>
40
+					<a-col :span="8"><a-form-item label="企业联系人" name="qylxr">
41
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.qylxr" /> </a-form-item></a-col>
42
+					<a-col :span="8"><a-form-item label="办公电话" name="bgdh">
43
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.bgdh" /> </a-form-item></a-col>
44
+					<a-col :span="8"><a-form-item label="电子邮箱" name="dzyx" :rules="[{ validator: isEmail, trigger: 'blur' }]">
45
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.dzyx" /> </a-form-item></a-col>
95 46
 				</a-row>
96 47
 				<a-row>
97
-					<a-col :span="16"
98
-						><a-form-item v-model:validation-status="formState.zcdz" label="注册地址" name="zcdz" class="from-item">
99
-							<a-cascader
100
-								:allowClear="false"
101
-								:disabled="showLock"
102
-								class="address-box"
103
-								:options="cascaOptions"
104
-								:load-data="(ev) => loadCascaderData(ev)"
105
-								placeholder="请选择"
106
-								v-model:value="formState.zcdz"
107
-								change-on-select
108
-								@change="getChangeData"
109
-							/>
48
+					<a-col :span="16"><a-form-item v-model:validation-status="formState.zcdz" label="注册地址" name="zcdz"
49
+							class="from-item">
50
+							<a-cascader :allowClear="false" :disabled="showLock" class="address-box" :options="cascaOptions"
51
+								:load-data="(ev) => loadCascaderData(ev)" placeholder="请选择" v-model:value="formState.zcdz"
52
+								change-on-select @change="getChangeData" />
110 53
 						</a-form-item>
111 54
 					</a-col>
112
-					<a-col :span="8"
113
-						><a-form-item label="详细地址" name="xxdz">
114
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.xxdz" /> </a-form-item
115
-					></a-col>
55
+					<a-col :span="8"><a-form-item label="详细地址" name="xxdz">
56
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.xxdz" /> </a-form-item></a-col>
116 57
 				</a-row>
117 58
 				<a-row>
118
-					<a-col :span="8"
119
-						><a-form-item label="行政区划代码" name="xzqhdm">
120
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.xzqhdm" /> </a-form-item
121
-					></a-col>
122
-					<a-col :span="8"
123
-						><a-form-item label="传真号码" name="czhm">
124
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.czhm" /> </a-form-item
125
-					></a-col>
126
-					<a-col :span="8"
127
-						><a-form-item label="企业官方网址" :rules="[{ validator: isInternetUrl, trigger: 'blur' }]" name="qygfwzdz">
128
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.qygfwzdz" /> </a-form-item
129
-					></a-col>
59
+					<a-col :span="8"><a-form-item label="行政区划代码" name="xzqhdm">
60
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.xzqhdm" /> </a-form-item></a-col>
61
+					<a-col :span="8"><a-form-item label="传真号码" name="czhm">
62
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.czhm" /> </a-form-item></a-col>
63
+					<a-col :span="8"><a-form-item label="企业官方网址" :rules="[{ validator: isInternetUrl, trigger: 'blur' }]"
64
+							name="qygfwzdz">
65
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.qygfwzdz" />
66
+						</a-form-item></a-col>
130 67
 				</a-row>
131 68
 				<a-row>
132
-					<a-col :span="8"
133
-						><a-form-item label="上级单位名称" name="sjdwmc">
134
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.sjdwmc" /> </a-form-item
135
-					></a-col>
136
-					<a-col :span="8"
137
-						><a-form-item label="邮政编码" :rules="[{ validator: isZipCode, trigger: 'blur' }]" name="yzbm">
138
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.yzbm" /> </a-form-item
139
-					></a-col>
140
-					<a-col :span="8"
141
-						><a-form-item label="库区数" name="kqs">
142
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.kqs" /> </a-form-item
143
-					></a-col>
69
+					<a-col :span="8"><a-form-item label="上级单位名称" name="sjdwmc">
70
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.sjdwmc" /> </a-form-item></a-col>
71
+					<a-col :span="8"><a-form-item label="邮政编码" :rules="[{ validator: isZipCode, trigger: 'blur' }]" name="yzbm">
72
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.yzbm" /> </a-form-item></a-col>
73
+					<a-col :span="8"><a-form-item label="库区数" name="kqs">
74
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.kqs" /> </a-form-item></a-col>
144 75
 				</a-row>
145 76
 				<a-row>
146
-					<a-col :span="8"
147
-						><a-form-item label="仓房数" name="cfs">
148
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.cfs" /> </a-form-item
149
-					></a-col>
150
-					<a-col :span="8"
151
-						><a-form-item label="油罐数" name="ygs">
152
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.ygs" /> </a-form-item
153
-					></a-col>
154
-					<a-col :span="8"
155
-						><a-form-item label="上级单位统一编码" name="sjdwdm">
156
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.sjdwdm" /> </a-form-item
157
-					></a-col>
77
+					<a-col :span="8"><a-form-item label="仓房数" name="cfs">
78
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.cfs" /> </a-form-item></a-col>
79
+					<a-col :span="8"><a-form-item label="油罐数" name="ygs">
80
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.ygs" /> </a-form-item></a-col>
81
+					<a-col :span="8"><a-form-item label="上级单位统一编码" name="sjdwdm">
82
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.sjdwdm" /> </a-form-item></a-col>
158 83
 				</a-row>
159 84
 				<a-row>
160
-					<a-col :span="8"
161
-						><a-form-item label="经度" :rules="[{ validator: isLongitude, trigger: 'blur' }]" name="jd">
162
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.jd" /> </a-form-item
163
-					></a-col>
164
-					<a-col :span="8"
165
-						><a-form-item label="纬度" :rules="[{ validator: isLatitude, trigger: 'blur' }]" name="wd">
166
-							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.wd" /> </a-form-item
167
-					></a-col>
168
-					<a-col :span="8"
169
-						><a-form-item label="单位类型" name="dwlx">
170
-							<a-select
171
-								:disabled="showLock"
172
-								class="select-box"
173
-								v-model:value="formState.dwlx"
174
-								:size="size"
175
-								placeholder="请选择"
176
-							>
85
+					<a-col :span="8"><a-form-item label="经度" :rules="[{ validator: isLongitude, trigger: 'blur' }]" name="jd">
86
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.jd" /> </a-form-item></a-col>
87
+					<a-col :span="8"><a-form-item label="纬度" :rules="[{ validator: isLatitude, trigger: 'blur' }]" name="wd">
88
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.wd" /> </a-form-item></a-col>
89
+					<a-col :span="8"><a-form-item label="单位类型" name="dwlx">
90
+							<a-select :disabled="showLock" class="select-box" v-model:value="formState.dwlx" :size="size"
91
+								placeholder="请选择">
177 92
 								<a-select-option v-for="item in unitTypeList" :key="item.id" :value="item.id">
178 93
 									{{ item.dictLabel }}
179 94
 								</a-select-option>
180 95
 							</a-select>
181
-						</a-form-item></a-col
182
-					>
96
+						</a-form-item></a-col>
183 97
 				</a-row>
184 98
 				<a-row>
185
-					<a-col :span="8"
186
-						><a-form-item label="单位状态" name="dwzt">
187
-							<a-select
188
-								:disabled="showLock"
189
-								class="select-box"
190
-								v-model:value="formState.dwzt"
191
-								:size="size"
192
-								placeholder="请选择"
193
-							>
99
+					<a-col :span="8"><a-form-item label="单位状态" name="dwzt">
100
+							<a-select :disabled="showLock" class="select-box" v-model:value="formState.dwzt" :size="size"
101
+								placeholder="请选择">
194 102
 								<a-select-option v-for="item in auditStatus" :key="item.dwzt" :value="item.dwzt">
195 103
 									{{ item.name }}
196 104
 								</a-select-option>
197 105
 							</a-select>
198
-						</a-form-item></a-col
199
-					>
200
-					<a-col :span="8"
201
-						><a-form-item label="总仓容" name="wd">
202
-							<a-input
203
-								autocomplete="off"
204
-								:disabled="showLock"
205
-								v-model:value="formState.totalWarehouseCapacity"
206
-							/> </a-form-item
207
-					></a-col>
106
+						</a-form-item></a-col>
107
+					<a-col :span="8"><a-form-item label="总仓容">
108
+							<a-input autocomplete="off" :disabled="showLock" v-model:value="formState.totalWarehouseCapacity" />
109
+						</a-form-item></a-col>
208 110
 				</a-row>
209
-
210 111
 				<a-row>
211
-					<a-col :span="24"
212
-						><a-form-item label="上传电子扫描件" name="wd">
213
-							<UPLoadData
214
-								multiple
215
-								:disabled="showLock"
216
-								:change="changeUpload"
217
-								listType="picture-card"
218
-								v-model:urls="formState.electronicScan"
219
-							></UPLoadData> </a-form-item
220
-					></a-col>
112
+					<a-col :span="12">
113
+						<a-form-item ref="uploadDataList" label="上传电子扫描件">
114
+							<UPLoadData :beforeUpload="beforeUpload" :disabled="showLock" listType="picture-card" multiple
115
+								v-model:urls="formState.electronicScan" :change="changeUpload" />
116
+						</a-form-item>
117
+					</a-col>
221 118
 				</a-row>
222 119
 			</a-form>
223 120
 			<div class="btn-box">
224
-				<a-button v-if="dataObj.isType !== '3'" style="margin-right: 16px" type="primary" @click="handleOk"
225
-					>保存</a-button
226
-				>
121
+				<a-button v-if="dataObj.isType !== '3'" style="margin-right: 16px" type="primary" @click="handleOk">保存</a-button>
227 122
 				<a-button @click="handleCancel">关闭</a-button>
228 123
 			</div>
229 124
 		</a-modal>
@@ -231,327 +126,338 @@
231 126
 </template>
232 127
 
233 128
 <script setup>
234
-	import unitInfoApi from '@/api/basic.info/unitInfoApi'
235
-	import { message } from 'ant-design-vue'
236
-	import global from '@/api/basic.info/global'
237
-	import {
238
-		isSocialCreditOrIdCode,
239
-		isLongitude,
240
-		isLatitude,
241
-		isEmail,
242
-		// isTelephone,
243
-		isMobileData,
244
-		isZipCode,
245
-		isInternetUrl,
246
-		isSocialCreditCode,
247
-		administrativeDivision,
248
-		isUnitCode
249
-	} from '@/utils/validator'
250
-	const props = defineProps({
251
-		dataObj: {
252
-			type: Object,
253
-			default: () => {}
254
-		}
255
-	})
256
-	const isTypeData = ref('')
257
-	const showLock = ref(false)
258
-	const visible = ref(false)
259
-	const titleText = ref('')
260
-	const formState = ref({
261
-		tydwbm: '',
262
-		dwmc: '',
263
-		dwdm: '',
264
-		dwlx: '',
265
-		zczb: '',
266
-		zcze: '',
267
-		zcrq: new Date(),
268
-		fdbbr: '',
269
-		frsfzh: '',
270
-		qylxr: '',
271
-		bgdh: '',
272
-		zcdd: '',
273
-		zcdz: '',
274
-		xxdz: '',
275
-		xzqhdm: '',
276
-		kqs: '',
277
-		cfs: '',
278
-		ygs: '',
279
-		dwzt: '',
280
-		totalWarehouseCapacity: '',
281
-		electronicScan: ''
129
+import unitInfoApi from '@/api/basic.info/unitInfoApi'
130
+import { message } from 'ant-design-vue'
131
+import global from '@/api/basic.info/global'
132
+import {
133
+	isSocialCreditOrIdCode,
134
+	isLongitude,
135
+	isLatitude,
136
+	isEmail,
137
+	// isTelephone,
138
+	isMobileData,
139
+	isZipCode,
140
+	isInternetUrl,
141
+	isSocialCreditCode,
142
+	administrativeDivision,
143
+	isUnitCode
144
+} from '@/utils/validator'
145
+const props = defineProps({
146
+	dataObj: {
147
+		type: Object,
148
+		default: () => { }
149
+	}
150
+})
151
+const isTypeData = ref('')
152
+const showLock = ref(false)
153
+const visible = ref(false)
154
+const titleText = ref('')
155
+const formState = ref({
156
+	tydwbm: '',
157
+	dwmc: '',
158
+	dwdm: '',
159
+	dwlx: '',
160
+	zczb: '',
161
+	zcze: '',
162
+	zcrq: new Date(),
163
+	fdbbr: '',
164
+	frsfzh: '',
165
+	qylxr: '',
166
+	bgdh: '',
167
+	zcdd: '',
168
+	zcdz: '',
169
+	xxdz: '',
170
+	xzqhdm: '',
171
+	kqs: '',
172
+	cfs: '',
173
+	ygs: '',
174
+	dwzt: '',
175
+	totalWarehouseCapacity: '',
176
+	electronicScan: ''
177
+})
178
+const cascaOptions = ref([])
179
+const unitTypeList = ref([])
180
+const rules = ref({
181
+	tydwbm: [
182
+		{ required: true, message: '请输入统一单位编码', trigger: 'blur' },
183
+		{ validator: isUnitCode, trigger: 'blur' }
184
+	],
185
+	dwmc: [{ required: true, message: '请输入单位名称', trigger: 'blur' }],
186
+	dwdm: [
187
+		{ required: true, message: '请输入单位代码', trigger: 'blur' },
188
+		{ validator: isSocialCreditCode, trigger: 'blur' }
189
+	],
190
+	dwlx: [{ required: true, message: '请选择单位类型', trigger: 'change' }],
191
+	zcrq: [{ required: true, message: '请选择注册日期', trigger: 'change' }],
192
+	fddbr: [{ required: true, message: '请输入法定代表人', trigger: 'blur' }],
193
+	frsfzh: [
194
+		{ required: true, message: '请输入法人身份证号', trigger: 'blur' },
195
+		{ validator: isSocialCreditOrIdCode, trigger: 'blur' }
196
+	],
197
+	qylxr: [{ required: true, message: '请输入企业联系人', trigger: 'blur' }],
198
+	bgdh: [
199
+		{ required: true, message: '请输入办公电话', trigger: 'blur' },
200
+		{ validator: isMobileData, trigger: 'blur' }
201
+	],
202
+	zcdz: [{ required: true, message: '请输入注册地址', trigger: 'change' }],
203
+	xzqhdm: [
204
+		{ required: true, message: '请输入行政区划代码', trigger: 'blur' },
205
+		{ validator: administrativeDivision, trigger: 'blur' }
206
+	],
207
+	kqs: [{ required: true, message: '请输入库区数', trigger: 'blur' }],
208
+	cfs: [{ required: true, message: '请输入仓房数', trigger: 'blur' }],
209
+	ygs: [{ required: true, message: '请输入油罐数', trigger: 'blur' }],
210
+	dwzt: [{ required: true, message: '请选择单位状态', trigger: 'change' }]
211
+})
212
+const auditStatus = ref([
213
+	{ name: '正常', dwzt: 1 },
214
+	{ name: '退出储备粮承储', dwzt: 2 }
215
+])
216
+
217
+const formRef = ref(null)
218
+const emit = defineEmits(['isVisible'])
219
+// 数字输入框只能输入数字
220
+function onInput(event) {
221
+	// 仅允许数字输入
222
+	formState.value.zczb = event.target.value.replace(/\D/g, '')
223
+}
224
+function onChangeInput(event) {
225
+	// 仅允许数字输入
226
+	formState.value.zcze = event.target.value.replace(/\D/g, '')
227
+}
228
+// 单位信息数据获取
229
+const getInformationData = () => {
230
+	unitInfoApi.getInfoDataList({ parentId: '1787747408829857793' }).then((res) => {
231
+		unitTypeList.value = []
232
+		unitTypeList.value = res
282 233
 	})
283
-	const cascaOptions = ref([])
284
-	const unitTypeList = ref([])
285
-	const rules = ref({
286
-		tydwbm: [
287
-			{ required: true, message: '请输入统一单位编码', trigger: 'blur' },
288
-			{ validator: isUnitCode, trigger: 'blur' }
289
-		],
290
-		dwmc: [{ required: true, message: '请输入单位名称', trigger: 'blur' }],
291
-		dwdm: [
292
-			{ required: true, message: '请输入单位代码', trigger: 'blur' },
293
-			{ validator: isSocialCreditCode, trigger: 'blur' }
294
-		],
295
-		dwlx: [{ required: true, message: '请选择单位类型', trigger: 'change' }],
296
-		zcrq: [{ required: true, message: '请选择注册日期', trigger: 'change' }],
297
-		fddbr: [{ required: true, message: '请输入法定代表人', trigger: 'blur' }],
298
-		frsfzh: [
299
-			{ required: true, message: '请输入法人身份证号', trigger: 'blur' },
300
-			{ validator: isSocialCreditOrIdCode, trigger: 'blur' }
301
-		],
302
-		qylxr: [{ required: true, message: '请输入企业联系人', trigger: 'blur' }],
303
-		bgdh: [
304
-			{ required: true, message: '请输入办公电话', trigger: 'blur' },
305
-			{ validator: isMobileData, trigger: 'blur' }
306
-		],
307
-		zcdz: [{ required: true, message: '请输入注册地址', trigger: 'change' }],
308
-		xzqhdm: [
309
-			{ required: true, message: '请输入行政区划代码', trigger: 'blur' },
310
-			{ validator: administrativeDivision, trigger: 'blur' }
311
-		],
312
-		kqs: [{ required: true, message: '请输入库区数', trigger: 'blur' }],
313
-		cfs: [{ required: true, message: '请输入仓房数', trigger: 'blur' }],
314
-		ygs: [{ required: true, message: '请输入油罐数', trigger: 'blur' }],
315
-		dwzt: [{ required: true, message: '请选择单位状态', trigger: 'change' }]
234
+}
235
+// 文件预览方式
236
+function changeUpload(ev) {
237
+	return global.uploadFile(ev).then((reg) => {
238
+		return reg
316 239
 	})
317
-	const auditStatus = ref([
318
-		{ name: '正常', dwzt: 1 },
319
-		{ name: '退出储备粮承储', dwzt: 2 }
320
-	])
321
-
322
-	const formRef = ref(null)
323
-	const emit = defineEmits(['isVisible'])
324
-	// 数字输入框只能输入数字
325
-	function onInput(event) {
326
-		// 仅允许数字输入
327
-		formState.value.zczb = event.target.value.replace(/\D/g, '')
328
-	}
329
-	function onChangeInput(event) {
330
-		// 仅允许数字输入
331
-		formState.value.zcze = event.target.value.replace(/\D/g, '')
332
-	}
333
-	// 单位信息数据获取
334
-	const getInformationData = () => {
335
-		unitInfoApi.getInfoDataList({ parentId: '1787747408829857793' }).then((res) => {
336
-			unitTypeList.value = []
337
-			unitTypeList.value = res
338
-		})
339
-	}
340
-	// 取消按钮
341
-	const handleCancel = () => {
342
-		visible.value = false
343
-		emit('isVisible', false)
344
-		formRef.value.resetFields() //resetFields()函数是组件库提供的
345
-		formState.value = {}
346
-		infoObj.value = {
347
-			id: '1781533421287342082',
348
-			isQueryFristNode: true
349
-		}
350
-	}
351
-	// 确定按钮
352
-	const handleOk = () => {
353
-		formRef.value
354
-			.validate()
355
-			.then(() => {
356
-				formState.value.zczb = Number(formState.value.zczb)
357
-				formState.value.zcze = Number(formState.value.zcze)
358
-				// isTypeData === '1' 新增  2是编辑 3是查看
359
-				if (isTypeData.value === '1') return addData()
360
-				if (isTypeData.value === '2') return editData()
361
-			})
362
-			.catch((error) => {
363
-				message.warning('请填写完善')
364
-				console.log('error', error)
365
-			})
366
-	}
240
+}
241
+const uploadDataList = ref(null)
242
+function beforeUpload() {
243
+	uploadDataList.value.clearValidate()
244
+}
367 245
 
368
-	const infoObj = ref({
246
+// 取消按钮
247
+const handleCancel = () => {
248
+	visible.value = false
249
+	emit('isVisible', false)
250
+	formRef.value.resetFields() //resetFields()函数是组件库提供的
251
+	formState.value = {}
252
+	infoObj.value = {
369 253
 		id: '1781533421287342082',
370 254
 		isQueryFristNode: true
371
-	})
372
-	const loadCascaderData = (selectedOptions) => {
373
-		const targetOption = selectedOptions[selectedOptions.length - 1]
374
-		targetOption.loading = true
375
-		infoObj.value.id = targetOption.id
376
-		if (selectedOptions.length >= 2) {
377
-			infoObj.value.isQueryFristNode = true
378
-		} else {
379
-			infoObj.value.isQueryFristNode = false
380
-		}
381
-		initProvince(infoObj.value, (data) => {
382
-			targetOption.loading = false
383
-			targetOption.children = data
384
-		})
385
-	}
386
-	let register = {
387
-		zcdzProvince: '',
388
-		zcdzCity: '',
389
-		zcdzArea: ''
390 255
 	}
391
-
392
-	// 新增时候获取省
393
-	const initProvince = (id, cb) => {
394
-		unitInfoApi
395
-			.getAllChildrenData(id)
396
-			.then((res) => {
397
-				let datas = res.map((v) => {
398
-					let row = { label: v.dictLabel, value: v.dictValue, id: v.id, pid: v.parentId, sortCode: v.sortCode }
399
-					row['isLeaf'] = v.sortCode.toString().length >= 6
400
-					return row
401
-				})
402
-				if (cb) {
403
-					cb(datas)
256
+}
257
+// 确定按钮
258
+const handleOk = () => {
259
+	formRef.value
260
+		.validate()
261
+		.then(() => {
262
+			formState.value.zczb = Number(formState.value.zczb)
263
+			formState.value.zcze = Number(formState.value.zcze)
264
+			// 判断附件内容存在与否
265
+			if (Array.isArray(formState.value.electronicScan)) {
266
+				if (formState.value.electronicScan[0].url) {
267
+					let arrList = formState.value.electronicScan
268
+					formState.value.electronicScan = []
269
+					arrList.forEach(item => {
270
+						formState.value.electronicScan.push(item.url)
271
+					})
272
+					formState.value.electronicScan = formState.value.electronicScan.join(',')
404 273
 				} else {
405
-					cascaOptions.value = []
406
-					cascaOptions.value = datas
274
+					formState.value.electronicScan = formState.value.electronicScan.join(',')
407 275
 				}
408
-			})
409
-			.catch()
276
+			}
277
+			// isTypeData === '1' 新增  2是编辑 3是查看
278
+			if (isTypeData.value === '1') return addData()
279
+			if (isTypeData.value === '2') return editData()
280
+		})
281
+		.catch((error) => {
282
+			message.warning('请填写完善')
283
+			console.log('error', error)
284
+		})
285
+}
286
+
287
+const infoObj = ref({
288
+	id: '1781533421287342082',
289
+	isQueryFristNode: true
290
+})
291
+const loadCascaderData = (selectedOptions) => {
292
+	const targetOption = selectedOptions[selectedOptions.length - 1]
293
+	targetOption.loading = true
294
+	infoObj.value.id = targetOption.id
295
+	if (selectedOptions.length >= 2) {
296
+		infoObj.value.isQueryFristNode = true
297
+	} else {
298
+		infoObj.value.isQueryFristNode = false
410 299
 	}
411
-	// 注册地址选择一栏
412
-	const getChangeData = (val, selectedOptions) => {
413
-		// 将选择好的id循环取出push到formState.value里面
414
-		if (selectedOptions.slice(-1)[0].sortCode.toString().length >= 6) {
415
-			if (selectedOptions.length === 1) {
416
-				register = { zcdzProvince: '', zcdzCity: '', zcdzArea: '' }
417
-				register.zcdzProvince = selectedOptions[0].id
418
-			} else if (selectedOptions.length === 2) {
419
-				register = { zcdzProvince: '', zcdzCity: '', zcdzArea: '' }
420
-				register.zcdzProvince = selectedOptions[0].id
421
-				register.zcdzCity = selectedOptions[1].id
300
+	initProvince(infoObj.value, (data) => {
301
+		targetOption.loading = false
302
+		targetOption.children = data
303
+	})
304
+}
305
+let register = {
306
+	zcdzProvince: '',
307
+	zcdzCity: '',
308
+	zcdzArea: ''
309
+}
310
+
311
+// 新增时候获取省
312
+const initProvince = (id, cb) => {
313
+	unitInfoApi
314
+		.getAllChildrenData(id)
315
+		.then((res) => {
316
+			let datas = res.map((v) => {
317
+				let row = { label: v.dictLabel, value: v.dictValue, id: v.id, pid: v.parentId, sortCode: v.sortCode }
318
+				row['isLeaf'] = v.sortCode.toString().length >= 6
319
+				return row
320
+			})
321
+			if (cb) {
322
+				cb(datas)
422 323
 			} else {
423
-				register = { zcdzProvince: '', zcdzCity: '', zcdzArea: '' }
424
-				register.zcdzProvince = selectedOptions[0].id
425
-				register.zcdzCity = selectedOptions[1].id
426
-				register.zcdzArea = selectedOptions[2].id
324
+				cascaOptions.value = []
325
+				cascaOptions.value = datas
427 326
 			}
327
+		})
328
+		.catch()
329
+}
330
+// 注册地址选择一栏
331
+const getChangeData = (val, selectedOptions) => {
332
+	// 将选择好的id循环取出push到formState.value里面
333
+	if (selectedOptions.slice(-1)[0].sortCode.toString().length >= 6) {
334
+		if (selectedOptions.length === 1) {
335
+			register = { zcdzProvince: '', zcdzCity: '', zcdzArea: '' }
336
+			register.zcdzProvince = selectedOptions[0].id
337
+		} else if (selectedOptions.length === 2) {
338
+			register = { zcdzProvince: '', zcdzCity: '', zcdzArea: '' }
339
+			register.zcdzProvince = selectedOptions[0].id
340
+			register.zcdzCity = selectedOptions[1].id
428 341
 		} else {
429
-			formState.value.zcdz = ''
342
+			register = { zcdzProvince: '', zcdzCity: '', zcdzArea: '' }
343
+			register.zcdzProvince = selectedOptions[0].id
344
+			register.zcdzCity = selectedOptions[1].id
345
+			register.zcdzArea = selectedOptions[2].id
430 346
 		}
347
+	} else {
348
+		formState.value.zcdz = ''
431 349
 	}
350
+}
432 351
 
433
-	// 用于新增提交
434
-	const addData = () => {
435
-		if (Array.isArray(formState.value.electronicScan)) {
436
-			formState.value.electronicScan = formState.value.electronicScan.join(',')
352
+// 用于新增提交
353
+const addData = () => {
354
+	formState.value.zcdzProvince = register.zcdzProvince
355
+	formState.value.zcdzCity = register.zcdzCity
356
+	formState.value.zcdzArea = register.zcdzArea
357
+	formState.value.zcdz = ''
358
+	unitInfoApi.addUnitForm(formState.value).then((res) => {
359
+		infoObj.value = {
360
+			id: '1781533421287342082',
361
+			isQueryFristNode: true
437 362
 		}
438
-		formState.value.zcdzProvince = register.zcdzProvince
439
-		formState.value.zcdzCity = register.zcdzCity
440
-		formState.value.zcdzArea = register.zcdzArea
441
-		formState.value.zcdz = ''
442
-		unitInfoApi.addUnitForm(formState.value).then((res) => {
443
-			infoObj.value = {
444
-				id: '1781533421287342082',
445
-				isQueryFristNode: true
446
-			}
447
-			isClose()
448
-		})
449
-	}
450
-	// 用于修改提交
451
-	const editData = () => {
452
-		if (Array.isArray(formState.value.electronicScan)) {
453
-			formState.value.electronicScan = formState.value.electronicScan.join(',')
363
+		isClose()
364
+	})
365
+}
366
+// 用于修改提交
367
+const editData = () => {
368
+	formState.value.zcdzProvince = register.zcdzProvince
369
+	formState.value.zcdzCity = register.zcdzCity
370
+	formState.value.zcdzArea = register.zcdzArea
371
+	formState.value.zcdz = ''
372
+	unitInfoApi.editUnitForm(formState.value).then((res) => {
373
+		infoObj.value = {
374
+			id: '1781533421287342082',
375
+			isQueryFristNode: true
454 376
 		}
455
-		formState.value.zcdzProvince = register.zcdzProvince
456
-		formState.value.zcdzCity = register.zcdzCity
457
-		formState.value.zcdzArea = register.zcdzArea
458
-		formState.value.zcdz = ''
459
-		unitInfoApi.editUnitForm(formState.value).then((res) => {
460
-			infoObj.value = {
461
-				id: '1781533421287342082',
462
-				isQueryFristNode: true
463
-			}
464
-			isClose()
465
-		})
466
-	}
467
-	// 用于查看调用
468
-	const detailData = (id) => {
469
-		unitInfoApi.unitInfoDetail({ id: id }).then((res) => {
470
-			formState.value = { ...res }
471
-			formState.value.electronicScan = (res.electronicScan || '').split(',').filter((v) => v)
472
-		})
473
-	}
474
-	const isClose = () => {
475
-		visible.value = false
476
-		emit('isVisible', false)
477
-		formRef.value.resetFields() //resetFields()函数是组件库提供的
478
-		formState.value = {}
479
-	}
480
-	// 监听点击事件更新数据
481
-	watch(
482
-		() => props.dataObj,
483
-		async (newValue, oldvalue) => {
484
-			await nextTick()
485
-			titleText.value = newValue.titleText
486
-			visible.value = newValue.visible
487
-			showLock.value = newValue.showLock
488
-			isTypeData.value = newValue.isType
489
-			initProvince(infoObj.value)
490
-			// isType字段用于查看接口
491
-			if (newValue.isType == '2' || newValue.isType == '3') {
492
-				detailData(newValue.id)
493
-			} else {
494
-				// 用于新增时清空表格数据
495
-				formState.value = {}
496
-			}
497
-		},
498
-		{ deep: true, immediate: true }
499
-	)
500
-	onMounted(() => {
501
-		getInformationData()
377
+		isClose()
502 378
 	})
379
+}
380
+// 用于查看调用
381
+const detailData = (id) => {
382
+	unitInfoApi.unitInfoDetail({ id: id }).then((res) => {
383
+		formState.value = { ...res }
384
+		if (res.electronicScan) {
385
+			formState.value.electronicScan = []
386
+			formState.value.electronicScan = res.electronicScan.split(',') || ''
387
+		}
388
+	})
389
+}
390
+const isClose = () => {
391
+	visible.value = false
392
+	emit('isVisible', false)
393
+	formRef.value.resetFields() //resetFields()函数是组件库提供的
394
+	formState.value = {}
395
+}
396
+// 监听点击事件更新数据
397
+watch(
398
+	() => props.dataObj,
399
+	async (newValue, oldvalue) => {
400
+		await nextTick()
401
+		titleText.value = newValue.titleText
402
+		visible.value = newValue.visible
403
+		showLock.value = newValue.showLock
404
+		isTypeData.value = newValue.isType
405
+		initProvince(infoObj.value)
406
+		// isType字段用于查看接口
407
+		if (newValue.isType == '2' || newValue.isType == '3') {
408
+			detailData(newValue.id)
409
+		} else {
410
+			// 用于新增时清空表格数据
411
+			formState.value = {}
412
+		}
413
+	},
414
+	{ deep: true, immediate: true }
415
+)
416
+onMounted(() => {
417
+	getInformationData()
418
+})
503 419
 
504
-	function changeUpload(fd) {
505
-		return global.uploadFile(fd).then((reg) => {
506
-			uploadDataList.value.clearValidate()
507
-			return reg
508
-		})
509
-	}
510
-	// const uploadDataList = ref(null)
511
-	// function beforeUpload() {
512
-	// 	uploadDataList.value.clearValidate()
513
-	// }
514 420
 </script>
515 421
 <style lang="less" scoped>
516
-	.ant-input {
517
-		width: 80%;
518
-	}
422
+.ant-input {
423
+	width: 80%;
424
+}
519 425
 
520
-	/* 针对 a-form-item 的 label 应用样式 */
521
-	::v-deep .ant-form-item-label {
522
-		width: 130px;
523
-		text-align: right;
524
-	}
426
+/* 针对 a-form-item 的 label 应用样式 */
427
+::v-deep .ant-form-item-label {
428
+	width: 130px;
429
+	text-align: right;
430
+}
525 431
 
526
-	::v-deep .ant-form-item-control-input {
527
-		width: 100%;
528
-	}
432
+::v-deep .ant-form-item-control-input {
433
+	width: 100%;
434
+}
529 435
 
530
-	.ant-picker {
531
-		width: 80%;
532
-	}
436
+.ant-picker {
437
+	width: 80%;
438
+}
533 439
 
534
-	.ant-select {
535
-		width: 80%;
536
-	}
440
+.ant-select {
441
+	width: 80%;
442
+}
537 443
 
538
-	.from-input {
539
-		width: 101.4%;
540
-	}
444
+.from-input {
445
+	width: 101.4%;
446
+}
541 447
 
542
-	.address-box {
543
-		width: 91.6%;
544
-	}
448
+.address-box {
449
+	width: 91.6%;
450
+}
545 451
 
546
-	.btn-box {
547
-		text-align: center;
548
-	}
452
+.btn-box {
453
+	text-align: center;
454
+}
549 455
 
550
-	.int-box {
551
-		width: 80% !important;
552
-	}
456
+.int-box {
457
+	width: 80% !important;
458
+}
553 459
 
554
-	::v-deep.ant-modal-footer {
555
-		display: none !important;
556
-	}
460
+::v-deep.ant-modal-footer {
461
+	display: none !important;
462
+}
557 463
 </style>