applyInvoiceRedConfirm.vue 18 KB

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