applyPaymentConfirm.vue 21 KB

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