siontion 3 months ago
commit 2ea60cc3b9

@ -1,5 +1,5 @@
<template>
<!-- 退料 -->
<!-- 入库 -->
<el-card class="hl-card" style="position: relative">
<template #header>
<span v-text="dialogTitle"></span>
@ -25,14 +25,14 @@
<el-col :span="8">
<el-row>
<el-col :span="24">
<el-form-item prop="name" label="退料单号">
<el-form-item prop="name" label="入库单号">
<el-input v-model="formData.stockNo" disabled placeholder="系统自动生成" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item prop="stockInType" label="退料类型">
<el-form-item prop="stockInType" label="入库类型">
<el-select
v-model="formData.stockInType"
clearable
@ -224,7 +224,7 @@
</template>
</el-table-column>
<el-table-column prop="storageOkQty" min-width="160" align="center">
<template #header> <span class="hl-table_header">*</span>本次退料数量</template>
<template #header> <span class="hl-table_header">*</span>本次入库数量</template>
<template #default="scope">
<el-form-item
:prop="`${scope.$index}.storageOkQty`"
@ -526,7 +526,7 @@ const formData = ref({
const formRules = reactive({
// name: [{ required: true, message: '', trigger: 'blur' }],
status: [{ required: true, message: '启用状态不能为空', trigger: 'blur' }],
stockInType: [{ required: true, message: '退料类型不能为空', trigger: 'blur' }],
stockInType: [{ required: true, message: '入库类型不能为空', trigger: 'blur' }],
whId: [{ required: true, message: '接收仓库不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref

@ -27,7 +27,7 @@
<el-row>
<el-col :span="24">
<el-form-item prop="name" label="出库单号">
<el-input v-model="formData.stockNo" disabled placeholder="系统自动生成" />
<el-input v-model="formData.stockNo" class="!w-400px" disabled placeholder="系统自动生成" />
</el-form-item>
</el-col>
</el-row>
@ -37,7 +37,7 @@
<el-select
v-model="formData.stockInType"
clearable
style="width: 100%"
class="!w-400px"
@change="handleStockType"
disabled
>
@ -57,7 +57,7 @@
<el-select
:disabled="!formData.projectOrderCode || activetype !== 'create'"
v-model="formData.materialMode"
style="width: 100%"
class="!w-400px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_STORAGE_OUT_MODE)"
@ -107,6 +107,23 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item prop="materialMode" label="领料车间">
<WorkshopSelect v-model="formData.workshopId" :disabled=" activetype !== 'create'" class="!w-400px" @update:newValue="handleSelectedWorkshop" />
<!-- <el-select
:disabled=" activetype !== 'create'"
v-model="formData.materialMode"
class="!w-400px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_STORAGE_OUT_MODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> -->
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="8">
@ -709,6 +726,7 @@ import projects from './subproject.vue'
import taskdispatchselect from './taskdispatchselect.vue'
import { useCommonStore } from '@/store/modules/common'
import { id } from 'node_modules/element-plus/es/locale'
import WorkshopSelect from '@/views/biz/hlvuestyle/workshopSelect.vue'
const reload: any = inject('reload')
const commonStore = useCommonStore()
@ -1262,6 +1280,11 @@ const handleSelectedProcedure = async (row: any, newValue: any) => {
row.procedureId = undefined
}
}
//
const handleSelectedWorkshop = (newValue: any) => {
formData.value.workshopId = newValue?.id
// formData.value.workshopName = newValue?.name
}
</script>
<style>
a {

@ -1,6 +1,6 @@
<template>
<el-card class="hl-card">
<template #header> <span>退料申请</span></template>
<template #header> <span>入库申请</span></template>
<ContentWrap class="borderxx">
<!-- 搜索工作栏 -->
<el-form
@ -10,10 +10,10 @@
:inline="true"
label-width="108px"
>
<el-form-item label="退料单号" prop="stockNo">
<el-form-item label="入库单号" prop="stockNo">
<el-input
v-model="queryParams.stockNo"
placeholder="退料单号"
placeholder="入库单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
@ -102,14 +102,14 @@
>
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column type="index" width="100" fixed label="序号" align="center" />
<el-table-column label="退料单号" align="center" prop="stockNo" min-width="210" fixed>
<el-table-column label="入库单号" align="center" prop="stockNo" min-width="210" fixed>
<template #default="scope">
<el-button text type="primary" @click="openDetail('review', scope.row.id)">
{{ scope.row.stockNo }}
</el-button>
</template>
</el-table-column>
<el-table-column label="退料类型" align="center" prop="stockInType" min-width="120">
<el-table-column label="入库类型" align="center" prop="stockInType" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.BIZ_STORAGE_IN_TYPE" :value="scope.row.stockInType" />
</template>

@ -1,6 +1,6 @@
<template>
<el-card class="hl-card">
<template #header> <span>退料审核</span></template>
<template #header> <span>入库审核</span></template>
<ContentWrap class="borderxx">
<!-- 搜索工作栏 -->
<el-form
@ -10,10 +10,10 @@
:inline="true"
label-width="108px"
>
<el-form-item label="退料单号" prop="stockNo">
<el-form-item label="入库单号" prop="stockNo">
<el-input
v-model="queryParams.stockNo"
placeholder="退料单号"
placeholder="入库单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
@ -102,14 +102,14 @@
>
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column type="index" width="100" fixed label="序号" align="center" />
<el-table-column label="退料单号" align="center" prop="stockNo" min-width="210" fixed>
<el-table-column label="入库单号" align="center" prop="stockNo" min-width="210" fixed>
<template #default="scope">
<el-button text type="primary" @click="openDetail('review', scope.row.id)">
{{ scope.row.stockNo }}
</el-button>
</template>
</el-table-column>
<el-table-column label="退料类型" align="center" prop="stockInType" min-width="120">
<el-table-column label="入库类型" align="center" prop="stockInType" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.BIZ_STORAGE_IN_TYPE" :value="scope.row.stockInType" />
</template>

@ -1,7 +1,7 @@
<template>
<el-card class="hl-card">
<template #header>
<span>领料申请</span>
<span>出库申请</span>
</template>
<ContentWrap class="borderxx">
<!-- 搜索工作栏 -->

@ -1,7 +1,7 @@
<template>
<el-card class="hl-card">
<template #header>
<span>领料审核</span>
<span>出库审核</span>
</template>
<ContentWrap class="borderxx">
<!-- 搜索工作栏 -->
@ -40,14 +40,14 @@
/>
</el-form-item>
<el-form-item label="物料名称" prop="matName">
<el-input
v-model="queryParams.matName"
placeholder="物料名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-input
v-model="queryParams.matName"
placeholder="物料名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="出库类型" prop="stockInType">
<el-select
v-model="queryParams.stockInType"
@ -85,8 +85,10 @@
</el-select>
</el-form-item>
<el-form-item style="margin-left:15px">
<el-button @click="handleQuery" type="primary"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-form-item style="margin-left: 15px">
<el-button @click="handleQuery" type="primary"
><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<!-- <el-button type="primary" plain @click="openDetail('create')">
<Icon icon="ep:plus" class="mr-5px" /> 新增
@ -100,19 +102,31 @@
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> -->
<el-button @click="openDispatching" type="success"> 打印 </el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" class="hl-table">
<el-table
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
class="hl-table"
:row-key="getRowKey"
@selection-change="handleSelectionChange"
@row-click="clickRow"
ref="multipleTable"
>
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column fixed type="selection" width="40" :reserve-selection="true" />
<el-table-column type="index" width="100" fixed label="序号" align="center" />
<el-table-column label="出库单号" align="center" prop="stockNo" fixed min-width="220" >
<template #default="scope">
<el-button text type="primary" @click="openDetail('review',scope.row.id)">
{{scope.row.stockNo}}
<el-table-column label="出库单号" align="center" prop="stockNo" fixed min-width="220">
<template #default="scope">
<el-button text type="primary" @click="openDetail('review', scope.row.id)">
{{ scope.row.stockNo }}
</el-button>
</template>
</el-table-column>
@ -121,13 +135,18 @@
<dict-tag :type="DICT_TYPE.BIZ_STORAGE_OUT_TYPE" :value="scope.row.stockInType" />
</template>
</el-table-column>
<el-table-column label="生产订单号" align="center" prop="projectOrderCode" min-width="180" />
<el-table-column
label="生产订单号"
align="center"
prop="projectOrderCode"
min-width="180"
/>
<el-table-column label="出库仓库" align="center" prop="whId" min-width="140">
<template #default="scope">
{{ warehouseList.find((tag) => tag.id === scope.row.whId)?.whName }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="description" min-width="120"/>
<el-table-column label="备注" align="center" prop="description" min-width="120" />
<el-table-column label="创建人" align="center" prop="creator" min-width="120">
<template #default="scope">
{{ userList.find((user) => user.id === scope.row.creator)?.nickname }}
@ -165,19 +184,28 @@
:formatter="dateFormatter"
min-width="240"
/>
<el-table-column label="单据状态" align="center" prop="status" min-width="120" fixed="right">
<el-table-column
label="单据状态"
align="center"
prop="status"
min-width="120"
fixed="right"
>
<template #default="scope">
<dict-tag :type="DICT_TYPE.BIZ_STORAGE_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="操作" align="right" width="180" fixed="right">
<template #header>
<span style="margin-right:35%">
操作
</span>
<span style="margin-right: 35%"> 操作 </span>
</template>
<template #default="scope">
<el-button link type="primary" @click="openDetail('Check', scope.row.id)" v-if="scope.row.status ==2">
<el-button
link
type="primary"
@click="openDetail('Check', scope.row.id)"
v-if="scope.row.status == 2"
>
审核
</el-button>
<el-button link type="primary" @click="openDetail('review', scope.row.id)">
@ -202,6 +230,7 @@
/>
</ContentWrap>
</el-card>
<Outprint ref="outprintref" />
</template>
<script setup lang="ts">
@ -211,7 +240,8 @@ import download from '@/utils/download'
import * as StorageApi from '@/api/biz/storage'
import * as WarehouseApi from '@/api/biz/warehouse'
import * as UserApi from '@/api/system/user'
import Outprint from './outprint.vue'
import { ElTable } from 'element-plus'
defineOptions({ name: 'Storage' })
import { useCommonStateWithOut } from '@/store/modules/common'
const message = useMessage() //
@ -244,7 +274,7 @@ const queryParams = reactive({
cancelTime: [],
matNo: undefined,
matName: undefined,
projectOrderCode:undefined
projectOrderCode: undefined
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
@ -295,7 +325,6 @@ onMounted(async () => {
})
warehouseList.value = await WarehouseApi.getWarehouseSimpList()
userList.value = await UserApi.getSimpleUserList()
await getList()
@ -303,4 +332,38 @@ onMounted(async () => {
onActivated(() => {
getList()
})
//
const multipleTable = ref<InstanceType<typeof ElTable>>()
const multipleSelection = ref([])
const handleSelectionChange = (val: []) => {
multipleSelection.value = val
}
const getRowKey = (row) => {
return row.id
}
const clickRow = (row: any) => {
if (row) {
multipleTable.value!.toggleRowSelection(row, undefined)
} else {
multipleTable.value!.clearSelection()
}
}
const fuid = ref([])
const outprintref = ref()
const openDispatching = () => {
if (multipleSelection.value.length === 0) {
message.warning('请至少选择一条数据')
return
}
fuid.value = []
multipleSelection.value.filter((item) => {
fuid.value.push(item.id)
})
console.log(fuid.value)
outprintref.value.open(fuid.value)
}
</script>

@ -0,0 +1,236 @@
<template>
<Dialog title="打印预览" v-model="dialogVisible" width="1000">
<!-- 打印预览 -->
<div class="print-wrap page" ref="print">
<!-- <div style="display: flex">
<div style="width: 33%">基础信息</div>
</div> -->
<div style="display: flex; margin-top: 20px">
<div style="width: 33%">出库单号</div>
<div style="width: 33%">单据日期</div>
<div style="width: 33%">单据状态</div>
</div>
<div style="display: flex">
<div style="width: 33%">出库类型</div>
<div style="width: 33%">生产订单号</div>
<div style="width: 33%">出库仓库</div>
</div>
<div style="display: flex">
<div style="width: 33%">领料模式</div>
<div style="width: 33%">领料车间</div>
<div style="width: 33%"></div>
</div>
<div style="display: flex; margin-top: 50px">
<div style="width: 33%">创建人</div>
<div style="width: 33%">创建时间</div>
<div style="width: 33%"></div>
</div>
<div style="display: flex">
<div style="width: 33%">送审人</div>
<div style="width: 33%">送审时间</div>
<div style="width: 33%"></div>
</div>
<div style="display: flex">
<div style="width: 33%">审核人</div>
<div style="width: 33%">审核时间</div>
<div style="width: 33%"></div>
</div>
<table border="2" cellspacing="0" id="table">
<tbody>
<tr
><td colspan="10"> <div style="text-align: center; width: 100%">物料信息</div></td></tr
>
<tr>
<td class="xh"> 序号 </td>
<td colspan="2"> 物料编码 </td>
<td> 物料名称 </td>
<td> 物料类型 </td>
<td> 规格型号 </td>
<td> 系统单位 </td>
<td> 库存数量 </td>
<td> 本次出库数量 </td>
<td colspan="3"> 备注 </td>
</tr>
<tr v-for="item in 8" :key="item.index">
<td>{{ item }}</td>
<td colspan="2"></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td colspan="3"> </td>
</tr>
</tbody>
</table>
</div>
<template #footer>
<!-- 打印 -->
<el-button @click="onPrint" type="primary">打印</el-button>
<el-button @click="outopen"></el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
// import { ref, reactive } from 'vue'
import { Check } from '@element-plus/icons-vue'
const dialogVisible = ref(false) //
const onPrint = () => {
// dom
const printNode = document.querySelector('.print-wrap')
if (!printNode) return
//
const newIframe: any = document.createElement('iframe')
newIframe.setAttribute(
'style',
'width:0px;height:0px;position:absolute;left:-9999px;top:-9999px;'
)
newIframe.setAttribute('align', 'center')
document.body.appendChild(newIframe)
//
let doc: any = null
doc = newIframe.contentWindow.document
doc.write(`
<style type="text/css">
/* 浏览器打印基本样式 */
.page {
width: 21cm;
min-height: 29.7cm;
padding: 10mm;
margin: 20px auto;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
@page {
size: A4;
margin:1cm;
}
@media print {
.page {
margin: 10mm;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
table {
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
height: auto; /* 高度根据内容自适应 */
font-size: 14px;
text-align: center;
border-collapse: collapse;
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
td {
padding: 10px 0;
border: 1px solid #333;
}
}
.xh {
width: 50px !important;
}
.checkbox {
border: 2px solid #999;
width: 10px;
height: 10px;
display: flex;
justify-content: center;
align-items: center;
margin-left:10px ;
}
</style>
<div>
${printNode.innerHTML}
</div>`)
doc.close()
//
setTimeout(() => {
newIframe.contentWindow.focus()
newIframe.contentWindow.print()
document.body.removeChild(newIframe) //
dialogVisible.value = false
}, 100)
}
const outopen = () => {
dialogVisible.value = false
}
const queryParams: any = ref({
code: undefined
})
const isSelected = ref([1, 3])
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
}
defineExpose({ open }) // open
</script>
<style scoped lang="scss">
.page {
width: 21cm;
min-height: 29.7cm;
padding: 10mm;
margin: 20px auto;
border: 1px #d3d3d3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
font-size: 14px !important;
}
@page {
size: A4;
margin: 0;
}
@media print {
.page {
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
table {
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
height: auto; /* 高度根据内容自适应 */
font-size: 14px;
text-align: center;
border-collapse: collapse;
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
td {
padding: 10px 0;
border: 1px solid #333;
}
}
.xh {
width: 50px !important;
}
.checkbox {
border: 2px solid #999;
width: 15px;
height: 15px;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10px;
}
/*
A4的大小21cm*29.7cmwidth:794px;
单位换算1 inch = 2.54 cm 1mm = 96 px 1 cm = 37.79528 px*/
</style>

@ -1,5 +1,5 @@
<template>
<el-card class="hl-card">
<el-card class="hl-card" v-loading="fullscreenLoading">
<template #header>
<span>实时库存</span>
</template>
@ -20,28 +20,12 @@
:value="dict.label" />
</el-select>
</el-form-item>
<el-form-item label="批次号" prop="lotNo" v-if="false">
<el-input v-model="queryParams.lotNo" placeholder="批次号" clearable @keyup.enter="handleQuery" class="!w-240px" />
</el-form-item>
<el-form-item label="仓库" prop="whId">
<el-select v-model="queryParams.whId" placeholder="下拉选择" clearable class="!w-240px" @change="handleWh">
<el-option v-for="dict in whList" :key="dict.id" :label="dict.wh_name"
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="库区" prop="rgId">
<el-select v-model="queryParams.rgId" placeholder="下拉选择" clearable class="!w-240px" @change="handleRg">
<el-option v-for="dict in rgCurrentList" :key="dict.id" :label="dict.rg_name"
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="库位" prop="pnId">
<el-select v-model="queryParams.pnId" placeholder="下拉选择" clearable class="!w-240px">
<el-option v-for="dict in pnCurrentList" :key="dict.id" :label="dict.pn_name"
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item style="margin-left:15px">
<el-button @click="handleQuery" type="primary">
<Icon icon="ep:search" class="mr-5px" /> 搜索
@ -49,6 +33,12 @@
<el-button @click="resetQuery">
<Icon icon="ep:refresh" class="mr-5px" /> 重置
</el-button>
<el-button
@click="getChanjet()"
style="background-color: rgba(0, 0, 255, 1); color: #fff"
>
获取数据
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
@ -62,11 +52,7 @@
<el-table-column label="物料类型" align="center" prop="matType" min-width="120"/>
<el-table-column label="物料简称" align="center" prop="shortName" min-width="120"/>
<el-table-column label="规格/型号" align="center" prop="matSpec" min-width="120"/>
<el-table-column label="品牌" align="center" prop="matBrand" min-width="120"/>
<el-table-column label="仓库" align="center" prop="whName" min-width="120"/>
<el-table-column label="库区" align="center" prop="rgName" min-width="120"/>
<el-table-column label="库位" align="center" prop="pnName" min-width="120"/>
<el-table-column label="批次号" align="center" prop="lotNo" min-width="120" v-if="false"/>
<el-table-column label="库存数量" align="center" prop="storageOkQty" min-width="120"/>
<el-table-column label="库存单位" align="center" prop="matUnit" min-width="120"/>
</el-table>
@ -84,14 +70,10 @@ import * as StorageLogApi from '@/api/biz/storagelog'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import * as WarehouseApi from '@/api/biz/warehouse'
import * as RgApi from '@/api/biz/rg'
import * as PnApi from '@/api/biz/pn'
defineOptions({ name: 'StorageLog' })
const whList = ref([])
const rgList = ref([])
const pnList = ref([])
const rgCurrentList = ref([])
const pnCurrentList = ref([])
@ -110,12 +92,35 @@ const queryParams = reactive({
matType: undefined,
lotNo: undefined,
whId: undefined,
rgId:undefined,
pnId: undefined,
headerNo: undefined,
})
const queryFormRef = ref() //
const fullscreenLoading = ref(false)
const reload: any = inject('reload')
const getChanjet = async () => {
loading.value = true
try {
// const response = await StorageLogApi.queryCustomerChanjet()
if (response === true) {
//
message.success(t('获取成功'))
fullscreenLoading.value = false
reload()
} else {
//
message.error(t('获取失败'))
fullscreenLoading.value = false
}
} catch (error) {
//
message.error(t('请求异常'))
console.error('Error fetching chanjet:', error)
fullscreenLoading.value = false
}
}
/** 查询列表 */
const getList = async () => {
loading.value = true
@ -140,37 +145,14 @@ const resetQuery = () => {
handleQuery()
}
const handleWh = async (wid) => {
queryParams.rgId = undefined
queryParams.pnId = undefined
rgCurrentList.value =[]
pnCurrentList.value =[]
rgCurrentList.value = rgList.value.filter( (item) => { return item.wh_id == wid})
}
const handleRg = async (rgid) => {
pnCurrentList.value =[]
pnCurrentList.value = pnList.value.filter( (item) => { return item.rg_id == rgid})
}
//
const init_page_wh = (async ()=>{
whList.value = await WarehouseApi.getSimpList()
})
//
const init_page_rg = (async ()=>{
rgList.value = await RgApi.getSimpList()
})
//
const init_page_pn = (async ()=>{
pnList.value = await PnApi.getSimpList()
})
/** 初始化 **/
onMounted(async () => {
await init_page_wh()
await init_page_rg()
await init_page_pn()
await getList()
})
</script>

Loading…
Cancel
Save