This commit is contained in:
faiz 2024-04-11 20:03:26 +08:00
parent 8abd1c7f17
commit 05be7640b5
6 changed files with 309 additions and 35 deletions

View File

@ -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,

View File

@ -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 属性规则 -- 列表
*/

View File

@ -32,6 +32,54 @@
/>
</el-select>
</el-form-item>
<el-form-item label="产品评分:" prop="product_score">
<el-select
v-model="tableFrom.product_score"
placeholder="请选择"
class="selWidth"
@change="getList(1)"
clearable
>
<el-option
v-for="item in productScoreList"
:key="item.value"
:label="item.label"
:value="item.value.toString()"
/>
</el-select>
</el-form-item>
<el-form-item label="物流评分:" prop="postage_score">
<el-select
v-model="tableFrom.postage_score"
placeholder="请选择"
class="selWidth"
@change="getList(1)"
clearable
>
<el-option
v-for="item in productScoreList"
:key="item.value"
:label="item.label"
:value="item.value.toString()"
/>
</el-select>
</el-form-item>
<el-form-item label="服务评分:" prop="service_score">
<el-select
v-model="tableFrom.service_score"
placeholder="请选择"
class="selWidth"
@change="getList(1)"
clearable
>
<el-option
v-for="item in productScoreList"
:key="item.value"
:label="item.label"
:value="item.value.toString()"
/>
</el-select>
</el-form-item>
<el-form-item label="商品信息:" prop="keyword">
<el-input
v-model="tableFrom.keyword"
@ -57,6 +105,7 @@
</el-form>
</div>
<el-card class="box-card mt14 dataBox">
<el-button style="margin-bottom: 10px;" type="primary" size="small" @click="exports">导出列表</el-button>
<el-table v-loading="listLoading" :data="tableData.data" size="small" @rowclick.stop="closeEdit" :row-class-name="tableRowClassName">
<el-table-column
prop="product_id"
@ -162,8 +211,9 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
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 = []

View File

