|
|
@@ -0,0 +1,1006 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basic-container>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <avue-tree ref="treeRef" :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;">
|
|
|
+ </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" @search-reset="resetChange"
|
|
|
+ @refresh-change="refreshChange" @row-del="rowDel"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 437)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 437)" :page.sync="page">
|
|
|
+ <template slot="filesListForm">
|
|
|
+ <span style="font-size: 12px;">(图片文件像素推荐700X700,有且只允许有一张主图,其余均为副图)</span>
|
|
|
+ <c-upload :data="form.filesList" display basic deleteUrl="/api/blade-sales-part/productLaunchFiles/remove"
|
|
|
+ :enumerationValue="160" />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="detailsTextForm">
|
|
|
+ <avue-ueditor v-model="form.detailsText" :options="optionsUeditor">
|
|
|
+ </avue-ueditor>
|
|
|
+ </template>
|
|
|
+ <!-- <template slot-scope="{ row, index }" slot="inventory">
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="storeInventoryOpen(row)">{{ row.inventory }}
|
|
|
+ </span>
|
|
|
+ </template> -->
|
|
|
+ <template slot-scope="{type,size,row,index}" slot="menu">
|
|
|
+ <el-button :size="size" :type="type" :disabled="row.shareStatus != '暂存'"
|
|
|
+ @click="$refs.crud.rowEdit(row, index)">编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button :size="size" :type="type" :disabled="row.shareStatus != '暂存'"
|
|
|
+ @click="annexOpen(row, index)">商城图片
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot-scope="{type,size,row,$index}" slot="menuLeft">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-top" @click="outExport">导出</el-button>
|
|
|
+ <!-- <el-button class="el-icon-bottom" type="warning" size="small" @click="excelBoxfun('code')">
|
|
|
+ 按编码导入
|
|
|
+ </el-button> -->
|
|
|
+ <!-- <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary"
|
|
|
+ size="small" @click="change(row, '1')">批量确认共享
|
|
|
+ </el-button>
|
|
|
+ <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="danger" size="small"
|
|
|
+ @click="change(row, '2')">批量撤销共享
|
|
|
+ </el-button> -->
|
|
|
+ <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary"
|
|
|
+ size="small" @click="change(row, '3')">批量上架
|
|
|
+ </el-button>
|
|
|
+ <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="danger" size="small"
|
|
|
+ @click="change(row, '4')">批量下架
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </basic-container>
|
|
|
+ <el-dialog title="选择产品" v-if="dialogVisibles" append-to-body class="el-dialogDeep" :visible.sync="dialogVisibles"
|
|
|
+ width="80%" :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false"
|
|
|
+ @close="dialogVisibles = false">
|
|
|
+ <el-row :style="{ height: rowHeight }">
|
|
|
+ <el-col :span="5">
|
|
|
+ <div>
|
|
|
+ <el-scrollbar>
|
|
|
+ <basic-container>
|
|
|
+ <avue-tree style="height: 60vh;overflow-y: auto" :option="treeOption" :data="treeData"
|
|
|
+ @node-click="nodeClick" />
|
|
|
+ </basic-container>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="19">
|
|
|
+ <!-- <basic-container> -->
|
|
|
+ <avue-crud :search.sync="query" :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="cruds"
|
|
|
+ :reserve-selection="true" @refresh-change="refreshChangeCost" @selection-change="selectionChangeCost"
|
|
|
+ @search-change="goodsSearchCost" @search-reset="goodsresetChange" :page.sync="pages" @on-load="onLoad"
|
|
|
+ @saveColumn="saveGoodsColumn" @resetColumn="resetGoodsColumn">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="tabHandle">
|
|
|
+ <el-tab-pane label="查询结果" name="searchList" />
|
|
|
+ <el-tab-pane label="已选定数据" name="importStaging" />
|
|
|
+ </el-tabs>
|
|
|
+ </template>
|
|
|
+ <template slot="priceOne" slot-scope="{row}">
|
|
|
+ <el-input v-model="row.priceOne" size="small" :controls="false" :precision="0" style="width: 100%"
|
|
|
+ @change="selectChangefun($event, row)" @focus="selectFocusfun(row)" />
|
|
|
+ </template>
|
|
|
+ <template slot="priceTwo" slot-scope="{ row }">
|
|
|
+ <el-input v-model="row.priceTwo" size="small" @change="selectChangefun($event, row)"></el-input>
|
|
|
+ <!-- <span v-else>{{ row.refreshChange | IntegerFormat }}</span> -->
|
|
|
+ </template>
|
|
|
+ <template slot="priceThree" slot-scope="{ row }">
|
|
|
+ <el-input v-model="row.priceThree" size="small" @change="selectChangefun($event, row)"></el-input>
|
|
|
+ <!-- <span v-else>{{ row.refreshChange | IntegerFormat }}</span> -->
|
|
|
+ </template>
|
|
|
+ <template slot="priceFour" slot-scope="{ row }">
|
|
|
+ <el-input v-model="row.priceFour" size="small" @change="selectChangefun($event, row)"></el-input>
|
|
|
+ <!-- <span v-else>{{ row.refreshChange | IntegerFormat }}</span> -->
|
|
|
+ </template>
|
|
|
+ <template slot="shareCost" slot-scope="{ row }">
|
|
|
+ <el-input v-model="row.shareCost" size="small"></el-input>
|
|
|
+ <!-- <span v-else>{{ row.refreshChange | IntegerFormat }}</span> -->
|
|
|
+ </template>
|
|
|
+ <template slot="sharedCompany" slot-scope="{ row, index }">
|
|
|
+ <span style="display:flex">
|
|
|
+ <el-select v-model="row.sharedCompany" multiple placeholder="请选择" size="small" filterable
|
|
|
+ style="width:60%">
|
|
|
+ <el-option v-for="item in sharedCompanyoptions" :key="item.id" :label="item.fullName"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="menu">
|
|
|
+ <el-button type="text" icon="el-icon-edit" size="small"
|
|
|
+ @click.stop="importStagList(scope.row, scope.index)" v-if="activeName == 'searchList'"
|
|
|
+ :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
|
|
|
+ </el-button>
|
|
|
+ <el-button type="text" icon="el-icon-delete" size="small"
|
|
|
+ @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <!-- </basic-container> -->
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisibles = false" :loading="saveLoading">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="importGoods" :loading="saveLoading">导入</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="添加产品" v-if="excelBox" append-to-body :visible.sync="excelBox" :close-on-click-modal="false"
|
|
|
+ width="555px">
|
|
|
+ <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
|
|
|
+ <template slot="excelTemplate">
|
|
|
+ <el-button type="primary" @click="derivation">
|
|
|
+ 点击下载<i class="el-icon-download el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ <p style="text-align: center;color: #DC0505">
|
|
|
+ 温馨提示 第一次导入时请先下载模板
|
|
|
+ </p>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="附件上传" append-to-body :visible.sync="enclosure" 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" :show-file-list="false" multiple>
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
+ <div class="el-upload__tip" slot="tip">
|
|
|
+ 如上传文件过大,请耐心等待上传成功
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ getList,
|
|
|
+ groundingList,
|
|
|
+ submit,
|
|
|
+ batchOperationProductLaunch,
|
|
|
+ getDetail,
|
|
|
+ remove,
|
|
|
+ productLaunch,
|
|
|
+ deptList,
|
|
|
+ listAllP,
|
|
|
+ groundingListZero,
|
|
|
+ batchConfirmSharing,
|
|
|
+ batchRevokeSharing,
|
|
|
+ batchSharingConfirm,
|
|
|
+ batchSharingRevoke
|
|
|
+} from "@/api/tirePartsMall/basicData/shareListing/index.js";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+import commodity from "./commodity.json"
|
|
|
+import { getCorpTypes } from "@/api/tirePartsMall/basicData/commodityInformation";
|
|
|
+import { isProcurement } from "@/api/basicData/configuration";
|
|
|
+export default {
|
|
|
+ name: "index",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ query: {},
|
|
|
+ action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
+ headers: { "Blade-Auth": "Bearer " + getToken() },
|
|
|
+ orderList: [],
|
|
|
+ enclosure: false,
|
|
|
+ dataId: 0,
|
|
|
+ rowImg: [],
|
|
|
+ data: [],
|
|
|
+ sharedCompanyoptions: [],
|
|
|
+ activeName: 'searchList',
|
|
|
+ dialogVisibles: false,
|
|
|
+ selectedNodes: [],// 存储选择节点的数组
|
|
|
+ tableData: [],
|
|
|
+ //上架列表
|
|
|
+ goodsListShow: [],
|
|
|
+ // 商品列表暂存
|
|
|
+ goodsListSave: [],
|
|
|
+ goodsListPolicy: [],
|
|
|
+ optionsUeditor: {
|
|
|
+ //普通上传地址
|
|
|
+ // action:'https://avuejs.com/imgupload',
|
|
|
+ action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
+ headers: { "Blade-Auth": "Bearer " + getToken() },
|
|
|
+ props: {
|
|
|
+ res: "data",
|
|
|
+ url: 'link'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ optionTwo: commodity,
|
|
|
+ excelForm: {},
|
|
|
+ excelOption: {
|
|
|
+ submitBtn: false,
|
|
|
+ emptyBtn: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "模板下载",
|
|
|
+ prop: "excelTemplate",
|
|
|
+ formslot: true,
|
|
|
+ span: 24
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "模板上传",
|
|
|
+ prop: "excelFile",
|
|
|
+ type: "upload",
|
|
|
+ drag: true,
|
|
|
+ loadText: "模板上传中,请稍等",
|
|
|
+ span: 24,
|
|
|
+ propsHttp: {
|
|
|
+ res: "data"
|
|
|
+ },
|
|
|
+ tip: "请上传 .xls,.xlsx 标准格式文件",
|
|
|
+ action: "/api/blade-sales-part/productLaunch/import-productLaunch"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ templateUrl: '/api/blade-sales-part/productLaunch/export-productLaunch',
|
|
|
+ treeOption: {
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+ size: "small",
|
|
|
+ props: {
|
|
|
+ labelText: "标题",
|
|
|
+ label: "cname",
|
|
|
+ value: "id",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ excelBox: false,
|
|
|
+ // 左侧搜索
|
|
|
+ treeData: [],
|
|
|
+ loading: false,
|
|
|
+ search: {},
|
|
|
+ form: {},
|
|
|
+ dataList: [],
|
|
|
+ selectionList: [],
|
|
|
+ page: {
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
+ pageList: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ key: 0,
|
|
|
+ option: {},
|
|
|
+ optionList: {
|
|
|
+ viewBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ addBtn: false,
|
|
|
+ index: true,
|
|
|
+ span: 8,
|
|
|
+ border: true,
|
|
|
+ selection: true,
|
|
|
+ height: "auto",
|
|
|
+ updateBtnText: '保存',
|
|
|
+ searchMenuPosition: "right",
|
|
|
+ align: "center",
|
|
|
+ menuWidth: 160,
|
|
|
+ searchSpan: 8,
|
|
|
+ searchIcon: true,
|
|
|
+ searchIndex: 2,
|
|
|
+ highlightCurrentRow: true,
|
|
|
+ dialogWidth: "90%",
|
|
|
+ column: [{
|
|
|
+ label: '商品名称',
|
|
|
+ prop: 'goodsName',
|
|
|
+ search: true,
|
|
|
+ disabled: true,
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: '规格型号',
|
|
|
+ prop: 'specificationAndModel',
|
|
|
+ disabled: true,
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: '花纹',
|
|
|
+ prop: 'brandItem',
|
|
|
+ disabled: true,
|
|
|
+ search: true, // 是否搜索
|
|
|
+ // type: 'select',
|
|
|
+ // remote:true, // 是否为远程搜索
|
|
|
+ // dicUrl:'/api/blade-sales-part/productLaunch/list?brandItem={{key}}', //key为当前输入值
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '库存',
|
|
|
+ prop: 'inventory',
|
|
|
+ disabled: true,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "品牌",
|
|
|
+ prop: "brandId",
|
|
|
+ search: true,
|
|
|
+ type: 'select',
|
|
|
+ props: {
|
|
|
+ label: 'cname',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
+ dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP&enableOrNot=1',
|
|
|
+ hide: true,
|
|
|
+ filterable: true,
|
|
|
+ disabled: true,
|
|
|
+ overHidden: false,
|
|
|
+ }, {
|
|
|
+ label: "品牌",
|
|
|
+ prop: "brandName",
|
|
|
+ disabled: true,
|
|
|
+ overHidden: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "售价1",
|
|
|
+ prop: "priceOne",
|
|
|
+ hide: false,
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: "售价2",
|
|
|
+ prop: "priceTwo",
|
|
|
+ hide: false,
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: "售价3",
|
|
|
+ prop: "priceThree",
|
|
|
+ hide: false,
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: "售价4",
|
|
|
+ prop: "priceFour",
|
|
|
+ hide: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "共享成本",
|
|
|
+ prop: "shareCost",
|
|
|
+ hide: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "共享公司",
|
|
|
+ prop: "srcSalesCompanyName",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ type: 'select',
|
|
|
+ filterable: true,
|
|
|
+ disabled: true,
|
|
|
+ props: {
|
|
|
+ label: 'deptName',
|
|
|
+ value: 'deptName'
|
|
|
+ },
|
|
|
+ dicUrl: '/api/blade-system/dept/deptListAll',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "商品图片",
|
|
|
+ prop: "filesList",
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ span: 24,
|
|
|
+ }, {
|
|
|
+ label: "防爆",
|
|
|
+ prop: "explosionProof",
|
|
|
+ display: false,
|
|
|
+ search: true,
|
|
|
+ hide: false,
|
|
|
+ showColumn: true,
|
|
|
+ span: 8,
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '否',
|
|
|
+ value: 0
|
|
|
+ }, {
|
|
|
+ label: '是',
|
|
|
+ value: 1
|
|
|
+ }],
|
|
|
+ }, {
|
|
|
+ label: "静音棉",
|
|
|
+ prop: "originalFactory",
|
|
|
+ display: false,
|
|
|
+ search: true,
|
|
|
+ hide: false,
|
|
|
+ showColumn: true,
|
|
|
+ span: 8,
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '否',
|
|
|
+ value: "0"
|
|
|
+ }, {
|
|
|
+ label: '是',
|
|
|
+ value: "1"
|
|
|
+ }],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "自修补",
|
|
|
+ prop: "selfRecovery",
|
|
|
+ display: false,
|
|
|
+ search: true,
|
|
|
+ hide: false,
|
|
|
+ showColumn: true,
|
|
|
+ span: 8,
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '否',
|
|
|
+ value: "0"
|
|
|
+ }, {
|
|
|
+ label: '是',
|
|
|
+ value: "1"
|
|
|
+ }],
|
|
|
+ }, {
|
|
|
+ label: "商品详情",
|
|
|
+ prop: "detailsText",
|
|
|
+ hide: true,
|
|
|
+ span: 24,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "共享状态",
|
|
|
+ prop: "shareStatus",
|
|
|
+ search: true,
|
|
|
+ showColumn: true,
|
|
|
+ addDisplay: false,
|
|
|
+ editDisplay: false,
|
|
|
+ viewDisplay: false,
|
|
|
+ span: 8,
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '暂存',
|
|
|
+ value: "暂存"
|
|
|
+ }, {
|
|
|
+ label: '已共享',
|
|
|
+ value: "已共享"
|
|
|
+ }, {
|
|
|
+ label: '已确认',
|
|
|
+ value: "已确认"
|
|
|
+ }],
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(437), this.optionList);
|
|
|
+ this.optionTwo = await this.getColumnData(
|
|
|
+ this.getColumnName(438),
|
|
|
+ this.optionTwo
|
|
|
+ );
|
|
|
+ isProcurement({ "param": "whether.model" }).then(res => {
|
|
|
+ if (res.data.data == 1) {
|
|
|
+ this.findObject(this.option.column, "brandItem").label = '规格型号1'
|
|
|
+ this.findObject(this.optionTwo.column, "brandItem").label = '规格型号1'
|
|
|
+ this.findObject(this.optionTwo.column, "goodsName").label = '名称'
|
|
|
+ this.findObject(this.optionTwo.column, "code").label = '编码'
|
|
|
+ this.findObject(this.optionTwo.column, "goodsTypeId").label = '类别'
|
|
|
+ this.findObject(this.option.column, "explosionProof").search = false
|
|
|
+ this.findObject(this.option.column, "originalFactory").search = false
|
|
|
+ this.findObject(this.option.column, "selfRecovery").search = false
|
|
|
+ this.findObject(this.option.column, "explosionProof").hide = true
|
|
|
+ this.findObject(this.option.column, "originalFactory").hide = true
|
|
|
+ this.findObject(this.option.column, "selfRecovery").hide = true
|
|
|
+ this.findObject(this.option.column, "explosionProof").showColumn = false
|
|
|
+ this.findObject(this.option.column, "originalFactory").showColumn = false
|
|
|
+ this.findObject(this.option.column, "selfRecovery").showColumn = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.key++
|
|
|
+ let i = 0;
|
|
|
+ this.option.column.forEach(item => {
|
|
|
+ if (item.search) i++
|
|
|
+ })
|
|
|
+ this.$refs.crud.dicInit()
|
|
|
+ if (i % 3 !== 0) {
|
|
|
+ const num = 3 - Number(i % 3)
|
|
|
+ this.option.searchMenuSpan = num * 8;
|
|
|
+ this.option.searchMenuPosition = "right";
|
|
|
+ }
|
|
|
+ listAllP().then(res => {
|
|
|
+ this.treeData = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 导入
|
|
|
+ excelBoxfun(name) {
|
|
|
+ if (name == '名称') {
|
|
|
+ this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/shareputonshelves/importShareProductLaunch'
|
|
|
+ this.templateUrl = '/api/blade-sales-part/shareputonshelves/exportShareProductLaunch'
|
|
|
+ }
|
|
|
+ // else if (name == 'code') {
|
|
|
+ // this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/productLaunch/import-productLaunch-code'
|
|
|
+ // this.templateUrl = '/api/blade-sales-part/productLaunch/export-productLaunch-code'
|
|
|
+ // }
|
|
|
+ this.excelBox = true
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ outExport() {
|
|
|
+ let config = { params: { ...this.search, whetherIntegral: 0 } }
|
|
|
+ if (config.params) {
|
|
|
+ for (const propName of Object.keys(config.params)) {
|
|
|
+ const value = config.params[propName];
|
|
|
+ if (value !== null && typeof (value) !== "undefined") {
|
|
|
+ if (value instanceof Array) {
|
|
|
+ for (const key of Object.keys(value)) {
|
|
|
+ let params = propName + '[' + key + ']';
|
|
|
+ config.params[params] = value[key]
|
|
|
+ }
|
|
|
+ delete config.params[propName]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const routeData = this.$router.resolve({
|
|
|
+ path: '/api/blade-sales-part/shareputonshelves/exportShareProductLaunch', //跳转目标窗口的地址
|
|
|
+ query: {
|
|
|
+ ...config.params, //括号内是要传递给新窗口的参数
|
|
|
+ identification: this.url
|
|
|
+ }
|
|
|
+ })
|
|
|
+ window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
|
|
|
+ },
|
|
|
+ // 商城图片上传
|
|
|
+ onSuccess(response, file, fileList) {
|
|
|
+ let version = '2'
|
|
|
+ if (this.form.filesList.length == 0) {
|
|
|
+ version = '0'
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form.filesList.push({
|
|
|
+ fileName: response.data.originalName,
|
|
|
+ url: response.data.link,
|
|
|
+ sort: this.form.filesList.length,
|
|
|
+ version: version
|
|
|
+ })
|
|
|
+ submit({
|
|
|
+ ...this.form
|
|
|
+ }).then(res => {
|
|
|
+ this.$message.success("修改成功")
|
|
|
+ this.enclosure = false
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectFocusfun(row) {
|
|
|
+ console.log(row, 503)
|
|
|
+ console.log(this.$refs.cruds, 504)
|
|
|
+ },
|
|
|
+ selectChangefun(value, row) {
|
|
|
+ console.log(value, 506)
|
|
|
+ if (value && Number(value) > 0) {
|
|
|
+ this.$refs.cruds.toggleRowSelection(row, true);
|
|
|
+ } else {
|
|
|
+ this.$refs.cruds.toggleRowSelection(row, false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //打开附件
|
|
|
+ annexOpen(row, index) {
|
|
|
+ this.dataId = index
|
|
|
+ this.rowImg = row
|
|
|
+ this.orderList = row.filesList ? row.filesList : [];
|
|
|
+ for (let order of this.orderList) {
|
|
|
+ order.paymentType = order.typeFiles
|
|
|
+ }
|
|
|
+ getDetail({ id: row.id }).then(res => {
|
|
|
+ this.form = res.data.data
|
|
|
+ })
|
|
|
+ this.enclosure = true
|
|
|
+ },
|
|
|
+ // 附件保存
|
|
|
+ saveAnnex() {
|
|
|
+ if (this.orderList.length > 0) {
|
|
|
+ // 循环把编辑状态变成保存状态
|
|
|
+ this.orderList.map((item) => {
|
|
|
+ if (item.$cellEdit == true) {
|
|
|
+ item.$cellEdit = false
|
|
|
+ } else {
|
|
|
+ item.$cellEdit = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let flag = this.orderList.some(item => {
|
|
|
+ return item.$version == '主图'
|
|
|
+ })
|
|
|
+ if (!flag) {
|
|
|
+ this.$message.warning('请选择主图')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.rowImg.filesList = this.orderList;
|
|
|
+ submit({
|
|
|
+ ...this.rowImg
|
|
|
+ }).then(res => {
|
|
|
+ this.$message.success("添加成功")
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ })
|
|
|
+ this.enclosure = false
|
|
|
+ },
|
|
|
+ derivation() {
|
|
|
+ window.open(
|
|
|
+ `${this.templateUrl}?${this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ uploadAfter(res, done, loading, column) {
|
|
|
+ this.excelBox = false;
|
|
|
+ done();
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+ nodeClick(data) {
|
|
|
+ this.search.brandId = data.id
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+ //刷新
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ },
|
|
|
+ //刷新触发
|
|
|
+ refreshChangeCost() {
|
|
|
+ // this.treeDeptId = ''
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page);
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ // sharedCompanyList
|
|
|
+ // this.search.sharedCompanyList = params.sharedCompany;
|
|
|
+ // Vue.delete(params, 'sharedCompany');
|
|
|
+ // Vue.delete(this.search, 'sharedCompany');
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params)
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list
|
|
|
+ },
|
|
|
+ selectionChangeCost(list) {
|
|
|
+ // this.goodsListSave = list
|
|
|
+ this.tableData = list
|
|
|
+ },
|
|
|
+ //新增
|
|
|
+ commoditySelection() {
|
|
|
+ delete this.page.brandId
|
|
|
+ this.goodsListShow = []
|
|
|
+
|
|
|
+ this.dialogVisibles = !this.dialogVisibles
|
|
|
+ this.tableData = []
|
|
|
+ this.goodsListSave = [];
|
|
|
+ },
|
|
|
+ //打开表单前
|
|
|
+ beforeOpen(done, type) {
|
|
|
+ getDetail({ id: this.form.id }).then(res => {
|
|
|
+ this.form = res.data.data
|
|
|
+ done();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 标签页切换
|
|
|
+ tabHandle(data) {
|
|
|
+ if (data.name == 'searchList') {
|
|
|
+ this.goodsListShow = this.data;
|
|
|
+ this.page.total = this.pageList.total
|
|
|
+ } else if (data.name == 'importStaging') {
|
|
|
+ this.goodsListShow = this.goodsListSave;
|
|
|
+ this.page.total = 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ removeStagList(row, index, type) {
|
|
|
+ if (type === 'policy') {
|
|
|
+ this.goodsListPolicy.splice(row.$index, 1)
|
|
|
+ if (this.goodsListPolicy.length == 0) {
|
|
|
+ this.customerBuyFree.selection = true
|
|
|
+ this.optionPolicy.selection = true
|
|
|
+ this.$set(this.customerBuyFree, 'menu', true)
|
|
|
+ }
|
|
|
+ } else if (type === 'policy_buyAndGive') {
|
|
|
+ this.buyAndGiveList.splice(row.$index, 1)
|
|
|
+ if (this.buyAndGiveList.length == 0) {
|
|
|
+ this.customerBuyFree.selection = true
|
|
|
+ this.optionPolicy.selection = true
|
|
|
+ this.$set(this.optionPolicy, 'menu', true)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log(row)
|
|
|
+ this.goodsListSave.splice(row.$index, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowDel(row, index) {
|
|
|
+ this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ remove(row.id).then((res) => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ this.dataList.splice(index, 1);
|
|
|
+ this.onLoad(this.page)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //编辑确定
|
|
|
+ rowUpdate(form, index, done, loading) {
|
|
|
+ if (this.form.filesList.length > 0) {
|
|
|
+ let flag = this.form.filesList.some(item => {
|
|
|
+ return item.$version == '主图'
|
|
|
+ })
|
|
|
+ if (!flag) {
|
|
|
+ this.$message.warning('请选择主图')
|
|
|
+ // done()
|
|
|
+ loading()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 循环把编辑状态变成保存状态
|
|
|
+ this.form.filesList.map((item) => {
|
|
|
+ if (item.$cellEdit == true) {
|
|
|
+ // this.$set(item, "$cellEdit", false);
|
|
|
+ item.$cellEdit = false
|
|
|
+ } else {
|
|
|
+ // this.$set(item, "$cellEdit", true);
|
|
|
+ item.$cellEdit = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log({ ...this.form }.detailsText, 651)
|
|
|
+ submit({
|
|
|
+ ...this.form
|
|
|
+ }).then(res => {
|
|
|
+ this.$message.success("修改成功")
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ done()
|
|
|
+ }).catch((err) => {
|
|
|
+ loading()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetChange() {
|
|
|
+
|
|
|
+ if (document.getElementsByClassName("is-current")[0]) {
|
|
|
+ let selected = document.getElementsByClassName("is-current")[0]
|
|
|
+ selected.classList.remove("is-current")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goodsresetChange() {
|
|
|
+ this.query = this.$options.data().query;
|
|
|
+ },
|
|
|
+ // 确认导入
|
|
|
+ importGoods() {
|
|
|
+ if (!this.goodsListSave.length) {
|
|
|
+ this.$message.error('请选择')
|
|
|
+ }
|
|
|
+ if (this.goodsListSave.some(item => item.priceOne == undefined || item.priceTwo == undefined || item.priceThree == undefined || item.priceFour == undefined || item.shareCost == 0)) {
|
|
|
+ this.$message.error('请填写所有售价和共享成本');
|
|
|
+ } else {
|
|
|
+ if (this.goodsListSave.length > 0) {
|
|
|
+ this.goodsListSaveHandle()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ goodsListSaveHandle() {
|
|
|
+ this.goodsListSave.forEach(item => {
|
|
|
+ item.sharedCompany = item.sharedCompany ? item.sharedCompany.toString() : '';
|
|
|
+ this.goodsListSave.specificationAndModel = item.typeno
|
|
|
+ delete this.goodsListSave.typeno
|
|
|
+ })
|
|
|
+ productLaunch(this.goodsListSave).then(res => {
|
|
|
+ this.dialogVisibles = !this.dialogVisibles
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ importStagList(row, index, type) {
|
|
|
+ if (type === 'policy') {
|
|
|
+ this.goodsListPolicy.push(row);
|
|
|
+ if (this.goodsListPolicy.length > 0) {
|
|
|
+ this.customerBuyFree.selection = false
|
|
|
+ this.optionPolicy.selection = true
|
|
|
+ this.$set(this.customerBuyFree, 'menu', false)
|
|
|
+ }
|
|
|
+ } else if (type === 'policy_buyAndGive') {
|
|
|
+ this.buyAndGiveList.push(row);
|
|
|
+ if (this.buyAndGiveList.length > 0) {
|
|
|
+ this.customerBuyFree.selection = true
|
|
|
+ this.optionPolicy.selection = false
|
|
|
+ this.$set(this.optionPolicy, 'menu', false)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.goodsListSave.push(row);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ change(row, type) {
|
|
|
+ let data = []
|
|
|
+ for (let item of this.selectionList) {
|
|
|
+ if (item.shareCost == 0 || item.shareCost == null) {
|
|
|
+ return this.$message.error("请维护共享成本单价");
|
|
|
+ }
|
|
|
+ data.push(item.id)
|
|
|
+ }
|
|
|
+ if (type === "3") {
|
|
|
+ for (let item of this.selectionList) {
|
|
|
+ if (item.billType != 1 || item.shareStatus != '暂存') return this.$message.error("选中数据已上架");
|
|
|
+ }
|
|
|
+ this.$confirm('是否共享确认?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ batchSharingConfirm({
|
|
|
+ ids: data.join(",")
|
|
|
+ }).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else if (type === "4") {
|
|
|
+ for (let item of this.selectionList) {
|
|
|
+ if (item.billType != 1 || item.shareStatus == '暂存') return this.$message.error("选中数据已下架");
|
|
|
+ }
|
|
|
+ this.$confirm('是否共享撤销?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ batchSharingRevoke({
|
|
|
+ ids: data.join(",")
|
|
|
+ }).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //新增搜索
|
|
|
+ goodsSearchCost(params, done) {
|
|
|
+ this.treeDeptId = ''
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ // artsVision: this.form.belongToCorpId
|
|
|
+ }
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done()
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ // 深拷贝一份防止弹出框的搜索参数和外面表格的搜索参数一样
|
|
|
+ let search = JSON.parse(JSON.stringify(this.search))
|
|
|
+ search.goodsName = params.goodsName
|
|
|
+
|
|
|
+ // this.search.cname = params.cname
|
|
|
+
|
|
|
+ // params.sharedCompany = params.$sharedCompany
|
|
|
+ params = {
|
|
|
+ ...params,
|
|
|
+ current: page.currentPage,
|
|
|
+ size: page.pageSize,
|
|
|
+ billType: 1,
|
|
|
+ ...Object.assign(params, search),
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ getList(params).then(res => {
|
|
|
+ this.dataList = res.data.data.records
|
|
|
+ this.page.total = res.data.data.total
|
|
|
+ this.pageList.total = res.data.data.total
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.loading = false
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ this.loading = true
|
|
|
+
|
|
|
+ groundingListZero(params).then(res => {
|
|
|
+ this.goodsListShow = res.data.data.records
|
|
|
+ this.data = res.data.data.records;
|
|
|
+ this.pages.total = res.data.data.total
|
|
|
+ this.loading = false
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ deptList().then(res => {
|
|
|
+ this.sharedCompanyoptions = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async saveGoodsColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(438),
|
|
|
+ this.optionTwo
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.cruds.$refs.dialogColumn.columnBox = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.cruds.doLayout()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async resetGoodsColumn() {
|
|
|
+ this.optionTwo = commodity;
|
|
|
+ const inSave = await this.delColumnData(
|
|
|
+ this.getColumnName(438),
|
|
|
+ commodity
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.cruds.doLayout()
|
|
|
+ })
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ //关闭窗口
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.cruds.$refs.dialogColumn.columnBox = false;
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //点击可用库存打开
|
|
|
+ storeInventoryOpen(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/tirePartsMall/basicData/listingManagement/detail",
|
|
|
+ query: {
|
|
|
+ goodsId: row.goodsId,
|
|
|
+ dot: row.dot
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ isProcurement({ "param": "whether.model" }).then(res => {
|
|
|
+ if (res.data.data == 1) {
|
|
|
+ this.findObject(this.option.column, "brandItem").label = '规格型号1'
|
|
|
+ this.findObject(this.optionTwo.column, "brandItem").label = '规格型号1'
|
|
|
+ this.findObject(this.optionTwo.column, "goodsName").label = '名称'
|
|
|
+ this.findObject(this.optionTwo.column, "code").label = '编码'
|
|
|
+ this.findObject(this.optionTwo.column, "goodsTypeId").label = '类别'
|
|
|
+ this.findObject(this.option.column, "explosionProof").search = false
|
|
|
+ this.findObject(this.option.column, "originalFactory").search = false
|
|
|
+ this.findObject(this.option.column, "selfRecovery").search = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ isProcurement({ "param": "whether.model" }).then(res => {
|
|
|
+ if (res.data.data == 1) {
|
|
|
+ this.findObject(this.option.column, "brandItem").label = '规格型号1'
|
|
|
+ this.findObject(this.optionTwo.column, "brandItem").label = '规格型号1'
|
|
|
+ this.findObject(this.optionTwo.column, "goodsName").label = '名称'
|
|
|
+ this.findObject(this.optionTwo.column, "code").label = '编码'
|
|
|
+ this.findObject(this.optionTwo.column, "goodsTypeId").label = '类别'
|
|
|
+ this.findObject(this.option.column, "explosionProof").search = false
|
|
|
+ this.findObject(this.option.column, "originalFactory").search = false
|
|
|
+ this.findObject(this.option.column, "selfRecovery").search = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped></style>
|