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

578 linhas
20 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">汇票支出申请审批</p>
  11. </template>
  12. <template #right>
  13. <van-icon name="../../../static/images/icon/icon_flow.png" size="20" @click="goFlow"/>
  14. </template>
  15. </van-nav-bar>
  16. <p class="main_title">基础信息</p>
  17. <div class="main_box">
  18. <van-field readonly label="申请时间" v-model="form.applyDate" input-align="right" />
  19. <van-field readonly label="资金支出类别" v-model="capitalExpenditureType" input-align="right" label-width="auto" />
  20. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" readonly>
  21. <template #input>
  22. <van-radio-group v-model="form.paymentState" direction="horizontal">
  23. <van-radio name="1">线上支付</van-radio>
  24. <van-radio name="2">线下支付</van-radio>
  25. </van-radio-group>
  26. </template>
  27. </van-field>
  28. </div>
  29. <div class="main_box" style="margin-top: 10px;">
  30. <van-field readonly label="付款事由" v-model="form.remark" type="textarea" input-align="right" rows="3" label-width="auto"/>
  31. </div>
  32. <div class="main_box" style="margin-top: 10px;">
  33. <van-field readonly label="说明情况" v-model="form.explainSituation" type="textarea" input-align="right" rows="3" label-width="auto"/>
  34. </div>
  35. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  36. <van-field readonly label="项目名称" v-model="projectForm.projectName" input-align="right" />
  37. <van-field readonly label="承建单位" v-model="projectForm.projectContractor" input-align="right" label-width="auto"/>
  38. <van-field readonly label="合同价款(元)" v-model="projectForm.projectAmount" input-align="right" label-width="auto"/>
  39. <van-field readonly label="工程款类型" v-model="projectFundType" input-align="right" />
  40. <van-field readonly label="工程发票号" v-model="projectForm.projectBillNum" input-align="right" label-width="auto"/>
  41. </div>
  42. <p class="main_title">出票方信息</p>
  43. <div class="main_box">
  44. <van-field readonly label="付款方" v-model="form.payer" input-align="right" label-width="auto"/>
  45. <van-field :rules="[{ required: true , message:'请输入汇票号码' }]" required label="汇票号码" v-model="form.payerAccount" placeholder="请输入汇票号码" input-align="right" label-width="auto"/>
  46. <van-field
  47. readonly
  48. label="出票金额(元)"
  49. v-model="form.expenditureAmount"
  50. placeholder=""
  51. input-align="right"
  52. label-width="auto"
  53. required
  54. :rules="[{ required: true , message:'出票金额不能为空!' }]"
  55. />
  56. <van-field
  57. readonly
  58. label="汇票类型"
  59. v-model="orderTypeName"
  60. placeholder=""
  61. input-align="right"
  62. label-width="auto"
  63. required
  64. :rules="[{ required: true , message:'汇票类型不能为空!' }]"
  65. />
  66. <van-field
  67. readonly
  68. label="汇票类型"
  69. v-model="form.orderType"
  70. placeholder=""
  71. input-align="right"
  72. label-width="auto"
  73. style="display: none"
  74. required
  75. :rules="[{ required: true , message:'汇票类型不能为空!' }]"
  76. />
  77. <van-field
  78. readonly
  79. label="开票日"
  80. v-model="form.startTime"
  81. placeholder=""
  82. input-align="right"
  83. label-width="auto"
  84. required
  85. :rules="[{ required: true , message:'开票日不能为空!' }]"
  86. />
  87. <van-field
  88. readonly
  89. label="到期日"
  90. v-model="form.endTime"
  91. placeholder=""
  92. input-align="right"
  93. label-width="auto"
  94. required
  95. :rules="[{ required: true , message:'到期日不能为空!' }]"
  96. />
  97. </div>
  98. <p class="main_title">收票方信息</p>
  99. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  100. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  101. <van-field readonly label="收款方" v-model="item.payee" input-align="right" />
  102. <van-field readonly label="联系方式" v-model="item.phone" input-align="right" label-width="auto"/>
  103. <van-field readonly label="所属单位" v-model="item.unit" input-align="right" label-width="auto"/>
  104. <van-field readonly label="负责人全称" v-model="item.leader" input-align="right" label-width="auto"/>
  105. <van-field readonly label="资金用途" v-model="item.remark" input-align="right" />
  106. </div>
  107. </div>
  108. <p class="main_title">上传附件</p>
  109. <div class="main_box" style="padding: 5px 0 0 8px;">
  110. <van-uploader v-model="fileList" v-if="fileList==null||fileList.length==0" :deletable="false" disabled :upload-text="'未上传附件'"></van-uploader>
  111. <van-uploader v-model="fileList" v-if="fileList!=null&&fileList.length>0" :deletable="false" :max-count="fileList.length" ></van-uploader>
  112. </div>
  113. <p style="margin-top:20px;padding: 0 10px">附件下载{{fileList&&fileList.length==0?':暂无可下载文件':''}}</p>
  114. <van-cell v-for="(item,index) in fileList" :key="index">
  115. <a :href="item.url">{{index+1}}.{{item.fileName}}</a>
  116. </van-cell>
  117. <div class="main_box examine_box" v-if="this.$route.query.type != 'done'">
  118. <van-row type="flex" justify="space-between" align="center">
  119. <van-col span="5">审批<br/>意见</van-col>
  120. <van-col span="19">
  121. <van-radio-group v-model="pass" direction="horizontal">
  122. <van-radio name="true">同意</van-radio>
  123. <van-radio name="false">驳回</van-radio>
  124. </van-radio-group>
  125. <van-field rows="2" autosize v-model="comment" type="textarea" placeholder="同意申请宅基地"/>
  126. </van-col>
  127. </van-row>
  128. </div>
  129. <div style="margin: 16px 2%;" v-if="this.$route.query.type != 'done'">
  130. <van-row>
  131. <van-col span="24" align="center">
  132. <van-button type="info" native-type="submit" @click="submitForm" class="submitButton">提交</van-button>
  133. </van-col>
  134. </van-row>
  135. <div class="clear"></div>
  136. </div>
  137. </div>
  138. </template>
  139. <script>
  140. import { getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  141. import request from '@/utils/request'
  142. import {
  143. approval,
  144. attachmentList,
  145. commonAttach,
  146. getCash,
  147. listCashdetailByCashId
  148. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  149. export default {
  150. name: "approvalDetail12",
  151. data() {
  152. return {
  153. showcapital:false,
  154. showpayee:false,
  155. showlasj:false,
  156. showbankType:false,
  157. showproject:false,
  158. showFundType:false,
  159. minDate: new Date(),
  160. maxDate: new Date(2025, 10, 1),
  161. currentDate: new Date(),
  162. form:{},
  163. fileList:[],
  164. capitalExpenditureType:'',
  165. payee:'',
  166. bankType:'',
  167. wfydlxDictionaries:[],
  168. jglxDictionaries:[],
  169. sysDictionaries:[],
  170. capitalExpenditureTypeOptions:[],
  171. bankTypeDictionaries:[],
  172. projectList:[],
  173. projectFundTypeOptions:[],
  174. projectFundTypeDictionaries:[],
  175. projectListShow:[],
  176. chargeItme:[],
  177. chargeItmeShow:[],
  178. payeeList:[],
  179. // 查询参数
  180. queryParams: {
  181. transferType:"",
  182. orderByColumn: "id",
  183. isAsc: "desc",
  184. },
  185. capitalExpenditureOpen:false,
  186. projectForm:{
  187. projectId:null,
  188. projectName:null,
  189. projectContractor:null,
  190. projectAmount:null,
  191. projectBillNum:null,
  192. projectFundType:'1',
  193. outId:null,
  194. ynType:'1'
  195. },
  196. projectFundType:'',
  197. orderTypeName:'',
  198. orderTypeOptions:[],
  199. // 审核意见默认值
  200. pass: "true",
  201. comment: "同意",
  202. };
  203. },
  204. created() {
  205. let queryParams={
  206. pageNum: 1,
  207. pageSize: 100,
  208. }
  209. listProject(queryParams).then(response => {
  210. console.log(response)
  211. this.projectList = response.rows;
  212. for (var i = 0; i < response.rows.length; i++) {
  213. this.projectListShow.push({text: response.rows[i].projectName, value: response.rows[i].id});
  214. }
  215. });
  216. this.getDicts("project_fund_type").then((response) => {
  217. for (var i = 0; i < response.data.length; i++) {
  218. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  219. }
  220. this.projectFundTypeDictionaries = response.data;
  221. });
  222. this.getDicts("order_type").then(response => {
  223. this.orderTypeOptions = response.data;
  224. });
  225. this.getDictionaries();
  226. this.getFileList();
  227. },
  228. methods: {
  229. goFlow(){
  230. window.location='approvalProcess2?id='+this.$route.query.id;
  231. },
  232. getDictionaries(){
  233. getCash(this.$route.query.id).then((response) => {
  234. this.getDicts("capital_expenditure_type").then((res) => {
  235. for (var i = 0; i < res.data.length; i++) {
  236. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  237. }
  238. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  239. });
  240. if(response.data.capitalExpenditureType==2){
  241. this.capitalExpenditureOpen = true
  242. let param={
  243. 'outId' : response.data.id,
  244. 'ynType' : '2'
  245. }
  246. getProjectto(param).then(res => {
  247. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  248. this.projectForm = res.data
  249. })
  250. }else{
  251. this.showproject = false
  252. }
  253. this.form = response.data;
  254. this.orderTypeOptions.map(res => {
  255. console.log(this.orderTypeOptions)
  256. if(res.dictValue==this.form.orderType){
  257. this.orderTypeName = res.dictLabel
  258. }
  259. })
  260. });
  261. console.log(this.$route.query.id)
  262. listCashdetailByCashId(this.$route.query.id).then((response) => {
  263. this.chargeItme = response.data;
  264. console.log(response.data)
  265. this.getPayeeList();
  266. });
  267. },
  268. addChargeItme(index){
  269. this.chargeItme.splice(index + 1, 0, {
  270. payeeId: "", //收款方ID
  271. payee: "", //收款方
  272. payeeAccount: "", //收款账户
  273. bankDeposit: "", //开户银行
  274. incomeAmount: "", //收入金额
  275. bankType: "", //所属银行
  276. });
  277. },
  278. getPayeeList() {
  279. //普通转账
  280. this.queryParams.accountType = this.form.accountType
  281. this.queryParams.status = "0"
  282. listPayee(this.queryParams).then((response) => {
  283. for (var i = 0; i < response.rows.length; i++) {
  284. this.payeeList.push({text: response.rows[i].payee, value: response.rows[i].id});
  285. }
  286. });
  287. },
  288. payeeDictLabel(datas, value) {
  289. var actions = [];
  290. Object.keys(datas).some((key) => {
  291. if (datas[key].payeeId == ('' + value)) {
  292. actions.push(datas[key].payee);
  293. return true;
  294. }
  295. })
  296. return actions.join('');
  297. },
  298. onConfirmCapital(data){
  299. console.log(data)
  300. if (data.value != 2){
  301. this.capitalExpenditureOpen = false;
  302. this.projectForm = [];
  303. }else{
  304. this.capitalExpenditureOpen = true;
  305. }
  306. this.capitalExpenditureType = data.text;
  307. this.form.capitalExpenditureType = data.value;
  308. this.showcapital = false;
  309. },
  310. onConfirmFundType(data){
  311. console.log(data)
  312. this.projectForm.projectFundType = data.value;
  313. this.projectFundType = data.text;
  314. this.showFundType = false;
  315. },
  316. onConfirmProject(data){
  317. console.log(data)
  318. this.projectList.map(res => {
  319. console.log(res)
  320. if(res.projectName==data.text){
  321. this.projectForm.projectId = res.id
  322. this.projectForm.projectName = res.projectName
  323. this.projectForm.projectContractor = res.projectContractor
  324. this.projectForm.projectAmount = res.projectAmount
  325. console.log(this.projectForm)
  326. }
  327. })
  328. this.showproject = false;
  329. },
  330. onConfirmPayee(data){
  331. // this.chargeItme[this.chargeItme.length-1].payeeText = data.text;
  332. this.chargeItme[this.chargeItme.length-1].payee = data.text;
  333. this.chargeItme[this.chargeItme.length-1].payeeId = data.value;
  334. console.log(this.chargeItme)
  335. this.showpayee = false;
  336. },
  337. onConfirmBankType(data){
  338. console.log(this.chargeItme)
  339. this.chargeItme[this.chargeItme.length-1].bankTypeText = data.text;
  340. this.chargeItme[this.chargeItme.length-1].bankType = data.value;
  341. this.showbankType = false;
  342. },
  343. onConfirmLasj(data){
  344. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  345. this.showlasj = false;
  346. },
  347. accountTypeChange(e){
  348. console.log(e)
  349. this.payeeList = [];
  350. this.queryParams.accountType = this.form.accountType
  351. this.queryParams.status = "0"
  352. listPayee(this.queryParams).then((response) => {
  353. for (var i = 0; i < response.rows.length; i++) {
  354. this.payeeList.push({text: response.rows[i].payee, value: response.rows[i].id});
  355. }
  356. });
  357. },
  358. goAdd(){
  359. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  360. this.$toast.error("付款事由禁止包含|。");
  361. return;
  362. }
  363. if(this.form.capitalExpenditureType==2){
  364. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  365. this.$toast.error('请选择项目名称!');
  366. return;
  367. }
  368. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  369. this.$toast.error('请输入工程发票号!');
  370. return;
  371. }
  372. }
  373. this.$set(this.form, "payeeList", this.chargeItme);
  374. this.$set(this.form, "bankTypeList", this.chargeItme);
  375. this.$set(this.form, "accountTypeList", this.chargeItme);
  376. this.$set(this.form, "transferStatusList", this.chargeItme);
  377. console.log(this.form);
  378. updateTransfer(this.form).then(response => {
  379. console.log(response);
  380. this.projectForm.outId = this.form.id
  381. this.$set(this.projectForm, "ynType", '1');
  382. console.log(this.projectForm)
  383. if(this.form.capitalExpenditureType==2){
  384. addProjectto(this.projectForm).then(res => {
  385. customSubmit(this.form.id).then(res => {
  386. this.$toast.success('提交成功');
  387. setTimeout(function(){
  388. history.go(-1)
  389. },2000)
  390. })
  391. })
  392. }else{
  393. customSubmit(this.form.id).then(res => {
  394. this.$toast.success('提交成功');
  395. setTimeout(function(){
  396. history.go(-1)
  397. },2000)
  398. })
  399. }
  400. });
  401. },
  402. goUpdate(){
  403. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  404. this.$toast.error("付款事由禁止包含|。");
  405. return;
  406. }
  407. if(this.form.capitalExpenditureType==2){
  408. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  409. this.$toast.error('请选择项目名称!');
  410. return;
  411. }
  412. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  413. this.$toast.error('请输入工程发票号!');
  414. return;
  415. }
  416. }
  417. this.$set(this.form, "payeeList", this.chargeItme);
  418. this.$set(this.form, "bankTypeList", this.chargeItme);
  419. this.$set(this.form, "accountTypeList", this.chargeItme);
  420. this.$set(this.form, "transferStatusList", this.chargeItme);
  421. this.projectForm.outId = this.form.id
  422. updateTransfer(this.form).then((response) => {
  423. this.projectForm.outId = this.form.id
  424. this.$set(this.projectForm, "ynType", '1');
  425. if(this.form.capitalExpenditureType==2){
  426. addProjectto(this.projectForm).then(res => {
  427. this.$toast.success('修改成功');
  428. setTimeout(function(){
  429. history.go(-1)
  430. },2000)
  431. })
  432. }else{
  433. this.$toast.success('修改成功');
  434. setTimeout(function(){
  435. history.go(-1)
  436. },2000)
  437. }
  438. });
  439. },
  440. beforeRead(file) {
  441. this.uploadFiles.push(file.file);
  442. },
  443. deleteFile(file){
  444. this.uploadFiles.map((response,index) => {
  445. if(file.file == response){
  446. this.uploadFiles.splice(index,1)
  447. }
  448. })
  449. },
  450. getFileList(){
  451. let oData= {
  452. tableId: this.$route.query.id,
  453. tableName: "t_yinnong_cash",
  454. bizPath: "yinnong",
  455. fileType: "",
  456. }
  457. attachmentList(oData).then(res => {
  458. console.log(res)
  459. console.log(location.protocol+"//"+location.host+request.defaults.baseURL)
  460. res.rows.map(r => {
  461. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  462. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id,"fileName":r.fileName})
  463. console.log(r)
  464. })
  465. })
  466. },
  467. goBack(){
  468. window.history.go(-1)
  469. },
  470. //删除家庭成员
  471. deleteChargeItme(index){
  472. this.chargeItme.splice(index,1)
  473. },
  474. /** 提交按钮 */
  475. submitForm() {
  476. const data = {
  477. taskId: this.$route.query.taskId,
  478. instanceId: this.form.instanceId,
  479. variables: JSON.stringify({
  480. comment: this.comment,
  481. pass: this.pass,
  482. }),
  483. };
  484. console.log(data);
  485. approval(data).then((response) => {
  486. if(response.code==200 && response.msg=="操作成功"){
  487. this.$toast.success("操作成功");
  488. setTimeout(function(){
  489. history.go(-1)
  490. },2000)
  491. } else{
  492. this.$toast.success("操作失败");
  493. }
  494. });
  495. },
  496. },watch: {
  497. pass: function (val) {
  498. this.comment = val === "true" ? "同意" : "驳回";
  499. },
  500. },
  501. }
  502. </script>
  503. <style scoped lang="scss">
  504. .app-container {
  505. padding: 2% 0;
  506. }
  507. .main_title{
  508. font-size: 0.4rem;
  509. color: #1D6FE9;
  510. margin: 0.2rem 6%;
  511. position: relative;
  512. }
  513. .main_box{
  514. width: 96%;
  515. margin: 0 auto;
  516. border-radius: 6px;
  517. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  518. overflow: hidden;
  519. background-color: #FFF;
  520. }
  521. .submitButton{
  522. width: 96%;
  523. margin: 0 auto;
  524. }
  525. .addFamily{
  526. position: absolute;
  527. top: -2px;
  528. right: 0;
  529. border-radius: 50%;
  530. }
  531. .deleteFamily{
  532. position: absolute;
  533. top: 0rem;
  534. right: 6%;
  535. z-index: 9;
  536. border-radius: 50%;
  537. }
  538. .examine_box{
  539. background-color: #1D6FE9!important;
  540. padding: 0.18rem!important;
  541. padding-left: 0!important;
  542. border-radius: 0.15rem!important;
  543. margin-top: 0.3rem!important;
  544. }
  545. .examine_box .van-col:first-child{
  546. color: #FFF!important;
  547. font-size: 0.45rem!important;
  548. text-align: center!important;
  549. }
  550. .examine_box .van-col:last-child{
  551. background-color: #FFF!important;
  552. border-radius: 0.15rem!important;
  553. overflow: hidden!important;
  554. .van-radio-group--horizontal{
  555. padding: 0.2rem 0;
  556. border-bottom: 1px solid #eee;
  557. }
  558. }
  559. /deep/.van-radio--horizontal{
  560. margin-left: 20px;
  561. margin-right: 0;
  562. }
  563. </style>