gyj 2 лет назад
Родитель
Сommit
e988fe6407

+ 8
- 0
api/handlecase/index.js Просмотреть файл

@@ -120,4 +120,12 @@ export function updateComfire(data) {
120 120
     method: "post",
121 121
     data: data,
122 122
   })
123
+}
124
+/** 根据id查询案件信息 */
125
+export function caseApplicationSelectById(data) {
126
+  return request({
127
+    url: '/caseApplication/selectById',
128
+    method: 'get',
129
+    params: data
130
+  })
123 131
 }

+ 7
- 0
pages/handlecase/component/list.vue Просмотреть файл

@@ -41,6 +41,7 @@
41 41
 			</view>
42 42
 		</view>
43 43
 		<view class="btn" v-if="sysType == 2">
44
+			<button class="btnItem" type="primary" size="mini" @tap="modify">修改</button>
44 45
 			<!-- <button class="btnItem" type="primary" size="mini" @tap="clickPay">申请人缴费</button>
45 46
 			<button class="btnItem" type="primary" size="mini" @tap="caseDetail">选择调解员</button> -->
46 47
 			<button class="btnItem" type="primary" size="mini" v-for="(item) in buttonList" :key="item.id"
@@ -85,6 +86,12 @@
85 86
 					url: `/pages/handlecase/component/payList?id=${this.defalutVal.id}`
86 87
 				})
87 88
 			},
89
+			// 修改
90
+			modify(){
91
+				uni.redirectTo({
92
+					url: `/pages/handlecase/component/newlyAddedCase?id=${this.defalutVal.id}`,
93
+				})
94
+			},
88 95
 			/**查询按钮列表 */
89 96
 			getButtonList() {
90 97
 				queryCaseFlowInfo({

+ 23
- 3
pages/handlecase/component/newlyAddedCase.vue Просмотреть файл

@@ -167,7 +167,7 @@
167 167
 </template>
168 168
 
169 169
 <script>
170
-	import {getTemplate,getInfoByIdCard,caseApplicationInsert,updateComfire} from '../../../api/handlecase/index.js'
170
+	import {getTemplate,getInfoByIdCard,caseApplicationInsert,updateComfire,caseApplicationSelectById} from '../../../api/handlecase/index.js'
171 171
 	import {
172 172
 		getToken
173 173
 	} from '@/utils/auth'
@@ -183,6 +183,7 @@
183 183
 						columnValueList: [],
184 184
 						caseAttachList: [],
185 185
 					},
186
+					ids:null,
186 187
 					tempFilePaths: null,
187 188
 					templateList:[],
188 189
 					objectiJurisArr: [{
@@ -210,7 +211,7 @@
210 211
 							
211 212
 							validateFunction: (rule, value, data, callback) => {
212 213
 								//判断手机号格式时候正确
213
-								if (value.length<3) {
214
+								if (value.length<1) {
214 215
 									if(this.formData.affiliate.organizeFlag == 0){
215 216
 										callback('请输入申请人姓名')
216 217
 									}else{
@@ -257,7 +258,12 @@
257 258
 			},
258 259
 			submitReasont(){
259 260
 				this.$refs.form.validate().then(res=>{
260
-						this.insertFn(this.formData)
261
+						if(this.ids){
262
+							this.modifyData(this.formData)
263
+						}else{
264
+							this.insertFn(this.formData)
265
+						}
266
+						
261 267
 					}).catch(err =>{
262 268
 						
263 269
 				})
@@ -271,6 +277,13 @@
271 277
 					})
272 278
 			      });
273 279
 			},
280
+			 /** 根据案件id获取对应信息 */
281
+			 caseApplicationSelectByIdFn(data) {
282
+				  caseApplicationSelectById(data).then(res=>{
283
+					 res.data.affiliate.respondentSex = Number(res.data.affiliate.respondentSex)
284
+					 this.formData = res.data
285
+				  })
286
+			 },
274 287
 			// 被申请人获取性别出生年月
275 288
 			handleBlur(){
276 289
 				let idCards = {
@@ -355,6 +368,13 @@
355 368
 			}
356 369
 		},
357 370
 		onLoad(data) {
371
+			this.ids = data.id
372
+			if(this.ids){
373
+				this.caseApplicationSelectByIdFn({id:data.id})
374
+				uni.setNavigationBarTitle({title:"案件修改"})
375
+			}else{
376
+				uni.setNavigationBarTitle({title:"案件新增"})
377
+			}
358 378
 			this.getTemplateFn()
359 379
 		},
360 380
 		onReady() {