移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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