|
|
@@ -49,7 +49,36 @@
|
|
|
<el-tab-pane :label="resourceType[2]" name="2"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <el-form-item label="需求文档" prop="doc">
|
|
|
+ <el-upload
|
|
|
+ v-if="isModifyMode"
|
|
|
+ drag
|
|
|
+ class="upload-demo"
|
|
|
+ action=""
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :limit="1"
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :before-upload="beforeFileUpload"
|
|
|
+ :http-request="uploadRequireDoc"
|
|
|
+ :file-list="task.doc"
|
|
|
+ >
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 将文件拖到此处,或
|
|
|
+ <em>点击上传</em>
|
|
|
+ </div>
|
|
|
+ <div class="el-upload__tip" slot="tip">请上传需求文档</div>
|
|
|
+ </el-upload>
|
|
|
+ <span v-if="!isModifyMode">
|
|
|
+ <span v-if="task.requireDocUrl == null">
|
|
|
+ 暂无文件
|
|
|
+ </span>
|
|
|
+ <span v-if="task.requireDocUrl != null">
|
|
|
+ <a :href="task.requireDocUrl">{{task.requireDocUrl}}</a>
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="任务截止时间" prop="datetime">
|
|
|
<div class="block">
|
|
|
<el-date-picker
|
|
|
@@ -99,7 +128,11 @@ export default {
|
|
|
resource: '1', //如果是广场不用管Location和institution ,定向看institution,区域看location
|
|
|
location: {provinceCode: '3200', cityCode: '3201'},
|
|
|
institution: '',
|
|
|
- datetime: ''
|
|
|
+ datetime: '',
|
|
|
+ quotePrice: '',
|
|
|
+ fixedPrice: '',
|
|
|
+ doc: [],
|
|
|
+ requireDocUrl: '123.doc'
|
|
|
},
|
|
|
pickerOptions: {
|
|
|
shortcuts: [
|
|
|
@@ -196,7 +229,19 @@ export default {
|
|
|
return provinceName + ' / ' + cityName
|
|
|
},
|
|
|
submitForm (formName) {
|
|
|
- Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), this.task).then((res) => {
|
|
|
+ const newTask = {
|
|
|
+ name: this.task.name,
|
|
|
+ desc: this.task.desc,
|
|
|
+ type: this.task.type,
|
|
|
+ resource: this.task.resource,
|
|
|
+ location: this.task.location,
|
|
|
+ institution: this.task.institution,
|
|
|
+ datetime: this.task.datetime,
|
|
|
+ quotePrice: this.task.quotePrice,
|
|
|
+ fixedPrice: this.task.fixedPrice,
|
|
|
+ requireDocUrl: this.task.requireDocUrl
|
|
|
+ }
|
|
|
+ Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), newTask).then((res) => {
|
|
|
console.log(res)
|
|
|
this.cancelCreate()
|
|
|
})
|
|
|
@@ -246,7 +291,49 @@ export default {
|
|
|
} else {
|
|
|
this.$router.go(-1)
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ handleRemove (file, fileList) {
|
|
|
+ console.log(file, fileList)
|
|
|
+ },
|
|
|
+ handleExceed (files, fileList) {
|
|
|
+ this.$message.warning(
|
|
|
+ `当前限制选择 1 个文件,本次选择了 ${
|
|
|
+ files.length
|
|
|
+ } 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
|
+ )
|
|
|
+ },
|
|
|
+ beforeRemove (file, fileList) {
|
|
|
+ return this.$confirm(`确定移除 ${file.name}?`)
|
|
|
+ },
|
|
|
+ beforeFileUpload () {
|
|
|
+
|
|
|
+ },
|
|
|
+ uploadProjectCreateExcelFile (param) {
|
|
|
+ const formData = new FormData()
|
|
|
+ let config = {
|
|
|
+ //添加请求头
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'},
|
|
|
+ }
|
|
|
+ formData.append('file', param.file)
|
|
|
+ Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, formData, config).then((res) => {
|
|
|
+ console.log('上传成功')
|
|
|
+ this.project.excelFileUrl = res.data
|
|
|
+ console.log(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadRequireDoc (param) {
|
|
|
+ const formData = new FormData()
|
|
|
+ let config = {
|
|
|
+ //添加请求头
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'},
|
|
|
+ }
|
|
|
+ formData.append('file', param.file)
|
|
|
+ Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', 3), formData, config).then((res) => {
|
|
|
+ console.log('上传成功')
|
|
|
+ this.task.requireDocUrl = res.data
|
|
|
+ console.log(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|