<template>
  <div class="create-container" v-loading="loading">
    <div class="title h1" v-if="!isModifyMode">项目</div>
    <div class="create-body">
      <div class="title h2" v-if="!isModifyMode">基本信息</div>
      <div v-if="!isModifyMode" class="el-form-item">
        <label class="el-form-item__label" style="width: 12%;">编号</label>
        <div class="el-form-item__content" style="margin-left: 12%;">
          <div>{{projectId}}</div>
        </div>
      </div>
      <el-form :model="project" :rules="rules" ref="project" label-width="12%" class="demo-project">
        <el-form-item label="项目名称" prop="name">
          <el-input v-if="isModifyMode" v-model="project.name"></el-input>
          <span v-if="!isModifyMode">{{project.name}}</span>
        </el-form-item>

        <el-form-item label="联系人" prop="name">
          <el-input v-if="isModifyMode" v-model="project.contactName" placeholder="请输入联系人姓名"></el-input>
          <span v-if="!isModifyMode">{{project.contactName}}</span>
        </el-form-item>
        <el-form-item label="联系人电话" prop="name">
          <el-input v-if="isModifyMode" v-model="project.contactPhone" placeholder="请输入联系人电话"></el-input>
          <span v-if="!isModifyMode">{{project.contactPhone}}</span>
        </el-form-item>
        <!--<el-form-item label="联系方式" prop="contact">-->
        <!--<div>-->
        <!--<el-row :gutter="2">-->
        <!--<el-col :span="2">-->
        <!--<span>联系人</span>-->
        <!--</el-col>-->
        <!--<el-col :span="10">-->
        <!--<el-input v-if="isModifyMode" v-model="project.contactName" placeholder="请输入联系人姓名"></el-input>-->
        <!--<div v-if="!isModifyMode">{{project.contactName}}</div>-->
        <!--</el-col>-->
        <!--</el-row>-->
        <!--<el-row :gutter="2">-->
        <!--<el-col :span="2">-->
        <!--<span>联系人电话</span>-->
        <!--</el-col>-->
        <!--<el-col :span="10">-->
        <!--<el-input-->
        <!--v-if="isModifyMode"-->
        <!--v-model="project.contactPhone"-->
        <!--placeholder="请输入联系人电话"-->
        <!--&gt;</el-input>-->
        <!--<div v-if="!isModifyMode">{{project.contactPhone}}</div>-->
        <!--</el-col>-->
        <!--</el-row>-->
        <!--</div>-->
        <!--</el-form-item>-->

        <el-form-item label="预算" prop="budget">
          <el-input v-if="isModifyMode" type="number" v-model="project.budget">
            ¥
            <template slot="append"></template>
          </el-input>
          <span v-if="!isModifyMode">{{project.budget}}¥</span>
        </el-form-item>
        <el-form-item label="需求描述">
          <el-input v-if="isModifyMode" type="textarea" v-model="project.desc"></el-input>
          <span v-if="!isModifyMode">{{project.desc}}</span>
        </el-form-item>
        <!--<el-form-item label="价格" prop="price">-->
        <!--<el-input v-if="isModifyMode" type="number" v-model="project.price">-->
        <!--<template slot="append">¥</template>-->
        <!--</el-input>-->
        <!--<span v-if="!isModifyMode">{{project.price}}¥</span>-->
        <!--</el-form-item>-->
        <el-form-item label="平台" prop="platform">
          <el-checkbox-group v-if="isModifyMode" v-model="project.platform">
            <span v-for="(item,index) in platforms" :key="index">
              <el-checkbox :label="item">{{ item }}&nbsp;&nbsp;&nbsp;&nbsp;</el-checkbox>
            </span>
          </el-checkbox-group>
          <span
            v-if="!isModifyMode"
            class="badge"
            v-for="item in project.platform"
          >{{item}}</span>
        </el-form-item>
        <el-form-item label="服务类型" prop="type">
          <el-checkbox-group v-if="isModifyMode" v-model="project.type">
            <span v-for="(item,index) in serviceType" :key="index">
              <el-checkbox :label="item" name="type">{{ item }}&nbsp;&nbsp;</el-checkbox>
            </span>
          </el-checkbox-group>
          <span v-if="!isModifyMode" class="badge" v-for="item in project.type">{{item}}</span>
        </el-form-item>
        <!--<el-form-item label="用途" prop="usage">-->
        <!--<el-input v-if="isModifyMode" v-model="project.usage"></el-input>-->
        <!--<span v-if="!isModifyMode">{{project.usage}}</span>-->
        <!--</el-form-item>-->


        <el-form-item label="项目可见性" prop="resource">
          <div v-if="!isModifyMode">
            <div v-if="project.resource=='1'">{{updateLocation(project.location)}}</div>
            <div v-if="project.resource=='0'">{{project.institution==null?'暂未被接收':project.institution}}</div>
            <div v-if="project.resource=='2'">{{resourceType[project.resource]}}</div>
          </div>
          <el-tabs :tab-position="tabPosition" v-model="project.resource" style="max-height: 200px;"
                   v-if="isModifyMode">
            <el-tab-pane :label="resourceType[0]" name="0">
              <el-radio-group v-model="project.institution">
                <el-radio :label="item" name="type" v-for="(item,index) in institutionArray" :key="index">
                  {{item.name}}
                </el-radio>
              </el-radio-group>
            </el-tab-pane>
            <el-tab-pane :label="resourceType[1]" name="1">
              <provincecity
                ref="addFormProvince"
                @selectChange="locationChange"
                :provinceCode="project.location==null?'3200':project.location.provinceCode"
                :cityCode="project.location==null?'3201':project.location.cityCode"
              ></provincecity>
            </el-tab-pane>
            <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="project.doc"
          >
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">
              将文件拖到此处，或
              <em>点击上传</em>
            </div>
          </el-upload>
          <span v-if="!isModifyMode"><a :href="project.requireDocUrl"><el-link :underline="false" type="primary"><i
            class="el-icon-document"></i>下载文档</el-link></a></span>
        </el-form-item>
        <el-form-item label="安装包" prop="file">
          <el-upload
            v-if="isModifyMode"
            drag
            class="upload-demo"
            action=""
            :on-remove="handleRemove"
            :before-remove="beforeRemove"
            :limit="1"
            :on-exceed="handleExceed"
            :before-upload="beforeApkUpload"
            :http-request="uploadApkFile"
            :file-list="project.file"
          >
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">
              将文件拖到此处，或
              <em>点击上传</em>
            </div>
          </el-upload>
          <span v-if="!isModifyMode"><a :href="project.fileUrl"><el-link :underline="false" type="primary"><i
            class="el-icon-document"></i>下载文件</el-link></a></span>
        </el-form-item>
        <el-form-item label="项目截止时间" prop="datetime">
          <div class="block" v-if="isModifyMode">
            <el-date-picker
              v-model="project.datetime"
              type="datetime"
              placeholder="选择截止时间"
              align="right"
              :picker-options="pickerOptions"
            ></el-date-picker>
          </div>
          <span v-if="!isModifyMode">{{new Date(project.datetime)}}</span>
        </el-form-item>
        <el-form-item v-if="isModifyMode">
          <div class="btn btn-small btn-info" @click="submitForm('project')">确认修改</div>
          <div class="btn btn-small" @click="resetForm('project')">重置</div>
          <div class="btn btn-small" @click="cancelMode('project')">取消</div>
        </el-form-item>
        <el-form-item v-if="!isModifyMode">
          <div class="btn btn-small btn-warning-soft" @click="submitProjectRequest()">结束项目</div>
          <!--<div class="btn btn-small btn-info" @click="submitProjectRequest()">发布项目</div>-->
          <div class="btn btn-small btn-info" @click="submitProjectRequest()">提交项目</div>
          <div class="btn btn-small btn-info" @click="applyProject()">接受项目</div>
          <div class="btn btn-small btn-danger" @click="submitProjectRequest()">拒绝项目</div>
          <div class="btn btn-small btn-info" @click="modifyForm()">修改项目</div>
          <!--<div class="btn btn-medium btn-info" @click="analyseDemand()">分析需求</div>-->
          <div class="btn btn-small btn-info" @click="createTask()">新建任务</div>
          <div class="btn btn-small btn-info" @click="createReport()">上传报告</div>
        </el-form-item>
      </el-form>
    </div>
    <div class="create-body" v-if="!isModifyMode">
      <div class="title h2">任务列表</div>
      <div class="task-list">
        <el-table :showHeader="true" :stripe="true" :data="task" style="width: 100%">
          <el-table-column prop="title" label="任务名称" title="任务名称"></el-table-column>
          <el-table-column prop="datetime" sortable label="任务截止时间"></el-table-column>
          <el-table-column prop="resource" label="任务可见性">
            <template slot-scope="scope">
              <div v-if="scope.row.resource=='1'">{{scope.row.location.provinceCode}}/{{scope.row.location.cityCode}}
              </div>
              <div v-if="scope.row.resource=='0'">{{scope.row.institution}}</div>
              <div v-if="scope.row.resource=='2'">{{resourceType[scope.row.resource]}}</div>
            </template>
          </el-table-column>
          <el-table-column prop="type" label="业务类型">
            <template slot-scope="scope">
              <div class="badge">{{scope.row.serviceType}}</div>
            </template>
          </el-table-column>

          <el-table-column align="right" label="操作">
            <template slot-scope="scope">
              <div
                class="btn btn-small btn-info"
                @click="goToTaskDetail(projectId, scope.row.id)"
              >查看详情
              </div>
              <div
                class="btn btn-small btn-danger"
                @click="handleDelete(scope.$index, scope.row.id)"
              >删除
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>

    <div class="create-body" v-if="!isModifyMode">
      <div class="title h2">报告列表</div>
      <report-list v-bind:reports="reportList" v-bind:taskId=null v-bind:projectId="projectId"/>
    </div>
  </div>
