移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
2 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121
  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="收款账户类型" 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==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" 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 0;">
  259. <van-cell value="收据" />
  260. <van-uploader v-model="fileList1" :after-read="beforeRead1" @delete="deleteFile1" style="margin-left:8px;"></van-uploader>
  261. <van-cell title="发票" />
  262. <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" style="margin-left:8px;"></van-uploader>
  263. <van-cell title="其他" />
  264. <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" style="margin-left:8px;"></van-uploader>
  265. </div>
  266. <div style="padding: 16px 0;">
  267. <van-row>
  268. <van-col span="12" align="center">
  269. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  270. </van-col>
  271. <van-col span="12" align="center">
  272. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  273. </van-col>
  274. </van-row>
  275. <div class="clear"></div>
  276. </div>
  277. </van-form>
  278. </div>
  279. </template>
  280. <script>
  281. import { getAccount , getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit ,getQmyeFlow,listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  282. import {
  283. attachmentList,
  284. commonAttach, listVaccount, listVaccount1,
  285. systemAttachment
  286. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  287. import request from '@/utils/request';
  288. import Dialog from "vant/lib/dialog";
  289. export default {
  290. name: "approvalModify4",
  291. data() {
  292. return {
  293. showcontract:false,
  294. showcapital:false,
  295. showpayee:false,
  296. showlasj:false,
  297. showbankType:false,
  298. showproject:false,
  299. showFundType:false,
  300. showpayer:false,
  301. minDate: new Date(2000, 1, 1),
  302. maxDate: new Date(2050, 12, 31),
  303. currentDate: new Date(),
  304. form:{},
  305. capitalExpenditureType:'',
  306. payee:'',
  307. bankType:'',
  308. buttonType:'a',
  309. wfydlxDictionaries:[],
  310. jglxDictionaries:[],
  311. sysDictionaries:[],
  312. capitalExpenditureTypeOptions:[],
  313. bankTypeDictionaries:[],
  314. infoList:[],
  315. projectList:[],
  316. projectFundTypeOptions:[],
  317. projectFundTypeDictionaries:[],
  318. payerOptions:[],
  319. chargeItme:[],
  320. chargeItmeShow:[],
  321. payeeList:[],
  322. // 查询参数
  323. queryParams: {
  324. transferType:"",
  325. orderByColumn: "id",
  326. isAsc: "desc",
  327. },
  328. capitalExpenditureOpen:false,
  329. contractOpen:false,
  330. projectForm:{
  331. projectId:null,
  332. projectName:null,
  333. projectContractor:null,
  334. projectAmount:null,
  335. projectBillNum:null,
  336. projectFundType:'1',
  337. outId:null,
  338. ynType:'1'
  339. },
  340. infoForm:{
  341. infoId:null,
  342. name:null,
  343. code:null,
  344. totalAmount:null,
  345. contractionId:null,
  346. transferId:null
  347. },
  348. // 合同信息查询参数
  349. queryContractionParams: {
  350. pageNum: 1,
  351. pageSize: 100,
  352. contractionStatus: '1',
  353. orderByColumn: "endTime",
  354. isAsc: "desc",
  355. },
  356. projectFundType:'',
  357. fileList1:[],
  358. fileList2:[],
  359. fileList3:[],
  360. uploadFiles1:[],
  361. uploadFiles2:[],
  362. uploadFiles3:[],
  363. };
  364. },
  365. created() {
  366. let queryParams={
  367. pageNum: 1,
  368. pageSize: 100,
  369. }
  370. listProject(queryParams).then(response => {
  371. this.projectList = response.rows;
  372. for (var i = 0; i < response.rows.length; i++) {
  373. this.$set(this.projectList[i],"text",response.rows[i].projectName)
  374. this.$set(this.projectList[i],"value",response.rows[i].id)
  375. }
  376. });
  377. listInfo(this.queryContractionParams).then(response => {
  378. this.infoList = response.rows;
  379. for (let i = 0; i < response.rows.length; i++) {
  380. this.$set(this.infoList[i],"text",response.rows[i].name)
  381. this.$set(this.infoList[i],"value",response.rows[i].code)
  382. }
  383. });
  384. this.getDicts("project_fund_type").then((response) => {
  385. for (var i = 0; i < response.data.length; i++) {
  386. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  387. }
  388. this.projectFundTypeDictionaries = response.data;
  389. });
  390. let params1={
  391. villageAccountType:'1',
  392. "params":{townAccountType:'1'}
  393. }
  394. listVaccount1(params1).then((response) => {
  395. this.payerOptions = response.rows;
  396. response.rows.map((res,index) => {
  397. res['payerFrom'] = '1'
  398. this.payerOptions[index].text = res.payee;
  399. this.payerOptions[index].value = res.id;
  400. })
  401. });
  402. this.getDictionaries();
  403. this.getFileList();
  404. },
  405. methods: {
  406. getDictionaries(){
  407. getTransfer(this.$route.query.id).then((response) => {
  408. this.getDicts("capital_expenditure_type").then((res) => {
  409. for (var i = 0; i < res.data.length; i++) {
  410. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  411. }
  412. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  413. });
  414. if(response.data.capitalExpenditureType==2){
  415. this.capitalExpenditureOpen = true
  416. let param={
  417. 'outId' : response.data.id,
  418. 'ynType' : '1'
  419. }
  420. getProjectto(param).then(res => {
  421. console.log(this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType))
  422. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  423. this.projectForm = res.data
  424. console.log(res.data)
  425. })
  426. }else if(response.data.capitalExpenditureType==4){
  427. this.contractOpen = true
  428. let param={
  429. 'transferId' : response.data.id
  430. }
  431. console.log(param)
  432. getInfoto(param).then(res => {
  433. this.infoForm = res.data
  434. })
  435. }else{
  436. this.showproject = false
  437. }
  438. this.form = response.data;
  439. this.getPayeeList();
  440. });
  441. queryTransferDetail(this.$route.query.id).then((response) => {
  442. this.getDicts("bank_type").then(res => {
  443. for (var i = 0; i < res.data.length; i++) {
  444. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  445. }
  446. for (var j = 0 ; j < response.rows.length ; j++){
  447. // response.rows[j].payeeText = response.rows[j].payee;
  448. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  449. response.rows[j].showPayee = false;
  450. }
  451. this.chargeItme = response.rows;
  452. console.log(this.chargeItme)
  453. });
  454. });
  455. },
  456. getChange(){
  457. console.log(this.buttonType)
  458. if(this.buttonType == 'update'){
  459. console.log('update')
  460. this.goUpdate();
  461. }else if(this.buttonType == 'add'){
  462. console.log('add')
  463. this.goAdd();
  464. }
  465. },
  466. getError(e){
  467. console.log(e)
  468. this.$notify({ type: 'danger', message: e.errors[0].message });
  469. },
  470. addChargeItme(index){
  471. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  472. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  473. return;
  474. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  475. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  476. return;
  477. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  478. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  479. return;
  480. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  481. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  482. return;
  483. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  484. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  485. return;
  486. }
  487. this.getDicts("bank_type").then(res => {
  488. this.chargeItme.splice(index + 1, 0, {
  489. payeeId: "", //收款方ID
  490. payee: "", //收款方
  491. payeeAccount: "", //收款账户
  492. bankDeposit: "", //开户银行
  493. incomeAmount: "", //收入金额
  494. bankType:null, //所属银行
  495. bankTypeText:"", //所属银行
  496. showPayee:false,
  497. showbankType:false
  498. });
  499. });
  500. },
  501. getPayeeList() {
  502. //普通转账
  503. this.queryParams.isPeers = this.form.isPeers
  504. this.queryParams.accountType = this.form.accountType
  505. this.queryParams.status = "0"
  506. listPayee(this.queryParams).then((response) => {
  507. response.rows.map((res,index) => {
  508. if(res.payeeType==1||res.payeeType==2){
  509. res.text = res.payee;
  510. res.value = res.id;
  511. this.payeeList.push(res)
  512. }
  513. })
  514. });
  515. },
  516. payeeDictLabel(datas, value) {
  517. var actions = [];
  518. Object.keys(datas).some((key) => {
  519. if (datas[key].payeeId == ('' + value)) {
  520. actions.push(datas[key].payee);
  521. return true;
  522. }
  523. })
  524. return actions.join('');
  525. },
  526. onConfirmCapital(data){
  527. if (data.value == 2){
  528. this.capitalExpenditureOpen = true;
  529. this.contractOpen = false
  530. this.infoForm = {};
  531. }else if(data.value == 4){
  532. this.capitalExpenditureOpen = false;
  533. this.contractOpen = true
  534. this.projectForm = {};
  535. }else{
  536. this.capitalExpenditureOpen = false;
  537. this.contractOpen = false
  538. this.projectForm = {};
  539. this.infoForm = {};
  540. }
  541. this.capitalExpenditureType = data.text;
  542. this.form.capitalExpenditureType = data.value;
  543. this.showcapital = false;
  544. },
  545. onConfirmFundType(data){
  546. console.log(data)
  547. this.projectForm.projectFundType = data.value;
  548. this.projectFundType = data.text;
  549. this.showFundType = false;
  550. },
  551. onConfirmProject(data){
  552. this.projectList.map(res => {
  553. if(res.projectName==data.text){
  554. this.projectForm.projectId = res.id
  555. this.projectForm.projectName = res.projectName
  556. this.projectForm.projectContractor = res.projectContractor
  557. this.projectForm.projectAmount = res.projectAmount
  558. }
  559. })
  560. this.showproject = false;
  561. },
  562. onConfirmContract(data){
  563. this.infoList.map(res => {
  564. if(res.name==data.text){
  565. this.infoForm.contractionId = res.id;
  566. this.infoForm.name = res.name;
  567. this.infoForm.code = res.code;
  568. this.infoForm.totalAmount = res.totalAmount;
  569. }
  570. })
  571. this.showcontract = false;
  572. },
  573. onConfirmPayee(data,index){
  574. for (let i = 0 ; i < this.chargeItme.length ; i++){
  575. this.chargeItme[i].showPayee = false;
  576. }
  577. this.chargeItme[index].payee = data.text;
  578. this.chargeItme[index].payeeId = data.value;
  579. this.chargeItme[index].showpayee = false;
  580. this.payeeSelectChange(data.value , index)
  581. this.onConfirmBankType(data,index)
  582. },
  583. onConfirmBankType(data,index){
  584. console.log(this.bankTypeDictionaries)
  585. this.bankTypeDictionaries.map(res => {
  586. if(res.value==data.bankType){
  587. this.chargeItme[index].bankTypeText = res.text;
  588. this.chargeItme[index].bankType = res.value;
  589. }
  590. })
  591. },
  592. onConfirmPayer(data){
  593. this.form.payer = data.text;
  594. this.form.cashierId = data.value;
  595. this.showpayer = false;
  596. this.selectChange(data.value)
  597. },
  598. onConfirmLasj(data){
  599. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  600. this.showlasj = false;
  601. },
  602. accountTypeChange(e){
  603. this.payeeList = [];
  604. this.chargeItme = [];
  605. this.queryParams.accountType = this.form.accountType
  606. this.queryParams.bankType = this.form.bankType
  607. this.queryParams.status = "0"
  608. listPayee(this.queryParams).then((response) => {
  609. response.rows.map((res,index) => {
  610. if(res.payeeType==1||res.payeeType==2){
  611. response.rows[index].text = res.payee;
  612. response.rows[index].value = res.id;
  613. this.payeeList.push(res)
  614. }
  615. })
  616. });
  617. },
  618. accountTypeChange1(e){
  619. this.payeeList = [];
  620. this.chargeItme = [];
  621. this.queryParams.isPeers = this.form.isPeers
  622. this.queryParams.bankType = this.form.bankType
  623. this.queryParams.status = "0"
  624. listPayee(this.queryParams).then((response) => {
  625. response.rows.map((res,index) => {
  626. if(res.payeeType==1||res.payeeType==2){
  627. response.rows[index].text = res.payee;
  628. response.rows[index].value = res.id;
  629. this.payeeList.push(res)
  630. }
  631. })
  632. });
  633. },
  634. // 钱计算
  635. moneyChange(input) {
  636. console.log(input)
  637. let obj = {};
  638. obj = this.chargeItme.find((account) => {
  639. //model就是上面的数据源
  640. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  641. });
  642. let total = 0;
  643. this.chargeItme.forEach((money) => {
  644. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  645. });
  646. this.$set(this.form, "expenditureAmount", total);
  647. },
  648. goAdd(){
  649. if(this.chargeItme.length<1){
  650. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  651. return;
  652. }
  653. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  654. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  655. return;
  656. }
  657. if(this.form.capitalExpenditureType==2){
  658. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  659. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  660. return;
  661. }
  662. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  663. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  664. return;
  665. }
  666. }
  667. if(this.form.capitalExpenditureType==4){
  668. if(this.infoForm.name==""||this.infoForm.name==null){
  669. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  670. return;
  671. }
  672. if(this.infoForm.code==""||this.infoForm.code==null){
  673. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  674. return;
  675. }
  676. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  677. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  678. return;
  679. }
  680. }
  681. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
  682. Dialog.confirm({
  683. title: '提示',
  684. message: '此申请单中未上传任何附件,是否确认提交?',
  685. })
  686. .then(() => {
  687. this.$set(this.form, "payeeList", this.chargeItme);
  688. this.$set(this.form, "bankTypeList", this.chargeItme);
  689. this.$set(this.form, "accountTypeList", this.chargeItme);
  690. this.$set(this.form, "transferStatusList", this.chargeItme);
  691. updateTransfer(this.form).then(response => {
  692. this.projectForm.outId = this.form.id
  693. this.infoForm.transferId = this.form.id
  694. this.$set(this.projectForm, "ynType", '1');
  695. if(this.form.capitalExpenditureType==2){
  696. addProjectto(this.projectForm).then(res => {
  697. customSubmit(this.form.id).then(res => {
  698. this.$toast.success('提交成功');
  699. setTimeout(function(){
  700. history.go(-1)
  701. },2000)
  702. })
  703. })
  704. }else if(this.form.capitalExpenditureType==4){
  705. addInfoto(this.infoForm).then(res => {
  706. customSubmit(this.form.id).then(res => {
  707. this.$toast.success('提交成功');
  708. setTimeout(function(){
  709. history.go(-1)
  710. },2000)
  711. })
  712. })
  713. }else{
  714. customSubmit(this.form.id).then(res => {
  715. this.$toast.success('提交成功');
  716. setTimeout(function(){
  717. history.go(-1)
  718. },2000)
  719. })
  720. }
  721. });
  722. })
  723. .catch(() => {
  724. return false;
  725. });
  726. }else{
  727. this.$set(this.form, "payeeList", this.chargeItme);
  728. this.$set(this.form, "bankTypeList", this.chargeItme);
  729. this.$set(this.form, "accountTypeList", this.chargeItme);
  730. this.$set(this.form, "transferStatusList", this.chargeItme);
  731. updateTransfer(this.form).then(response => {
  732. this.projectForm.outId = this.form.id
  733. this.infoForm.transferId = this.form.id
  734. this.$set(this.projectForm, "ynType", '1');
  735. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  736. this.uploadFiles1.map(rr => {
  737. const params = new FormData();
  738. params.append("tableId", this.form.id);
  739. params.append("tableName", "t_yinnong_transfer");
  740. params.append("bizPath", "transfer");
  741. params.append("fileType", "1");
  742. params.append("file", rr);
  743. commonAttach(params).then((r) => {
  744. })
  745. })}
  746. if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  747. this.uploadFiles2.map(rr => {
  748. const params = new FormData();
  749. params.append("tableId", this.form.id);
  750. params.append("tableName", "t_yinnong_transfer");
  751. params.append("bizPath", "transfer");
  752. params.append("fileType", "2");
  753. params.append("file", rr);
  754. commonAttach(params).then((r) => {
  755. })
  756. })}
  757. if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  758. this.uploadFiles3.map(rr => {
  759. const params = new FormData();
  760. params.append("tableId", this.form.id);
  761. params.append("tableName", "t_yinnong_transfer");
  762. params.append("bizPath", "transfer");
  763. params.append("fileType", "3");
  764. params.append("file", rr);
  765. commonAttach(params).then((r) => {
  766. })
  767. })}
  768. if(this.form.capitalExpenditureType==2){
  769. addProjectto(this.projectForm).then(res => {
  770. customSubmit(this.form.id).then(res => {
  771. this.$toast.success('提交成功');
  772. setTimeout(function(){
  773. history.go(-1)
  774. },2000)
  775. })
  776. })
  777. } else if(this.form.capitalExpenditureType==4){
  778. addInfoto(this.infoForm).then(res => {
  779. customSubmit(this.form.id).then(res => {
  780. this.$toast.success('提交成功');
  781. setTimeout(function(){
  782. history.go(-1)
  783. },2000)
  784. })
  785. })
  786. }else{
  787. customSubmit(this.form.id).then(res => {
  788. this.$toast.success('提交成功');
  789. setTimeout(function(){
  790. history.go(-1)
  791. },2000)
  792. })
  793. }
  794. });
  795. }
  796. },
  797. goUpdate(){
  798. if(this.chargeItme.length<1){
  799. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  800. return;
  801. }
  802. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  803. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  804. return;
  805. }
  806. if(this.form.capitalExpenditureType==2){
  807. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  808. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  809. return;
  810. }
  811. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  812. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  813. return;
  814. }
  815. }
  816. if(this.form.capitalExpenditureType==4){
  817. if(this.infoForm.name==""||this.infoForm.name==null){
  818. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  819. return;
  820. }
  821. if(this.infoForm.code==""||this.infoForm.code==null){
  822. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  823. return;
  824. }
  825. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  826. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  827. return;
  828. }
  829. }
  830. this.$set(this.form, "payeeList", this.chargeItme);
  831. this.$set(this.form, "bankTypeList", this.chargeItme);
  832. this.$set(this.form, "accountTypeList", this.chargeItme);
  833. this.$set(this.form, "transferStatusList", this.chargeItme);
  834. updateTransfer(this.form).then((response) => {
  835. this.projectForm.outId = this.form.id
  836. this.infoForm.transferId = this.form.id
  837. this.$set(this.projectForm, "ynType", '1');
  838. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  839. this.uploadFiles1.map(rr => {
  840. const params = new FormData();
  841. params.append("tableId", this.form.id);
  842. params.append("tableName", "t_yinnong_transfer");
  843. params.append("bizPath", "transfer");
  844. params.append("fileType", "1");
  845. params.append("file", rr);
  846. commonAttach(params).then((r) => {
  847. })
  848. })}
  849. if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  850. this.uploadFiles2.map(rr => {
  851. const params = new FormData();
  852. params.append("tableId", this.form.id);
  853. params.append("tableName", "t_yinnong_transfer");
  854. params.append("bizPath", "transfer");
  855. params.append("fileType", "2");
  856. params.append("file", rr);
  857. commonAttach(params).then((r) => {
  858. })
  859. })}
  860. if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  861. this.uploadFiles3.map(rr => {
  862. const params = new FormData();
  863. params.append("tableId", this.form.id);
  864. params.append("tableName", "t_yinnong_transfer");
  865. params.append("bizPath", "transfer");
  866. params.append("fileType", "3");
  867. params.append("file", rr);
  868. commonAttach(params).then((r) => {
  869. })
  870. })}
  871. if(this.form.capitalExpenditureType==2){
  872. addProjectto(this.projectForm).then(res => {
  873. this.$toast.success('保存成功');
  874. setTimeout(function(){
  875. history.go(-1)
  876. },2000)
  877. })
  878. }else if(this.form.capitalExpenditureType==4){
  879. addInfoto(this.infoForm).then(res => {
  880. this.$toast.success('保存成功');
  881. setTimeout(function(){
  882. history.go(-1)
  883. },2000)
  884. })
  885. }else{
  886. this.$toast.success('保存成功');
  887. setTimeout(function(){
  888. history.go(-1)
  889. },2000)
  890. }
  891. });
  892. },
  893. payeeSelectChange(select, i) {
  894. let obj = {};
  895. let fuzhitype = 0;
  896. let _this = this
  897. obj = this.payeeList.find((account) => {
  898. //model就是上面的数据源
  899. return account.id === select ; //筛选出匹配数据
  900. });
  901. if(this.chargeItme != [] && this.chargeItme.length>1){
  902. this.chargeItme.some((value, index) => {
  903. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  904. fuzhitype = 2;
  905. return true;
  906. }
  907. if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
  908. }else{
  909. if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  910. fuzhitype = 1;
  911. return true;
  912. }
  913. }
  914. });
  915. }
  916. if(fuzhitype == 0){
  917. this.$set(this.chargeItme[i], "payee",obj.payee)
  918. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  919. this.$set(this.chargeItme[i], "payeeId", obj.id);
  920. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  921. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  922. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  923. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  924. _this.bankTypeDictionaries.map(rr => {
  925. if(rr.value==obj.bankType){
  926. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  927. }
  928. })
  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.$set(this.chargeItme[i], "payeePaymentLines", '');
  937. this.$set(this.chargeItme[i], "bankTypeText", '');
  938. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  939. }else if(fuzhitype == 2){
  940. this.$set(this.chargeItme[i], "payee",'')
  941. this.$set(this.chargeItme[i], "bankType",'')
  942. this.$set(this.chargeItme[i], "payeeId", '');
  943. this.$set(this.chargeItme[i], "payeeAccount", '');
  944. this.$set(this.chargeItme[i], "bankDeposit", '');
  945. this.$set(this.chargeItme[i], "accountType", '');
  946. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  947. this.$set(this.chargeItme[i], "bankTypeText", '');
  948. this.$notify({ type: 'danger', message: '收款方已存在!' });
  949. }
  950. },
  951. selectChange(select) {
  952. let obj = {};
  953. obj = this.payerOptions.find((account) => {
  954. //model就是上面的数据源
  955. return account.id === select; //筛选出匹配数据
  956. });
  957. this.$set(this.form, "bookId", obj.bookId);
  958. this.$set(this.form, "deptId", obj.deptId);
  959. this.$set(this.form, "cashierId", obj.id);
  960. this.$set(this.form, "payer", obj.payee);
  961. this.$set(this.form, "payerAccount", obj.payeeAccount);
  962. this.$set(this.form, "operatorCode", obj.operatorCode);
  963. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  964. this.$set(this.form, "bankType", obj.bankType);
  965. this.$set(this.form, "payerFrom", '1');
  966. if(obj.bankType==1){
  967. this.form.accountType = "1"
  968. this.form.isPeers = null
  969. this.accountTypeChange();
  970. }else if(obj.bankType==2||obj.bankType==4){
  971. this.form.accountType = null
  972. this.form.isPeers = "Y"
  973. this.accountTypeChange1();
  974. }
  975. },
  976. beforeRead1(file) {
  977. this.uploadFiles1.push(file.file);
  978. },
  979. deleteFile1(file){
  980. this.uploadFiles1.map((response,index) => {
  981. if(file.file == response){
  982. this.uploadFiles1.splice(index,1)
  983. }
  984. })
  985. if(file.id){
  986. systemAttachment(file.id).then((res) => {
  987. });
  988. }
  989. },
  990. beforeRead2(file) {
  991. this.uploadFiles2.push(file.file);
  992. },
  993. deleteFile2(file){
  994. this.uploadFiles2.map((response,index) => {
  995. if(file.file == response){
  996. this.uploadFiles2.splice(index,1)
  997. }
  998. })
  999. if(file.id){
  1000. systemAttachment(file.id).then((res) => {
  1001. });
  1002. }
  1003. },
  1004. beforeRead3(file) {
  1005. this.uploadFiles3.push(file.file);
  1006. },
  1007. deleteFile3(file){
  1008. this.uploadFiles3.map((response,index) => {
  1009. if(file.file == response){
  1010. this.uploadFiles3.splice(index,1)
  1011. }
  1012. })
  1013. if(file.id){
  1014. systemAttachment(file.id).then((res) => {
  1015. });
  1016. }
  1017. },
  1018. getFileList(){
  1019. let oData1= {
  1020. tableId: this.$route.query.id,
  1021. tableName: "t_yinnong_transfer",
  1022. bizPath: "transfer",
  1023. fileType: "1",
  1024. }
  1025. attachmentList(oData1).then(res => {
  1026. res.rows.map(r => {
  1027. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1028. this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1029. })
  1030. })
  1031. let oData2= {
  1032. tableId: this.$route.query.id,
  1033. tableName: "t_yinnong_transfer",
  1034. bizPath: "transfer",
  1035. fileType: "2",
  1036. }
  1037. attachmentList(oData2).then(res => {
  1038. res.rows.map(r => {
  1039. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1040. this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1041. })
  1042. })
  1043. let oData3= {
  1044. tableId: this.$route.query.id,
  1045. tableName: "t_yinnong_transfer",
  1046. bizPath: "transfer",
  1047. fileType: "3",
  1048. }
  1049. attachmentList(oData3).then(res => {
  1050. res.rows.map(r => {
  1051. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1052. this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1053. })
  1054. })
  1055. },
  1056. goBack(){
  1057. window.history.go(-1)
  1058. },
  1059. //删除家庭成员
  1060. deleteChargeItme(index){
  1061. this.chargeItme.splice(index,1)
  1062. },
  1063. },
  1064. }
  1065. </script>
  1066. <style scoped lang="scss">
  1067. .app-container {
  1068. padding: 2% 0;
  1069. }
  1070. .main_title{
  1071. font-size: 0.4rem;
  1072. color: #1D6FE9;
  1073. margin: 0.2rem 6%;
  1074. position: relative;
  1075. }
  1076. .main_box{
  1077. width: 96%;
  1078. margin: 0 auto;
  1079. border-radius: 6px;
  1080. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1081. overflow: hidden;
  1082. background-color: #FFF;
  1083. }
  1084. .submitButton{
  1085. width: 80%;
  1086. margin: 0 auto;
  1087. background-color: #1D6FE9;
  1088. }
  1089. .addFamily{
  1090. position: absolute;
  1091. top: -2px;
  1092. right: 0;
  1093. border-radius: 50%;
  1094. }
  1095. .deleteFamily{
  1096. position: absolute;
  1097. top: 0rem;
  1098. right: 6%;
  1099. z-index: 9;
  1100. border-radius: 50%;
  1101. }
  1102. </style>