workflowAndStatus.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <el-dialog
  3. title="拉取望岳状态及工作流"
  4. :visible.sync="dialogVisible"
  5. width="33%"
  6. class="public_task"
  7. :before-close="close"
  8. >
  9. <div class="blueStripe" />
  10. <div class="Layout_flex_start">
  11. <div class="el-icon-warning iconSty" />
  12. <div class="dia-content">
  13. <div>点击确定按钮,将同步望岳{{ dia_content }}”<span style="color: rgb(230, 162, 60);">{{ titName }}</span> “的状态及工作流到质惠,同步后质惠上的状态及工作流时间将被覆盖,并且无法恢复,请谨慎操作!</div>
  14. </div>
  15. </div>
  16. <span slot="footer" class="dialog-footer">
  17. <el-button @click="close">取 消</el-button>
  18. <el-button type="danger" @click="requirementSyncDpmWorkflow">确 定</el-button>
  19. </span>
  20. </el-dialog>
  21. </template>
  22. <script>
  23. import '@/styles/PublicStyle/index.scss'
  24. import { requirementSyncDpmWorkflow, taskSyncDpmWorkflow } from '@/api/requirement.js'
  25. export default {
  26. props: {
  27. visible: { type: Boolean, default: false },
  28. name: { type: String, required: true },
  29. dpmrequired: { type: String, required: true }
  30. },
  31. data() {
  32. return {
  33. dia_content: this.name,
  34. dialogVisible: false,
  35. requirementId: Number(this.$route.query.id), // 需求id
  36. titName: ''
  37. }
  38. },
  39. watch: {
  40. visible: {
  41. handler(newV, old) {
  42. this.dialogVisible = newV
  43. },
  44. deep: true,
  45. immediate: true
  46. },
  47. dpmrequired: {
  48. handler(newV, old) {
  49. this.titName = newV
  50. },
  51. deep: true,
  52. immediate: true
  53. }
  54. },
  55. methods: {
  56. async requirementSyncDpmWorkflow() {
  57. if (this.name === '需求') {
  58. const res = await requirementSyncDpmWorkflow(this.requirementId)
  59. if (res.code === 200) {
  60. this.$emit('update')
  61. }
  62. }
  63. if (this.name === '任务') {
  64. const res = await taskSyncDpmWorkflow(this.requirementId)
  65. if (res.code === 200) {
  66. this.$emit('update')
  67. }
  68. }
  69. },
  70. close() {
  71. this.dialogVisible = false
  72. this.$emit('update')
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .iconSty {
  79. font-size: 40px;
  80. color: #F56C6C;
  81. margin: -24px 10px 0 10px;
  82. }
  83. .dia-content {
  84. color: #333;
  85. }
  86. </style>