周宾
13 小时以前 b54a94b098a5a0a3375bab0d6493bacf45dd0a58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<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>