diff --git a/package.json b/package.json index 24a9244..386dde4 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "path-to-regexp": "^6.2.0", "pinia": "^2.0.9", "screenfull": "^6.0.0", + "sortablejs": "^1.14.0", "vue": "^3.2.16", "vue-router": "^4.0.12" }, diff --git a/src/views/pms/category/components/Attribute.vue b/src/views/pms/category/components/Attribute.vue index 978fa9f..9862f62 100644 --- a/src/views/pms/category/components/Attribute.vue +++ b/src/views/pms/category/components/Attribute.vue @@ -58,7 +58,6 @@ import {listAttributes, saveAttributeBatch} from "@/api/pms/attribute"; import {computed, reactive, toRefs, watch} from "vue"; import {Plus, Check, Delete} from '@element-plus/icons' import {ElMessage} from "element-plus"; -import {listRoleMenuIds} from "@api/system/role"; import SvgIcon from '@/components/SvgIcon/index.vue'; const props = defineProps({ diff --git a/src/views/pms/goods/components/GoodsAttribute.vue b/src/views/pms/goods/components/GoodsAttribute.vue index fab9803..c405d9f 100644 --- a/src/views/pms/goods/components/GoodsAttribute.vue +++ b/src/views/pms/goods/components/GoodsAttribute.vue @@ -1,32 +1,37 @@ - diff --git a/src/views/pms/goods/components/GoodsCategory.vue b/src/views/pms/goods/components/GoodsCategory.vue index a6a0665..6eb427e 100644 --- a/src/views/pms/goods/components/GoodsCategory.vue +++ b/src/views/pms/goods/components/GoodsCategory.vue @@ -4,7 +4,7 @@ { state.categoryOptions = response.data if (props.modelValue.id) { - state.categoryId = props.modelValue.categoryId nextTick(() => { handleCategoryChange() }) @@ -66,7 +64,8 @@ function handleCategoryChange() { } function handleNext() { - if (!state.categoryId) { + console.log('商品属性',props.modelValue.categoryId) + if (!props.modelValue.categoryId) { ElMessage.warning('请选择商品分类') return false } diff --git a/src/views/pms/goods/components/GoodsStock.vue b/src/views/pms/goods/components/GoodsStock.vue index b339f99..9744d82 100644 --- a/src/views/pms/goods/components/GoodsStock.vue +++ b/src/views/pms/goods/components/GoodsStock.vue @@ -1,24 +1,25 @@ - diff --git a/src/views/pms/goods/detail.vue b/src/views/pms/goods/detail.vue index ed164dd..863403a 100644 --- a/src/views/pms/goods/detail.vue +++ b/src/views/pms/goods/detail.vue @@ -78,6 +78,7 @@ export default { methods: { loadData() { const goodsId = this.$route.query.goodsId + console.log('goodsId',goodsId) if (goodsId) { getGoodsDetail(goodsId).then(response => { this.goods = response.data diff --git a/src/views/pms/goods/index.vue b/src/views/pms/goods/index.vue index 8b55759..f369304 100644 --- a/src/views/pms/goods/index.vue +++ b/src/views/pms/goods/index.vue @@ -30,7 +30,7 @@ @@ -121,12 +121,16 @@ import {Search, Plus, Edit, Refresh, Delete} from '@element-plus/icons' import {listGoodsWithPage, deleteGoods} from '@/api/pms/goods' import {listCascadeCategories} from '@/api/pms/category' -import {reactive, ref, onMounted, toRefs} from 'vue' -import {ElMessage, ElMessageBox, ElTree} from 'element-plus' +import {reactive, ref, onMounted, toRefs, unref} from 'vue' +import {ElTable, ElMessage, ElMessageBox, ElTree} from 'element-plus' import {getCurrentInstance} from 'vue' import {moneyFormatter} from '@/utils/filter' -const {proxy}: any = getCurrentInstance(); +const dataTableRef = ref(ElTable) + +import {useRouter} from "vue-router" + +const router=useRouter() const state = reactive({ // 遮罩层 @@ -185,18 +189,17 @@ function resetQuery() { handleQuery() } - function handleGoodsView(detail: any) { state.goodDetail = detail state.dialogVisible = true } function handleAdd() { - proxy.$router.push({path: 'goods-detail'}) + router.push({path: 'goods-detail'}) } function handleUpdate(row: any) { - proxy.$router.push({path: 'goods-detail', query: {goodsId: row.id,categoryId:row.categoryId}}) + router.push({path: 'goods-detail', query: {goodsId: row.id, categoryId: row.categoryId}}) } function handleDelete(row: any) { @@ -214,7 +217,7 @@ function handleDelete(row: any) { } function handleRowClick(row: any) { - proxy.$refs.multipleTable.toggleRowSelection(row); + dataTableRef.value.toggleRowSelection(row); } function handleSelectionChange(selection: any) { diff --git a/tsconfig.json b/tsconfig.json index 2b92a7f..f13f374 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,10 +11,8 @@ "esModuleInterop": true, "lib": ["esnext", "dom"], - /* Vite 路径别名报错 */ "baseUrl": "./", "paths": { - "@": ["src"], "@*": ["src/*"], }, "extends": "./tsconfig.extends.json",