移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

1068 行
40 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. </div>
  79. <div class="main_box" style="margin-top: 10px;">
  80. <van-field
  81. label="转账附言"
  82. v-model="form.remark"
  83. type="textarea"
  84. placeholder="请输入转账附言"
  85. input-align="right"
  86. rows="3"
  87. label-width="auto"
  88. required
  89. :rules="[{ required: true , message:'请输入转账附言' }]"
  90. />
  91. </div>
  92. <div class="main_box" style="margin-top: 10px;">
  93. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  94. </div>
  95. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  96. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  97. <van-field
  98. readonly
  99. clickable
  100. label="项目名称"
  101. placeholder="请选择"
  102. v-model="projectForm.projectName"
  103. @click="showproject = true"
  104. input-align="right"
  105. right-icon="arrow-down"
  106. required
  107. :rules="[{ required: true , message:'请选择项目名称' }]"
  108. />
  109. <van-popup v-model="showproject" position="bottom">
  110. <van-picker
  111. show-toolbar
  112. :columns="projectList"
  113. @confirm="onConfirmProject"
  114. @cancel="showproject = false"
  115. />
  116. </van-popup>
  117. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  118. <van-field required :rules="[{ required: true , message:'请输入合同价款(元)' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  119. <van-field
  120. readonly
  121. clickable
  122. label="工程款类型"
  123. placeholder="请选择"
  124. v-model="projectFundType"
  125. @click="showFundType = true"
  126. input-align="right"
  127. right-icon="arrow-down"
  128. required
  129. :rules="[{ required: true , message:'请选择工程款类型' }]"
  130. />
  131. <van-popup v-model="showFundType" position="bottom">
  132. <van-picker
  133. show-toolbar
  134. :columns="projectFundTypeOptions"
  135. @confirm="onConfirmFundType"
  136. @cancel="showFundType = false"
  137. />
  138. </van-popup>
  139. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  140. </div>
  141. <p class="main_title" v-if="contractOpen">关联合同</p>
  142. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  143. <van-field
  144. readonly
  145. clickable
  146. label="合同"
  147. placeholder="请选择"
  148. v-model="infoForm.name"
  149. @click="showcontract = true"
  150. input-align="right"
  151. right-icon="arrow-down"
  152. required
  153. :rules="[{ required: true , message:'请选择项目名称' }]"
  154. />
  155. <van-popup v-model="showcontract" position="bottom">
  156. <van-picker
  157. show-toolbar
  158. :columns="infoList"
  159. @confirm="onConfirmContract"
  160. @cancel="showcontract = false"
  161. />
  162. </van-popup>
  163. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  164. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  165. </div>
  166. <p class="main_title">付款方信息</p>
  167. <div class="main_box">
  168. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  169. <van-field
  170. readonly
  171. clickable
  172. label="付款方"
  173. placeholder="请选择付款方"
  174. v-model="form.payer"
  175. @click="showpayer = true"
  176. input-align="right"
  177. right-icon="arrow-down"
  178. label-width="auto"
  179. required
  180. :rules="[{ required: true , message:'请选择付款方' }]"
  181. />
  182. <van-popup v-model="showpayer" position="bottom">
  183. <van-picker
  184. show-toolbar
  185. :columns="payerOptions"
  186. @confirm="onConfirmPayer($event)"
  187. @cancel="showpayer = false"
  188. />
  189. </van-popup>
  190. <van-field :rules="[{ required: true , message:'请输入账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  191. </div>
  192. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  193. <div class="main_box" style="margin-bottom: 15px;">
  194. <van-cell title="收款账户类型">
  195. <template #right-icon>
  196. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange">
  197. <van-radio name="1">公户</van-radio>
  198. <van-radio name="2">私户</van-radio>
  199. </van-radio-group>
  200. </template>
  201. </van-cell>
  202. </div>
  203. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  204. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  205. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  206. <van-field
  207. readonly
  208. clickable
  209. label="收款方"
  210. placeholder="请选择"
  211. v-model="item.payee"
  212. @click="item.showPayee = true"
  213. input-align="right"
  214. right-icon="arrow-down"
  215. required
  216. :rules="[{ required: true , message:'请选择收款方' }]"
  217. />
  218. <van-popup v-model="item.showPayee" position="bottom">
  219. <van-picker
  220. show-toolbar
  221. :columns="payeeList"
  222. @confirm="onConfirmPayee($event,index)"
  223. @cancel="item.showPayee = false"
  224. />
  225. </van-popup>
  226. <van-field required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  227. <van-field required :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入银行" input-align="right" label-width="auto"/>
  228. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  229. <van-field
  230. readonly
  231. clickable
  232. label="所属银行"
  233. placeholder="请选择"
  234. v-model="item.bankTypeText"
  235. @click="item.showbankType = true"
  236. input-align="right"
  237. right-icon="arrow-down"
  238. required
  239. :rules="[{ required: true , message:'请选择所属银行' }]"
  240. />
  241. <van-popup v-model="item.showbankType" position="bottom">
  242. <van-picker
  243. show-toolbar
  244. :columns="bankTypeDictionaries"
  245. @confirm="onConfirmBankType($event,index)"
  246. @cancel="item.showbankType = false"
  247. />
  248. </van-popup>
  249. </div>
  250. </div>
  251. <p class="main_title">上传附件</p>
  252. <div class="main_box" style="padding: 5px 0 0 8px;">
  253. <van-uploader v-model="fileList" :after-read="beforeRead" @delete="deleteFile"></van-uploader>
  254. </div>
  255. <div style="padding: 16px 0;">
  256. <van-row>
  257. <van-col span="12" align="center">
  258. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  259. </van-col>
  260. <van-col span="12" align="center">
  261. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  262. </van-col>
  263. </van-row>
  264. <div class="clear"></div>
  265. </div>
  266. </van-form>
  267. </div>
  268. </template>
  269. <script>
  270. import { getAccount , getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit ,getQmyeFlow , listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  271. import {
  272. attachmentList,
  273. commonAttach,listVaccount, listVaccount1,
  274. systemAttachment
  275. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  276. import request from '@/utils/request';
  277. import Dialog from "vant/lib/dialog";
  278. export default {
  279. name: "approvalModify2",
  280. data() {
  281. return {
  282. showcontract:false,
  283. showcapital:false,
  284. showpayee:false,
  285. showlasj:false,
  286. showbankType:false,
  287. showproject:false,
  288. showFundType:false,
  289. showpayer:false,
  290. minDate: new Date(2000, 1, 1),
  291. maxDate: new Date(2050, 12, 31),
  292. currentDate: new Date(),
  293. form:{},
  294. capitalExpenditureType:'',
  295. payee:'',
  296. bankType:'',
  297. buttonType:'a',
  298. wfydlxDictionaries:[],
  299. jglxDictionaries:[],
  300. sysDictionaries:[],
  301. capitalExpenditureTypeOptions:[],
  302. bankTypeDictionaries:[],
  303. infoList:[],
  304. projectList:[],
  305. projectFundTypeOptions:[],
  306. projectFundTypeDictionaries:[],
  307. payerOptions:[],
  308. chargeItme:[],
  309. chargeItmeShow:[],
  310. payeeList:[],
  311. // 查询参数
  312. queryParams: {
  313. transferType:"",
  314. orderByColumn: "id",
  315. isAsc: "desc",
  316. },
  317. capitalExpenditureOpen:false,
  318. contractOpen:false,
  319. projectForm:{
  320. projectId:null,
  321. projectName:null,
  322. projectContractor:null,
  323. projectAmount:null,
  324. projectBillNum:null,
  325. projectFundType:'1',
  326. outId:null,
  327. ynType:'1'
  328. },
  329. infoForm:{
  330. infoId:null,
  331. name:null,
  332. code:null,
  333. totalAmount:null,
  334. contractionId:null,
  335. transferId:null
  336. },
  337. // 合同信息查询参数
  338. queryContractionParams: {
  339. pageNum: 1,
  340. pageSize: 100,
  341. contractionStatus: '1',
  342. orderByColumn: "endTime",
  343. isAsc: "desc",
  344. },
  345. projectFundType:'',
  346. fileList:[],
  347. uploadFiles:[],
  348. };
  349. },
  350. created() {
  351. let queryParams={
  352. pageNum: 1,
  353. pageSize: 100,
  354. }
  355. listProject(queryParams).then(response => {
  356. this.projectList = response.rows;
  357. for (var i = 0; i < response.rows.length; i++) {
  358. this.$set(this.projectList[i],"text",response.rows[i].projectName)
  359. this.$set(this.projectList[i],"value",response.rows[i].id)
  360. }
  361. });
  362. listInfo(this.queryContractionParams).then(response => {
  363. this.infoList = response.rows;
  364. for (let i = 0; i < response.rows.length; i++) {
  365. this.$set(this.infoList[i],"text",response.rows[i].name)
  366. this.$set(this.infoList[i],"value",response.rows[i].code)
  367. }
  368. });
  369. this.getDicts("project_fund_type").then((response) => {
  370. for (var i = 0; i < response.data.length; i++) {
  371. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  372. }
  373. this.projectFundTypeDictionaries = response.data;
  374. });
  375. let params1={
  376. villageAccountType:'1',
  377. "params":{townAccountType:'1'}
  378. }
  379. listVaccount1(params1).then((response) => {
  380. this.payerOptions = response.rows;
  381. response.rows.map((res,index) => {
  382. res['payerFrom'] = '1'
  383. this.payerOptions[index].text = res.payee;
  384. this.payerOptions[index].value = res.id;
  385. })
  386. });
  387. this.getDictionaries();
  388. this.getFileList();
  389. },
  390. methods: {
  391. getDictionaries(){
  392. getTransfer(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' : '1'
  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. });
  425. queryTransferDetail(this.$route.query.id).then((response) => {
  426. this.getDicts("bank_type").then(res => {
  427. for (var i = 0; i < res.data.length; i++) {
  428. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  429. }
  430. for (var j = 0 ; j < response.rows.length ; j++){
  431. // response.rows[j].payeeText = response.rows[j].payee;
  432. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  433. response.rows[j].showPayee = false;
  434. }
  435. this.chargeItme = response.rows;
  436. });
  437. this.getPayeeList();
  438. });
  439. },
  440. getChange(){
  441. console.log(this.buttonType)
  442. if(this.buttonType == 'update'){
  443. console.log('update')
  444. this.goUpdate();
  445. }else if(this.buttonType == 'add'){
  446. console.log('add')
  447. this.goAdd();
  448. }
  449. },
  450. getError(e){
  451. console.log(e)
  452. this.$notify({ type: 'danger', message: e.errors[0].message });
  453. },
  454. addChargeItme(index){
  455. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  456. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  457. return;
  458. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  459. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  460. return;
  461. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  462. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  463. return;
  464. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  465. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  466. return;
  467. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  468. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  469. return;
  470. }
  471. this.getDicts("bank_type").then(res => {
  472. this.chargeItme.splice(index + 1, 0, {
  473. payeeId: "", //收款方ID
  474. payee: "", //收款方
  475. payeeAccount: "", //收款账户
  476. bankDeposit: "", //开户银行
  477. incomeAmount: "", //收入金额
  478. bankType: "1", //所属银行
  479. bankTypeText:this.selectDictLabel(res.data, 1), //所属银行
  480. showPayee:false,
  481. showbankType:false
  482. });
  483. });
  484. },
  485. getPayeeList() {
  486. //普通转账
  487. this.queryParams.accountType = this.form.accountType
  488. this.queryParams.status = "0"
  489. listPayee(this.queryParams).then((response) => {
  490. this.payeeList = response.rows;
  491. response.rows.map((res,index) => {
  492. if(res.payeeType==1||res.payeeType==2){
  493. this.payeeList[index].text = res.payee;
  494. this.payeeList[index].value = res.id;}
  495. })
  496. });
  497. },
  498. payeeDictLabel(datas, value) {
  499. var actions = [];
  500. Object.keys(datas).some((key) => {
  501. if (datas[key].payeeId == ('' + value)) {
  502. actions.push(datas[key].payee);
  503. return true;
  504. }
  505. })
  506. return actions.join('');
  507. },
  508. onConfirmCapital(data){
  509. if (data.value == 2){
  510. this.capitalExpenditureOpen = true;
  511. this.contractOpen = false
  512. this.infoForm = {};
  513. }else if(data.value == 4){
  514. this.capitalExpenditureOpen = false;
  515. this.contractOpen = true
  516. this.projectForm = {};
  517. }else{
  518. this.capitalExpenditureOpen = false;
  519. this.contractOpen = false
  520. this.projectForm = {};
  521. this.infoForm = {};
  522. }
  523. this.capitalExpenditureType = data.text;
  524. this.form.capitalExpenditureType = data.value;
  525. this.showcapital = false;
  526. },
  527. onConfirmFundType(data){
  528. console.log(data)
  529. this.projectForm.projectFundType = data.value;
  530. this.projectFundType = data.text;
  531. this.showFundType = false;
  532. },
  533. onConfirmProject(data){
  534. this.projectList.map(res => {
  535. if(res.projectName==data.text){
  536. this.projectForm.projectId = res.id
  537. this.projectForm.projectName = res.projectName
  538. this.projectForm.projectContractor = res.projectContractor
  539. this.projectForm.projectAmount = res.projectAmount
  540. }
  541. })
  542. this.showproject = false;
  543. },
  544. onConfirmContract(data){
  545. this.infoList.map(res => {
  546. if(res.name==data.text){
  547. this.infoForm.contractionId = res.id;
  548. this.infoForm.name = res.name;
  549. this.infoForm.code = res.code;
  550. this.infoForm.totalAmount = res.totalAmount;
  551. }
  552. })
  553. this.showcontract = false;
  554. },
  555. onConfirmPayee(data,index){
  556. console.log(data)
  557. for (var i = 0 ; i < this.chargeItme.length ; i++){
  558. this.chargeItme[i].showPayee = false;
  559. }
  560. this.chargeItme[index].payee = data.text;
  561. this.chargeItme[index].payeeId = data.value;
  562. this.payeeSelectChange(data.value , index)
  563. },
  564. onConfirmBankType(data,index){
  565. for (var i = 0 ; i < this.chargeItme.length ; i++){
  566. this.chargeItme[i].showbankType = false;
  567. }
  568. this.chargeItme[index].bankTypeText = data.text;
  569. this.chargeItme[index].bankType = data.value;
  570. this.chargeItme[index].showbankType = false;
  571. },
  572. onConfirmPayer(data){
  573. this.form.payer = data.text;
  574. this.form.cashierId = data.value;
  575. this.showpayer = false;
  576. this.selectChange(data.value)
  577. },
  578. onConfirmLasj(data){
  579. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  580. this.showlasj = false;
  581. },
  582. accountTypeChange(e){
  583. this.payeeList = [];
  584. this.chargeItme = [];
  585. this.queryParams.accountType = this.form.accountType
  586. this.queryParams.bankType = this.form.bankType
  587. this.queryParams.status = "0"
  588. listPayee(this.queryParams).then((response) => {
  589. response.rows.map((res,index) => {
  590. if(res.payeeType==1||res.payeeType==2){
  591. response.rows[index].text = res.payee;
  592. response.rows[index].value = res.id;
  593. this.payeeList.push(res)
  594. }
  595. })
  596. });
  597. },
  598. // 钱计算
  599. moneyChange(input) {
  600. console.log(input)
  601. let obj = {};
  602. obj = this.chargeItme.find((account) => {
  603. //model就是上面的数据源
  604. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  605. });
  606. let total = 0;
  607. this.chargeItme.forEach((money) => {
  608. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  609. });
  610. this.$set(this.form, "expenditureAmount", total);
  611. },
  612. goAdd(){
  613. if(this.chargeItme.length<1){
  614. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  615. return;
  616. }
  617. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  618. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  619. return;
  620. }
  621. if(this.form.capitalExpenditureType==2){
  622. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  623. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  624. return;
  625. }
  626. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  627. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  628. return;
  629. }
  630. }
  631. if(this.form.capitalExpenditureType==4){
  632. if(this.infoForm.name==""||this.infoForm.name==null){
  633. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  634. return;
  635. }
  636. if(this.infoForm.code==""||this.infoForm.code==null){
  637. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  638. return;
  639. }
  640. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  641. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  642. return;
  643. }
  644. }
  645. if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){
  646. Dialog.confirm({
  647. title: '提示',
  648. message: '此申请单中未上传任何附件,是否确认提交?',
  649. })
  650. .then(() => {
  651. this.$set(this.form, "payeeList", this.chargeItme);
  652. this.$set(this.form, "bankTypeList", this.chargeItme);
  653. this.$set(this.form, "accountTypeList", this.chargeItme);
  654. this.$set(this.form, "transferStatusList", this.chargeItme);
  655. updateTransfer(this.form).then(response => {
  656. this.projectForm.outId = this.form.id
  657. this.infoForm.transferId = this.form.id
  658. this.$set(this.projectForm, "ynType", '1');
  659. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  660. this.uploadFiles.map(rr => {
  661. const params = new FormData();
  662. params.append("tableId", this.form.id);
  663. params.append("tableName", "t_yinnong_transfer");
  664. params.append("bizPath", "upload");
  665. params.append("fileType", "0");
  666. params.append("file", rr);
  667. commonAttach(params).then((r) => {
  668. })
  669. })
  670. if(this.form.capitalExpenditureType==2){
  671. addProjectto(this.projectForm).then(res => {
  672. customSubmit(this.form.id).then(res => {
  673. this.$toast.success('提交成功');
  674. setTimeout(function(){
  675. history.go(-1)
  676. },2000)
  677. })
  678. })
  679. }else if(this.form.capitalExpenditureType==4){
  680. addInfoto(this.infoForm).then(res => {
  681. customSubmit(this.form.id).then(res => {
  682. this.$toast.success('提交成功');
  683. setTimeout(function(){
  684. history.go(-1)
  685. },2000)
  686. })
  687. })
  688. }else{
  689. customSubmit(this.form.id).then(res => {
  690. this.$toast.success('提交成功');
  691. setTimeout(function(){
  692. history.go(-1)
  693. },2000)
  694. })
  695. }
  696. }else{
  697. if(this.form.capitalExpenditureType==2){
  698. addProjectto(this.projectForm).then(res => {
  699. customSubmit(this.form.id).then(res => {
  700. this.$toast.success('提交成功');
  701. setTimeout(function(){
  702. history.go(-1)
  703. },2000)
  704. })
  705. })
  706. }else if(this.form.capitalExpenditureType==4){
  707. addInfoto(this.infoForm).then(res => {
  708. customSubmit(this.form.id).then(res => {
  709. this.$toast.success('提交成功');
  710. setTimeout(function(){
  711. history.go(-1)
  712. },2000)
  713. })
  714. })
  715. }else{
  716. customSubmit(this.form.id).then(res => {
  717. this.$toast.success('提交成功');
  718. setTimeout(function(){
  719. history.go(-1)
  720. },2000)
  721. })
  722. }
  723. }
  724. });
  725. })
  726. .catch(() => {
  727. return false;
  728. });
  729. }else{
  730. this.$set(this.form, "payeeList", this.chargeItme);
  731. this.$set(this.form, "bankTypeList", this.chargeItme);
  732. this.$set(this.form, "accountTypeList", this.chargeItme);
  733. this.$set(this.form, "transferStatusList", this.chargeItme);
  734. updateTransfer(this.form).then(response => {
  735. this.projectForm.outId = this.form.id
  736. this.infoForm.transferId = this.form.id
  737. this.$set(this.projectForm, "ynType", '1');
  738. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  739. this.uploadFiles.map(rr => {
  740. const params = new FormData();
  741. params.append("tableId", this.form.id);
  742. params.append("tableName", "t_yinnong_transfer");
  743. params.append("bizPath", "upload");
  744. params.append("fileType", "0");
  745. params.append("file", rr);
  746. commonAttach(params).then((r) => {
  747. })
  748. })
  749. if(this.form.capitalExpenditureType==2){
  750. addProjectto(this.projectForm).then(res => {
  751. customSubmit(this.form.id).then(res => {
  752. this.$toast.success('提交成功');
  753. setTimeout(function(){
  754. history.go(-1)
  755. },2000)
  756. })
  757. })
  758. } else if(this.form.capitalExpenditureType==4){
  759. addInfoto(this.infoForm).then(res => {
  760. customSubmit(this.form.id).then(res => {
  761. this.$toast.success('提交成功');
  762. setTimeout(function(){
  763. history.go(-1)
  764. },2000)
  765. })
  766. })
  767. }else{
  768. customSubmit(this.form.id).then(res => {
  769. this.$toast.success('提交成功');
  770. setTimeout(function(){
  771. history.go(-1)
  772. },2000)
  773. })
  774. }
  775. }else{
  776. if(this.form.capitalExpenditureType==2){
  777. addProjectto(this.projectForm).then(res => {
  778. customSubmit(this.form.id).then(res => {
  779. this.$toast.success('提交成功');
  780. setTimeout(function(){
  781. history.go(-1)
  782. },2000)
  783. })
  784. })
  785. } else if(this.form.capitalExpenditureType==4){
  786. addInfoto(this.infoForm).then(res => {
  787. customSubmit(this.form.id).then(res => {
  788. this.$toast.success('提交成功');
  789. setTimeout(function(){
  790. history.go(-1)
  791. },2000)
  792. })
  793. })
  794. }else{
  795. customSubmit(this.form.id).then(res => {
  796. this.$toast.success('提交成功');
  797. setTimeout(function(){
  798. history.go(-1)
  799. },2000)
  800. })
  801. }
  802. }
  803. });
  804. }
  805. },
  806. goUpdate(){
  807. if(this.chargeItme.length<1){
  808. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  809. return;
  810. }
  811. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  812. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  813. return;
  814. }
  815. if(this.form.capitalExpenditureType==2){
  816. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  817. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  818. return;
  819. }
  820. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  821. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  822. return;
  823. }
  824. }
  825. if(this.form.capitalExpenditureType==4){
  826. if(this.infoForm.name==""||this.infoForm.name==null){
  827. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  828. return;
  829. }
  830. if(this.infoForm.code==""||this.infoForm.code==null){
  831. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  832. return;
  833. }
  834. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  835. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  836. return;
  837. }
  838. }
  839. this.$set(this.form, "payeeList", this.chargeItme);
  840. this.$set(this.form, "bankTypeList", this.chargeItme);
  841. this.$set(this.form, "accountTypeList", this.chargeItme);
  842. this.$set(this.form, "transferStatusList", this.chargeItme);
  843. updateTransfer(this.form).then((response) => {
  844. this.projectForm.outId = this.form.id
  845. this.infoForm.transferId = this.form.id
  846. this.$set(this.projectForm, "ynType", '1');
  847. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  848. console.log(this.uploadFiles)
  849. this.uploadFiles.map(rr => {
  850. const params = new FormData();
  851. params.append("tableId", this.form.id);
  852. params.append("tableName", "t_yinnong_transfer");
  853. params.append("bizPath", "upload");
  854. params.append("fileType", "0");
  855. params.append("file", rr);
  856. commonAttach(params).then((r) => {
  857. })
  858. })
  859. if(this.form.capitalExpenditureType==2){
  860. addProjectto(this.projectForm).then(res => {
  861. this.$toast.success('保存成功');
  862. setTimeout(function(){
  863. history.go(-1)
  864. },2000)
  865. })
  866. }else if(this.form.capitalExpenditureType==4){
  867. addInfoto(this.infoForm).then(res => {
  868. this.$toast.success('保存成功');
  869. setTimeout(function(){
  870. history.go(-1)
  871. },2000)
  872. })
  873. }else{
  874. this.$toast.success('保存成功');
  875. setTimeout(function(){
  876. history.go(-1)
  877. },2000)
  878. }
  879. }else{
  880. if(this.form.capitalExpenditureType==2){
  881. addProjectto(this.projectForm).then(res => {
  882. this.$toast.success('保存成功');
  883. setTimeout(function(){
  884. history.go(-1)
  885. },2000)
  886. })
  887. }else if(this.form.capitalExpenditureType==4){
  888. addInfoto(this.infoForm).then(res => {
  889. this.$toast.success('保存成功');
  890. setTimeout(function(){
  891. history.go(-1)
  892. },2000)
  893. })
  894. }else{
  895. this.$toast.success('保存成功');
  896. setTimeout(function(){
  897. history.go(-1)
  898. },2000)
  899. }
  900. }
  901. });
  902. },
  903. payeeSelectChange(select, i) {
  904. let obj = {};
  905. let fuzhitype = 0;
  906. obj = this.payeeList.find((account) => {
  907. //model就是上面的数据源
  908. return account.id === select ; //筛选出匹配数据
  909. });
  910. if(this.chargeItme != [] && this.chargeItme.length>1){
  911. this.chargeItme.some((value, index) => {
  912. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  913. fuzhitype = 2;
  914. return true;
  915. }
  916. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  917. fuzhitype = 1;
  918. return true;
  919. }
  920. });
  921. }
  922. if(fuzhitype == 0){
  923. this.$set(this.chargeItme[i], "payee",obj.payee)
  924. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  925. this.$set(this.chargeItme[i], "payeeId", obj.id);
  926. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  927. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  928. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  929. }else if(fuzhitype == 1){
  930. this.$set(this.chargeItme[i], "payee",'')
  931. this.$set(this.chargeItme[i], "bankType",'')
  932. this.$set(this.chargeItme[i], "payeeId", '');
  933. this.$set(this.chargeItme[i], "payeeAccount", '');
  934. this.$set(this.chargeItme[i], "bankDeposit", '');
  935. this.$set(this.chargeItme[i], "accountType", '');
  936. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  937. }else if(fuzhitype == 2){
  938. this.$set(this.chargeItme[i], "payee",'')
  939. this.$set(this.chargeItme[i], "bankType",'')
  940. this.$set(this.chargeItme[i], "payeeId", '');
  941. this.$set(this.chargeItme[i], "payeeAccount", '');
  942. this.$set(this.chargeItme[i], "bankDeposit", '');
  943. this.$set(this.chargeItme[i], "accountType", '');
  944. this.$notify({ type: 'danger', message: '收款方已存在!' });
  945. }
  946. },
  947. selectChange(select) {
  948. let obj = {};
  949. obj = this.payerOptions.find((account) => {
  950. //model就是上面的数据源
  951. return account.id === select; //筛选出匹配数据
  952. });
  953. this.$set(this.form, "bookId", obj.bookId);
  954. this.$set(this.form, "deptId", obj.deptId);
  955. this.$set(this.form, "cashierId", obj.id);
  956. this.$set(this.form, "payer", obj.payee);
  957. this.$set(this.form, "payerAccount", obj.payeeAccount);
  958. this.$set(this.form, "operatorCode", obj.operatorCode);
  959. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  960. this.$set(this.form, "bankType", obj.bankType);
  961. this.$set(this.form, "payerFrom", '1');
  962. if(obj.bankType==1){
  963. this.form.accountType = "1"
  964. this.form.isPeers = null
  965. this.accountTypeChange();
  966. }else if(obj.bankType==2||obj.bankType==3){
  967. this.form.accountType = null
  968. this.form.isPeers = "Y"
  969. this.accountTypeChange1();
  970. }
  971. },
  972. beforeRead(file) {
  973. this.uploadFiles.push(file.file);
  974. },
  975. deleteFile(file){
  976. this.uploadFiles.map((response,index) => {
  977. if(file.file == response){
  978. this.uploadFiles.splice(index,1)
  979. }
  980. })
  981. if(file.id){
  982. systemAttachment(file.id).then((res) => {
  983. });
  984. }
  985. },
  986. getFileList(){
  987. let oData= {
  988. tableId: this.$route.query.id,
  989. tableName: "t_yinnong_transfer",
  990. bizPath: "upload",
  991. fileType: "0",
  992. }
  993. attachmentList(oData).then(res => {
  994. console.log(res)
  995. console.log(location.protocol+"//"+location.host+request.defaults.baseURL)
  996. res.rows.map(r => {
  997. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  998. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  999. console.log(r)
  1000. })
  1001. })
  1002. },
  1003. goBack(){
  1004. window.history.go(-1)
  1005. },
  1006. //删除家庭成员
  1007. deleteChargeItme(index){
  1008. this.chargeItme.splice(index,1)
  1009. },
  1010. },
  1011. }
  1012. </script>
  1013. <style scoped lang="scss">
  1014. .app-container {
  1015. padding: 2% 0;
  1016. }
  1017. .main_title{
  1018. font-size: 0.4rem;
  1019. color: #1D6FE9;
  1020. margin: 0.2rem 6%;
  1021. position: relative;
  1022. }
  1023. .main_box{
  1024. width: 96%;
  1025. margin: 0 auto;
  1026. border-radius: 6px;
  1027. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1028. overflow: hidden;
  1029. background-color: #FFF;
  1030. }
  1031. .submitButton{
  1032. width: 80%;
  1033. margin: 0 auto;
  1034. background-color: #1D6FE9;
  1035. }
  1036. .addFamily{
  1037. position: absolute;
  1038. top: -2px;
  1039. right: 0;
  1040. border-radius: 50%;
  1041. }
  1042. .deleteFamily{
  1043. position: absolute;
  1044. top: 0rem;
  1045. right: 6%;
  1046. z-index: 9;
  1047. border-radius: 50%;
  1048. }
  1049. </style>