代码优化
This commit is contained in:
@@ -85,7 +85,6 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, reactive, ref, watch, onMounted } from 'vue';
|
||||
import { returnSkuSnap, returnTypeEnum, returnCategory } from '@/pageProduct/util.js'
|
||||
import { formatPrice } from "@/commons/utils/format.js";
|
||||
|
||||
const emits = defineEmits(['update:show', 'save'])
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<text class="u-m-l-20">{{data.sort}}</text>
|
||||
</view>
|
||||
<view class="color-333 u-m-l-42 u-flex">
|
||||
<up-icon @click="editStock" name="edit-pen" :size="16" :color="ColorMain"></up-icon>
|
||||
<up-icon @click="editStock" name="edit-pen" :size="16" :color="$utils.ColorMain"></up-icon>
|
||||
<text class="stock u-m-l-4">库存:{{data.stockNumber}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -21,7 +21,7 @@
|
||||
<view class="u-m-t-48 u-flex u-col-top u-relative">
|
||||
<view v-if="props.showChecked">
|
||||
<label class="radio">
|
||||
<radio :color="ColorMain" style="transform: scale(0.7);" @click="radioClick"
|
||||
<radio :color="$utils.ColorMain" style="transform: scale(0.7);" @click="radioClick"
|
||||
:checked="props.data.checked" /><text></text>
|
||||
</label>
|
||||
</view>
|
||||
@@ -102,7 +102,7 @@
|
||||
import { updateProduct,productOnOff,productMarkIsSoldOut } from '@/http/api/product.js'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js';
|
||||
import { ColorMain } from '@/commons/color.js'
|
||||
|
||||
const emits = defineEmits(['radioClick', 'xiajia', 'del', 'changePrice', 'baosun', 'guigeClick','update',
|
||||
'editStock'
|
||||
])
|
||||
|
||||
@@ -203,7 +203,6 @@
|
||||
size: 200
|
||||
}).then(res => {
|
||||
pageData.categoryList = returnAllCategory(res)
|
||||
console.log(pageData.categoryList);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user