|
|
@@ -3,15 +3,14 @@
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
<el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
- @click="backToList">返回列表
|
|
|
+ @click="backToList">返回列表
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
- <el-button v-if="form.status == 0 || form.status == 2"
|
|
|
- type="success" size="small" :disabled="!form.id"
|
|
|
- @click="releasefun" >发 布</el-button>
|
|
|
+ <el-button v-if="form.status == 0 || form.status == 2" type="success" size="small" :disabled="!form.id"
|
|
|
+ @click="releasefun">发 布</el-button>
|
|
|
<el-button v-if="form.status == 1" type="warning" size="small" :disabled="!form.id"
|
|
|
- @click="releasefun" >撤销发布</el-button>
|
|
|
+ @click="releasefun">撤销发布</el-button>
|
|
|
<el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">保存数据</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -21,7 +20,7 @@
|
|
|
<template slot="activePictures">
|
|
|
<div style="display: flex;align-items: center;justify-content: center;">
|
|
|
<el-input v-model="form.activePictures" :disabled="true" placeholder="请输入内容"></el-input>
|
|
|
- <el-button type="primary" size="small" icon="el-icon-edit" @click="addPicture" >上传</el-button>
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-edit" @click="addPicture">上传</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</avue-form>
|
|
|
@@ -29,55 +28,39 @@
|
|
|
</div>
|
|
|
<div style="margin-top: 10px">
|
|
|
<trade-card title="详情">
|
|
|
- <avue-crud :option="optionDetails" ref="optionDetailsRef" :data="form.activityItemsList"
|
|
|
- @selection-change="detailsMultiplechoice"
|
|
|
- @resetColumn="resetColumnTwo('optionDetailsRef', 'optionDetails', 'optionDetailsBack', 339.1)"
|
|
|
- @saveColumn="saveColumnTwo('optionDetailsRef', 'optionDetails', 'optionDetailsBack', 339.1)" >
|
|
|
+ <avue-crud :option="optionDetails" ref="crud" :data="form.activityItemsList"
|
|
|
+ @selection-change="detailsMultiplechoice"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'optionDetails', 'optionDetailsBack', 339.1)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'optionDetails', 'optionDetailsBack', 339.1)">
|
|
|
<template slot="menuLeft">
|
|
|
- <el-button icon="el-icon-plus" type="primary" size="small" @click="detailsAddButton" >添加数据</el-button>
|
|
|
- <el-button type="danger"
|
|
|
- size="small"
|
|
|
- icon="el-icon-delete"
|
|
|
- plain
|
|
|
- @click="multipleActivityitemsRemovefun">删 除
|
|
|
+ <el-button icon="el-icon-plus" type="primary" size="small"
|
|
|
+ @click="detailsAddButton">添加数据</el-button>
|
|
|
+ <el-button type="danger" size="small" icon="el-icon-delete" plain
|
|
|
+ @click="multipleActivityitemsRemovefun">删 除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click="detailsRowCell(row,index)"
|
|
|
- >{{row.$cellEdit?'确认':'修改'}}</el-button>
|
|
|
- <el-button type="text" size="small" @click="activityitemsRemovefun(row,index)" >删除</el-button>
|
|
|
- <el-button type="text" size="small" @click="changingtheImage(row,index)" >换图</el-button>
|
|
|
+ <el-button type="text" size="small" @click="detailsRowCell(row, index)">{{ row.$cellEdit ? '确认' :
|
|
|
+ '修改' }}</el-button>
|
|
|
+ <el-button type="text" size="small" @click="activityitemsRemovefun(row, index)">删除</el-button>
|
|
|
+ <el-button type="text" size="small" @click="changingtheImage(row, index)">换图</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog title="商城数据" append-to-body v-dialog-drag :visible.sync="detailsVisible" width="80%" >
|
|
|
- <assembly-details ref="assemblyDetails" @selectionDetails="selectionDetails" ></assembly-details>
|
|
|
+ <el-dialog title="商城数据" append-to-body v-dialog-drag :visible.sync="detailsVisible" width="80%">
|
|
|
+ <assembly-details ref="assemblyDetails" @selectionDetails="selectionDetails"></assembly-details>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="detailsVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="popupConfirmation">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- title="上传附件"
|
|
|
- append-to-body
|
|
|
- :visible.sync="excelBox"
|
|
|
- width="555px"
|
|
|
- :close-on-click-modal="false"
|
|
|
- v-dialog-drag >
|
|
|
- <el-upload
|
|
|
- class="upload-demo" drag
|
|
|
- style="text-align: center"
|
|
|
- ref="upload"
|
|
|
- :action="action"
|
|
|
- :headers="headers"
|
|
|
- :on-success="onSuccess"
|
|
|
- multiple >
|
|
|
+ <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
|
|
|
+ v-dialog-drag>
|
|
|
+ <el-upload class="upload-demo" drag style="text-align: center" ref="upload" :action="action" :headers="headers"
|
|
|
+ :on-success="onSuccess" multiple>
|
|
|
<i class="el-icon-upload"></i>
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
<div class="el-upload__tip" slot="tip">
|
|
|
@@ -90,490 +73,488 @@
|
|
|
|
|
|
<script>
|
|
|
import assemblyDetails from "./assembly/assemblyDetails.vue";
|
|
|
-import {getToken} from "@/util/auth";
|
|
|
-import {activityDetail, activityitemsRemove, activitySubmit, activityUpdate} from "@/api/tirePartsMall/activity";
|
|
|
- export default {
|
|
|
- data(){
|
|
|
- return {
|
|
|
- optionForm:{
|
|
|
- menuBtn: false,
|
|
|
- span: 6,
|
|
|
- column: [{
|
|
|
- label: '活动名称',
|
|
|
- prop: "activityName",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },{
|
|
|
- label: '开始日期',
|
|
|
- prop: "startDate",
|
|
|
- type: "date",
|
|
|
- format: "yyyy-MM-dd",
|
|
|
- valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },{
|
|
|
- label: '结束日期',
|
|
|
- prop: "endDate",
|
|
|
- type: "date",
|
|
|
- format: "yyyy-MM-dd",
|
|
|
- valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },{
|
|
|
- label: '最小购买',
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+import { activityDetail, activityitemsRemove, activitySubmit, activityUpdate } from "@/api/tirePartsMall/activity";
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ optionForm: {
|
|
|
+ menuBtn: false,
|
|
|
+ span: 6,
|
|
|
+ column: [{
|
|
|
+ label: '活动名称',
|
|
|
+ prop: "activityName",
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '开始日期',
|
|
|
+ prop: "startDate",
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '结束日期',
|
|
|
+ prop: "endDate",
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '最小购买',
|
|
|
+ prop: "minQuantity",
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '最大购买',
|
|
|
+ prop: "maxQuantity",
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '图片名称',
|
|
|
+ prop: "activePictures",
|
|
|
+ formslot: true,
|
|
|
+ disabled: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '图片地址',
|
|
|
+ prop: "url",
|
|
|
+ disabled: true,
|
|
|
+ span: 12,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: '活动说明',
|
|
|
+ prop: "activityDescription",
|
|
|
+ span: 24,
|
|
|
+ type: 'textarea',
|
|
|
+ minRows: 2,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ minQuantity: 1, // 最小购买
|
|
|
+ activityItemsList: []
|
|
|
+ },
|
|
|
+ // 详情配置
|
|
|
+ optionDetails: {},
|
|
|
+ optionDetailsBack: {
|
|
|
+ height: 'auto',
|
|
|
+ calcHeight: 30,
|
|
|
+ tip: false,
|
|
|
+ searchShow: true,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ selection: true,
|
|
|
+ dialogClickModal: false,
|
|
|
+ addBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ cancelBtn: false,
|
|
|
+ menuWidth: 120,
|
|
|
+ cellBtn: false,
|
|
|
+ addRowBtn: false,
|
|
|
+ rowKey: '$index',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "名称",
|
|
|
+ prop: "cname",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "规格型号",
|
|
|
+ prop: "specificationAndModel",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "花纹",
|
|
|
+ prop: "brandItem",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "库存",
|
|
|
+ prop: "inventory",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "最小购买数量",
|
|
|
prop: "minQuantity",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },{
|
|
|
- label: '最大购买',
|
|
|
+ overHidden: true,
|
|
|
+ type: 'number',
|
|
|
+ controls: false,
|
|
|
+ cell: true,
|
|
|
+ width: '100px',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "最大购买数量",
|
|
|
prop: "maxQuantity",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },{
|
|
|
- label: '图片名称',
|
|
|
- prop: "activePictures",
|
|
|
- formslot:true,
|
|
|
- disabled:true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },{
|
|
|
- label: '图片地址',
|
|
|
- prop: "url",
|
|
|
- disabled:true,
|
|
|
- span:12,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },{
|
|
|
- label: '活动说明',
|
|
|
- prop: "activityDescription",
|
|
|
- span:24,
|
|
|
- type:'textarea',
|
|
|
- minRows: 2,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- }]
|
|
|
- },
|
|
|
- form:{
|
|
|
- minQuantity:1, // 最小购买
|
|
|
- activityItemsList:[]
|
|
|
- },
|
|
|
- // 详情配置
|
|
|
- optionDetails:{},
|
|
|
- optionDetailsBack:{
|
|
|
- height:'auto',
|
|
|
- calcHeight: 30,
|
|
|
- tip: false,
|
|
|
- searchShow: true,
|
|
|
- searchMenuSpan: 6,
|
|
|
- border: true,
|
|
|
- index: true,
|
|
|
- selection: true,
|
|
|
- dialogClickModal: false,
|
|
|
- addBtn:false,
|
|
|
- viewBtn:false,
|
|
|
- editBtn:false,
|
|
|
- delBtn:false,
|
|
|
- cancelBtn:false,
|
|
|
- menuWidth:120,
|
|
|
- cellBtn:false,
|
|
|
- addRowBtn:false,
|
|
|
- rowKey:'$index',
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "名称",
|
|
|
- prop: "cname",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "规格型号",
|
|
|
- prop: "specificationAndModel",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "花纹",
|
|
|
- prop: "brandItem",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "库存",
|
|
|
- prop: "inventory",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "最小购买数量",
|
|
|
- prop: "minQuantity",
|
|
|
- overHidden:true,
|
|
|
- type:'number',
|
|
|
- controls:false,
|
|
|
- cell: true,
|
|
|
- width:'100px',
|
|
|
- },
|
|
|
- {
|
|
|
- label: "最大购买数量",
|
|
|
- prop: "maxQuantity",
|
|
|
- overHidden:true,
|
|
|
- type:'number',
|
|
|
- controls:false,
|
|
|
- cell: true,
|
|
|
- width:'100px',
|
|
|
- },
|
|
|
- {
|
|
|
- label: "原售价1",
|
|
|
- prop: "priceOnePrimary",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "原售价2",
|
|
|
- prop: "priceTwoPrimary",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "原售价3",
|
|
|
- prop: "priceThreePrimary",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "原售价4",
|
|
|
- prop: "priceFourPrimary",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "促销价1",
|
|
|
- prop: "priceOne",
|
|
|
- overHidden:true,
|
|
|
- cell: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: "促销价2",
|
|
|
- prop: "priceTwo",
|
|
|
- overHidden:true,
|
|
|
- cell: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: "促销价3",
|
|
|
- prop: "priceThree",
|
|
|
- overHidden:true,
|
|
|
- cell: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: "促销价4",
|
|
|
- prop: "priceFour",
|
|
|
- overHidden:true,
|
|
|
- cell: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: "品牌名称",
|
|
|
- prop: "brandName",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
+ overHidden: true,
|
|
|
+ type: 'number',
|
|
|
+ controls: false,
|
|
|
+ cell: true,
|
|
|
+ width: '100px',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "原售价1",
|
|
|
+ prop: "priceOnePrimary",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "原售价2",
|
|
|
+ prop: "priceTwoPrimary",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "原售价3",
|
|
|
+ prop: "priceThreePrimary",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "原售价4",
|
|
|
+ prop: "priceFourPrimary",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "促销价1",
|
|
|
+ prop: "priceOne",
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "促销价2",
|
|
|
+ prop: "priceTwo",
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "促销价3",
|
|
|
+ prop: "priceThree",
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "促销价4",
|
|
|
+ prop: "priceFour",
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "品牌名称",
|
|
|
+ prop: "brandName",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- label: "产地",
|
|
|
- prop: "placeProduction",
|
|
|
- overHidden:true,
|
|
|
- cell: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: "防爆",
|
|
|
- prop: "explosionProof",
|
|
|
- type: 'select',
|
|
|
- dicData: [{
|
|
|
- label: '否',
|
|
|
- value: 0
|
|
|
- }, {
|
|
|
- label: '是',
|
|
|
- value: 1
|
|
|
- }],
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "原厂",
|
|
|
- prop: "originalFactory",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "自修补",
|
|
|
- prop: "selfRecovery",
|
|
|
- overHidden:true,
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: "原价",
|
|
|
- // prop: "originalPrice",
|
|
|
- // overHidden:true,
|
|
|
- // cell: true
|
|
|
- // },
|
|
|
- {
|
|
|
- label: "商品图片名称",
|
|
|
- prop: "goodsPictures",
|
|
|
- overHidden:true,
|
|
|
- width:'140px',
|
|
|
- },
|
|
|
- {
|
|
|
- label: "商品图片地址",
|
|
|
- prop: "url",
|
|
|
- overHidden:true,
|
|
|
- width:'140px',
|
|
|
- },
|
|
|
- {
|
|
|
- label: "备注",
|
|
|
- prop: "remarks",
|
|
|
- overHidden:true,
|
|
|
- cell: true
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- detailsMultipleData:[], // 详情多选数据
|
|
|
- detailsVisible:false, // 商城弹窗显示隐藏
|
|
|
- selectionDetailsData:[], // 弹窗多选数据
|
|
|
- excelBox:false, // 上传图片的弹窗
|
|
|
- action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
- headers: { "Blade-Auth": "Bearer " + getToken() },
|
|
|
- detailsIndex:null, // 详情下标
|
|
|
+ {
|
|
|
+ label: "产地",
|
|
|
+ prop: "placeProduction",
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "防爆",
|
|
|
+ prop: "explosionProof",
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '否',
|
|
|
+ value: 0
|
|
|
+ }, {
|
|
|
+ label: '是',
|
|
|
+ value: 1
|
|
|
+ }],
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "原厂",
|
|
|
+ prop: "originalFactory",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "自修补",
|
|
|
+ prop: "selfRecovery",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label: "原价",
|
|
|
+ // prop: "originalPrice",
|
|
|
+ // overHidden:true,
|
|
|
+ // cell: true
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ label: "商品图片名称",
|
|
|
+ prop: "goodsPictures",
|
|
|
+ overHidden: true,
|
|
|
+ width: '140px',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "商品图片地址",
|
|
|
+ prop: "url",
|
|
|
+ overHidden: true,
|
|
|
+ width: '140px',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
+ overHidden: true,
|
|
|
+ cell: true
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ detailsMultipleData: [], // 详情多选数据
|
|
|
+ detailsVisible: false, // 商城弹窗显示隐藏
|
|
|
+ selectionDetailsData: [], // 弹窗多选数据
|
|
|
+ excelBox: false, // 上传图片的弹窗
|
|
|
+ action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
+ headers: { "Blade-Auth": "Bearer " + getToken() },
|
|
|
+ detailsIndex: null, // 详情下标
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ assemblyDetails
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.optionDetails = await this.getColumnData(this.getColumnName(339.1), this.optionDetailsBack);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 从表单个删除
|
|
|
+ activityitemsRemovefun(row, index) {
|
|
|
+ if (row.id) {
|
|
|
+ activityitemsRemove(row.id).then(res => {
|
|
|
+ this.$message.success('操作成功!')
|
|
|
+ })
|
|
|
}
|
|
|
+ this.form.activityItemsList.splice(index, 1)
|
|
|
},
|
|
|
- components:{
|
|
|
- assemblyDetails
|
|
|
- },
|
|
|
- async created() {
|
|
|
- this.optionDetails = await this.getColumnData(this.getColumnName(339.1), this.optionDetailsBack);
|
|
|
- },
|
|
|
- methods:{
|
|
|
- // 从表单个删除
|
|
|
- activityitemsRemovefun(row,index){
|
|
|
- if (row.id) {
|
|
|
- activityitemsRemove(row.id).then(res=>{
|
|
|
+ // 从表多个删除
|
|
|
+ multipleActivityitemsRemovefun() {
|
|
|
+ if (this.detailsMultipleData.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ let multiList = this.detailsMultipleData
|
|
|
+ let arr = this.form.activityItemsList
|
|
|
+ // 获取有id 的数据
|
|
|
+ const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
|
|
|
+ let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
+ // 把选中的删除掉
|
|
|
+ multiList.forEach((item) => {
|
|
|
+ for (let index in arr) {
|
|
|
+ if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
+ arr.splice(Number(index), 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 有id 的处理
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ activityitemsRemove(arrIds.join(',')).then(res => {
|
|
|
this.$message.success('操作成功!')
|
|
|
})
|
|
|
}
|
|
|
- this.form.activityItemsList.splice(index,1)
|
|
|
- },
|
|
|
- // 从表多个删除
|
|
|
- multipleActivityitemsRemovefun(){
|
|
|
- if (this.detailsMultipleData.length === 0) {
|
|
|
- this.$message.warning("请选择至少一条数据");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(()=>{
|
|
|
- let multiList = this.detailsMultipleData
|
|
|
- let arr = this.form.activityItemsList
|
|
|
- // 获取有id 的数据
|
|
|
- const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
|
|
|
- let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
|
|
|
- // 把选中的删除掉
|
|
|
- multiList.forEach((item)=>{
|
|
|
- for (let index in arr) {
|
|
|
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
- arr.splice(Number(index),1)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- // 有id 的处理
|
|
|
- if(itemsWithId.length != 0) {
|
|
|
- activityitemsRemove(arrIds.join(',')).then(res=>{
|
|
|
- this.$message.success('操作成功!')
|
|
|
- })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 详情多选
|
|
|
+ detailsMultiplechoice(list) {
|
|
|
+ this.detailsMultipleData = list
|
|
|
+ },
|
|
|
+ // 发布
|
|
|
+ releasefun() {
|
|
|
+ if (this.form.status == 0 || this.form.status == 2) {
|
|
|
+ this.form.status = 1
|
|
|
+ } else if (this.form.status == 1) {
|
|
|
+ this.form.status = 2
|
|
|
+ }
|
|
|
+ activityUpdate(this.form).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.activityDetailfun(this.form.id)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 大保存
|
|
|
+ editCustomer() {
|
|
|
+ this.$refs["form"].validate((valid, done) => {
|
|
|
+ if (valid) {
|
|
|
+ let sumText = '请输入'
|
|
|
+ let maxnum = 0
|
|
|
+ for (let item of this.form.activityItemsList) {
|
|
|
+ if (!Number(item.priceOne)) {
|
|
|
+ sumText += ` 序号${item.$index + 1}促销价1`
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- // 详情多选
|
|
|
- detailsMultiplechoice(list){
|
|
|
- this.detailsMultipleData = list
|
|
|
- },
|
|
|
- // 发布
|
|
|
- releasefun(){
|
|
|
- if (this.form.status == 0 || this.form.status == 2) {
|
|
|
- this.form.status = 1
|
|
|
- }else if (this.form.status == 1) {
|
|
|
- this.form.status = 2
|
|
|
- }
|
|
|
- activityUpdate(this.form).then(res=>{
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.activityDetailfun(this.form.id)
|
|
|
- })
|
|
|
- },
|
|
|
- // 大保存
|
|
|
- editCustomer(){
|
|
|
- this.$refs["form"].validate((valid, done) => {
|
|
|
- if (valid) {
|
|
|
- let sumText = '请输入'
|
|
|
- let maxnum = 0
|
|
|
- for (let item of this.form.activityItemsList) {
|
|
|
- if (!Number(item.priceOne)) {
|
|
|
- sumText += ` 序号${item.$index + 1}促销价1`
|
|
|
- }
|
|
|
- if (!Number(item.priceTwo)) {
|
|
|
- sumText += ` 序号${item.$index + 1}促销价2`
|
|
|
- }
|
|
|
- if (!Number(item.priceThree)) {
|
|
|
- sumText += ` 序号${item.$index + 1}促销价3`
|
|
|
- }
|
|
|
- if (!Number(item.priceFour)) {
|
|
|
- sumText += ` 序号${item.$index + 1}促销价4`
|
|
|
- }
|
|
|
- maxnum += Number(item.maxQuantity)
|
|
|
+ if (!Number(item.priceTwo)) {
|
|
|
+ sumText += ` 序号${item.$index + 1}促销价2`
|
|
|
}
|
|
|
- if(sumText != '请输入') {
|
|
|
- this.$confirm(sumText, {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- return;
|
|
|
+ if (!Number(item.priceThree)) {
|
|
|
+ sumText += ` 序号${item.$index + 1}促销价3`
|
|
|
}
|
|
|
- if (this.form.maxQuantity < maxnum) {
|
|
|
- return this.$message.warning('最大购买数量过大请重新修改')
|
|
|
+ if (!Number(item.priceFour)) {
|
|
|
+ sumText += ` 序号${item.$index + 1}促销价4`
|
|
|
}
|
|
|
- activitySubmit(this.form).then(res=>{
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.activityDetailfun(res.data.data.id)
|
|
|
+ maxnum += Number(item.maxQuantity)
|
|
|
+ }
|
|
|
+ if (sumText != '请输入') {
|
|
|
+ this.$confirm(sumText, {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
- done()
|
|
|
+ return;
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- // 详情获取数据
|
|
|
- activityDetailfun(id){
|
|
|
- activityDetail(id).then(res=>{
|
|
|
- this.form = res.data.data
|
|
|
- })
|
|
|
- },
|
|
|
- // 详情确认按钮
|
|
|
- detailsRowCell(row,index){
|
|
|
- if (row.$cellEdit) {
|
|
|
- this.$refs.optionDetailsRef.rowCancel(row,index)
|
|
|
- }else {
|
|
|
- this.$refs.optionDetailsRef.rowCell(row, index)
|
|
|
- }
|
|
|
- },
|
|
|
- // 图片上传
|
|
|
- addPicture(){
|
|
|
- this.excelBox = true
|
|
|
- },
|
|
|
- // 替换图片
|
|
|
- changingtheImage(row,index){
|
|
|
- this.detailsIndex = index
|
|
|
- this.excelBox = true
|
|
|
- },
|
|
|
- //新增上传成功
|
|
|
- onSuccess(response, file, fileList) {
|
|
|
- if (this.detailsIndex) {
|
|
|
- this.$set(this.form.activityItemsList[this.detailsIndex],'goodsPictures',response.data.originalName)
|
|
|
- this.$set(this.form.activityItemsList[this.detailsIndex],'url',response.data.link)
|
|
|
- }else {
|
|
|
- this.form.activePictures = response.data.originalName
|
|
|
- this.form.url = response.data.link
|
|
|
- }
|
|
|
- this.detailsIndex = null
|
|
|
- this.excelBox = false;
|
|
|
- },
|
|
|
- // 弹窗多选回调
|
|
|
- selectionDetails(list){
|
|
|
- this.selectionDetailsData = list
|
|
|
- },
|
|
|
- // 弹窗确认
|
|
|
- popupConfirmation(){
|
|
|
- for (let item of this.selectionDetailsData) {
|
|
|
- this.form.activityItemsList.push({
|
|
|
- pid:this.form.id?this.form.id:null,
|
|
|
- cname:item.cname,
|
|
|
- specificationAndModel:item.specificationAndModel,
|
|
|
- inventory:item.inventory,
|
|
|
- goodsId:item.goodsId,
|
|
|
- priceOnePrimary:item.priceOne,
|
|
|
- priceTwoPrimary:item.priceTwo,
|
|
|
- priceThreePrimary:item.priceThree,
|
|
|
- priceFourPrimary:item.priceFour,
|
|
|
- brandId:item.brandId,
|
|
|
- brandName:item.brandName,
|
|
|
- brandItem:item.brandItem,
|
|
|
- placeProduction:null, // 产地
|
|
|
- explosionProof:item.explosionProof,
|
|
|
- originalFactory:item.originalFactory,
|
|
|
- selfRecovery:item.selfRecovery,
|
|
|
- minQuantity:1, // 最小购买数量
|
|
|
- maxQuantity:1, // 最大购买数量
|
|
|
- originalPrice:null, // 原价
|
|
|
- priceOne:null, // 促销价1
|
|
|
- priceTwo:null, // 促销价2
|
|
|
- priceThree:null, // 促销价3
|
|
|
- priceFour:null, // 促销价4
|
|
|
- goodsPictures:item.filesList.length > 0?item.filesList[0].fileName:'', // 商品图片名称
|
|
|
- url:item.filesList.length > 0?item.filesList[0].url:'',// 商品图片地址
|
|
|
- $cellEdit:true
|
|
|
+ if (this.form.maxQuantity < maxnum) {
|
|
|
+ return this.$message.warning('最大购买数量过大请重新修改')
|
|
|
+ }
|
|
|
+ activitySubmit(this.form).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.activityDetailfun(res.data.data.id)
|
|
|
})
|
|
|
+ done()
|
|
|
}
|
|
|
- this.detailsVisible = false
|
|
|
- },
|
|
|
- // 详情添加商品
|
|
|
- detailsAddButton(){
|
|
|
- this.detailsVisible = true
|
|
|
- let page = {pageSize: 20, currentPage: 1}
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.assemblyDetails.listAllPfun()
|
|
|
- this.$refs.assemblyDetails.onLoad(page)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 详情获取数据
|
|
|
+ activityDetailfun(id) {
|
|
|
+ activityDetail(id).then(res => {
|
|
|
+ this.form = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 详情确认按钮
|
|
|
+ detailsRowCell(row, index) {
|
|
|
+ if (row.$cellEdit) {
|
|
|
+ row.$cellEdit = false
|
|
|
+ } else {
|
|
|
+ row.$cellEdit = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 图片上传
|
|
|
+ addPicture() {
|
|
|
+ this.excelBox = true
|
|
|
+ },
|
|
|
+ // 替换图片
|
|
|
+ changingtheImage(row, index) {
|
|
|
+ this.detailsIndex = index
|
|
|
+ this.excelBox = true
|
|
|
+ },
|
|
|
+ //新增上传成功
|
|
|
+ onSuccess(response, file, fileList) {
|
|
|
+ if (this.detailsIndex == null) {
|
|
|
+ this.form.activePictures = response.data.originalName
|
|
|
+ this.form.url = response.data.link
|
|
|
+ } else {
|
|
|
+ this.$set(this.form.activityItemsList[this.detailsIndex], 'goodsPictures', response.data.originalName)
|
|
|
+ this.$set(this.form.activityItemsList[this.detailsIndex], 'url', response.data.link)
|
|
|
+ }
|
|
|
+ this.detailsIndex = null
|
|
|
+ this.excelBox = false;
|
|
|
+ },
|
|
|
+ // 弹窗多选回调
|
|
|
+ selectionDetails(list) {
|
|
|
+ this.selectionDetailsData = list
|
|
|
+ },
|
|
|
+ // 弹窗确认
|
|
|
+ popupConfirmation() {
|
|
|
+ for (let item of this.selectionDetailsData) {
|
|
|
+ this.form.activityItemsList.push({
|
|
|
+ pid: this.form.id ? this.form.id : null,
|
|
|
+ cname: item.cname,
|
|
|
+ specificationAndModel: item.specificationAndModel,
|
|
|
+ inventory: item.inventory,
|
|
|
+ goodsId: item.goodsId,
|
|
|
+ priceOnePrimary: item.priceOne,
|
|
|
+ priceTwoPrimary: item.priceTwo,
|
|
|
+ priceThreePrimary: item.priceThree,
|
|
|
+ priceFourPrimary: item.priceFour,
|
|
|
+ brandId: item.brandId,
|
|
|
+ brandName: item.brandName,
|
|
|
+ brandItem: item.brandItem,
|
|
|
+ placeProduction: null, // 产地
|
|
|
+ explosionProof: item.explosionProof,
|
|
|
+ originalFactory: item.originalFactory,
|
|
|
+ selfRecovery: item.selfRecovery,
|
|
|
+ minQuantity: 1, // 最小购买数量
|
|
|
+ maxQuantity: 1, // 最大购买数量
|
|
|
+ originalPrice: null, // 原价
|
|
|
+ priceOne: null, // 促销价1
|
|
|
+ priceTwo: null, // 促销价2
|
|
|
+ priceThree: null, // 促销价3
|
|
|
+ priceFour: null, // 促销价4
|
|
|
+ goodsPictures: item.filesList.length > 0 ? item.filesList[0].fileName : '', // 商品图片名称
|
|
|
+ url: item.filesList.length > 0 ? item.filesList[0].url : '',// 商品图片地址
|
|
|
+ $cellEdit: true
|
|
|
})
|
|
|
+ }
|
|
|
+ this.detailsVisible = false
|
|
|
+ },
|
|
|
+ // 详情添加商品
|
|
|
+ detailsAddButton() {
|
|
|
+ this.detailsVisible = true
|
|
|
+ let page = { pageSize: 20, currentPage: 1 }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.assemblyDetails.listAllPfun()
|
|
|
+ this.$refs.assemblyDetails.onLoad(page)
|
|
|
+ })
|
|
|
|
|
|
|
|
|
- },
|
|
|
- //自定义列保存
|
|
|
- async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
- /**
|
|
|
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
- */
|
|
|
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
- if (inSave) {
|
|
|
- this.$message.success("保存成功");
|
|
|
- //关闭窗口
|
|
|
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
- }
|
|
|
- },
|
|
|
- //自定义列重置
|
|
|
- async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
- this[option] = this[optionBack];
|
|
|
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
- if (inSave) {
|
|
|
- this.$message.success("重置成功");
|
|
|
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
- }
|
|
|
- },
|
|
|
- // 返回列表
|
|
|
- backToList() {
|
|
|
- this.$emit("backToList");
|
|
|
+ },
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 返回列表
|
|
|
+ backToList() {
|
|
|
+ this.$emit("backToList");
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style scoped></style>
|