From 05be7640b5a94e0838a2aa3a204ff387da47c672 Mon Sep 17 00:00:00 2001 From: 15820893422 <1978476055@qq.com> Date: Thu, 11 Apr 2024 20:03:26 +0800 Subject: [PATCH] add --- .env.development | 4 +- src/api/product.js | 6 + src/views/product/Reviews/index.vue | 83 ++++++++++- src/views/product/addProduct/index.vue | 93 ++++++++---- src/views/product/productList/editAttr.vue | 140 +++++++++++++++++-- src/views/product/productList/proDetails.vue | 18 +++ 6 files changed, 309 insertions(+), 35 deletions(-) diff --git a/.env.development b/.env.development index fb66c88..bddf448 100644 --- a/.env.development +++ b/.env.development @@ -2,11 +2,11 @@ ENV = 'development' # base api -VUE_APP_BASE_API = 'http://192.168.1.199:8080' +VUE_APP_BASE_API = 'http://192.168.1.131:8080' # VUE_APP_BASE_API = 'https://plus.hwms.shop' # socket 连接地址 -VUE_APP_WS_URL = 'ws://192.168.1.199:8080' +VUE_APP_WS_URL = 'ws://192.168.1.131:8080' # VUE_APP_WS_URL = 'ws://plus.hwms.shop' # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, diff --git a/src/api/product.js b/src/api/product.js index 996c156..5f658f5 100644 --- a/src/api/product.js +++ b/src/api/product.js @@ -39,6 +39,12 @@ export function storeCategoryDeleteApi(id) { export function storeCategoryStatusApi(id, status) { return request.post(`store/category/status/${id}`, { status }) } +/** + * @description 导出订单 + */ +export function exportReplytApi(data) { + return request.get(`store/reply/export`, data) +} /** * @description 属性规则 -- 列表 */ diff --git a/src/views/product/Reviews/index.vue b/src/views/product/Reviews/index.vue index 1683757..06fa616 100644 --- a/src/views/product/Reviews/index.vue +++ b/src/views/product/Reviews/index.vue @@ -32,6 +32,54 @@ /> + + + + + + + + + + + + + + + + 导出列表 // +---------------------------------------------------------------------- -import { reviewLstApi, reviewReplyApi, reviewsSort ,destoryApi} from '@/api/product' +import { exportReplytApi,reviewLstApi, reviewReplyApi, reviewsSort ,destoryApi} from '@/api/product' import timeOptions from '@/utils/timeOptions'; +import createWorkBook from '@/utils/newToExcel.js' export default { data() { return { @@ -216,6 +266,13 @@ export default { { value: 1, label: '已回复' }, { value: 0, label: '未回复' } ], + productScoreList: [ + { value: 1, label: '1' }, + { value: 2, label: '2' }, + { value: 3, label: '3' }, + { value: 4, label: '4' }, + { value: 5, label: '5' } + ], orderDatalist: null } }, @@ -223,6 +280,30 @@ export default { this.getList(1) }, methods: { + async exports() { + let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = [] + excelData.page = 1 + let pageCount = 1 + let lebData = {}; + for (let i = 0; i < pageCount; i++) { + lebData = await this.downData(excelData) + pageCount = Math.ceil(lebData.count/excelData.limit) + if (lebData.export.length) { + data = data.concat(lebData.export) + excelData.page++ + } + } + createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename); + return + }, + /**订单列表 */ + downData(excelData) { + return new Promise((resolve, reject) => { + exportReplytApi(excelData).then((res) => { + return resolve(res.data) + }) + }) + }, /**重置 */ searchReset(){ this.timeVal = [] diff --git a/src/views/product/addProduct/index.vue b/src/views/product/addProduct/index.vue index 2ce43a3..14ac03d 100644 --- a/src/views/product/addProduct/index.vue +++ b/src/views/product/addProduct/index.vue @@ -50,6 +50,8 @@ @@ -1134,7 +1137,7 @@ - + @@ -1412,7 +1415,7 @@ type="number" size="small" class="priceBox" - :disabled="formThead[iii].title === '成本价'" + :disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" controls-position="right" /> @@ -1568,7 +1571,7 @@ - + @@ -1632,12 +1635,12 @@ " :span="24" > - + { - item.response && this.formValidate.qualification[name].push({ ...item,url: res.data.src,type:item.raw.type}); + item.response && arr.push({ ...item,url: item.response.data.src,type:item.raw.type}) }) + this.formValidate.qualification[name] = arr } } }, @@ -3333,7 +3346,7 @@ export default { this.$set(item, 'inputVisible', true) }, virtualbtn(id, type) { - if (this.$route.params.id) { + if (this.virStatus) { return this.$message.warning('商品类型不能切换!') } this.formValidate.audit_type = id @@ -3391,6 +3404,8 @@ export default { ot_price: null, svip_price: null, stock: null, + proportion:0.6, + growth:0, bar_code: '', weight: null, volume: null, @@ -3415,6 +3430,8 @@ export default { bar_code: '', weight: null, volume: null, + proportion:0.6, + growth:0, gist_url:'' } } @@ -3446,6 +3463,8 @@ export default { }, // 批量添加 batchAdd() { + let attr = this.oneFormBatch[0] + if(+attr.ot_price{ + return !(+item.ot_price{ + return item.gist_url + }) + if(!url) return this.$message.error("规格设置-多规格依据链接必选填写"); + } else { + let attr = this.OneattrValue[0] + if(+attr.ot_price { if (valid) { this.currentTab = (Number(this.currentTab) + 1).toString(); @@ -3747,8 +3781,19 @@ export default { this.$store.dispatch("settings/setEdit", false); this.onChangeGroup(); if (this.formValidate.spec_type === 1) { + let mode = this.ManyAttrValue.every(item=>{ + return !(+item.ot_price{ + return item.gist_url + }) + if(!url) return this.$message.error("规格设置-多规格依据链接必选填写"); this.formValidate.attrValue = this.ManyAttrValue; } else { + let attr = this.OneattrValue[0] + if(+attr.ot_price
-
+ + + + + + + + +
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+ + + + + +
+ + 提交 + +