Commit 8f57c541 by linjinhong Committed by qinjianhui

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

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