修改项目详情的编辑

2.法规清单编辑内容没有更新
This commit is contained in:
qq787203167
2022-04-20 18:07:13 +08:00
parent 78f4e4a706
commit 17dde52ed8
2 changed files with 32 additions and 6 deletions
@@ -162,28 +162,46 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<listOfRelevantPersonnel ref="listOfRelevantPersonnelRef"/> <listOfRelevantPersonnel ref="listOfRelevantPersonnelRef"/>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import listOfRelevantPersonnel from './listOfRelevantPersonnel' import listOfRelevantPersonnel from './listOfRelevantPersonnel'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import addModel from './addModel'
export default { export default {
name: 'ProjectDetails', name: 'ProjectDetails',
components: { components: {
listOfRelevantPersonnel listOfRelevantPersonnel,
addModel
}, },
data() { data() {
return { return {
queryForm: {} queryForm: {},
url: {
queryById: 'project/projectLibraryBase/queryById',
add: 'project/projectLibraryBase/add',
edit: 'project/projectLibraryBase/edit'
}
} }
}, },
mounted() { mounted() {
this.queryForm = this.$route.query this.getForm()
this.mainEcharts() this.mainEcharts()
}, },
methods: { methods: {
getForm() {
getAction(this.url.queryById, { id: this.$route.query.id }).then((res) => {
if (res.success) {
this.queryForm = res.result[0] || {}
} else {
this.queryForm = {}
}
})
},
mainEcharts() { mainEcharts() {
var myChart = echarts.init(document.getElementById('main')) var myChart = echarts.init(document.getElementById('main'))
myChart.setOption({ myChart.setOption({
@@ -212,9 +230,12 @@
window.open(val) window.open(val)
} }
}, },
edit(){ edit() {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(this.queryForm)))
}, },
addModelList() {
this.getForm()
}
} }
} }
</script> </script>
@@ -760,7 +760,12 @@
}, },
editModel(item) { editModel(item) {
this.visible = true this.visible = true
this.queryPersonByProject(item) if (item.dutyTerritory) {
this.queryPersonByProject(item)
} else {
this.formInline = item
this.formInline = { ...this.formInline }
}
this.$nextTick(() => { this.$nextTick(() => {
this.rules = {} this.rules = {}
switch (item.roleCode) { switch (item.roleCode) {