移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

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