From 0e08119ac2948940fd32675ada2b88e2c8682c37 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 24 May 2023 19:40:50 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/index.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/order/index.vue b/src/views/order/index.vue index 072bdeb..374f374 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -393,8 +393,15 @@ export default { }, // 下单确认 confirmSubmit(row) { - this.controlWindows.addInfo = row - this.controlWindows.confirmSubmit = true + // this.controlWindows.addInfo = row + // this.controlWindows.confirmSubmit = true + + serve.orderSuccess({ id: row.id }).then(res => { + if (res.code == 20000) { + this.$message.success(res.msg) + this.closeWindow() + } + }) }, //启用禁用 switchTrigger(val, row) { From e03be9445c1db9e2c3ab5756f5183800fa447897 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 24 May 2023 19:41:22 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/order/index.vue b/src/views/order/index.vue index 374f374..b11ee68 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -399,7 +399,8 @@ export default { serve.orderSuccess({ id: row.id }).then(res => { if (res.code == 20000) { this.$message.success(res.msg) - this.closeWindow() + // this.closeWindow() + this.getByPage() } }) }, From e70252152b3f8430ce47dc9d18f8df4eb09368d5 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 24 May 2023 19:49:41 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/order/index.vue b/src/views/order/index.vue index b11ee68..b7dc8bc 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -396,7 +396,7 @@ export default { // this.controlWindows.addInfo = row // this.controlWindows.confirmSubmit = true - serve.orderSuccess({ id: row.id }).then(res => { + order.orderSuccess({ id: row.id }).then(res => { if (res.code == 20000) { this.$message.success(res.msg) // this.closeWindow() From cefb6d1c267ede75918be60cf611ac238fdb9deb Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 24 May 2023 20:16:51 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/order/index.vue b/src/views/order/index.vue index b7dc8bc..d58ef5b 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -116,7 +116,9 @@ 订单锁定 - 下单确认 + + 下单确认 + Date: Mon, 29 May 2023 16:53:42 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 78 ++++++++++++++------ 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index a54666f..e3014fa 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -64,7 +64,7 @@ - + @@ -126,7 +126,7 @@ export default { let { productId, salePrice, floorPrice } = this.controlWindows.addInfo if (productId) { serve.getRefineryProduct(productId).then(res => { - let data = res.data; + let data = res.data if (data.salePrice2company != salePrice || data.floorPrice != floorPrice) { console.log('价格发生变化了捏') // 新的价格 @@ -147,29 +147,65 @@ export default { policyPopulation() { let { salePrice, floorPrice, preQuantity, preAmount } = this.controlWindows.addInfo // console.log(salePrice, preQuantity, preAmount) - if ((salePrice, preQuantity, preAmount)) { - // 原策略 - Object.assign(this.tableData[0], { salePrice: salePrice.toFixed(2), - floorPrice: floorPrice.toFixed(2), - preQuantity: preQuantity.toFixed(2), - preAmount: preAmount.toFixed(2) }) - // 以提货量为准 - Object.assign(this.tableData[1], { - salePrice: (this.newSalePrice).toFixed(2), - floorPrice: (this.newCostPrice).toFixed(2), - preQuantity: preQuantity.toFixed(2), - preAmount: (+this.newSalePrice * +preQuantity).toFixed(2) - }) - // 以订单金额为准 - Object.assign(this.tableData[2], { - salePrice: (this.newSalePrice).toFixed(2), - floorPrice: (this.newCostPrice).toFixed(2), - preQuantity: (+preAmount / +this.newSalePrice).toFixed(2), - preAmount: preAmount.toFixed(2) + if (salePrice && floorPrice && preQuantity && preAmount) { + let strategyArr = [ + // 原策略 + { salePrice: salePrice, floorPrice: floorPrice, preQuantity: preQuantity, preAmount: preAmount }, + // 以提货量为准 + { + salePrice: this.newSalePrice, + floorPrice: this.newCostPrice, + preQuantity: preQuantity, + preAmount: +this.newSalePrice * +preQuantity + }, + // 以订单金额为准 + { + salePrice: this.newSalePrice, + floorPrice: this.newCostPrice, + preQuantity: +preAmount / +this.newSalePrice, + preAmount: preAmount + } + ] + strategyArr.forEach((item, index) => { + for (let key in item) { + item[key] = this.fixedHandle(item[key]) + } + Object.assign(this.tableData[index], item) }) + + // // 原策略 + // Object.assign(this.tableData[0], { salePrice: salePrice, floorPrice: floorPrice, preQuantity: preQuantity, preAmount: preAmount }) + // // 以提货量为准 + // Object.assign(this.tableData[1], { + // salePrice: this.newSalePrice, + // floorPrice: this.newCostPrice, + // preQuantity: preQuantity, + // preAmount: +this.newSalePrice * +preQuantity + // }) + // // 以订单金额为准 + // Object.assign(this.tableData[2], { + // salePrice: this.newSalePrice, + // floorPrice: this.newCostPrice, + // preQuantity: +preAmount / +this.newSalePrice, + // preAmount: preAmount + // }) this.undergoChanges = true } }, + fixedHandle(val) { + val = parseFloat(val) + if (!isNaN(val)) { + let fixedLength4 = val.toFixed(4) + let length = fixedLength4.length + let fixedLength3 = fixedLength4.slice(0, length - 1) + fixedLength3 *= 100 + fixedLength3 = Math.round(fixedLength3) + fixedLength3 /= 100 + let fixedLength2 = fixedLength3.toFixed(2) + return fixedLength2 + } + return 0 + }, submit() { if (this.undergoChanges) { let targetPolicy = this.tableData.filter(item => item.isChecked) From 4da9e42ebaa18449faeed39c244c5922a14f0e7e Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Mon, 29 May 2023 17:38:25 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 12 ++++++---- src/views/order/index.vue | 25 ++++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index e3014fa..0427a35 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -64,7 +64,7 @@ - + @@ -150,20 +150,22 @@ export default { if (salePrice && floorPrice && preQuantity && preAmount) { let strategyArr = [ // 原策略 - { salePrice: salePrice, floorPrice: floorPrice, preQuantity: preQuantity, preAmount: preAmount }, + { salePrice, floorPrice: floorPrice, preQuantity: preQuantity, preAmount, preCostAmount: +floorPrice * +preQuantity }, // 以提货量为准 { salePrice: this.newSalePrice, floorPrice: this.newCostPrice, - preQuantity: preQuantity, - preAmount: +this.newSalePrice * +preQuantity + preQuantity, + preAmount: +this.newSalePrice * +preQuantity, + preCostAmount: +floorPrice * +preQuantity }, // 以订单金额为准 { salePrice: this.newSalePrice, floorPrice: this.newCostPrice, preQuantity: +preAmount / +this.newSalePrice, - preAmount: preAmount + preAmount, + preCostAmount: +floorPrice * +preQuantity } ] strategyArr.forEach((item, index) => { diff --git a/src/views/order/index.vue b/src/views/order/index.vue index d58ef5b..fddc8ab 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -116,9 +116,10 @@ 订单锁定 - - 下单确认 - + + + 下单确认 { - if (res.code == 20000) { - this.$message.success(res.msg) - // this.closeWindow() - this.getByPage() - } - }) + // order.orderSuccess({ id: row.id }).then(res => { + // if (res.code == 20000) { + // this.$message.success(res.msg) + // // this.closeWindow() + // this.getByPage() + // } + // }) }, //启用禁用 switchTrigger(val, row) { From 114f1ad1be03729f4d49e1eb664ccecc39cdb93b Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 30 May 2023 14:28:11 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 82 +++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/permission.js b/src/permission.js index f3145ab..508be07 100644 --- a/src/permission.js +++ b/src/permission.js @@ -1,79 +1,79 @@ -import router from "./router"; -import store from "./store"; -import NProgress from "nprogress"; // progress bar -import "nprogress/nprogress.css"; // progress bar style -import getPageTitle from "@/utils/get-page-title"; +import router from './router' +import store from './store' +import NProgress from 'nprogress' // progress bar +import 'nprogress/nprogress.css' // progress bar style +import getPageTitle from '@/utils/get-page-title' -import Layout from "@/layout"; +import Layout from '@/layout' -import serve from "api/login.js"; +import serve from 'api/login.js' -NProgress.configure({ showSpinner: false }); // NProgress Configuration +NProgress.configure({ showSpinner: false }) // NProgress Configuration -const whiteList = ["/login"]; // no redirect whitelist +const whiteList = ['/login'] // no redirect whitelist router.beforeEach(async (to, from, next) => { - NProgress.start(); - document.title = getPageTitle(to.meta.title); - const hasToken = localStorage.getItem("businessToken"); + NProgress.start() + document.title = getPageTitle(to.meta.title) + const hasToken = localStorage.getItem('businessToken') if (hasToken) { - if (to.path === "/login") { - next({ path: "/" }); - NProgress.done(); + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() } else { - const hasAuth = store.getters.auth && store.getters.auth.length; + const hasAuth = store.getters.auth && store.getters.auth.length if (hasAuth) { - next(); + next() } else { try { // let infoRes = await serve.getUserInfo(); // infoRes.data.authList = [1]; - let infoRes = await serve.info(); + let infoRes = await serve.info() // infoRes.data.authList = infoRes.authList; - store.dispatch("user/info", infoRes.data); + store.dispatch('user/info', infoRes.data) - let routerRes = await serve.getCustomerRouters(); - let realRouter = filterAsyncRouter(routerRes.data); - store.dispatch("permission/generateRoutes", realRouter); - router.addRoutes(realRouter); - next({ ...to, replace: true }); + let routerRes = await serve.getCustomerRouters() + let realRouter = filterAsyncRouter(routerRes.data) + store.dispatch('permission/generateRoutes', realRouter) + router.addRoutes(realRouter) + next({ ...to, replace: true }) } catch (err) { - console.log("catch"); - next("/login"); - NProgress.done(); + console.log('catch') + // next("/login"); + NProgress.done() } } } } else { if (whiteList.includes(to.path)) { - next(); + next() } else { - next("/login"); - NProgress.done(); + next('/login') + NProgress.done() } } -}); +}) router.afterEach(() => { - NProgress.done(); -}); + NProgress.done() +}) function filterAsyncRouter(routers) { - return routers.map((route) => { + return routers.map(route => { if (route.component) { - if (route.component === "Layout") { - route.component = Layout; + if (route.component === 'Layout') { + route.component = Layout } else { - route.component = lazyLoad(route.component); + route.component = lazyLoad(route.component) } } if (route.children && route.children.length) { - route.children = filterAsyncRouter(route.children); + route.children = filterAsyncRouter(route.children) } - return route; - }); + return route + }) } function lazyLoad(path) { - return (resolve) => require([`@/views/${path}`], resolve); + return resolve => require([`@/views/${path}`], resolve) } From f996006dadb5649f3fc4d4f9bde964abd3feb685 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 30 May 2023 14:28:46 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 71c4192..0e9ad07 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "Pan ", "scripts": { "dev": "vue-cli-service serve", - "build:prod": "vue-cli-service build" + "build": "vue-cli-service build" }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", From f4f44eb50299184be95fa36e4b0cd91f69223f41 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 30 May 2023 15:30:20 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index 0427a35..be151b3 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -146,18 +146,17 @@ export default { // 策略选择 policyPopulation() { let { salePrice, floorPrice, preQuantity, preAmount } = this.controlWindows.addInfo - // console.log(salePrice, preQuantity, preAmount) if (salePrice && floorPrice && preQuantity && preAmount) { let strategyArr = [ // 原策略 - { salePrice, floorPrice: floorPrice, preQuantity: preQuantity, preAmount, preCostAmount: +floorPrice * +preQuantity }, + { salePrice, floorPrice, preQuantity, preAmount, preCostAmount: +floorPrice * +preQuantity }, // 以提货量为准 { salePrice: this.newSalePrice, floorPrice: this.newCostPrice, preQuantity, preAmount: +this.newSalePrice * +preQuantity, - preCostAmount: +floorPrice * +preQuantity + preCostAmount: +this.newCostPrice * +preQuantity }, // 以订单金额为准 { @@ -165,7 +164,7 @@ export default { floorPrice: this.newCostPrice, preQuantity: +preAmount / +this.newSalePrice, preAmount, - preCostAmount: +floorPrice * +preQuantity + preCostAmount: +this.newCostPrice * (+preAmount / +this.newSalePrice) } ] strategyArr.forEach((item, index) => { From 2e3065b5ff1d17de3046850322cf6e58d9478bf2 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 30 May 2023 15:41:23 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 59 +++++++++----------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index be151b3..5810eeb 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -149,47 +149,42 @@ export default { if (salePrice && floorPrice && preQuantity && preAmount) { let strategyArr = [ // 原策略 - { salePrice, floorPrice, preQuantity, preAmount, preCostAmount: +floorPrice * +preQuantity }, + () => { + return { salePrice, floorPrice, preQuantity, preAmount, preCostAmount: floorPrice * preQuantity } + }, // 以提货量为准 - { - salePrice: this.newSalePrice, - floorPrice: this.newCostPrice, - preQuantity, - preAmount: +this.newSalePrice * +preQuantity, - preCostAmount: +this.newCostPrice * +preQuantity + () => { + let _salePrice = this.newSalePrice + let _floorPrice = this.newCostPrice + return { + salePrice: _salePrice, + floorPrice: _floorPrice, + preQuantity, + preAmount: _salePrice * preQuantity, + preCostAmount: _floorPrice * preQuantity + } }, // 以订单金额为准 - { - salePrice: this.newSalePrice, - floorPrice: this.newCostPrice, - preQuantity: +preAmount / +this.newSalePrice, - preAmount, - preCostAmount: +this.newCostPrice * (+preAmount / +this.newSalePrice) + () => { + let _salePrice = this.newSalePrice + let _floorPrice = this.newCostPrice + return { + salePrice: _salePrice, + floorPrice: _floorPrice, + preQuantity: preAmount / _salePrice, + preAmount, + preCostAmount: _floorPrice * (preAmount / _salePrice) + } } ] strategyArr.forEach((item, index) => { - for (let key in item) { - item[key] = this.fixedHandle(item[key]) + let data = item() + for (let key in data) { + data[key] = this.fixedHandle(data[key]) } - Object.assign(this.tableData[index], item) + Object.assign(this.tableData[index], data) }) - // // 原策略 - // Object.assign(this.tableData[0], { salePrice: salePrice, floorPrice: floorPrice, preQuantity: preQuantity, preAmount: preAmount }) - // // 以提货量为准 - // Object.assign(this.tableData[1], { - // salePrice: this.newSalePrice, - // floorPrice: this.newCostPrice, - // preQuantity: preQuantity, - // preAmount: +this.newSalePrice * +preQuantity - // }) - // // 以订单金额为准 - // Object.assign(this.tableData[2], { - // salePrice: this.newSalePrice, - // floorPrice: this.newCostPrice, - // preQuantity: +preAmount / +this.newSalePrice, - // preAmount: preAmount - // }) this.undergoChanges = true } }, From b8f1d670bd586f72e5502918f30efb977e1ea30f Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 30 May 2023 16:19:26 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index 5810eeb..e27fe78 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -173,7 +173,7 @@ export default { floorPrice: _floorPrice, preQuantity: preAmount / _salePrice, preAmount, - preCostAmount: _floorPrice * (preAmount / _salePrice) + preCostAmount: _floorPrice * this.fixedHandle(preAmount / _salePrice) } } ] From 3cd3af00f526da5bce91397c6849c8bb200ffa4c Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 31 May 2023 10:55:13 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 104 ++++++++++++++----- 1 file changed, 78 insertions(+), 26 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index e27fe78..671d0a4 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -44,27 +44,38 @@

