|
@@ -4,32 +4,38 @@
|
|
|
<div class="box">
|
|
|
<el-scrollbar>
|
|
|
<basic-container>
|
|
|
- <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
|
|
|
+ <avue-tree
|
|
|
+ :option="treeOption"
|
|
|
+ :data="treeData"
|
|
|
+ @node-click="nodeClick"
|
|
|
+ />
|
|
|
</basic-container>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="19">
|
|
|
- <basic-container>
|
|
|
- <avue-crud :option="option"
|
|
|
- :data="dataList"
|
|
|
- ref="crud"
|
|
|
- v-model="form"
|
|
|
- :page.sync="page"
|
|
|
- @row-del="rowDel"
|
|
|
- @row-update="rowUpdate"
|
|
|
- :before-open="beforeOpen"
|
|
|
- :before-close="beforeClose"
|
|
|
- @row-save="rowSave"
|
|
|
- @search-change="searchChange"
|
|
|
- @search-reset="searchReset"
|
|
|
- @selection-change="selectionChange"
|
|
|
- @current-change="currentChange"
|
|
|
- @size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @on-load="onLoad"
|
|
|
- @search-criteria-switch="searchCriteriaSwitch"
|
|
|
- @tree-load="treeLoad">
|
|
|
+ <basic-container class="page-crad">
|
|
|
+ <avue-crud
|
|
|
+ :option="option"
|
|
|
+ :data="dataList"
|
|
|
+ ref="crud"
|
|
|
+ v-model="form"
|
|
|
+ :page.sync="page"
|
|
|
+ @row-del="rowDel"
|
|
|
+ @row-update="rowUpdate"
|
|
|
+ :before-open="beforeOpen"
|
|
|
+ :before-close="beforeClose"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="searchReset"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @on-load="onLoad"
|
|
|
+ @search-criteria-switch="searchCriteriaSwitch"
|
|
|
+ @tree-load="treeLoad"
|
|
|
+ >
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</el-col>
|
|
@@ -38,7 +44,14 @@
|
|
|
|
|
|
<script>
|
|
|
import option from "./configuration/mainList.json";
|
|
|
-import {customerList, typeSave,detail,deleteDetails,getDeptLazyTree,getDeptTree} from "@/api/basicData/basicStorageDesc"
|
|
|
+import {
|
|
|
+ customerList,
|
|
|
+ typeSave,
|
|
|
+ detail,
|
|
|
+ deleteDetails,
|
|
|
+ getDeptLazyTree,
|
|
|
+ getDeptTree
|
|
|
+} from "@/api/basicData/basicStorageDesc";
|
|
|
|
|
|
export default {
|
|
|
name: "customerInformation",
|
|
@@ -47,50 +60,54 @@ export default {
|
|
|
form: {},
|
|
|
option: option,
|
|
|
treeOption: {
|
|
|
- nodeKey: 'id',
|
|
|
+ nodeKey: "id",
|
|
|
lazy: true,
|
|
|
- treeLoad: function (node, resolve) {
|
|
|
- const parentId = (node.level === 0) ? 0 : node.data.id;
|
|
|
+ treeLoad: function(node, resolve) {
|
|
|
+ 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"
|
|
|
}
|
|
|
},
|
|
|
- parentId:0,
|
|
|
+ parentId: 0,
|
|
|
dataList: [],
|
|
|
page: {
|
|
|
- pageSize: 10,
|
|
|
- pagerCount: 5,
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
},
|
|
|
- treeDeptId:'',
|
|
|
- }
|
|
|
+ treeDeptId: ""
|
|
|
+ };
|
|
|
},
|
|
|
created() {
|
|
|
// customerList({parentId:0}).then(res => {
|
|
|
// console.log(res.data.data.records)
|
|
|
// this.dataList = res.data.data.records
|
|
|
// })
|
|
|
+ this.option.height = window.innerHeight - 210;
|
|
|
},
|
|
|
mounted() {
|
|
|
- option.height = window.innerHeight - 350 ;
|
|
|
//查询服务类别字典项
|
|
|
getDeptTree().then(res => {
|
|
|
- this.findObject(this.option.column, "storageTypeId").dicData = res.data.data;
|
|
|
+ this.findObject(this.option.column, "storageTypeId").dicData =
|
|
|
+ res.data.data;
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
@@ -106,46 +123,54 @@ export default {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
- }).then(() => {
|
|
|
- return deleteDetails(row.id);
|
|
|
- }).then(() => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- // 数据回调进行刷新
|
|
|
- done(row);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return deleteDetails(row.id);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
+ // 数据回调进行刷新
|
|
|
+ done(row);
|
|
|
+ });
|
|
|
},
|
|
|
//修改时的修改按钮点击触发
|
|
|
rowUpdate(row, index, done, loading) {
|
|
|
- typeSave(row).then(() => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- // 数据回调进行刷新
|
|
|
- done(row);
|
|
|
- }, error => {
|
|
|
- window.console.log(error);
|
|
|
- loading();
|
|
|
- });
|
|
|
+ typeSave(row).then(
|
|
|
+ () => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ // 数据回调进行刷新
|
|
|
+ done(row);
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ window.console.log(error);
|
|
|
+ loading();
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
//新增修改时保存触发
|
|
|
rowSave(row, done, loading) {
|
|
|
- console.log(row)
|
|
|
- typeSave(row).then(res => {
|
|
|
- console.log(res)
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.onLoad(this.page, {});
|
|
|
- done()
|
|
|
- }, error => {
|
|
|
- window.console.log(error);
|
|
|
- loading();
|
|
|
- })
|
|
|
+ console.log(row);
|
|
|
+ typeSave(row).then(
|
|
|
+ res => {
|
|
|
+ console.log(res);
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, {});
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ window.console.log(error);
|
|
|
+ loading();
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
//查询全部
|
|
|
- initData(){
|
|
|
+ initData() {
|
|
|
getDeptTree().then(res => {
|
|
|
const column = this.findObject(this.option.column, "storageTypeId");
|
|
|
column.dicData = res.data.data;
|
|
@@ -162,11 +187,11 @@ export default {
|
|
|
//新增子项和新增触发查询所有
|
|
|
beforeOpen(done, type) {
|
|
|
if (["add", "edit"].includes(type)) {
|
|
|
- this.option.column.forEach(e=>{
|
|
|
- if(e.prop=='storageTypeId'){
|
|
|
- this.$set(this.option.column,3,{...e,value:this.treeDeptId})
|
|
|
+ this.option.column.forEach(e => {
|
|
|
+ if (e.prop == "storageTypeId") {
|
|
|
+ this.$set(this.option.column, 3, { ...e, value: this.treeDeptId });
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
if (["edit", "view"].includes(type)) {
|
|
|
detail(this.form.id).then(res => {
|
|
@@ -187,53 +212,54 @@ export default {
|
|
|
searchChange(params, done) {
|
|
|
this.page.currentPage = 1;
|
|
|
this.onLoad(this.page, params);
|
|
|
- done()
|
|
|
+ done();
|
|
|
},
|
|
|
searchReset() {
|
|
|
this.query = {};
|
|
|
- this.treeDeptId = '';
|
|
|
+ this.treeDeptId = "";
|
|
|
this.onLoad(this.page);
|
|
|
},
|
|
|
selectionChange() {
|
|
|
- console.log('1')
|
|
|
+ console.log("1");
|
|
|
},
|
|
|
currentChange() {
|
|
|
- console.log('1')
|
|
|
+ console.log("1");
|
|
|
},
|
|
|
sizeChange() {
|
|
|
- console.log('1')
|
|
|
+ console.log("1");
|
|
|
},
|
|
|
refreshChange() {
|
|
|
- console.log('1')
|
|
|
+ console.log("1");
|
|
|
},
|
|
|
- onLoad(page, params = {parentId:0}) {
|
|
|
- let queryParams = Object.assign({}, params, {size: page.pageSize, current: page.currentPage,parentId:0,storageTypeId:this.treeDeptId})
|
|
|
+ onLoad(page, params = { parentId: 0 }) {
|
|
|
+ let queryParams = Object.assign({}, params, {
|
|
|
+ size: page.pageSize,
|
|
|
+ current: page.currentPage,
|
|
|
+ parentId: 0,
|
|
|
+ storageTypeId: this.treeDeptId
|
|
|
+ });
|
|
|
customerList(queryParams).then(res => {
|
|
|
- this.dataList = res.data.data.records
|
|
|
- this.page.total = res.data.data.total
|
|
|
- if (this.page.total || this.page.total === 0) {
|
|
|
- this.option.height = window.innerHeight - 200;
|
|
|
- }
|
|
|
+ this.dataList = res.data.data.records;
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
});
|
|
|
},
|
|
|
- searchCriteriaSwitch(type){
|
|
|
- if (type){
|
|
|
- this.option.height = this.option.height - 90
|
|
|
- }else {
|
|
|
- this.option.height = this.option.height + 90
|
|
|
+ searchCriteriaSwitch(type) {
|
|
|
+ if (type) {
|
|
|
+ this.option.height = this.option.height - 93;
|
|
|
+ } else {
|
|
|
+ this.option.height = this.option.height + 93;
|
|
|
}
|
|
|
- this.$refs.crud.getTableHeight()
|
|
|
+ this.$refs.crud.getTableHeight();
|
|
|
},
|
|
|
//树桩列点击展开触发
|
|
|
treeLoad(tree, treeNode, resolve) {
|
|
|
const parentId = tree.id;
|
|
|
- customerList({parentId:parentId}).then(res => {
|
|
|
+ customerList({ parentId: parentId }).then(res => {
|
|
|
resolve(res.data.data.records);
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-}
|
|
|
+};
|
|
|
// {
|
|
|
// "label": "仓库",
|
|
|
// "prop": "storageTypeId",
|
|
@@ -260,5 +286,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
+.page-crad ::v-deep .basic-container__card {
|
|
|
+ height: 94.8vh;
|
|
|
+}
|
|
|
</style>
|