修改耗材问题

This commit is contained in:
duan 2024-11-01 16:36:14 +08:00
parent 5e4022f85c
commit dc1ff9ba43
4 changed files with 38 additions and 28 deletions

View File

@ -41,6 +41,7 @@ export function queryAllShopInfo(params) {
method: "get",
params: {
shopId: uni.getStorageSync('shopId'),
isVip:1,
...params
}
});

View File

@ -63,8 +63,9 @@
},
})
const currentInstance = getCurrentInstance()
function sumbit() {
if(!datas.form.purveyorName||!datas.form.purveyorTelephone||!datas.form.address){
if (!datas.form.purveyorName || !datas.form.purveyorTelephone || !datas.form.address) {
currentInstance.ctx.$refs.uToastRef.show({
message: "请填写必填项",
type: 'default',
@ -72,7 +73,16 @@
return
}
tbShopPurveyorpost(datas.form).then(res => {
go.back()
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'})
}, 1000)
})
}
</script>
@ -140,6 +150,7 @@
.bottombutton {
margin-top: 84rpx;
padding: 0 24rpx;
>button {
width: 530rpx;
height: 80rpx;

View File

@ -57,27 +57,29 @@
<input type="text" placeholder="请输入总价值(元)" name="" id="">
</view>
</li> -->
<view style="justify-content: space-between;">
<view style="justify-content: space-between;align-items: center;">
<view>
供应商
</view>
<view style="width: 54%;" @tap="showStatusToggle">
{{datas.status[nowStatusIndex]}}
</view>
<picker @change="changeNowStatusIndex" :value="nowStatusIndex" :range="datas.status">
<view class="color-333" style="height: 84rpx;line-height: 84rpx;">{{datas.status[nowStatusIndex]}}</view>
</picker>
<uni-icons type="bottom" size="16"></uni-icons>
<view style="color: #318AFE;width: 80rpx;text-align: center;" @tap="toggle">
新增
</view>
<!-- <up-button type="text" style="color: #318AFE;" @tap="toggle" :plain="true"
text="新增"></up-button> -->
</view>
</view>
<view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
<!-- <view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
v-for="(item,index) in datas.status" :key="index">
<view :class="{'color-main':nowStatusIndex===index}">{{item}}</view>
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
</view>
<view :style="{height: '14px'}"></view>
</view>
</view> -->
</view>
<view class="bottombutton">
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
@ -156,7 +158,7 @@
let nowStatusIndex = ref(0)
function changeNowStatusIndex(i) {
nowStatusIndex.value = i
nowStatusIndex.value = i.detail.value
showStatus.value = false
}

View File

@ -25,7 +25,7 @@
<input type="number" placeholder="请输入数量" v-model="datas.form.list.stockNumber" name="" id="">
</view>
</view>
<!-- <view style="justify-content: space-between;">
<!-- <view style="justify-content: space-between;">
<view>
单位
</view>
@ -66,33 +66,28 @@
<input type="text" placeholder="请输入总价值(元)" name="" id="">
</view>
</view> -->
<view style="justify-content: space-between;">
<view style="justify-content: space-between;align-items: center;">
<view>
供应商
</view>
<view style="width: 375rpx;" @tap="showStatusToggle">
{{datas.status[nowStatusIndex]}}
</view>
<picker @change="changeNowStatusIndex" :value="nowStatusIndex" :range="datas.status">
<view class="color-333" style="height: 84rpx;line-height: 84rpx;">{{datas.status[nowStatusIndex]}}</view>
</picker>
<uni-icons type="bottom" size="16"></uni-icons>
<view style="color: #318AFE;width: 80rpx;text-align: center;" @tap="toggle">
<view style="color: #318AFE;width: 80rpx;text-align: center;" @tap="toggle">
新增
</view>
<!-- <up-button type="text" style="color: #318AFE;" @tap="toggle" :plain="true"
<!-- <up-button type="text" style="color: #318AFE;" @tap="toggle" :plain="true"
text="新增"></up-button> -->
</view>
</view>
<view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
v-for="(item,index) in datas.status" :key="index">
<view :class="{'color-main':nowStatusIndex===index}">{{item}}</view>
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
</view>
<view :style="{height: '14px'}"></view>
</view>
</view>
<view class="bottombutton">
<up-button type="primary" style="background-color: #318AFE;color: #fff;width: 100%!important;" @tap="sumbit" :plain="true"
text="保存"></up-button>
<up-button type="primary" style="background-color: #318AFE;color: #fff;width: 100%!important;" @tap="sumbit"
:plain="true" text="保存"></up-button>
<!-- <up-button type="text" style="background-color: #f9f9f9;color: #999;" @tap="toggle" :plain="true"
text="取消"></up-button> -->
</view>
@ -159,6 +154,7 @@
res.content.forEach(ele => {
datas.status.push(ele.purveyorName)
})
console.log(datas.status, '调试121')
})
}
@ -168,7 +164,7 @@
let nowStatusIndex = ref(0)
function changeNowStatusIndex(i) {
nowStatusIndex.value = i
nowStatusIndex.value = i.detail.value
showStatus.value = false
}
@ -187,7 +183,7 @@
})
return
}
if(!datas.list[nowStatusIndex.value]){
if (!datas.list[nowStatusIndex.value]) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "供应商不能为空",