代码优化

This commit is contained in:
GaoHao
2025-03-26 13:34:19 +08:00
parent e928fdfa2a
commit 413222a5f0
42 changed files with 166 additions and 531 deletions

View File

@@ -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)
}
})
}