|
|
@@ -15,22 +15,22 @@
|
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- class="ele-btn-icon"
|
|
|
- @click="openEdit({},2)"
|
|
|
- >
|
|
|
- 新建物料
|
|
|
- </el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="openEdit({}, 2)"
|
|
|
+ >
|
|
|
+ 新建物料
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
icon="el-icon-copy-document"
|
|
|
- @click="openEdit(row,1)"
|
|
|
+ @click="openEdit(row, 1)"
|
|
|
>
|
|
|
复制
|
|
|
</el-link>
|
|
|
@@ -38,7 +38,7 @@
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
icon="el-icon-edit"
|
|
|
- @click="openEdit(row,0)"
|
|
|
+ @click="openEdit(row, 0)"
|
|
|
>
|
|
|
修改
|
|
|
</el-link>
|
|
|
@@ -56,30 +56,30 @@
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
<!-- 编辑弹窗 -->
|
|
|
-<!-- <dict-edit :visible.sync="showEdit" :id="id" @done="reload" /> -->
|
|
|
+ <!-- <dict-edit :visible.sync="showEdit" :id="id" @done="reload" /> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getMaterialList , removeMaterial } from '@/api/material/manage.js';
|
|
|
+ import { getMaterialList, removeMaterial } from '@/api/material/manage.js';
|
|
|
export default {
|
|
|
- components: { },
|
|
|
+ components: {},
|
|
|
props: {
|
|
|
// 物料组id
|
|
|
currentId: [Number, String],
|
|
|
- data:Object
|
|
|
+ data: Object
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
// 表格列配置
|
|
|
columns: [
|
|
|
{
|
|
|
columnKey: 'index',
|
|
|
type: 'index',
|
|
|
- width: 45,
|
|
|
+ width: 55,
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
|
- label:'序号'
|
|
|
+ label: '序号'
|
|
|
},
|
|
|
{
|
|
|
prop: 'code',
|
|
|
@@ -143,7 +143,7 @@
|
|
|
resizable: false,
|
|
|
slot: 'action',
|
|
|
showOverflowTooltip: true,
|
|
|
- fixed:'right'
|
|
|
+ fixed: 'right'
|
|
|
}
|
|
|
],
|
|
|
types: {
|
|
|
@@ -160,26 +160,35 @@
|
|
|
|
|
|
methods: {
|
|
|
/* 表格数据源 */
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
- return getMaterialList({ pageNum: page, size: limit, ...where , categoryLevelGroupId:this.currentId });
|
|
|
+ datasource ({ page, limit, where, order }) {
|
|
|
+ return getMaterialList({
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ ...where,
|
|
|
+ categoryLevelGroupId: this.currentId
|
|
|
+ });
|
|
|
},
|
|
|
/* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({ page: 1, where: where , categoryLevelGroupId:this.currentId });
|
|
|
+ reload (where) {
|
|
|
+ this.$refs.table.reload({
|
|
|
+ page: 1,
|
|
|
+ where: where,
|
|
|
+ categoryLevelGroupId: this.currentId
|
|
|
+ });
|
|
|
},
|
|
|
/* 显示编辑 */
|
|
|
- openEdit(row,status) {
|
|
|
+ openEdit (row, status) {
|
|
|
this.$router.push({
|
|
|
path: '/material/manage/manageMaterial',
|
|
|
query: {
|
|
|
chooseTab: JSON.stringify(this.data),
|
|
|
- id: row.id?row.id:null,
|
|
|
- status:status
|
|
|
+ id: row.id ? row.id : null,
|
|
|
+ status: status
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
/* 删除 */
|
|
|
- remove(row) {
|
|
|
+ remove (row) {
|
|
|
const loading = this.$loading({ lock: true });
|
|
|
removeMaterial(row.id)
|
|
|
.then((msg) => {
|
|
|
@@ -195,7 +204,7 @@
|
|
|
},
|
|
|
watch: {
|
|
|
// 监听物料组id变化
|
|
|
- currentId() {
|
|
|
+ currentId () {
|
|
|
this.reload();
|
|
|
}
|
|
|
}
|