|
@@ -6,10 +6,18 @@
|
|
|
<!-- 主体列表 -->
|
|
|
<el-card class="material-list" v-loading="loading">
|
|
|
|
|
|
- <!-- 操作栏 -->
|
|
|
+
|
|
|
<div style="margin: 0 0 10px 0;">
|
|
|
<!-- 查询条件 -->
|
|
|
- <el-row :gutter="10">
|
|
|
+ <el-super-search
|
|
|
+ v-model="params"
|
|
|
+ :size="size"
|
|
|
+ :dict="dict"
|
|
|
+ :columns="SearchColumns"
|
|
|
+ @reset="handleResetQuery"
|
|
|
+ @submit="handleQuery"
|
|
|
+ ></el-super-search>
|
|
|
+ <!-- <el-row :gutter="10">
|
|
|
<el-col :span="1.5">
|
|
|
<el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
|
|
|
<el-form-item label="物料编码">
|
|
@@ -19,14 +27,12 @@
|
|
|
<el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="启用状态">
|
|
|
- <!-- 0=已启用,2=已停用 -->
|
|
|
<el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
|
|
|
<el-option key="0" label="已启用" value="0"></el-option>
|
|
|
<el-option key="2" label="已停用" value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="是否同步NC">
|
|
|
- <!-- 是否同步;2=否,0=是 -->
|
|
|
<el-select size="small" v-model="queryForm.isSync" placeholder="请选择" clearable>
|
|
|
<el-option key="0" label="是" value="0"></el-option>
|
|
|
<el-option key="2" label="否" value="2"></el-option>
|
|
@@ -40,8 +46,9 @@
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
|
|
|
- </el-row>
|
|
|
+ </el-row> -->
|
|
|
</div>
|
|
|
+ <!-- 操作栏 -->
|
|
|
<el-row
|
|
|
:gutter="10"
|
|
|
class="mb10"
|
|
@@ -104,6 +111,7 @@
|
|
|
border
|
|
|
:data="taskList"
|
|
|
ref="materialTable"
|
|
|
+ max-height="550"
|
|
|
@cell-dblclick="handledbClick"
|
|
|
:row-key="getRowKey"
|
|
|
@selection-change="handleSelectionChange"
|
|
@@ -111,7 +119,7 @@
|
|
|
@select-all="handleSelectAll"
|
|
|
>
|
|
|
<!-- -->
|
|
|
- <el-table-column type="selection" width="45" :reserve-selection="true"/>
|
|
|
+ <el-table-column type="selection" width="45" :reserve-selection="true" fixed/>
|
|
|
<el-table-column type="index" label="序号" width="55" align="center"/>
|
|
|
<el-table-column
|
|
|
width="150"
|
|
@@ -120,13 +128,27 @@
|
|
|
align="center"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
- <!-- :prop="h.attribute == 'select' ? `${h.prop}Name` : h.prop" -->
|
|
|
<template slot-scope="scope">
|
|
|
- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
|
|
|
+ <span v-if="h.apiUrl">{{scope.row[`${h.prop}Name`]}}</span>
|
|
|
+ <el-checkbox
|
|
|
+ v-else-if="h.attribute == 'checkbox'"
|
|
|
+ v-model="scope.row[h.prop]"
|
|
|
+ disabled
|
|
|
+ true-label="0"
|
|
|
+ false-label="2"
|
|
|
+ ></el-checkbox>
|
|
|
+ <el-dict-tag
|
|
|
+ v-else-if="h.dictId"
|
|
|
+ :value="scope.row[h.prop]"
|
|
|
+ :options="dict.type[h.dictId]"
|
|
|
+ ></el-dict-tag>
|
|
|
+
|
|
|
+ <span v-else>{{ scope.row[h.prop] || '--' }}</span>
|
|
|
+ <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
|
|
|
(h.attribute == 'checkbox' ?
|
|
|
(scope.row[h.prop] == '0' ? '√' : '')
|
|
|
: scope.row[h.prop])
|
|
|
- }}
|
|
|
+ }} -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -174,12 +196,24 @@
|
|
|
<script>
|
|
|
import './style/index.scss';
|
|
|
import materialApi from '@/api/material/basic';
|
|
|
+ import { SearchColumns,OtherDictColumns } from './columns';
|
|
|
+ import { initDicts } from "@/utils/init.js";
|
|
|
|
|
|
export default {
|
|
|
name: "material-basic",
|
|
|
+ dicts:[...initDicts([...SearchColumns,...OtherDictColumns])],
|
|
|
+ // dicts:[],
|
|
|
+ components: {
|
|
|
+ ElSuperSearch: () => import("@/components/super-search/index.vue"),
|
|
|
+ ElDictTag: () => import("@/components/DictTag/index.vue"),
|
|
|
+ },
|
|
|
data() {
|
|
|
+ const params = this.$init.params(SearchColumns);
|
|
|
return {
|
|
|
failLoad: false,
|
|
|
+ params:params,
|
|
|
+ SearchColumns:SearchColumns,
|
|
|
+ size:'mini',
|
|
|
// 物料基本信息数据
|
|
|
taskList: [],
|
|
|
// 查询表单字段
|
|
@@ -289,17 +323,25 @@
|
|
|
},
|
|
|
// 重置查询条件
|
|
|
handleResetQuery() {
|
|
|
- for (const key in this.queryForm) {
|
|
|
+ // for (const key in this.queryForm) {
|
|
|
|
|
|
- this.queryForm[key] = '';
|
|
|
- }
|
|
|
+ // this.queryForm[key] = '';
|
|
|
+ // }
|
|
|
+
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+
|
|
|
+ this.queryParams.pageSize = 10;
|
|
|
+
|
|
|
+ this.params = this.$init.params(SearchColumns);
|
|
|
+
|
|
|
+ this.handleQuery();
|
|
|
},
|
|
|
// 刷新
|
|
|
handleRefresh() {
|
|
|
this.getMaterialList('material');
|
|
|
- for (const key in this.queryForm) {
|
|
|
- this.queryForm[key] = '';
|
|
|
- }
|
|
|
+ // for (const key in this.queryForm) {
|
|
|
+ // this.queryForm[key] = '';
|
|
|
+ // }
|
|
|
},
|
|
|
// 过滤
|
|
|
handleFilter(e) {
|
|
@@ -495,6 +537,7 @@
|
|
|
},
|
|
|
// 获取物料列表信息
|
|
|
getMaterialList(templateCode, query) {
|
|
|
+ // (params, page)
|
|
|
let _this = this;
|
|
|
this.loading = true;
|
|
|
let page = {
|
|
@@ -504,7 +547,8 @@
|
|
|
|
|
|
let param = {
|
|
|
templateCode,
|
|
|
- ...this.queryForm
|
|
|
+ ...this.params
|
|
|
+ // ...this.queryForm
|
|
|
}
|
|
|
// console.log(param, 'param');
|
|
|
materialApi.materialList(param, page).then((res) => {
|
|
@@ -523,6 +567,24 @@
|
|
|
materialApi.tagList({templateCode}).then(res => {
|
|
|
console.log(res, '获取物料列表表头');
|
|
|
if (res.code == 200) {
|
|
|
+
|
|
|
+ // let dictList = []
|
|
|
+ // res.data.forEach(item =>{
|
|
|
+ // if(item.dictId){
|
|
|
+ // // 字典
|
|
|
+ // dictList.push({
|
|
|
+ // item:{...item},
|
|
|
+ // attr:{
|
|
|
+ // dictName:item.dictId
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // console.log(dictList,'dictList');
|
|
|
+ // console.log(this,'this');
|
|
|
+ // this.dict =[...initDicts([...SearchColumns,...dictList])]
|
|
|
+
|
|
|
this.tableHeader = res.data;
|
|
|
}
|
|
|
})
|
|
@@ -565,7 +627,7 @@
|
|
|
|
|
|
<style lang="scss">
|
|
|
.material-list {
|
|
|
- height: calc(100vh - 70px);
|
|
|
+ // height: calc(100vh - 70px);
|
|
|
|
|
|
|
|
|
.el-card__body {
|