Compare commits
No commits in common. "6cf4381c534d05496d9842b06e0460af333fc0ac" and "57f06999598c82707a593bcd51188dd67c23666c" have entirely different histories.
6cf4381c53
...
57f0699959
Admin.NET
Admin.NET.Application/Service/SysUnit
Admin.NET.Core
Web/src
api-services
views/basics-date/unit
|
@ -143,16 +143,3 @@ public class QueryByIdSysUnitGroupInput : DeleteSysUnitGroupInput
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 单位组检查输入参数
|
|
||||||
/// </summary>
|
|
||||||
public class CheckSysUnitGroupInput : SysUnitGroupBaseInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 主键Id
|
|
||||||
/// </summary>
|
|
||||||
[Required(ErrorMessage = "主键Id不能为空")]
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -11,14 +11,9 @@ namespace Admin.NET.Application;
|
||||||
public class SysUnitGroupService : IDynamicApiController, ITransient
|
public class SysUnitGroupService : IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
private readonly SqlSugarRepository<SysUnitGroup> _rep;
|
private readonly SqlSugarRepository<SysUnitGroup> _rep;
|
||||||
|
public SysUnitGroupService(SqlSugarRepository<SysUnitGroup> rep)
|
||||||
private readonly SysUnitService _sysUnitService;
|
|
||||||
|
|
||||||
public SysUnitGroupService(SqlSugarRepository<SysUnitGroup> rep,
|
|
||||||
SysUnitService sysUnitService )
|
|
||||||
{
|
{
|
||||||
_rep = rep;
|
_rep = rep;
|
||||||
_sysUnitService = sysUnitService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -106,17 +101,9 @@ public class SysUnitGroupService : IDynamicApiController, ITransient
|
||||||
return await _rep.AsQueryable().Where(a => !a.IsDelete).Select<SysUnitGroupOutput>().ToListAsync();
|
return await _rep.AsQueryable().Where(a => !a.IsDelete).Select<SysUnitGroupOutput>().ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 检查单位是否存在数据
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
[ApiDescriptionSettings(Name = "CheckUnitList")]
|
|
||||||
public async Task<bool> CheckUnitList(CheckSysUnitGroupInput input)
|
|
||||||
{
|
|
||||||
var sysUnits = await _sysUnitService.ListByGroupId(input.Id);
|
|
||||||
return sysUnits.Any();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using Admin.NET.Application.Const;
|
using Admin.NET.Application.Const;
|
||||||
using Admin.NET.Application.Entity;
|
using Admin.NET.Application.Entity;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|
||||||
namespace Admin.NET.Application;
|
namespace Admin.NET.Application;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单位服务
|
/// 单位服务
|
||||||
|
@ -172,21 +171,5 @@ public class SysUnitService : IDynamicApiController, ITransient
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 校验基本单位是否唯一
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
[ApiDescriptionSettings(Name = "checkBaseUnit")]
|
|
||||||
public async Task<SysUnit> CheckBaseUnit(AddSysUnitInput input)
|
|
||||||
{
|
|
||||||
var result = await _rep.AsQueryable()
|
|
||||||
.Where(a => !a.IsDelete && a.IsBaseUnit==true)
|
|
||||||
.WhereIF(input.GroupUnitId > 0, u => u.GroupUnitId == input.GroupUnitId)
|
|
||||||
.FirstAsync();
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Admin.NET.Core.xml" />
|
<None Remove="Admin.NET.Core.xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="2.0.24" />
|
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="2.0.24" />
|
||||||
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
<PackageReference Include="AngleSharp" Version="1.1.2" />
|
||||||
|
|
|
@ -362,54 +362,6 @@ export const SysUnitApiAxiosParamCreator = function (configuration?: Configurati
|
||||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||||
|
|
||||||
return {
|
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
||||||
options: localVarRequestOptions,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 校验基本单位是否唯一
|
|
||||||
* @param {UpdateSysUnitInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
apiSysUnitCheckPost: async (body?: UpdateSysUnitInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
||||||
const localVarPath = `/api/sysUnit/checkBaseUnit`;
|
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
||||||
let baseOptions;
|
|
||||||
if (configuration) {
|
|
||||||
baseOptions = configuration.baseOptions;
|
|
||||||
}
|
|
||||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
||||||
const localVarHeaderParameter = {} as any;
|
|
||||||
const localVarQueryParameter = {} as any;
|
|
||||||
|
|
||||||
// authentication Bearer required
|
|
||||||
// http bearer authentication required
|
|
||||||
if (configuration && configuration.accessToken) {
|
|
||||||
const accessToken = typeof configuration.accessToken === 'function'
|
|
||||||
? await configuration.accessToken()
|
|
||||||
: await configuration.accessToken;
|
|
||||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
|
||||||
|
|
||||||
const query = new URLSearchParams(localVarUrlObj.search);
|
|
||||||
for (const key in localVarQueryParameter) {
|
|
||||||
query.set(key, localVarQueryParameter[key]);
|
|
||||||
}
|
|
||||||
for (const key in options.params) {
|
|
||||||
query.set(key, options.params[key]);
|
|
||||||
}
|
|
||||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
||||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
||||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
|
@ -521,19 +473,6 @@ export const SysUnitApiFp = function(configuration?: Configuration) {
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 校验基本单位是否唯一
|
|
||||||
* @param body
|
|
||||||
* @param options
|
|
||||||
*/
|
|
||||||
async apiSysUnitCheckPost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
||||||
const localVarAxiosArgs = await SysUnitApiAxiosParamCreator(configuration).apiSysUnitCheckPost(body, options);
|
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
||||||
return axios.request(axiosRequestArgs);
|
|
||||||
};
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -612,15 +551,6 @@ export const SysUnitApiFactory = function (configuration?: Configuration, basePa
|
||||||
async apiSysUnitUpdatePost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
async apiSysUnitUpdatePost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||||
return SysUnitApiFp(configuration).apiSysUnitUpdatePost(body, options).then((request) => request(axios, basePath));
|
return SysUnitApiFp(configuration).apiSysUnitUpdatePost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 校验基本单位是否唯一
|
|
||||||
* @param body
|
|
||||||
* @param options
|
|
||||||
*/
|
|
||||||
async apiSysUnitCheckPost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
||||||
return SysUnitApiFp(configuration).apiSysUnitCheckPost(body, options).then((request) => request(axios, basePath));
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -707,14 +637,4 @@ export class SysUnitApi extends BaseAPI {
|
||||||
public async apiSysUnitUpdatePost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
public async apiSysUnitUpdatePost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
return SysUnitApiFp(this.configuration).apiSysUnitUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysUnitApiFp(this.configuration).apiSysUnitUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 校验基本单位是否唯一
|
|
||||||
* @param body
|
|
||||||
* @param options
|
|
||||||
*/
|
|
||||||
async apiSysUnitCheckPost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
||||||
return SysUnitApiFp(this.configuration).apiSysUnitCheckPost(body, options).then((request) => request(this.axios, this.basePath));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ import { AdminResultSysUnitGroup } from '../models';
|
||||||
import { DeleteSysUnitGroupInput } from '../models';
|
import { DeleteSysUnitGroupInput } from '../models';
|
||||||
import { SysUnitGroupInput } from '../models';
|
import { SysUnitGroupInput } from '../models';
|
||||||
import { UpdateSysUnitGroupInput } from '../models';
|
import { UpdateSysUnitGroupInput } from '../models';
|
||||||
import {CheckSysUnitGroupInput} from "/@/api-services/models/check-sys-unit-group-input";
|
|
||||||
/**
|
/**
|
||||||
* SysUnitGroupApi - axios parameter creator
|
* SysUnitGroupApi - axios parameter creator
|
||||||
* @export
|
* @export
|
||||||
|
@ -314,54 +313,6 @@ export const SysUnitGroupApiAxiosParamCreator = function (configuration?: Config
|
||||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||||
|
|
||||||
return {
|
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
||||||
options: localVarRequestOptions,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 检查单位组
|
|
||||||
* @param {CheckSysUnitGroupInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
apiSysUnitGroupCheckPost: async (body?: CheckSysUnitGroupInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
||||||
const localVarPath = `/api/sysUnitGroup/CheckUnitList`;
|
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
||||||
let baseOptions;
|
|
||||||
if (configuration) {
|
|
||||||
baseOptions = configuration.baseOptions;
|
|
||||||
}
|
|
||||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
||||||
const localVarHeaderParameter = {} as any;
|
|
||||||
const localVarQueryParameter = {} as any;
|
|
||||||
|
|
||||||
// authentication Bearer required
|
|
||||||
// http bearer authentication required
|
|
||||||
if (configuration && configuration.accessToken) {
|
|
||||||
const accessToken = typeof configuration.accessToken === 'function'
|
|
||||||
? await configuration.accessToken()
|
|
||||||
: await configuration.accessToken;
|
|
||||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
|
||||||
|
|
||||||
const query = new URLSearchParams(localVarUrlObj.search);
|
|
||||||
for (const key in localVarQueryParameter) {
|
|
||||||
query.set(key, localVarQueryParameter[key]);
|
|
||||||
}
|
|
||||||
for (const key in options.params) {
|
|
||||||
query.set(key, options.params[key]);
|
|
||||||
}
|
|
||||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
||||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
||||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
|
@ -459,20 +410,6 @@ export const SysUnitGroupApiFp = function(configuration?: Configuration) {
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 检查单位组
|
|
||||||
* @param {CheckSysUnitGroupInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSysUnitGroupCheckPost(body?: CheckSysUnitGroupInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
||||||
const localVarAxiosArgs = await SysUnitGroupApiAxiosParamCreator(configuration).apiSysUnitGroupCheckPost(body, options);
|
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
||||||
return axios.request(axiosRequestArgs);
|
|
||||||
};
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -616,15 +553,4 @@ export class SysUnitGroupApi extends BaseAPI {
|
||||||
public async apiSysUnitGroupUpdatePost(body?: UpdateSysUnitGroupInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
public async apiSysUnitGroupUpdatePost(body?: UpdateSysUnitGroupInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
return SysUnitGroupApiFp(this.configuration).apiSysUnitGroupUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysUnitGroupApiFp(this.configuration).apiSysUnitGroupUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 检查单位是否存在数据
|
|
||||||
* @param {UpdateSysUnitGroupInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
* @memberof SysUnitGroupApi
|
|
||||||
*/
|
|
||||||
public async apiSysUnitGroupCheckPost(body?: CheckSysUnitGroupInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
||||||
return SysUnitGroupApiFp(this.configuration).apiSysUnitGroupCheckPost(body, options).then((request) => request(this.axios, this.basePath));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
/**
|
|
||||||
* 所有接口
|
|
||||||
* 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。
|
|
||||||
*
|
|
||||||
* OpenAPI spec version: 1.0.0
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* NOTE: This class is auto generated by the swagger code generator program.
|
|
||||||
* https://github.com/swagger-api/swagger-codegen.git
|
|
||||||
* Do not edit the class manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单位组校验输入参数
|
|
||||||
*
|
|
||||||
* @export
|
|
||||||
* @interface CheckSysUnitGroupInput
|
|
||||||
*/
|
|
||||||
export interface CheckSysUnitGroupInput {
|
|
||||||
/**
|
|
||||||
* 主键Id
|
|
||||||
*
|
|
||||||
* @type {number}
|
|
||||||
* @memberof UpdateSysUnitGroupInput
|
|
||||||
*/
|
|
||||||
id: number;
|
|
||||||
}
|
|
|
@ -62,46 +62,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div>
|
<div>
|
||||||
<!-- <el-table-->
|
|
||||||
<!-- :data="data.unit"-->
|
|
||||||
<!-- style="width: 40%"-->
|
|
||||||
<!-- v-loading="loading"-->
|
|
||||||
<!-- tooltip-effect="light"-->
|
|
||||||
<!-- row-key="id"-->
|
|
||||||
<!-- @sort-change="sortChange"-->
|
|
||||||
<!-- border="">-->
|
|
||||||
<!-- <el-table-column type="index" label="序号" width="55" align="center"/>-->
|
|
||||||
<!-- <el-table-column prop="name" label="名称" width="140" show-overflow-tooltip="" />-->
|
|
||||||
<!-- <el-table-column prop="codeNum" label="编码" width="140" show-overflow-tooltip="" />-->
|
|
||||||
<!-- <el-table-column prop="aliasName" label="别名" width="140" show-overflow-tooltip="" />-->
|
|
||||||
<!-- <el-table-column prop="simpleNumber" label="助记码" width="140" show-overflow-tooltip="" />-->
|
|
||||||
<!-- <el-table-column prop="specifications" label="规格型号" width="140" show-overflow-tooltip="" />-->
|
|
||||||
<!-- <el-table-column prop="isEnable" label="可用状态" width="120" show-overflow-tooltip="">-->
|
|
||||||
<!-- <template #default="scope">-->
|
|
||||||
<!-- <el-tag v-if="scope.row.isEnable"> 是 </el-tag>-->
|
|
||||||
<!-- <el-tag type="danger" v-else> 否 </el-tag>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<!-- <el-table-column prop="remarks" label="备注" width="200" show-overflow-tooltip="" />-->
|
|
||||||
<!-- <el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('materials:update') || auth('materials:delete')">-->
|
|
||||||
<!-- <template #default="scope">-->
|
|
||||||
<!-- <el-button icon="ele-Edit" size="small" text="" type="primary" @click="editUnit(scope.row)"> 编辑 </el-button>-->
|
|
||||||
<!-- <el-button icon="ele-Delete" size="small" text="" type="primary" @click="deleteUnit(scope.row)" > 删除 </el-button>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<!-- </el-table>-->
|
|
||||||
<!-- <el-pagination-->
|
|
||||||
<!-- v-model:currentPage="tableParams.page"-->
|
|
||||||
<!-- v-model:page-size="tableParams.pageSize"-->
|
|
||||||
<!-- :total="tableParams.total"-->
|
|
||||||
<!-- :page-sizes="[10, 20, 50, 100, 200, 500]"-->
|
|
||||||
<!-- small=""-->
|
|
||||||
<!-- background=""-->
|
|
||||||
<!-- @size-change="handleSizeChange"-->
|
|
||||||
<!-- @current-change="handleCurrentChange"-->
|
|
||||||
<!-- layout="total, sizes, prev, pager, next, jumper"-->
|
|
||||||
<!-- />-->
|
|
||||||
|
|
||||||
<vxe-table show-overflow height="100%" :data="data.unit" :border=true
|
<vxe-table show-overflow height="100%" :data="data.unit" :border=true
|
||||||
:tree-config="{ transform: true }" :scroll-y="{ gt: 20 }">
|
:tree-config="{ transform: true }" :scroll-y="{ gt: 20 }">
|
||||||
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
|
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
|
||||||
|
@ -256,12 +216,10 @@ import { SysUnitApi, SysUnitGroupApi } from '/@/api-services/api';
|
||||||
import { AddSysUnitInput, SqlSugarPagedListSysUnitOutput, SysUnitGroupOutput, SysUnitInput} from '/@/api-services/models';
|
import { AddSysUnitInput, SqlSugarPagedListSysUnitOutput, SysUnitGroupOutput, SysUnitInput} from '/@/api-services/models';
|
||||||
import type { FormRules } from "element-plus";
|
import type { FormRules } from "element-plus";
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import {auth} from "/@/utils/authFunction";
|
|
||||||
|
|
||||||
let data = reactive({
|
let data = reactive({
|
||||||
unit: [] as SqlSugarPagedListSysUnitOutput[],//单位数据
|
unit: [] as SqlSugarPagedListSysUnitOutput[],//单位数据
|
||||||
unitGroup: [] as SysUnitGroupOutput[],//单位组数据
|
unitGroup: [] as SysUnitGroupOutput[],//单位组数据
|
||||||
selectUnitGroupId:0,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const ruleFormRef = ref();
|
const ruleFormRef = ref();
|
||||||
|
@ -310,7 +268,6 @@ const unitGroup = async () => {
|
||||||
//单选
|
//单选
|
||||||
|
|
||||||
const radioChangeEvent = ({ row }) => {
|
const radioChangeEvent = ({ row }) => {
|
||||||
data.selectUnitGroupId = row.id;
|
|
||||||
unitPage({groupUnitId:row.id})
|
unitPage({groupUnitId:row.id})
|
||||||
}
|
}
|
||||||
const formInline = reactive({} as SysUnitInput)
|
const formInline = reactive({} as SysUnitInput)
|
||||||
|
@ -332,35 +289,20 @@ const addUnit= ()=>{
|
||||||
|
|
||||||
//提交
|
//提交
|
||||||
const unitSubmit = async () => {
|
const unitSubmit = async () => {
|
||||||
//校验基本单位是否唯一
|
|
||||||
let checkRes = await getAPI(SysUnitApi).apiSysUnitCheckPost(unitFrom.value);
|
|
||||||
if(checkRes.data.code === 200){
|
|
||||||
const item = checkRes.data.result;
|
|
||||||
if(mTitle.value=='新增'){
|
if(mTitle.value=='新增'){
|
||||||
if(unitFrom.value.isBaseUnit && item!=null){
|
|
||||||
ElMessage({ message: '基本单位必须唯一', type: 'error', });
|
|
||||||
unitFrom.value.isBaseUnit = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let res = await getAPI(SysUnitApi).apiSysUnitAddPost(unitFrom.value);
|
let res = await getAPI(SysUnitApi).apiSysUnitAddPost(unitFrom.value);
|
||||||
if (res.data.code===200) {
|
if (res.data.code===200) {
|
||||||
dialogTableVisible.value = false;
|
dialogTableVisible.value = false;
|
||||||
unitPage({groupUnitId:data.selectUnitGroupId});
|
unitPage();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(unitFrom.value.isBaseUnit && item!=null && item.id!=unitFrom.value.id)
|
|
||||||
{
|
|
||||||
ElMessage({ message: '基本单位必须唯一', type: 'error', });
|
|
||||||
unitFrom.value.isBaseUnit = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let res = await getAPI(SysUnitApi).apiSysUnitUpdatePost(unitFrom.value);
|
let res = await getAPI(SysUnitApi).apiSysUnitUpdatePost(unitFrom.value);
|
||||||
if (res.data.code===200) {
|
if (res.data.code===200) {
|
||||||
dialogTableVisible.value = false;
|
dialogTableVisible.value = false;
|
||||||
unitPage({groupUnitId:data.selectUnitGroupId});
|
unitPage();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editUnit=async(row:any)=>{
|
const editUnit=async(row:any)=>{
|
||||||
|
@ -379,7 +321,7 @@ const deleteUnit=async(row:any)=>{
|
||||||
let res = await getAPI(SysUnitApi).apiSysUnitDeletePost(row);
|
let res = await getAPI(SysUnitApi).apiSysUnitDeletePost(row);
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
ElMessage({ message: '成功', type: 'success', })
|
ElMessage({ message: '成功', type: 'success', })
|
||||||
unitPage();
|
unitPage()
|
||||||
//state.tableData.handleList();
|
//state.tableData.handleList();
|
||||||
} else
|
} else
|
||||||
ElMessage.error(res.data.message!)
|
ElMessage.error(res.data.message!)
|
||||||
|
@ -400,12 +342,6 @@ const editUnitGroup=async(row:any)=>{
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteUnitGroup=async(row:any)=>{
|
const deleteUnitGroup=async(row:any)=>{
|
||||||
let checkRes = await getAPI(SysUnitGroupApi).apiSysUnitGroupCheckPost({Id:row.id});
|
|
||||||
if(checkRes.data.code == 200){
|
|
||||||
const result = checkRes.data.result;
|
|
||||||
if(result){
|
|
||||||
return ElMessage.error("存在单位数据,不允许删除")
|
|
||||||
}
|
|
||||||
ElMessageBox.confirm(`确定删除?`, '提示', {
|
ElMessageBox.confirm(`确定删除?`, '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
|
@ -416,7 +352,6 @@ const deleteUnitGroup=async(row:any)=>{
|
||||||
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupDeletePost(row);
|
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupDeletePost(row);
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
ElMessage({ message: '成功', type: 'success', })
|
ElMessage({ message: '成功', type: 'success', })
|
||||||
unitGroup()
|
|
||||||
unitPage()
|
unitPage()
|
||||||
//state.tableData.handleList();
|
//state.tableData.handleList();
|
||||||
} else
|
} else
|
||||||
|
@ -425,8 +360,6 @@ const deleteUnitGroup=async(row:any)=>{
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const pageVO1 = reactive({
|
const pageVO1 = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
Loading…
Reference in New Issue