Merge branch 'dev' of http://47.109.205.240:3000/Web/daimp-front into dev
This commit is contained in:
commit
f4fcba7ee1
@ -0,0 +1,22 @@
|
|||||||
|
import request from '@/utils/axios';
|
||||||
|
|
||||||
|
export function getEnterpriseDealerCheck(params) {
|
||||||
|
return request('/inputGoods/distributorCheck/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function addEnterpriseDealerCheck(data) {
|
||||||
|
return request('/inputGoods/distributorCheck/page', {
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function delEnterpriseDealerCheck(ids) {
|
||||||
|
return request(`/inputGoods/distributorCheck/page/${ids}`);
|
||||||
|
}
|
||||||
|
export function editEnterpriseDealerCheck(data) {
|
||||||
|
return request('/inputGoods/distributorCheck/page', {
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
@ -3,6 +3,8 @@ import * as materialApi from './material';
|
|||||||
import * as knowledgeApi from './knowledge';
|
import * as knowledgeApi from './knowledge';
|
||||||
import * as leaseSuperviseApi from './leaseSupervise';
|
import * as leaseSuperviseApi from './leaseSupervise';
|
||||||
import * as productionDealerApi from './productionDealer';
|
import * as productionDealerApi from './productionDealer';
|
||||||
|
import * as useSuperviseApi from './useSupervise';
|
||||||
|
import * as enteroriseDealerCheckApi from './enterpriseDealerCheck';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...materialApi,
|
...materialApi,
|
||||||
@ -10,4 +12,6 @@ export default {
|
|||||||
...knowledgeApi,
|
...knowledgeApi,
|
||||||
...leaseSuperviseApi,
|
...leaseSuperviseApi,
|
||||||
...productionDealerApi,
|
...productionDealerApi,
|
||||||
|
...useSuperviseApi,
|
||||||
|
...enteroriseDealerCheckApi,
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
import request from '@/utils/axios';
|
||||||
|
|
||||||
|
export function getUseSuperviseList(params) {
|
||||||
|
return request('/inputGoods/supervise/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delUseSupervise(ids) {
|
||||||
|
return request(`/inputGoods/supervise/delete/${ids}`);
|
||||||
|
}
|
||||||
|
export function addUseSupervise(data) {
|
||||||
|
return request('/inputGoods/supervise/save', {
|
||||||
|
method: 'POST',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editUseSupervise(data) {
|
||||||
|
return request('/inputGoods/supervise/edit', {
|
||||||
|
method: 'PUT',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
@ -15,12 +15,6 @@ const inputSuppliesRoutes = [
|
|||||||
// component: () => import('@/views/inputSuppliesManage/inputDataView/index.vue'),
|
// component: () => import('@/views/inputSuppliesManage/inputDataView/index.vue'),
|
||||||
// meta: { title: '投入品资源一张图', icon: 'Document' },
|
// meta: { title: '投入品资源一张图', icon: 'Document' },
|
||||||
// },
|
// },
|
||||||
// {
|
|
||||||
// path: '/sub-government-affairs-service/materialManage',
|
|
||||||
// name: 'materialManage',
|
|
||||||
// component: () => import('@/views/inputSuppliesManage/materialManage/index.vue'),
|
|
||||||
// meta: { title: '物资管理融合', icon: 'Document' },
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
path: '/sub-government-affairs-service/material',
|
path: '/sub-government-affairs-service/material',
|
||||||
name: 'material',
|
name: 'material',
|
||||||
@ -66,12 +60,12 @@ const inputSuppliesRoutes = [
|
|||||||
component: () => import('@/views/inputSuppliesManage/productionDealer/index.vue'),
|
component: () => import('@/views/inputSuppliesManage/productionDealer/index.vue'),
|
||||||
meta: { title: '企业经销商管理', icon: 'Document' },
|
meta: { title: '企业经销商管理', icon: 'Document' },
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// path: '/sub-government-affairs-service/enterpriseDealerCheck',
|
path: '/sub-government-affairs-service/enterpriseDealerCheck',
|
||||||
// name: 'enterpriseDealerCheck',
|
name: 'enterpriseDealerCheck',
|
||||||
// component: () => import('@/views/inputSuppliesManage/enterpriseDealerCheck/index.vue'),
|
component: () => import('@/views/inputSuppliesManage/enterpriseDealerCheck/index.vue'),
|
||||||
// meta: { title: '企业经销商抽检', icon: 'Document' },
|
meta: { title: '企业经销商抽检', icon: 'Document' },
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
path: '/sub-government-affairs-service/useSupervise',
|
path: '/sub-government-affairs-service/useSupervise',
|
||||||
name: 'useSupervise',
|
name: 'useSupervise',
|
||||||
|
@ -7,14 +7,20 @@
|
|||||||
:min="_numberSet.min"
|
:min="_numberSet.min"
|
||||||
:controls-position="_numberSet.controlsPosition"
|
:controls-position="_numberSet.controlsPosition"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
></el-input-number>
|
>
|
||||||
|
</el-input-number>
|
||||||
<el-select v-model="data.type" @change="handleChange">
|
<el-select v-model="data.type" @change="handleChange">
|
||||||
<el-option v-for="item in props.options" :key="'custom_' + Date.now() + item.value" :label="item.label" :value="item.value" />
|
<el-option
|
||||||
|
v-for="item in props.options"
|
||||||
|
:key="'custom_' + Date.now() + item[props.prop.value]"
|
||||||
|
:label="item[props.prop.label]"
|
||||||
|
:value="item[props.prop.value]"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script setup>
|
||||||
import { ref, watchEffect } from 'vue';
|
import { ref, watchEffect } from 'vue';
|
||||||
|
|
||||||
const emit = defineEmits(['update:value']);
|
const emit = defineEmits(['update:value']);
|
||||||
@ -57,6 +63,12 @@ const props = defineProps({
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
prop: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return { label: 'label', value: 'value' };
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const _numberSet = ref({
|
const _numberSet = ref({
|
||||||
precision: 2,
|
precision: 2,
|
||||||
@ -71,7 +83,9 @@ const data = ref({
|
|||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
data.value = Object.assign(data.value, props.value);
|
data.value = Object.assign(data.value, props.value);
|
||||||
_numberSet.value = Object.assign(_numberSet.value, props.numberSet);
|
_numberSet.value = Object.assign(_numberSet.value, props.numberSet);
|
||||||
console.log('_numberSet.value', _numberSet.value);
|
if (data.value.num === null) {
|
||||||
|
data.value.num = _numberSet.value.min;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
function handleChange() {
|
function handleChange() {
|
||||||
emit('update:value', data.value);
|
emit('update:value', data.value);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<avue-crud
|
<avue-crud
|
||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
v-model:page="pageData"
|
v-model:page="pageData"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:option="option"
|
:option="option"
|
||||||
:loading="_loading"
|
:loading="_loading"
|
||||||
@search-change="
|
@search-change="
|
||||||
@ -20,8 +20,8 @@
|
|||||||
@row-save="handleRowSave"
|
@row-save="handleRowSave"
|
||||||
@row-update="handleRowUpdate"
|
@row-update="handleRowUpdate"
|
||||||
>
|
>
|
||||||
<template #menu="{ row }">
|
<template #menu="scope">
|
||||||
<el-button type="primary">详情</el-button>
|
<custom-table-operate :actions="actions" :data="scope" />
|
||||||
</template>
|
</template>
|
||||||
</avue-crud>
|
</avue-crud>
|
||||||
</section>
|
</section>
|
||||||
@ -29,8 +29,10 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import { CRUD_OPTIONS } from '@/config';
|
import { CRUD_OPTIONS, pageData } from '@/config';
|
||||||
|
import inputSuppliesApi from '@/apis/inputSuppliesApi';
|
||||||
|
|
||||||
|
const { getEnterpriseDealerCheck, addEnterpriseDealerCheck, delEnterpriseDealerCheck, editEnterpriseDealerCheck } = inputSuppliesApi;
|
||||||
onMounted(getData);
|
onMounted(getData);
|
||||||
|
|
||||||
/* --------------- data --------------- */
|
/* --------------- data --------------- */
|
||||||
@ -40,12 +42,7 @@ const _loading = ref(false);
|
|||||||
const searchCondition = ref({
|
const searchCondition = ref({
|
||||||
keywords: '',
|
keywords: '',
|
||||||
});
|
});
|
||||||
const pageData = ref({
|
const tableData = ref([]);
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0,
|
|
||||||
});
|
|
||||||
const data = ref([]);
|
|
||||||
const option = reactive({
|
const option = reactive({
|
||||||
...CRUD_OPTIONS,
|
...CRUD_OPTIONS,
|
||||||
selection: false,
|
selection: false,
|
||||||
@ -138,6 +135,24 @@ const option = reactive({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
const actions = reactive([
|
||||||
|
{
|
||||||
|
name: '详情',
|
||||||
|
icon: 'view',
|
||||||
|
event: ({ row }) => row,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '编辑',
|
||||||
|
icon: 'edit',
|
||||||
|
event: ({ row }) => row,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'danger',
|
||||||
|
name: '删除',
|
||||||
|
icon: 'delete',
|
||||||
|
event: ({ row }) => row,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
@ -146,26 +161,20 @@ const option = reactive({
|
|||||||
async function getData(resetPage) {
|
async function getData(resetPage) {
|
||||||
resetPage === 1 && (pageData.value.currentPage = 1);
|
resetPage === 1 && (pageData.value.currentPage = 1);
|
||||||
_loading.value = true;
|
_loading.value = true;
|
||||||
let params = Object.assign(
|
let params = {
|
||||||
{
|
currentPage: pageData.value.currentPage,
|
||||||
currentPage: pageData.value.currentPage,
|
size: pageData.value.pageSize,
|
||||||
size: pageData.value.pageSize,
|
companyName: searchCondition.value.keywords,
|
||||||
},
|
};
|
||||||
searchCondition.value
|
|
||||||
);
|
let res = await getEnterpriseDealerCheck(params);
|
||||||
console.log('params', params);
|
if (res.code == 200) {
|
||||||
for (let i = 0; i < 14; i++) {
|
tableData.value = res.data.records;
|
||||||
data.value.push({
|
pageData.value.total = res.data.total;
|
||||||
taskNum: '20220101' + `${i}${i}${i}${i}${i}`,
|
|
||||||
taskType: i % 2 == 0 ? '0' : '1',
|
|
||||||
enterpriseName: '上海XX有限公司',
|
|
||||||
enterpriseOwner: '张三',
|
|
||||||
phone: '123456789',
|
|
||||||
status: i % 2 == 0 ? '0' : '1',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
pageData.value.total = data.value.length;
|
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
|
console.log('params', params);
|
||||||
|
pageData.value.total = tableData.value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleRowSave(row, done, loading) {
|
function handleRowSave(row, done, loading) {
|
||||||
|
@ -81,7 +81,7 @@ export function useBasicInfo(set = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* 获取标签的名字 */
|
/* 获取标签的名字 */
|
||||||
function targetName(arr, ids, _name) {
|
function targetName(arr, ids, _name = '') {
|
||||||
let name = '';
|
let name = '';
|
||||||
if (!arr || !arr.length || ids.length < 1) {
|
if (!arr || !arr.length || ids.length < 1) {
|
||||||
return name;
|
return name;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
ref="crudRef"
|
ref="crudRef"
|
||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
v-model:page="pageData"
|
v-model:page="pageData"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:option="option"
|
:option="option"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:before-close="handleDialogClose"
|
:before-close="handleDialogClose"
|
||||||
@ -55,7 +55,7 @@ const pageData = ref({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
const data = ref([]);
|
const tableData = ref([]);
|
||||||
const option = reactive({
|
const option = reactive({
|
||||||
...CRUD_OPTIONS,
|
...CRUD_OPTIONS,
|
||||||
selection: false,
|
selection: false,
|
||||||
@ -195,7 +195,7 @@ async function getData(resetPage) {
|
|||||||
let res = await inputSuppliesApi.getLeaseSuperviseList(params);
|
let res = await inputSuppliesApi.getLeaseSuperviseList(params);
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.value = res.data.records.map((v) => {
|
tableData.value = res.data.records.map((v) => {
|
||||||
let d = leaseDate(v.startEndTime);
|
let d = leaseDate(v.startEndTime);
|
||||||
let obj = {
|
let obj = {
|
||||||
...v,
|
...v,
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:before-close="handleCloseDialog"
|
:before-close="handleCloseDialog"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:option="option"
|
:option="option"
|
||||||
@search-change="
|
@search-change="
|
||||||
(form, done) => {
|
(form, done) => {
|
||||||
@ -140,7 +140,7 @@ const subsidy = reactive([
|
|||||||
value: '0',
|
value: '0',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const data = ref([{}]);
|
const tableData = ref([{}]);
|
||||||
const option = ref({
|
const option = ref({
|
||||||
...CRUD_OPTIONS,
|
...CRUD_OPTIONS,
|
||||||
dialogWidth: '50%',
|
dialogWidth: '50%',
|
||||||
@ -441,7 +441,7 @@ async function getData(reset) {
|
|||||||
let res = await getMachineryList(params);
|
let res = await getMachineryList(params);
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
pageData.value.total = res.data.total;
|
pageData.value.total = res.data.total;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
ref="crud"
|
ref="crud"
|
||||||
v-model:page="pageData"
|
v-model:page="pageData"
|
||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:option="option"
|
:option="option"
|
||||||
:before-close="handleCloseDialog"
|
:before-close="handleCloseDialog"
|
||||||
@ -85,7 +85,7 @@ watch(
|
|||||||
|
|
||||||
const crud = ref();
|
const crud = ref();
|
||||||
const _loading = ref(false);
|
const _loading = ref(false);
|
||||||
const data = ref([]);
|
const tableData = ref([]);
|
||||||
const searchCondition = ref({
|
const searchCondition = ref({
|
||||||
keywords: '',
|
keywords: '',
|
||||||
});
|
});
|
||||||
@ -236,7 +236,7 @@ async function getData(reset) {
|
|||||||
let res = await getFertilizreList(params);
|
let res = await getFertilizreList(params);
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.value = res.data.records.map((v) => {
|
tableData.value = res.data.records.map((v) => {
|
||||||
v.productSpecification = handleNumUnit({ num1: v.productSpecification, unit1: v.productUnit, type: 1 });
|
v.productSpecification = handleNumUnit({ num1: v.productSpecification, unit1: v.productUnit, type: 1 });
|
||||||
v.suggest = handleNumUnit({ unit1: v.productUnit, num2: v.suggestDosage, unit2: v.suggestUnit, type: -1 });
|
v.suggest = handleNumUnit({ unit1: v.productUnit, num2: v.suggestDosage, unit2: v.suggestUnit, type: -1 });
|
||||||
v.produceDosage = handleShowName(v.produceDosage);
|
v.produceDosage = handleShowName(v.produceDosage);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
v-model:page="pageData"
|
v-model:page="pageData"
|
||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:option="option"
|
:option="option"
|
||||||
:before-close="handleCloseDialog"
|
:before-close="handleCloseDialog"
|
||||||
@search-change="
|
@search-change="
|
||||||
@ -63,7 +63,7 @@ import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo';
|
|||||||
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
|
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
|
||||||
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
|
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
|
||||||
import inputSuppliesApi from '@/apis/inputSuppliesApi';
|
import inputSuppliesApi from '@/apis/inputSuppliesApi';
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
|
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
|
||||||
const { deleteFn } = new assistFn();
|
const { deleteFn } = new assistFn();
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ const searchCondition = ref({
|
|||||||
});
|
});
|
||||||
const crud = ref();
|
const crud = ref();
|
||||||
const _loading = ref(true);
|
const _loading = ref(true);
|
||||||
const data = ref([]);
|
const tableData = ref([]);
|
||||||
const pageData = ref({
|
const pageData = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
@ -456,8 +456,8 @@ async function getData(reset) {
|
|||||||
console.log('res --- ', res);
|
console.log('res --- ', res);
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
if (res && res.code === 200) {
|
if (res && res.code === 200) {
|
||||||
data.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
data.value.forEach((v) => {
|
tableData.value.forEach((v) => {
|
||||||
v.productSpecification = handleNumUnit({ num1: v.productSpecification, unit1: v.productUnit, type: 1 });
|
v.productSpecification = handleNumUnit({ num1: v.productSpecification, unit1: v.productUnit, type: 1 });
|
||||||
v.dosage = handleNumUnit({ unit1: v.productUnit, num2: v.suggestDosage, unit2: v.suggestUnit, type: -1 });
|
v.dosage = handleNumUnit({ unit1: v.productUnit, num2: v.suggestDosage, unit2: v.suggestUnit, type: -1 });
|
||||||
v.targetPests = handleShowName(v.targetPests);
|
v.targetPests = handleShowName(v.targetPests);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
v-model:page="pageData"
|
v-model:page="pageData"
|
||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:option="option"
|
:option="option"
|
||||||
:before-close="handleCloseDialog"
|
:before-close="handleCloseDialog"
|
||||||
@search-change="
|
@search-change="
|
||||||
@ -68,7 +68,7 @@ const searchCondition = ref({
|
|||||||
});
|
});
|
||||||
const crud = ref();
|
const crud = ref();
|
||||||
const _loading = ref(true);
|
const _loading = ref(true);
|
||||||
const data = ref([]);
|
const tableData = ref([]);
|
||||||
const pageData = ref({
|
const pageData = ref({
|
||||||
total: 0,
|
total: 0,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
@ -229,8 +229,8 @@ async function getData(reset) {
|
|||||||
let res = await getAnimalMedicineList(params);
|
let res = await getAnimalMedicineList(params);
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
if (res && res.code === 200) {
|
if (res && res.code === 200) {
|
||||||
data.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
data.value.forEach((v) => {
|
tableData.value.forEach((v) => {
|
||||||
v.productSpecification = handleNumUnit({ num1: v.productSpecification, unit1: v.productUnit, type: 1 });
|
v.productSpecification = handleNumUnit({ num1: v.productSpecification, unit1: v.productUnit, type: 1 });
|
||||||
v.produceDosage = handleShowName(v.produceDosage);
|
v.produceDosage = handleShowName(v.produceDosage);
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:before-close="handleCloseDialog"
|
:before-close="handleCloseDialog"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:option="option"
|
:option="option"
|
||||||
@search-change="
|
@search-change="
|
||||||
(form, done) => {
|
(form, done) => {
|
||||||
@ -27,7 +27,9 @@
|
|||||||
<el-button type="primary" @click="handleInfo(row)">详情</el-button>
|
<el-button type="primary" @click="handleInfo(row)">详情</el-button>
|
||||||
<el-button @click="deleteFn(row.id, delSeed, getData)">删除</el-button>
|
<el-button @click="deleteFn(row.id, delSeed, getData)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #photoUrl-form="{ type }"> <Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" /> </template>
|
<template #photoUrl-form="{ type }">
|
||||||
|
<Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" />
|
||||||
|
</template>
|
||||||
</avue-crud>
|
</avue-crud>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@ -70,7 +72,7 @@ const _loading = ref(true);
|
|||||||
const searchCondition = ref({
|
const searchCondition = ref({
|
||||||
keywords: '',
|
keywords: '',
|
||||||
});
|
});
|
||||||
const data = ref([]);
|
const tableData = ref([]);
|
||||||
const option = ref({
|
const option = ref({
|
||||||
...CRUD_OPTIONS,
|
...CRUD_OPTIONS,
|
||||||
selection: false,
|
selection: false,
|
||||||
@ -189,7 +191,7 @@ async function getData(reset) {
|
|||||||
if (_type.value != '0') params['classifyId'] = _type.value;
|
if (_type.value != '0') params['classifyId'] = _type.value;
|
||||||
let res = await getSeedList(params);
|
let res = await getSeedList(params);
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.value = res.data.records ?? [];
|
tableData.value = res.data.records ?? [];
|
||||||
pageData.value.total = res.data.total;
|
pageData.value.total = res.data.total;
|
||||||
}
|
}
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class="custom-page">
|
|
||||||
<!-- <section style="width: 600px; height: 400px">
|
|
||||||
<custom-rich-editor />
|
|
||||||
</section> -->
|
|
||||||
<avue-crud
|
|
||||||
ref="curdRef"
|
|
||||||
v-model:page="pageData"
|
|
||||||
:data="data"
|
|
||||||
:before-close="handleDialogClose"
|
|
||||||
:option="option"
|
|
||||||
:table-loading="_loading"
|
|
||||||
@search-change="handleSearch"
|
|
||||||
@search-reset="handleSearchReset"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@row-save="handleRowSave"
|
|
||||||
@row-update="handleRowUpdate"
|
|
||||||
>
|
|
||||||
<template #menu="scope">
|
|
||||||
<custom-table-operate :actions="actions" :data="scope" />
|
|
||||||
</template>
|
|
||||||
</avue-crud>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { useMaterialHook } from './useMaterialHook';
|
|
||||||
|
|
||||||
const {
|
|
||||||
curdRef,
|
|
||||||
_loading,
|
|
||||||
data,
|
|
||||||
pageData,
|
|
||||||
option,
|
|
||||||
actions,
|
|
||||||
handleDialogClose,
|
|
||||||
handleSearch,
|
|
||||||
handleRowSave,
|
|
||||||
handleRowUpdate,
|
|
||||||
handleSearchReset,
|
|
||||||
handleCurrentChange,
|
|
||||||
handleSizeChange,
|
|
||||||
} = useMaterialHook();
|
|
||||||
/* --------------- data --------------- */
|
|
||||||
// #region
|
|
||||||
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
/* --------------- methods --------------- */
|
|
||||||
// #region
|
|
||||||
|
|
||||||
// #endregion
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
@ -1,197 +0,0 @@
|
|||||||
import { ref, reactive, onMounted } from 'vue';
|
|
||||||
import { CRUD_OPTIONS } from '@/config';
|
|
||||||
import inputSuppliesApis from '@/apis/inputSuppliesApi';
|
|
||||||
const { getMaterailTypes } = inputSuppliesApis;
|
|
||||||
export const useMaterialHook = () => {
|
|
||||||
onMounted(() => {
|
|
||||||
getData();
|
|
||||||
getTypes();
|
|
||||||
});
|
|
||||||
/* ------ data ------ */
|
|
||||||
// #region
|
|
||||||
const currentType = ref('0');
|
|
||||||
const curdRef = ref();
|
|
||||||
const _loading = ref(false);
|
|
||||||
const materialTypes = reactive([
|
|
||||||
{
|
|
||||||
id: '0',
|
|
||||||
dataName: '全部',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const pageData = ref({
|
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0,
|
|
||||||
});
|
|
||||||
const testData = reactive([
|
|
||||||
{ type: '1', id: 1, name: '物资1', producer: '生产厂家1', dealer: '经销商1' },
|
|
||||||
{ type: '2', id: 2, name: '物资2', producer: '生产厂家2', dealer: '经销商2' },
|
|
||||||
{ type: '3', id: 3, name: '物资3', producer: '生产厂家3', dealer: '经销商3' },
|
|
||||||
{ type: '4', id: 4, name: '物资4', producer: '生产厂家4', dealer: '经销商4' },
|
|
||||||
{ type: '5', id: 4, name: '物资4', producer: '生产厂家4', dealer: '经销商4' },
|
|
||||||
]);
|
|
||||||
const data = ref([]);
|
|
||||||
const option = reactive({
|
|
||||||
...CRUD_OPTIONS,
|
|
||||||
selection: false,
|
|
||||||
column: [
|
|
||||||
{
|
|
||||||
label: '物资类型',
|
|
||||||
prop: 'materailType',
|
|
||||||
hide: false,
|
|
||||||
search: true,
|
|
||||||
type: 'cascader',
|
|
||||||
dicData: materialTypes,
|
|
||||||
checkStrictly: true,
|
|
||||||
props: {
|
|
||||||
value: 'id',
|
|
||||||
label: 'dataName',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '物资编号',
|
|
||||||
prop: 'id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '物资编号',
|
|
||||||
prop: 'name',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '生产厂家',
|
|
||||||
prop: 'producer',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '经销商',
|
|
||||||
prop: 'dealer',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// label: '物资编号',
|
|
||||||
// prop: '',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: '物资编号',
|
|
||||||
// prop: 'id',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: '物资编号',
|
|
||||||
// prop: 'id',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
});
|
|
||||||
const actions = reactive([
|
|
||||||
{
|
|
||||||
auth: ({ row }) => row.type == '1',
|
|
||||||
name: 'custom',
|
|
||||||
icon: 'edit',
|
|
||||||
event: handleCustomFn,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '编辑',
|
|
||||||
icon: 'edit',
|
|
||||||
event: handleEdit,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'danger',
|
|
||||||
name: '删除',
|
|
||||||
icon: 'delete',
|
|
||||||
event: handleDel,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
/* ------ methods ------ */
|
|
||||||
// #region
|
|
||||||
async function getTypes() {
|
|
||||||
let res = await getMaterailTypes();
|
|
||||||
if (res.code == 200) {
|
|
||||||
materialTypes.push(...res.data);
|
|
||||||
console.log('types', materialTypes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getData() {
|
|
||||||
let params = {
|
|
||||||
currentPage: pageData.value.currentPage,
|
|
||||||
pageSize: pageData.value.pageSize,
|
|
||||||
type: currentType.value,
|
|
||||||
};
|
|
||||||
console.log('get params -- ', params);
|
|
||||||
if (currentType.value == '0') {
|
|
||||||
data.value = testData.map((v) => v);
|
|
||||||
} else {
|
|
||||||
data.value = testData.filter((item) => item.type == currentType.value);
|
|
||||||
}
|
|
||||||
console.log('data', data.value);
|
|
||||||
}
|
|
||||||
function handleSearch(form, done) {
|
|
||||||
if (!form.materailType || !form.materailType.length) {
|
|
||||||
currentType.value = '0';
|
|
||||||
} else {
|
|
||||||
currentType.value = form.materailType[0];
|
|
||||||
}
|
|
||||||
console.log('search --- ', form);
|
|
||||||
getData();
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
function handleSearchReset() {
|
|
||||||
resetPage();
|
|
||||||
}
|
|
||||||
async function handleDialogClose(done) {
|
|
||||||
done();
|
|
||||||
console.log('dialog close');
|
|
||||||
}
|
|
||||||
/* 新建行数据 */
|
|
||||||
async function handleRowSave(form, done, loading) {
|
|
||||||
console.log('save', form);
|
|
||||||
loading();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* */
|
|
||||||
function handleCustomFn({ row }) {
|
|
||||||
console.log('custom', row);
|
|
||||||
}
|
|
||||||
/* 行编辑 */
|
|
||||||
function handleEdit({ row }) {
|
|
||||||
console.log('edit', row);
|
|
||||||
}
|
|
||||||
/* 更新行数据 */
|
|
||||||
async function handleRowUpdate(form, done, loading) {
|
|
||||||
console.log('update', form);
|
|
||||||
loading();
|
|
||||||
}
|
|
||||||
/* 行删除 */
|
|
||||||
function handleDel({ row }) {
|
|
||||||
console.log('del', row);
|
|
||||||
}
|
|
||||||
function handleCurrentChange(val) {
|
|
||||||
pageData.value.currentPage = val;
|
|
||||||
getData();
|
|
||||||
}
|
|
||||||
function handleSizeChange(val) {
|
|
||||||
pageData.value.currentPage = 1;
|
|
||||||
pageData.value.size = val;
|
|
||||||
getData();
|
|
||||||
}
|
|
||||||
function resetPage() {
|
|
||||||
currentType.value = '0';
|
|
||||||
pageData.value.currentPage = 1;
|
|
||||||
pageData.value.pageSize = 10;
|
|
||||||
getData();
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
return {
|
|
||||||
curdRef,
|
|
||||||
_loading,
|
|
||||||
data,
|
|
||||||
pageData,
|
|
||||||
option,
|
|
||||||
actions,
|
|
||||||
handleSearch,
|
|
||||||
handleDialogClose,
|
|
||||||
handleRowSave,
|
|
||||||
handleRowUpdate,
|
|
||||||
handleSearchReset,
|
|
||||||
handleCurrentChange,
|
|
||||||
handleSizeChange,
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="custom-page">巡查与案件 </section>
|
<section class="custom-page">巡查与案件</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
v-model:page="pageData"
|
v-model:page="pageData"
|
||||||
v-model:search="searchCondition"
|
v-model:search="searchCondition"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
:option="option"
|
:option="option"
|
||||||
:before-close="
|
:before-close="
|
||||||
(done) => {
|
(done) => {
|
||||||
@ -68,7 +68,7 @@ const searchCondition = ref({
|
|||||||
_dealerType: '',
|
_dealerType: '',
|
||||||
keywords: '',
|
keywords: '',
|
||||||
});
|
});
|
||||||
const data = ref([{}]);
|
const tableData = ref([{}]);
|
||||||
const option = reactive({
|
const option = reactive({
|
||||||
...CRUD_OPTIONS,
|
...CRUD_OPTIONS,
|
||||||
dialogWidth: '50%',
|
dialogWidth: '50%',
|
||||||
@ -339,7 +339,7 @@ async function getData(reset) {
|
|||||||
};
|
};
|
||||||
let res = await getProductionDealerList(params);
|
let res = await getProductionDealerList(params);
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
pageData.value.total = res.data.total;
|
pageData.value.total = res.data.total;
|
||||||
}
|
}
|
||||||
_loading.value = false;
|
_loading.value = false;
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
v-model:page="pageData"
|
v-model:page="pageData"
|
||||||
:table-loading="_loading"
|
:table-loading="_loading"
|
||||||
:option="option"
|
:option="option"
|
||||||
:data="data"
|
:data="tableData"
|
||||||
|
:before-close="(done) => (handleOtherInfo(), done())"
|
||||||
@search-change="
|
@search-change="
|
||||||
(form, done) => {
|
(form, done) => {
|
||||||
getData(1);
|
getData(1);
|
||||||
@ -20,30 +21,61 @@
|
|||||||
@row-save="handleRowSave"
|
@row-save="handleRowSave"
|
||||||
@row-update="handleRowUpdate"
|
@row-update="handleRowUpdate"
|
||||||
>
|
>
|
||||||
<template #land-form="{ type }">
|
<!-- <template #land-form="{ type }">
|
||||||
<section if="type == 'add'">地块</section>
|
<section if="type == 'add'">地块</section>
|
||||||
|
</template> -->
|
||||||
|
<template #menu="scope">
|
||||||
|
<custom-table-operate :actions="actions" :data="scope" />
|
||||||
|
</template>
|
||||||
|
<template #report-form="{ type }">
|
||||||
|
<Attrs v-model:attrs="attrs" :type="type" />
|
||||||
|
</template>
|
||||||
|
<template #buyNumber-form="{ type }">
|
||||||
|
<NumberSelect v-if="type != 'view'" v-model:value="buyNumber" :options="useNumberOptions" :prop="useNumebrProp" />
|
||||||
|
<span v-else>{{ buyNumber + buyUnit }}</span>
|
||||||
|
</template>
|
||||||
|
<template #useNumber-form="{ type }">
|
||||||
|
<NumberSelect v-if="type != 'view'" v-model:value="useNumber" :options="useNumberOptions" :prop="useNumebrProp" />
|
||||||
|
<span v-else>{{ useNumber + useUnit }}</span>
|
||||||
</template>
|
</template>
|
||||||
</avue-crud>
|
</avue-crud>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from 'vue';
|
import { reactive, ref, onMounted } from 'vue';
|
||||||
import { CRUD_OPTIONS, pageData } from '@/config';
|
import { CRUD_OPTIONS, pageData, customRules } from '@/config';
|
||||||
import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo';
|
import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo';
|
||||||
|
import inputSuppliesApi from '@/apis/inputSuppliesApi';
|
||||||
|
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
|
||||||
|
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { GetEntityList } from '@/apis/system/dict';
|
||||||
|
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
|
||||||
|
|
||||||
const { loadFinish, materialTwoLevel, materialTypes } = useBasicInfo();
|
const { deleteFn } = new assistFn();
|
||||||
|
const { getUseSuperviseList, delUseSupervise, addUseSupervise, editUseSupervise } = inputSuppliesApi;
|
||||||
|
const { materialTypes, targetName } = useBasicInfo();
|
||||||
|
|
||||||
watch(
|
onMounted(() => {
|
||||||
() => loadFinish.value,
|
getData();
|
||||||
(bol) => {
|
getUseNumberDict();
|
||||||
if (loadFinish.value) {
|
});
|
||||||
console.log('material', materialTypes);
|
/* --------------- tableData --------------- */
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
/* --------------- data --------------- */
|
|
||||||
// #region
|
// #region
|
||||||
|
const useNumebrProp = reactive({
|
||||||
|
label: 'dictLabel',
|
||||||
|
value: 'dictValue',
|
||||||
|
});
|
||||||
|
const useNumberOptions = ref([]);
|
||||||
|
const buyNumber = ref({
|
||||||
|
num: 1,
|
||||||
|
type: '1',
|
||||||
|
});
|
||||||
|
const useNumber = ref({
|
||||||
|
num: 1,
|
||||||
|
type: '1',
|
||||||
|
});
|
||||||
const crudRef = ref(null);
|
const crudRef = ref(null);
|
||||||
const _loading = ref(true);
|
const _loading = ref(true);
|
||||||
const searchCondition = ref({
|
const searchCondition = ref({
|
||||||
@ -55,7 +87,7 @@ const types = reactive([
|
|||||||
{ label: '肥料监管', value: '2' },
|
{ label: '肥料监管', value: '2' },
|
||||||
{ label: '兽药监管', value: '3' },
|
{ label: '兽药监管', value: '3' },
|
||||||
]);
|
]);
|
||||||
const data = ref([{}]);
|
const tableData = ref([{}]);
|
||||||
const option = ref({
|
const option = ref({
|
||||||
...CRUD_OPTIONS,
|
...CRUD_OPTIONS,
|
||||||
selection: false,
|
selection: false,
|
||||||
@ -88,48 +120,78 @@ const option = ref({
|
|||||||
clearable: false,
|
clearable: false,
|
||||||
value: '1',
|
value: '1',
|
||||||
change: handleTypeChange,
|
change: handleTypeChange,
|
||||||
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '姓名',
|
label: '使用者名称',
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
|
width: 240,
|
||||||
|
rules: customRules({ msg: '请输入名称' }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '联系方式',
|
label: '联系方式',
|
||||||
prop: 'phone',
|
prop: 'phone',
|
||||||
|
width: 120,
|
||||||
|
rules: customRules({ msg: '请输入联系方式' }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '投入品名称',
|
label: '投入品名称',
|
||||||
prop: 'materialName',
|
prop: 'inputName',
|
||||||
|
width: 240,
|
||||||
|
rules: customRules({ msg: '请输入投入品名称' }),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
hide: true,
|
||||||
|
label: '分类',
|
||||||
|
prop: '_classifyId',
|
||||||
|
type: 'cascader',
|
||||||
|
dicData: [],
|
||||||
|
value: [],
|
||||||
|
rules: customRules({ msg: '请选择分类' }),
|
||||||
|
viewDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '分类',
|
label: '分类',
|
||||||
prop: 'type',
|
prop: 'classifyName',
|
||||||
type: 'cascader',
|
width: 200,
|
||||||
dicData: [],
|
overHidden: true,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '购买量',
|
label: '购买量',
|
||||||
prop: 't1',
|
prop: 'buyNumber',
|
||||||
|
render: ({ row }) => row.buyNumber + row.buyUnit,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '购买时间',
|
label: '购买时间',
|
||||||
prop: 't2',
|
type: 'date',
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
width: 140,
|
||||||
|
prop: 'buyTime',
|
||||||
|
rules: customRules({ msg: '请选择购买时间' }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '使用量',
|
label: '使用量',
|
||||||
prop: 't3',
|
prop: 'useNumber',
|
||||||
|
render: ({ row }) => row.useNumber + row.useUnit,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '使用时间',
|
label: '使用时间',
|
||||||
prop: 't4',
|
type: 'date',
|
||||||
|
width: 140,
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
prop: 'useTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '使用对象',
|
label: '使用对象',
|
||||||
prop: 't5',
|
prop: 'useObject',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '关联地块',
|
label: '关联地块',
|
||||||
prop: 'land',
|
prop: 'landName',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
group: [
|
group: [
|
||||||
@ -141,59 +203,169 @@ const option = ref({
|
|||||||
column: [
|
column: [
|
||||||
{
|
{
|
||||||
label: '检测时间',
|
label: '检测时间',
|
||||||
prop: 'checkTime',
|
prop: 'detectionTime',
|
||||||
span: 24,
|
|
||||||
type: 'date',
|
type: 'date',
|
||||||
valueFormat: 'yyyy-MM-dd',
|
valueFormat: 'YYYY-MM-DD',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'YYYY-MM-DD',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '检测结果',
|
label: '检测结果',
|
||||||
prop: 'result',
|
prop: 'detectionResult',
|
||||||
span: 24,
|
type: 'select',
|
||||||
|
dicData: [
|
||||||
|
{
|
||||||
|
label: '合格',
|
||||||
|
value: '0',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '不合格',
|
||||||
|
value: '1',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '投入品名称',
|
label: '投入品名称',
|
||||||
prop: 'unit',
|
prop: 'detectionUnit',
|
||||||
span: 24,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '检测报告',
|
label: '检测报告',
|
||||||
prop: 'report',
|
prop: 'report',
|
||||||
span: 24,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
const attrs = ref([]);
|
||||||
|
const actions = reactive([
|
||||||
|
{
|
||||||
|
name: '详情',
|
||||||
|
icon: 'view',
|
||||||
|
event: ({ row }) => {
|
||||||
|
handleOtherInfo(row);
|
||||||
|
crudRef.value.rowView(row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '编辑',
|
||||||
|
icon: 'edit',
|
||||||
|
event: ({ row }) => {
|
||||||
|
handleOtherInfo(row);
|
||||||
|
crudRef.value.rowEdit(row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'danger',
|
||||||
|
name: '删除',
|
||||||
|
icon: 'delete',
|
||||||
|
event: ({ row }) => deleteFn(row.id, delUseSupervise, getData),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const typeDictData = ref([]);
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
/* --------------- methods --------------- */
|
/* --------------- methods --------------- */
|
||||||
// #region
|
// #region
|
||||||
function getData(reset = 1) {
|
async function getUseNumberDict() {
|
||||||
reset == 1 && (pageData.value.currentPage = 1);
|
let res = await GetEntityList({
|
||||||
console.log('get data');
|
dictType: 'sys_use_supervise_number',
|
||||||
|
current: 1,
|
||||||
|
size: 1000,
|
||||||
|
});
|
||||||
|
useNumberOptions.value = res?.data?.records ?? [];
|
||||||
|
if (useNumberOptions.value.length) {
|
||||||
|
buyNumber.value.type = useNumberOptions.value[0].dictValue;
|
||||||
|
useNumber.value.type = useNumberOptions.value[0].dictValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getData(reset = 0) {
|
||||||
|
_loading.value = true;
|
||||||
|
reset === 1 && (pageData.value.currentPage = 1);
|
||||||
|
let res = await getUseSuperviseList({
|
||||||
|
current: pageData.value.currentPage,
|
||||||
|
size: pageData.value.pageSize,
|
||||||
|
dataType: searchCondition.value.searchType,
|
||||||
|
name: searchCondition.value.keywords,
|
||||||
|
});
|
||||||
|
_loading.value = false;
|
||||||
|
if (res.code == 200) {
|
||||||
|
tableData.value = res.data.records.map((v) => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
_classifyId: v.classifyId.split(','),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
pageData.value.total = res.data.total;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function handleTypeChange(val) {
|
function handleTypeChange(val) {
|
||||||
console.log(
|
option.value.group[0].addDisplay = val.value == '1';
|
||||||
'dicData',
|
option.value.group[0].editDisplay = val.value == '1';
|
||||||
materialTypes[val.value].filter((v) => v.value != '0')
|
option.value.group[0].viewDisplay = val.value == '1';
|
||||||
);
|
typeDictData.value = materialTypes[val.value].filter((v) => v.value != '0') || [];
|
||||||
option.value.column[6].dicData = materialTypes[val.value].filter((v) => v.value != '0');
|
option.value.column[6].dicData = typeDictData.value;
|
||||||
}
|
}
|
||||||
function handleData(val) {
|
function handleData(val) {
|
||||||
console.log('handleData', val);
|
let _data = Object.assign({}, val);
|
||||||
|
_data.buyNumber = buyNumber.value.num;
|
||||||
|
_data.buyUnit = buyNumber.value.type;
|
||||||
|
_data.useNumber = useNumber.value.num;
|
||||||
|
_data.useUnit = useNumber.value.type;
|
||||||
|
_data.classifyId = val._classifyId.join();
|
||||||
|
_data.classifyName = targetName(typeDictData.value, val._classifyId);
|
||||||
|
if (attrs.value.length) {
|
||||||
|
_data.detectionReport = attrs.value.map((v) => v.url).join();
|
||||||
|
}
|
||||||
|
delete _data.keywords;
|
||||||
|
delete _data.searchType;
|
||||||
|
delete _data._classifyId;
|
||||||
|
return _data;
|
||||||
}
|
}
|
||||||
function handleRowSave(row, done, laoding) {
|
async function handleRowSave(row, done, loading) {
|
||||||
handleData(row);
|
let data = handleData(row);
|
||||||
laoding();
|
let res = await addUseSupervise(data);
|
||||||
}
|
|
||||||
|
|
||||||
function handleRowUpdate(row, index, done, loading) {
|
|
||||||
handleData(row);
|
|
||||||
loading();
|
loading();
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage.success('保存成功');
|
||||||
|
getData();
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function handleRowUpdate(row, index, done, loading) {
|
||||||
|
let data = handleData(row);
|
||||||
|
let res = await editUseSupervise(data);
|
||||||
|
loading();
|
||||||
|
if (res.code == 200) {
|
||||||
|
ElMessage.success('保存成功');
|
||||||
|
getData();
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function handleOtherInfo(obj = {}) {
|
||||||
|
if (!Object.keys(obj).length) {
|
||||||
|
attrs.value = [];
|
||||||
|
buyNumber.value = { num: 1, type: useNumberOptions.value?.[0].dictValue ?? '1' };
|
||||||
|
useNumber.value = { num: 1, type: useNumberOptions.value?.[0].dictValue ?? '1' };
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (obj.detectionReport) {
|
||||||
|
attrs.value = obj.detectionReport.split(',').map((v, i) => {
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
name: '检测报告' + i,
|
||||||
|
url: v,
|
||||||
|
uid: 'id_' + i + Date.now(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
buyNumber.value = {
|
||||||
|
num: +obj.buyNumber,
|
||||||
|
type: obj.buyUnit,
|
||||||
|
};
|
||||||
|
useNumber.value = {
|
||||||
|
num: +obj.useNumber,
|
||||||
|
type: obj.useUnit,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
|
@ -37,13 +37,16 @@
|
|||||||
<el-button type="success" icon="download" @click="handleExport">导出</el-button>
|
<el-button type="success" icon="download" @click="handleExport">导出</el-button>
|
||||||
<el-button type="success" icon="upload" @click="onUpload">导入</el-button>
|
<el-button type="success" icon="upload" @click="onUpload">导入</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #area-form>
|
<template #area-form="{ type }">
|
||||||
<section class="area_form_">
|
<section v-show="type != 'view'" class="area_form_">
|
||||||
<el-input-number v-model="landArea" :precision="2" :step="1" :min="1" controls-position="right"></el-input-number>
|
<el-input-number v-model="landArea" :precision="2" :step="1" :min="1" controls-position="right"></el-input-number>
|
||||||
<el-select v-model="unitValue">
|
<el-select v-model="unitValue">
|
||||||
<el-option v-for="item in unitOptions" :key="'unitOptions_' + item.value" :label="item.label" :value="item.label" />
|
<el-option v-for="item in unitOptions" :key="'unitOptions_' + item.value" :label="item.label" :value="item.label" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</section>
|
</section>
|
||||||
|
<section v-show="type == 'view'">
|
||||||
|
{{ landArea + unitValue }}
|
||||||
|
</section>
|
||||||
</template>
|
</template>
|
||||||
<template #propertyCertificateUrl-form="{ type }">
|
<template #propertyCertificateUrl-form="{ type }">
|
||||||
<Attrs v-model:attrs="attrs" :type="type" />
|
<Attrs v-model:attrs="attrs" :type="type" />
|
||||||
@ -269,9 +272,10 @@ const option = reactive({
|
|||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
change: handleChangeGrid,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '用地分类1',
|
label: '用地分类',
|
||||||
prop: 'landTypeId',
|
prop: 'landTypeId',
|
||||||
type: 'cascader',
|
type: 'cascader',
|
||||||
dicData: landTreeDic,
|
dicData: landTreeDic,
|
||||||
@ -306,6 +310,14 @@ const option = reactive({
|
|||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
hide: true,
|
||||||
|
label: '位置',
|
||||||
|
prop: 'address',
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '是否土地流转',
|
label: '是否土地流转',
|
||||||
@ -476,35 +488,27 @@ async function getList(reset = 1) {
|
|||||||
v.coordinateView = v.coordinate;
|
v.coordinateView = v.coordinate;
|
||||||
v.soilTypeName = v.soilType;
|
v.soilTypeName = v.soilType;
|
||||||
v.soilTypeId = v.soilId;
|
v.soilTypeId = v.soilId;
|
||||||
v._villageCode = handleArea(v);
|
v._villageCode = v.villageCode;
|
||||||
v.landTypeId = [v.pid, v.landType];
|
v.landTypeId = [v.pid, v.landType];
|
||||||
console.log('vvv', v);
|
|
||||||
});
|
});
|
||||||
pageData.value.total = total;
|
pageData.value.total = total;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function handleGetGrid(res) {
|
function handleGetGrid(res) {
|
||||||
console.log('res', res);
|
return res?.data?.records ?? [];
|
||||||
return res.records ?? [];
|
}
|
||||||
|
function handleChangeGrid(val) {
|
||||||
|
val.item && filterArea(val.item.townCode);
|
||||||
|
}
|
||||||
|
function filterArea(id) {
|
||||||
|
option.group[0].column[4].dicData = regionData.value.find((v) => v.areaCode == id)?.areaChildVOS ?? [];
|
||||||
}
|
}
|
||||||
async function handleGetRegion() {
|
async function handleGetRegion() {
|
||||||
let res = await getRegion();
|
let res = await getRegion();
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
option.group[0].column[5];
|
regionData.value = res?.data?.[0].areaChildVOS?.[0].areaChildVOS?.[0].areaChildVOS ?? [];
|
||||||
}
|
}
|
||||||
console.log('region', res);
|
|
||||||
}
|
}
|
||||||
function handleArea(v) {
|
|
||||||
const { provinceCode, cityCode, county, townCode, villageCode } = v;
|
|
||||||
let _area = [provinceCode, cityCode, county, townCode, villageCode];
|
|
||||||
let _arr = [];
|
|
||||||
for (let i = 0; i < _area.length; i++) {
|
|
||||||
if (!_area[i]) return;
|
|
||||||
_arr.push(_area[i]);
|
|
||||||
}
|
|
||||||
return _arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSizeChange(val) {
|
function handleSizeChange(val) {
|
||||||
pageData.value.pageSize = val;
|
pageData.value.pageSize = val;
|
||||||
getList();
|
getList();
|
||||||
@ -581,7 +585,7 @@ function handleData(val) {
|
|||||||
data.propertyCertificateUrl = urls.join();
|
data.propertyCertificateUrl = urls.join();
|
||||||
data.landCertificateUrl = landOwnerUrls.join();
|
data.landCertificateUrl = landOwnerUrls.join();
|
||||||
data.landUrl = landUrls.join();
|
data.landUrl = landUrls.join();
|
||||||
data.villageCode = data._villageCode[data._villageCode.length - 1] || '';
|
data.villageCode = data._villageCode;
|
||||||
data.landTypeId = data.landTypeId[data.landTypeId.length - 1];
|
data.landTypeId = data.landTypeId[data.landTypeId.length - 1];
|
||||||
data.soilType = data.soilTypeId;
|
data.soilType = data.soilTypeId;
|
||||||
if (local.value.length != 0) {
|
if (local.value.length != 0) {
|
||||||
@ -617,14 +621,13 @@ async function handleRowUpdate(form, index, done, loading) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function rowEdit(row) {
|
async function rowEdit(row) {
|
||||||
console.log('rowEdit', row);
|
|
||||||
handleOtherInfo(row);
|
handleOtherInfo(row);
|
||||||
|
filterArea(row.townCode);
|
||||||
crudRef.value.rowEdit(row);
|
crudRef.value.rowEdit(row);
|
||||||
}
|
}
|
||||||
function handleOtherInfo(obj) {
|
function handleOtherInfo(obj) {
|
||||||
landArea.value = obj.area;
|
landArea.value = obj.area;
|
||||||
unitValue.value = obj.landUnit;
|
unitValue.value = obj.landUnit;
|
||||||
console.log('option', obj._villageCode, option.group[0].column[4]);
|
|
||||||
if (obj.propertyCertificateUrl) {
|
if (obj.propertyCertificateUrl) {
|
||||||
attrs.value = obj.propertyCertificateUrl.split(',').map((v, i) => {
|
attrs.value = obj.propertyCertificateUrl.split(',').map((v, i) => {
|
||||||
return {
|
return {
|
||||||
|
@ -81,14 +81,15 @@ const keyword = ref('');
|
|||||||
const meuns = ref([
|
const meuns = ref([
|
||||||
{
|
{
|
||||||
label: '智慧种植',
|
label: '智慧种植',
|
||||||
path: '/login',
|
path: '/sub-operation-service/ecommerce',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '农事服务',
|
label: '农事服务',
|
||||||
path: '/sub-admin/home',
|
path: '/sub-operation-service/ecommerce',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '涉农金融',
|
label: '涉农金融',
|
||||||
|
path: '/sub-operation-service/ecommerce',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '电商交易',
|
label: '电商交易',
|
||||||
@ -96,12 +97,15 @@ const meuns = ref([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '分拣包装',
|
label: '分拣包装',
|
||||||
|
path: '/sub-operation-service/ecommerce',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '仓储物流',
|
label: '仓储物流',
|
||||||
|
path: '/sub-operation-service/ecommerce',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '公共品牌运营',
|
label: '公共品牌运营',
|
||||||
|
path: '/sub-operation-service/ecommerce',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -111,7 +115,7 @@ function Search() {
|
|||||||
|
|
||||||
const toHome = () => {
|
const toHome = () => {
|
||||||
console.info('toHome', router);
|
console.info('toHome', router);
|
||||||
router.push('/');
|
router.push('/sub-operation-service/home');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user