Commit e4199f19 by wusiyi

feat: 库存展示添加币种字段

parent 7fb24716
......@@ -7,15 +7,11 @@
<div
title="打印物流面单"
class="tool-item"
@click="getLogisticDrawer = true;isAutoPrint=false"
@click=";(getLogisticDrawer = true), (isAutoPrint = false)"
>
<img src="../assets/images/printer.png" width="24" height="24" />
</div>
<div
title="生产单查询"
class="tool-item"
@click="searchVisible = true"
>
<div title="生产单查询" class="tool-item" @click="searchVisible = true">
<img src="../assets/images/saoma.png" width="24" height="24" />
</div>
</div>
......@@ -95,7 +91,13 @@
/>
<el-button type="primary" @click="getLogistic">查 询</el-button>
<el-button type="success" @click="printLogistic">打印面单</el-button>
<el-checkbox v-model="isAutoPrint" :disabled="!printDeviceList" style="margin-left: 5px;position: relative;top: 5px" type="success" >自动打印面单</el-checkbox>
<el-checkbox
v-model="isAutoPrint"
:disabled="!printDeviceList"
style="margin-left: 5px; position: relative; top: 5px"
type="success"
>自动打印面单</el-checkbox
>
<div style="font-size: 20px; margin: 20px 0px; color: #666666">
<div style="margin-bottom: 10px; display: flex; gap: 20px">
<div style="width: 400px">店铺单号: {{ tableData.shopNumber }}</div>
......@@ -150,7 +152,7 @@
import SearchProductOrder from './searchProdOrder.vue'
import { ref, watch, computed } from 'vue'
import { ElMessage } from 'element-plus'
import {print} from './print.ts'
import { print } from './print.ts'
import useLodop from '@/utils/hooks/useLodop'
import { getLogisticUSApi, getLogisticCNApi } from '@/api/common'
import { filePath, FileCnPath } from '@/api/axios'
......@@ -372,7 +374,7 @@ const getLogistic = () => {
if (res.code === 200) {
tableData.value = res.data
productCount.value = tableData.value.productList?.length || 0
if(isAutoPrint.value) printLogistic()
if (isAutoPrint.value) printLogistic()
// window.open(filePath + tableData.value.expressSheet, '_blank')
}
})
......@@ -382,7 +384,7 @@ const getLogistic = () => {
if (res.code === 200) {
tableData.value = res.data
productCount.value = tableData.value.productList?.length || 0
if(isAutoPrint.value) printLogistic()
if (isAutoPrint.value) printLogistic()
// window.open(FileCnPath + tableData.value.expressSheet, '_blank')
}
})
......@@ -397,13 +399,13 @@ const printLogistic = () => {
ElMessage.warning('请先查询面单')
return
}
if(!sheetPrinter.value){
if (!sheetPrinter.value) {
ElMessage.warning('请选择打印机')
return
}
const path = type.value.startsWith('USPSC')?filePath :FileCnPath
const path = type.value.startsWith('USPSC') ? filePath : FileCnPath
// let path = 'http://10.168.31.142:80/upload/factory'
print(path + tableData.value.expressSheet,sheetPrinter.value)
print(path + tableData.value.expressSheet, sheetPrinter.value)
}
// 监听打印机状态
......
......@@ -109,6 +109,8 @@ export interface InterskuList {
usableInventory?: number | null
warehouseSku?: string
remark?: string | null
currencyName?: string | null
currencyCode?: string | null
}
export interface ILocation {
id?: number
......
......@@ -201,7 +201,15 @@
align="center"
></ElTableColumn>
<ElTableColumn
label="总金额(¥)"
label="币种"
show-overflow-tooltip
width="80"
prop="currencyName"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="总金额"
show-overflow-tooltip
width="120"
prop="totalPrice"
......@@ -300,6 +308,7 @@
align="center"
label="库存SKU"
prop="warehouseSku"
width="180"
/>
<ElTableColumn
......@@ -329,13 +338,20 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价(¥)"
label="币种"
width="80"
prop="currencyName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价"
prop="costPrice"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="总成本(¥)"
label="总成本"
prop="totalPrice"
/>
<ElTableColumn
......@@ -349,12 +365,14 @@
show-overflow-tooltip
align="center"
label="创建时间"
width="130"
prop="createTime"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="更新时间"
width="130"
prop="updateTime"
/>
</ElTable>
......@@ -521,15 +539,21 @@
</template>
</ElTableColumn>
<ElTableColumn
width="80"
align="center"
label="币种"
prop="currencyName"
/>
<ElTableColumn
width="100"
align="center"
label="成本价(¥)"
label="成本价"
prop="costPrice"
/>
<ElTableColumn
align="center"
width="100"
label="总成本(¥)"
label="总成本"
prop="totalPrice"
/>
<ElTableColumn align="center" label="库位" prop="locationCode">
......@@ -621,8 +645,15 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价(¥)"
width="100"
label="币种"
width="80"
prop="currencyName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价"
width="80"
prop="price"
/>
<ElTableColumn
......@@ -632,7 +663,7 @@
prop="locationCode"
/>
<ElTableColumn
width="100"
width="80"
align="center"
header-align="center"
label="操作"
......@@ -1340,7 +1371,20 @@ const skudblclick = (val: InterskuList) => {
locationId = null,
usableInventory = null,
id = null,
currencyName = '',
currencyCode = '',
} = val || {}
// 币种一致性校验
const lastItem =
otherPurchaseData.value[otherPurchaseData.value.length - 1] || null
if (lastItem && lastItem.currencyName) {
if (!currencyName || currencyName !== lastItem.currencyName) {
ElMessage.error(`添加的商品币种需一致`)
return
}
}
otherPurchaseData.value = [
...otherPurchaseData.value,
{
......@@ -1355,6 +1399,8 @@ const skudblclick = (val: InterskuList) => {
totalPrice: null,
usableInventory, //可用库存数量
inventoryId: id,
currencyName,
currencyCode,
},
]
// 使用filter代替forEach+splice,时间复杂度从O(n^2)降到O(n)
......
......@@ -213,7 +213,15 @@
align="center"
></ElTableColumn>
<ElTableColumn
label="总金额(¥)"
label="币种"
show-overflow-tooltip
width="80"
prop="currencyName"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="总金额"
show-overflow-tooltip
width="120"
prop="totalPrice"
......@@ -311,6 +319,7 @@
show-overflow-tooltip
align="center"
label="库存SKU"
width="180"
prop="warehouseSku"
/>
......@@ -329,6 +338,7 @@
<ElTableColumn
show-overflow-tooltip
align="center"
width="90"
label="入库数量"
prop="buyStored"
/>
......@@ -341,13 +351,20 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价(¥)"
label="币种"
width="80"
prop="currencyName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价"
prop="costPrice"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="总成本(¥)"
label="总成本"
prop="totalPrice"
/>
<ElTableColumn
......@@ -361,12 +378,14 @@
show-overflow-tooltip
align="center"
label="创建时间"
width="130"
prop="createTime"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="更新时间"
width="130"
prop="updateTime"
/>
</ElTable>
......@@ -538,15 +557,21 @@
</template>
</ElTableColumn>
<ElTableColumn
align="center"
width="80"
label="币种"
prop="currencyName"
/>
<ElTableColumn
width="100"
align="center"
label="成本价(¥)"
label="成本价"
prop="costPrice"
/>
<ElTableColumn
align="center"
width="100"
label="总成本(¥)"
label="总成本"
prop="totalPrice"
/>
<ElTableColumn align="center" label="库位" prop="locationCode">
......@@ -637,8 +662,15 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价(¥)"
width="100"
label="币种"
width="80"
prop="currencyName"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价"
width="80"
prop="factoryPrice"
/>
<ElTableColumn
......@@ -648,7 +680,7 @@
prop="locationCode"
/>
<ElTableColumn
width="100"
width="80"
align="center"
header-align="center"
label="操作"
......@@ -1309,7 +1341,19 @@ const skudblclick = (val: InterskuList) => {
skuName = '',
image = '',
locationId = null,
currencyName = '',
currencyCode = null,
} = val || {}
// 币种一致性校验
const lastItem =
otherPurchaseData.value[otherPurchaseData.value.length - 1] || null
if (lastItem && lastItem.currencyName) {
if (!currencyName || currencyName !== lastItem.currencyName) {
ElMessage.error(`添加的商品币种需一致`)
return
}
}
otherPurchaseData.value = [
...otherPurchaseData.value,
{
......@@ -1322,8 +1366,11 @@ const skudblclick = (val: InterskuList) => {
costPrice: factoryPrice,
buyStored: null,
totalPrice: null,
currencyName,
currencyCode,
},
]
// 使用filter代替forEach+splice,时间复杂度从O(n^2)降到O(n)
const skuSet = new Set(
otherPurchaseData.value.map((item: InterProductList) => item.warehouseSku),
......
......@@ -545,18 +545,24 @@ getWarehouse()
align="center"
prop="productNo"
label="款号"
width="180"
width="140"
></el-table-column>
<el-table-column
align="center"
prop="unit"
label="单位"
width="60"
></el-table-column>
<el-table-column
align="center"
prop="currencyName"
label="币种"
width="80"
></el-table-column>
<el-table-column
align="center"
prop="price"
label="商品成本价($)"
label="商品成本价"
width="140"
></el-table-column>
<el-table-column
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment