移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2339 regels
112 KiB

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