移动端
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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