@ -50,6 +50,8 @@
<el-input
v-model="formValidate.store_name"
placeholder="请输入商品名称"
maxlength="10"
show-word-limit
size="small"
class="pageWidth"
:disabled='virStatus'
@ -60,7 +62,8 @@
<el-form-item label="商品关键字:">
<el-input
v-model="formValidate.keyword"
:disabled='virStatus'
maxlength="20"
show-word-limit
placeholder="请输入商品关键字"
size="small"
class="pageWidth"
@ -1064,7 +1067,7 @@
type="number"
min="0"
size="small"
:disabled="formThead[iii].title === '成本价'"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
class="priceBox"
controls-position="right"
/>
@ -1134,7 +1137,7 @@
</el-col>
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
<!-- 单规格表格-->
<el-form-item v-if="formValidate.spec_type === 0">
<el-form-item :rules="{required: true, message: '域名不能为空', trigger: 'blur'}" v-if="formValidate.spec_type === 0">
<el-table
:data="OneattrValue"
border
@ -1227,7 +1230,7 @@
:min="0"
type="number"
size="small"
:disabled="formThead[iii].title === '成本价'"
:disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'"
class="priceBox"
controls-position="right"
/>
@ -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"
/>
</div>
@ -1568,7 +1571,7 @@
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<!-- <el-col :span="24">
<el-form-item label="是否开启礼包:">
<el-radio-group
v-model="formValidate.is_gift_bag"
@ -1591,7 +1594,7 @@
该商品设置为分销礼包后会展示在平台后台的分销-分销礼包即不会展示在平台后台-商品列表
</div>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
<!-- 其它设置 -->
<el-row v-if="currentTab == '6'">
@ -1632,12 +1635,12 @@
"
:span="24"
>
<el-form-item label="是否包邮:">
<!-- <el-form-item label="是否包邮:">
<el-radio-group :disabled='virStatus' v-model="formValidate.delivery_free">
<el-radio :label="0" class="radio"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-form-item> -->
</el-col>
<el-col
v-if="
@ -2107,6 +2110,8 @@ const defaultObj = {
ot_price: null,
svip_price: null,
select: false,
proportion:0.6,
growth:0,
stock: null,
cdkey: {},
bar_code: '',
@ -2128,7 +2133,7 @@ const defaultObj = {
product_type: 0,
qualification_type: 0,
remark: '',
is_huimei:1,
is_huimei:0,
audit_type:0,
qualification: {
production_name: '',
@ -2161,9 +2166,15 @@ const objTitle = {
svip_price: {
title: '付费会员价'
},
proportion: {
title: '占比'
},
stock: {
title: '库存'
},
growth: {
title: '成长值'
},
bar_code: {
title: '商品编号'
},
@ -2464,7 +2475,9 @@ export default {
price: null,
cost: null,
ot_price: null,
proportion:0.6,
stock: null,
growth:0,
bar_code: '',
weight: null,
volume: null,
@ -2611,17 +2624,15 @@ export default {
handleCost(val,i,e){
// console.log(val);
if(i=='price'){
val.price=val.price.replace(/[^\d|\.]/g, '')
val.price=val.price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
val.cost = (e * 0.6).toFixed(2)
val.growth = parseInt(e*0.3)
}
if(i=='ot_price'){
val.ot_price=val.ot_price.replace(/[^\d|\.]/g, '')
val.ot_price=val.ot_price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
if(!val.price){
this.$message.error('成本价低于0')
}
if(+val.ot_price<val.price){
this.$message.error('市场价需大于或等于售价')
}
}
},
handlCommodity(name) {
@ -2647,14 +2658,14 @@ export default {
//
onRemoveHandler(file, name) {
// if (fileList) return
const { uploadFiles } = this.$refs[name]
uploadFiles.splice(
let uploadFiles = this.$refs[name]?.uploadFiles
uploadFiles?.splice(
uploadFiles.findIndex((item) => item.uid === file.uid),
1
)
this.formValidate.qualification[name].splice(
this.formValidate.qualification[name]?.splice(
this.formValidate.qualification[name].findIndex(
(item) => item.url !== file.url
(item) => item.uid === file.uid
),
1
)
@ -2662,9 +2673,11 @@ export default {
initSuccess(name,res,fileList){
if (res.status == 200) {
if (fileList.every(item => item.status == "success")) {
let arr = []
fileList.map(item => {
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<attr.price) return this.$message.error("规格设置-市场价格限定等于或大于售价");
for (const val of this.ManyAttrValue) {
if (val.select) {
if (this.oneFormBatch[0].attr != '') this.$set(val, 'attr', this.oneFormBatch[0].attr)
@ -3667,6 +3686,8 @@ export default {
ot_price: null,
svip_price: null,
stock: null,
proportion:0.6,
growth:0,
// cdkey: {},
bar_code: "",
weight: null,
@ -3735,7 +3756,20 @@ export default {
this.currentTab = (Number(this.currentTab) - 1).toString();
},
handleSubmitNest(name) {
console.log(this.formValidate)
if (this.formValidate.spec_type === 1) {
let mode = this.ManyAttrValue.every(item=>{
return !(+item.ot_price<item.price)
})
if(!mode) return this.$message.error("规格设置-多规格市场价格限定等于或大于售价");
let url = this.ManyAttrValue.every(item=>{
return item.gist_url
})
if(!url) return this.$message.error("规格设置-多规格依据链接必选填写");
} else {
let attr = this.OneattrValue[0]
if(+attr.ot_price<attr.price) return this.$message.error("规格设置-市场价格限定等于或大于售价");
if(!attr.gist_url) return this.$message.error("规格设置-依据链接必须填写");
}
this.$refs[name].validate(valid => {
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<item.price)
})
if(!mode) return this.$message.error("规格设置-市场价格限定等于或大于售价");
let url = this.ManyAttrValue.every(item=>{
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<attr.price) return this.$message.error("规格设置-市场价格限定等于或大于售价");
if(!attr.gist_url) return this.$message.error("规格设置-依据链接必须填写");
this.formValidate.attrValue = this.OneattrValue;
this.formValidate.attr = [];
}
@ -3904,7 +3949,7 @@ export default {
let btn = new window.UE.ui.Button({
name: "dialog-button",
title: "上传图片",
cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
cssRules: `height:50px;width:50px;background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
onclick: function() {
// dialog
dialog.render();
@ -4068,7 +4113,7 @@ export default {
padding-left: 25px !important;
padding-right: 25px !important;
}
.el-input-number.is-controls-right .el-input__inner{
/deep/.el-input-number.is-controls-right .el-input__inner{
padding-right: 15px !important;
}
.tabNumWidth ::v-deep .priceBox .el-input-number__decrease,

View File

@ -17,7 +17,67 @@
@submit.native.prevent
>
<div>
<div>
<el-row>
<el-col :span="24">
<el-form-item label="商品简介:" prop="store_info">
<el-input
v-model="formValidate.store_info"
type="textarea"
:rows="3"
placeholder="请输入商品简介"
class="pageWidth"
size="small"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品轮播图:" prop="slider_image">
<div class="acea-row">
<div
v-for="(item, index) in formValidate.slider_image"
:key="index"
class="pictrue"
draggable="false"
@dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)"
@dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)"
>
<!-- <img :src="item"> -->
<el-image
style="width: 60px; height: 60px"
:src="item"
:preview-src-list="[item]"
/>
<i
class="el-icon-error btndel"
@click="handleRemove(index)"
/>
</div>
<div
v-if="formValidate.slider_image.length < 10"
class="uploadCont"
title="750*750px"
>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button :loading="loading1" type="primary" class="submission" @click="handleSubmit('formValidate')">提交</el-button>
</el-form-item>
<!-- <div>
<el-form-item label="商户商品分类:" >
<el-cascader
v-model="formValidate.mer_cate_id"
@ -118,7 +178,6 @@
</template>
</el-table>
</el-form-item>
<!-- 多规格表格-->
<el-form-item v-if="formValidate.spec_type === 1" class="labeltop" label="规格列表:">
<el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini">
<template v-if="manyTabDate">
@ -161,7 +220,7 @@
<el-form-item>
<el-button :loading="loading1" type="primary" class="submission" @click="handleSubmit('formValidate')">提交</el-button>
</el-form-item>
</div>
</div> -->
</div>
</el-form>
</el-dialog>
@ -184,6 +243,7 @@ import {
freeTrialApi
} from '@/api/product'
import { roterPre } from "@/settings";
import ueditorFrom from '@/components/ueditorFrom'
const defaultObj = {
store_name: '',
cate_id: '',
@ -247,7 +307,7 @@ const objTitle = {
}
export default {
name: 'editAttr',
components: {},
components: {ueditorFrom},
data() {
return {
product_id: '',
@ -329,6 +389,59 @@ export default {
},
methods: {
handleRemove(i) {
this.formValidate.slider_image.splice(i, 1);
},
//
handleDragStart(e, item) {
this.dragging = item;
},
handleDragEnd(e, item) {
this.dragging = null;
},
handleDragOver(e) {
e.dataTransfer.dropEffect = "move";
},
handleDragEnter(e, item) {
e.dataTransfer.effectAllowed = "move";
if (item === this.dragging) {
return;
}
const newItems = [...this.formValidate.slider_image];
const src = newItems.indexOf(this.dragging);
const dst = newItems.indexOf(item);
newItems.splice(dst, 0, ...newItems.splice(src, 1));
this.formValidate.slider_image = newItems;
},
//
modalPicTap(tit, num, i) {
const _this = this;
const attr = [];
this.$modalUpload(function(img) {
if (tit === "1" && !num) {
_this.formValidate.image = img[0];
_this.OneattrValue[0].image = img[0];
}
if (tit === "2" && !num) {
img.map(item => {
attr.push(item.attachment_src);
_this.formValidate.slider_image.push(item);
if (_this.formValidate.slider_image.length > 10) {
_this.formValidate.slider_image.length = 10;
}
});
}
if (tit === "1" && num === "dan") {
_this.OneattrValue[0].image = img[0];
}
if (tit === "1" && num === "duo") {
_this.ManyAttrValue[i].image = img[0];
}
if (tit === "1" && num === "pi") {
_this.oneFormBatch[0].image = img[0];
}
}, tit);
},
batchDel() {
this.oneFormBatch = [
{
@ -471,7 +584,10 @@ export default {
attr: info.attr || [],
attrValue: info.attrValue,
mer_cate_id: info.mer_cate_id,
spec_type: info.spec_type
spec_type: info.spec_type,
slider_image: info.slider_image,
content: info.content,
store_info: info.store_info
}
if (this.formValidate.spec_type === 0) {
this.OneattrValue = info.attrValue
@ -540,11 +656,19 @@ export default {
.priceBox {
width: 80px;
}
.btndel {
position: absolute;
z-index: 1;
width: 20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.pictrue {
width: 50px;
height: 50px;
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
display: inline-block;
margin-right: 10px;
position: relative;
cursor: pointer;
img {

View File

@ -431,6 +431,24 @@
</div>
</div>
</span>
<span class="upload">
<div class="upload_left">生产许可证</div>
<div class="upload_right">
<div
v-for="(item,index) in qualification.licenceList"
:key="index"
>
<a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a>
<div class="pictrue" v-else>
<el-image
style="width: 60px; height: 60px;"
:src="item.url"
:preview-src-list="[item.url]"
/>
</div>
</div>
</div>
</span>
<span class="upload">
<div class="upload_left">商标注册证</div>
<div class="upload_right">