Browse Source

备件基础信息 添加 批量禁用 和 库存

清行 2 years ago
parent
commit
7dd19b51d6
1 changed files with 39 additions and 2 deletions
  1. 39 2
      src/views/custom/basic/index.vue

+ 39 - 2
src/views/custom/basic/index.vue

@@ -44,6 +44,7 @@
           <div>
             <el-button v-if="isBasicAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">新增</el-button>
             <el-button v-if="isBasicTemplate" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
+            <el-button v-if="isDisable" v-waves class="filter-item" type="danger" icon="el-icon-remove-outline"  @click="handleBatchDisable">批量禁用</el-button>
             <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
               <el-button v-if="isBasicImport" v-waves class="filter-item" type="warning" icon="el-icon-download" @click="handleFilter">导入</el-button>
             </el-upload>
@@ -63,7 +64,9 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
+          @selection-change="handleSelectionChange2"
         >
+          <el-table-column type="selection"  width="55"></el-table-column>
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
               <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
@@ -113,9 +116,9 @@
               </el-popover>
             </template>
           </el-table-column>
-          <el-table-column label="EAS同步状态" min-width="120px" align="center">
+          <el-table-column label="备件库存" min-width="120px" align="center">
             <template slot-scope="scope">
-              <span>{{ scope.row.easStatus }}</span>
+              <span>{{ scope.row.reportery }}</span>
             </template>
           </el-table-column>
           <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
@@ -675,6 +678,7 @@ export default {
       isEasSynchronization: [],
       isManualSynchronization: [],
       isIgnoreSynchronization: [],
+      multipleSelection:[],
       rules: {
         temptypeCode: [{ required: true, message: '必填', trigger: 'blur' }],
         partClass: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -1004,7 +1008,40 @@ export default {
       const isIgnoreSynchronization = checkButtons(this.$store.state.user.buttons, IgnoreSynchronization)
       this.isIgnoreSynchronization = isIgnoreSynchronization
     },
+    handleSelectionChange2(val) {
+        this.multipleSelection = val;
+      },
+    handleBatchDisable(){
+      if(this.multipleSelection.length > 0){
 
+    
+      this.$confirm('是否确定批量禁用?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.multipleSelection.forEach(row => {
+            console.log("批量禁用",row)
+            this.requestParam.name = 'updatepartsEnable'
+            this.requestParam.parammaps = {}
+            this.requestParam.parammaps.id = row.id
+            this.requestParam.parammaps.enable = 0
+            PostDataByName(this.requestParam).then(() => {
+              this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
+            })
+          });
+          this.getList()
+          this.getListSH()
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消批量禁用'
+          });          
+        });
+      }else{
+        this.$notify({ title: '提示', message: '请勾选禁用备件', type: 'error', duration: 2000 })
+      }
+    },
     getDownList() {
       GetDataByNames(this.requestParams).then(response => {
         this.units = response.data.getDictByName.list