baichengfei 5 years ago
parent
commit
3895f08d81

+ 4 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -430,6 +430,7 @@ func (this *InfoChangeController) GetAllEntityList() {
 	asc := false
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
+	SupplierId := this.GetString("SupplierId")
 	if Order != "" && Prop != "" {
 		orderby = "a." + Prop
 		if Order == "asc" {
@@ -443,6 +444,9 @@ func (this *InfoChangeController) GetAllEntityList() {
 	if SupplierName != "" {
 		where = where + " and a.SupplierName like '%" + SupplierName + "%'"
 	}
+	if SupplierId != "" {
+		where = where + " and b.SupplierId = '" + SupplierId + "'"
+	}
 
 	if CreateOn != "" {
 		dates := strings.Split(CreateOn, ",")

+ 7 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/supplierappend.js

@@ -110,5 +110,12 @@ export default {
       method: 'post',
       params: params
     })
+  },
+  judgeAppend (params, myAxios) {
+    return myAxios({
+      url: '/suppliercertappend/addappend/',
+      method: 'post',
+      params: params
+    })
   }
 }

+ 30 - 25
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/basislist.vue

@@ -361,32 +361,37 @@
             _this.addshow = false
             _this.appendformData.AppendType = '02'
             _this.appendformData.SupplierId = parseInt(_this.appendformData.SupplierId)
-            _this.$axios.post('/suppliercertappend/addappend/', _this.appendformData)
-              .then(res => {
-                if (res.data.code === 0) {
-                  //this.entityList = res.data.item
-                  let AppendId = res.data.info
-                  this.$router.push({
-                    path: `/oilsupplier/supplierappend/2/basisdataopera`,
-                    query: {
-                      Id: AppendId,
-                      editFlag: 1 //编辑标记: 1 修改,0 不修改
-                    }
-                  })
-                  _this.$message({
-                    type: 'success',
-                    message: res.data.message,
-                  })
-                } else {
-                  _this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
-              })
-              .catch(err => {
-                console.error(err)
+            if (!_this.appendformData.SupplierId || !_this.appendformData.SupplierName) {
+              _this.$message({
+                type: 'warning',
+                message: '请选择供应商公司'
               })
+              this.appendformData.SupplierId = ''
+              return
+            }
+            api.judgeAppend(_this.appendformData, _this.$axios).then(res => {
+              if (res.data.code === 0) {
+                //this.entityList = res.data.item
+                let AppendId = res.data.info
+                this.$router.push({
+                  path: `/oilsupplier/supplierappend/2/basisdataopera`,
+                  query: {
+                    Id: AppendId,
+                    editFlag: 1 //编辑标记: 1 修改,0 不修改
+                  }
+                })
+                _this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                _this.appendformData.SupplierId = ''
+                _this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
           })
           .catch(() => {});
       },

+ 27 - 30
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/goodslist.vue

@@ -364,44 +364,41 @@
             _this.appendformData.AppendType = '01'
             _this.appendformData.SupplierId = parseInt(_this.appendformData.SupplierId)
             console.log(_this.appendformData, '数据')
-            if (!_this.appendformData.SupplierId) {
+            if (!_this.appendformData.SupplierId || !_this.appendformData.SupplierName) {
               _this.$message({
                 type: 'warning',
                 message: '请选择供应商公司'
               })
+              this.appendformData.SupplierId = ''
               return
             }
-            _this.$axios.post('/suppliercertappend/addappend/', _this.appendformData)
-              .then(res => {
-                if (res.data.code === 0) {
-                  //this.entityList = res.data.item
-                  let AppendId = res.data.info
-                  this.$router.push({
-                    path: `/oilsupplier/supplierappend/1/goodsdataopera`,
-                    query: {
-                      Id: AppendId,
-                      editFlag: 1 //编辑标记: 1 修改,0 不修改
-                    }
-                  })
-                  _this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  })
-                } else {
-                  _this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
-              })
-              .catch(err => {
-                console.error(err)
-              })
-          })
-          .catch(() => {});
+            api.judgeAppend(_this.appendformData, _this.$axios).then(res => {
+              if (res.data.code === 0) {
+                //this.entityList = res.data.item
+                let AppendId = res.data.info
+                this.$router.push({
+                  path: `/oilsupplier/supplierappend/1/goodsdataopera`,
+                  query: {
+                    Id: AppendId,
+                    editFlag: 1 //编辑标记: 1 修改,0 不修改
+                  }
+                })
+                _this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                _this.appendformData.SupplierId = ''
+                _this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+          }).catch(() => {});
       },
 
-      getSupplierList() {
+      getSupplierList () {
         let _this = this
         _this.supplierList = []
         let params = {

+ 30 - 26
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/techlist.vue

@@ -364,33 +364,37 @@
             _this.addshow = false
             _this.appendformData.AppendType = '03'
             _this.appendformData.SupplierId = parseInt(_this.appendformData.SupplierId)
-            _this.$axios.post('/suppliercertappend/addappend/', _this.appendformData)
-              .then(res => {
-                if (res.data.code === 0) {
-                  //this.entityList = res.data.item
-                  let AppendId = res.data.info
-                  this.$router.push({
-                    path: `/oilsupplier/supplierappend/3/techdataopera`,
-                    query: {
-                      Id: AppendId,
-                      editFlag: 1, //编辑标记: 1 修改,0 不修改
-                      sId: _this.appendformData.SupplierId
-                    }
-                  })
-                  _this.$message({
-                    type: 'success',
-                    message: res.data.message,
-                  })
-                } else {
-                  _this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
-              })
-              .catch(err => {
-                console.error(err)
+            if (!_this.appendformData.SupplierId || !_this.appendformData.SupplierName) {
+              _this.$message({
+                type: 'warning',
+                message: '请选择供应商公司'
               })
+              this.appendformData.SupplierId = ''
+              return
+            }
+            api.judgeAppend(_this.appendformData, _this.$axios).then(res => {
+              if (res.data.code === 0) {
+                //this.entityList = res.data.item
+                let AppendId = res.data.info
+                this.$router.push({
+                  path: `/oilsupplier/supplierappend/3/techdataopera`,
+                  query: {
+                    Id: AppendId,
+                    editFlag: 1 //编辑标记: 1 修改,0 不修改
+                  }
+                })
+                _this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                _this.appendformData.SupplierId = ''
+                _this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
           })
           .catch(() => {});
       },