applyCostDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. <template>
  2. <el-dialog
  3. :close-on-click-modal="false"
  4. :close-on-press-escape="false"
  5. :title="dialogTitle"
  6. :visible.sync="dialogVisible"
  7. top="50px"
  8. width="75%"
  9. :before-close="beforeClose"
  10. >
  11. <div class="tabsdom">
  12. <el-tabs v-model="activeName" @tab-click="handleClick">
  13. <el-tab-pane label="报支申请" name="first">
  14. <el-form
  15. ref="elformData"
  16. :model="form"
  17. class="cost_form"
  18. label-width="125px"
  19. style="width: 100%;padding: 5px"
  20. >
  21. <el-card shadow="always" style="padding: 15px 5px 5px 15px">
  22. <el-row :gutter="10">
  23. <el-col :span="24">
  24. <el-form-item label="关联项目">
  25. <el-input v-model="form.proMainName" readonly></el-input>
  26. </el-form-item>
  27. </el-col>
  28. </el-row>
  29. <el-card class="pdtopbottom16 mb25 pdtop16px">
  30. <span class="moneydetails">
  31. 费用明细
  32. </span>
  33. <el-row :gutter="10" class="eltype">
  34. <el-col :span="4" class="col-txt txtc"><span>费用&成本类型</span></el-col>
  35. <el-col :span="4" class="col-txt txtc">
  36. 金额(元)
  37. </el-col>
  38. <el-col :span="4" class="col-txt txtc">发票号</el-col>
  39. <el-col :span="12" class="col-txt txtc">
  40. 单据
  41. </el-col>
  42. </el-row>
  43. <el-row
  44. v-for="(item,index) in form.applyUseMoneyDetailListString"
  45. :gutter="10" class="eltype"
  46. >
  47. <el-col :span="4">
  48. <el-select
  49. size="small"
  50. v-model="item.feeType"
  51. disabled
  52. filterable placeholder="请选择"
  53. style="width: 100%"
  54. >
  55. <el-option
  56. v-for="item in cbFyTypes"
  57. :key="item.value"
  58. :label="item.label"
  59. :value="item.value"
  60. />
  61. </el-select>
  62. </el-col>
  63. <el-col :span="4">
  64. <el-input
  65. v-model="item.feeMoney"
  66. filterable
  67. size="small"
  68. placeholder="请选择"
  69. readonly
  70. style="width: 100%"
  71. />
  72. </el-col>
  73. <el-col :span="4">
  74. <el-input
  75. v-model="item.fileNumber"
  76. :controls="false"
  77. size="small"
  78. readonly
  79. :disabled="item.fileList==0"
  80. controls-position="right"
  81. placeholder="无"
  82. style="width: 100%"
  83. />
  84. </el-col>
  85. <el-col :span="12" class="col-input">
  86. <el-upload
  87. :action="$constant.BASE_URI+'/FileController/upload'"
  88. :file-list="item.fileList"
  89. :http-request="(params)=>{uploadFile(params,index)}"
  90. :limit="5"
  91. :multiple="false"
  92. disabled
  93. :show-file-list="false"
  94. class="upload-demo"
  95. style="width: 30%;float: left;margin-left: 42px"
  96. >
  97. <el-button size="small" disabled style="font-size: 14px" type="text">
  98. 上传发票
  99. <img
  100. src="./fapiaoicon.png"
  101. style="margin-left: 5px;position: absolute;top: 13.5px;"
  102. width="24px"
  103. />
  104. </el-button>
  105. </el-upload>
  106. <el-radio-group
  107. disabled
  108. v-model="item.fileType"
  109. style="margin-left: 30px;"
  110. @input="changeFileType($event,index)"
  111. >
  112. <el-radio v-if="false" :label="1">上传发票</el-radio>
  113. <el-radio :label="2">发票后补</el-radio>
  114. <el-radio :label="3">无发票</el-radio>
  115. </el-radio-group>
  116. </el-col>
  117. <el-col :span="13">&nbsp;</el-col>
  118. <el-col :span="11">
  119. <div v-for="(file,i) in item.fileList" v-if="item.fileList.length>0"
  120. style="margin: 0px 0px 0px 45px;"
  121. >
  122. <div>
  123. <a :href="file.url">{{ file.name }}</a>
  124. <span class="el-upload-list__item-actions">
  125. </span>
  126. </div>
  127. </div>
  128. </el-col>
  129. </el-row>
  130. <div class="feeMoneyTotal">
  131. <div style="float: right">共计金额(元):{{ form.feeMoneyTotal }}</div>
  132. </div>
  133. </el-card>
  134. <el-row>
  135. <el-col :span="24">
  136. <el-form-item label="用途">
  137. <el-input
  138. v-model="form.useReasons"
  139. readonly
  140. type="textarea"
  141. />
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="24">
  145. <el-form-item label="收款单位(人)">
  146. <el-input v-model="form.payeeName" readonly></el-input>
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="12">
  150. <el-form-item label="开户银行">
  151. <el-input v-model="form.bankName" readonly></el-input>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="12">
  155. <el-form-item label="银行账户" label-width="125px">
  156. <el-input v-model="form.bankAccountNum" placeholder="金额" readonly/>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="24">
  160. <el-form-item label="抄送">
  161. <el-input v-model="form.flowMainCcList" readonly/>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="12">
  165. <el-form-item
  166. label="发起人" prop="field119"
  167. >
  168. <el-input v-model="form.createdByString" disabled></el-input>
  169. </el-form-item>
  170. </el-col>
  171. <el-col :span="12">
  172. <el-form-item
  173. label="发起时间"
  174. prop="field119"
  175. >
  176. <el-input v-model="form.createdAt"></el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-card style="margin-bottom: 10px;">
  180. <h3 style="margin:0">制单 </h3>
  181. <el-row :gutter="10">
  182. <el-col :span="12">
  183. <el-form-item disabled label="支付方式" style="margin-bottom: 15px">
  184. <el-select v-model="confirmForm.payType" disabled>
  185. <el-option
  186. v-for="item in dc_data.PAY_TYPE"
  187. :key="item.value"
  188. :label="item.label"
  189. :value="item.value"
  190. />
  191. </el-select>
  192. </el-form-item>
  193. </el-col>
  194. <el-col :span="12">
  195. <el-form-item disabled label="支付账户" style="margin-bottom: 15px">
  196. <el-select v-model="confirmForm.accountType" disabled>
  197. <el-option
  198. v-for="item in dc_data.ACCOUNT"
  199. :key="item.value"
  200. :label="item.label"
  201. :value="item.value"
  202. />
  203. </el-select>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="12">
  207. <el-form-item label="制单日期" style="margin-bottom: 0">
  208. <el-date-picker
  209. disabled
  210. v-model="confirmForm.makeDate"
  211. placeholder="制单日期"
  212. style="width: 100%"
  213. type="date"
  214. value-format="yyyy-MM-dd"
  215. />
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="12">
  219. <el-form-item label="制单号" style="margin-bottom: 0">
  220. <el-input readonly v-model="confirmForm.makeNum"></el-input>
  221. </el-form-item>
  222. </el-col>
  223. </el-row>
  224. </el-card>
  225. <el-card style="margin-bottom: 10px;">
  226. <h3 style="margin:0">支付复核 </h3>
  227. <el-form
  228. ref="confirmForm"
  229. :model="confirmForm"
  230. class="cost_form"
  231. label-width="100px"
  232. style="width: 100%;padding: 5px"
  233. >
  234. <el-row :gutter="10">
  235. <el-col :span="24">
  236. <el-form-item label="实际支付日期" style="margin-bottom: 15px">
  237. <el-date-picker
  238. readonly
  239. v-model="confirmForm.payTime"
  240. placeholder="实际支付日期"
  241. style="width: 100%"
  242. type="date"
  243. value-format="yyyy-MM-dd"
  244. />
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="24">
  248. <el-form-item label="备注" style="margin-bottom: 0">
  249. <el-input readonly v-model="confirmForm.payRemark" style="margin-top:10px" type="textarea"/>
  250. </el-form-item>
  251. </el-col>
  252. </el-row>
  253. </el-form>
  254. </el-card>
  255. </el-row>
  256. </el-card>
  257. </el-form>
  258. <h3>流程历史</h3>
  259. <el-card>
  260. <div class="tableDom">
  261. <el-table
  262. :data="tableData"
  263. :header-cell-style="{
  264. background:'#1890FF !important',
  265. color:'white'
  266. }"
  267. border
  268. style="width: 100%"
  269. >
  270. <el-table-column fixed label="序号" type="index" width="60"/>
  271. <el-table-column
  272. label="节点名称"
  273. prop="nodeName"
  274. width="180"
  275. />
  276. <el-table-column
  277. label="处理人"
  278. prop="auditUserName"
  279. width="180"
  280. />
  281. <el-table-column
  282. label="审核结果"
  283. prop="auditResultString"
  284. />
  285. <el-table-column
  286. label="审核意见"
  287. prop="auditContent"
  288. />
  289. <el-table-column
  290. label="发起/审核时间"
  291. prop="createdAt"
  292. >
  293. <template slot-scope="scope">
  294. {{ $common.transTime(scope.row.createdAt) }}
  295. </template>
  296. </el-table-column>
  297. </el-table>
  298. </div>
  299. </el-card>
  300. </el-tab-pane>
  301. <el-tab-pane label="流程图 " name="second">
  302. <cost-canvas v-if="canVasStatus" ref="costCanvas"/>
  303. </el-tab-pane>
  304. </el-tabs>
  305. </div>
  306. <div slot="footer">
  307. <el-button @click="confirmSubmit()">关 闭</el-button>
  308. </div>
  309. </el-dialog>
  310. </template>
  311. <script>
  312. import { upload } from '@/static/utils/channel'
  313. import Base from '@/views/base/base'
  314. import BaseData from '@/views/base/baseData'
  315. import UserSelect from '@/views/components/UserSelect'
  316. import costCanvas from '@/views/workflow/components/myProcess/costCanvas.vue'
  317. export default {
  318. name: 'ApplyPay',
  319. mixins: [Base, BaseData],
  320. components: {
  321. UserSelect, costCanvas
  322. },
  323. data() {
  324. return {
  325. row: {},
  326. canVasStatus: false,
  327. confirmForm: {},
  328. selectList: [],
  329. tableData: [],
  330. confirmList: [],
  331. loading: false,
  332. dc_key: ['ORDER_STATUS', 'PAY_TYPE', 'BUDGET_FY','ACCOUNT'],
  333. argeeBackStatus: false,
  334. argeeNoStatus: false,
  335. ProjectData: [],
  336. dialogTitle: '费用报支申请-查看详情',
  337. dialogVisible: false,
  338. form: {
  339. applyUseMoneyDetailListString: [],
  340. feeMoneyTotal: 0
  341. },
  342. activeName: 'first',
  343. cbFyTypes:[]
  344. }
  345. },
  346. mounted() {
  347. const _this = this
  348. _this.initDict(this.dc_key).then((res) => {
  349. })
  350. },
  351. methods: {
  352. handleClick(tab, event) {
  353. this.canVasStatus = false
  354. if (this.activeName == 'second') {
  355. this.canVasStatus = true
  356. this.$nextTick(() => {
  357. this.$refs.costCanvas.createNodeCanvas(this.row)
  358. })
  359. }
  360. },
  361. beforeClose() {
  362. this.canVasStatus = false
  363. this.form = {
  364. applyUseMoneyDetailListString: []
  365. }
  366. this.dialogVisible = false
  367. this.activeName = 'first'
  368. this.$forceUpdate()
  369. this.dialogVisible = false
  370. this.$emit('close')
  371. },
  372. getFeeMoneyTotal() {
  373. let feeMoneyTotal = 0
  374. for (let i = 0; i < this.form.applyUseMoneyDetailListString.length; i++) {
  375. feeMoneyTotal += this.form.applyUseMoneyDetailListString[i].feeMoney
  376. }
  377. this.form.feeMoneyTotal = feeMoneyTotal
  378. },
  379. changeFileType(e, i) {
  380. if (e != 1) {
  381. this.form.applyUseMoneyDetailListString[i].fileList = []
  382. }
  383. this.$forceUpdate()
  384. },
  385. parentMethod(val) {
  386. if (val.length > 0) {
  387. this.confirmForm.ccList = val.join(',')
  388. }
  389. },
  390. handlePictureRemove(i, file, fileList) {
  391. fileList.splice(i, 1)
  392. let copyFileList = [...fileList]
  393. fileList = copyFileList
  394. this.form.applyUseMoneyDetailListString = this.form.applyUseMoneyDetailListString.map((e) => {
  395. return e
  396. })
  397. },
  398. uploadFile(params, i) {
  399. upload(params, true).then((res) => {
  400. this.form.applyUseMoneyDetailListString[i].fileList.push(res)
  401. this.form.applyUseMoneyDetailListString[i].fileType = 1
  402. this.$message.success('上传成功')
  403. })
  404. },
  405. baseRequest1(prefix, opUrl, postData) {
  406. return this.$channel.globleRequest(prefix, opUrl, postData, 'project task')
  407. },
  408. async confirmSubmit() {
  409. this.dialogVisible = false
  410. this.form = {}
  411. this.$emit('close')
  412. },
  413. async setVisible(status, row) {
  414. this.loading = false
  415. this.row = row
  416. this.loading = false
  417. try {
  418. const { data } = await this.baseRequest1('ApplyUseMoneyController', 'getInfoByFlowMainId', { flowMainId: row.id })
  419. const { data: flowHistroy } = await this.baseRequest1('FlowMainController', 'getFlowHistroyByFlowMainId', { flowMainId: row.id })
  420. this.confirmForm.flowMainPushId = row.flowMainPushId
  421. this.tableData = flowHistroy
  422. this.form = data
  423. this.confirmForm.confirmResult = data.confirmResult
  424. this.confirmForm.payType = data.payType
  425. this.confirmForm.payTime = this.$common.transDate(data.payTime)
  426. this.confirmForm.payRemark = data.payRemark
  427. this.confirmForm.accountType = data.accountType
  428. this.projectChange()
  429. this.confirmList = data.ccList
  430. console.log(this.$common.transDate(data.makeDate))
  431. this.confirmForm.makeDate = this.$common.transDate(data.makeDate)
  432. this.confirmForm.makeNum = data.makeNum
  433. this.form.createdAt = data.createdAt ? this.$common.transDate(data.createdAt) : null
  434. this.form.applyUseMoneyDetailListString = data.applyUseMoneyDetailList
  435. for (const e of this.form.applyUseMoneyDetailListString) {
  436. if (e.fileDataIds && e.fileDataIds.length > 0) {
  437. // e.fileList = e.fileDataIds.split(',')
  438. const { data: fileTaoTaoList } = await this.baseRequest1('FileZtController', 'findFileInfoByIds/' + e.fileDataIds, '')
  439. e.fileList = fileTaoTaoList.data.map((file) => {
  440. console.log(file)
  441. return {
  442. url: this.$constant.BASE_URI + '/FileController/download/' + file.id,
  443. name: file.fileName,
  444. data: e.id,
  445. uid: new Date().getTime()
  446. }
  447. })
  448. } else {
  449. e.fileList = []
  450. }
  451. }
  452. this.getFeeMoneyTotal()
  453. if (data.flowMainCcList) {
  454. this.form.flowMainCcList = data.flowMainCcList.map((e) => {
  455. return (e.name)
  456. }).join()
  457. }
  458. if (data.applyUseMoneyDetailList) {
  459. this.form.applyUseMoneyDetailListString = data.applyUseMoneyDetailList
  460. }
  461. } catch (e) {
  462. console.error(e)
  463. }
  464. this.dialogVisible = status
  465. this.row = row
  466. },
  467. addListRow() {
  468. const _this = this
  469. _this.form.applyUseMoneyDetailListString.push({ type: '1', fileList: [] })
  470. },
  471. deleteRow(index) {
  472. this.form.applyUseMoneyDetailListString.splice(index, 1)
  473. },
  474. async projectChange(){
  475. this.cbFyTypes=[]
  476. let submitData = {proId:this.form.proId }
  477. const { data } = await this.baseRequest1('ProMainDashboardController', 'getRightBudgetList', submitData)
  478. if (data) {
  479. const fyList = data.fyList || []
  480. const cbList = data.cbList || []
  481. fyList.forEach(item=>{
  482. const i = {
  483. value : item.budgetChildType,
  484. label:item.budgetType+'-'+item.budgetChildType
  485. }
  486. this.cbFyTypes.push(i)
  487. })
  488. cbList.forEach(item=>{
  489. const i = {
  490. value : item.budgetChildType,
  491. label:item.budgetType+'-'+item.budgetChildType
  492. }
  493. this.cbFyTypes.push(i)
  494. })
  495. }
  496. }
  497. }
  498. }
  499. </script>
  500. <style lang="scss">
  501. .mb25 {
  502. margin-bottom: 25px;
  503. }
  504. .pdtopbottom16 {
  505. padding: 0px 16px;
  506. }
  507. .pdtop16px {
  508. padding-top: 16px;
  509. }
  510. .cost_form {
  511. .col-input {
  512. font-weight: 400;
  513. }
  514. .el-form-item__label {
  515. text-align: right;
  516. font-size: 16px;
  517. font-family: 微软雅黑;
  518. padding-right: 10px;
  519. line-height: 40px;
  520. word-break: keep-all;
  521. white-space: nowrap;
  522. color: #606266;
  523. text-rendering: optimizeLegibility;
  524. font-weight: 400;
  525. }
  526. }
  527. .txtc {
  528. text-align: center
  529. }
  530. .ml5 {
  531. margin-left: 5px;
  532. }
  533. .eltype {
  534. margin-bottom: 5px;
  535. }
  536. .moneydetails {
  537. text-align: right;
  538. font-size: 16px;
  539. font-family: 微软雅黑;
  540. padding-right: 10px;
  541. word-break: keep-all;
  542. white-space: nowrap;
  543. color: #606266;
  544. text-rendering: optimizeLegibility;
  545. font-weight: 400;
  546. }
  547. .moneydetails:before {
  548. content: "*";
  549. color: #ff4949;
  550. }
  551. .tabsdom {
  552. .el-tabs__header {
  553. text-align: center !important;
  554. width: 139px !important;
  555. text-align: center !important;
  556. display: block !important;
  557. margin: auto !important;
  558. margin-bottom: 15px !important;
  559. }
  560. .el-tabs__nav-wrap::after {
  561. display: none;
  562. }
  563. .el-upload {
  564. width: 100%;
  565. }
  566. }
  567. .feeMoneyTotal {
  568. width: 100%;
  569. height: 14px;
  570. font-size: 14px;
  571. font-weight: 400;
  572. color: #1890FF;
  573. margin-top: 31px;
  574. margin-bottom: 13px;
  575. }
  576. </style>