</template>

<script>
import ReportList from '@/components/report/ReportList'
import Http from '@/js/http.js'
import Apis from '@/js/api.js'
import ResourceType from '@/constants/enum/resource-type'
import provincecity from '@/components/commons/ProvinceCity'
import {notify} from '@/constants/index'
import {
  getAllInstitutions,
  getAllPlatformTypes,
  getAllServiceTypes,
  getProvinceCodeByProvinceName,
  getProvinceNameByProvinceCode,
  storageGet,
} from '@/js/index'

export default {
  name: 'Project',
  components: {
    provincecity,
    ReportList
  },
  data () {
    var validatePass = (rule, value, callback) => {
      var reg = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
      if (this.project.contactPhone) {
        if (!reg.test(this.project.contactPhone)) {
          callback(new Error('请检查手机号码'))
        } else {
          callback()
        }
      }
    }
    return {
      projectId: 0,
      user: {},
      loading: false,
      tabPosition: 'top',
      institutionArray: [],
      isModifyMode: false,
      platforms: [],
      resourceType: ResourceType,
      serviceType: [],
      project: {
        userId: 0,
        name: '',
        type: '',
        platform: '',
        desc: '',
        resource: '',
        location: '',
        institution: {},
        contactName: '',
        contactPhone: '',
        doc: [],
        requireDocUrl: '',
        file: [],
        fileUrl: '',
        budget: '',
        price: '',
        datetime: '',
        usage: '',
        status: ''
      },
      task: [],
      reportList: [],
      pickerOptions: {
        shortcuts: [
          {
            text: '今天',
            onClick (picker) {
              picker.$emit('pick', new Date())
            }
          },
          {
            text: '昨天',
            onClick (picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24)
              picker.$emit('pick', date)
            }
          },
          {
            text: '一周前',
            onClick (picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', date)
            }
          }
        ]
      },
      rules: {
        // name: [
        //   {required: true, message: '请输入项目名称', trigger: 'blur'}
        //   // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
        // ],
        // type: [
        //   {
        //     type: 'array',
        //     required: true,
        //     message: '请至少选择一种服务类型',
        //     trigger: 'change'
        //   }
        // ],
        // platform: [
        //   {
        //     type: 'array',
        //     required: true,
        //     message: '请至少选择一个平台',
        //     trigger: 'change'
        //   }
        // ],
        // desc: [{required: true, message: '请填写活动形式', trigger: 'blur'}],
        // contact: [{validator: validatePass, trigger: 'blur'}],
        // resource: [
        //   {
        //     required: true,
        //     message: '请选择项目可见性',
        //     trigger: 'change'
        //   }
        // ]
      }
    }
  },
  mounted () {
    this.$nextTick(() => {
      this.init()
    })
  },
  watch: {
    serviceType (val) {
      this.serviceType = val
    },
    institutionArray (val) {
      this.institutionArray = val
    },
    // 'project.institution' () {
    //   if (this.project.institution) {
    //     //this.$refs.addFormProvince.resetProviceCity()
    //     this.project.location = {provinceCode: '', cityCode: ''}
    //   }
    // },
    // 'project.location' () {
    //   if (this.project.location.provinceCode || this.project.location.cityCode) {
    //     this.project.institution = ''
    //   }
    // },
    // 'project.resource' () {
    //   if (this.project.resource == '2') {
    //     //this.$refs.addFormProvince.resetProviceCity()
    //     this.project.institution = ''
    //     this.project.location = {provinceCode: '', cityCode: ''}
    //   }
    // },
    deep: true
  },
  methods: {
    updateLocation (location) {
      //console.log(location)
      const loactionName = getProvinceNameByProvinceCode(location.provinceCode, location.cityCode)
      // var provinceName = ''
      // var cityName = ''
      // for (var item of provinceCityJSON.provinces) {
      //   if (item.code === location.provinceCode) {
      //     provinceName = item.name
      //     for (var city of item.cities) {
      //       if (city.code === location.cityCode) {
      //         cityName = city.name
      //         break
      //       }
      //     }
      //   }
      // }
      return loactionName.provinceCode + ' / ' + loactionName.cityCode
    },
    init () {
      this.projectId = this.$route.params.projectId
      this.setServiceType()
      this.setPlatformType()
      this.setInstitutions()
      this.setUserInfo()
      this.loadData()
      // this.project.platform.map(item => {
      //   this.platformType.push(PlatformType[item])
      // })
    },
    //提交修改
    submitForm (formName) {
      this.showLoading()
      const newProject = {
        userId: this.user.userVO.id,
        name: this.project.name,
        type: this.project.type,
        platform: this.project.platform,
        desc: this.project.desc,
        resource: this.project.resource,
        location: getProvinceNameByProvinceCode(this.project.location.provinceCode, this.project.location.cityCode),
        institution: this.project.institution == null ? null : this.project.institution.id,
        contactName: this.project.contactName,
        contactPhone: this.project.contactPhone,
        doc: this.project.requireDocUrl,
        file: this.project.fileUrl,
        budget: this.project.budget,
        price: this.project.price,
        datetime: this.project.datetime,
        usage: this.project.usage,
      }
      Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
        console.log('bb')
        console.log(res)
        this.projectId = res.projectDetails.id
        this.project.name = res.projectDetails.name
        this.project.contactName = res.projectDetails.contactName
        this.project.contactPhone = res.projectDetails.contactPhone
        this.project.type = res.projectDetails.type
        this.project.platform = res.projectDetails.platform
        this.project.desc = res.projectDetails.desc
        this.project.doc = []
        this.project.file = []
        this.project.resource = res.projectDetails.resource
        this.project.location = getProvinceCodeByProvinceName(res.projectDetails.location.provinceCode, res.projectDetails.location.cityCode)
        this.project.institution = res.projectDetails.institution
        this.project.datetime = new Date(res.projectDetails.datetime)
        this.project.price = res.projectDetails.price
        this.project.budget = res.projectDetails.budget
        this.project.usage = res.projectDetails.usage
        this.project.fileUrl = res.projectDetails.file
        this.project.requireDocUrl = res.projectDetails.doc

        this.task = res.taskList
        this.reportList = res.reportList
        this.isModifyMode = false
        this.hideLoading()
        notify('success', '项目修改成功')
      }).catch(error => {
        this.hideLoading()
        notify('error', error.data)
        console.log(error)
      })
      // this.$refs[formName].validate(valid => {
      //   if (valid) {
      //
      //     //提交 project
      //   } else {
      //     console.log('error submit!!')
      //     return false
      //   }
      // })
    },
    //重置表单
    resetForm (formName) {
      this.$refs[formName].resetFields()
      this.project.name = ''
      this.project.type = []
      this.project.platform = []
      this.project.desc = ''
      this.project.doc = ''
      this.project.file = ''
      this.project.contactName = ''
      this.project.contactPhone = ''
      this.project.resource = '2'
      this.project.institution = ''
      this.project.datetime = ''
      this.project.price = ''
      this.project.usage = ''
      this.project.budget = ''
    },
    //进入修改项目页面
    modifyForm () {
      this.isModifyMode = true
      console.log(this.project.doc)
      //this.setInstitutions()
      //获得update 信息
      //this.loadData()
    },
    //接收项目
    submitProjectRequest () {
      const data = {
        userId: this.user.userVO.id,
        projectId: this.projectId
      }
      Http.post(Apis.USER.SUBMIT_PROJECT_REQUEST, data).then((res) => {
        console.log(res)
      })
    },
    //申请项目
    applyProject () {
      const data = {
        userId: this.user.userVO.id,
        projectId: this.projectId
      }
      Http.post(Apis.USER.ACCEPT_PROJECT, data).then((res) => {
        console.log(res)
      })
    },
    cancelMode (formName) {
      this.isModifyMode = false
      this.loadData()

    },
    goToTaskDetail (projectId, taskId) {
      this.$router.push({
        name: 'Task',
        params: {projectId: projectId, taskId: taskId}
      })
    },
    createTask () {
      this.$router.push({name: 'TaskCreate'})
    },
    createReport () {
      this.$router.push({
        name: 'ReportCreate',
        params: {
          scope: 0,
          dependencyCode: this.projectId,
          projectId: this.projectId,
          taskId: null,
        }
      })
    },
    handleDelete (index, id) {
      this.task.splice(index, 1)
    },
    beforeApkUpload (file) {
      const isAPK = file.type === 'application/vnd.android.package-archive'
      const isDMG = file.type === 'application/octet-stream'

      if (!isAPK && !isDMG) {
        this.$message.error('上传安装包只能是 APK 或 DMG 格式!')
      }
      return isAPK || isDMG
    },
    beforeFileUpload (file) {
      console.log(file)
      const isPDF = file.type === 'application/pdf'
      const isDOC = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
      const isEXCEL = file.type === 'application/vnd.ms-excel'
      const isXLS = file.type === 'application/x-xls'
      const isTXT = file.type === 'text/plain'
      const isXLSX = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
      //console.log(file)
      if (!(isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX)) {
        this.$message.error('上传文件只能是 PDF 、 DOC 、DOCX 、XLS、TXT、XLSX 格式!')
      }
      return isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX
    },
    analyseDemand () {
      this.$router.push({name: 'AnalyseDemand'})
    },
    handleAccept (index, id) {
      console.log('接受')
    },
    handleReject (index, id) {
      console.log('拒绝')
    },
    loadData () {//PROJ--2019073114009
      this.showLoading()
      Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', this.projectId)).then((res) => {
        console.log(res)
        this.projectId = res.projectDetails.id
        this.project.name = res.projectDetails.name
        this.project.contactName = res.projectDetails.contactName
        this.project.contactPhone = res.projectDetails.contactPhone
        this.project.type = res.projectDetails.type
        this.project.platform = res.projectDetails.platform
        this.project.desc = res.projectDetails.desc
        this.project.doc = []
        this.project.file = []
        this.project.resource = res.projectDetails.resource
        this.project.location = getProvinceCodeByProvinceName(res.projectDetails.location.provinceCode, res.projectDetails.location.cityCode)
        this.project.institution = res.projectDetails.institution
        this.project.datetime = new Date(res.projectDetails.datetime)
        this.project.price = res.projectDetails.price
        this.project.budget = res.projectDetails.budget
        this.project.usage = res.projectDetails.usage
        this.project.fileUrl = res.projectDetails.file
        this.project.requireDocUrl = res.projectDetails.doc
        this.project.userId = res.projectDetails.userId
        this.project.status = res.projectDetails.status
        this.task = res.taskList
        this.reportList = res.reportList
        this.hideLoading()
      }).catch((error) => {
        this.hideLoading()
        notify('error', error.data)
      })
    },
    locationChange (provinceId, cityId) {
      if (provinceId || cityId) {
        this.project.location = {provinceCode: provinceId, cityCode: cityId}
      }
    },
    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}？`)
    },
    uploadRequireDoc (param) {
      this.showLoading()
      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}', this.user.userVO.id), formData, config).then((res) => {
        this.project.requireDocUrl = res.data
        this.hideLoading()
        notify('success', '需求文档上传成功')
      }).catch((error) => {
        this.hideLoading()
        notify('error', '需求文档上传失败:' + error.data)
      })
    },
    uploadApkFile (param) {
      this.showLoading()
      const formData = new FormData()
      let config = {
        //添加请求头
        headers: {'Content-Type': 'multipart/form-data'},
      }
      formData.append('file', param.file)
      Http.upload(Apis.FILE.APK.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
        this.project.fileUrl = res.data
        this.hideLoading()
        notify('success', '文件上传成功')
      }).catch((error) => {
        this.hideLoading()
        notify('error', '文件上传失败')
      })
    },
    setServiceType () {
      getAllServiceTypes().then((res) => {
        this.serviceType = res
      }).catch((error) => {
        notify('error', '获取项目类型列表失败')
      })
    },
    setPlatformType () {
      this.platforms = getAllPlatformTypes()
    },
    setInstitutions () {
      getAllInstitutions().then((res) => {
        this.institutionArray = res
      }).catch((error) => {
        notify('error', '获取institution失败' + error.data)
      })
    },
    setUserInfo () {
      this.user = storageGet('user')
    },
    showLoading () {
      this.loading = true
    },
    hideLoading () {
      this.loading = false
    }
  }
}
</script>

<style lang="less" scoped>
  .task-list {
    margin: 0 30px;
  }

  .el-col {
    padding: 0 !important;
  }

  .el-row {
    margin-bottom: 10px;
  }

  .el-input {
    width: 400px;
  }
</style>


<!--<div class="create-body" v-if="!isModifyMode">-->
<!--<div class="title h2">分析需求</div>-->
<!--<div class="task-list">-->
<!--<el-table :data="analyseDemandList" style="width: 100%" max-height="400">-->
<!--<el-table-column prop="institution" label="承接单位" title="承接单位"></el-table-column>-->
<!--<el-table-column prop="feasibilityReport" sortable label="可行性分析报告">-->
<!--<template slot-scope="scope">-->
<!--<span v-if="!scope.row.feasibilityReport.url">暂无文件</span>-->
<!--<a-->
<!--:href="scope.row.feasibilityReport.url"-->
<!--v-if="scope.row.feasibilityReport.url"-->
<!--target="_blank"-->
<!--&gt;-->
<!--<i class="fa fa-file-text-o"></i>-->
<!--{{scope.row.feasibilityReport.name}}-->
<!--</a>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column prop="priceAuditReport" sortable label="可行性分析报告">-->
<!--<template slot-scope="scope">-->
<!--<span v-if="!scope.row.priceAuditReport.url">暂无文件</span>-->
<!--<a-->
<!--:href="scope.row.priceAuditReport.url"-->
<!--v-if="scope.row.priceAuditReport.url"-->
<!--target="_blank"-->
<!--&gt;-->
<!--<i class="fa fa-file-text-o"></i>-->
<!--{{scope.row.priceAuditReport.name}}-->
<!--</a>-->
<!--</template>-->
<!--</el-table-column>-->

<!--<el-table-column align="right" label="操作">-->
<!--<template slot-scope="scope">-->
<!--<div-->
<!--class="btn btn-small btn-info"-->
<!--@click="handleAccept(scope.$index, scope.row.id)"-->
<!--&gt;接受-->
<!--</div>-->
<!--<div-->
<!--class="btn btn-small btn-danger"-->
<!--@click="handleReject(scope.$index, scope.row.id)"-->
<!--&gt;拒绝-->
<!--</div>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>-->
<!--</div>-->
<!--</div>-->

