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-04 23:31:47 +08:00
parent 755dba17cf
commit 495d66bc20
7 changed files with 812 additions and 663 deletions

View File

@ -5,6 +5,7 @@ enum Api {
UpdateReportDetailTable = '/api/reportDetailTable/update',
PageReportDetailTable = '/api/reportDetailTable/page',
DetailReportDetailTable = '/api/reportDetailTable/detail',
UpdateStateReportDetailTable = '/api/reportDetailTable/UpdateState',
}
// 增加汇报单详情
@ -47,4 +48,12 @@ export const detailReportDetailTable = (id: any) =>
data: { id },
});
// 审核汇报单
export const updateStateReportDetailTable = (params?: any) =>
request({
url: Api.UpdateStateReportDetailTable,
method: 'post',
data: params,
});

View File

@ -166,6 +166,7 @@
</template>
<script lang="ts" setup="" name="matter">
import {ElMessageBox, ElMessage, ElTable} from "element-plus";
import { auth } from '/@/utils/authFunction';
@ -177,7 +178,6 @@
listMaterialsClassify,
} from "/@/api/main/materialClassify";
import {ref} from "vue";
const currentRow = ref();
const singleTableRef = ref<InstanceType<typeof ElTable>>();
const showAdvanceQueryUI = ref(false);

View File

