阅行客电子档案
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.

146 lines
3.7 KiB

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({
  78. message: '当前年月没有数据!',
  79. type: 'warning'
  80. })
  81. return false
  82. }
  83. this.quickVisible = false
  84. this.form.date = ''
  85. this.searchNumber = 0
  86. this.$nextTick(() => {
  87. this.$parent.handleForm('add')
  88. })
  89. } else {
  90. console.log('error submit!!')
  91. return false
  92. }
  93. })
  94. },
  95. changeDate(val) {
  96. if (!val) {
  97. this.$nextTick(() => {
  98. this.form.date = ''
  99. })
  100. } else {
  101. let parentsId
  102. if (this.selectedCategory.arrangeType === 3) {
  103. parentsId = this.parentsData.parentsProjectId
  104. } else {
  105. parentsId = null
  106. }
  107. const params = {
  108. 'categoryId': this.selectedCategory.id,
  109. 'date': val,
  110. 'parentsId': parentsId
  111. }
  112. FetchPreFastToArchives(params).then(res => {
  113. if (res.length === 0) {
  114. this.searchNumber = 0
  115. this.archivesIds = []
  116. this.$parent.quickPaper = false
  117. this.$parent.quickPaperArcId = []
  118. } else {
  119. this.searchNumber = res.length
  120. this.archivesIds = res
  121. this.$parent.quickPaper = true
  122. this.$parent.quickPaperArcId = res
  123. }
  124. })
  125. }
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang='scss' scoped>
  131. .tip-result{
  132. margin-left: 12px;
  133. font-size: 12px;
  134. color: #0C0E1E;
  135. span{
  136. padding: 0 6px;
  137. font-weight: bold;
  138. color: #ED4A41;
  139. }
  140. }
  141. </style>