mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
Merge branch 'yyw' of gitee.com:hzchunfen/erp into fix-release-1.0.0/yjc-migrate
This commit is contained in:
commit
f858221f24
@ -28,7 +28,7 @@
|
|||||||
<el-form-item label="商品编码:">
|
<el-form-item label="商品编码:">
|
||||||
<el-input placeholder="商品编码" v-model="form.goods_code" :disabled="disabled"></el-input>
|
<el-input placeholder="商品编码" v-model="form.goods_code" :disabled="disabled"></el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="商品品种:">
|
<el-form-item label="商品品种/品类:">
|
||||||
<treeselect
|
<treeselect
|
||||||
:options="treeList"
|
:options="treeList"
|
||||||
style="width: 200px;"
|
style="width: 200px;"
|
||||||
@ -36,7 +36,9 @@
|
|||||||
:show-count="true"
|
:show-count="true"
|
||||||
:normalizer="normalizer"
|
:normalizer="normalizer"
|
||||||
placeholder="请选择品种"
|
placeholder="请选择品种"
|
||||||
v-model="form.type_id" />
|
v-model="form.type_id">
|
||||||
|
<div slot="value-label" slot-scope="{ node }">{{ parseLabel(node) }}</div>
|
||||||
|
</treeselect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="商品品牌:">
|
<!-- <el-form-item label="商品品牌:">
|
||||||
<el-select v-model="form.brand_id" placeholder="商品品牌" filterable :disabled="disabled">
|
<el-select v-model="form.brand_id" placeholder="商品品牌" filterable :disabled="disabled">
|
||||||
@ -47,37 +49,38 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-for="(item, i) in skus" :key="i" class="skuBox">
|
<div v-for="(item, i) in skus" :key="i" class="skuBox">
|
||||||
<div class="tit">规格{{ i + 1 }}</div>
|
<div class="tit">规格{{ i + 1 }}</div>
|
||||||
<el-form-item label="商品规格:">
|
<el-form-item label="规格名称:">
|
||||||
<el-input placeholder="商品规格" v-model="item.title"></el-input>
|
<el-input placeholder="规格名称" v-model="item.title"></el-input>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="规格编码:">
|
|
||||||
<el-input v-model="item.sku_code" placeholder="商品编码"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品状态:">
|
<el-form-item label="商品状态:">
|
||||||
<el-select v-model="item.reserve" placeholder="下架(默认)">
|
<el-select v-model="item.reserve" placeholder="下架(默认)">
|
||||||
<el-option v-for="it in options" :key="it.id" :label="it.label" :value="it.id">
|
<el-option v-for="it in options" :key="it.id" :label="it.label" :value="it.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<el-form-item label="商品成本:">
|
||||||
|
<el-input v-model="item.cost" placeholder="商品成本">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div>
|
<div>
|
||||||
<!-- <el-form-item label="商品数量:">
|
<!-- <el-form-item label="商品数量:">
|
||||||
<el-input v-model="item.num" placeholder="商品数量">
|
<el-input v-model="item.num" placeholder="商品数量">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="商品成本:">
|
|
||||||
<el-input v-model="item.cost" placeholder="商品成本">
|
<el-form-item label="可售库存:">
|
||||||
|
<el-input v-model="item.sale_stock" placeholder="可售库存">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="在售库存:">
|
<el-form-item label="规格编码:">
|
||||||
<el-input v-model="item.sale_stock" placeholder="在售库存">
|
<el-input v-model="item.sku_code" placeholder="不输入自动生成"></el-input>
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button type="danger" @click="handleDelete(i)" icon="el-icon-delete">删除</el-button>
|
<el-button type="danger" @click="handleDelete(i)" icon="el-icon-delete">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="success" @click="handleAdd()" icon="el-icon-plus">增加规格</el-button>
|
<el-button type="success" @click="toAddSku()" icon="el-icon-plus">增加规格</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<div style="margin-top: 30px;">
|
<div style="margin-top: 30px;">
|
||||||
@ -118,18 +121,8 @@
|
|||||||
},
|
},
|
||||||
// 商品状态
|
// 商品状态
|
||||||
options: [
|
options: [
|
||||||
{
|
{ id: "0", label: "下架" },
|
||||||
id: "0",
|
{ id: "1", label: "在售" }
|
||||||
label: "下架",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
label: "在售",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2",
|
|
||||||
label: "预警",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
file: [],
|
file: [],
|
||||||
disabled: false
|
disabled: false
|
||||||
@ -218,6 +211,13 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
toAddSku() {
|
||||||
|
if(!this.form.type_id) {
|
||||||
|
this.$message({ message: "请选择商品品种/品类", type: "error" })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.handleAdd()
|
||||||
|
},
|
||||||
// 增加一个商品规格
|
// 增加一个商品规格
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
let sku = {
|
let sku = {
|
||||||
@ -226,7 +226,7 @@
|
|||||||
status: "0",
|
status: "0",
|
||||||
num: "0",
|
num: "0",
|
||||||
cost: "0",
|
cost: "0",
|
||||||
sale_stock: 0,
|
sale_stock: 9999,
|
||||||
reserve: "0",
|
reserve: "0",
|
||||||
};
|
};
|
||||||
this.skus.push(sku);
|
this.skus.push(sku);
|
||||||
@ -251,9 +251,16 @@
|
|||||||
node.isDisabled = true
|
node.isDisabled = true
|
||||||
}
|
}
|
||||||
return node
|
return node
|
||||||
|
},
|
||||||
|
parseLabel(node) {
|
||||||
|
console.log(node)
|
||||||
|
let text = ''
|
||||||
|
text += node.parentNode ? node.parentNode.label + ' / ' : ''
|
||||||
|
text += node.raw ? node.raw.label : ''
|
||||||
|
return text
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@ -1,316 +1,324 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="pageBox">
|
||||||
<el-card :body-style="{ padding: '20px 20px 0 20px' }">
|
<div class="cardBox">
|
||||||
<div class="goods">
|
<div class="searchBox">
|
||||||
<el-form ref="searchForm" :inline="true" :model="searchForm">
|
<div class="row">
|
||||||
<el-form-item label="商品名称:">
|
<span>商品名称:</span>
|
||||||
<el-input v-model="searchForm.sku_title" placeholder="商品名称" style="width: 100px"></el-input>
|
<el-input v-model="searchForm.sku_title" clearable></el-input>
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-form-item label="商品编码:">
|
<div class="row">
|
||||||
<el-input v-model="searchForm.external_sku_id" placeholder="商品编码" style="width: 100px"></el-input>
|
<span>商品编码:</span>
|
||||||
</el-form-item>
|
<el-input v-model="searchForm.external_sku_id" clearable></el-input>
|
||||||
<el-form-item>
|
</div>
|
||||||
<el-button type="primary" @click="handleChoose(1)">筛选</el-button>
|
<div class="row">
|
||||||
<el-upload ref="myUpload" action="/api/combination/goods" :multiple="false" name="combinationGoods"
|
<el-button type="primary" @click="handleChoose(1)" icon="el-icon-search">筛选</el-button>
|
||||||
:show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload"
|
</div>
|
||||||
:on-error="uploadError" style="display:inline-block;margin: 0 10px 0 10px;">
|
</div>
|
||||||
<el-button type="primary" plain>组合商品导入</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-card style="margin-top: 10px">
|
|
||||||
<div>
|
|
||||||
<!-- 表格头部操作 -->
|
|
||||||
<div class="btn">
|
|
||||||
<el-button type="primary" plain @click="addGoodsCombination">新增组合商品</el-button>
|
|
||||||
</div>
|
|
||||||
<!-- 表格 -->
|
|
||||||
<el-table v-loading="loading" ref="multipleTable" :data="tableData" class="table" tooltip-effect="dark"
|
|
||||||
style="width: 100%" row-key="id" :tree-props="{ children: 'children' }">
|
|
||||||
<el-table-column label="商品信息" width="400">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div class="commodityimg">
|
|
||||||
<img :src="scope.row.img_url" class="Img" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>{{ scope.row.title }}</p>
|
|
||||||
<p>{{ scope.row.external_sku_id }}</p>
|
|
||||||
<p>{{ scope.row.updated_at }}</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="num" label="组合数量"></el-table-column>
|
|
||||||
<el-table-column prop="reference_price" label="售价"></el-table-column>
|
|
||||||
<el-table-column sortable label="今日7点以后订单">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div>
|
|
||||||
<span>{{ scope.row.order_goods_num }}</span>
|
|
||||||
</div>
|
|
||||||
<el-popover placement="right-start" trigger="hover" v-if="scope.row.order_detail.length !== 0">
|
|
||||||
<div>
|
|
||||||
<span v-for="(j, index) in scope.row.order_detail" :key="index">
|
|
||||||
<div>{{ j.shop.name }}:{{ j.number }}</div>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<el-button class="btn11" type="text" slot="reference"><img src="../../css/img/眼睛.png"
|
|
||||||
alt="" />
|
|
||||||
</el-button>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column sortable prop="total_orders_num" label="累计订单"></el-table-column>
|
|
||||||
<el-table-column sortable prop="stock" label="库存"></el-table-column>
|
|
||||||
<el-table-column prop="status" label="状态"> </el-table-column>
|
|
||||||
<el-table-column label="操作" width="130">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text" @click="handleEdit(scope.row.id)">编辑</el-button>
|
|
||||||
<!-- <el-button type="text" @click="handleDelete(scope.row.id)">删除</el-button> -->
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 分页功能 -->
|
|
||||||
<div class="page">
|
|
||||||
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
||||||
:current-page="current_page" :page-sizes="[15, 50, 100, 150, 200]" :page-size="per_page"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="Paginationdata.total">
|
|
||||||
</el-pagination>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-dialog title="新增组合商品" :visible.sync="dialogVisible">
|
|
||||||
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
|
|
||||||
<el-form-item label="商品名称" prop="title" :rules="[
|
|
||||||
{ required: true, message: '请输入商品名称', trigger: 'blur' },
|
|
||||||
]">
|
|
||||||
<el-input v-model="dynamicValidateForm.title"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品编码" prop="external_sku_id">
|
|
||||||
<el-input v-model="dynamicValidateForm.external_sku_id"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-for="(item, index) in dynamicValidateForm.combination_goods" :label="'子商品' + index"
|
|
||||||
:key="item.item_id" :prop="'combination_goods.' + index + '.item_id'" :rules="{
|
|
||||||
required: true, message: '子商品不能为空', trigger: 'blur'
|
|
||||||
}">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-select v-model="item.item_id" filterable remote reserve-keyword placeholder="请选择子商品"
|
|
||||||
:remote-method="remoteMethod" :loading="remoteLoading">
|
|
||||||
<el-option v-for="sku in skus" :key="sku.id" :label="sku.title" :value="sku.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2">
|
|
||||||
<el-input v-model="item.item_num" placeholder="数量"></el-input>
|
|
||||||
</el-col>
|
|
||||||
<el-button type="danger" @click.prevent="removeItem(index)">删除</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="submitForm('dynamicValidateForm')">提交</el-button>
|
|
||||||
<el-button @click="addItem">添加子商品</el-button>
|
|
||||||
<el-button @click="resetForm('dynamicValidateForm')">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-card>
|
||||||
|
<div class="opaBox">
|
||||||
|
<el-upload ref="myUpload" action="/api/combination/goods" :multiple="false" name="combinationGoods"
|
||||||
|
:show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload"
|
||||||
|
:on-error="uploadError" style="display:inline-block;margin: 0 15px 0 0;">
|
||||||
|
<el-button type="warning" icon="el-icon-upload2">组合商品导入</el-button>
|
||||||
|
</el-upload>
|
||||||
|
<el-button type="primary" plain @click="addGoodsCombination" icon="el-icon-plus">新增组合商品</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" ref="multipleTable" :data="tableData" class="table" tooltip-effect="dark" border
|
||||||
|
style="width: 100%" row-key="id" :tree-props="{ children: 'children' }">
|
||||||
|
<el-table-column label="商品信息" width="400">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="commodityimg">
|
||||||
|
<img :src="scope.row.img_url" class="Img" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>{{ scope.row.title }}</p>
|
||||||
|
<p>{{ scope.row.external_sku_id }}</p>
|
||||||
|
<p>{{ scope.row.updated_at }}</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="num" label="组合数量"></el-table-column>
|
||||||
|
<!-- <el-table-column prop="reference_price" label="售价"></el-table-column> -->
|
||||||
|
<!-- <el-table-column sortable label="今日7点以后订单">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span>{{ scope.row.order_goods_num }}</span>
|
||||||
|
</div>
|
||||||
|
<el-popover placement="right-start" trigger="hover" v-if="scope.row.order_detail.length !== 0">
|
||||||
|
<div>
|
||||||
|
<span v-for="(j, index) in scope.row.order_detail" :key="index">
|
||||||
|
<div>{{ j.shop.name }}:{{ j.number }}</div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<el-button class="btn11" type="text" slot="reference"><img src="../../css/img/眼睛.png"
|
||||||
|
alt="" />
|
||||||
|
</el-button>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column sortable prop="total_orders_num" label="累计订单"></el-table-column> -->
|
||||||
|
<el-table-column sortable prop="stock" label="库存"></el-table-column>
|
||||||
|
<el-table-column prop="status" label="状态"> </el-table-column>
|
||||||
|
<el-table-column label="操作" width="130">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" @click="handleEdit(scope.row.id)">编辑</el-button>
|
||||||
|
<!-- <el-button type="text" @click="handleDelete(scope.row.id)">删除</el-button> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<div class="page-pagination">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="current_page"
|
||||||
|
:page-sizes="[15, 50, 100, 150, 200]"
|
||||||
|
:page-size="per_page"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="Paginationdata.total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-dialog title="新增组合商品" :visible.sync="dialogVisible">
|
||||||
|
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
|
||||||
|
<el-form-item label="商品名称" prop="title" :rules="[{ required: true, message: '请输入商品名称', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="dynamicValidateForm.title"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品编码" prop="external_sku_id">
|
||||||
|
<el-input v-model="dynamicValidateForm.external_sku_id"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-for="(item, index) in dynamicValidateForm.combination_goods" :label="'子商品' + index"
|
||||||
|
:key="item.item_id" :prop="'combination_goods.' + index + '.item_id'" :rules="{
|
||||||
|
required: true, message: '子商品不能为空', trigger: 'blur'
|
||||||
|
}">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-select v-model="item.item_id" filterable remote reserve-keyword placeholder="请选择子商品"
|
||||||
|
:remote-method="remoteMethod" :loading="remoteLoading">
|
||||||
|
<el-option v-for="sku in skus" :key="sku.id" :label="sku.title" :value="sku.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-input v-model="item.item_num" placeholder="数量"></el-input>
|
||||||
|
</el-col>
|
||||||
|
<el-button type="danger" @click.prevent="removeItem(index)">删除</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="submitForm('dynamicValidateForm')">提交</el-button>
|
||||||
|
<el-button @click="addItem">添加子商品</el-button>
|
||||||
|
<el-button @click="resetForm('dynamicValidateForm')">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getGoodsCombination, addGoodsCombination, showGoodsCombination, delGoodsCombination, getGoodsFilter } from "../../api/goods.js";
|
import { getGoodsCombination, addGoodsCombination, showGoodsCombination, getGoodsFilter } from "@/api/goods.js";
|
||||||
export default {
|
|
||||||
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
tableData: [], // 商品列表
|
tableData: [], // 商品列表
|
||||||
searchForm: {
|
searchForm: {
|
||||||
external_sku_id: "",
|
external_sku_id: '',
|
||||||
sku_title: "", // 商品名称
|
sku_title: '' // 商品名称
|
||||||
},
|
},
|
||||||
Paginationdata: {}, // 分页相关数据
|
Paginationdata: {}, // 分页相关数据
|
||||||
current_page: 1, // 当前页
|
current_page: 1, // 当前页
|
||||||
per_page: 100, // 每页显示数量
|
per_page: 100, // 每页显示数量
|
||||||
dynamicValidateForm: {
|
dynamicValidateForm: {
|
||||||
id: 0,
|
id: 0,
|
||||||
title: '',
|
title: '',
|
||||||
external_sku_id: '',
|
external_sku_id: '',
|
||||||
combination_goods: [{
|
combination_goods: [{
|
||||||
item_id: '',
|
item_id: '',
|
||||||
item_num: 1,
|
item_num: 1
|
||||||
}],
|
}]
|
||||||
},
|
},
|
||||||
skus: [],
|
skus: [],
|
||||||
remoteLoading: false
|
remoteLoading: false
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 列表编辑
|
// 列表编辑
|
||||||
handleEdit(id) {
|
handleEdit(id) {
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
showGoodsCombination(id).then((res) => {
|
showGoodsCombination(id).then((res) => {
|
||||||
this.dynamicValidateForm = res.data.data;
|
this.dynamicValidateForm = res.data.data
|
||||||
this.skus = res.data.data.skus;
|
this.skus = res.data.data.skus
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
// 删除
|
handleDelete(id) {
|
||||||
handleDelete(id) {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
getList(params) {
|
getList(params) {
|
||||||
getGoodsCombination(params).then((res) => {
|
getGoodsCombination(params).then((res) => {
|
||||||
this.tableData = res.data.data;
|
this.tableData = res.data.data
|
||||||
this.Paginationdata = res.data.meta;
|
this.Paginationdata = res.data.meta
|
||||||
this.currentPage = res.data.meta.current_page;
|
this.currentPage = res.data.meta.current_page
|
||||||
this.per_page = parseInt(res.data.meta.per_page)
|
this.per_page = parseInt(res.data.meta.per_page)
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
// 筛选
|
// 筛选
|
||||||
handleChoose() {
|
handleChoose() {
|
||||||
this.searchForm = {
|
this.searchForm = {
|
||||||
...this.searchForm,
|
...this.searchForm,
|
||||||
page: this.current_page,
|
page: this.current_page,
|
||||||
per_page: this.per_page,
|
per_page: this.per_page
|
||||||
};
|
|
||||||
this.getList(this.searchForm);
|
|
||||||
},
|
|
||||||
// 分页功能
|
|
||||||
handleSizeChange(val) {
|
|
||||||
// 当前条数
|
|
||||||
this.per_page = val;
|
|
||||||
this.current_page = 1;
|
|
||||||
this.handleChoose();
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
// 当前页
|
|
||||||
this.current_page = val;
|
|
||||||
this.handleChoose();
|
|
||||||
},
|
|
||||||
submitForm(formName) {
|
|
||||||
this.$refs[formName].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
addGoodsCombination(this.dynamicValidateForm).then((res) => {
|
|
||||||
this.$message({
|
|
||||||
message: res.data.message,
|
|
||||||
type: 'success'
|
|
||||||
});
|
|
||||||
this.dialogVisible = false;
|
|
||||||
this.handleCurrentChange(1);
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
resetForm(formName) {
|
|
||||||
this.$refs[formName].resetFields();
|
|
||||||
},
|
|
||||||
removeItem(index) {
|
|
||||||
this.dynamicValidateForm.combination_goods.splice(index, 1)
|
|
||||||
},
|
|
||||||
addItem() {
|
|
||||||
this.dynamicValidateForm.combination_goods.push({
|
|
||||||
item_id: '',
|
|
||||||
item_num: 1,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
remoteMethod(query) {
|
|
||||||
if (query !== '') {
|
|
||||||
this.remoteLoading = true;
|
|
||||||
getGoodsFilter(query).then((res) => {
|
|
||||||
this.skus = res.data.data;
|
|
||||||
this.remoteLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.skus = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addGoodsCombination() {
|
|
||||||
this.dialogVisible = true;
|
|
||||||
this.dynamicValidateForm = {
|
|
||||||
id: 0,
|
|
||||||
title: '',
|
|
||||||
external_sku_id: '',
|
|
||||||
combination_goods: [{
|
|
||||||
item_id: '',
|
|
||||||
item_num: 1,
|
|
||||||
}],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
beforeUpload() {
|
|
||||||
this.loadingModule = this.$loading({
|
|
||||||
lock: true,
|
|
||||||
text: '表格导入中...',
|
|
||||||
spinner: 'el-icon-loading',
|
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
uploadSuccess(response) {
|
|
||||||
this.$message({
|
|
||||||
message: response.message,
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
this.loadingModule.close();
|
|
||||||
},
|
|
||||||
uploadError(err) {
|
|
||||||
this.$message({
|
|
||||||
message: err.errorMessage,
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
this.loadingModule.close();
|
|
||||||
}
|
}
|
||||||
|
this.getList(this.searchForm)
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.per_page = val
|
||||||
|
this.current_page = 1
|
||||||
|
this.handleChoose()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.current_page = val
|
||||||
|
this.handleChoose()
|
||||||
|
},
|
||||||
|
submitForm(formName) {
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
addGoodsCombination(this.dynamicValidateForm).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: res.data.message,
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.handleCurrentChange(1)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetForm(formName) {
|
||||||
|
this.$refs[formName].resetFields()
|
||||||
|
},
|
||||||
|
removeItem(index) {
|
||||||
|
this.dynamicValidateForm.combination_goods.splice(index, 1)
|
||||||
|
},
|
||||||
|
addItem() {
|
||||||
|
this.dynamicValidateForm.combination_goods.push({
|
||||||
|
item_id: '',
|
||||||
|
item_num: 1
|
||||||
|
})
|
||||||
|
},
|
||||||
|
remoteMethod(query) {
|
||||||
|
if (query !== '') {
|
||||||
|
this.remoteLoading = true
|
||||||
|
getGoodsFilter(query).then((res) => {
|
||||||
|
this.skus = res.data.data
|
||||||
|
this.remoteLoading = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.skus = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addGoodsCombination() {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.dynamicValidateForm = {
|
||||||
|
id: 0,
|
||||||
|
title: '',
|
||||||
|
external_sku_id: '',
|
||||||
|
combination_goods: [{
|
||||||
|
item_id: '',
|
||||||
|
item_num: 1
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeUpload() {
|
||||||
|
this.loadingModule = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '表格导入中...',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
uploadSuccess(response) {
|
||||||
|
this.$message({
|
||||||
|
message: response.message,
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.loadingModule.close()
|
||||||
|
},
|
||||||
|
uploadError(err) {
|
||||||
|
this.$message({
|
||||||
|
message: err.errorMessage,
|
||||||
|
type: "error"
|
||||||
|
});
|
||||||
|
this.loadingModule.close()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.handleCurrentChange(1);
|
this.handleCurrentChange(1)
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
.table {
|
.searchBox{
|
||||||
margin-top: 20px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .cell {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
flex-wrap: wrap;
|
||||||
|
white-space: nowrap;
|
||||||
|
.row{
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
margin-right: 15px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.opaBox{
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.commodityimg {
|
.btn {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .cell {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.commodityimg {
|
||||||
width: 59px;
|
width: 59px;
|
||||||
height: 59px;
|
height: 59px;
|
||||||
background: rgba(227, 227, 227, 0.39);
|
background: rgba(227, 227, 227, 0.39);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
display: block;
|
display: block;
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Img {
|
.Img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .btn11 {
|
::v-deep .btn11 {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .btn11 img {
|
::v-deep .btn11 img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<el-form ref="form" :inline="true" :model="goodsData" label-position="right" label-width="100px">
|
<el-form ref="form" :inline="true" :model="goodsData" label-position="right" label-width="120px">
|
||||||
<div>
|
<!-- <div>
|
||||||
<el-form-item label="商品列表:">
|
<el-form-item label="商品列表:">
|
||||||
<el-select v-model="goodsData.goods_id" placeholder="选择商品" filterable :disabled="true">
|
<el-select v-model="goodsData.goods_id" placeholder="选择商品" filterable :disabled="true">
|
||||||
<el-option v-for="item in goodschoose" :key="item.id" :label="item.title" :value="item.id">
|
<el-option v-for="item in goodschoose" :key="item.id" :label="item.title" :value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div> -->
|
||||||
<div>
|
<!-- <div>
|
||||||
<el-form-item label="商品图片:">
|
<el-form-item label="商品图片:">
|
||||||
<el-upload class="avatar-uploader" action="#" :limit="1" :auto-upload="false"
|
<el-upload class="avatar-uploader" action="#" :limit="1" :auto-upload="false"
|
||||||
:show-file-list="true" list-type="picture-card" :on-change="handleAvatarSuccess">
|
:show-file-list="true" list-type="picture-card" :on-change="handleAvatarSuccess">
|
||||||
@ -18,21 +18,25 @@
|
|||||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div> -->
|
||||||
<div>
|
<div>
|
||||||
<el-form-item label="商品名称:">
|
<!-- <el-form-item label="商品名称:">
|
||||||
<el-input placeholder="商品名称" v-model="goodsData.goods.title"></el-input>
|
<el-input placeholder="商品名称" v-model="goodsData.goods.title"></el-input>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="商品编码:">
|
<!-- <el-form-item label="商品编码:">
|
||||||
<el-input placeholder="商品编码" v-model="goodsData.goods.goods_code"></el-input>
|
<el-input placeholder="商品编码" v-model="goodsData.goods.goods_code"></el-input>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="商品种类:">
|
<el-form-item label="商品品种/品类:">
|
||||||
<treeselect
|
<treeselect
|
||||||
:options="treeList"
|
:options="treeList"
|
||||||
style="width: 200px;"
|
style="width: 200px;"
|
||||||
:disable-branch-nodes="true"
|
:disable-branch-nodes="true"
|
||||||
|
:show-count="true"
|
||||||
|
:normalizer="normalizer"
|
||||||
placeholder="请选择品种"
|
placeholder="请选择品种"
|
||||||
v-model="goodsData.goods.type_id" />
|
v-model="goodsData.goods.type_id">
|
||||||
|
<div slot="value-label" slot-scope="{ node }">{{ parseLabel(node) }}</div>
|
||||||
|
</treeselect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="商品品牌:">
|
<!-- <el-form-item label="商品品牌:">
|
||||||
<el-select v-model="goodsData.goods.brand_id" placeholder="商品品牌" filterable>
|
<el-select v-model="goodsData.goods.brand_id" placeholder="商品品牌" filterable>
|
||||||
@ -42,12 +46,11 @@
|
|||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-form-item label="商品规格:">
|
<el-form-item label="规格名称:">
|
||||||
<el-input placeholder="商品规格" v-model="goodsData.title"></el-input>
|
<el-input placeholder="规格名称" v-model="goodsData.title"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="规格编码:">
|
<el-form-item label="规格编码:">
|
||||||
<el-input v-model="goodsData.sku_code" placeholder="商品编码">
|
<el-input v-model="goodsData.sku_code" placeholder="规格编码" disabled></el-input>
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品状态:">
|
<el-form-item label="商品状态:">
|
||||||
<el-select v-model="goodsData.status">
|
<el-select v-model="goodsData.status">
|
||||||
@ -70,7 +73,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<!-- <div>
|
||||||
<el-form-item label="规格图片:">
|
<el-form-item label="规格图片:">
|
||||||
<div class="shop-sku-img">
|
<div class="shop-sku-img">
|
||||||
<div class="shop" v-for="item in goodsData.thumb_url" :key="item.shop_id">
|
<div class="shop" v-for="item in goodsData.thumb_url" :key="item.shop_id">
|
||||||
@ -87,9 +90,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-form-item>
|
<el-form-item label=" ">
|
||||||
<el-button type="primary" @click="Edititem()">保存</el-button>
|
<el-button type="primary" @click="Edititem()">保存</el-button>
|
||||||
<el-button plain @click="cancel()">取消</el-button>
|
<el-button plain @click="cancel()">取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -266,6 +269,19 @@ export default {
|
|||||||
cancel() {
|
cancel() {
|
||||||
this.$router.push("/GOODS_LIST");
|
this.$router.push("/GOODS_LIST");
|
||||||
},
|
},
|
||||||
|
normalizer(node) {
|
||||||
|
if ((!node.children || (node.children && node.children.length == 0)) && node.level == 1) {
|
||||||
|
node.isDisabled = true
|
||||||
|
}
|
||||||
|
return node
|
||||||
|
},
|
||||||
|
parseLabel(node) {
|
||||||
|
console.log(node)
|
||||||
|
let text = ''
|
||||||
|
text += node.parentNode ? node.parentNode.label + ' / ' : ''
|
||||||
|
text += node.raw ? node.raw.label : ''
|
||||||
|
return text
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.skuId = parseInt(this.$route.query.id);
|
this.skuId = parseInt(this.$route.query.id);
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
<el-input v-model="form.goods_title" placeholder="商品名称" clearable></el-input>
|
<el-input v-model="form.goods_title" placeholder="商品名称" clearable></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<span>商品品种:</span>
|
<span>商品品种/品类:</span>
|
||||||
<treeselect
|
<treeselect
|
||||||
:options="treeList"
|
:options="treeList"
|
||||||
style="width: 200px;"
|
style="width: 200px;"
|
||||||
@ -16,7 +16,9 @@
|
|||||||
:show-count="true"
|
:show-count="true"
|
||||||
:normalizer="normalizer"
|
:normalizer="normalizer"
|
||||||
placeholder="请选择品种"
|
placeholder="请选择品种"
|
||||||
v-model="form.type_id" />
|
v-model="form.type_id">
|
||||||
|
<div slot="value-label" slot-scope="{ node }">{{ parseLabel(node) }}</div>
|
||||||
|
</treeselect>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="row">
|
<!-- <div class="row">
|
||||||
<span>商品品牌:</span>
|
<span>商品品牌:</span>
|
||||||
@ -36,7 +38,7 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<!-- <div class="row">
|
||||||
<el-select v-model="form.keyword_type" style="width: 80px;margin-right: 5px;">
|
<el-select v-model="form.keyword_type" style="width: 80px;margin-right: 5px;">
|
||||||
<el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value">
|
<el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
@ -45,7 +47,7 @@
|
|||||||
start-placeholder="开始时间" end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss"
|
start-placeholder="开始时间" end-placeholder="结束时间" value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
@change="getSTime" style="width: 300px">
|
@change="getSTime" style="width: 300px">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<el-button type="primary" @click="handleChoose(1)" icon="el-icon-search">筛选</el-button>
|
<el-button type="primary" @click="handleChoose(1)" icon="el-icon-search">筛选</el-button>
|
||||||
<el-button plain @click="handleReChoose" icon="el-icon-refresh">重置筛选</el-button>
|
<el-button plain @click="handleReChoose" icon="el-icon-refresh">重置筛选</el-button>
|
||||||
@ -58,8 +60,6 @@
|
|||||||
<!-- 表格头部操作 -->
|
<!-- 表格头部操作 -->
|
||||||
<div>
|
<div>
|
||||||
<span>全部商品(共{{ total }}条)</span>
|
<span>全部商品(共{{ total }}条)</span>
|
||||||
<span> 玫瑰合计: {{ rose_num }},</span>
|
|
||||||
<span> 其它合计: {{ other_num }}</span>
|
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<!-- <el-button @click="resetOrderCount" icon="el-icon-refresh">订单重置</el-button> -->
|
<!-- <el-button @click="resetOrderCount" icon="el-icon-refresh">订单重置</el-button> -->
|
||||||
<!-- <el-button type="primary" plain @click="update">上新</el-button> -->
|
<!-- <el-button type="primary" plain @click="update">上新</el-button> -->
|
||||||
@ -99,9 +99,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="品类" align="center">
|
<el-table-column label="品类/品种" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.row.goods && scope.row.goods.type && scope.row.goods.type.name || '' }}</div>
|
<div v-if="scope.row.goods && scope.row.goods.type">
|
||||||
|
<span>{{ scope.row.goods.type.parent_type ? scope.row.goods.type.parent_type.name : '-' }} / </span>
|
||||||
|
<span>{{ scope.row.goods.type.name || '-' }}</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="规格" prop="title"></el-table-column> -->
|
<!-- <el-table-column label="规格" prop="title"></el-table-column> -->
|
||||||
@ -176,7 +179,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
<el-table-column sortable label="销量" align="center">
|
<!-- <el-table-column sortable label="销量" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.order_goods_num }}</span>
|
<span>{{ scope.row.order_goods_num }}</span>
|
||||||
<el-popover placement="right-start" trigger="hover"
|
<el-popover placement="right-start" trigger="hover"
|
||||||
@ -189,7 +192,7 @@
|
|||||||
<i class="el-icon-view" slot="reference" style="padding-left: 5px;"></i>
|
<i class="el-icon-view" slot="reference" style="padding-left: 5px;"></i>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
|
|
||||||
<!-- <el-table-column sortable label="损耗">
|
<!-- <el-table-column sortable label="损耗">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -224,11 +227,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
<el-table-column prop="stock" sortable label="库存" align="center"></el-table-column>
|
<el-table-column prop="stock" sortable label="当前实际库存" align="center"></el-table-column>
|
||||||
<el-table-column prop="sale_stock" label="在售库存">
|
<el-table-column prop="sale_stock" label="可售库存">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div class="titBox" v-if="scope.row.edit">
|
<div class="titBox" v-if="scope.row.edit">
|
||||||
<el-input v-model="scope.row.sale_stock" placeholder="在售库存" size="mini" style="width: 100%;"></el-input>
|
<el-input v-model="scope.row.sale_stock" placeholder="可售库存" size="mini" style="width: 100%;"></el-input>
|
||||||
<span @click="cancelEdit(scope.row, scope.$index)" style="color: #666;cursor: pointer;font-size: 18px;margin-left: 5px;"><i class="el-icon-close"></i></span>
|
<span @click="cancelEdit(scope.row, scope.$index)" style="color: #666;cursor: pointer;font-size: 18px;margin-left: 5px;"><i class="el-icon-close"></i></span>
|
||||||
<span @click="confirmEdit(scope.row, scope.$index)" style="color: #409eff;cursor: pointer;font-size: 18px;margin-left: 5px;"><i class="el-icon-check"></i></span>
|
<span @click="confirmEdit(scope.row, scope.$index)" style="color: #409eff;cursor: pointer;font-size: 18px;margin-left: 5px;"><i class="el-icon-check"></i></span>
|
||||||
</div>
|
</div>
|
||||||
@ -267,12 +270,12 @@
|
|||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
<el-table-column prop="status" label="状态" align="center"></el-table-column>
|
<el-table-column prop="status" label="状态" align="center"></el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="120">
|
<el-table-column label="操作" align="center" width="120" v-if="is_admin">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div style="text-align: center;width: 100%;">
|
<div style="text-align: center;width: 100%;">
|
||||||
<!-- <el-button type="text" @click="ejectstock(scope.row)">库存</el-button> -->
|
<!-- <el-button type="text" @click="ejectstock(scope.row)">库存</el-button> -->
|
||||||
<el-button type="text" v-if="is_admin" @click="handleEdit(scope.row.id)">编辑</el-button>
|
<el-button type="text" @click="handleEdit(scope.row.id)">编辑</el-button>
|
||||||
<el-button type="text" @click="goodslog(scope.row)">记录</el-button>
|
<!-- <el-button type="text" @click="goodslog(scope.row)">记录</el-button> -->
|
||||||
<!-- <el-button type="text" @click="deleteSku(scope.row)">删除</el-button> -->
|
<!-- <el-button type="text" @click="deleteSku(scope.row)">删除</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -402,7 +405,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="在售库存" :visible.sync="showUpdate" width="600px">
|
<el-dialog title="可售库存" :visible.sync="showUpdate" width="600px">
|
||||||
<div class="">
|
<div class="">
|
||||||
<el-table :data="chooseList" border style="width: 100%">
|
<el-table :data="chooseList" border style="width: 100%">
|
||||||
<el-table-column label="商品信息">
|
<el-table-column label="商品信息">
|
||||||
@ -416,7 +419,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="在售库存" width="200">
|
<el-table-column label="可售库存" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.sale_stock"></el-input>
|
<el-input v-model="scope.row.sale_stock"></el-input>
|
||||||
</template>
|
</template>
|
||||||
@ -1111,6 +1114,13 @@
|
|||||||
node.isDisabled = true
|
node.isDisabled = true
|
||||||
}
|
}
|
||||||
return node
|
return node
|
||||||
|
},
|
||||||
|
parseLabel(node) {
|
||||||
|
console.log(node)
|
||||||
|
let text = ''
|
||||||
|
text += node.parentNode ? node.parentNode.label + ' / ' : ''
|
||||||
|
text += node.raw ? node.raw.label : ''
|
||||||
|
return text
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user