|
@@ -133,7 +133,7 @@ table{
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="noEdit = false;" v-if="noEdit">编辑</el-button>
|
|
|
<el-button type="primary" @click="visibleJudge = false;plan={}" v-if="!noEdit">取消</el-button>
|
|
|
- <el-button type="primary" @click="change" v-if="!noEdit">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="change(2)" v-if="!noEdit">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
@@ -150,7 +150,7 @@ table{
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getPlanList,addPlan,updatePlan,deletePlan } from '@/api/year';
|
|
|
+import { getPlanList,addPlan,updatePlan,deletePlan,evaluate } from '@/api/year';
|
|
|
import Judge from "@/components/MainPage/Judge/Judge";
|
|
|
|
|
|
export default {
|
|
@@ -196,21 +196,34 @@ export default {
|
|
|
this.plan = JSON.parse(JSON.stringify( item ));
|
|
|
this.yearData = new Date(item.year,1,1);
|
|
|
},
|
|
|
- change(){
|
|
|
+ change(type){
|
|
|
this.plan.year = this.yearData.getFullYear();
|
|
|
if(this.plan.id){
|
|
|
- updatePlan(this.plan).then((result) => {
|
|
|
- this.$message(result.result?'更新成功':'更新失败');
|
|
|
- this.visibleChange = false;
|
|
|
- this.visibleJudge = false;
|
|
|
- this.plan = {};
|
|
|
- this.getPlanList();
|
|
|
- this.$store.dispatch('setCurPlanSin');
|
|
|
- })
|
|
|
+ if(type == 2){
|
|
|
+ evaluate({
|
|
|
+ id: this.plan.id,
|
|
|
+ evaluation: this.plan.evaluation
|
|
|
+ }).then((result) => {
|
|
|
+ this.$message(result.result?'更新成功':'更新失败');
|
|
|
+ this.visibleJudge = false;
|
|
|
+ this.plan = {};
|
|
|
+ this.getPlanList();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ updatePlan(this.plan).then((result) => {
|
|
|
+ this.$message(result.result?'更新成功':'更新失败');
|
|
|
+ this.visibleChange = false;
|
|
|
+ this.visibleJudge = false;
|
|
|
+ this.plan = {};
|
|
|
+ this.getPlanList();
|
|
|
+ this.$store.dispatch('setCurPlanSin');
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
else{
|
|
|
addPlan(this.plan).then((result) => {
|
|
|
- this.$message(result.result?'添加成功':'添加失败');
|
|
|
+ this.$message(result.result?'添加成功':result.message);
|
|
|
this.visibleChange = false;
|
|
|
this.plan = {};
|
|
|
this.getPlanList();
|