|
|
@@ -2,7 +2,7 @@
|
|
|
<div class='flex flex-justify-start flex-align-center flex-col'>
|
|
|
<div class='flex flex-center full-width flex-justify-between mt-10 mb-10'>
|
|
|
<span class='full-width text-left bold'>{{ info.dictValue }}</span>
|
|
|
- <el-button v-if='detail.can_update' type='primary' @click='update'>
|
|
|
+ <el-button v-if='detail.can_update' type='primary' @click='disabled = !disabled'>
|
|
|
{{ disabled ? '编 辑' : '保 存' }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -90,12 +90,12 @@
|
|
|
1-2月
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- {{item + 1}}月
|
|
|
+ {{ item + 1 }}月
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class='mr-5 flex flex-center'>
|
|
|
- <div v-for='(item,index) in current.planMonths' :key='item'>
|
|
|
+ <div v-for='(item,index) in current.planMonths' :key='item.name'>
|
|
|
<input class='input' v-model="item.data" @change='changeMonth(item,1,index)'/>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -136,6 +136,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
immediate: true
|
|
|
+ },
|
|
|
+ disabled: {
|
|
|
+ handler (val) {
|
|
|
+ if (val) {
|
|
|
+ this.update(val !== true)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: false
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
@@ -233,17 +241,18 @@ export default {
|
|
|
this.form[item.code2] = item.value2
|
|
|
},
|
|
|
update (show = Boolean) {
|
|
|
- this.disabled = !this.disabled
|
|
|
- this.form.projectId = this.form.id
|
|
|
- delete this.form._id
|
|
|
- this.$api.project.proUpdate(this.detail).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- if (show) {
|
|
|
- this.$message.success(res.msg)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.form.projectId = this.form.id
|
|
|
+ delete this.form._id
|
|
|
+ this.$api.project.proUpdate(this.detail).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (show) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
}
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
/**
|