|
|
@@ -0,0 +1,398 @@
|
|
|
+<template>
|
|
|
+ <wt-card
|
|
|
+ title="基础信息"
|
|
|
+ :edit-btn="form.can_update"
|
|
|
+ @edit="change"
|
|
|
+ @save="save"
|
|
|
+ >
|
|
|
+ <el-form class="mt-20" :disabled="disabled">
|
|
|
+ <div class="flex flex-justify-center" v-watermark="{ text: '33' }">
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">项目名称:</span>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入项目名称"
|
|
|
+ v-model="form.name"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">总投资金额:</span>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入总投资金额"
|
|
|
+ v-model="form.total_amount"
|
|
|
+ >
|
|
|
+ <template #append>万元</template>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">地区:</span>
|
|
|
+ <area-picker
|
|
|
+ :placeholder="
|
|
|
+ form.province_name !== undefined
|
|
|
+ ? form.province_name +
|
|
|
+ '/' +
|
|
|
+ form.city_name +
|
|
|
+ '/' +
|
|
|
+ form.district_name
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ @change="changeArea"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="flex flex-justify-center">
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">主管单位:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="form.competent_unit"
|
|
|
+ placeholder="请选择项目标签"
|
|
|
+ class="full-width"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in deptDic"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">责任单位:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="form.responsible_unit"
|
|
|
+ placeholder="请选择责任单位"
|
|
|
+ class="full-width"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in form.tags === 1 ? deptDic : compDic"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">责任领导:</span>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入责任领导"
|
|
|
+ v-model="form.responsible_leader"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="flex flex-justify-center">
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">联系电话:</span>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入责任领导联系电话"
|
|
|
+ v-model="form.responsible_leader_phone"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">所属行业:</span>
|
|
|
+ <industry-picker
|
|
|
+ :placeholder="
|
|
|
+ form.dict_key && typeof form.dict_key === 'object'
|
|
|
+ ? form.dict_key.map(ele => ele.title).join('/')
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ @change="changeIndustry"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">产业项目:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="form.industrial_investment"
|
|
|
+ placeholder="是否是产业项目"
|
|
|
+ class="full-width"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in yesOrNo"
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="flex flex-justify-center">
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">民间投资项目:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="form.social_investment"
|
|
|
+ placeholder="是否民间投资项目"
|
|
|
+ class="full-width"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in yesOrNo"
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">获得资金支持:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="form.is_funded_project"
|
|
|
+ placeholder="是否获得资金支持"
|
|
|
+ class="full-width"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in yesOrNo"
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="full-width flex-child-average">
|
|
|
+ <div class="flex flex-center full-width item">
|
|
|
+ <span class="title">项目标签:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="form.project_stage"
|
|
|
+ placeholder="请选择项目标签"
|
|
|
+ class="full-width"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in projectSituation"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictKey"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="flex flex-justify-center">
|
|
|
+ <el-form-item class="full-width" style="flex: 2">
|
|
|
+ <div
|
|
|
+ class="flex flex-center flex-justify-start full-width"
|
|
|
+ style="width: 99%"
|
|
|
+ >
|
|
|
+ <span style="width: 100px" class="text-left">项目位置:</span>
|
|
|
+ <div class="full-width">
|
|
|
+ <map-picker
|
|
|
+ :project-id="form.id"
|
|
|
+ :address="form.address"
|
|
|
+ :lat-lng="[form.latitude, form.longitude]"
|
|
|
+ @success="mapSuccess"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="flex flex-justify-center">
|
|
|
+ <el-form-item class="full-width" style="flex: 1">
|
|
|
+ <div
|
|
|
+ class="flex flex-center flex-align-start full-width"
|
|
|
+ style="width: 99.3%"
|
|
|
+ >
|
|
|
+ <span class="title-textarea">建设规模:</span>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入建设规模(250 个字以内)"
|
|
|
+ v-model="form.construction_scale"
|
|
|
+ :rows="5"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="flex flex-justify-center">
|
|
|
+ <el-form-item class="full-width" style="flex: 1">
|
|
|
+ <div
|
|
|
+ class="flex flex-center flex-align-start full-width"
|
|
|
+ style="width: 99.3%"
|
|
|
+ >
|
|
|
+ <span class="title-textarea">建设内容:</span>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入建设内容(250 个字以内)"
|
|
|
+ :maxlength="250"
|
|
|
+ :rows="5"
|
|
|
+ v-model="form.construction_content"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </wt-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import wtCard from '@/components/wt-card/index.vue'
|
|
|
+import areaPicker from '@/components/area-picker/index.vue'
|
|
|
+import mapPicker from '@/views/project/componens/map-picker.vue'
|
|
|
+import { useStore } from '@/store/user.js'
|
|
|
+import industryPicker from '@/components/industry-picker/index.vue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ wtCard,
|
|
|
+ areaPicker,
|
|
|
+ mapPicker,
|
|
|
+ industryPicker
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ info: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ info: {
|
|
|
+ handler(val) {
|
|
|
+ this.form = val
|
|
|
+ if (val.tags === 1) {
|
|
|
+ // 1 政府项目,主管单位和责任单位都为政府机构
|
|
|
+ this.getDepList()
|
|
|
+ } else {
|
|
|
+ // 2 企业项目,主管单位为机构,责任单位为企业
|
|
|
+ this.getDepList()
|
|
|
+ this.getCompList()
|
|
|
+ }
|
|
|
+ this.getDict('project-situation')
|
|
|
+ },
|
|
|
+ immediate: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ const user = useStore()
|
|
|
+ return { user }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ disabled: true,
|
|
|
+ form: {},
|
|
|
+ photoList: [],
|
|
|
+ yesOrNo: [
|
|
|
+ {
|
|
|
+ label: '否',
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是',
|
|
|
+ value: 1
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ projectSituation: [],
|
|
|
+ deptDic: [],
|
|
|
+ compDic: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getDict(code) {
|
|
|
+ this.$api.common.dicList({ code }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.projectSituation = res.data.map(ele => {
|
|
|
+ ele.dictKey = Number.parseInt(ele.dictKey)
|
|
|
+ return ele
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDepList() {
|
|
|
+ const local = {
|
|
|
+ label: this.form.competent_unit_name,
|
|
|
+ value: this.form.competent_unit
|
|
|
+ }
|
|
|
+ this.deptDic.push(local)
|
|
|
+ this.$api.system
|
|
|
+ .getDeptLazy({ parentId: this.form.competent_unit, deptCategory: 3 })
|
|
|
+ .then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ const tmp = res.data.map(ele => {
|
|
|
+ const item = { label: ele.deptName, value: ele.id }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ this.deptDic = this.deptDic.concat(tmp)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCompList() {
|
|
|
+ this.$api.system.getNewDeptLazy({ deptCategory: 4 }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ const tmp = res.data.map(ele => {
|
|
|
+ const item = { label: ele.deptName, value: ele.id }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ this.compDic = this.compDic.concat(tmp)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ save() {
|
|
|
+ if (this.photoList.length > 0) {
|
|
|
+ this.$api.project.addPhotoProject(this.photoList).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$api.project.proUpdate(this.form).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ change(res) {
|
|
|
+ this.disabled = res
|
|
|
+ },
|
|
|
+ changeArea(list) {
|
|
|
+ this.form.province_code = list[0].key
|
|
|
+ this.form.province_name = list[0].title
|
|
|
+ this.form.city_code = list[1].key
|
|
|
+ this.form.city_name = list[1].title
|
|
|
+ this.form.district_code = list[2].key
|
|
|
+ this.form.district_name = list[2].title
|
|
|
+ },
|
|
|
+ mapSuccess(res, list) {
|
|
|
+ this.form.address = res.address
|
|
|
+ this.form.longitude = res.longitude
|
|
|
+ this.form.latitude = res.latitude
|
|
|
+ this.photoList = list
|
|
|
+ },
|
|
|
+ changeIndustry(tmps) {
|
|
|
+ this.form.dict_key = tmps
|
|
|
+ this.$emit('industry', tmps[0])
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.title {
|
|
|
+ width: 120px;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+
|
|
|
+.title-textarea {
|
|
|
+ width: 100px;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+
|
|
|
+.item {
|
|
|
+ width: 98%;
|
|
|
+}
|
|
|
+</style>
|