移动端
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

approvalAdd4.vue 43 KiB

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