Commit c15671a9 authored by jingnan's avatar jingnan 👀

实物构型管理功能开发

parent e3f9c11b
<template>
<section>
<div class="physicalConfigurationManagement-from">
<div class="icon-wrapper">
<img src="/icons/r-access.png" class="icon">
<span>架次查询</span>
</div>
<el-form ref="ruleForm" :model="form" label-width="70px">
<el-form-item label="机型:" prop="model">
<el-select v-model="form.model" clearable @change="getAddRecursion">
<el-option
v-for="item in dataModel"
:key="item.id"
:label="item.resName"
:value="item.resCode"
/>
</el-select>
</el-form-item>
<el-form-item label="架次:" prop="sortie">
<el-select v-model="form.sortie" filterable clearable :loading="sortiesLoading" @change="getTreeData">
<el-option
v-for="item in dataSortie"
:key="item.id"
:label="item.serialNo"
:value="item.serialNo"
/>
</el-select>
</el-form-item>
</el-form>
</div>
</section>
</template>
<script>
export default {
data() {
return {
form: {
model: '',
sortie: ''
},
dataModel: [],
sortiesLoading: true,
dataSortie: [],
isCollapse: false
}
},
mounted() {
this.getModelData()
},
methods: {
/**
* 获取机型
*/
getModelData() {
this.modelData = []
const params = { 'searchItems': { 'items': [] }, 'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }] }
this.$api.searchApi('AircraftType', params).then((res) => {
if (res.items && res.items.content && res.items.content.length) {
this.dataModel = res.items.content.map(p => {
return {
id: p.id,
resCode: p.defCode,
resName: p.defName
}
})
} else {
this.$message({
showClose: true,
message: res.message,
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {
this.$nextTick(() => {
this.form.model = this.dataModel[0].resCode
this.getAddRecursion()
})
})
},
/**
* 获取架次数据
*/
getAddRecursion() {
this.sortiesLoading = true
const params = {
'searchItems': {
'items': [{
'fieldName': 'aircraftTypeId',
'operator': 'EQ',
'value': this.dataModel.filter(p => p.resCode === this.form.model)[0].id
}]
},
sortItem: [{ fieldName: 'defCode', sortOrder: 'asc' }]
}
this.dataSortie = []
this.$api.searchApi('AircraftSorties', params)
.then((res) => {
if (res.items && res.items.content && res.items.content.length) {
this.dataSortie = res.items.content.map(p => {
return {
id: p.id,
serialNo: p.defCode
}
})
} else {
this.$message({
showClose: true,
message: res.message,
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {
this.$nextTick(() => {
if (this.dataSortie.length) this.form.sortie = this.dataSortie[0].serialNo
this.sortiesLoading = false
this.$parent.$parent.$refs.right.handleClick()
this.getTreeData()
})
})
},
getTreeData() {
this.$parent.$refs.tree.getTreeData()
}
}
}
</script>
<style lang="scss" >
.physicalConfigurationManagement-from {
border: 1px solid #ccc;
border-radius: 8px;
box-sizing: border-box;
padding: 20px;
.el-select {
width: 100%;
}
.el-form-item:last-child {
margin-bottom: 0px;
}
.form-btn {
text-align: center;
}
.icon-wrapper {
.icon,
span {
vertical-align: middle;
}
margin-bottom: 10px;
}
}
</style>
...@@ -4,21 +4,23 @@ ...@@ -4,21 +4,23 @@
v-model="nameOrNum" v-model="nameOrNum"
clearable clearable
placeholder="请输入内容" placeholder="请输入内容"
@change="nameOrNumChange"
/> />
<el-tree <el-tree
ref="tree" ref="tree"
class="tree" class="tree"
:data="treeData"
node-key="id" node-key="id"
lazy :lazy="lazyTree"
:load="loadNode" :load="loadNode"
accordion accordion
:data="treeData"
:default-expanded-keys="defaultExpandedKeys" :default-expanded-keys="defaultExpandedKeys"
:props="defaultProps" :props="defaultProps"
:highlight-current="true" :highlight-current="true"
:expand-on-click-node="false" :expand-on-click-node="false"
@node-click="handleNodeClick" @node-click="handleNodeClick"
> >
<!-- :filter-node-method="filterNode" -->
<span <span
slot-scope="{ data, node }" slot-scope="{ data, node }"
class="custom-tree-node changeText" class="custom-tree-node changeText"
...@@ -57,52 +59,11 @@ export default { ...@@ -57,52 +59,11 @@ export default {
children: 'dxProcessPlanVos', children: 'dxProcessPlanVos',
label: 'serialNumber', label: 'serialNumber',
isLeaf: 'isLeaf' isLeaf: 'isLeaf'
} },
lazyTree: true
} }
}, },
watch: { watch: {
nameOrNum: {
handler: function(keyword) {
// this.getExtPosition()
// const spans = document.getElementsByClassName('changeText')
// if (spans.length > 0) {
// for (let i = 0; i < spans.length; i++) {
// var labelText = spans[i].textContent
// const reg = keyword
// .replace(/\(/g, '\\(')
// .replace(/\)/g, '\\)')
// .replace(/\./g, '\\.')
// const allVal = labelText.match(new RegExp(reg, 'ig'))
// if (allVal) {
// const newAllVal = [...new Set(allVal)]
// for (let j = 0; j < newAllVal.length; j++) {
// if (newAllVal[j]) {
// const tp = newAllVal[j]
// .replace(/\(/g, '\\(')
// .replace(/\)/g, '\\)')
// .replace(/\./g, '\\.')
// labelText = labelText.replace(
// new RegExp(tp, 'g'),
// '*' + newAllVal[j] + '*'
// )
// }
// }
// for (let k = 0; k < allVal.length; k++) {
// if (allVal[k]) {
// labelText = labelText.replace(
// '*' + allVal[k] + '*',
// '<span style="color:blue">' +
// allVal[k] +
// '</span>'
// )
// }
// }
// }
// spans[i].innerHTML = labelText
// }
// }
}
},
rowData: { rowData: {
immediate: true, immediate: true,
deep: true, deep: true,
...@@ -113,54 +74,53 @@ export default { ...@@ -113,54 +74,53 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
nameOrNumChange(keyword) {
if (keyword && keyword.trim() !== '') {
this.lazyTree = false // 如果输入查询的时候关闭书结构懒加载,一次返回查到的所有结果
} else {
this.lazyTree = true
}
this.getExtPosition()
},
handleNodeClick(data, node, options) { handleNodeClick(data, node, options) {
const cnode = this.$refs.tree.getNode(this.rowData.id) const cnode = this.$refs.tree.getNode(this.rowData.id)
const assembly = this.$parent.$parent.$parent.$parent.$refs.right if (node.level < 3) {
const table = assembly && assembly.$refs[assembly.activeName].$refs.table node.isCurrent = false
if ( cnode.isCurrent = true
assembly.activeName === 'BRecord' ||
assembly.activeName === 'CRecord' ||
assembly.activeName === 'ERecord'
) {
if (node.level < 3) {
node.isCurrent = false
cnode.isCurrent = true
} else {
cnode.isCurrent = false
node.isCurrent = true
this.rowData = data
table.tablePagination.currentPage = 1
table.tablePagination.pageSize = 10
table.init()
}
} else { } else {
if (node.level < 4) { const assembly = this.$parent.$parent.$parent.$parent.$refs.right
node.isCurrent = false if (assembly.activeName === 'BRecord' || assembly.activeName === 'CRecord' || assembly.activeName === 'ERecord') {
cnode.isCurrent = true
} else {
cnode.isCurrent = false cnode.isCurrent = false
node.isCurrent = true node.isCurrent = true
this.rowData = data this.rowData = { ...data, nodeLevel: node.level }
if (this.$parent.$parent.$parent.$parent.$refs.right.activeName === 'FPreview') { } else {
assembly.$refs[assembly.activeName].init() if (node.level < 4) {
node.isCurrent = false
cnode.isCurrent = true
} else { } else {
table.tablePagination.currentPage = 1 cnode.isCurrent = false
table.tablePagination.pageSize = 10 node.isCurrent = true
table.init() this.rowData = { ...data, nodeLevel: node.level }
} }
} }
} }
}, },
getCurVal(data) { getCurVal(data) {
if (data.length && data[0].dxProcessPlanVos) { if (data.length && data[0].dxProcessPlanVos && data[0].dxProcessPlanVos.length) {
this.defaultExpandedKeys.push(data[0].id) this.defaultExpandedKeys.push(data[0].id)
this.getCurVal(data[0].dxProcessPlanVos) this.getCurVal(data[0].dxProcessPlanVos)
} else { } else {
if (!data || !data[0] || !data[0].id) return
this.$nextTick(() => { this.$nextTick(() => {
const node = this.$refs.tree.getNode(data[0].id) const node = this.$refs.tree.getNode(data[0].id)
if (this.rowData && this.rowData.id || !this.rowData.id && node.parent) {
const cnode = this.$refs.tree.getNode(this.rowData.id || node.parent)
cnode.isCurrent = false
}
node.isCurrent = true node.isCurrent = true
this.rowData = data[0] if (node.level > 2) {
this.rowData = { ...data[0], nodeLevel: node.level }
}
}) })
} }
}, },
...@@ -168,86 +128,234 @@ export default { ...@@ -168,86 +128,234 @@ export default {
const node = this.$refs.tree.getNode(this.rowData.id) const node = this.$refs.tree.getNode(this.rowData.id)
if (node && node.level === 3) { if (node && node.level === 3) {
node.isCurrent = false node.isCurrent = false
if (!node.childNodes || !node.childNodes.length) return this.$utils.showMessageWarning('请选择指令进行操作!')
node.childNodes[0].isCurrent = true node.childNodes[0].isCurrent = true
this.rowData = node.childNodes[0].data this.rowData = { ...node.childNodes[0].data, level: 4 }
} }
}, },
loadNode(node, resolve) { loadNode(node, resolve) {
this.requestUrl = '' this.requestUrl = ''
if (node.level === 0) { if (node.level === 0) {
this.getExtPosition(resolve) return resolve(this.treeData)
// return resolve(this.treeData)
} }
if (node.level === 1) { if (!this.lazyTree) {
return resolve(node.data.dxProcessPlanVos) if (node.level >= 1) {
} else if (node.level === 2) { return resolve(node.data.dxProcessPlanVos)
if (node.data) {
this.getCASData(node, resolve)
} }
} else if (node.level === 3) { } else {
if (node.data) { if (node.level === 1) {
this.getJoExecutePlan(node, resolve) return resolve(node.data.dxProcessPlanVos)
} else if (node.level === 2) {
if (node.data) {
this.getCASData(node, resolve)
}
} else if (node.level === 3) {
if (node.data) {
this.getJoExecutePlan(node, resolve)
}
} }
} }
}, },
/** /**
* 获取树结站位数据 * 获取树结构——站位数据
*/ */
getExtPosition(resolve) { getExtPosition(resolve) {
const params = { if (!this.searchForm.sorties) return
'searchItems': { let params = {}
'children': [ if (this.lazyTree) {
params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'aircraftSortiesId',
'operator': 'EQ',
'value': this.searchForm.sorties || ''
}
],
'operator': 'AND'
},
{
'items': [
],
'operator': 'OR'
}
]
},
'openProps': [],
'sortItem': [
{ {
'items': [ 'fieldName': 'serialNumber',
{ 'sortOrder': 'desc'
'fieldName': 'aircraftSortiesId', }
'operator': 'EQ', ]
'value': this.searchForm.sorties || '' }
} } else {
], params = {
'operator': 'AND' 'searchItems': {
}, 'children': [
{
'items': [
{
'fieldName': 'aircraftSortiesId',
'operator': 'EQ',
'value': this.searchForm.sorties || ''
}
],
'operator': 'AND'
},
{
'items': [
{
'fieldName': 'extPositionLinks.target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.serialNumber',
'operator': 'LIKE',
'value': this.nameOrNum || ''
},
{
'fieldName': 'extPositionLinks.target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.serialNumber',
'operator': 'LIKE',
'value': this.nameOrNum || ''
}
],
'operator': 'OR'
}
]
},
'openProps': [
{ {
'items': [ 'name': 'extPositionLinks',
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.serialNumber',
'operator': 'LIKE',
'value': this.nameOrNum || ''
},
{
'fieldName': 'target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.serialNumber',
'operator': 'LIKE',
'value': this.nameOrNum || ''
}
],
'operator': 'OR'
}
]
},
'openProps': [
{ {
'fieldName': 'extPositionLinks.target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.serialNumber', 'name': 'target',
'operator': 'LIKE', 'openProps': [
'value': this.nameOrNum || '' {
}, 'name': 'wrProduction'
{ },
'fieldName': 'extPositionLinks.target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.sourceExtProcessUsageLink.target.serialNumber', {
'operator': 'LIKE', 'name': 'sourceExtProcessUsageLink',
'value': this.nameOrNum || '' 'openProps': [
{
'name': 'target',
'openProps': [
{
'name': 'sourceExtProcessUsageLink',
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'target.serialNumber',
'operator': 'LIKE',
'value': this.nameOrNum || ''
},
{
'fieldName': 'target.sourceExtProcessUsageLink.target.serialNumber',
'operator': 'LIKE',
'value': this.nameOrNum || ''
}
],
'operator': 'OR'
}
]
},
'openProps': [
{
'name': 'target',
'openProps': [
{
'name': 'joExecutePlan'
},
{
'name': 'sourceExtProcessUsageLink',
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'target.serialNumber',
'operator': 'LIKE',
'value': this.nameOrNum || ''
}
],
'operator': 'AND'
}
]
},
'openProps': [
{
'name': 'target',
'openProps': [
{
'name': 'joExecutePlan'
}
]
}
]
}
]
}
]
}
]
}
]
}
]
} }
], ]
'operator': 'OR' }
],
'sortItem': [
{
'fieldName': 'serialNumber',
'sortOrder': 'desc'
} }
] ]
}, }
'openProps': [],
'sortItem': [
{
'fieldName': 'serialNumber',
'sortOrder': 'desc'
}
]
} }
this.$api.searchApi('ExtPosition', params).then((res) => { this.$api.searchApi('ExtPosition', params).then((res) => {
if (!res || !res.items || !res.items.content) return
const data = res.items.content || [] const data = res.items.content || []
data.map((item) => { const processedData = data.map(item => {
let dxProcessPlanVos = []
if (item.extPositionLinks) { if (item.extPositionLinks) {
item.dxProcessPlanVos = item.extPositionLinks.map(es => { dxProcessPlanVos = item.extPositionLinks.map(es => ({
return { serialNumber: es.target.serialNumber,
serialNumber: es.target.serialNumber, name: es.target.name,
name: es.target.name, id: es.target.id,
id: es.id, gaceVersion: es.target.gaceVersion,
gaceVersion: es.target.gaceVersion, dxProcessPlanVos: this.lazyTree ? [] : this.findAndCollectExtProcessPlanInfo(es, []),
state: es.isOk ? 'Delivery' : 'Finish' state: es.isOk ? 'Delivery' : 'Finish'
} }))
})
} }
let state = ''
if (item.extPositionPlans && item.extPositionPlans.length) { if (item.extPositionPlans && item.extPositionPlans.length) {
item.state = item.extPositionPlans[0].planState || null state = item.extPositionPlans[0].planState || null
}
return {
...item, // 假设你不需要修改item的其他属性,否则应该选择性地复制
dxProcessPlanVos,
state
} }
}) })
this.treeData = [ this.treeData = [
...@@ -255,28 +363,48 @@ export default { ...@@ -255,28 +363,48 @@ export default {
serialNumber: `BBOM-${this.searchForm.modelName}-${this.searchForm.sortiesName}`, serialNumber: `BBOM-${this.searchForm.modelName}-${this.searchForm.sortiesName}`,
name: '', name: '',
gaceVersion: '', gaceVersion: '',
dxProcessPlanVos: data, dxProcessPlanVos: processedData,
state: '' state: ''
} }
] ]
this.defaultExpandedKeys = [] this.defaultExpandedKeys = []
this.treeData.length && this.getCurVal(this.treeData) if (this.treeData.length) {
return resolve(this.treeData) this.getCurVal(this.treeData)
}
}) })
.catch((err) => console.log(err)) .catch(err => {
console.error('Error fetching ExtPosition data:', err)
})
.finally(() => { .finally(() => {
this.$nextTick(() => {
const assembly = this.$parent.$parent.$parent.$parent.$refs.right
if (assembly.activeName === 'FPreview') {
assembly.$refs[assembly.activeName].init()
} else {
assembly.$refs[assembly.activeName].$refs.table.init()
}
})
}) })
}, },
findAndCollectExtProcessPlanInfo(startVal, resultVal = []) {
if (!Array.isArray(resultVal)) {
throw new Error('resultVal must be an array')
}
if (!startVal || !startVal.target) {
return resultVal // 提前返回,避免后续的错误
}
const target = startVal.target
if (target.subTypeName === 'ExtProcessPlanAOR' || target.subTypeName === 'ExtProcessPlanAssembly') {
resultVal.push({
serialNumber: target.serialNumber,
name: target.name,
id: target.id,
isLeaf: true,
gaceVersion: target.gaceVersion,
state: target.joExecutePlan && target.joExecutePlan.length && target.joExecutePlan[0].planState
})
}
if (target.sourceExtProcessUsageLink) {
for (const child of target.sourceExtProcessUsageLink) {
this.findAndCollectExtProcessPlanInfo(child, resultVal)
}
}
return resultVal
},
/** /**
* 获取树结CAS数据 * 获取树结构-CAS数据(第三层)
*/ */
getCASData(node, resolve) { getCASData(node, resolve) {
const params = { const params = {
...@@ -333,6 +461,7 @@ export default { ...@@ -333,6 +461,7 @@ export default {
} }
this.$api.searchApi('ExtProcessPlan', params) this.$api.searchApi('ExtProcessPlan', params)
.then((res) => { .then((res) => {
if (!res || !res.items || !res.items.content) return
res.items.content.forEach(element => { res.items.content.forEach(element => {
if (element.wrProduction && element.wrProduction.length) { if (element.wrProduction && element.wrProduction.length) {
element.state = element.wrProduction[0].planState || null element.state = element.wrProduction[0].planState || null
...@@ -340,6 +469,7 @@ export default { ...@@ -340,6 +469,7 @@ export default {
element.level = 3 element.level = 3
element.dxProcessPlanVos = [] element.dxProcessPlanVos = []
}) })
res.items.content.length && this.getCurVal(res.items.content)
return resolve(res.items.content) return resolve(res.items.content)
}) })
.catch((err) => { .catch((err) => {
...@@ -349,10 +479,9 @@ export default { ...@@ -349,10 +479,9 @@ export default {
.finally(() => {}) .finally(() => {})
}, },
/** /**
* 获取树结CAS数据 * 获取树结构-指令数据
*/ */
getJoExecutePlan(node, resolve) { getJoExecutePlan(node, resolve) {
console.log('🚀 node:', node)
const params = { const params = {
'searchItems': { 'searchItems': {
'children': [ 'children': [
...@@ -444,20 +573,13 @@ export default { ...@@ -444,20 +573,13 @@ export default {
background: #dcdfe6; background: #dcdfe6;
} }
.physicalConfigurationManagement-left-tree { .physicalConfigurationManagement-left-tree {
// margin-top: 20px;
// border: 1px solid #ccc;
border-radius: 7px; border-radius: 7px;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: calc(100% - 66px); height: calc(100% - 66px);
// height: 20px;
// flex-grow: 1;
// display: flex;
// flex-direction: column;
> .el-input { > .el-input {
padding: 10px; padding: 10px;
width: -webkit-fill-available; width: -webkit-fill-available;
// border-bottom: 1px solid #ccc;
} }
> .tree { > .tree {
overflow: auto; overflow: auto;
...@@ -489,7 +611,6 @@ export default { ...@@ -489,7 +611,6 @@ export default {
} }
} }
.el-tree-node { .el-tree-node {
// margin: 20px 0 !important;
.el-tree-node__content { .el-tree-node__content {
height: 40px !important; height: 40px !important;
// &:hover { // &:hover {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<div class="row"> <div class="row">
<label>架次:</label> <label>架次:</label>
<el-select v-model="form.sorties" filterable clearable size="mini" placeholder="请选择" :loading="sortiesLoading"> <el-select v-model="form.sorties" filterable clearable size="mini" placeholder="请选择">
<el-option <el-option
v-for="item in sortiesData" v-for="item in sortiesData"
:key="item.id" :key="item.id"
...@@ -46,7 +46,6 @@ export default { ...@@ -46,7 +46,6 @@ export default {
sorties: '' sorties: ''
}, },
modelData: [], modelData: [],
sortiesLoading: true,
sortiesData: [], sortiesData: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
...@@ -67,6 +66,7 @@ export default { ...@@ -67,6 +66,7 @@ export default {
const model = this.modelData.find((r) => r.id === val) const model = this.modelData.find((r) => r.id === val)
this.$set(this.form, 'modelName', (model && model.defName) || '') this.$set(this.form, 'modelName', (model && model.defName) || '')
this.$set(this.form, 'sorties', '') this.$set(this.form, 'sorties', '')
this.updateForm()
this.getSortiesData() this.getSortiesData()
} }
}, },
...@@ -78,6 +78,7 @@ export default { ...@@ -78,6 +78,7 @@ export default {
} }
const sorties = this.sortiesData.find((r) => r.id === val) const sorties = this.sortiesData.find((r) => r.id === val)
this.$set(this.form, 'sortiesName', (sorties && sorties.defCode) || '') this.$set(this.form, 'sortiesName', (sorties && sorties.defCode) || '')
this.updateForm()
this.getExtPosition() this.getExtPosition()
} }
} }
...@@ -91,33 +92,33 @@ export default { ...@@ -91,33 +92,33 @@ export default {
*/ */
getModelData() { getModelData() {
this.modelData = [] this.modelData = []
const params = { 'searchItems': { 'items': [] }, 'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }] } const params = {
this.$api.searchApi('AircraftType', params).then((res) => { 'searchItems': { 'items': [] },
if (res.items && res.items.content && res.items.content.length) { 'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }]
this.modelData = res.items.content.map(p => { }
return { this.$api.searchApi('AircraftType', params)
.then(res => {
if (res && res.items && res.items.content && res.items.content.length) {
this.modelData = res.items.content.map(p => ({
id: p.id, id: p.id,
defCode: p.defCode, defCode: p.defCode,
defName: p.defName defName: p.defName
} }))
}) // 如果modelData不为空,则设置form.model为第一个元素的id
} if (this.modelData.length) {
})
.catch((err) => console.log(err))
.finally(() => {
this.$nextTick(() => {
if (this.modelData && this.modelData.length) {
this.form.model = this.modelData[0].id this.form.model = this.modelData[0].id
} }
this.getSortiesData() this.getSortiesData()
}) }
})
.catch(err => {
console.error('Failed to fetch aircraft types:', err)
}) })
}, },
/** /**
* 获取架次数据 * 获取架次数据
*/ */
getSortiesData() { getSortiesData() {
this.sortiesLoading = true
const params = { const params = {
'searchItems': { 'searchItems': {
'items': [{ 'items': [{
...@@ -126,123 +127,35 @@ export default { ...@@ -126,123 +127,35 @@ export default {
'value': this.form.model || '' 'value': this.form.model || ''
}] }]
}, },
sortItem: [{ fieldName: 'defCode', sortOrder: 'asc' }] 'sortItem': [{ 'fieldName': 'defCode', 'sortOrder': 'asc' }]
} }
this.sortiesData = [] this.sortiesData = []
this.$api.searchApi('AircraftSorties', params) this.$api.searchApi('AircraftSorties', params)
.then((res) => { .then((res) => {
if (res.items && res.items.content && res.items.content.length) { if (res.items && res.items.content && res.items.content.length) {
this.sortiesData = res.items.content.map(p => { this.sortiesData = res.items.content.map(p => ({
return { id: p.id,
id: p.id, defCode: p.defCode
defCode: p.defCode }))
}
}) if (this.sortiesData.length) {
}
})
.catch((err) => console.log(err))
.finally(() => {
this.$nextTick(() => {
if (this.sortiesData && this.sortiesData.length) {
this.form.sorties = this.sortiesData[0].id this.form.sorties = this.sortiesData[0].id
this.$set(this.form, 'sortiesName', (this.sortiesData[0].defCode) || '')
} }
this.sortiesLoading = false }
// this.$parent.$parent.$refs.right.handleClick() })
this.getExtPosition() .catch((err) => {
}) console.error('Failed to fetch aircraft sorties:', err)
}) })
}, },
updateForm() {
this.$emit('formChange', this.form)
},
/**
* 初始化树结构
*/
getExtPosition() { getExtPosition() {
this.$refs.tree.getExtPosition() this.$refs.tree.getExtPosition()
// this.reloadTreeData()
},
// 加载数据
// getExtPosition(level = -1) {
// this.treeLoading = true
// const params = {
// pageFrom: 1,
// pageSize: 9999,
// searchItems: {
// children: [
// {
// items: [
// {
// fieldName: 'aircraftSortiesId', // 架次ID
// operator: 'EQ',
// value: this.form.sorties || ''
// }
// ],
// operator: 'AND'
// }
// ],
// items: [],
// operator: 'AND'
// },
// openProps: [
// {
// name: 'extPositionPlans'
// },
// {
// name: 'extPositionLinks',
// openProps: [
// {
// name: 'target',
// openProps: [
// {
// name: 'wrProduction'
// }
// ]
// }
// ]
// }
// ],
// sortItem: [
// {
// 'fieldName': 'serialNumber',
// 'sortOrder': 'desc'
// }
// ]
// }
// this.$api.searchApi('ExtPosition', params)
// .then((res) => {
// res.items && res.items.content && res.items.content.forEach(element => {
// element.workingStatus = element.extPositionPlans && element.extPositionPlans.length > 0 ? element.extPositionPlans[0].planState : null
// })
// this.treeData = [
// {
// serialNumber: `BBOM-${this.form.modelName}-${this.form.sortiesName}`,
// materName: '',
// gaceVersio: '',
// state: '',
// id: 1,
// children: res.items.content || [],
// level: 0
// }
// ]
// this.defaultExpandedKeys = [1]
// })
// .catch((err) => console.log(err))
// .finally(() => {
// this.treeLoading = false
// })
// },
loadNode(node, resolve) {
if (node.level === 0) {
return resolve([{ name: 'region' }])
}
if (node.level > 1) return resolve([])
setTimeout(() => {
const data = [{
name: 'leaf',
leaf: true
}, {
name: 'zone'
}]
resolve(data)
}, 500)
} }
} }
} }
...@@ -250,7 +163,6 @@ export default { ...@@ -250,7 +163,6 @@ export default {
<style lang="scss" > <style lang="scss" >
.physicalConfigurationManagement_left { .physicalConfigurationManagement_left {
// margin: 4px;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
......
<!-- <!--
* @Author:ljm * @LastEditTime: 2024-07-12 15:07:23
* @Date: 2021-04-25
* @LastEditTime:
* @Description: 架次实物构型-记实 * @Description: 架次实物构型-记实
* @FilePath: /mes-web/applications/dee-mes/src/views/mes//physicalQualityAndConfiguratioCnontrol/physicalConfigurationManagement/physicalDocumentationOfSorties/index.vue'
--> -->
<template> <template>
<section class="physical-documentation-of-sorties-material"> <section class="physical-documentation-of-sorties-material">
...@@ -54,7 +51,7 @@ ...@@ -54,7 +51,7 @@
<div class="logo" style="margin: 20px 20px 10px 0px"> <div class="logo" style="margin: 20px 20px 10px 0px">
<img src="/icons/u212.svg" alt=""><span>装配记实</span> <img src="/icons/u212.svg" alt=""><span>装配记实</span>
</div> </div>
<div class="dee-tools"> <!-- <div class="dee-tools">
<div class="tools-block"> <div class="tools-block">
<div <div
class="tool-item" class="tool-item"
...@@ -67,7 +64,7 @@ ...@@ -67,7 +64,7 @@
<i v-show="preserveDisabled" class="el-icon-loading" /> <i v-show="preserveDisabled" class="el-icon-loading" />
</div> </div>
</div> </div>
</div> </div> -->
</div> </div>
<div class="right"> <div class="right">
<div class="legnd"> <div class="legnd">
...@@ -101,9 +98,10 @@ ...@@ -101,9 +98,10 @@
</template> </template>
<script> <script>
import { post } from '@/utils/http'
import Table from './table' import Table from './table'
import { downloadPdfHandle } from '@/api/inventory.js' // import { downloadPdfHandle } from '@/api/inventory.js'
import axios from 'axios' // import axios from 'axios'
export default { export default {
name: 'Material', name: 'Material',
components: { components: {
...@@ -125,22 +123,20 @@ export default { ...@@ -125,22 +123,20 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
getComprehensive() { getComprehensive() {
var { model, sortie } = const { modelName, sortiesName } = this.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.form
this.$parent.$parent.$parent.$parent.$refs.left.$refs.form.form const activeName = this.$parent.$parent.$parent.activeName
var activeName = this.$parent.$parent.$parent.activeName
this.comprehensive = [] this.comprehensive = []
this.HttpRequest( post(
`DxProcessPlan/comprehensive?sorties=${sortie}&planType=${model}&number=${activeName}`, `ExtProcessPlan/comprehensive?sorties=${sortiesName}&planType=${modelName}&number=${activeName}`,
{}, {}
'post'
) )
.then((res) => { .then((res) => {
if (res.items) { if (res.items) {
this.comprehensive = { this.comprehensive = {
scrapQuantity: res.items['报废单'].countCarry || 0, scrapQuantity: res.items['报废单'].countCarry || 0,
scrapCount: res.items['报废单'].countAO || 0, scrapCount: res.items['报废单'].countAO || 0,
materialsQuantity: res.items['代料单'].countCarry || 0, materialsQuantity: res.items['器材代料'].countCarry || 0,
materialsCount: res.items['代料单'].countAO || 0, materialsCount: res.items['器材代料'].countAO || 0,
stringQuantity: res.items['串件单'].countCarry || 0, stringQuantity: res.items['串件单'].countCarry || 0,
stringCount: res.items['串件单'].countAO || 0 stringCount: res.items['串件单'].countAO || 0
} }
...@@ -148,49 +144,49 @@ export default { ...@@ -148,49 +144,49 @@ export default {
}) })
.catch((err) => console.error(err)) .catch((err) => console.error(err))
.finally(() => {}) .finally(() => {})
},
exportTable() {
this.preserveDisabled = true
const baseURl = downloadPdfHandle()
var { model, sortie } =
this.$parent.$parent.$parent.$parent.$refs.left.$refs.form.form
axios({
method: 'get',
url: `/DifferenceExcel/download/excel?planType=${model}&sorties=${sortie}`,
baseURL: baseURl,
params: {
},
headers: { token: `${localStorage.getItem('token')}`, 'equipment_id': `${localStorage.getItem('uid')}` },
responseType: 'arraybuffer'
})
.then((res) => {
const blob = new Blob([res.data], {
type:
'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob)
} else {
const elink = document.createElement('a')
elink.download = 'MBOM差异表' + '.xlsx'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
document.body.removeChild(elink)
}
// } else {
// // IE10+下载
// navigator.msSaveBlob(blob)
// }
})
.catch((err) => {
console.error(err)
})
.finally(() => {
this.preserveDisabled = false
})
} }
// exportTable() {
// this.preserveDisabled = true
// const baseURl = downloadPdfHandle()
// var { model, sortie } =
// this.$parent.$parent.$parent.$parent.$refs.left.$refs.form.form
// axios({
// method: 'get',
// url: `/DifferenceExcel/download/excel?planType=${model}&sorties=${sortie}`,
// baseURL: baseURl,
// params: {
// },
// headers: { token: `${localStorage.getItem('token')}`, 'equipment_id': `${localStorage.getItem('uid')}` },
// responseType: 'arraybuffer'
// })
// .then((res) => {
// const blob = new Blob([res.data], {
// type:
// 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
// })
// if (window.navigator.msSaveOrOpenBlob) {
// navigator.msSaveBlob(blob)
// } else {
// const elink = document.createElement('a')
// elink.download = 'MBOM差异表' + '.xlsx'
// elink.style.display = 'none'
// elink.href = URL.createObjectURL(blob)
// document.body.appendChild(elink)
// elink.click()
// document.body.removeChild(elink)
// }
// // } else {
// // // IE10+下载
// // navigator.msSaveBlob(blob)
// // }
// })
// .catch((err) => {
// console.error(err)
// })
// .finally(() => {
// this.preserveDisabled = false
// })
// }
} }
} }
</script> </script>
...@@ -233,8 +229,7 @@ export default { ...@@ -233,8 +229,7 @@ export default {
img { img {
width: 50px; width: 50px;
height: 58px; height: 58px;
margin-bottom: 5px; // margin-bottom: 5px;
// height: ;
} }
} }
.right { .right {
......
<template> <template>
<section class="physical-documentation-of-sorties-material-table"> <section class="physical-documentation-of-sorties-material-table dee-table">
<!-- 表格 --> <!-- 表格 -->
<el-table <el-table
v-loading="loading"
:data="tableData" :data="tableData"
height="calc(100% - 40px)" height="calc(100% - 40px)"
border border
...@@ -45,12 +44,11 @@ ...@@ -45,12 +44,11 @@
</section> </section>
</template> </template>
<script> <script>
import { post } from '@/utils/http'
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
// 加载中
loading: false,
// 所有可动态配置的表格列 // 所有可动态配置的表格列
colums1: [ colums1: [
{ {
...@@ -91,13 +89,6 @@ export default { ...@@ -91,13 +89,6 @@ export default {
sortable: true, sortable: true,
width: 180 width: 180
} }
// {
// title: '软件版本记实',
// show: true,
// key: 'recordSoftware',
// sortable: true,
// width: 180
// },
], ],
colums2: [ colums2: [
{ {
...@@ -110,7 +101,7 @@ export default { ...@@ -110,7 +101,7 @@ export default {
{ {
title: '代料单', title: '代料单',
show: true, show: true,
key: 'totalMinutes', key: 'recordSubstitute',
sortable: true, sortable: true,
width: 120 width: 120
}, },
...@@ -152,14 +143,13 @@ export default { ...@@ -152,14 +143,13 @@ export default {
// 初始化数据 // 初始化数据
init() { init() {
this.tableData = [] this.tableData = []
var id = const id =
this.$parent.$parent.$parent.$parent.$parent.$refs.left.$refs.tree this.$parent.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.$refs.tree
.rowData.id .rowData.id
var number = this.$parent.$parent.$parent.$parent.activeName const number = this.$parent.$parent.$parent.$parent.activeName
if (!id || !number) { if (!id || !number) {
return return
} }
this.loading = true
const params = { const params = {
id: id, id: id,
number: number, number: number,
...@@ -168,22 +158,21 @@ export default { ...@@ -168,22 +158,21 @@ export default {
numberOrName: this.$parent.search numberOrName: this.$parent.search
} }
// 发送请求 // 发送请求
this.HttpRequest('/DxProcessPlan/planDetails', params, 'post') post('/ExtProcessPlan/planDetails', params)
.then((res) => { .then((res) => {
if ( if (
res.items && res.items &&
res.items.physicalRecordDDxPage && res.items.physicalRecordDS &&
res.items.physicalRecordDDxPage && res.items.physicalRecordDS &&
res.items.physicalRecordDDxPage.content && res.items.physicalRecordDS.content &&
res.items.physicalRecordDDxPage.content.length res.items.physicalRecordDS.content.length
) { ) {
this.tableData = res.items.physicalRecordDDxPage.content this.tableData = res.items.physicalRecordDS.content
this.tablePagination.total = res.items.physicalRecordDDxPage.totalElements this.tablePagination.total = res.items.physicalRecordDS.totalElements
} }
}) })
.catch((err) => console.log(err)) .catch((err) => console.log(err))
.finally(() => { .finally(() => {
this.loading = false
}) })
}, },
setPage($event, state) { setPage($event, state) {
......
<!-- <!--
* @Author:ljm * @LastEditTime: 2024-07-12 18:03:48
* @Date: 2021-04-25
* @LastEditTime: 2024-07-09 16:18:32
* @Description: 架次实物构型-预览 * @Description: 架次实物构型-预览
* @FilePath: /mes-web/applications/dee-mes/src/views/mes//physicalQualityAndConfiguratioCnontrol/physicalConfigurationManagement/sortiesPhysicalConfigurationsSame/index.vue'
--> -->
<template> <template>
<section <section
v-loading="loading"
class="physical-documentation-of-sorties-preview" class="physical-documentation-of-sorties-preview"
> >
<label v-show="showTitle" :title="title">{{ title }}</label> <label v-show="showTitle" :title="title">{{ title }}</label>
...@@ -16,8 +12,6 @@ ...@@ -16,8 +12,6 @@
</template> </template>
<script> <script>
// import { downloadPdfHandle } from '@/api/inventory.js'
// import axios from 'axios'
import { get } from '@/utils/http' import { get } from '@/utils/http'
export default { export default {
name: 'Preview', name: 'Preview',
...@@ -25,8 +19,7 @@ export default { ...@@ -25,8 +19,7 @@ export default {
return { return {
showTitle: false, showTitle: false,
title: '', title: '',
openUrl: '', openUrl: ''
loading: false
} }
}, },
mounted() {}, mounted() {},
...@@ -38,19 +31,7 @@ export default { ...@@ -38,19 +31,7 @@ export default {
if (!id || !number) { if (!id || !number) {
return return
} }
this.loading = true
this.showTitle = false this.showTitle = false
// const baseURl = VUE_APP_BASE_API || process.env.VUE_APP_BASE_API // eslint-disable-line
// axios({
// method: 'POST',
// url: 'ExtProcessPlan/createPDF',
// baseURL: baseURl,
// params: {
// id: id
// },
// headers: { token: `${localStorage.getItem('token')}`, 'equipment_id': `${localStorage.getItem('uid')}` },
// responseType: 'arraybuffer'
// })
get(`ExtProcessPlan/createPDF?id=${id}`).then((res) => { get(`ExtProcessPlan/createPDF?id=${id}`).then((res) => {
const blob = new Blob([res.data], { const blob = new Blob([res.data], {
type: 'application/pdf' type: 'application/pdf'
...@@ -60,7 +41,6 @@ export default { ...@@ -60,7 +41,6 @@ export default {
} else { } else {
this.openUrl = URL.createObjectURL(blob) this.openUrl = URL.createObjectURL(blob)
this.$nextTick(() => { this.$nextTick(() => {
this.loading = false
this.title = this.$parent.$parent.$parent.$parent.$refs.left.$refs.tree this.title = this.$parent.$parent.$parent.$parent.$refs.left.$refs.tree
.rowData.serialNumber .rowData.serialNumber
setTimeout(() => { setTimeout(() => {
...@@ -69,7 +49,6 @@ export default { ...@@ -69,7 +49,6 @@ export default {
}) })
} }
}).catch(() => { }).catch(() => {
this.loading = false
}) })
} }
} }
......
<!-- <!--
* @Author:ljm * @LastEditTime: 2024-07-12 10:21:15
* @Date: 2021-04-25
* @LastEditTime: 2024-07-09 15:12:05
* @Description: 架次实物构型-质量控制 * @Description: 架次实物构型-质量控制
* @FilePath: /mes-web/applications/dee-mes/src/views/mes//physicalQualityAndConfiguratioCnontrol/physicalConfigurationManagement/sortiesPhysicalConfigurationsSame/index.vue'
--> -->
<template> <template>
<section class="physical-documentation-of-sorties-quality"> <section class="physical-documentation-of-sorties-quality">
...@@ -50,6 +47,7 @@ ...@@ -50,6 +47,7 @@
</template> </template>
<script> <script>
import { post } from '@/utils/http'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import Table from './table' import Table from './table'
export default { export default {
...@@ -139,12 +137,12 @@ export default { ...@@ -139,12 +137,12 @@ export default {
}, },
methods: { methods: {
initEcharts() { initEcharts() {
var chartDom = document.getElementById('main') const chartDom = document.getElementById('main')
var that = this const that = this
var elementResizeDetectorMaker = require('element-resize-detector') // 引入监听dom变化的组件 const elementResizeDetectorMaker = require('element-resize-detector') // 引入监听dom变化的组件
var erd = elementResizeDetectorMaker() const erd = elementResizeDetectorMaker()
// 用于使chart自适应高度和宽度,通过窗体高宽计算容器高宽 // 用于使chart自适应高度和宽度,通过窗体高宽计算容器高宽
// var resizeWorldMapContainer = function() { // let resizeWorldMapContainer = function() {
// // eslint-disable-line // // eslint-disable-line
// chartDom.style.width = chartDom.scrollWidth + 'px' // chartDom.style.width = chartDom.scrollWidth + 'px'
// chartDom.style.height = chartDom.clientHeight + 'px' // chartDom.style.height = chartDom.clientHeight + 'px'
...@@ -159,9 +157,8 @@ export default { ...@@ -159,9 +157,8 @@ export default {
}) })
}, },
getComprehensive() { getComprehensive() {
var { model, sortie } = const { modelName, sortiesName } = this.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.form
this.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.form const activeName = this.$parent.$parent.$parent.activeName
var activeName = this.$parent.$parent.$parent.activeName
this.myChart.setOption({ this.myChart.setOption({
series: [ series: [
{ {
...@@ -175,36 +172,35 @@ export default { ...@@ -175,36 +172,35 @@ export default {
} }
] ]
}) })
this.HttpRequest( post(
`DxProcessPlan/comprehensive?sorties=${sortie}&planType=${model}&number=${activeName}`, `ExtProcessPlan/comprehensive?sorties=${sortiesName}&planType=${modelName}&number=${activeName}`,
{}, {}
'post'
) )
.then((res) => { .then((res) => {
if (res.items) { if (res.items) {
// 发起 // 发起
var launch = [ const launch = [
res.items['报废'].countAO, res.items['报废'].countAO,
res.items['不合格'].countAO, res.items['不合格审理单'].countAO,
res.items['质量问题'].countAO, res.items['质量预审单'].countAO,
res.items['器材代料'].countAO, res.items['器材代料'].countAO,
res.items['串件申请单'].countAO res.items['串件单'].countAO
] ]
// 完成 // 完成
var Finish = [ const Finish = [
res.items['报废'].countNotOk, res.items['报废'].countNotOk,
res.items['不合格'].countNotOk, res.items['不合格审理单'].countNotOk,
res.items['质量问题'].countNotOk, res.items['质量预审单'].countNotOk,
res.items['器材代料'].countNotOk, res.items['器材代料'].countNotOk,
res.items['串件申请单'].countNotOk res.items['串件单'].countNotOk
] ]
// 审理 // 审理
var hear = [ const hear = [
res.items['报废'].countCarry, res.items['报废'].countCarry,
res.items['不合格'].countCarry, res.items['不合格审理单'].countCarry,
res.items['质量问题'].countCarry, res.items['质量预审单'].countCarry,
res.items['器材代料'].countCarry, res.items['器材代料'].countCarry,
res.items['串件申请单'].countCarry res.items['串件单'].countCarry
] ]
this.myChart.setOption({ this.myChart.setOption({
series: [ series: [
......
<template> <template>
<section class="sorties-physical-configurations-same-table"> <section class="sorties-physical-configurations-same-table dee-table">
<!-- 表格 --> <!-- 表格 -->
<el-table <el-table
v-loading="loading"
:data="tableData" :data="tableData"
height="calc(100% - 40px)" height="calc(100% - 40px)"
border border
...@@ -32,12 +31,13 @@ ...@@ -32,12 +31,13 @@
</section> </section>
</template> </template>
<script> <script>
import { post } from '@/utils/http'
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
// 加载中 // 加载中
loading: false, // loading: false,
// 分页 // 分页
tablePagination: { tablePagination: {
currentPage: 1, currentPage: 1,
...@@ -65,12 +65,13 @@ export default { ...@@ -65,12 +65,13 @@ export default {
// 初始化数据 // 初始化数据
init() { init() {
this.tableData = [] this.tableData = []
var id = this.$parent.$parent.$parent.$parent.$parent.$refs.left.$refs.tree.rowData.id const id = this.$parent.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.$refs.tree
var number = this.$parent.$parent.$parent.$parent.activeName .rowData.id
const number = this.$parent.$parent.$parent.$parent.activeName
if (!id || !number) { if (!id || !number) {
return return
} }
this.loading = true // this.loading = true
const params = { const params = {
id: id, id: id,
number: number, number: number,
...@@ -79,18 +80,18 @@ export default { ...@@ -79,18 +80,18 @@ export default {
numberOrName: this.$parent.search numberOrName: this.$parent.search
} }
// 发送请求 // 发送请求
this.HttpRequest('/DxProcessPlan/planDetails', params, 'post') post('/ExtProcessPlan/planDetails', params)
.then((res) => { .then((res) => {
if (res.items && res.items.qualityRecordDxPage && if (res.items && res.items.quality &&
res.items.qualityRecordDxPage.content && res.items.quality.content &&
res.items.qualityRecordDxPage.content.length) { res.items.quality.content.length) {
this.tableData = res.items.qualityRecordDxPage.content this.tableData = res.items.quality.content
this.tablePagination.total = res.items.qualityRecordDxPage.totalElements this.tablePagination.total = res.items.quality.totalElements
} }
}) })
.catch((err) => console.log(err)) .catch((err) => console.log(err))
.finally(() => { .finally(() => {
this.loading = false // this.loading = false
}) })
}, },
setPage($event, state) { setPage($event, state) {
......
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
<el-tab-pane label="实物记实" name="DRecord"> <el-tab-pane label="实物记实" name="DRecord">
<Material ref="DRecord" /> <Material ref="DRecord" />
</el-tab-pane> </el-tab-pane>
<!-- <el-tab-pane label="供应商记实" name="ERecord">
<Supplier ref="ERecord" />
</el-tab-pane> -->
<el-tab-pane label="预览" name="FPreview"> <el-tab-pane label="预览" name="FPreview">
<Preview ref="FPreview" /> <Preview ref="FPreview" />
</el-tab-pane> </el-tab-pane>
...@@ -31,71 +28,67 @@ import Schedule from './schedule' ...@@ -31,71 +28,67 @@ import Schedule from './schedule'
import Material from './material' import Material from './material'
// 质量记实 // 质量记实
import Quality from './quality' import Quality from './quality'
// 供应商记实
// import Supplier from './supplier'
export default { export default {
components: { components: {
Preview, Preview,
Material, Material,
Quality, Quality,
Schedule Schedule
// Supplier
}, },
props: { props: {
collapse: { leftSearchForm: {
type: Boolean, type: Object,
default: () => true default: () => {}
} }
}, },
data() { data() {
return { return {
activeName: '', activeName: 'BRecord',
tabPaneData: [] tabPaneData: []
} }
}, },
watch: {
activeName: {
handler(val) {
if (val && val !== 'FPreview' && this.leftSearchForm.sorties && this.leftSearchForm.model) {
this.$nextTick(() => {
this.$refs[this.activeName].getComprehensive()
})
}
}
},
leftSearchForm: {
deep: true,
handler(val) {
if (val && val.sorties && val.model) {
this.$nextTick(() => {
this.$refs[this.activeName].getComprehensive()
})
}
}
}
},
created() { created() {
this.$bus.$on('treeCurrentRowData', (data) => { this.$bus.$on('treeCurrentRowData', (data) => {
this.treeRowData = JSON.parse(JSON.stringify(data)) if (data && data.id && data.nodeLevel > 2) {
this.handleClick()
}
}) })
this.getTabs()
}, },
methods: { methods: {
handleClick() { handleClick() {
if (this.activeName === 'FPreview') { if (this.activeName === 'FPreview') {
this.$parent.$parent.$parent.$refs.left.$refs.tree.setBRecordOrCRecord() this.$parent.$parent.$parent.$refs.left.$refs.tree.setBRecordOrCRecord()
this.$refs[this.activeName].init() this.$refs[this.activeName].init()
} else if (this.activeName === 'ERecord') {
this.$refs[this.activeName].$refs.table.init()
} else { } else {
if (this.activeName === 'DRecord') { if (this.activeName === 'DRecord') {
this.$parent.$refs.left.$refs.tree.setBRecordOrCRecord() this.$parent.$parent.$parent.$refs.left.$refs.tree.setBRecordOrCRecord()
} }
this.$refs[this.activeName].getComprehensive() this.$refs[this.activeName].$refs.table.tablePagination.currentPage = 1
this.$refs[this.activeName].$refs.table.tablePagination.pageSize = 10
this.$refs[this.activeName].$refs.table.init() this.$refs[this.activeName].$refs.table.init()
} }
}, },
getTabs() {
this.tabPaneData = []
this.HttpRequest('DxProcessPlan/rightMenu', {}, 'post')
.then((res) => {
if (res.items) {
for (var key in res.items) {
this.tabPaneData.push({
key: key,
value: res.items[key]
})
}
}
})
.catch((err) => console.log(err))
.finally(() => {
this.tabPaneData.length &&
this.$nextTick(() => {
this.activeName = this.tabPaneData[0].key
this.handleClick()
})
})
},
previewPDF() { previewPDF() {
this.$refs.FPreview.getPdf() this.$refs.FPreview.getPdf()
} }
......
<!-- <!--
* @Author:ljm * @LastEditTime: 2024-07-12 10:05:03
* @Date: 2021-04-25
* @LastEditTime: 2024-07-09 14:51:34
* @Description: 架次实物构型-进度 * @Description: 架次实物构型-进度
* @FilePath: /mes-web/applications/dee-mes/src/views/mes//physicalQualityAndConfiguratioCnontrol/physicalConfigurationManagement/SortiesPhysicalConfigurationsSchedule/index.vue'
--> -->
<template> <template>
<section class="physical-documentation-of-sorties-schedule"> <section class="physical-documentation-of-sorties-schedule">
...@@ -64,7 +61,7 @@ ...@@ -64,7 +61,7 @@
</div> </div>
</div> </div>
</div> </div>
<Table ref="table" :tree-row-data="treeRowData" /> <Table ref="table" />
</section> </section>
</template> </template>
...@@ -76,12 +73,6 @@ export default { ...@@ -76,12 +73,6 @@ export default {
components: { components: {
Table Table
}, },
props: {
treeRowData: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
comprehensive: [ comprehensive: [
...@@ -107,14 +98,17 @@ export default { ...@@ -107,14 +98,17 @@ export default {
search: '', search: '',
colors: [{ color: '#5cb87a', percentage: 100 }] colors: [{ color: '#5cb87a', percentage: 100 }]
} }
},
watch: {
},
created() {
}, },
mounted() {}, mounted() {},
methods: { methods: {
getComprehensive() { getComprehensive() {
const { modelName, sortiesName } = const { modelName, sortiesName } = this.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.form
this.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.form
const activeName = this.$parent.$parent.$parent.activeName const activeName = this.$parent.$parent.$parent.activeName
console.log('🚀 activeName:', activeName)
this.comprehensive = [ this.comprehensive = [
{ {
key: 1, key: 1,
...@@ -137,8 +131,7 @@ export default { ...@@ -137,8 +131,7 @@ export default {
] ]
post( post(
`ExtProcessPlan/comprehensive?sorties=${sortiesName}&planType=${modelName}&number=${activeName}`, `ExtProcessPlan/comprehensive?sorties=${sortiesName}&planType=${modelName}&number=${activeName}`,
{}, {}
'post'
) )
.then((res) => { .then((res) => {
if (res.items) { if (res.items) {
......
...@@ -37,15 +37,9 @@ import { post } from '@/utils/http' ...@@ -37,15 +37,9 @@ import { post } from '@/utils/http'
export default { export default {
components: {}, components: {},
props: { props: {
treeRowData: {
type: Object,
default: () => {}
}
}, },
data() { data() {
return { return {
// 加载中
loading: false,
// 分页 // 分页
tablePagination: { tablePagination: {
currentPage: 1, currentPage: 1,
...@@ -95,10 +89,10 @@ export default { ...@@ -95,10 +89,10 @@ export default {
// 初始化数据 // 初始化数据
init() { init() {
this.tableData = [] this.tableData = []
var id = const id =
this.$parent.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.$refs.tree this.$parent.$parent.$parent.$parent.$parent.$parent.$parent.$refs.left.$refs.tree
.rowData.id .rowData.id
var number = this.$parent.$parent.$parent.$parent.activeName const number = this.$parent.$parent.$parent.$parent.activeName
if (!id || !number) { if (!id || !number) {
return return
} }
...@@ -110,7 +104,7 @@ export default { ...@@ -110,7 +104,7 @@ export default {
numberOrName: this.$parent.search numberOrName: this.$parent.search
} }
// 发送请求 // 发送请求
post('/ExtProcessPlan/planDetails', params, 'post') post('/ExtProcessPlan/planDetails', params)
.then((res) => { .then((res) => {
if ( if (
res.items && res.items &&
......
<template>
<dee-dialog
title="附件浏览"
:dialog-visible.sync="visible"
width="50%"
:before-close="handleClose"
class="sorties-physical-configurations-supplier-dialog"
>
<div>
<!-- <upload-files v-if="uploadVisble" v-model="form.objFileLinks" /> -->
</div>
</dee-dialog>
</template>
<script>
// import UploadFiles from '@/components/Lean/UploadFiles'
export default {
// components: { UploadFiles },
data() {
return {
visible: false,
disabled: false,
uploadVisble: true,
form: {
results: '',
objFileLinks: []
},
row: {},
loading: false
}
},
created() {},
methods: {
// 打开弹出框
open(row = {}) {
this.form = {
results: '',
objFileLinks: []
}
this.row = row
this.form.results = row.results
this.visible = true
this.getList(row.id)
},
getList(sourceId) {
this.loading = true
this.uploadVisble = false
const params = {
indices: ['ObjFileLink'],
searchItems: {
items: [
{
fieldName: 'sourceId',
operator: 'EQ',
value: sourceId
}
],
operator: 'AND'
},
openProps: [
{
pageFrom: 1,
pageSize: 1,
name: 'target'
}
]
}
this.HttpRequest('/FileUtil/checkFile', params, 'post')
.then((res) => {
this.form.objFileLinks = res.items.content[0].objFileLinks
})
.catch((err) => console.log(err))
.finally(() => {
this.loading = false
this.uploadVisble = true
})
},
/**
* 保存功能
* 根据是否有id处理创建和编辑逻辑
*/
save() {
this.updateFile()
this.removeFile()
},
removeFile() {
var result = []
var index = []
this.form.objFileLinks.forEach((item, i) => {
if (item.operator === 'REMOVE') {
result.push({ id: item.id })
index.push(i)
}
})
index.forEach((item) => {
this.$delete(this.form.objFileLinks, item)
})
// 发送请求
this.HttpRequest('/FileUtil/removeFile', result, 'post')
.then((res) => {
})
.catch((err) => console.log(err))
.finally(() => {})
},
// 上传附件
updateFile() {
var result = []
this.form.objFileLinks.forEach((item) => {
result.push({
targetId: item.target.id, // fileId
targetIdType: 'Papers',
sourceId: this.row.id, // 处理单id
sourceIdType: 'ExamineRecord'
})
})
this.disabled = true
this.HttpRequest('/FileUtil/upload', result, 'post')
.then((res) => {
this.reset('上传')
})
.catch((err) => console.log(err))
.finally(() => {
this.disabled = false
})
},
// 重置弹出框
reset(message) {
this.visible = false
this.$message({
message: `${message}成功`,
type: 'success'
})
this.$emit('reload')
this.form = {
results: '',
objFileLinks: []
}
},
handleClose() {
this.visible = false
}
}
}
</script>
<style lang="scss">
.view-dialog {
.el-form-item__label,
.dee-table-header {
display: none !important;
}
}
</style>
<template>
<div class="sorties-physical-configurations-supplier">
<Table ref="table" @open="(row) => $refs.dialog.open(row)" />
<!-- 弹出框 -->
<Dialog ref="dialog" />
</div>
</template>
<script>
import Table from './table'
import Dialog from './dialog.vue'
export default {
name: 'Supplier',
components: {
Table,
Dialog
},
data() {
return {}
},
created() {},
methods: {
getComprehensive() {}
}
}
</script>
<style lang="scss">
.sorties-physical-configurations-supplier {
height: 100%;
display: flex;
flex-direction: column;
> section {
height: 20px;
flex-grow: 1;
display: flex;
flex-direction: column;
> .el-table {
height: 20px;
flex-grow: 1;
}
.el-pagination {
text-align: right;
padding-top: 10px;
}
}
.el-table thead th {
color: #2e2e2e;
font-weight: 700;
font-size: 14px;
padding: 0;
background-color: #f3f6f7;
line-height: 46px !important;
}
.el-table .see-excel {
color: #3a8ee6;
cursor: pointer;
}
}
.sorties-physical-configurations-supplier-dialog .upload-files {
.dee-upload-page,
.el-form-item--small.el-form-item {
margin-bottom: 0 !important;
}
.dee-table-header,
.dee-form2 .el-form-item--small .el-form-item__label {
display: none;
}
.el-form-item__content {
padding-left: 0 !important;
}
}
</style>
<template>
<section>
<!-- 表格 -->
<!-- <dee-table
ref="table"
:loading="loading"
:index-row="indexRow"
:columns="tableColums"
:data="tableData"
:options="tableOptions"
:pagination="tablePagination"
:selection-row="selectionRow"
@cell-class-name="cellClassName"
@cell-click="cellClick"
@selection-change="selectionChange"
@pagination-size-change="paginationSizeChange"
@pagination-current-change="paginationCurrentChange"
> -->
<el-table
ref="table"
v-loading="loading"
:data="tableData"
height="100%"
border
size="mini"
highlight-current-row
:cell-class-name="cellClassName"
@cell-click="cellClick"
>
<el-table-column type="index" :width="80" label="序号" align="center" />
<el-table-column
v-for="item in tableColums"
:key="item.key"
:prop="item.key"
align="center"
:label="item.title"
:width="item.width"
:min-width="item.minWidth"
show-overflow-tooltip
:formatter="item.formatter"
sortable
/>
</el-table>
<el-pagination
:current-page="tablePagination.currentPage"
:page-sizes="tablePagination.pageSizes"
:page-size="tablePagination.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tablePagination.total"
@size-change="setPage"
@current-change="setPage($event, true)"
/>
</section>
</template>
<script>
import { downloadPdfHandle } from '@/api/inventory.js'
import axios from 'axios'
export default {
name: 'IntegrationWithWaveTable',
props: {},
data() {
return {
// 加载中
loading: false,
// 工具栏
tools: [],
// 选中表格列
selectionRow: [],
// 分页
tablePagination: {
currentPage: 1,
pageSize: 10,
total: 0,
pageSizes: [10, 20, 50]
},
// 序号
indexRow: { title: '序号', align: 'center', width: '70' },
// 器材验收单动态配置的表格列
colums: [
{
title: '浏览',
show: true,
key: 'fname',
align: 'center',
width: 220
},
{
align: 'center',
minWidth: '120',
title: '验收单',
show: true,
key: 'testNo',
sortable: true
},
{
align: 'center',
minWidth: '110',
title: '是否合格',
show: true,
key: 'isPassCode',
sortable: true,
formatter: (row, column, cellValue, index) => {
if (cellValue === 'Y') {
return '是'
} else {
return '否'
}
}
},
{
align: 'center',
minWidth: '120',
title: '物料类型',
show: true,
key: 'jobOrder.dxProcessMaterial.resType2.typeCode',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '编码',
show: true,
key: 'jobOrder.dxProcessMaterial.resCode',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '名称',
show: true,
key: 'jobOrder.dxProcessMaterial.resName',
sortable: true
},
{
align: 'center',
minWidth: '150',
title: '型号/牌号/件号',
show: true,
key: 'jobOrder.dxProcessMaterial.modelNo',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '技术条件',
show: true,
key: 'jobOrder.dxProcessMaterial.techSpec',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '规格',
show: true,
key: 'jobOrder.dxProcessMaterial.spec',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '供应状态',
show: true,
key: 'jobOrder.dxProcessMaterial.supplyStatus',
sortable: true
},
{
align: 'center',
minWidth: '150',
title: '热处理/炉/批号',
show: true,
key: 'jobOrder.lotNo',
sortable: true
},
{
align: 'center',
minWidth: '170',
title: '系列号',
show: true,
key: 'jobOrder.serialNo',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '机型',
show: true,
key: 'jobOrder.airModel',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '架次',
show: true,
key: 'jobOrder.sorties',
sortable: true
},
{
align: 'center',
minWidth: '130',
title: '入库单位',
show: true,
key: 'jobOrder.reqUnit',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '库存数量',
show: true,
key: 'storageAmount',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '库房',
show: true,
key: 'jobOrder.storageName',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '库位',
show: true,
key: 'jobOrder.storageUnitName',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '供应商',
show: true,
key: 'jobOrder.supplier.supplierName',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '制造商',
show: true,
key: 'jobOrder.manufacturer',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '到货日期',
show: true,
key: 'jobOrder.arrivalDate',
sortable: true,
formatter: (row, column, cellValue, index) =>
cellValue && cellValue.split(' ').length > 1
? cellValue.split(' ')[0]
: '/'
},
{
align: 'center',
minWidth: '120',
title: '生产日期',
show: true,
key: 'jobOrder.producedTime',
sortable: true,
formatter: (row, column, cellValue, index) =>
cellValue && cellValue.split(' ').length > 1
? cellValue.split(' ')[0]
: '/'
},
{
align: 'center',
minWidth: '150',
title: '保质期/贮存期',
show: true,
key: 'jobOrder.qualityPeriod',
sortable: true,
formatter: (row, column, cellValue, index) =>
cellValue && cellValue.split(' ').length > 1
? cellValue.split(' ')[0]
: '/'
},
{
align: 'center',
minWidth: '120',
title: '最长期',
show: true,
key: 'jobOrder.longPeriod',
sortable: true,
formatter: (row, column, cellValue, index) =>
cellValue && cellValue.split(' ').length > 1
? cellValue.split(' ')[0]
: '/'
},
{
align: 'center',
minWidth: '120',
title: '抽查期',
show: true,
key: 'jobOrder.spotCheckPeriodMounch',
sortable: true
},
{
align: 'center',
minWidth: '150',
title: '到货标准/图号',
show: true,
key: 'jobOrder.arrivedDrawNo',
sortable: true
},
{
align: 'center',
minWidth: '150',
title: '到货版次',
show: true,
key: 'jobOrder.arrivalVer',
sortable: true
},
{
align: 'center',
title: '入库单价',
show: true,
key: 'jobOrder.stockUnitPrice',
sortable: true,
minWidth: 120
},
{
align: 'center',
minWidth: '120',
title: '入库金额',
show: true,
key: 'jobOrder.stockPrice',
sortable: true
}, // 固定 8
{
align: 'center',
minWidth: '120',
title: '含税单价',
show: true,
key: 'jobOrder.taxUnitPrice',
sortable: true
},
{
align: 'center',
minWidth: '120',
title: '含税金额',
show: true,
key: 'jobOrder.taxPrice',
sortable: true
},
{
align: 'center',
title: '报检人',
show: true,
key: 'jobOrder.itemUserName',
sortable: true,
minWidth: 100
},
{
align: 'center',
title: '合同号',
show: true,
key: 'jobOrder.contractNo',
sortable: true,
minWidth: 100
},
{
align: 'center',
title: '备注',
show: true,
key: '',
sortable: true,
minWidth: 100
}
],
// 默认展示的表格列
tableColums: [],
// 表格数据
tableData: [],
// 表格样式配置
tableOptions: {
stripe: true,
border: true,
height: '100%'
}
}
},
watch: {},
created() {
this.setDefaultColums()
},
mounted() {},
methods: {
// 设置默认展示列
setDefaultColums() {
this.tableColums = this.colums.filter((item) => item.show)
},
// 初始化数据
init() {
// 设置数据
this.loading = true
this.tableData = []
var id = this.$parent.$parent.$parent.$parent.$parent.$refs.left.$refs
.tree.rowData.id
var number = this.$parent.$parent.$parent.$parent.activeName
if (!id || !number) {
return
}
const params = {
id: id,
number: number,
pageFrom: this.tablePagination.currentPage,
pageSize: this.tablePagination.pageSize,
numberOrName: this.$parent.search
}
// 发送请求
this.HttpRequest(
'/DxProcessPlan/planDetails',
params,
'post'
)
.then((res) => {
this.tableData = res.items.jobResponseInStorageVoDxPage.content
this.tablePagination.total =
res.items.jobResponseInStorageVoDxPage.totalElements
})
.catch((err) => console.error(err))
.finally(() => {
this.loading = false
})
},
cellClick(row, column, cell, event) {
if (column.property === 'fname') {
this.handleExport(row)
}
},
/**
* 页码触发
*/
setPage($event, state) {
if (state) {
this.tablePagination.currentPage = $event
} else {
this.tablePagination.currentPage = 1
this.tablePagination.pageSize = $event
}
this.init()
},
// 选择项发生改变
selectionChange(val) {
this.selectionRow = val
this.$emit('selectionRow', val)
},
cellClassName({ row, column, rowIndex, columnIndex }) {
if (column.property === 'fname') {
return 'see-excel'
}
return 'asdasf'
},
handleExport(row) {
const baseURl = downloadPdfHandle()
axios({
method: 'get',
url: `/dfs/fileManager/downloadio?fileId=${row.fileId}`,
baseURL: baseURl,
params: {},
headers: { token: `${localStorage.getItem('token')}`, 'equipment_id': `${localStorage.getItem('uid')}` },
responseType: 'arraybuffer'
})
.then((res) => {
const blob = new Blob([res.data], {
type:
'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob)
} else {
const elink = document.createElement('a')
elink.download = row.fname
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
document.body.removeChild(elink)
}
// } else {
// // IE10+下载
// navigator.msSaveBlob(blob)
// }
})
.catch((err) => {
console.error(err)
})
.finally(() => {
this.disabled = false
this.loading = false
})
}
}
}
</script>
<!-- <!--
* @LastEditTime: 2024-07-09 10:09:20 * @LastEditTime: 2024-07-12 15:38:19
* @Description: 实物构型管理 * @Description: 实物构型管理
--> -->
<template> <template>
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
> >
<template slot="paneL"> <template slot="paneL">
<div class="left-container"> <div class="left-container">
<Left ref="left" /> <Left ref="left" @formChange="formChangeHandle" />
</div> </div>
</template> </template>
<template slot="paneR"> <template slot="paneR">
<div class="right-container"> <div class="right-container">
<!-- 223333 --> <Right ref="right" :left-search-form="leftSearchForm" />
<Right ref="right" :collapse="collapse" />
</div> </div>
</template> </template>
</dee-fold-pane> </dee-fold-pane>
...@@ -37,12 +36,13 @@ export default { ...@@ -37,12 +36,13 @@ export default {
}, },
data() { data() {
return { return {
collapse: true collapse: true,
leftSearchForm: {}
} }
}, },
methods: { methods: {
handleCollapse(val) { formChangeHandle(val) {
// this.collapse = val this.leftSearchForm = JSON.parse(JSON.stringify(val))
} }
} }
} }
...@@ -94,14 +94,11 @@ export default { ...@@ -94,14 +94,11 @@ export default {
justify-content:flex-start; justify-content:flex-start;
padding: 6px 0px; padding: 6px 0px;
.search-input{ .search-input{
// width: calc(100% - 150px);
// flex:1;
margin-right:10px; margin-right:10px;
} }
} }
} }
.box { .box {
// width: 100%;
margin: 4px; margin: 4px;
border: 1px solid #d8d8d8; border: 1px solid #d8d8d8;
border-radius: 8px; border-radius: 8px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment