detail.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <div class="widget-wrapper">
  3. <div class="widget-list" v-loading="loading">
  4. <div class="fx-field x-grid-col-12">
  5. <div class="field-label">
  6. <div class="field-name">用印人</div>
  7. </div>
  8. <div class="field-component">
  9. <span :title="form.loginName">{{ form.employeeName }}</span>
  10. </div>
  11. </div>
  12. <div class="fx-field x-grid-col-12">
  13. <div class="field-label">
  14. <div class="field-name">部门</div>
  15. </div>
  16. <div class="field-component">
  17. <span :title="form.deptName">{{ form.deptName }}</span>
  18. </div>
  19. </div>
  20. <div class="fx-field x-grid-col-12">
  21. <div class="field-label">
  22. <div class="field-name">职位</div>
  23. </div>
  24. <div class="field-component">
  25. <span :title="form.position">{{ form.position }}</span>
  26. </div>
  27. </div>
  28. <div class="fx-field x-grid-col-12">
  29. <div class="field-label">
  30. <div class="field-name">手机号</div>
  31. </div>
  32. <div class="field-component">
  33. <span :title="form.employeePhone">{{ form.employeePhone }}</span>
  34. </div>
  35. </div>
  36. <div class="fx-field x-grid-col-12">
  37. <div class="field-label">
  38. <span class="field-required">*</span>
  39. <div class="field-name">用印标题</div>
  40. </div>
  41. <div class="field-component">
  42. <span :title="form.stampTitle">{{ form.stampTitle }}</span>
  43. </div>
  44. </div>
  45. <div class="fx-field x-grid-col-12">
  46. <div class="field-label">
  47. <span class="field-required">*</span>
  48. <div class="field-name">用章类型</div>
  49. </div>
  50. <div class="field-component">
  51. <el-checkbox-group v-model="form.stampSealId">
  52. <el-checkbox v-for="item in oaStampSeal" :label="item.id" :key="item.id" disabled>{{item.sealName}}</el-checkbox>
  53. </el-checkbox-group>
  54. </div>
  55. </div>
  56. <div class="fx-field x-grid-col-12">
  57. <div class="field-label">
  58. <span class="field-required">*</span>
  59. <div class="field-name">用印事由</div>
  60. </div>
  61. <div class="field-component">
  62. <span :title="form.reason">{{ form.reason }}</span>
  63. </div>
  64. </div>
  65. <div class="fx-field x-grid-col-12">
  66. <div class="field-label">
  67. <div class="field-name">附件</div>
  68. </div>
  69. <div class="field-component">
  70. <div v-for="(item, index) in form.fileList" :key="index">
  71. <a :href="item.url" target="_blank" :title="item.name" style="color: #5094d5;">{{ item.name }}</a>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="fx-field x-grid-col-12">
  76. <div class="field-label">
  77. <div class="field-name">备注</div>
  78. </div>
  79. <div class="field-component">
  80. <span :title="form.remarks">{{ form.remarks }}</span>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="widget-list">
  85. <div class="fx-field x-grid-col-12" v-if="(form.auditStatus==2 || form.auditStatus==1) && name=='todo'">
  86. <div class="field-label">
  87. <span class="field-required">*</span>
  88. <div class="field-name">审批意见</div>
  89. </div>
  90. <el-input type="textarea" v-model="reason" placeholder="请输入审批建议" />
  91. </div>
  92. <div class="fx-field x-grid-col-12">
  93. <div class="field-label">
  94. <div class="field-name">流程动态</div>
  95. </div>
  96. <el-timeline>
  97. <el-timeline-item v-for="(item, index) in tasks" :key="index" :icon="getTimelineItemIcon(item)"
  98. :type="getTimelineItemType(item)">
  99. <p style="font-weight: 700">任务:{{ item.name }}</p>
  100. <el-card :body-style="{ padding: '10px' }">
  101. <label v-if="item.assigneeUser" style="font-weight: normal; margin-right: 30px;">
  102. 审批人:{{ item.assigneeUser.nickname }}
  103. <el-tag type="info" size="mini">{{ item.assigneeUser.deptName }}</el-tag>
  104. </label>
  105. <label style="font-weight: normal" v-if="item.createTime">创建时间:</label>
  106. <label style="color:#8a909c; font-weight: normal">{{ parseTime(item.createTime) }}</label>
  107. <label v-if="item.endTime" style="margin-left: 30px;font-weight: normal">审批时间:</label>
  108. <label v-if="item.endTime" style="color:#8a909c;font-weight: normal"> {{
  109. parseTime(item.endTime)
  110. }}</label>
  111. <!-- <label v-if="item.durationInMillis" style="margin-left: 30px;font-weight: normal">耗时:</label>
  112. <label v-if="item.durationInMillis" style="color:#8a909c;font-weight: normal">
  113. {{ getDateStar(item.durationInMillis) }} </label> -->
  114. <p v-if="item.reason">
  115. <el-tag :type="getTimelineItemType(item)">{{ item.reason }}</el-tag>
  116. </p>
  117. </el-card>
  118. </el-timeline-item>
  119. </el-timeline>
  120. </div>
  121. <div class="fx-field x-grid-col-12" >
  122. <div v-if="name=='todo'">
  123. <el-button type="primary" @click="handleAudit(true)" v-loading.fullscreen.lock="fullscreenLoading">同意</el-button>
  124. <el-button @click="handleAudit(false)" v-loading.fullscreen.lock="fullscreenLoading">驳回</el-button>
  125. </div>
  126. <div v-if="name=='my'">
  127. <el-button v-if="form.auditStatus==1" type="warning" @click="handleRevocation()" v-loading.fullscreen.lock="fullscreenLoading">撤回</el-button>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </template>
  133. <script>
  134. import { getDetail,agree,disagree,revocation } from "@/api/oa/stamp"
  135. import {getDate} from "@/utils/dateUtils";
  136. export default {
  137. props: {
  138. id: {
  139. type: [String, Number],
  140. default: undefined
  141. },
  142. name: {
  143. type: String,
  144. default: undefined
  145. },
  146. },
  147. data() {
  148. return {
  149. oaStampSeal:[
  150. {
  151. id:1,
  152. sealName:'公章'
  153. },
  154. {
  155. id:2,
  156. sealName:'财务章'
  157. }
  158. ],
  159. fullscreenLoading:false,
  160. loading:false,
  161. reason: '',
  162. auditRule: {
  163. reason: [{ required: true, message: '审批建议不能为空', trigger: 'blur' }],
  164. },
  165. tasks: [],
  166. // 表单参数
  167. form: {},
  168. };
  169. },
  170. created() {
  171. },
  172. watch: {
  173. id: {
  174. immediate: true,
  175. handler(val) {
  176. this.getDetail(val);
  177. }
  178. }
  179. },
  180. methods: {
  181. getDateStar(ms) {
  182. return getDate(ms);
  183. },
  184. handleRevocation(){
  185. console.log(this.form.taskId);
  186. this.$modal.confirm('是否确认撤回?').then(() => {
  187. this.fullscreenLoading = true;
  188. revocation({id:this.form.taskId}).then(response => {
  189. this.fullscreenLoading = false;
  190. this.$modal.msgSuccess("撤回成功");
  191. this.$parent.$parent.closeEdit();
  192. })
  193. }).catch(() => { });
  194. },
  195. handleAudit(pass) {
  196. if (!this.reason) {
  197. this.$message({
  198. message: '请填写审批意见',
  199. type: 'warning',
  200. customClass: 'myBox'
  201. });
  202. return;
  203. } else {
  204. const data = {
  205. id: this.form.taskId,
  206. reason: this.reason,
  207. }
  208. if (pass) {
  209. this.fullscreenLoading = true;
  210. agree(data).then(response => {
  211. this.fullscreenLoading = false;
  212. this.$parent.$parent.closeEdit();
  213. this.$modal.msgSuccess({
  214. message: '审批通过成功!',
  215. customClass: 'myBox'
  216. });
  217. });
  218. } else {
  219. this.fullscreenLoading = true;
  220. disagree(data).then(response => {
  221. this.fullscreenLoading = false;
  222. this.$parent.$parent.closeEdit();
  223. this.$modal.msgSuccess({
  224. message: '驳回成功!',
  225. customClass: 'myBox'
  226. });
  227. });
  228. }
  229. }
  230. },
  231. getTimelineItemIcon(item) {
  232. if (item.result === 1) {
  233. return 'el-icon-time';
  234. }
  235. if (item.result === 2) {
  236. return 'el-icon-check';
  237. }
  238. if (item.result === 3) {
  239. return 'el-icon-close';
  240. }
  241. if (item.result === 4) {
  242. return 'el-icon-remove-outline';
  243. }
  244. if (item.result === 5) {
  245. return 'el-icon-back'
  246. }
  247. return '';
  248. },
  249. getTimelineItemType(item) {
  250. if (item.result === 1) {
  251. return 'primary';
  252. }
  253. if (item.result === 2) {
  254. return 'success';
  255. }
  256. if (item.result === 3) {
  257. return 'danger';
  258. }
  259. if (item.result === 4) {
  260. return 'info';
  261. }
  262. if (item.result === 5) {
  263. return 'warning';
  264. }
  265. if (item.result === 6) {
  266. return 'default'
  267. }
  268. return '';
  269. },
  270. /** 获得详情信息 */
  271. getDetail(val) {
  272. this.$parent.$parent.detailLoading = true
  273. getDetail(val).then(response => {
  274. this.$parent.$parent.detailLoading = false
  275. this.form = response.data;
  276. this.tasks = response.data.auditRecordList;
  277. });
  278. },
  279. }
  280. };
  281. </script>
  282. <style>
  283. /* .el-timeline-item__wrapper {
  284. top: -12px !important;
  285. } */
  286. </style>
  287. <style lang="scss" scoped>
  288. .widget-wrapper>.widget-list {
  289. display: flex;
  290. flex-wrap: wrap;
  291. }
  292. .x-grid-col-6 {
  293. width: 50%;
  294. }
  295. .x-grid-col-12 {
  296. width: 100%;
  297. }
  298. .fx-field {
  299. line-height: 20px;
  300. padding: 7px 12px 12px;
  301. position: relative;
  302. }
  303. .fx-field .field-label {
  304. word-wrap: break-word;
  305. color: #141e31;
  306. display: flex;
  307. font-weight: 600;
  308. line-height: 20px;
  309. padding: 5px 0;
  310. position: relative;
  311. word-break: break-word;
  312. }
  313. .fx-field .field-label .field-required {
  314. color: #eb5050;
  315. margin-left: -6px;
  316. position: relative;
  317. }
  318. .fx-field .field-label .field-name {
  319. overflow: hidden;
  320. }
  321. .field-component {
  322. word-wrap: break-word;
  323. background: #f5f6f8;
  324. border-radius: 2px;
  325. color: #141e31;
  326. font-size: 14px;
  327. line-height: 20px;
  328. min-height: 32px;
  329. padding: 6px 8px;
  330. white-space: pre-wrap;
  331. word-break: break-word;
  332. }
  333. ul {
  334. padding-left: 0px !important;
  335. }
  336. .el-tag+.el-tag {
  337. margin-left: 10px;
  338. }
  339. </style>