Commit 8f57c541 by linjinhong Committed by qinjianhui

feat:【工厂端】工厂端-供应模块新增供应商管理#1001007

parent b1a594c3
......@@ -249,6 +249,7 @@ interface IOption {
[key: string]: unknown
}
//表单
const formConfig = computed<IFormConfig[]>(() => [
{
prop: 'supplierName',
......@@ -346,9 +347,9 @@ const formConfig = computed<IFormConfig[]>(() => [
style={{ width: '200px' }}
></el-input>
<el-popover
placement="right"
placement="bottom"
trigger="click"
width="1050"
width="750"
disabled={isShowSearch.value}
v-slots={{
reference: () => (
......@@ -366,7 +367,7 @@ const formConfig = computed<IFormConfig[]>(() => [
isShowCheckBox={false}
modelValue={goodsTableData.value}
config={searchTableConfig.value}
{...{ height: '600px', align: 'center', border: true }}
{...{ height: '400px', align: 'center', border: true }}
style={{ marginBottom: '20px' }}
></CustomizeTable>
</el-popover>
......@@ -390,6 +391,7 @@ const formConfig = computed<IFormConfig[]>(() => [
},
])
//列表表格
const tableConfig = ref<TableColumn[]>([
{
prop: 'supplierName',
......@@ -437,6 +439,8 @@ const tableConfig = ref<TableColumn[]>([
},
},
])
//表单表格
const formTableConfig = ref<TableColumn[]>([
{
prop: 'productName',
......@@ -493,6 +497,7 @@ const formTableConfig = ref<TableColumn[]>([
},
])
//查询商品表格
const searchTableConfig = ref<TableColumn[]>([
{
prop: 'name',
......@@ -543,6 +548,7 @@ const searchTableConfig = ref<TableColumn[]>([
},
])
//管理供应价格表格
const priceTableConfig = ref<TableColumn[]>([
{
prop: 'productItemImage',
......@@ -610,6 +616,7 @@ function cancelPiceFn() {
priceDialogVisible.value = false
}
//保存供应价格
function savePiceFn() {
if (!currentGoods.value.currencyCode) {
return ElMessage({
......@@ -789,6 +796,7 @@ async function showDialog() {
supplierTableData.value = []
supplierSeletctions.value = []
}
/**
* @description: 编辑供应商
*/
......@@ -830,6 +838,7 @@ async function editSupplier(id: string | number) {
}
}
//查询spu
const goodsLoading = ref(false)
const isShowSearch = ref(false)
const supplierSeletctions = ref<IgoodsType[]>([])
......@@ -855,6 +864,7 @@ async function searchSupplyGoodsFn() {
}
}
//删除商品
function deleteSupplyGoodsFn() {
if (!supplierSeletctions.value.length) {
return ElMessage.warning(`请勾选商品`)
......@@ -864,6 +874,7 @@ function deleteSupplyGoodsFn() {
(el) => !deleteIds.includes(el.productSpu),
)
}
function getSupplierItem(v: IgoodsType[]) {
supplierSeletctions.value = v
}
......@@ -876,6 +887,7 @@ const sizeList = ref<IsizeType[]>([])
const showSizeList = ref<IsizeType[]>([])
const currentGoods = ref()
//管理供应价格按钮
async function addPice(product: IgoodsType) {
supplierPirce.value = ''
colorIndex.value = null
......@@ -958,8 +970,8 @@ function filterPropertyList<T extends { id?: number | string }>(
})
}
//新增商品
function addGoods(data: IgoodsType) {
// 使用 Set 进行快速查找(性能更好)
data.productImage = data.productImage || data.imgUrl || ''
data.productSpu = data.productSpu || data.sku || ''
data.productName = data.productName || data.name || ''
......@@ -980,9 +992,9 @@ function addGoods(data: IgoodsType) {
const selectPirceList = ref<Iprice[]>([])
const supplierPirce = ref('')
function selectPirce(value: never[]) {
console.log(351, value)
selectPirceList.value = value
}
//批量供应价格
function updatePrices() {
if (!supplierPirce.value) {
ElMessage.warning(`请输入供应价格`)
......@@ -997,14 +1009,12 @@ function updatePrices() {
}
}
//获取颜色和尺寸
const colorIndex = ref()
const sizeIndex = ref()
const tableRef = ref()
const optionSelection = (row: IcolorType, type: 'color' | 'size') => {
// 更新选中索引
updateSelectionIndex(row, type)
// 更新表格选中状态
updateTableSelection()
}
......@@ -1050,7 +1060,7 @@ const getRowsToSelect = () => {
return false
})
}
//获取供应价格区间
function getSupplyPrice(row: IgoodsType) {
let range = ''
const arr = row.supplierPriceItemList
......@@ -1084,20 +1094,6 @@ function getSupplyPrice(row: IgoodsType) {
row.supplyPriceRange = range as string
return range
}
watch(
() => currentGoods.value,
(value) => {
console.log(946, value)
},
{ deep: true },
)
onMounted(() => {
getAllList()
})
async function getAllList() {}
</script>
<style lang="scss" scoped>
......
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