修改地块
This commit is contained in:
parent
ad1371f8e8
commit
9786978f3f
@ -20,6 +20,14 @@ export function getLandInfo(param) {
|
||||
})
|
||||
}
|
||||
|
||||
//查询地块编码排序
|
||||
export function getLandNum() {
|
||||
return request({
|
||||
url: '/system/land/getLandNum',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增地块
|
||||
export function addLand (data) {
|
||||
return request({
|
||||
|
@ -178,8 +178,9 @@
|
||||
},
|
||||
onLoad(data) {
|
||||
//获取数据字典
|
||||
this.getDictList("custom_soil_type")
|
||||
this.getDictList("custom_water_source_type")
|
||||
this.getDictList("custom_soil_type");
|
||||
this.getDictList("custom_water_source_type");
|
||||
|
||||
if (data) {
|
||||
if (data.companyObj) {
|
||||
let companyAllObj = JSON.parse(decodeURIComponent(data.companyObj));
|
||||
@ -212,8 +213,10 @@
|
||||
title: "修改地块"
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.getLandNum();
|
||||
this.getChargeList();
|
||||
}
|
||||
this.getChargeList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -376,16 +379,11 @@
|
||||
getLandNum() {
|
||||
plugin.modal.loading("获取地块编号中!")
|
||||
store
|
||||
.dispatch("onGetLandNum")
|
||||
.dispatch("getLandNum")
|
||||
.then(res => {
|
||||
landInfo.value.landNum = res.data.landNum
|
||||
landInfo.value.orderNum = res.data.orderNum
|
||||
})
|
||||
.catch(error => {
|
||||
plugin.modal.msgError("获取地块编号失败!")
|
||||
})
|
||||
.finally(() => {
|
||||
plugin.modal.closeLoading()
|
||||
console.log(res)
|
||||
this.landInfo.landNum = res.data.landNum
|
||||
this.landInfo.orderNum = res.data.orderNum
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<template #cell="{ item }">
|
||||
<view class="item-container" >
|
||||
<view class="item-container">
|
||||
<view style="display: flex; align-items: center; justify-content: space-between;">
|
||||
<view class="flex-text" style="margin: 15px;">
|
||||
<view class="flex-text-one" style="color: black;">地块编号:</view>
|
||||
@ -26,7 +26,7 @@
|
||||
<u-tag text="禁用" type="error" v-if="item.status == 1" plain plainFill></u-tag>
|
||||
</view>
|
||||
<view style="margin-right: 5px;" v-hasPermi="['system:land:edit']">
|
||||
<u-button text="编辑" type="primary" plain plainFill @click="edit(item)"></u-button>
|
||||
<u-button text="编辑" type="primary" plain plainFill @click="edit(item)"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap height="1" bgColor="#D2D2D2"></u-gap>
|
||||
@ -50,7 +50,8 @@
|
||||
</view> -->
|
||||
<view class="flex-text global-font-size-1" style="margin-top: 5px;">
|
||||
<view class="flex-text-one">所属公司:</view>
|
||||
<view v-if="item.companyGroup && item.companyGroup.companyFullName">{{item.companyGroup.companyFullName}}</view>
|
||||
<view v-if="item.companyGroup && item.companyGroup.companyFullName">
|
||||
{{item.companyGroup.companyFullName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -82,12 +83,12 @@
|
||||
companyId: null,
|
||||
landName: null
|
||||
},
|
||||
selectCompanyObj:{}
|
||||
selectCompanyObj: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.windowHeight = uni.getSystemInfoSync().windowHeight;
|
||||
|
||||
|
||||
},
|
||||
onShow() {
|
||||
if (this.paging != null) {
|
||||
@ -99,13 +100,14 @@
|
||||
onNavigationBarButtonTap(e) {
|
||||
//如果点击了添加地块
|
||||
if (e.index == 0) {
|
||||
if(!this.query.companyId){
|
||||
if (!this.query.companyId) {
|
||||
plugin.modal.msgError("请选择要添加地块的公司")
|
||||
return;
|
||||
}
|
||||
if (checkPermi(["system:land:add"])) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/work/land/create-new?companyObj=" + encodeURIComponent(JSON.stringify(this.selectCompanyObj))
|
||||
url: "/pages/work/land/create-new?companyObj=" + encodeURIComponent(JSON.stringify(this
|
||||
.selectCompanyObj))
|
||||
})
|
||||
} else {
|
||||
plugin.modal.msgError("抱歉暂无权限")
|
||||
@ -139,7 +141,6 @@
|
||||
store
|
||||
.dispatch("getLandList", this.query)
|
||||
.then(res => {
|
||||
console.log(res.data)
|
||||
this.list = res.data;
|
||||
this.$refs.paging.complete(this.list)
|
||||
})
|
||||
@ -164,7 +165,7 @@
|
||||
this.selectCompanyObj = currentItem;
|
||||
this.getListData();
|
||||
},
|
||||
edit(item){
|
||||
edit(item) {
|
||||
if (checkPermi(["system:land:edit"])) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/work/land/create-new?item=" + encodeURIComponent(JSON.stringify(item))
|
||||
|
@ -2,7 +2,8 @@ import {
|
||||
getLandList,
|
||||
getLandInfo,
|
||||
addLand,
|
||||
updateLand
|
||||
updateLand,
|
||||
getLandNum
|
||||
} from "@/api/system/land"
|
||||
import {allListUser}from "@/api/system/user"
|
||||
const land = {
|
||||
@ -62,6 +63,17 @@ const land = {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
getLandNum() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getLandNum()
|
||||
.then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user