applyCostDetails.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  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 dc_data.BUDGET_FY"
  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="24">
  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 label="制单日期" style="margin-bottom: 0">
  196. <el-date-picker
  197. disabled
  198. v-model="confirmForm.makeDate"
  199. placeholder="制单日期"
  200. style="width: 100%"
  201. type="date"
  202. value-format="yyyy-MM-dd"
  203. />
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="12">
  207. <el-form-item label="制单号" style="margin-bottom: 0">
  208. <el-input readonly v-model="confirmForm.makeNum"></el-input>
  209. </el-form-item>
  210. </el-col>
  211. </el-row>
  212. </el-card>
  213. <el-card style="margin-bottom: 10px;">
  214. <h3 style="margin:0">支付复核 </h3>
  215. <el-form
  216. ref="confirmForm"
  217. :model="confirmForm"
  218. class="cost_form"
  219. label-width="100px"
  220. style="width: 100%;padding: 5px"
  221. >
  222. <el-row :gutter="10">
  223. <el-col :span="24">
  224. <el-form-item label="实际支付日期" style="margin-bottom: 15px">
  225. <el-date-picker
  226. readonly
  227. v-model="confirmForm.payTime"
  228. placeholder="实际支付日期"
  229. style="width: 100%"
  230. type="date"
  231. value-format="yyyy-MM-dd"
  232. />
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="24">
  236. <el-form-item label="备注" style="margin-bottom: 0">
  237. <el-input readonly v-model="confirmForm.payRemark" style="margin-top:10px" type="textarea"/>
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. </el-form>
  242. </el-card>
  243. </el-row>
  244. </el-card>
  245. </el-form>
  246. <h3>流程历史</h3>
  247. <el-card>
  248. <div class="tableDom">
  249. <el-table
  250. :data="tableData"
  251. :header-cell-style="{
  252. background:'#1890FF !important',
  253. color:'white'
  254. }"
  255. border
  256. style="width: 100%"
  257. >
  258. <el-table-column fixed label="序号" type="index" width="60"/>
  259. <el-table-column
  260. label="节点名称"
  261. prop="nodeName"
  262. width="180"
  263. />
  264. <el-table-column
  265. label="处理人"
  266. prop="auditUserName"
  267. width="180"
  268. />
  269. <el-table-column
  270. label="审核结果"
  271. prop="auditResultString"
  272. />
  273. <el-table-column
  274. label="审核意见"
  275. prop="auditContent"
  276. />
  277. <el-table-column
  278. label="发起/审核时间"
  279. prop="createdAt"
  280. >
  281. <template slot-scope="scope">
  282. {{ $common.transTime(scope.row.createdAt) }}
  283. </template>
  284. </el-table-column>
  285. </el-table>
  286. </div>
  287. </el-card>
  288. </el-tab-pane>
  289. <el-tab-pane label="流程图 " name="second">
  290. <cost-canvas v-if="canVasStatus" ref="costCanvas"/>
  291. </el-tab-pane>
  292. </el-tabs>
  293. </div>
  294. <div slot="footer">
  295. <el-button @click="confirmSubmit()">关 闭</el-button>
  296. </div>
  297. </el-dialog>
  298. </template>
  299. <script>
  300. import { upload } from '@/static/utils/channel'
  301. import Base from '@/views/base/base'
  302. import BaseData from '@/views/base/baseData'
  303. import UserSelect from '@/views/components/UserSelect'
  304. import costCanvas from '@/views/workflow/components/myProcess/costCanvas.vue'
  305. export default {
  306. name: 'ApplyPay',
  307. mixins: [Base, BaseData],
  308. components: {
  309. UserSelect, costCanvas
  310. },
  311. data() {
  312. return {
  313. row: {},
  314. canVasStatus: false,
  315. confirmForm: {},
  316. selectList: [],
  317. tableData: [],
  318. confirmList: [],
  319. loading: false,
  320. dc_key: ['ORDER_STATUS', 'PAY_TYPE', 'BUDGET_FY'],
  321. argeeBackStatus: false,
  322. argeeNoStatus: false,
  323. ProjectData: [],
  324. dialogTitle: '费用报支申请-查看详情',
  325. dialogVisible: false,
  326. form: {
  327. applyUseMoneyDetailListString: [],
  328. feeMoneyTotal: 0
  329. },
  330. activeName: 'first'
  331. }
  332. },
  333. mounted() {
  334. const _this = this
  335. _this.initDict(this.dc_key).then((res) => {
  336. })
  337. },
  338. methods: {
  339. handleClick(tab, event) {
  340. this.canVasStatus = false
  341. if (this.activeName == 'second') {
  342. this.canVasStatus = true
  343. this.$nextTick(() => {
  344. this.$refs.costCanvas.createNodeCanvas(this.row)
  345. })
  346. }
  347. },
  348. beforeClose() {
  349. this.canVasStatus = false
  350. this.form = {
  351. applyUseMoneyDetailListString: []
  352. }
  353. this.dialogVisible = false
  354. this.activeName = 'first'
  355. this.$forceUpdate()
  356. },
  357. getFeeMoneyTotal() {
  358. let feeMoneyTotal = 0
  359. for (let i = 0; i < this.form.applyUseMoneyDetailListString.length; i++) {
  360. feeMoneyTotal += this.form.applyUseMoneyDetailListString[i].feeMoney
  361. }
  362. this.form.feeMoneyTotal = feeMoneyTotal
  363. },
  364. changeFileType(e, i) {
  365. if (e != 1) {
  366. this.form.applyUseMoneyDetailListString[i].fileList = []
  367. }
  368. this.$forceUpdate()
  369. },
  370. parentMethod(val) {
  371. if (val.length > 0) {
  372. this.confirmForm.ccList = val.join(',')
  373. }
  374. },
  375. handlePictureRemove(i, file, fileList) {
  376. fileList.splice(i, 1)
  377. let copyFileList = [...fileList]
  378. fileList = copyFileList
  379. this.form.applyUseMoneyDetailListString = this.form.applyUseMoneyDetailListString.map((e) => {
  380. return e
  381. })
  382. },
  383. uploadFile(params, i) {
  384. upload(params, true).then((res) => {
  385. this.form.applyUseMoneyDetailListString[i].fileList.push(res)
  386. this.form.applyUseMoneyDetailListString[i].fileType = 1
  387. this.$message.success('上传成功')
  388. })
  389. },
  390. baseRequest1(prefix, opUrl, postData) {
  391. return this.$channel.globleRequest(prefix, opUrl, postData, 'project task')
  392. },
  393. async confirmSubmit() {
  394. this.dialogVisible = false
  395. this.form = {}
  396. },
  397. async setVisible(status, row) {
  398. this.loading = false
  399. this.row = row
  400. this.loading = false
  401. try {
  402. const { data } = await this.baseRequest1('ApplyUseMoneyController', 'getInfoByFlowMainId', { flowMainId: row.id })
  403. const { data: flowHistroy } = await this.baseRequest1('FlowMainController', 'getFlowHistroyByFlowMainId', { flowMainId: row.id })
  404. this.confirmForm.flowMainPushId = row.flowMainPushId
  405. this.tableData = flowHistroy
  406. this.form = data
  407. this.confirmForm.confirmResult = data.confirmResult
  408. this.confirmForm.payType = data.payType
  409. this.confirmForm.payTime = this.$common.transDate(data.payTime)
  410. this.confirmForm.payRemark = data.payRemark
  411. this.confirmList = data.ccList
  412. console.log(this.$common.transDate(data.makeDate))
  413. this.confirmForm.makeDate = this.$common.transDate(data.makeDate)
  414. this.confirmForm.makeNum = data.makeNum
  415. this.form.createdAt = data.createdAt ? this.$common.transDate(data.createdAt) : null
  416. this.form.applyUseMoneyDetailListString = data.applyUseMoneyDetailList
  417. for (const e of this.form.applyUseMoneyDetailListString) {
  418. if (e.fileDataIds && e.fileDataIds.length > 0) {
  419. // e.fileList = e.fileDataIds.split(',')
  420. const { data: fileTaoTaoList } = await this.baseRequest1('FileZtController', 'findFileInfoByIds/' + e.fileDataIds, '')
  421. e.fileList = fileTaoTaoList.data.map((file) => {
  422. console.log(file)
  423. return {
  424. url: this.$constant.BASE_URI + '/FileController/download/' + file.id,
  425. name: file.fileName,
  426. data: e.id,
  427. uid: new Date().getTime()
  428. }
  429. })
  430. } else {
  431. e.fileList = []
  432. }
  433. }
  434. this.getFeeMoneyTotal()
  435. if (data.flowMainCcList) {
  436. this.form.flowMainCcList = data.flowMainCcList.map((e) => {
  437. return (e.name)
  438. }).join()
  439. }
  440. if (data.applyUseMoneyDetailList) {
  441. this.form.applyUseMoneyDetailListString = data.applyUseMoneyDetailList
  442. }
  443. } catch (e) {
  444. console.error(e)
  445. }
  446. this.dialogVisible = status
  447. this.row = row
  448. },
  449. addListRow() {
  450. const _this = this
  451. _this.form.applyUseMoneyDetailListString.push({ type: '1', fileList: [] })
  452. },
  453. deleteRow(index) {
  454. this.form.applyUseMoneyDetailListString.splice(index, 1)
  455. }
  456. }
  457. }
  458. </script>
  459. <style lang="scss">
  460. .mb25 {
  461. margin-bottom: 25px;
  462. }
  463. .pdtopbottom16 {
  464. padding: 0px 16px;
  465. }
  466. .pdtop16px {
  467. padding-top: 16px;
  468. }
  469. .cost_form {
  470. .col-input {
  471. font-weight: 400;
  472. }
  473. .el-form-item__label {
  474. text-align: right;
  475. font-size: 16px;
  476. font-family: 微软雅黑;
  477. padding-right: 10px;
  478. line-height: 40px;
  479. word-break: keep-all;
  480. white-space: nowrap;
  481. color: #606266;
  482. text-rendering: optimizeLegibility;
  483. font-weight: 400;
  484. }
  485. }
  486. .txtc {
  487. text-align: center
  488. }
  489. .ml5 {
  490. margin-left: 5px;
  491. }
  492. .eltype {
  493. margin-bottom: 5px;
  494. }
  495. .moneydetails {
  496. text-align: right;
  497. font-size: 16px;
  498. font-family: 微软雅黑;
  499. padding-right: 10px;
  500. word-break: keep-all;
  501. white-space: nowrap;
  502. color: #606266;
  503. text-rendering: optimizeLegibility;
  504. font-weight: 400;
  505. }
  506. .moneydetails:before {
  507. content: "*";
  508. color: #ff4949;
  509. }
  510. .tabsdom {
  511. .el-tabs__header {
  512. text-align: center !important;
  513. width: 139px !important;
  514. text-align: center !important;
  515. display: block !important;
  516. margin: auto !important;
  517. margin-bottom: 15px !important;
  518. }
  519. .el-tabs__nav-wrap::after {
  520. display: none;
  521. }
  522. .el-upload {
  523. width: 100%;
  524. }
  525. }
  526. .feeMoneyTotal {
  527. width: 100%;
  528. height: 14px;
  529. font-size: 14px;
  530. font-weight: 400;
  531. color: #1890FF;
  532. margin-top: 31px;
  533. margin-bottom: 13px;
  534. }
  535. </style>