周宾
97 分钟以前 81dbb5d80f59a434702ea9264c66a93411430325
天津双奇点-仓储物流开发
已添加5个文件
已修改5个文件
670 ■■■■■ 文件已修改
src/api/inventoryManagement/dispatchLog.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/receiptManagement.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/stockManagement.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages.json 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inventoryManagement/dispatchLog/index.vue 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inventoryManagement/receiptManagement/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inventoryManagement/stockManagement/edit.vue 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inventoryManagement/stockManagement/index.vue 221 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inventoryManagement/dispatchLog.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
// å·¡æ£€ä¸Šä¼ 
import request from '@/utils/request'
// é‡‡è´­å‡ºåº“台账列表
export function listPage(query) {
    return request({
        url: '/stockmanagement/listPage',
        method: 'get',
        params: query
    })
}
//自定义出库台账列表
export function listPageByCustom(query) {
    return request({
        url: '/stockmanagement/listPageByCustom',
        method: 'get',
        params: query
    })
}
//删除
export function stockmanagementDel(query) {
  return request({
    url: '/stockmanagement/del',
    method: 'post',
    data: query
  })
}
src/api/inventoryManagement/receiptManagement.js
@@ -26,3 +26,12 @@
    data: query
  })
}
// åˆ é™¤è‡ªå®šä¹‰å…¥åº“
 export function deleteCustom(query) {
  return request({
    url: '/stockin/deleteCustom',
    method: 'delete',
    data: query
  })
}
src/api/inventoryManagement/stockManagement.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
// å·¡æ£€ä¸Šä¼ 
import request from '@/utils/request'
// é‡‡è´­å…¥åº“列表
export function listPage(query) {
    return request({
        url: '/stockin/listPageCopy',
        method: 'get',
        params: query
    })
}
//自定义入库列表
export function listPageByCustom(query) {
    return request({
        url: '/stockin/listPageCopyByCustom',
        method: 'get',
        params: query
    })
}
//修改自定义入库库存
export function updateManagementByCustom(query) {
  return request({
    url: '/stockin/updateManagementByCustom',
    method: 'post',
    data: query
  })
}
src/config.js
@@ -2,7 +2,7 @@
const config = {
  //  baseUrl: 'https://vue.ruoyi.vip/prod-api',
  // baseUrl: 'http://localhost/prod-api',
    baseUrl: 'http://192.168.1.211:8888', // å¤©æ´¥åŒå¥‡ç‚¹
    baseUrl: 'http://192.168.1.147:7003', // å¤©æ´¥åŒå¥‡ç‚¹
  // baseUrl: 'http://114.132.189.42:9066', // å®å¤æ¶¦æ³°
  // baseUrl: 'http://114.132.189.42:9068', // æ–°ç–†æµ·å·å¼€å¿ƒ
  // baseUrl: 'http://192.168.1.147:9036',
src/pages.json
@@ -645,6 +645,31 @@
                        "navigationBarTitleText": "自定义出库",
            "navigationStyle": "custom"
                    }
                },
        {
                    "path": "dispatchLog/index",
                    "style": {
                        "navigationBarTitleText": "出库台账",
            "navigationStyle": "custom",
            "enablePullDownRefresh": true,
            "backgroundColor": "#f8f8f8"
                    }
                },
        {
                    "path": "stockManagement/index",
                    "style": {
                        "navigationBarTitleText": "库存管理",
            "navigationStyle": "custom",
            "enablePullDownRefresh": true,
            "backgroundColor": "#f8f8f8"
                    }
                },
        {
                    "path": "stockManagement/edit",
                    "style": {
                        "navigationBarTitleText": "修改库存",
            "navigationStyle": "custom"
                    }
                }
            ]
        }
src/pages/index.vue
@@ -11,7 +11,7 @@
        <view class="hero-section">
            <view class="bg-img">
                <view class="hero-content">
                    <text class="hero-title">润泰生物科技</text>
                    <text class="hero-title">双奇点</text>
                </view>
                <view class="hero-wave"></view>
            </view>
