handleExamine.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="handleExamine height_100">
  3. <myView style="height: 100%;width: 100%;" position="row">
  4. <div slot="left" style="height: 100%;width:100%;padding: 20px 10px 0 10px;">
  5. <div>任务详情:</div>
  6. <el-divider></el-divider>
  7. <detailsPage :row="row"></detailsPage>
  8. </div>
  9. <div slot="right" style="height: 100%;width:100%;padding: 20px 10px 0 10px;">
  10. <div>审核:</div>
  11. <el-divider></el-divider>
  12. <template>
  13. <div >
  14. <el-form :model="form" status-icon ref="form" label-width="120px" class="demo-ruleForm" :disabled="row.disabled">
  15. <el-row>
  16. <el-col :span="24">
  17. <el-form-item label="审核附件:">
  18. <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove"
  19. style="height: 185px;" :autoUpload="true" @on-dblclick="handleOndblclick"></myUpload>
  20. </el-form-item>
  21. </el-col>
  22. </el-row>
  23. <el-row>
  24. <el-col :span="12">
  25. <el-form-item label="是否返回修改:">
  26. <el-switch v-model="form.ifBack" active-color="#13ce66" inactive-color="#ff4949">
  27. </el-switch>
  28. </el-form-item>
  29. </el-col>
  30. </el-row>
  31. <el-row v-if="!form.ifBack">
  32. <el-col :span="12">
  33. <el-form-item label="下一个审核人:">
  34. <el-autocomplete v-model="form.nextAuditorName" value-key="name" v-SelectLazyLoading="personnelLoad"
  35. :fetch-suggestions="querySearchPersonnel" placeholder="请输入审核人(外部审核人请直接输入邮箱)"
  36. :trigger-on-focus="false" @select="handleSelectPersonnel" @blur="handleBlur(form.nextAuditorName)"
  37. style="width: 100%;"></el-autocomplete>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="12">
  41. <el-form-item label="截止时间:">
  42. <el-date-picker v-model="form.deadLineTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
  43. placeholder="选择日期" style="width: 100%;">
  44. </el-date-picker>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. <el-row>
  49. <el-col :span="24">
  50. <el-form-item label="审核意见:">
  51. <el-input type="textarea" :rows="3" v-model="form.description"
  52. style="margin-bottom: 20px;"></el-input>
  53. </el-form-item>
  54. </el-col>
  55. </el-row>
  56. </el-form>
  57. <div style="float: right;">
  58. <el-button type="primary" size="small" @click="sure">确 认</el-button>
  59. </div>
  60. </div>
  61. </template>
  62. </div>
  63. </myView>
  64. <detailsDialog ref="detailsDialog"></detailsDialog>
  65. </div>
  66. </template>
  67. <script>
  68. import { personnelLoading } from '../mixins/index2'
  69. import detailsPage from './detailsPage.vue'
  70. import detailsDialog from './detailsDialog.vue'
  71. export default {
  72. mixins: [personnelLoading],
  73. props: ['row'],
  74. components: {
  75. detailsPage,
  76. detailsDialog,
  77. },
  78. data() {
  79. return {
  80. form: {
  81. systemFileList: [],//文件数组
  82. ifBack: false,//是否返回修改
  83. },
  84. }
  85. },
  86. mounted() {
  87. },
  88. methods: {
  89. // 双击文件
  90. handleOndblclick(file) {
  91. },
  92. // 人员输入框失焦
  93. handleBlur(val) {
  94. if (this.form.nextAuditorName.includes('@')) {
  95. this.form.nextAuditor = val
  96. }
  97. },
  98. // 人员输入框选择
  99. handleSelectPersonnel(val) {
  100. this.form.nextAuditor=val.id
  101. },
  102. // 审核确认
  103. sure() {
  104. // 判断文件是否都上传完毕
  105. if (this.form.systemFileList && this.form.systemFileList.length > 0) {
  106. this.form.fileGuids = []
  107. for (let i = 0; i < this.form.systemFileList.length; i++) {
  108. if (this.form.systemFileList[i].guid) {
  109. this.form.fileGuids.push(this.form.systemFileList[i].guid)
  110. } else {
  111. this.$message.error('文件未全部上传,请耐心等待')
  112. return false
  113. }
  114. }
  115. }
  116. if (this.form.nextAuditor) {
  117. if (this.form.nextAuditor.includes('@')) {//是邮箱为false
  118. this.form.ifInner = false
  119. } else {//是内部人员是id为true
  120. this.form.ifInner = true
  121. }
  122. }
  123. let params = {
  124. type: 5,//任务的类型,5任务审核任务
  125. taskId: this.row.id,//当前任务的id
  126. lastTaskId: this.row.id,//上一级任务的id
  127. ...this.form,
  128. }
  129. this.$api.addTaskAuditResult(params).then(res => {
  130. if (res.code == 200) {
  131. this.$message.success('提交审核成功')
  132. }
  133. })
  134. },
  135. // 上传的文件监听
  136. onchangeFile(file, fileList) {
  137. if (file.guid) {
  138. let index = this.form.systemFileList.findIndex(item => {
  139. return item.uid == file.uid
  140. })
  141. if (index != -1) {
  142. this.form.systemFileList.splice(index, 1, file)
  143. }
  144. } else {
  145. this.form.systemFileList.push(file.raw)
  146. }
  147. },
  148. // 删除上传的文件
  149. onRemove(file, fileList) {
  150. let index = this.form.systemFileList.findIndex(item => {
  151. return item.uid == file.uid
  152. })
  153. if (index != -1) {
  154. this.form.systemFileList.splice(index, 1)
  155. }
  156. },
  157. },
  158. }
  159. </script>
  160. <style lang="scss">
  161. .handleExamine {
  162. .el-divider--horizontal {
  163. margin: 10px 0;
  164. }
  165. }
  166. </style>
  167. <style lang="scss" scoped>
  168. .handleExamine {
  169. .upload_demo {
  170. display: flex;
  171. justify-content: flex-end;
  172. margin-bottom: 10px;
  173. }
  174. }
  175. </style>