@ -5,12 +5,12 @@
<el-row>
<el-col :span="8">
<el-form-item label="名称">
<el-input v-model="formInline.name" placeholder="请输入名称" clearable />
<el-input v-model="formInline.name" placeholder="请输入名称" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="编码">
<el-input v-model="formInline.codeNum" placeholder="请输入编码" clearable />
<el-input v-model="formInline.codeNum" placeholder="请输入编码" clearable/>
</el-form-item>
</el-col>
</el-row>
@ -18,8 +18,8 @@
<el-form-item>
<el-button type="primary" @click="unitPage({groupUnitId:data.selectUnitGroupId})"></el-button>
<el-button type="primary" @click="addUnit"></el-button>
<el-button @click="''"></el-button>
<el-button @click="''"></el-button>
<el-button @click="unitUpdateEnable(true)"></el-button>
<el-button @click="unitUpdateEnable(false)"></el-button>
</el-form-item>
</el-form>
</div>
@ -33,7 +33,9 @@
<div>
<el-button type="success" link
@click.prevent="addUnitGroup"
style="border-right: 1px #515a6e solid; border-radius: 0px; margin-right: 3px; padding: 0 3px;">新增</el-button>
style="border-right: 1px #515a6e solid; border-radius: 0px; margin-right: 3px; padding: 0 3px;">
新增
</el-button>
</div>
</div>
<div style="height: 100%;">
@ -53,7 +55,9 @@
<vxe-column title="操作" width="150" fixed="right" show-overflow>
<template #default="{ row }">
<vxe-button type="text" @click="editUnitGroup(row)" icon="vxe-icon-edit">修改</vxe-button>
<vxe-button type="text" @click="deleteUnitGroup(row)" icon="vxe-icon-delete" style="color: rgb(223, 65, 65)">删除</vxe-button>
<vxe-button type="text" @click="deleteUnitGroup(row)" icon="vxe-icon-delete"
style="color: rgb(223, 65, 65)">删除
</vxe-button>
<!-- <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> -->
</template>
</vxe-column>
@ -69,64 +73,68 @@
v-loading="loading"
tooltip-effect="light"
row-key="id"
@selection-change="handleSelectionChange"
border="">
<el-table-column type="selection" width="60" />
<el-table-column prop="codeNum" label="编码" show-overflow-tooltip="" />
<el-table-column prop="name" label="名称" show-overflow-tooltip="" />
<el-table-column prop="code" label="代码" show-overflow-tooltip="" />
<el-table-column type="selection" width="60"/>
<el-table-column prop="codeNum" label="编码" show-overflow-tooltip=""/>
<el-table-column prop="name" label="名称" show-overflow-tooltip=""/>
<el-table-column prop="code" label="代码" show-overflow-tooltip=""/>
<el-table-column prop="isEnable" label="可用状态" show-overflow-tooltip="">
<template #default="scope">
{{ scope.row.isEnable ? '启用' : '关闭' }}
</template>
</el-table-column>
<el-table-column prop="childUnitCount" label="子单位数" show-overflow-tooltip="" />
<el-table-column prop="rate" label="换算率" show-overflow-tooltip="" />
<el-table-column prop="childUnitCount" label="子单位数" show-overflow-tooltip=""/>
<el-table-column prop="rate" label="换算率" show-overflow-tooltip=""/>
<el-table-column prop="isEnable" label="作为基本单位" show-overflow-tooltip="">
<template #default="scope">
{{ scope.row.isBaseUnit ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="updateUserName" label="修改人" show-overflow-tooltip="" />
<el-table-column prop="updateTime" label="修改时间" show-overflow-tooltip="" />
<el-table-column width="200" label="操作"align="center" fixed="right" show-overflow-tooltip="" v-if="auth('materials:update') || auth('materials:delete')">
<el-table-column prop="updateUserName" label="修改人" show-overflow-tooltip=""/>
<el-table-column prop="updateTime" label="修改时间" show-overflow-tooltip=""/>
<el-table-column width="200" label="操作" align="center" fixed="right" show-overflow-tooltip=""
v-if="auth('materials:update') || auth('materials:delete')">
<template #default="scope">
<vxe-button type="text" @click="editUnit(scope.row)" icon="vxe-icon-edit">修改</vxe-button>
<vxe-button type="text" @click="deleteUnit(scope.row)" icon="vxe-icon-delete" style="color: rgb(223, 65, 65)">删除</vxe-button>
<vxe-button type="text" @click="deleteUnit(scope.row)" icon="vxe-icon-delete"
style="color: rgb(223, 65, 65)">删除
</vxe-button>
</template>
</el-table-column>
</el-table>
<!-- <vxe-table show-overflow height="100%" :data="data.unit" :border=true-->
<!-- :tree-config="{ transform: true }" :scroll-y="{ gt: 20 }">-->
<!-- <vxe-column type="checkbox" width="60" fixed="left"></vxe-column>-->
<!-- <vxe-table show-overflow height="100%" :data="data.unit" :border=true-->
<!-- :tree-config="{ transform: true }" :scroll-y="{ gt: 20 }">-->
<!-- <vxe-column type="checkbox" width="60" fixed="left"></vxe-column>-->
<!-- <vxe-column field="codeNum" sortable title="编码" width=""></vxe-column>-->
<!-- <vxe-column field="name" sortable title="名称" width=""></vxe-column>-->
<!-- <vxe-column field="code" sortable title="代码" width=""></vxe-column>-->
<!-- <vxe-column field="codeNum" sortable title="编码" width=""></vxe-column>-->
<!-- <vxe-column field="name" sortable title="名称" width=""></vxe-column>-->
<!-- <vxe-column field="code" sortable title="代码" width=""></vxe-column>-->
<!-- <vxe-column sortable title="可用状态" width="">-->
<!-- <template #default="{ row }">-->
<!-- {{ row.isEnable ? '启用' : '关闭' }}-->
<!-- &lt;!&ndash; <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> &ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<!-- <vxe-column field="childUnitCount" sortable title="子单位数" width=""></vxe-column>-->
<!-- <vxe-column field="rate" sortable title="换算率" width=""></vxe-column>-->
<!-- <vxe-column field="isBaseUnit" sortable title="作为基本单位" width="">-->
<!-- <template #default="{ row }">-->
<!-- {{ row.isBaseUnit ? '是' : '否' }}-->
<!-- &lt;!&ndash; <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> &ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<!-- <vxe-column title="操作" width="200" fixed="right" show-overflow>-->
<!-- <template #default="{ row }">-->
<!-- <vxe-button type="text" @click="editUnit(row)" icon="vxe-icon-edit">修改</vxe-button>-->
<!-- <vxe-button type="text" @click="deleteUnit(row)" icon="vxe-icon-delete" style="color: rgb(223, 65, 65)">删除</vxe-button>-->
<!-- &lt;!&ndash; <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> &ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<!-- </vxe-table>-->
<!-- <vxe-column sortable title="可用状态" width="">-->
<!-- <template #default="{ row }">-->
<!-- {{ row.isEnable ? '启用' : '关闭' }}-->
<!-- &lt;!&ndash; <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> &ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<!-- <vxe-column field="childUnitCount" sortable title="子单位数" width=""></vxe-column>-->
<!-- <vxe-column field="rate" sortable title="换算率" width=""></vxe-column>-->
<!-- <vxe-column field="isBaseUnit" sortable title="作为基本单位" width="">-->
<!-- <template #default="{ row }">-->
<!-- {{ row.isBaseUnit ? '是' : '否' }}-->
<!-- &lt;!&ndash; <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> &ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<!-- <vxe-column title="操作" width="200" fixed="right" show-overflow>-->
<!-- <template #default="{ row }">-->
<!-- <vxe-button type="text" @click="editUnit(row)" icon="vxe-icon-edit">修改</vxe-button>-->
<!-- <vxe-button type="text" @click="deleteUnit(row)" icon="vxe-icon-delete" style="color: rgb(223, 65, 65)">删除</vxe-button>-->
<!-- &lt;!&ndash; <vxe-button type="text" icon="vxe-icon-delete"></vxe-button> &ndash;&gt;-->
<!-- </template>-->
<!-- </vxe-column>-->
<!-- </vxe-table>-->
</div>
<div style="line-height: 35px">
<el-pagination
@ -142,32 +150,32 @@
/>
</div>
<!-- <div>-->
<!-- <vxe-pager v-model:current-page="pageVO1.currentPage" v-model:page-size="pageVO1.pageSize"-->
<!-- :total="pageVO1.total" />-->
<!-- </div>-->
<!-- <div>-->
<!-- <vxe-pager v-model:current-page="pageVO1.currentPage" v-model:page-size="pageVO1.pageSize"-->
<!-- :total="pageVO1.total" />-->
<!-- </div>-->
</div>
</div>
<el-dialog v-model="dialogTableVisible" :title="mTitle" width="860">
<el-form :inline="true" :model="unitFrom" class="demo-form-inline" label-width="80px">
<el-form :inline="true" ref="ruleFormRef" :model="unitFrom" class="demo-form-inline" label-width="80px">
<el-row>
<el-col :span="8">
<el-form-item label="名称" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]">
<el-input v-model="unitFrom.name" placeholder="请输入名称" clearable />
<el-form-item label="名称" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]" prop="name">
<el-input v-model="unitFrom.name" placeholder="请输入名称" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="编码" :rules="[{ required: true, message: '编码不能为空', trigger: 'blur' }]">
<el-input v-model="unitFrom.codeNum" placeholder="请输入编码" clearable />
<el-form-item label="编码" :rules="[{ required: true, message: '编码不能为空', trigger: 'blur' }]" prop="codeNum">
<el-input v-model="unitFrom.codeNum" placeholder="请输入编码" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位组" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]">
<el-form-item label="单位组" :rules="[{ required: true, message: '单位组不能为空', trigger: 'blur' }]" prop="groupUnitId">
<el-select v-model="unitFrom.groupUnitId" placeholder="请选择" clearable>
<el-option :label="item.name" :value="item.id" v-for="item, index in data.unitGroup"
:key="index" />
:key="index"/>
</el-select>
</el-form-item>
</el-col>
@ -175,73 +183,89 @@
<el-row>
<el-col :span="8">
<el-form-item label="精度">
<el-input v-model="unitFrom.accuracy" placeholder="请输入" clearable />
<el-input v-model="unitFrom.accuracy" placeholder="请输入" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="子单位数" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-input v-model="unitFrom.childUnitCount" placeholder="下级单位数量" clearable />
<el-form-item label="子单位数" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]" prop="childUnitCount">
<el-input v-model="unitFrom.childUnitCount" placeholder="下级单位数量" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="换算率" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-input v-model="unitFrom.rate" placeholder="基本单位数量" clearable />
<el-form-item label="换算率" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]" prop="rate">
<el-input v-model="unitFrom.rate" placeholder="基本单位数量" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="代码">
<el-input v-model="unitFrom.code" placeholder="请输入" clearable />
<el-input v-model="unitFrom.code" placeholder="请输入" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="外部编码">
<el-input v-model="unitFrom.externalNumber" placeholder="请输入" clearable />
<el-input v-model="unitFrom.externalNumber" placeholder="请输入" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
<el-input v-model="unitFrom.remarks" placeholder="请输入" clearable />
<el-input v-model="unitFrom.remarks" placeholder="请输入" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="基本单位">
<el-switch v-model="unitFrom.isBaseUnit" inline-prompt active-text="" inactive-text="" />
<el-switch v-model="unitFrom.isBaseUnit" inline-prompt active-text="" inactive-text=""/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否启用">
<el-switch v-model="unitFrom.isEnable" inline-prompt active-text="" inactive-text="" />
<el-switch v-model="unitFrom.isEnable" inline-prompt active-text="" inactive-text=""/>
</el-form-item>
</el-col>
</el-row>
<el-tabs v-model="activeName" class="demo-tabs" >
<el-tab-pane label="操作信息" name="操作信息">
<el-row>
<el-col :span="8">
<el-form-item label="创建人" >
<el-input v-model="unitFrom.createUserName" disabled clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="修改人" >
<el-input v-model="unitFrom.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;">
<el-button style="width: 100px;" type="primary" @click="unitSubmit"></el-button>
<el-button style="width: 100px;" @click="dialogTableVisible = false">取消</el-button>
</el-row>
</el-dialog>
<el-dialog v-model="isShowDialog" :title="mGroupTitle" ref="ruleFormRef" :width="800" >
<div v-if="isShowDialog">
<el-dialog v-model="isShowDialog" :title="mGroupTitle" :width="800">
<template #header>
<div style="color: #fff">
<span>单位组</span>
</div>
</template>
<el-form :model="unitGroupModel" label-width="auto" :rules="rules">
<el-form ref="unitGroupRuleFormRef" :model="unitGroupModel" label-width="auto" >
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称" prop="name">
<el-input v-model="unitGroupModel.name" placeholder="请输入名称" maxlength="32" show-word-limit clearable />
<el-form-item label="名称" prop="name" :rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]">
<el-input v-model="unitGroupModel.name" placeholder="请输入名称" maxlength="32" show-word-limit
clearable/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否启用" prop="isEnable">
<el-switch v-model="unitGroupModel.isEnable" active-text="" inactive-text="" />
<el-switch v-model="unitGroupModel.isEnable" active-text="" inactive-text=""/>
</el-form-item>
</el-col>
</el-form>
@ -252,69 +276,88 @@
</span>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts" name="sysUnit">
import { onMounted, reactive, ref } from 'vue'
import { getAPI } from '/@/utils/axios-utils';
import { SysUnitApi, SysUnitGroupApi } from '/@/api-services/api';
import { AddSysUnitInput, SqlSugarPagedListSysUnitOutput, SysUnitGroupOutput, SysUnitInput} from '/@/api-services/models';
import type { FormRules } from "element-plus";
import { ElMessageBox, ElMessage } from 'element-plus';
import {onMounted, reactive, ref} from 'vue'
import {getAPI} from '/@/utils/axios-utils';
import {SysUnitApi, SysUnitGroupApi} from '/@/api-services/api';
import {
AddSysUnitInput,
SqlSugarPagedListSysUnitOutput,
SysUnitGroupOutput,
SysUnitInput
} from '/@/api-services/models';
import type {FormRules} from "element-plus";
import {ElMessageBox, ElMessage} from 'element-plus';
import {auth} from "/@/utils/authFunction";
import {listMaterialByUnit} from "/@/api/main/materials";
let data = reactive({
unit: [] as SqlSugarPagedListSysUnitOutput[],//
unitGroup: [] as SysUnitGroupOutput[],//
selectUnitGroupId:0,
selectUnitGroupId: 0,
});
const activeName = ref('操作信息')
const loading = ref(false);
const ruleFormRef = ref();
const isShowDialog=ref(false);
const isShowDialog = ref(false);
const multipleSelection = ref([])
const tableParams = ref({
page: 1,
pageSize: 10,
total: 0,
});
let unitGroupModel=reactive<any>({isEnable:true,isDelete:false});
//
const rules = ref<FormRules>({
name: [{required: true, message: '请输入名称', trigger: 'blur',},],
});
const unitGroupRuleFormRef = ref();
let unitGroupModel = reactive<any>({isEnable: true, isDelete: false});
let mTitle = ref('新增');
let mTitle = ref('新增');
let mGroupTitle = ref('新增');
let dialogTableVisible = ref(false);
const unitFrom = ref<any>({isEnable: true, isDelete: false, name: '', codeNum: ''})
const unitFrom = ref<any>({isEnable:true,isDelete:false,name:'',codeNum:''})
const cancel = () => {
isShowDialog.value = false
}
const cancel=()=>{
isShowDialog.value=false
const handleSelectionChange = (val: []) => {
multipleSelection.value = val
}
//submit
const submit = async () => {
unitGroupRuleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
if (isValid) {
if (unitGroupModel.id>0){
if(!unitGroupModel.isEnable){
let wlRes = await listMaterialByUnit(unitGroupModel.id,"");
if(wlRes.data.code == 200) {
if (wlRes.data.result.length > 0) return ElMessage.error("单位已被物料使用,无法停用")
}
//submit
const submit = async () => {
if(mGroupTitle.value=='新增'){
}
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupUpdatePost(unitGroupModel);
if (res.data.code === 200) {
isShowDialog.value = false;
await unitGroup();
}
}
else{
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupAddPost(unitGroupModel);
console.log(res)
if (res.data.code===200) {
if (res.data.code === 200) {
isShowDialog.value = false;
unitGroup();
}
}else{
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupUpdatePost(unitGroupModel);
if (res.data.code===200) {
isShowDialog.value = false;
unitGroup();
await unitGroup();
}
}
};
}
});
};
//
const unitGroup = async () => {
@ -323,15 +366,18 @@ 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 unitPage = async (parameter = formInline) => {
let res = await getAPI(SysUnitApi).apiSysUnitPagePost({pageSize:tableParams.value.pageSize,page:tableParams.value.page, ...parameter,...formInline });
let res = await getAPI(SysUnitApi).apiSysUnitPagePost({
pageSize: tableParams.value.pageSize,
page: tableParams.value.page, ...parameter, ...formInline
});
data.unit = res.data.result?.items as any;
tableParams.value.total = res.data.result?.total;
}
@ -339,53 +385,81 @@ const unitPage = async (parameter = formInline) => {
//
const handleSizeChange = (val: number) => {
tableParams.value.pageSize = val;
unitPage({groupUnitId:data.selectUnitGroupId});
unitPage({groupUnitId: data.selectUnitGroupId});
};
//
const handleCurrentChange = (val: number) => {
tableParams.value.page = val;
unitPage({groupUnitId:data.selectUnitGroupId});
unitPage({groupUnitId: data.selectUnitGroupId});
};
const addUnit= ()=>{
unitFrom.value.codeNum = 'DW'+ getCurrentDate();
dialogTableVisible.value=true;
mTitle.value='新增'
const addUnit = () => {
ruleFormRef.value?.resetFields();
unitFrom.value = reactive({ });
unitFrom.value.codeNum = 'DW' + getCurrentDate();
dialogTableVisible.value = true;
mTitle.value = '新增'
}
//
const unitSubmit = async () => {
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
if (isValid) {
//
let checkRes = await getAPI(SysUnitApi).apiSysUnitCheckPost(unitFrom.value);
if(checkRes.data.code === 200){
if (checkRes.data.code === 200) {
const item = checkRes.data.result;
if(mTitle.value=='新增'){
if(unitFrom.value.isBaseUnit && item!=null){
ElMessage({ message: '基本单位必须唯一', type: 'error', });
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);
if (res.data.code===200) {
if (res.data.code === 200) {
dialogTableVisible.value = false;
unitPage({groupUnitId:data.selectUnitGroupId});
await unitPage({groupUnitId: data.selectUnitGroupId});
}
}else{
if(unitFrom.value.isBaseUnit && item!=null && item.id!=unitFrom.value.id)
{
ElMessage({ message: '基本单位必须唯一', type: 'error', });
} else {
if (unitFrom.value.isBaseUnit && item != null && item.id != unitFrom.value.id) {
ElMessage({message: '基本单位必须唯一', type: 'error',});
unitFrom.value.isBaseUnit = false;
return;
}
if(!unitFrom.value.isEnable){
let wlRes = await listMaterialByUnit(unitFrom.value.unitGroupId,unitFrom.value.name);
if(wlRes.data.code == 200) {
if (wlRes.data.result.length > 0) return ElMessage.error("单位已被物料使用,无法停用")
}
}
let res = await getAPI(SysUnitApi).apiSysUnitUpdatePost(unitFrom.value);
if (res.data.code===200) {
if (res.data.code === 200) {
dialogTableVisible.value = false;
unitPage({groupUnitId:data.selectUnitGroupId});
await unitPage({groupUnitId: data.selectUnitGroupId});
}
}
}
}
})
}
//
const unitUpdateEnable = async (enable:boolean) => {
if(multipleSelection.value.length === 0){ return ElMessage.error("至少选择一条单位数据")}
let ids = [] as any;
multipleSelection.value.forEach(item => {
ids.push(item.id);
})
let result = await getAPI(SysUnitApi).apiSysUnitUpdateEnablePost({ids:ids.join(","),isEnable:enable});
if (result.data.code === 200) {
ElMessage({message: '成功', type: 'success',})
await unitPage({groupUnitId: data.selectUnitGroupId});
}
else{
ElMessage.error(res.data.message!)
}
}
const getCurrentDate = () => {
@ -399,13 +473,17 @@ const getCurrentDate = () => {
return `${year}${month}${day}${hours}${minutes}${seconds}`;
}
const editUnit=async(row:any)=>{
unitFrom.value=row;
mTitle.value='编辑'
dialogTableVisible.value=true;
const editUnit = async (row: any) => {
ruleFormRef.value?.resetFields();
unitFrom.value = reactive({ ...row });
mTitle.value = '编辑'
dialogTableVisible.value = true;
}
const deleteUnit=async(row:any)=>{
const deleteUnit = async (row: any) => {
let wlRes = await listMaterialByUnit(row.unitGroupId,row.name);
if(wlRes.data.code == 200) {
if (wlRes.data.result.length > 0) return ElMessage.error("单位已被物料使用")
ElMessageBox.confirm(`确定删除?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -414,34 +492,41 @@ const deleteUnit=async(row:any)=>{
.then(async () => {
let res = await getAPI(SysUnitApi).apiSysUnitDeletePost(row);
if (res.data.code == 200) {
ElMessage({ message: '成功', type: 'success', })
unitPage({groupUnitId:data.selectUnitGroupId});
ElMessage({message: '成功', type: 'success',})
unitPage({groupUnitId: data.selectUnitGroupId});
//state.tableData.handleList();
} else
ElMessage.error(res.data.message!)
})
.catch(() => {});
.catch(() => {
});
}
}
const addUnitGroup=()=>{
isShowDialog.value=true
const addUnitGroup = () => {
unitGroupRuleFormRef.value?.resetFields();
unitGroupModel = reactive({ });
isShowDialog.value = true
}
const editUnitGroup=async(row:any)=>{
unitGroupModel=row;
mGroupTitle.value='编辑'
isShowDialog.value=true;
const editUnitGroup = (row: any) => {
unitGroupRuleFormRef.value?.resetFields();
mGroupTitle.value = '编辑'
isShowDialog.value = true;
unitGroupModel = reactive({ ...row });
}
const deleteUnitGroup=async(row:any)=>{
let checkRes = await getAPI(SysUnitGroupApi).apiSysUnitGroupCheckPost({Id:row.id});
if(checkRes.data.code == 200){
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){
if (result) {
return ElMessage.error("存在单位数据,不允许删除")
}
let wlRes = await listMaterialByUnit(row.id,"");
if(wlRes.data.code == 200) {
if(wlRes.data.result.length>0) return ElMessage.error("单位组已被物料使用")
ElMessageBox.confirm(`确定删除?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -451,16 +536,17 @@ const deleteUnitGroup=async(row:any)=>{
console.log(row)
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupDeletePost(row);
if (res.data.code == 200) {
ElMessage({ message: '成功', type: 'success', })
ElMessage({message: '成功', type: 'success',})
unitGroup()
unitPage({groupUnitId:data.selectUnitGroupId})
unitPage({groupUnitId: data.selectUnitGroupId})
//state.tableData.handleList();
} else
ElMessage.error(res.data.message!)
})
.catch(() => {});
.catch(() => {
});
}
}
}
const pageVO1 = reactive({
@ -471,7 +557,7 @@ const pageVO1 = reactive({
onMounted(() => {
unitGroup()
unitPage({groupUnitId:data.selectUnitGroupId})
unitPage({groupUnitId: data.selectUnitGroupId})
})
</script>

View File

@ -7,7 +7,69 @@
<span>{{ props.title }}</span>
</div>
</template>
<el-form label-width="auto" >
<el-row :gutter="35">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称" >
<el-select v-model="ruleReportForm.materialsId" placeholder="请选择" clearable @change="materialsChange" disabled>
<el-option :label="item.name" :value="item.id" v-for="item, index in materials"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单位">
<el-input v-model="ruleReportForm.unit" maxlength="32" show-word-limit clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="批次" prop="batch">
<el-input v-model="ruleReportForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单号">
<el-input v-model="ruleReportForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="业务日期" >
<el-date-picker v-model="ruleReportForm.startDate" type="date" placeholder="生产日期" disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产类型" prop="productType" :rules="[{ required: true, message: '生产类型不能为空', trigger: 'blur' }]">
<el-select v-model="ruleReportForm.productType" placeholder="请选择" clearable disabled>
<el-option label="普通生产" value= '普通生产' />
<el-option label="返工生产" value= '返工生产' />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产线" prop="productionLine" >
<el-select v-model="ruleReportForm.productionLine" placeholder="请选择" clearable disabled>
<el-option :label="item.name" :value="item.name" v-for="item, index in productionLines"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="计划生产数量" prop="productCount" >
<el-input-number v-model="ruleReportForm.productCount" placeholder="请输入计划生产数量" clearable disabled/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="备注" prop="remarks" >
<el-input v-model="ruleReportForm.remarks" clearable disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-tabs v-model="activeName" class="demo-tabs" :key="key">
<el-tab-pane label="条码信息" name="条码信息">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
<el-row>
@ -26,6 +88,7 @@
</el-col>
</el-row>
</el-form>
</el-card>
<el-table
:data="ruleForm"
@ -50,7 +113,24 @@
</template>
</el-table-column> -->
</el-table>
</el-tab-pane>
<el-tab-pane label="操作信息" name="操作信息">
<el-row>
<el-col :span="8">
<el-form-item label="创建人" >
<el-input v-model="ruleReportForm.createUserName" disabled clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="修改人" >
<el-input v-model="ruleReportForm.updateUserName" disabled clearable />
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button>
@ -78,26 +158,28 @@
default: "",
},
});
const activeName = ref('条码信息')
//
const emit = defineEmits(["reloadTable"]);
const isShowDialog = ref(false);
const ruleReportForm = ref<any>([]);
const ruleForm = ref<any>([]);
const tempRuleForm = ref<any>([]);
const loading = ref(false);
const queryParams = ref<any>({});
//
const openDialog = async (row: any) => {
// ruleForm.value = JSON.parse(JSON.stringify(row));
//console.log(row);
ruleForm.value=[];
if(typeof(row) === 'number'){
var res = await getPrintDetail(row);
if(typeof(row.id) === 'number'){
var res = await getPrintDetail(row.id);
ruleForm.value = res.data.result;
ruleReportForm.value = {...row};
}else{
ruleForm.value=row;
ruleForm.value=row.id;
}
//console.log(ruleForm.value);
tempRuleForm.value=ruleForm.value;

View File

@ -5,37 +5,79 @@
<el-form-item v-show="false">
<el-input v-model="ruleForm.id" />
</el-form-item>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="产品名称" prop="materialsId" :rules="[{ required: true, message: '产品名称不能为空', trigger: 'blur' }]">
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="单号" prop="oddNumber">
<el-input v-model="ruleForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="计划开工日期" prop="productDate" :rules="[{ required: true, message: '计划开工日期不能为空', trigger: 'blur' }]">
<el-date-picker v-model="ruleForm.productDate" type="date" placeholder="生产日期" />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="生产类型" prop="productType" :rules="[{ required: true, message: '生产类型不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.productType" placeholder="请选择" clearable>
<el-option label="普通生产" value= '普通生产' />
<el-option label="返工生产" value= '返工生产' />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="产品" prop="materialsId" >
<el-select v-model="ruleForm.materialsId" placeholder="请选择" clearable @change="materialsChange">
<el-option :label="item.name" :value="item.id" v-for="item, index in materials"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="产品编码" prop="productCodeNum">
<el-input v-model="ruleForm.productCodeNum" placeholder="请输入产品编码" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col> -->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单号" prop="oddNumber">
<el-input v-model="ruleForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
<!-- <el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">-->
<!-- <el-form-item label="状态" prop="state" >-->
<!-- <el-select v-model="ruleForm.state" placeholder="请选择" clearable>-->
<!-- <el-option label="待审核" :value= "0" />-->
<!-- <el-option label="已审核" :value= "1" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="批次" prop="batch">
<el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="状态" prop="state" >
<el-select v-model="ruleForm.state" placeholder="请选择" clearable>
<el-option label="待审核" :value= "0" />
<el-option label="已审核" :value= "1" />
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="计划生产数量" prop="productCount" :rules="[{ required: true, message: '计划生产数量不能为空', trigger: 'blur' }]">
<el-input-number v-model="ruleForm.productCount" placeholder="请输入计划生产数量" clearable />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="单位" prop="package" :rules="[{ required: true, message: '单位不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.package" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6" class="mb20">
<el-form-item label="基本单位" prop="baseUnit" :rules="[{ required: true, message: '基本单位不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.baseUnit" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产类型" prop="productType">
<el-select v-model="ruleForm.productType" placeholder="请选择" clearable>
<el-option label="普通生产" value= '普通生产' />
<el-option label="返工生产" value= '返工生产' />
<el-form-item label="生产线" prop="productionLine" :rules="[{ required: true, message: '生产线不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.productionLine" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in productionLines"
:key="index" />
</el-select>
</el-form-item>
</el-col>
@ -55,21 +97,17 @@
<el-input v-model="ruleForm.sourceNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col>-->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产数量" prop="productCount">
<el-input-number v-model="ruleForm.productCount" placeholder="请输入生产数量" clearable />
</el-form-item>
</el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="入库数量" prop="putWarehouse">
<el-input-number v-model="ruleForm.putWarehouse" placeholder="请输入入库数量" clearable />
</el-form-item>
</el-col> -->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本生产数量" prop="baseProductCount">
<el-input-number v-model="ruleForm.baseProductCount" placeholder="请输入基本生产数量" clearable />
</el-form-item>
</el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">-->
<!-- <el-form-item label="基本生产数量" prop="baseProductCount">-->
<!-- <el-input-number v-model="ruleForm.baseProductCount" placeholder="请输入基本生产数量" clearable />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本入库数量" prop="basePutWarehouse">
<el-input-number v-model="ruleForm.basePutWarehouse" placeholder="请输入基本入库数量" clearable />
@ -84,32 +122,13 @@
</el-form-item>
</el-col>-->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="批次" prop="batch">
<el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="包装单位" prop="package" :rules="[{ required: true, message: '包装单位不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.package" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本单位" prop="baseUnit" :rules="[{ required: true, message: '基本单位不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.baseUnit" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="包装数量" prop="packageCount">
<el-input-number v-model="ruleForm.packageCount" placeholder="请输入包装数量" clearable />
</el-form-item>
</el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">-->
<!-- <el-form-item label="包装数量" prop="packageCount">-->
<!-- <el-input-number v-model="ruleForm.packageCount" placeholder="请输入包装数量" clearable />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="采集失败数量" prop="gatherFalseCount">
<el-input-number v-model="ruleForm.gatherFalseCount" placeholder="请输入采集失败数量" clearable />
@ -117,54 +136,59 @@
</el-col> -->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产线" prop="productionLine" >
<el-select v-model="ruleForm.productionLine" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in productionLines"
:key="index" />
</el-select>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">-->
<!-- <el-form-item label="班组" prop="teamGroup">-->
<!-- <el-select v-model="ruleForm.teamGroup" placeholder="请选择" clearable >-->
<!-- <el-option :label="item.name" :value="item.name" v-for="item, index in teamOfGroups"-->
<!-- :key="index" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">-->
<!-- <el-form-item label="操作工人" prop="operator">-->
<!-- <el-select v-model="ruleForm.operator" placeholder="请选择操作工人" clearable >-->
<!-- <el-option :label="item.name" :value="item.name" v-for="item, index in employees"-->
<!-- :key="index" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">-->
<!-- <el-form-item label="完工时间" prop="endDate">-->
<!-- <el-date-picker v-model="ruleForm.endDate" type="date" placeholder="完工时间" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">-->
<!-- <el-form-item label="源单号" prop="sourceOddNumber">-->
<!-- <el-input v-model="ruleForm.sourceOddNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">-->
<!-- <el-form-item label="备注" prop="remarks">-->
<!-- <el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-tabs v-model="activeName" class="demo-tabs" >
<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 :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="班组" prop="teamGroup">
<el-select v-model="ruleForm.teamGroup" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in teamOfGroups"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="操作工人" prop="operator">
<el-select v-model="ruleForm.operator" placeholder="请选择操作工人" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in employees"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产日期" prop="productDate">
<el-date-picker v-model="ruleForm.productDate" type="date" placeholder="生产日期" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="完工时间" prop="endDate">
<el-date-picker v-model="ruleForm.endDate" type="date" placeholder="完工时间" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="源单号" prop="sourceOddNumber">
<el-input v-model="ruleForm.sourceOddNumber" placeholder="请输入源单号" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="备注" prop="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
<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>
<div class="footer" align="right" >
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button type="primary" @click="submit" :disabled="disabled"> </el-button>
</div>
</el-form>
@ -205,10 +229,12 @@
type: String,
default: "",
},
row: Object
row: Object,
disabled:Boolean,
});
//
const emit = defineEmits(["reloadTable","back"]);
const activeName = ref('操作信息')
const ruleFormRef = ref();
const isShowDialog = ref(false);
const ruleForm = ref<any>({});
@ -233,16 +259,29 @@
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);
}
}
else{
ruleForm.value = {};
ruleForm.value.oddNumber = 'A'+ getCurrentDate();
}
});
const getCurrentDate = () => {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0');
return `${year}${month}${day}${hours}${minutes}${seconds}`;
}
// //
// const openDialog = async (row: any) => {
// // ruleForm.value = JSON.parse(JSON.stringify(row));

View File

@ -15,16 +15,9 @@
</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">
@ -45,48 +38,7 @@
</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.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.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.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="请输入单位"/>
@ -105,60 +57,14 @@
</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.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-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-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.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;">
@ -167,7 +73,8 @@
<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 type="primary" style="margin-left:5px;" icon="ele-Check" @click="handleStateChange('已审核')" > 审核 </el-button>
<el-button type="primary" style="margin-left:5px;" icon="ele-CloseBold" @click="handleStateChange('待审核')" > 防审核 </el-button>
</el-button-group>
</el-form-item>
@ -177,45 +84,41 @@
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table
ref="multipleTableRef"
:data="tableData"
style="width: 100%"
v-loading="loading"
tooltip-effect="light"
row-key="id"
@sort-change="sortChange"
@selection-change="handleSelectionChange"
border="">
<el-table-column type="selection" width="60"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="productName" label="产品名称" width="140" show-overflow-tooltip="" />
<el-table-column prop="productCodeNum" label="产品编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="60" show-overflow-tooltip="" />
<el-table-column prop="oddNumber" label="单号" show-overflow-tooltip="" />
<el-table-column prop="productDate" label="计划开工日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="生产线编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="sourceNumber" label="源单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="specifications" label="规格型号" width="140" show-overflow-tooltip="" />
<el-table-column prop="productCount" label="生产数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="putWarehouse" label="入库数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseProductCount" label="基本生产数量" width="90" show-overflow-tooltip="" />
<el-table-column prop="basePutWarehouse" label="基本入库数量" width="90" show-overflow-tooltip="" />
<el-table-column prop="productName" label="产品" width="140" show-overflow-tooltip="" />
<el-table-column prop="batch" label="批次" width="140" show-overflow-tooltip="" />
<el-table-column prop="productCount" label="计划生产数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="unit" label="单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseUnit" label="基本单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="batch" label="批次" width="140" show-overflow-tooltip="" />
<el-table-column prop="package" label="包装规格" width="140" show-overflow-tooltip="" />
<el-table-column prop="packageCount" label="包装数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="gatherFalseCount" label="采集失败数量" width="90" show-overflow-tooltip="" />
<el-table-column prop="productDate" label="生产日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="teamGroup" label="班组" width="140" show-overflow-tooltip="" />
<el-table-column prop="operator" label="操作工人" width="140" show-overflow-tooltip="" />
<el-table-column prop="endDate" label="完工时间" width="140" show-overflow-tooltip="" />
<el-table-column prop="sourceOddNumber" label="源单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" 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="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportDetailTable:update') || auth('reportDetailTable:delete')">
<template #default="scope">
<div v-if="scope.row.state==='已审核'">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openBrowseReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button>
</div>
<div v-else>
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button>
<!-- <el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row.id)" v-auth="'reportDetailTable:update'"> </el-button> -->
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delReportDetailTable(scope.row)" v-auth="'reportDetailTable:delete'"> </el-button>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination
@ -241,6 +144,7 @@
ref="editDialogRef"
:title="editReportDetailTableTitle"
:row = "state.editRow"
:disabled = "state.editDisabled"
@reloadTable="handleQuery"
@back="closeReportDetailTable"
/>
@ -250,12 +154,16 @@
<script lang="ts" setup="" name="reportDetailTable">
import {reactive, ref} from "vue";
import { ElMessageBox, ElMessage } from "element-plus";
import {ElMessageBox, ElMessage, ElTable} from "element-plus";
import { auth } from '/@/utils/authFunction';
import editDialog from '/@/views/productionCenter/reportDetailTable/component/editDialog.vue'
import printDetailDialog from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue'
import { pageReportDetailTable, deleteReportDetailTable } from '/@/api/main/reportDetailTable';
import {
pageReportDetailTable,
deleteReportDetailTable,
updateStateReportDetailTable
} from '/@/api/main/reportDetailTable';
const showAdvanceQueryUI = ref(false);
@ -266,8 +174,10 @@ import {reactive, ref} from "vue";
const queryParams = ref<any>({});
const state = reactive({
editShow: false,
editRow:{}
editRow:<any>{},
editDisabled:false
})
const multipleSelection = ref([])
const tableParams = ref({
page: 1,
pageSize: 10,
@ -292,6 +202,9 @@ import {reactive, ref} from "vue";
loading.value = false;
};
const handleSelectionChange = (val: []) => {
multipleSelection.value = val
}
//
const sortChange = async (column: any) => {
@ -316,6 +229,16 @@ import {reactive, ref} from "vue";
const openEditReportDetailTable = (row: any) => {
state.editRow = row;
state.editShow = true;
state.editDisabled = false;
// editReportDetailTableTitle.value = '';
// editDialogRef.value.openDialog(row);
};
//
const openBrowseReportDetailTable = (row: any) => {
state.editRow = row;
state.editShow = true;
state.editDisabled = true;
// editReportDetailTableTitle.value = '';
// editDialogRef.value.openDialog(row);
};
@ -355,6 +278,18 @@ import {reactive, ref} from "vue";
handleQuery();
};
//
const handleStateChange = async (val: any) => {
if(multipleSelection.value.length === 0){ return ElMessage.error("至少选择一条数据")}
let ids = [] as any;
multipleSelection.value.forEach(item => {
ids.push(item.id);
})
await updateStateReportDetailTable({ids,state:val});
await handleQuery();
};
handleQuery();
</script>
<style scoped>

View File

@ -61,7 +61,6 @@
<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="openAddReportTable" v-auth="'reportTable:add'"> </el-button>
</el-button-group>
</el-form-item>
@ -92,7 +91,6 @@
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
<el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportTable:update') || auth('reportTable:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditReportTable(scope.row)" v-auth="'reportTable:update'"> </el-button>
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button>
</template>
</el-table-column>
@ -196,7 +194,7 @@
const readReportDetailTable = (row: any) => {
printDetailTableTitle.value = '条码详情';
//console.log(row.sourceId);
printDetailDialogRef.value.openDialog(row.id);
printDetailDialogRef.value.openDialog(row);
};
//