Pārlūkot izejas kodu

23条批量删除

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 gadi atpakaļ
vecāks
revīzija
739f1ccd31

+ 6 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -656,14 +656,17 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 		this.ServeJSON()
 		return
 	}
+	Ids := strings.Split(Id, ",")
 	//根据Id查出OilSupplierCertSub的SubClassId
 	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE) //获得数据库引擎
 	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
 	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+
+	for i:=0;i<len(Ids);i++{
 	var datamain suppliercertsub.OilSupplierCertSub    //创建OilSupplierCertSub结构体(映射用)
 	var datamain2 []suppliercertsub.OilSupplierCertSub //空的查询用
 
-	where := " Id= " + Id
+	where := " Id= " + Ids[i]
 	svc.GetEntity(&datamain, where) //根据Id查找,映射结构体
 
 	//再根据企业id查找这个企业有几个准入范围(如果只有一个准入范围了,基本资质也删除)
@@ -722,7 +725,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	}
-	where = " Id= " + Id
+	where = " Id= " + Ids[i]
 	err2 := svc.DeleteEntityBytbl(OilSupplierCertSubName, where) //删除OilSupplierCertSub单条准入范围
 	if err2 == nil {
 		errinfo.Message = "删除成功"
@@ -734,6 +737,7 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
 		errinfo.Code = -1
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
+		}
 	}
 }
 

+ 23 - 10
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -4,16 +4,13 @@
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">准入范围</span>
         <span style="float: right;">
-          <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" v-if="canadd">添加
+           <el-button style="float: right; padding: 3px 0px" type="text" @click="deletedata()" v-if="candelete">删除</el-button>
+          <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd">添加
           </el-button>
         </span>
       </div>
-      <el-table :data="businessList" border>
-        <el-table-column
-          type="selection"
-          width="55">
-        </el-table-column>
-
+      <el-table :data="businessList" border size="mini"  @selection-change="handleSelectionChange">
+        <el-table-column type="selection"  width="55"></el-table-column>
         <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
         <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
         <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
@@ -23,12 +20,12 @@
             <!-- <el-button type="primary" plain size="mini" title="编辑" @click="openDialog(scope.row)" :disabled="!canadd">编辑
             </el-button> -->
             <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
-                       @click="deletedata(scope.row)" :disabled="!canadd">删除</el-button>
+                       @click="deletedata(scope.row)" :disabled="!candelete">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+        :page-sizes="[10, 20, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
         :total="currentItemCount">
       </el-pagination>
     </el-card>
@@ -124,6 +121,10 @@
       canadd: {
         type: Boolean,
         default: false
+      },
+      candelete:{
+        type: Boolean,
+        default: false
       }
     },
     /*created() {
@@ -143,6 +144,7 @@
         }
       };
       return {
+        Ids:[],
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
@@ -202,6 +204,13 @@
       }
     },
     methods: {
+        handleSelectionChange(val) {
+        this.Ids=[]
+        for (var i=0;i<val.length;i++)
+        {
+          this.Ids.push(val[i].Id)
+        }
+      },
       getvalue(SupplierId, SupplierTypeCode, certId) {
         this.SupplierId = SupplierId
         this.SupplierTypeCode = SupplierTypeCode
@@ -364,6 +373,10 @@
       //     })
       // },
       deletedata(val) {
+          if(val!=null&&val!=""){
+            this.Ids=[]
+            this.Ids.push(val.Id)
+            }
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
             confirmButtonText: '确定',
@@ -371,7 +384,7 @@
             type: 'warning'
           })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' + val.Id, {})
+            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({

+ 25 - 7
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -4,11 +4,11 @@
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">准入范围</span>
         <span style="float: right;">
-          <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" v-if="canadd">添加
-          </el-button>
+          <el-button style="float: right; padding: 3px 0px" type="text" @click="deletedata()" v-if="candelete">删除</el-button>
+          <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd">添加</el-button>
         </span>
       </div>
-      <el-table :data="goodsList" border>
+      <el-table :data="goodsList" border size="mini"  @selection-change="handleSelectionChange">
         <el-table-column
           type="selection"
           width="55">
@@ -18,15 +18,15 @@
         <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
         <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
 
-        <el-table-column label="操作" width="90" align="center" fixed>
+        <el-table-column label="操作" width="90" align="center" fixed >
           <template slot-scope="scope">
             <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
-                       @click="deletedata(scope.row)" :disabled="!canadd">删除</el-button>
+                       @click="deletedata(scope.row)" :disabled="!candelete">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+        :page-sizes="[10, 50, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
         :total="currentItemCount">
       </el-pagination>
     </el-card>
@@ -71,6 +71,10 @@
       canadd: {
         type: Boolean,
         default: false
+      },
+      candelete:{
+        type:Boolean,
+        default:false
       }
     },
     /*created() {
@@ -88,6 +92,7 @@
     },
     data() {
       return {
+        Ids:[],
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
@@ -114,6 +119,14 @@
       }
     },
     methods: {
+
+      handleSelectionChange(val) {
+        this.Ids=[]
+        for (var i=0;i<val.length;i++)
+        {
+          this.Ids.push(val[i].Id)
+        }
+      },
       getvalue(SupplierId, SupplierTypeCode, certId) {
         this.SupplierId = SupplierId
         this.SupplierTypeCode = SupplierTypeCode
@@ -191,6 +204,11 @@
           })
       },
       deletedata(val) {
+        if(val!=null&&val!=""){
+            this.Ids=[]
+            this.Ids.push(val.Id)
+        }
+        
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
             confirmButtonText: '确定',
@@ -198,7 +216,7 @@
             type: 'warning'
           })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' + val.Id, {})
+            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({

+ 23 - 5
src/dashoo.cn/frontend_web/src/components/oilsupplier/techlist.vue

@@ -4,11 +4,13 @@
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">准入范围</span>
         <span style="float: right;">
-          <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" v-if="canadd">添加
+           <el-button style="float: right; padding: 3px 0px" type="text" @click="deletedata()" v-if="candelete">删除</el-button>
+          <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd">添加
+         
           </el-button>
         </span>
       </div>
-      <el-table :data="techList" border style="height: calc(100vh - 435px);">
+      <el-table :data="techList" border style="height: calc(100vh - 435px);" size="mini" @selection-change="handleSelectionChange">
         <el-table-column
           type="selection"
           width="55">
@@ -21,12 +23,12 @@
         <el-table-column label="操作" width="90" align="center" fixed>
           <template slot-scope="scope">
             <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
-                       @click="deletedata(scope.row)" :disabled="!canadd">删除</el-button>
+                       @click="deletedata(scope.row)" :disabled="!candelete">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+        :page-sizes="[10, 50, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
         :total="currentItemCount">
       </el-pagination>
     </el-card>
@@ -71,6 +73,10 @@
       canadd: {
         type: Boolean,
         default: false
+      },
+       candelete:{
+        type:Boolean,
+        default:false
       }
     },
     /*created() {
@@ -83,6 +89,7 @@
     },*/
     data() {
       return {
+        Ids:[],
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
@@ -108,6 +115,13 @@
       }
     },
     methods: {
+       handleSelectionChange(val) {
+        this.Ids=[]
+        for (var i=0;i<val.length;i++)
+        {
+          this.Ids.push(val[i].Id)
+        }
+      },
       getvalue(SupplierId, SupplierTypeCode, certId) {
         this.SupplierId = SupplierId
         this.SupplierTypeCode = SupplierTypeCode
@@ -185,6 +199,10 @@
           })
       },
       deletedata(val) {
+         if(val!=null&&val!=""){
+            this.Ids=[]
+            this.Ids.push(val.Id)
+        }
         let _this = this
         _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
             confirmButtonText: '确定',
@@ -192,7 +210,7 @@
             type: 'warning'
           })
           .then(() => {
-            _this.$axios.delete('suppliercertsub/businessdelete/' + val.Id, {})
+            _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {})
               .then(function (response) {
                 if (response.data.code === 0) {
                   _this.$message({

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/basisedit.vue

@@ -203,7 +203,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="准入范围" :disabled="!certId">
-          <business-list ref="businessList" :data.sync="businessList" @close="getbuslist" :canadd="add_flat"
+          <business-list ref="businessList" :data.sync="businessList" @close="getbuslist" :canadd="add_flat" :candelete="delete_flat"
             height="360px" style="margin-top: 20px"></business-list>
         </el-tab-pane>
         <el-tab-pane label="企业资质" :disabled="!certId">
@@ -528,6 +528,7 @@
           WorkflowId: ''
         },
         add_flat: true,
+        delete_flat: true,
         entrydetail: {
           process: 'oil_supplier_apply_1',
           business: '',
@@ -717,6 +718,9 @@
             if (this.formData.Status > 0) {
               this.add_flat = false
             }
+            if ((this.formData.Status > 0 ) && (this.formData.Status !=4)) {
+              this.delete_flat = false
+            }
             this.$refs['BasisInfo'].CityAry = []
             this.$refs['BasisInfo'].CityAry.push(this.formData.Province)
             this.$refs['BasisInfo'].CityAry.push(this.formData.City)

+ 6 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -210,7 +210,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="准入范围" :disabled="!certId">
-          <goods-list ref="goodsList" :data.sync="goodsList" @close="getbuslist" :canadd="add_flat" height="360px"
+          <goods-list ref="goodsList" :data.sync="goodsList" @close="getbuslist" :canadd="add_flat" :candelete="delete_flat" height="360px"
             style="margin-top: 20px"></goods-list>
         </el-tab-pane>
         <el-tab-pane label="企业资质" :disabled="!certId">
@@ -530,6 +530,7 @@
           Status: 0
         },
         add_flat: true,
+        delete_flat:true,
         entrydetail: {
           process: "oil_supplier_apply_1",
           business: "",
@@ -738,6 +739,10 @@
               if (this.formData.Status > 0) {
                 this.add_flat = false;
               }
+              if ((this.formData.Status > 0 ) && (this.formData.Status !=4)) {
+              this.delete_flat = false
+              }
+            
               this.$refs["GoodsInfo"].CityAry = [];
               this.$refs["GoodsInfo"].CityAry.push(this.formData.Province);
               this.$refs["GoodsInfo"].CityAry.push(this.formData.City);

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -203,7 +203,7 @@
           </el-card>
         </el-tab-pane>
         <el-tab-pane label="准入范围" :disabled="!certId">
-          <tech-list ref="techList" :data.sync="techList" @close="getbuslist" :canadd="add_flat" height="360px"
+          <tech-list ref="techList" :data.sync="techList" @close="getbuslist" :canadd="add_flat" :candelete="delete_flat" height="360px"
             style="margin-top: 20px"></tech-list>
         </el-tab-pane>
         <el-tab-pane label="企业资质" :disabled="!certId">
@@ -523,6 +523,7 @@
           WorkflowId: ''
         },
         add_flat: true,
+        delete_flat:true,
         entrydetail: {
           process: 'oil_supplier_apply_1',
           business: '',
@@ -710,6 +711,9 @@
             if (this.formData.Status > 0) {
               this.add_flat = false
             }
+            if ((this.formData.Status > 0 ) && (this.formData.Status !=4)) {
+              this.delete_flat = false
+            }
             this.formDataCert.WorkflowId = this.formData.WorkflowId
             this.$refs["TechInfo"].CityAry = []
             this.$refs["TechInfo"].CityAry.push(this.formData.Province)