代码删除同步
parent
d18c244339
commit
74f13d0d91
@ -1,53 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建溯源链证书配置
|
||||
export function createTraceCert(data) {
|
||||
return request({
|
||||
url: '/configure/trace-cert/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新溯源链证书配置
|
||||
export function updateTraceCert(data) {
|
||||
return request({
|
||||
url: '/configure/trace-cert/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除溯源链证书配置
|
||||
export function deleteTraceCert(id) {
|
||||
return request({
|
||||
url: '/configure/trace-cert/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得溯源链证书配置
|
||||
export function getByBelongBusinessId(belongBusinessId) {
|
||||
return request({
|
||||
url: '/configure/trace-cert/getByBelongBusinessId?belongBusinessId=' + belongBusinessId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得溯源链证书配置
|
||||
// export function getTraceCert(id) {
|
||||
// return request({
|
||||
// url: '/configure/trace-cert/get?id=' + id,
|
||||
// method: 'get'
|
||||
// })
|
||||
// }
|
||||
|
||||
// 获得溯源链证书配置分页
|
||||
// export function getTraceCertPage(query) {
|
||||
// return request({
|
||||
// url: '/configure/trace-cert/page',
|
||||
// method: 'get',
|
||||
// params: query
|
||||
// })
|
||||
// }
|
||||
|
@ -1,73 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
// 创建农资批次
|
||||
export function createInputsBatch(data) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新农资批次
|
||||
export function updateInputsBatch(data) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除农资批次
|
||||
export function deleteInputsBatch(id) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得农资批次
|
||||
export function getInputsBatch(id) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得农资批次分页
|
||||
export function getInputsBatchPage(query) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出农资批次 Excel
|
||||
export function exportInputsBatchExcel(query) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得农资批次编号
|
||||
export function getInputsBatchNumberList(count) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/getInputsBatchNumberList?count=' + count,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量删除农资批次
|
||||
export function deleteBatch(params) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/deleteBatch?' + Object.keys(params).map(key => key + '=' + params[key]).join('&'),
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,96 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
// 创建农资采购
|
||||
export function createInputsBuy(data) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新农资采购
|
||||
export function updateInputsBuy(data) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除农资采购
|
||||
export function deleteInputsBuy(id) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得农资采购
|
||||
export function getInputsBuy(id) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得农资采购分页
|
||||
export function getInputsBuyPage(query) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出农资采购 Excel
|
||||
export function exportInputsBuyExcel(query) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得农资采购单号
|
||||
export function getInputsBuyNumberList(count) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/getInputsBuyNumberList?count=' + count,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得农资采购(通过出库单号,用于新增)
|
||||
export function getInputsBuyByOutbound(query) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/getInputsBuyByOutbound',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 冻结
|
||||
export function getInputsBuyFreeze(id) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/freeze?id='+id,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
// 激活
|
||||
export function getInputsBuyActive(id) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/active?id='+id,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
// 上链
|
||||
export function getInputsBuyUpChain(id) {
|
||||
return request({
|
||||
url: '/product/inputs-buy/upChain?id='+id,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 根据农资id获取所有农资批次
|
||||
export function getInputsBatchInputsBatchIdList(params) {
|
||||
return request({
|
||||
url: '/product/inputs-batch/getInputsBatchInputsBatchIdList',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建地块类型
|
||||
export function createLandInfoType(data) {
|
||||
return request({
|
||||
url: '/product/land-info-type/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新地块类型
|
||||
export function updateLandInfoType(data) {
|
||||
return request({
|
||||
url: '/product/land-info-type/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除地块类型
|
||||
export function deleteLandInfoType(id) {
|
||||
return request({
|
||||
url: '/product/land-info-type/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得地块类型
|
||||
export function getLandInfoType(id) {
|
||||
return request({
|
||||
url: '/product/land-info-type/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得地块类型分页
|
||||
export function getLandInfoTypePage(query) {
|
||||
return request({
|
||||
url: '/product/land-info-type/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出地块类型 Excel
|
||||
export function exportLandInfoTypeExcel(query) {
|
||||
return request({
|
||||
url: '/product/land-info-type/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据belongBusinessId商户id获取所有地块类型
|
||||
export function getByBusinessInfoId(params) {
|
||||
return request({
|
||||
url: '/product/land-info-type/getByBusinessInfoId',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 删除地块作业农资
|
||||
export function deleteLandJobInputs(id) {
|
||||
return request({
|
||||
url: '/product/land-job-inputs/delete?id=' + id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建作业类型
|
||||
export function createLandJobType(data) {
|
||||
return request({
|
||||
url: '/product/land-job-type/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新作业类型
|
||||
export function updateLandJobType(data) {
|
||||
return request({
|
||||
url: '/product/land-job-type/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除作业类型
|
||||
export function deleteLandJobType(id) {
|
||||
return request({
|
||||
url: '/product/land-job-type/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得作业类型
|
||||
export function getLandJobType(id) {
|
||||
return request({
|
||||
url: '/product/land-job-type/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得作业类型分页
|
||||
export function getLandJobTypePage(query) {
|
||||
return request({
|
||||
url: '/product/land-job-type/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出作业类型 Excel
|
||||
export function exportLandJobTypeExcel(query) {
|
||||
return request({
|
||||
url: '/product/land-job-type/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据belongBusinessName获取所以地块类型
|
||||
export function getLandJobTypesByBelongBusinessName(params) {
|
||||
return request({
|
||||
url: '/product/land-job-type/getLandJobTypesByBelongBusinessName',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
// 根据商户ID获得作业类型
|
||||
export function getByBusinessInfoId(params) {
|
||||
return request({
|
||||
url: '/product/land-job-type/getByBusinessInfoId',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
@ -1,183 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container-search main-bgcolor main-radius">
|
||||
<h1 class="">农资批次管理</h1>
|
||||
<br />
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchForm
|
||||
ref="searchForm"
|
||||
:searchFormParam="{ queryParams , dataSource }"
|
||||
:showSearch.sync="showSearch"
|
||||
@handleQuery="handleQuery"
|
||||
@resetQuery="resetQuery"
|
||||
></SearchForm>
|
||||
</div>
|
||||
|
||||
<div class="app-container-list main-bgcolor main-radius shopping">
|
||||
<div class="shopping-top">
|
||||
<div class="shopping-title">农资批次列表</div>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="编号" align="center" type="index" width="80" >
|
||||
<template v-slot="{ $index }">
|
||||
<span>{{($index+1)+ (queryParams.pageNo-1)*queryParams.pageSize }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="农资批次编号" align="center" prop="inputsBatchId" width="250" />
|
||||
<el-table-column label="农资采购单号" align="center" prop="inputsBuyId" width="250" />
|
||||
<el-table-column label="生产日期" align="center" prop="productData">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.productData) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="农资名称" align="center" prop="inputsName" />
|
||||
<el-table-column label="所属商户名称" align="center" prop="belongBusinessName" />
|
||||
<el-table-column label="备注" align="center" prop="remarks" />
|
||||
<!-- <el-table-column label="状态" align="center" prop="blockState">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.blockState === 1 ? '已上传' : '冻结' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" @click="handleUpChain(scope.row)" v-if=" scope.row.blockState == 2 "
|
||||
v-hasPermi="['product:inputs-batch:update']">激活</el-button>
|
||||
<el-button size="mini" type="text" @click="handleUpChain(scope.row)" v-if=" scope.row.blockState == 1 "
|
||||
v-hasPermi="['product:inputs-batch:update']">冻结</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<div slot="empty">
|
||||
<EmptyTable />
|
||||
</div>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SearchForm from '@/components/Customer/SearchForm/index.vue';
|
||||
import EmptyTable from '@/components/EmptyTable'
|
||||
import { getInputsBatchPage } from "@/api/material/inputsBatch";
|
||||
|
||||
export default {
|
||||
name: "InputsBatch",
|
||||
components: {
|
||||
SearchForm,
|
||||
EmptyTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 农资批次列表
|
||||
list: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
inputsName: null,
|
||||
inputsBatchId: null,
|
||||
inputsBuyId: null,
|
||||
productData: null,
|
||||
belongBusinessName: null,
|
||||
},
|
||||
// 表单对象
|
||||
dataSource: [
|
||||
{
|
||||
key: 'inputsName',
|
||||
itemType: 'input',
|
||||
label: '农资名称',
|
||||
placeholder: '请输入农资名称',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'inputsBatchId',
|
||||
itemType: 'input',
|
||||
label: '批次编号',
|
||||
placeholder: '请输入批次编号',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'inputsBuyId',
|
||||
itemType: 'input',
|
||||
label: '采购单号',
|
||||
placeholder: '请输入采购单号',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'productData',
|
||||
itemType: 'datePicker',
|
||||
label: '生产日期',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'belongBusinessName',
|
||||
itemType: 'input',
|
||||
label: '所属商户',
|
||||
placeholder: '请输入所属商户',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getInputsBatchPage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
inputsName: undefined,
|
||||
inputsId: undefined,
|
||||
inputsBuyId: undefined,
|
||||
productData: undefined,
|
||||
belongBusinessId: undefined,
|
||||
belongBusinessName: undefined,
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm',"searchForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 上传 */
|
||||
handleUpChain() {
|
||||
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
File diff suppressed because it is too large
Load Diff
@ -1,257 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<div class="app-container-search main-bgcolor main-radius">
|
||||
<h1 class="">地块状态</h1>
|
||||
<br />
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchForm
|
||||
ref="searchForm"
|
||||
:searchFormParam="{queryParams, dataSource}"
|
||||
:showSearch.sync="showSearch"
|
||||
@handleQuery="handleQuery"
|
||||
@resetQuery="resetQuery"
|
||||
></SearchForm>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="app-container-list main-bgcolor main-radius shopping">
|
||||
<div class="shopping-top">
|
||||
<div class="shopping-title">地块状态列表</div>
|
||||
<el-button class="shopping-add-btn" type="primary" plain @click="handleAdd"
|
||||
v-hasPermi="['product:land-block-state:create']">新增</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" align="center" type="index" width="80" >
|
||||
<template v-slot="{ $index }">
|
||||
<span>{{($index+1)+ (queryParams.pageNo-1)*queryParams.pageSize }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地块状态" align="center" prop="landStateName" />
|
||||
<el-table-column label="所属商户" align="center" prop="belongBusinessName" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" >
|
||||
<template v-slot="{ row }">
|
||||
<span>{{parseTime(row.createTime)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:land-block-state:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['product:land-block-state:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div slot="empty">
|
||||
<EmptyTable />
|
||||
</div>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
</div>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="地块状态" prop="landStateName">
|
||||
<el-input v-model="form.landStateName" placeholder="请输入地块状态名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属商户" prop="belongBusinessId">
|
||||
<el-select class="w100" :disabled="idEdit" v-model="form.belongBusinessId" ref="business">
|
||||
<el-option
|
||||
v-for="(item,index) in businessNameList"
|
||||
:key="index"
|
||||
:label="item.businessName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</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 { createLandBlockState, updateLandBlockState, deleteLandBlockState, getLandBlockState, getLandBlockStatePage, exportLandBlockStateExcel } from "@/api/product/landBlockState";
|
||||
import { getBusinessNameList } from '@/api/basic/businessInfo';
|
||||
import SearchForm from '@/components/Customer/SearchForm'
|
||||
import EmptyTable from '@/components/EmptyTable'
|
||||
export default {
|
||||
name: "LandBlockState",
|
||||
components: {
|
||||
SearchForm,
|
||||
EmptyTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 地块状态列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
landStateName: null,
|
||||
belongBusinessId: null,
|
||||
belongBusinessName: null,
|
||||
createTime: [],
|
||||
},
|
||||
dataSource:[
|
||||
{
|
||||
key: 'landStateName',
|
||||
itemType: 'input',
|
||||
label: '地块状态',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'belongBusinessName',
|
||||
itemType: 'input',
|
||||
label: '所属商户',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
landStateName: [{ required: true, message: "地块状态不能为空", trigger: "blur" }],
|
||||
belongBusinessId: [{ required: true, message: "所属商户id不能为空", trigger: "blur" }],
|
||||
},
|
||||
businessNameList: [],
|
||||
idEdit: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.initDate();
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据 获取所有商户昵称
|
||||
async initDate(){
|
||||
let res = await getBusinessNameList();
|
||||
this.businessNameList = res.data;
|
||||
console.log('所有商户列表',res);
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getLandBlockStatePage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
landStateName: undefined,
|
||||
belongBusinessId: undefined,
|
||||
belongBusinessName: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加地块状态";
|
||||
this.idEdit = false;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getLandBlockState(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改地块状态";
|
||||
this.idEdit = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateLandBlockState(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createLandBlockState(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除地块状态编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteLandBlockState(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有地块状态数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportLandBlockStateExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '地块状态.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,433 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container-search main-bgcolor main-radius">
|
||||
<h1 class="">地块管理</h1>
|
||||
<br />
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<RecordForm
|
||||
ref="searchForm"
|
||||
:searchFormParam="{queryParams, dataSource}"
|
||||
:showSearch.sync="showSearch"
|
||||
@handleQuery="handleQuery"
|
||||
@resetQuery="resetQuery"
|
||||
@selectChage="selectChage"
|
||||
></RecordForm>
|
||||
</div>
|
||||
|
||||
<div class="app-container-list main-bgcolor main-radius">
|
||||
<!-- 操作工具栏 -->
|
||||
<h1>地块列表</h1>
|
||||
|
||||
<el-button
|
||||
style="float: right; margin-bottom: 10px"
|
||||
type="primary"
|
||||
:loading="exportLoading"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['product:land-info:create']"
|
||||
>添加地块</el-button>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="编号" align="center" type="index" width="80" >
|
||||
<template v-slot="{ $index }">
|
||||
<span>{{($index+1)+ (queryParams.pageNo-1)*queryParams.pageSize }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地块名称" align="center" prop="landName" />
|
||||
<el-table-column label="地块编码" align="center" prop="landId" />
|
||||
<el-table-column label="类型" align="center" prop="infoTypeName" >
|
||||
</el-table-column>
|
||||
<el-table-column label="所属商户" align="center" prop="belongBusinessName" />
|
||||
<el-table-column label="面积" align="center" prop="size" />
|
||||
<el-table-column label="状态" align="center" prop="infoStateName" >
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remarks" />
|
||||
<el-table-column label="操作" fixed="right" class-name="small-padding fixed-width" width="150">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:land-info:update']">编辑</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['product:land-info:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div slot="empty">
|
||||
<EmptyTable />
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
</div>
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" class="goods-verify" :visible.sync="open" width="530px" v-dialogDrag append-to-body>
|
||||
<el-form ref="form" :rules="rules" label-position="top" :model="form" label-width="80px">
|
||||
<el-form-item label="所属商户" prop="belongBusinessId">
|
||||
<el-select ref="businessName" @change="handchangeBusiness" v-model="form.belongBusinessId" placeholder="请选择所属商户">
|
||||
<el-option v-for="item in businessNameList" :key="item.id" :label="item.businessName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="地块名称" prop="landName">
|
||||
<el-input v-model="form.landName" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地块类型" prop="landType">
|
||||
<el-select v-model="form.landType" placeholder="请先选择所属商户">
|
||||
<el-option :key="item.id" v-for="item in landTypeList" :label="item.landTypeName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-select v-model="form.state" placeholder="请先选择所属商户">
|
||||
<el-option :key="item.id" v-for="item in stateList" :label="item.landStateName" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="面积" prop="size">
|
||||
<el-input placeholder="请输入" v-model="form.size" type="number" min="0" step="0.01" @change="changeSize">
|
||||
<template slot="append">亩</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input type="textarea" class="w150" v-model="form.remarks" 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 { createLandInfo, updateLandInfo, deleteLandInfo, getLandInfo, getLandInfoPage, exportLandInfoExcel } from "@/api/product/landInfo";
|
||||
import { getBusinessNameList } from '@/api/basic/businessInfo';
|
||||
import { getByBusinessInfoId } from '@/api/product/landInfoType';
|
||||
import { getBusinessInfoByListLandBlockState } from '@/api/product/landBlockState';
|
||||
|
||||
import RecordForm from '@/components/Customer/SearchForm'
|
||||
import EmptyTable from '@/components/EmptyTable'
|
||||
|
||||
export default {
|
||||
name: "LandInfo",
|
||||
components: {
|
||||
RecordForm,
|
||||
EmptyTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '修整'
|
||||
},{
|
||||
value: 1,
|
||||
label: '种植'
|
||||
}],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 农事土地信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
landName: null,
|
||||
landId: null,
|
||||
size: null,
|
||||
state: null,
|
||||
remarks: null,
|
||||
landType: null,
|
||||
belongBusinessId: null,
|
||||
belongBusinessName: null,
|
||||
createTime: [],
|
||||
status: null,
|
||||
},
|
||||
dataSource: [
|
||||
{
|
||||
key: 'landName',
|
||||
itemType: 'input',
|
||||
label: '地块名称',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'landId',
|
||||
itemType: 'input',
|
||||
label: '地块编码',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'belongBusinessName',
|
||||
itemType: 'select',
|
||||
label: '所属商户',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
options:[],
|
||||
isNet: true,
|
||||
},
|
||||
{
|
||||
key: 'state',
|
||||
itemType: 'select',
|
||||
label: '状态',
|
||||
placeholder: '请先选择所属商户',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
options: [],
|
||||
},
|
||||
],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
belongBusinessName: [{ required: true, message: "所属商户名称不能为空", trigger: "blur" }],
|
||||
landName: [{ required: true, message: "地块名称不能为空", trigger: "blur" }],
|
||||
landType: [{ required: true, message: "地块类型不能为空", trigger: "blur" }],
|
||||
landId: [{ required: true, message: "地块编码不能为空", trigger: "blur" }],
|
||||
status: [{ required: true, message: "状态不能为空", trigger: "blur" }],
|
||||
},
|
||||
// 所属商户列表
|
||||
businessNameList: [],
|
||||
landTypeList:[],
|
||||
stateList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.initDate();
|
||||
},
|
||||
methods: {
|
||||
async initDate(){
|
||||
// 商户列表
|
||||
let res = await getBusinessNameList();
|
||||
this.businessNameList = res.data;
|
||||
res.data.map(item=>{
|
||||
item.label = item.businessName;
|
||||
item.value = item.businessName;
|
||||
});
|
||||
this.dataSource[2].options = res.data;
|
||||
},
|
||||
//获取所有商户昵称
|
||||
handchangeBusiness(e){
|
||||
this.$nextTick(async ()=>{
|
||||
this.form.belongBusinessName = this.$refs.businessName.selected.label;
|
||||
let res = await getByBusinessInfoId({id: e});
|
||||
console.log("获取商户昵称对应的地块类型列表",res);
|
||||
if(res.data) this.landTypeList = res.data;
|
||||
if(!res.data) this.landTypeList = [];
|
||||
|
||||
let resState = await getBusinessInfoByListLandBlockState({id: e});
|
||||
console.log("获取商户对应的地块状态列表",resState);
|
||||
if(res.data) this.stateList = resState.data;
|
||||
if(!res.data) this.stateList = [];
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getLandInfoPage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
landName: undefined,
|
||||
landId: undefined,
|
||||
size: undefined,
|
||||
state: undefined,
|
||||
remarks: undefined,
|
||||
landType: undefined,
|
||||
belongBusinessId: undefined,
|
||||
belongBusinessName: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dataSource[3].options = []
|
||||
this.resetForm("queryForm","searchForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加地块";
|
||||
this.landTypeList = [];
|
||||
this.stateList = [];
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getLandInfo(id).then(async response => {
|
||||
this.form = response.data;
|
||||
this.form.state = Number( this.form.state );
|
||||
this.open = true;
|
||||
this.title = "修改农事土地信息";
|
||||
|
||||
let res = await getByBusinessInfoId({id: response.data.belongBusinessId});
|
||||
console.log("获取商户昵称对应的地块类型列表",res);
|
||||
if(res.data) this.landTypeList = res.data;
|
||||
if(!res.data) this.landTypeList = [];
|
||||
|
||||
let resState = await getBusinessInfoByListLandBlockState({id: response.data.belongBusinessId});
|
||||
console.log("获取商户对应的地块状态列表",resState);
|
||||
if(res.data) this.stateList = resState.data;
|
||||
if(!res.data) this.stateList = [];
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateLandInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createLandInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除农事土地信息编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteLandInfo(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有农事土地信息数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportLandInfoExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '农事土地信息.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
selectChage({ value, type, book }) {
|
||||
if (type != 'state') {
|
||||
this.queryParams.state = ''
|
||||
}
|
||||
if (!book) {
|
||||
return
|
||||
}
|
||||
if(value == null || value == ''){
|
||||
this.dataSource[3].options = []
|
||||
return
|
||||
}
|
||||
|
||||
let businessInfo = this.businessNameList.find(item=>item.businessName == value);
|
||||
getBusinessInfoByListLandBlockState({
|
||||
id: businessInfo.id,
|
||||
}).then((res) => {
|
||||
this.$nextTick(() => {
|
||||
this.dataSource[3].options = res.data.map((el) => {
|
||||
let obj = {
|
||||
label: el.landStateName,
|
||||
value: el.id,
|
||||
key: el.id,
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 改变面积
|
||||
changeSize(e){
|
||||
this.form.size = Number(e).toFixed(2);
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.goods-verify{
|
||||
.el-select{
|
||||
width: 100%;
|
||||
}
|
||||
.el-date-editor{
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
|
||||
.hide {
|
||||
::v-deep .el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.verifyFileUpload{
|
||||
::v-deep .el-icon-document{
|
||||
white-space:nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
width: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
.table-column{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.dian{
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 100%;
|
||||
background-color: rgb(217, 217, 217);
|
||||
display: inline-block;
|
||||
}
|
||||
.dian-active{
|
||||
background-color: rgb(82, 196, 26);
|
||||
}
|
||||
.column-content{
|
||||
display: inline-block;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
@ -1,256 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container-search main-bgcolor main-radius">
|
||||
<h1 class="">地块类型</h1>
|
||||
<br />
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchForm
|
||||
ref="searchForm"
|
||||
:searchFormParam="{queryParams, dataSource}"
|
||||
:showSearch.sync="showSearch"
|
||||
@handleQuery="handleQuery"
|
||||
@resetQuery="resetQuery"
|
||||
></SearchForm>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="app-container-list main-bgcolor main-radius shopping">
|
||||
<div class="shopping-top">
|
||||
<div class="shopping-title">地块类型列表</div>
|
||||
<el-button class="shopping-add-btn" type="primary" plain @click="handleAdd"
|
||||
v-hasPermi="['product:land-info-type:create']">新增</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" align="center" type="index" width="80" >
|
||||
<template v-slot="{ $index }">
|
||||
<span>{{($index+1)+ (queryParams.pageNo-1)*queryParams.pageSize }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地块类型" align="center" prop="landTypeName" />
|
||||
<el-table-column label="所属商户" align="center" prop="belongBusinessName" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" >
|
||||
<template v-slot="{ row }">
|
||||
<span>{{parseTime(row.createTime)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:land-info-type:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['product:land-info-type:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div slot="empty">
|
||||
<EmptyTable />
|
||||
</div>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
</div>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="地块类型" prop="landTypeName">
|
||||
<el-input v-model="form.landTypeName" placeholder="请输入地块类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属商户" prop="belongBusinessId">
|
||||
<el-select class="w100" :disabled="idEdit" v-model="form.belongBusinessId" ref="business">
|
||||
<el-option
|
||||
v-for="(item,index) in businessNameList"
|
||||
:key="index"
|
||||
:label="item.businessName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</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 { createLandInfoType, updateLandInfoType, deleteLandInfoType, getLandInfoType, getLandInfoTypePage, exportLandInfoTypeExcel } from "@/api/product/landInfoType";
|
||||
import { getBusinessNameList } from '@/api/basic/businessInfo';
|
||||
import SearchForm from '@/components/Customer/SearchForm'
|
||||
import EmptyTable from '@/components/EmptyTable'
|
||||
export default {
|
||||
name: "LandInfoType",
|
||||
components: {
|
||||
SearchForm,
|
||||
EmptyTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 地块类型列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
landTypeName: null,
|
||||
belongBusinessId: null,
|
||||
belongBusinessName: null,
|
||||
createTime: [],
|
||||
},
|
||||
dataSource:[
|
||||
{
|
||||
key: 'landTypeName',
|
||||
itemType: 'input',
|
||||
label: '地块类型',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'belongBusinessName',
|
||||
itemType: 'input',
|
||||
label: '所属商户',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
landTypeName: [{ required: true, message: "地块类型不能为空", trigger: "blur" }],
|
||||
belongBusinessId: [{ required: true, message: "所属商户id不能为空", trigger: "blur" }],
|
||||
},
|
||||
businessNameList: [],
|
||||
idEdit: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.initDate();
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据 获取所有商户昵称
|
||||
async initDate(){
|
||||
let res = await getBusinessNameList();
|
||||
this.businessNameList = res.data;
|
||||
console.log('所有商户列表',res);
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getLandInfoTypePage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
landTypeName: undefined,
|
||||
belongBusinessId: undefined,
|
||||
belongBusinessName: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm","searchForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加地块类型";
|
||||
this.idEdit = false;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getLandInfoType(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改地块类型";
|
||||
this.idEdit = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateLandInfoType(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createLandInfoType(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除此地块类型?').then(function() {
|
||||
return deleteLandInfoType(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有地块类型数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportLandInfoTypeExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '地块类型.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,255 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container-search main-bgcolor main-radius">
|
||||
<h1 class="">作业类型</h1>
|
||||
<br />
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchForm
|
||||
ref="searchForm"
|
||||
:searchFormParam="{queryParams, dataSource}"
|
||||
:showSearch.sync="showSearch"
|
||||
@handleQuery="handleQuery"
|
||||
@resetQuery="resetQuery"
|
||||
></SearchForm>
|
||||
</div>
|
||||
|
||||
<div class="app-container-list main-bgcolor main-radius shopping">
|
||||
<div class="shopping-top">
|
||||
<div class="shopping-title">类型列表</div>
|
||||
<el-button class="shopping-add-btn" type="primary" plain @click="handleAdd"
|
||||
v-hasPermi="['basic:goods-info:create']">新增</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" align="center" type="index" width="80" >
|
||||
<template v-slot="{ $index }">
|
||||
<span>{{($index+1)+ (queryParams.pageNo-1)*queryParams.pageSize }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="作业名称" align="center" prop="typeName" />
|
||||
<el-table-column label="所属商户" align="center" prop="belongBusinessName" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" >
|
||||
<template v-slot="{ row }">
|
||||
<span>{{parseTime(row.createTime)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:land-job-type:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['product:land-job-type:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div slot="empty">
|
||||
<EmptyTable />
|
||||
</div>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
</div>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="类型名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属商户" prop="belongBusinessId">
|
||||
<el-select class="w100" :disabled="idEdit" v-model="form.belongBusinessId" ref="business">
|
||||
<el-option
|
||||
v-for="(item,index) in businessNameList"
|
||||
:key="index"
|
||||
:label="item.businessName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</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 { createLandJobType, updateLandJobType, deleteLandJobType, getLandJobType, getLandJobTypePage, exportLandJobTypeExcel } from "@/api/product/landJobType";
|
||||
import { getBusinessNameList } from '@/api/basic/businessInfo';
|
||||
import SearchForm from '@/components/Customer/SearchForm'
|
||||
import EmptyTable from '@/components/EmptyTable'
|
||||
export default {
|
||||
name: "LandJobType",
|
||||
components: {
|
||||
SearchForm,
|
||||
EmptyTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 作业类型列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
typeName: null,
|
||||
belongBusinessId: null,
|
||||
belongBusinessName: null,
|
||||
createTime: [],
|
||||
},
|
||||
dataSource:[
|
||||
{
|
||||
key: 'typeName',
|
||||
itemType: 'input',
|
||||
label: '类型名称',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
{
|
||||
key: 'belongBusinessName',
|
||||
itemType: 'input',
|
||||
label: '所属商户',
|
||||
placeholder: '请输入',
|
||||
onEnterKeyUp: this.handleQuery,
|
||||
},
|
||||
],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
typeName: [{ required: true, message: "地块名称不能为空", trigger: "blur" }],
|
||||
belongBusinessId: [{ required: true, message: "所属商户id不能为空", trigger: "blur" }],
|
||||
},
|
||||
businessNameList: [],
|
||||
idEdit: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.initDate();
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据 获取所有商户昵称
|
||||
async initDate(){
|
||||
let res = await getBusinessNameList();
|
||||
this.businessNameList = res.data;
|
||||
console.log('所有商户列表',res);
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getLandJobTypePage(this.queryParams).then(response => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
typeName: undefined,
|
||||
belongBusinessId: undefined,
|
||||
belongBusinessName: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm","searchForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加作业类型";
|
||||
this.idEdit = false;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getLandJobType(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改作业类型";
|
||||
this.idEdit = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateLandJobType(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createLandJobType(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal.confirm('是否确认删除作业类型编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteLandJobType(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有作业类型数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportLandJobTypeExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '作业类型.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue