移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

approvalDetail11.vue 20 KiB

2 anni fa
2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  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 readonly label="支出总金额" v-model="form.expenditureAmount" input-align="right" label-width="auto"/>
  21. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" readonly>
  22. <template #input>
  23. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  24. <van-radio name="1">线上审批</van-radio>
  25. <van-radio name="2">线下审批</van-radio>
  26. </van-radio-group>
  27. </template>
  28. </van-field>
  29. <van-field v-if="form.approvalMode==1" readonly label="审批流程" :value="tempalteFormat(form.approvalTemplateId)" input-align="right" label-width="auto"/>
  30. </div>
  31. <div class="main_box" style="margin-top: 10px;">
  32. <van-field readonly label="转账附言" v-model="form.remark" type="textarea" input-align="right" rows="3" label-width="auto"/>
  33. </div>
  34. <div class="main_box" style="margin-top: 10px;">
  35. <van-field readonly label="说明情况" v-model="form.explainSituation" type="textarea" input-align="right" rows="3" label-width="auto"/>
  36. </div>
  37. <p class="main_title">付款方信息</p>
  38. <div class="main_box">
  39. <van-field readonly label="付款方" v-model="form.payer" input-align="right" label-width="auto"/>
  40. <van-field readonly label="付款方账户" v-model="form.payerAccount" input-align="right" label-width="auto"/>
  41. </div>
  42. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  43. <van-field readonly label="项目名称" v-model="projectForm.projectName" input-align="right" />
  44. <van-field readonly label="承建单位" v-model="projectForm.projectContractor" input-align="right" label-width="auto"/>
  45. <van-field readonly label="合同价款(元)" v-model="projectForm.projectAmount" input-align="right" label-width="auto"/>
  46. <van-field readonly label="工程款类型" v-model="projectFundType" input-align="right" />
  47. <van-field readonly label="工程发票号" v-model="projectForm.projectBillNum" input-align="right" label-width="auto"/>
  48. </div>
  49. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  50. <van-field readonly label="合同名称" v-model="infoForm.name" input-align="right" />
  51. <van-field readonly label="合同编码" v-model="infoForm.code" input-align="right" label-width="auto"/>
  52. <van-field readonly label="合同价款(元)" v-model="infoForm.totalAmount" input-align="right" label-width="auto"/>
  53. </div>
  54. <p class="main_title">收款方信息</p>
  55. <div style="position:relative;">
  56. <div class="main_box" style="margin-bottom: 10px;position:relative;" v-for="(item, index) in chargeItme" :key="index" v-if="index<listLength">
  57. <van-field readonly label="收款方" v-model="item.payee" input-align="right" />
  58. <van-field readonly label="联系方式" v-model="item.phone" input-align="right" label-width="auto"/>
  59. <van-field readonly label="申请使用金额" v-model="item.incomeAmount" input-align="right" label-width="auto"/>
  60. <van-field readonly label="资金用途" v-model="item.remark" input-align="right" label-width="auto"/>
  61. </div>
  62. <p class="main_more" v-if="chargeItme.length>1 && showbtn" @click="listLength = chargeItme.length,showbtn=false">查看更多</p>
  63. <p class="main_more" v-if="chargeItme.length>1 && !showbtn" @click="listLength = 1,showbtn=true">收起列表</p>
  64. </div>
  65. <p class="main_title">上传附件</p>
  66. <div class="main_box" style="padding: 5px 0 0 0;">
  67. <van-cell value="收据" />
  68. <van-uploader v-model="fileList1" v-if="fileList1==null||fileList1.length==0" :deletable="false" disabled :upload-text="'未上传附件'" style="margin-left:8px;"></van-uploader>
  69. <van-uploader v-model="fileList1" v-if="fileList1!=null&&fileList1.length>0" :deletable="false" @click-preview="previewPreview" :max-count="fileList1.length" style="margin-left:8px;">
  70. <template #preview-cover="file">
  71. <div class="preview-cover">
  72. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  73. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  74. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  75. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  76. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  77. </div>
  78. </template>
  79. </van-uploader>
  80. <van-cell value="发票" />
  81. <van-uploader v-model="fileList2" v-if="fileList2==null||fileList2.length==0" :deletable="false" disabled :upload-text="'未上传附件'" style="margin-left:8px;"></van-uploader>
  82. <van-uploader v-model="fileList2" v-if="fileList2!=null&&fileList2.length>0" :deletable="false" @click-preview="previewPreview" :max-count="fileList2.length" style="margin-left:8px;">
  83. <template #preview-cover="file">
  84. <div class="preview-cover">
  85. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  86. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  87. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  88. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  89. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  90. </div>
  91. </template>
  92. </van-uploader>
  93. <van-cell value="其他" />
  94. <van-uploader v-model="fileList3" v-if="fileList3==null||fileList3.length==0" :deletable="false" disabled :upload-text="'未上传附件'" style="margin-left:8px;"></van-uploader>
  95. <van-uploader v-model="fileList3" v-if="fileList3!=null&&fileList3.length>0" :deletable="false" @click-preview="previewPreview" :max-count="fileList3.length" style="margin-left:8px;" >
  96. <template #preview-cover="file">
  97. <div class="preview-cover">
  98. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  99. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  100. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  101. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  102. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  103. </div>
  104. </template>
  105. </van-uploader>
  106. </div>
  107. </div>
  108. </template>
  109. <script>
  110. import { getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto ,
  111. listProject , addProjectto , customSubmit,getInfoto,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  112. import request from '@/utils/request'
  113. import {
  114. attachmentList,
  115. commonAttach,
  116. getCash,
  117. listCashdetailByCashId
  118. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  119. export default {
  120. name: "approvalDetail11",
  121. data() {
  122. return {
  123. showcapital:false,
  124. showpayee:false,
  125. showlasj:false,
  126. showbankType:false,
  127. showproject:false,
  128. showFundType:false,
  129. showbtn:true,
  130. listLength:1,
  131. minDate: new Date(),
  132. maxDate: new Date(2025, 10, 1),
  133. currentDate: new Date(),
  134. form:{},
  135. fileList1:[],
  136. fileList2:[],
  137. fileList3:[],
  138. capitalExpenditureType:'',
  139. payee:'',
  140. bankType:'',
  141. wfydlxDictionaries:[],
  142. jglxDictionaries:[],
  143. sysDictionaries:[],
  144. capitalExpenditureTypeOptions:[],
  145. bankTypeDictionaries:[],
  146. projectList:[],
  147. projectFundTypeOptions:[],
  148. projectFundTypeDictionaries:[],
  149. projectListShow:[],
  150. chargeItme:[],
  151. chargeItmeShow:[],
  152. payeeList:[],
  153. // 查询参数
  154. queryParams: {
  155. transferType:11,
  156. orderByColumn: "id",
  157. isAsc: "desc",
  158. },
  159. capitalExpenditureOpen:false,
  160. contractOpen:false,
  161. projectForm:{
  162. projectId:null,
  163. projectName:null,
  164. projectContractor:null,
  165. projectAmount:null,
  166. projectBillNum:null,
  167. projectFundType:'1',
  168. outId:null,
  169. ynType:'1'
  170. },
  171. infoForm:{
  172. infoId:null,
  173. name:null,
  174. code:null,
  175. totalAmount:null,
  176. contractionId:null,
  177. transferId:null
  178. },
  179. projectFundType:'',
  180. templateList:[],
  181. };
  182. },
  183. created() {
  184. this.getDicts("project_fund_type").then((response) => {
  185. for (var i = 0; i < response.data.length; i++) {
  186. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  187. }
  188. this.projectFundTypeDictionaries = response.data;
  189. });
  190. this.getDictionaries();
  191. this.getFileList();
  192. this.getTemplateList();
  193. },
  194. methods: {
  195. getTemplateList(){
  196. let templateQueryParams = {
  197. // 分页
  198. pageNum: 1,
  199. pageSize: 999,
  200. };
  201. listTemplate(templateQueryParams).then(response => {
  202. this.templateList = response.rows;
  203. });
  204. },
  205. tempalteFormat(id){
  206. let name = ""
  207. this.templateList.map(res => {
  208. if(res.id==id){
  209. name = res.name
  210. }
  211. })
  212. return name
  213. },
  214. goFlow(){
  215. window.location='approvalProcess?id='+this.$route.query.id+'&auditbatchNo='+this.$route.query.auditbatchNo;
  216. },
  217. getDictionaries(){
  218. getCash(this.$route.query.id).then((response) => {
  219. this.getDicts("capital_expenditure_type").then((res) => {
  220. for (var i = 0; i < res.data.length; i++) {
  221. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  222. }
  223. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  224. });
  225. if(response.data.capitalExpenditureType==2){
  226. this.capitalExpenditureOpen = true
  227. let param={
  228. 'outId' : response.data.id,
  229. 'ynType' : '2'
  230. }
  231. getProjectto(param).then(res => {
  232. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  233. this.projectForm = res.data
  234. })
  235. }else if(response.data.capitalExpenditureType==4){
  236. this.contractOpen = true
  237. let param={
  238. 'transferId' : response.data.id
  239. }
  240. getInfoto(param).then(res => {
  241. this.infoForm = res.data
  242. })
  243. }else{
  244. this.showproject = false
  245. }
  246. this.form = response.data;
  247. });
  248. listCashdetailByCashId(this.$route.query.id).then((response) => {
  249. this.chargeItme = response.data;
  250. console.log(response)
  251. this.getPayeeList();
  252. });
  253. },
  254. addChargeItme(index){
  255. this.chargeItme.splice(index + 1, 0, {
  256. payeeId: "", //收款方ID
  257. payee: "", //收款方
  258. payeeAccount: "", //收款账户
  259. bankDeposit: "", //开户银行
  260. incomeAmount: "", //收入金额
  261. bankType: "", //所属银行
  262. });
  263. },
  264. getPayeeList() {
  265. //普通转账
  266. this.queryParams.accountType = this.form.accountType
  267. this.queryParams.status = "0"
  268. listPayee(this.queryParams).then((response) => {
  269. for (var i = 0; i < response.rows.length; i++) {
  270. this.payeeList.push({text: response.rows[i].payee, value: response.rows[i].id});
  271. }
  272. });
  273. },
  274. previewPreview(file, index, len) {
  275. const baseImgUrl = this.$store.getters.baseRoutingUrl;
  276. if (file.url) {
  277. //已上传文件
  278. let fileName = file.file.name || file.url;
  279. let subIndex = fileName.lastIndexOf(".");
  280. let ext = fileName.substring(subIndex + 1, fileName.length);
  281. let imgi = file.listIndex
  282. //console.log(ext)
  283. let allUrl = file.url;
  284. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  285. const link = document.createElement("a");
  286. link.style.display = "none";
  287. link.target = "_blank"
  288. link.href = allUrl;
  289. document.body.appendChild(link);
  290. link.click();
  291. document.body.removeChild(link);
  292. }
  293. } else {
  294. //新上传文件
  295. let fileName = file.file.name;
  296. // console.info(file.file.name)
  297. let subIndex = fileName.lastIndexOf(".");
  298. let ext = fileName.substring(subIndex + 1, fileName.length);
  299. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  300. let type = this.getfileType(ext);
  301. // 将文件转换为base64编码
  302. this.fileToBase64(file.file, ext).then(res => {
  303. this.downloadFile(res, fileName, ext, type);
  304. })
  305. }
  306. }
  307. },
  308. getfileType(type) {
  309. switch (type) {
  310. case 'txt':
  311. return 'text/plain';
  312. case 'doc':
  313. return 'application/msword';
  314. case 'docx':
  315. return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  316. case 'xls':
  317. return 'application/vnd.ms-excel';
  318. case 'xlsx':
  319. return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  320. case 'pdf':
  321. return 'application/pdf';
  322. case 'pptx':
  323. return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  324. case 'png':
  325. return 'image/png';
  326. case 'jpg':
  327. return 'image/jpeg';
  328. case 'gif':
  329. return 'image/gif';
  330. case 'svg':
  331. return 'image/svg+xml';
  332. case 'ico':
  333. return 'image/x-icon';
  334. case 'bmp':
  335. return 'image/bmp,';
  336. }
  337. },
  338. downloadFile(base64, fileName, fileType, mimetype) {
  339. const typeHeader = 'data:application/' + fileType + ';base64,';
  340. const blob = this.base64ToBlob(base64, mimetype);
  341. this.downloadFileDownload(blob, fileName, fileType);
  342. },
  343. base64ToBlob(base64, mime) {
  344. //解码base64得到二进制字符串
  345. let raw = window.atob(base64.substring(base64.indexOf(',') + 1));
  346. let rawLength = raw.length
  347. //创建8位无符号整数值的类型化数组
  348. let uInt8Array = new Uint8Array(rawLength)
  349. for (let i = 0; i < rawLength; ++i) {
  350. uInt8Array[i] = raw.charCodeAt(i);
  351. }
  352. return new Blob([uInt8Array], {type: mime})
  353. },
  354. downloadFileDownload(blob, fileName, fileType) {
  355. const downloadElement = document.createElement('a');
  356. let href = blob;
  357. if (typeof blob === 'string') {
  358. downloadElement.target = '_blank'
  359. } else {
  360. href = window.URL.createObjectURL(blob)
  361. }
  362. downloadElement.href = href;
  363. downloadElement.download = fileName + '.' + fileType;//下载后文件名
  364. document.body.appendChild(downloadElement);
  365. downloadElement.click();
  366. document.body.removeChild(downloadElement)
  367. if (typeof blob !== 'string') {
  368. window.URL.revokeObjectURL(href)
  369. }
  370. },
  371. fileToBase64(file,fileType){
  372. return new Promise((resolve,reject)=>{
  373. //创建一个新的FileReader 对象
  374. const reader = new FileReader();
  375. //读取file对象
  376. reader.readAsDataURL(file);
  377. reader.onload=function () {
  378. const base64String = reader.result.split(",")[1];
  379. resolve('data:application/' + fileType + ';base64,'+base64String);
  380. }
  381. reader.onerror=function () {
  382. reject(new Error("Failed to load file") )
  383. }
  384. })
  385. },
  386. getFileList(){
  387. let oData1= {
  388. tableId: this.$route.query.id,
  389. tableName: "t_yinnong_transfer",
  390. bizPath: "yinnong",
  391. fileType: "1",
  392. }
  393. attachmentList(oData1).then(res => {
  394. res.rows.map(r => {
  395. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  396. let subIndex = r.fileName.lastIndexOf(".");
  397. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  398. this.fileList1.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  399. })
  400. })
  401. let oData2= {
  402. tableId: this.$route.query.id,
  403. tableName: "t_yinnong_transfer",
  404. bizPath: "yinnong",
  405. fileType: "2",
  406. }
  407. attachmentList(oData2).then(res => {
  408. res.rows.map(r => {
  409. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  410. let subIndex = r.fileName.lastIndexOf(".");
  411. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  412. this.fileList2.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  413. })
  414. })
  415. let oData3= {
  416. tableId: this.$route.query.id,
  417. tableName: "t_yinnong_transfer",
  418. bizPath: "yinnong",
  419. fileType: "3",
  420. }
  421. attachmentList(oData3).then(res => {
  422. res.rows.map(r => {
  423. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  424. let subIndex = r.fileName.lastIndexOf(".");
  425. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  426. this.fileList3.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  427. })
  428. })
  429. },
  430. goBack(){
  431. window.history.go(-1)
  432. },
  433. //删除家庭成员
  434. deleteChargeItme(index){
  435. this.chargeItme.splice(index,1)
  436. },
  437. },
  438. }
  439. </script>
  440. <style scoped lang="scss">
  441. .app-container {
  442. padding: 2% 0;
  443. }
  444. .main_more{
  445. width: 96%;
  446. margin: 0 auto;
  447. margin-top: 10px;
  448. border-radius: 6px;
  449. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  450. overflow: hidden;
  451. background-color: #FFF;
  452. text-align: center;
  453. padding: 10PX 0;
  454. }
  455. .main_title{
  456. font-size: 0.4rem;
  457. color: #1D6FE9;
  458. margin: 0.2rem 6%;
  459. position: relative;
  460. }
  461. .main_box{
  462. width: 96%;
  463. margin: 0 auto;
  464. border-radius: 6px;
  465. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  466. overflow: hidden;
  467. background-color: #FFF;
  468. }
  469. .submitButton{
  470. width: 80%;
  471. margin: 0 auto;
  472. background-color: #1D6FE9;
  473. }
  474. .addFamily{
  475. position: absolute;
  476. top: -2px;
  477. right: 0;
  478. border-radius: 50%;
  479. }
  480. .deleteFamily{
  481. position: absolute;
  482. top: 0rem;
  483. right: 6%;
  484. z-index: 9;
  485. border-radius: 50%;
  486. }
  487. </style>