crops智慧农业
This commit is contained in:
44
ruoyi-ui/src/api/crops/data.js
Normal file
44
ruoyi-ui/src/api/crops/data.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询作物综合数据列表
|
||||
export function listData(query) {
|
||||
return request({
|
||||
url: '/crops/data/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询作物综合数据详细
|
||||
export function getData(id) {
|
||||
return request({
|
||||
url: '/crops/data/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增作物综合数据
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/crops/data',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改作物综合数据
|
||||
export function updateData(data) {
|
||||
return request({
|
||||
url: '/crops/data',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除作物综合数据
|
||||
export function delData(id) {
|
||||
return request({
|
||||
url: '/crops/data/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
ruoyi-ui/src/api/pill/factory.js
Normal file
44
ruoyi-ui/src/api/pill/factory.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询生产厂家信息列表
|
||||
export function listFactory(query) {
|
||||
return request({
|
||||
url: '/pill/factory/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询生产厂家信息详细
|
||||
export function getFactory(factoryId) {
|
||||
return request({
|
||||
url: '/pill/factory/' + factoryId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增生产厂家信息
|
||||
export function addFactory(data) {
|
||||
return request({
|
||||
url: '/pill/factory',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改生产厂家信息
|
||||
export function updateFactory(data) {
|
||||
return request({
|
||||
url: '/pill/factory',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除生产厂家信息
|
||||
export function delFactory(factoryId) {
|
||||
return request({
|
||||
url: '/pill/factory/' + factoryId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
506
ruoyi-ui/src/views/crops/data/index.vue
Normal file
506
ruoyi-ui/src/views/crops/data/index.vue
Normal file
@ -0,0 +1,506 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="镇耕地面积(万亩)" prop="cultivatedArea">
|
||||
<el-input
|
||||
v-model="queryParams.cultivatedArea"
|
||||
placeholder="请输入镇耕地面积(万亩)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="粮食总产(万吨)" prop="foodstuffProduction">
|
||||
<el-input
|
||||
v-model="queryParams.foodstuffProduction"
|
||||
placeholder="请输入粮食总产(万吨)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="蔬菜种植面积(亩)" prop="vegetablePlantingArea">
|
||||
<el-input
|
||||
v-model="queryParams.vegetablePlantingArea"
|
||||
placeholder="请输入蔬菜种植面积(亩)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="蔬菜总产(吨)" prop="vegetableProduction">
|
||||
<el-input
|
||||
v-model="queryParams.vegetableProduction"
|
||||
placeholder="请输入蔬菜总产(吨)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="农产品种类" prop="type">
|
||||
<el-input
|
||||
v-model="queryParams.type"
|
||||
placeholder="请输入农产品种类"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="农产品种植面积(亩)" prop="agriculturalPlantingArea">
|
||||
<el-input
|
||||
v-model="queryParams.agriculturalPlantingArea"
|
||||
placeholder="请输入农产品种植面积(亩)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="特色农业总产量(吨)" prop="agricultureProduction">
|
||||
<el-input
|
||||
v-model="queryParams.agricultureProduction"
|
||||
placeholder="请输入特色农业总产量(吨)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="特色农业年产值(万元)" prop="agricultureOutputVaule">
|
||||
<el-input
|
||||
v-model="queryParams.agricultureOutputVaule"
|
||||
placeholder="请输入特色农业年产值(万元)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="总人口(人)" prop="totalPopulation">
|
||||
<el-input
|
||||
v-model="queryParams.totalPopulation"
|
||||
placeholder="请输入总人口(人)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="占地面积(平方公里)" prop="coverArea">
|
||||
<el-input
|
||||
v-model="queryParams.coverArea"
|
||||
placeholder="请输入占地面积(平方公里)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="示范大棚数量(个)" prop="exampleGreenhouse">
|
||||
<el-input
|
||||
v-model="queryParams.exampleGreenhouse"
|
||||
placeholder="请输入示范大棚数量(个)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="村居数量(个)" prop="rusticate">
|
||||
<el-input
|
||||
v-model="queryParams.rusticate"
|
||||
placeholder="请输入村居数量(个)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联合社耕地面积(万亩)" prop="cultivatedAlly">
|
||||
<el-input
|
||||
v-model="queryParams.cultivatedAlly"
|
||||
placeholder="请输入联合社耕地面积(万亩)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="大棚数量(个)" prop="greenhouse">
|
||||
<el-input
|
||||
v-model="queryParams.greenhouse"
|
||||
placeholder="请输入大棚数量(个)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="农产品产值(万元)" prop="outputValue">
|
||||
<el-input
|
||||
v-model="queryParams.outputValue"
|
||||
placeholder="请输入农产品产值(万元)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="庞家镇矢量边界" prop="vectorBoundary">
|
||||
<el-input
|
||||
v-model="queryParams.vectorBoundary"
|
||||
placeholder="请输入庞家镇矢量边界"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="庞家镇村庄矢量边界" prop="villageVectorBoundary">
|
||||
<el-input
|
||||
v-model="queryParams.villageVectorBoundary"
|
||||
placeholder="请输入庞家镇村庄矢量边界"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input
|
||||
v-model="queryParams.createdBy"
|
||||
placeholder="请输入创建人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['crops:data:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['crops:data:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['crops:data:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['crops:data:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="id" align="center" prop="id" />
|
||||
<el-table-column label="镇耕地面积(万亩)" align="center" prop="cultivatedArea" />
|
||||
<el-table-column label="粮食总产(万吨)" align="center" prop="foodstuffProduction" />
|
||||
<el-table-column label="蔬菜种植面积(亩)" align="center" prop="vegetablePlantingArea" />
|
||||
<el-table-column label="蔬菜总产(吨)" align="center" prop="vegetableProduction" />
|
||||
<el-table-column label="农产品种类" align="center" prop="type" />
|
||||
<el-table-column label="农产品种植面积(亩)" align="center" prop="agriculturalPlantingArea" />
|
||||
<el-table-column label="特色农业总产量(吨)" align="center" prop="agricultureProduction" />
|
||||
<el-table-column label="特色农业年产值(万元)" align="center" prop="agricultureOutputVaule" />
|
||||
<el-table-column label="总人口(人)" align="center" prop="totalPopulation" />
|
||||
<el-table-column label="占地面积(平方公里)" align="center" prop="coverArea" />
|
||||
<el-table-column label="示范大棚数量(个)" align="center" prop="exampleGreenhouse" />
|
||||
<el-table-column label="村居数量(个)" align="center" prop="rusticate" />
|
||||
<el-table-column label="联合社耕地面积(万亩)" align="center" prop="cultivatedAlly" />
|
||||
<el-table-column label="大棚数量(个)" align="center" prop="greenhouse" />
|
||||
<el-table-column label="农产品产值(万元)" align="center" prop="outputValue" />
|
||||
<el-table-column label="庞家镇矢量边界" align="center" prop="vectorBoundary" />
|
||||
<el-table-column label="庞家镇村庄矢量边界" align="center" prop="villageVectorBoundary" />
|
||||
<el-table-column label="创建人" align="center" prop="createdBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createdTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['crops:data:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['crops:data:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改作物综合数据对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="镇耕地面积(万亩)" prop="cultivatedArea">
|
||||
<el-input v-model="form.cultivatedArea" placeholder="请输入镇耕地面积(万亩)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="粮食总产(万吨)" prop="foodstuffProduction">
|
||||
<el-input v-model="form.foodstuffProduction" placeholder="请输入粮食总产(万吨)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="蔬菜种植面积(亩)" prop="vegetablePlantingArea">
|
||||
<el-input v-model="form.vegetablePlantingArea" placeholder="请输入蔬菜种植面积(亩)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="蔬菜总产(吨)" prop="vegetableProduction">
|
||||
<el-input v-model="form.vegetableProduction" placeholder="请输入蔬菜总产(吨)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="农产品种类" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入农产品种类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="农产品种植面积(亩)" prop="agriculturalPlantingArea">
|
||||
<el-input v-model="form.agriculturalPlantingArea" placeholder="请输入农产品种植面积(亩)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="特色农业总产量(吨)" prop="agricultureProduction">
|
||||
<el-input v-model="form.agricultureProduction" placeholder="请输入特色农业总产量(吨)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="特色农业年产值(万元)" prop="agricultureOutputVaule">
|
||||
<el-input v-model="form.agricultureOutputVaule" placeholder="请输入特色农业年产值(万元)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总人口(人)" prop="totalPopulation">
|
||||
<el-input v-model="form.totalPopulation" placeholder="请输入总人口(人)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="占地面积(平方公里)" prop="coverArea">
|
||||
<el-input v-model="form.coverArea" placeholder="请输入占地面积(平方公里)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="示范大棚数量(个)" prop="exampleGreenhouse">
|
||||
<el-input v-model="form.exampleGreenhouse" placeholder="请输入示范大棚数量(个)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="村居数量(个)" prop="rusticate">
|
||||
<el-input v-model="form.rusticate" placeholder="请输入村居数量(个)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联合社耕地面积(万亩)" prop="cultivatedAlly">
|
||||
<el-input v-model="form.cultivatedAlly" placeholder="请输入联合社耕地面积(万亩)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="大棚数量(个)" prop="greenhouse">
|
||||
<el-input v-model="form.greenhouse" placeholder="请输入大棚数量(个)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="农产品产值(万元)" prop="outputValue">
|
||||
<el-input v-model="form.outputValue" placeholder="请输入农产品产值(万元)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="庞家镇矢量边界" prop="vectorBoundary">
|
||||
<el-input v-model="form.vectorBoundary" placeholder="请输入庞家镇矢量边界" />
|
||||
</el-form-item>
|
||||
<el-form-item label="庞家镇村庄矢量边界" prop="villageVectorBoundary">
|
||||
<el-input v-model="form.villageVectorBoundary" placeholder="请输入庞家镇村庄矢量边界" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建人" prop="createdBy">-->
|
||||
<!-- <el-input v-model="form.createdBy" placeholder="请输入创建人" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="创建时间" prop="createdTime">-->
|
||||
<!-- <el-date-picker clearable-->
|
||||
<!-- v-model="form.createdTime"-->
|
||||
<!-- type="date"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- placeholder="请选择创建时间">-->
|
||||
<!-- </el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listData, getData, delData, addData, updateData } from "@/api/crops/data";
|
||||
|
||||
export default {
|
||||
name: "Data",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 作物综合数据表格数据
|
||||
dataList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cultivatedArea: null,
|
||||
foodstuffProduction: null,
|
||||
vegetablePlantingArea: null,
|
||||
vegetableProduction: null,
|
||||
type: null,
|
||||
agriculturalPlantingArea: null,
|
||||
agricultureProduction: null,
|
||||
agricultureOutputVaule: null,
|
||||
totalPopulation: null,
|
||||
coverArea: null,
|
||||
exampleGreenhouse: null,
|
||||
rusticate: null,
|
||||
cultivatedAlly: null,
|
||||
greenhouse: null,
|
||||
outputValue: null,
|
||||
vectorBoundary: null,
|
||||
villageVectorBoundary: null,
|
||||
// createdBy: null,
|
||||
// createdTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询作物综合数据列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listData(this.queryParams).then(response => {
|
||||
this.dataList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cultivatedArea: null,
|
||||
foodstuffProduction: null,
|
||||
vegetablePlantingArea: null,
|
||||
vegetableProduction: null,
|
||||
type: null,
|
||||
agriculturalPlantingArea: null,
|
||||
agricultureProduction: null,
|
||||
agricultureOutputVaule: null,
|
||||
totalPopulation: null,
|
||||
coverArea: null,
|
||||
exampleGreenhouse: null,
|
||||
rusticate: null,
|
||||
cultivatedAlly: null,
|
||||
greenhouse: null,
|
||||
outputValue: null,
|
||||
vectorBoundary: null,
|
||||
villageVectorBoundary: null,
|
||||
// createdBy: null,
|
||||
// createdTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加作物综合数据";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getData(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改作物综合数据";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateData(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addData(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除作物综合数据编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delData(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('crops/data/export', {
|
||||
...this.queryParams
|
||||
}, `data_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
347
ruoyi-ui/src/views/pill/factory/index.vue
Normal file
347
ruoyi-ui/src/views/pill/factory/index.vue
Normal file
@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="厂家名称" prop="factoryName">
|
||||
<el-input
|
||||
v-model="queryParams.factoryName"
|
||||
placeholder="请输入厂家名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字" prop="keyword">
|
||||
<el-input
|
||||
v-model="queryParams.keyword"
|
||||
placeholder="请输入关键字"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入电话"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_common_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['pill:factory:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['pill:factory:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['pill:factory:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['pill:factory:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="factoryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="厂家ID" align="center" prop="factoryId" width="80"/>
|
||||
<el-table-column label="厂家名称" align="center" prop="factoryName" min-width="200"/>
|
||||
<el-table-column label="厂家编码" align="center" prop="factoryCode" />
|
||||
<el-table-column label="联系人" align="center" prop="contact" />
|
||||
<el-table-column label="电话" align="center" prop="phone" />
|
||||
<el-table-column label="关键字" align="center" prop="keyword" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pill:factory:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pill:factory:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改生产厂家信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="厂家名称" prop="factoryName">
|
||||
<el-input v-model="form.factoryName" placeholder="请输入厂家名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家编码" prop="factoryCode">
|
||||
<el-input v-model="form.factoryCode" placeholder="请输入厂家编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contact">
|
||||
<el-input v-model="form.contact" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字" prop="keyword">
|
||||
<el-input v-model="form.keyword" placeholder="请输入关键字" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_common_status"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFactory, getFactory, delFactory, addFactory, updateFactory } from "@/api/pill/factory";
|
||||
|
||||
export default {
|
||||
name: "Factory",
|
||||
dicts: ['sys_common_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 生产厂家信息表格数据
|
||||
factoryList: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
factoryName: null,
|
||||
factoryCode: null,
|
||||
contact: null,
|
||||
phone: null,
|
||||
keyword: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
factoryName: [
|
||||
{ required: true, message: "厂家名称不能为空", trigger: "blur" }
|
||||
],
|
||||
factoryCode: [
|
||||
{ required: true, message: "厂家编码不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询生产厂家信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFactory(this.queryParams).then(response => {
|
||||
this.factoryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
factoryId: null,
|
||||
factoryName: null,
|
||||
factoryCode: null,
|
||||
contact: null,
|
||||
phone: null,
|
||||
keyword: null,
|
||||
status: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.factoryId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加生产厂家信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const factoryId = row.factoryId || this.ids
|
||||
getFactory(factoryId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改生产厂家信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.factoryId != null) {
|
||||
updateFactory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addFactory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const factoryIds = row.factoryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除生产厂家信息编号为"' + factoryIds + '"的数据项?').then(function() {
|
||||
return delFactory(factoryIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('pill/factory/export', {
|
||||
...this.queryParams
|
||||
}, `factory_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user