移动端
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.
 
 

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