完善单位物料功能
parent
fa659428de
commit
8e81dee033
|
@ -166,5 +166,15 @@ public class MaterialsService : IDynamicApiController, ITransient
|
|||
return model!=null?true:false;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "GetMaterialsList")]
|
||||
public async Task<List<Materials>> GetMaterialsList(MaterialsUnitGetInput input)
|
||||
{
|
||||
var list = await _rep.AsQueryable().Where(a => !a.IsDelete)
|
||||
.WhereIF(input.UnitGroupId>0, u => u.UnitGroupId == input.UnitGroupId)
|
||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Unit), u => u.Unit.Equals(input.Unit))
|
||||
.ToListAsync();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -224,3 +224,21 @@ public class QueryByIdSysUnitInput : DeleteSysUnitInput
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新单位状态
|
||||
/// </summary>
|
||||
public class UpdateSysUnitEnableInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键Id
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "主键Id不能为空")]
|
||||
public string Ids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using Admin.NET.Application.Entity;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
using System.Text.RegularExpressions;
|
||||
using Nest;
|
||||
namespace Admin.NET.Application;
|
||||
/// <summary>
|
||||
/// 单位服务
|
||||
|
@ -12,6 +13,8 @@ namespace Admin.NET.Application;
|
|||
public class SysUnitService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<SysUnit> _rep;
|
||||
|
||||
|
||||
public SysUnitService(SqlSugarRepository<SysUnit> rep)
|
||||
{
|
||||
_rep = rep;
|
||||
|
@ -191,41 +194,19 @@ public class SysUnitService : IDynamicApiController, ITransient
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成编码
|
||||
/// 修改单位启用禁用状态
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ApiDescriptionSettings(Name = "createCodeNum")]
|
||||
public async Task<string> CreateCodeNum()
|
||||
[HttpPost]
|
||||
[ApiDescriptionSettings(Name = "updateBaseUnitEnable")]
|
||||
public async Task UpdateBaseUnitEnable(UpdateSysUnitEnableInput input)
|
||||
{
|
||||
string dt = DateTime.Now.ToString("yyyyMMdd");
|
||||
var unit = await _rep.AsQueryable()
|
||||
.Where(a => !a.IsDelete)
|
||||
.Where(a => a.CodeNum.Contains(dt))
|
||||
.OrderByDescending(t => t.CodeNum)
|
||||
.FirstAsync();
|
||||
if (unit != null)
|
||||
foreach (var id in input.Ids.Split(","))
|
||||
{
|
||||
Match match = Regex.Match(unit.CodeNum, @"\d+");
|
||||
if (match.Success)
|
||||
{
|
||||
string numberStr = match.Value; // 获取匹配到的数字字符串
|
||||
int number = int.Parse(numberStr); // 将数字字符串转换为整数
|
||||
number++; // 对数字进行加1操作
|
||||
|
||||
// 将结果转换回字符串,并保持与原数字相同的长度
|
||||
string paddedNumber = number.ToString().PadLeft(match.Value.Length, '0');
|
||||
return paddedNumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
return dt + "001";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return dt + "001";
|
||||
var entity = _rep.GetById(id);
|
||||
entity.IsEnable = input.IsEnable;
|
||||
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import { AdminResultSysUnit } from '../models';
|
|||
import { DeleteSysUnitInput } from '../models';
|
||||
import { SysUnitInput } from '../models';
|
||||
import { UpdateSysUnitInput } from '../models';
|
||||
import {UpdateSysUnitEnableInput} from "/@/api-services/models/update-sys-unit-enable-input";
|
||||
/**
|
||||
* SysUnitApi - axios parameter creator
|
||||
* @export
|
||||
|
@ -410,6 +411,54 @@ export const SysUnitApiAxiosParamCreator = function (configuration?: Configurati
|
|||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
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}
|
||||
*/
|
||||
apiSysUnitUpdateEnablePost: async (body?: UpdateSysUnitEnableInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysUnit/updateBaseUnitEnable`;
|
||||
// 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 {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
|
@ -534,6 +583,19 @@ export const SysUnitApiFp = function(configuration?: Configuration) {
|
|||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 单位禁用
|
||||
* @param body
|
||||
* @param options
|
||||
*/
|
||||
async apiSysUnitUpdateEnablePost(body?: UpdateSysUnitEnableInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysUnitApiAxiosParamCreator(configuration).apiSysUnitUpdateEnablePost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -717,4 +779,14 @@ export class SysUnitApi extends BaseAPI {
|
|||
async apiSysUnitCheckPost(body?: UpdateSysUnitInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysUnitApiFp(this.configuration).apiSysUnitCheckPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param body
|
||||
* @param options
|
||||
*/
|
||||
async apiSysUnitUpdateEnablePost(body?: UpdateSysUnitEnableInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysUnitApiFp(this.configuration).apiSysUnitUpdateEnablePost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/* 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 UpdateSysUnitInput
|
||||
*/
|
||||
export interface UpdateSysUnitEnableInput {
|
||||
|
||||
/**
|
||||
* 单位组ID
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateSysUnitInput
|
||||
*/
|
||||
isEnable: boolean;
|
||||
|
||||
/**
|
||||
* 主键Id
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateSysUnitInput
|
||||
*/
|
||||
ids: string;
|
||||
}
|
|
@ -8,6 +8,7 @@ enum Api {
|
|||
ListMaterials = '/api/materials/list',
|
||||
MtListBySourceId = '/api/materialList/listBySourceId',
|
||||
CheckMaterials = '/api/materials/CheckById',
|
||||
GetMaterialsList = '/api/materials/GetMaterialsList',
|
||||
}
|
||||
|
||||
// 增加物料
|
||||
|
@ -72,4 +73,12 @@ export const materialListBySourceId = (sourceId: any) =>
|
|||
url: Api.MtListBySourceId,
|
||||
method: 'get',
|
||||
data: { sourceId },
|
||||
});
|
||||
});
|
||||
|
||||
// 获取物料集合
|
||||
export const listMaterialByUnit = (unitGroupId: any,unit:any) =>
|
||||
request({
|
||||
url: Api.GetMaterialsList,
|
||||
method: 'post',
|
||||
data: { UnitGroupId:unitGroupId,Unit:unit },
|
||||
});
|
|
@ -1,164 +1,171 @@
|
|||
<!-- 物料 -->
|
||||
<template>
|
||||
<div class="sys-open-access-container">
|
||||
<el-dialog v-model="state.isShowDialog" :title="props.title" width="1000">
|
||||
<el-form :inline="true" :model="ruleForm" class="demo-form-inline" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="物料类型" :rules="[{ required: true, message: '物料类型不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入名称" clearable maxlength="32" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row style="display: flex; justify-content: space-around;">
|
||||
<el-button style="width: 100px;" type="primary" @click="matterSubmit">提交</el-button>
|
||||
<el-button style="width: 100px;" @click="closeDialog">取消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div class="sys-open-access-container">
|
||||
<el-dialog v-model="state.isShowDialog" :title="props.title" width="1000">
|
||||
<el-form ref="ruleFormRef" :inline="true" :model="state.ruleForm" class="demo-form-inline" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="name" label="物料类型" :rules="[{ required: true, message: '物料类型不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="state.ruleForm.name" placeholder="请输入名称" clearable maxlength="32"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button style="width: 100px;" type="primary" @click="matterSubmit">提交</el-button>
|
||||
<el-button style="width: 100px;" @click="closeDialog">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { BrandApi, MaterialClassifyApi, PackageInfoApi, SysUnitGroupApi,SysUnitApi } from '/@/api-services/api';
|
||||
import { AddMaterialsInput, BrandOutput, MaterialsOutput, PackageInfoOutput, SysUnitGroupOutput, SysUnitOutput} from '/@/api-services/models';
|
||||
import { ElMessageBox, ElMessage, TabsPaneContext } from 'element-plus';
|
||||
import { addMaterials, updateMaterials,detailMaterials } from '/@/api/main/materials';
|
||||
import { listUnitGroup } from '/@/api/main/unit';
|
||||
import {onMounted, reactive, ref} from 'vue';
|
||||
import {getAPI} from '/@/utils/axios-utils';
|
||||
import {
|
||||
MaterialClassifyApi,
|
||||
} from '/@/api-services/api';
|
||||
import {
|
||||
MaterialsOutput,
|
||||
SysUnitGroupOutput,
|
||||
SysUnitOutput, UpdateMaterialClassifyInput
|
||||
} from '/@/api-services/models';
|
||||
import {ElMessageBox, ElMessage, TabsPaneContext} from 'element-plus';
|
||||
import {addMaterialsClassify, detailMaterialsClassify, updateMaterialsClassify} from "/@/api/main/materialClassify";
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
orgData: Array<MaterialsOutput>,
|
||||
title: String,
|
||||
orgData: Array<MaterialsOutput>,
|
||||
});
|
||||
//父级传递来的函数,用于回调
|
||||
const emit = defineEmits(["reloadTable"]);
|
||||
//父级传递来的函数,用于回调
|
||||
const emit = defineEmits(["reloadTable"]);
|
||||
|
||||
//获取物料分类
|
||||
let fyListData = ref();
|
||||
|
||||
const fyListGet = async () => {
|
||||
let res = await getAPI(MaterialClassifyApi).apiMaterialClassifyListGet();
|
||||
if (res.data.code === 200) {
|
||||
fyListData.value = res.data.result;
|
||||
}
|
||||
let res = await getAPI(MaterialClassifyApi).apiMaterialClassifyListGet();
|
||||
if (res.data.code === 200) {
|
||||
fyListData.value = res.data.result;
|
||||
}
|
||||
}
|
||||
|
||||
const ruleForm = ref<any>({});
|
||||
const ruleFormRef = ref();
|
||||
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
isShowDialog:false,
|
||||
editClassifyOpenAccessTitle:'新增',
|
||||
tableData: [] ,//as Array<MaterialsOutput>
|
||||
orgTreeData: [] ,//as Array<MaterialsOutput>
|
||||
//matterFrom: {} ,//as AddMaterialsInput
|
||||
queryParams: {
|
||||
name: undefined,
|
||||
},
|
||||
tableParams: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0 as any,
|
||||
},
|
||||
editPrintTitle: '',
|
||||
unitGroupData:[] as Array<SysUnitGroupOutput>,
|
||||
unitData:[] as Array<SysUnitOutput>,
|
||||
loading: false,
|
||||
isShowDialog: false,
|
||||
editClassifyOpenAccessTitle: '新增',
|
||||
tableData: [],//as Array<MaterialsOutput>
|
||||
orgTreeData: [],//as Array<MaterialsOutput>
|
||||
//matterFrom: {} ,//as AddMaterialsInput
|
||||
queryParams: {
|
||||
name: undefined,
|
||||
},
|
||||
tableParams: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0 as any,
|
||||
},
|
||||
editPrintTitle: '',
|
||||
unitGroupData: [] as Array<SysUnitGroupOutput>,
|
||||
unitData: [] as Array<SysUnitOutput>,
|
||||
ruleForm: {} as UpdateMaterialClassifyInput,
|
||||
});
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
//ruleFormRef.value?.resetFields();
|
||||
//state.selectedTabName = '0'; // 重置为第一个 tab 页
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
ruleForm.value = (await detailMaterialsClassify(rowData.id)).data.result;
|
||||
else{
|
||||
ruleForm.value = rowData;
|
||||
ruleForm.value.isEnable=true;
|
||||
}
|
||||
state.isShowDialog = true;
|
||||
ruleFormRef.value?.resetFields();
|
||||
//state.selectedTabName = '0'; // 重置为第一个 tab 页
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
state.ruleForm = (await detailMaterialsClassify(rowData.id)).data.result;
|
||||
else {
|
||||
state.ruleForm = rowData;
|
||||
}
|
||||
state.isShowDialog = true;
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fyListGet();
|
||||
fyListGet();
|
||||
});
|
||||
|
||||
//提交
|
||||
const matterSubmit = async () => {
|
||||
const matterSubmit = () => {
|
||||
ruleFormRef.value.validate(async (valid: boolean) => {
|
||||
if (!valid) return;
|
||||
let res;
|
||||
if (props.title=='添加物料类型'){
|
||||
res = await addMaterialsClassify(ruleForm.value);
|
||||
}
|
||||
else {
|
||||
res = await updateMaterialsClassify(ruleForm.value);
|
||||
if (props.title == '添加物料类型') {
|
||||
res = await addMaterialsClassify(state.ruleForm);
|
||||
} else {
|
||||
res = await updateMaterialsClassify(state.ruleForm);
|
||||
}
|
||||
//console.log(res)
|
||||
|
||||
if (res.data.code == 200) {
|
||||
state.isShowDialog = false;
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
//state.tableData.handleList();
|
||||
}
|
||||
else
|
||||
ElMessage.error(res.message!)
|
||||
state.isShowDialog = false;
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
//state.tableData.handleList();
|
||||
} else
|
||||
ElMessage.error(res.message!)
|
||||
emit("reloadTable");
|
||||
closeDialog();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 导出对象
|
||||
defineExpose({ openDialog });
|
||||
defineExpose({openDialog});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.main {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.main-from {
|
||||
// height: 300px;
|
||||
width: 100%;
|
||||
padding: 20px 10px;
|
||||
|
||||
.el-row {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.main-table {
|
||||
margin-top: 20px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
flex-grow: 1;
|
||||
height: 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.main-from {
|
||||
// height: 300px;
|
||||
width: 100%;
|
||||
padding: 20px 10px;
|
||||
|
||||
.el-row {
|
||||
width: 100%;
|
||||
}
|
||||
.tab {
|
||||
flex: 1;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.main-table {
|
||||
margin-top: 20px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
flex-grow: 1;
|
||||
height: 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tab {
|
||||
flex: 1;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.tab-hed {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 5px;
|
||||
align-items: center;
|
||||
}
|
||||
.tab-hed {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 5px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -2,11 +2,11 @@
|
|||
<template>
|
||||
<div class="sys-open-access-container">
|
||||
<el-dialog v-model="state.isShowDialog" :title="props.title" width="1000">
|
||||
<el-form :inline="true" :model="ruleForm" class="demo-form-inline" label-width="90px">
|
||||
<el-form ref="ruleFormRef" :inline="true" :model="ruleForm" class="demo-form-inline" label-width="90px">
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="名称" :rules="[{ required: true, message: '分销单位不能为空', trigger: 'blur' }]">
|
||||
<el-form-item prop="name" label="名称" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -16,7 +16,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="分类" :rules="[{ required: true, message: '分销单位不能为空', trigger: 'blur' }]">
|
||||
<el-form-item prop="classify" label="分类" :rules="[{ required: true, message: '分类不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="ruleForm.classify" placeholder="请选择" clearable>
|
||||
<el-option :label="item.name" :value="item.id" v-for="item, index in fyListData"
|
||||
:key="index" />
|
||||
|
@ -178,6 +178,20 @@
|
|||
</vxe-column>
|
||||
</vxe-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="操作信息" name="操作信息">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建人" >
|
||||
<el-input v-model="ruleForm.createUserName" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="修改人" >
|
||||
<el-input v-model="ruleForm.updateUserName" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<el-row style="display: flex; justify-content: space-around;">
|
||||
|
@ -215,7 +229,7 @@ const fyListGet = async () => {
|
|||
}
|
||||
|
||||
const ruleForm = ref<any>({});
|
||||
|
||||
const ruleFormRef = ref();
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
isShowDialog:false,
|
||||
|
@ -238,8 +252,8 @@ const state = reactive({
|
|||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
//ruleFormRef.value?.resetFields();
|
||||
//state.selectedTabName = '0'; // 重置为第一个 tab 页
|
||||
ruleFormRef.value?.resetFields();
|
||||
state.selectedTabName = '0'; // 重置为第一个 tab 页
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
ruleForm.value = (await detailMaterials(rowData.id)).data.result;
|
||||
|
@ -307,26 +321,28 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|||
|
||||
//提交
|
||||
const matterSubmit = async () => {
|
||||
let res;
|
||||
if (props.title=='添加物料'){
|
||||
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
|
||||
if (isValid) {
|
||||
let res;
|
||||
if (props.title == '添加物料') {
|
||||
res = await addMaterials(ruleForm.value);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
res = await updateMaterials(ruleForm.value);
|
||||
}
|
||||
//console.log(res)
|
||||
}
|
||||
//console.log(res)
|
||||
|
||||
if (res.data.code == 200) {
|
||||
if (res.data.code == 200) {
|
||||
state.isShowDialog = false;
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
//state.tableData.handleList();
|
||||
}
|
||||
else
|
||||
} else
|
||||
ElMessage.error(res.message!)
|
||||
closeDialog();
|
||||
closeDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -124,6 +124,8 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" label="备注" width="200" show-overflow-tooltip="" />
|
||||
<el-table-column prop="updateUserName" label="修改人" show-overflow-tooltip=""/>
|
||||
<el-table-column prop="updateTime" label="修改时间" 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="openEditMaterials(scope.row)" v-auth="'materials:update'"> 编辑 </el-button>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,5 @@
|
|||
<template>
|
||||
<div class="reportDetailTable-container">
|
||||
<el-dialog v-model="isShowDialog" :width="800" draggable="">
|
||||
<template #header>
|
||||
<div style="color: #fff">
|
||||
<!--<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>-->
|
||||
<span>{{ props.title }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="reportDetailTable-container" style="height: 100vh">
|
||||
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
|
||||
<el-row :gutter="35">
|
||||
<el-form-item v-show="false">
|
||||
|
@ -169,17 +162,24 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="footer" align="right" >
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.footer {
|
||||
position: fixed; /* 固定定位 */
|
||||
left: 0;
|
||||
bottom: 60px;
|
||||
width: 100%; /* 宽度占满整个屏幕 */
|
||||
color: #fff; /* 文字颜色 */
|
||||
padding: 10px; /* 可根据需要添加内边距 */
|
||||
text-align: right; /* 文字居中 */
|
||||
}
|
||||
:deep(.el-select),
|
||||
:deep(.el-input-number) {
|
||||
width: 100%;
|
||||
|
@ -205,9 +205,10 @@
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
row: Object
|
||||
});
|
||||
//父级传递来的函数,用于回调
|
||||
const emit = defineEmits(["reloadTable"]);
|
||||
const emit = defineEmits(["reloadTable","back"]);
|
||||
const ruleFormRef = ref();
|
||||
const isShowDialog = ref(false);
|
||||
const ruleForm = ref<any>({});
|
||||
|
@ -227,23 +228,38 @@
|
|||
const teamOfGroups = ref<any>([]);
|
||||
const employees = ref<any>([]);
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = async (row: any) => {
|
||||
// ruleForm.value = JSON.parse(JSON.stringify(row));
|
||||
// 改用detail获取最新数据来编辑
|
||||
let rowData = JSON.parse(JSON.stringify(row));
|
||||
if (rowData.id)
|
||||
ruleForm.value = (await detailReportDetailTable(rowData.id)).data.result;
|
||||
else
|
||||
ruleForm.value = rowData;
|
||||
onMounted(async () => {
|
||||
if(props.row) {
|
||||
let rowData = JSON.parse(JSON.stringify(props.row));
|
||||
if (rowData.id)
|
||||
ruleForm.value = (await detailReportDetailTable(rowData.id)).data.result;
|
||||
else
|
||||
ruleForm.value = rowData;
|
||||
|
||||
if(rowData.updateUserId){
|
||||
currentMaterial.value= (await detailMaterials(rowData.materialsId)).data.result;
|
||||
//console.log(materials.value);
|
||||
}
|
||||
isShowDialog.value = true;
|
||||
//console.log(ruleForm.value);
|
||||
};
|
||||
if (rowData.updateUserId) {
|
||||
currentMaterial.value = (await detailMaterials(rowData.materialsId)).data.result;
|
||||
//console.log(materials.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// // 打开弹窗
|
||||
// const openDialog = async (row: any) => {
|
||||
// // ruleForm.value = JSON.parse(JSON.stringify(row));
|
||||
// // 改用detail获取最新数据来编辑
|
||||
// let rowData = JSON.parse(JSON.stringify(row));
|
||||
// if (rowData.id)
|
||||
// ruleForm.value = (await detailReportDetailTable(rowData.id)).data.result;
|
||||
// else
|
||||
// ruleForm.value = rowData;
|
||||
//
|
||||
// if(rowData.updateUserId){
|
||||
// currentMaterial.value= (await detailMaterials(rowData.materialsId)).data.result;
|
||||
// //console.log(materials.value);
|
||||
// }
|
||||
// isShowDialog.value = true;
|
||||
// //console.log(ruleForm.value);
|
||||
// };
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
|
@ -253,7 +269,8 @@
|
|||
|
||||
// 取消
|
||||
const cancel = () => {
|
||||
isShowDialog.value = false;
|
||||
emit("reloadTable");
|
||||
emit("back");
|
||||
};
|
||||
|
||||
// 提交
|
||||
|
@ -266,7 +283,8 @@
|
|||
} else {
|
||||
await updateReportDetailTable(values);
|
||||
}
|
||||
closeDialog();
|
||||
emit("reloadTable");
|
||||
emit("back");
|
||||
} else {
|
||||
ElMessage({
|
||||
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
|
||||
|
@ -305,7 +323,7 @@
|
|||
});
|
||||
|
||||
//将属性或者函数暴露给父组件
|
||||
defineExpose({ openDialog });
|
||||
// defineExpose({ openDialog });
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
@ -1,181 +1,181 @@
|
|||
<template>
|
||||
<div class="reportDetailTable-container">
|
||||
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
||||
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="queryParams.searchKey" clearable="" placeholder="请输入模糊查询关键字"/>
|
||||
<div v-if="!state.editShow" class="reportDetailTable-container">
|
||||
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
||||
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="queryParams.searchKey" clearable="" placeholder="请输入模糊查询关键字"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="产品名称">
|
||||
<el-input v-model="queryParams.productName" clearable="" placeholder="请输入产品名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="产品名称">
|
||||
<el-input v-model="queryParams.productName" clearable="" placeholder="请输入产品名称"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="产品编码">
|
||||
<el-input v-model="queryParams.productCodeNum" clearable="" placeholder="请输入产品编码"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="产品编码">
|
||||
<el-input v-model="queryParams.productCodeNum" clearable="" placeholder="请输入产品编码"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="单号">
|
||||
<el-input v-model="queryParams.oddNumber" clearable="" placeholder="请输入单号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="单号">
|
||||
<el-input v-model="queryParams.oddNumber" clearable="" placeholder="请输入单号"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="状态">
|
||||
<el-input v-model="queryParams.state" clearable="" placeholder="请输入状态"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="状态">
|
||||
<el-input v-model="queryParams.state" clearable="" placeholder="请输入状态"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产类型">
|
||||
<el-input v-model="queryParams.productType" clearable="" placeholder="请输入生产类型"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产类型">
|
||||
<el-input v-model="queryParams.productType" clearable="" placeholder="请输入生产类型"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产线">
|
||||
<el-input v-model="queryParams.productionLine" clearable="" placeholder="请输入生产线"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产线">
|
||||
<el-input v-model="queryParams.productionLine" clearable="" placeholder="请输入生产线"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产线编码">
|
||||
<el-input v-model="queryParams.codeNum" clearable="" placeholder="请输入生产线编码"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产线编码">
|
||||
<el-input v-model="queryParams.codeNum" clearable="" placeholder="请输入生产线编码"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="源单号">
|
||||
<el-input v-model="queryParams.sourceNumber" clearable="" placeholder="请输入源单号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="源单号">
|
||||
<el-input v-model="queryParams.sourceNumber" clearable="" placeholder="请输入源单号"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="queryParams.specifications" clearable="" placeholder="请输入规格型号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="queryParams.specifications" clearable="" placeholder="请输入规格型号"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="完工数量">
|
||||
<el-input-number v-model="queryParams.productCount" clearable="" placeholder="请输入完工数量"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="完工数量">
|
||||
<el-input-number v-model="queryParams.productCount" clearable="" placeholder="请输入完工数量"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="入库数量">
|
||||
<el-input-number v-model="queryParams.putWarehouse" clearable="" placeholder="请输入入库数量"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="入库数量">
|
||||
<el-input-number v-model="queryParams.putWarehouse" clearable="" placeholder="请输入入库数量"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="基本完工数量">
|
||||
<el-input-number v-model="queryParams.baseProductCount" clearable="" placeholder="请输入基本完工数量"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="基本完工数量">
|
||||
<el-input-number v-model="queryParams.baseProductCount" clearable="" placeholder="请输入基本完工数量"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="基本入库数量">
|
||||
<el-input-number v-model="queryParams.basePutWarehouse" clearable="" placeholder="请输入基本入库数量"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="基本入库数量">
|
||||
<el-input-number v-model="queryParams.basePutWarehouse" clearable="" placeholder="请输入基本入库数量"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="queryParams.unit" clearable="" placeholder="请输入单位"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="单位">
|
||||
<el-input v-model="queryParams.unit" clearable="" placeholder="请输入单位"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="基本单位">
|
||||
<el-input v-model="queryParams.baseUnit" clearable="" placeholder="请输入基本单位"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="基本单位">
|
||||
<el-input v-model="queryParams.baseUnit" clearable="" placeholder="请输入基本单位"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="批次">
|
||||
<el-input v-model="queryParams.batch" clearable="" placeholder="请输入批次"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="批次">
|
||||
<el-input v-model="queryParams.batch" clearable="" placeholder="请输入批次"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="包装规格">
|
||||
<el-input v-model="queryParams.package" clearable="" placeholder="请输入包装规格"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="包装规格">
|
||||
<el-input v-model="queryParams.package" clearable="" placeholder="请输入包装规格"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="包装数量">
|
||||
<el-input-number v-model="queryParams.packageCount" clearable="" placeholder="请输入包装数量"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="包装数量">
|
||||
<el-input-number v-model="queryParams.packageCount" clearable="" placeholder="请输入包装数量"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="采集失败数量">
|
||||
<el-input-number v-model="queryParams.gatherFalseCount" clearable="" placeholder="请输入采集失败数量"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="采集失败数量">
|
||||
<el-input-number v-model="queryParams.gatherFalseCount" clearable="" placeholder="请输入采集失败数量"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产日期">
|
||||
<el-date-picker placeholder="请选择生产日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.productDateRange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="生产日期">
|
||||
<el-date-picker placeholder="请选择生产日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.productDateRange" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="班组">
|
||||
<el-input v-model="queryParams.teamGroup" clearable="" placeholder="请输入班组"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="班组">
|
||||
<el-input v-model="queryParams.teamGroup" clearable="" placeholder="请输入班组"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="操作工人">
|
||||
<el-input v-model="queryParams.operator" clearable="" placeholder="请输入操作工人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="操作工人">
|
||||
<el-input v-model="queryParams.operator" clearable="" placeholder="请输入操作工人"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="完工时间">
|
||||
<el-date-picker placeholder="请选择完工时间" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.endDateRange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="完工时间">
|
||||
<el-date-picker placeholder="请选择完工时间" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.endDateRange" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="源单号">
|
||||
<el-input v-model="queryParams.sourceOddNumber" clearable="" placeholder="请输入源单号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="源单号">
|
||||
<el-input v-model="queryParams.sourceOddNumber" clearable="" placeholder="请输入源单号"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryParams.remarks" clearable="" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryParams.remarks" clearable="" placeholder="请输入备注"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
|
||||
<el-form-item>
|
||||
<el-button-group style="display: flex; align-items: center;">
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'reportDetailTable:page'"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
|
||||
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 高级查询 </el-button>
|
||||
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 隐藏 </el-button>
|
||||
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddReportDetailTable" v-auth="'reportDetailTable:add'"> 新增 </el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
|
||||
<el-form-item>
|
||||
<el-button-group style="display: flex; align-items: center;">
|
||||
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'reportDetailTable:page'"> 查询 </el-button>
|
||||
<el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
|
||||
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 高级查询 </el-button>
|
||||
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 隐藏 </el-button>
|
||||
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddReportDetailTable" v-auth="'reportDetailTable:add'"> 新增 </el-button>
|
||||
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
|
@ -229,21 +229,27 @@
|
|||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
/>
|
||||
<editDialog
|
||||
ref="editDialogRef"
|
||||
:title="editReportDetailTableTitle"
|
||||
@reloadTable="handleQuery"
|
||||
/>
|
||||
<printDetailDialog
|
||||
ref="printDetailDialogRef"
|
||||
:title="printDetailTableTitle"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
<div v-else class="reportDetailTable-container">
|
||||
<el-card >
|
||||
<editDialog
|
||||
ref="editDialogRef"
|
||||
:title="editReportDetailTableTitle"
|
||||
:row = "state.editRow"
|
||||
@reloadTable="handleQuery"
|
||||
@back="closeReportDetailTable"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup="" name="reportDetailTable">
|
||||
import { ref } from "vue";
|
||||
import {reactive, ref} from "vue";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import { auth } from '/@/utils/authFunction';
|
||||
|
||||
|
@ -258,6 +264,10 @@
|
|||
const loading = ref(false);
|
||||
const tableData = ref<any>([]);
|
||||
const queryParams = ref<any>({});
|
||||
const state = reactive({
|
||||
editShow: false,
|
||||
editRow:{}
|
||||
})
|
||||
const tableParams = ref({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
|
@ -282,6 +292,7 @@
|
|||
loading.value = false;
|
||||
};
|
||||
|
||||
|
||||
// 列排序
|
||||
const sortChange = async (column: any) => {
|
||||
queryParams.value.field = column.prop;
|
||||
|
@ -291,15 +302,22 @@
|
|||
|
||||
// 打开新增页面
|
||||
const openAddReportDetailTable = () => {
|
||||
editReportDetailTableTitle.value = '添加汇报单详情';
|
||||
editDialogRef.value.openDialog({});
|
||||
state.editRow = null;
|
||||
state.editShow = true;
|
||||
};
|
||||
|
||||
// 关闭页面
|
||||
const closeReportDetailTable = () => {
|
||||
state.editShow = false;
|
||||
};
|
||||
|
||||
|
||||
// 打开编辑页面
|
||||
const openEditReportDetailTable = (row: any) => {
|
||||
editReportDetailTableTitle.value = '编辑汇报单详情';
|
||||
editDialogRef.value.openDialog(row);
|
||||
state.editRow = row;
|
||||
state.editShow = true;
|
||||
// editReportDetailTableTitle.value = '编辑汇报单详情';
|
||||
// editDialogRef.value.openDialog(row);
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue