瀏覽代碼

待删除按公司删

lining 6 年之前
父節點
當前提交
25ec8dad3f

+ 5 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -1927,10 +1927,15 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 	session.Begin()
 	defer session.Close()
 
+	supplierId := this.GetString("SupplierId")
+
 	svc := goodsaptitude.GetOilGoodsAptitudeSession(session)
 
 	var supplierCertSubList []suppliercertsub.Tmp_OilSupplierCertSub
 	wheredel := "1=1 and SupplierTypeCode = '01'"
+	if supplierId != "" {
+		wheredel += " and SupplierId=" + supplierId
+	}
 	svc.GetEntitysByWhere(TmpOilSupplierCertSubName, wheredel, &supplierCertSubList)
 
 	var errinfo ErrorInfo

+ 3 - 2
src/dashoo.cn/frontend_web/src/api/oilsupplier/goodsaptitude.js

@@ -126,10 +126,11 @@ export default {
       data: formdata
     })
   },
-  delTmpSupplierCertSub (myAxios) {
+  delTmpSupplierCertSub (params, myAxios) {
     return myAxios({
       url: '/goodsaptitude/deltmpsuppliercertsub',
-      method: 'get'
+      method: 'get',
+      params: params
     })
   },
   findinconformity (formdata, myAxios) {

+ 33 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/_opera/showdelcertsub.vue

@@ -53,6 +53,7 @@
         <el-table-column label="操作" width="260px" align="center" fixed="right" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-button type="text" @click="opencertsub(scope.row)" title="导出" size="mini" icon="el-icon-document" width="120px">待删除准入范围</el-button>
+            <el-button type="text" style="color: red" @click="delcertsub(scope.row)" title="删除" size="mini" icon="el-icon-delete" width="120px">删除准入范围</el-button>
             <!--<el-button type="text" @click="openfilelist(scope.row)" title="导出" size="mini" icon="el-icon-document" width="120px">企业资质</el-button>-->
           </template>
         </el-table-column>
@@ -407,6 +408,34 @@ export default {
   },
 
   methods: {
+    delcertsub (row) {
+      this.$confirm('是否删除该公司的准入项?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let params = {
+          SupplierId: row.Id
+        }
+        console.log(row)
+        console.log(params)
+        api.delTmpSupplierCertSub(params, this.$axios).then(res => {
+          console.log(res)
+          if (res.data.code === 0) {
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.initDatas()
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        })
+      })
+    },
     // 导出准入范围到pdf
     toPdf () {
       api.pdfexport(this.Id, this.SupplierTypeCode, this.$axios)
@@ -455,7 +484,10 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        api.delTmpSupplierCertSub(this.$axios).then(res => {
+        let params = {
+
+        }
+        api.delTmpSupplierCertSub(params, this.$axios).then(res => {
           console.log(res)
           if (res.data.code === 0) {
             this.$message({