applyCostConfirm.vue 19 KB

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