@@ -548,6 +548,16 @@
                url: '/pages/inventoryManagement/issueManagement/index'
            });
            break
        case '出库台账':
            uni.navigateTo({
                url: '/pages/inventoryManagement/dispatchLog/index'
            });
            break
        case '库存管理':
            uni.navigateTo({
                url: '/pages/inventoryManagement/stockManagement/index'
            });
            break
        default:
            uni.showToast({
                title: `点击了${item.label}`,
src/pages/inventoryManagement/dispatchLog/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,226 @@
<template>
    <view>
        <PageHeader title="出库台账" @back="goBack" />
        <view class="tabs">
            <uni-segmented-control :current="tabCurrent" :values="tabItems" @clickItem="switchTab" />
        </view>
        <!-- <button class="mini-btn" type="primary" size="mini" style="margin-left: 0;margin-right: 0;" @click="openForm({},'add')">新增入库</button> -->
        <view v-if="contentList?.length !== 0" class="content">
            <view v-if="tabCurrent === 0">
                <block v-for="item in contentList" :key="item.id">
                    <view class="item-box item-box0"></view>
                </block>
                <uni-load-more :status="loadMoreStatus"></uni-load-more>
            </view>
            <view v-if="tabCurrent === 1">
                <block v-for="item in contentList" :key="item.id">
                    <view class="item-box item-box1">
                        <view class="item">
                            <view class="label">产品图片</view>
                            <view class="value">
                                <image class="img" :src="baseUrl + item.url" mode="aspectFill‌" lazy-load></image>
                            </view>
                        </view>
                        <view class="item">
                            <view class="label">出库日期</view>
                            <view class="value">{{ item.createTime }}</view>
                        </view>
                        <view class="item">
                            <view class="label">产品名称</view>
                            <view class="value">{{ item.productCategory }}</view>
                        </view>
                        <view class="item">
                            <view class="label">产品高度</view>
                            <view class="value">{{ item.specificationModel }}{{ item.unit }}</view>
                        </view>
                        <view class="item">
                            <view class="label">出库数量/ä»¶</view>
                            <view class="value">{{ item.inboundNum }}</view>
                        </view>
                        <view class="item">
                            <view class="label">每件数量/支</view>
                            <view class="value">{{ item.boxNum }}</view>
                        </view>
                        <view class="item">
                            <view class="label">单价(元)/支</view>
                            <view class="value">{{ item.taxInclusiveUnitPrice }}</view>
                        </view>
                        <view class="item">
                            <view class="label">纸箱规格</view>
                            <view class="value">{{ item.cartonSpecifications }}cm</view>
                        </view>
                        <view class="item">
                            <view class="label">出库人</view>
                            <view class="value">{{ item.createBy }}</view>
                        </view>
                        <view class="item" style="justify-content: flex-end;">
                            <button class="mini-btn" type="warn" size="mini" style="margin-left: 0;margin-right: 0;" @click="deleteGoods(item)">删除</button>
                        </view>
                    </view>
                </block>
                <uni-load-more :status="loadMoreStatus"></uni-load-more>
            </view>
        </view>
        <view v-if="contentList?.length === 0" class="no-data">
            <text>暂无数据</text>
        </view>
    </view>
</template>
<script setup>
import { ref, reactive, computed } from 'vue'
import { listPage, listPageByCustom,stockmanagementDel } from '@/api/inventoryManagement/dispatchLog.js'
import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import config from '@/config'
const baseUrl = config.baseUrl
// tab相关
const tabItems = reactive(['采购出库', '成品出库'])
const tabCurrent = ref(0)
const switchTab = (e) => {
    if (tabCurrent.value !== e.currentIndex) {
        tabCurrent.value = e.currentIndex
    }
    reloadPage()
}
// è¿”回上一页
const goBack = () => {
    uni.navigateBack()
}
// åˆ†é¡µç›¸å…³
const pageParams = reactive({
    size: 10,
    current: 1
})
const totalSize = ref(0)
const noMore = computed(() => {
    return contentList.value.length >= totalSize.value
})
const loading = ref(false)
const contentList = ref([])
const loadMoreStatus = computed(() => {
    if (loading.value) {
        return 'loading'
    }
    if (noMore.value) {
        return 'noMore'
    }
    return 'more'
})
const loadPage = () => {
    if (noMore.value || loading.value) {
        return
    }
    pageParams.current += 1
    getList()
}
const reloadPage = () => {
    pageParams.current = 1
    contentList.value = []
    getList()
}
const deleteGoods = async (goods) => {
    uni.showModal({
        title: '提示',
        content: '确定要删除该商品的出库台账吗?',
        success: function (res) {
            if (res.confirm) {
                uni.showLoading({
                    title: '删除中...'
                })
                let params = [goods.id]
                stockmanagementDel(params).then(res => {
                    uni.hideLoading()
                    reloadPage()
                })
            }
        }
    })
}
const getList = async () => {
    let getListApi = null
    if (tabCurrent.value == 1) {
        getListApi = listPageByCustom
    } else if (tabCurrent.value == 0) {
        getListApi = listPage
    }
    loading.value = true
    let resp = await getListApi(pageParams)
    loading.value = false
    if (resp.code != 200 || !resp.data) {
        contentList.value = []
        totalSize.value = 0
        return
    }
    contentList.value = [...contentList.value, ...resp.data.records]
    console.log(resp.data.records)
    totalSize.value = resp.data.total
}
onReachBottom(() => {
    loadPage()
})
onPullDownRefresh(() => {
    reloadPage()
    uni.stopPullDownRefresh()
})
onShow(() => {
    reloadPage()
})
</script>
<style lang='scss' scoped>
.tabs {
    box-sizing: border-box;
    padding: 20rpx 40rpx;
}
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}
.item-box{
    box-sizing: border-box;
    margin: 20rpx;
    padding: 20rpx;
    border-radius: 10rpx;
    background-color: #f5f5f5;
}
.item {
    display: flex;
    justify-content: space-between;
    margin: 10rpx 0;
    .label {}
    .value {
        .img {
            width: 200rpx;
            height: 200rpx;
            background-color: #999;
            border-radius: 10rpx;
        }
    }
}
// æµ®åŠ¨æŒ‰é’®æ ·å¼
.fab-button {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom));
    right: 30px;
    width: 56px;
    height: 56px;
    background: #2979ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(41, 121, 255, 0.3);
    z-index: 1000;
}
</style>
src/pages/inventoryManagement/receiptManagement/index.vue
@@ -54,6 +54,7 @@
                            <view class="value">{{ item.createBy }}</view>
                        </view>
                        <view class="item" style="justify-content: flex-end;">
                            <button class="mini-btn" type="warn" size="mini" style="margin-left: 0;margin-right: 20rpx;" @click="deleteGoods(item)">删除</button>
                            <button class="mini-btn" type="primary" size="mini" style="margin-left: 0;margin-right: 0;" @click="openForm(item,'edit')">编辑</button>
                        </view>
                    </view>