订单变更信息

因炼厂单价发生变化,请重新选择策略

- - + + - - + + - + - + - + - + @@ -91,23 +102,30 @@ export default { { isChecked: false, type: '原策略', - salePrice: 100, - preQuantity: 100, - preAmount: 10000 + salePrice: '', + preQuantity: '', + preAmount: '' }, { isChecked: false, type: '以提货量为准', - salePrice: 100, - preQuantity: 100, - preAmount: 10000 + salePrice: '', + preQuantity: '', + preAmount: '' }, + // { + // isChecked: false, + // type: '以订单金额为准', + // salePrice: '', + // preQuantity: '', + // preAmount: '' + // }, { isChecked: false, - type: '以订单金额为准', - salePrice: 100, - preQuantity: 100, - preAmount: 10000 + type: '自定义提货量', + salePrice: '', + preQuantity: '', + preAmount: '' } ] } @@ -117,7 +135,7 @@ export default { if (val) { return Number(val).toFixed(2) } else { - return '--' + return '- -' } } }, @@ -137,6 +155,17 @@ export default { }) } }, + changePreQuantity(row, val) { + let segment = val.match(/.?\d{0,2}/g) + row.preQuantity = parseFloat(segment[0] + segment[1]) + if (isNaN(row.preQuantity)) { + this.$message.error('数量输入错误,请重新输入') + return + } + let { salePrice, floorPrice } = row + row.preAmount = this.fixedHandle(salePrice * row.preQuantity) + row.preCostAmount = this.fixedHandle(floorPrice * row.preQuantity) + }, selectPolicy(index, val) { if (val) { this.tableData.map(item => (item.isChecked = false)) @@ -164,25 +193,42 @@ export default { preCostAmount: _floorPrice * preQuantity } }, - // 以订单金额为准 + // // 以订单金额为准 + // () => { + // let _salePrice = this.newSalePrice + // let _floorPrice = this.newCostPrice + // return { + // salePrice: _salePrice, + // floorPrice: _floorPrice, + // preQuantity: preAmount / _salePrice, + // preAmount, + // preCostAmount: _floorPrice * this.fixedHandle(preAmount / _salePrice) + // } + // }, + // 自定义数量 () => { let _salePrice = this.newSalePrice let _floorPrice = this.newCostPrice return { salePrice: _salePrice, floorPrice: _floorPrice, - preQuantity: preAmount / _salePrice, - preAmount, - preCostAmount: _floorPrice * this.fixedHandle(preAmount / _salePrice) + preQuantity: '', + preAmount: '', + preCostAmount: '' } } ] strategyArr.forEach((item, index) => { + let originData = this.tableData[index] let data = item() + if (originData.type === '自定义提货量') { + Object.assign(originData, data) + return + } for (let key in data) { data[key] = this.fixedHandle(data[key]) } - Object.assign(this.tableData[index], data) + Object.assign(originData, data) }) this.undergoChanges = true @@ -209,6 +255,11 @@ export default { this.$message.warning('炼厂单价发生变化,请选择变更策略') return } + let target = targetPolicy[0] + if (target.type === '自定义提货量' && target.preQuantity <= 0) { + this.$message.warning('请输入提货数量') + return + } serve.orderSuccess({ id: this.controlWindows.addInfo.id, ...targetPolicy[0] }).then(res => { if (res.code == 20000) { this.$message.success(res.msg) @@ -239,11 +290,12 @@ export default { .el-drawer__header { margin-bottom: 0; } + .el-input-group__append { + padding: 0 7px; + } } .confirm-submit { padding: 0 30px; - .title { - } > ul { display: flex; margin: 0 auto 30px; From a7d6f5dd7d9c361e7507567c26413fb9727c3fc3 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 31 May 2023 11:30:43 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index 671d0a4..f02d542 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -157,14 +157,15 @@ export default { }, changePreQuantity(row, val) { let segment = val.match(/.?\d{0,2}/g) - row.preQuantity = parseFloat(segment[0] + segment[1]) - if (isNaN(row.preQuantity)) { + let realPrice = parseFloat(segment[0] + segment[1]) + if (isNaN(realPrice)) { this.$message.error('数量输入错误,请重新输入') return } let { salePrice, floorPrice } = row - row.preAmount = this.fixedHandle(salePrice * row.preQuantity) - row.preCostAmount = this.fixedHandle(floorPrice * row.preQuantity) + row.preQuantity = realPrice + row.preAmount = this.fixedHandle(salePrice * realPrice) + row.preCostAmount = this.fixedHandle(floorPrice * realPrice) }, selectPolicy(index, val) { if (val) { From 2e2dd46d969e6394a6761dbf48b4d4fb06f054bc Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 31 May 2023 17:07:52 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 37 +++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index f02d542..a062d5b 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -30,7 +30,9 @@ - {{ controlWindows.addInfo.salePrice }}元 + {{ controlWindows.addInfo.salePrice }} 元/{{ controlWindows.addInfo.productMeasurement }} {{ controlWindows.addInfo.preQuantity | toNumberFixed }} {{ controlWindows.addInfo.productMeasurement }} @@ -66,13 +68,13 @@ - + - + @@ -95,8 +97,8 @@ export default { }, data() { return { - newCostPrice: '', - newSalePrice: '', + // newCostPrice: '', + // newSalePrice: '', undergoChanges: false, tableData: [ { @@ -146,12 +148,8 @@ export default { serve.getRefineryProduct(productId).then(res => { let data = res.data if (data.salePrice2company != salePrice || data.floorPrice != floorPrice) { - console.log('价格发生变化了捏') - // 新的价格 - this.newSalePrice = data.salePrice2company - this.newCostPrice = data.floorPrice - this.policyPopulation() - } else console.log('芜湖 没变') + this.policyPopulation(data.salePrice2company, data.floorPrice) + } }) } }, @@ -174,7 +172,7 @@ export default { } }, // 策略选择 - policyPopulation() { + policyPopulation(newSalePrice, newCostPrice) { let { salePrice, floorPrice, preQuantity, preAmount } = this.controlWindows.addInfo if (salePrice && floorPrice && preQuantity && preAmount) { let strategyArr = [ @@ -184,8 +182,8 @@ export default { }, // 以提货量为准 () => { - let _salePrice = this.newSalePrice - let _floorPrice = this.newCostPrice + let _salePrice = newSalePrice + let _floorPrice = newCostPrice return { salePrice: _salePrice, floorPrice: _floorPrice, @@ -196,8 +194,8 @@ export default { }, // // 以订单金额为准 // () => { - // let _salePrice = this.newSalePrice - // let _floorPrice = this.newCostPrice + // let _salePrice = newSalePrice + // let _floorPrice = newCostPrice // return { // salePrice: _salePrice, // floorPrice: _floorPrice, @@ -208,11 +206,9 @@ export default { // }, // 自定义数量 () => { - let _salePrice = this.newSalePrice - let _floorPrice = this.newCostPrice return { - salePrice: _salePrice, - floorPrice: _floorPrice, + salePrice: newSalePrice, + floorPrice: newCostPrice, preQuantity: '', preAmount: '', preCostAmount: '' @@ -231,7 +227,6 @@ export default { } Object.assign(originData, data) }) - this.undergoChanges = true } }, From 2bbf28b9c1ff6213dc68e3feff76602e58e29bac Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Mon, 5 Jun 2023 13:41:48 +0800 Subject: [PATCH 15/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/billOfLading.vue | 440 ++++++++++---------- 1 file changed, 223 insertions(+), 217 deletions(-) diff --git a/src/views/order/components/billOfLading.vue b/src/views/order/components/billOfLading.vue index 4e64fed..40f4e7a 100644 --- a/src/views/order/components/billOfLading.vue +++ b/src/views/order/components/billOfLading.vue @@ -1,50 +1,44 @@ From 7a74234022dcdc4c7e074e293c0caa66685f7095 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Mon, 5 Jun 2023 15:56:38 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/billOfLading.vue | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/views/order/components/billOfLading.vue b/src/views/order/components/billOfLading.vue index 40f4e7a..e3fbe44 100644 --- a/src/views/order/components/billOfLading.vue +++ b/src/views/order/components/billOfLading.vue @@ -77,7 +77,11 @@ -
+
我来修改/锁定
@@ -143,6 +147,7 @@ 取 消 + 确 定 @@ -219,6 +224,21 @@ export default { created() {}, methods: { billdelivery() { + this.deliveryQuantity + let percentage103 = (this.billAddData.preDeliveryQuantity * 10000 * 1.03) / 10000 + if (this.deliveryQuantity > percentage103) { + this.$confirm('实际提货量超出预约提货量103%, 是否确认?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.realBilldelivery() + }) + return + } + this.realBilldelivery() + }, + realBilldelivery() { this.billAddData.deliveryStatus = 'COMPLETE' this.billAddData.accDeliveryQuantity = this.deliveryQuantity order.update(this.billAddData).then(res => { From a18cbf1b9fde0ce8a671c7f910f9fa596ebed489 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 6 Jun 2023 09:19:00 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/billOfLading.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/order/components/billOfLading.vue b/src/views/order/components/billOfLading.vue index e3fbe44..01d8216 100644 --- a/src/views/order/components/billOfLading.vue +++ b/src/views/order/components/billOfLading.vue @@ -224,7 +224,6 @@ export default { created() {}, methods: { billdelivery() { - this.deliveryQuantity let percentage103 = (this.billAddData.preDeliveryQuantity * 10000 * 1.03) / 10000 if (this.deliveryQuantity > percentage103) { this.$confirm('实际提货量超出预约提货量103%, 是否确认?', '提示', {