diff --git a/src/api/problem.js b/src/api/problem.js new file mode 100644 index 0000000..4ba3bc0 --- /dev/null +++ b/src/api/problem.js @@ -0,0 +1,63 @@ + +import request from '@/utils/request' + +/** + * 新增 + * @param pram + */ +export function createApi(data) { + return request({ + url: '/admin/problem/save', + method: 'POST', + data + }) +} + +/** + * 更新 + * @param pram + */ +export function updateApi(data) { + return request({ + url: '/admin/problem/update', + method: 'POST', + data + }) +} + +/** + * 详情 + * @param pram + */ +export function detailApi(id) { + return request({ + url: `/admin/problem/info/${id}`, + method: 'GET' + }) +} + +/** + * 删除 + * @param pram + */ +export function deleteApi(params) { + return request({ + url: `/admin/problem/delete`, + method: 'post', + params + }) +} + + +/** + * 列表 + * @param pram + */ +export function listApi(params) { + return request({ + url: '/admin/problem/list', + method: 'GET', + params + }) +} + diff --git a/src/router/modules/store.js b/src/router/modules/store.js index 4c225bd..0aa2319 100644 --- a/src/router/modules/store.js +++ b/src/router/modules/store.js @@ -36,12 +36,12 @@ const storeRouter = { name: 'StoreComment', meta: { title: '商品评论', icon: '' } }, - // { - // path: 'problem', - // component: () => import('@/views/store/problem/index'), - // name: 'Problem', - // meta: { title: '商品常见问题', icon: '' } - // }, + { + path: 'problem/:id?', + component: () => import('@/views/store/problem/index'), + name: 'Problem', + meta: { title: '商品常见问题', icon: '' } + }, { path: 'list/creatProduct/:id?/:isDisabled?', component: () => import('@/views/store/creatStore/index'), diff --git a/src/views/home/add-and-update.vue b/src/views/home/add-and-update.vue index ae77dcf..13a4849 100644 --- a/src/views/home/add-and-update.vue +++ b/src/views/home/add-and-update.vue @@ -188,8 +188,10 @@ export default { api.homeCreateApi(this.dataForm).then(res => { this.$message.success('新增成功'); }); + setTimeout(() => { + this.$emit('refreshDataList') + }, 600) this.visible = false; - this.$emit('refreshDataList'); } }) }, diff --git a/src/views/home/index.vue b/src/views/home/index.vue index bfad371..3ddb6fa 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -211,12 +211,6 @@ export default { this.$refs.addOrUpdate.init(id) }) }, - // 添加/修改 子项 - addOrUpdateItem() { - this.$nextTick(() => { - this.$refs.addOrUpdateItem.init(id) - }) - }, // 删除 deleteHandle(id) { var ids = id ? [id] : this.dataListSelections.map(item => { diff --git a/src/views/store/index.vue b/src/views/store/index.vue index 487c3da..d93856a 100644 --- a/src/views/store/index.vue +++ b/src/views/store/index.vue @@ -134,8 +134,11 @@ 编辑 - 恢复商品 + 恢复商品 {{ tableFrom.type === '5' ? '删除' : '加入回收站' }} + + 常见问题 + @@ -151,6 +154,7 @@ /> + - @@ -201,7 +204,8 @@ import { checkPermi } from "@/utils/permission"; import CreatTemplates from "@/views/systemSetting/logistics/shippingTemplates/creatTemplates.vue"; import edit from "@/components/Category/edit.vue"; import tableHeader from "element-ui/packages/table/src/table-header"; -import {fileImageApi} from "@/api/systemSetting"; // 权限判断函数 +import {fileImageApi} from "@/api/systemSetting"; +import AddOrUpdate from "@/views/home/add-and-update.vue"; // 权限判断函数 export default { name: 'ProductList', computed: { @@ -209,7 +213,7 @@ export default { return tableHeader } }, - components: {edit, CreatTemplates, taoBao, UploadExcelComponent }, + components: {AddOrUpdate, edit, CreatTemplates, taoBao, UploadExcelComponent }, data() { return { props: { @@ -241,6 +245,7 @@ export default { objectUrl: process.env.VUE_APP_BASE_API, dialogVisible: false, importVisible: false, + problemVisible: false, } }, mounted() { @@ -401,6 +406,12 @@ export default { }) }) }, + productProblem(id) { + this.problemVisible = true + this.$nextTick(() => { + this.$refs.problemList.init(id) + }) + }, onchangeIsShow(row) { row.isShow ? putOnShellApi( row.id ).then(() => { diff --git a/src/views/store/problem/add-and-update.vue b/src/views/store/problem/add-and-update.vue new file mode 100644 index 0000000..02b766b --- /dev/null +++ b/src/views/store/problem/add-and-update.vue @@ -0,0 +1,90 @@ + + + diff --git a/src/views/store/problem/index.vue b/src/views/store/problem/index.vue new file mode 100644 index 0000000..d69598e --- /dev/null +++ b/src/views/store/problem/index.vue @@ -0,0 +1,156 @@ + +