移动端
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1332 рядки
53 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="goBack"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">修改银行卡转账申请</p>
  11. </template>
  12. <template #right>
  13. <van-icon name="../../../static/images/icon/icon_flow.png" size="20" @click="goFlow"/>
  14. </template>
  15. </van-nav-bar>
  16. <van-form @submit="getChange" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  17. <p class="main_title">基础信息</p>
  18. <div class="main_box">
  19. <van-field
  20. readonly
  21. clickable
  22. required
  23. :rules="[{ required: true , message:'请选择申请时间' }]"
  24. v-model="form.applyDate"
  25. label="申请时间"
  26. placeholder="请选择申请时间"
  27. @click="showlasj = true"
  28. input-align="right"
  29. right-icon="arrow-down"
  30. />
  31. <van-popup v-model="showlasj" position="bottom">
  32. <van-datetime-picker
  33. v-model="currentDate"
  34. type="date"
  35. title="选择年月日"
  36. :min-date="minDate"
  37. :max-date="maxDate"
  38. @confirm="onConfirmLasj"
  39. @cancel="showlasj = false"
  40. />
  41. </van-popup>
  42. <van-field
  43. readonly
  44. clickable
  45. required
  46. :rules="[{ required: true , message:'请选择资金支出类别' }]"
  47. label="资金支出类别"
  48. placeholder="请选择"
  49. v-model="capitalExpenditureType"
  50. @click="showcapital = true"
  51. input-align="right"
  52. right-icon="arrow-down"
  53. label-width="auto"
  54. />
  55. <van-popup v-model="showcapital" position="bottom">
  56. <van-picker
  57. show-toolbar
  58. :columns="capitalExpenditureTypeOptions"
  59. @confirm="onConfirmCapital"
  60. @cancel="showcapital = false"
  61. />
  62. </van-popup>
  63. <van-field
  64. readonly
  65. required
  66. label="支出总金额"
  67. v-model="form.expenditureAmount"
  68. placeholder="根据下方收款金额自动核算"
  69. input-align="right"
  70. label-width="auto"
  71. />
  72. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
  73. :rules="[{ required: true , message:'请选择审批模式' }]">
  74. <template #input>
  75. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  76. <van-radio name="1">线上审批</van-radio>
  77. <van-radio name="2">线下审批</van-radio>
  78. </van-radio-group>
  79. </template>
  80. </van-field>
  81. <van-field
  82. v-if="form.approvalMode==1"
  83. readonly
  84. clickable
  85. label="审批流程"
  86. placeholder="请选择"
  87. v-model="form.approvalTemplateName"
  88. @click="showtemplate = true"
  89. input-align="right"
  90. right-icon="arrow-down"
  91. required
  92. :rules="[{ required: true , message:'请选择项目流程' }]"
  93. />
  94. <van-popup v-model="showtemplate" position="bottom">
  95. <van-picker
  96. show-toolbar
  97. value-key="name"
  98. :columns="templateList"
  99. @confirm="onConfirmTemplate"
  100. @cancel="showtemplate = false"
  101. />
  102. </van-popup>
  103. </div>
  104. <div class="main_box" style="margin-top: 10px;">
  105. <van-field
  106. label="转账附言"
  107. v-model="form.remark"
  108. type="textarea"
  109. placeholder="附言请尽量简洁并减少标点符号的使用,详情可在‘说明情况’中描述。"
  110. input-align="right"
  111. rows="3"
  112. label-width="auto"
  113. maxlength="10"
  114. required
  115. show-word-limit
  116. v-if="form.bankType == '5'"
  117. :rules="[{ required: true , message:'请输入转账附言' }]"
  118. />
  119. <van-field
  120. label="转账附言"
  121. v-model="form.remark"
  122. type="textarea"
  123. placeholder="附言请尽量简洁并减少标点符号的使用,详情可在‘说明情况’中描述。"
  124. input-align="right"
  125. rows="3"
  126. label-width="auto"
  127. maxlength="20"
  128. required
  129. show-word-limit
  130. v-if="form.bankType == '6'"
  131. :rules="[{ required: true , message:'请输入转账附言' }]"
  132. />
  133. <van-field
  134. label="转账附言"
  135. v-model="form.remark"
  136. type="textarea"
  137. placeholder="附言请尽量简洁并减少标点符号的使用,详情可在‘说明情况’中描述。"
  138. input-align="right"
  139. rows="3"
  140. label-width="auto"
  141. maxlength="30"
  142. required
  143. show-word-limit
  144. v-if="form.bankType != '5' && form.bankType != '6'"
  145. :rules="[{ required: true , message:'请输入转账附言' }]"
  146. />
  147. </div>
  148. <div class="main_box" style="margin-top: 10px;">
  149. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  150. </div>
  151. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  152. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  153. <van-field
  154. readonly
  155. clickable
  156. label="项目名称"
  157. placeholder="请选择"
  158. v-model="projectForm.projectName"
  159. @click="showproject = true"
  160. input-align="right"
  161. right-icon="arrow-down"
  162. required
  163. :rules="[{ required: true , message:'请选择项目名称' }]"
  164. />
  165. <van-popup v-model="showproject" position="bottom">
  166. <van-picker
  167. show-toolbar
  168. :columns="projectList"
  169. @confirm="onConfirmProject"
  170. @cancel="showproject = false"
  171. />
  172. </van-popup>
  173. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  174. <van-field required :rules="[{ required: true , message:'请输入合同价款(元)' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  175. <van-field
  176. readonly
  177. clickable
  178. label="工程款类型"
  179. placeholder="请选择"
  180. v-model="projectFundType"
  181. @click="showFundType = true"
  182. input-align="right"
  183. right-icon="arrow-down"
  184. required
  185. :rules="[{ required: true , message:'请选择工程款类型' }]"
  186. />
  187. <van-popup v-model="showFundType" position="bottom">
  188. <van-picker
  189. show-toolbar
  190. :columns="projectFundTypeOptions"
  191. @confirm="onConfirmFundType"
  192. @cancel="showFundType = false"
  193. />
  194. </van-popup>
  195. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  196. </div>
  197. <p class="main_title" v-if="contractOpen">关联合同</p>
  198. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  199. <van-field
  200. readonly
  201. clickable
  202. label="合同"
  203. placeholder="请选择"
  204. v-model="infoForm.name"
  205. @click="showcontract = true"
  206. input-align="right"
  207. right-icon="arrow-down"
  208. required
  209. :rules="[{ required: true , message:'请选择项目名称' }]"
  210. />
  211. <van-popup v-model="showcontract" position="bottom">
  212. <van-picker
  213. show-toolbar
  214. :columns="infoList"
  215. @confirm="onConfirmContract"
  216. @cancel="showcontract = false"
  217. />
  218. </van-popup>
  219. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  220. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  221. </div>
  222. <p class="main_title">付款方信息</p>
  223. <div class="main_box">
  224. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  225. <van-field
  226. readonly
  227. clickable
  228. label="付款方"
  229. placeholder="请选择付款方"
  230. v-model="form.payer"
  231. @click="showpayer = true"
  232. input-align="right"
  233. right-icon="arrow-down"
  234. label-width="auto"
  235. required
  236. :rules="[{ required: true , message:'请选择付款方' }]"
  237. />
  238. <van-popup v-model="showpayer" position="bottom">
  239. <van-picker
  240. show-toolbar
  241. :columns="payerOptions"
  242. @confirm="onConfirmPayer($event)"
  243. @cancel="showpayer = false"
  244. />
  245. </van-popup>
  246. <van-field :rules="[{ required: true , message:'请输入账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  247. </div>
  248. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  249. <!-- <div class="main_title main_title_box">-->
  250. <!-- <p>收款方信息</p>-->
  251. <!-- <router-link :to="{name:'collectionApprovalAdd', params: {accountType:form.accountType,isPeers:form.isPeers,bankType:form.bankType,option:form}}">添加收款方</router-link>-->
  252. <!-- <van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/>-->
  253. <!-- </div>-->
  254. <div class="main_box" style="margin-bottom: 15px;">
  255. <van-cell title="收款账户类型" v-if="form.bankType==1">
  256. <template #right-icon>
  257. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange" >
  258. <van-radio name="1">公户</van-radio>
  259. <van-radio name="2">私户</van-radio>
  260. </van-radio-group>
  261. </template>
  262. </van-cell>
  263. <van-cell title="行内转账" v-if="form.bankType==2||form.bankType==3||form.bankType==4" >
  264. <template #right-icon>
  265. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  266. <van-radio name="Y">是</van-radio>
  267. <van-radio name="N">否</van-radio>
  268. </van-radio-group>
  269. </template>
  270. </van-cell>
  271. </div>
  272. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  273. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  274. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  275. <van-field
  276. readonly
  277. clickable
  278. label="收款方"
  279. placeholder="请选择"
  280. v-model="item.payee"
  281. @click="item.showPayee = true"
  282. input-align="right"
  283. right-icon="arrow-down"
  284. required
  285. :rules="[{ required: true , message:'请选择收款方' }]"
  286. />
  287. <van-popup v-model="item.showPayee" position="bottom">
  288. <van-picker
  289. show-toolbar
  290. :columns="payeeList"
  291. @confirm="onConfirmPayee($event,index)"
  292. @cancel="item.showPayee = false"
  293. />
  294. </van-popup>
  295. <van-field required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  296. <van-field required :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入银行" input-align="right" label-width="auto"/>
  297. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  298. <van-field
  299. readonly
  300. clickable
  301. label="所属银行"
  302. placeholder="请选择"
  303. v-model="item.bankTypeText"
  304. input-align="right"
  305. required
  306. :rules="[{ required: true , message:'请选择所属银行' }]"
  307. />
  308. <van-popup v-model="item.showbankType" position="bottom">
  309. <van-picker
  310. show-toolbar
  311. :columns="bankTypeDictionaries"
  312. @confirm="onConfirmBankType($event,index)"
  313. @cancel="item.showbankType = false"
  314. />
  315. </van-popup>
  316. </div>
  317. </div>
  318. <p class="main_title" style="margin: 0.2rem 3%;">上传附件<i style="margin-right: 0.5em;"></i><span style="font-size: 12px;color: red;">(若申请单未变动可不必点击底部的修改按钮)</span></p>
  319. <div class="main_box" style="padding: 5px 0 0 0;">
  320. <van-cell value="收据" />
  321. <van-uploader v-model="fileList1" :after-read="beforeRead('1')" @delete="deleteFile" @click-preview="previewPreview" style="margin-left:8px;">
  322. <template #preview-cover="file">
  323. <div class="preview-cover">
  324. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  325. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  326. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  327. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  328. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  329. </div>
  330. </template>
  331. </van-uploader>
  332. <van-cell title="发票" />
  333. <van-uploader v-model="fileList2" :after-read="beforeRead('2')" @delete="deleteFile" @click-preview="previewPreview" style="margin-left:8px;">
  334. <template #preview-cover="file">
  335. <div class="preview-cover">
  336. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  337. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  338. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  339. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  340. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  341. </div>
  342. </template>
  343. </van-uploader>
  344. <van-cell title="其他" />
  345. <van-uploader v-model="fileList3" :after-read="beforeRead('3')" @delete="deleteFile" @click-preview="previewPreview" style="margin-left:8px;">
  346. <template #preview-cover="file">
  347. <div class="preview-cover">
  348. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  349. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  350. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  351. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  352. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  353. </div>
  354. </template>
  355. </van-uploader>
  356. </div>
  357. <div style="padding: 16px 0;">
  358. <van-row>
  359. <van-col span="12" align="center">
  360. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">修<i style="margin-right: 1em;"></i>改</van-button>
  361. </van-col>
  362. <van-col span="12" align="center">
  363. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">提<i style="margin-right: 1em;"></i>交</van-button>
  364. </van-col>
  365. </van-row>
  366. <div class="clear"></div>
  367. </div>
  368. </van-form>
  369. </div>
  370. </template>
  371. <script>
  372. import { getAccount , getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto ,
  373. customSubmit ,offlineCustomSubmit, getQmyeFlow ,listInfo ,getInfoto ,addInfoto,listTemplate,selectApprovalByTemplateId} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  374. import {
  375. attachmentList,
  376. commonAttach,
  377. systemAttachment
  378. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  379. import request from '@/utils/request';
  380. import Dialog from "vant/lib/dialog";
  381. export default {
  382. name: "approvalModify",
  383. data() {
  384. return {
  385. showtemplate:false,
  386. showcontract:false,
  387. showcapital:false,
  388. showpayee:false,
  389. showlasj:false,
  390. showbankType:false,
  391. showproject:false,
  392. showFundType:false,
  393. showpayer:false,
  394. minDate: new Date(2000, 1, 1),
  395. maxDate: new Date(2050, 12, 31),
  396. currentDate: new Date(),
  397. form:{},
  398. capitalExpenditureType:'',
  399. payee:'',
  400. bankType:'',
  401. buttonType:'a',
  402. wfydlxDictionaries:[],
  403. jglxDictionaries:[],
  404. sysDictionaries:[],
  405. capitalExpenditureTypeOptions:[],
  406. bankTypeDictionaries:[],
  407. infoList:[],
  408. projectList:[],
  409. projectFundTypeOptions:[],
  410. projectFundTypeDictionaries:[],
  411. payerOptions:[],
  412. chargeItme:[],
  413. chargeItmeShow:[],
  414. payeeList:[],
  415. // 查询参数
  416. queryParams: {
  417. transferType:"",
  418. orderByColumn: "id",
  419. isAsc: "desc",
  420. },
  421. capitalExpenditureOpen:false,
  422. contractOpen:false,
  423. projectForm:{
  424. projectId:null,
  425. projectName:null,
  426. projectContractor:null,
  427. projectAmount:null,
  428. projectBillNum:null,
  429. projectFundType:'1',
  430. outId:null,
  431. ynType:'1'
  432. },
  433. infoForm:{
  434. infoId:null,
  435. name:null,
  436. code:null,
  437. totalAmount:null,
  438. contractionId:null,
  439. transferId:null
  440. },
  441. // 合同信息查询参数
  442. queryContractionParams: {
  443. pageNum: 1,
  444. pageSize: 100,
  445. contractionStatus: '1',
  446. orderByColumn: "endTime",
  447. isAsc: "desc",
  448. },
  449. projectFundType:'',
  450. fileList1:[],
  451. fileList2:[],
  452. fileList3:[],
  453. uploadFiles1:[],
  454. uploadFiles2:[],
  455. uploadFiles3:[],
  456. templateList:[],
  457. };
  458. },
  459. created() {
  460. let queryParams={
  461. pageNum: 1,
  462. pageSize: 100,
  463. }
  464. listProject(queryParams).then(response => {
  465. this.projectList = response.rows;
  466. for (let i = 0; i < response.rows.length; i++) {
  467. this.$set(this.projectList[i],"text",response.rows[i].projectName)
  468. this.$set(this.projectList[i],"value",response.rows[i].id)
  469. }
  470. });
  471. listInfo(this.queryContractionParams).then(response => {
  472. this.infoList = response.rows;
  473. for (let i = 0; i < response.rows.length; i++) {
  474. this.$set(this.infoList[i],"text",response.rows[i].name)
  475. this.$set(this.infoList[i],"value",response.rows[i].code)
  476. }
  477. });
  478. this.getDicts("project_fund_type").then((response) => {
  479. for (var i = 0; i < response.data.length; i++) {
  480. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  481. }
  482. this.projectFundTypeDictionaries = response.data;
  483. });
  484. let params1={
  485. accountType: "102",
  486. // "params":{townAccountType:'0'},
  487. status: "N",
  488. }
  489. getAccount(params1).then((response) => {
  490. this.payerOptions = response.rows;
  491. response.rows.map((res,index) => {
  492. res['payerFrom'] = '1'
  493. this.payerOptions[index].text = res.accountName;
  494. this.payerOptions[index].value = res.id;
  495. })
  496. });
  497. this.getDictionaries();
  498. this.getFileList();
  499. },
  500. methods: {
  501. goFlow(){
  502. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  503. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  504. }else{
  505. this.$notify({ type: 'danger', message: '无审批流程!' });
  506. }
  507. },
  508. onConfirmTemplate(data){
  509. selectApprovalByTemplateId(data.id).then(res => {
  510. this.showtemplate = false;
  511. if(res.approvalDetails.length>0){
  512. this.form.approvalTemplateName = data.name
  513. this.form.approvalTemplateId = data.id
  514. }else{
  515. this.form.approvalTemplateName = null
  516. this.form.approvalTemplateId = null
  517. this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
  518. }
  519. })
  520. },
  521. getDictionaries(){
  522. getTransfer(this.$route.query.id).then((response) => {
  523. this.getDicts("capital_expenditure_type").then((res) => {
  524. for (var i = 0; i < res.data.length; i++) {
  525. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  526. }
  527. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  528. });
  529. if(response.data.capitalExpenditureType==2){
  530. this.capitalExpenditureOpen = true
  531. let param={
  532. 'outId' : response.data.id,
  533. 'ynType' : '1'
  534. }
  535. getProjectto(param).then(res => {
  536. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  537. this.projectForm = res.data
  538. })
  539. }else if(response.data.capitalExpenditureType==4){
  540. this.contractOpen = true
  541. let param={
  542. 'transferId' : response.data.id
  543. }
  544. getInfoto(param).then(res => {
  545. this.infoForm = res.data
  546. })
  547. }else{
  548. this.showproject = false
  549. }
  550. this.form = response.data;
  551. this.getPayeeList();
  552. let _this = this
  553. let templateQueryParams = {
  554. // 分页
  555. pageNum: 1,
  556. pageSize: 999,
  557. type:'1'
  558. };
  559. listTemplate(templateQueryParams).then(rrr => {
  560. this.templateList = rrr.rows;
  561. this.templateList.map(ra => {
  562. if(ra.id == response.data.approvalTemplateId){
  563. _this.form.approvalTemplateName = ra.name
  564. }
  565. })
  566. });
  567. });
  568. queryTransferDetail(this.$route.query.id).then((response) => {
  569. this.getDicts("bank_type_all").then(res => {
  570. for (var i = 0; i < res.data.length; i++) {
  571. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  572. }
  573. for (var j = 0 ; j < response.rows.length ; j++){
  574. // response.rows[j].payeeText = response.rows[j].payee;
  575. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  576. response.rows[j].showPayee = false;
  577. }
  578. this.chargeItme = response.rows;
  579. console.log(this.chargeItme)
  580. });
  581. });
  582. },
  583. getChange(){
  584. if(this.buttonType == 'update'){
  585. this.goUpdate();
  586. }else if(this.buttonType == 'add'){
  587. this.goAdd();
  588. }
  589. },
  590. getError(e){
  591. this.$notify({ type: 'danger', message: e.errors[0].message });
  592. },
  593. addChargeItme(index){
  594. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  595. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  596. return;
  597. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  598. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  599. return;
  600. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  601. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  602. return;
  603. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  604. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  605. return;
  606. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  607. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  608. return;
  609. }
  610. // if(this.form.bankType == '2' && this.form.isPeers == 'N' && this.chargeItme.length==1){
  611. // this.$notify({ type: 'danger', message: '目前农商行仅支持单笔跨行转账,即仅能有一个收款方!' });
  612. // }else
  613. if(this.form.bankType == '7' && this.chargeItme.length==1){
  614. this.$notify({ type: 'danger', message: '目前农商行仅支持单笔转账,即仅能有一个收款方!' });
  615. }else{
  616. this.getDicts("bank_type_all").then(res => {
  617. this.chargeItme.splice(index + 1, 0, {
  618. payeeId: "", //收款方ID
  619. payee: "", //收款方
  620. payeeAccount: "", //收款账户
  621. bankDeposit: "", //开户银行
  622. incomeAmount: "", //收入金额
  623. bankType: null, //所属银行
  624. bankTypeText:"", //所属银行
  625. showPayee:false,
  626. showbankType:false
  627. });
  628. });}
  629. },
  630. getPayeeList() {
  631. //普通转账
  632. this.queryParams.isPeers = this.form.isPeers?this.form.isPeers:null
  633. this.queryParams.accountType = this.form.accountType?this.form.accountType:null
  634. this.queryParams.bankType = this.form.bankType
  635. this.queryParams.status = "0"
  636. listPayee(this.queryParams).then((response) => {
  637. response.rows.map((res,index) => {
  638. if(res.payeeType==1||res.payeeType==2){
  639. res.text = res.payee;
  640. res.value = res.id;
  641. this.payeeList.push(res)
  642. }
  643. })
  644. });
  645. },
  646. payeeDictLabel(datas, value) {
  647. var actions = [];
  648. Object.keys(datas).some((key) => {
  649. if (datas[key].payeeId == ('' + value)) {
  650. actions.push(datas[key].payee);
  651. return true;
  652. }
  653. })
  654. return actions.join('');
  655. },
  656. onConfirmCapital(data){
  657. if (data.value == 2){
  658. this.capitalExpenditureOpen = true;
  659. this.contractOpen = false
  660. this.infoForm = {};
  661. }else if(data.value == 4){
  662. this.capitalExpenditureOpen = false;
  663. this.contractOpen = true
  664. this.projectForm = {};
  665. }else{
  666. this.capitalExpenditureOpen = false;
  667. this.contractOpen = false
  668. this.projectForm = {};
  669. this.infoForm = {};
  670. }
  671. this.capitalExpenditureType = data.text;
  672. this.form.capitalExpenditureType = data.value;
  673. this.showcapital = false;
  674. },
  675. onConfirmFundType(data){
  676. console.log(data)
  677. this.projectForm.projectFundType = data.value;
  678. this.projectFundType = data.text;
  679. this.showFundType = false;
  680. },
  681. onConfirmProject(data){
  682. this.projectList.map(res => {
  683. if(res.projectName==data.text){
  684. this.projectForm.projectId = res.id
  685. this.projectForm.projectName = res.projectName
  686. this.projectForm.projectContractor = res.projectContractor
  687. this.projectForm.projectAmount = res.projectAmount
  688. }
  689. })
  690. this.showproject = false;
  691. },
  692. onConfirmContract(data){
  693. this.infoList.map(res => {
  694. if(res.name==data.text){
  695. this.infoForm.contractionId = res.id;
  696. this.infoForm.name = res.name;
  697. this.infoForm.code = res.code;
  698. this.infoForm.totalAmount = res.totalAmount;
  699. }
  700. })
  701. this.showcontract = false;
  702. },
  703. onConfirmPayee(data,index){
  704. console.log(data)
  705. for (var i = 0 ; i < this.chargeItme.length ; i++){
  706. this.chargeItme[i].showPayee = false;
  707. }
  708. this.chargeItme[index].payee = data.text;
  709. this.chargeItme[index].payeeId = data.value;
  710. this.payeeSelectChange(data.value , index)
  711. },
  712. onConfirmBankType(data,index){
  713. for (var i = 0 ; i < this.chargeItme.length ; i++){
  714. this.chargeItme[i].showbankType = false;
  715. }
  716. this.chargeItme[index].bankTypeText = data.text;
  717. this.chargeItme[index].bankType = data.value;
  718. this.chargeItme[index].showbankType = false;
  719. },
  720. onConfirmPayer(data){
  721. this.form.payer = data.text;
  722. this.form.cashierId = data.value;
  723. this.showpayer = false;
  724. this.selectChange(data.value)
  725. },
  726. onConfirmLasj(data){
  727. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  728. this.showlasj = false;
  729. },
  730. accountTypeChange(e){
  731. this.payeeList = [];
  732. this.chargeItme = [];
  733. this.queryParams.accountType = this.form.accountType
  734. this.queryParams.isPeers = this.form.isPeers
  735. this.queryParams.bankType = this.form.bankType
  736. this.queryParams.status = "0"
  737. listPayee(this.queryParams).then((response) => {
  738. response.rows.map((res,index) => {
  739. if(res.payeeType==1||res.payeeType==2){
  740. response.rows[index].text = res.payee;
  741. response.rows[index].value = res.id;
  742. this.payeeList.push(res)
  743. }
  744. })
  745. });
  746. },
  747. accountTypeChange1(e){
  748. this.payeeList = [];
  749. this.chargeItme = [];
  750. this.queryParams.accountType = this.form.accountType
  751. this.queryParams.isPeers = this.form.isPeers
  752. this.queryParams.bankType = this.form.bankType
  753. this.queryParams.status = "0"
  754. listPayee(this.queryParams).then((response) => {
  755. response.rows.map((res,index) => {
  756. if(res.payeeType==1||res.payeeType==2){
  757. response.rows[index].text = res.payee;
  758. response.rows[index].value = res.id;
  759. this.payeeList.push(res)
  760. }
  761. })
  762. });
  763. },
  764. // 钱计算
  765. moneyChange(input) {
  766. console.log(input)
  767. let obj = {};
  768. obj = this.chargeItme.find((account) => {
  769. //model就是上面的数据源
  770. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  771. });
  772. let total = 0;
  773. this.chargeItme.forEach((money) => {
  774. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  775. });
  776. this.$set(this.form, "expenditureAmount", total);
  777. },
  778. goAdd(){
  779. let _this = this
  780. if(this.chargeItme.length<1){
  781. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  782. return;
  783. }
  784. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  785. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  786. return;
  787. }
  788. if(this.form.capitalExpenditureType==2){
  789. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  790. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  791. return;
  792. }
  793. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  794. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  795. return;
  796. }
  797. }
  798. if(this.form.capitalExpenditureType==4){
  799. if(this.infoForm.name==""||this.infoForm.name==null){
  800. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  801. return;
  802. }
  803. if(this.infoForm.code==""||this.infoForm.code==null){
  804. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  805. return;
  806. }
  807. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  808. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  809. return;
  810. }
  811. }
  812. if(
  813. this.fileList1.length==0&&
  814. this.fileList2.length==0&&
  815. this.fileList3.length==0){
  816. Dialog.confirm({
  817. title: '提示',
  818. message: '此申请单中未上传任何附件,是否确认提交?',
  819. })
  820. .then(() => {
  821. this.saveRelease()
  822. })
  823. .catch(() => {
  824. return false;
  825. });
  826. }else{
  827. this.saveRelease()
  828. }
  829. },
  830. previewPreview(file, index, len) {
  831. const baseImgUrl = this.$store.getters.baseRoutingUrl;
  832. if (file.url) {
  833. //已上传文件
  834. let fileName = file.file.name || file.url;
  835. let subIndex = fileName.lastIndexOf(".");
  836. let ext = fileName.substring(subIndex + 1, fileName.length);
  837. let imgi = file.listIndex
  838. //console.log(ext)
  839. let allUrl = file.url;
  840. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  841. const link = document.createElement("a");
  842. link.style.display = "none";
  843. link.target = "_blank"
  844. link.href = allUrl;
  845. document.body.appendChild(link);
  846. link.click();
  847. document.body.removeChild(link);
  848. }
  849. } else {
  850. //新上传文件
  851. let fileName = file.file.name;
  852. // console.info(file.file.name)
  853. let subIndex = fileName.lastIndexOf(".");
  854. let ext = fileName.substring(subIndex + 1, fileName.length);
  855. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  856. let type = this.getfileType(ext);
  857. // 将文件转换为base64编码
  858. this.fileToBase64(file.file, ext).then(res => {
  859. this.downloadFile(res, fileName, ext, type);
  860. })
  861. }
  862. }
  863. },
  864. getfileType(type) {
  865. switch (type) {
  866. case 'txt':
  867. return 'text/plain';
  868. case 'doc':
  869. return 'application/msword';
  870. case 'docx':
  871. return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  872. case 'xls':
  873. return 'application/vnd.ms-excel';
  874. case 'xlsx':
  875. return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  876. case 'pdf':
  877. return 'application/pdf';
  878. case 'pptx':
  879. return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  880. case 'png':
  881. return 'image/png';
  882. case 'jpg':
  883. return 'image/jpeg';
  884. case 'gif':
  885. return 'image/gif';
  886. case 'svg':
  887. return 'image/svg+xml';
  888. case 'ico':
  889. return 'image/x-icon';
  890. case 'bmp':
  891. return 'image/bmp,';
  892. }
  893. },
  894. downloadFile(base64, fileName, fileType, mimetype) {
  895. const typeHeader = 'data:application/' + fileType + ';base64,';
  896. const blob = this.base64ToBlob(base64, mimetype);
  897. this.downloadFileDownload(blob, fileName, fileType);
  898. },
  899. base64ToBlob(base64, mime) {
  900. //解码base64得到二进制字符串
  901. let raw = window.atob(base64.substring(base64.indexOf(',') + 1));
  902. let rawLength = raw.length
  903. //创建8位无符号整数值的类型化数组
  904. let uInt8Array = new Uint8Array(rawLength)
  905. for (let i = 0; i < rawLength; ++i) {
  906. uInt8Array[i] = raw.charCodeAt(i);
  907. }
  908. return new Blob([uInt8Array], {type: mime})
  909. },
  910. downloadFileDownload(blob, fileName, fileType) {
  911. const downloadElement = document.createElement('a');
  912. let href = blob;
  913. if (typeof blob === 'string') {
  914. downloadElement.target = '_blank'
  915. } else {
  916. href = window.URL.createObjectURL(blob)
  917. }
  918. downloadElement.href = href;
  919. downloadElement.download = fileName + '.' + fileType;//下载后文件名
  920. document.body.appendChild(downloadElement);
  921. downloadElement.click();
  922. document.body.removeChild(downloadElement)
  923. if (typeof blob !== 'string') {
  924. window.URL.revokeObjectURL(href)
  925. }
  926. },
  927. fileToBase64(file,fileType){
  928. return new Promise((resolve,reject)=>{
  929. //创建一个新的FileReader 对象
  930. const reader = new FileReader();
  931. //读取file对象
  932. reader.readAsDataURL(file);
  933. reader.onload=function () {
  934. const base64String = reader.result.split(",")[1];
  935. resolve('data:application/' + fileType + ';base64,'+base64String);
  936. }
  937. reader.onerror=function () {
  938. reject(new Error("Failed to load file") )
  939. }
  940. })
  941. },
  942. saveRelease(){
  943. let _this = this;
  944. this.$set(this.form, "payeeList", this.chargeItme);
  945. this.$set(this.form, "bankTypeList", this.chargeItme);
  946. this.$set(this.form, "accountTypeList", this.chargeItme);
  947. this.$set(this.form, "transferStatusList", this.chargeItme);
  948. updateTransfer(this.form).then(response => {
  949. this.projectForm.outId = this.form.id
  950. this.infoForm.transferId = this.form.id
  951. this.$set(this.projectForm, "ynType", '1');
  952. if(this.form.capitalExpenditureType==2){
  953. addProjectto(this.projectForm).then(res => {
  954. offlineCustomSubmit(this.form.id).then(res => {
  955. this.$toast.success('提交成功');
  956. setTimeout(function(){
  957. _this.$router.push('/sunVillage_info/approvalList')
  958. },2000)
  959. })
  960. })
  961. }else if(this.form.capitalExpenditureType==4){
  962. addInfoto(this.infoForm).then(res => {
  963. offlineCustomSubmit(this.form.id).then(res => {
  964. this.$toast.success('提交成功');
  965. setTimeout(function(){
  966. _this.$router.push('/sunVillage_info/approvalList')
  967. },2000)
  968. })
  969. })
  970. }else{
  971. offlineCustomSubmit(this.form.id).then(res => {
  972. this.$toast.success('提交成功');
  973. setTimeout(function(){
  974. _this.$router.push('/sunVillage_info/approvalList')
  975. },2000)
  976. })
  977. }
  978. });
  979. },
  980. goUpdate(){
  981. let _this = this
  982. if(this.chargeItme.length<1){
  983. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  984. return;
  985. }
  986. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  987. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  988. return;
  989. }
  990. if(this.form.capitalExpenditureType==2){
  991. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  992. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  993. return;
  994. }
  995. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  996. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  997. return;
  998. }
  999. }
  1000. if(this.form.capitalExpenditureType==4){
  1001. if(this.infoForm.name==""||this.infoForm.name==null){
  1002. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1003. return;
  1004. }
  1005. if(this.infoForm.code==""||this.infoForm.code==null){
  1006. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1007. return;
  1008. }
  1009. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1010. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1011. return;
  1012. }
  1013. }
  1014. this.$set(this.form, "payeeList", this.chargeItme);
  1015. this.$set(this.form, "bankTypeList", this.chargeItme);
  1016. this.$set(this.form, "accountTypeList", this.chargeItme);
  1017. this.$set(this.form, "transferStatusList", this.chargeItme);
  1018. updateTransfer(this.form).then(response => {
  1019. this.projectForm.outId = this.form.id
  1020. this.infoForm.transferId = this.form.id
  1021. this.$set(this.projectForm, "ynType", '1');
  1022. if(this.form.capitalExpenditureType==2){
  1023. addProjectto(this.projectForm).then(res => {
  1024. this.$toast.success('保存成功');
  1025. setTimeout(function(){
  1026. _this.$router.push('/sunVillage_info/approvalList')
  1027. },2000)
  1028. })
  1029. } else if(this.form.capitalExpenditureType==4){
  1030. addInfoto(this.infoForm).then(res => {
  1031. this.$toast.success('保存成功');
  1032. setTimeout(function(){
  1033. _this.$router.push('/sunVillage_info/approvalList')
  1034. },2000)
  1035. })
  1036. }else{
  1037. this.$toast.success('保存成功');
  1038. setTimeout(function(){
  1039. _this.$router.push('/sunVillage_info/approvalList')
  1040. },2000)
  1041. }
  1042. });
  1043. },
  1044. payeeSelectChange(select, i) {
  1045. let obj = {};
  1046. let fuzhitype = 0;
  1047. let _this = this
  1048. obj = this.payeeList.find((account) => {
  1049. //model就是上面的数据源
  1050. return account.id === select ; //筛选出匹配数据
  1051. });
  1052. if(this.chargeItme != [] && this.chargeItme.length>1){
  1053. this.chargeItme.some((value, index) => {
  1054. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  1055. fuzhitype = 2;
  1056. return true;
  1057. }
  1058. if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
  1059. }else{
  1060. if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  1061. fuzhitype = 1;
  1062. return true;
  1063. }
  1064. }
  1065. });
  1066. }
  1067. if(fuzhitype == 0){
  1068. this.$set(this.chargeItme[i], "payee",obj.payee)
  1069. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  1070. this.$set(this.chargeItme[i], "payeeId", obj.id);
  1071. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  1072. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  1073. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  1074. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  1075. _this.bankTypeDictionaries.map(rr => {
  1076. if(rr.value==obj.bankType){
  1077. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  1078. }
  1079. })
  1080. }else if(fuzhitype == 1){
  1081. this.$set(this.chargeItme[i], "payee",'')
  1082. this.$set(this.chargeItme[i], "bankType",'')
  1083. this.$set(this.chargeItme[i], "payeeId", '');
  1084. this.$set(this.chargeItme[i], "payeeAccount", '');
  1085. this.$set(this.chargeItme[i], "bankDeposit", '');
  1086. this.$set(this.chargeItme[i], "accountType", '');
  1087. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1088. this.$set(this.chargeItme[i], "bankTypeText", '');
  1089. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  1090. }else if(fuzhitype == 2){
  1091. this.$set(this.chargeItme[i], "payee",'')
  1092. this.$set(this.chargeItme[i], "bankType",'')
  1093. this.$set(this.chargeItme[i], "payeeId", '');
  1094. this.$set(this.chargeItme[i], "payeeAccount", '');
  1095. this.$set(this.chargeItme[i], "bankDeposit", '');
  1096. this.$set(this.chargeItme[i], "accountType", '');
  1097. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1098. this.$set(this.chargeItme[i], "bankTypeText", '');
  1099. this.$notify({ type: 'danger', message: '收款方已存在!' });
  1100. }
  1101. },
  1102. selectChange(select) {
  1103. let obj = {};
  1104. obj = this.payerOptions.find((account) => {
  1105. //model就是上面的数据源
  1106. return account.id === select; //筛选出匹配数据
  1107. });
  1108. if(obj.accountPassword != null && obj.accountPassword != "" &&
  1109. obj.bankType != null && obj.bankType != ""){
  1110. this.$set(this.form, "bookId", obj.bookId);
  1111. this.$set(this.form, "deptId", obj.deptId);
  1112. this.$set(this.form, "cashierId", obj.id);
  1113. this.$set(this.form, "payer", obj.accountName);
  1114. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1115. this.$set(this.form, "operatorCode", obj.operatorCode);
  1116. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1117. this.$set(this.form, "bankType", obj.bankType);
  1118. this.$set(this.form, "payerFrom", '1');
  1119. console.log(obj.bankType)
  1120. if(obj.bankType==1){
  1121. this.form.accountType = "1"
  1122. this.form.isPeers = null
  1123. this.accountTypeChange();
  1124. }else if(obj.bankType==2||obj.bankType==4){
  1125. this.form.accountType = null
  1126. this.form.isPeers = "Y"
  1127. this.accountTypeChange1();
  1128. }
  1129. }else{
  1130. if(obj.payerFrom==1){
  1131. this.diglogStatus = false;
  1132. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1133. this.$set(this.form,"payer","")
  1134. this.$set(this.form,"payerAccount","")
  1135. }else{
  1136. this.$set(this.form, "payerFrom", obj.parerFrom);
  1137. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1138. this.$set(this.form, "operatorCode", obj.operatorCode);
  1139. }else{
  1140. this.$set(this.form, "operatorCode", '');
  1141. }
  1142. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1143. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1144. }else{
  1145. this.$set(this.form, "enterpriseCode", '');
  1146. }
  1147. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1148. this.$set(this.form, "accountPassword", obj.accountPassword);
  1149. }else{
  1150. this.$set(this.form, "accountPassword", '');
  1151. }
  1152. this.$set(this.form, "bookId",'');
  1153. this.$set(this.form, "deptId", '');
  1154. this.$set(this.form, "cashierId", obj.id);
  1155. this.$set(this.form, "payer", obj.accountName);
  1156. if(obj.payerFrom==6){
  1157. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1158. this.$set(this.form, "payerAccount", response.data);
  1159. });
  1160. }else {
  1161. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1162. }
  1163. }
  1164. }
  1165. },
  1166. beforeRead(obj) {
  1167. return (file) =>{
  1168. let params1 = new FormData();
  1169. params1.append("tableId", this.form.id);
  1170. params1.append("tableName", "t_yinnong_transfer");
  1171. params1.append("bizPath", "transfer");
  1172. params1.append("fileType", obj);
  1173. params1.append("file", file.file);
  1174. commonAttach(params1).then((r1) => {
  1175. file.id=r1.id;
  1176. file.fileUrl = r1.fileUrl;
  1177. let subIndex = r1.fileUrl.lastIndexOf(".");
  1178. let ext = r1.fileUrl.substring(subIndex + 1, r1.fileUrl.length);
  1179. let baseUrl = location.protocol + "//" + location.host + request.defaults.baseURL;
  1180. let fileData = {"url": baseUrl + r1.fileUrl, "file": new File([], "name", {}), "id": r1.id,"type":ext};
  1181. if(obj === '1'){
  1182. this.fileList1.splice(-1, 1);
  1183. this.fileList1.push(fileData);
  1184. }else if(obj === '2'){
  1185. this.fileList2.splice(-1, 1);
  1186. this.fileList2.push(fileData);
  1187. }else{
  1188. this.fileList3.splice(-1, 1);
  1189. this.fileList3.push(fileData);
  1190. }
  1191. })
  1192. }
  1193. },
  1194. deleteFile(file){
  1195. systemAttachment(file.id).then((res) => {});
  1196. },
  1197. getFileList(){
  1198. let oData1= {
  1199. tableId: this.$route.query.id,
  1200. tableName: "t_yinnong_transfer",
  1201. bizPath: "transfer",
  1202. fileType: "1",
  1203. }
  1204. attachmentList(oData1).then(res => {
  1205. res.rows.map(r => {
  1206. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1207. let subIndex = r.fileName.lastIndexOf(".");
  1208. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1209. this.fileList1.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1210. })
  1211. })
  1212. let oData2= {
  1213. tableId: this.$route.query.id,
  1214. tableName: "t_yinnong_transfer",
  1215. bizPath: "transfer",
  1216. fileType: "2",
  1217. }
  1218. attachmentList(oData2).then(res => {
  1219. res.rows.map(r => {
  1220. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1221. let subIndex = r.fileName.lastIndexOf(".");
  1222. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1223. this.fileList2.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1224. })
  1225. })
  1226. let oData3= {
  1227. tableId: this.$route.query.id,
  1228. tableName: "t_yinnong_transfer",
  1229. bizPath: "transfer",
  1230. fileType: "3",
  1231. }
  1232. attachmentList(oData3).then(res => {
  1233. res.rows.map(r => {
  1234. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1235. let subIndex = r.fileName.lastIndexOf(".");
  1236. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1237. this.fileList3.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1238. })
  1239. })
  1240. },
  1241. goBack(){
  1242. this.$router.push({path:'/sunVillage_info/approvalList'})
  1243. },
  1244. //删除家庭成员
  1245. deleteChargeItme(index){
  1246. this.chargeItme.splice(index,1)
  1247. },
  1248. },
  1249. watch: {
  1250. $route (to, from ) {
  1251. // 监听路由变化, 实现类似 小程序的 onShow 事件
  1252. if (to.path === '/yinnong/approvalModify') {
  1253. // do anything you want
  1254. console.log("aaa")
  1255. if (this.$route.params.payeeForm){
  1256. this.chargeItme.push(this.$route.params.payeeForm)
  1257. console.log(this.$route.params.payeeForm)
  1258. }
  1259. }
  1260. }
  1261. },
  1262. }
  1263. </script>
  1264. <style scoped lang="scss">
  1265. .app-container {
  1266. padding: 2% 0;
  1267. }
  1268. .main_title_box{
  1269. display: flex;
  1270. justify-content: space-between;
  1271. align-items: center;
  1272. }
  1273. .main_title{
  1274. font-size: 0.4rem;
  1275. color: #1D6FE9;
  1276. margin: 0.2rem 6%;
  1277. position: relative;
  1278. /*a{*/
  1279. /* background: #1989fa;*/
  1280. /* color: #ffffff;*/
  1281. /* padding: 0.05rem 0.3rem;*/
  1282. /* border-radius: 5PX;*/
  1283. /*}*/
  1284. }
  1285. .main_box{
  1286. width: 96%;
  1287. margin: 0 auto;
  1288. border-radius: 6px;
  1289. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1290. overflow: hidden;
  1291. background-color: #FFF;
  1292. }
  1293. .submitButton{
  1294. width: 80%;
  1295. margin: 0 auto;
  1296. background-color: #1D6FE9;
  1297. }
  1298. .addFamily{
  1299. position: absolute;
  1300. top: -2px;
  1301. right: 0;
  1302. border-radius: 50%;
  1303. }
  1304. .deleteFamily{
  1305. position: absolute;
  1306. top: 0rem;
  1307. right: 6%;
  1308. z-index: 9;
  1309. border-radius: 50%;
  1310. }
  1311. </style>