applyBuyingMoreDetail.vue 18 KB

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