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

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