|
|
@@ -140,7 +140,11 @@
|
|
|
<p v-show="!isPrintPage" class="tip">注:可一次上传多个相关文件(文档、表格、图片等)。 支持格式:DOC, PDF, Excel, PNG, JPG, PPT 等。 请确保文件内容清晰有效。</p>
|
|
|
|
|
|
<div v-show="!isPrintPage" class="btn-wrap" style="text-align: center; margin-top: 30px;">
|
|
|
- <el-button type="primary" style="width: 160px;" @click="handleSaveBtn">保存</el-button>
|
|
|
+ <template v-if="!projectIsEnd">
|
|
|
+ <el-button type="primary" style="width: 160px;" @click="handleSaveBtn(0)">保 存</el-button>
|
|
|
+ <el-button type="primary" style="width: 160px;" @click="handleSaveBtn(2)">确定结题</el-button>
|
|
|
+ </template>
|
|
|
+ <el-button v-else type="primary" style="width: 160px;" @click="handleSaveBtn(1)">取消结题</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -186,6 +190,9 @@ export default {
|
|
|
this.isPrintPage = false;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 项目是否已结束
|
|
|
+ projectIsEnd: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -351,6 +358,7 @@ export default {
|
|
|
},
|
|
|
handleProjectChange(data) {
|
|
|
this.selProject = data;
|
|
|
+ this.projectIsEnd = data.status == 2 ? true : false;
|
|
|
},
|
|
|
validForm() {
|
|
|
let errorText = '';
|
|
|
@@ -362,26 +370,40 @@ export default {
|
|
|
|
|
|
return errorText;
|
|
|
},
|
|
|
- handleSaveBtn() {
|
|
|
+ /**
|
|
|
+ * 提交表单
|
|
|
+ * @param status 0(暂存)、2(确定结题)、1(取消结题)
|
|
|
+ */
|
|
|
+ handleSaveBtn(operateType) {
|
|
|
let errorText = this.validForm();
|
|
|
if (errorText) {
|
|
|
this.$message.error(errorText+'!');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const params = { ...this.formData, xmId: this.currProjectId };
|
|
|
+ const params = { ...this.formData, xmId: this.currProjectId, status: operateType };
|
|
|
params.ysbg = JSON.stringify(params.ysbg);
|
|
|
params.jsbg = JSON.stringify(params.jsbg);
|
|
|
params.cgbg = JSON.stringify(params.cgbg);
|
|
|
params.xybg = JSON.stringify(params.xybg);
|
|
|
params.yspw = JSON.stringify(params.yspw);
|
|
|
|
|
|
- this.saveData(params);
|
|
|
+ this.saveData(params, operateType);
|
|
|
},
|
|
|
- saveData(params) {
|
|
|
+ saveData(params, operateType) {
|
|
|
save(params).then(({ data }) => {
|
|
|
if (data.code == 200) {
|
|
|
- this.$message.success('保存成功!');
|
|
|
+ let msgObj = {
|
|
|
+ 0: '保存成功',
|
|
|
+ 1: '项目取消结题成功',
|
|
|
+ 2: '项目结题成功'
|
|
|
+ };
|
|
|
+ if (operateType == 2) {
|
|
|
+ this.projectIsEnd = true;
|
|
|
+ } else {
|
|
|
+ this.projectIsEnd = false;
|
|
|
+ }
|
|
|
+ this.$message.success(`${msgObj[operateType]}!`);
|
|
|
}
|
|
|
});
|
|
|
}
|