移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

2109 行
98 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  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. required
  114. :rules="[{ required: true , message:'请输入转账附言' }]"
  115. />
  116. </div>
  117. <div class="main_box" style="margin-top: 10px;">
  118. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  119. </div>
  120. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  121. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  122. <van-field
  123. readonly
  124. clickable
  125. label="项目名称"
  126. placeholder="请选择"
  127. v-model="projectForm.projectName"
  128. @click="showproject = true"
  129. input-align="right"
  130. right-icon="arrow-down"
  131. required
  132. :rules="[{ required: true , message:'请选择项目名称' }]"
  133. />
  134. <van-popup v-model="showproject" position="bottom">
  135. <van-picker
  136. show-toolbar
  137. :columns="projectList"
  138. @confirm="onConfirmProject"
  139. @cancel="showproject = false"
  140. />
  141. </van-popup>
  142. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  143. <van-field required :rules="[{ required: true , message:'请输入合同价款(元)' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  144. <van-field
  145. readonly
  146. clickable
  147. label="工程款类型"
  148. placeholder="请选择"
  149. v-model="projectFundType"
  150. @click="showFundType = true"
  151. input-align="right"
  152. right-icon="arrow-down"
  153. required
  154. :rules="[{ required: true , message:'请选择工程款类型' }]"
  155. />
  156. <van-popup v-model="showFundType" position="bottom">
  157. <van-picker
  158. show-toolbar
  159. :columns="projectFundTypeOptions"
  160. @confirm="onConfirmFundType"
  161. @cancel="showFundType = false"
  162. />
  163. </van-popup>
  164. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  165. </div>
  166. <p class="main_title" v-if="contractOpen">关联合同</p>
  167. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  168. <van-field
  169. readonly
  170. clickable
  171. label="合同"
  172. placeholder="请选择"
  173. v-model="infoForm.name"
  174. @click="showcontract = true"
  175. input-align="right"
  176. right-icon="arrow-down"
  177. required
  178. :rules="[{ required: true , message:'请选择项目名称' }]"
  179. />
  180. <van-popup v-model="showcontract" position="bottom">
  181. <van-picker
  182. show-toolbar
  183. :columns="infoList"
  184. @confirm="onConfirmContract"
  185. @cancel="showcontract = false"
  186. />
  187. </van-popup>
  188. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  189. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  190. </div>
  191. <p class="main_title">付款方信息</p>
  192. <div class="main_box">
  193. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  194. <van-field
  195. readonly
  196. clickable
  197. label="付款方"
  198. placeholder="请选择付款方"
  199. v-model="form.payer"
  200. @click="showpayer = true"
  201. input-align="right"
  202. right-icon="arrow-down"
  203. label-width="auto"
  204. required
  205. :rules="[{ required: true , message:'请选择付款方' }]"
  206. />
  207. <van-popup v-model="showpayer" position="bottom">
  208. <van-picker
  209. show-toolbar
  210. :columns="payerOptions"
  211. @confirm="onConfirmPayer($event)"
  212. @cancel="showpayer = false"
  213. />
  214. </van-popup>
  215. <van-field :rules="[{ required: true , message:'请输入账户' }]" readonly required label="可用余额(元)" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  216. </div>
  217. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  218. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  219. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  220. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  221. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  222. <van-field required :rules="[{ required: true , message:'请输入收款方全称' }]" v-model="item.payee" label="收款方" placeholder="请输入收款方全称" input-align="right" label-width="auto"/>
  223. <van-field required :rules="[{ required: true , message:'请输入联系方式' }]" v-model="item.phone" label="联系方式" placeholder="请输入联系方式" input-align="right" label-width="auto"/>
  224. <van-field required :rules="[{ required: true , message:'请输入申请使用金额' }]" v-model="item.incomeAmount" type="number" label="申请使用金额(元)" placeholder="请输入申请使用金额" input-align="right" label-width="auto"/>
  225. <van-field required :rules="[{ required: true , message:'请输入资金用途' }]" v-model="item.remark" label="资金用途" placeholder="请输入资金用途" input-align="right" label-width="auto" />
  226. </div>
  227. </div>
  228. </div>
  229. <p class="main_title">上传附件</p>
  230. <div class="main_box" style="padding: 5px 0 0 0;">
  231. <van-cell value="收据" />
  232. <van-uploader v-model="fileList1" :after-read="beforeRead1" @click-preview="previewPreview" @delete="deleteFile1" style="margin-left:8px;">
  233. <template #preview-cover="file">
  234. <div class="preview-cover">
  235. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  236. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  237. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  238. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  239. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  240. </div>
  241. </template>
  242. </van-uploader>
  243. <van-cell title="发票" />
  244. <van-uploader v-model="fileList2" :after-read="beforeRead2" @click-preview="previewPreview" @delete="deleteFile2" style="margin-left:8px;">
  245. <template #preview-cover="file">
  246. <div class="preview-cover">
  247. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  248. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  249. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  250. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  251. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  252. </div>
  253. </template>
  254. </van-uploader>
  255. <van-cell title="其他" />
  256. <van-uploader v-model="fileList3" :after-read="beforeRead3" @click-preview="previewPreview" @delete="deleteFile3" style="margin-left:8px;">
  257. <template #preview-cover="file">
  258. <div class="preview-cover">
  259. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  260. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  261. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  262. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  263. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  264. </div>
  265. </template>
  266. </van-uploader>
  267. </div>
  268. <div style="padding: 16px 0;">
  269. <van-row>
  270. <van-col span="12" align="center">
  271. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  272. </van-col>
  273. <van-col span="12" align="center">
  274. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  275. </van-col>
  276. </van-row>
  277. <div class="clear"></div>
  278. </div>
  279. </van-form>
  280. </div>
  281. </template>
  282. <script>
  283. import { listAccount1 , getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto
  284. , offlineCustomSubmit , offlineCashSubmit, getQmyeFlow,listInfo ,getInfoto ,addInfoto,listTemplate,selectApprovalByTemplateId} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  285. import {
  286. addCash, addCashdetail,
  287. attachmentList,
  288. commonAttach, getCash,
  289. listCashdetailByCashId, systemAttachment, updateCash
  290. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  291. import Dialog from "vant/lib/dialog";
  292. import request from '@/utils/request'
  293. export default {
  294. name: "approvalModify11",
  295. data() {
  296. return {
  297. showtemplate:false,
  298. showcontract:false,
  299. showcapital:false,
  300. showpayee:false,
  301. showlasj:false,
  302. showbankType:false,
  303. showproject:false,
  304. showFundType:false,
  305. showpayer:false,
  306. minDate: new Date(2000, 1, 1),
  307. maxDate: new Date(2050, 12, 31),
  308. currentDate: new Date(),
  309. form:{},
  310. capitalExpenditureType:'',
  311. payee:'',
  312. bankType:'',
  313. buttonType:'a',
  314. wfydlxDictionaries:[],
  315. jglxDictionaries:[],
  316. sysDictionaries:[],
  317. capitalExpenditureTypeOptions:[],
  318. bankTypeDictionaries:[],
  319. projectList:[],
  320. projectFundTypeOptions:[],
  321. projectFundTypeDictionaries:[],
  322. infoList:[],
  323. payerOptions:[],
  324. chargeItme:[],
  325. chargeItmeShow:[],
  326. payeeList:[],
  327. // 查询参数
  328. queryParams: {
  329. cashType:11,
  330. orderByColumn: "id",
  331. isAsc: "desc",
  332. },
  333. capitalExpenditureOpen:false,
  334. contractOpen:false,
  335. projectForm:{
  336. projectId:null,
  337. projectName:null,
  338. projectContractor:null,
  339. projectAmount:null,
  340. projectBillNum:null,
  341. projectFundType:'1',
  342. outId:null,
  343. ynType:'1'
  344. },
  345. infoForm:{
  346. infoId:null,
  347. name:null,
  348. code:null,
  349. totalAmount:null,
  350. contractionId:null,
  351. transferId:null
  352. },
  353. // 合同信息查询参数
  354. queryContractionParams: {
  355. pageNum: 1,
  356. pageSize: 100,
  357. contractionStatus: '1',
  358. orderByColumn: "endTime",
  359. isAsc: "desc",
  360. },
  361. projectFundType:'',
  362. fileList1:[],
  363. fileList2:[],
  364. fileList3:[],
  365. uploadFiles1:[],
  366. uploadFiles2:[],
  367. uploadFiles3:[],
  368. templateList:[],
  369. };
  370. },
  371. created() {
  372. this.initProjectInfo();
  373. this.getDicts("project_fund_type").then((response) => {
  374. for (var i = 0; i < response.data.length; i++) {
  375. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  376. }
  377. this.projectFundTypeDictionaries = response.data;
  378. });
  379. let params1={
  380. accountType: "101",
  381. status: "N",
  382. }
  383. listAccount1(params1).then((response) => {
  384. response.rows.map(res => {
  385. res['text'] = res.accountName+"余额:"+res.balance
  386. res['value'] = res.id
  387. res['bankAccountNumber'] = res.startDay
  388. res['payerFrom'] = '6'
  389. this.payerOptions.push(res)
  390. })
  391. });
  392. this.getDictionaries();
  393. this.getFileList();
  394. },
  395. methods: {
  396. goFlow(){
  397. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  398. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  399. }else{
  400. this.$notify({ type: 'danger', message: '无审批流程!' });
  401. }
  402. },
  403. onConfirmTemplate(data){
  404. selectApprovalByTemplateId(data.id).then(res => {
  405. this.showtemplate = false;
  406. if(res.approvalDetails.length>0){
  407. this.form.approvalTemplateName = data.name
  408. this.form.approvalTemplateId = data.id
  409. }else{
  410. this.form.approvalTemplateName = null
  411. this.form.approvalTemplateId = null
  412. this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
  413. }
  414. })
  415. },
  416. previewPreview(file, index, len) {
  417. const baseImgUrl = this.$store.getters.baseRoutingUrl;
  418. if (file.url) {
  419. //已上传文件
  420. let fileName = file.file.name || file.url;
  421. let subIndex = fileName.lastIndexOf(".");
  422. let ext = fileName.substring(subIndex + 1, fileName.length);
  423. let imgi = file.listIndex
  424. //console.log(ext)
  425. let allUrl = file.url;
  426. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  427. const link = document.createElement("a");
  428. link.style.display = "none";
  429. link.target = "_blank"
  430. link.href = allUrl;
  431. document.body.appendChild(link);
  432. link.click();
  433. document.body.removeChild(link);
  434. }
  435. } else {
  436. //新上传文件
  437. let fileName = file.file.name;
  438. // console.info(file.file.name)
  439. let subIndex = fileName.lastIndexOf(".");
  440. let ext = fileName.substring(subIndex + 1, fileName.length);
  441. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  442. let type = this.getfileType(ext);
  443. // 将文件转换为base64编码
  444. this.fileToBase64(file.file, ext).then(res => {
  445. this.downloadFile(res, fileName, ext, type);
  446. })
  447. }
  448. }
  449. },
  450. getfileType(type) {
  451. switch (type) {
  452. case 'txt':
  453. return 'text/plain';
  454. case 'doc':
  455. return 'application/msword';
  456. case 'docx':
  457. return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  458. case 'xls':
  459. return 'application/vnd.ms-excel';
  460. case 'xlsx':
  461. return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  462. case 'pdf':
  463. return 'application/pdf';
  464. case 'pptx':
  465. return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  466. case 'png':
  467. return 'image/png';
  468. case 'jpg':
  469. return 'image/jpeg';
  470. case 'gif':
  471. return 'image/gif';
  472. case 'svg':
  473. return 'image/svg+xml';
  474. case 'ico':
  475. return 'image/x-icon';
  476. case 'bmp':
  477. return 'image/bmp,';
  478. }
  479. },
  480. downloadFile(base64, fileName, fileType, mimetype) {
  481. const typeHeader = 'data:application/' + fileType + ';base64,';
  482. const blob = this.base64ToBlob(base64, mimetype);
  483. this.downloadFileDownload(blob, fileName, fileType);
  484. },
  485. base64ToBlob(base64, mime) {
  486. //解码base64得到二进制字符串
  487. let raw = window.atob(base64.substring(base64.indexOf(',') + 1));
  488. let rawLength = raw.length
  489. //创建8位无符号整数值的类型化数组
  490. let uInt8Array = new Uint8Array(rawLength)
  491. for (let i = 0; i < rawLength; ++i) {
  492. uInt8Array[i] = raw.charCodeAt(i);
  493. }
  494. return new Blob([uInt8Array], {type: mime})
  495. },
  496. downloadFileDownload(blob, fileName, fileType) {
  497. const downloadElement = document.createElement('a');
  498. let href = blob;
  499. if (typeof blob === 'string') {
  500. downloadElement.target = '_blank'
  501. } else {
  502. href = window.URL.createObjectURL(blob)
  503. }
  504. downloadElement.href = href;
  505. downloadElement.download = fileName + '.' + fileType;//下载后文件名
  506. document.body.appendChild(downloadElement);
  507. downloadElement.click();
  508. document.body.removeChild(downloadElement)
  509. if (typeof blob !== 'string') {
  510. window.URL.revokeObjectURL(href)
  511. }
  512. },
  513. fileToBase64(file,fileType){
  514. return new Promise((resolve,reject)=>{
  515. //创建一个新的FileReader 对象
  516. const reader = new FileReader();
  517. //读取file对象
  518. reader.readAsDataURL(file);
  519. reader.onload=function () {
  520. const base64String = reader.result.split(",")[1];
  521. resolve('data:application/' + fileType + ';base64,'+base64String);
  522. }
  523. reader.onerror=function () {
  524. reject(new Error("Failed to load file") )
  525. }
  526. })
  527. },
  528. initProjectInfo(){
  529. let _this = this
  530. let queryParams={
  531. pageNum: 1,
  532. pageSize: 100,
  533. }
  534. listProject(queryParams).then(response => {
  535. _this.projectList = response.rows;
  536. for (let i = 0; i < response.rows.length; i++) {
  537. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  538. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  539. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  540. }
  541. });
  542. listInfo(this.queryContractionParams).then(response => {
  543. _this.infoList = response.rows;
  544. for (let i = 0; i < response.rows.length; i++) {
  545. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  546. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  547. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  548. }
  549. });
  550. },
  551. getDictionaries(){
  552. getCash(this.$route.query.id).then((response) => {
  553. this.getDicts("capital_expenditure_type").then((res) => {
  554. for (var i = 0; i < res.data.length; i++) {
  555. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  556. }
  557. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  558. });
  559. if(response.data.capitalExpenditureType==2){
  560. this.capitalExpenditureOpen = true
  561. let param={
  562. 'outId' : response.data.id,
  563. 'ynType' : '2'
  564. }
  565. getProjectto(param).then(res => {
  566. console.log(this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType))
  567. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  568. this.projectForm = res.data
  569. console.log(res.data)
  570. })
  571. }else if(response.data.capitalExpenditureType==4){
  572. this.contractOpen = true
  573. let param={
  574. 'transferId' : response.data.id
  575. }
  576. console.log(param)
  577. getInfoto(param).then(res => {
  578. this.infoForm = res.data
  579. })
  580. }else{
  581. this.showproject = false
  582. }
  583. this.form = response.data;
  584. let _this = this
  585. let templateQueryParams = {
  586. // 分页
  587. pageNum: 1,
  588. pageSize: 999,
  589. type:'3'
  590. };
  591. listTemplate(templateQueryParams).then(rrr => {
  592. this.templateList = rrr.rows;
  593. this.templateList.map(ra => {
  594. if(ra.id == response.data.approvalTemplateId){
  595. _this.form.approvalTemplateName = ra.name
  596. }
  597. })
  598. });
  599. });
  600. listCashdetailByCashId(this.$route.query.id).then((response) => {
  601. this.chargeItme = response.data;
  602. console.log(response)
  603. this.getPayeeList();
  604. });
  605. },
  606. getChange(){
  607. if(this.buttonType == 'update'){
  608. this.goUpdate();
  609. }else if(this.buttonType == 'add'){
  610. this.goAdd();
  611. }
  612. },
  613. getError(e){
  614. console.log(e)
  615. this.$notify({ type: 'danger', message: e.errors[0].message });
  616. },
  617. addChargeItme(index){
  618. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  619. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  620. return;
  621. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  622. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  623. return;
  624. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  625. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  626. return;
  627. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  628. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  629. return;
  630. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  631. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  632. return;
  633. }
  634. this.chargeItme.splice(index + 1, 0, {
  635. payeeId: "", //收款方ID
  636. payee: "", //收款方全称
  637. payeeAccount: "", //收款账户
  638. drawer: "", //提款人
  639. incomeAmount: "", //提款金额
  640. bankType: "", //资金用途
  641. showPayee:false,
  642. showbankType:false
  643. });
  644. },
  645. getPayeeList() {
  646. //普通转账
  647. this.queryParams.accountType = this.form.accountType
  648. this.queryParams.status = "0"
  649. listPayee(this.queryParams).then((response) => {
  650. this.payeeList = response.rows;
  651. response.rows.map((res,index) => {
  652. this.payeeList[index].text = res.payee;
  653. this.payeeList[index].value = res.id;
  654. })
  655. });
  656. },
  657. payeeDictLabel(datas, value) {
  658. var actions = [];
  659. Object.keys(datas).some((key) => {
  660. if (datas[key].payeeId == ('' + value)) {
  661. actions.push(datas[key].payee);
  662. return true;
  663. }
  664. })
  665. return actions.join('');
  666. },
  667. onConfirmCapital(data){
  668. if (data.value == 2){
  669. this.capitalExpenditureOpen = true;
  670. this.contractOpen = false
  671. this.infoForm = {};
  672. }else if(data.value == 4){
  673. this.capitalExpenditureOpen = false;
  674. this.contractOpen = true
  675. this.projectForm = {};
  676. }else{
  677. this.capitalExpenditureOpen = false;
  678. this.contractOpen = false
  679. this.projectForm = {};
  680. this.infoForm = {};
  681. }
  682. this.capitalExpenditureType = data.text;
  683. this.form.capitalExpenditureType = data.value;
  684. this.showcapital = false;
  685. },
  686. onConfirmFundType(data){
  687. console.log(data)
  688. this.projectForm.projectFundType = data.value;
  689. this.projectFundType = data.text;
  690. this.showFundType = false;
  691. },
  692. onConfirmProject(data){
  693. this.projectList.map(res => {
  694. if(res.projectName==data.text){
  695. this.projectForm.projectId = res.id
  696. this.projectForm.projectName = res.projectName
  697. this.projectForm.projectContractor = res.projectContractor
  698. this.projectForm.projectAmount = res.projectAmount
  699. }
  700. })
  701. this.showproject = 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. onConfirmContract(data){
  713. this.infoList.map(res => {
  714. if(res.name==data.text){
  715. this.infoForm.contractionId = res.id;
  716. this.infoForm.name = res.name;
  717. this.infoForm.code = res.code;
  718. this.infoForm.totalAmount = res.totalAmount;
  719. }
  720. })
  721. this.showcontract = false;
  722. },
  723. onConfirmBankType(data,index){
  724. for (var i = 0 ; i < this.chargeItme.length ; i++){
  725. this.chargeItme[i].showbankType = false;
  726. }
  727. this.chargeItme[index].bankTypeText = data.text;
  728. this.chargeItme[index].bankType = data.value;
  729. this.chargeItme[index].showbankType = false;
  730. },
  731. onConfirmPayer(data){
  732. this.form.payer = data.text;
  733. this.form.cashierId = data.value;
  734. this.showpayer = false;
  735. this.selectChange(data.value)
  736. },
  737. onConfirmLasj(data){
  738. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  739. this.showlasj = false;
  740. },
  741. accountTypeChange(e){
  742. this.payeeList = [];
  743. this.queryParams.accountType = this.form.accountType
  744. this.queryParams.status = "0"
  745. listPayee(this.queryParams).then((response) => {
  746. this.payeeList = response.rows;
  747. response.rows.map((res,index) => {
  748. this.payeeList[index].text = res.payee;
  749. this.payeeList[index].value = res.id;
  750. })
  751. });
  752. },
  753. goAdd(){
  754. let _this = this
  755. if(this.form.payerAccount==0){
  756. this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });
  757. return false;
  758. }else {
  759. let total = 0;
  760. this.chargeItme.forEach((money) => {
  761. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  762. });
  763. this.$set(this.form, "expenditureAmount", total);
  764. if(parseInt(this.form.payerAccount)< parseInt(this.form.expenditureAmount)){
  765. this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
  766. return false;
  767. }else{
  768. if(this.chargeItme.length<1){
  769. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  770. return;
  771. }
  772. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  773. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  774. return;
  775. }
  776. if(this.form.capitalExpenditureType==2){
  777. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  778. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  779. return;
  780. }
  781. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  782. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  783. return;
  784. }
  785. }
  786. if(this.form.capitalExpenditureType==4){
  787. if(this.infoForm.name==""||this.infoForm.name==null){
  788. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  789. return;
  790. }
  791. if(this.infoForm.code==""||this.infoForm.code==null){
  792. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  793. return;
  794. }
  795. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  796. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  797. return;
  798. }
  799. }
  800. this.$set(this.form, "payeeList", this.chargeItme);
  801. this.$set(this.form, "bankTypeList", this.chargeItme);
  802. this.$set(this.form, "accountTypeList", this.chargeItme);
  803. this.$set(this.form, "transferStatusList", this.chargeItme);
  804. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&
  805. (this.uploadFiles2==null||this.uploadFiles2.length==0)&&
  806. (this.uploadFiles3==null||this.uploadFiles3.length==0&&
  807. this.fileList1.length==0&&
  808. this.fileList2.length==0&&
  809. this.fileList3.length==0)){
  810. Dialog.confirm({
  811. title: '提示',
  812. message: '此申请单中未上传任何附件,是否确认提交?',
  813. })
  814. .then(() => {
  815. updateCash(this.form).then((response) => {
  816. this.chargeItme.map((res,idx) => {
  817. res.cashId = _this.form.id
  818. addCashdetail(res).then(r => {
  819. if(idx == (_this.chargeItme.length - 1)){
  820. if(_this.form.capitalExpenditureType==2){
  821. _this.projectForm.outId = _this.form.id
  822. _this.$set(_this.projectForm, "ynType", '2');
  823. addProjectto(_this.projectForm).then(res => {
  824. offlineCustomSubmit(_this.form.id).then(res => {
  825. _this.$toast.success('提交成功');
  826. setTimeout(function(){
  827. history.go(-1)
  828. },2000)
  829. })
  830. })
  831. }else if(_this.form.capitalExpenditureType==4){
  832. _this.infoForm.transferId = _this.form.id
  833. addInfoto(_this.infoForm).then(res => {
  834. offlineCustomSubmit(_this.form.id).then(res => {
  835. _this.$toast.success('提交成功');
  836. setTimeout(function(){
  837. history.go(-1)
  838. },2000)
  839. })
  840. })
  841. }else{
  842. offlineCustomSubmit(_this.form.id).then(res => {
  843. _this.$toast.success('提交成功');
  844. setTimeout(function(){
  845. history.go(-1)
  846. },2000)
  847. })
  848. }
  849. }
  850. })
  851. })
  852. });
  853. })
  854. }else {
  855. updateCash(this.form).then((response) => {
  856. this.projectForm.outId = _this.form.id
  857. this.infoForm.transferId = _this.form.id
  858. this.$set(this.projectForm, "ynType", '2');
  859. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  860. this.uploadFiles1.map((rr1,idx1) => {
  861. let params1 = new FormData();
  862. params1.append("tableId", _this.form.id);
  863. params1.append("tableName", "t_yinnong_transfer");
  864. params1.append("bizPath", "yinnong");
  865. params1.append("fileType", "1");
  866. params1.append("file", rr1);
  867. commonAttach(params1).then((r1) => {
  868. if(idx1 == (_this.uploadFiles1.length-1)){
  869. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  870. _this.uploadFiles2.map((rr2,idx2) => {
  871. let params2 = new FormData();
  872. params2.append("tableId", _this.form.id);
  873. params2.append("tableName", "t_yinnong_transfer");
  874. params2.append("bizPath", "yinnong");
  875. params2.append("fileType", "2");
  876. params2.append("file", rr2);
  877. commonAttach(params2).then((r2) => {
  878. if(idx2 == (_this.uploadFiles2.length-1)){
  879. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  880. _this.uploadFiles3.map((rr3,idx3) => {
  881. let params3 = new FormData();
  882. params3.append("tableId", _this.form.id);
  883. params3.append("tableName", "t_yinnong_transfer");
  884. params3.append("bizPath", "yinnong");
  885. params3.append("fileType", "3");
  886. params3.append("file", rr3);
  887. commonAttach(params3).then((r3) => {
  888. if(idx3 == (_this.uploadFiles3.length-1)){
  889. if(_this.form.capitalExpenditureType==2){
  890. addProjectto(_this.projectForm).then(res => {
  891. offlineCustomSubmit(_this.form.id).then(res => {
  892. _this.chargeItme.map((resD,b) => {
  893. resD.cashId = _this.form.id
  894. addCashdetail(resD).then((a,rD) => {
  895. if(b == (_this.chargeItme.length-1)){
  896. _this.$toast.success('提交成功');
  897. setTimeout(function(){
  898. history.go(-1)
  899. },2000)
  900. }
  901. })
  902. })
  903. })
  904. })
  905. } else if(_this.form.capitalExpenditureType==4){
  906. addInfoto(_this.infoForm).then(res => {
  907. offlineCustomSubmit(_this.form.id).then(res => {
  908. _this.chargeItme.map((resD,b) => {
  909. resD.cashId = _this.form.id
  910. addCashdetail(resD).then((a,rD) => {
  911. if(b == (_this.chargeItme.length-1)){
  912. _this.$toast.success('提交成功');
  913. setTimeout(function(){
  914. history.go(-1)
  915. },2000)
  916. }
  917. })
  918. })
  919. })
  920. })
  921. }else{
  922. offlineCustomSubmit(_this.form.id).then(res => {
  923. _this.chargeItme.map((resD,b) => {
  924. resD.cashId = _this.form.id
  925. addCashdetail(resD).then((a,rD) => {
  926. if(b == (_this.chargeItme.length-1)){
  927. _this.$toast.success('提交成功');
  928. setTimeout(function(){
  929. history.go(-1)
  930. },2000)
  931. }
  932. })
  933. })
  934. })
  935. }
  936. }
  937. })
  938. })
  939. }else{
  940. if(_this.form.capitalExpenditureType==2){
  941. addProjectto(_this.projectForm).then(res => {
  942. offlineCustomSubmit(_this.form.id).then(res => {
  943. _this.chargeItme.map((resD,b) => {
  944. resD.cashId = _this.form.id
  945. addCashdetail(resD).then((a,rD) => {
  946. if(b == (_this.chargeItme.length-1)){
  947. _this.$toast.success('提交成功');
  948. setTimeout(function(){
  949. history.go(-1)
  950. },2000)
  951. }
  952. })
  953. })
  954. })
  955. })
  956. } else if(_this.form.capitalExpenditureType==4){
  957. addInfoto(_this.infoForm).then(res => {
  958. offlineCustomSubmit(_this.form.id).then(res => {
  959. _this.chargeItme.map((resD,b) => {
  960. resD.cashId = _this.form.id
  961. addCashdetail(resD).then((a,rD) => {
  962. if(b == (_this.chargeItme.length-1)){
  963. _this.$toast.success('提交成功');
  964. setTimeout(function(){
  965. history.go(-1)
  966. },2000)
  967. }
  968. })
  969. })
  970. })
  971. })
  972. }else{
  973. offlineCustomSubmit(_this.form.id).then(res => {
  974. _this.chargeItme.map((resD,b) => {
  975. resD.cashId = _this.form.id
  976. addCashdetail(resD).then((a,rD) => {
  977. if(b == (_this.chargeItme.length-1)){
  978. _this.$toast.success('提交成功');
  979. setTimeout(function(){
  980. history.go(-1)
  981. },2000)
  982. }
  983. })
  984. })
  985. })
  986. }
  987. }
  988. }
  989. })
  990. })
  991. }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  992. _this.uploadFiles3.map((rr3,idx3) => {
  993. let params3 = new FormData();
  994. params3.append("tableId", _this.form.id);
  995. params3.append("tableName", "t_yinnong_transfer");
  996. params3.append("bizPath", "yinnong");
  997. params3.append("fileType", "3");
  998. params3.append("file", rr3);
  999. commonAttach(params3).then((r3) => {
  1000. if(idx3 ==(_this.uploadFiles3.length-1)){
  1001. if(_this.form.capitalExpenditureType==2){
  1002. addProjectto(_this.projectForm).then(res => {
  1003. offlineCustomSubmit(_this.form.id).then(res => {
  1004. _this.chargeItme.map((resD,b) => {
  1005. resD.cashId = _this.form.id
  1006. addCashdetail(resD).then((a,rD) => {
  1007. if(b == (_this.chargeItme.length-1)){
  1008. _this.$toast.success('提交成功');
  1009. setTimeout(function(){
  1010. history.go(-1)
  1011. },2000)
  1012. }
  1013. })
  1014. })
  1015. })
  1016. })
  1017. } else if(_this.form.capitalExpenditureType==4){
  1018. addInfoto(_this.infoForm).then(res => {
  1019. offlineCustomSubmit(_this.form.id).then(res => {
  1020. _this.chargeItme.map((resD,b) => {
  1021. resD.cashId = _this.form.id
  1022. addCashdetail(resD).then((a,rD) => {
  1023. if(b == (_this.chargeItme.length-1)){
  1024. _this.$toast.success('提交成功');
  1025. setTimeout(function(){
  1026. history.go(-1)
  1027. },2000)
  1028. }
  1029. })
  1030. })
  1031. })
  1032. })
  1033. }else{
  1034. offlineCustomSubmit(_this.form.id).then(res => {
  1035. _this.chargeItme.map((resD,b) => {
  1036. resD.cashId = _this.form.id
  1037. addCashdetail(resD).then((a,rD) => {
  1038. if(b == (_this.chargeItme.length-1)){
  1039. _this.$toast.success('提交成功');
  1040. setTimeout(function(){
  1041. history.go(-1)
  1042. },2000)
  1043. }
  1044. })
  1045. })
  1046. })
  1047. }
  1048. }
  1049. })
  1050. })
  1051. }else{
  1052. if(_this.form.capitalExpenditureType==2){
  1053. addProjectto(_this.projectForm).then(res => {
  1054. offlineCustomSubmit(_this.form.id).then(res => {
  1055. _this.chargeItme.map((resD,b) => {
  1056. resD.cashId = _this.form.id
  1057. addCashdetail(resD).then((a,rD) => {
  1058. if(b == (_this.chargeItme.length-1)){
  1059. _this.$toast.success('提交成功');
  1060. setTimeout(function(){
  1061. history.go(-1)
  1062. },2000)
  1063. }
  1064. })
  1065. })
  1066. })
  1067. })
  1068. } else if(_this.form.capitalExpenditureType==4){
  1069. addInfoto(_this.infoForm).then(res => {
  1070. offlineCustomSubmit(_this.form.id).then(res => {
  1071. _this.chargeItme.map((resD,b) => {
  1072. resD.cashId = _this.form.id
  1073. addCashdetail(resD).then((a,rD) => {
  1074. if(b == (_this.chargeItme.length-1)){
  1075. _this.$toast.success('提交成功');
  1076. setTimeout(function(){
  1077. history.go(-1)
  1078. },2000)
  1079. }
  1080. })
  1081. })
  1082. })
  1083. })
  1084. }else{
  1085. offlineCustomSubmit(_this.form.id).then(res => {
  1086. _this.chargeItme.map((resD,b) => {
  1087. resD.cashId = _this.form.id
  1088. addCashdetail(resD).then((a,rD) => {
  1089. if(b == (_this.chargeItme.length-1)){
  1090. _this.$toast.success('提交成功');
  1091. setTimeout(function(){
  1092. history.go(-1)
  1093. },2000)
  1094. }
  1095. })
  1096. })
  1097. })
  1098. }
  1099. }
  1100. }
  1101. })
  1102. })
  1103. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1104. this.uploadFiles2.map((rr2,idx2) => {
  1105. let params = new FormData();
  1106. params.append("tableId", _this.form.id);
  1107. params.append("tableName", "t_yinnong_transfer");
  1108. params.append("bizPath", "yinnong");
  1109. params.append("fileType", "2");
  1110. params.append("file", rr2);
  1111. commonAttach(params).then((r2) => {
  1112. if(idx2 == (_this.uploadFiles2.length-1)){
  1113. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1114. _this.uploadFiles3.map((rr3,idx3) => {
  1115. let params3 = new FormData();
  1116. params3.append("tableId", _this.form.id);
  1117. params3.append("tableName", "t_yinnong_transfer");
  1118. params3.append("bizPath", "yinnong");
  1119. params3.append("fileType", "3");
  1120. params3.append("file", rr3);
  1121. commonAttach(params).then((r3) => {
  1122. if(idx3 == (_this.uploadFiles3.length-1)){
  1123. if(_this.form.capitalExpenditureType==2){
  1124. addProjectto(_this.projectForm).then(res => {
  1125. offlineCustomSubmit(_this.form.id).then(res => {
  1126. _this.chargeItme.map((resD,b) => {
  1127. resD.cashId = _this.form.id
  1128. addCashdetail(resD).then((a,rD) => {
  1129. if(b == (_this.chargeItme.length-1)){
  1130. _this.$toast.success('提交成功');
  1131. setTimeout(function(){
  1132. history.go(-1)
  1133. },2000)
  1134. }
  1135. })
  1136. })
  1137. })
  1138. })
  1139. } else if(_this.form.capitalExpenditureType==4){
  1140. addInfoto(_this.infoForm).then(res => {
  1141. offlineCustomSubmit(_this.form.id).then(res => {
  1142. _this.chargeItme.map((resD,b) => {
  1143. resD.cashId = _this.form.id
  1144. addCashdetail(resD).then((a,rD) => {
  1145. if(b == (_this.chargeItme.length-1)){
  1146. _this.$toast.success('提交成功');
  1147. setTimeout(function(){
  1148. history.go(-1)
  1149. },2000)
  1150. }
  1151. })
  1152. })
  1153. })
  1154. })
  1155. }else{
  1156. offlineCustomSubmit(_this.form.id).then(res => {
  1157. _this.chargeItme.map((resD,b) => {
  1158. resD.cashId = _this.form.id
  1159. addCashdetail(resD).then((a,rD) => {
  1160. if(b == (_this.chargeItme.length-1)){
  1161. _this.$toast.success('提交成功');
  1162. setTimeout(function(){
  1163. history.go(-1)
  1164. },2000)
  1165. }
  1166. })
  1167. })
  1168. })
  1169. }
  1170. }
  1171. })
  1172. })
  1173. }else{
  1174. if(_this.form.capitalExpenditureType==2){
  1175. addProjectto(_this.projectForm).then(res => {
  1176. offlineCustomSubmit(_this.form.id).then(res => {
  1177. _this.chargeItme.map((resD,b) => {
  1178. resD.cashId = _this.form.id
  1179. addCashdetail(resD).then((a,rD) => {
  1180. if(b == (_this.chargeItme.length-1)){
  1181. _this.$toast.success('提交成功');
  1182. setTimeout(function(){
  1183. history.go(-1)
  1184. },2000)
  1185. }
  1186. })
  1187. })
  1188. })
  1189. })
  1190. } else if(_this.form.capitalExpenditureType==4){
  1191. addInfoto(_this.infoForm).then(res => {
  1192. offlineCustomSubmit(_this.form.id).then(res => {
  1193. _this.chargeItme.map((resD,b) => {
  1194. resD.cashId = _this.form.id
  1195. addCashdetail(resD).then((a,rD) => {
  1196. if(b == (_this.chargeItme.length-1)){
  1197. _this.$toast.success('提交成功');
  1198. setTimeout(function(){
  1199. history.go(-1)
  1200. },2000)
  1201. }
  1202. })
  1203. })
  1204. })
  1205. })
  1206. }else{
  1207. offlineCustomSubmit(_this.form.id).then(res => {
  1208. _this.chargeItme.map((resD,b) => {
  1209. resD.cashId = _this.form.id
  1210. addCashdetail(resD).then((a,rD) => {
  1211. if(b == (_this.chargeItme.length-1)){
  1212. _this.$toast.success('提交成功');
  1213. setTimeout(function(){
  1214. history.go(-1)
  1215. },2000)
  1216. }
  1217. })
  1218. })
  1219. })
  1220. }
  1221. }
  1222. }
  1223. })
  1224. })
  1225. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1226. this.uploadFiles3.map((rr3,idx3) => {
  1227. let params = new FormData();
  1228. params.append("tableId", _this.form.id);
  1229. params.append("tableName", "t_yinnong_transfer");
  1230. params.append("bizPath", "yinnong");
  1231. params.append("fileType", "3");
  1232. params.append("file", rr3);
  1233. commonAttach(params).then((r) => {
  1234. if(idx3 == (_this.uploadFiles3.length-1)){
  1235. if(_this.form.capitalExpenditureType==2){
  1236. addProjectto(_this.projectForm).then(res => {
  1237. offlineCustomSubmit(_this.form.id).then(res => {
  1238. _this.chargeItme.map((resD,b) => {
  1239. resD.cashId = _this.form.id
  1240. addCashdetail(resD).then((a,rD) => {
  1241. if(b == (_this.chargeItme.length-1)){
  1242. _this.$toast.success('提交成功');
  1243. setTimeout(function(){
  1244. history.go(-1)
  1245. },2000)
  1246. }
  1247. })
  1248. })
  1249. })
  1250. })
  1251. } else if(_this.form.capitalExpenditureType==4){
  1252. addInfoto(_this.infoForm).then(res => {
  1253. offlineCustomSubmit(_this.form.id).then(res => {
  1254. _this.chargeItme.map((resD,b) => {
  1255. resD.cashId = _this.form.id
  1256. addCashdetail(resD).then((a,rD) => {
  1257. if(b == (_this.chargeItme.length-1)){
  1258. _this.$toast.success('提交成功');
  1259. setTimeout(function(){
  1260. history.go(-1)
  1261. },2000)
  1262. }
  1263. })
  1264. })
  1265. })
  1266. })
  1267. }else{
  1268. offlineCustomSubmit(_this.form.id).then(res => {
  1269. _this.chargeItme.map((resD,b) => {
  1270. resD.cashId = _this.form.id
  1271. addCashdetail(resD).then((a,rD) => {
  1272. if(b == (_this.chargeItme.length-1)){
  1273. _this.$toast.success('提交成功');
  1274. setTimeout(function(){
  1275. history.go(-1)
  1276. },2000)
  1277. }
  1278. })
  1279. })
  1280. })
  1281. }
  1282. }
  1283. })
  1284. })
  1285. }else{
  1286. if(this.form.capitalExpenditureType==2){
  1287. addProjectto(this.projectForm).then(res => {
  1288. offlineCustomSubmit(_this.form.id).then(res => {
  1289. _this.chargeItme.map((resD,b) => {
  1290. resD.cashId = _this.form.id
  1291. addCashdetail(resD).then((a,rD) => {
  1292. if(b == (_this.chargeItme.length-1)){
  1293. _this.$toast.success('提交成功');
  1294. setTimeout(function(){
  1295. history.go(-1)
  1296. },2000)
  1297. }
  1298. })
  1299. })
  1300. })
  1301. })
  1302. } else if(this.form.capitalExpenditureType==4){
  1303. addInfoto(this.infoForm).then(res => {
  1304. offlineCustomSubmit(_this.form.id).then(res => {
  1305. _this.chargeItme.map((resD,b) => {
  1306. resD.cashId = _this.form.id
  1307. addCashdetail(resD).then((a,rD) => {
  1308. if(b == (_this.chargeItme.length-1)){
  1309. _this.$toast.success('提交成功');
  1310. setTimeout(function(){
  1311. history.go(-1)
  1312. },2000)
  1313. }
  1314. })
  1315. })
  1316. })
  1317. })
  1318. }else{
  1319. offlineCustomSubmit(_this.form.id).then(res => {
  1320. _this.chargeItme.map((resD,b) => {
  1321. resD.cashId = _this.form.id
  1322. addCashdetail(resD).then((a,rD) => {
  1323. if(b == (_this.chargeItme.length-1)){
  1324. _this.$toast.success('提交成功');
  1325. setTimeout(function(){
  1326. history.go(-1)
  1327. },2000)
  1328. }
  1329. })
  1330. })
  1331. })
  1332. }
  1333. }
  1334. });
  1335. }
  1336. }
  1337. }
  1338. },
  1339. goUpdate(){
  1340. let _this = this
  1341. if(this.form.payerAccount==0){
  1342. this.$notify({ type: 'danger', message: '申请使用金额不能等于0!' });
  1343. return false;
  1344. }else {
  1345. let total = 0;
  1346. this.chargeItme.forEach((money) => {
  1347. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  1348. });
  1349. this.$set(this.form, "expenditureAmount", total);
  1350. if(parseFloat(this.form.payerAccount)<parseFloat(this.form.expenditureAmount)){
  1351. this.$notify({ type: 'danger', message: '申请使用金额不能大于可用余额!' });
  1352. return false;
  1353. }else{
  1354. if(this.chargeItme.length<1){
  1355. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1356. return;
  1357. }
  1358. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1359. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  1360. return;
  1361. }
  1362. if(this.form.capitalExpenditureType==2){
  1363. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1364. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1365. return;
  1366. }
  1367. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1368. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1369. return;
  1370. }
  1371. }
  1372. if(this.form.capitalExpenditureType==4){
  1373. if(this.infoForm.name==""||this.infoForm.name==null){
  1374. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1375. return;
  1376. }
  1377. if(this.infoForm.code==""||this.infoForm.code==null){
  1378. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1379. return;
  1380. }
  1381. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1382. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1383. return;
  1384. }
  1385. }
  1386. this.projectForm.outId = this.form.id
  1387. updateCash(this.form).then(response => {
  1388. this.projectForm.outId = _this.form.id
  1389. this.infoForm.transferId = _this.form.id
  1390. this.$set(this.projectForm, "ynType", '2');
  1391. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  1392. this.uploadFiles1.map((rr1,idx1) => {
  1393. let params1 = new FormData();
  1394. params1.append("tableId", _this.form.id);
  1395. params1.append("tableName", "t_yinnong_transfer");
  1396. params1.append("bizPath", "yinnong");
  1397. params1.append("fileType", "1");
  1398. params1.append("file", rr1);
  1399. commonAttach(params1).then((r1) => {
  1400. if(idx1 == (_this.uploadFiles1.length-1)){
  1401. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  1402. _this.uploadFiles2.map((rr2,idx2) => {
  1403. let params2 = new FormData();
  1404. params2.append("tableId", _this.form.id);
  1405. params2.append("tableName", "t_yinnong_transfer");
  1406. params2.append("bizPath", "yinnong");
  1407. params2.append("fileType", "2");
  1408. params2.append("file", rr2);
  1409. commonAttach(params2).then((r2) => {
  1410. if(idx2 == (_this.uploadFiles2.length-1)){
  1411. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1412. _this.uploadFiles3.map((rr3,idx3) => {
  1413. let params3 = new FormData();
  1414. params3.append("tableId", _this.form.id);
  1415. params3.append("tableName", "t_yinnong_transfer");
  1416. params3.append("bizPath", "yinnong");
  1417. params3.append("fileType", "3");
  1418. params3.append("file", rr3);
  1419. commonAttach(params3).then((r3) => {
  1420. if(idx3 == (_this.uploadFiles3.length-1)){
  1421. if(_this.form.capitalExpenditureType==2){
  1422. addProjectto(_this.projectForm).then(res => {
  1423. _this.chargeItme.map((resD,b) => {
  1424. resD.cashId = _this.form.id
  1425. addCashdetail(resD).then((a,rD) => {
  1426. if(b == (_this.chargeItme.length-1)){
  1427. _this.$toast.success('保存成功');
  1428. setTimeout(function(){
  1429. history.go(-1)
  1430. },2000)
  1431. }
  1432. })
  1433. })
  1434. })
  1435. } else if(_this.form.capitalExpenditureType==4){
  1436. addInfoto(_this.infoForm).then(res => {
  1437. _this.chargeItme.map((resD,b) => {
  1438. resD.cashId = _this.form.id
  1439. addCashdetail(resD).then((a,rD) => {
  1440. if(b == (_this.chargeItme.length-1)){
  1441. _this.$toast.success('保存成功');
  1442. setTimeout(function(){
  1443. history.go(-1)
  1444. },2000)
  1445. }
  1446. })
  1447. })
  1448. })
  1449. }else{
  1450. _this.chargeItme.map((resD,b) => {
  1451. resD.cashId = _this.form.id
  1452. addCashdetail(resD).then((a,rD) => {
  1453. if(b == (_this.chargeItme.length-1)){
  1454. _this.$toast.success('保存成功');
  1455. setTimeout(function(){
  1456. history.go(-1)
  1457. },2000)
  1458. }
  1459. })
  1460. })
  1461. }
  1462. }
  1463. })
  1464. })
  1465. }else{
  1466. if(_this.form.capitalExpenditureType==2){
  1467. addProjectto(_this.projectForm).then(res => {
  1468. _this.chargeItme.map((resD,b) => {
  1469. resD.cashId = _this.form.id
  1470. addCashdetail(resD).then((a,rD) => {
  1471. if(b == (_this.chargeItme.length-1)){
  1472. _this.$toast.success('保存成功');
  1473. setTimeout(function(){
  1474. history.go(-1)
  1475. },2000)
  1476. }
  1477. })
  1478. })
  1479. })
  1480. } else if(_this.form.capitalExpenditureType==4){
  1481. addInfoto(_this.infoForm).then(res => {
  1482. _this.chargeItme.map((resD,b) => {
  1483. resD.cashId = _this.form.id
  1484. addCashdetail(resD).then((a,rD) => {
  1485. if(b == (_this.chargeItme.length-1)){
  1486. _this.$toast.success('保存成功');
  1487. setTimeout(function(){
  1488. history.go(-1)
  1489. },2000)
  1490. }
  1491. })
  1492. })
  1493. })
  1494. }else{
  1495. _this.chargeItme.map((resD,b) => {
  1496. resD.cashId = _this.form.id
  1497. addCashdetail(resD).then((a,rD) => {
  1498. if(b == (_this.chargeItme.length-1)){
  1499. _this.$toast.success('保存成功');
  1500. setTimeout(function(){
  1501. history.go(-1)
  1502. },2000)
  1503. }
  1504. })
  1505. })
  1506. }
  1507. }
  1508. }
  1509. })
  1510. })
  1511. }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1512. _this.uploadFiles3.map((rr3,idx3) => {
  1513. let params3 = new FormData();
  1514. params3.append("tableId", _this.form.id);
  1515. params3.append("tableName", "t_yinnong_transfer");
  1516. params3.append("bizPath", "yinnong");
  1517. params3.append("fileType", "3");
  1518. params3.append("file", rr3);
  1519. commonAttach(params3).then((r3) => {
  1520. if(idx3 ==(_this.uploadFiles3.length-1)){
  1521. if(_this.form.capitalExpenditureType==2){
  1522. addProjectto(_this.projectForm).then(res => {
  1523. _this.chargeItme.map((resD,b) => {
  1524. resD.cashId = _this.form.id
  1525. addCashdetail(resD).then((a,rD) => {
  1526. if(b == (_this.chargeItme.length-1)){
  1527. _this.$toast.success('保存成功');
  1528. setTimeout(function(){
  1529. history.go(-1)
  1530. },2000)
  1531. }
  1532. })
  1533. })
  1534. })
  1535. } else if(_this.form.capitalExpenditureType==4){
  1536. addInfoto(_this.infoForm).then(res => {
  1537. _this.chargeItme.map((resD,b) => {
  1538. resD.cashId = _this.form.id
  1539. addCashdetail(resD).then((a,rD) => {
  1540. if(b == (_this.chargeItme.length-1)){
  1541. _this.$toast.success('保存成功');
  1542. setTimeout(function(){
  1543. history.go(-1)
  1544. },2000)
  1545. }
  1546. })
  1547. })
  1548. })
  1549. }else{
  1550. _this.chargeItme.map((resD,b) => {
  1551. resD.cashId = _this.form.id
  1552. addCashdetail(resD).then((a,rD) => {
  1553. if(b == (_this.chargeItme.length-1)){
  1554. _this.$toast.success('保存成功');
  1555. setTimeout(function(){
  1556. history.go(-1)
  1557. },2000)
  1558. }
  1559. })
  1560. })
  1561. }
  1562. }
  1563. })
  1564. })
  1565. }else{
  1566. if(_this.form.capitalExpenditureType==2){
  1567. addProjectto(_this.projectForm).then(res => {
  1568. _this.chargeItme.map((resD,b) => {
  1569. resD.cashId = _this.form.id
  1570. addCashdetail(resD).then((a,rD) => {
  1571. if(b == (_this.chargeItme.length-1)){
  1572. _this.$toast.success('保存成功');
  1573. setTimeout(function(){
  1574. history.go(-1)
  1575. },2000)
  1576. }
  1577. })
  1578. })
  1579. })
  1580. } else if(_this.form.capitalExpenditureType==4){
  1581. addInfoto(_this.infoForm).then(res => {
  1582. _this.chargeItme.map((resD,b) => {
  1583. resD.cashId = _this.form.id
  1584. addCashdetail(resD).then((a,rD) => {
  1585. if(b == (_this.chargeItme.length-1)){
  1586. _this.$toast.success('保存成功');
  1587. setTimeout(function(){
  1588. history.go(-1)
  1589. },2000)
  1590. }
  1591. })
  1592. })
  1593. })
  1594. }else{
  1595. _this.chargeItme.map((resD,b) => {
  1596. resD.cashId = _this.form.id
  1597. addCashdetail(resD).then((a,rD) => {
  1598. if(b == (_this.chargeItme.length-1)){
  1599. _this.$toast.success('保存成功');
  1600. setTimeout(function(){
  1601. history.go(-1)
  1602. },2000)
  1603. }
  1604. })
  1605. })
  1606. }
  1607. }
  1608. }
  1609. })
  1610. })
  1611. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1612. this.uploadFiles2.map((rr2,idx2) => {
  1613. let params = new FormData();
  1614. params.append("tableId", _this.form.id);
  1615. params.append("tableName", "t_yinnong_transfer");
  1616. params.append("bizPath", "yinnong");
  1617. params.append("fileType", "2");
  1618. params.append("file", rr2);
  1619. commonAttach(params).then((r2) => {
  1620. if(idx2 == (_this.uploadFiles2.length-1)){
  1621. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1622. _this.uploadFiles3.map((rr3,idx3) => {
  1623. let params3 = new FormData();
  1624. params3.append("tableId", _this.form.id);
  1625. params3.append("tableName", "t_yinnong_transfer");
  1626. params3.append("bizPath", "yinnong");
  1627. params3.append("fileType", "3");
  1628. params3.append("file", rr3);
  1629. commonAttach(params).then((r3) => {
  1630. if(idx3 == (_this.uploadFiles3.length-1)){
  1631. if(_this.form.capitalExpenditureType==2){
  1632. addProjectto(_this.projectForm).then(res => {
  1633. _this.chargeItme.map((resD,b) => {
  1634. resD.cashId = _this.form.id
  1635. addCashdetail(resD).then((a,rD) => {
  1636. if(b == (_this.chargeItme.length-1)){
  1637. _this.$toast.success('保存成功');
  1638. setTimeout(function(){
  1639. history.go(-1)
  1640. },2000)
  1641. }
  1642. })
  1643. })
  1644. })
  1645. } else if(_this.form.capitalExpenditureType==4){
  1646. addInfoto(_this.infoForm).then(res => {
  1647. _this.chargeItme.map((resD,b) => {
  1648. resD.cashId = _this.form.id
  1649. addCashdetail(resD).then((a,rD) => {
  1650. if(b == (_this.chargeItme.length-1)){
  1651. _this.$toast.success('保存成功');
  1652. setTimeout(function(){
  1653. history.go(-1)
  1654. },2000)
  1655. }
  1656. })
  1657. })
  1658. })
  1659. }else{
  1660. _this.chargeItme.map((resD,b) => {
  1661. resD.cashId = _this.form.id
  1662. addCashdetail(resD).then((a,rD) => {
  1663. if(b == (_this.chargeItme.length-1)){
  1664. _this.$toast.success('保存成功');
  1665. setTimeout(function(){
  1666. history.go(-1)
  1667. },2000)
  1668. }
  1669. })
  1670. })
  1671. }
  1672. }
  1673. })
  1674. })
  1675. }else{
  1676. if(_this.form.capitalExpenditureType==2){
  1677. addProjectto(_this.projectForm).then(res => {
  1678. _this.chargeItme.map((resD,b) => {
  1679. resD.cashId = _this.form.id
  1680. addCashdetail(resD).then((a,rD) => {
  1681. if(b == (_this.chargeItme.length-1)){
  1682. _this.$toast.success('保存成功');
  1683. setTimeout(function(){
  1684. history.go(-1)
  1685. },2000)
  1686. }
  1687. })
  1688. })
  1689. })
  1690. } else if(_this.form.capitalExpenditureType==4){
  1691. addInfoto(_this.infoForm).then(res => {
  1692. _this.chargeItme.map((resD,b) => {
  1693. resD.cashId = _this.form.id
  1694. addCashdetail(resD).then((a,rD) => {
  1695. if(b == (_this.chargeItme.length-1)){
  1696. _this.$toast.success('保存成功');
  1697. setTimeout(function(){
  1698. history.go(-1)
  1699. },2000)
  1700. }
  1701. })
  1702. })
  1703. })
  1704. }else{
  1705. _this.chargeItme.map((resD,b) => {
  1706. resD.cashId = _this.form.id
  1707. addCashdetail(resD).then((a,rD) => {
  1708. if(b == (_this.chargeItme.length-1)){
  1709. _this.$toast.success('保存成功');
  1710. setTimeout(function(){
  1711. history.go(-1)
  1712. },2000)
  1713. }
  1714. })
  1715. })
  1716. }
  1717. }
  1718. }
  1719. })
  1720. })
  1721. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1722. this.uploadFiles3.map((rr3,idx3) => {
  1723. let params = new FormData();
  1724. params.append("tableId", _this.form.id);
  1725. params.append("tableName", "t_yinnong_transfer");
  1726. params.append("bizPath", "yinnong");
  1727. params.append("fileType", "3");
  1728. params.append("file", rr3);
  1729. commonAttach(params).then((r) => {
  1730. if(idx3 == (_this.uploadFiles3.length-1)){
  1731. if(_this.form.capitalExpenditureType==2){
  1732. addProjectto(_this.projectForm).then(res => {
  1733. _this.chargeItme.map((resD,b) => {
  1734. resD.cashId = _this.form.id
  1735. addCashdetail(resD).then((a,rD) => {
  1736. if(b == (_this.chargeItme.length-1)){
  1737. _this.$toast.success('保存成功');
  1738. setTimeout(function(){
  1739. history.go(-1)
  1740. },2000)
  1741. }
  1742. })
  1743. })
  1744. })
  1745. } else if(_this.form.capitalExpenditureType==4){
  1746. addInfoto(_this.infoForm).then(res => {
  1747. _this.chargeItme.map((resD,b) => {
  1748. resD.cashId = _this.form.id
  1749. addCashdetail(resD).then((a,rD) => {
  1750. if(b == (_this.chargeItme.length-1)){
  1751. _this.$toast.success('保存成功');
  1752. setTimeout(function(){
  1753. history.go(-1)
  1754. },2000)
  1755. }
  1756. })
  1757. })
  1758. })
  1759. }else{
  1760. _this.chargeItme.map((resD,b) => {
  1761. resD.cashId = _this.form.id
  1762. addCashdetail(resD).then((a,rD) => {
  1763. if(b == (_this.chargeItme.length-1)){
  1764. _this.$toast.success('保存成功');
  1765. setTimeout(function(){
  1766. history.go(-1)
  1767. },2000)
  1768. }
  1769. })
  1770. })
  1771. }
  1772. }
  1773. })
  1774. })
  1775. }else{
  1776. if(this.form.capitalExpenditureType==2){
  1777. addProjectto(this.projectForm).then(res => {
  1778. _this.chargeItme.map((resD,b) => {
  1779. resD.cashId = _this.form.id
  1780. addCashdetail(resD).then((a,rD) => {
  1781. if(b == (_this.chargeItme.length-1)){
  1782. _this.$toast.success('保存成功');
  1783. setTimeout(function(){
  1784. history.go(-1)
  1785. },2000)
  1786. }
  1787. })
  1788. })
  1789. })
  1790. } else if(this.form.capitalExpenditureType==4){
  1791. addInfoto(this.infoForm).then(res => {
  1792. _this.chargeItme.map((resD,b) => {
  1793. resD.cashId = _this.form.id
  1794. addCashdetail(resD).then((a,rD) => {
  1795. if(b == (_this.chargeItme.length-1)){
  1796. _this.$toast.success('保存成功');
  1797. setTimeout(function(){
  1798. history.go(-1)
  1799. },2000)
  1800. }
  1801. })
  1802. })
  1803. })
  1804. }else{
  1805. _this.chargeItme.map((resD,b) => {
  1806. resD.cashId = _this.form.id
  1807. addCashdetail(resD).then((a,rD) => {
  1808. if(b == (_this.chargeItme.length-1)){
  1809. _this.$toast.success('保存成功');
  1810. setTimeout(function(){
  1811. history.go(-1)
  1812. },2000)
  1813. }
  1814. })
  1815. })
  1816. }
  1817. }
  1818. });
  1819. }
  1820. }
  1821. },
  1822. payeeSelectChange(select, i) {
  1823. let obj = {};
  1824. let fuzhitype = 0;
  1825. obj = this.payeeList.find((account) => {
  1826. //model就是上面的数据源
  1827. return account.id === select ; //筛选出匹配数据
  1828. });
  1829. if(this.chargeItme != [] && this.chargeItme.length>1){
  1830. this.chargeItme.some((value, index) => {
  1831. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  1832. fuzhitype = 2;
  1833. return true;
  1834. }
  1835. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  1836. fuzhitype = 1;
  1837. return true;
  1838. }
  1839. });
  1840. }
  1841. if(fuzhitype == 0){
  1842. this.$set(this.chargeItme[i], "payee",obj.payee)
  1843. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  1844. this.$set(this.chargeItme[i], "payeeId", obj.id);
  1845. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  1846. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  1847. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  1848. }else if(fuzhitype == 1){
  1849. this.$set(this.chargeItme[i], "payee",'')
  1850. this.$set(this.chargeItme[i], "bankType",'')
  1851. this.$set(this.chargeItme[i], "payeeId", '');
  1852. this.$set(this.chargeItme[i], "payeeAccount", '');
  1853. this.$set(this.chargeItme[i], "bankDeposit", '');
  1854. this.$set(this.chargeItme[i], "accountType", '');
  1855. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  1856. }else if(fuzhitype == 2){
  1857. this.$set(this.chargeItme[i], "payee",'')
  1858. this.$set(this.chargeItme[i], "bankType",'')
  1859. this.$set(this.chargeItme[i], "payeeId", '');
  1860. this.$set(this.chargeItme[i], "payeeAccount", '');
  1861. this.$set(this.chargeItme[i], "bankDeposit", '');
  1862. this.$set(this.chargeItme[i], "accountType", '');
  1863. this.$notify({ type: 'danger', message: '收款方已存在!' });
  1864. }
  1865. },
  1866. selectChange(select) {
  1867. let obj = {};
  1868. obj = this.payerOptions.find((account) => {
  1869. //model就是上面的数据源
  1870. return account.id === select; //筛选出匹配数据
  1871. });
  1872. if(obj.accountPassword != null && obj.accountPassword != "" &&
  1873. obj.bankType != null && obj.bankType != ""){
  1874. this.$set(this.form, "bookId", obj.bookId);
  1875. this.$set(this.form, "deptId", obj.deptId);
  1876. this.$set(this.form, "cashierId", obj.id);
  1877. this.$set(this.form, "payer", obj.accountName);
  1878. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1879. this.$set(this.form, "operatorCode", obj.operatorCode);
  1880. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1881. this.$set(this.form, "bankType", obj.bankType);
  1882. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  1883. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  1884. this.$set(this.form, "taccountId", obj.taccountId);
  1885. this.$set(this.form, "accountNo", obj.accountNo);
  1886. this.$set(this.form, "cifNo", obj.cifNo);
  1887. this.$set(this.form, "payerFrom", '1');
  1888. if(obj.bankType==1){
  1889. this.form.accountType = "1"
  1890. this.form.isPeers = null
  1891. this.accountTypeChange();
  1892. }else if(obj.bankType==2||obj.bankType==4){
  1893. this.form.accountType = null
  1894. this.form.isPeers = "Y"
  1895. this.accountTypeChange1();
  1896. }
  1897. }else{
  1898. if(obj.payerFrom==1){
  1899. this.diglogStatus = false;
  1900. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1901. this.$set(this.form,"payer","")
  1902. this.$set(this.form,"payerAccount","")
  1903. }else{
  1904. this.$set(this.form, "payerFrom", obj.parerFrom);
  1905. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1906. this.$set(this.form, "operatorCode", obj.operatorCode);
  1907. }else{
  1908. this.$set(this.form, "operatorCode", '');
  1909. }
  1910. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1911. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1912. }else{
  1913. this.$set(this.form, "enterpriseCode", '');
  1914. }
  1915. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1916. this.$set(this.form, "accountPassword", obj.accountPassword);
  1917. }else{
  1918. this.$set(this.form, "accountPassword", '');
  1919. }
  1920. this.$set(this.form, "bookId",'');
  1921. this.$set(this.form, "deptId", '');
  1922. this.$set(this.form, "cashierId", obj.id);
  1923. this.$set(this.form, "payer", obj.accountName);
  1924. this.$set(this.form, "bankType", obj.bankType);
  1925. if(obj.payerFrom==6){
  1926. getQmyeFlow(obj.id).then((response) => {
  1927. this.$set(this.form, "payerAccount", response.data);
  1928. });
  1929. }else {
  1930. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1931. }
  1932. }
  1933. }
  1934. },
  1935. beforeRead1(file) {
  1936. let subIndex = file.file.name.lastIndexOf(".");
  1937. let ext = file.file.name.substring(subIndex + 1, file.file.name.length);
  1938. if(ext !== 'png' || ext !== 'jpg'){
  1939. this.$set(file, "type", ext);
  1940. this.fileList1.splice(-1, 1);
  1941. this.fileList1.push(file);
  1942. this.uploadFiles1.push(file.file);
  1943. }
  1944. },
  1945. deleteFile1(file){
  1946. this.uploadFiles1.map((response,index) => {
  1947. if(file.file == response){
  1948. this.uploadFiles1.splice(index,1)
  1949. }
  1950. })
  1951. if(file.id){
  1952. systemAttachment(file.id).then((res) => {
  1953. });
  1954. }
  1955. },
  1956. beforeRead2(file) {
  1957. let subIndex = file.file.name.lastIndexOf(".");
  1958. let ext = file.file.name.substring(subIndex + 1, file.file.name.length);
  1959. if(ext !== 'png' || ext !== 'jpg'){
  1960. this.$set(file, "type", ext);
  1961. this.fileList2.splice(-1, 1);
  1962. this.fileList2.push(file);
  1963. this.uploadFiles2.push(file.file);
  1964. }
  1965. },
  1966. deleteFile2(file){
  1967. this.uploadFiles2.map((response,index) => {
  1968. if(file.file == response){
  1969. this.uploadFiles2.splice(index,1)
  1970. }
  1971. })
  1972. if(file.id){
  1973. systemAttachment(file.id).then((res) => {
  1974. });
  1975. }
  1976. },
  1977. beforeRead3(file) {
  1978. let subIndex = file.file.name.lastIndexOf(".");
  1979. let ext = file.file.name.substring(subIndex + 1, file.file.name.length);
  1980. if(ext !== 'png' || ext !== 'jpg'){
  1981. this.$set(file, "type", ext);
  1982. this.fileList3.splice(-1, 1);
  1983. this.fileList3.push(file);
  1984. this.uploadFiles3.push(file.file);
  1985. }
  1986. },
  1987. deleteFile3(file){
  1988. this.uploadFiles3.map((response,index) => {
  1989. if(file.file == response){
  1990. this.uploadFiles3.splice(index,1)
  1991. }
  1992. })
  1993. if(file.id){
  1994. systemAttachment(file.id).then((res) => {
  1995. });
  1996. }
  1997. },
  1998. getFileList(){
  1999. let oData1= {
  2000. tableId: this.$route.query.id,
  2001. tableName: "t_yinnong_transfer",
  2002. bizPath: "yinnong",
  2003. fileType: "1",
  2004. }
  2005. attachmentList(oData1).then(res => {
  2006. res.rows.map(r => {
  2007. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2008. let subIndex = r.fileName.lastIndexOf(".");
  2009. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  2010. this.fileList1.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  2011. })
  2012. })
  2013. let oData2= {
  2014. tableId: this.$route.query.id,
  2015. tableName: "t_yinnong_transfer",
  2016. bizPath: "yinnong",
  2017. fileType: "2",
  2018. }
  2019. attachmentList(oData2).then(res => {
  2020. res.rows.map(r => {
  2021. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2022. let subIndex = r.fileName.lastIndexOf(".");
  2023. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  2024. this.fileList2.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  2025. })
  2026. })
  2027. let oData3= {
  2028. tableId: this.$route.query.id,
  2029. tableName: "t_yinnong_transfer",
  2030. bizPath: "yinnong",
  2031. fileType: "3",
  2032. }
  2033. attachmentList(oData3).then(res => {
  2034. res.rows.map(r => {
  2035. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  2036. let subIndex = r.fileName.lastIndexOf(".");
  2037. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  2038. this.fileList3.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  2039. })
  2040. })
  2041. },
  2042. goBack(){
  2043. window.history.go(-1)
  2044. },
  2045. //删除家庭成员
  2046. deleteChargeItme(index){
  2047. this.chargeItme.splice(index,1)
  2048. },
  2049. },
  2050. }
  2051. </script>
  2052. <style scoped lang="scss">
  2053. .app-container {
  2054. padding: 2% 0;
  2055. }
  2056. .main_title{
  2057. font-size: 0.4rem;
  2058. color: #1D6FE9;
  2059. margin: 0.2rem 6%;
  2060. position: relative;
  2061. }
  2062. .main_box{
  2063. width: 96%;
  2064. margin: 0 auto;
  2065. border-radius: 6px;
  2066. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  2067. overflow: hidden;
  2068. background-color: #FFF;
  2069. }
  2070. .submitButton{
  2071. width: 80%;
  2072. margin: 0 auto;
  2073. background-color: #1D6FE9;
  2074. }
  2075. .addFamily{
  2076. position: absolute;
  2077. top: -2px;
  2078. right: 0;
  2079. border-radius: 50%;
  2080. }
  2081. .deleteFamily{
  2082. position: absolute;
  2083. top: 0rem;
  2084. right: 6%;
  2085. z-index: 9;
  2086. border-radius: 50%;
  2087. }
  2088. </style>