|
@@ -4,68 +4,45 @@
|
|
|
<el-row>
|
|
|
<el-col :span="4">
|
|
|
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
|
|
|
- @save="corpTypeVisible = true">
|
|
|
+ @save="corpTypeVisible = true">
|
|
|
<template slot="addBtn">
|
|
|
<i class="el-icon-setting" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
|
|
|
- @click="corpTypeVisible = true"></i>
|
|
|
+ @click="corpTypeVisible = true"></i>
|
|
|
</template>
|
|
|
</avue-tree>
|
|
|
</el-col>
|
|
|
<el-col :span="20">
|
|
|
- <avue-crud
|
|
|
- :option="option"
|
|
|
- :search.sync="search"
|
|
|
- v-model="form"
|
|
|
- :table-loading="loading"
|
|
|
- :data="dataList"
|
|
|
- ref="crud"
|
|
|
- :key="key"
|
|
|
- @on-load="onLoad"
|
|
|
- @selection-change="selectionChange"
|
|
|
- :before-open="beforeOpen"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @search-change="searchChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @resetColumn="resetColumnTwo('crud','option','optionList',273)"
|
|
|
- @saveColumn="saveColumnTwo('crud','option','optionList',273)"
|
|
|
- :page.sync="page">
|
|
|
+ <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
|
|
|
+ ref="crud" :key="key" @on-load="onLoad" @selection-change="selectionChange" :before-open="beforeOpen"
|
|
|
+ @row-update="rowUpdate" @search-change="searchChange" @refresh-change="refreshChange"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 273)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 273)" :page.sync="page">
|
|
|
+
|
|
|
<template slot-scope="{type,size,row,index}" slot="menu">
|
|
|
- <el-button icon="el-icon-edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,index)">编辑
|
|
|
+ <el-button icon="el-icon-edit" :size="size" :type="type" @click="getDetail(row)">编辑
|
|
|
+ <!-- @click="$refs.crud.rowEdit(row, index)" -->
|
|
|
</el-button>
|
|
|
<!-- <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">-->
|
|
|
<!-- {{ row.upperFrame == 0 ? '上架' : '下架' }}-->
|
|
|
<!-- </el-button>-->
|
|
|
- <el-tooltip :content="`${row.upAndDownShelves == 0?'上架':'下架'}`" placement="top">
|
|
|
- <el-switch
|
|
|
- style="margin-left: 10px"
|
|
|
- v-model="row.upAndDownShelves"
|
|
|
- @change="check(row)"
|
|
|
- active-value="1"
|
|
|
- inactive-value="0">
|
|
|
+ <el-tooltip :content="`${row.upAndDownShelves == 0 ? '上架' : '下架'}`" placement="top">
|
|
|
+ <el-switch style="margin-left: 10px" v-model="row.upAndDownShelves" @change="check(row)" active-value="1"
|
|
|
+ inactive-value="0">
|
|
|
</el-switch>
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
|
|
|
<template slot-scope="{type,size,row,$index}" slot="menuLeft">
|
|
|
- <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary"
|
|
|
- size="small"
|
|
|
- @click="change(row,'up')">批量上架
|
|
|
+ <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary" size="small"
|
|
|
+ @click="change(row, 'up')">批量上架
|
|
|
</el-button>
|
|
|
<el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="danger" size="small"
|
|
|
- @click="change(row,'down')">批量下架
|
|
|
+ @click="change(row, 'down')">批量下架
|
|
|
</el-button>
|
|
|
- <el-button class="el-icon-bottom" type="warning"
|
|
|
- size="small" @click="excelBox = true">
|
|
|
+ <el-button class="el-icon-bottom" type="warning" size="small" @click="excelBox = true">
|
|
|
导入
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <template slot="photoForm">
|
|
|
- <c-upload :data="[]" display deleteUrl="/api/blade-client/goodsfiles/delete" :enumerationValue="160" />
|
|
|
- </template>
|
|
|
- <template slot="detailForm">
|
|
|
- <avue-ueditor v-model="form.detail"
|
|
|
- v-bind="options"></avue-ueditor>
|
|
|
- </template>
|
|
|
</avue-crud>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -82,26 +59,40 @@
|
|
|
温馨提示 第一次导入时请先下载模板
|
|
|
</p>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="编辑" :visible.sync="dialogVisible" append-to-body width="60%">
|
|
|
+ <avue-form v-if="dialogVisible" ref="formData" v-model="formData" :option="optionList"
|
|
|
+ @submit="confirmSynchronization">
|
|
|
+ <template slot="filesList">
|
|
|
+ <c-upload :data="formData.filesList" display deleteUrl="/api/blade-sales-part/productLaunch/update"
|
|
|
+ :enumerationValue="160" />
|
|
|
+ </template>
|
|
|
+ <template slot="detailsText">
|
|
|
+ <avue-ueditor v-model="formData.detailsText" :options="optionsUeditor"></avue-ueditor>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ <span slot="menuform" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmSynchronization">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {getList, submit,batchOperationProductLaunch} from "@/api/tirePartsMall/basicData/listingManagement/index.js";
|
|
|
-import {getToken} from "@/util/auth";
|
|
|
+import { getList, submit, batchOperationProductLaunch, getDetail } from "@/api/tirePartsMall/basicData/listingManagement/index.js";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
return {
|
|
|
- options: {
|
|
|
+ dialogVisible: false,
|
|
|
+ formData: false,
|
|
|
+ optionsUeditor: {
|
|
|
//普通上传地址
|
|
|
+ // action:'https://avuejs.com/imgupload',
|
|
|
action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
headers: { "Blade-Auth": "Bearer " + getToken() },
|
|
|
- propsHttp: {
|
|
|
- home:'',
|
|
|
- url:'url',
|
|
|
- res: 'data'
|
|
|
- },
|
|
|
props: {
|
|
|
res: "data",
|
|
|
url: 'link'
|
|
@@ -143,7 +134,7 @@ export default {
|
|
|
value: "value",
|
|
|
}
|
|
|
},
|
|
|
- excelBox:false,
|
|
|
+ excelBox: false,
|
|
|
corpTypeVisible: false,
|
|
|
treeData: [],
|
|
|
loading: false,
|
|
@@ -202,10 +193,6 @@ export default {
|
|
|
prop: 'inventory',
|
|
|
overHidden: true,
|
|
|
}, {
|
|
|
- label: '商城价格',
|
|
|
- prop: 'salesPrice',
|
|
|
- overHidden: true,
|
|
|
- }, {
|
|
|
label: '产品状态',
|
|
|
prop: 'upAndDownShelves',
|
|
|
filterable: true,
|
|
@@ -222,55 +209,56 @@ export default {
|
|
|
label: "下架",
|
|
|
value: 0
|
|
|
}]
|
|
|
- }, {
|
|
|
- label: "售价1",
|
|
|
- prop: "price1",
|
|
|
- hide: true,
|
|
|
- showColumn: false,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "售价2",
|
|
|
- prop: "price2",
|
|
|
- hide: true,
|
|
|
- showColumn: false,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "售价3",
|
|
|
- prop: "price3",
|
|
|
- hide: true,
|
|
|
- showColumn: false,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "售价4",
|
|
|
- prop: "price4",
|
|
|
- hide: true,
|
|
|
- showColumn: false,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "共享公司",
|
|
|
- prop: "company",
|
|
|
- hide: true,
|
|
|
- showColumn: false,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "详情附件",
|
|
|
- prop: "photo",
|
|
|
- hide: true,
|
|
|
- showColumn: false,
|
|
|
- overHidden: true,
|
|
|
- span:24,
|
|
|
- },{
|
|
|
- label: "商品详情",
|
|
|
- prop: "deail",
|
|
|
- hide: true,
|
|
|
- showColumn: false,
|
|
|
- overHidden: true,
|
|
|
- }]
|
|
|
+ }, {
|
|
|
+ label: "售价1",
|
|
|
+ prop: "priceOne",
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "售价2",
|
|
|
+ prop: "priceTwo",
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "售价3",
|
|
|
+ prop: "priceThree",
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "售价4",
|
|
|
+ prop: "priceFour",
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "共享公司",
|
|
|
+ prop: "sharedCompany",
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "详情附件",
|
|
|
+ prop: "filesList",
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ span: 24,
|
|
|
+ }, {
|
|
|
+ label: "商品详情",
|
|
|
+ prop: "detailsText",
|
|
|
+ hide: true,
|
|
|
+ span: 24,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -293,8 +281,8 @@ export default {
|
|
|
methods: {
|
|
|
derivation() {
|
|
|
window.open(
|
|
|
- `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader
|
|
|
- }=${getToken()}`
|
|
|
+ `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
);
|
|
|
},
|
|
|
uploadAfter(res, done, loading, column) {
|
|
@@ -333,6 +321,43 @@ export default {
|
|
|
loading()
|
|
|
})
|
|
|
},
|
|
|
+ // 获取详情
|
|
|
+ getDetail(row) {
|
|
|
+ getDetail({ id: row.id }).then(res => {
|
|
|
+ console.log("res", res.data.data)
|
|
|
+ this.formData = JSON.parse(JSON.stringify(res.data.data));
|
|
|
+ this.dialogVisible = true
|
|
|
+ console.log("Res", this.form)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 编辑确定
|
|
|
+ confirmSynchronization(form, done, loading) {
|
|
|
+ console.log("formdata", this.formData, this.formData.filesList[0].$version)
|
|
|
+ if (this.formData.filesList.length > 0) {
|
|
|
+ let flag = this.formData.filesList.some(item => { return item.$version == '主图' })
|
|
|
+ console.log("flag", flag)
|
|
|
+ if (!flag) {
|
|
|
+ this.$message.warning('请选择主图')
|
|
|
+ done()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log(1)
|
|
|
+ }
|
|
|
+ console.log(2)
|
|
|
+ submit({
|
|
|
+ ...this.formData
|
|
|
+ }).then(res => {
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ this.dialogVisible = false;
|
|
|
+ // this.$message({
|
|
|
+
|
|
|
+ // })
|
|
|
+ done()
|
|
|
+ }).catch((err) => {
|
|
|
+ loading()
|
|
|
+ console.log("Eee", err)
|
|
|
+ })
|
|
|
+ },
|
|
|
check(row) {
|
|
|
// if (row.flag == 0) {
|
|
|
// if (!Number(row.salesPrice)) return this.$message.error("上架失败,商城价格不能为0")
|
|
@@ -387,7 +412,7 @@ export default {
|
|
|
current: page.currentPage,
|
|
|
size: page.pageSize,
|
|
|
...Object.assign(params, this.search),
|
|
|
- billType:0
|
|
|
+ billType: 0
|
|
|
}
|
|
|
this.loading = true
|
|
|
getList(params).then(res => {
|
|
@@ -401,7 +426,7 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
-//自定义列保存
|
|
|
+ //自定义列保存
|
|
|
async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
/**
|
|
|
* 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
@@ -418,7 +443,7 @@ export default {
|
|
|
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]);
|
|
@@ -434,5 +459,4 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-</style>
|
|
|
+<style scoped></style>
|