Parcourir la source

链长制分类

master
YF-yuan il y a 3 ans
Parent
révision
1907e93839
2 fichiers modifiés avec 62 ajouts et 41 suppressions
  1. +19
    -0
      src/api/chain/industryClassify.js
  2. +43
    -41
      src/views/chain/industryClassify.vue

+ 19
- 0
src/api/chain/industryClassify.js Voir le fichier

@@ -0,0 +1,19 @@
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 Voir le fichier

@@ -1,7 +1,30 @@
<template>
<div class="category ele-body">
<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">
<el-button size="small" type="warning" @click="add">新增</el-button>
<el-button size="small" type="default" @click="remove()"
@@ -100,34 +123,14 @@
ref="editForm"
: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
:disabled='ischecked=="look"'
placeholder="请输入如表格名称"
placeholder="请输入如分类名称"
clearable
v-model="form.name"
></el-input>
</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-input :disabled='ischecked=="look"' type="textarea" :rows="4" v-model="form.note"></el-input>
</el-form-item>
@@ -141,15 +144,17 @@
</template>

<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 {
components: {
search,
Treeselect,
},
data() {
return {
// searchParams: {},
searchParams: {},
loading: false,
dataList: [],
count: 0,
@@ -178,12 +183,19 @@ export default {
};
},
created() {
this.getDataList();
this.$store.dispatch("base/getQuota1List", 1);
this.getDataList()
},
computed: {
...mapGetters(["formatDep"]),
},
methods: {
updateParams(data){
this.searchParams=data;
clear() {
this.searchParams = {
name: "",
};
},
search() {
// this.searchParams=data;
this.resetCurrentPage();
this.getDataList();
},
@@ -202,10 +214,6 @@ export default {
.then((res) => {
this.loading = false;
let data = res.data.data.records;
data = data.map((item) => {
item.year = item.year + "";
return item;
});
this.dataList = data;
this.count = res.data.data.total;
})
@@ -221,12 +229,6 @@ export default {
this.showAdd = true;
this.ischecked = 'add'
},
look(row) {
this.form = Object.assign({}, row)
this.dialogTitle = '查看表'
this.showAdd = true
this.ischecked = 'look'
},
edit(row) {
this.form = Object.assign({}, row)
this.showAdd = true;

Chargement…
Annuler
Enregistrer