Commit 99a6157b authored by jingnan's avatar jingnan 👀

Merge branch 'dev' of http://94.191.100.41/tfmom/tf-mom-web into dev

parents cd04336c 2ff36e8b
<template>
<div class="missing-parts">
<div class="sub-title" style="margin:0 10px">
下发班组
</div>
<div class="group-list">
<div v-for="(item, index) in groupDropList" :key="index" class="group-list-box" :class="{'active': group===item.id}" @click="changeGroup(item)">
<div class="left">
<div class="left-text"> {{ item.resName }}</div>
</div>
<div class="right">
<div class="right-text"><span>操作工人数:</span><span>{{ item.userCount }}</span></div>
<div class="right-text"><span>未完成任务:</span><span>{{ item.notFinishCount }}</span></div>
<div class="right-text"><span>未完成工时:</span><span>{{ item.notFinishWork }}(h)</span></div>
<div class="right-text"><span>当月完成任务:</span><span>{{ item.finishCount }}</span></div>
<div class="right-text"><span>当月完成工时:</span><span>{{ item.finishWork }}(h)</span></div>
<el-tooltip placement="top">
<div v-if="item.extProcessSkillUsers" slot="content">
<span v-for="user in item.extProcessSkillUsers" :key="user.id">
{{ user.dxUserInfo.name }}
</span>
</div>
<div v-if="item.extProcessSkillUsers" class="right-text overfllowhind">
<span>班组长:</span>
<span v-for="user in item.extProcessSkillUsers" :key="user.id">
{{ user.dxUserInfo.name }}
</span>
</div>
</el-tooltip>
</div>
</div>
<div class="more-bar">
<span v-if="groupDropList.length < groupTotal" class="more" @click="getMoreData">加载更多</span>
<span v-else-if="groupDropList.length===0">暂无数据</span>
<span v-else>已全部加载!</span>
</div>
</div>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'MissingParts',
props: {
info: {
type: Object,
default: () => ({})
}
},
data() {
return {
groupDropList: [],
groupPage: 1,
groupTotal: 0,
detailInfo: null,
group: '',
groupType: ''
}
},
created() {
},
mounted() {
this.$bus.$on('getTeamList', (data) => {
this.group = ''
this.groupType = ''
this.groupDropList = []
this.groupPage = 1
this.groupTotal = 0
this.getGroupList()
})
this.$bus.$on('getMissData', (data) => {
this.group = ''
this.groupType = ''
this.detailInfo = data
this.groupDropList = []
this.groupPage = 1
this.groupTotal = 0
this.getGroupList()
})
this.$bus.$on('clearMissData', () => {
this.group = ''
this.groupType = ''
})
},
methods: {
handleCurrentChange(val) {
this.$emit('getInfo', val)
},
getGroupList() {
const params = {
'pageFrom': this.groupPage,
'pageSize': 10,
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extStandPosition.extcode',
'operator': 'EQ',
'value': this.detailInfo.serialNumber
},
{
'fieldName': 'isValid',
'operator': 'EQ',
'value': 'Y'
},
{
'fieldName': 'skillType',
'operator': 'EQ',
'value': 'FitOut'
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extProcessSkillUsers',
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'isSkillLeader',
'operator': 'EQ',
'value': true
}
],
'operator': 'AND'
}
]
}
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
post('/ExtProcessSkill/getSkillWorkDetail', params).then(res => {
if (res.items && res.items.content) {
this.groupDropList = this.groupDropList.concat(res.items.content)
this.groupTotal = res.items.totalElements
}
})
},
getMoreData() {
const num = Math.ceil(this.groupTotal / 10)
if (this.groupPage <= num) {
this.groupPage++
this.getGroupList()
}
},
changeGroup(val) {
this.$set(this, 'group', val.id || '')
this.$set(this, 'groupType', val.subTypeName || '')
this.$bus.$emit('addGroup', this.group, this.groupType)
// if (this.selectionRow.length > 0) {
// this.selectionRow.forEach(element => {
// element.skill = this.group
// element.skillType = this.groupType
// })
// }
}
}
}
</script>
<style lang="scss" scope>
.missing-parts{
.group-list{
height: calc(100vh - 100px);
overflow-y: scroll;
margin-bottom: 20px;
.more-bar {
margin: 10px auto;
text-align: center;
font-size: 12px;
color: #999;
.more {
margin: auto;
margin-top: 20px;
height: 26px;
line-height: 26px;
padding: 0 20px;
background: #cf9236;
border-radius: 13px;
display: inline-block;
cursor: pointer;
}
}
.group-list-box{
box-sizing: border-box;
background: url("/images/tasks.png") no-repeat;
background-size: 100% 100%;
padding: 10px;
margin: 10px 20px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 10px;
font-size: 14px;
border: 3px solid #fff;
.left{
text-align: center;
.left-text{
font-size: 16px;
font-weight: 500;
}
}
.right{
.right-text{
padding-top: 8px;
}
.overfllowhind{
max-width: 100%;
word-break:keep-all;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
}
}
.active{
color: #cf9236;
font-weight: 700;
border: 3px solid #cf9236;
}
}
}
</style>
<template>
<div class="station-plan-list">
<div ref="instructionsIssuedList" class="station-plan-list">
<dee-fold-pane
:min-percent="22"
:default-percent="22"
......@@ -38,9 +38,9 @@
:default-expanded-keys="defaultExpandedKeys"
:props="defaultProps"
:highlight-current="true"
:expand-on-click-node="false"
:load="loadNode"
@node-click="handleNodeClick"
@node-click="loadNode"
@node-expand="handleNodeExpanded"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span class="tree-row">
......@@ -48,11 +48,12 @@
<span v-if="node.level === 1" class="label" :title="data.serialNumber">{{ data.serialNumber }}</span>
<span v-if="node.level === 2">
{{ data.serialNumber + ',' + data.name }}
<img v-if="data.workingStatus === 'New'||data.workingStatus===null" :title="未开工" class="img-container" :src="wordImgUrl1" @click="startWorking(data)">
<img v-else-if="data.workingStatus === 'Run'" class="img-container" :title="已开工" :src="wordImgUrl2" @click="startWorking(data)">
<img v-else class="img-container" :title="已完工" :src="wordImgUrl2" @click="startWorking(data)">
<img v-if="data.workingStatus === 'New'||data.workingStatus===null" title="未开工" class="img-container" :src="wordImgUrl1" @click="startWorking(data)">
<img v-else-if="data.workingStatus === 'Run'" class="img-container" title="已开工" :src="wordImgUrl2" @click="startWorking(data)">
<img v-else class="img-container" title="已完工" :src="wordImgUrl2" @click="startWorking(data)">
</span>
<span v-if="node.level === 3" :class="[data.isOk ?'Delivery':'Finish']">{{ data.serialNumber + ',' + data.name }}</span>
<span v-if="node.level === 3 && data.type !=='cooperate'" :class="[data.isOk ?'Delivery':'Finish']">{{ data.serialNumber + ',' + data.name }}</span>
<span v-if="node.level === 3 && data.type ==='cooperate'">{{ data.name }}</span>
</span>
</span>
</el-tree>
......@@ -62,11 +63,22 @@
<template slot="paneR">
<div class="right-container">
<dee-as-com
v-show="!isCooperate"
ref="detailCom"
:key="layConfig.typeName"
:key="layConfig.layKey"
table-height="calc(100vh - 100px)"
:lay-config="layConfig"
:form="searchFormData"
@row-click="rowClick"
@selectionChange="selectionChange"
/>
<dee-as-com
v-show="isCooperate"
ref="detailComCoo"
:key="layConfigCoo.layKey"
table-height="calc(100vh - 100px)"
:lay-config="layConfigCoo"
:form="searchFormData"
@selectionChange="selectionChange"
/>
</div>
</template>
......@@ -99,11 +111,21 @@ export default {
typeName: 'JoExecutePlan',
layKey: 'instructionsIssuedList'
},
layConfigCoo: {
typeName: 'JoExecutePlan',
layKey: 'instructionsIssuedCooList'
},
activeTab: '0',
activeNodeData: {},
wordImgUrl1: '/icons/startWork1.png',
wordImgUrl2: '/icons/startWork2.png',
searchFormData: ''
searchFormData: {},
skill: '',
skillType: '',
isCooperate: false,
hasLoad: false,
currentLoadTreeData: '',
resolveObj: ''
}
},
watch: {
......@@ -132,11 +154,45 @@ export default {
}
},
created() {
this.getJoExecutePlanState()
this.getAddModel()
},
mounted() {},
mounted() {
this.$bus.$on('addGroup', (group, groupType) => {
this.$nextTick(() => {
if (!this.isCooperate) {
if (this.$refs.detailCom && this.$refs.detailCom.$children[0].selectedData.length > 0) {
this.skill = group
this.skillType = groupType
this.$refs.detailCom.$children[0].selectedData.forEach(element => {
element.skill = group
element.skillType = groupType
})
}
} else {
if (this.$refs.detailComCoo && this.$refs.detailComCoo.$children[0].selectedData.length > 0) {
this.skill = group
this.skillType = groupType
this.$refs.detailComCoo.$children[0].selectedData.forEach(element => {
element.skill = group
element.skillType = groupType
})
}
}
})
})
},
methods: {
/**
getJoExecutePlanState() {
this.$utils.getDicListByCode('PlanState').then(res => {
if (res) {
this.$set(this.searchFormData, 'joExecutePlanStateData', res)
} else {
this.$set(this.searchFormData, 'joExecutePlanStateData', [])
}
})
},
/**
* 获取机型
*/
getAddModel() {
......@@ -261,6 +317,9 @@ export default {
}
post(`ExtPosition/queryByStandPost`, params)
.then((res) => {
res.items.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}`,
......@@ -268,7 +327,8 @@ export default {
gaceVersio: '',
state: '',
id: 1,
children: res.items
children: res.items,
level: 0
}
]
this.defaultExpandedKeys = [1]
......@@ -278,9 +338,35 @@ export default {
this.treeLoading = false
})
},
// getExpandData(data, node) {
// if (node.level === 2) {
// this.$bus.$emit('getMissData', data)
// }
// },
// handleNodeCollapse(data, node) {
// if (node.level === 2) {
// node.loaded = false
// node.childNodes.splice(0, node.childNodes.length)
// }
// },
handleNodeExpanded(data, node) {
// console.log(333, node)
// if (node.level === 2) {
// node.childNodes = []
// if (node.expanded) {
// if (this.hasLoad) {
// this.hasLoad = false
// } else {
// node.loaded = false
// this.loadNode(node, this.resolveObj)
// }
// }
// }
},
loadNode(node, resolve) {
if (node.level === 1) return resolve(node.data.children)
if (node.level > 1) {
if (node.level === 1) {
return resolve(node.data.children)
} else if (node.level === 2) {
const params = {
pageFrom: 1,
pageSize: 9999,
......@@ -304,10 +390,17 @@ export default {
}
post(`ExtProcessPlan/queryByPosition`, params)
.then((res) => {
res.items.push({
positionId: node.data.id,
type: 'cooperate',
serialNumber: '',
name: '协同办公'
})
res.items.forEach(element => {
element.level = 3
element.leaf = true
element.workingStatus = element.extPositionPlans && element.extPositionPlans.length > 0 ? element.extPositionPlans[0].planState : null
})
this.$bus.$emit('getMissData', node.data)
return resolve(res.items)
})
.catch((err) => {
......@@ -315,6 +408,28 @@ export default {
return resolve([])
})
.finally(() => {})
} else if (node.level === 3) {
if (node.type === 'cooperate') {
this.isCooperate = true
} else {
this.isCooperate = false
}
node.joExecutePlanStateData = this.searchFormData.joExecutePlanStateData
this.searchFormData = node
this.skill = ''
this.skillType = ''
this.$bus.$emit('clearMissData')
this.$nextTick(() => {
if (!this.isCooperate) {
if (this.$refs.detailCom.$refs.asCom && this.$refs.detailCom.$refs.asCom.getData) {
this.$refs.detailCom.$refs.asCom.getData(node)
}
} else {
if (this.$refs.detailComCoo.$refs.asCom && this.$refs.detailComCoo.$refs.asCom.getData) {
this.$refs.detailComCoo.$refs.asCom.getData(node)
}
}
})
}
},
formatTime() {
......@@ -329,6 +444,9 @@ export default {
resStr = year + '-' + month + '-' + date + ' ' + hours + ':' + minutes + ':' + second
return resStr
},
getHandledValue(num) {
return num < 10 ? '0' + num : num
},
startWorking(data) {
if (data.workingStatus !== 'New') {
if (data.workingStatus === 'Run') {
......@@ -375,19 +493,24 @@ export default {
})
})
},
handleNodeClick(data, node) {
this.searchFormData = data
if (node.level === 3) {
console.log(454545, this.$refs.detailCom.$refs.asCom)
this.$nextTick(() => {
if (this.$refs.detailCom.$refs.asCom && this.$refs.detailCom.$refs.asCom.getData) {
this.$refs.detailCom.$refs.asCom.getData(data)
selectionChange() {
this.$nextTick(() => {
if (!this.isCooperate) {
if (this.$refs.detailCom && this.$refs.detailCom.$children[0].selectedData.length > 0) {
this.$refs.detailCom.$children[0].selectedData.forEach(element => {
element.skill = this.skill
element.skillType = this.skillType
})
}
})
}
},
rowClick(data) {
this.$emit('getMissData', data)
} else {
if (this.$refs.detailComCoo && this.$refs.detailComCoo.$children[0].selectedData.length > 0) {
this.$refs.detailComCoo.$children[0].selectedData.forEach(element => {
element.skill = this.skill
element.skillType = this.skillType
})
}
}
})
}
}
}
......
<template>
<div class="instructions-issued">
<div class="instructions-issued-top">
<el-form :inline="true" :model="searchFormData" class="instructions-issued-search">
<el-col :span="5">
<el-form-item label="站位:">
<el-select v-model="searchFormData.postion" placeholder="站位" @change="changePostion">
<el-option
v-for="(item, i) in postionList"
:key="item.value + i"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="架次:">
<el-select v-model="searchFormData.sorties" placeholder="架次" @change="changeSorties">
<el-option
v-for="(item, i) in sortiesData"
:key="item.value + i"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划结束:">
<el-date-picker
v-model="searchFormData.actualEnd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd 00:00:00"
@change="getTableData"
@clear="getTableData"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="AO(号/名称):">
<el-input v-model="searchFormData.aoName" clearable placeholder="请输入AO(号/名称)" @clear="getTableData" @keyup.enter.native="getTableData" />
</el-form-item>
</el-col>
</el-form>
<span class="start-working">
<img :src="wordImgUrl" alt="" :title="title" @click="startWorking">
</span>
</div>
<split-pane
:min-percent="18"
:default-percent="defaultPercent"
split="vertical"
class="detail-pane"
>
<div class="instructions-issued-page">
<dee-fold-pane :min-percent="18" :default-percent="18" split="vertical" class="detail-pane" fold-direction="false">
<template slot="paneL">
<dee-tab :tabs="tabItems" @tabClick="tabClick">
<div slot="0" style="height:100%;box-sizing:border-box">
<dee-up-table
selection-row
:index-row="indexRow"
:columns="columns"
:data="tableData"
:pagination="pagination"
@pagination-current-change="paginationCurrentChange"
@pagination-size-change="handleSizeChange"
@selection-change="selectionChange"
>
<dee-tools slot="header" :tools="tools" mode="normal" />
</dee-up-table>
</div>
<div slot="1" style="height:100%;box-sizing:border-box">
<dee-as-com
ref="detailComAlready"
:key="layConfigAlready.typeName"
:lay-config="layConfigAlready"
:form="searchFormData"
/>
</div>
</dee-tab>
<div class="three-member-wrap">
<stationPlanList />
</div>
</template>
<template slot="paneR">
<div class="sub-title" style="margin:0 10px">
下发班组
</div>
<!-- <el-select v-model="group" size="small" placeholder="请选择" style="width:86%;margin:10px" filterable @change="changeGroup">
<el-option
v-for="item in groupDropList"
:key="item.id"
:label="item.resName"
:value="item.id"
/>
</el-select> -->
<div class="group-list">
<div v-for="(item, index) in groupDropList" :key="index" class="group-list-box" :class="{'active': group===item.id}" @click="changeGroup(item)">
<div class="left">
<div class="left-text"> {{ item.resName }}</div>
</div>
<div class="right">
<div class="right-text"><span>操作工人数:</span><span>{{ item.userCount }}</span></div>
<div class="right-text"><span>未完成任务:</span><span>{{ item.notFinishCount }}</span></div>
<div class="right-text"><span>未完成工时:</span><span>{{ item.notFinishWork }}(h)</span></div>
<div class="right-text"><span>当月完成任务:</span><span>{{ item.finishCount }}</span></div>
<div class="right-text"><span>当月完成工时:</span><span>{{ item.finishWork }}(h)</span></div>
<el-tooltip placement="top">
<div v-if="item.extProcessSkillUsers" slot="content">
<span v-for="user in item.extProcessSkillUsers" :key="user.id">
{{ user.dxUserInfo.name }}
</span>
</div>
<div v-if="item.extProcessSkillUsers" class="right-text overfllowhind">
<span>班组长:</span>
<span v-for="user in item.extProcessSkillUsers" :key="user.id">
{{ user.dxUserInfo.name }}
</span>
</div>
</el-tooltip>
</div>
</div>
<div class="more-bar">
<span v-if="groupDropList.length < groupTotal" class="more" @click="getMoreData">加载更多</span>
<span v-else-if="groupDropList.length===0">暂无数据</span>
<span v-else>已全部加载!</span>
</div>
<div class="resourceTable-wrap">
<missingParts />
</div>
</template>
</split-pane>
</dee-fold-pane>
</div>
</template>
<script>
import { post } from '@/utils/http'
import missingParts from './components/missingParts'
import stationPlanList from './components/stationPlanList'
export default {
name: 'StationPlanMaintenance',
components: { missingParts, stationPlanList },
data() {
return {
sortiesData: [],
postionList: [],
searchFormData: {
sorties: '',
postion: '',
actualEnd: '',
aoName: ''
},
group: '',
groupType: '',
groupDropList: [],
activeName: 0,
// 开工状态
status: null,
title: '未开工',
wordImgUrl: '/icons/startWork1.png',
defaultPercent: 80,
indexRow: {
title: '序号',
align: 'center',
width: '70'
},
columns: [
{ title: '机型', key: 'extProcessPlan.planeType', align: 'left' },
{ title: '架次', key: 'extProcessPlan.sorties', align: 'left' },
{ title: '站位', key: 'extProcessPlan.positionNumber', align: 'left' },
{ title: '指令号', key: 'extProcessPlan.serialNumber', align: 'left' },
{ title: '指令名称', key: 'extProcessPlan.name', align: 'left' },
{ title: '工时定额', key: 'extProcessPlan.workHour', align: 'left' },
{ title: '工艺员', key: 'extProcessPlan.noteName', align: 'left' },
{ title: '计划开始', key: 'scheduledStart', align: 'left' },
{ title: '计划结束', key: 'scheduledEnd', align: 'left' }
],
tableData: [],
pagination: {
currentPage: 1,
pageSize: 20,
total: 0,
pageSizes: [20, 50, 100]
},
selectionRow: [],
tools: [
{
type: 'icon',
name: '下发',
icon: '/icons/o-Referencedoc.png',
handler: {
click: () => {
if (this.status !== 'New') {
if (this.selectionRow.length <= 0) {
this.$utils.showMessageWarning('该操作至少选择一条数据')
return
}
if (!this.group) {
this.$utils.showMessageWarning('请选择下发班组')
return
}
this.$confirm('您确认执行该操作吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const arr = []
this.selectionRow.map(item => {
arr.push(
{
id: item.id,
operator: 'MODIFY',
planState: 'Issued',
extProcessSkillId: item.skill,
extProcessSkillIdType: item.skillType
}
)
})
post('/JoExecutePlan/recursions', arr)
.then((res) => {
this.$message({
type: 'success',
message: '提交成功!'
})
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
this.getInstructionsIssuedListTo()
})
.catch((err) => console.log(err))
.finally(() => {})
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消'
// })
})
} else {
this.$utils.showMessageWarning('该站位还没开工')
}
}
}
}
],
groupPage: 1,
groupTotal: 0
sortiesId: '',
positionNumber: '',
form: {},
stateOptions: [],
headerShow: true,
basicData: {},
missInfo: {},
rowData: {},
defaultActiveName: ''
}
},
computed: {
tabItems() {
return [
{
name: '待下发',
name: '列表',
id: '0'
},
{
name: '已下发',
name: '甘特图',
id: '1'
}
]
},
layConfigAlready() {
layConfig() {
return {
typeName: 'JoExecutePlan',
layKey: 'instructionsIssuedListAlready'
layKey: 'stationPlanList'
}
}
},
watch: {
status: {
handler(val) {
if (val === 'New' || val === '') {
this.wordImgUrl = '/icons/startWork1.png'
this.title = '未开工'
} else if (val === 'Run') {
this.wordImgUrl = '/icons/startWork2.png'
this.title = '已开工'
} else {
this.wordImgUrl = '/icons/startWork2.png'
this.title = '已完工'
mounted() {
this.$nextTick(() => {
this.defaultActiveName = '2'
})
// this.defaultActiveName = this.$route.query.id ? '2' : '1'
this.$bus.$on('getTableData', (data) => {
this.$nextTick(() => {
this.getLeftCount(data)
this.getRightCount(data)
const formData = {
items: [],
operator: 'AND'
}
},
deep: true
}
},
created() {
this.getStation()
},
methods: {
getSortiesList() {
this.sortiesData = []
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extPosition.serialNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extPosition',
'searchItems': {
'items': [
{
'fieldName': 'serialNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'extPositionPlans'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
post('/AircraftSorties/search', params).then(res => {
if (res.items && res.items.content) {
this.sortiesData = res.items.content.map(row => {
return {
value: row.defCode,
label: row.defName,
postionId: row.extPosition && row.extPosition.length && row.extPosition[0].extPositionPlans && row.extPosition[0].extPositionPlans[0] ? row.extPosition[0].extPositionPlans[0].id : ''
}
for (const i in data) {
formData.items.push({
fieldName: i,
value: data[i]
})
this.$set(this.searchFormData, 'sorties', this.sortiesData[0].value)
this.$set(this.searchFormData, 'sortiesName', this.sortiesData[0].label)
this.$set(this.searchFormData, 'workId', this.sortiesData[0].postionId)
// this.$set(this, 'status', this.sortiesData[0].status)
// this.status = res.items.content[0].extPosition[0].extPositionPlans[0].planState
this.getWorkStatus()
this.getTableData()
}
this.$refs.detailCom.$children[0].searchFormData = formData
this.$refs.detailCom.$children[0].getData()
})
})
this.getStateOptions()
},
methods: {
getMissData(data) {
this.rowData = data
this.getMissInfo(data.row.extProcessPlan)
},
getStation() {
this.postionList = []
this.$set(this.searchFormData, 'postion', '')
const userId = localStorage.getItem('userId') || ''
// getPageData(val) {
// this.getMissInfo(this.rowData.row, val)
// },
getLeftCount(obj) {
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'targetId',
'operator': 'EQ',
'value': userId
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
operator: 'AND',
items: [
{
'name': 'source'
}
],
'sortItem': [
fieldName: 'extProcessPlan.sorties',
operator: 'EQ',
value: obj.sortiesName
},
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
post('/ExtPositionUserLink/search', params).then(res => {
if (res.items && res.items.content) {
this.postionList = res.items.content.map(row => {
return {
value: row.source.extname,
label: row.source.extcode,
id: row.source.id
}
})
if (this.postionList.length > 0) {
this.$set(this.searchFormData, 'postion', this.postionList[0].value)
this.$set(this.searchFormData, 'postionName', this.postionList[0].label)
this.$set(this.searchFormData, 'postionId', this.postionList[0].id)
this.getSortiesList()
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
fieldName: 'extProcessPlan.positionNumber',
operator: 'EQ',
value: obj.postionName
},
{
fieldName: 'extProcessPlan.subTypeName',
operator: 'IN',
value: ['ExtProcessPlanAssembly', 'ExtProcessPlanAOR']
},
{
fieldName: 'fitRates',
operator: 'EQ',
value: '1'
}
}
})
},
changePostion() {
const postion = this.postionList.find(r => r.value === this.searchFormData.postion)
this.$set(this.searchFormData, 'postionName', postion && postion.label || '')
this.$set(this.searchFormData, 'postionId', postion && postion.id || '')
this.getSortiesList()
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
},
changeSorties() {
const sorties = this.sortiesData.find(r => r.value === this.searchFormData.sorties)
this.$set(this.searchFormData, 'sortiesName', sorties && sorties.label || '')
this.$set(this.searchFormData, 'workId', sorties && sorties.postionId || '')
this.getWorkStatus()
// this.status = sorties.status
this.getTableData()
},
getWorkStatus() {
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'aircraftSorties.defCode',
'operator': 'EQ',
'value': this.searchFormData.sortiesName
},
{
'fieldName': 'extPosition.serialNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': []
]
}
this.$api.searchApi('ExtPositionPlan', params).then(res => {
if (res.items.content) {
if (res.items.content.length > 0) {
this.status = res.items.content[0].planState
} else {
this.status = ''
post(`/ExtSupporting/count`, params)
.then((res) => {
if (res.items) {
this.$set(this.missInfo, 'leftItem', res.items)
// this.missInfo.leftItem = res.items
}
}
})
},
tabClick(tab) {
this.searchFormData.aoName = ''
this.searchFormData.actualEnd = ''
this.activeName = tab.index
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
if (this.activeName === '1') {
this.defaultPercent = 100
} else {
this.defaultPercent = 80
}
this.getTableData()
},
getTableData() {
if (this.activeName === '1') {
if (this.$refs.detailComAlready) {
this.$refs.detailComAlready.$children[0].getData()
}
} else {
this.getInstructionsIssuedListTo()
}
})
.finally(() => {})
},
getInstructionsIssuedListTo() {
getRightCount(obj) {
const params = {
'pageFrom': this.pagination.currentPage,
'pageSize': this.pagination.pageSize,
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extProcessPlan.sorties',
'operator': 'EQ',
'value': this.searchFormData.sortiesName
},
{
'fieldName': 'extProcessPlan.positionNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
},
{
'fieldName': 'planState',
'operator': 'EQ',
'value': 'Yes'
}
],
'operator': 'AND'
},
{
'items': [
{
'fieldName': 'extProcessPlan.serialNumber',
'operator': 'LIKE',
'value': this.searchFormData.aoName
},
{
'fieldName': 'extProcessPlan.name',
'operator': 'LIKE',
'value': this.searchFormData.aoName
}
],
'operator': 'OR'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
operator: 'AND',
items: [
{
'name': 'extProcessPlan',
'openProps': [
{
'name': 'extSupportings'
}
]
}
],
'sortItem': [
fieldName: 'sorties',
operator: 'EQ',
value: obj.sortiesName
},
{
fieldName: 'positionNumber',
operator: 'EQ',
value: obj.postionName
},
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
fieldName: 'subTypeName',
operator: 'IN',
value: ['ExtProcessPlanAssembly', 'ExtProcessPlanAOR']
}
]
}
if (this.searchFormData.actualEnd && this.searchFormData.actualEnd.length > 0) {
params.searchItems.children[0].items.push({
'fieldName': 'scheduledEnd',
'operator': 'BTWN',
'value': this.searchFormData.actualEnd[0],
'value1': this.searchFormData.actualEnd[1]
})
}
post('/JoExecutePlan/getProductionPrepare', params).then(res => {
if (res.items && res.items.content) {
this.tableData = res.items.content
// this.$set(this, 'group', res.items[0] && res.items[0].id || '')
}
})
},
paginationCurrentChange(currentPage) {
this.pagination.currentPage = currentPage
this.getInstructionsIssuedListTo()
},
handleSizeChange(pageSize) {
this.pagination.pageSize = pageSize
this.pagination.currentPage = 1
this.getInstructionsIssuedListTo()
},
selectionChange(val) {
val.forEach(element => {
element.skill = this.group
element.skillType = this.groupType
})
this.selectionRow = val
},
changeGroup(val) {
this.$set(this, 'group', val.id || '')
this.$set(this, 'groupType', val.subTypeName || '')
if (this.selectionRow.length > 0) {
this.selectionRow.forEach(element => {
element.skill = this.group
element.skillType = this.groupType
post(`/ExtProcessPlan/count`, params)
.then((res) => {
if (res.items) {
this.$set(this.missInfo, 'rightItem', res.items)
}
})
}
.finally(() => {})
},
getGroupList() {
getMissInfo(obj) {
const params = {
'pageFrom': this.groupPage,
'pageSize': 10,
'searchItems': {
'children': [
pageFrom: 1,
pageSize: 200,
searchItems: {
children: [
{
'items': [
{
'fieldName': 'extStandPositionId',
'operator': 'EQ',
'value': this.searchFormData.postionId
},
{
'fieldName': 'isValid',
'operator': 'EQ',
'value': 'Y'
},
items: [
{
'fieldName': 'skillType',
'operator': 'EQ',
'value': 'FitOut'
fieldName: 'extSupporting.extProcessPlanId',
operator: 'EQ',
value: obj.id
}
],
'operator': 'AND'
operator: 'AND'
}
],
'items': [],
'operator': 'AND'
items: [],
operator: 'AND'
},
'openProps': [
openProps: [
{
'name': 'extProcessSkillUsers',
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'isSkillLeader',
'operator': 'EQ',
'value': true
}
],
'operator': 'AND'
}
]
}
}
],
'sortItem': [
name: 'extMaterial'
},
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
name: 'productWorkCenter'
}
],
'toValidateKeys': ''
}
post('/ExtProcessSkill/getSkillWorkDetail', params).then(res => {
if (res.items && res.items.content) {
this.groupDropList = res.items.content
this.groupTotal = res.items.totalElements
// this.$set(this, 'group', res.items.content[0] && res.items.content[0].id || '')
// this.$set(this, 'groupType', res.items.content[0] && res.items.content[0].subTypeName || '')
}
})
},
getMoreData() {
const num = Math.ceil(this.groupTotal / 10)
if (this.groupPage <= num) {
this.groupPage++
this.getGroupList()
}
},
getHandledValue(num) {
return num < 10 ? '0' + num : num
},
formatTime() {
const d = new Date()
const year = d.getFullYear()
const month = this.getHandledValue(d.getMonth() + 1)
const date = this.getHandledValue(d.getDate())
const hours = this.getHandledValue(d.getHours())
const minutes = this.getHandledValue(d.getMinutes())
const second = this.getHandledValue(d.getSeconds())
let resStr = ''
resStr = year + '-' + month + '-' + date + ' ' + hours + ':' + minutes + ':' + second
return resStr
},
startWorking() {
if (this.status !== 'New') {
if (this.status === 'Run') {
this.$utils.showMessageWarning('该站位己开工')
return
}
if (this.postionList.length === 0) {
this.$utils.showMessageWarning('没有站位')
return
}
if (this.status === '') {
this.$utils.showMessageWarning('该站位下没有生成计划')
return
}
// this.$utils.showMessageWarning('该站位不能开工')
return
}
const params = {
'operator': 'MODIFY',
'id': this.searchFormData.workId,
'planState': 'Run',
'extResPositionPlans': [
sortItem: [
{
'operator': 'ADD',
'isValid': 'Y',
'actualStart': this.formatTime()
fieldName: 'modifyTime',
sortOrder: 'desc'
}
]
}
this.$confirm('是否开工', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
post('/ExtPositionPlan/recursion', params)
.then((res) => {
this.$message({
type: 'success',
message: '开工成功!'
})
this.status = res.items.planState
this.getTableData()
})
.catch((err) => console.log(err))
.finally(() => {})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
post(`/ExtSupportingItem/supportingItemAoId`, params)
.then((res) => {
if (res.items) {
this.$set(this.missInfo, 'missList', res.items)
}
})
.finally(() => {})
},
getStateOptions() {
this.$utils.getDicListByCode('PlanState').then((res) => {
this.stateOptions = res
})
},
search(form) {
this.form = { ...form }
this.form.positionNumber = this.positionNumber
this.sortiesId = form.sorties
},
change(positionNumber) {
this.positionNumber = positionNumber
this.form.positionNumber = this.positionNumber
},
showStation(flag) {
this.headerShow = flag
}
}
}
</script>
<style lang="scss">
.instructions-issued{
background: #ffff;
.instructions-issued-page {
margin: 4px;
margin-top: 0px;
padding: 8px;
height: 100%;
width: 100%;
background-color: #fff;
.detail-pane {
overflow-x: hidden;
width: 100%;
height: calc(100% - 6px);
}
.splitter-pane-resizer.vertical {
opacity: 1;
background-color: #f1f4f5;
width: 6px;
border-left: 0;
border-right: 0;
}
.three-member-wrap {
height: 100%;
.group-list{
height: calc(100% - 100px);
overflow-y: scroll;
margin-bottom: 20px;
.more-bar {
margin: 10px auto;
text-align: center;
font-size: 12px;
color: #999;
.more {
margin: auto;
margin-top: 20px;
height: 26px;
line-height: 26px;
padding: 0 20px;
background: #cf9236;
border-radius: 13px;
display: inline-block;
cursor: pointer;
}
}
.group-list-box{
box-sizing: border-box;
background: url("/images/tasks.png") no-repeat;
background-size: 100% 100%;
padding: 10px;
margin: 10px 20px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 10px;
font-size: 14px;
border: 3px solid #fff;
.left{
text-align: center;
.left-text{
font-size: 16px;
font-weight: 500;
}
}
.right{
.right-text{
padding-top: 8px;
}
.overfllowhind{
max-width: 100%;
word-break:keep-all;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.dee-form2 {
margin-top: 6px;
.el-form-item {
margin-bottom: 0 !important;
}
}
}
.resourceTable-wrap {
height: 100%;
padding: 0 10px;
box-sizing: border-box;
}
.dee-panel {
height: 100% !important;
.el-tabs {
.el-tabs__content {
height: calc(100% - 30px) !important;
}
}
}
.color {
&.Not {
background-color: #cccccc;
}
&.Yes {
background-color: #59c4e6;
}
&.Delivery {
background-color: #e87c25;
}
&.Run {
background-color: #fcce10;
}
&.Finish {
background-color: #97b552;
}
&.Paused {
background-color: #8a7ca8;
}
&.Reserved {
background-color: #c1232b;
}
&.Issued {
background-color: #bd0b9f;
}
&.TF_ZF {
background-color: #666;
}
&.New {
background-color: #97b552;
}
}
.gantt-bar {
height: calc(100% - 208px);
.gantt {
height: 100%;
}
&.no-header {
height: calc(100% - 50px);
}
}
.search-bar {
height: 40px;
.legnd {
display: flex;
> div {
align-items: center;
margin-left: 8px;
display: flex;
cursor: pointer;
flex-direction: column;
> div:first-child {
line-height: 20px;
i {
display: inline-block;
width: 11px;
height: 11px;
margin-right: 6px;
&:hover {
opacity: 0.7;
}
}
span {
display: inline-block;
font-size: 10px;
line-height: 20px;
}
}
.active{
color: #cf9236;
font-weight: 700;
border: 3px solid #cf9236;
div:last-child {
font-size: 10px;
width: 100%;
line-height: 20px;
text-align: center;
}
}
}
.instructions-issued-top{
display: flex;
align-items: center;
.instructions-issued-search {
padding: 10px 8px;
height: 40px;
width: 90%;
}
.station-bar {
.load {
text-align: center;
line-height: 50px;
}
> .top {
display: flex;
margin-bottom: 15px;
> div {
// height: 160px;
flex: 1;
position: relative;
border: 1px solid #ccc;
border-radius: 5px;
max-width: 15.6%;
box-shadow: 1px 1px 5px 5px #eaeaea;
box-sizing: border-box;
&:not(:last-child) {
margin-right: 16px;
}
cursor: pointer;
&:hover {
transform: scale(1.05);
transition: 0.2s linear all;
box-shadow: 1px 1px 5px 5px #d8efff;
> div:first-child {
background-color: green;
}
}
&.cur {
box-shadow: 1px 1px 5px 5px #d8efff;
border: 1px solid #bffaff;
> div:first-child {
background-color: green;
}
}
> div:first-child {
position: absolute;
right: 0;
background-color: #ccc;
padding: 6px 10px;
color: #fff;
max-width: 50%;
min-width: 54px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
font-weight: bold;
font-size: 14px;
}
> div:nth-child(2) {
margin-top: 30px;
height: 100px;
background: url('/icons/stand.png') no-repeat center center;
}
.start-working{
height: 30px;
cursor: pointer;
img{
height: 100%;
};
> div:last-child {
height: 26px;
line-height: 26px;
text-align: center;
font-size: 12px;
box-shadow: 1px -4px 5px -2px #eaeaea;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&.state0 {
background-color: #92d050;
}
&.state1 {
background-color: #f2f79e;
}
&.state2 {
background-color: #f9df73;
}
&.state3 {
background-color: #f4b2a6;
}
}
}
}
}
}
</style>
<template>
<div class="instructions-issued">
<div class="instructions-issued-top">
<el-form :inline="true" :model="searchFormData" class="instructions-issued-search">
<el-col :span="5">
<el-form-item label="站位:">
<el-select v-model="searchFormData.postion" placeholder="站位" @change="changePostion">
<el-option
v-for="(item, i) in postionList"
:key="item.value + i"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="架次:">
<el-select v-model="searchFormData.sorties" placeholder="架次" @change="changeSorties">
<el-option
v-for="(item, i) in sortiesData"
:key="item.value + i"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划结束:">
<el-date-picker
v-model="searchFormData.actualEnd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd 00:00:00"
@change="getTableData"
@clear="getTableData"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="AO(号/名称):">
<el-input v-model="searchFormData.aoName" clearable placeholder="请输入AO(号/名称)" @clear="getTableData" @keyup.enter.native="getTableData" />
</el-form-item>
</el-col>
</el-form>
<span class="start-working">
<img :src="wordImgUrl" alt="" :title="title" @click="startWorking">
</span>
</div>
<split-pane
:min-percent="18"
:default-percent="defaultPercent"
split="vertical"
class="detail-pane"
>
<template slot="paneL">
<dee-tab :tabs="tabItems" @tabClick="tabClick">
<div slot="0" style="height:100%;box-sizing:border-box">
<dee-up-table
selection-row
:index-row="indexRow"
:columns="columns"
:data="tableData"
:pagination="pagination"
@pagination-current-change="paginationCurrentChange"
@pagination-size-change="handleSizeChange"
@selection-change="selectionChange"
>
<dee-tools slot="header" :tools="tools" mode="normal" />
</dee-up-table>
</div>
<div slot="1" style="height:100%;box-sizing:border-box">
<dee-as-com
ref="detailComAlready"
:key="layConfigAlready.typeName"
:lay-config="layConfigAlready"
:form="searchFormData"
/>
</div>
</dee-tab>
</template>
<template slot="paneR">
<div class="sub-title" style="margin:0 10px">
下发班组
</div>
<!-- <el-select v-model="group" size="small" placeholder="请选择" style="width:86%;margin:10px" filterable @change="changeGroup">
<el-option
v-for="item in groupDropList"
:key="item.id"
:label="item.resName"
:value="item.id"
/>
</el-select> -->
<div class="group-list">
<div v-for="(item, index) in groupDropList" :key="index" class="group-list-box" :class="{'active': group===item.id}" @click="changeGroup(item)">
<div class="left">
<div class="left-text"> {{ item.resName }}</div>
</div>
<div class="right">
<div class="right-text"><span>操作工人数:</span><span>{{ item.userCount }}</span></div>
<div class="right-text"><span>未完成任务:</span><span>{{ item.notFinishCount }}</span></div>
<div class="right-text"><span>未完成工时:</span><span>{{ item.notFinishWork }}(h)</span></div>
<div class="right-text"><span>当月完成任务:</span><span>{{ item.finishCount }}</span></div>
<div class="right-text"><span>当月完成工时:</span><span>{{ item.finishWork }}(h)</span></div>
<el-tooltip placement="top">
<div v-if="item.extProcessSkillUsers" slot="content">
<span v-for="user in item.extProcessSkillUsers" :key="user.id">
{{ user.dxUserInfo.name }}
</span>
</div>
<div v-if="item.extProcessSkillUsers" class="right-text overfllowhind">
<span>班组长:</span>
<span v-for="user in item.extProcessSkillUsers" :key="user.id">
{{ user.dxUserInfo.name }}
</span>
</div>
</el-tooltip>
</div>
</div>
<div class="more-bar">
<span v-if="groupDropList.length < groupTotal" class="more" @click="getMoreData">加载更多</span>
<span v-else-if="groupDropList.length===0">暂无数据</span>
<span v-else>已全部加载!</span>
</div>
</div>
</template>
</split-pane>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
data() {
return {
sortiesData: [],
postionList: [],
searchFormData: {
sorties: '',
postion: '',
actualEnd: '',
aoName: ''
},
group: '',
groupType: '',
groupDropList: [],
activeName: 0,
// 开工状态
status: null,
title: '未开工',
wordImgUrl: '/icons/startWork1.png',
defaultPercent: 80,
indexRow: {
title: '序号',
align: 'center',
width: '70'
},
columns: [
{ title: '机型', key: 'extProcessPlan.planeType', align: 'left' },
{ title: '架次', key: 'extProcessPlan.sorties', align: 'left' },
{ title: '站位', key: 'extProcessPlan.positionNumber', align: 'left' },
{ title: '指令号', key: 'extProcessPlan.serialNumber', align: 'left' },
{ title: '指令名称', key: 'extProcessPlan.name', align: 'left' },
{ title: '工时定额', key: 'extProcessPlan.workHour', align: 'left' },
{ title: '工艺员', key: 'extProcessPlan.noteName', align: 'left' },
{ title: '计划开始', key: 'scheduledStart', align: 'left' },
{ title: '计划结束', key: 'scheduledEnd', align: 'left' }
],
tableData: [],
pagination: {
currentPage: 1,
pageSize: 20,
total: 0,
pageSizes: [20, 50, 100]
},
selectionRow: [],
tools: [
{
type: 'icon',
name: '下发',
icon: '/icons/o-Referencedoc.png',
handler: {
click: () => {
if (this.status !== 'New') {
if (this.selectionRow.length <= 0) {
this.$utils.showMessageWarning('该操作至少选择一条数据')
return
}
if (!this.group) {
this.$utils.showMessageWarning('请选择下发班组')
return
}
this.$confirm('您确认执行该操作吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const arr = []
this.selectionRow.map(item => {
arr.push(
{
id: item.id,
operator: 'MODIFY',
planState: 'Issued',
extProcessSkillId: item.skill,
extProcessSkillIdType: item.skillType
}
)
})
post('/JoExecutePlan/recursions', arr)
.then((res) => {
this.$message({
type: 'success',
message: '提交成功!'
})
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
this.getInstructionsIssuedListTo()
})
.catch((err) => console.log(err))
.finally(() => {})
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消'
// })
})
} else {
this.$utils.showMessageWarning('该站位还没开工')
}
}
}
}
],
groupPage: 1,
groupTotal: 0
}
},
computed: {
tabItems() {
return [
{
name: '待下发',
id: '0'
},
{
name: '已下发',
id: '1'
}
]
},
layConfigAlready() {
return {
typeName: 'JoExecutePlan',
layKey: 'instructionsIssuedListAlready'
}
}
},
watch: {
status: {
handler(val) {
if (val === 'New' || val === '') {
this.wordImgUrl = '/icons/startWork1.png'
this.title = '未开工'
} else if (val === 'Run') {
this.wordImgUrl = '/icons/startWork2.png'
this.title = '已开工'
} else {
this.wordImgUrl = '/icons/startWork2.png'
this.title = '已完工'
}
},
deep: true
}
},
created() {
this.getStation()
},
methods: {
getSortiesList() {
this.sortiesData = []
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extPosition.serialNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extPosition',
'searchItems': {
'items': [
{
'fieldName': 'serialNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
}
],
'operator': 'AND'
},
'openProps': [
{
'name': 'extPositionPlans'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
post('/AircraftSorties/search', params).then(res => {
if (res.items && res.items.content) {
this.sortiesData = res.items.content.map(row => {
return {
value: row.defCode,
label: row.defName,
postionId: row.extPosition && row.extPosition.length && row.extPosition[0].extPositionPlans && row.extPosition[0].extPositionPlans[0] ? row.extPosition[0].extPositionPlans[0].id : ''
}
})
this.$set(this.searchFormData, 'sorties', this.sortiesData[0].value)
this.$set(this.searchFormData, 'sortiesName', this.sortiesData[0].label)
this.$set(this.searchFormData, 'workId', this.sortiesData[0].postionId)
// this.$set(this, 'status', this.sortiesData[0].status)
// this.status = res.items.content[0].extPosition[0].extPositionPlans[0].planState
this.getWorkStatus()
this.getTableData()
}
})
},
getStation() {
this.postionList = []
this.$set(this.searchFormData, 'postion', '')
const userId = localStorage.getItem('userId') || ''
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'targetId',
'operator': 'EQ',
'value': userId
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'source'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
post('/ExtPositionUserLink/search', params).then(res => {
if (res.items && res.items.content) {
this.postionList = res.items.content.map(row => {
return {
value: row.source.extname,
label: row.source.extcode,
id: row.source.id
}
})
if (this.postionList.length > 0) {
this.$set(this.searchFormData, 'postion', this.postionList[0].value)
this.$set(this.searchFormData, 'postionName', this.postionList[0].label)
this.$set(this.searchFormData, 'postionId', this.postionList[0].id)
this.getSortiesList()
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
}
}
})
},
changePostion() {
const postion = this.postionList.find(r => r.value === this.searchFormData.postion)
this.$set(this.searchFormData, 'postionName', postion && postion.label || '')
this.$set(this.searchFormData, 'postionId', postion && postion.id || '')
this.getSortiesList()
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
},
changeSorties() {
const sorties = this.sortiesData.find(r => r.value === this.searchFormData.sorties)
this.$set(this.searchFormData, 'sortiesName', sorties && sorties.label || '')
this.$set(this.searchFormData, 'workId', sorties && sorties.postionId || '')
this.getWorkStatus()
// this.status = sorties.status
this.getTableData()
},
getWorkStatus() {
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'aircraftSorties.defCode',
'operator': 'EQ',
'value': this.searchFormData.sortiesName
},
{
'fieldName': 'extPosition.serialNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': []
}
this.$api.searchApi('ExtPositionPlan', params).then(res => {
if (res.items.content) {
if (res.items.content.length > 0) {
this.status = res.items.content[0].planState
} else {
this.status = ''
}
}
})
},
tabClick(tab) {
this.searchFormData.aoName = ''
this.searchFormData.actualEnd = ''
this.activeName = tab.index
this.groupPage = 1
this.groupTotal = 0
this.groupDropList = []
this.getGroupList()
if (this.activeName === '1') {
this.defaultPercent = 100
} else {
this.defaultPercent = 80
}
this.getTableData()
},
getTableData() {
if (this.activeName === '1') {
if (this.$refs.detailComAlready) {
this.$refs.detailComAlready.$children[0].getData()
}
} else {
this.getInstructionsIssuedListTo()
}
},
getInstructionsIssuedListTo() {
const params = {
'pageFrom': this.pagination.currentPage,
'pageSize': this.pagination.pageSize,
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extProcessPlan.sorties',
'operator': 'EQ',
'value': this.searchFormData.sortiesName
},
{
'fieldName': 'extProcessPlan.positionNumber',
'operator': 'EQ',
'value': this.searchFormData.postionName
},
{
'fieldName': 'planState',
'operator': 'EQ',
'value': 'Yes'
}
],
'operator': 'AND'
},
{
'items': [
{
'fieldName': 'extProcessPlan.serialNumber',
'operator': 'LIKE',
'value': this.searchFormData.aoName
},
{
'fieldName': 'extProcessPlan.name',
'operator': 'LIKE',
'value': this.searchFormData.aoName
}
],
'operator': 'OR'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extProcessPlan',
'openProps': [
{
'name': 'extSupportings'
}
]
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
if (this.searchFormData.actualEnd && this.searchFormData.actualEnd.length > 0) {
params.searchItems.children[0].items.push({
'fieldName': 'scheduledEnd',
'operator': 'BTWN',
'value': this.searchFormData.actualEnd[0],
'value1': this.searchFormData.actualEnd[1]
})
}
post('/JoExecutePlan/getProductionPrepare', params).then(res => {
if (res.items && res.items.content) {
this.tableData = res.items.content
// this.$set(this, 'group', res.items[0] && res.items[0].id || '')
}
})
},
paginationCurrentChange(currentPage) {
this.pagination.currentPage = currentPage
this.getInstructionsIssuedListTo()
},
handleSizeChange(pageSize) {
this.pagination.pageSize = pageSize
this.pagination.currentPage = 1
this.getInstructionsIssuedListTo()
},
selectionChange(val) {
val.forEach(element => {
element.skill = this.group
element.skillType = this.groupType
})
this.selectionRow = val
},
changeGroup(val) {
this.$set(this, 'group', val.id || '')
this.$set(this, 'groupType', val.subTypeName || '')
if (this.selectionRow.length > 0) {
this.selectionRow.forEach(element => {
element.skill = this.group
element.skillType = this.groupType
})
}
},
getGroupList() {
const params = {
'pageFrom': this.groupPage,
'pageSize': 10,
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extStandPositionId',
'operator': 'EQ',
'value': this.searchFormData.postionId
},
{
'fieldName': 'isValid',
'operator': 'EQ',
'value': 'Y'
},
{
'fieldName': 'skillType',
'operator': 'EQ',
'value': 'FitOut'
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extProcessSkillUsers',
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'isSkillLeader',
'operator': 'EQ',
'value': true
}
],
'operator': 'AND'
}
]
}
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
],
'toValidateKeys': ''
}
post('/ExtProcessSkill/getSkillWorkDetail', params).then(res => {
if (res.items && res.items.content) {
this.groupDropList = res.items.content
this.groupTotal = res.items.totalElements
// this.$set(this, 'group', res.items.content[0] && res.items.content[0].id || '')
// this.$set(this, 'groupType', res.items.content[0] && res.items.content[0].subTypeName || '')
}
})
},
getMoreData() {
const num = Math.ceil(this.groupTotal / 10)
if (this.groupPage <= num) {
this.groupPage++
this.getGroupList()
}
},
getHandledValue(num) {
return num < 10 ? '0' + num : num
},
formatTime() {
const d = new Date()
const year = d.getFullYear()
const month = this.getHandledValue(d.getMonth() + 1)
const date = this.getHandledValue(d.getDate())
const hours = this.getHandledValue(d.getHours())
const minutes = this.getHandledValue(d.getMinutes())
const second = this.getHandledValue(d.getSeconds())
let resStr = ''
resStr = year + '-' + month + '-' + date + ' ' + hours + ':' + minutes + ':' + second
return resStr
},
startWorking() {
if (this.status !== 'New') {
if (this.status === 'Run') {
this.$utils.showMessageWarning('该站位己开工')
return
}
if (this.postionList.length === 0) {
this.$utils.showMessageWarning('没有站位')
return
}
if (this.status === '') {
this.$utils.showMessageWarning('该站位下没有生成计划')
return
}
// this.$utils.showMessageWarning('该站位不能开工')
return
}
const params = {
'operator': 'MODIFY',
'id': this.searchFormData.workId,
'planState': 'Run',
'extResPositionPlans': [
{
'operator': 'ADD',
'isValid': 'Y',
'actualStart': this.formatTime()
}
]
}
this.$confirm('是否开工', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
post('/ExtPositionPlan/recursion', params)
.then((res) => {
this.$message({
type: 'success',
message: '开工成功!'
})
this.status = res.items.planState
this.getTableData()
})
.catch((err) => console.log(err))
.finally(() => {})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
}
}
}
</script>
<style lang="scss">
.instructions-issued{
background: #ffff;
height: 100%;
.group-list{
height: calc(100% - 100px);
overflow-y: scroll;
margin-bottom: 20px;
.more-bar {
margin: 10px auto;
text-align: center;
font-size: 12px;
color: #999;
.more {
margin: auto;
margin-top: 20px;
height: 26px;
line-height: 26px;
padding: 0 20px;
background: #cf9236;
border-radius: 13px;
display: inline-block;
cursor: pointer;
}
}
.group-list-box{
box-sizing: border-box;
background: url("/images/tasks.png") no-repeat;
background-size: 100% 100%;
padding: 10px;
margin: 10px 20px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 10px;
font-size: 14px;
border: 3px solid #fff;
.left{
text-align: center;
.left-text{
font-size: 16px;
font-weight: 500;
}
}
.right{
.right-text{
padding-top: 8px;
}
.overfllowhind{
max-width: 100%;
word-break:keep-all;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
}
}
.active{
color: #cf9236;
font-weight: 700;
border: 3px solid #cf9236;
}
}
.instructions-issued-top{
display: flex;
align-items: center;
.instructions-issued-search {
padding: 10px 8px;
height: 40px;
width: 90%;
}
.start-working{
height: 30px;
cursor: pointer;
img{
height: 100%;
};
}
}
}
</style>
......@@ -59,6 +59,7 @@
ref="detailCom"
:key="layConfig.typeName"
:lay-config="layConfig"
table-height="calc(100vh - 200px)"
@row-click="rowClick"
/>
</div>
......@@ -67,6 +68,7 @@
ref="detailCom2"
:key="layConfig.typeName"
:lay-config="layConfig1"
table-height="calc(100vh - 200px)"
@row-click="rowClick"
/>
</div>
......
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