applyBuyingMoreDetail.vue 18 KB

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