Merge remote-tracking branch 'origin/main'

# Conflicts:
#	Web/src/views/basics-date/matter/component/editClassifyOpenAccess.vue
#	Web/src/views/basics-date/unit/index.vue
main
ljh 2024-07-03 23:47:35 +08:00
commit 755dba17cf
3 changed files with 563 additions and 625 deletions

View File

@ -259,3 +259,34 @@ public class QueryByIdMaterialsInput : DeleteMaterialsInput
{
}
/// <summary>
///
/// </summary>
public class MaterialsUnitInput : MaterialsBaseInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
///
/// </summary>
public class MaterialsUnitGetInput
{
/// <summary>
/// 单位组ID
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public virtual long UnitGroupId { get; set; }
/// <summary>
/// 基本单位
/// </summary>
public virtual string Unit { get; set; }
}

View File

@ -1,171 +1,164 @@
<!-- 物料 -->
<template>
<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>
<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>
</template>
<script setup lang="ts">
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 { 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 {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 ruleFormRef = ref();
const ruleForm = ref<any>({});
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>,
ruleForm: {} as UpdateMaterialClassifyInput,
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>,
});
//
const openDialog = async (row: any) => {
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;
//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;
};
//
const closeDialog = () => {
state.isShowDialog = false;
};
//
const closeDialog = () => {
state.isShowDialog = false;
};
onMounted(() => {
fyListGet();
fyListGet();
});
//
const matterSubmit = () => {
ruleFormRef.value.validate(async (valid: boolean) => {
if (!valid) return;
const matterSubmit = async () => {
let res;
if (props.title == '添加物料类型') {
res = await addMaterialsClassify(state.ruleForm);
} else {
res = await updateMaterialsClassify(state.ruleForm);
if (props.title=='添加物料类型'){
res = await addMaterialsClassify(ruleForm.value);
}
else {
res = await updateMaterialsClassify(ruleForm.value);
}
//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;
.tab {
flex: 1;
overflow: scroll;
.main-from {
// height: 300px;
width: 100%;
padding: 20px 10px;
.el-row {
width: 100%;
}
}
.tab-hed {
display: flex;
justify-content: space-between;
margin: 5px;
align-items: center;
.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;
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff