duhuizhe
2023-10-16 3aa55dd3f62cee2c1c4c0aa74e1570acf83f8927
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<template>
  <div>
    <el-drawer
      title=""
      :append-to-body="true"
      :before-close="close"
      :modal="false"
      :visible.sync="nodeShow">
      <div class="node-info">
        <div class="font-18 color-333 font-bold m-b-15">上报</div>
        <div class="com-c-box">
          <el-form ref="form" :model="formData" label-width="150px" label-position="top">
            <el-form-item label="本次进度">
              <el-input
                v-model="formData.progressRateInfo"
                type="textarea"
                :rows="3"
                maxlength="500"
                show-word-limit></el-input>
            </el-form-item>
            <el-form-item label="图片上传">
              <upload ref="imgs" :settings="imgSettings" :values="formData.imgs"/>
            </el-form-item>
            <el-form-item label="文件上传">
              <upload ref="files" :settings="settings" :values="formData.files"/>
            </el-form-item>
          </el-form>
        </div>
        <div class="f-r f-r-center btn-bot">
          <my-button name="取消" site="form" @click="close"/>
          <my-button name="上报" site="form" @click="save"/>
        </div>
      </div>
    </el-drawer>
  </div>
</template>
 
<script>
import myButton from '@/components/myButton/myButton'
import upload from '@/components/upload/index'
import {getUploadUrl} from "@/utils/base";
import * as information from '@/api/projectManage/information'
export default {
  name: "nodeProgress",
  components: {myButton,upload},
  props: {
    nodeId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      dialogImageUrl:'',
      nodeShow: true,
      formData: {
        progressRateInfo: '',
        imgs:[],
        files:[]
      },
      imgSettings:{
        uploadUrl: getUploadUrl(),
        type:'picture-card',
        max:10,
        num: 10,
        title:' ',
        accept: '.jpg,.jpeg,.png' // 限制格式
      },
      settings: {
        drag:true,
        uploadUrl: getUploadUrl(),
        num: 10,
        accept: '.bmp,.pdf,.doc,.docx,.xls,.xlsx,.apk,.zip' // 限制格式
      }
    }
  },
  methods: {
    close() {
      this.$emit('close')
    },
    save() {
      this.$refs.workForm.validate((valid) => {
        if (valid) {
          let params = Object.assign({}, this.formData)
          let file = this.$refs.files.getContent()
          params.fileId = JSON.stringify(file)
          let images = this.$refs.images.getContent()
          params.images = JSON.stringify(images)
        }
      })
      information.nodeSubmit(params).then(res => {
        if (res) {
          this.$message.success('保存成功!')
          this.$emit('close')
        } else {
          this.$message.error('保存失败')
        }
      })
    }
  }
}
</script>
 
<style scoped>
.node-info {
  padding: 15px;
}
 
.com-c-box {
  overflow-y: auto;
  max-height: calc(100vh - 240px);
}
 
>>> .com-c-box::-webkit-scrollbar {
  display: none;
}
 
>>> .el-drawer__container {
  top: 120px;
}
>>> .el-drawer__body{
  position: relative;
}
>>> .el-drawer__header {
  display: none;
}
.m-b-15{
  margin-bottom: 15px;
}
.btn-bot{
  position: absolute;
  left: 0;
  bottom: 120px;
  width: 100%;
  padding:15px 0;
  background-color: #FFFFFF;
  border-top:1px solid #eeeeee;
  z-index: 11;
}
</style>