Explorar el Código

-修改整改记录检查

jiangbiao hace 2 años
padre
commit
1bf9739178

+ 13 - 7
master/src/main/java/com/ruoyi/project/production/controller/TFivesChangeRecordController.java

@@ -115,13 +115,19 @@ public class TFivesChangeRecordController extends BaseController {
     @PreAuthorize("@ss.hasPermi('production:record:approve')")
     @Log(title = "区域检查整改记录", businessType = BusinessType.UPDATE)
     @PutMapping("/approve")
-    public AjaxResult approve(@RequestBody TFivesRecordDetails tFivesRecordDetails) {
-        tFivesRecordDetails.setUpdatedate(new Date());
-        tFivesRecordDetails.setUpdaterCode(getUserId().toString());
-        tFivesRecordDetailsService.updateTFivesRecordDetails(tFivesRecordDetails);
-        TFivesChangeRecord tFivesChangeRecord = new TFivesChangeRecord();
-        tFivesChangeRecord.setChangeResult(tFivesRecordDetails.getChangeResult());
-        tFivesChangeRecord.setId(tFivesRecordDetails.getRecordId());
+    public AjaxResult approve(@RequestBody TFivesChangeRecord tFivesChangeRecord) {
+        TFivesRecordDetails tFivesRecordDetails = new TFivesRecordDetails();
+        tFivesRecordDetails.setRecordId(tFivesChangeRecord.getId());
+        for (TFivesRecordDetails details : tFivesRecordDetailsService.selectTFivesRecordDetailsList(tFivesRecordDetails)) {
+            if (StringUtils.isEmpty(details.getChangeResult())) {
+                details.setChangeResult(tFivesChangeRecord.getChangeResult());
+                details.setUpdatedate(new Date());
+                details.setUpdaterCode(getUserId().toString());
+                tFivesRecordDetailsService.updateTFivesRecordDetails(details);
+            }
+        }
+        tFivesChangeRecord.setChangeResult(tFivesChangeRecord.getChangeResult());
+        tFivesChangeRecord.setId(tFivesChangeRecord.getId());
         tFivesChangeRecord.setUpdatedate(new Date());
         tFivesChangeRecord.setUpdaterCode(getUserId().toString());
         return toAjax(tFivesChangeRecordService.updateTFivesChangeRecord(tFivesChangeRecord));

+ 6 - 1
ui/src/views/apply/offlinevalve/index.vue

@@ -143,7 +143,12 @@
                        fixed="left" :formatter="approveStatusFormat"/>
       <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" width="90" fixed="left"
                        :formatter="statusFormat"/>
-      <el-table-column label="破锁编号" align="center" prop="lockNo" :show-overflow-tooltip="true" width="140"/>
+      <el-table-column label="破锁编号" align="center" prop="lockNo" :show-overflow-tooltip="true" width="140">
+        <template slot-scope="scope">
+          <span v-if="scope.row.lockNo">{{ scope.row.lockNo }}</span>
+          <span v-else>NA</span>
+        </template>
+      </el-table-column>
       <el-table-column label="离线原因" align="center" prop="offlineReason" :show-overflow-tooltip="true" width="185"/>
       <el-table-column label="安全阀锁开是否拆解" align="center" prop="disassembly" :show-overflow-tooltip="true"
                        width="185"/>

+ 6 - 1
ui/src/views/apply/safetychange/index.vue

@@ -117,7 +117,12 @@
                        fixed="left" width="160"/>
       <el-table-column label="状态变更的原因" align="center" prop="changeReason" :show-overflow-tooltip="true"
                        width="160"/>
-      <el-table-column label="破锁编号" align="center" prop="lockNo" :show-overflow-tooltip="true" width="140"/>
+      <el-table-column label="破锁编号" align="center" prop="lockNo"  :show-overflow-tooltip="true" width="140">
+        <template slot-scope="scope">
+          <span v-if="scope.row.lockNo">{{ scope.row.lockNo }}</span>
+          <span v-else>NA</span>
+        </template>
+      </el-table-column>
       <el-table-column label="申请人" align="center" prop="applicantName" :show-overflow-tooltip="true" width="160"/>
       <el-table-column label="申请时间" align="center" prop="applicationTime" width="140">
         <template slot-scope="scope">

+ 41 - 39
ui/src/views/production/record/index.vue

@@ -159,7 +159,29 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true"/>
+      <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <div v-if="scope.row.changeResult==null&&scope.row.changeFile!=null">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-circle-check"
+              @click="checkRecord(scope.row,'合格')"
+              v-hasPermi="['production:record:approve']"
+            >合格
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-circle-close"
+              @click="checkRecord(scope.row,'不合格')"
+              v-hasPermi="['production:record:approve']"
+            >不合格
+            </el-button>
+          </div>
+          <div v-else>{{ scope.row.changeResult }}</div>
+        </template>
+      </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="200" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -167,7 +189,7 @@
             size="mini"
             type="text"
             icon="el-icon-tickets"
-            @click="openDetail(scope.row.id)"
+            @click="openDetail(scope.row)"
             v-hasPermi="['production:record:edit']"
           >整改记录
           </el-button>
@@ -320,6 +342,7 @@
             icon="el-icon-plus"
             size="mini"
             @click="handleChange"
+            v-if="detail.flag"
           >添加整改记录
           </el-button>
         </el-col>
@@ -343,29 +366,7 @@
           </template>
         </el-table-column>
         <el-table-column label="整改内容" align="center" prop="changeContent" :show-overflow-tooltip="true"/>
-        <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true">
-          <template slot-scope="scope">
-            <div v-if="scope.row.changeResult==null">
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-circle-check"
-                @click="checkRecord(scope.row,'合格')"
-                v-hasPermi="['production:record:approve']"
-              >合格
-              </el-button>
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-circle-close"
-                @click="checkRecord(scope.row,'不合格')"
-                v-hasPermi="['production:record:approve']"
-              >不合格
-              </el-button>
-            </div>
-            <div v-else>{{ scope.row.changeResult }}</div>
-          </template>
-        </el-table-column>
+        <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true"/>
       </el-table>
     </el-dialog>
 
@@ -431,6 +432,7 @@ export default {
       detail: {
         open: false,
         recordId: null,
+        flag: true
       },
       file: {
         title: "",
@@ -555,20 +557,19 @@ export default {
   methods: {
     checkRecord(row, result) {
       console.log(row)
-      approveRecord({id: row.id, recordId: row.recordId, changeResult: result}).then(res => {
-        this.getDetailList(row.recordId);
+      approveRecord({id: row.id, changeResult: result}).then(res => {
         this.getList();
       })
     },
-    handleRemove(file, fileList){
-      console.log(this.fileIds,this.personFiles)
+    handleRemove(file, fileList) {
+      console.log(this.fileIds, this.personFiles)
       console.log(file)
-      if(file.response.data!=null){
-        if (this.fileIds.indexOf(file.response.data)>=0){
-          this.fileIds.splice(this.fileIds.indexOf(file.response.data),1)
+      if (file.response.data != null) {
+        if (this.fileIds.indexOf(file.response.data) >= 0) {
+          this.fileIds.splice(this.fileIds.indexOf(file.response.data), 1)
         }
       }
-      console.log(this.fileIds,this.personFiles)
+      console.log(this.fileIds, this.personFiles)
     },
     changeRecord(row, result) {
       this.$refs["form"].validate(valid => {
@@ -605,10 +606,11 @@ export default {
       this.form.position = this.regionList.find((o) => o.orderNo === event).position
       this.form.owner = this.regionList.find((o) => o.orderNo === event).personLiable
     },
-    openDetail(id) {
-      this.detail.recordId = id;
+    openDetail(row) {
+      this.detail.recordId = row.id;
       this.detail.open = true;
-      this.getDetailList(id);
+      this.detail.flag = row.changeResult === '合格' ? false : true;
+      this.getDetailList(row.id);
     },
     getDetailList(id) {
       listDetails({recordId: id}).then(response => {
@@ -722,11 +724,11 @@ export default {
       const id = row.id || this.ids
       getRecord(id).then(response => {
         this.form = response.data;
-        if (this.form.checkFile!=null){
+        if (this.form.checkFile != null) {
           let ids = this.form.checkFile.split(',')
           for (const id of ids) {
-            getFile(id).then(res=>{
-              let item = {url: process.env.VUE_APP_BASE_API +res.data.url,response: {msg: res.data.url,data:id} }
+            getFile(id).then(res => {
+              let item = {url: process.env.VUE_APP_BASE_API + res.data.url, response: {msg: res.data.url, data: id}}
               this.fileList.push(item)
               this.fileIds.push(id)
             })