diff --git a/src/api/product.js b/src/api/product.js new file mode 100644 index 0000000..59a448c --- /dev/null +++ b/src/api/product.js @@ -0,0 +1,43 @@ +import request from "utils/axios.js"; +// table +const getByPage = (params) => { + return request.postJson("/oil-refinery/oilRefineryProduct/getByPage", params); +}; +// 新增 +const save = (params) => { + return request.postJson("/oil-refinery/oilRefineryProduct/save", params); +}; +// 修改 +const update = (params) => { + return request.postJson("/oil-refinery/oilRefineryProduct/update", params); +}; +// 调价记录table +const getByPageRecord = (params) => { + return request.postJson( + "/oil-refinery/oilRefineryPriceChangelog/getByPage", + params + ); +}; +// 批量修改 +const updateBatchEnable = (params) => { + return request.postJson( + "/oil-refinery/oilRefineryProduct/updateBatchEnable", + params + ); +}; +// 调价 +const modifyPrice = (params) => { + return request.postJson( + "/oil-refinery/oilRefineryProduct/modifyPrice", + params + ); +}; + +export default { + getByPage, + save, + update, + getByPageRecord, + updateBatchEnable, + modifyPrice, +}; diff --git a/src/components/pagination/index.vue b/src/components/pagination/index.vue new file mode 100644 index 0000000..21733fc --- /dev/null +++ b/src/components/pagination/index.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/main.js b/src/main.js index 5ad04cf..3f08acb 100644 --- a/src/main.js +++ b/src/main.js @@ -21,6 +21,23 @@ Vue.use(ElementUI, { language, size: "medium" }); Vue.config.productionTip = false; Vue.prototype.$utils = utils; +Vue.directive("checkNum", { + update(el, binding, vNode) { + if (el.children.length) { + let val = el.children[0].value; + let qualifiedNum = val + .replace(/[^\d.]/g, "") + .replace(/^\./g, "") + .replace(/\.{2,}/g, ".") + .replace(/^0{2,}/g, "0") + .replace(".", "$#$") + .replace(/\./g, "") + .replace("$#$", "."); + vNode.componentInstance.$emit("input", qualifiedNum); + } + }, +}); + new Vue({ el: "#app", router, diff --git a/src/router/index.js b/src/router/index.js index 6df9d21..f2bb743 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,7 +6,7 @@ Vue.use(Router); export const constantRoutes = [ { path: "/", - redirect: "/refineryInfo", + redirect: "/product", }, { path: "/login", diff --git a/src/views/product/components/add.vue b/src/views/product/components/add.vue index 3b9d363..62d26e0 100644 --- a/src/views/product/components/add.vue +++ b/src/views/product/components/add.vue @@ -8,48 +8,73 @@ :before-close="closeWindow" >
- - + + - - + + + + + + + + + + + + + + + + + + + + + + 启用 禁用 - - - - - - - - - - - -
@@ -60,34 +85,69 @@ + + diff --git a/src/views/product/components/batch.vue b/src/views/product/components/batch.vue new file mode 100644 index 0000000..ca9b3ec --- /dev/null +++ b/src/views/product/components/batch.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/src/views/product/components/create.vue b/src/views/product/components/create.vue new file mode 100644 index 0000000..37d103c --- /dev/null +++ b/src/views/product/components/create.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/src/views/product/components/record.vue b/src/views/product/components/record.vue new file mode 100644 index 0000000..ad7511c --- /dev/null +++ b/src/views/product/components/record.vue @@ -0,0 +1,287 @@ + + + + + diff --git a/src/views/product/index.vue b/src/views/product/index.vue index 1b6ce7f..4b5d8dc 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -1,29 +1,21 @@