Commit 6da33764 authored by “lixuyan”'s avatar “lixuyan”

单架次指令标识维护批量前生

parent b3324372
......@@ -16,8 +16,8 @@ function patch(url, params) {
function del(url, params) {
return http.del(url, params)
}
function downloadFile(url, type) {
return http.downloadFile(url, type)
function downloadFile(url, type, params) {
return http.downloadFile(url, type, params)
}
function downloadZip(url, type) {
return http.downloadZip(url, type)
......
<template>
<section>
<div v-if="!show" class="from">
<div class="icon-wrap"><i class="icon" /> <span>搜索</span></div>
<el-form ref="ruleForm" :model="form" label-width="95px">
<el-form-item label="机型" prop="model">
<el-select v-model="form.model" clearable class="input-with-select el-input--small">
<el-option
v-for="item in dataModel"
:key="item.id"
:label="item.defName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="架次" prop="sortie">
<el-select v-model="form.sortie" clearable class="input-with-select el-input--small" :loading="sortiesLoading">
<el-option
v-for="item in dataSortie"
:key="item.id"
:label="item.defName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item v-if="labelShow()" label="AO(号/名称)" prop="aoName">
<el-input v-model="form.aoName" clearable class="input-with-select el-input--small" @change="searchAoname" />
</el-form-item>
<p class="btn">
<el-button size="small" type="primary" @click="searchForm">查询</el-button>
<el-button size="small" @click="resetForm('ruleForm')">重置</el-button>
</p>
</el-form>
</div>
</section>
</template>
<script>
export default {
name: 'Left',
props: {
show: {
type: Boolean,
default: null
},
dataModel: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
form: {
model: '',
modelName: '',
sortie: '',
sortieName: '',
aoName: ''
},
sortiesLoading: true,
dataSortie: [],
isCollapse: false
}
},
watch: {
dataModel(newV) {
if (newV.length <= 0) return
this.$nextTick(() => {
this.form.model = newV[0].id
this.form.modelName = newV[0].defName
this.getAddRecursion()
})
},
'form.model': {
immediate: true,
handler(val) {
if (!val) {
return
}
const model = this.dataModel.find((r) => r.id === val)
this.$set(this.form, 'modelName', (model && model.defName) || '')
this.getAddRecursion()
}
},
'form.sortie': {
immediate: true,
handler(val) {
if (!val) {
return
}
const sorties = this.dataSortie.find((r) => r.id === val)
this.$set(this.form, 'sortieName', (sorties && sorties.defName) || '')
}
}
},
mounted() {
this.getAddRecursion()
},
methods: {
labelShow() {
if (this.$parent.$parent &&
this.$parent.$parent.name === 'right' &&
this.$parent.$parent.isActive === 'ag') {
return false
} else {
return true
}
},
searchForm() {
this.$parent.$children
.filter(function(item) {
return item.name === 'tree'
})[0]
.getTreeData(this.form)
},
searchAoname() {
const that = this
if (that.$parent.$parent.name === 'right') {
that.$parent.$parent.getTableData()
} else {
this.searchForm()
}
},
/**
* 获取架次数据
*/
getAddRecursion() {
this.sortiesLoading = true
const params = { searchItems: { items: [{ fieldName: 'aircraftTypeId', operator: 'EQ', value: this.form.model }] }, sortItem: [{ fieldName: 'modifyTime', sortOrder: 'asc' }] }
params.openProps = [{ name: 'aircraftType' }]
this.$api
.searchApi('AircraftSorties', params)
.then((res) => {
this.dataSortie = []
if (res) {
this.dataSortie = res && res.items && res.items.content
this.$nextTick(() => {
if (this.dataSortie.length) {
this.form.sortie = this.dataSortie[0].id
this.form.sortieName = this.dataSortie[0].defName
this.searchForm()
}
})
} else {
this.$message({
showClose: true,
message: res.message,
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => {
this.$nextTick(() => {
this.sortiesLoading = false
})
})
},
resetForm() {
if (this.dataModel.length) {
this.form.model = this.dataModel[0].id
this.getAddRecursion()
}
this.form.aoName = null
}
}
}
</script>
<style lang="scss" >
.from {
border: 1px solid #ccc;
padding: 20px 20px 5px 20px;
border-radius: 5px;
box-sizing: border-box;
.icon-collapse {
display: inline-block;
width: 21px;
height: 21px;
background-size: contain;
cursor: pointer;
position: absolute;
z-index: 10;
top: 20px;
right: 20px;
}
.tobottom {
background: url("/icons/tobottom.png") no-repeat;
}
.totop {
background: url("/icons/totop.png") no-repeat;
}
.icon-wrap {
margin-bottom: 10px;
position: relative;
.icon {
display: inline-block;
width: 21px;
height: 21px;
background: url("/icons/r-access.png") no-repeat;
background-size: contain;
vertical-align: middle;
}
span {
vertical-align: middle;
// font-size: 12px;
}
}
.btn {
text-align: center;
}
.el-form-item {
margin-bottom: 8px;
}
}
/deep/.el-input {
height: 32px;
}
/deep/.el-button {
border-radius: 5px;
padding: 12px 30px;
}
</style>
<template>
<section class="single-mbom-left" :class="{ collapse: isCollapse }">
<div class="left-menu">
<searchForm
ref="searchForm"
:show="isCollapse"
:data-model="searchData.model"
/>
<!-- <i
class="iconTo"
:class="[isCollapse ? 'toright' : 'toleft']"
@click="handleCollapse"
/> -->
<tree
ref="tree"
class="tree"
:is-collapse="isCollapse"
/>
</div>
</section>
</template>
<script>
import searchForm from './form'
import tree from './tree'
export default {
components: {
searchForm,
tree
},
props: {
searchData: {
type: Object,
default: () => {
return {
model: []
}
}
}
},
data() {
return {
isCollapse: false
}
},
computed: {},
mounted() { },
created() {},
methods: {
// handleCollapse() {
// this.isCollapse = !this.isCollapse
// this.$emit('handleCollapse', this.isCollapse)
// }
}
}
</script>
<style lang="scss" >
.single-mbom-left {
height: 100%;
// width: 320px;
.left-menu {
position: relative;
display: flex;
flex-direction: column;
height: 100%;
.iconTo {
display: block;
width: 18px;
height: 21px;
background-size: contain;
cursor: pointer;
position: absolute;
top: 292px;
}
// .toleft {
// background: url("/icons/toleft.png") no-repeat;
// right: -18px;
// }
// .toright {
// background: url("/icons/toright.png") no-repeat;
// left: -10px;
// }
}
p {
text-align: right;
.b-packup {
display: inline-block;
width: 21px;
height: 21px;
background: url("/icons/b-packup.png") no-repeat;
background-size: contain;
cursor: pointer;
}
}
&.collapse {
width: 0px;
}
}
</style>
<template>
<section v-show="!isCollapse" class="left-tree">
<el-tree
class="tree"
:data="treeData"
default-expand-all
node-key="id"
:props="defaultProps"
:highlight-current="true"
:expand-on-click-node="false"
@node-click="handleNodeClick"
>
<span
slot-scope="{ data }"
class="custom-tree-node"
:class="[{ 'is-leaff': data.isLeaf }, { 'is-curr': data.id == curId }]"
>
<span class="tree-row">
<i :class="data.icon" />
<span class="label">{{ data.title }}</span>
<span>{{
"(" + data.quantity + "/" + data.total + ")"
}}</span>
</span>
</span>
</el-tree>
</section>
</template>
<script>
import { post } from '@/utils/http'
import $ from 'jquery'
export default {
name: 'Tree',
props: {
isCollapse: {
type: Boolean,
default: null
}
},
data() {
return {
// 组件唯一标识
name: 'tree',
treeData: [],
rowData: {},
curId: null,
// 判断当前组件处于指令标识还是Mbom
isMbom: false,
curNodeTitle: null,
assembly: null,
defaultProps: {
children: 'children',
label: 'label'
},
curTree: {}
}
},
mounted() {
this.$bus.$on('getPositionData', () => {
this.getTreeData()
})
// const that = this
// if (that.$parent.$parent.name === 'right') {
// that.assembly = that.$parent.$parent.$parent.$parent
// that.isMbom = true
// } else {
// that.assembly = that.$parent.$parent.$children.filter(function(item) {
// return item.name === 'right'
// })[0]
// }
},
methods: {
handleNodeClick(data, node, event) {
if (!data || !data.id) return
// 处于单架次的一级node 处于禁用状态
// if (this.isMbom) {
// if (this.assembly.isActive === 'ag' && !data.isLeaf) return
// else if (this.assembly.isActive === 'ins' && !data.isLeaf) return
// else if (this.assembly.isActive === 'ass' && data.isLeaf) return
// } else {
// console.log(44555, this.$parent)
// this.$parent.$parent.$parent.$parent.$refs.right.tablePagination.currentPage = 1
// this.$parent.$parent.$parent.$parent.$refs.right.tablePagination.pageSize = 10
// this.curTree = data
// if (data.isLeaf) return
// }
// this.curId = data.id
// this.assembly.title.sorties = data.serialNo
// this.curNodeTitle = data.title
// this.highlightTreeRow()
// 获取表格数据
// this.assembly.getTableData(data.id, this.froms.aoName, this.isMbom)
this.$bus.$emit('getPlanData', data)
},
/**
* 高亮状态
*/
highlightTreeRow() {
if (this.isMbom) {
this.$nextTick(() => {
if (
this.assembly.isActive === 'ag' ||
this.assembly.isActive === 'ins'
) {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('hhover')
} else {
$(ele).addClass('disabled')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
} else {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('disabled')
} else {
$(ele).addClass('hhover')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
}
})
} else {
this.$nextTick(() => {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('disabled')
} else {
$(ele).addClass('hhover')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
})
}
},
statuwMbom(id) {
if (id) {
this.curId = id
}
const that = this
if (that.isMbom) {
if (this.assembly.isActive === 'ass') {
this.handleNodeClick(that.data[0].children[0], this.froms.aoName)
} else {
this.handleNodeClick(that.data[0], this.froms.aoName)
}
}
this.highlightTreeRow()
},
/**
* 获取树结构数据
*/
getTreeData(froms) {
// var that = this
if (froms) {
this.froms = froms
}
const params = {
pageFrom: 1,
pageSize: 9999,
searchItems: {
children: [
{
items: [
{
fieldName: 'aircraftSorties.id', // 架次ID
operator: 'EQ',
value: this.froms.sortie
}
],
operator: 'AND'
}
],
items: [],
operator: 'AND'
},
openProps: [
{
name: 'extPositionPlans'
},
{
name: 'extPositionLinks',
openProps: [
{
name: 'target',
openProps: [
{
name: 'wrProduction'
}
]
}
]
}
],
sortItem: [
{
fieldName: 'serialNumber',
sortOrder: 'desc'
}
]
}
post(
'/ExtPosition/searchBatchExaminePosition?taskDefinitionKey=' + this.$route.query.taskDefinitionKey,
params
)
.then((res) => {
let quantity = 0
let total = 0
const data = [{
title: this.froms.modelName + '-' + this.froms.sortieName,
icon: 'aircraft',
id: this.froms.sortie,
isLeaf: true,
disabled: true,
children: res.items.map((t) => {
quantity += t.completeCount
total += t.carryCount
return {
serialNo: this.froms.sortieName,
title: t.serialNumber,
icon: 'c-backups3',
id: t.id,
quantity: t.completeCount,
total: t.carryCount
}
}),
quantity: quantity,
total: total
}]
this.treeData = data
this.handleNodeClick(data[0].children[0])
// if (that.isMbom) {
// this.handleNodeClick(data[0], this.froms.aoName)
// } else {
// if (
// JSON.stringify(this.curTree) === '{}' &&
// data[0].children &&
// data[0].children.length
// ) {
// this.curTree = data[0].children[0]
// this.handleNodeClick(data[0].children[0], this.froms.aoName)
// } else {
// this.handleNodeClick(this.curTree, this.froms.aoName)
// }
// }
// this.highlightTreeRow()
})
.catch((err) => console.error(err))
.finally(() => {})
}
}
}
</script>
<style lang="scss" >
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-thumb {
border-radius: 100px;
background: #dcdfe6;
}
.left-tree {
margin-top: 20px;
border: 1px solid #ccc;
padding: 20px;
border-radius: 5px;
box-sizing: border-box;
flex-grow: 1;
overflow: auto;
> .tree {
//当前选中项
&.el-tree--highlight-current .el-tree-node__content {
&.disabled {
color: #c0c4cc;
cursor: not-allowed;
background-color: #fff;
}
&.is-curr:not(.disabled),
&:hover:not(.disabled) {
font-weight: bold;
color: rgb(31, 30, 30);
background-color: rgb(214, 214, 214);
}
}
.el-tree-node {
// margin: 20px 0 !important;
.el-tree-node__content {
height: 40px !important;
// &:hover {
// font-weight: bold;
// color: #000;
// }
i {
display: inline-block;
vertical-align: middle;
margin: 10px;
}
.aircraft {
background: url("/icons/aircraft.png") no-repeat;
width: 32px;
height: 30px;
}
.c-backups3 {
width: 21px;
height: 21px;
background: url("/icons/u513.png") no-repeat;
background-size: contain;
}
.label {
vertical-align: middle;
}
}
}
}
overflow: hidden;
&:hover {
overflow: auto;
}
}
// .sidebar-container.sidebar-container{
// display: none;
// }
</style>
<template>
<section v-loading="instructionIdentificationShow" class="single-sortie-instruction-identification">
<dee-fold-pane :min-percent="18" :default-percent="18" split="vertical" class="detail-pane">
<template slot="paneL">
<div class="left">
<left
ref="left"
:search-data="searchData"
@handleTreeClick="handleTreeClick"
/>
</div>
</template>
<template slot="paneR">
<div class="right">
<right ref="right" />
</div>
</template>
</dee-fold-pane>
</section>
</template>
<script>
import left from './components/left/index'
import right from './components/right/index'
export default {
components: {
left,
right
},
data() {
return {
title: '',
instructionIdentificationShow: false,
jurisdId: null,
searchData: {
model: []
}
}
},
mounted() {
this.getModelData()
},
created() { },
methods: {
/**
* 获取机型数据
*/
getModelData() {
console.log(5555)
const param = { searchItems: { items: [{ fieldName: 'id', operator: 'NEQ', value: 0 }] }, sortItem: [{ fieldName: 'modifyTime', sortOrder: 'asc' }] }
this.$api
.searchApi('AircraftType', param)
.then((res) => {
if (res && res.items && res.items.content) {
this.searchData.model = res.items.content
} else {
this.$message({
showClose: true,
message: '机型数据获取失败!',
type: 'error'
})
}
})
.catch((err) => console.log(err))
.finally(() => { })
},
open(v) {
this.dialogCmp = {
typeName: 'RequestOutStorageOut',
typeKey: '34fcf9f2-0ae6-47bb-920c-7c625d3e0937'
}
// this.$refs.dialog.open()
},
handleTreeClick(v) {
this.title = v.label
},
handleCollapse(v) {
}
}
}
</script>
<style lang="scss" >
.single-sortie-instruction-identification {
display: flex;
height: 100%;
.detail-pane{
width: 100%;
.left{
height: 100%;
overflow-x: hidden;
}
.right {
height: 100%;
.table {
margin-top: 0;
}
}
}
}
</style>
......@@ -35,7 +35,9 @@ export default {
PlannerConfirm: () => import('./plannerConfirm'), // 计划员确认
WorkHourExamine: () => import('./workHourExamine'), // 工时审核
OutStorageMatchConfirm: () => import('./outStorageMatchConfirm'), // 配套出库确认
ProPreparateWorkerConfirm: () => import('./proPreparatWorkerConfirm') // 生产准备工确认
ProPreparateWorkerConfirm: () => import('./proPreparatWorkerConfirm'), // 生产准备工确认
InstructionIdentificationBatch: () => import('./instructionIdentificationBatch'), // 指令标识
InstructionIdentificationBatchInfo: () => import('./instructionIdentificationBatch') // 指令标识不编辑
},
props: {
selectData: {
......
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