137 lines
3.1 KiB
Vue
137 lines
3.1 KiB
Vue
<template>
|
|
<view class="warehouseEntry">
|
|
<view>
|
|
<view>
|
|
<view><text style="color: red;">*</text>供应商</view>
|
|
<view><input type="text" placeholder="请输入供应商名称" v-model="datas.form.name" name="" id=""></view>
|
|
</view>
|
|
<view>
|
|
<view><text style="color: red;">*</text>联系电话</view>
|
|
<view><input type="text" placeholder="请输入联系电话" v-model="datas.form.telephone" name="" id=""></view>
|
|
</view>
|
|
<view>
|
|
<view><text style="color: red;">*</text>地址</view>
|
|
<view><input type="text" placeholder="请输入地址" v-model="datas.form.address" name="" id=""></view>
|
|
</view>
|
|
<view>
|
|
<view><text style="color: red;">*</text>排序</view>
|
|
<view><input type="number" placeholder="请输入排序" @change="datas.form.sort=$utils.isNumber(datas.form.sort)" v-model="datas.form.sort" name="" id=""></view>
|
|
</view>
|
|
<view>
|
|
<view>备注</view>
|
|
<view><input type="text" placeholder="请输入备注" v-model="datas.form.remark" name="" id=""></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bottombutton">
|
|
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
|
|
text="保存"></up-button>
|
|
</view>
|
|
<!-- 消息提示 -->
|
|
<up-toast ref="uToastRef"></up-toast>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
import { ref, reactive, getCurrentInstance } from 'vue';
|
|
import { addVendor } from '@/http/api/vendor.js';
|
|
|
|
|
|
let datas = reactive({
|
|
form: {
|
|
shopId: uni.getStorageSync("shopId"),
|
|
},
|
|
})
|
|
const currentInstance = getCurrentInstance()
|
|
|
|
function sumbit() {
|
|
if (!datas.form.name || !datas.form.telephone || !datas.form.address) {
|
|
currentInstance.ctx.$refs.uToastRef.show({
|
|
message: "请填写必填项",
|
|
type: 'default',
|
|
})
|
|
return
|
|
}
|
|
addVendor(datas.form).then(res => {
|
|
currentInstance.ctx.$refs.uToastRef.show({
|
|
message: "添加成功",
|
|
type: 'default',
|
|
})
|
|
setTimeout(() => {
|
|
uni.navigateBack()
|
|
}, 1000)
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
page {
|
|
background-color: #f9f9f9;
|
|
}
|
|
|
|
.df() {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
ul,
|
|
li {
|
|
list-style: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.status {
|
|
margin: 0 32rpx;
|
|
position: absolute;
|
|
// top: 100%;
|
|
left: 0;
|
|
right: 0;
|
|
z-index: 10;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.warehouseEntry {
|
|
height: 540rpx;
|
|
background: #FFFFFF;
|
|
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
|
margin: 28rpx;
|
|
padding: 1rpx 24rpx;
|
|
box-sizing: border-box;
|
|
|
|
>view {
|
|
>view {
|
|
height: 84rpx;
|
|
background: #fcfcfc;
|
|
border: 2rpx solid #F9F9F9;
|
|
margin-top: 32rpx;
|
|
.df;
|
|
|
|
>view:first-child {
|
|
width: 190rpx;
|
|
height: 84rpx;
|
|
line-height: 84rpx;
|
|
// text-align: left;
|
|
padding-left: 24rpx;
|
|
background: #F9F9F9;
|
|
border-radius: 8rpx 0rpx 0rpx 8rpx;
|
|
border: 2rpx solid #F9F9F9;
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
font-weight: 400;
|
|
font-size: 32rpx;
|
|
color: #333333;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.bottombutton {
|
|
margin-top: 84rpx;
|
|
padding: 0 24rpx;
|
|
|
|
>button {
|
|
width: 530rpx;
|
|
height: 80rpx;
|
|
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
|
}
|
|
}
|
|
</style> |