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

approvalApproval11.vue 18 KiB

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