fix
This commit is contained in:
parent
553b872003
commit
6c013883b3
@ -23,8 +23,8 @@
|
||||
</template>
|
||||
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == 1" type="success" size="small">启用</el-tag>
|
||||
<el-tag v-if="row.status == 0" type="danger" size="small">禁用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="success">启用</el-tag>
|
||||
<el-tag v-if="row.status == 0" type="danger">禁用</el-tag>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
@ -34,12 +34,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useApp } from '@/hooks';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { isEmpty, setDicData, debounce } from '@/utils';
|
||||
import { CommonDicData } from '@/apis';
|
||||
import { getLandsList } from '@/apis/land';
|
||||
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, UpdateStatus } from '@/apis/plantingAndBreeding/base';
|
||||
|
||||
@ -233,10 +234,23 @@ const state = reactive({
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
currentRow: {},
|
||||
unitList: [],
|
||||
});
|
||||
|
||||
// 加载
|
||||
const getUnit = async () => {
|
||||
CommonDicData('sys_unit_type')
|
||||
.then((res) => {
|
||||
console.log(250, res);
|
||||
if (res.code === 200) {
|
||||
state.unitList = res.data;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
};
|
||||
|
||||
const loadData = async () => {
|
||||
state.loading = true;
|
||||
GetEntityList(state.query)
|
||||
@ -262,6 +276,10 @@ const loadData = async () => {
|
||||
|
||||
loadData();
|
||||
|
||||
onMounted(() => {
|
||||
getUnit();
|
||||
});
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
@ -384,7 +402,6 @@ const rowDel = (row, index, done) => {
|
||||
|
||||
// 远程搜搜
|
||||
const remoteLandList = async (val) => {
|
||||
if (!isEmpty(val)) return;
|
||||
const query = { landName: val, current: 1, size: 20 };
|
||||
const res = await getLandsList(query);
|
||||
if (res.code === 200) {
|
||||
@ -399,8 +416,8 @@ const selectedChange = ({ item, value, dic }) => {
|
||||
crudRef.value.tableForm.landName = item?.landName;
|
||||
crudRef.value.tableForm.address = item?.address;
|
||||
crudRef.value.tableForm.area = item?.area;
|
||||
crudRef.value.tableForm.unit = item?.landUnit;
|
||||
crudRef.value.tableForm.provinceCode = item?.provinceCode;
|
||||
// crudRef.value.tableForm.provinceName = item?.provinceName;
|
||||
crudRef.value.tableForm.cityCode = item?.cityCode;
|
||||
crudRef.value.tableForm.districtCode = item?.county;
|
||||
crudRef.value.tableForm.townCode = item?.townCode;
|
||||
|
@ -16,8 +16,8 @@
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == 0" type="success" size="small">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger" size="small">禁用</el-tag>
|
||||
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
|
@ -19,8 +19,8 @@
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == 0" type="success" size="small">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger" size="small">禁用</el-tag>
|
||||
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
|
@ -19,8 +19,8 @@
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == 0" type="success" size="small">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger" size="small">禁用</el-tag>
|
||||
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
|
Loading…
x
Reference in New Issue
Block a user