applyPaymentDetail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. <template>
  2. <!-- 加班申请单-详情改造 发起付款申请(要调用接口的)-->
  3. <el-dialog
  4. :close-on-click-modal="false"
  5. :close-on-press-escape="false"
  6. :visible.sync="dialogVisible"
  7. title="发起付款申请"
  8. top="50px"
  9. width="75%"
  10. :append-to-body="true"
  11. :before-close="closeDialog"
  12. class="statistic_base"
  13. :modal-append-to-body="true"
  14. custom-class="tagdialog"
  15. >
  16. <div class="tabsdom">
  17. <el-tabs v-model="activeName" @tab-click="handleClick">
  18. <el-tab-pane label="付款申请" name="first">
  19. <el-row type="flex" justify="end">
  20. <el-col :span="3" class="col-txt"><span>流程编号:</span></el-col>
  21. <el-col :span="6" class="col-input"><span style="font-size: 14px">{{ formData.flowNum }}</span></el-col>
  22. </el-row>
  23. <el-form
  24. ref="elForm"
  25. :model="formData"
  26. :rules="rules"
  27. label-width="150px"
  28. >
  29. <el-card shadow="always" style="padding: 15px 5px 5px 15px">
  30. <el-row :gutter="15">
  31. <el-col :span="24">
  32. <el-form-item label="标题" prop="title">
  33. <el-input v-model="formData.title" placeholder="付款领用单-年月日" readonly/>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="12">
  37. <el-form-item label="创建人">
  38. <el-input v-model="userinfo.truename" placeholder="创建人" readonly />
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="12">
  42. <el-form-item label="创建部门">
  43. <el-input v-model="userinfo.deptName" placeholder="创建部门" readonly />
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="24">
  47. <el-form-item label="是否为无合同付款">
  48. <el-select
  49. v-model="formData.isNoContract"
  50. clearable
  51. filterable
  52. placeholder="是否为无合同付款"
  53. style="width: 100%"
  54. :popper-append-to-body="false"
  55. popper-class="statistic_base"
  56. >
  57. <el-option
  58. v-for="item in dc_data.ANSWER_NEED"
  59. :key="item.value"
  60. :label="item.label"
  61. :value="item.value"
  62. :popper-append-to-body="false"
  63. popper-class="statistic_base"
  64. />
  65. </el-select>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="24">
  69. <el-form-item label="付款单位">
  70. <el-input v-model="formData.payerName" placeholder="请填写" />
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="24">
  74. <el-form-item label="收款单位">
  75. <el-input v-model="formData.payeeName" placeholder="请填写" />
  76. </el-form-item>
  77. </el-col>
  78. <el-col :span="24">
  79. <el-form-item label="资金用途">
  80. <el-input v-model="formData.moneyPurpose" placeholder="请填写" />
  81. </el-form-item>
  82. </el-col>
  83. <el-col :span="24">
  84. <el-form-item label="合同总价">
  85. <el-input v-model="formData.contractPrice" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请填写" />
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="24">
  89. <el-form-item label="付款说明">
  90. <el-input
  91. v-model="formData.payRemark"
  92. :autosize="{minRows: 4, maxRows: 4}"
  93. :style="{width: '100%'}"
  94. placeholder="请填写"
  95. type="textarea"
  96. maxlength="2000"
  97. show-word-limit
  98. />
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="24">
  102. <el-form-item label="累计付款">
  103. <el-input v-model="formData.havePayMoney" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请填写" />
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="12">
  107. <el-form-item label="申请金额(小写)" prop="applyPayMoney">
  108. <el-input v-model="formData.applyPayMoney" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请填写" @change="swapper(formData.applyPayMoney)" />
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="12">
  112. <el-form-item label="申请金额(大写)" prop="applyPayMoneyUppercase">
  113. <el-input v-model="formData.applyPayMoneyUppercase" placeholder="请填写" />
  114. </el-form-item>
  115. </el-col>
  116. <!-- <el-col :span="24">formData.applyPayMoneyUppercase={{formData.applyPayMoneyUppercase}}</el-col>-->
  117. <el-col :span="24">
  118. <el-form-item label="相关附件">
  119. <el-upload
  120. :disabled="true"
  121. :action="$constant.BASE_URI+'/FileController/upload'"
  122. :file-list="formData.fileUrlList"
  123. :http-request="uploadFile"
  124. class="upload-demo"
  125. multiple
  126. >
  127. <el-button size="small" type="primary">上传附件</el-button>
  128. <div slot="file" slot-scope="{file}">
  129. <a :href="file.url">{{ file.name }}</a>
  130. <span class="el-upload-list__item-actions">
  131. <i class="el-icon-delete" @click="handlePictureRemove(file,formData.fileUrlList)" />
  132. </span>
  133. </div>
  134. </el-upload>
  135. </el-form-item>
  136. </el-col>
  137. </el-row>
  138. <h3>流程历史</h3>
  139. <div class="tableDom">
  140. <el-table
  141. :data="tableData"
  142. :header-cell-style="{
  143. background:'#1890FF !important',
  144. color:'white'
  145. }"
  146. border
  147. style="width: 100%"
  148. >
  149. <el-table-column fixed label="序号" type="index" width="60" />
  150. <el-table-column
  151. label="节点名称"
  152. prop="nodeName"
  153. width="180"
  154. />
  155. <el-table-column
  156. label="处理人"
  157. prop="auditUserName"
  158. width="180"
  159. />
  160. <el-table-column
  161. label="审核结果"
  162. prop="auditResultString"
  163. />
  164. <el-table-column
  165. label="审核意见"
  166. prop="auditContent"
  167. />
  168. <el-table-column
  169. label="发起/审核时间"
  170. prop="createdAt"
  171. >
  172. <template slot-scope="scope">
  173. {{ $common.transTime(scope.row.createdAt) }}
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. </div>
  178. </el-card>
  179. </el-form>
  180. </el-tab-pane>
  181. <el-tab-pane label="流程图" name="second">
  182. <payment-canvas ref="PaymentCanvas" id="paymanetDetail"/>
  183. </el-tab-pane>
  184. </el-tabs>
  185. </div>
  186. <div slot="footer">
  187. <el-button @click="closeDialog">关闭</el-button>
  188. </div>
  189. </el-dialog>
  190. </template>
  191. <script>
  192. import { upload } from '@/static/utils/channel'
  193. import Base from '@/views/base/base'
  194. import BaseData from '@/views/base/baseData'
  195. import UserSelect from '@/views/components/UserSelect'
  196. import * as echarts from 'echarts'
  197. import PaymentCanvas from '@/views/workflow/components/myProcess/paymentCanvas.vue'
  198. const lineStyle = {
  199. color: '#00116a',
  200. width: 2
  201. }
  202. const redLinestyle = {
  203. color: 'red',
  204. width: 2
  205. }
  206. const applyAddWorkTime = { useTime: 0 }
  207. export default {
  208. name: 'ApplyPay',
  209. components: {
  210. PaymentCanvas,
  211. upload,
  212. UserSelect
  213. },
  214. mixins: [Base, BaseData],
  215. data() {
  216. return {
  217. row: {},
  218. argeeBackStatus: false,
  219. argeeNoStatus: false,
  220. tableData: [],
  221. flowHistroy: [],
  222. confirmForm: {
  223. confirmContent: ''
  224. },
  225. dc_key: ['ANSWER_NEED'],
  226. ProjectData: [],
  227. dialogVisible: false,
  228. applyAddWorkTime: [{ ...applyAddWorkTime }],
  229. formData: {
  230. proId: '',
  231. totalAddTime: 0,
  232. applyReasons: '',
  233. position: '',
  234. applyAddWorkTime: [
  235. {
  236. useTime: 0
  237. }
  238. ]
  239. },
  240. userinfo: {},
  241. activeName: 'first',
  242. rules: {
  243. title: [{
  244. required: true,
  245. message: '请输入标题',
  246. trigger: 'change'
  247. }],
  248. applyPayMoney: [{
  249. required: true,
  250. message: '请输入申请金额(小写)',
  251. trigger: 'change'
  252. }
  253. ],
  254. applyPayMoneyUppercase: [{
  255. required: true,
  256. message: '请输入申请金额(大写)',
  257. trigger: 'change'
  258. }]
  259. },
  260. positionOptions: [
  261. {
  262. 'label': '公司',
  263. 'value': 1
  264. },
  265. {
  266. 'label': '客户处',
  267. 'value': 2
  268. }, {
  269. 'label': '居家',
  270. 'value': 3
  271. }]
  272. }
  273. },
  274. computed: {},
  275. watch: {
  276. 'applyAddWorkTime': {
  277. deep: true,
  278. handler(newValue, oldValue) {
  279. let totalAddTime = 0
  280. for (let i = 0; i < this.applyAddWorkTime.length; i++) {
  281. if (this.applyAddWorkTime[i].useTime === 0 || this.applyAddWorkTime[i].useTime) {
  282. totalAddTime = totalAddTime + Number(this.applyAddWorkTime[i].useTime)
  283. }
  284. }
  285. console.log(totalAddTime)
  286. this.changeAddWorkTime(totalAddTime.toFixed(1))
  287. }
  288. }
  289. },
  290. created() {
  291. },
  292. mounted() {
  293. this.initDict(this.dc_key).then((res) => {
  294. })
  295. // this.initProject({ /* signstatus: '2,3'*/ })
  296. },
  297. methods: {
  298. handlePictureRemove(file, fileUrlList) {
  299. var index = fileUrlList.indexOf(file)
  300. fileUrlList.splice(index, 1)
  301. },
  302. uploadFile: function(param) {
  303. const _this = this
  304. upload(param, true).then((res) => {
  305. _this.formData.fileUrlList.push(res)
  306. })
  307. },
  308. swapper(n) {
  309. // console.log('ddd',n)
  310. if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) { return '数据非法' }
  311. var unit = '千百拾亿千百拾万千百拾元角分'; var str = ''
  312. n += '00'
  313. var p = n.indexOf('.')
  314. if (p >= 0) { n = n.substring(0, p) + n.substr(p + 1, 2) }
  315. unit = unit.substr(unit.length - n.length)
  316. for (var i = 0; i < n.length; i++) { str += '零壹贰叁肆伍陆柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i) }
  317. // console.log('end',str.replace(/零(千|百|拾|角)/g, '零').replace(/(零)+/g, '零').replace(/零(万|亿|元)/g, '$1').replace(/(亿)万|壹(拾)/g, '$1$2').replace(/^元零?|零分/g, '').replace(/元$/g, '元整'))
  318. this.formData.applyPayMoneyUppercase = str.replace(/零(千|百|拾|角)/g, '零').replace(/(零)+/g, '零').replace(/零(万|亿|元)/g, '$1').replace(/(亿)万|壹(拾)/g, '$1$2').replace(/^元零?|零分/g, '').replace(/元$/g, '元整')
  319. // console.log('end',this.formData.applyPayMoneyUppercase)
  320. this.$forceUpdate()
  321. },
  322. closeDialog() {
  323. this.dialogVisible = false
  324. this.$emit('close')
  325. },
  326. handleClick(tab, event) {
  327. if (this.activeName == 'second') this.$refs.PaymentCanvas.createNodeCanvas(this.row)
  328. },
  329. async getIMGFlowHistroyByFlowMainId(row) {
  330. console.log(row)
  331. // return
  332. const { data } = await this.baseRequest1('FlowMainController', 'getIMGFlowHistroyByFlowMainId', { flowMainId: row.id })
  333. console.log(data)
  334. for (let i = 0; i < data.length; i++) {
  335. switch (data[i].nodeKey) {
  336. case 'curr_user':
  337. if (i == 0 && data[i].type == 1) {
  338. // 审核人审核
  339. this.node[0].symbol = 'image://' + require('../asste/lanfangkuai.png')
  340. }
  341. break
  342. case 'dept_superior_1_0_1':
  343. if (i == 0 && data[i].type == 3) {
  344. this.node[0].symbol = 'image://' + require('../asste/huangfanmgkuai.png')
  345. }
  346. if (i == 0 && data[i].type == 1) {
  347. this.node[0].symbol = 'image://' + require('../asste/lanfangkuai.png')
  348. }
  349. break
  350. default:
  351. }
  352. }
  353. },
  354. createNodeCanvas() {
  355. this.$nextTick(() => {
  356. const chartDom = document.getElementById('containeraddworkdetail')
  357. var myCharts = echarts.init(chartDom)
  358. const charts = {
  359. nodes: this.node,
  360. linesData: this.linesData
  361. }
  362. const option = {
  363. xAxis: {
  364. min: 0,
  365. max: 600,
  366. padding: [0, 50, 0, 50],
  367. show: false,
  368. type: 'value'
  369. },
  370. yAxis: {
  371. min: 0,
  372. max: 450,
  373. show: false,
  374. type: 'value'
  375. },
  376. grid: {
  377. left: 50,
  378. right: 0,
  379. bottom: 0,
  380. top: 0
  381. },
  382. series: [
  383. {
  384. type: 'graph',
  385. coordinateSystem: 'cartesian2d',
  386. symbol: 'rect',
  387. symbolSize: [80, 40],
  388. itemStyle: {
  389. color: 'rgb(225,7,7)'
  390. },
  391. symbolOffset: [10, 0],
  392. // force: {
  393. // edgeLength: 100,//连线的长度
  394. // repulsion: 200 //子节点之间的间距
  395. // },
  396. label: {
  397. show: true,
  398. color: 'white' // 节点文字颜色
  399. },
  400. data: charts.nodes
  401. },
  402. {
  403. type: 'lines',
  404. polyline: false,
  405. coordinateSystem: 'cartesian2d',
  406. symbol: ['', 'arrow'],
  407. symbolSize: 10,
  408. data: charts.linesData
  409. }
  410. ]
  411. }
  412. myCharts.clear()
  413. myCharts.setOption(option)
  414. window.addEventListener('resize', () => {
  415. myCharts.resize()
  416. })
  417. })
  418. },
  419. selectCommonPhrases(e) {
  420. if (!this.confirmForm.confirmContent) this.confirmForm.confirmContent = ''
  421. this.confirmForm.confirmContent += e
  422. },
  423. changeAddWorkTime(totalAddTime) {
  424. this.formData.totalAddTime = totalAddTime
  425. },
  426. async getUserInfo(applyUser) {
  427. const { data: userinfo } = await this.baseRequest1('ApplyPaymentSettleController', 'getUserInfoByUserId', { userId: applyUser })
  428. this.userinfo = userinfo
  429. console.log(this.userinfo)
  430. },
  431. spliceListRow(index) {
  432. this.formData.workTimeList.splice(index, 1)
  433. },
  434. async setVisible(status, row) {
  435. this.row = row
  436. this.activeName = 'first'
  437. this.getUserInfo(row.applyUser)
  438. this.confirmForm.flowMainPushId = row.flowMainPushId
  439. const { data } = await this.baseRequest1('ApplyPaymentSettleController', 'getInfoByFlowMainId', { flowMainId: row.id })
  440. const { data: flowHistroy } = await this.baseRequest1('FlowMainController', 'getFlowHistroyByFlowMainId', { flowMainId: row.id })
  441. this.tableData = flowHistroy
  442. this.formData = data
  443. if (this.formData.isNoContract || this.formData.isNoContract == 0) {
  444. this.formData.isNoContract = String(this.formData.isNoContract)
  445. }
  446. if (data.fileDataIds) {
  447. const { data: fileTaoTaoList } = await this.baseRequest1('FileZtController', 'findFileInfoByIds/' + data.fileDataIds, '')
  448. console.log(fileTaoTaoList.data)
  449. this.formData.fileUrlList = fileTaoTaoList.data.map((e) => {
  450. return {
  451. url: this.$constant.BASE_URI + '/FileController/download/' + e.id,
  452. name: e.fileName,
  453. data: e.id,
  454. uid: new Date().getTime()
  455. }
  456. })
  457. console.log(this.formData.fileUrlList)
  458. } else {
  459. this.formData.fileUrlList = []
  460. }
  461. // this.applyAddWorkTime = data.applyAddWorkTimeList.map((e) => {
  462. // return {
  463. // useTime: e.useTime,
  464. // startDay: this.$common.transDate(e.startDay),
  465. // startTime: this.$common.transMinute(e.startTime),
  466. // endTime: this.$common.transMinute(e.endTime)
  467. // }
  468. // })
  469. this.dialogVisible = status
  470. this.row = row
  471. },
  472. baseRequest1(prefix, opUrl, postData) {
  473. return this.$channel.globleRequest(prefix, opUrl, postData, 'project task')
  474. },
  475. async handelConfirm() {
  476. this.dialogVisible = false
  477. }
  478. }
  479. }
  480. </script>
  481. <style lang="scss">
  482. #containeraddworkdetail {
  483. height: 600px;
  484. width: 100%;
  485. background: #F5F5F5;
  486. }
  487. .cclist {
  488. .col-input {
  489. padding: 0;
  490. }
  491. }
  492. .pdr10px {
  493. padding-right: 10px;
  494. }
  495. .mgb10px {
  496. margin-bottom: 10px;
  497. }
  498. .mb25 {
  499. margin-bottom: 25px;
  500. }
  501. .pdtopbottom16 {
  502. padding: 0px 16px;
  503. }
  504. .pdtop16px {
  505. padding-top: 16px;
  506. }
  507. .cost_form {
  508. .col-input {
  509. font-weight: 400;
  510. }
  511. .el-form-item__label .moneydetails {
  512. text-align: right;
  513. font-size: 16px;
  514. font-family: 微软雅黑;
  515. padding-right: 10px;
  516. line-height: 40px;
  517. word-break: keep-all;
  518. white-space: nowrap;
  519. color: #606266;
  520. text-rendering: optimizeLegibility;
  521. font-weight: 400;
  522. }
  523. .moneydetails {
  524. text-align: right;
  525. font-size: 16px;
  526. font-family: 微软雅黑;
  527. padding-right: 10px;
  528. word-break: keep-all;
  529. white-space: nowrap;
  530. color: #606266;
  531. text-rendering: optimizeLegibility;
  532. font-weight: 400;
  533. }
  534. .moneydetails:before {
  535. content: "*";
  536. color: #ff4949;
  537. }
  538. }
  539. .txtc {
  540. text-align: center
  541. }
  542. .ml5 {
  543. margin-left: 5px;
  544. }
  545. .eltype {
  546. margin-bottom: 15px;
  547. }
  548. .tabsdom {
  549. .el-input {
  550. width: 100%;
  551. }
  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>