<template>
|
<view style="margin-bottom: 2rem;">
|
<uni-section
|
title="发货单出库"
|
padding="0 0 5px 10px">
|
|
<template v-slot:right>
|
<button @click="warehouseOut" type="primary" size='mini'>出库</button>
|
</template>
|
</uni-section>
|
</view>
|
|
<view>
|
<uni-table ref="table" border stripe type="selection" emptyText="暂无更多数据" @selection-change="selectionChange">
|
<uni-tr>
|
<uni-th align="center">发货数量</uni-th>
|
<uni-th align="center">库存数量</uni-th>
|
<uni-th align="center">宽*高</uni-th>
|
<!-- <uni-th align="center" width='150'>产品名称</uni-th> -->
|
<uni-th align="center">发货单号</uni-th>
|
<uni-th align="center">发货序号</uni-th>
|
<uni-th align="center">订单号</uni-th>
|
|
<uni-th align="center">客户名称</uni-th>
|
<uni-th align="center">项目名称</uni-th>
|
<uni-th align="center">发货日期</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
<uni-td align="center">{{ item.deliveryDetail.quantity }}</uni-td>
|
<uni-td align="center">{{ item.warehouseNum }}</uni-td>
|
<uni-td align="center">{{ item.width }}*{{ item.height }}</uni-td>
|
|
<!-- <uni-td align="center">{{ item.productName }}</uni-td> -->
|
<uni-td align="center">{{ item.deliveryDetail.deliveryId }}</uni-td>
|
<uni-td align="center">{{ item.deliveryDetail.orderNumber }}</uni-td>
|
|
<uni-td align="center">{{ item.deliveryDetail.orderId }}</uni-td>
|
<uni-td align="center">{{ item.delivery.customerName }}</uni-td>
|
<uni-td align="center">{{ item.order.project }}</uni-td>
|
<uni-td align="center">{{ item.deliveryDetail.createTime }}</uni-td>
|
</uni-tr>
|
</uni-table>
|
</view>
|
<view>
|
<!-- 提示信息弹窗 -->
|
<uni-popup ref="message" type="message">
|
<uni-popup-message :type="msgType" :message="messageText" :duration="3000"></uni-popup-message>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script setup>
|
import { onMounted, ref } from 'vue';
|
import { onLoad } from '@dcloudio/uni-app'
|
import request from '../../utils/request'
|
import userInfo from '@/stores/userInfo'
|
import { debounce } from 'lodash'
|
const user=userInfo()
|
const tableData = ref([])
|
const checkList = ref([])
|
const table = ref(null)
|
const message = ref(null)
|
const msgType=ref('success')
|
const messageText=ref('')
|
|
|
onLoad(()=>{
|
getSelectDeliveryDetailList()
|
})
|
|
|
const selectionChange = (e) => {
|
checkList.value = e.detail.index
|
}
|
|
const getSelectDeliveryDetailList = () => {
|
request.post(`/app/getSelectDeliveryDetailList`).then(res => {
|
tableData.value = res.data.data
|
})
|
}
|
|
|
//出库方法
|
const warehouseOut = debounce(() => {
|
if(checkList.value.length === 0){
|
messageToggle('warn',"未选择出库数据")
|
}
|
checkList.value.sort()
|
const arr = []
|
checkList.value.forEach(item => {
|
arr.push(tableData.value[item])
|
})
|
const para = {
|
userId:user.user.userId,
|
userName: user.user.userName,
|
orderDetail:arr
|
}
|
|
request.post(`/app/addDeliveryDetail`,para).then(res => {
|
messageToggle('success',"出库成功")
|
table.value.clearSelection()
|
getSelectDeliveryDetailList()
|
})
|
},200)
|
|
const messageToggle = (type,msg) => {
|
msgType.value = type
|
messageText.value = msg
|
message.value.open()
|
}
|
|
</script>
|
|
<style>
|
|
|
</style>
|