|
|
@@ -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)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|