Merge branch 'dev' of http://47.109.205.240:3000/Web/daimp-front into dev
@ -23,7 +23,10 @@ import { resolve } from 'path';
|
||||
const useDevMode = true;
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const { VITE_APP_MIAN_URL, VITE_PORT, VITE_APP_NAME, VITE_APP_BASE_API, VITE_APP_BASE_URL, VITE_APP_UPLOAD_API, VITE_APP_UPLOAD_URL } = loadEnv(mode, process.cwd());
|
||||
const { VITE_APP_MIAN_URL, VITE_PORT, VITE_APP_NAME, VITE_APP_BASE_API, VITE_APP_BASE_URL, VITE_APP_UPLOAD_API, VITE_APP_UPLOAD_URL } = loadEnv(
|
||||
mode,
|
||||
process.cwd()
|
||||
);
|
||||
const config = {
|
||||
base: '/new-digital-agriculture-screen/',
|
||||
build: {
|
||||
@ -36,7 +39,6 @@ export default defineConfig(({ command, mode }) => {
|
||||
port: VITE_PORT,
|
||||
open: true,
|
||||
https: false,
|
||||
origin: VITE_APP_MIAN_URL,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
|
@ -1,8 +1,8 @@
|
||||
# 开发环境
|
||||
VITE_PORT = 9528
|
||||
VITE_MODE = 'DEV'
|
||||
VITE_APP_MIAN = 'platform'
|
||||
VITE_APP_MIAN_URL = 'http://192.168.18.99:88'
|
||||
VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://localhost:9000'
|
||||
VITE_APP_NAME = 'sub-government-affairs-service'
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
|
@ -1,9 +0,0 @@
|
||||
# 本地环境
|
||||
VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://localhost:8090'
|
||||
VITE_APP_NAME = 'sub-government-affairs-service'
|
||||
# 接口
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
VITE_APP_BASE_URL = ''
|
||||
VITE_APP_UPLOAD_API = '/uploadApis'
|
||||
VITE_APP_UPLOAD_URL = ''
|
@ -1,7 +1,7 @@
|
||||
# 生产环境
|
||||
VITE_MODE = 'PRO'
|
||||
VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://47.109.205.240'
|
||||
VITE_APP_MIAN_URL = 'http://47.109.205.240:88'
|
||||
VITE_APP_NAME = 'sub-government-affairs-service'
|
||||
# 接口
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
|
@ -1,9 +0,0 @@
|
||||
# 测试环境
|
||||
VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://192.168.18.99:88'
|
||||
VITE_APP_NAME = 'sub-government-affairs-service'
|
||||
# 接口
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
VITE_APP_BASE_URL = ''
|
||||
VITE_APP_UPLOAD_API = '/uploadApis'
|
||||
VITE_APP_UPLOAD_URL = ''
|
3
sub-government-affairs-service/.gitignore
vendored
@ -69,7 +69,8 @@ web_modules/
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
# .env
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
@ -11,10 +11,10 @@ module.exports = {
|
||||
extends: [
|
||||
'stylelint-config-standard',
|
||||
'stylelint-config-standard-scss',
|
||||
'stylelint-config-prettier',
|
||||
'stylelint-config-html/vue',
|
||||
'stylelint-config-recommended-vue',
|
||||
'stylelint-config-recommended-scss',
|
||||
'stylelint-config-prettier'
|
||||
'stylelint-config-recommended-scss'
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
|
75
sub-government-affairs-service/auto-imports.d.ts
vendored
@ -1,75 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// @ts-nocheck
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
// Generated by unplugin-auto-import
|
||||
export {}
|
||||
declare global {
|
||||
const EffectScope: typeof import('vue')['EffectScope']
|
||||
const computed: typeof import('vue')['computed']
|
||||
const createApp: typeof import('vue')['createApp']
|
||||
const customRef: typeof import('vue')['customRef']
|
||||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
||||
const defineComponent: typeof import('vue')['defineComponent']
|
||||
const effectScope: typeof import('vue')['effectScope']
|
||||
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
||||
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
||||
const h: typeof import('vue')['h']
|
||||
const inject: typeof import('vue')['inject']
|
||||
const isProxy: typeof import('vue')['isProxy']
|
||||
const isReactive: typeof import('vue')['isReactive']
|
||||
const isReadonly: typeof import('vue')['isReadonly']
|
||||
const isRef: typeof import('vue')['isRef']
|
||||
const markRaw: typeof import('vue')['markRaw']
|
||||
const nextTick: typeof import('vue')['nextTick']
|
||||
const onActivated: typeof import('vue')['onActivated']
|
||||
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
||||
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
||||
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
||||
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
||||
const onMounted: typeof import('vue')['onMounted']
|
||||
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
||||
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
||||
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
||||
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
||||
const onUpdated: typeof import('vue')['onUpdated']
|
||||
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
|
||||
const provide: typeof import('vue')['provide']
|
||||
const reactive: typeof import('vue')['reactive']
|
||||
const readonly: typeof import('vue')['readonly']
|
||||
const ref: typeof import('vue')['ref']
|
||||
const resolveComponent: typeof import('vue')['resolveComponent']
|
||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
||||
const shallowRef: typeof import('vue')['shallowRef']
|
||||
const toRaw: typeof import('vue')['toRaw']
|
||||
const toRef: typeof import('vue')['toRef']
|
||||
const toRefs: typeof import('vue')['toRefs']
|
||||
const toValue: typeof import('vue')['toValue']
|
||||
const triggerRef: typeof import('vue')['triggerRef']
|
||||
const unref: typeof import('vue')['unref']
|
||||
const useAttrs: typeof import('vue')['useAttrs']
|
||||
const useCssModule: typeof import('vue')['useCssModule']
|
||||
const useCssVars: typeof import('vue')['useCssVars']
|
||||
const useId: typeof import('vue')['useId']
|
||||
const useLink: typeof import('vue-router')['useLink']
|
||||
const useModel: typeof import('vue')['useModel']
|
||||
const useRoute: typeof import('vue-router')['useRoute']
|
||||
const useRouter: typeof import('vue-router')['useRouter']
|
||||
const useSlots: typeof import('vue')['useSlots']
|
||||
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
||||
const watch: typeof import('vue')['watch']
|
||||
const watchEffect: typeof import('vue')['watchEffect']
|
||||
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
||||
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
||||
}
|
||||
// for type re-export
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||
import('vue')
|
||||
}
|
14
sub-government-affairs-service/components.d.ts
vendored
@ -1,14 +0,0 @@
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
export {}
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
}
|
||||
}
|
13322
sub-government-affairs-service/package-lock.json
generated
@ -7,7 +7,7 @@
|
||||
"dev": "vite --mode development",
|
||||
"build": "vite build --mode production",
|
||||
"test": "vite build --mode test",
|
||||
"pre": "vite build --mode pre",
|
||||
"local": "vite build --mode local",
|
||||
"preview": "vite preview",
|
||||
"format": "prettier --write 'src/**/*.{vue,ts,tsx,js,jsx,css,less,scss,json,md}'",
|
||||
"eslint": "npx eslint --init",
|
||||
@ -21,7 +21,6 @@
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"axios": "^1.6.5",
|
||||
"dayjs": "^1.11.13",
|
||||
"echarts": "^5.6.0",
|
||||
"element-plus": "^2.7.2",
|
||||
"js-base64": "^3.7.6",
|
||||
|
@ -1,28 +0,0 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
export function getEnterpriseDealerCheck(params) {
|
||||
return request('/inputGoods/distributorCheck/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
export function addEnterpriseDealerCheck(data) {
|
||||
return request('/inputGoods/distributorCheck/save', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
export function delEnterpriseDealerCheck(ids) {
|
||||
return request(`/inputGoods/distributorCheck/delete/${ids}`);
|
||||
}
|
||||
export function editEnterpriseDealerCheck(data) {
|
||||
return request('/inputGoods/distributorCheck/edit', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
export function enterpriseDealerCheckRegister(data) {
|
||||
return request('/inputGoods/distributorCheck/register', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
@ -3,8 +3,6 @@ import * as materialApi from './material';
|
||||
import * as knowledgeApi from './knowledge';
|
||||
import * as leaseSuperviseApi from './leaseSupervise';
|
||||
import * as productionDealerApi from './productionDealer';
|
||||
import * as useSuperviseApi from './useSupervise';
|
||||
import * as enteroriseDealerCheckApi from './enterpriseDealerCheck';
|
||||
|
||||
export default {
|
||||
...materialApi,
|
||||
@ -12,6 +10,4 @@ export default {
|
||||
...knowledgeApi,
|
||||
...leaseSuperviseApi,
|
||||
...productionDealerApi,
|
||||
...useSuperviseApi,
|
||||
...enteroriseDealerCheckApi,
|
||||
};
|
||||
|
@ -1,24 +0,0 @@
|
||||
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,
|
||||
});
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
import * as produceList from './productList';
|
||||
|
||||
export default {
|
||||
...produceList,
|
||||
};
|
@ -1,40 +0,0 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
/* 产出品列表 */
|
||||
export function getProduceList(data) {
|
||||
return request('/goods/business/goods/list', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
/* 新增产出品 */
|
||||
export function addProduceGoods(data = {}) {
|
||||
return request('/goods/business/goods/add', {
|
||||
method: 'POST',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/* 编辑产出品 */
|
||||
export function editProduceGoods(data) {
|
||||
return request('/goods/business/goods/edit', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/* 删除产出品 */
|
||||
export function delProduceGoods(id) {
|
||||
return request(`/goods/business/goods/remove?ids=${id}`, {
|
||||
method: 'POST',
|
||||
// data,
|
||||
});
|
||||
}
|
||||
|
||||
/* 导出产出品列表 */
|
||||
export function exportProduceGoods() {
|
||||
return request(`/goods/business/goods/export`, {
|
||||
method: 'POST',
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
import request from '@/utils/axios';
|
||||
// #region
|
||||
|
||||
/* 经营主体相关 */
|
||||
export function getBuinessList(params = {}) {
|
||||
return request('/product-business/business/businessPage', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export function saveBuiness(data = {}) {
|
||||
return request('/product-business/business/businessSave', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function editBuiness(data = {}) {
|
||||
return request('/product-business/business/businessEdit', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function delBuiness(params = {}) {
|
||||
return request('/product-business/business/deleteBusiness', {
|
||||
method: 'DELETE',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
/* 经营主体审核相关 */
|
||||
export function getBuinesCheckList(params = {}) {
|
||||
return request('/product-business/business/businessCheckPage', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export function doBusinessCheck(data = {}) {
|
||||
return request('/product-business/business/businessCheck', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function exportBusinessCheck(params = {}) {
|
||||
return request('/product-business/business/businessCheckExport', {
|
||||
method: 'GET',
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
/* 经营主体审核历史相关 */
|
||||
export function getBuinesCheckRecord(params = {}) {
|
||||
return request('/product-business/business/businessCheckLogPage', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export function exportBusinessCheckRecord(params = {}) {
|
||||
return request('/product-business/business/businessCheckLogExport', {
|
||||
method: 'GET',
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
// #endregion
|
@ -1,49 +0,0 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
/**
|
||||
* @Title: 查询角色已授权用户列表
|
||||
*/
|
||||
export function AuthUserList(params = {}) {
|
||||
return request('/system/role/authUser/allocatedList', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 查询角色未授权用户列表
|
||||
*/
|
||||
export function UnAuthUserList(params = {}) {
|
||||
return request('/system/role/authUser/unallocatedList', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 取消用户授权角色
|
||||
export function AuthUserCancel(data) {
|
||||
return request('/system/role/authUser/cancel', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 批量取消用户授权角色
|
||||
*/
|
||||
export function AuthUserCancelAll(params = {}) {
|
||||
return request('/system/role/authUser/cancelAll', {
|
||||
method: 'PUT',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 授权用户选择
|
||||
*/
|
||||
export function AuthUserSelectAll(params = {}) {
|
||||
return request('/system/role/authUser/selectAll', {
|
||||
method: 'PUT',
|
||||
params,
|
||||
});
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
/**
|
||||
* @Title: 列表
|
||||
*/
|
||||
export function GetEntityList(params = {}) {
|
||||
return request('/system/role/list', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 新增
|
||||
*/
|
||||
export function AddEntity(data = {}) {
|
||||
return request('/system/role', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 修改
|
||||
*/
|
||||
export function UpdateEntity(data = {}) {
|
||||
return request('/system/role', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 删除
|
||||
*/
|
||||
export function DeleteEntity(params = {}) {
|
||||
return request(`/system/role/${params.id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 角色状态修改
|
||||
*/
|
||||
export function UpdateStatus(data = {}) {
|
||||
return request('/system/role/changeStatus', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 查询角色详细
|
||||
*/
|
||||
export function GetRole(roleId) {
|
||||
return request(`/system/role/${roleId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 根据角色ID查询部门树结构
|
||||
*/
|
||||
export function GetRoleDept(roleId) {
|
||||
return request(`/system/role/deptTree/${roleId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 角色菜单权限
|
||||
*/
|
||||
export function UpdateDataScope(data = {}) {
|
||||
return request('/system/role/dataScope', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
@ -1,167 +0,0 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
/**
|
||||
* @Title: 列表
|
||||
*/
|
||||
export function GetEntityList(params = {}) {
|
||||
return request('/system/user/list', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 新增
|
||||
*/
|
||||
export function AddEntity(data = {}) {
|
||||
return request('/system/user', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 修改
|
||||
*/
|
||||
export function UpdateEntity(data = {}) {
|
||||
return request('/system/user', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 删除
|
||||
*/
|
||||
export function DeleteEntity(params = {}) {
|
||||
return request(`/system/user/${params.id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 导入
|
||||
*/
|
||||
export function ImportEntity(data = {}) {
|
||||
return request('/system/user/importData', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 导出
|
||||
*/
|
||||
export function ExportEntity(params = {}) {
|
||||
return request('/system/user/export', {
|
||||
method: 'POST',
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 状态修改
|
||||
*/
|
||||
export function UpdateStatus(data = {}) {
|
||||
return request('/system/user/changeStatus', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 信息
|
||||
*/
|
||||
export function GetUser(id) {
|
||||
return request(`/system/user/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 用户密码重置
|
||||
*/
|
||||
export function ResetUserPwd(data = {}) {
|
||||
return request(`/system/user/resetPwd`, {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 查询用户个人信息
|
||||
*/
|
||||
export function GetUserProfile() {
|
||||
return request(`/system/user/profile`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 修改用户个人信息
|
||||
*/
|
||||
export function UpdateUserProfile(data = {}) {
|
||||
return request(`/system/user/profile`, {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 用户密码重置
|
||||
*/
|
||||
export function UpdateUserPwd(data = {}) {
|
||||
return request(`/system/user/profile/updatePwd`, {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 用户头像上传
|
||||
*/
|
||||
export function UploadAvatar(data = {}) {
|
||||
return request(`/system/user/profile/avatar`, {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 查询授权角色
|
||||
*/
|
||||
export function GetAuthRole(id) {
|
||||
return request(`/system/user/authRole/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 保存授权角色
|
||||
*/
|
||||
export function UpdateAuthRole(params = {}) {
|
||||
return request('/system/user/authRole', {
|
||||
method: 'PUT',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 查询部门
|
||||
*/
|
||||
export function GetDeptList() {
|
||||
return request('/system/dept/list', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 查询部门下拉树结构
|
||||
*/
|
||||
export function GetDeptTreeSelect() {
|
||||
return request('/system/user/deptTree', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
Before Width: | Height: | Size: 7.6 KiB |
@ -3,7 +3,7 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2023-06-20 14:29:45
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-04-10 11:15:23
|
||||
* @LastEditTime: 2025-02-18 09:48:18
|
||||
-->
|
||||
<template>
|
||||
<el-dropdown class="layout-avatar">
|
||||
@ -16,9 +16,7 @@
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item> 用户姓名:{{ userInfo.nickName }} </el-dropdown-item>
|
||||
<el-dropdown-item> 用户角色:{{ roles }} </el-dropdown-item>
|
||||
<el-dropdown-item> 部门组织:{{ userInfo?.dept?.deptName }} </el-dropdown-item>
|
||||
<el-dropdown-item :command="0"> 当前角色:{{ userInfo.nickName }} </el-dropdown-item>
|
||||
<el-dropdown-item :command="5" divided @click="logOut">
|
||||
<el-icon><SwitchButton /></el-icon>退出登录
|
||||
</el-dropdown-item>
|
||||
@ -44,13 +42,6 @@ const PermissionStore = usePermissionStore();
|
||||
|
||||
// 用户信息
|
||||
const userInfo = computed(() => UserStore.getUserInfo());
|
||||
// eslint-disable-next-line vue/return-in-computed-property
|
||||
const roles = computed(() => {
|
||||
if (userInfo.value.roles) {
|
||||
const arr = userInfo.value.roles.map((item) => item.roleName);
|
||||
return arr.join(' | ');
|
||||
}
|
||||
});
|
||||
|
||||
const logOut = async () => {
|
||||
ElMessageBox.confirm('您是否确认退出登录?', '温馨提示', {
|
||||
|
@ -3,24 +3,24 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2023-06-20 14:29:45
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-04-11 11:05:55
|
||||
* @LastEditTime: 2025-02-13 16:04:43
|
||||
-->
|
||||
<template>
|
||||
<div class="logo">
|
||||
<img :src="getAssetsFile('images/logo.png')" class="logo-picture" />
|
||||
<h2 v-show="!isCollapse" class="logo-title">政务服务</h2>
|
||||
<!-- <img src="/images/logo.png" class="logo-picture" /> -->
|
||||
<h2 v-show="!isCollapse" class="logo-title">{{ VITE_APP_TITLE }}</h2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="logo">
|
||||
import { getAssetsFile } from '@/utils';
|
||||
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
isCollapse: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const { VITE_APP_TITLE } = import.meta.env;
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -35,13 +35,13 @@ const props = defineProps({
|
||||
@include flex-row;
|
||||
&-picture {
|
||||
margin: 0 auto;
|
||||
width: 70px;
|
||||
height: 35px;
|
||||
}
|
||||
&-title {
|
||||
padding-right: 20px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
color: $color-333;
|
||||
color: $color-primary;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -6,8 +6,8 @@
|
||||
* @LastEditTime: 2024-04-12 21:12:01
|
||||
-->
|
||||
<template>
|
||||
<el-icon v-if="icon.includes('icon') && icon !== ''" :class="`iconfont ${icon}`" :size="size" />
|
||||
<el-icon v-if="!icon.includes('icon') && icon !== ''" :size="size"> <component :is="icon" /></el-icon>
|
||||
<el-icon v-if="icon.includes('icon')" :class="`iconfont ${icon}`" :size="size" />
|
||||
<el-icon v-else :size="size"> <component :is="icon" /></el-icon>
|
||||
</template>
|
||||
<script setup name="layout-icon">
|
||||
defineProps({
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2024-01-27 20:01:45
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-04-11 10:56:12
|
||||
* @LastEditTime: 2024-03-30 14:32:07
|
||||
-->
|
||||
<template>
|
||||
<div class="layout-sider" :class="{ 'has-logo': themeConfig.showLogo }">
|
||||
|
@ -7,12 +7,12 @@ export default {
|
||||
redirect: '/sub-government-affairs-service/produceGoods',
|
||||
meta: { title: '产出品', icon: 'Document' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-government-affairs-service/produceGoods',
|
||||
name: 'produceGoods',
|
||||
component: () => import('@/views/produceGoods/list/index.vue'),
|
||||
meta: { title: '产出品列表', icon: 'Document' },
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/produceGoods',
|
||||
// name: 'produceGoods',
|
||||
// component: () => import('@/views/produceGoods/list/index.vue'),
|
||||
// meta: { title: '产出品列表', icon: 'Document' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/produceGoods1',
|
||||
// name: 'produceGoods1',
|
||||
|
@ -32,25 +32,25 @@ export default [
|
||||
name: 'system-dept',
|
||||
meta: { title: '部门管理', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/system-role',
|
||||
component: () => import('@/views/system/role/index.vue'),
|
||||
name: 'system-role',
|
||||
meta: { title: '角色管理', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/system-auth-user',
|
||||
component: () => import('@/views/system/role/authUser.vue'),
|
||||
name: 'system-auth-user',
|
||||
meta: { title: '分配用户', icon: '' },
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/system-user',
|
||||
component: () => import('@/views/system/user/index.vue'),
|
||||
name: 'system-user',
|
||||
meta: { title: '用户管理', icon: '' },
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/system-role',
|
||||
// component: () => import('@/views/system/role/index.vue'),
|
||||
// name: 'system-role',
|
||||
// meta: { title: '角色管理', icon: '' },
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/system-auth-user',
|
||||
// component: () => import('@/views/system/role/authUser.vue'),
|
||||
// name: 'system-auth-user',
|
||||
// meta: { title: '分配用户', icon: '' },
|
||||
// hidden: true,
|
||||
// },
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/system-user',
|
||||
// component: () => import('@/views/system/user/index.vue'),
|
||||
// name: 'system-user',
|
||||
// meta: { title: '用户管理', icon: '' },
|
||||
// },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
@ -5,7 +5,7 @@ import { isEmpty, encode, decode } from '@/utils';
|
||||
export const useUserStore = defineStore({
|
||||
id: GenKey('userStore'),
|
||||
state: () => ({
|
||||
token: '',
|
||||
token: null,
|
||||
userInfo: {},
|
||||
currentOrg: null,
|
||||
orgList: [],
|
||||
|
@ -5,7 +5,7 @@
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family: PingFang SC, PingFang SC-Regular;
|
||||
font-family: Avenir, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
background-color: #f5f5f5;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2022-02-23 21:12:37
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-04-08 15:36:24
|
||||
* @LastEditTime: 2025-03-26 10:02:18
|
||||
*/
|
||||
import axios from 'axios';
|
||||
import { ElNotification } from 'element-plus';
|
||||
@ -11,7 +11,7 @@ import router from '@/router';
|
||||
import { isEmpty } from '@/utils';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
const { VITE_APP_BASE_API, VITE_APP_UPLOAD_API } = import.meta.env;
|
||||
const { VITE_APP_BASE_API, VITE_APP_UPLOAD_API, VITE_APP_DICDATA_API } = import.meta.env;
|
||||
|
||||
/**
|
||||
* 创建axios实例
|
||||
@ -55,9 +55,6 @@ publicAxios.interceptors.request.use(async (config) => {
|
||||
config.baseURL = VITE_APP_BASE_API;
|
||||
}
|
||||
}
|
||||
|
||||
config.headers['authorization'] =
|
||||
'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjVlZmMzZTZlLWEwZTUtNDcxYi05YmU5LWI3NDcwNDQxYTUzMCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.cIgRynK84hfjO6YfW206i3UajKRvIkLBmfYmENeVpbFfYc62gPz9gW8Y3JiU5j5s8KxfuxYqbFP16M5WIppXqw';
|
||||
if (UserStore.hasToken()) {
|
||||
config.headers['authorization'] = config.headers['authorization'] ?? UserStore.token;
|
||||
config.headers['cache-control'] = 'no-cache';
|
||||
|
@ -3,9 +3,9 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2022-02-23 21:12:37
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-04-09 09:53:18
|
||||
* @LastEditTime: 2025-04-02 14:21:56
|
||||
*/
|
||||
import lodash, { deburr } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import dayjs from 'dayjs';
|
||||
import { Base64 } from 'js-base64';
|
||||
|
||||
@ -303,7 +303,6 @@ export const getTree = (data, id = 'id', parentId = 'parentId', children = 'chil
|
||||
* @returns
|
||||
*/
|
||||
export const getParentIds = (treeData, targetId, id = 'id', children = 'children') => {
|
||||
if (isEmpty(targetId)) return [];
|
||||
const parentMap = {};
|
||||
function buildParentMap(node, parentId = null) {
|
||||
if (node[id]) {
|
||||
|
@ -24,7 +24,8 @@ router.beforeEach(async (to, from, next) => {
|
||||
|
||||
const userStore = useUserStore();
|
||||
const hasToken = userStore.hasToken();
|
||||
if (!hasToken) {
|
||||
console.log('sub', hasToken);
|
||||
if (hasToken) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' });
|
||||
} else {
|
||||
|
@ -86,28 +86,26 @@ const state = reactive({
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
debugger;
|
||||
state.loading = true;
|
||||
GetEntityList(state.query)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
console.log(res);
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.pageData = {
|
||||
currentPage: current || 1,
|
||||
pageSize: size || 10,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
// state.loading = true;
|
||||
// GetEntityList(state.query)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// const { current, size, total, records } = res.data;
|
||||
// state.data = records;
|
||||
// state.pageData = {
|
||||
// currentPage: current || 1,
|
||||
// pageSize: size || 10,
|
||||
// total: total,
|
||||
// };
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// state.data = [];
|
||||
// })
|
||||
// .finally(() => {
|
||||
// state.loading = false;
|
||||
// });
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
@ -192,9 +192,9 @@ const state = reactive({
|
||||
},
|
||||
inputsData: [
|
||||
{ value: 75, name: '农药使用', type: '投入品', max: 100, unit: '吨' },
|
||||
// { value: 38, name: '农机使用', type: '投入品', max: 100, unit: '台' },
|
||||
{ value: 38, name: '农机使用', type: '投入品', max: 100, unit: '台' },
|
||||
{ value: 74, name: '种源使用', type: '投入品', max: 100, unit: '万吨' },
|
||||
// { value: 55, name: '兽药使用', type: '投入品', max: 100, unit: '千克' },
|
||||
{ value: 55, name: '兽药使用', type: '投入品', max: 100, unit: '千克' },
|
||||
{ value: 65, name: '肥料使用', type: '投入品', max: 100, unit: '吨' },
|
||||
],
|
||||
businessOption: {
|
||||
|
@ -13,7 +13,7 @@
|
||||
<el-icon class="custom-form__uploader__icon"><Plus /></el-icon>
|
||||
</el-upload>
|
||||
<div v-for="(item, i) in attrs_" :key="`attr_${item.uid}`" class="attrs_content__item">
|
||||
<img :src="item.url" @click="handlePreview(i)" />
|
||||
<img :src="item.url" :alt="item.name" @click="handlePreview(i)" />
|
||||
<el-icon v-if="props.type != 'view'" class="clear_btn" @click.stop="handleClearAttr(item.uid)"><CircleCloseFilled /></el-icon>
|
||||
</div>
|
||||
<el-image-viewer v-if="previewShow" :url-list="srcList" :initial-index="index" @close="previewShow = false" />
|
||||
|
@ -7,20 +7,14 @@
|
||||
:min="_numberSet.min"
|
||||
:controls-position="_numberSet.controlsPosition"
|
||||
@change="handleChange"
|
||||
>
|
||||
</el-input-number>
|
||||
></el-input-number>
|
||||
<el-select v-model="data.type" @change="handleChange">
|
||||
<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-option v-for="item in props.options" :key="'custom_' + Date.now() + item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script lang="ts" setup>
|
||||
import { ref, watchEffect } from 'vue';
|
||||
|
||||
const emit = defineEmits(['update:value']);
|
||||
@ -63,12 +57,6 @@ const props = defineProps({
|
||||
return {};
|
||||
},
|
||||
},
|
||||
prop: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return { label: 'label', value: 'value' };
|
||||
},
|
||||
},
|
||||
});
|
||||
const _numberSet = ref({
|
||||
precision: 2,
|
||||
@ -83,9 +71,7 @@ const data = ref({
|
||||
watchEffect(() => {
|
||||
data.value = Object.assign(data.value, props.value);
|
||||
_numberSet.value = Object.assign(_numberSet.value, props.numberSet);
|
||||
if (data.value.num === null) {
|
||||
data.value.num = _numberSet.value.min;
|
||||
}
|
||||
console.log('_numberSet.value', _numberSet.value);
|
||||
});
|
||||
function handleChange() {
|
||||
emit('update:value', data.value);
|
||||
|
@ -3,13 +3,11 @@
|
||||
<h2>企业经销商抽检</h2>
|
||||
<br />
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:search="searchCondition"
|
||||
v-model:page="pageData"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:option="option"
|
||||
:loading="_loading"
|
||||
:before-close="handleCloseDialog"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
getData(1);
|
||||
@ -17,14 +15,13 @@
|
||||
}
|
||||
"
|
||||
@search-reset="() => getData(1)"
|
||||
@refresh-change="getData"
|
||||
@current-change="getData"
|
||||
@size-change="getData"
|
||||
@row-save="handleRowSave"
|
||||
@row-update="handleRowUpdate"
|
||||
>
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="actions" :data="scope" />
|
||||
<template #menu="{ row }">
|
||||
<el-button type="primary">详情</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</section>
|
||||
@ -32,32 +29,27 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { CRUD_OPTIONS, pageData, customRules } from '@/config';
|
||||
import inputSuppliesApi from '@/apis/inputSuppliesApi';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { add, get } from 'lodash';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
|
||||
const { getEnterpriseDealerCheck, addEnterpriseDealerCheck, delEnterpriseDealerCheck, editEnterpriseDealerCheck, enterpriseDealerCheckRegister } =
|
||||
inputSuppliesApi;
|
||||
onMounted(getData);
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
const crudRef = ref();
|
||||
|
||||
const _loading = ref(false);
|
||||
const searchCondition = ref({
|
||||
keywords: '',
|
||||
riskId: '',
|
||||
});
|
||||
const basicInfo = ref(true);
|
||||
const tableData = ref([]);
|
||||
const pageData = ref({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
});
|
||||
const data = ref([]);
|
||||
const option = reactive({
|
||||
...CRUD_OPTIONS,
|
||||
selection: false,
|
||||
updateBtnText: '确定',
|
||||
addTitle: '新增巡查任务',
|
||||
editTitle: '编辑巡查任务',
|
||||
showOverflowTooltip: true,
|
||||
refreshBtn: false,
|
||||
column: [
|
||||
{
|
||||
hide: true,
|
||||
@ -65,196 +57,87 @@ const option = reactive({
|
||||
label: '关键字',
|
||||
prop: 'keywords',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
_groupKey: 'basicInfo',
|
||||
_change: -1,
|
||||
label: '任务编号',
|
||||
prop: 'riskId',
|
||||
editDisabled: true,
|
||||
rules: customRules({ msg: '请输入任务编号' }),
|
||||
prop: 'taskNum',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择任务类型',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
_groupKey: 'basicInfo',
|
||||
label: '创建时间',
|
||||
_change: -1,
|
||||
prop: 'createTime',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
editDisabled: true,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
_groupKey: 'basicInfo',
|
||||
label: '企业名称',
|
||||
prop: 'companyName',
|
||||
rules: customRules({ msg: '请输入企业名称' }),
|
||||
},
|
||||
{
|
||||
hide: true,
|
||||
_groupKey: 'basicInfo',
|
||||
label: '地址',
|
||||
prop: 'address',
|
||||
rules: customRules({ mag: '请输入地址' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'basicInfo',
|
||||
label: '企业法人',
|
||||
prop: 'enterPerson',
|
||||
rules: customRules({ msg: '请输入企业法人名称' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'basicInfo',
|
||||
label: '联系电话',
|
||||
prop: 'phone',
|
||||
width: 120,
|
||||
rules: customRules({ msg: '请输入联系电话' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'basicInfo',
|
||||
label: '任务类型',
|
||||
prop: 'riskType',
|
||||
prop: 'taskType',
|
||||
type: 'select',
|
||||
clearable: false,
|
||||
width: 120,
|
||||
render: ({ row }) => {
|
||||
return row.riskType == '0' ? '直接创建' : '民众投诉';
|
||||
return row.taskType == '0' ? '直接创建' : '民众投诉';
|
||||
},
|
||||
value: '0',
|
||||
dicData: [
|
||||
{ label: '直接创建', value: '0' },
|
||||
{ label: '民众投诉', value: '1' },
|
||||
],
|
||||
rules: customRules({ msg: '请选择任务类型' }),
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择任务类型',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
hide: true,
|
||||
_groupKey: 'basicInfo',
|
||||
label: '投诉信息',
|
||||
prop: 'complaintInfo',
|
||||
span: 24,
|
||||
type: 'textarea',
|
||||
label: '企业名称',
|
||||
prop: 'enterpriseName',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择任务类型',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '企业法人',
|
||||
prop: 'enterpriseOwner',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择任务类型',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '联系电话',
|
||||
prop: 'phone',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择任务类型',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
render: ({ row }) => (row.status == '0' ? '进行中' : '结束'),
|
||||
},
|
||||
{
|
||||
_groupKey: 'checkInfo',
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
label: '巡查单位',
|
||||
prop: 'inspectUnit',
|
||||
rules: customRules({ msg: '请输入巡查单位' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'checkInfo',
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
label: '巡查部门',
|
||||
prop: 'inspectDept',
|
||||
rules: customRules({ msg: '请输入巡查部门' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'checkInfo',
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
label: '巡查人',
|
||||
prop: 'inspector',
|
||||
rules: customRules({ msg: '请输入巡查人' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'checkInfo',
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
label: '巡查时间',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
prop: 'inspectTime',
|
||||
rules: customRules({ msg: '请输入巡查时间' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'checkInfo',
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
label: '抽样产品',
|
||||
prop: 'checkProducts',
|
||||
rules: customRules({ msg: '请输入抽样产品' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'checkInfo',
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
label: '是否违规',
|
||||
type: 'select',
|
||||
prop: 'isViolation',
|
||||
dicData: [
|
||||
{ label: '否', value: '0' },
|
||||
{ label: '是', value: '1' },
|
||||
render: ({ row }) => {
|
||||
return row.status == '0' ? '未完成' : '已完成';
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择任务类型',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
value: '0',
|
||||
rules: customRules({ msg: '请输入任务编号' }),
|
||||
},
|
||||
{
|
||||
_groupKey: 'checkInfo',
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
span: 24,
|
||||
},
|
||||
],
|
||||
});
|
||||
const actions = reactive([
|
||||
{
|
||||
name: '详情',
|
||||
icon: 'view',
|
||||
event: ({ row }) => {
|
||||
handleCheckRegister(0);
|
||||
crudRef.value.rowView(row);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => {
|
||||
basicInfo.value = true;
|
||||
crudRef.value.rowEdit(row);
|
||||
},
|
||||
},
|
||||
{
|
||||
auth: ({ row }) => row.status == 0,
|
||||
name: '检查登记',
|
||||
icon: 'check',
|
||||
event: ({ row }) => {
|
||||
option.editTitle = '巡查登记';
|
||||
basicInfo.value = false;
|
||||
handleCheckRegister(2);
|
||||
crudRef.value.rowEdit(row);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => row,
|
||||
},
|
||||
]);
|
||||
|
||||
// #endregion
|
||||
|
||||
@ -263,68 +146,39 @@ const actions = reactive([
|
||||
async function getData(resetPage) {
|
||||
resetPage === 1 && (pageData.value.currentPage = 1);
|
||||
_loading.value = true;
|
||||
let params = {
|
||||
current: pageData.value.currentPage,
|
||||
size: pageData.value.pageSize,
|
||||
companyName: searchCondition.value.keywords,
|
||||
};
|
||||
|
||||
let res = await getEnterpriseDealerCheck(params);
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data.records;
|
||||
pageData.value.total = res.data.total;
|
||||
let params = Object.assign(
|
||||
{
|
||||
currentPage: pageData.value.currentPage,
|
||||
size: pageData.value.pageSize,
|
||||
},
|
||||
searchCondition.value
|
||||
);
|
||||
console.log('params', params);
|
||||
for (let i = 0; i < 14; i++) {
|
||||
data.value.push({
|
||||
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;
|
||||
}
|
||||
function handleData(row = {}) {
|
||||
let _data = {};
|
||||
let basic = ['riskId', 'enterPerson', 'companyName', 'address', 'phone', 'riskType', 'complaintInfo'];
|
||||
let check = ['riskId', 'inspectUnit', 'inspectDept', 'inspector', 'inspectTime', 'isViolation', 'remark'];
|
||||
(basicInfo.value ? basic : check).forEach((v) => (_data[v] = row[v] ?? null));
|
||||
console.log('_data here', _data);
|
||||
return _data;
|
||||
}
|
||||
async function handleRowSave(row, done, loading) {
|
||||
let res = await addEnterpriseDealerCheck(handleData(row));
|
||||
|
||||
function handleRowSave(row, done, loading) {
|
||||
console.log('row', row);
|
||||
loading();
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('保存成功');
|
||||
getData();
|
||||
}
|
||||
done();
|
||||
}
|
||||
async function handleRowUpdate(row, index, done, loading) {
|
||||
let data = handleData(row);
|
||||
let res;
|
||||
if (basicInfo.value) {
|
||||
res = await editEnterpriseDealerCheck(data);
|
||||
} else {
|
||||
res = await enterpriseDealerCheckRegister(data);
|
||||
}
|
||||
function handleRowUpdate(row, index, done, loading) {
|
||||
console.log('row', row);
|
||||
loading();
|
||||
if (res.code == 200) {
|
||||
ElMessage.success(`${basicInfo.value ? '修改' : '登记'}成功`);
|
||||
getData();
|
||||
}
|
||||
done();
|
||||
}
|
||||
function handleCloseDialog(done) {
|
||||
basicInfo.value = true;
|
||||
option.editTitle = '编辑巡查任务';
|
||||
handleCheckRegister(1);
|
||||
done();
|
||||
}
|
||||
function handleCheckRegister(t = 0) {
|
||||
option.column.forEach((v) => {
|
||||
if (v._groupKey == 'basicInfo') {
|
||||
v.viewDisplay = t < 2 ? true : false;
|
||||
v.editDisplay = t == 1;
|
||||
}
|
||||
if (v._groupKey == 'checkInfo') {
|
||||
v.editDisplay = t == 2;
|
||||
v.viewDisplay = t == 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
@ -81,7 +81,7 @@ export function useBasicInfo(set = {}) {
|
||||
}
|
||||
}
|
||||
/* 获取标签的名字 */
|
||||
function targetName(arr, ids, _name = '') {
|
||||
function targetName(arr, ids, _name) {
|
||||
let name = '';
|
||||
if (!arr || !arr.length || ids.length < 1) {
|
||||
return name;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section class="custom-page"> 投入品资源一张图 </section>
|
||||
<section class="custom-page">投入品资源一张图</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
@ -6,7 +6,7 @@
|
||||
ref="crudRef"
|
||||
v-model:search="searchCondition"
|
||||
v-model:page="pageData"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:option="option"
|
||||
:table-loading="_loading"
|
||||
:before-close="handleDialogClose"
|
||||
@ -17,7 +17,6 @@
|
||||
}
|
||||
"
|
||||
@search-reset="() => getData(1)"
|
||||
@refresh-change="getData"
|
||||
@current-change="getData"
|
||||
@size-change="getData"
|
||||
@row-save="handleRowSave"
|
||||
@ -56,10 +55,11 @@ const pageData = ref({
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
});
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const option = reactive({
|
||||
...CRUD_OPTIONS,
|
||||
selection: false,
|
||||
refreshBtn: false,
|
||||
dialogWidth: '50%',
|
||||
column: [
|
||||
{
|
||||
@ -195,7 +195,7 @@ async function getData(resetPage) {
|
||||
let res = await inputSuppliesApi.getLeaseSuperviseList(params);
|
||||
_loading.value = false;
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data.records.map((v) => {
|
||||
data.value = res.data.records.map((v) => {
|
||||
let d = leaseDate(v.startEndTime);
|
||||
let obj = {
|
||||
...v,
|
||||
|
@ -9,7 +9,7 @@
|
||||
v-model:search="searchCondition"
|
||||
:table-loading="_loading"
|
||||
:before-close="handleCloseDialog"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:option="option"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
@ -140,7 +140,7 @@ const subsidy = reactive([
|
||||
value: '0',
|
||||
},
|
||||
]);
|
||||
const tableData = ref([{}]);
|
||||
const data = ref([{}]);
|
||||
const option = ref({
|
||||
...CRUD_OPTIONS,
|
||||
dialogWidth: '50%',
|
||||
@ -441,7 +441,7 @@ async function getData(reset) {
|
||||
let res = await getMachineryList(params);
|
||||
_loading.value = false;
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data.records;
|
||||
data.value = res.data.records;
|
||||
pageData.value.total = res.data.total;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
ref="crud"
|
||||
v-model:page="pageData"
|
||||
v-model:search="searchCondition"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:table-loading="_loading"
|
||||
:option="option"
|
||||
:before-close="handleCloseDialog"
|
||||
@ -85,7 +85,7 @@ watch(
|
||||
|
||||
const crud = ref();
|
||||
const _loading = ref(false);
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const searchCondition = ref({
|
||||
keywords: '',
|
||||
});
|
||||
@ -236,7 +236,7 @@ async function getData(reset) {
|
||||
let res = await getFertilizreList(params);
|
||||
_loading.value = false;
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data.records.map((v) => {
|
||||
data.value = res.data.records.map((v) => {
|
||||
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.produceDosage = handleShowName(v.produceDosage);
|
||||
|
@ -8,7 +8,7 @@
|
||||
v-model:page="pageData"
|
||||
v-model:search="searchCondition"
|
||||
:table-loading="_loading"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:option="option"
|
||||
:before-close="handleCloseDialog"
|
||||
@search-change="
|
||||
@ -63,7 +63,7 @@ import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo';
|
||||
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
|
||||
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
|
||||
import inputSuppliesApi from '@/apis/inputSuppliesApi';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
|
||||
const { deleteFn } = new assistFn();
|
||||
|
||||
@ -88,7 +88,7 @@ const searchCondition = ref({
|
||||
});
|
||||
const crud = ref();
|
||||
const _loading = ref(true);
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const pageData = ref({
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
@ -456,8 +456,8 @@ async function getData(reset) {
|
||||
console.log('res --- ', res);
|
||||
_loading.value = false;
|
||||
if (res && res.code === 200) {
|
||||
tableData.value = res.data.records;
|
||||
tableData.value.forEach((v) => {
|
||||
data.value = res.data.records;
|
||||
data.value.forEach((v) => {
|
||||
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.targetPests = handleShowName(v.targetPests);
|
||||
|
@ -8,7 +8,7 @@
|
||||
v-model:page="pageData"
|
||||
v-model:search="searchCondition"
|
||||
:table-loading="_loading"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:option="option"
|
||||
:before-close="handleCloseDialog"
|
||||
@search-change="
|
||||
@ -68,7 +68,7 @@ const searchCondition = ref({
|
||||
});
|
||||
const crud = ref();
|
||||
const _loading = ref(true);
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const pageData = ref({
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
@ -229,8 +229,8 @@ async function getData(reset) {
|
||||
let res = await getAnimalMedicineList(params);
|
||||
_loading.value = false;
|
||||
if (res && res.code === 200) {
|
||||
tableData.value = res.data.records;
|
||||
tableData.value.forEach((v) => {
|
||||
data.value = res.data.records;
|
||||
data.value.forEach((v) => {
|
||||
v.productSpecification = handleNumUnit({ num1: v.productSpecification, unit1: v.productUnit, type: 1 });
|
||||
v.produceDosage = handleShowName(v.produceDosage);
|
||||
});
|
||||
|
@ -9,7 +9,7 @@
|
||||
v-model:search="searchCondition"
|
||||
:table-loading="_loading"
|
||||
:before-close="handleCloseDialog"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:option="option"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
@ -27,9 +27,7 @@
|
||||
<el-button type="primary" @click="handleInfo(row)">详情</el-button>
|
||||
<el-button @click="deleteFn(row.id, delSeed, getData)">删除</el-button>
|
||||
</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>
|
||||
</section>
|
||||
</template>
|
||||
@ -72,7 +70,7 @@ const _loading = ref(true);
|
||||
const searchCondition = ref({
|
||||
keywords: '',
|
||||
});
|
||||
const tableData = ref([]);
|
||||
const data = ref([]);
|
||||
const option = ref({
|
||||
...CRUD_OPTIONS,
|
||||
selection: false,
|
||||
@ -191,7 +189,7 @@ async function getData(reset) {
|
||||
if (_type.value != '0') params['classifyId'] = _type.value;
|
||||
let res = await getSeedList(params);
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data.records ?? [];
|
||||
data.value = res.data.records ?? [];
|
||||
pageData.value.total = res.data.total;
|
||||
}
|
||||
_loading.value = false;
|
||||
|
@ -0,0 +1,58 @@
|
||||
<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>
|
@ -0,0 +1,197 @@
|
||||
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,66 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="Tips" width="500" draggable>
|
||||
<avue-radio v-model="radio" :dic="radioDic" :button="true" class="top_radio"></avue-radio>
|
||||
<br />
|
||||
<avue-form v-model="data" :option="option"> </avue-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="visible = false"> Confirm </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, defineExpose, reactive, onMounted } from 'vue';
|
||||
import { customRules } from '@/config';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const data = ref({});
|
||||
const visible = ref(false);
|
||||
const radio = ref('1');
|
||||
const radioDic = reactive([
|
||||
{ label: '执法消息', value: '1' },
|
||||
{ label: '被询问人信息', value: '2' },
|
||||
{ label: '询问内容', value: '3' },
|
||||
]);
|
||||
const option = reactive({
|
||||
column: [
|
||||
{
|
||||
label: '询问时间',
|
||||
prop: 'time',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||||
span: 24,
|
||||
disabled: true,
|
||||
},
|
||||
{ label: '询问地点', prop: 'address', span: 24 },
|
||||
{ label: '询问机关', prop: 'unit', span: 24 },
|
||||
{ label: '询问人', prop: 'person', span: 24 },
|
||||
{ label: '记录人', prop: 'recordPerson', span: 24 },
|
||||
],
|
||||
});
|
||||
|
||||
function handleRecordOpen(obj = {}) {
|
||||
visible.value = Object.keys(obj).length ? true : false;
|
||||
if (visible.value) {
|
||||
data.value = Object.assign({}, obj);
|
||||
option.column[0].value = dayjs().format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
console.log('dayjs', dayjs().format('YYYY-MM-DD HH-mm'));
|
||||
option.column[0].value = dayjs().format('YYYY-MM-DD HH:mm');
|
||||
});
|
||||
defineExpose({
|
||||
handleRecordOpen,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.top_radio {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
@ -1,354 +1,19 @@
|
||||
<template>
|
||||
<section class="custom-page">
|
||||
<avue-crud ref="crudRef" v-model:search="searchCondition" v-model:page="pageData" :data="data" :option="option">
|
||||
<template #menu="scpoe">
|
||||
<custom-table-operate :actions="actions" :data="scpoe" />
|
||||
</template>
|
||||
<template #sceneProof-form="{ row, type }">
|
||||
<section class="proof_content_">
|
||||
<span v-if="type == 'add'">(照片、视频)</span>
|
||||
<Attrs v-model:attrs="examineForm.proof" :type="type" :limit="5" :file-num="5" accept="image/*,video/*" />
|
||||
</section>
|
||||
</template>
|
||||
<template #documentAttrs-form="{ row, type }">
|
||||
<FileUpload v-model:attrs="examineForm.documentAttrs" :format="['rar', 'zip', 'doc', 'docx', 'pdf']" :type="type" />
|
||||
</template>
|
||||
<template #c2-form="{ type }">
|
||||
<section class="record_content">
|
||||
<FileUpload v-model:attrs="examineForm.documentAttrs" :type="type" />
|
||||
<span>填写笔录</span>
|
||||
</section>
|
||||
</template>
|
||||
</avue-crud>
|
||||
<RecordModal ref="recordModalRef" />
|
||||
</section>
|
||||
<section class="custom-page">巡查与案件</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch } from 'vue';
|
||||
import { getRegion as GetRegion } from '@/apis';
|
||||
import { GetEntityList as GetUserList } from '@/apis/system/user';
|
||||
import { GetEntityList as GetDict } from '@/apis/system/dict';
|
||||
import { CRUD_OPTIONS, pageData, customRules } from '@/config';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import FileUpload from '@/views/landManage/component/illegalHandle/common/FileUpload.vue';
|
||||
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
|
||||
import RecordModal from './common/RecordModal.vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const UserStore = useUserStore();
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
onMounted(() => {
|
||||
getRegion();
|
||||
getMumber();
|
||||
});
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
const regionData = ref([]);
|
||||
const memberData = ref([]);
|
||||
const crudRef = ref(null);
|
||||
const searchCondition = reactive({
|
||||
keyword: '',
|
||||
});
|
||||
const data = ref([{}]);
|
||||
const option = reactive({
|
||||
...CRUD_OPTIONS,
|
||||
selection: false,
|
||||
dialogWidth: '50%',
|
||||
column: [
|
||||
{
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '任务编号',
|
||||
prop: 'text1',
|
||||
},
|
||||
{
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '任务名称',
|
||||
prop: 'text2',
|
||||
},
|
||||
{
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '单位名称',
|
||||
prop: 'text3',
|
||||
},
|
||||
{
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '统一社会信用代码',
|
||||
prop: 'text4',
|
||||
},
|
||||
{
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '法定代表人',
|
||||
prop: 'text5',
|
||||
},
|
||||
{
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '联系电话',
|
||||
prop: 'text6',
|
||||
},
|
||||
{
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '区域',
|
||||
prop: 'text7',
|
||||
},
|
||||
],
|
||||
group: [
|
||||
{
|
||||
label: '任务信息',
|
||||
prop: 'taskInfo',
|
||||
column: [
|
||||
{
|
||||
label: '任务名称',
|
||||
prop: 'taskName',
|
||||
},
|
||||
{
|
||||
label: '任务编号',
|
||||
prop: 'taskNumber',
|
||||
},
|
||||
{
|
||||
label: '任务巡查时限',
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
prop: 'taskTime',
|
||||
},
|
||||
{
|
||||
label: '任务巡查类型',
|
||||
prop: 'taskType',
|
||||
type: 'select',
|
||||
value: '1',
|
||||
clearable: false,
|
||||
dicData: [
|
||||
{
|
||||
label: '指定事项巡查',
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
label: '定期巡查',
|
||||
value: '2',
|
||||
},
|
||||
{
|
||||
label: '全面巡查',
|
||||
value: '3',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '执法区域',
|
||||
prop: 'region',
|
||||
type: 'cascader',
|
||||
dicData: [],
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '小组成员',
|
||||
prop: 'groupMember',
|
||||
type: 'select',
|
||||
dicData: [],
|
||||
multiple: true,
|
||||
props: {
|
||||
label: 'nickName',
|
||||
value: 'userId',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '执法对象',
|
||||
prop: 'checkObject',
|
||||
column: [
|
||||
{
|
||||
label: '单位名称',
|
||||
prop: 'b1',
|
||||
},
|
||||
{
|
||||
label: '社会统一信用代码',
|
||||
prop: 'b2',
|
||||
},
|
||||
{
|
||||
label: '法定代表人',
|
||||
prop: 'b3',
|
||||
},
|
||||
{
|
||||
label: '联系电话',
|
||||
prop: 'phone',
|
||||
},
|
||||
{
|
||||
label: '所在区域',
|
||||
prop: 'region1',
|
||||
type: 'cascader',
|
||||
dicData: [],
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'addressDetail',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '登记核查信息',
|
||||
prop: 'registerCheckInfo',
|
||||
column: [
|
||||
{
|
||||
label: '案情记录',
|
||||
prop: 'record',
|
||||
span: 24,
|
||||
type: 'textarea',
|
||||
},
|
||||
{
|
||||
label: '现场取证',
|
||||
prop: 'sceneProof',
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: '执法文书',
|
||||
prop: 'c1',
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
prop: 'documentAttrs',
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: '巡查笔录',
|
||||
prop: 'c2',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '案件处理',
|
||||
prop: '_caseResult',
|
||||
column: [
|
||||
{
|
||||
label: '案件处理结果',
|
||||
prop: 'caseResult',
|
||||
span: 24,
|
||||
type: 'radio',
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_law_case_result',
|
||||
current: 1,
|
||||
size: 9999,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicFormatter: (res) => res?.data?.records ?? [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
const actions = reactive([
|
||||
{
|
||||
name: '详情',
|
||||
icon: 'view',
|
||||
event: ({ row }) => {},
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => {
|
||||
crudRef.value.rowEdit(row);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '登记核查信息',
|
||||
icon: 'clock',
|
||||
event: ({ row }) => {
|
||||
option.group[0].editDisplay = false;
|
||||
option.group[1].column.forEach((v) => (v.editDisabled = true));
|
||||
crudRef.value.rowEdit(row);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => {},
|
||||
},
|
||||
]);
|
||||
const examineForm = reactive({
|
||||
caseId: '',
|
||||
proof: [],
|
||||
documentAttrs: [],
|
||||
});
|
||||
watch(
|
||||
() => examineForm,
|
||||
() => {
|
||||
console.log('examineForm', examineForm.attrs);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
const recordModalRef = ref(null);
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
async function getRegion() {
|
||||
let res = await GetRegion();
|
||||
if (res.code == 200) {
|
||||
regionData.value = res?.data ?? [];
|
||||
option.group[0].column[4].dicData = regionData.value;
|
||||
option.group[1].column[4].dicData = regionData.value;
|
||||
}
|
||||
}
|
||||
async function getMumber() {
|
||||
let res = await GetUserList({
|
||||
current: 1,
|
||||
size: 99999,
|
||||
deptId: 105,
|
||||
});
|
||||
if (res.code == 200) {
|
||||
memberData.value = res?.data?.records ?? [];
|
||||
option.group[0].column[5].dicData = memberData.value;
|
||||
console.log('regionData.value', memberData.value);
|
||||
}
|
||||
}
|
||||
async function getDictData(dicType) {
|
||||
let res = await GetDict({
|
||||
current: 1,
|
||||
size: 99999,
|
||||
dictType: dicType,
|
||||
});
|
||||
if (res.code == 200) {
|
||||
option.group[0].column[3].dicData = res?.data?.records ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
// #endregion
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.record_content {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
@ -5,7 +5,7 @@
|
||||
v-model:page="pageData"
|
||||
v-model:search="searchCondition"
|
||||
:table-loading="_loading"
|
||||
:data="tableData"
|
||||
:data="data"
|
||||
:option="option"
|
||||
:before-close="
|
||||
(done) => {
|
||||
@ -68,7 +68,7 @@ const searchCondition = ref({
|
||||
_dealerType: '',
|
||||
keywords: '',
|
||||
});
|
||||
const tableData = ref([{}]);
|
||||
const data = ref([{}]);
|
||||
const option = reactive({
|
||||
...CRUD_OPTIONS,
|
||||
dialogWidth: '50%',
|
||||
@ -339,7 +339,7 @@ async function getData(reset) {
|
||||
};
|
||||
let res = await getProductionDealerList(params);
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data.records;
|
||||
data.value = res.data.records;
|
||||
pageData.value.total = res.data.total;
|
||||
}
|
||||
_loading.value = false;
|
||||
|
@ -6,8 +6,7 @@
|
||||
v-model:page="pageData"
|
||||
:table-loading="_loading"
|
||||
:option="option"
|
||||
:data="tableData"
|
||||
:before-close="(done) => (handleOtherInfo(), done())"
|
||||
:data="data"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
getData(1);
|
||||
@ -21,61 +20,30 @@
|
||||
@row-save="handleRowSave"
|
||||
@row-update="handleRowUpdate"
|
||||
>
|
||||
<!-- <template #land-form="{ type }">
|
||||
<template #land-form="{ type }">
|
||||
<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>
|
||||
</avue-crud>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { CRUD_OPTIONS, pageData, customRules } from '@/config';
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { CRUD_OPTIONS, pageData } from '@/config';
|
||||
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 { deleteFn } = new assistFn();
|
||||
const { getUseSuperviseList, delUseSupervise, addUseSupervise, editUseSupervise } = inputSuppliesApi;
|
||||
const { materialTypes, targetName } = useBasicInfo();
|
||||
const { loadFinish, materialTwoLevel, materialTypes } = useBasicInfo();
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
getUseNumberDict();
|
||||
});
|
||||
/* --------------- tableData --------------- */
|
||||
watch(
|
||||
() => loadFinish.value,
|
||||
(bol) => {
|
||||
if (loadFinish.value) {
|
||||
console.log('material', materialTypes);
|
||||
}
|
||||
}
|
||||
);
|
||||
/* --------------- data --------------- */
|
||||
// #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 _loading = ref(true);
|
||||
const searchCondition = ref({
|
||||
@ -87,7 +55,7 @@ const types = reactive([
|
||||
{ label: '肥料监管', value: '2' },
|
||||
{ label: '兽药监管', value: '3' },
|
||||
]);
|
||||
const tableData = ref([{}]);
|
||||
const data = ref([{}]);
|
||||
const option = ref({
|
||||
...CRUD_OPTIONS,
|
||||
selection: false,
|
||||
@ -120,78 +88,48 @@ const option = ref({
|
||||
clearable: false,
|
||||
value: '1',
|
||||
change: handleTypeChange,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
label: '使用者名称',
|
||||
label: '姓名',
|
||||
prop: 'name',
|
||||
width: 240,
|
||||
rules: customRules({ msg: '请输入名称' }),
|
||||
},
|
||||
{
|
||||
label: '联系方式',
|
||||
prop: 'phone',
|
||||
width: 120,
|
||||
rules: customRules({ msg: '请输入联系方式' }),
|
||||
},
|
||||
{
|
||||
label: '投入品名称',
|
||||
prop: 'inputName',
|
||||
width: 240,
|
||||
rules: customRules({ msg: '请输入投入品名称' }),
|
||||
prop: 'materialName',
|
||||
},
|
||||
{
|
||||
hide: true,
|
||||
label: '分类',
|
||||
prop: '_classifyId',
|
||||
prop: 'type',
|
||||
type: 'cascader',
|
||||
dicData: [],
|
||||
value: [],
|
||||
rules: customRules({ msg: '请选择分类' }),
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '分类',
|
||||
prop: 'classifyName',
|
||||
width: 200,
|
||||
overHidden: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '购买量',
|
||||
prop: 'buyNumber',
|
||||
render: ({ row }) => row.buyNumber + row.buyUnit,
|
||||
prop: 't1',
|
||||
},
|
||||
{
|
||||
label: '购买时间',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 140,
|
||||
prop: 'buyTime',
|
||||
rules: customRules({ msg: '请选择购买时间' }),
|
||||
prop: 't2',
|
||||
},
|
||||
{
|
||||
label: '使用量',
|
||||
prop: 'useNumber',
|
||||
render: ({ row }) => row.useNumber + row.useUnit,
|
||||
prop: 't3',
|
||||
},
|
||||
{
|
||||
label: '使用时间',
|
||||
type: 'date',
|
||||
width: 140,
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
prop: 'useTime',
|
||||
prop: 't4',
|
||||
},
|
||||
{
|
||||
label: '使用对象',
|
||||
prop: 'useObject',
|
||||
prop: 't5',
|
||||
},
|
||||
{
|
||||
label: '关联地块',
|
||||
prop: 'landName',
|
||||
prop: 'land',
|
||||
},
|
||||
],
|
||||
group: [
|
||||
@ -203,169 +141,59 @@ const option = ref({
|
||||
column: [
|
||||
{
|
||||
label: '检测时间',
|
||||
prop: 'detectionTime',
|
||||
prop: 'checkTime',
|
||||
span: 24,
|
||||
type: 'date',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
format: 'yyyy-MM-dd',
|
||||
},
|
||||
{
|
||||
label: '检测结果',
|
||||
prop: 'detectionResult',
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{
|
||||
label: '合格',
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
label: '不合格',
|
||||
value: '1',
|
||||
},
|
||||
],
|
||||
prop: 'result',
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: '投入品名称',
|
||||
prop: 'detectionUnit',
|
||||
prop: 'unit',
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: '检测报告',
|
||||
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
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
async function getUseNumberDict() {
|
||||
let res = await GetEntityList({
|
||||
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 getData(reset = 1) {
|
||||
reset == 1 && (pageData.value.currentPage = 1);
|
||||
console.log('get data');
|
||||
}
|
||||
function handleTypeChange(val) {
|
||||
option.value.group[0].addDisplay = val.value == '1';
|
||||
option.value.group[0].editDisplay = val.value == '1';
|
||||
option.value.group[0].viewDisplay = val.value == '1';
|
||||
typeDictData.value = materialTypes[val.value].filter((v) => v.value != '0') || [];
|
||||
option.value.column[6].dicData = typeDictData.value;
|
||||
console.log(
|
||||
'dicData',
|
||||
materialTypes[val.value].filter((v) => v.value != '0')
|
||||
);
|
||||
option.value.column[6].dicData = materialTypes[val.value].filter((v) => v.value != '0');
|
||||
}
|
||||
function 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;
|
||||
console.log('handleData', val);
|
||||
}
|
||||
async function handleRowSave(row, done, loading) {
|
||||
let data = handleData(row);
|
||||
let res = await addUseSupervise(data);
|
||||
function handleRowSave(row, done, laoding) {
|
||||
handleData(row);
|
||||
laoding();
|
||||
}
|
||||
|
||||
function handleRowUpdate(row, index, done, loading) {
|
||||
handleData(row);
|
||||
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
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-upload ref="upload" :file-list="fileList" class="upload-demo" :limit="props.limit" :auto-upload="false" :on-change="fileChange">
|
||||
<el-button type="primary" :disabled="fileList.length == 5">点击上传</el-button>
|
||||
<template #tip>
|
||||
<div v-if="props.format.length && props.tips" class="el-upload__tip">只能上传{{ props.format.join() }} 文件,且不超过20MB</div>
|
||||
<div v-if="props.format.length" class="el-upload__tip">只能上传{{ props.format.join() }} 文件,且不超过20MB</div>
|
||||
</template>
|
||||
<template #file="{ file }">
|
||||
<section class="file_line">
|
||||
@ -41,10 +41,6 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: 'view',
|
||||
},
|
||||
tips: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
/* --------------- data --------------- */
|
||||
|
@ -422,7 +422,16 @@ const examineForm = reactive({
|
||||
proof: [],
|
||||
attrs: [],
|
||||
});
|
||||
|
||||
watch(
|
||||
() => examineForm,
|
||||
() => {
|
||||
console.log('examineForm', examineForm.attrs);
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
|
@ -37,16 +37,13 @@
|
||||
<el-button type="success" icon="download" @click="handleExport">导出</el-button>
|
||||
<el-button type="success" icon="upload" @click="onUpload">导入</el-button>
|
||||
</template>
|
||||
<template #area-form="{ type }">
|
||||
<section v-show="type != 'view'" class="area_form_">
|
||||
<template #area-form>
|
||||
<section class="area_form_">
|
||||
<el-input-number v-model="landArea" :precision="2" :step="1" :min="1" controls-position="right"></el-input-number>
|
||||
<el-select v-model="unitValue">
|
||||
<el-option v-for="item in unitOptions" :key="'unitOptions_' + item.value" :label="item.label" :value="item.label" />
|
||||
</el-select>
|
||||
</section>
|
||||
<section v-show="type == 'view'">
|
||||
{{ landArea + unitValue }}
|
||||
</section>
|
||||
</template>
|
||||
<template #propertyCertificateUrl-form="{ type }">
|
||||
<Attrs v-model:attrs="attrs" :type="type" />
|
||||
@ -137,7 +134,7 @@ const option = reactive({
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '地块名称',
|
||||
label: '地块名',
|
||||
prop: 'landName',
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
@ -154,13 +151,12 @@ const option = reactive({
|
||||
width: 300,
|
||||
},
|
||||
{
|
||||
label: '经营主体',
|
||||
label: '产权人',
|
||||
prop: 'owner',
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
display: false,
|
||||
editDisplay: false,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
label: '所属网格',
|
||||
@ -273,10 +269,9 @@ const option = reactive({
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
change: handleChangeGrid,
|
||||
},
|
||||
{
|
||||
label: '用地分类',
|
||||
label: '用地分类1',
|
||||
prop: 'landTypeId',
|
||||
type: 'cascader',
|
||||
dicData: landTreeDic,
|
||||
@ -311,14 +306,6 @@ const option = reactive({
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
hide: true,
|
||||
label: '位置',
|
||||
prop: 'address',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '是否土地流转',
|
||||
@ -347,7 +334,7 @@ const option = reactive({
|
||||
prop: 'area',
|
||||
},
|
||||
{
|
||||
label: '经营主体',
|
||||
label: '产权人',
|
||||
prop: 'owner',
|
||||
},
|
||||
{
|
||||
@ -376,11 +363,11 @@ const option = reactive({
|
||||
prop: 'baseGroup',
|
||||
column: [
|
||||
{
|
||||
label: '经营主体姓名',
|
||||
label: '产权人姓名',
|
||||
prop: 'propertyName',
|
||||
},
|
||||
{
|
||||
label: '经营主体联系电话',
|
||||
label: '产权人联系电话',
|
||||
prop: 'propertyPhone',
|
||||
},
|
||||
{
|
||||
@ -489,27 +476,35 @@ async function getList(reset = 1) {
|
||||
v.coordinateView = v.coordinate;
|
||||
v.soilTypeName = v.soilType;
|
||||
v.soilTypeId = v.soilId;
|
||||
v._villageCode = typeof v.villageCode == 'string' ? [v.villageCode] : v.villageCode;
|
||||
v._villageCode = handleArea(v);
|
||||
v.landTypeId = [v.pid, v.landType];
|
||||
console.log('vvv', v);
|
||||
});
|
||||
pageData.value.total = total;
|
||||
}
|
||||
}
|
||||
function handleGetGrid(res) {
|
||||
return res?.data?.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 ?? [];
|
||||
console.log('res', res);
|
||||
return res.records ?? [];
|
||||
}
|
||||
async function handleGetRegion() {
|
||||
let res = await getRegion();
|
||||
if (res.code == 200) {
|
||||
regionData.value = res?.data?.[0].areaChildVOS?.[0].areaChildVOS?.[0].areaChildVOS ?? [];
|
||||
option.group[0].column[5];
|
||||
}
|
||||
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) {
|
||||
pageData.value.pageSize = val;
|
||||
getList();
|
||||
@ -586,7 +581,7 @@ function handleData(val) {
|
||||
data.propertyCertificateUrl = urls.join();
|
||||
data.landCertificateUrl = landOwnerUrls.join();
|
||||
data.landUrl = landUrls.join();
|
||||
data.villageCode = data._villageCode[0];
|
||||
data.villageCode = data._villageCode[data._villageCode.length - 1] || '';
|
||||
data.landTypeId = data.landTypeId[data.landTypeId.length - 1];
|
||||
data.soilType = data.soilTypeId;
|
||||
if (local.value.length != 0) {
|
||||
@ -622,13 +617,14 @@ async function handleRowUpdate(form, index, done, loading) {
|
||||
}
|
||||
|
||||
async function rowEdit(row) {
|
||||
console.log('rowEdit', row);
|
||||
handleOtherInfo(row);
|
||||
filterArea(row.townCode);
|
||||
crudRef.value.rowEdit(row);
|
||||
}
|
||||
function handleOtherInfo(obj) {
|
||||
landArea.value = obj.area;
|
||||
unitValue.value = obj.landUnit;
|
||||
console.log('option', obj._villageCode, option.group[0].column[4]);
|
||||
if (obj.propertyCertificateUrl) {
|
||||
attrs.value = obj.propertyCertificateUrl.split(',').map((v, i) => {
|
||||
return {
|
||||
|
@ -172,7 +172,7 @@ const state = reactive({
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '种植作物',
|
||||
label: '产物',
|
||||
prop: 'crop',
|
||||
disabled: false,
|
||||
rules: {
|
||||
@ -213,7 +213,7 @@ const state = reactive({
|
||||
},
|
||||
],
|
||||
searchColumn: [
|
||||
{ label: '地块名称', prop: 'landName', search: true },
|
||||
{ label: '地块名', prop: 'landName', search: true },
|
||||
{ label: '种植产物', prop: 'crop', search: true },
|
||||
{
|
||||
label: '作业类型',
|
||||
|
@ -36,8 +36,8 @@
|
||||
type="date"
|
||||
placeholder="请选择种植日期"
|
||||
:disabled-date="disabledDate"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY/MM/DD"
|
||||
value-format="YYYY/MM/DD"
|
||||
:size="size"
|
||||
/>
|
||||
</template>
|
||||
@ -102,7 +102,7 @@ const state = reactive({
|
||||
size: 10,
|
||||
},
|
||||
form: {},
|
||||
selectionRow: [],
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
addBtn: false,
|
||||
@ -110,10 +110,9 @@ const state = reactive({
|
||||
searchSpan: 6,
|
||||
searchGutter: 80,
|
||||
searchMenuPosition: 'center',
|
||||
selection: true,
|
||||
column: [
|
||||
{
|
||||
label: '地块名称',
|
||||
label: '地块名',
|
||||
type: 'input',
|
||||
prop: 'landName',
|
||||
search: true,
|
||||
@ -140,7 +139,7 @@ const state = reactive({
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '经营主体',
|
||||
label: '产权人',
|
||||
type: 'input',
|
||||
prop: 'owner',
|
||||
search: true,
|
||||
@ -331,12 +330,12 @@ const refreshChange = () => {
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selectionRow = rows;
|
||||
console.info('selectionChange', state.selectionRow);
|
||||
state.selection = rows;
|
||||
console.info('selectionChange', state.selection);
|
||||
};
|
||||
|
||||
const handleIds = () => {
|
||||
let datalist = state.selectionRow.map((m) => {
|
||||
let datalist = state.selection.map((m) => {
|
||||
return { landId: m.landId, landName: m.landName };
|
||||
});
|
||||
|
||||
|
@ -111,7 +111,7 @@ const state = reactive({
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '地块名称',
|
||||
label: '地块名',
|
||||
prop: 'landName',
|
||||
width: 200,
|
||||
type: 'select',
|
||||
|
@ -92,7 +92,7 @@ const state = reactive({
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '地块名称',
|
||||
label: '地块名',
|
||||
prop: 'landName',
|
||||
width: 200,
|
||||
addDisplay: false,
|
||||
@ -101,7 +101,7 @@ const state = reactive({
|
||||
overHidden: true,
|
||||
},
|
||||
{
|
||||
label: '地块名称',
|
||||
label: '地块名',
|
||||
prop: 'landId',
|
||||
width: 200,
|
||||
type: 'select',
|
||||
@ -135,7 +135,7 @@ const state = reactive({
|
||||
width: 200,
|
||||
overHidden: true,
|
||||
disabled: true,
|
||||
// labelTip: '请先选择地块!',
|
||||
labelTip: '请先选择地块!',
|
||||
},
|
||||
{
|
||||
label: '区域面积',
|
||||
@ -143,7 +143,7 @@ const state = reactive({
|
||||
width: 150,
|
||||
overHidden: true,
|
||||
disabled: true,
|
||||
// labelTip: '请先选择地块!',
|
||||
labelTip: '请先选择地块!',
|
||||
formatter: (row) => {
|
||||
// const item = state.unitList.find((v) => v.dictValue == row.unit);
|
||||
// return row.area + (!isEmpty(item) ? item.dictLabel : '平方米');
|
||||
|
@ -1,349 +0,0 @@
|
||||
<template>
|
||||
<section class="custom-page">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:search="searchCondition"
|
||||
v-model:page="pageData"
|
||||
:table-loading="_loading"
|
||||
:data
|
||||
:option
|
||||
:before-close="handleCloseDialog"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
getData(1);
|
||||
done();
|
||||
}
|
||||
"
|
||||
@search-reset="() => getData(1)"
|
||||
@refresh-change="getData"
|
||||
@current-change="getData"
|
||||
@size-change="getData"
|
||||
@row-save="handleRowSave"
|
||||
@row-update="handleRowUpdate"
|
||||
>
|
||||
<!-- <template #menu-left>
|
||||
<el-button type="success" @click="handleExport">
|
||||
<el-icon><Download /></el-icon>导出
|
||||
</el-button>
|
||||
</template> -->
|
||||
<template #_quantity-form="{ type, row }">
|
||||
<template v-if="type === 'view'">{{ row.quantity }}{{ row.unit }}</template>
|
||||
<template v-else>
|
||||
<custom-number-select v-model:value="produceNum" :options="numUnitOptions" />
|
||||
</template>
|
||||
</template>
|
||||
<template #marketPrice-form="{ type, row }">
|
||||
<template v-if="type === 'view'">{{ row.priceOptions }}</template>
|
||||
<template v-else>
|
||||
<custom-number-select-double v-model:value="priceData" :options1="priceOptions" :options2="numUnitOptions" />
|
||||
</template>
|
||||
</template>
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, reactive } from 'vue';
|
||||
import { CRUD_OPTIONS, pageData, customRules } from '@/config';
|
||||
import produceGoodsApi from '@/apis/produceGoodsApi';
|
||||
import dayjs from 'dayjs';
|
||||
import { GetEntityList } from '@/apis/system/dict';
|
||||
import { getLandsList } from '@/apis/land';
|
||||
import { ElMessage } from 'element-plus';
|
||||
// import { Download } from '@element-plus/icons-vue';
|
||||
|
||||
const { getProduceList, addProduceGoods, editProduceGoods, delProduceGoods, exportProduceGoods } = produceGoodsApi;
|
||||
onMounted(async () => {
|
||||
await getBusiness();
|
||||
await getLands();
|
||||
await getPriceUnit();
|
||||
await getData();
|
||||
});
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
const crudRef = ref();
|
||||
const _loading = ref(true);
|
||||
const searchCondition = ref({
|
||||
landName: '',
|
||||
quantity: null,
|
||||
qualityGrade: '',
|
||||
});
|
||||
const produceNum = ref({
|
||||
num: 1,
|
||||
type: '公斤',
|
||||
});
|
||||
const numUnitOptions = reactive([
|
||||
{ label: '公斤', value: '公斤' },
|
||||
{ label: '吨', value: '吨' },
|
||||
]);
|
||||
const priceData = ref({
|
||||
num: 1,
|
||||
value1: '1',
|
||||
value2: '公斤',
|
||||
});
|
||||
const priceOptions = ref([]);
|
||||
const lands = ref([]);
|
||||
const produceMain = ref([]);
|
||||
const data = ref([]);
|
||||
const option = ref({
|
||||
...CRUD_OPTIONS,
|
||||
showOverflowTooltip: true,
|
||||
column: [
|
||||
{
|
||||
search: true,
|
||||
label: '地块名称',
|
||||
prop: 'landId',
|
||||
type: 'select',
|
||||
dicData: [],
|
||||
props: {
|
||||
label: 'landName',
|
||||
value: 'id',
|
||||
},
|
||||
rules: customRules({ msg: '请选择地块' }),
|
||||
},
|
||||
{
|
||||
hide: true,
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
label: '亩产',
|
||||
prop: 'quantity',
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{ label: '<30公斤', value: 30 },
|
||||
{ label: '<300公斤', value: 300 },
|
||||
{ label: '<3000公斤', value: 3000 },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '产品名称',
|
||||
prop: 'goodsName',
|
||||
rules: customRules({ msg: '请输入产品名称' }),
|
||||
},
|
||||
{
|
||||
label: '产品描述',
|
||||
prop: 'goodsDesc',
|
||||
},
|
||||
{
|
||||
label: '种植面积',
|
||||
prop: 'area',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '经营主体',
|
||||
prop: 'producerId',
|
||||
dicData: [],
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
type: 'select',
|
||||
rules: customRules({ msg: '请选择经营主体' }),
|
||||
render: ({ row }) => row.producerName,
|
||||
},
|
||||
{
|
||||
label: '生长周期',
|
||||
type: 'number',
|
||||
precision: 1,
|
||||
min: 1,
|
||||
prop: 'growthCycle',
|
||||
suffix: '天',
|
||||
rules: customRules({ msg: '请输入生长周期' }),
|
||||
},
|
||||
{
|
||||
label: '产地',
|
||||
prop: 'originPlace',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '亩产',
|
||||
prop: '_quantity',
|
||||
render: ({ row }) => `${row.quantity}${row.unit}`,
|
||||
},
|
||||
{
|
||||
search: true,
|
||||
label: '质量登记',
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{ label: '一级', value: '1' },
|
||||
{ label: '二级', value: '2' },
|
||||
{ label: '三级', value: '3' },
|
||||
],
|
||||
prop: 'qualityGrade',
|
||||
rules: customRules({ msg: '请选择经营主体' }),
|
||||
},
|
||||
{
|
||||
label: '单价',
|
||||
prop: 'marketPrice',
|
||||
render: ({ row }) => `${row.marketPrice}${row.priceUnit}/${row.weightUnit}`,
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
prop: 'createTime',
|
||||
render: ({ row }) => dayjs(row.createTime).format('YYYY-MM-DD'),
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
],
|
||||
});
|
||||
const actions = reactive([
|
||||
{
|
||||
name: '详情',
|
||||
icon: 'view',
|
||||
event: ({ row }) => {
|
||||
crudRef.value.rowView(row);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => {
|
||||
produceNum.value = {
|
||||
num: row.quantity * 1,
|
||||
type: row.unit,
|
||||
};
|
||||
priceData.value = {
|
||||
num: row.marketPrice * 1,
|
||||
value1: row.priceUnit,
|
||||
value2: row.weightUnit,
|
||||
};
|
||||
crudRef.value.rowEdit(row);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: async ({ row }) => {
|
||||
let res = await delProduceGoods(row.id);
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('删除成功');
|
||||
getData();
|
||||
}
|
||||
},
|
||||
},
|
||||
]);
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
async function getBusiness() {
|
||||
let res = await GetEntityList({
|
||||
dictType: 'sys_business_type',
|
||||
current: 1,
|
||||
size: 999,
|
||||
});
|
||||
if (res.code == 200) {
|
||||
option.value.column[5].dicData = produceMain.value = res.data.records;
|
||||
}
|
||||
}
|
||||
async function getLands() {
|
||||
let res = await getLandsList({
|
||||
current: 1,
|
||||
size: 999,
|
||||
});
|
||||
if (res.code == 200) {
|
||||
option.value.column[0].dicData = lands.value = res.data.records;
|
||||
}
|
||||
}
|
||||
async function getPriceUnit() {
|
||||
let res = await GetEntityList({ dictType: 'sys_price_unit', current: 1, size: 999 });
|
||||
if (res.code == 200) {
|
||||
priceOptions.value = res.data.records
|
||||
.map((v) => {
|
||||
return {
|
||||
label: v.dictLabel,
|
||||
value: v.dictValue,
|
||||
};
|
||||
})
|
||||
.sort((a, b) => a - b);
|
||||
priceData.value.value1 = priceOptions.value[0].value;
|
||||
console.log('priceData', priceData.value);
|
||||
}
|
||||
}
|
||||
async function getData(resetPage) {
|
||||
resetPage === 1 && (pageData.value.currentPage = 1);
|
||||
_loading.value = true;
|
||||
let _data = {
|
||||
current: pageData.value.currentPage,
|
||||
size: pageData.value.pageSize,
|
||||
...searchCondition.value,
|
||||
landName: searchCondition.value.landId,
|
||||
};
|
||||
let res = await getProduceList(_data);
|
||||
if (res.code == 200) {
|
||||
data.value = res.data.records;
|
||||
console.log('data', res);
|
||||
pageData.value.total = res.data.total;
|
||||
}
|
||||
_loading.value = false;
|
||||
}
|
||||
function handleCloseDialog(done) {
|
||||
done();
|
||||
}
|
||||
function handleData(val) {
|
||||
let obj = Object.assign({}, val);
|
||||
let _data = {
|
||||
landId: obj.landId,
|
||||
producerId: obj.producerId,
|
||||
growthCycle: obj.growthCycle,
|
||||
qualityGrade: obj.qualityGrade,
|
||||
goodsName: obj.goodsName,
|
||||
goodsDesc: obj.goodsDesc,
|
||||
plantingId: '0',
|
||||
plantingName: 'test',
|
||||
quantity: produceNum.value.num,
|
||||
unit: produceNum.value.type,
|
||||
marketPrice: priceData.value.num,
|
||||
priceUnit: priceData.value.value1,
|
||||
weightUnit: priceData.value.value2,
|
||||
};
|
||||
_data.landName = lands.value.find((v) => v.id == obj.landId).landName;
|
||||
_data.producerName = produceMain.value.find((v) => v.dictValue == obj.producerId).dictLabel;
|
||||
if (obj.id) _data.id = obj.id;
|
||||
return _data;
|
||||
}
|
||||
async function handleRowSave(row, done, loading) {
|
||||
let res = await addProduceGoods(handleData(row));
|
||||
loading();
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('保存成功');
|
||||
getData();
|
||||
}
|
||||
done();
|
||||
}
|
||||
async function handleRowUpdate(row, index, done, loading) {
|
||||
let res = await editProduceGoods(handleData(row));
|
||||
loading();
|
||||
console.log('res');
|
||||
if (res.code == 200) {
|
||||
ElMessage.success(`编辑成功`);
|
||||
getData();
|
||||
}
|
||||
done();
|
||||
}
|
||||
// async function handleExport() {
|
||||
// let res = await exportProduceGoods();
|
||||
// console.log('res', res);
|
||||
// if (res.status == 200) {
|
||||
// let a = document.createElement('a');
|
||||
// let blob = new Blob([res.data]);
|
||||
// let link = window.URL.createObjectURL(blob);
|
||||
// a.href = link;
|
||||
// a.download = '产出品列表.xlsx';
|
||||
// document.body.appendChild(a);
|
||||
// a.click();
|
||||
// document.body.removeChild(a);
|
||||
// window.URL.revokeObjectURL(link);
|
||||
// }
|
||||
// }
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
@ -1,772 +0,0 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model="state.form"
|
||||
v-model:search="searchCondition"
|
||||
v-model:page="pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="loadData"
|
||||
@search-reset="
|
||||
() => {
|
||||
loadData(1);
|
||||
}
|
||||
"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
loadData(1);
|
||||
done();
|
||||
}
|
||||
"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="loadData"
|
||||
@size-change="loadData"
|
||||
@row-save="rowSave"
|
||||
@row-update="rowUpdate"
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #menu-left>
|
||||
<!-- <el-button type="primary" icon="Upload" @click="onImport">导入</el-button> -->
|
||||
<el-button type="danger" icon="Delete" @click="onBatchDel">批量删除</el-button>
|
||||
</template>
|
||||
<template #businessLicense-form="{ column, value, type }">
|
||||
<Attrs v-model:attrs="attrs" :type="type" :limit="1" />
|
||||
</template>
|
||||
<template #businessPermitUrl-form="{ column, value, type }">
|
||||
<Attrs v-model:attrs="permitUrl" :type="type" :limit="1" />
|
||||
</template>
|
||||
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == '0' || !row.status" type="warning" size="small">待审核</el-tag>
|
||||
<el-tag v-if="row.status == '1'" type="success" size="small">通过</el-tag>
|
||||
<el-tag v-if="row.status == '2'" type="danger" size="small">拒绝</el-tag>
|
||||
</template>
|
||||
<template #idCard="{ row }">
|
||||
<span v-if="row.businessType == 2 || row.businessType == 3">{{ row.unifiedSocialCreditCode }}</span>
|
||||
<span v-else>{{ row.idCard }}</span>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS, pageData } from '@/config';
|
||||
import { isEmpty, downloadFile } from '@/utils';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
import { getBuinessList, saveBuiness, editBuiness, delBuiness } from '@/apis/productOperateMain';
|
||||
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
const crudRef = ref(null);
|
||||
|
||||
const searchCondition = ref({
|
||||
businessType: null,
|
||||
businessId: '',
|
||||
productType: '', //产品类型
|
||||
createStartTime: '',
|
||||
createEndTime: '',
|
||||
primaryProduct: '',
|
||||
});
|
||||
|
||||
// :0->个体,1->村集体,2->合作社,3->企业
|
||||
|
||||
let columnHide = reactive({
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
});
|
||||
|
||||
let typeVal = ref(0);
|
||||
|
||||
let businessType = reactive({
|
||||
label: '主体类型',
|
||||
prop: 'businessType',
|
||||
type: 'radio',
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_type',
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
return (res.data.records ?? []).map((item) => ({
|
||||
...item,
|
||||
dictValue: Number(item.dictValue),
|
||||
}));
|
||||
},
|
||||
});
|
||||
|
||||
const attrs = ref([]);
|
||||
const permitUrl = ref([]);
|
||||
|
||||
const bTypeChange = (val) => {
|
||||
beforeOpen(val);
|
||||
};
|
||||
|
||||
const searchDateChange = (val) => {
|
||||
// console.info('searchDateChange', val);
|
||||
searchCondition.value.createStartTime = val[0] || '';
|
||||
searchCondition.value.createEndTime = val[1] || '';
|
||||
};
|
||||
|
||||
const filterByLevel = (data, maxLevel = 3) => {
|
||||
return data
|
||||
.filter((item) => item.level <= maxLevel) // 筛选当前层符合条件的节点
|
||||
.map((item) => ({
|
||||
...item,
|
||||
areaChildVOS: item.areaChildVOS
|
||||
? filterByLevel(item.areaChildVOS, maxLevel) // 递归处理子节点
|
||||
: [],
|
||||
}));
|
||||
};
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
form: {},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
selection: true,
|
||||
addBtnText: '添加',
|
||||
searchLabelWidth: '150px',
|
||||
searchGutter: 100,
|
||||
searchSpan: 8,
|
||||
searchMenuPosition: 'center',
|
||||
column: [
|
||||
{
|
||||
...businessType,
|
||||
...columnHide,
|
||||
showOverflowTooltip: true,
|
||||
span: 24,
|
||||
type: 'select',
|
||||
},
|
||||
{
|
||||
label: '主体代码',
|
||||
prop: 'id',
|
||||
width: '120px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
search: true,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '主体名称',
|
||||
prop: 'businessName',
|
||||
width: '160px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
search: true,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
type: 'select',
|
||||
width: '120px',
|
||||
remote: false,
|
||||
search: true,
|
||||
...columnHide,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_product_type',
|
||||
current: 1,
|
||||
size: 100,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '主要经营产品',
|
||||
prop: 'primaryProduct',
|
||||
width: '120px',
|
||||
showOverflowTooltip: true,
|
||||
search: false,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '统一信用代码/证件号码',
|
||||
prop: 'idCard',
|
||||
search: false,
|
||||
width: '200px',
|
||||
labelWidth: '160px',
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '规模',
|
||||
prop: 'villageCount',
|
||||
search: false,
|
||||
width: '200px',
|
||||
labelWidth: '160px',
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
prop: 'headName',
|
||||
search: false,
|
||||
width: '200px',
|
||||
labelWidth: '160px',
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '联系地址',
|
||||
prop: 'addressCode',
|
||||
type: 'cascader',
|
||||
checkStrictly: false,
|
||||
width: '200px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
search: true,
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => filterByLevel(res.data ?? []),
|
||||
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
search: false,
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '联系电话',
|
||||
prop: 'phone',
|
||||
width: '160px',
|
||||
search: false,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '审核状态',
|
||||
prop: 'status',
|
||||
width: '80px',
|
||||
...columnHide,
|
||||
search: false,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '审核意见',
|
||||
prop: 'reviewSuggestion',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
width: '200px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{ label: '创建时间', prop: 'createTime', ...columnHide, width: '160px', search: false },
|
||||
],
|
||||
searchColumn: [
|
||||
{
|
||||
...businessType,
|
||||
button: true,
|
||||
searchSpan: 24,
|
||||
},
|
||||
{ label: '主体代码', prop: 'id', search: true },
|
||||
{ label: '主体名称', prop: 'businessName', search: true },
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_product_type',
|
||||
current: 1,
|
||||
size: 100,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
},
|
||||
{
|
||||
label: '创建日期',
|
||||
prop: 'operationDate',
|
||||
type: 'daterange',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
search: true,
|
||||
change: (val) => searchDateChange(val.value),
|
||||
},
|
||||
],
|
||||
group: [
|
||||
{
|
||||
label: '基本信息>',
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '主体名称',
|
||||
prop: 'businessName',
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
...businessType,
|
||||
className: 'el-col-md-24',
|
||||
change: (val) => bTypeChange(val.value),
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
type: 'select',
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_product_type',
|
||||
current: 1,
|
||||
size: 100,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
},
|
||||
{
|
||||
label: '主要产品',
|
||||
prop: 'primaryProduct',
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '规模',
|
||||
prop: 'villageCount',
|
||||
rules: [{ required: false, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '户主身份证号',
|
||||
prop: 'idCard',
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
prop: 'headName',
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '负责人电话',
|
||||
prop: 'phone',
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '联系地址',
|
||||
prop: 'addressCode',
|
||||
type: 'cascader',
|
||||
checkStrictly: false,
|
||||
width: '200px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
search: true,
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => filterByLevel(res.data ?? []),
|
||||
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '营业执照>',
|
||||
prop: 'license1',
|
||||
display: typeVal.value == 2 || typeVal.value == 3 ? true : false,
|
||||
column: [
|
||||
{
|
||||
label: '统一社会信用代码',
|
||||
prop: 'unifiedSocialCreditCode',
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '营业执照',
|
||||
prop: 'businessLicense',
|
||||
hide: true,
|
||||
formslot: true,
|
||||
span: 24,
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '有效期至',
|
||||
prop: 'businessLicenseExpiryDate',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '经营项目',
|
||||
prop: 'businessProject',
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '经营许可证>',
|
||||
prop: 'license2',
|
||||
display: typeVal.value == 2 || typeVal.value == 3 ? true : false,
|
||||
column: [
|
||||
{
|
||||
label: '经营许可证编号',
|
||||
prop: 'businessPermitNumber',
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '经营许可证',
|
||||
prop: 'businessPermitUrl',
|
||||
hide: true,
|
||||
formslot: true,
|
||||
span: 24,
|
||||
rules: [{ required: false, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '有效期至',
|
||||
prop: 'businessPermitExpiryDate',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '审核信息>',
|
||||
prop: 'caseInfo3',
|
||||
addDisplay: false,
|
||||
column: [
|
||||
{
|
||||
label: '是否通过',
|
||||
prop: 'status',
|
||||
span: 24,
|
||||
display: true,
|
||||
type: 'radio',
|
||||
editDisplay: true,
|
||||
addDisplay: false,
|
||||
editDisabled: true,
|
||||
viewDisabled: true,
|
||||
dicData: [
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 0 },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '审核意见',
|
||||
prop: 'reviewSuggestion',
|
||||
type: 'textarea',
|
||||
span: 24,
|
||||
minRows: 3, // 设置最小行数
|
||||
maxRows: 5, // 设置最大行数
|
||||
overHidden: true,
|
||||
editDisabled: true,
|
||||
viewDisabled: true,
|
||||
width: 200,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
name: '详情',
|
||||
icon: 'View',
|
||||
event: ({ row }) => doDetail(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => rowEdit(row),
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => rowDel(row),
|
||||
},
|
||||
],
|
||||
},
|
||||
data: [],
|
||||
currentRow: {},
|
||||
});
|
||||
|
||||
const beforeOpen = (val) => {
|
||||
state.options.group[1].display = state.options.group[2].display = val == 2 || val == 3 ? true : false;
|
||||
setDisplay('villageCount', state.options.group[0].column, val == 2 || val == 3 ? true : false);
|
||||
setDisplay('idCard', state.options.group[0].column, val == 0 ? true : false);
|
||||
// console.info('state.options.group[0].column', state.options.group[0].column);
|
||||
};
|
||||
|
||||
const setDisplay = (field, target, val) => {
|
||||
let index = target.findIndex((m) => {
|
||||
return m.prop == field;
|
||||
});
|
||||
console.info('setDisplay', field);
|
||||
if (index > -1) {
|
||||
target[index].display = val;
|
||||
console.info('target[index].display', target[index].display);
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => searchCondition,
|
||||
(newVal) => {
|
||||
// console.info('searchCondition', searchCondition);
|
||||
let val = newVal.businessType;
|
||||
beforeOpen(val);
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
);
|
||||
// 加载
|
||||
const loadData = (resetPage) => {
|
||||
resetPage === 1 && (pageData.value.currentPage = 1);
|
||||
state.loading = true;
|
||||
let searchParmer = {
|
||||
...searchCondition.value,
|
||||
};
|
||||
|
||||
delete searchParmer.operationDate;
|
||||
let params = Object.assign(
|
||||
{
|
||||
current: pageData.value.currentPage,
|
||||
size: pageData.value.size,
|
||||
},
|
||||
searchParmer
|
||||
);
|
||||
getBuinessList(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.data = state.data.map((m) => {
|
||||
return { ...m, addressCode: [m.provinceCode, m.cityCode, m.countyCode, m.townCode] };
|
||||
});
|
||||
pageData.value.total = res.data.total;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selection = rows;
|
||||
};
|
||||
|
||||
const handleIds = () => {
|
||||
let datalist = state.selection.map((m) => {
|
||||
return { landId: m.landId, landName: m.landName };
|
||||
});
|
||||
|
||||
let selectIdlist = uniqueObjects(datalist, 'landId');
|
||||
let selectIdsVal = selectIdlist.map((n) => {
|
||||
return n.landId;
|
||||
});
|
||||
|
||||
return selectIdsVal.toString() || '';
|
||||
};
|
||||
|
||||
function uniqueObjects(arr, key) {
|
||||
return arr.reduce((acc, current) => {
|
||||
const duplicate = acc.find((element) => element[key] === current[key]);
|
||||
if (!duplicate) {
|
||||
acc.push(current);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
// 新增
|
||||
const rowSave = (row, done, loading) => {
|
||||
let codeList = row.addressCode;
|
||||
let params = {
|
||||
...row,
|
||||
provinceCode: codeList[0] || '',
|
||||
cityCode: codeList[1] || '',
|
||||
countyCode: codeList[2] || '',
|
||||
townCode: codeList[3] || '',
|
||||
businessLicense: getImgUrl(attrs.value),
|
||||
businessPermitUrl: getImgUrl(permitUrl.value),
|
||||
};
|
||||
delete params.addressCode;
|
||||
|
||||
saveBuiness(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('添加成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const rowEdit = (row) => {
|
||||
row.addressCode = [row.provinceCode, row.cityCode, row.countyCode, row.townCode];
|
||||
attrs.value = [row.businessLicense] || [];
|
||||
permitUrl.value = [row.businessPermitUrl] || [];
|
||||
beforeOpen(row.businessType);
|
||||
crudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const doDetail = (row) => {
|
||||
row.addressCode = [row.provinceCode, row.cityCode, row.countyCode, row.townCode];
|
||||
attrs.value = [row.businessLicense] || [];
|
||||
permitUrl.value = [row.businessPermitUrl] || [];
|
||||
beforeOpen(row.businessType);
|
||||
crudRef.value.rowView(row);
|
||||
};
|
||||
const getImgUrl = (data) => {
|
||||
let url = '';
|
||||
if (data && data.length) {
|
||||
url = data.map((m) => {
|
||||
return m.url;
|
||||
});
|
||||
}
|
||||
return url.toString();
|
||||
};
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
// console.info('更新', row.addressCode);
|
||||
let codeList = row.addressCode;
|
||||
let params = {
|
||||
...row,
|
||||
provinceCode: codeList[0] || '',
|
||||
cityCode: codeList[1] || '',
|
||||
countyCode: codeList[2] || '',
|
||||
townCode: codeList[3] || '',
|
||||
};
|
||||
delete params.addressCode;
|
||||
editBuiness(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('更新成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const rowDel = (row, index, done) => {
|
||||
if (isEmpty(row)) return;
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.info('删除', row.id);
|
||||
delBuiness({ businessId: row.id })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('删除成功!');
|
||||
loadData();
|
||||
// done();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
const onBatchDel = () => {
|
||||
let ids = handleIds();
|
||||
if (!ids.length || ids.length <= 0) {
|
||||
app.$message.error('请先选择要删除的数据');
|
||||
return;
|
||||
}
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
delBuiness({ businessId: ids })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('删除成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
</script>
|
@ -3,42 +3,25 @@
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model="state.form"
|
||||
v-model:search="searchCondition"
|
||||
v-model:page="pageData"
|
||||
v-model:search="state.query"
|
||||
v-model:page="state.pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="loadData"
|
||||
@search-reset="
|
||||
() => {
|
||||
loadData(1);
|
||||
}
|
||||
"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
loadData(1);
|
||||
done();
|
||||
}
|
||||
"
|
||||
@refresh-change="refreshChange"
|
||||
@search-reset="searchChange"
|
||||
@search-change="searchChange"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@row-save="rowSave"
|
||||
@row-update="rowUpdate"
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="success" icon="download" @click="onExport">导出</el-button>
|
||||
</template>
|
||||
<template #businessLicense-form="{ column, value, type }">
|
||||
<Attrs v-model:attrs="attrs" :type="'view'" :limit="1" />
|
||||
</template>
|
||||
<template #businessPermitUrl-form="{ column, value, type }">
|
||||
<Attrs v-model:attrs="permitUrl" :type="'view'" :limit="1" />
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == '0' || !row.status" type="warning" size="small">待审核</el-tag>
|
||||
<el-tag v-if="row.status == '1'" type="success" size="small">通过</el-tag>
|
||||
<el-tag v-if="row.status == '2'" type="danger" size="small">拒绝</el-tag>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
@ -48,28 +31,35 @@
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS, pageData } from '@/config';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { isEmpty, downloadFile } from '@/utils';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { getBuinesCheckList, doBusinessCheck, exportBusinessCheck } from '@/apis/productOperateMain';
|
||||
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
|
||||
import {
|
||||
getOperationRecord,
|
||||
saveOperationRecord,
|
||||
editOperationRecord,
|
||||
delOperationRecord,
|
||||
exportOperationRecord,
|
||||
getAddrCropByLand,
|
||||
importOperationRecord,
|
||||
} from '@/apis/land';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
const crudRef = ref(null);
|
||||
|
||||
let typeVal = ref(null);
|
||||
let columnHide = reactive({
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
});
|
||||
const jobTypeOptions = reactive([
|
||||
{ label: '蔬菜', value: '0' },
|
||||
{ label: '水果', value: '1' },
|
||||
]);
|
||||
|
||||
let groupDisabled = reactive({
|
||||
editDisabled: true,
|
||||
viewDisabled: true,
|
||||
});
|
||||
const bTypeOptions = reactive([
|
||||
{ label: '个体', value: '0' },
|
||||
{ label: '村集体', value: '1' },
|
||||
{ label: '合作社', value: '2' },
|
||||
{ label: '企业', value: '3' },
|
||||
]);
|
||||
|
||||
const auditStatusOptions = reactive([
|
||||
{ label: '待审核', value: '0' },
|
||||
@ -77,78 +67,31 @@ const auditStatusOptions = reactive([
|
||||
{ label: '已拒绝', value: '2' },
|
||||
]);
|
||||
|
||||
const searchCondition = ref({
|
||||
businessType: null,
|
||||
businessId: '',
|
||||
productType: '', //产品类型
|
||||
createStartTime: '',
|
||||
createEndTime: '',
|
||||
primaryProduct: '',
|
||||
status: null,
|
||||
});
|
||||
const productTypeOptions = reactive([
|
||||
{ label: '蔬菜', value: '0' },
|
||||
{ label: '水果', value: '1' },
|
||||
]);
|
||||
|
||||
const attrs = ref([]);
|
||||
const permitUrl = ref([]);
|
||||
let bTypeVal = ref('0');
|
||||
const baseColumn = reactive([]);
|
||||
const individualBase = [
|
||||
{ label: '身份证号', prop: 'crop' },
|
||||
{ label: '联系电话', prop: 'crop' },
|
||||
{ label: '联系地址', prop: 'crop' },
|
||||
];
|
||||
|
||||
const filterByLevel = (data, maxLevel = 3) => {
|
||||
return data
|
||||
.filter((item) => item.level <= maxLevel) // 筛选当前层符合条件的节点
|
||||
.map((item) => ({
|
||||
...item,
|
||||
areaChildVOS: item.areaChildVOS
|
||||
? filterByLevel(item.areaChildVOS, maxLevel) // 递归处理子节点
|
||||
: [],
|
||||
}));
|
||||
};
|
||||
const collectiveBase = [
|
||||
{ label: '负责人', prop: 'crop' },
|
||||
{ label: '负责人电话', prop: 'crop' },
|
||||
{ label: '联系地址', prop: 'crop' },
|
||||
];
|
||||
|
||||
const beforeOpen = (val) => {
|
||||
state.options.group[1].display = state.options.group[2].display = val == 2 || val == 3 ? true : false;
|
||||
setDisplay('villageCount', state.options.group[0].column, val == 2 || val == 3 ? true : false);
|
||||
setDisplay('idCard', state.options.group[0].column, val == 0 ? true : false);
|
||||
// console.info('state.options.group[0].column', state.options.group[0].column);
|
||||
};
|
||||
|
||||
const setDisplay = (field, target, val) => {
|
||||
let index = target.findIndex((m) => {
|
||||
return m.prop == field;
|
||||
});
|
||||
console.info('setDisplay', field);
|
||||
if (index > -1) {
|
||||
target[index].display = val;
|
||||
console.info('target[index].display', target[index].display);
|
||||
}
|
||||
};
|
||||
|
||||
let businessType = reactive({
|
||||
label: '主体类型',
|
||||
prop: 'businessType',
|
||||
type: 'radio',
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_type',
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
return (res.data.records ?? []).map((item) => ({
|
||||
...item,
|
||||
dictValue: Number(item.dictValue),
|
||||
}));
|
||||
},
|
||||
});
|
||||
|
||||
const searchDateChange = (val) => {
|
||||
// console.info('searchDateChange', val);
|
||||
searchCondition.value.createStartTime = val[0] || '';
|
||||
searchCondition.value.createEndTime = val[1] || '';
|
||||
};
|
||||
const enterpriseBase = [
|
||||
{ label: '企业规模', prop: 'crop' },
|
||||
{ label: '负责人', prop: 'crop' },
|
||||
{ label: '负责人电话', prop: 'crop' },
|
||||
{ label: '公司地址', prop: 'crop' },
|
||||
];
|
||||
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
@ -166,171 +109,125 @@ const state = reactive({
|
||||
searchSpan: 8,
|
||||
searchGutter: 100,
|
||||
searchMenuPosition: 'center',
|
||||
updateBtnText: '审核',
|
||||
updateBtn: false,
|
||||
column: [
|
||||
{
|
||||
...businessType,
|
||||
...columnHide,
|
||||
showOverflowTooltip: true,
|
||||
span: 24,
|
||||
type: 'select',
|
||||
},
|
||||
{
|
||||
label: '主体代码',
|
||||
prop: 'id',
|
||||
width: '120px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
prop: 'executor',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
search: true,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '主体名称',
|
||||
prop: 'businessName',
|
||||
width: '160px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
prop: 'executor',
|
||||
search: true,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '主体类型',
|
||||
prop: 'BType',
|
||||
type: 'select',
|
||||
remote: false,
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
props: {
|
||||
label: 'landName',
|
||||
value: 'id',
|
||||
},
|
||||
dicData: bTypeOptions,
|
||||
// dicHeaders: {
|
||||
// authorization: UserStore.token,
|
||||
// },
|
||||
// dicUrl: `${VITE_APP_BASE_API}/land-resource/landManage/page?current=1&size=9999&draftsSaveType=0&landName=&gridName=&owner=`,
|
||||
// dicFormatter: (res) => res.data.records ?? [],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择主体类型',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '经营许可证有效期',
|
||||
prop: 'operationDate',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
type: 'select',
|
||||
width: '120px',
|
||||
remote: false,
|
||||
search: true,
|
||||
...columnHide,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_product_type',
|
||||
current: 1,
|
||||
size: 100,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '主要经营产品',
|
||||
prop: 'primaryProduct',
|
||||
width: '120px',
|
||||
showOverflowTooltip: true,
|
||||
search: false,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '统一信用代码/证件号码',
|
||||
prop: 'idCard',
|
||||
search: false,
|
||||
width: '200px',
|
||||
labelWidth: '160px',
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '规模',
|
||||
prop: 'villageCount',
|
||||
search: false,
|
||||
width: '200px',
|
||||
labelWidth: '160px',
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
prop: 'headName',
|
||||
search: false,
|
||||
width: '200px',
|
||||
labelWidth: '160px',
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '联系地址',
|
||||
prop: 'addressCode',
|
||||
type: 'cascader',
|
||||
checkStrictly: false,
|
||||
width: '200px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
search: true,
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
children: 'areaChildVOS',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
{
|
||||
label: '主要产品',
|
||||
prop: 'crop',
|
||||
search: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
dicFormatter: (res) => filterByLevel(res.data ?? []),
|
||||
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
search: false,
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '联系电话',
|
||||
prop: 'phone',
|
||||
width: '160px',
|
||||
search: false,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '审核状态',
|
||||
prop: 'status',
|
||||
width: '80px',
|
||||
...columnHide,
|
||||
prop: 'crop',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
search: false,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '审核意见',
|
||||
prop: 'reviewSuggestion',
|
||||
prop: 'crop',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
width: '200px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
...columnHide,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
},
|
||||
{ label: '创建时间', prop: 'createTime', ...columnHide, width: '160px', search: false },
|
||||
{ label: '审核时间', prop: 'crop', addDisplay: false, editDisplay: false, search: false },
|
||||
{ label: '创建时间', prop: 'crop', addDisplay: false, editDisplay: false, search: false },
|
||||
],
|
||||
searchColumn: [
|
||||
{
|
||||
...businessType,
|
||||
button: true,
|
||||
searchSpan: 24,
|
||||
},
|
||||
{ label: '主体代码', prop: 'id', search: true },
|
||||
{ label: '主体名称', prop: 'businessName', search: true },
|
||||
{ label: '主体代码', prop: 'landName', search: true },
|
||||
{ label: '主体名称', prop: 'crop', search: true },
|
||||
{
|
||||
label: '审核状态',
|
||||
prop: 'status',
|
||||
prop: 'auditStatus',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: auditStatusOptions,
|
||||
},
|
||||
{
|
||||
label: '主体类型',
|
||||
prop: 'operationType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: bTypeOptions,
|
||||
},
|
||||
{
|
||||
label: '创建日期',
|
||||
prop: 'operationDate',
|
||||
@ -339,7 +236,6 @@ const state = reactive({
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
search: true,
|
||||
change: (val) => searchDateChange(val.value),
|
||||
},
|
||||
],
|
||||
group: [
|
||||
@ -348,76 +244,53 @@ const state = reactive({
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '主体名称',
|
||||
prop: 'businessName',
|
||||
...groupDisabled,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
label: '主体代码',
|
||||
prop: 'taskCode',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
...businessType,
|
||||
...groupDisabled,
|
||||
className: 'el-col-md-24',
|
||||
label: '主体名称',
|
||||
prop: 'taskCode',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '主体类型',
|
||||
prop: 'bType',
|
||||
type: 'select',
|
||||
dicData: bTypeOptions,
|
||||
rules: { required: true, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
type: 'select',
|
||||
...groupDisabled,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_product_type',
|
||||
current: 1,
|
||||
size: 100,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
dicData: productTypeOptions,
|
||||
rules: { required: true, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '主要产品',
|
||||
prop: 'primaryProduct',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
prop: 'product',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '规模',
|
||||
prop: 'villageCount',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '户主身份证号',
|
||||
prop: 'idCard',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
label: '合作社规模',
|
||||
prop: 'inspectionType',
|
||||
rules: { required: false, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
prop: 'headName',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
prop: 'inspectionTarget',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '负责人电话',
|
||||
prop: 'phone',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
prop: 'inspectionTarget',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '联系地址',
|
||||
prop: 'addressCode',
|
||||
...groupDisabled,
|
||||
type: 'cascader',
|
||||
checkStrictly: false,
|
||||
width: '200px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
search: true,
|
||||
prop: 'inspectionTarget',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
type: 'select',
|
||||
props: {
|
||||
label: 'areaName',
|
||||
value: 'areaCode',
|
||||
@ -427,108 +300,95 @@ const state = reactive({
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => filterByLevel(res.data ?? []),
|
||||
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
dicFormatter: (res) => res.data ?? [],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
...groupDisabled,
|
||||
rules: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
prop: 'notes',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '营业执照>',
|
||||
prop: 'license1',
|
||||
display: typeVal.value == 2 || typeVal.value == 3 ? true : false,
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '统一社会信用代码',
|
||||
prop: 'unifiedSocialCreditCode',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
prop: 'notes',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '营业执照',
|
||||
prop: 'businessLicense',
|
||||
hide: true,
|
||||
formslot: true,
|
||||
...groupDisabled,
|
||||
span: 24,
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
prop: 'license',
|
||||
},
|
||||
{
|
||||
label: '有效期至',
|
||||
prop: 'businessLicenseExpiryDate',
|
||||
prop: 'operationDate',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
...groupDisabled,
|
||||
width: 200,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '经营项目',
|
||||
prop: 'businessProject',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
prop: 'inspectionSituation',
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '经营许可证>',
|
||||
prop: 'license2',
|
||||
display: typeVal.value == 2 || typeVal.value == 3 ? true : false,
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '经营许可证编号',
|
||||
prop: 'businessPermitNumber',
|
||||
...groupDisabled,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
prop: 'operationType',
|
||||
rules: { required: false, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '经营许可证',
|
||||
prop: 'businessPermitUrl',
|
||||
hide: true,
|
||||
formslot: true,
|
||||
...groupDisabled,
|
||||
span: 24,
|
||||
rules: [{ required: false, message: '请选择', trigger: 'blur' }],
|
||||
prop: 'permit',
|
||||
rules: { required: false, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '有效期至',
|
||||
prop: 'businessPermitExpiryDate',
|
||||
prop: 'operationDate',
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
...groupDisabled,
|
||||
width: 200,
|
||||
rules: [{ required: false, message: '请输入', trigger: 'blur' }],
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '审核信息>',
|
||||
prop: 'caseInfo3',
|
||||
addDisplay: false,
|
||||
label: '审核操作>',
|
||||
prop: 'caseInfo',
|
||||
column: [
|
||||
{
|
||||
label: '是否通过',
|
||||
prop: 'status',
|
||||
prop: 'isIllegal',
|
||||
span: 24,
|
||||
display: true,
|
||||
type: 'radio',
|
||||
editDisplay: true,
|
||||
addDisplay: false,
|
||||
dicData: [
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 0 },
|
||||
{
|
||||
label: '是',
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
label: '否',
|
||||
value: '0',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '审核意见',
|
||||
prop: 'reviewSuggestion',
|
||||
prop: 'note',
|
||||
type: 'textarea',
|
||||
span: 24,
|
||||
minRows: 3, // 设置最小行数
|
||||
@ -557,39 +417,27 @@ const state = reactive({
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = (resetPage) => {
|
||||
resetPage === 1 && (pageData.value.currentPage = 1);
|
||||
state.loading = true;
|
||||
let searchParmer = {
|
||||
...searchCondition.value,
|
||||
};
|
||||
|
||||
delete searchParmer.operationDate;
|
||||
let params = Object.assign(
|
||||
{
|
||||
current: pageData.value.currentPage,
|
||||
size: pageData.value.size,
|
||||
},
|
||||
searchParmer
|
||||
);
|
||||
getBuinesCheckList(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.data = state.data.map((m) => {
|
||||
return { ...m, addressCode: [m.provinceCode, m.cityCode, m.countyCode, m.townCode] };
|
||||
});
|
||||
pageData.value.total = res.data.total;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
const loadData = () => {
|
||||
// state.loading = true;
|
||||
// getOperationRecord(state.query)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// const { current, size, total, records } = res.data;
|
||||
// state.data = records;
|
||||
// state.pageData = {
|
||||
// currentPage: current || 1,
|
||||
// pageSize: size || 10,
|
||||
// total: total,
|
||||
// };
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// state.data = [];
|
||||
// })
|
||||
// .finally(() => {
|
||||
// state.loading = false;
|
||||
// });
|
||||
};
|
||||
|
||||
loadData();
|
||||
@ -647,53 +495,13 @@ function uniqueObjects(arr, key) {
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
|
||||
const onExport = () => {
|
||||
if (isEmpty(state.data)) {
|
||||
app.$message.error('当前暂时没有可供导出的数据!');
|
||||
return;
|
||||
}
|
||||
state.loading = true;
|
||||
const fileName = '经营主体审核列表';
|
||||
exportBusinessCheck(state.query)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
app.$message.success('导出成功!');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error('导出失败!');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
const doExam = (row) => {
|
||||
row.addressCode = [row.provinceCode, row.cityCode, row.countyCode, row.townCode];
|
||||
attrs.value = [row.businessLicense] || [];
|
||||
permitUrl.value = [row.businessPermitUrl] || [];
|
||||
beforeOpen(row.businessType);
|
||||
state.options.updateBtn = !row.status || row.status == 0 ? true : false;
|
||||
// state.options.group[state.options.group.length - 1].column[0].disabled = !row.status || row.status == 0 ? false : true;
|
||||
state.options.group[state.options.group.length - 1].column[1].disabled = !row.status || row.status == 0 ? false : true;
|
||||
crudRef.value && crudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
let params = {
|
||||
checkId: row.checkId || '',
|
||||
businessId: row.id || '',
|
||||
status: row.status,
|
||||
reviewSuggestion: row.reviewSuggestion,
|
||||
};
|
||||
|
||||
// console.info('审核params', params);
|
||||
doBusinessCheck(params)
|
||||
// 新增
|
||||
const rowSave = (row, done, loading) => {
|
||||
// console.info('新增', row);
|
||||
saveOperationRecord(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('审核成功!');
|
||||
app.$message.success('添加成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
@ -705,4 +513,63 @@ const rowUpdate = (row, index, done, loading) => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const rowDel = (row, index, done) => {
|
||||
if (isEmpty(row)) return;
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.info('删除', row.recordId);
|
||||
delOperationRecord(row.recordId || '')
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('删除成功!');
|
||||
loadData();
|
||||
done();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
const onBatchDel = () => {
|
||||
let ids = handleIds();
|
||||
if (!ids.length || ids.length <= 0) {
|
||||
return app.$message.error('请先选择要删除的数据');
|
||||
}
|
||||
};
|
||||
|
||||
const onExport = () => {
|
||||
// if (isEmpty(state.data)) {
|
||||
// app.$message.error('当前暂时没有可供导出的数据!');
|
||||
// return;
|
||||
// }
|
||||
// state.loading = true;
|
||||
// const fileName = '网格明细表';
|
||||
// ExportEntity(state.query)
|
||||
// .then((res) => {
|
||||
// if (res.status === 200) {
|
||||
// downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
// app.$message.success('导出成功!');
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error('导出失败!');
|
||||
// })
|
||||
// .finally(() => {
|
||||
// state.loading = false;
|
||||
// });
|
||||
};
|
||||
|
||||
const doExam = (row) => {
|
||||
crudRef.value && crudRef.value.rowEdit(row);
|
||||
};
|
||||
</script>
|
||||
|
@ -1,411 +1,5 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model="state.form"
|
||||
v-model:search="searchCondition"
|
||||
v-model:page="pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="loadData"
|
||||
@search-reset="
|
||||
() => {
|
||||
loadData(1);
|
||||
}
|
||||
"
|
||||
@search-change="
|
||||
(form, done) => {
|
||||
loadData(1);
|
||||
done();
|
||||
}
|
||||
"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="success" icon="download" @click="onExport">导出</el-button>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == '0' || !row.status" type="warning" size="small">待审核</el-tag>
|
||||
<el-tag v-if="row.status == '1'" type="success" size="small">通过</el-tag>
|
||||
<el-tag v-if="row.status == '2'" type="danger" size="small">拒绝</el-tag>
|
||||
</template>
|
||||
<!-- <template #menu="scope">
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template> -->
|
||||
</avue-crud>
|
||||
</div>
|
||||
<div></div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS, pageData } from '@/config';
|
||||
import { isEmpty, downloadFile } from '@/utils';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { getBuinesCheckRecord, exportBusinessCheckRecord } from '@/apis/productOperateMain';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
const crudRef = ref(null);
|
||||
|
||||
const auditStatusOptions = reactive([
|
||||
{ label: '待审核', value: '0' },
|
||||
{ label: '已通过', value: '1' },
|
||||
{ label: '已拒绝', value: '2' },
|
||||
]);
|
||||
|
||||
const searchCondition = ref({
|
||||
businessType: null,
|
||||
businessId: '',
|
||||
productType: '', //产品类型
|
||||
createStartTime: '',
|
||||
createEndTime: '',
|
||||
primaryProduct: '',
|
||||
status: null,
|
||||
});
|
||||
|
||||
const searchDateChange = (val) => {
|
||||
// console.info('searchDateChange', val);
|
||||
searchCondition.value.createStartTime = val[0] || '';
|
||||
searchCondition.value.createEndTime = val[1] || '';
|
||||
};
|
||||
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
form: {},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
addBtnText: '添加',
|
||||
addBtn: false,
|
||||
searchLabelWidth: '120px',
|
||||
searchSpan: 8,
|
||||
searchGutter: 100,
|
||||
searchMenuPosition: 'center',
|
||||
menu: false,
|
||||
column: [
|
||||
{
|
||||
label: '主体类型',
|
||||
prop: 'businessType',
|
||||
type: 'radio',
|
||||
search: true,
|
||||
width: '80px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
span: 24,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list?dictType=sys_business_type¤t=1&size=10`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
return (res.data.records ?? []).map((item) => ({
|
||||
...item,
|
||||
dictValue: Number(item.dictValue),
|
||||
}));
|
||||
},
|
||||
rules: { required: true, message: '请选择', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '主体代码',
|
||||
prop: 'id',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
search: true,
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '主体名称',
|
||||
prop: 'businessName',
|
||||
width: '160px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
search: true,
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
// {
|
||||
// label: '经营产品种类',
|
||||
// prop: 'productType',
|
||||
// type: 'select',
|
||||
// width: '120px',
|
||||
// remote: false,
|
||||
// search: true,
|
||||
// props: {
|
||||
// label: 'dictLabel',
|
||||
// value: 'dictValue',
|
||||
// },
|
||||
// dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
// dicQuery: {
|
||||
// dictType: 'sys_business_product_type',
|
||||
// current: 1,
|
||||
// size: 100,
|
||||
// },
|
||||
// dicHeaders: {
|
||||
// authorization: UserStore.token,
|
||||
// },
|
||||
// dicFormatter: (res) => res.data.records ?? [],
|
||||
// rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
// },
|
||||
// {
|
||||
// label: '主要经营产品',
|
||||
// prop: 'primaryProduct',
|
||||
// width: '120px',
|
||||
// showOverflowTooltip: true,
|
||||
// search: false,
|
||||
// rules: {
|
||||
// required: true,
|
||||
// message: '请输入',
|
||||
// trigger: 'blur',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// label: '统一信用代码/证件号码',
|
||||
// prop: 'idCard',
|
||||
// search: false,
|
||||
// width: '200px',
|
||||
// labelWidth: '160px',
|
||||
// rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
// },
|
||||
// {
|
||||
// label: '联系地址',
|
||||
// prop: 'addressCode',
|
||||
// type: 'cascader',
|
||||
// checkStrictly: false,
|
||||
// width: '200px',
|
||||
// ellipsis: true,
|
||||
// showOverflowTooltip: true,
|
||||
// addDisplay: true,
|
||||
// editDisplay: true,
|
||||
// search: true,
|
||||
// props: {
|
||||
// label: 'areaName',
|
||||
// value: 'areaCode',
|
||||
// children: 'areaChildVOS',
|
||||
// },
|
||||
// dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
|
||||
// dicHeaders: {
|
||||
// authorization: UserStore.token,
|
||||
// },
|
||||
// dicFormatter: (res) => res.data ?? [],
|
||||
// rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
// },
|
||||
// {
|
||||
// label: '详细地址',
|
||||
// prop: 'detailAddress',
|
||||
// search: false,
|
||||
// ellipsis: true,
|
||||
// showOverflowTooltip: true,
|
||||
// rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
// },
|
||||
// {
|
||||
// label: '联系电话',
|
||||
// prop: 'phone',
|
||||
// width: '160px',
|
||||
// search: false,
|
||||
// rules: {
|
||||
// required: true,
|
||||
// message: '请输入',
|
||||
// trigger: 'blur',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '审核状态',
|
||||
prop: 'status',
|
||||
width: '80px',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
search: false,
|
||||
rules: { required: true, message: '请输入', trigger: 'blur' },
|
||||
},
|
||||
{
|
||||
label: '审核意见',
|
||||
prop: 'reviewSuggestion',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
width: '200px',
|
||||
ellipsis: true,
|
||||
showOverflowTooltip: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{ label: '创建时间', prop: 'createTime', width: '180px', addDisplay: false, editDisplay: false, search: false },
|
||||
],
|
||||
searchColumn: [
|
||||
{ label: '主体代码', prop: 'id', search: true },
|
||||
{ label: '主体名称', prop: 'businessName', search: true },
|
||||
{
|
||||
label: '审核状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: auditStatusOptions,
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
type: 'select',
|
||||
width: '120px',
|
||||
remote: false,
|
||||
search: true,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_product_type',
|
||||
current: 1,
|
||||
size: 100,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '主体类型',
|
||||
prop: 'businessType',
|
||||
type: 'radio',
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list`,
|
||||
dicQuery: {
|
||||
dictType: 'sys_business_type',
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
return (res.data.records ?? []).map((item) => ({
|
||||
...item,
|
||||
dictValue: Number(item.dictValue),
|
||||
}));
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '创建日期',
|
||||
prop: 'operationDate',
|
||||
type: 'daterange',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
width: 200,
|
||||
search: true,
|
||||
change: (val) => searchDateChange(val.value),
|
||||
},
|
||||
],
|
||||
},
|
||||
pageData: {
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
currentRow: {},
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = (resetPage) => {
|
||||
resetPage === 1 && (pageData.value.currentPage = 1);
|
||||
state.loading = true;
|
||||
let searchParmer = {
|
||||
...searchCondition.value,
|
||||
};
|
||||
|
||||
delete searchParmer.operationDate;
|
||||
let params = Object.assign(
|
||||
{
|
||||
current: pageData.value.currentPage,
|
||||
size: pageData.value.size,
|
||||
},
|
||||
searchParmer
|
||||
);
|
||||
getBuinesCheckRecord(params)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.data = state.data.map((m) => {
|
||||
return { ...m, addressCode: [m.provinceCode, m.cityCode, m.countyCode, m.townCode] };
|
||||
});
|
||||
pageData.value.total = res.data.total;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 条数
|
||||
const sizeChange = (size) => {
|
||||
state.query.size = size;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const searchChange = (params, done) => {
|
||||
if (done) done();
|
||||
state.query = params;
|
||||
state.query.current = 1;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 刷新
|
||||
const refreshChange = () => {
|
||||
loadData();
|
||||
app.$message.success('刷新成功');
|
||||
};
|
||||
|
||||
const onExport = () => {
|
||||
if (isEmpty(state.data)) {
|
||||
app.$message.error('当前暂时没有可供导出的数据!');
|
||||
return;
|
||||
}
|
||||
state.loading = true;
|
||||
const fileName = '经营主体审核历史列表';
|
||||
exportBusinessCheckRecord(state.query)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
app.$message.success('导出成功!');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error('导出失败!');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<script setup></script>
|
||||
<style></style>
|
||||
|
@ -1,14 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<iframe :src="iframeUrl" :style="iframeStyle"></iframe>
|
||||
<mapSplashed></mapSplashed>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
// import { reactive, ref } from 'vue';
|
||||
// import { useApp } from '@/hooks';
|
||||
import mapSplashed from '../home/components/mapSplashed.vue';
|
||||
const iframeUrl = ref('http://192.168.1.214:9000/v2/entities');
|
||||
const iframeStyle = ref({ width: '100%', height: ' calc(100vh - 120px)' });
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
@ -49,8 +49,6 @@ import {
|
||||
importOperationRecord,
|
||||
} from '@/apis/land';
|
||||
|
||||
import { getBuinessList } from '@/apis/productOperateMain';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
@ -84,12 +82,6 @@ const state = reactive({
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
businessType: '',
|
||||
businessId: '',
|
||||
productType: '', //产品类型
|
||||
createStartTime: '',
|
||||
createEndTime: '',
|
||||
primaryProduct: '',
|
||||
},
|
||||
form: {},
|
||||
selection: [],
|
||||
@ -103,7 +95,7 @@ const state = reactive({
|
||||
column: [
|
||||
{
|
||||
label: '主体代码',
|
||||
prop: 'businessId',
|
||||
prop: 'executor',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
search: true,
|
||||
@ -123,29 +115,9 @@ const state = reactive({
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '主体类型',
|
||||
prop: 'businessType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list?dictType=sys_business_type¤t=1&size=10`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
prop: 'landId',
|
||||
type: 'select',
|
||||
remote: false,
|
||||
search: true,
|
||||
@ -267,30 +239,11 @@ const state = reactive({
|
||||
{ label: '创建时间', prop: 'crop', addDisplay: false, editDisplay: false, search: false },
|
||||
],
|
||||
searchColumn: [
|
||||
{
|
||||
label: '主体类型',
|
||||
prop: 'businessType',
|
||||
type: 'select',
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/list?dictType=sys_business_type¤t=1&size=10`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => res.data.records ?? [],
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{ label: '主体代码', prop: 'businessId', search: true },
|
||||
{ label: '主体代码', prop: 'landName', search: true },
|
||||
{ label: '主体名称', prop: 'crop', search: true },
|
||||
{
|
||||
label: '经营产品种类',
|
||||
prop: 'productType',
|
||||
prop: 'operationType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: jobTypeOptions,
|
||||
@ -335,26 +288,26 @@ const state = reactive({
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
state.loading = true;
|
||||
getBuinessList(state.query)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.pageData = {
|
||||
currentPage: current || 1,
|
||||
pageSize: size || 10,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
// state.loading = true;
|
||||
// getOperationRecord(state.query)
|
||||
// .then((res) => {
|
||||
// if (res.code === 200) {
|
||||
// const { current, size, total, records } = res.data;
|
||||
// state.data = records;
|
||||
// state.pageData = {
|
||||
// currentPage: current || 1,
|
||||
// pageSize: size || 10,
|
||||
// total: total,
|
||||
// };
|
||||
// }
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// app.$message.error(err.msg);
|
||||
// state.data = [];
|
||||
// })
|
||||
// .finally(() => {
|
||||
// state.loading = false;
|
||||
// });
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
@ -1,267 +0,0 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:search="state.query"
|
||||
v-model:page="state.pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="refreshChange"
|
||||
@search-reset="searchChange"
|
||||
@search-change="searchChange"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="primary" icon="plus" @click="rowAdd">选择用户</el-button>
|
||||
<el-button type="danger" icon="close" @click="rowAuthAll(state.selection)">批量取消授权</el-button>
|
||||
</template>
|
||||
|
||||
<template #status="{ row }">
|
||||
<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">
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<select-user ref="userRef" :role-id="state.roleId" @on-confirm="rowSave" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { AuthUserList, AuthUserCancel, AuthUserCancelAll, AuthUserSelectAll } from '@/apis/system/auth';
|
||||
import SelectUser from './selectUser.vue';
|
||||
|
||||
const app = useApp();
|
||||
const route = useRoute();
|
||||
const crudRef = ref(null);
|
||||
const userRef = ref(null);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
form: {},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
addBtn: false,
|
||||
selection: true,
|
||||
rowKey: 'userId',
|
||||
column: [
|
||||
{
|
||||
label: '登录名',
|
||||
prop: 'userName',
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户名称',
|
||||
prop: 'nickName',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{
|
||||
label: '启用',
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
label: '禁用',
|
||||
value: '1',
|
||||
},
|
||||
],
|
||||
value: '0',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
prop: 'phonenumber',
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
prop: 'email',
|
||||
hide: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
type: 'danger',
|
||||
name: '取消授权',
|
||||
icon: 'close',
|
||||
event: ({ row }) => rowAuth(row),
|
||||
},
|
||||
],
|
||||
},
|
||||
pageData: {
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
roleId: '',
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
state.loading = true;
|
||||
state.query.roleId = route.query.id;
|
||||
AuthUserList(state.query)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.pageData = {
|
||||
currentPage: current || 1,
|
||||
pageSize: size || 10,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 条数
|
||||
const sizeChange = (size) => {
|
||||
state.query.size = size;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const searchChange = (params, done) => {
|
||||
if (done) done();
|
||||
state.query = params;
|
||||
state.query.current = 1;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 刷新
|
||||
const refreshChange = () => {
|
||||
loadData();
|
||||
app.$message.success('刷新成功');
|
||||
};
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selection = rows;
|
||||
};
|
||||
|
||||
// 取消授权
|
||||
const rowAuth = (row) => {
|
||||
const roleId = route.query.id;
|
||||
app
|
||||
.$confirm(`确认要取消该用户 ${row.userName} 角色吗?`, '确定取消', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
AuthUserCancel({ roleId: roleId, userId: row.userId })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('取消授权成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
// 批量取消授权
|
||||
const rowAuthAll = () => {
|
||||
const roleId = route.query.id;
|
||||
const userIds = state.selection.map((item) => item.userId);
|
||||
app
|
||||
.$confirm(`是否取消选中用户授权数据项?`, '确定取消', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
AuthUserCancelAll({ roleId: roleId, userIds: userIds.join(',') })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('取消授权成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
// 添加
|
||||
const rowAdd = () => {
|
||||
state.roleId = route.query.id;
|
||||
userRef?.value && userRef.value.show();
|
||||
};
|
||||
|
||||
// 授权用户
|
||||
const rowSave = (data) => {
|
||||
AuthUserSelectAll(data)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('授权用户成功!');
|
||||
loadData();
|
||||
userRef.value.hide();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
};
|
||||
</script>
|
@ -1,566 +0,0 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:search="state.query"
|
||||
v-model:page="state.pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="refreshChange"
|
||||
@search-reset="searchChange"
|
||||
@search-change="searchChange"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@row-save="rowSave"
|
||||
@row-update="rowUpdate"
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
|
||||
</template>
|
||||
|
||||
<template #menuCheckStrictly-form="{ column, value, type }">
|
||||
<el-checkbox v-model="state.menuExpand" @change="onCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
|
||||
<el-checkbox v-model="state.menuNodeAll" @change="onCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
|
||||
<el-checkbox v-model="menuCheckStrictly" @change="onCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
|
||||
<el-tree
|
||||
ref="menuRef"
|
||||
class="tree-border"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
empty-text="加载中,请稍候"
|
||||
:data="state.menuOptions"
|
||||
:check-strictly="!menuCheckStrictly"
|
||||
:props="state.defaultProps"
|
||||
></el-tree>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :show="scope.row.roleId !== 1" :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog
|
||||
v-model="state.visible"
|
||||
draggable
|
||||
append-to-body
|
||||
title="分配数据权限"
|
||||
class="avue-dialog"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
@close="state.visible = false"
|
||||
>
|
||||
<avue-form ref="formRef" v-model="state.form" :option="state.formOptions">
|
||||
<template #deptCheckStrictly="{ column, value, type }">
|
||||
<el-checkbox v-model="state.deptExpand" @change="onCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
|
||||
<el-checkbox v-model="state.deptNodeAll" @change="onCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
|
||||
<el-checkbox v-model="state.form.deptCheckStrictly" @change="onCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
|
||||
<el-tree
|
||||
ref="deptRef"
|
||||
class="tree-border"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
empty-text="加载中,请稍候"
|
||||
:data="state.deptOptions"
|
||||
:check-strictly="!state.form.deptCheckStrictly"
|
||||
:props="state.defaultProps"
|
||||
></el-tree>
|
||||
</template>
|
||||
</avue-form>
|
||||
<div class="avue-dialog__footer avue-dialog__footer--right">
|
||||
<el-button type="primary" icon="CircleCheck" @click="rowScopeSave">确 定</el-button>
|
||||
<el-button icon="CircleClose" @click="state.visible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, onMounted, reactive, ref, nextTick, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { isEmpty } from '@/utils';
|
||||
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, UpdateStatus, GetRoleDept, UpdateDataScope } from '@/apis/system/role';
|
||||
import { GetMenuTree, GetRoleMenu } from '@/apis/system/menu';
|
||||
|
||||
const app = useApp();
|
||||
const router = useRouter();
|
||||
const crudRef = ref(null);
|
||||
const menuRef = ref(null);
|
||||
const formRef = ref(null);
|
||||
const deptRef = ref(null);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
selection: false,
|
||||
column: [
|
||||
{
|
||||
label: '角色名称',
|
||||
prop: 'roleName',
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '权限字符',
|
||||
prop: 'roleKey',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: [
|
||||
{
|
||||
label: '启用',
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
label: '禁用',
|
||||
value: '1',
|
||||
},
|
||||
],
|
||||
value: '0',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '排序',
|
||||
prop: 'roleSort',
|
||||
type: 'number',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '菜单权限',
|
||||
prop: 'menuCheckStrictly',
|
||||
hide: true,
|
||||
formSlot: true,
|
||||
viewDisplay: false,
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
span: 24,
|
||||
rows: 4,
|
||||
overHidden: true,
|
||||
width: 200,
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
name: '查看',
|
||||
icon: 'view',
|
||||
event: ({ row }) => rowView(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => rowEdit(row),
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
name: ({ row }) => {
|
||||
return row.status == 0 ? '禁用' : '启用';
|
||||
},
|
||||
icon: ({ row }) => {
|
||||
return row.status == 0 ? 'turnOff' : 'open';
|
||||
},
|
||||
event: ({ row }) => rowStatus(row),
|
||||
},
|
||||
{
|
||||
name: '数据权限',
|
||||
icon: 'lock',
|
||||
event: ({ row }) => rowScope(row),
|
||||
},
|
||||
{
|
||||
name: '分配用户',
|
||||
icon: 'user',
|
||||
event: ({ row }) => rowUser(row),
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => rowDel(row),
|
||||
},
|
||||
],
|
||||
},
|
||||
pageData: {
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
menuExpand: false,
|
||||
menuNodeAll: false,
|
||||
menuOptions: [],
|
||||
deptExpand: true,
|
||||
deptNodeAll: false,
|
||||
deptOptions: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
},
|
||||
visible: false,
|
||||
form: {},
|
||||
formOptions: {
|
||||
column: [
|
||||
{
|
||||
label: '角色名称',
|
||||
prop: 'roleName',
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
label: '权限字符',
|
||||
prop: 'roleKey',
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
label: '权限字符',
|
||||
prop: 'dataScope',
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{
|
||||
value: '1',
|
||||
label: '全部数据权限',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '自定数据权限',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '本部门数据权限',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '本部门及以下数据权限',
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '仅本人数据权限',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '数据权限',
|
||||
prop: 'deptCheckStrictly',
|
||||
span: 24,
|
||||
},
|
||||
],
|
||||
submitBtn: false,
|
||||
emptyBtn: false,
|
||||
},
|
||||
});
|
||||
const menuCheckStrictly = computed(() => crudRef.value.tableForm.menuCheckStrictly);
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
state.loading = true;
|
||||
GetEntityList(state.query)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.pageData = {
|
||||
currentPage: current || 1,
|
||||
pageSize: size || 10,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
||||
const getMenu = () => {
|
||||
GetMenuTree().then((res) => {
|
||||
if (res.code === 200) {
|
||||
state.menuOptions = res.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getMenu();
|
||||
});
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 条数
|
||||
const sizeChange = (size) => {
|
||||
state.query.size = size;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const searchChange = (params, done) => {
|
||||
if (done) done();
|
||||
state.query = params;
|
||||
state.query.current = 1;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 刷新
|
||||
const refreshChange = () => {
|
||||
loadData();
|
||||
app.$message.success('刷新成功');
|
||||
};
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selection = rows;
|
||||
};
|
||||
|
||||
// 查看
|
||||
const rowView = (row) => {
|
||||
crudRef.value.rowView(row);
|
||||
};
|
||||
|
||||
// 启用、禁用
|
||||
const rowStatus = (row) => {
|
||||
let status = row.status == 1 ? 0 : 1;
|
||||
UpdateStatus({ roleId: row.roleId, status })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('状态更改成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
};
|
||||
|
||||
// 树权限(展开/折叠)
|
||||
const onCheckedTreeExpand = (value, type) => {
|
||||
if (type == 'menu') {
|
||||
const treeList = state.menuOptions;
|
||||
for (let i = 0; i < treeList.length; i++) {
|
||||
menuRef.value.store.nodesMap[treeList[i].id].expanded = value;
|
||||
}
|
||||
} else if (type == 'dept') {
|
||||
const treeList = state.deptOptions;
|
||||
for (let i = 0; i < treeList.length; i++) {
|
||||
deptRef.value.store.nodesMap[treeList[i].id].expanded = value;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 树权限(全选/全不选)
|
||||
const onCheckedTreeNodeAll = (value, type) => {
|
||||
if (type == 'menu') {
|
||||
menuRef.value.setCheckedNodes(value ? state.menuOptions : []);
|
||||
} else if (type == 'dept') {
|
||||
deptRef.value.setCheckedNodes(value ? state.deptOptions : []);
|
||||
}
|
||||
};
|
||||
|
||||
// 树权限(父子联动)
|
||||
const onCheckedTreeConnect = (value, type) => {
|
||||
if (type == 'menu') {
|
||||
crudRef.value.tableForm.menuCheckStrictly = value ? true : false;
|
||||
} else if (type == 'dept') {
|
||||
state.form.deptCheckStrictly = value ? true : false;
|
||||
}
|
||||
};
|
||||
|
||||
// 所有菜单节点数据
|
||||
const getMenuAllCheckedKeys = () => {
|
||||
let checkedKeys = menuRef.value.getCheckedKeys();
|
||||
let halfCheckedKeys = menuRef.value.getHalfCheckedKeys();
|
||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||
return checkedKeys;
|
||||
};
|
||||
|
||||
// 所有部门节点数据
|
||||
const getDeptAllCheckedKeys = () => {
|
||||
let checkedKeys = deptRef.value.getCheckedKeys();
|
||||
let halfCheckedKeys = deptRef.value.getHalfCheckedKeys();
|
||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||
return checkedKeys;
|
||||
};
|
||||
|
||||
// 根据角色ID查询菜单树结构
|
||||
const getRoleMenuTreeselect = (roleId) => {
|
||||
return GetRoleMenu(roleId).then((res) => {
|
||||
state.menuOptions = res.menus;
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
// 根据角色ID查询部门树结构
|
||||
const getRoleDeptTreeselect = (roleId) => {
|
||||
return GetRoleDept(roleId).then((res) => {
|
||||
state.deptOptions = res.depts;
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
// 权限范围
|
||||
watch(
|
||||
() => state.form.dataScope,
|
||||
(val) => {
|
||||
state.formOptions.column[3].display = val === '2' ? true : false;
|
||||
}
|
||||
);
|
||||
|
||||
// 数据权限
|
||||
const rowScope = async (row) => {
|
||||
const roleDept = getRoleDeptTreeselect(row.roleId);
|
||||
state.form = { ...row };
|
||||
state.visible = true;
|
||||
nextTick(() => {
|
||||
roleDept.then((res) => {
|
||||
deptRef.value && deptRef.value.setCheckedKeys(res.checkedKeys);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const rowScopeSave = () => {
|
||||
if (state.form?.roleId) {
|
||||
state.form.deptIds = getDeptAllCheckedKeys();
|
||||
UpdateDataScope(state.form)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('更新成功!');
|
||||
state.visible = false;
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 分配用户
|
||||
const rowUser = (row) => {
|
||||
router.push({
|
||||
path: '/sub-government-affairs-service/system-auth-user',
|
||||
query: { id: row.roleId },
|
||||
});
|
||||
};
|
||||
|
||||
// 新增
|
||||
const rowSave = (row, done, loading) => {
|
||||
row.menuIds = getMenuAllCheckedKeys();
|
||||
AddEntity(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('添加成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const rowEdit = (row) => {
|
||||
const roleMenu = getRoleMenuTreeselect(row.roleId);
|
||||
nextTick(() => {
|
||||
roleMenu.then((res) => {
|
||||
const checkedKeys = res.checkedKeys;
|
||||
checkedKeys.forEach((v) => {
|
||||
nextTick(() => {
|
||||
menuRef.value.setChecked(v, true, false);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
crudRef.value.rowEdit(row);
|
||||
};
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
row.menuIds = getMenuAllCheckedKeys();
|
||||
UpdateEntity(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('更新成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const rowDel = (row, index, done) => {
|
||||
if (isEmpty(row)) return;
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
DeleteEntity({ id: row.roleId })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('删除成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tree-border {
|
||||
margin-top: 5px;
|
||||
border: 1px solid #e5e6e7;
|
||||
min-height: 200px;
|
||||
background: #ffffff none;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
@ -1,228 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="state.visible"
|
||||
draggable
|
||||
append-to-body
|
||||
title="选择用户"
|
||||
width="70%"
|
||||
class="avue-dialog"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
@close="state.visible = false"
|
||||
>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:search="state.query"
|
||||
v-model:page="state.pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="refreshChange"
|
||||
@search-reset="searchChange"
|
||||
@search-change="searchChange"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
>
|
||||
<template #status="{ row }">
|
||||
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
|
||||
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<div class="avue-dialog__footer avue-dialog__footer--right">
|
||||
<el-button type="primary" icon="CircleCheck" @click="onConfirm">确 定</el-button>
|
||||
<el-button icon="CircleClose" @click="state.visible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { isEmpty } from '@/utils';
|
||||
import { UnAuthUserList } from '@/apis/system/auth';
|
||||
|
||||
const props = defineProps({
|
||||
roleId: {
|
||||
type: [Number, String],
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['on-confirm']);
|
||||
|
||||
const app = useApp();
|
||||
const crudRef = ref(null);
|
||||
const state = reactive({
|
||||
visible: false,
|
||||
loading: false,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
form: {},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
menu: false,
|
||||
addBtn: false,
|
||||
selection: true,
|
||||
rowKey: 'userId',
|
||||
column: [
|
||||
{
|
||||
label: '登录名',
|
||||
prop: 'userName',
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户名称',
|
||||
prop: 'nickName',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{
|
||||
label: '启用',
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
label: '禁用',
|
||||
value: '1',
|
||||
},
|
||||
],
|
||||
value: '0',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
prop: 'phonenumber',
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
prop: 'email',
|
||||
hide: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
pageData: {
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
state.loading = true;
|
||||
state.query.roleId = props.id;
|
||||
UnAuthUserList(state.query)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.pageData = {
|
||||
currentPage: current || 1,
|
||||
pageSize: size || 10,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 条数
|
||||
const sizeChange = (size) => {
|
||||
state.query.size = size;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const searchChange = (params, done) => {
|
||||
if (done) done();
|
||||
state.query = params;
|
||||
state.query.current = 1;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 刷新
|
||||
const refreshChange = () => {
|
||||
loadData();
|
||||
app.$message.success('刷新成功');
|
||||
};
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selection = rows;
|
||||
};
|
||||
|
||||
// 选择授权用户操作
|
||||
const onConfirm = () => {
|
||||
const roleId = props.roleId;
|
||||
const userIds = state.selection.map((item) => item.userId);
|
||||
if (isEmpty(userIds)) {
|
||||
app.$message.error('请选择要分配的用户!');
|
||||
return;
|
||||
}
|
||||
emit('on-confirm', { roleId: roleId, userIds: userIds.join(',') });
|
||||
};
|
||||
|
||||
// watch(
|
||||
// () => props.roleId,
|
||||
// (val) => {},
|
||||
// {
|
||||
// deep: true,
|
||||
// immediate: true,
|
||||
// }
|
||||
// );
|
||||
|
||||
defineExpose({
|
||||
show: () => {
|
||||
loadData();
|
||||
state.visible = true;
|
||||
},
|
||||
hide: () => {
|
||||
state.visible = false;
|
||||
},
|
||||
});
|
||||
</script>
|
@ -1,545 +0,0 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<el-row :gutter="20">
|
||||
<splitpanes class="default-theme">
|
||||
<pane size="16">
|
||||
<el-col>
|
||||
<custom-table-tree title="部门组织信息" :data="treeData" :option="treeOption" filter @node-click="handleNodeClick">
|
||||
<template #default="{ data }">
|
||||
<div :class="{ 'text-primary': data.deptId == treeSelected.deptId }">
|
||||
{{ data.deptName }}
|
||||
</div>
|
||||
</template>
|
||||
</custom-table-tree>
|
||||
</el-col>
|
||||
</pane>
|
||||
<pane size="84">
|
||||
<el-col>
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model:search="state.query"
|
||||
v-model:page="state.pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="refreshChange"
|
||||
@search-reset="searchChange"
|
||||
@search-change="searchChange"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@row-save="rowSave"
|
||||
@row-update="rowUpdate"
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="warning" icon="upload" @click="rowImport">导入</el-button>
|
||||
<el-button type="success" icon="download" @click="rowExport">导出</el-button>
|
||||
</template>
|
||||
|
||||
<template #status="{ row }">
|
||||
<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">
|
||||
<custom-table-operate :show="!scope.row.admin" :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
</el-col>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</el-row>
|
||||
|
||||
<custom-import-excel
|
||||
ref="importExcelRef"
|
||||
title="用户导入"
|
||||
:template-url="getAssetsFile('template/用户-导入模板.xlsx')"
|
||||
@on-download="onDownloadExcel"
|
||||
@on-confirm="onUploadExcel"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { isEmpty, getAssetsFile, downloadFile, getTree, getParentIds } from '@/utils';
|
||||
import {
|
||||
GetEntityList,
|
||||
AddEntity,
|
||||
UpdateEntity,
|
||||
DeleteEntity,
|
||||
ImportEntity,
|
||||
ExportEntity,
|
||||
GetUser,
|
||||
UpdateStatus,
|
||||
GetDeptList,
|
||||
} from '@/apis/system/user';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
const router = useRouter();
|
||||
const crudRef = ref(null);
|
||||
const importExcelRef = ref(null);
|
||||
const treeData = ref([]);
|
||||
const treeOption = ref({
|
||||
nodeKey: 'id',
|
||||
props: { children: 'children', label: 'deptName', id: 'deptId' },
|
||||
});
|
||||
const treeSelected = ref({});
|
||||
const userId = computed(() => '');
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
form: {},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
selection: false,
|
||||
rowKey: 'userId',
|
||||
column: [
|
||||
{
|
||||
label: '登录名',
|
||||
prop: 'userName',
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户名称',
|
||||
prop: 'nickName',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户密码',
|
||||
prop: 'password',
|
||||
hide: true,
|
||||
addDisplay: true,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
showPassword: true,
|
||||
maxlength: 20,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户性别',
|
||||
prop: 'sex',
|
||||
type: 'select',
|
||||
hide: true,
|
||||
props: {
|
||||
label: 'dictLabel',
|
||||
value: 'dictValue',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/dict/data/type/sys_user_sex`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
return res.data;
|
||||
},
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
prop: 'phonenumber',
|
||||
search: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
dicData: [
|
||||
{
|
||||
label: '启用',
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
label: '禁用',
|
||||
value: '1',
|
||||
},
|
||||
],
|
||||
value: '0',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
prop: 'email',
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: '归属部门',
|
||||
prop: 'deptIds',
|
||||
type: 'cascader',
|
||||
checkStrictly: true,
|
||||
props: {
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/user/deptTree`,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
return res.data;
|
||||
},
|
||||
render: ({ row }) => {
|
||||
return row?.dept?.deptName ?? '';
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '岗位',
|
||||
// prop: 'postIds',
|
||||
// type: 'select',
|
||||
// hide: true,
|
||||
// props: {
|
||||
// label: 'postName',
|
||||
// value: 'postId',
|
||||
// },
|
||||
// dicUrl: `${VITE_APP_BASE_API}/system/user/${userId.value}`,
|
||||
// // dicFlag: true,
|
||||
// dicHeaders: {
|
||||
// authorization: UserStore.token,
|
||||
// },
|
||||
// dicFormatter: (res) => {
|
||||
// return res.posts;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '角色',
|
||||
prop: 'roleIds',
|
||||
type: 'select',
|
||||
multiple: true,
|
||||
hide: true,
|
||||
props: {
|
||||
label: 'roleName',
|
||||
value: 'roleId',
|
||||
},
|
||||
dicUrl: `${VITE_APP_BASE_API}/system/user/${userId.value}`,
|
||||
// dicFlag: true,
|
||||
dicHeaders: {
|
||||
authorization: UserStore.token,
|
||||
},
|
||||
dicFormatter: (res) => {
|
||||
return res.roles;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
span: 24,
|
||||
rows: 4,
|
||||
overHidden: true,
|
||||
width: 200,
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
name: '查看',
|
||||
icon: 'view',
|
||||
event: ({ row }) => rowView(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => rowEdit(row),
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
name: ({ row }) => {
|
||||
return row.status == 0 ? '禁用' : '启用';
|
||||
},
|
||||
icon: ({ row }) => {
|
||||
return row.status == 0 ? 'turnOff' : 'open';
|
||||
},
|
||||
event: ({ row }) => rowStatus(row),
|
||||
},
|
||||
// {
|
||||
// name: '分配角色',
|
||||
// icon: 'userFilled',
|
||||
// event: ({ row }) => rowRole(row),
|
||||
// },
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => rowDel(row),
|
||||
},
|
||||
],
|
||||
},
|
||||
pageData: {
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
postOptions: [],
|
||||
roleOptions: [],
|
||||
});
|
||||
|
||||
// tree
|
||||
const getDeptTree = async () => {
|
||||
try {
|
||||
const res = await GetDeptList();
|
||||
if (res.code == 200) {
|
||||
treeData.value = getTree(res.data, 'deptId');
|
||||
}
|
||||
} catch (err) {
|
||||
app.$message.error(err.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const handleNodeClick = (data) => {
|
||||
treeSelected.value = data;
|
||||
state.query.deptId = data.deptId;
|
||||
loadData();
|
||||
};
|
||||
|
||||
getDeptTree();
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
state.loading = true;
|
||||
GetEntityList(state.query)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.pageData = {
|
||||
currentPage: current || 1,
|
||||
pageSize: size || 10,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 条数
|
||||
const sizeChange = (size) => {
|
||||
state.query.size = size;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const searchChange = (params, done) => {
|
||||
if (done) done();
|
||||
state.query = params;
|
||||
state.query.current = 1;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 刷新
|
||||
const refreshChange = () => {
|
||||
loadData();
|
||||
app.$message.success('刷新成功');
|
||||
};
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selection = rows;
|
||||
};
|
||||
|
||||
// 查看
|
||||
const rowView = async (row) => {
|
||||
const { roleIds, postIds } = await GetUser(row.userId);
|
||||
row.roleIds = roleIds;
|
||||
row.postIds = postIds;
|
||||
row.deptIds = [...getParentIds(treeData.value, row.deptId, 'deptId'), row.deptId];
|
||||
crudRef.value.rowView(row);
|
||||
};
|
||||
|
||||
// 启用、禁用
|
||||
const rowStatus = (row) => {
|
||||
let status = row.status == 1 ? 0 : 1;
|
||||
UpdateStatus({ userId: row.userId, status })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('状态更改成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
};
|
||||
|
||||
// 新增
|
||||
const setDeptIds = (row) => {
|
||||
if (!isEmpty(row.deptIds)) {
|
||||
const len = row.deptIds.length;
|
||||
row.deptId = row?.deptIds[len - 1] ?? '';
|
||||
}
|
||||
};
|
||||
|
||||
const rowSave = (row, done, loading) => {
|
||||
setDeptIds(row);
|
||||
AddEntity(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('添加成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const rowEdit = async (row) => {
|
||||
const { roleIds, postIds } = await GetUser(row.userId);
|
||||
row.roleIds = roleIds;
|
||||
row.postIds = postIds;
|
||||
row.deptIds = [...getParentIds(treeData.value, row.deptId, 'deptId'), row.deptId];
|
||||
crudRef.value.rowEdit(row);
|
||||
};
|
||||
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
setDeptIds(row);
|
||||
UpdateEntity(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('更新成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 分配角色
|
||||
const rowRole = (row) => {
|
||||
router.push({
|
||||
path: '/sub-government-affairs-service/system-auth-role',
|
||||
query: { id: row.userId },
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const rowDel = (row, index, done) => {
|
||||
if (isEmpty(row)) return;
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
DeleteEntity({ id: row.userId })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('删除成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
// 导入
|
||||
const rowImport = () => {
|
||||
importExcelRef?.value && importExcelRef.value.show();
|
||||
};
|
||||
|
||||
const onDownloadExcel = (url) => {
|
||||
downloadFile(url, `用户-导入模板.xlsx.xlsx`);
|
||||
};
|
||||
|
||||
const onUploadExcel = (formData) => {
|
||||
ImportEntity(formData)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('导入成功!');
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error('导入失败!');
|
||||
importExcelRef.value.clear();
|
||||
})
|
||||
.finally(() => {
|
||||
importExcelRef.value.hide();
|
||||
});
|
||||
};
|
||||
|
||||
// 导出
|
||||
const rowExport = () => {
|
||||
if (isEmpty(state.data)) {
|
||||
app.$message.error('当前暂时没有可供导出的数据!');
|
||||
return;
|
||||
}
|
||||
state.loading = true;
|
||||
const fileName = '用户';
|
||||
ExportEntity(state.query)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
app.$message.success('导出成功!');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error('导出失败!');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
</script>
|
BIN
sub-operation-service/src/assets/images/smartFarm/banner.png
Normal file
After Width: | Height: | Size: 638 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/banner1.png
Normal file
After Width: | Height: | Size: 579 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/banner3.png
Normal file
After Width: | Height: | Size: 606 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/closing.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/down_1@2x.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/goods.png
Normal file
After Width: | Height: | Size: 2.8 MiB |
BIN
sub-operation-service/src/assets/images/smartFarm/menu1.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/menu2.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/menu3.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/menu4.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/pic.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/test01.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/trace01.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/trace02.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/trace03.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/trace05.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/trace06.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/traceb.png
Normal file
After Width: | Height: | Size: 768 KiB |
BIN
sub-operation-service/src/assets/images/smartFarm/tracetxt.png
Normal file
After Width: | Height: | Size: 14 KiB |
@ -75,33 +75,33 @@ const keyword = ref('');
|
||||
|
||||
const meuns = ref([
|
||||
{
|
||||
label: '智慧种植',
|
||||
path: '/sub-operation-service/ecommerce',
|
||||
label: '综合看板',
|
||||
path: '/sub-operation-service/dashboard',
|
||||
},
|
||||
{
|
||||
label: '智慧种植',
|
||||
path: '/sub-operation-service/smartFarm',
|
||||
},
|
||||
// {
|
||||
// label: '农事服务',
|
||||
// path: '/sub-operation-service/ecommerce',
|
||||
// },
|
||||
{
|
||||
label: '电商交易',
|
||||
path: '/sub-operation-service/ecommerce',
|
||||
},
|
||||
{
|
||||
label: '涉农金融',
|
||||
path: '/sub-operation-service/ecommerce',
|
||||
path: '/sub-operation-service/ruralFinance',
|
||||
},
|
||||
|
||||
{
|
||||
label: '分拣包装',
|
||||
path: '/sub-operation-service/ecommerce',
|
||||
path: '/sub-operation-service/packaging',
|
||||
},
|
||||
{
|
||||
label: '仓储物流',
|
||||
path: '/sub-operation-service/ecommerce',
|
||||
path: '/sub-operation-service/warehouseLogistics',
|
||||
},
|
||||
{
|
||||
label: '公共品牌运营',
|
||||
path: '/sub-operation-service/ecommerce',
|
||||
label: '公共品牌',
|
||||
path: '/sub-operation-service/brand',
|
||||
},
|
||||
]);
|
||||
|
||||
@ -136,7 +136,7 @@ const toCart = () => {
|
||||
border: none !important;
|
||||
}
|
||||
.el-menu-item {
|
||||
font-size: 24px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.el-menu-item:hover {
|
||||
background: none !important;
|
||||
@ -264,7 +264,7 @@ const toCart = () => {
|
||||
justify-content: space-around;
|
||||
border: none;
|
||||
.el-menu-item {
|
||||
font-size: 24px;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export const constantRoutes = [
|
||||
path: '/sub-operation-service',
|
||||
name: 'layout',
|
||||
component: Layout,
|
||||
redirect: '/sub-operation-service/ecommerce',
|
||||
redirect: '/sub-operation-service/smartFarm',
|
||||
meta: { title: '运营服务' },
|
||||
children: [
|
||||
{
|
||||
@ -36,6 +36,93 @@ export const constantRoutes = [
|
||||
name: 'home',
|
||||
meta: { title: '首页' },
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/dashboard',
|
||||
component: () => import('@/views/dashboard/index.vue'),
|
||||
name: 'dashboard',
|
||||
meta: { title: '综合看板' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/smartFarm',
|
||||
name: 'smartFarm',
|
||||
component: Layout,
|
||||
redirect: '/sub-operation-service/smartFarm/main',
|
||||
meta: { title: '智慧种植' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-operation-service/smartFarm/main',
|
||||
component: () => import('@/views/smartFarm/index.vue'),
|
||||
name: 'smartFarmMain',
|
||||
meta: { title: '智慧种植首页' },
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/smartFarm/fieldInspection',
|
||||
component: () => import('@/views/smartFarm/fieldInspection/index.vue'),
|
||||
name: 'fieldInspection',
|
||||
meta: { title: '田间检测' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/ruralFinance',
|
||||
name: 'ruralFinance',
|
||||
component: Layout,
|
||||
redirect: '/sub-operation-service/ruralFinance/index',
|
||||
meta: { title: '涉农金融' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-operation-service/ruralFinance/index',
|
||||
component: () => import('@/views/ruralFinance/index.vue'),
|
||||
name: 'ruralFinanceMain',
|
||||
meta: { title: '涉农金融首页' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/packaging',
|
||||
name: 'packaging',
|
||||
component: Layout,
|
||||
redirect: '/sub-operation-service/packaging/index',
|
||||
meta: { title: '分拣包装' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-operation-service/packaging/index',
|
||||
component: () => import('@/views/packaging/index.vue'),
|
||||
name: 'packagingMain',
|
||||
meta: { title: '分拣包装首页' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/warehouseLogistics',
|
||||
name: 'warehouseLogistics',
|
||||
component: Layout,
|
||||
redirect: '/sub-operation-service/warehouseLogistics/index',
|
||||
meta: { title: '仓储物流' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-operation-service/warehouseLogistics/index',
|
||||
component: () => import('@/views/warehouseLogistics/index.vue'),
|
||||
name: 'warehouseLogisticsMain',
|
||||
meta: { title: '仓储物流首页' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/brand',
|
||||
name: 'brand',
|
||||
component: Layout,
|
||||
redirect: '/sub-operation-service/brand/index',
|
||||
meta: { title: '公共品牌' },
|
||||
children: [
|
||||
{
|
||||
path: '/sub-operation-service/brand/index',
|
||||
component: () => import('@/views/brand/index.vue'),
|
||||
name: 'brandMain',
|
||||
meta: { title: '公共品牌首页' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section>1111111111111</section>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
19
sub-operation-service/src/views/dashboard/index.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
19
sub-operation-service/src/views/packaging/index.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
19
sub-operation-service/src/views/ruralFinance/index.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div class="ecommerce-common-warp">
|
||||
<div class="ecommerce-common-content">
|
||||
<div class="left-menu">
|
||||
<slot v-if="$slots.left" name="left"></slot>
|
||||
<template v-else>
|
||||
<leftMenu :current-name="currentName"></leftMenu>
|
||||
</template>
|
||||
</div>
|
||||
<div class="common-content">
|
||||
<slot v-if="$slots.main" name="main"></slot>
|
||||
<template v-else></template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch } from 'vue';
|
||||
import leftMenu from './leftMenu.vue';
|
||||
|
||||
const props = defineProps({
|
||||
currentName: { type: String, default: 'agricultural' },
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.ecommerce-common-warp {
|
||||
width: 100%;
|
||||
height: calc(100vh - 230px);
|
||||
text-align: center;
|
||||
.ecommerce-common-content {
|
||||
width: $width-main;
|
||||
margin: auto;
|
||||
height: 100%;
|
||||
display: inline-flex;
|
||||
justify-content: space-between;
|
||||
.left-menu,
|
||||
.common-content {
|
||||
height: calc(100% - 16px);
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.left-menu {
|
||||
width: 240px;
|
||||
background: $color-fff;
|
||||
}
|
||||
.common-content {
|
||||
width: calc(100% - 240px);
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<div class="smartFarm-left-menu-warp">
|
||||
<div class="left-menu">
|
||||
<div v-for="(n, index) in leftMenu" :key="index" class="left-menu-item" style="position: relative">
|
||||
<div style="display: flex; justify-content: flex-start; align-items: center" @click.stop="toLink(index)">
|
||||
<div class="item-img">
|
||||
<img :src="getAssetsFile('images/smartFarm/' + n.icon)?.href ?? ''" alt="" />
|
||||
</div>
|
||||
<span :class="n.isOpen ? 'active' : ''" class="item-title">{{ n.title }}</span>
|
||||
<img
|
||||
v-if="n.children && n.isOpen"
|
||||
alt=""
|
||||
:src="getAssetsFile('images/smartFarm/closing.png')"
|
||||
class="isOpen"
|
||||
@click.stop="openList(index)"
|
||||
/>
|
||||
<img
|
||||
v-if="n.children && !n.isOpen"
|
||||
alt=""
|
||||
:src="getAssetsFile('images/smartFarm/down_1@2x.png')"
|
||||
class="isOpen fz"
|
||||
@click.stop="openList(index)"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="n.children && n.isOpen" class="item-children">
|
||||
<div v-for="(item, indexC) in n.children" :key="indexC">
|
||||
<ul style="list-style-type: disc !important; padding-left: 40px; text-align: left; overflow: visible">
|
||||
<li :class="indexC === currentCIndex ? 'active' : ''" @click.stop="toLinkSub(index, indexC)">
|
||||
<div class="dot"></div>
|
||||
{{ item.title }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
// const props = defineProps({
|
||||
// currentName: { type: String, default: 'dashboard' },
|
||||
// });
|
||||
|
||||
const leftMenu = reactive([
|
||||
{
|
||||
name: 'supplier',
|
||||
title: '农业环境监测',
|
||||
icon: 'menu1.png',
|
||||
path: '/sub-operation-service/smartFarm/main',
|
||||
isOpen: true,
|
||||
children: [
|
||||
{
|
||||
name: 'supplier',
|
||||
title: '田间监测',
|
||||
icon: 'menu1.png',
|
||||
path: '/sub-operation-service/smartFarm/fieldInspection',
|
||||
},
|
||||
{
|
||||
name: 'supplier',
|
||||
title: '水质监测',
|
||||
icon: 'menu1.png',
|
||||
path: '/sub-operation-service/ecommerce-supplier',
|
||||
},
|
||||
{
|
||||
name: 'supplier',
|
||||
title: '病虫害监测',
|
||||
icon: 'menu1.png',
|
||||
path: '/sub-operation-service/ecommerce-supplier',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'purchaser',
|
||||
title: '生产管理控制',
|
||||
icon: 'menu3.png',
|
||||
path: '/sub-operation-service/ecommerce-purchaser',
|
||||
isOpen: false,
|
||||
children: [],
|
||||
},
|
||||
]);
|
||||
|
||||
let currentIndex = ref(0);
|
||||
let currentCIndex = ref(-1);
|
||||
|
||||
// watch(
|
||||
// () => props.currentName,
|
||||
// () => {
|
||||
// console.info('currentName', props.currentName);
|
||||
// currentIndex.value = leftMenu.findIndex((m) => {
|
||||
// return m.name === props.currentName;
|
||||
// });
|
||||
// },
|
||||
// { deep: true, immediate: true }
|
||||
// );
|
||||
|
||||
const toLink = (index) => {
|
||||
currentIndex.value = index;
|
||||
currentCIndex.value = -1;
|
||||
let path = index !== undefined ? leftMenu[index].path : null;
|
||||
if (path) {
|
||||
router.push(path);
|
||||
}
|
||||
};
|
||||
const toLinkSub = (index, c) => {
|
||||
currentCIndex.value = c;
|
||||
let path = leftMenu[index].children[c].path;
|
||||
if (path) {
|
||||
router.push(path);
|
||||
}
|
||||
};
|
||||
const openList = (index) => {
|
||||
currentIndex.value = index;
|
||||
leftMenu[index].isOpen = !leftMenu[index].isOpen;
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.fz {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.isOpen {
|
||||
position: absolute;
|
||||
right: -24px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
.active {
|
||||
color: $color-main;
|
||||
}
|
||||
.smartFarm-left-menu-warp {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 30px;
|
||||
.left-menu {
|
||||
.left-menu-item {
|
||||
width: 100%;
|
||||
padding: 16px 0;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
color: $color-main;
|
||||
}
|
||||
.item-img,
|
||||
.item-title {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.item-img {
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.item-title {
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
padding-left: 8px;
|
||||
}
|
||||
.item-children {
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
margin-top: 8px;
|
||||
transition: transform 0.3s ease;
|
||||
.dot {
|
||||
display: inline-block;
|
||||
height: 4px;
|
||||
margin-right: 15px;
|
||||
width: 4px;
|
||||
border-radius: 90px;
|
||||
background-color: black;
|
||||
vertical-align: middle;
|
||||
}
|
||||
li {
|
||||
margin: 5px auto;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<section>
|
||||
<common>
|
||||
<template #main>
|
||||
<div>农田监测</div>
|
||||
</template>
|
||||
</common>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import Common from '../components/common.vue';
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
28
sub-operation-service/src/views/smartFarm/index.vue
Normal file
@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<section>
|
||||
<common>
|
||||
<template #main>
|
||||
<div>
|
||||
<el-card shadow="hover"> </el-card>
|
||||
</div>
|
||||
</template>
|
||||
</common>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import Common from './components/common.vue';
|
||||
|
||||
/* --------------- data --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
|
||||
/* --------------- methods --------------- */
|
||||
// #region
|
||||
|
||||
// #endregion
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|