瀏覽代碼

删除单条日报

seyason 1 年之前
父節點
當前提交
643e49a660
共有 1 個文件被更改,包括 43 次插入2 次删除
  1. 43 2
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue

+ 43 - 2
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue

@@ -150,13 +150,16 @@
                                     </span>
                                     <div class="checkbtn" style="padding-right:20px;">
                                         <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
-                                        <el-button v-if="permissions.reportsDeleteAll" size="small" @click="deleteUserReport(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
+                                        <el-button v-if="permissions.reportsDeleteAll" size="small" @click="deleteUserReport(item1)" style="float: right;">删除</el-button>
                                     </div>
                                     <div class="one_daily_body">
                                         <el-timeline>
                                             <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
                                                 <el-card shadow="never">
-                                                    <p v-if="item2.planType == 0">排产工单号:<b>{{item2.productSchedulingNum}}</b></p>
+                                                    <div></div>
+                                                    <p v-if="item2.planType == 0">排产工单号:<b>{{item2.productSchedulingNum}}</b>
+                                                        <el-button v-if="permissions.reportsDeleteAll" size="small" @click="deleteOneReport(item2.id)" style="float: right;">删除</el-button>
+                                                    </p>
                                                     <p v-if="item2.planType == 1">任务变更通知号:<b>{{item2.taskChangeNoticeNum}}</b></p>
                                                     <p >钢印号:<el-tag v-for="num in JSON.parse(item2.steelNumArray)" :key="num" size="small" type="info">{{num}}</el-tag></p>
                                                     <p>工作时长:<b style="color:goldenrod">{{item2.workingTime.toFixed(2)}} </b>分钟</p>
@@ -3626,6 +3629,44 @@
                 })
                 .catch(() => {});
                 
+           },
+           //删除一条日报
+           deleteOneReport(id) {
+            this.$confirm('确定要删除该条报工吗?',this.$t('other.prompts'), {
+                    confirmButtonText: this.$t('btn.determine'),
+                    cancelButtonText: this.$t('btn.cancel'),
+                    type: "warning"
+                })
+                .then(() => {
+                    this.listLoading = true;
+                    this.http.post('/report/delete',{id:id},
+                    res => {
+                        this.listLoading = false;
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: this.$t('message.successfullyDeleted'),
+                                type: "success"
+                            });
+                            this.getReportList();
+                            this.getDepartment();
+                            this.dialogVisible = false;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                })
+                .catch(() => {});
            },
             // 管理员删除日报
             deleteUserReport(item) {