<template>
|
<PageHeader :title="pageTitle" @back="goBack" />
|
<view class="account-detail">
|
<view class="box">
|
<view class="form-box">
|
<uni-forms :key="index" label-position="top" label-width="400rpx">
|
|
<uni-forms-item label="名称" required>
|
<uni-easyinput v-model="goods.productCategory" placeholder="" disabled />
|
</uni-forms-item>
|
<uni-forms-item label="库存数量/件" required>
|
<uni-number-box v-model="goods.inboundNum" :min="0"></uni-number-box>
|
</uni-forms-item>
|
<uni-forms-item label="入库日期" required>
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="goods.createTime" />
|
</uni-forms-item>
|
</uni-forms>
|
</view>
|
<view style="display: flex;justify-content: flex-end;">
|
<button class="mini-btn" type="primary" size="mini"
|
style="margin-left: 0;margin-right: 0;margin-right: 20rpx;" @click="submitForm">确定</button>
|
<button class="mini-btn" size="mini" style="margin-left: 0;margin-right: 0;" @click="goBack">取消</button>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { onMounted, ref } from 'vue'
|
import { updateManagementByCustom } from '@/api/inventoryManagement/stockManagement.js'
|
import { userListNoPageByTenantId } from "@/api/system/user"
|
const pageTitle = ref('领用产品')
|
const userList = ref([])
|
const goods = ref({
|
id: 0,
|
inboundNum: 0,
|
createTime: "",
|
})
|
const props = defineProps(['goods'])
|
|
const goBack = () => {
|
uni.navigateBack()
|
}
|
const submitForm = async () => {
|
let res = await updateManagementByCustom(goods.value)
|
if (res.code !== 200) {
|
uni.showToast({
|
title: res.msg,
|
icon: 'none'
|
})
|
return
|
}
|
uni.showToast({
|
title: '成功领用',
|
icon: 'none'
|
})
|
goBack()
|
}
|
const initContacts = () => {
|
userListNoPageByTenantId().then((res) => {
|
console.log('userListNoPageByTenantId',res.data)
|
userList.value = res.data
|
})
|
}
|
|
|
onMounted(() => {
|
let _goods = JSON.parse(props.goods)
|
console.log('_goods',_goods)
|
goods.value = {..._goods}
|
initContacts()
|
})
|
</script>
|
<style lang="scss" scoped>
|
.box {
|
background-color: #fff;
|
box-sizing: border-box;
|
padding: 20rpx;
|
min-height: 80rpx;
|
padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
|
}
|
|
.form-box {
|
box-sizing: border-box;
|
margin-bottom: 20rpx;
|
padding: 20rpx;
|
background-color: #f5f5f5;
|
border-radius: 20rpx;
|
}
|
|
.add-img {
|
.img {
|
background-color: #efefef;
|
border-radius: 10rpx;
|
width: 200rpx;
|
height: 200rpx;
|
}
|
}
|
</style>
|