|
|
@@ -1,22 +1,32 @@
|
|
|
<template>
|
|
|
<div class='flex flex-justify-start flex-align-center flex-col'>
|
|
|
- <span class='full-width text-left'>{{ info.dictValue }}</span>
|
|
|
+ <span class='full-width text-left mt-20'>{{ info.dictValue }}</span>
|
|
|
<div style='width: 95%;' class='mt-20'>
|
|
|
<avue-crud
|
|
|
:option="option"
|
|
|
:data="data"
|
|
|
ref="crud"
|
|
|
v-model="form"
|
|
|
+ :table-loading="loading"
|
|
|
:before-open="beforeOpen"
|
|
|
@row-del="rowDel"
|
|
|
@row-save="rowSave"
|
|
|
@row-update="rowUpdate">
|
|
|
+ <template #menu="{row}">
|
|
|
+ <el-button text type='primary' icon='el-icon-plus' @click='report(row)'>上报</el-button>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import option1 from '@/views/home/component/inspect/option1.js'
|
|
|
+import option2 from '@/views/home/component/inspect/option2.js'
|
|
|
+import option3 from '@/views/home/component/inspect/option3.js'
|
|
|
+import option4 from '@/views/home/component/inspect/option4.js'
|
|
|
+import option5 from '@/views/home/component/inspect/option5.js'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'Inspect1',
|
|
|
props: {
|
|
|
@@ -25,8 +35,19 @@ export default {
|
|
|
default: null
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ info: {
|
|
|
+ handler (val) {
|
|
|
+ if (val) {
|
|
|
+ this.changeColum(val.dictKey)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
form: {},
|
|
|
data: [],
|
|
|
projectId: '',
|
|
|
@@ -37,7 +58,6 @@ export default {
|
|
|
option: {
|
|
|
align: 'center',
|
|
|
menuAlign: 'center',
|
|
|
- menuWidth: 180,
|
|
|
addBtn: true,
|
|
|
refreshBtn: false,
|
|
|
columnBtn: false,
|
|
|
@@ -85,12 +105,42 @@ export default {
|
|
|
this.onLoad()
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeColum (key) {
|
|
|
+ if (key === '1') {
|
|
|
+ this.option = option1
|
|
|
+ } else if (key === '2') {
|
|
|
+ this.option = option2
|
|
|
+ } else if (key === '3') {
|
|
|
+ this.option = option3
|
|
|
+ } else if (key === '4') {
|
|
|
+ this.option = option4
|
|
|
+ } else if (key === '5') {
|
|
|
+ this.option = option5
|
|
|
+ }
|
|
|
+ },
|
|
|
add () {
|
|
|
this.$refs.crud.rowAdd()
|
|
|
},
|
|
|
+ report (row) {
|
|
|
+ this.$confirm('是否确定进行上报操作?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ this.$api.inspect.report({ projectInspectorId: row.id }).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
onLoad () {
|
|
|
const data = {
|
|
|
- projectInfoId: this.projectId,
|
|
|
+ projectId: this.projectId,
|
|
|
status: this.info.dictKey
|
|
|
}
|
|
|
this.loading = true
|
|
|
@@ -111,7 +161,8 @@ export default {
|
|
|
},
|
|
|
rowSave (row, done, loading) {
|
|
|
const data = {
|
|
|
- projectId: this.projectId
|
|
|
+ projectId: this.projectId,
|
|
|
+ status: this.info.dictKey
|
|
|
}
|
|
|
this.$api.inspect.submint(Object.assign(row, data)).then((res) => {
|
|
|
if (res.code === 200) {
|