|
|
@@ -1,160 +1,199 @@
|
|
|
<template>
|
|
|
- <el-row>
|
|
|
- <el-col :span="5">
|
|
|
- <basic-container>
|
|
|
- <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
|
|
|
- </basic-container>
|
|
|
- </el-col>
|
|
|
- <el-col :span="19">
|
|
|
- <basic-container>
|
|
|
- <avue-crud :option="option"
|
|
|
- :search.sync="search"
|
|
|
- :table-loading="loading"
|
|
|
- :data="data"
|
|
|
- ref="crud"
|
|
|
- v-model="form"
|
|
|
- :permission="permissionList"
|
|
|
- @row-del="rowDel"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @row-save="rowSave"
|
|
|
- :before-open="beforeOpenE"
|
|
|
- :page.sync="page"
|
|
|
- @search-change="searchChange"
|
|
|
- @search-reset="searchReset"
|
|
|
- @selection-change="selectionChange"
|
|
|
- @current-change="currentChange"
|
|
|
- @size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @on-load="onLoad">
|
|
|
- <template slot="menuLeft">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- icon="el-icon-bottom"
|
|
|
- @click="excelBox = true"
|
|
|
- >导入
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template slot-scope="scope" slot="menu">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-view"
|
|
|
- size="small"
|
|
|
- @click.stop="beforeOpenPage(scope.row, scope.index)"
|
|
|
- >查看
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- size="small"
|
|
|
- @click.stop="editOpen(scope.row, scope.index)"
|
|
|
- >编辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="small"
|
|
|
- @click.stop="rowDel(scope.row, scope.index)"
|
|
|
- >删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <template slot-scope="{row}"
|
|
|
- slot="tenantName">
|
|
|
- <el-tag>{{row.tenantName}}</el-tag>
|
|
|
- </template>
|
|
|
- <template slot-scope="{row}"
|
|
|
- slot="roleName">
|
|
|
- <el-tag>{{row.roleName}}</el-tag>
|
|
|
- </template>
|
|
|
- <template slot-scope="{row}"
|
|
|
- slot="deptName">
|
|
|
- <el-tag>{{row.deptName}}</el-tag>
|
|
|
- </template>
|
|
|
- <template slot-scope="{row}"
|
|
|
- slot="userTypeName">
|
|
|
- <el-tag>{{row.userTypeName}}</el-tag>
|
|
|
- </template>
|
|
|
- </avue-crud>
|
|
|
- <el-dialog title="用户角色配置"
|
|
|
- append-to-body
|
|
|
- :visible.sync="roleBox"
|
|
|
- width="345px">
|
|
|
+ <div>
|
|
|
+ <div v-show="show">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="5">
|
|
|
+ <basic-container>
|
|
|
+ <avue-tree
|
|
|
+ :option="treeOption"
|
|
|
+ :data="treeData"
|
|
|
+ @node-click="nodeClick"
|
|
|
+ />
|
|
|
+ </basic-container>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="19">
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud
|
|
|
+ :option="option"
|
|
|
+ :search.sync="search"
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="data"
|
|
|
+ ref="crud"
|
|
|
+ v-model="form"
|
|
|
+ :permission="permissionList"
|
|
|
+ @row-del="rowDel"
|
|
|
+ @row-update="rowUpdate"
|
|
|
+ @row-save="rowSave"
|
|
|
+ :before-open="beforeOpen"
|
|
|
+ :page.sync="page"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="searchReset"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @on-load="onLoad"
|
|
|
+ >
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-bottom"
|
|
|
+ @click="excelBox = true"
|
|
|
+ >导入
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ size="small"
|
|
|
+ @click.stop="copyDoc()"
|
|
|
+ :disabled="selectionList.length != 1"
|
|
|
+ >复制单据</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope" slot="menu">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-view"
|
|
|
+ size="small"
|
|
|
+ @click.stop="editOpen(scope.row, 1)"
|
|
|
+ >查看
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="small"
|
|
|
+ @click.stop="editOpen(scope.row, 1)"
|
|
|
+ >编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowDel(scope.row, scope.index)"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="tenantName">
|
|
|
+ <el-tag>{{ row.tenantName }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="roleName">
|
|
|
+ <el-tag>{{ row.roleName }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="deptName">
|
|
|
+ <el-tag>{{ row.deptName }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="userTypeName">
|
|
|
+ <el-tag>{{ row.userTypeName }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <el-dialog
|
|
|
+ title="用户角色配置"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="roleBox"
|
|
|
+ width="345px"
|
|
|
+ >
|
|
|
+ <el-tree
|
|
|
+ :data="roleGrantList"
|
|
|
+ show-checkbox
|
|
|
+ check-strictly
|
|
|
+ default-expand-all
|
|
|
+ node-key="id"
|
|
|
+ ref="treeRole"
|
|
|
+ :default-checked-keys="roleTreeObj"
|
|
|
+ :props="props"
|
|
|
+ >
|
|
|
+ </el-tree>
|
|
|
|
|
|
- <el-tree :data="roleGrantList"
|
|
|
- show-checkbox
|
|
|
- check-strictly
|
|
|
- default-expand-all
|
|
|
- node-key="id"
|
|
|
- ref="treeRole"
|
|
|
- :default-checked-keys="roleTreeObj"
|
|
|
- :props="props">
|
|
|
- </el-tree>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="roleBox = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitRole">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="用户数据导入"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="excelBox"
|
|
|
+ width="555px"
|
|
|
+ >
|
|
|
+ <avue-form
|
|
|
+ :option="excelOption"
|
|
|
+ v-model="excelForm"
|
|
|
+ :upload-after="uploadAfter"
|
|
|
+ >
|
|
|
+ <template slot="excelTemplate">
|
|
|
+ <el-button type="primary" @click="handleTemplate">
|
|
|
+ 点击下载<i class="el-icon-download el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="用户平台配置"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="platformBox"
|
|
|
+ >
|
|
|
+ <avue-crud
|
|
|
+ :option="platformOption"
|
|
|
+ :table-loading="platformLoading"
|
|
|
+ :data="platformData"
|
|
|
+ ref="platformCrud"
|
|
|
+ v-model="platformForm"
|
|
|
+ :before-open="platformBeforeOpen"
|
|
|
+ :page.sync="platformPage"
|
|
|
+ :permission="platformPermissionList"
|
|
|
+ @row-update="platformRowUpdate"
|
|
|
+ @search-change="platformSearchChange"
|
|
|
+ @search-reset="platformSearchReset"
|
|
|
+ @selection-change="platformSelectionChange"
|
|
|
+ @current-change="platformCurrentChange"
|
|
|
+ @size-change="platformSizeChange"
|
|
|
+ @refresh-change="platformRefreshChange"
|
|
|
+ @on-load="platformOnLoad"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }" slot="tenantName">
|
|
|
+ <el-tag>{{ row.tenantName }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="userTypeName">
|
|
|
+ <el-tag>{{ row.userTypeName }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="导入商品"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="excelBox"
|
|
|
+ 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>
|
|
|
+ </basic-container>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="roleBox = false">取 消</el-button>
|
|
|
- <el-button type="primary"
|
|
|
- @click="submitRole">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog title="用户数据导入"
|
|
|
- append-to-body
|
|
|
- :visible.sync="excelBox"
|
|
|
- width="555px">
|
|
|
- <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
|
|
|
- <template slot="excelTemplate">
|
|
|
- <el-button type="primary" @click="handleTemplate">
|
|
|
- 点击下载<i class="el-icon-download el-icon--right"></i>
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </avue-form>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog title="用户平台配置"
|
|
|
- append-to-body
|
|
|
- :visible.sync="platformBox">
|
|
|
- <avue-crud :option="platformOption"
|
|
|
- :table-loading="platformLoading"
|
|
|
- :data="platformData"
|
|
|
- ref="platformCrud"
|
|
|
- v-model="platformForm"
|
|
|
- :before-open="platformBeforeOpen"
|
|
|
- :page.sync="platformPage"
|
|
|
- :permission="platformPermissionList"
|
|
|
- @row-update="platformRowUpdate"
|
|
|
- @search-change="platformSearchChange"
|
|
|
- @search-reset="platformSearchReset"
|
|
|
- @selection-change="platformSelectionChange"
|
|
|
- @current-change="platformCurrentChange"
|
|
|
- @size-change="platformSizeChange"
|
|
|
- @refresh-change="platformRefreshChange"
|
|
|
- @on-load="platformOnLoad">
|
|
|
- <template slot-scope="{row}"
|
|
|
- slot="tenantName">
|
|
|
- <el-tag>{{row.tenantName}}</el-tag>
|
|
|
- </template>
|
|
|
- <template slot-scope="{row}"
|
|
|
- slot="userTypeName">
|
|
|
- <el-tag>{{row.userTypeName}}</el-tag>
|
|
|
- </template>
|
|
|
- </avue-crud>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog title="导入商品"
|
|
|
- append-to-body
|
|
|
- :visible.sync="excelBox"
|
|
|
- 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>
|
|
|
- </basic-container>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <detail-page
|
|
|
+ @goBack="goBack"
|
|
|
+ :detailData="detailData"
|
|
|
+ @copyOrder="copyOrder"
|
|
|
+ v-if="!show"
|
|
|
+ ></detail-page>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import detailPage from "./detailsPageEdit";
|
|
|
import {
|
|
|
getList,
|
|
|
getUser,
|
|
|
@@ -168,33 +207,35 @@ import {
|
|
|
getDeptLazyTree,
|
|
|
getDeptTree
|
|
|
} from "@/api/basicData/commodityType";
|
|
|
-import {getRoleTree} from "@/api/system/role";
|
|
|
-import {getPostList} from "@/api/system/post";
|
|
|
-import {mapGetters} from "vuex";
|
|
|
-import website from '@/config/website';
|
|
|
-import {getToken} from '@/util/auth';
|
|
|
+import { getRoleTree } from "@/api/system/role";
|
|
|
+import { getPostList } from "@/api/system/post";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
+import website from "@/config/website";
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
import option from "./configuration/mainList.json";
|
|
|
export default {
|
|
|
data() {
|
|
|
const validatePass = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('请输入密码'));
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("请输入密码"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
const validatePass2 = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('请再次输入密码'));
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("请再次输入密码"));
|
|
|
} else if (value !== this.form.password) {
|
|
|
- callback(new Error('两次输入密码不一致!'));
|
|
|
+ callback(new Error("两次输入密码不一致!"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
+ show: true,
|
|
|
+ detailData: {},
|
|
|
form: {},
|
|
|
- search:{},
|
|
|
+ search: {},
|
|
|
roleBox: false,
|
|
|
excelBox: false,
|
|
|
platformBox: false,
|
|
|
@@ -215,7 +256,7 @@ export default {
|
|
|
},
|
|
|
init: {
|
|
|
roleTree: [],
|
|
|
- deptTree: [],
|
|
|
+ deptTree: []
|
|
|
},
|
|
|
props: {
|
|
|
label: "title",
|
|
|
@@ -223,31 +264,33 @@ export default {
|
|
|
},
|
|
|
roleGrantList: [],
|
|
|
roleTreeObj: [],
|
|
|
- treeDeptId: '',
|
|
|
+ treeDeptId: "",
|
|
|
treeData: [],
|
|
|
treeOption: {
|
|
|
- nodeKey: 'id',
|
|
|
+ nodeKey: "id",
|
|
|
lazy: true,
|
|
|
- treeLoad: function (node, resolve) {
|
|
|
- console.log(node)
|
|
|
- const parentId = (node.level === 0) ? 0 : node.data.id;
|
|
|
+ treeLoad: function(node, resolve) {
|
|
|
+ console.log(node);
|
|
|
+ const parentId = node.level === 0 ? 0 : node.data.id;
|
|
|
getDeptLazyTree(parentId).then(res => {
|
|
|
- resolve(res.data.data.map(item => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- leaf: !item.hasChildren
|
|
|
- }
|
|
|
- }))
|
|
|
+ resolve(
|
|
|
+ res.data.data.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ leaf: !item.hasChildren
|
|
|
+ };
|
|
|
+ })
|
|
|
+ );
|
|
|
});
|
|
|
},
|
|
|
addBtn: false,
|
|
|
menu: false,
|
|
|
- size: 'small',
|
|
|
+ size: "small",
|
|
|
props: {
|
|
|
- labelText: '标题',
|
|
|
- label: 'title',
|
|
|
- value: 'value',
|
|
|
- children: 'children'
|
|
|
+ labelText: "标题",
|
|
|
+ label: "title",
|
|
|
+ value: "value",
|
|
|
+ children: "children"
|
|
|
}
|
|
|
},
|
|
|
option: option,
|
|
|
@@ -266,7 +309,7 @@ export default {
|
|
|
viewBtn: true,
|
|
|
dialogClickModal: false,
|
|
|
menuWidth: 120,
|
|
|
- editBtnText: '配置',
|
|
|
+ editBtnText: "配置",
|
|
|
column: [
|
|
|
{
|
|
|
label: "登录账号",
|
|
|
@@ -305,11 +348,13 @@ export default {
|
|
|
hide: true,
|
|
|
display: false,
|
|
|
prop: "userType",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请选择用户平台",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择用户平台",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "用户拓展",
|
|
|
@@ -319,9 +364,9 @@ export default {
|
|
|
span: 24,
|
|
|
overHidden: true,
|
|
|
row: true,
|
|
|
- hide: true,
|
|
|
- },
|
|
|
- ],
|
|
|
+ hide: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
excelForm: {},
|
|
|
excelOption: {
|
|
|
@@ -329,34 +374,37 @@ export default {
|
|
|
emptyBtn: false,
|
|
|
column: [
|
|
|
{
|
|
|
- label: '模板下载',
|
|
|
- prop: 'excelTemplate',
|
|
|
+ label: "模板下载",
|
|
|
+ prop: "excelTemplate",
|
|
|
formslot: true,
|
|
|
- span: 24,
|
|
|
+ span: 24
|
|
|
},
|
|
|
{
|
|
|
- label: '模板上传',
|
|
|
- prop: 'excelFile',
|
|
|
- type: 'upload',
|
|
|
+ label: "模板上传",
|
|
|
+ prop: "excelFile",
|
|
|
+ type: "upload",
|
|
|
drag: true,
|
|
|
- loadText: '模板上传中,请稍等',
|
|
|
+ loadText: "模板上传中,请稍等",
|
|
|
span: 24,
|
|
|
propsHttp: {
|
|
|
- res: 'data',
|
|
|
+ res: "data"
|
|
|
},
|
|
|
- tip: '请上传 .xls,.xlsx 标准格式文件',
|
|
|
- action: "/api/blade-client/goodsdesc/import-desc",
|
|
|
- },
|
|
|
+ tip: "请上传 .xls,.xlsx 标准格式文件",
|
|
|
+ action: "/api/blade-client/goodsdesc/import-desc"
|
|
|
+ }
|
|
|
]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ components: {
|
|
|
+ detailPage
|
|
|
+ },
|
|
|
watch: {
|
|
|
- 'form.tenantId'() {
|
|
|
- if (this.form.tenantId !== '' && this.initFlag) {
|
|
|
+ "form.tenantId"() {
|
|
|
+ if (this.form.tenantId !== "" && this.initFlag) {
|
|
|
this.initData(0);
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["userInfo", "permission"]),
|
|
|
@@ -382,10 +430,10 @@ export default {
|
|
|
ids.push(ele.id);
|
|
|
});
|
|
|
return ids.join(",");
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
- option.height = window.innerHeight - 230 ;
|
|
|
+ option.height = window.innerHeight - 230;
|
|
|
// 非租户模式默认加载管理组数据
|
|
|
if (!website.tenantMode) {
|
|
|
this.initData(website.tenantId);
|
|
|
@@ -393,7 +441,11 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
derivation() {
|
|
|
- window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
|
|
|
+ window.open(
|
|
|
+ `/api/blade-client/goodsdesc/export-template?${
|
|
|
+ this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
},
|
|
|
uploadAfter(res, done, loading, column) {
|
|
|
window.console.log(column);
|
|
|
@@ -425,56 +477,71 @@ export default {
|
|
|
},
|
|
|
rowSave(row, done, loading) {
|
|
|
row.goodsTypeId = row.goodsTypeId.join(",");
|
|
|
- add(row).then(() => {
|
|
|
- this.initFlag = false;
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- window.console.log(error);
|
|
|
- loading();
|
|
|
- });
|
|
|
+ add(row).then(
|
|
|
+ () => {
|
|
|
+ this.initFlag = false;
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ window.console.log(error);
|
|
|
+ loading();
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
rowUpdate(row, index, done, loading) {
|
|
|
row.goodsTypeId = row.goodsTypeId.join(",");
|
|
|
// row.deptId = row.deptId.join(",");
|
|
|
// row.roleId = row.roleId.join(",");
|
|
|
// row.postId = row.postId.join(",");
|
|
|
- add(row).then(() => {
|
|
|
- this.initFlag = false;
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- window.console.log(error);
|
|
|
- loading();
|
|
|
- });
|
|
|
- },
|
|
|
- //查看跳转页面
|
|
|
- beforeOpenPage(row, index) {
|
|
|
- this.$router.push({
|
|
|
- path: "/commodityType_detailsPageEdit",
|
|
|
- query: { id: JSON.stringify(row.id) }
|
|
|
- });
|
|
|
+ add(row).then(
|
|
|
+ () => {
|
|
|
+ this.initFlag = false;
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ window.console.log(error);
|
|
|
+ loading();
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
//新增跳转页面
|
|
|
- beforeOpenE(row, index) {
|
|
|
- this.$router.push({
|
|
|
- path: "/commodityType_detailsPageEdit",
|
|
|
- query: { id: JSON.stringify(row.id),treeDeptId:this.treeDeptId }
|
|
|
+ beforeOpen() {
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ editOpen(row, status) {
|
|
|
+ this.detailData = {
|
|
|
+ id: row.id,
|
|
|
+ status: status
|
|
|
+ };
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ copyDoc() {
|
|
|
+ this.selectionList.forEach(e => {
|
|
|
+ this.detailData = {
|
|
|
+ id: e.id,
|
|
|
+ status: "copy"
|
|
|
+ };
|
|
|
+ this.show = false;
|
|
|
});
|
|
|
},
|
|
|
- //编辑跳转页面
|
|
|
- editOpen(row, index) {
|
|
|
- this.$router.push({
|
|
|
- path: "/commodityType_detailsPageEdit",
|
|
|
- query: { id: JSON.stringify(row.id) }
|
|
|
+ copyOrder(id) {
|
|
|
+ this.show = true;
|
|
|
+ this.detailData = {
|
|
|
+ id: id,
|
|
|
+ status: "copy"
|
|
|
+ };
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.show = false;
|
|
|
});
|
|
|
},
|
|
|
//删除触发
|
|
|
@@ -484,21 +551,21 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- return remove(row.id);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done()
|
|
|
+ .then(() => {
|
|
|
+ return remove(row.id);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
+ done();
|
|
|
+ });
|
|
|
},
|
|
|
searchReset() {
|
|
|
this.query = {};
|
|
|
- this.treeDeptId = '';
|
|
|
+ this.treeDeptId = "";
|
|
|
this.onLoad(this.page);
|
|
|
},
|
|
|
searchChange(params, done) {
|
|
|
@@ -524,17 +591,17 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- return remove(this.ids);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- this.$refs.crud.toggleSelection();
|
|
|
+ .then(() => {
|
|
|
+ return remove(this.ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ });
|
|
|
},
|
|
|
handleGrant() {
|
|
|
if (this.selectionList.length === 0) {
|
|
|
@@ -557,32 +624,11 @@ export default {
|
|
|
this.excelBox = true;
|
|
|
},
|
|
|
handleTemplate() {
|
|
|
- window.open(`/api/blade-user/export-template?${this.website.tokenHeader}=${getToken()}`);
|
|
|
- },
|
|
|
- //新增编辑查看触发
|
|
|
- async beforeOpen(done, type) {
|
|
|
- if (["add"].includes(type)) {
|
|
|
- this.option.column.forEach(e=>{
|
|
|
- if(e.prop=='goodsTypeId'){
|
|
|
- this.$set(this.option.column,2,{...e,value:this.treeDeptId})
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (["edit", "view"].includes(type)) {
|
|
|
- await getUser(this.form.id).then(res => {
|
|
|
- this.form = res.data.data;
|
|
|
- // this.form.goodsTypeId = [this.form.goodsTypeId.replace(/\"/g,"")]
|
|
|
- console.log(this.form.hasOwnProperty("goodsTypeId"))
|
|
|
- if(this.form.hasOwnProperty("goodsTypeId")){
|
|
|
- this.form.goodsTypeId = this.form.goodsTypeId.split(",");
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (["add", "edit"].includes(type)) {
|
|
|
- this.initData(0);
|
|
|
- }
|
|
|
- this.initFlag = true;
|
|
|
- done();
|
|
|
+ window.open(
|
|
|
+ `/api/blade-user/export-template?${
|
|
|
+ this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
},
|
|
|
currentChange(currentPage) {
|
|
|
this.page.currentPage = currentPage;
|
|
|
@@ -595,26 +641,34 @@ export default {
|
|
|
},
|
|
|
onLoad(page, params = {}) {
|
|
|
this.loading = true;
|
|
|
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
|
|
|
+ getList(
|
|
|
+ page.currentPage,
|
|
|
+ page.pageSize,
|
|
|
+ Object.assign(params, this.query),
|
|
|
+ this.treeDeptId
|
|
|
+ ).then(res => {
|
|
|
const data = res.data.data;
|
|
|
this.data = data.records;
|
|
|
- this.page.total = res.data.data.total
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
this.loading = false;
|
|
|
this.selectionClear();
|
|
|
});
|
|
|
},
|
|
|
platformRowUpdate(row, index, done, loading) {
|
|
|
- updatePlatform(row.id, row.userType, row.userExt).then(() => {
|
|
|
- this.platformOnLoad(this.platformPage);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- window.console.log(error);
|
|
|
- loading();
|
|
|
- });
|
|
|
+ updatePlatform(row.id, row.userType, row.userExt).then(
|
|
|
+ () => {
|
|
|
+ this.platformOnLoad(this.platformPage);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ window.console.log(error);
|
|
|
+ loading();
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
platformBeforeOpen(done, type) {
|
|
|
if (["edit", "view"].includes(type)) {
|
|
|
@@ -652,13 +706,23 @@ export default {
|
|
|
},
|
|
|
platformOnLoad(page, params = {}) {
|
|
|
this.platformLoading = true;
|
|
|
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
|
|
|
+ getList(
|
|
|
+ page.currentPage,
|
|
|
+ page.pageSize,
|
|
|
+ Object.assign(params, this.query),
|
|
|
+ this.treeDeptId
|
|
|
+ ).then(res => {
|
|
|
const data = res.data.data;
|
|
|
this.platformPage.total = data.total;
|
|
|
this.platformData = data.records;
|
|
|
this.platformLoading = false;
|
|
|
this.selectionClear();
|
|
|
});
|
|
|
+ },
|
|
|
+ goBack() {
|
|
|
+ this.detailData = this.$options.data().detailData;
|
|
|
+ this.show = true;
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
}
|
|
|
}
|
|
|
};
|