Commit 4fe8989a authored by jingnan's avatar jingnan 👀

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

parents 9f623d86 352c1cb5
...@@ -1549,6 +1549,21 @@ export function fileByIdDownload(objName, objId, linkId) { ...@@ -1549,6 +1549,21 @@ export function fileByIdDownload(objName, objId, linkId) {
this.downLoadFile(res) this.downLoadFile(res)
}) })
} }
/**
* @Description: 查找DeeForm
* @author xioln
*/
export function findForm(elem = this) {
// 检查当前元素是否是 el-form
if (elem.$el && elem.$el.classList.contains('el-form')) {
return elem // 找到了 el-form,返回当前
}
// 检查是否存在父组件
if (elem.$parent) {
return findForm(elem.$parent) // 递归调用父组件
}
return null // 没有找到 el-form,返回 null
}
export default { export default {
treeFindBackArray, treeFindBackArray,
...@@ -1631,5 +1646,6 @@ export default { ...@@ -1631,5 +1646,6 @@ export default {
groupBy, groupBy,
filterParams, filterParams,
deepClone, deepClone,
fileByIdDownload fileByIdDownload,
findForm
} }
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<div class="AddOutStorageMaterialDetailDialog-diloag"> <div class="AddOutStorageMaterialDetailDialog-diloag">
<dee-as-com <dee-as-com
ref="materielSearch" ref="materielSearch"
:lay-config="{ typeName: 'Inventory', layKey: 'search_sanqichukuwuliaomingxi'}" :lay-config="{ typeName: 'Inventory', layKey: 'search_sanqichukuwuliaomingxi' }"
:basic-data="defaultData" :basic-data="defaultData"
@searchEvent="searchEvent" @searchEvent="searchEvent"
/> />
<dee-as-com <dee-as-com
ref="materielTable" ref="materielTable"
class="list-table" class="list-table"
:lay-config="{ typeName: 'Inventory', layKey: 'table_sanqichukuwuliaomingxi'}" :lay-config="{ typeName: 'Inventory', layKey: 'table_sanqichukuwuliaomingxi' }"
@selectionChange="selectionChange" @selectionChange="selectionChange"
/> />
<div slot="footer" class="foot-btn-box"> <div slot="footer" class="foot-btn-box">
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
props: { props: {
basicData: { basicData: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
data() { data() {
...@@ -126,16 +126,16 @@ export default { ...@@ -126,16 +126,16 @@ export default {
} }
</script> </script>
<style lang='scss'> <style lang='scss'>
.AddOutStorageMaterialDetailDialog-diloag{ .AddOutStorageMaterialDetailDialog-diloag {
.list-table{ .list-table {
height: 510px!important; height: 510px !important;
} }
.foot-btn-box{
display: flex;
margin-top: 10px;
justify-content: center;
align-content: center;
}
}
.foot-btn-box {
display: flex;
margin-top: 10px;
justify-content: center;
align-content: center;
}
}
</style> </style>
...@@ -51,8 +51,8 @@ export default { ...@@ -51,8 +51,8 @@ export default {
'form.sorties': { 'form.sorties': {
immediate: true, immediate: true,
deep: true, deep: true,
handler(val) { handler(val, oldVal) {
if (val) { if (val !== oldVal) {
const params = { const params = {
searchItems: { searchItems: {
items: [ items: [
......
/**
* @Description: 供外出库调整占用申领数量
* @author xioln
* @date 2023-08-02
*/
<template>
<div class="outStorageAdjustOccupy-reqAmount">
<el-input-number v-model="reqAmount" :min="0" :max="maxNum" @change="handleChange" />
</div>
</template>
<script>
export default {
componentName: '供外出库调整占用申领数量',
name: 'OutStorageCallBackReqAmount',
components: {},
props: {
form: {
type: Object,
default: () => {}
},
value: {
type: Number,
default: 0
}
},
data() {
return {
reqAmount: 0,
maxNum: 0
}
},
computed: {},
created() {
// 初始化数据
if (this.value !== '0') {
this.reqAmount = Number(this.value)
}
if (this.form.reqAmount) {
this.maxNum = this.form.reqAmount
} else {
this.maxNum = 10
}
},
methods: {
handleChange() {
this.$emit('input', this.reqAmount)
}
}
}
</script>
<style lang='scss'>
</style>
/**
* @Description: 供外出库调整占用
* @author xioln
* @date 2023-08-23
* @FilePath: applications/dee-mes/src/privateComponents/components/OutStorageOfferAdjustOccupy/index.vue
*/
<template>
<div class="OutStorageOfferAdjustOccupy">
<DeeAsCom
ref="adjustOccupyInfo"
:basic-data="basicData"
:lay-config="{
typeName: 'OutStorageOutItem',
layKey: 'adjustOccupyTable'
}"
/>
<DeeAsCom
ref="adjustOccupyInventory"
:basic-data="basicData"
:lay-config="{
typeName: 'JobResponseOutStorageOut',
layKey: 'table'
}"
/>
</div>
</template>
<script>
export default {
componentName: '供外出库调整占用',
name: 'OutStorageOfferAdjustOccupy', // name写在组件的最前方,自定义组件为必填
components: {},
data() {
return {
}
},
computed: {},
created() {
// 初始化数据
},
methods: {
}
}
</script>
<style lang='scss'>
</style>
/**
* @Description: 供外出库调整占用
* @author xioln
* @date 2023-08-23
*/
<template>
<div class="outStorageOffer-adjustOccupy">
<DeeAsCom
ref="adjustOccupyInfo"
:basic-data="selectDatas[0]"
:form="form"
:lay-config="{
typeName: 'Inventory',
layKey: 'adjustOccupyTable'
}"
@selectionChange="infoSelectionChange"
/>
<div style="height: 80px; text-align: center;display: flex;justify-content: center;align-items: center;">
<el-button type="primary" size="medium" round icon="el-icon-caret-top" @click="relieve">解除</el-button>
<el-button type="primary" round icon="el-icon-caret-bottom" @click="occupy">占用</el-button>
</div>
<DeeAsCom
ref="adjustOccupyjobResponse"
:basic-data="selectDatas[0]"
:lay-config="{
typeName: 'JobResponseOutStorageOut',
layKey: 'table',
}"
@selectionChange="jobResponseSelectionChange"
/>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
componentName: '供外出库调整占用',
name: 'OutStorageOfferAdjustOccupy', // name写在组件的最前方,自定义组件为必填
components: {},
props: {
// basicData: {
// type: Object,
// default: () => { }
// },
selectDatas: {
type: Array,
default: () => {}
},
form: {
type: Object,
default: () => {}
}
},
data() {
return {
infoSelection: [],
jobResponseSelection: []
}
},
computed: {},
created() {
// 初始化数据
},
methods: {
infoSelectionChange(v) {
this.infoSelection = v
},
jobResponseSelectionChange(v) {
this.jobResponseSelection = v
},
// 解除占用
relieve() {
if (this.jobResponseSelection.length === 0) {
return this.$utils.showMessageWarning('请选择响应数据!')
}
const ids = this.jobResponseSelection.map(item => item.id).join(',')
post('InStorageRequestItem/adjust/cancelTake?jobResponseIds=' + ids).then(res => {
this.$utils.showMessageSuccess('解除占用成功!')
this.refeach()
}).catch((err) => {
console.log(err)
})
},
// 手动占用
occupy() {
const param = this.infoSelection.map(item => {
if (item.allocatedAmount === 0 || !item.hasOwnProperty('allocatedAmount')) {
return this.$utils.showMessageWarning('请输入分配数量!')
} else {
return {
inventoryId: item.id,
allocatedAmount: item.allocatedAmount
}
}
})
console.log('param', param)
if (!param.includes(undefined)) {
post('InStorageRequestItem/adjust/reTake?itemId=' + this.selectDatas[0].id, param).then(res => {
this.$utils.showMessageSuccess('占用成功!')
this.refeach()
}).catch((err) => {
console.log(err)
})
}
},
refeach() {
this.$refs.adjustOccupyInfo.$refs.asCom.getData()
this.$refs.adjustOccupyjobResponse.$refs.asCom.getData()
}
}
}
</script>
<style lang='scss'>
.outStorageOffer-adjustOccupy{
}
</style>
...@@ -15,23 +15,31 @@ ...@@ -15,23 +15,31 @@
> >
<dee-tools slot="header" :tools="tools" mode="normal" :collapse="false" /> <dee-tools slot="header" :tools="tools" mode="normal" :collapse="false" />
</dee-table> </dee-table>
<dee-dialog width="70%" title="添加供外出库申请明细" :visible="dialogVisible"> <dee-dialog width="70%" title="添加供外出库申请明细" :visible.sync="dialogVisible" @on-cancel="cancel">
<addOutStorageOfferDetailDialog ref="addOffer" :basic-data="form" @submitEvent="addData" @cancel="cancel" /> <addOutStorageOfferDetailDialog ref="addOffer" :basic-data="form" @submitEvent="addData" />
</dee-dialog>
<dee-dialog width="70%" title="调整占用" :visible.sync="aoDialogVisible" @on-cancel="aoCancel">
<OutStorageOfferAdjustOccupy ref="adjustOffer" :select-datas="selectTableData" :form="form" @submitEvent="addData" />
</dee-dialog> </dee-dialog>
</div> </div>
</template> </template>
<script> <script>
import AddOutStorageOfferDetailDialog from './components/addOutStorageOfferDetailDialog' import AddOutStorageOfferDetailDialog from './components/addOutStorageOfferDetailDialog'
import OutStorageOfferAdjustOccupy from './components/outStorageOfferAdjustOccupy'
import { post } from '@/utils/http' import { post } from '@/utils/http'
export default { export default {
componentName: '供外出库申请明细', componentName: '供外出库申请明细',
name: 'OutStorageOfferDetail', name: 'OutStorageOfferDetail',
components: { AddOutStorageOfferDetailDialog }, components: { AddOutStorageOfferDetailDialog, OutStorageOfferAdjustOccupy },
props: { props: {
form: { form: {
type: Object, type: Object,
required: true required: true
},
basicData: {
type: Object,
required: true
} }
}, },
data() { data() {
...@@ -44,7 +52,7 @@ export default { ...@@ -44,7 +52,7 @@ export default {
{ title: '规格', key: 'extMaterial.spec', align: 'center' }, { title: '规格', key: 'extMaterial.spec', align: 'center' },
{ title: '单位名称', key: 'extMaterial.extUnit.unitName', align: 'center' }, { title: '单位名称', key: 'extMaterial.extUnit.unitName', align: 'center' },
{ {
title: '申领数量', key: 'reqAmount', align: 'center', minWidth: '120', title: '申领数量', key: 'reqAmount', align: 'center', minWidth: '160', fixed: 'right',
component: { component: {
show: true, show: true,
render: (h, data, column, index) => { render: (h, data, column, index) => {
...@@ -71,11 +79,17 @@ export default { ...@@ -71,11 +79,17 @@ export default {
icon: '/icons/c-add.png', icon: '/icons/c-add.png',
handler: { handler: {
click: () => { click: () => {
if (!this.form.extWorkCenterId) { this.$utils.findForm(this).validate((isok) => {
this.$utils.showMessageWarning('请先选择库房!') if (isok) {
return if (!this.form.extWorkCenterId) {
} this.$utils.showMessageWarning('请先选择库房!')
this.dialogVisible = true return
}
this.dialogVisible = true
} else {
this.$utils.showMessageWarning('请填写基本信息!')
}
})
} }
} }
}, },
...@@ -84,7 +98,33 @@ export default { ...@@ -84,7 +98,33 @@ export default {
icon: '/icons/c-creatBook.png', icon: '/icons/c-creatBook.png',
handler: { handler: {
click: () => { click: () => {
this.occupy() this.$utils.findForm(this).validate((isok) => {
if (isok) {
// 校验通过
this.occupy()
} else {
this.$utils.showMessageWarning('请填写基本信息!')
}
})
}
}
},
{
name: '调整占用',
icon: '/icons/c-newchangeapp.png',
handler: {
click: () => {
if (this.selectTableData.length === 1) {
if (this.selectTableData[0].hasOwnProperty('id')) {
this.aoDialogVisible = true
} else {
this.$utils.showMessageWarning('请先保存占用!')
}
} else if (this.selectTableData.length > 1) {
this.$utils.showMessageWarning('只能勾选一条明细!')
} else {
this.$utils.showMessageWarning('请先选择要调整的明细!')
}
} }
} }
}, },
...@@ -97,7 +137,9 @@ export default { ...@@ -97,7 +137,9 @@ export default {
} }
} }
}], }],
param: {} param: {},
aoDialogVisible: false,
selectTableData: []
} }
}, },
computed: { computed: {
...@@ -115,8 +157,8 @@ export default { ...@@ -115,8 +157,8 @@ export default {
// 初始化数据 // 初始化数据
}, },
mounted() { mounted() {
if (this.$route.query.id) { if (this.basicData.id) {
this.getEditData(this.$route.query.id) this.getEditData()
} }
}, },
methods: { methods: {
...@@ -131,11 +173,13 @@ export default { ...@@ -131,11 +173,13 @@ export default {
cancel() { cancel() {
this.dialogVisible = false this.dialogVisible = false
}, },
aoCancel() {
this.aoDialogVisible = false
},
occupy() { occupy() {
const form = { ...this.form } const form = { ...this.form }
form.aircraftType = form.aircraftType.split('+')[1] form.aircraftType = form.aircraftType.split('+')[1]
form.sorties = form.sorties.split('+')[1] form.sorties = form.sorties.split('+')[1]
const param = { const param = {
...form, ...form,
inStorageRequestItems: this.tableData, inStorageRequestItems: this.tableData,
...@@ -143,7 +187,7 @@ export default { ...@@ -143,7 +187,7 @@ export default {
operator: 'ADD' operator: 'ADD'
} }
post('OutStorageRequest/outStorageOut/saveAndTake', param).then(res => { post('OutStorageRequest/outStorageOut/saveAndTake', param).then(res => {
console.log('res', res) this.$utils.showMessageSuccess('占用成功!')
const data = res.items.inStorageRequestItems const data = res.items.inStorageRequestItems
const tableData = [...this.tableData] const tableData = [...this.tableData]
data.forEach(item => { data.forEach(item => {
...@@ -183,45 +227,46 @@ export default { ...@@ -183,45 +227,46 @@ export default {
}) })
}) })
}, },
getEditData(id) { getEditData() {
const param = { this.tableData.push(...this.basicData.inStorageRequestItems)
'searchItems': { // const param = {
'items': [ // 'searchItems': {
{ 'fieldName': 'subTypeName', 'operator': 'EQ', 'value': 'OutStorageOut' }, // 'items': [
{ 'fieldName': 'id', 'operator': 'EQ', 'value': id } // { 'fieldName': 'subTypeName', 'operator': 'EQ', 'value': 'OutStorageOut' },
] // { 'fieldName': 'id', 'operator': 'EQ', 'value': id }
}, // ]
openProps: [{ // },
'name': 'inStorageRequestItems', // openProps: [{
'openProps': [{ // 'name': 'inStorageRequestItems',
'name': 'extMaterial', // 'openProps': [{
'openProps': [{ // 'name': 'extMaterial',
'name': 'resType2' // 'openProps': [{
}, { // 'name': 'resType2'
'name': 'extUnit' // }, {
}] // 'name': 'extUnit'
}, { // }]
'name': 'extDxSipplier' // }, {
}, { // 'name': 'extDxSipplier'
'name': 'creator' // }, {
}, { // 'name': 'creator'
'name': 'storageZone' // }, {
}, // 'name': 'storageZone'
{ // },
'name': 'inventoryJobResponses' // {
}] // 'name': 'inventoryJobResponses'
}] // }]
} // }]
post('OutStorageRequest/search', param).then(res => { // }
console.log('res', res) // post('OutStorageRequest/search', param).then(res => {
const data = res.items.content[0].inStorageRequestItems // console.log('res', res)
data.forEach(item => { // const data = res.items.content[0].inStorageRequestItems
item.allocatedAmount = this.sumArray(item.inventoryJobResponses, 'allocatedAmount') // data.forEach(item => {
}) // item.allocatedAmount = this.sumArray(item.inventoryJobResponses, 'allocatedAmount')
this.tableData = data // })
}).catch((err) => { // this.tableData = data
console.log(err) // }).catch((err) => {
}) // console.log(err)
// })
}, },
sumArray(array, key) { sumArray(array, key) {
let sum = 0 let sum = 0
......
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
} }
} }
}, },
form: { 'form.extProductAreaId': {
immediate: true, immediate: true,
deep: true, deep: true,
handler() { handler() {
......
...@@ -52,8 +52,8 @@ export default { ...@@ -52,8 +52,8 @@ export default {
'form.aircraftType': { 'form.aircraftType': {
immediate: true, immediate: true,
deep: true, deep: true,
handler(val) { handler(val, oldVal) {
if (val) { if (val !== oldVal) {
const params = { const params = {
searchItems: { searchItems: {
items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.split('+')[0] }], items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.split('+')[0] }],
......
...@@ -182,13 +182,13 @@ export default { ...@@ -182,13 +182,13 @@ export default {
ganttStm.attachEvent('onLinkDblClick', function(id, e) { ganttStm.attachEvent('onLinkDblClick', function(id, e) {
return false return false
}) })
ganttStm.attachEvent('onAfterTaskUpdate', function(id, item) { // ganttStm.attachEvent('onAfterTaskUpdate', function(id, item) {
// var data = { // var data = {
// id: item.tooltipId, // id: item.tooltipId,
// scheduledStart: that.formatDate(item.start_date) // scheduledStart: that.formatDate(item.start_date)
// } // }
// that.updatePlanTime(data) // that.updatePlanTime(data)
}) // })
// 当分支被打开时触发 // 当分支被打开时触发
ganttStm.attachEvent('onTaskOpened', function(id) { ganttStm.attachEvent('onTaskOpened', function(id) {
that.openTree.push(Number(id)) that.openTree.push(Number(id))
...@@ -355,6 +355,7 @@ export default { ...@@ -355,6 +355,7 @@ export default {
ganttStm.config.drag_links = false ganttStm.config.drag_links = false
ganttStm.config.details_on_dblclick = false ganttStm.config.details_on_dblclick = false
ganttStm.config.show_task_cells = true ganttStm.config.show_task_cells = true
ganttStm.config.readonly = true
// ganttStm.config.auto_scheduling = true // ganttStm.config.auto_scheduling = true
// ganttStm.config.auto_scheduling_initial = false // ganttStm.config.auto_scheduling_initial = false
ganttStm.config.open_split_tasks = true ganttStm.config.open_split_tasks = true
......
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
id: item.tooltipId, id: item.tooltipId,
scheduledStart: that.formatDate(item.start_date) scheduledStart: that.formatDate(item.start_date)
} }
that.updatePlanTime(data) that.updatePlanTime(data, item)
}) })
// 当分支被打开时触发 // 当分支被打开时触发
ganttStm.attachEvent('onTaskOpened', function(id) { ganttStm.attachEvent('onTaskOpened', function(id) {
...@@ -568,37 +568,34 @@ export default { ...@@ -568,37 +568,34 @@ export default {
/** /**
* 修改工期及开工时间 * 修改工期及开工时间
*/ */
updatePlanTime(item) { updatePlanTime(data, item) {
// const that = this const that = this
// that.loading = true that.loading = true
// const param = { const params = {
// // maxTime: that.getLongTime(), scheduledStart: data.scheduledStart,
// // minTime: _min_date, wrProductionId: item.$rendered_parent,
// minTime: that.start_date, joId: data.id
// parentId: that.$parent.platformId, }
// wrProduction: [item] post(`/JoExecutePlan/updatePlanTime`, params)
// } .then((res) => {
// // return tooltipData if (res.message.includes('成功')) {
// this.HttpRequest(`/WrProduction/updatePlanTime`, param, 'post', true) this.$message({
// .then((res) => { showClose: true,
// if (res.message.includes('成功')) { message: '修改成功!',
// this.$message({ type: 'success'
// showClose: true, })
// message: '修改成功!', } else {
// type: 'success' this.$message({
// }) showClose: true,
// } else { message: res.message,
// this.$message({ type: 'error'
// showClose: true, })
// message: res.message, }
// type: 'error' })
// }) .catch((err) => console.error(err))
// } .finally(() => {
// }) that.getData()
// .catch((err) => console.error(err)) })
// .finally(() => {
// that.getGanttData()
// })
} }
} }
} }
......
<template> <template>
<div class="show-page-com stationPlan-maintenance-page"> <div class="show-page-com stationPlan-maintenance-page">
<searchBar :state-options="stateOptions" @showStation="showStation" @search="search" /> <dee-tab :tabs="tabItems" :show-swipe="false" :is-detail="false">
<station v-show="headerShow" :state-options="stateOptions" :sorties-id="sortiesId" :form="form" @change="change" /> <div slot="0" style="height:100%;box-sizing:border-box">
<gantt :form="form" :state-options="stateOptions" :class="[headerShow?'gantt-bar':'gantt-bar no-header']" /> 列表
</div>
<div slot="1" style="height:100%;box-sizing:border-box">
<searchBar :state-options="stateOptions" @showStation="showStation" @search="search" />
<station v-show="headerShow" :state-options="stateOptions" :sorties-id="sortiesId" :form="form" @change="change" />
<gantt :form="form" :state-options="stateOptions" :class="[headerShow?'gantt-bar':'gantt-bar no-header']" />
</div>
</dee-tab>
</div> </div>
</template> </template>
...@@ -22,7 +29,20 @@ export default { ...@@ -22,7 +29,20 @@ export default {
headerShow: true headerShow: true
} }
}, },
computed: {
tabItems() {
return [
{
name: '列表',
id: '0'
},
{
name: '甘特图',
id: '1'
}
]
}
},
mounted() { mounted() {
this.getStateOptions() this.getStateOptions()
}, },
...@@ -57,6 +77,12 @@ export default { ...@@ -57,6 +77,12 @@ export default {
height: calc(100% - 20px); height: calc(100% - 20px);
width: calc(100% - 24px); width: calc(100% - 24px);
background-color: #fff; background-color: #fff;
.dee-panel{
height: 100%;
}
.el-tab-pane{
height: calc(100% - 10px);
}
.color{ .color{
&.Not{ &.Not{
background-color: #cccccc; background-color: #cccccc;
......
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
}, },
data() { data() {
return { return {
headerShow: true, headerShow: false,
modelData: [], modelData: [],
sortiesData: [], sortiesData: [],
SoriteTypeOptions: [], SoriteTypeOptions: [],
...@@ -123,6 +123,7 @@ export default { ...@@ -123,6 +123,7 @@ export default {
} }
}, },
created() { // SoriteType created() { // SoriteType
this.$emit('showStation', this.headerShow)
this.$utils.getDicListByCode('SoriteType').then(res => { this.$utils.getDicListByCode('SoriteType').then(res => {
this.SoriteTypeOptions = res this.SoriteTypeOptions = res
this.getModelData() this.getModelData()
...@@ -183,7 +184,13 @@ export default { ...@@ -183,7 +184,13 @@ export default {
}, 500) }, 500)
}, },
goto() { goto() {
this.$router.push({
path: '/dee-mes/assembly-plan-maintenance',
query: {
title: '装配计划维护',
menuRootAppId: 1626782294437
}
})
} }
} }
} }
......
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