diff --git a/src/store/index.js b/src/store/index.js index 51f3e76..bbd8473 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -100,6 +100,7 @@ const store = new Vuex.Store({ if (res.data.status === 1) { commit('setShopList', res.data.shopList) } else { + commit('setShopList', []) Message.error(res.data.msg) } }, @@ -172,6 +173,7 @@ const store = new Vuex.Store({ }) commit('setAdminList', res.data.adminList) } else { + commit('setAdminList', []) Message.error(res.data.msg) } }, @@ -276,6 +278,7 @@ const store = new Vuex.Store({ if (res.data.status === 1) { commit('setAirList', res.data.airList) } else { + commit('setAirList', []) Message.warning(res.data.msg) } return res.data.airList @@ -367,6 +370,7 @@ const store = new Vuex.Store({ if (res.data.status === 1) { commit('setSiteList', res.data.siteList) } else { + commit('setSiteList', []) Message.warning(res.data.msg) } }, @@ -469,6 +473,7 @@ const store = new Vuex.Store({ if (res.data.status === 1) { commit('setRouteList', res.data.routeList) } else { + commit('setRouteList', []) Message.warning(res.data.msg) } return res.data.routeList @@ -551,6 +556,8 @@ const store = new Vuex.Store({ const res = await api.get('getCategoryList', 'Admin') if (res.data.status === 1) { commit('setCategoryList', res.data.categoryList) + } else { + commit('setCategoryList', []) } return res }, @@ -611,7 +618,7 @@ const store = new Vuex.Store({ const params = new URLSearchParams() params.append('delIdArr', form.delIdArr) params.append('shop_id', form.shop_id) - api.post('delCategory', params, 'Admin').then(res => { + api.post('deleteCategory', params, 'Admin').then(res => { if (res.data.status === 1) { Message.success(res.data.msg) dispatch('fetchCategoryList')// 刷新分类列表 @@ -628,6 +635,8 @@ const store = new Vuex.Store({ const res = await api.get('getSpuList', 'Admin') if (res.data.status === 1) { commit('setSpuList', res.data.spuList) + } else { + commit('setSpuList', []) } return res }, @@ -757,6 +766,34 @@ const store = new Vuex.Store({ } return res }, + /** + * @description: 删除spu + * @param {*} 多选id组 + */ + async fetchDelSpu ({ dispatch }, idArr) { + if (idArr.length === 0) { + Message.error('未勾选记录') + } else { + MessageBox.confirm('请谨慎操作 确认删除?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const params = new URLSearchParams() + params.append('idArr', idArr) + api.post('deleteSpu', params, 'Admin').then(res => { + if (res.data.status === 1) { + Message.success(res.data.msg) + dispatch('fetchSpuList')// 刷新列表 + } else { + Message.error(res.data.msg) + } + }) + }).catch(() => { + Message.info('取消操作') + }) + } + }, /** * @description: 获取商品sku列表 * @return {*} 列表 @@ -765,6 +802,8 @@ const store = new Vuex.Store({ const res = await api.get('getSkuList', 'Admin') if (res.data.status === 1) { commit('setSkuList', res.data.skuList) + } else { + commit('setSkuList', []) } return res }, @@ -818,6 +857,34 @@ const store = new Vuex.Store({ } return res }, + /** + * @description: 删除sku + * @param {*} 多选id组 + */ + async fetchDelSku ({ dispatch }, idArr) { + if (idArr.length === 0) { + Message.error('未勾选记录') + } else { + MessageBox.confirm('请谨慎操作 确认删除?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const params = new URLSearchParams() + params.append('idArr', idArr) + api.post('deleteSku', params, 'Admin').then(res => { + if (res.data.status === 1) { + Message.success(res.data.msg) + dispatch('fetchSkuList')// 刷新列表 + } else { + Message.error(res.data.msg) + } + }) + }).catch(() => { + Message.info('取消操作') + }) + } + }, /** * @description: 获取订单列表 ps:待发货及待收货 并且不是退款成功状态 * @return {*} 列表 @@ -826,6 +893,8 @@ const store = new Vuex.Store({ const res = await api.get('getQuestList') if (res.data.status === 1) { commit('setQuestList', res.data.questList) + } else { + commit('setQuestList', []) } return res }, diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index d917c21..8337405 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -29,9 +29,10 @@ .el-upload { width: 100%; - + } } + .el-upload-dragger { width: 178px !important; height: 178px !important; @@ -55,13 +56,18 @@ top: 10px !important; } -.el-drawer__header{ - margin-bottom:15px; +.el-drawer__header { + margin-bottom: 15px; } -.el-tabs__nav .is-top{ +.el-tabs__nav .is-top { cursor: pointer; } -.el-tabs__header{ + +.el-tabs__header { margin-bottom: -16px; +} + +.el-table th.el-table__cell { + background-color: #F2F6FC !important; } \ No newline at end of file diff --git a/src/views/layout/components/main/category/index.vue b/src/views/layout/components/main/category/index.vue index 3b85730..cdd51f0 100644 --- a/src/views/layout/components/main/category/index.vue +++ b/src/views/layout/components/main/category/index.vue @@ -29,10 +29,10 @@ @click="openWin(`${data.name} : 添加子分类`, { id: data.id, path: data.path, bz_1: '' })"> 添加子分类 - + 编辑 - + 删除 @@ -303,4 +303,12 @@ export default { .el-upload__text { line-height: 1.2em !important; } + +.textEditBut { + color: $warning-color !important; +} + +.textDelBut { + color: $danger-color !important; +} diff --git a/src/views/layout/components/main/order/index.vue b/src/views/layout/components/main/order/index.vue new file mode 100644 index 0000000..f608a00 --- /dev/null +++ b/src/views/layout/components/main/order/index.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index 2036e54..d001dbb 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -30,10 +30,10 @@ export default { }, computed: { plane () { - if (!this.$store.state.airList) { - return null + if (this.$store.state.airList.length > 0) { + return this.$store.state.airList.find(plane => plane.id === this.planesId) } - return this.$store.state.airList.find(plane => plane.id === this.planesId) + return null }, position () { if (this.plane) { diff --git a/src/views/layout/components/main/product/sku/index.vue b/src/views/layout/components/main/product/sku/index.vue index a05f7d1..7af5959 100644 --- a/src/views/layout/components/main/product/sku/index.vue +++ b/src/views/layout/components/main/product/sku/index.vue @@ -3,7 +3,7 @@ 添加 - 删除 + 删除 编辑 diff --git a/src/views/layout/components/main/product/spu/index.vue b/src/views/layout/components/main/product/spu/index.vue index 5cf54cd..f608a00 100644 --- a/src/views/layout/components/main/product/spu/index.vue +++ b/src/views/layout/components/main/product/spu/index.vue @@ -3,7 +3,7 @@ 添加 - 删除 + 删除 编辑 @@ -52,7 +52,7 @@ @click="handeleShow(scope.row.id, scope.row.show)">显示 编辑 - 删除 + 删除 @@ -181,10 +181,10 @@ export default { } }, /** - * @description: 删除飞机 + * @description: 删除spu */ - deleteAir (idArr) { - this.$store.dispatch('fetchDelAir', idArr) + deleteSpu (idArr) { + this.$store.dispatch('fetchDelSpu', idArr) }, /** * @description: 排序input失焦 更新数据库的排序