|
@@ -4,20 +4,18 @@
|
|
|
<el-row>
|
|
|
<el-col :span="4">
|
|
|
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
|
|
|
- @save="corpTypeVisible = true">
|
|
|
+ @save="corpTypeVisible = true">
|
|
|
</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"
|
|
|
- @row-del="rowDel"
|
|
|
- @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 273)"
|
|
|
- @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 273)" :page.sync="page">
|
|
|
+ ref="crud" :key="key" @on-load="onLoad" @selection-change="selectionChange" :before-open="beforeOpen"
|
|
|
+ @row-update="rowUpdate" @search-change="searchChange" @refresh-change="refreshChange" @row-del="rowDel"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 273)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 273)" :page.sync="page">
|
|
|
<template slot="filesListForm">
|
|
|
<c-upload :data="form.filesList" display basic deleteUrl="/api/blade-sales-part/productLaunchFiles/remove"
|
|
|
- :enumerationValue="160"/>
|
|
|
+ :enumerationValue="160" />
|
|
|
</template>
|
|
|
<template slot="detailsTextForm">
|
|
|
<avue-ueditor v-model="form.detailsText" :options="optionsUeditor"></avue-ueditor>
|
|
@@ -27,33 +25,94 @@
|
|
|
</el-button>
|
|
|
<el-button :size="size" :type="type" @click="$refs.crud.rowDel(row, index)">删除
|
|
|
</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>
|
|
|
- <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="danger" size="small"
|
|
|
- @click="change(row, 'down')">批量下架
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click="commoditySelection">新增
|
|
|
</el-button>
|
|
|
<el-button class="el-icon-bottom" type="warning" size="small" @click="excelBox = true">
|
|
|
导入
|
|
|
</el-button>
|
|
|
+ <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')">批量下架
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</basic-container>
|
|
|
+ <el-dialog title="导入上架" 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="closeGoods">
|
|
|
+ <el-row :style="{ height: rowHeight }">
|
|
|
+ <el-col :span="24">
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="cruds"
|
|
|
+ @refresh-change="refreshChangeCost" @selection-change="selectionChangeCost" @search-change="goodsSearchCost"
|
|
|
+ :page.sync="page" @on-load="onLoad">
|
|
|
+ <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="orderQuantity" slot-scope="{row}">
|
|
|
+ <el-input-number v-model="row.orderQuantity" size="small" :controls="false" :precision="0"
|
|
|
+ @input="amountChange(row)" style="width: 100%" />
|
|
|
+ </template> -->
|
|
|
+ <template slot="priceOne" slot-scope="{ row }">
|
|
|
+ <el-input v-model.trim="row.priceOne" size="small"></el-input>
|
|
|
+ <!-- <span v-else>{{ row.refreshChange | IntegerFormat }}</span> -->
|
|
|
+ </template>
|
|
|
+ <template slot="priceTwo" slot-scope="{ row }">
|
|
|
+ <el-input v-model.trim="row.priceTwo" size="small"></el-input>
|
|
|
+ <!-- <span v-else>{{ row.refreshChange | IntegerFormat }}</span> -->
|
|
|
+ </template>
|
|
|
+ <template slot="priceThree" slot-scope="{ row }">
|
|
|
+ <el-input v-model.trim="row.priceThree" size="small"></el-input>
|
|
|
+ <!-- <span v-else>{{ row.refreshChange | IntegerFormat }}</span> -->
|
|
|
+ </template>
|
|
|
+ <template slot="priceFour" slot-scope="{ row }">
|
|
|
+ <el-input v-model.trim="row.priceFour" 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" 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" v-if="commodityData !== true" :loading="saveLoading">导入</el-button>
|
|
|
+ <el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading"
|
|
|
+ :disabled="tableData.length !== 1">导入</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog title="添加产品" 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">
|
|
@@ -72,28 +131,42 @@
|
|
|
<script>
|
|
|
import {
|
|
|
getList,
|
|
|
+ groundingList,
|
|
|
submit,
|
|
|
batchOperationProductLaunch,
|
|
|
getDetail,
|
|
|
listAll,
|
|
|
- remove
|
|
|
+ remove,
|
|
|
+ productLaunch,
|
|
|
+ deptList
|
|
|
} from "@/api/tirePartsMall/basicData/listingManagement/index.js";
|
|
|
-import {getToken} from "@/util/auth";
|
|
|
-
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+import commodity from "./commodity.json"
|
|
|
export default {
|
|
|
name: "index",
|
|
|
data() {
|
|
|
return {
|
|
|
+ data: [],
|
|
|
+ sharedCompanyoptions:[],
|
|
|
+ activeName: 'searchList',
|
|
|
+ dialogVisibles: false,
|
|
|
+ tableData: [],
|
|
|
+ //上架列表
|
|
|
+ goodsListShow: [],
|
|
|
+ // 商品列表暂存
|
|
|
+ goodsListSave: [],
|
|
|
+ goodsListPolicy: [],
|
|
|
optionsUeditor: {
|
|
|
//普通上传地址
|
|
|
// action:'https://avuejs.com/imgupload',
|
|
|
action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
- headers: {"Blade-Auth": "Bearer " + getToken()},
|
|
|
+ headers: { "Blade-Auth": "Bearer " + getToken() },
|
|
|
props: {
|
|
|
res: "data",
|
|
|
url: 'link'
|
|
|
}
|
|
|
},
|
|
|
+ optionTwo: commodity,
|
|
|
excelForm: {},
|
|
|
excelOption: {
|
|
|
submitBtn: false,
|
|
@@ -144,6 +217,11 @@ export default {
|
|
|
total: 0,
|
|
|
pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
},
|
|
|
+ pageList: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
key: 0,
|
|
|
option: {},
|
|
|
optionList: {
|
|
@@ -271,7 +349,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
|
- listAll().then(res=>{
|
|
|
+ listAll().then(res => {
|
|
|
this.treeData = res.data.data
|
|
|
})
|
|
|
this.onLoad(this.page, this.search)
|
|
@@ -323,23 +401,62 @@ export default {
|
|
|
selectionChange(list) {
|
|
|
this.selectionList = list
|
|
|
},
|
|
|
+ selectionChangeCost(list) {
|
|
|
+ this.tableData = list
|
|
|
+ },
|
|
|
+ //新增
|
|
|
+ commoditySelection() {
|
|
|
+ this.dialogVisibles = !this.dialogVisibles
|
|
|
+ this.tableData = []
|
|
|
+ this.goodsListSave = [];
|
|
|
+ },
|
|
|
//打开表单前
|
|
|
beforeOpen(done, type) {
|
|
|
// 查看和编辑逻辑
|
|
|
if (['view', 'edit'].includes(type)) {
|
|
|
- getDetail({id: this.form.id}).then(res => {
|
|
|
+ getDetail({ id: this.form.id }).then(res => {
|
|
|
this.form = res.data.data
|
|
|
done();
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- rowDel(row,index){
|
|
|
+ // 标签页切换
|
|
|
+ tabHandle(data) {
|
|
|
+ console.log(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 {
|
|
|
+ this.goodsListSave.splice(row.$index, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowDel(row, index) {
|
|
|
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
- }).then(()=>{
|
|
|
- remove(row.id).then((res)=>{
|
|
|
+ }).then(() => {
|
|
|
+ remove(row.id).then((res) => {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '删除成功!'
|
|
@@ -387,6 +504,85 @@ export default {
|
|
|
this.onLoad(this.page, this.search)
|
|
|
})
|
|
|
},
|
|
|
+ // 确认导入
|
|
|
+ importGoods() {
|
|
|
+ console.log(this.goodsListSave);
|
|
|
+ if (this.goodsListSave.some(item => item.priceOne == "" || item.priceTwo == "" || item.priceThree == "" || item.priceFour == "")) {
|
|
|
+ this.$message.error('请填写所有价格字段');
|
|
|
+ console.log('字段没填');
|
|
|
+ }
|
|
|
+ if (this.goodsListSave.length > 0) {
|
|
|
+ this.goodsListSaveHandle()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goodsListSaveHandle() {
|
|
|
+ this.goodsListSave.forEach(item => {
|
|
|
+ this.goodsListSave.specificationAndModel = item.typeno
|
|
|
+ delete this.goodsListSave.typeno
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(this.goodsListSave);
|
|
|
+ productLaunch(this.goodsListSave).then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.dialogVisibles = !this.dialogVisibles
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //导入商品触发
|
|
|
+ importChoice() {
|
|
|
+ console.log(1);
|
|
|
+ return
|
|
|
+ // this.contactsData = this.contactsData.concat(this.tableData)
|
|
|
+ if (this.tableData.length === 1) {
|
|
|
+ this.goodsShowData[this.choiceIndexT].cname = this.tableData[0].cname
|
|
|
+ this.goodsShowData[this.choiceIndexT].code = this.tableData[0].code
|
|
|
+ this.goodsShowData[this.choiceIndexT].typeno = this.tableData[0].typeno
|
|
|
+ this.goodsShowData[this.choiceIndexT].itemType = this.tableData[0].typeno
|
|
|
+ this.goodsShowData[this.choiceIndexT].itemId = this.tableData[0].id
|
|
|
+ this.goodsShowData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
|
|
|
+ this.goodsShowData[this.choiceIndexT].integralMultiples = this.tableData[0].integralMultiples
|
|
|
+ this.goodsShowData[this.choiceIndexT].corpId = this.tableData[0].corpId
|
|
|
+ this.goodsShowData[this.choiceIndexT].corpName = this.tableData[0].corpName
|
|
|
+ this.quantityChange(this.goodsShowData[this.choiceIndexT])
|
|
|
+ selectGoodsNum({
|
|
|
+ goodsId: this.tableData[0].id,
|
|
|
+ itemType: this.tableData[0].typeno,
|
|
|
+ tradeType: 'GN',
|
|
|
+ warehouseId: this.form.storageId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.data.length > 0) {
|
|
|
+ this.goodsShowData[this.choiceIndexT].storageQuantityList = res.data.data
|
|
|
+ this.goodsShowData[this.choiceIndexT].storageId = res.data.data[0].storageId
|
|
|
+ this.goodsShowData[this.choiceIndexT].storageName = res.data.data[0].storageName
|
|
|
+ this.goodsShowData[this.choiceIndexT].storageQuantity = res.data.data[0].surplusRouteQuantity
|
|
|
+ if (res.data.data[0].tenantId !== "681169") {
|
|
|
+ this.goodsShowData[this.choiceIndexT].purchaseAmount = res.data.data[0].stockPrice
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.dialogVisible = !this.dialogVisible
|
|
|
+ this.commodityData = false
|
|
|
+ },
|
|
|
+ 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) {
|
|
@@ -436,6 +632,7 @@ export default {
|
|
|
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();
|
|
|
});
|
|
@@ -443,6 +640,19 @@ export default {
|
|
|
}).finally(() => {
|
|
|
this.loading = false
|
|
|
})
|
|
|
+ this.loading = true
|
|
|
+ groundingList(params).then(res => {
|
|
|
+ this.goodsListShow = res.data.data.records
|
|
|
+ this.data = res.data.data.records;
|
|
|
+ this.page.total = res.data.data.total
|
|
|
+ this.loading = false
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ deptList().then(res=>{
|
|
|
+ console.log(res);
|
|
|
+ this.sharedCompanyoptions = res.data.data
|
|
|
+ })
|
|
|
},
|
|
|
//自定义列保存
|
|
|
async saveColumnTwo(ref, option, optionBack, code) {
|