|
@@ -1,23 +1,32 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
<basic-container v-show="show" class="page-crad">
|
|
<basic-container v-show="show" class="page-crad">
|
|
|
- <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
|
|
|
|
|
- @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
|
|
|
|
|
- @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
|
|
|
|
|
- @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
|
|
|
|
|
- <template slot="menuLeft">
|
|
|
|
|
- <el-button type="primary" size="mini" @click.stop="newAdd()">新建产品
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template slot-scope="{ row, index }" slot="cname">
|
|
|
|
|
- <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.cname }}
|
|
|
|
|
- </span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template slot-scope="{ row, index }" slot="menu">
|
|
|
|
|
- <el-tooltip class="item" effect="dark" content="删除" placement="top">
|
|
|
|
|
- <i class="tradingIcon icon-del" @click.stop="rowDel(row, index)" v-if="row.status != 0" />
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
- <!-- <el-tooltip class="item" effect="dark" content="新建销售订单" placement="top">
|
|
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;">
|
|
|
|
|
+ <template slot="addBtn">
|
|
|
|
|
+ <i class="el-icon-plus" @click="goodsTypeVisible= true" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"></i>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </avue-tree>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="20">
|
|
|
|
|
+ <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
|
|
|
|
|
+ @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
|
|
|
|
|
+ @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
|
|
|
|
|
+ @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
|
|
|
|
|
+ <template slot="menuLeft">
|
|
|
|
|
+ <el-button type="primary" size="mini" @click.stop="newAdd()">新建产品
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template slot-scope="{ row, index }" slot="cname">
|
|
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.cname }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template slot-scope="{ row, index }" slot="menu">
|
|
|
|
|
+ <el-tooltip class="item" effect="dark" content="删除" placement="top">
|
|
|
|
|
+ <i class="tradingIcon icon-del" @click.stop="rowDel(row, index)" v-if="row.status != 0" />
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ <!-- <el-tooltip class="item" effect="dark" content="新建销售订单" placement="top">
|
|
|
<i class="tradingIcon icon-add" />
|
|
<i class="tradingIcon icon-add" />
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
|
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
|
@@ -32,27 +41,41 @@
|
|
|
<el-tooltip class="item" effect="dark" content="对账" placement="top">
|
|
<el-tooltip class="item" effect="dark" content="对账" placement="top">
|
|
|
<i class="tradingIcon icon-reconciliation" />
|
|
<i class="tradingIcon icon-reconciliation" />
|
|
|
</el-tooltip> -->
|
|
</el-tooltip> -->
|
|
|
- <!-- <el-button type="text" size="small" @click.stop="editOpen(row, 2)">
|
|
|
|
|
|
|
+ <!-- <el-button type="text" size="small" @click.stop="editOpen(row, 2)">
|
|
|
查看
|
|
查看
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button type="text" size="small" @click.stop="rowDel(row, index)">
|
|
<el-button type="text" size="small" @click.stop="rowDel(row, index)">
|
|
|
删除
|
|
删除
|
|
|
</el-button> -->
|
|
</el-button> -->
|
|
|
- </template>
|
|
|
|
|
- </avue-crud>
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </avue-crud>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
</basic-container>
|
|
</basic-container>
|
|
|
<details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
|
|
<details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
|
|
|
|
|
+ <el-dialog title="添加产品分类" v-dialogDrag :visible.sync="goodsTypeVisible" class="avue-dialog avue-dialog--top"
|
|
|
|
|
+ width="30%" append-to-body @closed="goodsTypeClosed">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <avue-form :key="reload" ref="goodsType" v-model="form2" :option="option2" style="margin-top:20px">
|
|
|
|
|
+ </avue-form>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <div class="avue-dialog__footer">
|
|
|
|
|
+ <el-button @click="goodsTypeVisible = false" size="mini">取 消</el-button>
|
|
|
|
|
+ <el-button @click="saveGoodstype" type="primary" size="mini">确 定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import detailsPage from "./detailsPage";
|
|
import detailsPage from "./detailsPage";
|
|
|
import { option } from "./js/optionList";
|
|
import { option } from "./js/optionList";
|
|
|
-import { getList, remove, getAllgoods } from "@/api/basicData/product";
|
|
|
|
|
|
|
+import { getList, remove, getAllgoods,getGoodstype,goodsTypesubmit } from "@/api/basicData/product";
|
|
|
export default {
|
|
export default {
|
|
|
name: "index",
|
|
name: "index",
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ goodsTypeVisible:false,
|
|
|
src: '',
|
|
src: '',
|
|
|
show: true,
|
|
show: true,
|
|
|
loading: false,
|
|
loading: false,
|
|
@@ -67,6 +90,47 @@ export default {
|
|
|
pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
},
|
|
},
|
|
|
option: {},
|
|
option: {},
|
|
|
|
|
+ treeData: [],
|
|
|
|
|
+ form2: {},
|
|
|
|
|
+ option2: {
|
|
|
|
|
+ menuBtn: false,
|
|
|
|
|
+ labelWidth: 80,
|
|
|
|
|
+ column: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "分类名称",
|
|
|
|
|
+ prop: "cname",
|
|
|
|
|
+ rules: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: "",
|
|
|
|
|
+ trigger: "blur"
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ span: 24,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: "上级类型",
|
|
|
|
|
+ prop: "parentId",
|
|
|
|
|
+ dicData: [],
|
|
|
|
|
+ type: "tree",
|
|
|
|
|
+ props: {
|
|
|
|
|
+ label: "title",
|
|
|
|
|
+ value: "id"
|
|
|
|
|
+ },
|
|
|
|
|
+ span: 24,
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ treeOption: {
|
|
|
|
|
+ addBtn: false,
|
|
|
|
|
+ menu: false,
|
|
|
|
|
+ size: "small",
|
|
|
|
|
+ props: {
|
|
|
|
|
+ labelText: "标题",
|
|
|
|
|
+ label: "title",
|
|
|
|
|
+ value: "value",
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
@@ -96,6 +160,10 @@ export default {
|
|
|
getAllgoods().then(res => {
|
|
getAllgoods().then(res => {
|
|
|
this.findObject(this.option.column, "cname").dicData = res.data.data
|
|
this.findObject(this.option.column, "cname").dicData = res.data.data
|
|
|
});
|
|
});
|
|
|
|
|
+ getGoodstype().then(res => {
|
|
|
|
|
+ this.treeData= res.data.data;
|
|
|
|
|
+ this.findObject(this.option2.column, "parentId").dicData = res.data.data;
|
|
|
|
|
+ });
|
|
|
this.$refs.crud.init();
|
|
this.$refs.crud.init();
|
|
|
},
|
|
},
|
|
|
searchCriteriaSwitch(type) {
|
|
searchCriteriaSwitch(type) {
|
|
@@ -121,6 +189,28 @@ export default {
|
|
|
newAdd() {
|
|
newAdd() {
|
|
|
this.show = false;
|
|
this.show = false;
|
|
|
},
|
|
},
|
|
|
|
|
+ saveGoodstype() {
|
|
|
|
|
+ this.$refs["goodsType"].validate((valid, done) => {
|
|
|
|
|
+ done();
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ goodsTypesubmit({ ...this.form2, status: 0 }).then(res => {
|
|
|
|
|
+ this.getAllWorkDicts()
|
|
|
|
|
+ })
|
|
|
|
|
+ this.goodsTypeVisible = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ goodsTypeClosed() {
|
|
|
|
|
+ this.reload = Math.random();
|
|
|
|
|
+ this.form2 = this.$options.data().form2
|
|
|
|
|
+ },
|
|
|
|
|
+ nodeClick(data) {
|
|
|
|
|
+ this.search.goodsTypeId = data.value
|
|
|
|
|
+ this.page.currentPage = 1;
|
|
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
|
|
+ },
|
|
|
onLoad(page, params = {}) {
|
|
onLoad(page, params = {}) {
|
|
|
let data = this.deepClone(Object.assign(params, this.search));
|
|
let data = this.deepClone(Object.assign(params, this.search));
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
@@ -208,7 +298,9 @@ export default {
|
|
|
.page-crad ::v-deep .basic-container__card {
|
|
.page-crad ::v-deep .basic-container__card {
|
|
|
height: 94.2vh;
|
|
height: 94.2vh;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+::v-deep .el-input-group__append{
|
|
|
|
|
+ padding: 0 0px !important;
|
|
|
|
|
+}
|
|
|
.stat-td {
|
|
.stat-td {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
position: relative;
|
|
position: relative;
|