|
@@ -8,11 +8,11 @@
|
|
</div>
|
|
</div>
|
|
<div class="bill-main">
|
|
<div class="bill-main">
|
|
<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
|
|
<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
|
|
- @resert="onRefresh" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
|
|
|
|
|
|
+ @resert="getDataList" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="onRefresh">
|
|
</module-view>
|
|
</module-view>
|
|
</div>
|
|
</div>
|
|
<!-- 新增/编辑弹窗 -->
|
|
<!-- 新增/编辑弹窗 -->
|
|
- <el-dialog :title="popTitle+'虚拟分类'" :visible.sync="dialogFormVisible" width="30%">
|
|
|
|
|
|
+ <el-dialog :title="popTitle+'厂商'" :visible.sync="dialogFormVisible" width="30%">
|
|
<by-form :propConfig="addConfig" ref="addFormId">
|
|
<by-form :propConfig="addConfig" ref="addFormId">
|
|
<template v-slot:status class="clearfix">
|
|
<template v-slot:status class="clearfix">
|
|
<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
|
|
<el-radio class="fl" style="margin-top: 8px;" v-model="radio" :label="0">正常</el-radio>
|
|
@@ -31,30 +31,26 @@
|
|
import api from "@/api/currency";
|
|
import api from "@/api/currency";
|
|
import Assembly from "@/components/Assembly/material.vue";
|
|
import Assembly from "@/components/Assembly/material.vue";
|
|
@Component
|
|
@Component
|
|
- export default class Virtually extends Vue {
|
|
|
|
- // 左边
|
|
|
|
- data : any = []
|
|
|
|
- expandedKeys : any = []
|
|
|
|
- parentId : any = ''
|
|
|
|
- // 右边
|
|
|
|
|
|
+ export default class Supplier extends Vue {
|
|
baseURL : any = process.env.VUE_APP_BASE_API
|
|
baseURL : any = process.env.VUE_APP_BASE_API
|
|
|
|
+ loading : any = null
|
|
timeNum = 0;
|
|
timeNum = 0;
|
|
timer : any = null
|
|
timer : any = null
|
|
popTitle : any = ''
|
|
popTitle : any = ''
|
|
radio : any = 0
|
|
radio : any = 0
|
|
dialogFormVisible : boolean = false
|
|
dialogFormVisible : boolean = false
|
|
|
|
+ categoryId : any = '';
|
|
treeConfig = {
|
|
treeConfig = {
|
|
attr: {
|
|
attr: {
|
|
retConfig: {
|
|
retConfig: {
|
|
id: 'id',
|
|
id: 'id',
|
|
- name: 'name'
|
|
|
|
},
|
|
},
|
|
defaultExpandAll: true,
|
|
defaultExpandAll: true,
|
|
label: 'name',
|
|
label: 'name',
|
|
resType: 'data'
|
|
resType: 'data'
|
|
},
|
|
},
|
|
request: {
|
|
request: {
|
|
- url: '/maindata/maindataOrganizationCategory/treeList',
|
|
|
|
|
|
+ url: '/maindata/maindataOrganizationCategory/treeUseList',
|
|
method: 'GET'
|
|
method: 'GET'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -76,29 +72,28 @@
|
|
clearable: true
|
|
clearable: true
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- },
|
|
|
|
- {
|
|
|
|
|
|
+ }, {
|
|
span: 6,
|
|
span: 6,
|
|
- label: '简称',
|
|
|
|
- prop: 'shortName',
|
|
|
|
|
|
+ label: '负责人',
|
|
|
|
+ prop: 'contacts',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
labelWidth: '70px',
|
|
labelWidth: '70px',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请输入简称',
|
|
|
|
|
|
+ placeholder: '请输入负责人',
|
|
clearable: true
|
|
clearable: true
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 6,
|
|
span: 6,
|
|
label: '状态',
|
|
label: '状态',
|
|
prop: 'status',
|
|
prop: 'status',
|
|
- component: 'by-select',
|
|
|
|
labelWidth: '70px',
|
|
labelWidth: '70px',
|
|
|
|
+ component: 'by-select',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
- placeholder: '请选择数据',
|
|
|
|
|
|
+ placeholder: '请选择状态',
|
|
clearable: true,
|
|
clearable: true,
|
|
data: [{
|
|
data: [{
|
|
value: 0,
|
|
value: 0,
|
|
@@ -123,28 +118,40 @@
|
|
table: {
|
|
table: {
|
|
attr: {
|
|
attr: {
|
|
size: 'mini',
|
|
size: 'mini',
|
|
- seq: true,
|
|
|
|
- align: 'center',
|
|
|
|
- checkbox: false,
|
|
|
|
|
|
+ align: 'left',
|
|
height: 600
|
|
height: 600
|
|
},
|
|
},
|
|
columns: [{
|
|
columns: [{
|
|
- width: 300,
|
|
|
|
title: '名称',
|
|
title: '名称',
|
|
field: 'name',
|
|
field: 'name',
|
|
isDetail: true,
|
|
isDetail: true,
|
|
- }, {
|
|
|
|
- title: '简称',
|
|
|
|
- field: 'shortName'
|
|
|
|
- }, {
|
|
|
|
|
|
+ width: 150,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '负责人',
|
|
|
|
+ field: 'contacts',
|
|
|
|
+ width: 120,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '联系电话',
|
|
|
|
+ field: 'phonenum',
|
|
|
|
+ width: 150,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '手机号码',
|
|
|
|
+ field: 'telephone',
|
|
|
|
+ width: 150,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ width: 300,
|
|
|
|
+ title: '财务系统类型',
|
|
|
|
+ field: 'financeType',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
width: 80,
|
|
width: 80,
|
|
title: '状态',
|
|
title: '状态',
|
|
field: 'status',
|
|
field: 'status',
|
|
component: Assembly,
|
|
component: Assembly,
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '备注',
|
|
|
|
- field: 'remark',
|
|
|
|
}, {
|
|
}, {
|
|
width: 120,
|
|
width: 120,
|
|
title: '操作',
|
|
title: '操作',
|
|
@@ -171,11 +178,17 @@
|
|
attr: {
|
|
attr: {
|
|
size: 'small',
|
|
size: 'small',
|
|
rules: {
|
|
rules: {
|
|
|
|
+ categoryName: [{
|
|
|
|
+ required: true, message: '请输入父级', trigger: 'blur'
|
|
|
|
+ }],
|
|
name: [{
|
|
name: [{
|
|
required: true, message: '请输入名称', trigger: 'blur'
|
|
required: true, message: '请输入名称', trigger: 'blur'
|
|
}],
|
|
}],
|
|
- parentName: [{
|
|
|
|
- required: true, message: '请选择父级', trigger: 'change'
|
|
|
|
|
|
+ contacts: [{
|
|
|
|
+ required: true, message: '请输入负责人', trigger: 'blur'
|
|
|
|
+ }],
|
|
|
|
+ financeType: [{
|
|
|
|
+ required: true, message: '请输入财务系统类型', trigger: 'change'
|
|
}],
|
|
}],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -185,20 +198,20 @@
|
|
span: 23,
|
|
span: 23,
|
|
label: '父级',
|
|
label: '父级',
|
|
labelWidth: '70px',
|
|
labelWidth: '70px',
|
|
- prop: 'parentName',
|
|
|
|
|
|
+ prop: 'categoryName',
|
|
component: 'select-tree',
|
|
component: 'select-tree',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
label: 'name',
|
|
label: 'name',
|
|
clearable: true,
|
|
clearable: true,
|
|
retConfig: {
|
|
retConfig: {
|
|
- parentId: 'id',
|
|
|
|
- parentName: 'name',
|
|
|
|
|
|
+ categoryId: 'id',
|
|
|
|
+ categoryName: 'name',
|
|
},
|
|
},
|
|
defaultExpandAll: true
|
|
defaultExpandAll: true
|
|
},
|
|
},
|
|
request: {
|
|
request: {
|
|
- url: '/maindata/maindataOrganizationCategory/treeList'
|
|
|
|
|
|
+ url: '/maindata/maindataOrganizationCategory/treeUseList'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -212,9 +225,8 @@
|
|
{
|
|
{
|
|
span: 23,
|
|
span: 23,
|
|
labelWidth: '70px',
|
|
labelWidth: '70px',
|
|
- label: '简称',
|
|
|
|
- slot: true,
|
|
|
|
- prop: 'shortName',
|
|
|
|
|
|
+ label: '负责人',
|
|
|
|
+ prop: 'contacts',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -226,11 +238,25 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
span: 23,
|
|
span: 23,
|
|
- labelWidth: '70px',
|
|
|
|
- label: '备注',
|
|
|
|
- slot: true,
|
|
|
|
- prop: 'remark',
|
|
|
|
- component: 'by-input',
|
|
|
|
|
|
+ labelWidth: '110px',
|
|
|
|
+ label: '财务系统类型',
|
|
|
|
+ prop: 'financeType',
|
|
|
|
+ component: 'by-select',
|
|
|
|
+ compConfig: {
|
|
|
|
+ attr: {
|
|
|
|
+ placeholder: '请选择财务系统类型',
|
|
|
|
+ clearable: true,
|
|
|
|
+ data: [
|
|
|
|
+ {
|
|
|
|
+ value: '金蝶K3',
|
|
|
|
+ label: '金蝶K3'
|
|
|
|
+ }, {
|
|
|
|
+ value: '用友U8',
|
|
|
|
+ label: '用友U8'
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
],
|
|
],
|
|
]
|
|
]
|
|
@@ -238,19 +264,13 @@
|
|
mounted() {
|
|
mounted() {
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
this.getDataList()
|
|
this.getDataList()
|
|
- }, 500)
|
|
|
|
|
|
+ }, 300)
|
|
}
|
|
}
|
|
//点击树获取数据
|
|
//点击树获取数据
|
|
onChangeTree(e : any) {
|
|
onChangeTree(e : any) {
|
|
- this.parentId = e.id;
|
|
|
|
- let data : any = {};
|
|
|
|
- if (e.id.length > 1) {
|
|
|
|
- data.ids = e.id;
|
|
|
|
- if (data.ids[0] === 100) data.ids.shift();
|
|
|
|
- } else {
|
|
|
|
- data.parentId = e.id;
|
|
|
|
- }
|
|
|
|
- api.childrenTreeList(data, 'maindataMaterialSupplier').then((res : any) => {
|
|
|
|
|
|
+ console.log('点击结果:', e)
|
|
|
|
+ this.categoryId = e.id
|
|
|
|
+ api.byCategoryPage({ categoryId: e.id }, 'maindataOrganizationCategory').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
let page = {
|
|
let page = {
|
|
@@ -269,6 +289,7 @@
|
|
console.log(query);
|
|
console.log(query);
|
|
query.status = this.radio;
|
|
query.status = this.radio;
|
|
this.dialogFormVisible = false;
|
|
this.dialogFormVisible = false;
|
|
|
|
+
|
|
if (this.popTitle === '新增') {
|
|
if (this.popTitle === '新增') {
|
|
api.saveList(query, 'maindataMaterialSupplier').then((res : any) => {
|
|
api.saveList(query, 'maindataMaterialSupplier').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -286,6 +307,7 @@
|
|
} else this.$message.error(res.msg);
|
|
} else this.$message.error(res.msg);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
// 获取列表数据
|
|
// 获取列表数据
|
|
@@ -299,17 +321,6 @@
|
|
}
|
|
}
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
let query = (this.$refs.moduleView as any).getQuery();
|
|
let query = (this.$refs.moduleView as any).getQuery();
|
|
- if (this.parentId) query.parentId = this.parentId;
|
|
|
|
- let newData : any = {}
|
|
|
|
- for (let key in query) {
|
|
|
|
- if (query[key].toString()) {
|
|
|
|
- newData[key] = query[key]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- console.log('表单字段 ==> ', newData);
|
|
|
|
- this.getPageList(newData)
|
|
|
|
- }
|
|
|
|
- getPageList(query : any) {
|
|
|
|
api.pageList(query, 'maindataMaterialSupplier').then((res : any) => {
|
|
api.pageList(query, 'maindataMaterialSupplier').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
(this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
@@ -318,7 +329,7 @@
|
|
pageSize: res.data.size, //每页条数
|
|
pageSize: res.data.size, //每页条数
|
|
total: res.data.total //总条数
|
|
total: res.data.total //总条数
|
|
};
|
|
};
|
|
- (this.$refs.moduleView as any).setPage(page);
|
|
|
|
|
|
+ (this.$refs.moduleView as any).setPage(page)
|
|
} else this.$message.error(res.msg);
|
|
} else this.$message.error(res.msg);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -330,32 +341,25 @@
|
|
}
|
|
}
|
|
// 打开新增
|
|
// 打开新增
|
|
onAdd() {
|
|
onAdd() {
|
|
- this.popTitle = '新增'
|
|
|
|
|
|
+ this.popTitle = '新增';
|
|
this.dialogFormVisible = true;
|
|
this.dialogFormVisible = true;
|
|
- this.radio = 0
|
|
|
|
|
|
+ this.radio = 0;
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue({});
|
|
|
|
|
|
+ if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue('');
|
|
}, 0)
|
|
}, 0)
|
|
}
|
|
}
|
|
// 打开编辑
|
|
// 打开编辑
|
|
openEdit(e : any) {
|
|
openEdit(e : any) {
|
|
- console.log(e);
|
|
|
|
this.popTitle = '编辑'
|
|
this.popTitle = '编辑'
|
|
this.dialogFormVisible = true;
|
|
this.dialogFormVisible = true;
|
|
this.radio = e.status;
|
|
this.radio = e.status;
|
|
- e.parentId = e.id;
|
|
|
|
- api.single({ id: e.parentId }, 'maindataMaterialSupplier').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- e.parentName = res.data.name
|
|
|
|
- setTimeout(() => {
|
|
|
|
- if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
|
|
|
|
- }, 0)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);
|
|
|
|
+ }, 0)
|
|
}
|
|
}
|
|
// 工具栏删除
|
|
// 工具栏删除
|
|
onDelete() {
|
|
onDelete() {
|
|
- let selectData = (this.$refs.moduleView as any).getSelectData();
|
|
|
|
|
|
+ let selectData = (this.$refs.moduleView as any).getSelectData()
|
|
let ids = '';
|
|
let ids = '';
|
|
if (selectData.length > 0) {
|
|
if (selectData.length > 0) {
|
|
selectData.map((v : any) => {
|
|
selectData.map((v : any) => {
|
|
@@ -386,27 +390,33 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- api.childrenTreeList({ id: item.id }, 'maindataMaterialSupplier').then((v : any) => {
|
|
|
|
- if (v.code === 200) {
|
|
|
|
- if (v.data.length > 0) return this.$message.error('此数据有子节点,不能进行删除!')
|
|
|
|
- api.deleteList({ ids: item.id }, 'maindataMaterialSupplier').then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- (this as any).$refs.sideTree.request();
|
|
|
|
- this.getDataList();
|
|
|
|
- this.$message.success('删除成功!');
|
|
|
|
- } else this.$message.error(res.msg);;
|
|
|
|
- })
|
|
|
|
- } else this.$message.error('删除失败!请稍后再试');
|
|
|
|
|
|
+ api.deleteList({ ids: item.id }, 'maindataMaterialSupplier').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ (this as any).$refs.sideTree.request();
|
|
|
|
+ this.getDataList();
|
|
|
|
+ this.$message.success('删除成功!');
|
|
|
|
+ } else this.$message.error(res.msg);
|
|
})
|
|
})
|
|
- }).catch(() => this.$message.info('已取消删除'));
|
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$message.info('已取消删除');
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- // 刷新/重置
|
|
|
|
|
|
+ // 刷新
|
|
onRefresh() {
|
|
onRefresh() {
|
|
- let loading = this.$loading({ target: '.main-container' });
|
|
|
|
|
|
+ this.loading = this.$loading({ target: '.main-container' });
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
(this as any).$refs.moduleView.clearSearch();
|
|
- this.parentId = '';
|
|
|
|
- this.getPageList({});
|
|
|
|
- loading.close();
|
|
|
|
|
|
+ api.pageList({}, 'maindataMaterialSupplier').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ (this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
|
|
+ let page = {
|
|
|
|
+ pageNo: res.data.current, //当前页
|
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
|
+ total: res.data.total //总条数
|
|
|
|
+ };
|
|
|
|
+ (this.$refs.moduleView as any).setPage(page);
|
|
|
|
+ this.loading.close();
|
|
|
|
+ } else this.$message.error(res.msg);
|
|
|
|
+ })
|
|
}
|
|
}
|
|
//导出
|
|
//导出
|
|
onExport() {
|
|
onExport() {
|
|
@@ -437,7 +447,6 @@
|
|
border-right: solid #EEE 1px;
|
|
border-right: solid #EEE 1px;
|
|
padding-right: 16px;
|
|
padding-right: 16px;
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
- height: 740px;
|
|
|
|
|
|
|
|
// box-sizing: border-box;
|
|
// box-sizing: border-box;
|
|
.bill-tab {
|
|
.bill-tab {
|
|
@@ -447,7 +456,7 @@
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
|
|
|
|
- .tab-title {
|
|
|
|
|
|
+ .title {
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
padding-bottom: 16px;
|
|
padding-bottom: 16px;
|
|
width: 200px;
|
|
width: 200px;
|