| src/api/inventoryManagement/dispatchLog.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/api/inventoryManagement/receiptManagement.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/api/inventoryManagement/stockManagement.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/config.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/inventoryManagement/dispatchLog/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/inventoryManagement/receiptManagement/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/inventoryManagement/stockManagement/edit.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/inventoryManagement/stockManagement/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | 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>