入库管理

This commit is contained in:
bb_pan 2025-12-24 18:17:46 +08:00
parent d39426a7dc
commit 1cff4203b1
2 changed files with 831 additions and 20 deletions

View File

@ -0,0 +1,794 @@
<template>
<!-- 弹窗内容区域 -->
<el-dialog
title="设备入库"
:visible.sync="dialogVisible"
width="90%"
:destroy-on-close="true"
:close-on-click-modal="false"
class="dialog-box"
>
<div class="dialog-content">
<div class="page-header">
<div>
<!-- <i
class="el-icon-arrow-left goBack-btn"
@click="goBack"
style="
border-color: transparent;
color: #00a288;
background: transparent;
padding-left: 0;
padding-right: 0;
"
>返回</i
>
<span class="page-title">{{ pageTitle }}</span> -->
</div>
<div class="dialog-footer" style="float: right">
<!-- <el-button size="medium" @click="close">取消</el-button> -->
<el-button type="primary" size="medium" @click="handleSubmit">确认</el-button>
</div>
</div>
<el-form
label-width="120px"
ref="formRef"
style="padding: 12px; overflow-y: auto; height: calc(100vh - 180px); width: 100%"
label-position="right"
:model="form"
:rules="equipRules"
>
<div style="display: flex; padding-bottom: 5px">
<div style="width: 5px; background-color: #00a288; margin-right: 10px"></div>
基础信息
</div>
<el-row :gutter="24" style="padding-top: 10px">
<el-col :span="6">
<el-form-item label="专业" prop="major">
<el-select v-model="form.major" placeholder="请选择专业" @change="majorChange" style="width: 100%">
<el-option v-for="item in majorList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="工序" prop="process">
<el-cascader
style="width: 100%"
v-model="form.process"
placeholder="请选择工序"
clearable
filterable
:options="processList"
@change="processChange"
></el-cascader>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="装备类目" prop="category">
<el-cascader
style="width: 100%"
v-model="form.category"
:options="categoryList"
clearable
filterable
placeholder="请选择装备类目"
@change="categoryChange"
></el-cascader>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="装备名称" prop="name">
<el-input autocomplete="off" maxlength="30" placeholder="请输入装备名称" v-model="form.name" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="规格型号" prop="specificationModel">
<el-input
autocomplete="off"
maxlength="30"
v-model="form.specificationModel"
placeholder="请输入规格型号"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="资产原值(万元)" prop="originalValue">
<el-input
@input="handlePriceInput"
autocomplete="off"
maxlength="20"
v-model="form.originalValue"
placeholder="请输入资产原值(万元)"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="生产厂家" prop="manufacturerId">
<el-select v-model="form.manufacturerId" placeholder="请选择生产厂家" clearable style="width: 100%">
<el-option v-for="item in manufacturerList" :key="item.id" :label="item.label" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="出厂日期" prop="productionDate">
<el-date-picker
v-model="form.productionDate"
type="date"
placeholder="请选择出厂日期"
value-format="yyyy-MM-dd"
style="width: 100%"
:picker-options="{
disabledDate(time) {
return time.getTime() > Date.now()
},
}"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="下次维保日期" prop="nextMaintenanceDate">
<el-date-picker
v-model="form.nextMaintenanceDate"
placeholder="请选择下次维保日期"
value-format="yyyy-MM-dd"
type="date"
style="width: 100%"
:picker-options="{
disabledDate(time) {
return time.getTime() < Date.now()
},
}"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="装备原始编码" prop="originalCode">
<el-input clearable maxlength="20" placeholder="请输入装备原始编码" v-model="form.originalCode" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="最大使用年限" prop="maxServiceLifeYears">
<el-input-number
clearable
maxlength="20"
placeholder="请输入最大使用年限"
v-model="form.maxServiceLifeYears"
:min="1"
:max="100"
:precision="0"
:controls="false"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="计数单位" prop="unit">
<!-- <el-input v-model="form.unit" placeholder="请输入计数单位" clearable maxlength="11" /> -->
<el-select v-model="form.unit" placeholder="请选择计数单位" clearable style="width: 100%">
<el-option
v-for="dict in dict.type.dev_unit_type"
:key="dict.label"
:label="dict.label"
:value="dict.label"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="采购日期" prop="purchaseDate">
<el-date-picker
v-model="form.purchaseDate"
placeholder="请选择采购日期"
value-format="yyyy-MM-dd"
type="date"
style="width: 100%"
:picker-options="{
disabledDate(time) {
return time.getTime() > Date.now()
},
}"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<div style="display: flex; padding-bottom: 10px">
<div style="width: 5px; background-color: #00a288; margin-right: 10px"></div>
特征属性
</div>
<el-row :gutter="24" style="padding-top: 10px">
<!-- propertyVoList -->
<el-col :span="6" v-for="(item, index) in propertyVoList" :key="index">
<el-form-item v-if="item.inputType == 1" :label="item.propertyName">
<el-input autocomplete="off" maxlength="30" v-model="item.propertyValue" clearable />
</el-form-item>
<!-- 单选 -->
<el-form-item v-if="item.inputType == 2" :label="item.propertyName">
<el-select v-model="item.propertyValue" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="(item, index) in handleData(item.value)"
:key="index"
:label="item.value"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<!-- 多选 -->
<el-form-item v-if="item.inputType == 3" :label="item.propertyName">
<el-select v-model="item.propertyValue" multiple placeholder="请选择" clearable style="width: 100%">
<el-option
v-for="(item, index) in handleData(item.value)"
:key="index"
:label="item.value"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="6">
<el-form-item label="专业特征" prop="specialtyFeature">
<el-input autocomplete="off" maxlength="30" v-model="form.specialtyFeature" clearable />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="工序特征" prop="processFeature">
<el-input autocomplete="off" maxlength="30" v-model="form.processFeature" clearable />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="类目特征" prop="categoryFeature">
<el-input autocomplete="off" maxlength="30" v-model="form.categoryFeature" clearable />
</el-form-item>
</el-col> -->
</el-row>
<div style="display: flex; padding-bottom: 10px">
<div style="width: 5px; background-color: #00a288; margin-right: 10px"></div>
装备图片
</div>
<el-row :gutter="24" style="padding-top: 10px">
<el-col>
<el-form-item label="装备外观" prop="mainFileList">
<ImageUpload
v-model="form.mainFileList"
:value="form.mainFileList"
:limit="6"
@change="handleImageChange"
/>
</el-form-item>
</el-col>
</el-row>
<div style="display: flex; padding-bottom: 10px">
<div style="width: 5px; background-color: #00a288; margin-right: 10px"></div>
相关证书
</div>
<el-row :gutter="24" style="padding-top: 10px">
<el-col>
<el-form-item label="合格证" prop="certificateList">
<FileUpload
v-model="form.certificateList"
:value="form.certificateList"
:limit="3"
:fileSize="10"
:fileType="['jpg', 'png', 'pdf']"
@change="handleCertificateChange"
/>
</el-form-item>
<el-form-item label="检测证书" prop="inspectionList">
<FileUpload
v-model="form.inspectionList"
:value="form.inspectionList"
:limit="3"
:fileSize="10"
:fileType="['jpg', 'png', 'pdf']"
@change="handleInspectionChange"
/>
</el-form-item>
<el-form-item label="采购发票" prop="purchaseInvoices">
<FileUpload
v-model="form.purchaseInvoices"
:value="form.purchaseInvoices"
:limit="3"
:fileSize="10"
:fileType="['jpg', 'png', 'pdf']"
@change="handlePurchaseInvoicesChange"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-dialog>
</template>
<script>
import {
addInterDevice,
getEquipmentAddIdApi,
firstLevel,
secondAndThirdLevel,
fourthToSixthLevel,
getDeviceApi,
equipmentEditApiNew,
getEquipmentPropertyTypeApi,
} from '@/api/EquipmentEntryApply'
import { getManufacturerSelectApi } from '@/api/EquipmentLedger/index.js'
import ImageUpload from '@/components/ImageUpload'
import FileUpload from '@/components/FileImageUpload'
import { handlePositiveNumberInput } from '@/utils/bonus.js'
export default {
name: 'EquipmentEntryEditDialog', //
emits: ['update:isVisible', 'submit', 'getOrderId'], //
dicts: ['dev_unit_type'],
components: { ImageUpload, FileUpload },
data() {
return {
dialogVisible: false,
isSubmit: false,
query: {},
pageTitle: '新增装备',
//
majorList: [],
processList: [],
categoryList: [],
manufacturerList: [],
form: {
major: '', //
process: [], //
category: [], //
name: '', //
specificationModel: '', //
originalValue: '', //
productionDate: '', //
manufacturerId: '', //
originalCode: '', //
nextMaintenanceDate: '', //
maxServiceLifeYears: '', // 寿
manageType: '0', //
count: 1, //
unit: '', //
purchaseDate: '',
specialtyFeature: '', //
processFeature: '', //
categoryFeature: '', //
// deviceTypeList: [], //
mainFileList: [], //
certificateList: [], //
inspectionList: [], //
},
//
equipRules: {
major: [{ required: true, message: '请选择专业', trigger: 'change' }],
process: [{ required: true, message: '请选择工序', trigger: 'change' }],
category: [{ required: true, message: '请选择装备类目', trigger: 'change' }],
name: [{ required: true, message: '请输入装备名称', trigger: 'blur' }],
specificationModel: [{ required: true, message: '请输入规格型号', trigger: 'blur' }],
originalValue: [{ required: true, message: '请输入资产原值', trigger: 'blur' }],
productionDate: [{ required: true, message: '请选择出厂日期', trigger: 'change' }],
manufacturerId: [{ required: true, message: '请输入生产厂家', trigger: 'blur' }],
originalCode: [{ required: true, message: '请输入装备原始编码', trigger: 'blur' }],
nextMaintenanceDate: [{ required: true, message: '请选择下次维保日期', trigger: 'change' }],
maxServiceLifeYears: [{ required: true, message: '请输入装备寿命', trigger: 'blur' }],
// manageType: [{ required: true, message: '', trigger: 'change' }],
count: [{ required: true, message: '请输入装备数量', trigger: 'blur' }],
unit: [{ required: true, message: '请输入计数单位', trigger: 'blur' }],
purchaseDate: [{ required: true, message: '请选择采购日期', trigger: 'change' }],
certificateList: [{ required: true, message: '请上传合格证', trigger: 'change' }],
inspectionList: [{ required: true, message: '请上传检测证书', trigger: 'change' }],
mainFileList: [{ required: true, message: '请上传图片', trigger: 'change' }],
},
propertyVoList: [], //
}
},
created() {
// this.firstLevel()
// this.getManufacturerSelectList()
// this.query = this.$route.query
// console.log('🚀 ~ this.query:', this.query)
// this.form.orderId = this.orderId = this.query.orderId || ''
// if (this.query && this.query.maId) {
// this.pageTitle = ''
// this.getInfo()
// }
},
methods: {
openDialog(orderId) {
this.dialogVisible = true
this.firstLevel()
this.getManufacturerSelectList()
this.form.orderId = orderId
},
//
async getInfo() {
try {
const res = await getDeviceApi(this.query.maId)
console.log('🚀 ~ getInfo ~ res:', res)
this.form = res.data
this.form.mainFileList = res.data.appearanceImages
? res.data.appearanceImages.map((item) => item.fileUrl).join(',')
: []
this.form.certificateList = res.data.certificates
? res.data.certificates.map((item) => item.fileUrl).join(',')
: []
this.form.inspectionList = res.data.inspectionReports
? res.data.inspectionReports.map((item) => item.fileUrl).join(',')
: []
this.form.purchaseInvoices = res.data.purchaseInvoices
? res.data.purchaseInvoices.map((item) => item.fileUrl).join(',')
: []
this.form.process = [String(res.data.mainProcessId), String(res.data.subProcessId)].filter(Boolean)
console.log('🚀 ~ getInfo ~ this.form.process:', this.form.process)
if (res.data.branchId) {
this.form.category = [
String(res.data.mainCategoryId),
String(res.data.subCategoryId),
String(res.data.branchId),
].filter(Boolean)
} else {
this.form.category = [String(res.data.mainCategoryId), String(res.data.subCategoryId)].filter(Boolean)
}
this.propertyVoList = res.data.propertyVoList || []
console.log('🚀 ~ getInfo ~ this.propertyVoList:', this.propertyVoList)
if (this.propertyVoList.length > 0) {
this.propertyVoList.forEach((item) => {
if (item.propertyValue === '' || item.propertyValue === null || item.propertyValue === undefined) {
item.propertyValue = null
}
if (item.inputType == 3) {
item.propertyValue = item.propertyValue.split(',')
}
})
}
const res2 = await secondAndThirdLevel({ firstLevelId: this.form.majorId })
this.processList = this.convertToSubTree(res2.data)
const res3 = await fourthToSixthLevel({ thirdLevelId: this.form.subProcessId })
this.categoryList = this.convertToSubTree(res3.data)
} catch (error) {
console.log('🚀 ~ getInfo ~ error:', error)
}
},
//
getManufacturerSelectList() {
getManufacturerSelectApi().then((res) => {
console.log('🚀 ~ getManufacturerSelectList ~ res:', res)
if (res.code === 200) {
this.manufacturerList = res.data
}
})
},
/**
* 获取一级类型
*/
firstLevel() {
firstLevel().then((res) => {
if (res.code === 200) {
this.majorList = res.data
}
})
},
majorChange(item) {
if (!item) {
this.processList = []
this.form.process = []
} else {
secondAndThirdLevel({ firstLevelId: item }).then((res) => {
if (res.code === 200) {
this.processList = this.convertToSubTree(res.data)
}
})
}
},
processChange(item) {
console.log('🚀 ~ processChange ~ item:', item)
if (item.length === 0) {
this.categoryList = []
this.form.category = []
} else {
fourthToSixthLevel({ thirdLevelId: item[item.length - 1] }).then((res) => {
if (res.code === 200) {
this.categoryList = this.convertToSubTree(res.data)
}
})
}
},
categoryChange(item) {
console.log('🚀 ~ processChange ~ item:', item)
this.propertyVoList = []
this.getPropertyVoList(item[item.length - 1])
},
//
goBack() {
// this.$tab.closePage()
this.$router.push({
name: 'equipmentInput',
query: {
orderId: this.orderId,
isAddVisible: false,
isApprovalVisible: false,
},
})
},
close() {
this.$tab.closePage({ path: '/equipment/equipment-input/add' }).then(() => {
this.$router.push({
name: 'equipmentInput',
query: {
orderId: this.orderId,
isAddVisible: false,
isApprovalVisible: false,
},
})
})
},
deviceTypeChange(val) {
if (val === 0) {
this.form.count = 1
}
},
//
handlePriceInput(v) {
this.form.originalValue = handlePositiveNumberInput(this.form.originalValue)
// this.form.originalValue = this.form.originalValue
// .replace(/[^\d.]/g, '') //
// .replace(/\.{2,}/g, '.') // ->
// .replace(/^(\d+)\.(.*)\./, '$1.$2'); //
},
//
handleImageChange(files) {
this.form.mainFileList = files
this.$refs.formRef.validateField('mainFileList')
},
//
handleCertificateChange(files) {
this.form.certificateList = files
this.$refs.formRef.validateField('certificateList')
},
//
handleInspectionChange(files) {
this.form.inspectionList = files
this.$refs.formRef.validateField('inspectionList')
},
//
handlePurchaseInvoicesChange(files) {
this.form.purchaseInvoices = files
this.$refs.formRef.validateField('purchaseInvoices')
},
/**
* 处理表单提交
*/
async handleSubmit() {
console.log('🚀 ~ handleSubmit ~ this.form:', this.form, this.propertyVoList)
this.$refs['formRef'].validate(async (valid) => {
if (valid) {
if (this.isSubmit) return
this.isSubmit = true
const loading = this.$loading()
try {
if (!this.form.orderId) {
const result = await getEquipmentAddIdApi()
this.orderId = result.data.id
this.form.orderId = this.orderId
this.$emit('replaceRoute', this.orderId)
}
// ID
// this.form.typeId = this.form.deviceTypeList[this.form.deviceTypeList.length - 1]
//
this.form.typeId = this.form.category[this.form.category.length - 1]
let appearanceImages = [] //
let certificates = [] //
let inspectionReports = [] //
let purchaseInvoices = [] //
if (this.form.mainFileList) {
const arr = this.form.mainFileList.split(',')
console.log('🚀 ~ 提交 ~ arr:', arr)
appearanceImages = arr.map((item) => {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ appearanceImages:', appearanceImages)
}
if (this.form.certificateList) {
const arr = this.form.certificateList.split(',')
certificates = arr.map((item) => {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ certificates:', certificates)
} else {
//
this.$message.error('请上传合格证')
return
}
if (this.form.inspectionList) {
const arr = this.form.inspectionList.split(',')
inspectionReports = arr.map((item) => {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ inspectionReports:', inspectionReports)
} else {
//
this.$message.error('请上传检测证书')
return
}
if (this.form.purchaseInvoices) {
const arr = this.form.purchaseInvoices.split(',')
purchaseInvoices = arr.map((item) => {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ purchaseInvoices:', purchaseInvoices)
}
// propertyVoList propertyValue
if (this.propertyVoList && this.propertyVoList.length > 0) {
const unfilledIndex = this.propertyVoList.findIndex(
(item) => (!item.propertyValue || item.propertyValue === '') && item.mustHave != '0',
)
if (unfilledIndex !== -1) {
this.$message.warning(`${unfilledIndex + 1} 个特征项为必填项,请填写完整`)
return
}
}
this.propertyVoList.forEach((item) => {
console.log('item.item.propertyValue', item.propertyValue)
if (item.inputType == 3 && Array.isArray(item.propertyValue)) {
item.propertyValue = item.propertyValue.join(',')
}
})
let res = null
const params = {
...this.form,
appearanceImages,
certificates,
inspectionReports,
purchaseInvoices,
propertyVoList: this.propertyVoList,
}
if (this.query && this.query.maId) {
params.maId = this.query.maId
res = await equipmentEditApiNew(params)
} else {
res = await addInterDevice(params)
}
if (res.code === 200) {
this.dialogVisible = false
this.$emit('getList')
this.$emit('handleSubmit')
}
} catch (error) {
console.log('🚀 ~ handleSubmit ~ error:', error)
} finally {
this.isSubmit = false
loading.close()
}
}
})
},
/**
* 转换类型数据为树形结构适用于级联选择器
*/
convertToSubTree(list) {
const map = {}
const tree = []
//
list.forEach((item) => {
map[item.value] = {
value: item.value.toString(),
label: item.label,
}
})
//
list.forEach((item) => {
const current = map[item.value]
const parent = map[item.parentId]
if (parent) {
if (!parent.children) {
parent.children = []
}
parent.children.push(current)
} else {
tree.push(current)
}
})
return tree
},
//
async getPropertyVoList(typeId) {
try {
const res = await getEquipmentPropertyTypeApi(typeId)
console.log('特征值-->:', res)
this.propertyVoList = res.data || []
} catch (error) {
console.log('获取特征值失败:', error)
}
},
//
handleData(data) {
console.log('处理数据:', data)
if (!data) return []
return data.split(',').map((item) => {
return {
label: item,
value: item,
}
})
},
},
}
</script>
<style lang="scss" scoped>
.dialog-content {
padding: 20px;
}
.page-header {
display: flex;
align-items: center;
margin-bottom: 20px;
padding-bottom: 15px;
font-size: 18px;
border-bottom: 1px solid #e6e6e6;
justify-content: space-between;
.page-title {
font-size: 18px;
font-weight: 600;
margin-left: 15px;
color: #303133;
}
}
.dialog-content {
padding: 10px 0;
min-height: 200px; //
}
.goBack-btn:hover {
cursor: pointer;
color: #33b5a0;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 10px; //
}
::v-deep .el-input-number.is-without-controls .el-input__inner {
text-align: left;
}
</style>

View File

@ -81,9 +81,9 @@
<el-card class="content-box">
<el-row>
<el-col :span="24" style="text-align: right" v-if="!routerParams.isView">
<!-- <el-button type="primary" size="mini" @click="equipmentDeployment" v-show="!isAddVisible">
<el-button type="primary" size="mini" @click="equipmentDeployment" v-show="!isAddVisible">
新增装备
</el-button> -->
</el-button>
<el-button type="primary" size="mini" @click="handleImport" v-show="!isAddVisible"> 批量导入 </el-button>
<el-button
type="primary"
@ -619,11 +619,13 @@
</el-table-column>
</el-table>
</el-dialog>
<AddEquip ref="addEquipRef" @handleSubmit="handleSubmit" @getList="getList" @replaceRoute="replaceRoute" />
</div>
</template>
<script>
import EquipmentEntryEditDialog from '@/views/EquipmentEntryApply/equipmentInput/edit.vue'
import AddEquip from './AddEquip'
// 使defineComponent
import {
@ -646,7 +648,7 @@ import FileUpload from '@/components/FileImageUpload'
export default {
name: 'EquipmentInput',
components: { EquipmentEntryEditDialog, FileUpload },
components: { EquipmentEntryEditDialog, FileUpload, AddEquip },
emits: ['update:isVisible', 'submit'], //
dicts: ['dev_unit_type'],
created() {
@ -777,6 +779,8 @@ export default {
},
created() {
this.routerParams = this.$route.query
console.log('🚀 ~ this.routerParams:', this.routerParams)
this.getList()
},
mounted() {
this.getManufacturerSelectList()
@ -913,17 +917,21 @@ export default {
// 1orderIdorderId
if (response.data) {
this.orderId = response.data
const routerParams = this.$route.query || {}
this.$router
.replace({
query: {
orderId: response.data,
isAddVisible: this.isAddVisible,
isApprovalVisible: this.isApprovalVisible,
id: routerParams.id || '',
applyId: routerParams.applyId || '',
orderId: response.data || routerParams.orderId || '',
isAddVisible: routerParams.isAddVisible || '',
isApprovalVisible: routerParams.isApprovalVisible || '',
},
})
.then(() => {
console.log('🚀 ~ 导入成功跳转完成')
this.getList()
this.handleSubmit()
})
} else {
// 2orderId使orderId
@ -990,7 +998,7 @@ export default {
this.queryParams.startProductionDate = this.queryParams.productionDate ? this.queryParams.productionDate[0] : ''
this.queryParams.endProductionDate = this.queryParams.productionDate ? this.queryParams.productionDate[1] : ''
this.queryParams.orderId = this.orderId || ''
const params = { ...this.queryParams, id: this.$route.query.id || '' }
const params = { ...this.queryParams, orderId: this.$route.query.orderId || '' }
delete params.orderCreateTime
delete params.productionDate
const res = await getDeviceByOrderIdApi(params)
@ -1013,12 +1021,8 @@ export default {
this.getList()
},
equipmentDeployment() {
this.$router.push({
path: '/equipment/equipment-input/add',
query: {
orderId: this.orderId,
},
})
const orderId = this.$route.query.orderId || ''
this.$refs.addEquipRef.openDialog(orderId)
},
//
@ -1098,16 +1102,16 @@ export default {
if (this.isSubmit) return
this.isSubmit = true
const loading = this.$loading()
const applyId = this.$route.query.applyId || ''
const id = this.$route.query.id || ''
console.log('🚀 ~ applyId:', applyId)
const orderId = this.$route.query.orderId || ''
const applyId = this.$route.query.applyId || ''
try {
if (id) {
await updateWarehousingApi({ id, orderId: this.orderId, applyId })
await updateWarehousingApi({ id, orderId, applyId })
} else {
const routerParams = this.$route.query || {}
const res = await addWarehousingApi({ orderId: this.orderId, applyId })
const res = await addWarehousingApi({ orderId, applyId })
this.$router.replace({
query: {
id: res.data.id || '',
@ -1463,7 +1467,7 @@ export default {
.replace(/^(\d+)\.(.*)\./, '$1.$2') //
},
async handleDblClick(row, column, event) {
if (this.routerParams.isView) return
if (this.routerParams.isView || row.isNew) return
this.$set(row, 'majorList', [])
this.$set(row, 'processList', [])
this.$set(row, 'categoryList', [])
@ -1488,7 +1492,7 @@ export default {
//
console.log('双击的行数据:', row)
this.$set(row, 'isNew', !row.isNew)
this.$set(row, 'isNew', true)
},
submitRow(row) {
console.log('🚀 ~ row:', row)
@ -1532,7 +1536,7 @@ export default {
console.log('🚀 ~ row.propertyVoList:', row.propertyVoList)
//
this.$confirm('确定要提交吗', '提示', {
this.$confirm('是否确定保存', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
@ -1571,6 +1575,19 @@ export default {
}
})
},
replaceRoute(orderId) {
const routerParams = this.$route.query || {}
console.log('routerParams--->>', routerParams)
this.$router.replace({
query: {
id: routerParams.id || '',
applyId: routerParams.applyId || '',
orderId,
isAddVisible: routerParams.isAddVisible,
isApprovalVisible: routerParams.isApprovalVisible,
},
})
},
},
}
</script>