Browse Source

链长制分类

master
YF-yuan 3 years ago
parent
commit
1907e93839
2 changed files with 62 additions and 41 deletions
  1. +19
    -0
      src/api/chain/industryClassify.js
  2. +43
    -41
      src/views/chain/industryClassify.vue

+ 19
- 0
src/api/chain/industryClassify.js View File

import axios from "@/config/axios"

export default {
add(params) {
return axios.post('/chaincategory/add', params)
},
getList(params) {
return axios.get('/chaincategory/index', { params })
},
edit(params) {
return axios.put('/chaincategory/edit', params)
},
delete(params) {
return axios.delete('/chaincategory/delete/'+params)
},
getDetail(index) {
return axios.get("/chaincategory/info" + index)
}
}

+ 43
- 41
src/views/chain/industryClassify.vue View File

<template> <template>
<div class="category ele-body"> <div class="category ele-body">
<el-card shadow="never"> <el-card shadow="never">
<search @search="updateParams($event)" />
<div class="search">
<el-form :inline="true" :model="searchParams" size="small">
<el-form-item label="分类名称">
<el-select v-model="searchParams.name">
<el-option
v-for="(item, index) in dataList"
:key="index"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
<el-button type="primary" size="small" @click="search">查询</el-button>
<el-button
type="default"
size="small"
@click="
clear();
search();
"
>清空</el-button
>
</el-form>
</div>
<div class="operating"> <div class="operating">
<el-button size="small" type="warning" @click="add">新增</el-button> <el-button size="small" type="warning" @click="add">新增</el-button>
<el-button size="small" type="default" @click="remove()" <el-button size="small" type="default" @click="remove()"
ref="editForm" ref="editForm"
:rules="rules" :rules="rules"
> >
<el-form-item label="考核年度:" prop="year">
<el-date-picker
:disabled='ischecked=="look"'
type="year"
placeholder="选择考核年度"
style="width: 100%"
v-model="form.year"
format="yyyy"
value-format="yyyy"
>
</el-date-picker>
</el-form-item>
<el-form-item label="表格名称:" prop="name">
<el-form-item label="分类名称:" prop="name">
<el-input <el-input
:disabled='ischecked=="look"' :disabled='ischecked=="look"'
placeholder="请输入如表格名称"
placeholder="请输入如分类名称"
clearable clearable
v-model="form.name" v-model="form.name"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="表编号:" prop="code">
<el-input
:disabled='ischecked=="look"'
placeholder="请输入表编号"
clearable
v-model="form.code"
></el-input>
</el-form-item>
<el-form-item label="备注:"> <el-form-item label="备注:">
<el-input :disabled='ischecked=="look"' type="textarea" :rows="4" v-model="form.note"></el-input> <el-input :disabled='ischecked=="look"' type="textarea" :rows="4" v-model="form.note"></el-input>
</el-form-item> </el-form-item>
</template> </template>


<script> <script>
import search from "./search";
import api from "@/api/basicTable/category.js";
import api from "@/api/chain/industryClassify.js";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect"; // 下拉树
import { mapGetters, mapActions } from "vuex";
export default { export default {
components: { components: {
search,
Treeselect,
}, },
data() { data() {
return { return {
// searchParams: {},
searchParams: {},
loading: false, loading: false,
dataList: [], dataList: [],
count: 0, count: 0,
}; };
}, },
created() { created() {
this.getDataList();
this.$store.dispatch("base/getQuota1List", 1);
this.getDataList()
},
computed: {
...mapGetters(["formatDep"]),
}, },
methods: { methods: {
updateParams(data){
this.searchParams=data;
clear() {
this.searchParams = {
name: "",
};
},
search() {
// this.searchParams=data;
this.resetCurrentPage(); this.resetCurrentPage();
this.getDataList(); this.getDataList();
}, },
.then((res) => { .then((res) => {
this.loading = false; this.loading = false;
let data = res.data.data.records; let data = res.data.data.records;
data = data.map((item) => {
item.year = item.year + "";
return item;
});
this.dataList = data; this.dataList = data;
this.count = res.data.data.total; this.count = res.data.data.total;
}) })
this.showAdd = true; this.showAdd = true;
this.ischecked = 'add' this.ischecked = 'add'
}, },
look(row) {
this.form = Object.assign({}, row)
this.dialogTitle = '查看表'
this.showAdd = true
this.ischecked = 'look'
},
edit(row) { edit(row) {
this.form = Object.assign({}, row) this.form = Object.assign({}, row)
this.showAdd = true; this.showAdd = true;

Loading…
Cancel
Save