代码优化
This commit is contained in:
@@ -112,7 +112,6 @@
|
||||
<script setup>
|
||||
import { reactive, ref, watch, onMounted, computed } from 'vue';
|
||||
|
||||
import { $invoicingType } from '@/commons/goodsData.js'
|
||||
import { productStockFlow } from '@/http/api/product.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
const refForm = ref(null)
|
||||
@@ -173,22 +172,18 @@
|
||||
getProductStockDetail()
|
||||
}
|
||||
})
|
||||
let getTypeName = (type) => {
|
||||
let item = $invoicingType.filter(item=> item.value == type)[0]
|
||||
return item?item.text:''
|
||||
}
|
||||
|
||||
async function getProductStockDetail(){
|
||||
const { records }=await productStockFlow({
|
||||
page: 1,
|
||||
size: 2,
|
||||
productId: props.goods.id,
|
||||
})
|
||||
console.log(records);
|
||||
recoders.list = records.map(v=>{
|
||||
return {
|
||||
...v,
|
||||
title: v.createTime,
|
||||
content: getTypeName(v.inOutItem)+':'+Math.abs(v.inOutNumber)
|
||||
content: uni.$dict.getDiceName(v.inOutItem,'invoicingType')+':'+Math.abs(v.inOutNumber)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user