移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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