@@ -72,7 +73,7 @@
<script setup>
import { ref, reactive, computed } from 'vue'
import { listPage, listPageByCustom } from '@/api/inventoryManagement/receiptManagement.js'
import { listPage, listPageByCustom,deleteCustom } from '@/api/inventoryManagement/receiptManagement.js'
import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import config from '@/config'
const baseUrl = config.baseUrl
@@ -131,6 +132,24 @@
    contentList.value = []
    getList()
}
const deleteGoods = async (goods) => {
    uni.showModal({
        title: '提示',
        content: '确定要删除该商品的入库吗?',
        success: function (res) {
            if (res.confirm) {
                uni.showLoading({
                    title: '删除中...'
                })
                let params = [goods.id]
                deleteCustom(params).then(res => {
                    uni.hideLoading()
                    reloadPage()
                })
            }
        }
    })
}
const getList = async () => {
    let getListApi = null
    if (tabCurrent.value == 1) {
src/pages/inventoryManagement/stockManagement/edit.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,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>
src/pages/inventoryManagement/stockManagement/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,221 @@
<template>
    <view>
        <PageHeader title="库存管理" @back="goBack" />
        <view class="tabs">
            <uni-segmented-control :current="tabCurrent" :values="tabItems" @clickItem="switchTab" />
        </view>
        <view v-if="contentList?.length !== 0" class="content">
            <view v-if="tabCurrent === 0">
                <block v-for="item in contentList" :key="item.id">
                    <view class="item-box item-box0"></view>
                </block>
                <uni-load-more :status="loadMoreStatus"></uni-load-more>
            </view>
            <view v-if="tabCurrent === 1">
                <block v-for="item in contentList" :key="item.id">
                    <view class="item-box item-box1">
                        <view class="item">
                            <view class="label">产品图片</view>
                            <view class="value">
                                <image class="img" :src="baseUrl + item.url" mode="aspectFill‌" lazy-load></image>
                            </view>
                        </view>
                        <view class="item">
                            <view class="label">入库时间</view>
                            <view class="value">{{ item.inboundDate }}</view>
                        </view>
                        <view class="item">
                            <view class="label">产品名称</view>
                            <view class="value">{{ item.productCategory }}</view>
                        </view>
                        <view class="item">
                            <view class="label">产品高度</view>
                            <view class="value">{{ item.specificationModel }}{{ item.unit }}</view>
                        </view>
                        <view class="item">
                            <view class="label">入库数量/ä»¶</view>
                            <view class="value">{{ item.inboundNum }}</view>
                        </view>
                        <view class="item">
                            <view class="label">库存数量/ä»¶</view>
                            <view class="value">{{ item.inboundNum0 }}</view>
                        </view>
                        <view class="item">
                            <view class="label">每件数量/支</view>
                            <view class="value">{{ item.boxNum }}</view>
                        </view>
                        <view class="item">
                            <view class="label">单价(元)/支</view>
                            <view class="value">{{ item.taxInclusiveUnitPrice }}</view>
                        </view>
                        <view class="item">
                            <view class="label">纸箱规格</view>
                            <view class="value">{{ item.cartonSpecifications }}cm</view>
                        </view>
                        <view class="item">
                            <view class="label">入库人</view>
                            <view class="value">{{ item.createBy }}</view>
                        </view>
                        <view class="item" style="justify-content: flex-end;">
                            <button class="mini-btn" type="primary" size="mini" style="margin-left: 0;margin-right: 0;"
                                @click="openForm(item, 'edit')">编辑</button>
                        </view>
                    </view>
                </block>
                <uni-load-more :status="loadMoreStatus"></uni-load-more>
            </view>
        </view>
        <view v-if="contentList?.length === 0" class="no-data">
            <text>暂无数据</text>
        </view>
    </view>
</template>
<script setup>
import { ref, reactive, computed } from 'vue'
import { listPage, listPageByCustom } from '@/api/inventoryManagement/stockManagement.js'
import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import config from '@/config'
const baseUrl = config.baseUrl
// tab相关
const tabItems = reactive(['采购库存', '成品库存'])
const tabCurrent = ref(0)
const switchTab = (e) => {
    if (tabCurrent.value !== e.currentIndex) {
        tabCurrent.value = e.currentIndex
    }
    reloadPage()
}
// è¿”回上一页
const goBack = () => {
    uni.navigateBack()
}
// æ‰“开编辑/新增
const openForm = (goods, type) => {
    uni.navigateTo({
        url: '/pages/inventoryManagement/stockManagement/edit?goods=' + JSON.stringify(goods)
    })
}
// åˆ†é¡µç›¸å…³
const pageParams = reactive({
    size: 10,
    current: 1
})
const totalSize = ref(0)
const noMore = computed(() => {
    return contentList.value.length >= totalSize.value
})
const loading = ref(false)
const contentList = ref([])
const loadMoreStatus = computed(() => {
    if (loading.value) {
        return 'loading'
    }
    if (noMore.value) {
        return 'noMore'
    }
    return 'more'
})
const loadPage = () => {
    if (noMore.value || loading.value) {
        return
    }
    pageParams.current += 1
    getList()
}
const reloadPage = () => {
    pageParams.current = 1
    contentList.value = []
    getList()
}
const getList = async () => {
    let getListApi = null
    if (tabCurrent.value == 1) {
        getListApi = listPageByCustom
    } else if (tabCurrent.value == 0) {
        getListApi = listPage
    }
    loading.value = true
    let resp = await getListApi(pageParams)
    loading.value = false
    if (resp.code != 200 || !resp.data) {
        contentList.value = []
        totalSize.value = 0
        return
    }
    contentList.value = [...contentList.value, ...resp.data.records]
    console.log(resp.data.records)
    totalSize.value = resp.data.total
}
onReachBottom(() => {
    loadPage()
})
onPullDownRefresh(() => {
    reloadPage()
    uni.stopPullDownRefresh()
})
onShow(() => {
    reloadPage()
})
</script>
<style lang='scss' scoped>
.tabs {
    box-sizing: border-box;
    padding: 20rpx 40rpx;
}
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}
.item-box {
    box-sizing: border-box;
    margin: 20rpx;
    padding: 20rpx;
    border-radius: 10rpx;
    background-color: #f5f5f5;
}
.item {
    display: flex;
    justify-content: space-between;
    margin: 10rpx 0;
    .label {}
    .value {
        .img {
            width: 200rpx;
            height: 200rpx;
            background-color: #999;
            border-radius: 10rpx;
        }
    }
}
// æµ®åŠ¨æŒ‰é’®æ ·å¼
.fab-button {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom));
    right: 30px;
    width: 56px;
    height: 56px;
    background: #2979ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(41, 121, 255, 0.3);
    z-index: 1000;
}
</style>