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

approvalAdd12.vue 43 KiB

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