入库物料 ui/ux

入库物料 ui/ux
pull/1/head
siontion 9 months ago
parent f631d8834e
commit fe055d057d

@ -12,14 +12,14 @@
<el-col :span="8"> <el-col :span="8">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name" label="入库单号" required> <el-form-item prop="name" label="入库单号" >
<el-input v-model="formData.stockNo" disabled /> <el-input v-model="formData.stockNo" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="stockInType" label="入库类型" required> <el-form-item prop="stockInType" label="入库类型" >
<el-select v-model="formData.stockInType" clearable style="width: 100%"> <el-select v-model="formData.stockInType" clearable style="width: 100%">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.value" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" /> :label="dict.label" :value="dict.value" />
@ -32,7 +32,7 @@
<el-col :span="8"> <el-col :span="8">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="name" label="单号日期" required> <el-form-item prop="name" label="单号日期" >
<el-input v-model="formData.name" disabled /> <el-input v-model="formData.name" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -59,7 +59,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="level" label="入库仓库"> <el-form-item prop="whId" label="入库仓库" required>
<el-select v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh"> <el-select v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh">
<el-option v-for="dict in warehouseList" :key="dict.id" :label="dict.whName" :value="dict.id" /> <el-option v-for="dict in warehouseList" :key="dict.id" :label="dict.whName" :value="dict.id" />
</el-select> </el-select>
@ -95,7 +95,7 @@
<el-table-column prop="matCode" label="物料编码" required> <el-table-column prop="matCode" label="物料编码" required>
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.matCode" placeholder="物料编码" :remote-method="remoteMatCodeSearch" <el-select v-model="scope.row.matCode" placeholder="物料编码" :remote-method="remoteMatCodeSearch"
remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading" @change="handleMatCode(scope)" remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading" @change="(val) => handleMatCode(scope,val)"
class="!w-180px"> class="!w-180px">
<el-option v-for="item in matList" :key="item.id" :label="item.code" :value="item.id" /> <el-option v-for="item in matList" :key="item.id" :label="item.code" :value="item.id" />
</el-select> </el-select>
@ -136,7 +136,7 @@
<el-table-column prop="pnid" width="140" label="入库库位" required> <el-table-column prop="pnid" width="140" label="入库库位" required>
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.pnid" placeholder="" style="width: 100%"> <el-select v-model="scope.row.pnid" placeholder="" style="width: 100%">
<el-option v-for="dict in pnList" :key="dict.id" :label="dict.pnName" :value="dict.id" /> <el-option v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pnName" :value="dict.id" />
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -196,7 +196,7 @@
<el-table-column prop="name" label="文件名称" align="center"> <el-table-column prop="name" label="文件名称" align="center">
<template #default="scope"> <template #default="scope">
<!-- <div></div> --> <!-- <div></div> -->
<a :href="scope.row.url" style="color: #409eff">{{ scope.row.name }} </a> <a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a>
</template> </template>
</el-table-column> </el-table-column>
@ -207,7 +207,7 @@
<el-button link type="danger" size="small" @click="handleDelete(scope.$index)"> <el-button link type="danger" size="small" @click="handleDelete(scope.$index)">
删除 删除
</el-button> </el-button>
<el-button link type="primary" size="small"> 下载 </el-button> <el-button link type="primary" size="small" @click="downloadAttachment(scope.row.name,scope.row.url)"> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -278,7 +278,8 @@ import * as MaterialApi from '@/api/heli/material'
import * as WarehouseApi from '@/api/heli/warehouse' import * as WarehouseApi from '@/api/heli/warehouse'
import * as RgApi from '@/api/heli/rg' import * as RgApi from '@/api/heli/rg'
import * as PnApi from '@/api/heli/pn' import * as PnApi from '@/api/heli/pn'
import { ITEM_RENDER_EVT } from 'element-plus/es/components/virtual-list/src/defaults' import {deleteFile, downloadFile} from "@/api/infra/file";
import download from "@/utils/download";
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -309,8 +310,10 @@ const formData = ref({
productBomItemDOList: [] productBomItemDOList: []
}) })
const formRules = reactive({ const formRules = reactive({
name: [{ required: true, message: '模具类型不能为空', trigger: 'blur' }], // name: [{ required: true, message: '', trigger: 'blur' }],
status: [{ required: true, message: '启用状态不能为空', trigger: 'blur' }] status: [{ required: true, message: '启用状态不能为空', trigger: 'blur' }],
stockInType :[{ required: true, message: '入库类型不能为空', trigger: 'blur' }],
whId :[{ required: true, message: '入库仓库不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
@ -455,7 +458,7 @@ const handleDelete2 = (index: number) => {
const fileList = ref([ const fileList = ref([
{ {
name: 'element-plus-logo.svg', name: 'element-plus-logo.svg',
url: 'https://element-plus.org/images/element-plus-logo.svg', url: 'http://127.0.0.1:8080/admin-api/infra/file/5/get/d229467d4ad143582725cc39d16dd04c660034b71e3ddcfe930901639bbccee5.png',
uploadTimestamp: '2024-1-12 1606' uploadTimestamp: '2024-1-12 1606'
}, },
{ {
@ -481,6 +484,12 @@ const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => {
console.log('333') console.log('333')
} }
//
const downloadAttachment = async (name, url) => {
const data = await downloadFile(url)
download.any(data, name);
}
let uploadTimestamp: any = null let uploadTimestamp: any = null
const handleBeforeUpload = (file: File) => { const handleBeforeUpload = (file: File) => {
uploadTimestamp = new Date().toISOString() // uploadTimestamp = new Date().toISOString() //
@ -532,7 +541,7 @@ const handleWh = (async (wid) => {
formData.value.productBomItemDOList.forEach( item =>{ formData.value.productBomItemDOList.forEach( item =>{
item.rgid = '' item.rgid = ''
item.pnid = '' item.pnid = ''
item.pnlist = [] item.pnlist.value = []
}) })
//------------------- //-------------------
}) })
@ -545,8 +554,7 @@ const handleRg = (async (scope) => {
pnStatus: 1 pnStatus: 1
}) })
const dataPn = await PnApi.getPnPage(queryParamsRPn) const dataPn = await PnApi.getPnPage(queryParamsRPn)
pnList.value = [] scope.row.pnid = ''
pnList.value = dataPn.list
scope.row.pnlist = dataPn.list scope.row.pnlist = dataPn.list
//------------------- //-------------------
}) })
@ -585,15 +593,22 @@ const remoteMatCodeSearch = async (query) => {
} }
const handleMatCode = async (scope) =>{ const handleMatCode = async (scope,matid) =>{
if(scope.row.matCode){ if(matid){
const matVo = await MaterialApi.getMaterial(scope.row.matCode) const matVo = await MaterialApi.getMaterial(scope.row.matCode)
scope.row.matId = matVo.id scope.row.matId = matVo.id
scope.row.matName = matVo.name scope.row.matName = matVo.name
scope.row.matSpec = matVo.spec scope.row.matSpec = matVo.spec
scope.row.matType = matVo.materialType scope.row.matType = matVo.materialType
scope.row.matUnit = matVo.unit scope.row.matUnit = matVo.unit
}else{
scope.row.matId = ''
scope.row.matCode = ''
scope.row.matName = ''
scope.row.matSpec = ''
scope.row.matType = ''
scope.row.matUnit = ''
} }
} }

Loading…
Cancel
Save