This commit is contained in:
parent
3c2ab029b2
commit
71b66ac8c5
|
|
@ -113,6 +113,11 @@
|
||||||
<el-input v-model="form.purchaseDate" placeholder="采购日期" readonly />
|
<el-input v-model="form.purchaseDate" placeholder="采购日期" readonly />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="产权单位" prop="propertyUnit">
|
||||||
|
<el-input v-model="form.propertyUnit" placeholder="产权单位" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<div style="display: flex; padding-bottom: 10px">
|
<div style="display: flex; padding-bottom: 10px">
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
v-model="queryParams.propertyUnitIds"
|
v-model="queryParams.propertyUnitIds"
|
||||||
placeholder="请选择产权单位"
|
placeholder="请选择产权单位"
|
||||||
:options="propertyUnitList"
|
:options="propertyUnitList"
|
||||||
:props="{ label: 'label', value: 'id', children: 'children' }"
|
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="handleUnitChange"
|
@change="handleUnitChange"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,20 @@
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="产权单位" prop="propertyUnitIds">
|
||||||
|
<el-cascader
|
||||||
|
clearable
|
||||||
|
v-model="form.propertyUnitIds"
|
||||||
|
placeholder="请选择产权单位"
|
||||||
|
:options="propertyUnitList"
|
||||||
|
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
|
||||||
|
style="width: 100%"
|
||||||
|
@change="handleUnitChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<div style="display: flex; padding-bottom: 10px">
|
<div style="display: flex; padding-bottom: 10px">
|
||||||
|
|
@ -445,6 +459,7 @@ import ImageUpload from '@/components/ImageUpload'
|
||||||
import FileUpload from '@/components/FileImageUpload'
|
import FileUpload from '@/components/FileImageUpload'
|
||||||
import { handlePositiveNumberInput } from '@/utils/bonus.js'
|
import { handlePositiveNumberInput } from '@/utils/bonus.js'
|
||||||
import { addFacturer } from '@/api/ma/supplier'
|
import { addFacturer } from '@/api/ma/supplier'
|
||||||
|
import { deptTreeSelect } from '@/api/system/user'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentEntryEditDialog', // 明确组件名称
|
name: 'EquipmentEntryEditDialog', // 明确组件名称
|
||||||
|
|
@ -499,7 +514,10 @@ export default {
|
||||||
certificateList: '', // 合格证
|
certificateList: '', // 合格证
|
||||||
inspectionList: '', // 检测证书
|
inspectionList: '', // 检测证书
|
||||||
purchaseInvoices: '', // 采购发票
|
purchaseInvoices: '', // 采购发票
|
||||||
|
propertyUnitIds: [], // 产权单位
|
||||||
|
propertyUnitId: null, // 产权单位
|
||||||
},
|
},
|
||||||
|
propertyUnitList: [], // 产权单位列表
|
||||||
// 表单校验规则(所有字段均为必填)
|
// 表单校验规则(所有字段均为必填)
|
||||||
equipRules: {
|
equipRules: {
|
||||||
major: [{ required: true, message: '请选择专业', trigger: 'change' }],
|
major: [{ required: true, message: '请选择专业', trigger: 'change' }],
|
||||||
|
|
@ -536,7 +554,8 @@ export default {
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openDialog(id, type) {
|
async openDialog(id, type) {
|
||||||
|
await this.getDeptTreeSelect()
|
||||||
if (type === 'edit') {
|
if (type === 'edit') {
|
||||||
this.pageTitle = '编辑装备'
|
this.pageTitle = '编辑装备'
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
|
|
@ -571,6 +590,15 @@ export default {
|
||||||
: ''
|
: ''
|
||||||
this.form.process = [String(res.data.mainProcessId), String(res.data.subProcessId)].filter(Boolean)
|
this.form.process = [String(res.data.mainProcessId), String(res.data.subProcessId)].filter(Boolean)
|
||||||
console.log('🚀 ~ getInfo ~ this.form.process:', this.form.process)
|
console.log('🚀 ~ getInfo ~ this.form.process:', this.form.process)
|
||||||
|
const ids = []
|
||||||
|
if (res.data?.parentId) {
|
||||||
|
ids.push(res.data.parentId)
|
||||||
|
}
|
||||||
|
if (res.data?.propertyUnitId) {
|
||||||
|
ids.push(res.data.propertyUnitId)
|
||||||
|
}
|
||||||
|
this.form.propertyUnitIds = [...ids.map(Number)]
|
||||||
|
|
||||||
if (res.data.branchId) {
|
if (res.data.branchId) {
|
||||||
this.form.category = [
|
this.form.category = [
|
||||||
String(res.data.mainCategoryId),
|
String(res.data.mainCategoryId),
|
||||||
|
|
@ -601,6 +629,28 @@ export default {
|
||||||
console.log('🚀 ~ getInfo ~ error:', error)
|
console.log('🚀 ~ getInfo ~ error:', error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleUnitChange(value) {
|
||||||
|
if (value.length === 0) {
|
||||||
|
this.form.propertyUnitId = undefined
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.form.propertyUnitId = value[value.length - 1]
|
||||||
|
},
|
||||||
|
// 获取产权单位
|
||||||
|
async getDeptTreeSelect() {
|
||||||
|
const res = await deptTreeSelect()
|
||||||
|
this.propertyUnitList = this.filterTree(res.data)
|
||||||
|
},
|
||||||
|
filterTree(nodes) {
|
||||||
|
return nodes
|
||||||
|
.map((node) => {
|
||||||
|
if (node.children) {
|
||||||
|
node.children = this.filterTree(node.children)
|
||||||
|
}
|
||||||
|
return node
|
||||||
|
})
|
||||||
|
.filter((node) => node.status !== '1')
|
||||||
|
},
|
||||||
// 获取厂家
|
// 获取厂家
|
||||||
getManufacturerSelectList() {
|
getManufacturerSelectList() {
|
||||||
getManufacturerSelectApi().then((res) => {
|
getManufacturerSelectApi().then((res) => {
|
||||||
|
|
@ -875,7 +925,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 处理数据
|
// 处理数据
|
||||||
handleData(data) {
|
handleData(data) {
|
||||||
console.log('处理数据:', data)
|
// console.log('处理数据:', data)
|
||||||
if (!data) return []
|
if (!data) return []
|
||||||
return data.split(',').map((item) => {
|
return data.split(',').map((item) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -964,7 +1014,7 @@ export default {
|
||||||
-webkit-transform: translate(-50%, -50%);
|
-webkit-transform: translate(-50%, -50%);
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #C0C4CC;
|
color: #c0c4cc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,17 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card v-show="showSearch" style="margin-bottom: 20px">
|
<el-card v-show="showSearch" style="margin-bottom: 20px">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
|
<el-form :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
|
||||||
|
<el-form-item label="产权单位" prop="propertyUnitIds">
|
||||||
|
<el-cascader
|
||||||
|
clearable
|
||||||
|
v-model="queryParams.propertyUnitIds"
|
||||||
|
placeholder="请选择产权单位"
|
||||||
|
:options="propertyUnitList"
|
||||||
|
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
|
||||||
|
style="width: 240px"
|
||||||
|
@change="handleUnitChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="工具专业" prop="fourthParentId">
|
<el-form-item label="工具专业" prop="fourthParentId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.fourthParentId"
|
v-model="queryParams.fourthParentId"
|
||||||
|
|
@ -411,6 +422,7 @@ import { getListCodeApi, getToolSelectApi, updateByIdApi } from '@/api/toolsMana
|
||||||
import { getManufacturerSelectApi } from '@/api/EquipmentLedger'
|
import { getManufacturerSelectApi } from '@/api/EquipmentLedger'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import FileUpload from '@/components/FileImageUpload'
|
import FileUpload from '@/components/FileImageUpload'
|
||||||
|
import { deptTreeSelect } from '@/api/system/user'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CodeToolsLedger',
|
name: 'CodeToolsLedger',
|
||||||
|
|
@ -431,7 +443,10 @@ export default {
|
||||||
parentTypeId: null, // 工具名称
|
parentTypeId: null, // 工具名称
|
||||||
typeName: null, // 规格型号
|
typeName: null, // 规格型号
|
||||||
toolCode: null,
|
toolCode: null,
|
||||||
|
propertyUnitIds: null,
|
||||||
|
propertyUnitId: null,
|
||||||
},
|
},
|
||||||
|
propertyUnitList: [],
|
||||||
fourthParentList: [],
|
fourthParentList: [],
|
||||||
greatGrandparentList: [],
|
greatGrandparentList: [],
|
||||||
grandparentTypeList: [],
|
grandparentTypeList: [],
|
||||||
|
|
@ -501,10 +516,34 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.getDeptTreeSelect()
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getSelectList()
|
this.getSelectList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleUnitChange(value) {
|
||||||
|
if (value.length === 0) {
|
||||||
|
this.queryParams.propertyUnitId = undefined
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.queryParams.propertyUnitId = value[value.length - 1]
|
||||||
|
},
|
||||||
|
// 获取产权单位
|
||||||
|
getDeptTreeSelect() {
|
||||||
|
deptTreeSelect().then((res) => {
|
||||||
|
this.propertyUnitList = this.filterTree(res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
filterTree(nodes) {
|
||||||
|
return nodes
|
||||||
|
.map((node) => {
|
||||||
|
if (node.children) {
|
||||||
|
node.children = this.filterTree(node.children)
|
||||||
|
}
|
||||||
|
return node
|
||||||
|
})
|
||||||
|
.filter((node) => node.status !== '1')
|
||||||
|
},
|
||||||
// 处理图片上传变化
|
// 处理图片上传变化
|
||||||
handleImageChange(files) {
|
handleImageChange(files) {
|
||||||
this.form.mainFileList = files
|
this.form.mainFileList = files
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,17 @@
|
||||||
<el-option label="数量工具" value="1"/>
|
<el-option label="数量工具" value="1"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
|
<el-form-item label="产权单位" prop="propertyUnitIds">
|
||||||
|
<el-cascader
|
||||||
|
clearable
|
||||||
|
v-model="queryParams.propertyUnitIds"
|
||||||
|
placeholder="请选择产权单位"
|
||||||
|
:options="propertyUnitList"
|
||||||
|
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
|
||||||
|
style="width: 240px"
|
||||||
|
@change="handleUnitChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="工具类目"
|
label="工具类目"
|
||||||
prop="typeIds"
|
prop="typeIds"
|
||||||
|
|
@ -222,6 +233,7 @@ import {
|
||||||
getToolByOrderApi
|
getToolByOrderApi
|
||||||
} from '@/api/toolsManage'
|
} from '@/api/toolsManage'
|
||||||
import { getTreeSelectApi } from '@/api/toolsManage/index.js'
|
import { getTreeSelectApi } from '@/api/toolsManage/index.js'
|
||||||
|
import { deptTreeSelect } from '@/api/system/user'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ToolsLedger',
|
name: 'ToolsLedger',
|
||||||
|
|
@ -246,8 +258,11 @@ export default {
|
||||||
typeName: null, // 规格型号
|
typeName: null, // 规格型号
|
||||||
manageMode: '1',
|
manageMode: '1',
|
||||||
typeId: null,
|
typeId: null,
|
||||||
typeIds: null
|
typeIds: null,
|
||||||
|
propertyUnitIds: null,
|
||||||
|
propertyUnitId: null,
|
||||||
},
|
},
|
||||||
|
propertyUnitList: [],
|
||||||
toolCascaderProps: {
|
toolCascaderProps: {
|
||||||
value: 'typeId',
|
value: 'typeId',
|
||||||
label: 'typeName',
|
label: 'typeName',
|
||||||
|
|
@ -381,11 +396,35 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.getDeptTreeSelect()
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getSelectList()
|
this.getSelectList()
|
||||||
this.getToolTree()
|
this.getToolTree()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleUnitChange(value) {
|
||||||
|
if (value.length === 0) {
|
||||||
|
this.queryParams.propertyUnitId = undefined
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.queryParams.propertyUnitId = value[value.length - 1]
|
||||||
|
},
|
||||||
|
// 获取产权单位
|
||||||
|
getDeptTreeSelect() {
|
||||||
|
deptTreeSelect().then((res) => {
|
||||||
|
this.propertyUnitList = this.filterTree(res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
filterTree(nodes) {
|
||||||
|
return nodes
|
||||||
|
.map((node) => {
|
||||||
|
if (node.children) {
|
||||||
|
node.children = this.filterTree(node.children)
|
||||||
|
}
|
||||||
|
return node
|
||||||
|
})
|
||||||
|
.filter((node) => node.status !== '1')
|
||||||
|
},
|
||||||
// 查询
|
// 查询
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue