|
|
|
@ -12,14 +12,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 />
|
|
|
|
|
</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 style="width: 100%">
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.value"
|
|
|
|
|
:label="dict.label" :value="dict.value" />
|
|
|
|
@ -32,7 +32,7 @@
|
|
|
|
|
<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.name" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -95,13 +95,13 @@
|
|
|
|
|
<el-table-column prop="matCode" label="物料编码" required>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-select v-model="scope.row.matCode" placeholder="物料编码" :remote-method="remoteMatCodeSearch"
|
|
|
|
|
remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading" @change="(val) => handleMatCode(scope,val)"
|
|
|
|
|
class="!w-180px">
|
|
|
|
|
remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading"
|
|
|
|
|
@change="(val) => handleMatCode(scope, val)" class="!w-180px">
|
|
|
|
|
<el-option v-for="item in matList" :key="item.id" :label="item.code" :value="item.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="matName" label="物料名称" >
|
|
|
|
|
<el-table-column prop="matName" label="物料名称">
|
|
|
|
|
<!-- <template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.matName"
|
|
|
|
|
:disabled="!scope.row.editable" />
|
|
|
|
@ -116,14 +116,16 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="matType" label="物料类型">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType?true:false"/>
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType"
|
|
|
|
|
v-if="scope.row.matType ? true : false" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="matSpec" label="规格/型号" />
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="matUnit" label="系统单位">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="scope.row.matUnit?true:false" />
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit"
|
|
|
|
|
v-if="scope.row.matUnit ? true : false" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="rgId" width="140" label="入库库区" required>
|
|
|
|
@ -142,17 +144,17 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="storageOkQty" width="120" label="入库数量" required>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.storageOkQty" />
|
|
|
|
|
<el-input v-model="scope.row.storageOkQty" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="lotNo" width="120" label="批次号">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.lotNo" />
|
|
|
|
|
<el-input v-model="scope.row.lotNo" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="description" width="150" label="备注">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.description" />
|
|
|
|
|
<el-input v-model="scope.row.description" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" width="240">
|
|
|
|
@ -185,14 +187,17 @@
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-card class="hl-incard">
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-upload v-model:file-list="fileList" :show-file-list="false" class="upload-demo"
|
|
|
|
|
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" multiple
|
|
|
|
|
:on-preview="handlePreview" :on-remove="handleRemove" :before-remove="beforeRemove" :limit="3"
|
|
|
|
|
:on-exceed="handleExceed" @before-upload="handleBeforeUpload">
|
|
|
|
|
<el-button type="primary" size="large" class="hl-addbutton">上传</el-button>
|
|
|
|
|
<el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :action="uploadUrl"
|
|
|
|
|
:headers="{ 'Authorization': 'Bearer ' + getAccessToken(), 'tenant-id': getTenantId() }" name="files"
|
|
|
|
|
:show-file-list="false" :auto-upload="false"
|
|
|
|
|
:data="{ 'businessType': 'STORAGE', 'businessId': formData.id, 'businessFileType': 'MATERIAL' }"
|
|
|
|
|
:on-change="matUploadChange" class="upload-file-uploader">
|
|
|
|
|
<el-button type="primary">
|
|
|
|
|
<Icon icon="ep:upload-filled" />上传
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-table :data="fileList" class="hl-table">
|
|
|
|
|
<el-table :data="matUploadFiles" class="hl-table">
|
|
|
|
|
<el-table-column prop="name" label="文件名称" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<!-- <div></div> -->
|
|
|
|
@ -200,14 +205,17 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="uploadTimestamp" align="center" label="上传日期" />
|
|
|
|
|
<el-table-column prop="createTime" align="center" label="上传日期" :formatter="dateFormatter" />
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button link type="danger" size="small" @click="handleDelete(scope.$index)">
|
|
|
|
|
<el-button link type="danger" size="small"
|
|
|
|
|
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)">
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button link type="primary" size="small" @click="downloadAttachment(scope.row.name,scope.row.url)"> 下载 </el-button>
|
|
|
|
|
<el-button link type="primary" size="small" v-if="isShow"
|
|
|
|
|
@click="downloadAttachment(scope.row.name, scope.row.url)">
|
|
|
|
|
下载 </el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -268,19 +276,21 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
|
|
|
|
|
import type { UploadProps, UploadUserFile } from 'element-plus'
|
|
|
|
|
import { dateFormatter } from "@/utils/formatTime"
|
|
|
|
|
import type { UploadUserFile } from 'element-plus'
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import * as StorageApi from '@/api/heli/storage'
|
|
|
|
|
import * as StorageMatApi from '@/api/heli/storagemat'
|
|
|
|
|
import { getAccessToken, getTenantId } from "@/utils/auth"
|
|
|
|
|
|
|
|
|
|
import * as MaterialApi from '@/api/heli/material'
|
|
|
|
|
import * as WarehouseApi from '@/api/heli/warehouse'
|
|
|
|
|
import * as RgApi from '@/api/heli/rg'
|
|
|
|
|
import * as PnApi from '@/api/heli/pn'
|
|
|
|
|
import {deleteFile, downloadFile} from "@/api/infra/file";
|
|
|
|
|
import download from "@/utils/download";
|
|
|
|
|
import { deleteFile, downloadFile } from "@/api/infra/file"
|
|
|
|
|
import download from "@/utils/download"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
@ -309,17 +319,66 @@ const formData = ref({
|
|
|
|
|
outboundTime: undefined,
|
|
|
|
|
cancel: undefined,
|
|
|
|
|
cancelTime: undefined,
|
|
|
|
|
productBomItemDOList: []
|
|
|
|
|
productBomItemDOList: [],
|
|
|
|
|
attachments: []
|
|
|
|
|
})
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
// name: [{ required: true, message: '模具类型不能为空', trigger: 'blur' }],
|
|
|
|
|
status: [{ required: true, message: '启用状态不能为空', trigger: 'blur' }],
|
|
|
|
|
stockInType :[{ required: true, message: '入库类型不能为空', trigger: 'blur' }],
|
|
|
|
|
whId :[{ required: true, message: '入库仓库不能为空', trigger: 'blur' }]
|
|
|
|
|
stockInType: [{ required: true, message: '入库类型不能为空', trigger: 'blur' }],
|
|
|
|
|
whId: [{ required: true, message: '入库仓库不能为空', trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
// ====================附件信息 开始=======================================
|
|
|
|
|
const uploadUrl = ref(import.meta.env.VITE_UPLOAD_BATCH_URL)
|
|
|
|
|
const matUploadRef = ref();
|
|
|
|
|
const matUploadFiles = ref<UploadUserFile[]>([]);
|
|
|
|
|
const matUploadChange = (file, files) => {
|
|
|
|
|
matUploadFiles.value = files;
|
|
|
|
|
refreshAttachments(files, 'MATERIAL')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const refreshAttachments = (files, type) => {
|
|
|
|
|
formData.value.attachments = formData.value.attachments.filter((value, index, array) => {
|
|
|
|
|
return value.businessFileType != type;
|
|
|
|
|
});
|
|
|
|
|
for (let i = 0; i < files.length; i++) {
|
|
|
|
|
let file = files[i];
|
|
|
|
|
file.businessFileType = type;
|
|
|
|
|
file.createTime = new Date();
|
|
|
|
|
formData.value.attachments.push(file);
|
|
|
|
|
}
|
|
|
|
|
// 排序
|
|
|
|
|
formData.value.attachments.sort((v1, v2) => {
|
|
|
|
|
return v1.businessFileType == v2.businessFileType ? 0 : 1;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 删除附件
|
|
|
|
|
const handleDeleteAttachment = async (index, type) => {
|
|
|
|
|
const deletedAttachments = formData.value.attachments.splice(index, 1);
|
|
|
|
|
for (let i = 0; i < deletedAttachments.length; i++) {
|
|
|
|
|
const attachment = deletedAttachments[i];
|
|
|
|
|
if (attachment.id) {
|
|
|
|
|
// 清理已上传文件
|
|
|
|
|
await deleteFile(attachment.id);
|
|
|
|
|
}
|
|
|
|
|
// 清理待上传文件
|
|
|
|
|
matUploadFiles.value = matUploadFiles.value.filter(file1 => {
|
|
|
|
|
return file1.name != attachment.name || file1.businessFileType != type;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
protocolUploadFiles.value = protocolUploadFiles.value.filter(file2 => {
|
|
|
|
|
return file2.name != attachment.name || file2.businessFileType != type;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 下载文件
|
|
|
|
|
const downloadAttachment = async (name, url) => {
|
|
|
|
|
const data = await downloadFile(url)
|
|
|
|
|
download.any(data, name);
|
|
|
|
|
}
|
|
|
|
|
// ====================附件信息 结束=======================================
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
@ -351,9 +410,9 @@ const submitForm = async () => {
|
|
|
|
|
if (router.query.type === 'create') {
|
|
|
|
|
storageid.value = await StorageApi.createStorage(data)
|
|
|
|
|
|
|
|
|
|
formData.value.productBomItemDOList.forEach( item=>{
|
|
|
|
|
item.stockId = storageid.value
|
|
|
|
|
item.whId = formData.value.whId
|
|
|
|
|
formData.value.productBomItemDOList.forEach(item => {
|
|
|
|
|
item.stockId = storageid.value
|
|
|
|
|
item.whId = formData.value.whId
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const dataMats = formData.value.productBomItemDOList as unknown as StorageMatApi.StorageMatVO[]
|
|
|
|
@ -373,43 +432,33 @@ const submitForm = async () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const goback = () => {
|
|
|
|
|
resetForm()
|
|
|
|
|
}
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
formData.value = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
status: 1,
|
|
|
|
|
productBomItemDOList: []
|
|
|
|
|
}
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var matCount = 1
|
|
|
|
|
const onAddItem = () => {
|
|
|
|
|
const newData = {
|
|
|
|
|
// 新数据的属性
|
|
|
|
|
cid : matCount,
|
|
|
|
|
stockId : 0,
|
|
|
|
|
cid: matCount,
|
|
|
|
|
stockId: 0,
|
|
|
|
|
matId: '',
|
|
|
|
|
matName: '',
|
|
|
|
|
matCode: '',
|
|
|
|
|
matType : '',
|
|
|
|
|
matType: '',
|
|
|
|
|
matSpec: '',
|
|
|
|
|
matUnit: '',
|
|
|
|
|
whId: '',
|
|
|
|
|
rgId: '',
|
|
|
|
|
pnId: '',
|
|
|
|
|
pnlist : ref([]),
|
|
|
|
|
pnlist: ref([]),
|
|
|
|
|
storageOkQty: '',
|
|
|
|
|
lotNo: '',
|
|
|
|
|
description: '',
|
|
|
|
|
productBomItemValueDOList: []
|
|
|
|
|
}
|
|
|
|
|
matCount = matCount+ 1
|
|
|
|
|
matCount = matCount + 1
|
|
|
|
|
formData.value.productBomItemDOList.push(newData)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 复制数据
|
|
|
|
@ -419,48 +468,27 @@ const handlefuke = (index, item) => {
|
|
|
|
|
// 复制数据
|
|
|
|
|
const newData: any = {
|
|
|
|
|
...data,
|
|
|
|
|
cid : matCount,
|
|
|
|
|
stockId : item.stockId,
|
|
|
|
|
cid: matCount,
|
|
|
|
|
stockId: item.stockId,
|
|
|
|
|
matId: item.matId,
|
|
|
|
|
matName: item.matName,
|
|
|
|
|
matCode: item.matCode,
|
|
|
|
|
matType : item.matType,
|
|
|
|
|
matType: item.matType,
|
|
|
|
|
matSpec: item.matSpec,
|
|
|
|
|
matUnit: item.matUnit,
|
|
|
|
|
whId: item.whId,
|
|
|
|
|
rgId: item.rgId,
|
|
|
|
|
pnId: item.pnId,
|
|
|
|
|
pnlist : item.pnlist,
|
|
|
|
|
pnlist: item.pnlist,
|
|
|
|
|
storageOkQty: item.storageOkQty,
|
|
|
|
|
lotNo: item.lotNo,
|
|
|
|
|
description: item.description,
|
|
|
|
|
productBomItemValueDOList: []
|
|
|
|
|
}
|
|
|
|
|
matCount = matCount+ 1
|
|
|
|
|
matCount = matCount + 1
|
|
|
|
|
// 添加新数据
|
|
|
|
|
formData.value.productBomItemDOList.splice(index + 1, 0, newData)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//点击编辑 / 保存 input框是否可输入
|
|
|
|
|
const handleEdit = (index) => {
|
|
|
|
|
formData.value.productBomItemDOList[index].editable = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSave = (index) => {
|
|
|
|
|
formData.value.productBomItemDOList[index].editable = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleCellClick = (row, column, event) => {
|
|
|
|
|
if (row.editable) {
|
|
|
|
|
column.el.querySelector('input').focus()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleCellBlur = (row, column, event) => {
|
|
|
|
|
if (row.editable) {
|
|
|
|
|
column.el.querySelector('input').blur()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除新增物料信息
|
|
|
|
@ -468,72 +496,8 @@ const handleDelete2 = (index: number) => {
|
|
|
|
|
formData.value.productBomItemDOList.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//上传的附件信息
|
|
|
|
|
|
|
|
|
|
const fileList = ref([
|
|
|
|
|
{
|
|
|
|
|
name: 'element-plus-logo.svg',
|
|
|
|
|
url: 'http://127.0.0.1:8080/admin-api/infra/file/5/get/d229467d4ad143582725cc39d16dd04c660034b71e3ddcfe930901639bbccee5.png',
|
|
|
|
|
uploadTimestamp: '2024-1-12 16:06'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'element-plus-logo2.svg',
|
|
|
|
|
url: 'https://element-plus.org/images/element-plus-logo.svg',
|
|
|
|
|
uploadTimestamp: '2024-1-12 16:06'
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const handleRemove: UploadProps['onRemove'] = (file, uploadFiles) => {
|
|
|
|
|
console.log(file, uploadFiles, '11')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
|
|
|
|
|
console.log(uploadFile, '222')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => {
|
|
|
|
|
ElMessage.warning(
|
|
|
|
|
`The limit is 3, you selected ${files.length} files this time, add up to ${files.length + uploadFiles.length
|
|
|
|
|
} totally`
|
|
|
|
|
)
|
|
|
|
|
console.log('333')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 下载文件
|
|
|
|
|
const downloadAttachment = async (name, url) => {
|
|
|
|
|
const data = await downloadFile(url)
|
|
|
|
|
download.any(data, name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let uploadTimestamp: any = null
|
|
|
|
|
const handleBeforeUpload = (file: File) => {
|
|
|
|
|
uploadTimestamp = new Date().toISOString() // 获取并保存当前时间戳
|
|
|
|
|
// 如果需要阻止默认上传行为,可以返回 false
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
|
|
// 创建新的文件对象并添加到 filelist 中
|
|
|
|
|
const newFile: any = {
|
|
|
|
|
name: '',
|
|
|
|
|
url: '', // 这里可以是实际上传后的URL,根据实际情况填写
|
|
|
|
|
uploadTimestamp: uploadTimestamp!,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileList.value.push(newFile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => {
|
|
|
|
|
console.log('444', uploadFile, uploadFiles)
|
|
|
|
|
|
|
|
|
|
return ElMessageBox.confirm(`Cancel the transfer of ${uploadFile.name} ?`).then(
|
|
|
|
|
() => true,
|
|
|
|
|
() => false
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除上传的附件信息
|
|
|
|
|
const handleDelete = (index: number) => {
|
|
|
|
|
fileList.value.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
//仓库全数据
|
|
|
|
|
const warehouseList = ref([])
|
|
|
|
|
//库区全数据
|
|
|
|
@ -553,7 +517,7 @@ const handleWh = (async (wid) => {
|
|
|
|
|
pnList.value = []
|
|
|
|
|
rgList.value = dataRg.list
|
|
|
|
|
|
|
|
|
|
formData.value.productBomItemDOList.forEach( item =>{
|
|
|
|
|
formData.value.productBomItemDOList.forEach(item => {
|
|
|
|
|
item.rgId = ''
|
|
|
|
|
item.pnId = ''
|
|
|
|
|
item.pnlist.value = []
|
|
|
|
@ -570,54 +534,39 @@ const handleRg = (async (scope) => {
|
|
|
|
|
})
|
|
|
|
|
const dataPn = await PnApi.getPnPage(queryParamsRPn)
|
|
|
|
|
scope.row.pnid = ''
|
|
|
|
|
scope.row.pnlist = dataPn.list
|
|
|
|
|
scope.row.pnlist = dataPn.list
|
|
|
|
|
//-------------------
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const matList = ref<MaterialApi.MaterialVO[]>([]) // 用户列表
|
|
|
|
|
const matList = ref<MaterialApi.MaterialVO[]>([]) // 物料列表
|
|
|
|
|
const matSelectLoading = ref(false);
|
|
|
|
|
const remoteMatSearch = async (query) => {
|
|
|
|
|
matSelectLoading.value= true
|
|
|
|
|
// 获得用户列表
|
|
|
|
|
let matParams = {
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
name : query,
|
|
|
|
|
status: "1"
|
|
|
|
|
}
|
|
|
|
|
const dataMat = await MaterialApi.getMaterialPage(matParams)
|
|
|
|
|
matList.value = []
|
|
|
|
|
matList.value = dataMat.list
|
|
|
|
|
matSelectLoading.value= false
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const remoteMatCodeSearch = async (query) => {
|
|
|
|
|
matSelectLoading.value= true
|
|
|
|
|
matSelectLoading.value = true
|
|
|
|
|
// 获得用户列表
|
|
|
|
|
let matParams = {
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
code : query,
|
|
|
|
|
code: query,
|
|
|
|
|
status: "1"
|
|
|
|
|
}
|
|
|
|
|
const dataMat = await MaterialApi.getMaterialPage(matParams)
|
|
|
|
|
matList.value = []
|
|
|
|
|
matList.value = dataMat.list
|
|
|
|
|
matSelectLoading.value= false
|
|
|
|
|
matSelectLoading.value = false
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleMatCode = async (scope,matid) =>{
|
|
|
|
|
const handleMatCode = async (scope, matid) => {
|
|
|
|
|
|
|
|
|
|
if(matid){
|
|
|
|
|
if (matid) {
|
|
|
|
|
const matVo = await MaterialApi.getMaterial(scope.row.matCode)
|
|
|
|
|
scope.row.matId = matVo.id
|
|
|
|
|
scope.row.matName = matVo.name
|
|
|
|
|
scope.row.matSpec = matVo.spec
|
|
|
|
|
scope.row.matType = matVo.materialType
|
|
|
|
|
scope.row.matUnit = matVo.unit
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
scope.row.matId = ''
|
|
|
|
|
scope.row.matCode = ''
|
|
|
|
|
scope.row.matName = ''
|
|
|
|
|