newlyAddedCase.vue 36KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. <template>
  2. <view class="conent">
  3. <view class="assignrbitrators">
  4. <uni-forms ref="form" :modelValue="formData" :rules="rules">
  5. <uni-section title="案件信息" type="line" padding></uni-section>
  6. <uni-forms-item label="案件压缩包:" name="headZip" label-width="120px">
  7. <uni-file-picker ref="files" file-mediatype="all" return-type='object' v-model="fileListZip"
  8. :auto-upload="false" @select="selectZip" :limit='1' />
  9. </uni-forms-item>
  10. <uni-forms-item label="申请人调解请求:" name="arbitratClaims" label-width="120px" required
  11. :rules="[{required: true,errorMessage: '申请人调解请求不能为空'}]">
  12. <uni-easyinput v-model="formData.arbitratClaims" type="textarea" placeholder="请输入申请人调解请求" />
  13. </uni-forms-item>
  14. <uni-forms-item label="事实和理由:" name="facts" label-width="120px" required
  15. :rules="[{required: true,errorMessage: '事实和理由不能为空'}]">
  16. <uni-easyinput v-model="formData.facts" type="textarea" placeholder="请输入事实和理由" />
  17. </uni-forms-item>
  18. <uni-forms-item label="申请人案件证据资料上传:" name="headImage" label-width="120px">
  19. <uni-file-picker ref="files" file-mediatype="all" return-type='object' v-model="fileList"
  20. :auto-upload="false" @select="select" :limit='1' />
  21. </uni-forms-item>
  22. <uni-forms-item label="证据:" label-width="120px" v-if="ids">
  23. <view class="" v-for="item in formData.caseAttachList">
  24. <uni-link v-if="item.annexType==2" :href="baseUrl+item.annexPath" color="#007BFF"
  25. :text="item.annexName"></uni-link>
  26. </view>
  27. </uni-forms-item>
  28. <uni-forms-item label="调解申请书:" label-width="120px" v-if="ids">
  29. <view class="" v-for="item in formData.caseAttachList">
  30. <uni-link v-if="item.annexType==3" :href="baseUrl+item.annexPath" color="#007BFF"
  31. :text="item.annexName"></uni-link>
  32. </view>
  33. </uni-forms-item>
  34. <uni-forms-item label="选择机构或自然人" label-width="120px" name="objectiJuris">
  35. <uni-data-checkbox class='checkbox' :disabled="ids?true:false" :localdata="objectiJurisArr"
  36. v-model="formData.organizeFlag" @change='clearValidate'></uni-data-checkbox>
  37. </uni-forms-item>
  38. <button type="primary" @click="addMultiple" style="margin-bottom: 20px;">新增多个信息</button>
  39. <view v-for="(item ,index ) in formData.affiliate" :key="index">
  40. <button class="mini-btn" type="primary" size="mini" @tap="delValue(index)" v-if="delShow">删除</button>
  41. <uni-section :title="'双方信息' + (index + 1)" type="line" padding></uni-section>
  42. <uni-forms-item label="是否操作人" label-width="120px">
  43. <uni-data-checkbox
  44. v-model="formData.affiliate[index].applicant.operatorFlag"
  45. :localdata="isOperate"
  46. ></uni-data-checkbox>
  47. </uni-forms-item>
  48. <uni-forms-item :label="formData.organizeFlag==0 ? '申请人':'申请机构'" :rules="rulesPersonName"
  49. :name="['affiliate',index,'applicant','name']" label-width="120px" required>
  50. <uni-easyinput v-model="formData.affiliate[index].applicant.name" type="text"
  51. :placeholder="formData.organizeFlag==0 ? '请输入申请人姓名':'请输入申请机构名称'" />
  52. </uni-forms-item>
  53. <uni-forms-item label="证件类型" label-width="120px" v-if="formData.organizeFlag==0">
  54. <uni-data-select
  55. v-model="formData.affiliate[index].applicant.idType"
  56. :localdata="certificate"
  57. @change="changeDocment"
  58. ></uni-data-select>
  59. </uni-forms-item>
  60. <uni-forms-item label="地区" label-width="120px">
  61. <uni-data-select
  62. v-model="formData.affiliate[index].applicant.nationality"
  63. :localdata="nationality"
  64. @change="changeArea"
  65. ></uni-data-select>
  66. </uni-forms-item>
  67. <uni-forms-item key = 'code' v-if="formData.organizeFlag==1" label="机构代码" required label-width="120px" :name="['affiliate',index,'applicant','code']" :rules="[{required: true,errorMessage: '机构代码不能为空'}]">
  68. <uni-easyinput v-model="formData.affiliate[index].applicant.code" type="text"
  69. placeholder="请输入统一社会代码" />
  70. </uni-forms-item>
  71. <uni-forms-item label="证件号码" key = 'idCard' v-if="formData.organizeFlag==0" :name="['affiliate',index,'applicant','idCard']"
  72. label-width="120px" required :rules="[
  73. {required: true,errorMessage: '申请人身份证号不能为空'},
  74. {pattern:'^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$',errorMessage:'申请人身份证格式错误'}]">
  75. <uni-easyinput v-model="formData.affiliate[index].applicant.idCard" type="text"
  76. placeholder="请输入证件号码" />
  77. </uni-forms-item>
  78. <uni-forms-item label="申请人邮箱:" key="email" v-if="formData.organizeFlag==0"
  79. :name="['affiliate',index,'applicant','email']" label-width="120px" required :rules="[
  80. {required: true,errorMessage: '被申请人邮箱不能为空'},
  81. {pattern:'^\\S+?@\\S+?\\.\\S+?$',errorMessage:'邮箱格式不正确'}
  82. ]">
  83. <uni-easyinput v-model="formData.affiliate[index].applicant.email"
  84. type="text" placeholder="请输入申请人邮箱" />
  85. </uni-forms-item>
  86. <uni-forms-item label="申请人电话:" key="phone" v-if="formData.organizeFlag==0"
  87. :name="['affiliate',index,'applicant','phone']" label-width="120px" :required="testVerify" :rules="rulesRespondentPhone">
  88. <uni-easyinput v-model="formData.affiliate[index].applicant.phone"
  89. type="text" placeholder="请输入申请人电话" />
  90. </uni-forms-item>
  91. <uni-forms-item label="法定代表人:" v-if="formData.organizeFlag==1"
  92. :name="['affiliate',index,'applicant','compLegalPerson']" key="compLegalPerson" label-width="120px" required :rules="[{required: true,errorMessage: '法定代表人不能为空'}]">
  93. <uni-easyinput v-model="formData.affiliate[index].applicant.compLegalPerson" type="text" placeholder="请输入法定代表人" />
  94. </uni-forms-item>
  95. <uni-forms-item label="申请人住所:" :name="['affiliate',index,'applicant','home']" label-width="120px" required
  96. :rules="[{required: true,errorMessage: '申请人住所不能为空'}]">
  97. <uni-easyinput v-model="formData.affiliate[index].applicant.home" type="text" placeholder="请输入申请人住所" />
  98. </uni-forms-item>
  99. <uni-forms-item label="申请人联系地址:" :name="['affiliate',index,'applicant','address']" label-width="120px" required
  100. :rules="[{required: true,errorMessage: '申请人联系地址不能为空'}]">
  101. <uni-easyinput v-model="formData.affiliate[index].applicant.address" type="text" placeholder="请输入申请人联系地址" />
  102. </uni-forms-item>
  103. <uni-section title="申请代理人" type="line" padding></uni-section>
  104. <uni-forms-item label="是否操作人" label-width="120px">
  105. <uni-data-checkbox
  106. v-model="formData.affiliate[index].applicantAgent.operatorFlag"
  107. :localdata="isProxyApplicant"
  108. ></uni-data-checkbox>
  109. </uni-forms-item>
  110. <uni-forms-item label="代理人联系电话:" label-width="120px">
  111. <uni-easyinput v-model="formData.affiliate[index].applicantAgent.phone" type="text"
  112. placeholder="请输入代理人联系电话" />
  113. </uni-forms-item>
  114. <uni-forms-item label="代理人姓名:" label-width="120px">
  115. <uni-easyinput v-model="formData.affiliate[index].applicantAgent.name" type="text"
  116. placeholder="请输入委托代理人姓名" />
  117. </uni-forms-item>
  118. <uni-forms-item label="代理人邮箱:" label-width="120px">
  119. <uni-easyinput v-model="formData.affiliate[index].applicantAgent.email" type="text"
  120. placeholder="请输入代理人邮箱" />
  121. </uni-forms-item>
  122. <uni-section title="被申请人" type="line" padding></uni-section>
  123. <uni-forms-item label="是否操作人" label-width="120px">
  124. <uni-data-checkbox
  125. v-model="formData.affiliate[index].res.operatorFlag"
  126. :localdata="isRespondent"
  127. ></uni-data-checkbox>
  128. </uni-forms-item>
  129. <uni-forms-item label="被申请人姓名:" :name="['affiliate',index,'res','name']" label-width="120px" required
  130. :rules="[{required: true,errorMessage: '被申请人姓名不能为空'}]">
  131. <uni-easyinput v-model="formData.affiliate[index].res.name" type="text" placeholder="请输入被申请人姓名" />
  132. </uni-forms-item>
  133. <uni-forms-item label="被申请人联系电话:" :name="['affiliate',index,'res','phone']" label-width="120px" :required="testVerify" :rules="rulesRespondentPhone">
  134. <uni-easyinput v-model="formData.affiliate[index].res.phone" type="text" placeholder="请输入被申请人联系电话" />
  135. </uni-forms-item>
  136. <uni-forms-item label="被申请人身份证号:" :name="['affiliate',index,'res','idCard']" label-width="120px" required
  137. :rules="[
  138. {required: true,errorMessage: '被申请人身份证号不能为空'},
  139. {pattern:'^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$',errorMessage:'被申请人身份证格式错误'}
  140. ]">
  141. <uni-easyinput v-model="formData.affiliate[index].res.idCard" @blur="handleBlur(index)" type="text"
  142. placeholder="请输入被申请人身份证号" />
  143. </uni-forms-item>
  144. <uni-forms-item label="被申请人性别" label-width="120px" required>
  145. <uni-data-checkbox class='checkbox' :disabled='true' v-model="formData.affiliate[index].res.sex"
  146. :localdata="respondentSexy"></uni-data-checkbox>
  147. </uni-forms-item>
  148. <uni-forms-item label="被申请人出生年月日" label-width="120px">
  149. <uni-datetime-picker v-model="formData.affiliate[index].res.birth" :disabled='true' type="date"
  150. :clear-icon="false" />
  151. </uni-forms-item>
  152. <uni-forms-item label="被申请人住所:" :name="['affiliate',index,'res','home']" label-width="120px" required
  153. :rules="[{required: true,errorMessage: '被申请人住所不能为空'}]">
  154. <uni-easyinput v-model="formData.affiliate[index].res.home" type="text" placeholder="请输入被申请人住所" />
  155. </uni-forms-item>
  156. <uni-forms-item label="被申请人邮箱:" :name="['affiliate',index,'res','email']" label-width="120px" required :rules="[
  157. {required: true,errorMessage: '被申请人邮箱不能为空'},
  158. {pattern:'^\\S+?@\\S+?\\.\\S+?$',errorMessage:'邮箱格式不正确'}
  159. ]">
  160. <uni-easyinput v-model="formData.affiliate[index].res.email" type="text" placeholder="请输入被申请人邮箱" />
  161. </uni-forms-item>
  162. <uni-section title="被申请代理人" type="line" padding></uni-section>
  163. <uni-forms-item label="是否操作人" label-width="120px">
  164. <uni-data-checkbox
  165. v-model="formData.affiliate[index].resAgent.operatorFlag"
  166. :localdata="isResApplicant"
  167. ></uni-data-checkbox>
  168. </uni-forms-item>
  169. <uni-forms-item label="代理人联系电话:" label-width="120px">
  170. <uni-easyinput v-model="formData.affiliate[index].resAgent.phone" type="text"
  171. placeholder="请输入代理人联系电话" />
  172. </uni-forms-item>
  173. <uni-forms-item label="代理人姓名:" label-width="120px">
  174. <uni-easyinput v-model="formData.affiliate[index].resAgent.name" type="text"
  175. placeholder="请输入委托代理人姓名" />
  176. </uni-forms-item>
  177. <uni-forms-item label="代理人邮箱:" label-width="120px">
  178. <uni-easyinput v-model="formData.affiliate[index].resAgent.email" type="text"
  179. placeholder="请输入代理人邮箱" />
  180. </uni-forms-item>
  181. </view>
  182. </uni-forms>
  183. <view class="determine" style="text-align: center;">
  184. <button class="mini-btn" type="primary" size="mini" @tap="submitReasont">确定</button>
  185. <button style="margin-left:30rpx;" class="mini-btn" type="default" size="mini"
  186. @tap="cencalBut">取消</button>
  187. </view>
  188. </view>
  189. </view>
  190. </template>
  191. <script>
  192. import {
  193. getTemplate,
  194. getInfoByIdCard,
  195. caseApplicationInsert,
  196. updateComfire,
  197. caseApplicationSelectById,
  198. getUserInfo,
  199. idType
  200. } from '../../../api/handlecase/index.js'
  201. import {
  202. getToken
  203. } from '@/utils/auth'
  204. import config from '@/config'
  205. import constant from '../../../utils/constant.js'
  206. export default {
  207. data() {
  208. return {
  209. baseUrl: config.baseUrlTJ,
  210. certificate: [],
  211. dynamicLists: [],
  212. nationality: [
  213. { value: 0, text: "境内" },
  214. { value: 1, text: "境外" },
  215. ],
  216. isOperate:[
  217. { value: 1, text: "是" },
  218. { value: 0, text: "否" },
  219. ],
  220. isProxyApplicant:[
  221. { value: 1, text: "是" },
  222. { value: 0, text: "否" },
  223. ],
  224. isRespondent:[
  225. { value: 1, text: "是" },
  226. { value: 0, text: "否" },
  227. ],
  228. isResApplicant:[
  229. { value: 1, text: "是" },
  230. { value: 0, text: "否" },
  231. ],
  232. delShow:false,
  233. formZipData: {},
  234. formData: {
  235. organizeFlag: 0,
  236. // affiliate: {
  237. // roleType:1,
  238. // respondentSex: 0,
  239. // },
  240. affiliate:[{
  241. applicant: {
  242. roleType: 1,
  243. name: "",
  244. idCard: "",
  245. code: "",
  246. phone: "",
  247. compLegalPerson: "",
  248. email: "",
  249. home: "",
  250. address: "",
  251. idType: 0,
  252. nationality: 0,
  253. birth: "",
  254. sex: "",
  255. group_order: 1,
  256. operatorFlag:1
  257. },
  258. applicantAgent: {
  259. roleType: 2,
  260. name: "",
  261. idCard: "",
  262. code: "",
  263. phone: "",
  264. compLegalPerson: "",
  265. email: "",
  266. home: "",
  267. address: "",
  268. idType: 0,
  269. nationality: 1,
  270. birth: "",
  271. sex: "",
  272. group_order: 1,
  273. operatorFlag:1
  274. },
  275. res:{
  276. roleTyp: 3,
  277. name: "",
  278. idCard: "",
  279. code: "",
  280. phone: "",
  281. compLegalPerson: "",
  282. email: "",
  283. home: "",
  284. address: "",
  285. idType: 0,
  286. nationality: 1,
  287. birth: "",
  288. sex: "0",
  289. group_order: 1,
  290. operatorFlag:1
  291. },
  292. resAgent: {
  293. roleType: 4,
  294. name: "",
  295. idCard: "",
  296. code: "",
  297. phone: "",
  298. compLegalPerson: "",
  299. email: "",
  300. home: "",
  301. address: "",
  302. idType: 0,
  303. nationality: 1,
  304. birth: "",
  305. sex: "",
  306. group_order: 1,
  307. operatorFlag:1
  308. }
  309. }],
  310. columnValueList: [],
  311. caseAttachList: [],
  312. },
  313. testVerify:true,
  314. getUserInfoList: {},
  315. ids: null,
  316. tempFilePaths: null,
  317. tempFilePathsZip: null,
  318. templateList: [],
  319. objectiJurisArr: [{
  320. text: '自然人',
  321. value: 0
  322. }, {
  323. text: '机构',
  324. value: 1
  325. }],
  326. respondentSexy: [{
  327. text: '女',
  328. value: 1
  329. }, {
  330. text: '男',
  331. value: 0
  332. }],
  333. disabledVal: false,
  334. disabledApplicat: false,
  335. fileList: {},
  336. fileListZip: {},
  337. rules: {},
  338. rulesRespondentPhone:[
  339. {required:true ,errorMessage: '被申请人联系电话不能为空'},
  340. {pattern:'^[1][3,4,5,6,7,8,9][0-9]{9}$',errorMessage:'被申请人联系电话格式不正确'}
  341. ],
  342. rulesPersonName:[{'required': true,errorMessage: '不能为空'}],
  343. rulesappNo: [{
  344. required: true,
  345. errorMessage: '输入信息不能为空',
  346. }, {
  347. validateFunction: (rule, value, data, callback) => {
  348. //判断手机号格
  349. if (this.formData.organizeFlag == 0) {
  350. let pNoReg =
  351. /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
  352. if (!pNoReg.test(value)) {
  353. callback('请输入正确的身份证号码')
  354. }
  355. } else {
  356. if (!value) {
  357. callback('请输入正确的机构信息')
  358. }
  359. }
  360. return true
  361. }
  362. }]
  363. }
  364. },
  365. methods: {
  366. submitReasont() {
  367. this.$refs.form.validate().then(res => {
  368. console.log("pppppppppppp")
  369. if (this.ids) {
  370. this.modifyData(this.formData)
  371. } else {
  372. this.insertFn(this.formData)
  373. }
  374. }).catch(err => {
  375. console.log(err)
  376. })
  377. },
  378. // 获取新增默认值
  379. getUserInfoNumber() {
  380. let indexs = ""
  381. this.formData.affiliate.forEach((item,index)=>{
  382. indexs = index
  383. })
  384. getUserInfo().then(res => {
  385. this.getUserInfoList = res.data
  386. console.log(res.data.nationality)
  387. if (this.formData.organizeFlag == 0) {
  388. this.$set(this.formData.affiliate[indexs].applicant, 'name', res.data.nickName)
  389. this.$set(this.formData.affiliate[indexs].applicant, 'idCard', res.data.idCard)
  390. this.$set(this.formData.affiliate[indexs].applicant, 'email', res.data.email)
  391. this.$set(this.formData.affiliate[indexs].applicant, 'phone', res.data.phonenumber)
  392. this.$set(this.formData.affiliate[indexs].applicant, 'idType', res.data.idType)
  393. this.$set(this.formData.affiliate[indexs].applicant, 'nationality', res.data.nationality)
  394. if(res.data.nationality == 0){
  395. this.testVerify = true
  396. this.rulesRespondentPhone[0].required = true;
  397. }else if(res.data.nationality == 1){
  398. this.testVerify = false
  399. this.rulesRespondentPhone[0].required = false;
  400. }
  401. } else if (this.formData.organizeFlag == 1) {
  402. console.log(this.formData.organizeFlag)
  403. this.$set(this.formData.affiliate[indexs].applicantAgent, 'name', res.data.nickName)
  404. this.$set(this.formData.affiliate[indexs].applicantAgent, 'email', res.data.email)
  405. this.$set(this.formData.affiliate[indexs].applicantAgent, 'phone', res.data.phonenumber)
  406. this.$set(this.formData.affiliate[indexs].applicantAgent, 'nationality', res.data.nationality)
  407. }
  408. })
  409. },
  410. clearValidate(val) {
  411. let indexs = ""
  412. this.formData.affiliate.forEach((item,index)=>{
  413. indexs = index
  414. })
  415. if (this.formData.organizeFlag == 0) {
  416. this.$set(this.formData.affiliate[indexs].applicant, 'name', this.getUserInfoList.nickName)
  417. this.$set(this.formData.affiliate[indexs].applicant, 'idCard', this.getUserInfoList.idCard)
  418. this.$set(this.formData.affiliate[indexs].applicant, 'email', this.getUserInfoList.email)
  419. this.$set(this.formData.affiliate[indexs].applicant, 'phone', this.getUserInfoList.phonenumber)
  420. if (this.formZipData.affiliate) {
  421. this.$set(this.formData, 'arbitratClaims', this.formZipData.arbitratClaims);
  422. this.$set(this.formData, 'facts', this.formZipData.facts);
  423. this.$set(this.formData.affiliate[0].applicant, 'home', this.formZipData.affiliate[0]
  424. .applicant.home);
  425. this.$set(this.formData.affiliate[0].applicant, 'address', this.formZipData.affiliate[0]
  426. .applicant.address);
  427. this.$set(this.formData.affiliate[0].applicantAgent, 'phone', this.formZipData
  428. .affiliate[0].applicantAgent.phone);
  429. this.$set(this.formData.affiliate[0].applicantAgent, 'name', this.formZipData.affiliate[0]
  430. .applicantAgent.name);
  431. this.$set(this.formData.affiliate[0].applicantAgent, 'email', this.formZipData.affiliate[0]
  432. .applicantAgent.email);
  433. this.$set(this.formData.affiliate[0].res, 'name', this.formZipData.affiliate[0]
  434. .res.name);
  435. this.$set(this.formData.affiliate[0].res, 'phone', this.formZipData.affiliate[0]
  436. .res.phone);
  437. this.$set(this.formData.affiliate[0].res, 'idCard', this.formZipData
  438. .affiliate[0].res.idCard);
  439. this.$set(this.formData.affiliate[0].res, 'sex', Number(this.formZipData
  440. .affiliate[0].res.sex));
  441. this.$set(this.formData.affiliate[0].res, 'birth', this.formZipData.affiliate[0]
  442. .res.birth);
  443. this.$set(this.formData.affiliate[0].res, 'home', this.formZipData.affiliate[0]
  444. .res.home);
  445. this.$set(this.formData.affiliate[0].res, 'email', this.formZipData.affiliate[0]
  446. .res.email);
  447. } else {
  448. this.$set(this.formData.affiliate[indexs].applicantAgent, 'name', null)
  449. this.$set(this.formData.affiliate[indexs].applicantAgent, 'email', null)
  450. this.$set(this.formData.affiliate[indexs].applicantAgent, 'phone', null)
  451. }
  452. this.disabledVal = false
  453. this.disabledApplicat = true
  454. } else if (this.formData.organizeFlag == 1) {
  455. this.$set(this.formData.affiliate[indexs].applicantAgent, 'name', this.getUserInfoList.nickName)
  456. this.$set(this.formData.affiliate[indexs].applicantAgent, 'email', this.getUserInfoList.email)
  457. this.$set(this.formData.affiliate[indexs].applicantAgent, 'phone', this.getUserInfoList.phonenumber)
  458. if (this.formZipData.affiliate) {
  459. this.$set(this.formData, 'arbitratClaims', this.formZipData.arbitratClaims);
  460. this.$set(this.formData, 'facts', this.formZipData.facts);
  461. this.$set(this.formData.affiliate[0].applicant, 'name', this.formZipData.affiliate[0]
  462. .applicant.name);
  463. this.$set(this.formData.affiliate[0].applicant, 'code', this.formZipData.affiliate[0].applicant.code);
  464. this.$set(this.formData.affiliate[0].applicant, 'home', this.formZipData.affiliate[0]
  465. .applicant.home);
  466. this.$set(this.formData.affiliate[0].applicant, 'address', this.formZipData.affiliate[0]
  467. .applicant.address);
  468. this.$set(this.formData.affiliate[0].applicant, 'compLegalPerson', this.formZipData.affiliate[0]
  469. .applicant.compLegalPerson);
  470. this.$set(this.formData.affiliate[0].applicant, 'email', this.formZipData.affiliate[0]
  471. .applicant.email);
  472. this.$set(this.formData.affiliate[0].applicant, 'phone', this.formZipData.affiliate[0]
  473. .applicant.phone);
  474. this.$set(this.formData.affiliate[0].res, 'name', this.formZipData.affiliate[0]
  475. .res.name);
  476. this.$set(this.formData.affiliate[0].res, 'phone', this.formZipData.affiliate[0]
  477. .res.phone);
  478. this.$set(this.formData.affiliate[0].res, 'idCard', this.formZipData
  479. .affiliate[0].res.idCard);
  480. this.$set(this.formData.affiliate[0].res, 'sex', Number(this.formZipData
  481. .affiliate[0].res.sex));
  482. this.$set(this.formData.affiliate[0].res, 'birth', this.formZipData.affiliate[0]
  483. .res.birth);
  484. this.$set(this.formData.affiliate[0].res, 'home', this.formZipData.affiliate[0]
  485. .res.home);
  486. this.$set(this.formData.affiliate[0].res, 'email', this.formZipData.affiliate[0]
  487. .res.email);
  488. } else {
  489. this.$set(this.formData.affiliate[indexs].applicant, 'name', null)
  490. this.$set(this.formData.affiliate[indexs].applicant, 'idCard', null)
  491. this.$set(this.formData.affiliate[indexs].applicant, 'email', null)
  492. this.$set(this.formData.affiliate[indexs].applicant, 'phone', null)
  493. }
  494. this.disabledVal = true
  495. this.disabledApplicat = false
  496. }
  497. // this.formData.affiliate.applicationName =null
  498. // this.formData.affiliate.code =null
  499. this.$refs["form"].clearValidate()
  500. },
  501. /** 获取裁决书模板 */
  502. getTemplateFn(data) {
  503. getTemplate(data).then((res) => {
  504. //this.templateList = res.rows;
  505. res.rows.forEach(item => {
  506. this.templateList.push({
  507. value: item.id,
  508. text: item.temName
  509. })
  510. })
  511. });
  512. },
  513. /** 根据案件id获取对应信息 */
  514. caseApplicationSelectByIdFn(data) {
  515. caseApplicationSelectById(data).then(res => {
  516. let data = res.data
  517. let indexs = ""
  518. data.affiliate.forEach((item,index) =>{
  519. indexs = index
  520. if(!item.applicant){
  521. item.applicant = {}
  522. }
  523. if(!item.applicantAgent){
  524. item.applicantAgent = {}
  525. }
  526. if(!item.res){
  527. item.res = {}
  528. }
  529. if(!item.resAgent){
  530. item.resAgent = {}
  531. }
  532. })
  533. data.affiliate[indexs].res.sex = Number(data.affiliate[indexs].res.sex)
  534. this.formData = data
  535. console.log(this.formData)
  536. })
  537. },
  538. // 被申请人获取性别出生年月
  539. handleBlur(index) {
  540. console.log(this.formData.affiliate[index].res.idCard)
  541. let idCards = {
  542. idCard: this.formData.affiliate[index].res.idCard,
  543. };
  544. getInfoByIdCard(idCards).then(res => {
  545. this.formData.affiliate[index].res.sex = Number(res.respondentSex);
  546. this.formData.affiliate[index].res.birth= res.respondentBirth;
  547. })
  548. },
  549. // 新增案件
  550. insertFn(data) {
  551. caseApplicationInsert(data).then((res) => {
  552. uni.showToast({
  553. title: '新增成功',
  554. icon: 'none',
  555. duration: 1000
  556. })
  557. uni.navigateTo({
  558. url: '../index'
  559. })
  560. // this.$router.go(-1)
  561. });
  562. },
  563. //修改案件
  564. modifyData(data) {
  565. updateComfire(data).then((res) => {
  566. uni.showToast({
  567. title: '修改成功',
  568. icon: 'none',
  569. duration: 1000
  570. })
  571. uni.navigateBack({
  572. delta: 1
  573. })
  574. });
  575. },
  576. // 压缩包上传
  577. selectZip(e) {
  578. if (e.tempFiles[0].extname != 'zip') {
  579. uni.showToast({
  580. title: '上传类型为zip',
  581. icon: 'none',
  582. duration: 1000
  583. })
  584. return
  585. }
  586. // loading
  587. this.tempFilePathsZip = e.tempFilePaths;
  588. uni.showLoading({
  589. title: '上传中'
  590. });
  591. uni.uploadFile({
  592. url: config.baseUrlTJ + "/caseApplication/userIdentify",
  593. filePath: this.tempFilePathsZip[0],
  594. header: {
  595. Authorization: getToken() || '',
  596. },
  597. name: 'file',
  598. success: (res) => {
  599. let result = JSON.parse(res.data)
  600. uni.showToast({
  601. title: '上传成功',
  602. icon: 'none',
  603. duration: 1000
  604. })
  605. this.formZipData = result.data;
  606. let idnexVal = ""
  607. this.formData.affiliate.forEach((item,index)=>{
  608. idnexVal = index
  609. })
  610. console.log(this.formZipData)
  611. if (this.formData.organizeFlag == 0) {
  612. this.$set(this.formData, 'arbitratClaims', this.formZipData.arbitratClaims);
  613. this.$set(this.formData, 'facts', this.formZipData.facts);
  614. this.$set(this.formData.affiliate[0].applicant, 'home', this.formZipData.affiliate[0]
  615. .applicant.home);
  616. this.$set(this.formData.affiliate[0].applicant, 'address', this.formZipData.affiliate[0]
  617. .applicant.address);
  618. this.$set(this.formData.affiliate[0].applicantAgent, 'phone', this.formZipData
  619. .affiliate[0].applicantAgent.phone);
  620. this.$set(this.formData.affiliate[0].applicantAgent, 'name', this.formZipData.affiliate[0]
  621. .applicantAgent.name);
  622. this.$set(this.formData.affiliate[0].applicantAgent, 'email', this.formZipData.affiliate[0]
  623. .applicantAgent.email);
  624. this.$set(this.formData.affiliate[0].res, 'name', this.formZipData.affiliate[0]
  625. .res.name);
  626. this.$set(this.formData.affiliate[0].res, 'phone', this.formZipData.affiliate[0]
  627. .res.phone);
  628. this.$set(this.formData.affiliate[0].res, 'idCard', this.formZipData
  629. .affiliate[0].res.idCard);
  630. this.$set(this.formData.affiliate[0].res, 'sex', Number(this.formZipData
  631. .affiliate[0].res.sex));
  632. this.$set(this.formData.affiliate[0].res, 'birth', this.formZipData.affiliate[0]
  633. .res.birth);
  634. this.$set(this.formData.affiliate[0].res, 'home', this.formZipData.affiliate[0]
  635. .res.home);
  636. this.$set(this.formData.affiliate[0].res, 'email', this.formZipData.affiliate[0]
  637. .res.email);
  638. // this.$set(this.formData.affiliate[0].resAgent, 'phone', this.formZipData
  639. // .affiliate[0].resAgent.phone);
  640. // this.$set(this.formData.affiliate[0].resAgent, 'name', this.formZipData.affiliate[0]
  641. // .resAgent.name);
  642. // this.$set(this.formData.affiliate[0].resAgent, 'email', this.formZipData.affiliate[0]
  643. // .resAgent.email);
  644. } else if (this.formData.organizeFlag == 1) {
  645. this.$set(this.formData, 'arbitratClaims', this.formZipData.arbitratClaims);
  646. this.$set(this.formData, 'facts', this.formZipData.facts);
  647. this.$set(this.formData.affiliate[0].applicant, 'name', this.formZipData.affiliate[0]
  648. .applicant.name);
  649. this.$set(this.formData.affiliate[0].applicant, 'code', this.formZipData.affiliate[0].applicant.code);
  650. this.$set(this.formData.affiliate[0].applicant, 'home', this.formZipData.affiliate[0]
  651. .applicant.home);
  652. this.$set(this.formData.affiliate[0].applicant, 'address', this.formZipData.affiliate[0]
  653. .applicant.address);
  654. this.$set(this.formData.affiliate[0].applicant, 'compLegalPerson', this.formZipData.affiliate[0]
  655. .applicant.compLegalPerson);
  656. this.$set(this.formData.affiliate[0].applicant, 'email', this.formZipData.affiliate[0]
  657. .applicant.email);
  658. this.$set(this.formData.affiliate[0].applicant, 'phone', this.formZipData.affiliate[0]
  659. .applicant.phone);
  660. this.$set(this.formData.affiliate[0].res, 'name', this.formZipData.affiliate[0]
  661. .res.name);
  662. this.$set(this.formData.affiliate[0].res, 'phone', this.formZipData.affiliate[0]
  663. .res.phone);
  664. this.$set(this.formData.affiliate[0].res, 'idCard', this.formZipData
  665. .affiliate[0].res.idCard);
  666. this.$set(this.formData.affiliate[0].res, 'sex', Number(this.formZipData
  667. .affiliate[0].res.sex));
  668. this.$set(this.formData.affiliate[0].res, 'birth', this.formZipData.affiliate[0]
  669. .res.birth);
  670. this.$set(this.formData.affiliate[0].res, 'home', this.formZipData.affiliate[0]
  671. .res.home);
  672. this.$set(this.formData.affiliate[0].res, 'email', this.formZipData.affiliate[0]
  673. .res.email);
  674. }
  675. uni.hideLoading();
  676. },
  677. fail: (err) => {
  678. uni.showToast({
  679. title: '上传失败',
  680. icon: 'none',
  681. duration: 1000
  682. })
  683. uni.hideLoading()
  684. }
  685. })
  686. },
  687. // 文件上传
  688. select(e) {
  689. this.tempFilePaths = e.tempFilePaths;
  690. // loading
  691. uni.showLoading({
  692. title: '上传中'
  693. });
  694. uni.uploadFile({
  695. url: config.baseUrlTJ + "/common/upload",
  696. filePath: this.tempFilePaths[0],
  697. header: {
  698. Authorization: getToken() || '',
  699. },
  700. formData: {
  701. annexType: 2,
  702. id: this.formData.id
  703. },
  704. name: 'file',
  705. success: (res) => {
  706. let result = JSON.parse(res.data)
  707. this.formData.caseAttachList.push({
  708. annexId: result.annexId,
  709. annexName: result.fileName
  710. });
  711. console.log(result.fileName)
  712. uni.showToast({
  713. title: '上传成功',
  714. icon: 'none',
  715. duration: 1000
  716. })
  717. uni.hideLoading();
  718. },
  719. fail: (err) => {
  720. uni.showToast({
  721. title: '上传失败',
  722. icon: 'none',
  723. duration: 1000
  724. })
  725. uni.hideLoading()
  726. }
  727. })
  728. },
  729. cencalBut() {
  730. uni.navigateBack({
  731. delta: 1
  732. })
  733. },
  734. // 改变证件类型
  735. changeDocment(e){
  736. console.log(e)
  737. },
  738. //改变地区类型
  739. changeArea(e){
  740. if(e==0){
  741. this.testVerify = true
  742. this.rulesRespondentPhone[0].required = true;
  743. }else if(e==1){
  744. this.testVerify = false
  745. this.rulesRespondentPhone[0].required = false;
  746. }
  747. },
  748. // 获取证件类型
  749. getIdType(){
  750. idType().then(res =>{
  751. console.log(res)
  752. res.data.forEach(item =>{
  753. this.certificate.push({value:item.dictSort,text:item.dictLabel})
  754. })
  755. })
  756. },
  757. // 新增多个申请代理人
  758. addMultiple(){
  759. this.delShow =true
  760. this.formData.affiliate.push({
  761. applicant:{
  762. roleType: 1,
  763. name: "",
  764. idCard: "",
  765. code: "",
  766. phone: "",
  767. compLegalPerson: "",
  768. email: "",
  769. home: "",
  770. address: "",
  771. idType: 0,
  772. nationality: 0,
  773. birth: "",
  774. sex: "",
  775. group_order: 1,
  776. operatorFlag:1
  777. },
  778. applicantAgent: {
  779. roleType: 2,
  780. name: "",
  781. idCard: "",
  782. code: "",
  783. phone: "",
  784. compLegalPerson: "",
  785. email: "",
  786. home: "",
  787. address: "",
  788. idType: 0,
  789. nationality: 1,
  790. birth: "",
  791. sex: "",
  792. group_order: 1,
  793. operatorFlag:1
  794. },
  795. res:{
  796. roleTyp: 3,
  797. name: "",
  798. idCard: "",
  799. code: "",
  800. phone: "",
  801. compLegalPerson: "",
  802. email: "",
  803. home: "",
  804. address: "",
  805. idType: 0,
  806. nationality: 1,
  807. birth: "",
  808. sex: "0",
  809. group_order: 1,
  810. operatorFlag:1
  811. },
  812. resAgent: {
  813. roleType: 4,
  814. name: "",
  815. idCard: "",
  816. code: "",
  817. phone: "",
  818. compLegalPerson: "",
  819. email: "",
  820. home: "",
  821. address: "",
  822. idType: 0,
  823. nationality: 1,
  824. birth: "",
  825. sex: "",
  826. group_order: 1,
  827. operatorFlag:1
  828. }
  829. })
  830. let idnexVal = ""
  831. this.formData.affiliate.forEach((item,index)=>{
  832. idnexVal = index
  833. })
  834. getUserInfo().then(res => {
  835. this.getUserInfoList = res.data
  836. if (this.formData.organizeFlag == 0) {
  837. this.$set(this.formData.affiliate[idnexVal].applicant, 'name', res.data.nickName)
  838. this.$set(this.formData.affiliate[idnexVal].applicant, 'idCard', res.data.idCard)
  839. this.$set(this.formData.affiliate[idnexVal].applicant, 'email', res.data.email)
  840. this.$set(this.formData.affiliate[idnexVal].applicant, 'phone', res.data.phonenumber)
  841. this.$set(this.formData.affiliate[idnexVal].applicant, 'idType', res.data.idType)
  842. this.$set(this.formData.affiliate[idnexVal].applicant, 'nationality', res.data.nationality)
  843. } else if (this.formData.organizeFlag == 1) {
  844. this.$set(this.formData.affiliate[idnexVal].applicantAgent, 'name', res.data.nickName)
  845. this.$set(this.formData.affiliate[idnexVal].applicantAgent, 'email', res.data.email)
  846. this.$set(this.formData.affiliate[idnexVal].applicantAgent, 'phone', res.data.phonenumber)
  847. this.$set(this.formData.affiliate[idnexVal].applicantAgent, 'nationality', res.data.nationality)
  848. }
  849. })
  850. },
  851. //删除新增的多个申请代理人
  852. delValue(id){
  853. let index = this.formData.affiliate.findIndex(v => v.id === id)
  854. this.formData.affiliate.splice(index, 1)
  855. }
  856. },
  857. onLoad(data) {
  858. this.ids = data.id
  859. if (this.ids) {
  860. this.caseApplicationSelectByIdFn({
  861. id: data.id
  862. })
  863. uni.setNavigationBarTitle({
  864. title: "案件修改"
  865. })
  866. } else {
  867. uni.setNavigationBarTitle({
  868. title: "案件新增"
  869. })
  870. }
  871. if(this.formData.affiliate.nationality == 0){
  872. this.testVerify = true
  873. this.rulesRespondentPhone[0].required = true;
  874. }else if(this.formData.affiliate.idType==1){
  875. this.testVerify = false
  876. this.rulesRespondentPhone[0].required = false;
  877. }
  878. this.getTemplateFn()
  879. this.getUserInfoNumber()
  880. this.getIdType() //获取证件类型
  881. },
  882. onReady() {
  883. this.$refs.form.setRules(this.rules)
  884. }
  885. }
  886. </script>
  887. <style lang="scss">
  888. page {
  889. background-color: #ffffff;
  890. }
  891. .assignrbitrators {
  892. margin: 30rpx;
  893. }
  894. ::v-deep .uni-icons[data-v-a2e81f6e]{
  895. display: none;
  896. }
  897. </style>