applyFinanceConfirm.vue 18 KB

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