gaoshp
2024-04-14 037af3bed10918cf24629f9a7f7e207af059ee96
src/views/console/workstation/index.vue
@@ -19,7 +19,7 @@
                     <el-header>
                        <div class="left-panel">
                           <el-button @click="table_add" type="primary" icon="el-icon-plus"></el-button>
                           <el-button type="danger" plain icon="el-icon-delete"></el-button>
                           <el-button type="danger" plain icon="el-icon-delete" @click="batchDel"></el-button>
                           <!-- <el-button type="primary" plain>导入</el-button>
                           <el-button type="primary" plain>批量操作</el-button> -->
                        </div>
@@ -64,12 +64,12 @@
                                          <el-button text type="primary" size="small">删除</el-button>
                                       </template>
                                    </el-popconfirm>
                                    <el-popconfirm title="确定停用吗?"
                                    <!-- <el-popconfirm title="确定停用吗?"
                                       @confirm="table_del(scope.row, scope.$index,'1')">
                                       <template #reference>
                                          <el-button text type="primary" size="small">停用</el-button>
                                       </template>
                                    </el-popconfirm>
                                    </el-popconfirm> -->
                                 </el-button-group>
                              </template>
                           </el-table-column>
@@ -85,9 +85,9 @@
                                    <li>工位编号 {{previewData.code}}</li>
                                    <li>工位组 {{previewData.groupName}}</li>
                                    <li>工位名称 {{previewData.name}}</li>
                                    <li>工位类型 {{previewData.type}}</li>
                                    <li>工位类型 {{types.find(v => v.value == previewData.type)?.label}}</li>
                                    <li>工位日历 {{previewData.calendarName}}</li>
                                    <li>状态 {{previewData.status}}</li>
                                    <li>状态 {{previewData.status ? '启用' : '禁用'}}</li>
                                 </ul>
                              </div>
                              <el-tabs tab-position="top" class="custom-tabs" v-model="normal">
@@ -237,7 +237,7 @@
         </el-tabs>
      </el-card>
      <Dialog ref="dialog"></Dialog>
      <Dialog ref="dialog" @success="success" :option="{types,status,group}"></Dialog>
   </el-main>
</template>
@@ -263,29 +263,25 @@
         params: {},
         keyWord: '',
         type: '',
         statu: '1',
         statu: 1,
         types: [
            {
               label: '所有',
               value: ''
            },
            {
               label: '机器',
               value: '0'
               value: 0
            },
            {
               label: '人工',
               value: '1'
               value: 1
            },
         ],
         status: [
            {
               label: '启用',
               value: '1'
               value: 1
            },
            {
               label: '停用',
               value: '0'
               value: 0
            }
         ],
         previewData: {},
@@ -305,7 +301,8 @@
         treeCheckKey: [],
         beltline_type: [],
         group_tag: [],
         addGroupShow: false
         addGroupShow: false,
         selection: []
      }
   },
   watch: {
@@ -360,6 +357,9 @@
            this.group_tag = res.data
         })
      },
      success () {
         this.search()
      },
      async queryList(flag) {
         this.showGrouploading = true
@@ -480,20 +480,21 @@
         this.$refs.dialog.open()
      },
      table_edit(row) {
         if (row.isSet) {
            row.isSet = false
         } else {
            row.isSet = true
         }
         this.$refs.dialog.open('edit',row)
      },
      table_del(row, index,type) {
         this.$API.workstation.deleteWork.delete({
            type,
            workstationIds:row.id
         }).then(() => {
         this.$HTTP.delete(`/api/blade-cps/workstation?type=0&workstationIds=${row.id}`).then(res => {
            this.search()
         })
      },
      selectionChange (selection) {
         this.selection = selection
      },
      batchDel () {
         this.$HTTP.delete(`/api/blade-cps/workstation?type=0&workstationIds=${this.selection.map(item => item.id).join(',')}`).then(res => {
            this.search()
         })
      }
   }
}
</script>