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> <template>
<div class="sys-open-access-container"> <div class="sys-open-access-container">
<el-dialog v-model="state.isShowDialog" :title="props.title" width="1000"> <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-form :inline="true" :model="ruleForm" class="demo-form-inline" label-width="90px">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name" label="物料类型" :rules="[{ required: true, message: '物料类型不能为空', trigger: 'blur' }]"> <el-form-item label="物料类型" :rules="[{ required: true, message: '物料类型不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.name" placeholder="请输入名称" clearable maxlength="32"/> <el-input v-model="ruleForm.name" placeholder="请输入名称" clearable maxlength="32" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <el-row style="display: flex; justify-content: space-around;">
<span class="dialog-footer"> <el-button style="width: 100px;" type="primary" @click="matterSubmit"></el-button>
<el-button style="width: 100px;" type="primary" @click="matterSubmit"></el-button> <el-button style="width: 100px;" @click="closeDialog"></el-button>
<el-button style="width: 100px;" @click="closeDialog"></el-button> </el-row>
</span> </el-dialog>
</template> </div>
</el-dialog>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {onMounted, reactive, ref} from 'vue'; import { onMounted, reactive, ref } from 'vue';
import {getAPI} from '/@/utils/axios-utils'; import { getAPI } from '/@/utils/axios-utils';
import { import { BrandApi, MaterialClassifyApi, PackageInfoApi, SysUnitGroupApi,SysUnitApi } from '/@/api-services/api';
MaterialClassifyApi, import { AddMaterialsInput, BrandOutput, MaterialsOutput, PackageInfoOutput, SysUnitGroupOutput, SysUnitOutput} from '/@/api-services/models';
} from '/@/api-services/api'; import { ElMessageBox, ElMessage, TabsPaneContext } from 'element-plus';
import { import { addMaterials, updateMaterials,detailMaterials } from '/@/api/main/materials';
MaterialsOutput, import { listUnitGroup } from '/@/api/main/unit';
SysUnitGroupOutput,
SysUnitOutput, UpdateMaterialClassifyInput
} from '/@/api-services/models';
import {ElMessageBox, ElMessage, TabsPaneContext} from 'element-plus';
import {addMaterialsClassify, detailMaterialsClassify, updateMaterialsClassify} from "/@/api/main/materialClassify"; import {addMaterialsClassify, detailMaterialsClassify, updateMaterialsClassify} from "/@/api/main/materialClassify";
const props = defineProps({ const props = defineProps({
title: String, title: String,
orgData: Array<MaterialsOutput>, orgData: Array<MaterialsOutput>,
}); });
// //
const emit = defineEmits(["reloadTable"]); const emit = defineEmits(["reloadTable"]);
// //
let fyListData = ref(); let fyListData = ref();
const fyListGet = async () => { const fyListGet = async () => {
let res = await getAPI(MaterialClassifyApi).apiMaterialClassifyListGet(); let res = await getAPI(MaterialClassifyApi).apiMaterialClassifyListGet();
if (res.data.code === 200) { if (res.data.code === 200) {
fyListData.value = res.data.result; fyListData.value = res.data.result;
} }
} }
const ruleFormRef = ref();
const ruleForm = ref<any>({});
const state = reactive({ const state = reactive({
loading: false, loading: false,
isShowDialog: false, isShowDialog:false,
editClassifyOpenAccessTitle: '新增', editClassifyOpenAccessTitle:'新增',
tableData: [],//as Array<MaterialsOutput> tableData: [] ,//as Array<MaterialsOutput>
orgTreeData: [],//as Array<MaterialsOutput> orgTreeData: [] ,//as Array<MaterialsOutput>
//matterFrom: {} ,//as AddMaterialsInput //matterFrom: {} ,//as AddMaterialsInput
queryParams: { queryParams: {
name: undefined, name: undefined,
}, },
tableParams: { tableParams: {
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0 as any, total: 0 as any,
}, },
editPrintTitle: '', editPrintTitle: '',
unitGroupData: [] as Array<SysUnitGroupOutput>, unitGroupData:[] as Array<SysUnitGroupOutput>,
unitData: [] as Array<SysUnitOutput>, unitData:[] as Array<SysUnitOutput>,
ruleForm: {} as UpdateMaterialClassifyInput,
}); });
// //
const openDialog = async (row: any) => { const openDialog = async (row: any) => {
ruleFormRef.value?.resetFields(); //ruleFormRef.value?.resetFields();
//state.selectedTabName = '0'; // tab //state.selectedTabName = '0'; // tab
let rowData = JSON.parse(JSON.stringify(row)); let rowData = JSON.parse(JSON.stringify(row));
if (rowData.id) if (rowData.id)
state.ruleForm = (await detailMaterialsClassify(rowData.id)).data.result; ruleForm.value = (await detailMaterialsClassify(rowData.id)).data.result;
else { else{
state.ruleForm = rowData; ruleForm.value = rowData;
} ruleForm.value.isEnable=true;
state.isShowDialog = true; }
state.isShowDialog = true;
}; };
// //
const closeDialog = () => { const closeDialog = () => {
state.isShowDialog = false; state.isShowDialog = false;
}; };
onMounted(() => { onMounted(() => {
fyListGet(); fyListGet();
}); });
// //
const matterSubmit = () => { const matterSubmit = async () => {
ruleFormRef.value.validate(async (valid: boolean) => {
if (!valid) return;
let res; let res;
if (props.title == '添加物料类型') { if (props.title=='添加物料类型'){
res = await addMaterialsClassify(state.ruleForm); res = await addMaterialsClassify(ruleForm.value);
} else { }
res = await updateMaterialsClassify(state.ruleForm); else {
res = await updateMaterialsClassify(ruleForm.value);
} }
//console.log(res) //console.log(res)
if (res.data.code == 200) { if (res.data.code == 200) {
state.isShowDialog = false; state.isShowDialog = false;
ElMessage({ ElMessage({
message: '成功', message: '成功',
type: 'success', type: 'success',
}) })
//state.tableData.handleList(); //state.tableData.handleList();
} else }
ElMessage.error(res.message!) else
ElMessage.error(res.message!)
emit("reloadTable"); emit("reloadTable");
closeDialog(); closeDialog();
});
} }
// //
defineExpose({openDialog}); defineExpose({ openDialog });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main { .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; padding: 10px;
flex-grow: 1;
height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.tab { .main-from {
flex: 1; // height: 300px;
overflow: scroll; width: 100%;
padding: 20px 10px;
.el-row {
width: 100%;
}
} }
.tab-hed { .main-table {
display: flex; margin-top: 20px;
justify-content: space-between; box-sizing: border-box;
margin: 5px; padding: 10px;
align-items: center; 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> </style>

File diff suppressed because it is too large Load Diff