阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
3.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <!--快速组卷-->
  3. <el-dialog class="tip-dialog" title="快速组卷" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="quickVisible">
  4. <div class="setting-dialog">
  5. <div class="fourTest-container">
  6. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  7. <el-form-item label="选择年月" prop="date">
  8. <el-date-picker
  9. v-model="form.date"
  10. type="month"
  11. placeholder="选择年月"
  12. value-format="yyyy-MM"
  13. style="width: 360px;"
  14. @change="changeDate"
  15. />
  16. </el-form-item>
  17. <div v-if="form.date !== ''" class="tip-result">总共为您找到<span>{{ searchNumber }}</span>条数据</div>
  18. </el-form>
  19. </div>
  20. <div slot="footer" class="dialog-footer">
  21. <el-button type="text" @click="quickVisible = false">取消</el-button>
  22. <el-button type="primary" @click.native="handleComfireQuick">确定</el-button>
  23. </div>
  24. </div>
  25. </el-dialog>
  26. </template>
  27. <script>
  28. import { FetchPreFastToArchives } from '@/api/collect/collect'
  29. export default {
  30. name: 'QuickPaper',
  31. components: { },
  32. inject: ['parentsData'],
  33. props: {
  34. selectedCategory: {
  35. type: Object,
  36. default: function() {
  37. return {}
  38. }
  39. },
  40. arcId: {
  41. type: String,
  42. default: function() {
  43. return ''
  44. }
  45. },
  46. collectLevel: {
  47. type: Number,
  48. default: function() {
  49. return null
  50. }
  51. }
  52. },
  53. data() {
  54. return {
  55. quickVisible: false,
  56. form: {
  57. date: ''
  58. },
  59. searchNumber: 0,
  60. archivesIds: [],
  61. rules: {
  62. date: [
  63. { required: true, message: '请选择年月', trigger: 'change' }
  64. ]
  65. }
  66. }
  67. },
  68. created() {
  69. },
  70. mounted() {
  71. },
  72. methods: {
  73. handleComfireQuick() {
  74. this.$refs.form.validate((valid) => {
  75. if (valid) {
  76. if (!this.searchNumber) {
  77. this.$message({ message: '当前年月没有数据!', type: 'warning', offset: 8 })
  78. return false
  79. }
  80. this.quickVisible = false
  81. this.form.date = ''
  82. this.searchNumber = 0
  83. this.$nextTick(() => {
  84. this.$parent.handleForm('add', 1)
  85. })
  86. } else {
  87. console.log('error submit!!')
  88. return false
  89. }
  90. })
  91. },
  92. changeDate(val) {
  93. if (!val) {
  94. this.$nextTick(() => {
  95. this.form.date = ''
  96. })
  97. } else {
  98. let parentsId
  99. if (this.selectedCategory.arrangeType === 3) {
  100. parentsId = this.parentsData.parentsProjectId
  101. } else {
  102. parentsId = null
  103. }
  104. const params = {
  105. 'categoryId': this.selectedCategory.id,
  106. 'date': val,
  107. 'parentsId': parentsId
  108. }
  109. FetchPreFastToArchives(params).then(res => {
  110. if (res.length === 0) {
  111. this.searchNumber = 0
  112. this.archivesIds = []
  113. this.$parent.quickPaper = false
  114. this.$parent.quickPaperArcId = []
  115. } else {
  116. this.searchNumber = res.length
  117. this.archivesIds = res
  118. this.$parent.quickPaper = true
  119. this.$parent.quickPaperArcId = res
  120. }
  121. })
  122. }
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang='scss' scoped>
  128. .tip-result{
  129. margin-left: 12px;
  130. font-size: 12px;
  131. color: #0C0E1E;
  132. span{
  133. padding: 0 6px;
  134. font-weight: bold;
  135. color: #ED4A41;
  136. }
  137. }
  138. </style>