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

@ -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,6 +73,7 @@
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=""/>
@ -88,10 +93,13 @@
</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 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>
@ -150,21 +158,21 @@
</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-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-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"/>
@ -179,13 +187,13 @@
</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="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-form-item label="换算率" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]" prop="rate">
<el-input v-model="unitFrom.rate" placeholder="基本单位数量" clearable/>
</el-form-item>
</el-col>
@ -219,24 +227,40 @@
</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">
@ -252,7 +276,7 @@
</span>
</template>
</el-dialog>
</div>
</div>
</template>
@ -261,59 +285,78 @@
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 {
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,
});
const activeName = ref('操作信息')
const loading = ref(false);
const ruleFormRef = ref();
const isShowDialog = ref(false);
const multipleSelection = ref([])
const tableParams = ref({
page: 1,
pageSize: 10,
total: 0,
});
const unitGroupRuleFormRef = ref();
let unitGroupModel = reactive<any>({isEnable: true, isDelete: false});
//
const rules = ref<FormRules>({
name: [{required: true, message: '请输入名称', trigger: 'blur',},],
});
let mTitle = ref('新增');
let mGroupTitle = ref('新增');
let dialogTableVisible = ref(false);
const unitFrom = ref<any>({isEnable: true, isDelete: false, name: '', codeNum: ''})
const cancel = () => {
isShowDialog.value = false
}
const handleSelectionChange = (val: []) => {
multipleSelection.value = val
}
//submit
const submit = async () => {
if(mGroupTitle.value=='新增'){
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("单位已被物料使用,无法停用")
}
}
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) {
isShowDialog.value = false;
unitGroup();
}
}else{
let res = await getAPI(SysUnitGroupApi).apiSysUnitGroupUpdatePost(unitGroupModel);
if (res.data.code===200) {
isShowDialog.value = false;
unitGroup();
await unitGroup();
}
}
}
});
};
//
@ -331,7 +374,10 @@ 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;
}
@ -350,6 +396,8 @@ const handleCurrentChange = (val: number) => {
const addUnit = () => {
ruleFormRef.value?.resetFields();
unitFrom.value = reactive({ });
unitFrom.value.codeNum = 'DW' + getCurrentDate();
dialogTableVisible.value = true;
mTitle.value = '新增'
@ -357,6 +405,8 @@ const addUnit= ()=>{
//
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) {
@ -370,23 +420,47 @@ const unitSubmit = async () => {
let res = await getAPI(SysUnitApi).apiSysUnitAddPost(unitFrom.value);
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)
{
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) {
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 = () => {
const now = new Date();
@ -400,12 +474,16 @@ const getCurrentDate = () => {
}
const editUnit = async (row: any) => {
unitFrom.value=row;
ruleFormRef.value?.resetFields();
unitFrom.value = reactive({ ...row });
mTitle.value = '编辑'
dialogTableVisible.value = true;
}
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: '取消',
@ -420,19 +498,23 @@ const deleteUnit=async(row:any)=>{
} else
ElMessage.error(res.data.message!)
})
.catch(() => {});
.catch(() => {
});
}
}
const addUnitGroup = () => {
unitGroupRuleFormRef.value?.resetFields();
unitGroupModel = reactive({ });
isShowDialog.value = true
}
const editUnitGroup=async(row:any)=>{
unitGroupModel=row;
const editUnitGroup = (row: any) => {
unitGroupRuleFormRef.value?.resetFields();
mGroupTitle.value = '编辑'
isShowDialog.value = true;
unitGroupModel = reactive({ ...row });
}
const deleteUnitGroup = async (row: any) => {
@ -442,6 +524,9 @@ const deleteUnitGroup=async(row:any)=>{
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: '取消',
@ -458,9 +543,10 @@ const deleteUnitGroup=async(row:any)=>{
} else
ElMessage.error(res.data.message!)
})
.catch(() => {});
.catch(() => {
});
}
}
}
const pageVO1 = reactive({

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);
};
//