Ver Fonte

往来单位10.13

caojunjie há 1 ano atrás
pai
commit
2ef5e56940
1 ficheiros alterados com 27 adições e 3 exclusões
  1. 27 3
      src/views/iosBasicData/bcorps/index.vue

+ 27 - 3
src/views/iosBasicData/bcorps/index.vue

@@ -119,10 +119,12 @@
               <el-button type="success" size="small" @click="handleExport" icon="el-icon-printer">导出</el-button>
             </template>
             <template slot-scope="{ row, index }" slot="menu">
-                <el-button type="text" style="color: #85e967" size="small" @click.stop="statusfun">
+                <el-button v-if="row.status == 1" type="text" style="color: #85e967" size="small"
+                           @click.stop="statusfun(row.id,0)">
                   启用
                 </el-button>
-                <el-button type="text" style="color: #e83c3a" size="small" @click.stop="">
+                <el-button v-if="row.status == 0" type="text" style="color: #e83c3a" size="small"
+                           @click.stop="statusfun(row.id,1)">
                     停用
                 </el-button>
 
@@ -240,7 +242,8 @@ export default {
       page: {
         pageSize: 10,
         currentPage: 1,
-        total: 0
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
       selectionList: [],
       option: {},
@@ -1044,6 +1047,27 @@ export default {
     this.bcorpstypedefineListfun()
   },
   methods: {
+      // 禁用启用按钮
+      statusfun(id,status){
+          this.$confirm("确定将选择数据更改状态?", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+          }).then(()=>{
+              getBcorpsDetail(id).then(res => {
+                  let obj = res.data.data;
+                  obj.status = status
+                  updateBcorps(obj).then(res=>{
+                      this.onLoad(this.page);
+                      this.$message({
+                          type: "success",
+                          message: "操作成功!"
+                      });
+                  })
+              });
+          })
+
+      },
     // 导入
     // handleChange(file, fileLis) {
     //   console.log('daoru');