Răsfoiți Sursa

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt

liujt 5 luni în urmă
părinte
comite
4ba83c60e4

+ 1 - 1
src/views/bpm/doneTickets/maintenance/detail.vue

@@ -469,7 +469,7 @@
     data() {
       return {
         options: {
-          0: '正常',
+          1: '正常',
           '-1': '缺陷'
         },
         num: 1,

+ 1 - 1
src/views/bpm/doneTickets/patrolInspection/index.vue

@@ -82,7 +82,7 @@
               报工
             </el-link>
             <el-link
-              v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+              v-if="row.orderStatus !== 3 && row.orderStatus !== 4&&row.isGroup != 1"
               type="primary"
               :underline="false"
               icon="el-icon-edit"

+ 1 - 1
src/views/bpm/doneTickets/repair/index.vue

@@ -131,7 +131,7 @@
             v-if="
               row.orderStatus !== 3 &&
               row.orderStatus !== 4 &&
-              userId === row.executeUserId
+              userId === row.executeUserId&&row.isGroup != 1
             "
             type="primary"
             :underline="false"

+ 88 - 11
src/views/bpm/tickets/components/signingUpWork.vue

@@ -19,10 +19,13 @@
         <!-- 巡点检、保养设备 -->
         <div class="maintain_equipment_info">
           <HeaderTitle title="设备" size="16px"></HeaderTitle>
+          <div style="text-align: right; margin-bottom: 15px">
+            <el-button type="primary" @click="allSet">批量设置</el-button></div
+          >
           <div class="maintain_equipment_info_content">
             <div
               class="equipment_item"
-              v-for="item in infoData.planDeviceList"
+              v-for="(item, index) in infoData.planDeviceList"
               :key="item.id"
             >
               <div class="equipment_info" v-if="item.substance">
@@ -51,15 +54,20 @@
                 <div class="item_info">
                   <span class="item_label">编号</span>
                   <span class="item_value">{{
-                    item.substance.extInfo
-                      ? item.substance.extInfo.codeNumber
-                      : ''
+                    item.substance ? item.substance.codeNumber : ''
                   }}</span>
                 </div>
               </div>
               <p>操作事项</p>
               <div class="ruleMatters_box">
-                <el-table :data="item.workItems" border>
+                <el-table
+                  :data="item.workItems"
+                  border
+                  :ref="'table' + index"
+                  row-key="id"
+                >
+                  <el-table-column type="selection" width="55" align="center">
+                  </el-table-column>
                   <el-table-column label="序号" width="50">
                     <template slot-scope="scope">
                       <span>{{ scope.$index + 1 }}</span>
@@ -113,12 +121,13 @@
                       </div>
                     </template>
                   </el-table-column>
-                  <el-table-column label="" prop="status" width="150">
+                  <el-table-column label="状态" prop="status" width="150">
                     <template slot-scope="scope">
                       <template>
                         <el-select
                           v-model="scope.row.status"
                           placeholder="请选择"
+                          @change="handleStatusChange(scope.row)"
                         >
                           <el-option
                             v-for="item in options"
@@ -143,7 +152,7 @@
               </div>
             </div>
           </div>
-          <div class="control">
+          <!-- <div class="control">
             <span>处理说明:</span>
             <el-input
               type="textarea"
@@ -151,7 +160,7 @@
               v-model="infoData.reason"
             >
             </el-input>
-          </div>
+          </div> -->
         </div>
       </div>
     </div>
@@ -159,6 +168,26 @@
       <el-button @click="cancel">返回</el-button>
       <el-button type="primary" @click="submit">提交</el-button>
     </div>
+    <el-dialog
+      :visible.sync="allVisible"
+      title="批量设置"
+      width="500px"
+      append-to-body
+    >
+      <el-select v-model="allData.status" placeholder="请选择">
+        <el-option
+          v-for="item in options"
+          :label="item.label"
+          :value="item.value"
+          :key="item.value"
+        >
+        </el-option>
+      </el-select>
+      <div slot="footer" class="footer">
+        <el-button @click="allVisible = false">取消</el-button>
+        <el-button type="primary" @click="allSave">确认</el-button>
+      </div>
+    </el-dialog>
   </el-dialog>
 </template>
 
@@ -168,14 +197,16 @@
   export default {
     data() {
       return {
+        allVisible: false,
+        allData: { status: '' },
         time: [],
         options: [
           {
             label: '正常',
-            value: 0
+            value: 1
           },
           {
-            label: '缺陷',
+            label: '异常',
             value: -1
           }
         ],
@@ -184,6 +215,46 @@
       };
     },
     methods: {
+      allSet() {
+        this.multipleSelection = [];
+        this.infoData.planDeviceList.forEach((item, index) => {
+          this.multipleSelection = [
+            ...this.multipleSelection,
+            ...this.$refs['table' + index][0].selection
+          ];
+        });
+        if (!this.multipleSelection.length) {
+          this.$message.error('请选择至少一条记录');
+
+          return;
+        }
+        this.allVisible = true;
+      },
+      allSave() {
+        this.allVisible = false;
+        this.multipleSelection.forEach((item, index) => {
+          this.$set(
+            this.multipleSelection[index],
+            'status',
+            this.allData.status
+          );
+          this.$set(
+            this.multipleSelection[index],
+            'result',
+            this.allData.status == '-1'
+              ? '异常'
+              : this.allData.status == '1'
+              ? '正常'
+              : ''
+          );
+        });
+        this.infoData.planDeviceList.forEach((item, index) => {
+          this.$refs['table' + index][0].clearSelection();
+        });
+      },
+      handleStatusChange(row) {
+        row.result =row.status == '-1' ? '异常' : row.status == '1' ? '正常' : '';
+      },
       open(row) {
         console.log(row);
         this.getInfo(row);
@@ -220,7 +291,13 @@
       // 表格数据
       async getInfo(row) {
         let res = await getById(row.planId);
-        console.log(row);
+        res.data.planDeviceList.forEach((item, index) => {
+          item.workItems.forEach((item1, index1) => {
+            item1.status = 1;
+            item1.result = '正常';
+            item1.normal = '正常';
+          });
+        });
         this.infoData = res.data;
         this.infoData.workOrderId = row.id;
       }

+ 1 - 1
src/views/bpm/tickets/patrolInspection/index.vue

@@ -30,7 +30,7 @@
               报工
             </el-link>
             <el-link
-              v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+              v-if="row.orderStatus !== 3 && row.orderStatus !== 4&&row.isGroup != 1"
               type="primary"
               :underline="false"
               icon="el-icon-edit"