Browse Source

状态修改

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 years ago
parent
commit
6283616429

+ 31 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -823,3 +823,34 @@ func (this *OilSupplierCertSubController) AddOpinion() {
 		this.ServeJSON()
 	}
 }
+
+
+
+
+// @Title 更新准入项状态
+// @Description
+// @router /updatestatus/:Id/:Status [get]
+func (this *OilSupplierCertSubController) UpdateStatus() {
+	Id := this.Ctx.Input.Param(":Id")
+	Status := this.Ctx.Input.Param(":Status")
+	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
+	var error error
+	if Status =="1"{
+		_,error=svc.DBE.Exec("update "+ OilSupplierCertSubName+" set CertSubStatus='3' where Id="+Id+"")
+	}else{
+		_,error=svc.DBE.Exec("update "+ OilSupplierCertSubName+" set CertSubStatus='1' where Id="+Id+"")
+	}
+
+	var errinfo ErrorDataInfo
+	if error == nil {
+		errinfo.Message = "操作成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "操作失败!"
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}

+ 24 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -9,7 +9,7 @@
           </el-button>
         </span>
       </div>
-      <el-table :data="businessList" border size="mini" height="calc(100vh - 435px)"  @selection-change="handleSelectionChange">
+      <el-table :data="businessList" border size="mini" height="calc(100vh - 435px)"  @selection-change="handleSelectionChange" @cell-click="changeCertSubStatus">
         <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>
@@ -219,6 +219,29 @@
       }
     },
     methods: {
+      changeCertSubStatus (row, column, cell, event) {
+        if (this.newcanadd && column.property === 'CertSubStatus') {
+          this.$confirm('确定更改此准入范围状态吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then((res) => {
+            this.$axios.get('suppliercertsub/updatestatus/' + row.Id + '/' + row.CertSubStatus + '', {}).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: '更改成功'
+                })
+                this.initData()
+              }
+            }).catch(err => {
+              console.error(err)
+            })
+          }).catch(() => {
+          })
+        } else {
+        }
+      },
       handleSelectionChange (val) {
         this.Ids = []
         for (var i = 0; i < val.length; i++) {

+ 24 - 2
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -8,7 +8,7 @@
           <el-button style="float: right; padding: 3px 25px" type="text" @click="showDialog" v-if="canadd || newcanadd">添加</el-button>
         </span>
       </div>
-      <el-table :data="goodsList" border size="mini" height="calc(100vh - 435px)" @selection-change="handleSelectionChange">
+      <el-table :data="goodsList" border size="mini" height="calc(100vh - 435px)" @selection-change="handleSelectionChange" @cell-click="changeCertSubStatus">
         <el-table-column
           type="selection"
           width="55">
@@ -152,7 +152,29 @@
       }
     },
     methods: {
-
+      changeCertSubStatus (row, column, cell, event) {
+        if (this.newcanadd && column.property === 'CertSubStatus') {
+          this.$confirm('确定更改此准入范围状态吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then((res) => {
+            this.$axios.get('suppliercertsub/updatestatus/' + row.Id + '/' + row.CertSubStatus + '', {}).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: '更改成功'
+                })
+                this.initData()
+              }
+            }).catch(err => {
+              console.error(err)
+            })
+          }).catch(() => {
+          })
+        } else {
+        }
+      },
       handleSelectionChange (val) {
         this.Ids = []
         for (var i = 0; i < val.length; i++) {

+ 24 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/techlist.vue

@@ -10,7 +10,7 @@
           </el-button>
         </span>
       </div>
-      <el-table :data="techList" border height="calc(100vh - 435px)" size="mini" @selection-change="handleSelectionChange">
+      <el-table :data="techList" border height="calc(100vh - 435px)" size="mini" @selection-change="handleSelectionChange" @cell-click="changeCertSubStatus">
         <el-table-column
           type="selection"
           width="55">
@@ -129,6 +129,29 @@
       }
     },
     methods: {
+      changeCertSubStatus (row, column, cell, event) {
+        if (this.newcanadd && column.property === 'CertSubStatus') {
+          this.$confirm('确定更改此准入范围状态吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then((res) => {
+            this.$axios.get('suppliercertsub/updatestatus/' + row.Id + '/' + row.CertSubStatus + '', {}).then(res => {
+              if (res.data.code === 0) {
+                this.$message({
+                  type: 'success',
+                  message: '更改成功'
+                })
+                this.initData()
+              }
+            }).catch(err => {
+              console.error(err)
+            })
+          }).catch(() => {
+          })
+        } else {
+        }
+      },
       handleSelectionChange (val) {
         this.Ids = []
         for (var i = 0; i < val.length; i++) {