移动端
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

1168 linhas
44 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">添加村户转账申请</p>
  11. </template>
  12. </van-nav-bar>
  13. <van-form @submit="getChange" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  14. <p class="main_title">基础信息</p>
  15. <div class="main_box">
  16. <van-field
  17. readonly
  18. clickable
  19. required
  20. :rules="[{ required: true , message:'请选择申请时间' }]"
  21. v-model="form.applyDate"
  22. label="申请时间"
  23. placeholder="请选择申请时间"
  24. @click="showlasj = true"
  25. input-align="right"
  26. right-icon="arrow-down"
  27. />
  28. <van-popup v-model="showlasj" position="bottom">
  29. <van-datetime-picker
  30. v-model="currentDate"
  31. type="date"
  32. title="选择年月日"
  33. :min-date="minDate"
  34. :max-date="maxDate"
  35. @confirm="onConfirmLasj"
  36. @cancel="showlasj = false"
  37. />
  38. </van-popup>
  39. <van-field
  40. readonly
  41. clickable
  42. required
  43. :rules="[{ required: true , message:'请选择资金支出类别' }]"
  44. label="资金支出类别"
  45. placeholder="请选择"
  46. v-model="capitalExpenditureType"
  47. @click="showcapital = true"
  48. input-align="right"
  49. right-icon="arrow-down"
  50. label-width="auto"
  51. />
  52. <van-popup v-model="showcapital" position="bottom">
  53. <van-picker
  54. show-toolbar
  55. :columns="capitalExpenditureTypeOptions"
  56. @confirm="onConfirmCapital"
  57. @cancel="showcapital = false"
  58. />
  59. </van-popup>
  60. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
  61. :rules="[{ required: true , message:'请选择审批模式' }]">
  62. <template #input>
  63. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  64. <van-radio name="1">线上支付</van-radio>
  65. <van-radio name="2">线下支付</van-radio>
  66. </van-radio-group>
  67. </template>
  68. </van-field>
  69. <van-field
  70. readonly
  71. required
  72. label="支出总金额"
  73. v-model="form.expenditureAmount"
  74. placeholder="根据下方收款金额自动核算"
  75. input-align="right"
  76. label-width="auto"
  77. />
  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="收款账户类型" v-if="form.bankType==1">
  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. <van-cell title="是否与付款方同行" v-if="form.bankType==2||form.bankType==3||form.bankType==4" >
  203. <template #right-icon>
  204. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  205. <van-radio name="Y">是</van-radio>
  206. <van-radio name="N">否</van-radio>
  207. </van-radio-group>
  208. </template>
  209. </van-cell>
  210. </div>
  211. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  212. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  213. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  214. <van-field
  215. readonly
  216. clickable
  217. label="收款方"
  218. placeholder="请选择"
  219. v-model="item.payee"
  220. @click="item.showPayee = true"
  221. input-align="right"
  222. right-icon="arrow-down"
  223. required
  224. :rules="[{ required: true , message:'请选择收款方' }]"
  225. />
  226. <van-popup v-model="item.showPayee" position="bottom">
  227. <van-picker
  228. show-toolbar
  229. :columns="payeeList"
  230. @confirm="onConfirmPayee($event,index)"
  231. @cancel="item.showPayee = false"
  232. />
  233. </van-popup>
  234. <van-field required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  235. <van-field required :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入银行" input-align="right" label-width="auto"/>
  236. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  237. <van-field
  238. readonly
  239. clickable
  240. label="所属银行"
  241. placeholder=""
  242. v-model="item.bankTypeText"
  243. input-align="right"
  244. required
  245. :rules="[{ required: true , message:'请选择所属银行' }]"
  246. />
  247. <!--<van-popup v-model="item.showbankType" position="bottom">
  248. <van-picker
  249. show-toolbar
  250. :columns="bankTypeDictionaries"
  251. @confirm="onConfirmBankType($event,index)"
  252. @cancel="item.showbankType = false"
  253. />
  254. </van-popup>-->
  255. </div>
  256. </div>
  257. <p class="main_title">上传附件</p>
  258. <div class="main_box" style="padding: 5px 0 0 8px;">
  259. <van-uploader v-model="fileList" :after-read="beforeRead" @delete="deleteFile"></van-uploader>
  260. </div>
  261. <div style="padding: 16px 0;">
  262. <van-row>
  263. <van-col span="12" align="center">
  264. <!-- @click="goUpdate"-->
  265. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  266. </van-col>
  267. <van-col span="12" align="center">
  268. <!-- @click="goAdd"-->
  269. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  270. </van-col>
  271. </van-row>
  272. <div class="clear"></div>
  273. </div>
  274. </van-form>
  275. </div>
  276. </template>
  277. <script>
  278. import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit , getAccount ,getQmyeFlow , attach ,listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  279. import request from '@/utils/request'
  280. import {attachmentList, commonAttach} from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  281. import Dialog from "vant/lib/dialog";
  282. export default {
  283. name: "approvalAdd",
  284. data() {
  285. return {
  286. showcontract:false,
  287. showcapital:false,
  288. showpayee:false,
  289. showlasj:false,
  290. showbankType:false,
  291. showproject:false,
  292. showFundType:false,
  293. showpayer:false,
  294. buttonType:'a',
  295. minDate: new Date(2000, 1, 1),
  296. maxDate: new Date(2050, 12, 31),
  297. currentDate: new Date(),
  298. form:{},
  299. fileList:[],
  300. capitalExpenditureType:'',
  301. payee:'',
  302. bankType:'',
  303. wfydlxDictionaries:[],
  304. jglxDictionaries:[],
  305. sysDictionaries:[],
  306. capitalExpenditureTypeOptions:[],
  307. bankTypeDictionaries:[],
  308. projectList:[],
  309. projectFundTypeOptions:[],
  310. projectFundTypeDictionaries:[],
  311. infoList:[],
  312. payerOptions:[],
  313. chargeItme:[],
  314. chargeItmeShow:[],
  315. payeeList:[],
  316. // 查询参数
  317. queryParams: {
  318. transferType:"",
  319. orderByColumn: "id",
  320. isAsc: "desc",
  321. },
  322. capitalExpenditureOpen:false,
  323. contractOpen:false,
  324. projectForm:{
  325. projectId:null,
  326. projectName:null,
  327. projectContractor:null,
  328. projectAmount:null,
  329. projectBillNum:null,
  330. projectFundType:'1',
  331. outId:null,
  332. ynType:'1'
  333. },
  334. infoForm:{
  335. infoId:null,
  336. name:null,
  337. code:null,
  338. totalAmount:null,
  339. contractionId:null,
  340. transferId:null
  341. },
  342. // 合同信息查询参数
  343. queryContractionParams: {
  344. pageNum: 1,
  345. pageSize: 100,
  346. contractionStatus: '1',
  347. orderByColumn: "endTime",
  348. isAsc: "desc",
  349. },
  350. projectFundType:'',
  351. uploadFiles:[],
  352. };
  353. },
  354. created() {
  355. this.reset();
  356. this.initProjectInfo();
  357. this.capitalExpenditureOpen = false
  358. this.getDicts("project_fund_type").then((response) => {
  359. for (var i = 0; i < response.data.length; i++) {
  360. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  361. }
  362. this.projectFundTypeDictionaries = response.data;
  363. });
  364. let params1={
  365. accountType: "102",
  366. "params":{townAccountType:'0'},
  367. status: "N",
  368. }
  369. getAccount(params1).then((response) => {
  370. this.payerOptions = response.rows;
  371. response.rows.map((res,index) => {
  372. res['payerFrom'] = '1'
  373. this.payerOptions[index].text = res.accountName;
  374. this.payerOptions[index].value = res.id;
  375. })
  376. });
  377. this.getDictionaries();
  378. },
  379. methods: {
  380. initProjectInfo(){
  381. let _this = this
  382. let queryParams={
  383. pageNum: 1,
  384. pageSize: 100,
  385. }
  386. listProject(queryParams).then(response => {
  387. _this.projectList = response.rows;
  388. console.log(response)
  389. for (let i = 0; i < response.rows.length; i++) {
  390. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  391. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  392. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  393. }
  394. });
  395. listInfo(this.queryContractionParams).then(response => {
  396. console.log(response)
  397. _this.infoList = response.rows;
  398. for (let i = 0; i < response.rows.length; i++) {
  399. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  400. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  401. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  402. }
  403. });
  404. },
  405. // 表单重置
  406. reset() {
  407. this.form = {
  408. id: null,
  409. upId: null,
  410. downId: null,
  411. orderId: null,
  412. cashierId: null,
  413. transferType: '1',
  414. accountType: null,
  415. isPeers:null,
  416. explainSituation: null,
  417. succeedAmount: null,
  418. payer: null,
  419. payerAccount: null,
  420. operatorCode: null,
  421. enterpriseCode: null,
  422. expenditureAmount: null,
  423. capitalExpenditureType: '1',
  424. remark: null,
  425. transferStatus: "0",
  426. auditStatus: "0",
  427. paymentState: "1",
  428. bankPriority: "0",
  429. clientPriority: "0"
  430. };
  431. this.processList = {}
  432. this.projectForm={
  433. projectId:null,
  434. projectName:null,
  435. projectContractor:null,
  436. projectAmount:null,
  437. projectBillNum:null,
  438. projectFundType:'1',
  439. outId:null,
  440. ynType:'1'
  441. }
  442. },
  443. getChange(){
  444. if(this.buttonType == 'update'){
  445. this.goUpdate();
  446. }else if(this.buttonType == 'add'){
  447. this.goAdd();
  448. }
  449. },
  450. getDictionaries(){
  451. this.getDicts("capital_expenditure_type").then((res) => {
  452. for (var i = 0; i < res.data.length; i++) {
  453. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  454. }
  455. });
  456. this.getDicts("bank_type").then(res => {
  457. for (var i = 0; i < res.data.length; i++) {
  458. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  459. }
  460. });
  461. },
  462. getError(e){
  463. console.log(e)
  464. this.$notify({ type: 'danger', message: e.errors[0].message });
  465. },
  466. addChargeItme(index){
  467. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  468. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  469. return;
  470. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  471. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  472. return;
  473. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  474. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  475. return;
  476. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  477. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  478. return;
  479. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  480. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  481. return;
  482. }
  483. this.getDicts("bank_type").then(res => {
  484. this.chargeItme.splice(index + 1, 0, {
  485. payeeId: "", //收款方ID
  486. payee: "", //收款方
  487. payeeAccount: "", //收款账户
  488. bankDeposit: "", //开户银行
  489. incomeAmount: "", //收入金额
  490. bankType: null, //所属银行
  491. bankTypeText:"", //所属银行
  492. showPayee:false,
  493. showbankType:false
  494. });
  495. });
  496. },
  497. getPayeeList() {
  498. //普通转账
  499. this.queryParams.status = "0"
  500. listPayee(this.queryParams).then((response) => {
  501. this.payeeList = response.rows;
  502. response.rows.map((res,index) => {
  503. if(res.payeeType==1||res.payeeType==2){
  504. this.payeeList[index].text = res.payee;
  505. this.payeeList[index].value = res.id;}
  506. })
  507. });
  508. },
  509. payeeDictLabel(datas, value) {
  510. var actions = [];
  511. Object.keys(datas).some((key) => {
  512. if (datas[key].payeeId == ('' + value)) {
  513. actions.push(datas[key].payee);
  514. return true;
  515. }
  516. })
  517. return actions.join('');
  518. },
  519. onConfirmCapital(data){
  520. if (data.value == 2){
  521. this.capitalExpenditureOpen = true;
  522. this.contractOpen = false
  523. this.infoForm = {};
  524. }else if(data.value == 4){
  525. this.capitalExpenditureOpen = false;
  526. this.contractOpen = true
  527. this.projectForm = {};
  528. }else{
  529. this.capitalExpenditureOpen = false;
  530. this.contractOpen = false
  531. this.projectForm = {};
  532. this.infoForm = {};
  533. }
  534. this.capitalExpenditureType = data.text;
  535. this.form.capitalExpenditureType = data.value;
  536. this.showcapital = false;
  537. },
  538. onConfirmFundType(data){
  539. console.log(data)
  540. this.projectForm.projectFundType = data.value;
  541. this.projectFundType = data.text;
  542. this.showFundType = 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. onConfirmProject(data){
  556. this.projectList.map(res => {
  557. if(res.projectName==data.text){
  558. this.projectForm.projectId = res.id
  559. this.projectForm.projectName = res.projectName
  560. this.projectForm.projectContractor = res.projectContractor
  561. this.projectForm.projectAmount = res.projectAmount
  562. }
  563. })
  564. this.showproject = false;
  565. },
  566. onConfirmPayee(data,index){
  567. for (var i = 0 ; i < this.chargeItme.length ; i++){
  568. this.chargeItme[i].showPayee = false;
  569. }
  570. this.chargeItme[index].payee = data.text;
  571. this.chargeItme[index].payeeId = data.value;
  572. this.chargeItme[index].showpayee = false;
  573. this.payeeSelectChange(data.value , index)
  574. console.log(data)
  575. },
  576. onConfirmBankType(data,index){
  577. for (var i = 0 ; i < this.chargeItme.length ; i++){
  578. this.chargeItme[i].showbankType = false;
  579. }
  580. this.chargeItme[index].bankTypeText = data.text;
  581. this.chargeItme[index].bankType = data.value;
  582. this.chargeItme[index].showbankType = false;
  583. },
  584. onConfirmPayer(data){
  585. this.form.payer = data.text;
  586. this.form.cashierId = data.value;
  587. this.showpayer = false;
  588. this.selectChange(data.value)
  589. },
  590. onConfirmLasj(data){
  591. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  592. this.showlasj = false;
  593. },
  594. accountTypeChange(e){
  595. this.payeeList = [];
  596. this.chargeItme = [];
  597. this.queryParams.isPeers = this.form.isPeers
  598. this.queryParams.accountType = this.form.accountType
  599. this.queryParams.bankType = this.form.bankType
  600. this.queryParams.status = "0"
  601. listPayee(this.queryParams).then((response) => {
  602. response.rows.map((res,index) => {
  603. if(res.payeeType==1||res.payeeType==2){
  604. response.rows[index].text = res.payee;
  605. response.rows[index].value = res.id;
  606. this.payeeList.push(res)
  607. }
  608. })
  609. });
  610. },
  611. accountTypeChange1(e){
  612. this.payeeList = [];
  613. this.chargeItme = [];
  614. this.queryParams.isPeers = this.form.isPeers
  615. this.queryParams.accountType = this.form.accountType
  616. this.queryParams.bankType = this.form.bankType
  617. this.queryParams.status = "0"
  618. listPayee(this.queryParams).then((response) => {
  619. response.rows.map((res,index) => {
  620. if(res.payeeType==1||res.payeeType==2){
  621. response.rows[index].text = res.payee;
  622. response.rows[index].value = res.id;
  623. this.payeeList.push(res)
  624. }
  625. })
  626. });
  627. },
  628. // 钱计算
  629. moneyChange(input) {
  630. console.log(input)
  631. let obj = {};
  632. obj = this.chargeItme.find((account) => {
  633. //model就是上面的数据源
  634. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  635. });
  636. let total = 0;
  637. this.chargeItme.forEach((money) => {
  638. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  639. });
  640. this.$set(this.form, "expenditureAmount", total);
  641. },
  642. goAdd(){
  643. if(this.chargeItme.length<1){
  644. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  645. return;
  646. }
  647. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  648. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  649. return;
  650. }
  651. if(this.form.capitalExpenditureType==2){
  652. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  653. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  654. return;
  655. }
  656. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  657. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  658. return;
  659. }
  660. }
  661. if(this.form.capitalExpenditureType==4){
  662. if(this.infoForm.name==""||this.infoForm.name==null){
  663. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  664. return;
  665. }
  666. if(this.infoForm.code==""||this.infoForm.code==null){
  667. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  668. return;
  669. }
  670. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  671. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  672. return;
  673. }
  674. }
  675. if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){
  676. Dialog.confirm({
  677. title: '提示',
  678. message: '此申请单中未上传任何附件,是否确认提交?',
  679. })
  680. .then(() => {
  681. this.$set(this.form, "payeeList", this.chargeItme);
  682. this.$set(this.form, "bankTypeList", this.chargeItme);
  683. this.$set(this.form, "accountTypeList", this.chargeItme);
  684. this.$set(this.form, "transferStatusList", this.chargeItme);
  685. addTransfer(this.form).then(response => {
  686. this.projectForm.outId = response.data.id
  687. this.infoForm.transferId = response.data.id
  688. this.$set(this.projectForm, "ynType", '1');
  689. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  690. this.uploadFiles.map(rr => {
  691. const params = new FormData();
  692. params.append("tableId", response.data.id);
  693. params.append("tableName", "t_yinnong_transfer");
  694. params.append("bizPath", "upload");
  695. params.append("fileType", "0");
  696. params.append("file", rr);
  697. commonAttach(params).then((r) => {
  698. })
  699. })
  700. if(this.form.capitalExpenditureType==2){
  701. addProjectto(this.projectForm).then(res => {
  702. customSubmit(response.data.id).then(res => {
  703. this.$toast.success('提交成功');
  704. setTimeout(function(){
  705. history.go(-1)
  706. },2000)
  707. })
  708. })
  709. }else if(this.form.capitalExpenditureType==4){
  710. addInfoto(this.infoForm).then(res => {
  711. customSubmit(response.data.id).then(res => {
  712. this.$toast.success('提交成功');
  713. setTimeout(function(){
  714. history.go(-1)
  715. },2000)
  716. })
  717. })
  718. }else{
  719. customSubmit(response.data.id).then(res => {
  720. this.$toast.success('提交成功');
  721. setTimeout(function(){
  722. history.go(-1)
  723. },2000)
  724. })
  725. }
  726. }else{
  727. if(this.form.capitalExpenditureType==2){
  728. addProjectto(this.projectForm).then(res => {
  729. customSubmit(response.data.id).then(res => {
  730. this.$toast.success('提交成功');
  731. setTimeout(function(){
  732. history.go(-1)
  733. },2000)
  734. })
  735. })
  736. }else if(this.form.capitalExpenditureType==4){
  737. addInfoto(this.infoForm).then(res => {
  738. customSubmit(response.data.id).then(res => {
  739. this.$toast.success('提交成功');
  740. setTimeout(function(){
  741. history.go(-1)
  742. },2000)
  743. })
  744. })
  745. }else{
  746. customSubmit(response.data.id).then(res => {
  747. this.$toast.success('提交成功');
  748. setTimeout(function(){
  749. history.go(-1)
  750. },2000)
  751. })
  752. }
  753. }
  754. });
  755. })
  756. .catch(() => {
  757. return false;
  758. });
  759. }else{
  760. this.$set(this.form, "payeeList", this.chargeItme);
  761. this.$set(this.form, "bankTypeList", this.chargeItme);
  762. this.$set(this.form, "accountTypeList", this.chargeItme);
  763. this.$set(this.form, "transferStatusList", this.chargeItme);
  764. addTransfer(this.form).then(response => {
  765. this.projectForm.outId = response.data.id
  766. this.infoForm.transferId = response.data.id
  767. this.$set(this.projectForm, "ynType", '1');
  768. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  769. this.uploadFiles.map(rr => {
  770. const params = new FormData();
  771. params.append("tableId", response.data.id);
  772. params.append("tableName", "t_yinnong_transfer");
  773. params.append("bizPath", "upload");
  774. params.append("fileType", "0");
  775. params.append("file", rr);
  776. commonAttach(params).then((r) => {
  777. })
  778. })
  779. if(this.form.capitalExpenditureType==2){
  780. addProjectto(this.projectForm).then(res => {
  781. customSubmit(response.data.id).then(res => {
  782. this.$toast.success('提交成功');
  783. setTimeout(function(){
  784. history.go(-1)
  785. },2000)
  786. })
  787. })
  788. } else if(this.form.capitalExpenditureType==4){
  789. addInfoto(this.infoForm).then(res => {
  790. customSubmit(response.data.id).then(res => {
  791. this.$toast.success('提交成功');
  792. setTimeout(function(){
  793. history.go(-1)
  794. },2000)
  795. })
  796. })
  797. }else{
  798. customSubmit(response.data.id).then(res => {
  799. this.$toast.success('提交成功');
  800. setTimeout(function(){
  801. history.go(-1)
  802. },2000)
  803. })
  804. }
  805. }else{
  806. if(this.form.capitalExpenditureType==2){
  807. addProjectto(this.projectForm).then(res => {
  808. customSubmit(response.data.id).then(res => {
  809. this.$toast.success('提交成功');
  810. setTimeout(function(){
  811. history.go(-1)
  812. },2000)
  813. })
  814. })
  815. } else if(this.form.capitalExpenditureType==4){
  816. addInfoto(this.infoForm).then(res => {
  817. customSubmit(response.data.id).then(res => {
  818. this.$toast.success('提交成功');
  819. setTimeout(function(){
  820. history.go(-1)
  821. },2000)
  822. })
  823. })
  824. }else{
  825. customSubmit(response.data.id).then(res => {
  826. this.$toast.success('提交成功');
  827. setTimeout(function(){
  828. history.go(-1)
  829. },2000)
  830. })
  831. }
  832. }
  833. });
  834. }
  835. },
  836. goUpdate(){
  837. if(this.chargeItme.length<1){
  838. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  839. return;
  840. }
  841. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  842. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  843. return;
  844. }
  845. if(this.form.capitalExpenditureType==2){
  846. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  847. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  848. return;
  849. }
  850. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  851. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  852. return;
  853. }
  854. }
  855. if(this.form.capitalExpenditureType==4){
  856. if(this.infoForm.name==""||this.infoForm.name==null){
  857. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  858. return;
  859. }
  860. if(this.infoForm.code==""||this.infoForm.code==null){
  861. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  862. return;
  863. }
  864. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  865. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  866. return;
  867. }
  868. }
  869. this.$set(this.form, "payeeList", this.chargeItme);
  870. this.$set(this.form, "bankTypeList", this.chargeItme);
  871. this.$set(this.form, "accountTypeList", this.chargeItme);
  872. this.$set(this.form, "transferStatusList", this.chargeItme);
  873. addTransfer(this.form).then((response) => {
  874. this.projectForm.outId = response.data.id
  875. this.infoForm.transferId = response.data.id
  876. this.$set(this.projectForm, "ynType", '1');
  877. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  878. this.uploadFiles.map(rr => {
  879. const params = new FormData();
  880. params.append("tableId", response.data.id);
  881. params.append("tableName", "t_yinnong_transfer");
  882. params.append("bizPath", "upload");
  883. params.append("fileType", "0");
  884. params.append("file", rr);
  885. commonAttach(params).then((r) => {
  886. })
  887. })
  888. if(this.form.capitalExpenditureType==2){
  889. addProjectto(this.projectForm).then(res => {
  890. this.$toast.success('保存成功');
  891. setTimeout(function(){
  892. history.go(-1)
  893. },2000)
  894. })
  895. }else if(this.form.capitalExpenditureType==4){
  896. addInfoto(this.infoForm).then(res => {
  897. this.$toast.success('保存成功');
  898. setTimeout(function(){
  899. history.go(-1)
  900. },2000)
  901. })
  902. }else{
  903. this.$toast.success('保存成功');
  904. setTimeout(function(){
  905. history.go(-1)
  906. },2000)
  907. }
  908. }else{
  909. if(this.form.capitalExpenditureType==2){
  910. addProjectto(this.projectForm).then(res => {
  911. this.$toast.success('保存成功');
  912. setTimeout(function(){
  913. history.go(-1)
  914. },2000)
  915. })
  916. }else if(this.form.capitalExpenditureType==4){
  917. addInfoto(this.infoForm).then(res => {
  918. this.$toast.success('保存成功');
  919. setTimeout(function(){
  920. history.go(-1)
  921. },2000)
  922. })
  923. }else{
  924. this.$toast.success('保存成功');
  925. setTimeout(function(){
  926. history.go(-1)
  927. },2000)
  928. }
  929. }
  930. });
  931. },
  932. payeeSelectChange(select, i) {
  933. let obj = {};
  934. let fuzhitype = 0;
  935. obj = this.payeeList.find((account) => {
  936. //model就是上面的数据源
  937. return account.id === select ; //筛选出匹配数据
  938. });
  939. let _this = this
  940. if(this.chargeItme != [] && this.chargeItme.length>1){
  941. this.chargeItme.some((value, index) => {
  942. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  943. fuzhitype = 2;
  944. return true;
  945. }
  946. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  947. fuzhitype = 1;
  948. return true;
  949. }
  950. });
  951. }
  952. if(fuzhitype == 0){
  953. this.$set(this.chargeItme[i], "payee",obj.payee)
  954. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  955. this.$set(this.chargeItme[i], "payeeId", obj.id);
  956. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  957. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  958. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  959. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  960. _this.bankTypeDictionaries.map(rr => {
  961. if(rr.value==obj.bankType){
  962. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  963. }
  964. })
  965. }else if(fuzhitype == 1){
  966. this.$set(this.chargeItme[i], "payee",'')
  967. this.$set(this.chargeItme[i], "bankType",'')
  968. this.$set(this.chargeItme[i], "payeeId", '');
  969. this.$set(this.chargeItme[i], "payeeAccount", '');
  970. this.$set(this.chargeItme[i], "bankDeposit", '');
  971. this.$set(this.chargeItme[i], "accountType", '');
  972. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  973. this.$set(this.chargeItme[i], "bankTypeText", '');
  974. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  975. }else if(fuzhitype == 2){
  976. this.$set(this.chargeItme[i], "payee",'')
  977. this.$set(this.chargeItme[i], "bankType",'')
  978. this.$set(this.chargeItme[i], "payeeId", '');
  979. this.$set(this.chargeItme[i], "payeeAccount", '');
  980. this.$set(this.chargeItme[i], "bankDeposit", '');
  981. this.$set(this.chargeItme[i], "accountType", '');
  982. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  983. this.$set(this.chargeItme[i], "bankTypeText", '');
  984. this.$notify({ type: 'danger', message: '收款方已存在!' });
  985. }
  986. },
  987. selectChange(select) {
  988. let obj = {};
  989. obj = this.payerOptions.find((account) => {
  990. //model就是上面的数据源
  991. return account.id === select; //筛选出匹配数据
  992. });
  993. if(obj.accountPassword != null && obj.accountPassword != "" &&
  994. obj.bankType != null && obj.bankType != ""){
  995. this.$set(this.form, "bookId", obj.bookId);
  996. this.$set(this.form, "deptId", obj.deptId);
  997. this.$set(this.form, "cashierId", obj.id);
  998. this.$set(this.form, "payer", obj.accountName);
  999. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1000. this.$set(this.form, "operatorCode", obj.operatorCode);
  1001. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1002. this.$set(this.form, "bankType", obj.bankType);
  1003. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  1004. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  1005. this.$set(this.form, "taccountId", obj.taccountId);
  1006. this.$set(this.form, "accountNo", obj.accountNo);
  1007. this.$set(this.form, "cifNo", obj.cifNo);
  1008. this.$set(this.form, "payerFrom", '1');
  1009. if(obj.bankType==1){
  1010. this.form.accountType = "1"
  1011. this.form.isPeers = null
  1012. this.accountTypeChange();
  1013. }else if(obj.bankType==2||obj.bankType==4){
  1014. this.form.accountType = null
  1015. this.form.isPeers = "Y"
  1016. this.accountTypeChange1();
  1017. }
  1018. }else{
  1019. if(obj.payerFrom==1){
  1020. this.diglogStatus = false;
  1021. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1022. this.$set(this.form,"payer","")
  1023. this.$set(this.form,"payerAccount","")
  1024. }else{
  1025. this.$set(this.form, "payerFrom", obj.parerFrom);
  1026. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1027. this.$set(this.form, "operatorCode", obj.operatorCode);
  1028. }else{
  1029. this.$set(this.form, "operatorCode", '');
  1030. }
  1031. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1032. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1033. }else{
  1034. this.$set(this.form, "enterpriseCode", '');
  1035. }
  1036. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1037. this.$set(this.form, "accountPassword", obj.accountPassword);
  1038. }else{
  1039. this.$set(this.form, "accountPassword", '');
  1040. }
  1041. this.$set(this.form, "bookId",'');
  1042. this.$set(this.form, "deptId", '');
  1043. this.$set(this.form, "cashierId", obj.id);
  1044. this.$set(this.form, "payer", obj.accountName);
  1045. this.$set(this.form, "bankType", obj.bankType);
  1046. if(obj.payerFrom==6){
  1047. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1048. this.$set(this.form, "payerAccount", response.data);
  1049. });
  1050. }else {
  1051. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1052. }
  1053. }
  1054. }
  1055. },
  1056. beforeRead(file) {
  1057. this.uploadFiles.push(file.file);
  1058. },
  1059. deleteFile(file){
  1060. this.uploadFiles.map((response,index) => {
  1061. if(file.file == response){
  1062. this.uploadFiles.splice(index,1)
  1063. }
  1064. })
  1065. },
  1066. getFileList(){
  1067. let oData1= {
  1068. tableId: this.$route.query.id,
  1069. tableName: "t_yinnong_transfer",
  1070. bizPath: "upload",
  1071. fileType: "1",
  1072. }
  1073. attachmentList(oData1).then(res => {
  1074. res.rows.map(r => {
  1075. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1076. this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1077. })
  1078. })
  1079. let oData2= {
  1080. tableId: this.$route.query.id,
  1081. tableName: "t_yinnong_transfer",
  1082. bizPath: "upload",
  1083. fileType: "2",
  1084. }
  1085. attachmentList(oData2).then(res => {
  1086. res.rows.map(r => {
  1087. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1088. this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1089. })
  1090. })
  1091. let oData3= {
  1092. tableId: this.$route.query.id,
  1093. tableName: "t_yinnong_transfer",
  1094. bizPath: "upload",
  1095. fileType: "3",
  1096. }
  1097. attachmentList(oData3).then(res => {
  1098. res.rows.map(r => {
  1099. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1100. this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1101. })
  1102. })
  1103. },
  1104. goBack(){
  1105. window.history.go(-1)
  1106. },
  1107. deleteChargeItme(index){
  1108. this.chargeItme.splice(index,1)
  1109. },
  1110. },
  1111. }
  1112. </script>
  1113. <style scoped lang="scss">
  1114. .app-container {
  1115. padding: 2% 0;
  1116. }
  1117. .main_title{
  1118. font-size: 0.4rem;
  1119. color: #1D6FE9;
  1120. margin: 0.2rem 6%;
  1121. position: relative;
  1122. }
  1123. .main_box{
  1124. width: 96%;
  1125. margin: 0 auto;
  1126. border-radius: 6px;
  1127. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1128. overflow: hidden;
  1129. background-color: #FFF;
  1130. }
  1131. .submitButton{
  1132. width: 80%;
  1133. margin: 0 auto;
  1134. background-color: #1D6FE9;
  1135. }
  1136. .addFamily{
  1137. position: absolute;
  1138. top: -2px;
  1139. right: 0;
  1140. border-radius: 50%;
  1141. }
  1142. .deleteFamily{
  1143. position: absolute;
  1144. top: 0rem;
  1145. right: 6%;
  1146. z-index: 9;
  1147. border-radius: 50%;
  1148. }
  1149. </style>