shish 3 лет назад
Родитель
Сommit
a1a9227b5e

+ 15 - 1
hdApp/src/admin/ghs/addGhs.vue

@@ -17,6 +17,7 @@
 </template>
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
+import { addGhsFn } from '@/api/ghs'
 export default {
   name: "addGhs",
   components: {
@@ -31,7 +32,20 @@ export default {
   },
   methods: {
     formSubmit() {
-
+      let that = this
+      if (this.$util.isEmpty(this.form.name)){
+        this.$msg('请填写名称')
+        return false
+      }
+      uni.showLoading({mask:true})
+      addGhsFn({name:this.form.name}).then(res=>{
+        if(res.code == 1){
+          that.$msg('添加成功')
+          setTimeout(function(){
+            uni.navigateBack()
+          },1300)
+        }
+      })
     }
   }
 };

+ 4 - 0
hdApp/src/api/ghs/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const addGhsFn = data => {
+	return https.post('/ghs/add-ghs', data)
+}
+
 export const changeDelStatus = data => {
 	return https.get('/ghs/change-del-status', data)
 }

+ 1 - 0
hdApp/src/pages.json

@@ -165,6 +165,7 @@
 			"root": "admin/ghs",
 			"pages": [
 				{ "path": "shop", "style": {"navigationBarTitleText": "供货商"}},
+				{ "path": "addGhs", "style": {"navigationBarTitleText": "添加"}},
 				{ "path": "debtChange", "style": {"navigationBarTitleText": "欠款变动明细"}}
 			]
 		},

+ 1 - 1
hdApp/src/pagesPurchase/order.vue

@@ -76,7 +76,7 @@ export default {
   },
   methods: {
     addGhs(){
-
+      this.pageTo({url: '/admin/ghs/addGhs'})
     },
     suggest(){
       let that = this