applyReceivablesAdjustConfirm.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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="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 :loading="loading" 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. loading: false,
  198. row: {},
  199. confirmList: [],
  200. selectList: [],
  201. argeeBackStatus: false,
  202. argeeNoStatus: false,
  203. tableData: [],
  204. flowHistroy: [],
  205. confirmForm: {
  206. confirmContent: '',
  207. confirmResult: 1
  208. },
  209. dc_key: ['ANSWER_NEED'],
  210. ProjectData: [],
  211. dialogVisible: false,
  212. applyAddWorkTime: [{ ...applyAddWorkTime }],
  213. formData: {
  214. proId: '',
  215. totalAddTime: 0,
  216. applyReasons: '',
  217. position: '',
  218. applyAddWorkTime: [
  219. {
  220. useTime: 0
  221. }
  222. ]
  223. },
  224. userinfo: {},
  225. activeName: 'first',
  226. rules: {
  227. confirmResult: [{
  228. required: true,
  229. message: '请选择处理意见',
  230. trigger: 'change'
  231. }],
  232. title: [{
  233. required: true,
  234. message: '请输入标题',
  235. trigger: 'change'
  236. }],
  237. applyPayMoney: [{
  238. required: true,
  239. message: '请输入申请金额(小写)',
  240. trigger: 'change'
  241. }
  242. ],
  243. applyPayMoneyUppercase: [{
  244. required: true,
  245. message: '请输入申请金额(大写)',
  246. trigger: 'change'
  247. }]
  248. },
  249. positionOptions: [
  250. {
  251. 'label': '公司',
  252. 'value': 1
  253. },
  254. {
  255. 'label': '客户处',
  256. 'value': 2
  257. }, {
  258. 'label': '居家',
  259. 'value': 3
  260. }],
  261. TreeData: []
  262. }
  263. },
  264. computed: {},
  265. watch: {
  266. 'applyAddWorkTime': {
  267. deep: true,
  268. handler(newValue, oldValue) {
  269. let totalAddTime = 0
  270. for (let i = 0; i < this.applyAddWorkTime.length; i++) {
  271. if (this.applyAddWorkTime[i].useTime === 0 || this.applyAddWorkTime[i].useTime) {
  272. totalAddTime = totalAddTime + Number(this.applyAddWorkTime[i].useTime)
  273. }
  274. }
  275. console.log(totalAddTime)
  276. this.changeAddWorkTime(totalAddTime.toFixed(1))
  277. }
  278. }
  279. },
  280. created() {
  281. },
  282. mounted() {
  283. this.initDict(this.dc_key).then((res) => {
  284. // this.initProject({ /* signstatus: '2,3'*/ })
  285. })
  286. },
  287. methods: {
  288. handlePictureRemove(file, fileUrlList) {
  289. var index = fileUrlList.indexOf(file)
  290. fileUrlList.splice(index, 1)
  291. },
  292. uploadFile: function(param) {
  293. const _this = this
  294. upload(param, true).then((res) => {
  295. _this.formData.fileUrlList.push(res)
  296. })
  297. },
  298. swapper(n) {
  299. // console.log('ddd',n)
  300. if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) { return '数据非法' }
  301. var unit = '千百拾亿千百拾万千百拾元角分'; var str = ''
  302. n += '00'
  303. var p = n.indexOf('.')
  304. if (p >= 0) { n = n.substring(0, p) + n.substr(p + 1, 2) }
  305. unit = unit.substr(unit.length - n.length)
  306. for (var i = 0; i < n.length; i++) { str += '零壹贰叁肆伍陆柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i) }
  307. // console.log('end',str.replace(/零(千|百|拾|角)/g, '零').replace(/(零)+/g, '零').replace(/零(万|亿|元)/g, '$1').replace(/(亿)万|壹(拾)/g, '$1$2').replace(/^元零?|零分/g, '').replace(/元$/g, '元整'))
  308. this.formData.applyPayMoneyUppercase = str.replace(/零(千|百|拾|角)/g, '零').replace(/(零)+/g, '零').replace(/零(万|亿|元)/g, '$1').replace(/(亿)万|壹(拾)/g, '$1$2').replace(/^元零?|零分/g, '').replace(/元$/g, '元整')
  309. // console.log('end',this.formData.applyPayMoneyUppercase)
  310. this.$forceUpdate()
  311. },
  312. handleClick(tab, event) {
  313. this.canVasStatus = false
  314. if (this.activeName == 'second') {
  315. this.canVasStatus = true
  316. this.$nextTick(() => {
  317. this.$refs.PaymentCanvas.createNodeCanvas(this.row)
  318. })
  319. }
  320. },
  321. parentMethod(val) {
  322. if (val.length > 0) {
  323. this.confirmForm.ccList = val.join(',')
  324. }
  325. },
  326. selectCommonPhrases(e) {
  327. if (!this.confirmForm.confirmContent) this.confirmForm.confirmContent = ''
  328. },
  329. changeAddWorkTime(totalAddTime) {
  330. this.formData.totalAddTime = totalAddTime
  331. },
  332. async getUserInfo(applyUser) {
  333. const { data: userinfo } = await this.baseRequest1('ApplyReceivablesAdjustController', 'getUserInfoByUserId', { userId: applyUser })
  334. this.userinfo = userinfo
  335. console.log(this.userinfo)
  336. },
  337. spliceListRow(index) {
  338. this.formData.workTimeList.splice(index, 1)
  339. },
  340. async setVisible(status, row) {
  341. this.activeName = 'first'
  342. this.row = row
  343. this.getUserInfo(row.applyUser)
  344. this.confirmForm.flowMainPushId = row.flowMainPushId
  345. const { data } = await this.baseRequest1('ApplyReceivablesAdjustController', '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. this.loading = true
  396. const { data } = await this.baseRequest1('ApplyReceivablesAdjustController', 'AddConfirmResult', { ...this.confirmForm })
  397. if (data.code == 200) {
  398. this.loading = false
  399. this.$message.success('处理成功')
  400. this.form = {}
  401. this.confirmForm = { confirmContent: '' }
  402. this.dialogVisible = false
  403. this.$emit('getData')
  404. }
  405. })
  406. }
  407. }
  408. }
  409. </script>
  410. <style lang="scss">
  411. .cclist {
  412. .col-input {
  413. padding: 0;
  414. }
  415. }
  416. .pdr10px {
  417. padding-right: 10px;
  418. }
  419. .mgb10px {
  420. margin-bottom: 10px;
  421. }
  422. .mb25 {
  423. margin-bottom: 25px;
  424. }
  425. .pdtopbottom16 {
  426. padding: 0px 16px;
  427. }
  428. .pdtop16px {
  429. padding-top: 16px;
  430. }
  431. .cost_form {
  432. .col-input {
  433. font-weight: 400;
  434. }
  435. .el-form-item__label .moneydetails {
  436. text-align: right;
  437. font-size: 16px;
  438. font-family: 微软雅黑;
  439. padding-right: 10px;
  440. line-height: 40px;
  441. word-break: keep-all;
  442. white-space: nowrap;
  443. color: #606266;
  444. text-rendering: optimizeLegibility;
  445. font-weight: 400;
  446. }
  447. .moneydetails {
  448. text-align: right;
  449. font-size: 16px;
  450. font-family: 微软雅黑;
  451. padding-right: 10px;
  452. word-break: keep-all;
  453. white-space: nowrap;
  454. color: #606266;
  455. text-rendering: optimizeLegibility;
  456. font-weight: 400;
  457. }
  458. .moneydetails:before {
  459. content: "*";
  460. color: #ff4949;
  461. }
  462. }
  463. .txtc {
  464. text-align: center
  465. }
  466. .ml5 {
  467. margin-left: 5px;
  468. }
  469. .eltype {
  470. margin-bottom: 15px;
  471. }
  472. .tabsdom {
  473. .el-input {
  474. width: 100%;
  475. }
  476. .el-tabs__header {
  477. text-align: center !important;
  478. width: 139px !important;
  479. text-align: center !important;
  480. display: block !important;
  481. margin: auto !important;
  482. margin-bottom: 15px !important;
  483. }
  484. .el-tabs__nav-wrap::after {
  485. display: none;
  486. }
  487. .el-upload {
  488. width: 100%;
  489. }
  490. }
  491. .feeMoneyTotal {
  492. width: 100%;
  493. height: 14px;
  494. font-size: 14px;
  495. font-weight: 400;
  496. color: #1890FF;
  497. margin-top: 31px;
  498. margin-bottom: 13px;
  499. }
  500. </style>