代码更新
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<text style="color: red;">*</text> 供应商
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入供应商名称" v-model="datas.form.purveyorName" name="" id="">
|
||||
<input type="text" placeholder="请输入供应商名称" v-model="datas.form.name" name="" id="">
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
@@ -14,7 +14,7 @@
|
||||
<text style="color: red;">*</text> 联系电话
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入联系电话" v-model="datas.form.purveyorTelephone" name="" id="">
|
||||
<input type="text" placeholder="请输入联系电话" v-model="datas.form.telephone" name="" id="">
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
@@ -25,6 +25,14 @@
|
||||
<input type="text" placeholder="请输入地址" v-model="datas.form.address" name="" id="">
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
<text style="color: red;">*</text> 排序
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入排序" v-model="datas.form.sort" name="" id="">
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
备注
|
||||
@@ -45,18 +53,10 @@
|
||||
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
reactive,
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
import color from '@/commons/color.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
tbShopPurveyorpost
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
import { ref, reactive, getCurrentInstance } from 'vue';
|
||||
import { addVendor } from '@/api/vendor.js';
|
||||
|
||||
|
||||
let datas = reactive({
|
||||
form: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
@@ -65,23 +65,20 @@
|
||||
const currentInstance = getCurrentInstance()
|
||||
|
||||
function sumbit() {
|
||||
if (!datas.form.purveyorName || !datas.form.purveyorTelephone || !datas.form.address) {
|
||||
if (!datas.form.name || !datas.form.telephone || !datas.form.address) {
|
||||
currentInstance.ctx.$refs.uToastRef.show({
|
||||
message: "请填写必填项",
|
||||
type: 'default',
|
||||
})
|
||||
return
|
||||
}
|
||||
tbShopPurveyorpost(datas.form).then(res => {
|
||||
addVendor(datas.form).then(res => {
|
||||
currentInstance.ctx.$refs.uToastRef.show({
|
||||
message: "添加成功",
|
||||
type: 'default',
|
||||
})
|
||||
setTimeout(() => {
|
||||
// go.to('PAGES_SUPPLIER')pageConsumables/supplier
|
||||
// uni.redirectTo({url: '/pageConsumables/supplier'})
|
||||
go.back()
|
||||
// uni.redirectTo({url: '/pageConsumables/supplier'})
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user