|
@@ -0,0 +1,671 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basic-container v-show="show" class="page-crad">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:82vh;">
|
|
|
+ <template slot="addBtn">
|
|
|
+ <i class="el-icon-setting" @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)" />
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </basic-container>
|
|
|
+
|
|
|
+ <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
|
|
|
+
|
|
|
+ <el-dialog title="设置商品类别" v-dialogDrag :visible.sync="goodsTypeVisible" class="avue-dialog" width="80%"
|
|
|
+ append-to-body @closed="goodsTypeClosed">
|
|
|
+ <span>
|
|
|
+ <goods-typeQX></goods-typeQX>
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <el-dialog title="导入项目" append-to-body class="el-dialogDeep" :visible.sync="productVisible" 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="5" style="height: 100%;overflow-y: auto">
|
|
|
+ <div>
|
|
|
+ <el-scrollbar>
|
|
|
+ <basic-container>
|
|
|
+ <avue-tree :option="productOption" :data="productDataGoods" @node-click="productnodeClick" />
|
|
|
+ </basic-container>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="19">
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud ref="productCrud" :option="optionTwo" :data="productListShow" :page.sync="productPage"
|
|
|
+ :search.sync="productSearch" @selection-change="productSelection" @search-change="goodsSearch"
|
|
|
+ @current-change="productCurrent" @size-change="productSize"
|
|
|
+ @refresh-change="productRefresh" @on-load="productonLoad" :table-loading="loading"
|
|
|
+ @saveColumn="productSave" @resetColumn="productReset" :cell-style="cellStyle">
|
|
|
+ <template slot="menuLeft" slot-scope="{size}">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="tabHandle">
|
|
|
+ <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
|
|
|
+ <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </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="productVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="importGoods">导入</el-button>
|
|
|
+ <!--<el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>-->
|
|
|
+ <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true"-->
|
|
|
+ <!-- :disabled="tableData.length !== 1">导入</el-button>-->
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import detailsPage from "./detailsPage";
|
|
|
+import { option } from "./js/optionList";
|
|
|
+import { optionTwo } from "./js/optionListTwo";
|
|
|
+import { getList, remove, getAllgoods, getGoodstype, goodsTypesubmit } from "@/api/basicData/product";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
+import goodsTypeQX from '@/components/goodsTypeQX/index'
|
|
|
+import billApplication from "@/components/bill/billApplication";
|
|
|
+import {getList as CJgetList} from "@/api/basicData/client";
|
|
|
+import {getList as getListpp } from "@/api/tirePartsMall/basicData/brandPage";
|
|
|
+import {
|
|
|
+ goodsTypeProjectListAll,
|
|
|
+ goodsTypeProjectSubmit,
|
|
|
+ goodsTypeProjectTree,
|
|
|
+ projectGoodsList, projectGoodsRemove,
|
|
|
+ projectGoodsSubmit
|
|
|
+} from "@/api/basicData/ServiceLtems";
|
|
|
+export default {
|
|
|
+ name: "index",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 类别的弹窗关闭开启
|
|
|
+ goodsTypeVisible: false,
|
|
|
+ // 导入项目的弹窗
|
|
|
+ productVisible:false,
|
|
|
+ // 导入项目弹窗高度
|
|
|
+ rowHeight: '',
|
|
|
+ // 产品左侧类别
|
|
|
+ productOption: {
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+ size: "small",
|
|
|
+ props: {
|
|
|
+ labelText: "标题",
|
|
|
+ label: "title",
|
|
|
+ value: "value",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 产品左侧是数据
|
|
|
+ productDataGoods:[],
|
|
|
+ // 产品弹窗列表
|
|
|
+ optionTwo:optionTwo,
|
|
|
+ productPage:{
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
+ productListShow:[],
|
|
|
+ // 暂存的数据
|
|
|
+ goodsListSave:[],
|
|
|
+ // 产品弹窗tabs切换
|
|
|
+ activeName:'searchList',
|
|
|
+ // 弹窗选中的数据
|
|
|
+ tableData:[],
|
|
|
+ productSearch:{},
|
|
|
+ // 详情列表的切换
|
|
|
+ show: true,
|
|
|
+ // 表格等待框的控制
|
|
|
+ loading: false,
|
|
|
+ // 检索数据
|
|
|
+ search: {},
|
|
|
+ // 列表左侧选择的id
|
|
|
+ goodsTypeId:null,
|
|
|
+ // 详情传的数据
|
|
|
+ detailData: {},
|
|
|
+ // 列表的数据
|
|
|
+ dataList: [],
|
|
|
+ selectionList: [],
|
|
|
+ // 分页数据
|
|
|
+ page: {
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
+ 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: {
|
|
|
+ detailsPage,
|
|
|
+ goodsTypeQX,
|
|
|
+ billApplication
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ // 初始化
|
|
|
+ this.rowHeight = (window.innerHeight - 130) + 'px'
|
|
|
+ // this.option = await this.getColumnData(this.getColumnName(217), option);
|
|
|
+ this.option = option
|
|
|
+ this.option.height = window.innerHeight - 210;
|
|
|
+ this.getAllWorkDicts()
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 监听浏览器高度变化,改变表格高度
|
|
|
+ window.onresize = () => {
|
|
|
+ this.rowHeight = (window.innerHeight - 130) + 'px'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.$refs.crud.refreshTable();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 获取搜索框的数据
|
|
|
+ getAllWorkDicts() {
|
|
|
+ // 获取商品名称
|
|
|
+ // this.getWorkDicts("label").then(res => {
|
|
|
+ // this.findObject(this.option.column, "label").dicData = res.data.data;
|
|
|
+ // });
|
|
|
+ // 获取单位字典
|
|
|
+ this.getWorkDicts("unit").then(res => {
|
|
|
+ this.findObject(this.option.column, "unit").dicData = res.data.data;
|
|
|
+ this.findObject(this.optionTwo.column, "unit").dicData = res.data.data;
|
|
|
+ });
|
|
|
+ // 获取状态字典
|
|
|
+ this.getWorkDicts("goods_status").then(res => {
|
|
|
+ this.findObject(this.option.column, "status").dicData = res.data.data;
|
|
|
+ this.findObject(this.optionTwo.column, "status").dicData = res.data.data;
|
|
|
+ });
|
|
|
+ // 获取左侧数据
|
|
|
+ goodsTypeProjectTree().then(res => {
|
|
|
+ this.treeData = res.data.data;
|
|
|
+ // this.findObject(this.option.column, "goodsTypeId").dicData = res.data.data;
|
|
|
+ this.findObject(this.option2.column, "parentId").dicData = res.data.data;
|
|
|
+ });
|
|
|
+ // 获取所有类别数据
|
|
|
+ goodsTypeProjectListAll().then(res=>{
|
|
|
+ this.findObject(this.option.column, "goodsTypeId").dicData = res.data.data;
|
|
|
+ })
|
|
|
+ // 获取供应商
|
|
|
+ CJgetList(1,20, {corpType:'GYS'}).then(res=>{
|
|
|
+ this.findObject(this.option.column, "corpId").dicData = res.data.data.records
|
|
|
+ })
|
|
|
+ // 获取品牌数据
|
|
|
+ getListpp().then(res=>{
|
|
|
+ this.findObject(this.option.column, "brand").dicData = res.data.data.records
|
|
|
+ })
|
|
|
+ // this.$refs.crud.init();
|
|
|
+ },
|
|
|
+ // 设置高度
|
|
|
+ searchCriteriaSwitch(type) {
|
|
|
+ if (type) {
|
|
|
+ this.option.height = this.option.height - 46;
|
|
|
+ } else {
|
|
|
+ this.option.height = this.option.height + 46;
|
|
|
+ }
|
|
|
+ this.$refs.crud.getTableHeight();
|
|
|
+ },
|
|
|
+ cellStyle() {
|
|
|
+ return "padding:0;height:40px;";
|
|
|
+ },
|
|
|
+ //点击搜索按钮触发
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ // 刷新触发
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+ // 添加项目
|
|
|
+ newAdd() {
|
|
|
+ if(!this.search.goodsTypeId) {
|
|
|
+ return this.$message.warning('请先选中类别');
|
|
|
+ }
|
|
|
+ console.log('添加')
|
|
|
+ this.tableData = []
|
|
|
+ this.goodsListSave = []
|
|
|
+ // 获取产品弹窗的左侧类型
|
|
|
+ this.getGoodstypefun()
|
|
|
+ this.productVisible = true
|
|
|
+ },
|
|
|
+ // 设置产品分类的确认按钮
|
|
|
+ saveGoodstype() {
|
|
|
+ this.getAllWorkDicts()
|
|
|
+ this.goodsTypeVisible = false
|
|
|
+ },
|
|
|
+ goodsTypeClosed() {
|
|
|
+ // this.reload = Math.random();
|
|
|
+ // this.form2 = this.$options.data().form2
|
|
|
+ },
|
|
|
+ // 选中数据
|
|
|
+ nodeClick(data) {
|
|
|
+ this.search.goodsTypeId = data.value
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.goodsTypeId = data.value
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+ // 获取列表数据
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ let data = this.deepClone(Object.assign(params, this.search));
|
|
|
+ data.whetherIntegral = 0
|
|
|
+ this.loading = true;
|
|
|
+ projectGoodsList(
|
|
|
+ page.currentPage,
|
|
|
+ page.pageSize,
|
|
|
+ data
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 详情跳转
|
|
|
+ editOpen(row, status) {
|
|
|
+ this.detailData = {
|
|
|
+ id: row.id,
|
|
|
+ status:status
|
|
|
+ };
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ currentChange(val) {
|
|
|
+ this.page.currentPage = val;
|
|
|
+ },
|
|
|
+ sizeChange(val) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.page.pageSize = val;
|
|
|
+ },
|
|
|
+ // 列表删除
|
|
|
+ rowDel(row, index, done) {
|
|
|
+ this.$confirm("确定删除数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ projectGoodsRemove({ ids: row.id }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 列表保存数据
|
|
|
+ projectGoodsSubmitfun(obj){
|
|
|
+ projectGoodsSubmit(obj).then(res=>{
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.productVisible = false
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ }else {
|
|
|
+ this.$message.error(res.data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async saveColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(217),
|
|
|
+ this.option
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async resetColumn() {
|
|
|
+ this.option = option;
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(217), option);
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.getAllWorkDicts()
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //返回列表
|
|
|
+ goBack() {
|
|
|
+ this.detailData = this.$options.data().detailData;
|
|
|
+ this.show = true;
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // -------------------------产品弹窗的方法---------------------------------------------------------------
|
|
|
+ // 产品弹窗导入
|
|
|
+ importGoods(){
|
|
|
+ // id
|
|
|
+ // 商品名称 cname
|
|
|
+ // 产品名称提取数字 cnameInt
|
|
|
+ // 中文描述 nameDescription
|
|
|
+ // 计量单位 unit
|
|
|
+ // 品牌 brand
|
|
|
+ // 规格尺寸 specs
|
|
|
+ // 包装单位 packgeunit
|
|
|
+ // 单价 price
|
|
|
+ // 备注(收费指示)remarks
|
|
|
+ // 修改人 updateUser
|
|
|
+ // createUser 创建人
|
|
|
+ // 创建时间 createTime
|
|
|
+ // 修改时间 updateTime
|
|
|
+ // 状态(0 正常 1停用) status
|
|
|
+ // 供应商 corpId
|
|
|
+ // 供应商名称 corpName
|
|
|
+ // 出场日期 exitDate
|
|
|
+ // 维修日期 maintenanceDate
|
|
|
+ // 来源商品id srcId
|
|
|
+ // 商品类型id goodsTypeId
|
|
|
+ // 附件集合 projectGoodsFilesList
|
|
|
+ // 品牌id brandId
|
|
|
+ if (this.goodsListSave.length > 0) {
|
|
|
+ console.log(this.goodsListSave,'445')
|
|
|
+ for (let item of this.goodsListSave) {
|
|
|
+ const obj = {
|
|
|
+ id:null,
|
|
|
+ cname:item.cname,
|
|
|
+ cnameInt:item.cnameInt,
|
|
|
+ nameDescription:item.nameDescription,
|
|
|
+ unit:item.unit,
|
|
|
+ brand:item.brand,
|
|
|
+ specs:item.specs,
|
|
|
+ packgeunit:item.packgeunit,
|
|
|
+ price:item.price,
|
|
|
+ remarks:item.remarks,
|
|
|
+ updateUser:item.updateUser,
|
|
|
+ createUser:item.createUser,
|
|
|
+ createTime:item.createTime,
|
|
|
+ updateTime:item.updateTime,
|
|
|
+ status:item.status,
|
|
|
+ corpId:item.corpId,
|
|
|
+ corpName:item.corpName,
|
|
|
+ exitDate:item.exitDate,
|
|
|
+ maintenanceDate:item.maintenanceDate,
|
|
|
+ srcId:item.id,
|
|
|
+ goodsTypeId:this.goodsTypeId,
|
|
|
+ projectGoodsFilesList:item.filesList,
|
|
|
+ brandId:item.brand,
|
|
|
+ }
|
|
|
+ this.projectGoodsSubmitfun(obj)
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ console.log('475')
|
|
|
+ for (let item of this.tableData) {
|
|
|
+ const obj = {
|
|
|
+ id:null,
|
|
|
+ cname:item.cname,
|
|
|
+ cnameInt:item.cnameInt,
|
|
|
+ nameDescription:item.nameDescription,
|
|
|
+ unit:item.unit,
|
|
|
+ brand:item.brand,
|
|
|
+ specs:item.specs,
|
|
|
+ packgeunit:item.packgeunit,
|
|
|
+ price:item.price,
|
|
|
+ remarks:item.remarks,
|
|
|
+ updateUser:item.updateUser,
|
|
|
+ createUser:item.createUser,
|
|
|
+ createTime:item.createTime,
|
|
|
+ updateTime:item.updateTime,
|
|
|
+ status:item.status,
|
|
|
+ corpId:item.corpId,
|
|
|
+ corpName:item.corpName,
|
|
|
+ exitDate:item.exitDate,
|
|
|
+ maintenanceDate:item.maintenanceDate,
|
|
|
+ srcId:item.id,
|
|
|
+ goodsTypeId:this.goodsTypeId,
|
|
|
+ projectGoodsFilesList:item.filesList,
|
|
|
+ brandId:item.brand,
|
|
|
+ }
|
|
|
+ this.projectGoodsSubmitfun(obj)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 产品选择左侧数据
|
|
|
+ productnodeClick(data){
|
|
|
+ this.productSearch.goodsTypeId = data.value
|
|
|
+ this.productPage.currentPage = 1;
|
|
|
+ this.productonLoad(this.productPage, this.productSearch);
|
|
|
+ },
|
|
|
+ // 产品弹窗的列表数据获取
|
|
|
+ productonLoad(page, params = {}){
|
|
|
+ let data = this.deepClone(Object.assign(params, this.productSearch));
|
|
|
+ this.loading = true;
|
|
|
+ getList(
|
|
|
+ page.currentPage,
|
|
|
+ page.pageSize,
|
|
|
+ data
|
|
|
+ ).then(res=>{
|
|
|
+ // this.productListShow = res.data.data.records ? res.data.data.records : [];
|
|
|
+ this.productListShow = res.data.data.records
|
|
|
+ this.productPage.total = res.data.data.total;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.productCrud.doLayout();
|
|
|
+ });
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 标签页切换
|
|
|
+ tabHandle(data) {
|
|
|
+ if (data.name == 'searchList') {
|
|
|
+ this.productListShow = this.data;
|
|
|
+ // this.productSearch.total = this.pageList.total
|
|
|
+ this.productonLoad(this.productPage,this.productSearch);
|
|
|
+ } else if (data.name == 'importStaging') {
|
|
|
+ this.productListShow = this.goodsListSave;
|
|
|
+ this.productSearch.total = 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取产品左侧数据
|
|
|
+ getGoodstypefun(){
|
|
|
+ getGoodstype().then(res => {
|
|
|
+ this.productDataGoods = res.data.data;
|
|
|
+ // this.findObject(this.option2.column, "parentId").dicData = res.data.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 弹窗选中的数据
|
|
|
+ importStagList(row, index) {
|
|
|
+ this.goodsListSave.push(row);
|
|
|
+ },
|
|
|
+ // 产品弹窗移除
|
|
|
+ removeStagList(row, index) {
|
|
|
+ this.goodsListSave.splice(row.$index, 1)
|
|
|
+ },
|
|
|
+ // 产品弹窗刷新触发
|
|
|
+ productRefresh(){
|
|
|
+ // this.treeDeptId = '';
|
|
|
+ this.productPage.currentPage = 1;
|
|
|
+ this.productonLoad(this.productPage,this.productSearch);
|
|
|
+ },
|
|
|
+ // 产品弹窗选择触发
|
|
|
+ productSelection(list) {
|
|
|
+ this.tableData = list
|
|
|
+ },
|
|
|
+ // 产品弹窗搜索按钮触发
|
|
|
+ goodsSearch(params, done) {
|
|
|
+ // this.treeDeptId = '';
|
|
|
+ this.productonLoad(this.productPage,params);
|
|
|
+ done()
|
|
|
+ },
|
|
|
+ // 产品弹窗分页
|
|
|
+ productCurrent(val){
|
|
|
+ this.productPage.currentPage = val;
|
|
|
+ },
|
|
|
+ productSize(val){
|
|
|
+ this.productPage.currentPage = 1;
|
|
|
+ this.productPage.pageSize = val;
|
|
|
+ },
|
|
|
+ // 产品弹窗的重置和保存
|
|
|
+ productSave(){
|
|
|
+ const inSave = optionTwo
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.productCrud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.productCrud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ productReset(){
|
|
|
+ this.optionTwo = optionTwo;
|
|
|
+ // const inSave = await this.delColumnData(this.getColumnName(217), option);
|
|
|
+ const inSave = option
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.productCrud.doLayout();
|
|
|
+ });
|
|
|
+ this.getAllWorkDicts()
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs.productCrud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭弹窗的回调
|
|
|
+ closeGoods() {
|
|
|
+ this.productDataGoods = [];
|
|
|
+ // this.treeDeptId = "";
|
|
|
+ this.activeName = "searchList";
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.page-crad ::v-deep .basic-container__card {
|
|
|
+ height: 94.2vh;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-input-group__append {
|
|
|
+ padding: 0 0px !important;
|
|
|
+}
|
|
|
+
|
|
|
+.stat-td {
|
|
|
+ text-align: center;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.stat-img {
|
|
|
+ width: 95%;
|
|
|
+ height: 100px;
|
|
|
+}
|
|
|
+
|
|
|
+.stat-tip {
|
|
|
+ position: absolute;
|
|
|
+ left: 15px;
|
|
|
+ top: 5px;
|
|
|
+
|
|
|
+ .money {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 28px;
|
|
|
+ text-align: left;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: left;
|
|
|
+ margin-top: 5px;
|
|
|
+ margin-bottom: 0px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|