From 13272e92a6c98daad06aa166a6674bf4dac7cc4b Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期一, 21 十月 2024 11:06:55 +0800 Subject: [PATCH] 问题审核1021 --- src/views/fysp/check/components/CompProblemCard.vue | 96 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 66 insertions(+), 30 deletions(-) diff --git a/src/views/fysp/check/components/CompProblemCard.vue b/src/views/fysp/check/components/CompProblemCard.vue index 04947c6..3db8c37 100644 --- a/src/views/fysp/check/components/CompProblemCard.vue +++ b/src/views/fysp/check/components/CompProblemCard.vue @@ -60,14 +60,7 @@ <el-col :span="12"> <el-row justify="start" class="btn-group"> <el-button type="success" size="small" @click="updatePro" plain>闂鏇存</el-button> - <el-button - type="primary" - size="small" - @click="updateChange" - plain - :disabled="!proStatus.changeable" - >鏁存敼妫�楠�</el-button - > + <el-button type="primary" size="small" @click="updateChange" plain>鏁存敼妫�楠�</el-button> <el-button type="info" size="small" @click="currProRecent" plain>闂澶嶇幇</el-button> </el-row> </el-col> @@ -86,14 +79,31 @@ </el-col> </el-row> </el-card> - <el-dialog v-model="proAddOrUpdDialogVisible" :before-close="proAddOrUpdDialogClose" width="80%"> - <CompProblemAddOrUpd - v-if="proAddOrUpdDialogVisible" - :problem="deepCopyPro" - :subtask="deepCopySubtask" - :topTask="deepCopyTopTask" - ref="compProblemAddOrUpdRef" - @submited="onProSubmited" + <div class="dialog-wrapper"> + <el-dialog + title="闂鏇存" + width="80%" + v-model="proAddOrUpdDialogVisible" + :before-close="proAddOrUpdDialogClose" + > + <CompProblemAddOrUpd + v-if="proAddOrUpdDialogVisible" + :problem="deepCopyPro" + :subtask="deepCopySubtask" + :topTask="deepCopyTopTask" + ref="compProblemAddOrUpdRef" + @submited="onProSubmited" + /> + </el-dialog> + </div> + <el-dialog width="80%" title="鏁存敼鎻愪氦" v-model="addChangeDialogVisible"> + <ComChangeEdit + :changeType="0" + v-if="addChangeDialogVisible" + :problemId="problem.guid" + :subtask="subtask" + :month="month" + @submited="onAddChangeSubmited" /> </el-dialog> <el-dialog @@ -103,6 +113,7 @@ :before-close="changeEditDialogClose" > <ComChangeEdit + :changeType="1" v-if="changeEditDialogVisible" :problemId="problem.guid" :oldChangeFileList="problem.mediafileList" @@ -118,11 +129,12 @@ v-model="proRecentDialogVisible" :before-close="proRecentDialogClose" > - <CompProRecent - v-if="proRecentDialogVisible" + <CompProRecent + v-if="proRecentDialogVisible" :subtask="subtask" :topTask="topTask" - :problem="problem"/> + :problem="problem" + /> </el-dialog> </template> @@ -174,6 +186,7 @@ emits: ['submit'], data() { return { + addChangeDialogVisible: false, // 杩戞湡鎯呭喌 proRecentDialogVisible: false, month: -1, @@ -199,10 +212,7 @@ ] }; }, - mounted() { - console.log(this.topTask); - - }, + mounted() {}, computed: { // 闂鍚嶇О title() { @@ -243,6 +253,10 @@ } }, methods: { + onAddChangeSubmited() { + this.$emit('updated', true); + this.addChangeDialogVisible = false; + }, // 杩戞湡鎯呭喌寮圭獥鍏抽棴 proRecentDialogClose() { this.proRecentDialogVisible = false; @@ -255,8 +269,6 @@ this.proAddOrUpdDialogVisible = false; }, onChangeSubmited(isOk) { - console.log("zhenggaisubmit"); - this.$emit('updated', isOk); this.changeEditDialogVisible = false; }, @@ -266,7 +278,23 @@ changeEditDialogClose() { this.changeEditDialogVisible = false; }, - deletePro() {}, + deletePro() { + useMessageBoxTip({ + confirmMsg: '鏄惁鍒犻櫎闂', + confirmTitle: '纭畾', + onConfirm: () => { + return problemApi + .deleteProblem({ + pid: this.problem.guid + }) + .then((res) => { + if (res.success) { + this.$emit('submit') + } + }); + } + }); + }, rejectPro() { this.checkPro(false); }, @@ -290,9 +318,10 @@ } }); }, + addChange() { + this.addChangeDialogVisible = true; + }, updatePro() { - console.log("clone", this.topTask); - this.deepCopyPro = useCloned(this.problem).cloned.value; this.deepCopySubtask = useCloned(this.subtask).cloned.value; this.deepCopyTopTask = useCloned(this.topTask).cloned.value; @@ -300,7 +329,7 @@ this.proAddOrUpdDialogVisible = true; }); }, - updateChange() { + getCurrentMouth() { // 浣跨敤Date瀵硅薄瑙f瀽鏃ユ湡瀛楃涓� var date = new Date(this.subtask.subtask.planstarttime); // 鑾峰彇鏈堜唤淇℃伅锛屾湀浠芥槸浠�0寮�濮嬬殑锛屾墍浠ラ渶瑕佸姞1 @@ -311,7 +340,14 @@ // 鑾峰彇骞翠唤 var year = date.getFullYear(); this.month = `${year}-${this.month}`; - this.changeEditDialogVisible = true; + }, + updateChange() { + this.getCurrentMouth(); + if (!this.problem.ischanged) { + this.addChange(); + } else { + this.changeEditDialogVisible = true; + } }, currProRecent() { this.proRecentDialogVisible = true; -- Gitblit v1.9.3