Commit 4b8e5378 authored by arvin's avatar arvin

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

parents ce948e14 60e670a3
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -27,7 +27,7 @@ export default {
name: 'CommonProcessHistory',
displayName: '流程历史记录',
modelRelationObjs: ['DxDocument', 'DxPart', 'DxBaseline', 'DxAbstractChangeIssue',
'DxChangeItem', 'DxProcessExecutor', 'ExtECM', 'DxCADDocument', 'Contract'],
'DxChangeItem', 'DxProcessExecutor', 'ExtECM', 'DxCADDocument', 'Contract', 'OutStorageRequest'],
props: {
basicData: {
type: Object,
......
/**
* @Description: 新增表单
* @author xioln
* @date 2023-06-16
* @FilePath: applications/dee-mes/src/privateComponents/components/addDisplayForm/index.vue
*/
<template>
<div class="className" />
</template>
<script>
export default {
name: '', // name写在组件的最前方,自定义组件为必填
components: {},
data() {
return {
}
},
computed: {},
created() {
// 初始化数据
},
methods: {
}
}
</script>
<style lang='scss'>
</style>
/**
* @Description: 召回出库添加明细
* @author xioln
* @date 2023-08-01
* @FilePath: applications/dee-mes/src/privateComponents/components/AddOutStorageCallbackDetailDialog/index.vue
*/
<template>
<div class="addOutStorageCallbackDetail-dialog">
<dee-as-com
ref="materielSearch"
:lay-config="{ typeName: 'Inventory', layKey: 'search_sanqichukuwuliaomingxi' }"
:basic-data="defaultData"
@searchEvent="searchEvent"
/>
<dee-as-com
ref="materielTable"
class="list-table"
:lay-config="{ typeName: 'Inventory', layKey: 'table_sanqichukuwuliaomingxi' }"
@selectionChange="selectionChange"
/>
<div slot="footer" class="foot-btn-box">
<el-button type="primary" @click="submitEvent">确认</el-button>
<el-button @click="cancelEvent">取消</el-button>
</div>
</div>
</template>
<script>
export default {
componentName: '添加召回出库物料明细弹框',
name: 'AddOutStorageCallbackDetailDialog',
props: {
basicData: {
type: Object,
default: () => { }
}
},
data() {
return {
selection: [],
defaultData: {}
}
},
computed: {},
created() {
// 初始化数据
console.log('this.basicData', this.basicData)
},
methods: {
searchEvent(val) {
// const materialType = this.findByNameVnode(this, 'DeeAsForm').form.materialType
val.items.push({ fieldName: 'subTypeName', operator: 'EQ', value: 'Inventory' }/*, { fieldName: 'inventory.materialType', operator: 'EQ', value: materialType }*/)
val.items.push({ fieldName: 'status', operator: 'EQ', value: 'disposed' })
val.items.push({ fieldName: 'usableAmount', operator: 'GT', value: 0 })
val.items.push({ fieldName: 'disposeDes', operator: 'LIKE', value: '返厂' })
const extWorkCenterName = this.basicData.extWorkCenteName || (this.basicData.extWorkCeter && this.basicData.extWorkCeter.extname)
if (extWorkCenterName) {
val.items.push({ fieldName: 'workcenter', operator: 'EQ', value: extWorkCenterName })
}
const el = this.$refs['materielTable']
el.$refs.asCom.getData(val.items, val.items)
},
selectionChange(val) {
this.selection = val
},
submitEvent() {
console.log('this.basicData', this.basicData)
const selection = this.selection.filter(r => {
if (!this.basicData.inStorageRequestItems) {
return true
}
return !this.basicData.inStorageRequestItems.find(item => r.id === item.inventoryId)
})
if (selection.length) {
const data = selection.map(r => {
return {
'subTypeName': 'OutStorageRecallItem',
'reqStatus': 'Apply',
'outStorageId': r.jobResponseId,
'outStorageIdType': r.jobResponseIdType,
inventory: r,
'inventoryId': r.id,
'inventoryIdType': this.$utils.getModelName4dxClassName(r),
'purchaseUnitId': r.jobResponse.jobOrder.extMaterial.extUnitId,
'purchaseUnitIdType': r.jobResponse.jobOrder.extMaterial.extUnitIdType,
'extDxSipplierId': r.jobResponse.jobOrder.extDxSipplierId,
'extDxSipplierIdType': r.jobResponse.jobOrder.extDxSipplierIdType,
extDxSipplier: r.jobResponse.jobOrder.extDxSipplier,
extMaterial: r.jobResponse.jobOrder.extMaterial,
storageZone: r.jobResponse.jobOrder.storageZone,
storageCondition: r.jobResponse.jobOrder.storageCondition,
'extMaterialId': r.jobResponse.jobOrder.extMaterialId,
'extMaterialIdType': r.jobResponse.jobOrder.extMaterialIdType,
'arrivalDate': r.jobResponse.jobOrder.arrivalDate,
// 'reqAmount': r.usableAmount,
'airModel': r.jobResponse.jobOrder.airModel,
'sorties': r.jobResponse.jobOrder.sorties,
'manufacturer': r.jobResponse.jobOrder.manufacturer,
'contractNo': r.jobResponse.jobOrder.contractNo,
'stockPrice': r.jobResponse.jobOrder.stockPrice,
'lotNo': r.jobResponse.jobOrder.lotNo,
'taxRate': r.jobResponse.jobOrder.taxRate,
'taxUnitPrice': r.jobResponse.jobOrder.taxUnitPrice,
'taxPrice': r.jobResponse.jobOrder.taxPrice,
'stockUnitPrice': r.jobResponse.jobOrder.stockUnitPrice,
'purchaseOrderNo': r.jobResponse.jobOrder.purchaseOrderNo,
'operator': 'ADD',
remark: r.jobResponse.jobOrder.remark,
'isRoot': r.jobResponse.jobOrder.isRoot
}
})
this.$emit('submitEvent', { formData: data })
}
},
cancelEvent() {
this.$emit('cancel')
}
}
}
</script>
<style lang='scss'>
.addOutStorageCallbackDetail-dialog {
.list-table {
height: 510px !important;
}
.foot-btn-box {
display: flex;
margin-top: 10px;
justify-content: center;
align-content: center;
}
}
</style>
export default {
data() {
return {
// eslint-disable-next-line no-undef
gantt: Gantt.getGanttInstance()
}
},
mounted() {
this.initGantt()
},
methods: {
initGantt() {
this.gantt.init(this.ganttElId)
this.setColumnsConfig()
this.setScaleConfig(this.type)
this.configLayout()
this.gantt.i18n.setLocale('cn')
},
setColumnsConfig() {
this.gantt.config.columns = this.columns
},
configLayout() {
this.gantt.config.layout = {
css: 'gantt_container',
rows: [
{
cols: [
{ view: 'grid', id: 'grid', scrollX: 'scrollHor', scrollY: 'scrollVer' },
{ resizer: true, width: 2 },
{ view: 'timeline', id: 'timeline', scrollX: 'scrollHor', scrollY: 'scrollVer' },
{ view: 'scrollbar', scroll: 'y', id: 'scrollVer' }
]
},
{ view: 'scrollbar', scroll: 'x', id: 'scrollHor', height: 20 }
]
}
},
setScaleConfig(type) {
if (type === 'month-week') {
var weekScaleTemplate = function(date) {
var dateToStr = this.gantt.date.date_to_str('%d %M')
var endDate = this.gantt.date.add(this.gantt.date.add(date, 1, 'week'), -1, 'day')
return dateToStr(date) + ' - ' + dateToStr(endDate)
}
this.gantt.config.scales = [
{ unit: 'month', step: 1, format: '%M月' },
{ unit: 'week', step: 1, format: weekScaleTemplate }
]
this.gantt.config.scale_height = 50
return
}
},
usePlugins() {
this.gantt.plugins({
drag_timeline: true, // 整体拖拽时间线
fullscreen: true, // 全屏模式,
tooltip: true
})
}
}
}
export default {
watch: {
showFlag(val) {
if (!val) {
return
}
if (!this.node) {
return
}
if (this.node.id === this.currentId) {
return
}
this.getData()
},
node: {
immediate: true,
deep: true,
handler(val) {
if (!this.showFlag) {
return
}
if (!val) {
return
}
if (val.id === this.currentId) {
return
}
this.getData()
}
}
},
mounted() {
},
methods: {
search() {
},
import() {
},
save() {
}
}
}
<template>
<div class="TfMomWebGatt-page">
<div class="btn-bar">
<el-radio-group v-model="viewType" size="small" @input="setView">
<el-radio-button label="ExtPosition">站位路线</el-radio-button>
<el-radio-button label="unit">装配单元路线</el-radio-button>
<el-radio-button label="AircraftSorties">架次视图路线</el-radio-button>
</el-radio-group>
<dee-tools mode="normal" :tools="tools" />
</div>
<div class="content-model">
<step v-show="viewType === 'ExtPosition'" :show-flag="viewType === 'ExtPosition'" :node="node" />
<unit v-show="viewType === 'unit'" :show-flag="viewType === 'unit'" :node="node" />
<view2 v-show="viewType === 'AircraftSorties'" :show-flag="viewType === 'AircraftSorties'" :node="node" />
</div>
</div>
</template>
<script>
import step from './step.vue'
import unit from './unit.vue'
import view2 from './view.vue'
export default {
componentName: '单架次MBOM甘特图',
name: 'TfMomWebGatt',
components: { step, unit, view2 },
data() {
return {
viewType: 'ExtPosition',
node: null,
evenList: [
{
even: 'changeView',
name: '更改视图'
}
],
emitMethods: [
{
methods: 'getData',
methodsName: '获取列表数据'
}
]
}
},
computed: {
tools() {
const btns = [{
name: '导出',
icon: '/icons/c-export.png',
handler: {
click: () => {
this.import()
}
}
}]
if (this.viewType === 'AircraftSorties') {
return btns
}
if (this.viewType === 'ExtPosition') {
btns.unshift({
name: '保存',
icon: '/icons/c-export.png',
handler: {
click: () => {
this.save()
}
}
})
return btns
}
btns.unshift({
name: '设置排序',
icon: '/icons/check.png',
handler: {
click: () => {
this.config()
}
}
})
btns.unshift({
name: '保存',
icon: '/icons/c-export.png',
handler: {
click: () => {
this.save()
}
}
})
return btns
}
},
mounted() {
},
methods: {
setView(type) {
this.viewType = type
this.$emit('changeView', this.viewType)
},
getData(params) {
this.node = params
},
import() {
},
save() {
},
config() {
}
}
}
</script>
<style lang="scss">
.TfMomWebGatt-page{
height: 100%;
.btn-bar{
height: 40px;
display: flex;
justify-content: space-between;
}
.content-model{
height: calc(100% - 40px);
}
}
</style>
<template>
<div class="TfMomWebStep-model">
<div :id="ganttElId" style="height: 100%;" />
</div>
</template>
<script>
import moment from 'moment'
import config from './config'
import data from './data'
export default {
name: 'TfMomWebStep',
mixins: [config, data],
props: {
node: {
type: Object,
default: () => null
},
showFlag: {
type: Boolean,
default: false
}
},
data() {
return {
ganttElId: 'unit-gantt',
type: 'month-week',
ganttData: [],
initGanttFlag: false,
params: null,
currentId: ''
}
},
computed: {
columns() {
return [
{ name: 'ganttId', label: '节点', width: 60, align: 'center', resize: true },
{ name: 'text', label: '站位号', width: 160, align: 'center', resize: true },
{ name: 'duration', label: '工期(天)', width: 100, align: 'center', resize: true },
{ name: 'prevIndex', label: '前置', width: 150, align: 'center', resize: true, editor: { type: 'date', map_to: 'start_date' }}
]
}
},
mounted() {
},
methods: {
refreshGantt() {
const val = this.ganttData
if (!val || !val.length) {
this.gantt.parse({ data: [] })
return
}
const params = {
data: [],
links: []
}
val.forEach((item, index) => {
params.data.push({
ganttId: index + 1,
text: item.serialNumber,
rowId: item.id,
prevIndex: '',
start_date: new Date(item.createTime), // moment(item.createTime).format('DD-MM-yyyy'),
duration: item.workHour ? (item.workHour / 8) : 0
})
})
val.forEach((item) => {
if (item.extProcessExecutorRoutes && item.extProcessExecutorRoutes[0]) {
const ganttRow = params.data.find(r => r.rowId === item.id)
const prevRow = params.data.find(r => r.rowId === item.extProcessExecutorRoutes[0].prevNodeId)
ganttRow.prevIndex = prevRow.ganttId
const idx = params.links.length + 1
params.links.push({
id: idx,
source: prevRow.ganttId,
target: ganttRow.ganttId
})
}
})
this.params = JSON.parse(JSON.stringify(params))
this.gantt.clearAll()
this.gantt.parse(params)
},
getData() {
this.currentId = this.node.id
const params = {
'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': this.node.id }] },
'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }],
'openProps': [
{
'name': 'extProcessExecutorRoutes'
}
]
}
this.$api.searchApi('ExtPosition', params).then(res => {
if (res.items.content) {
this.ganttData = res.items.content
} else {
this.ganttData = []
}
this.refreshGantt()
}).catch(() => {
this.ganttData = []
this.refreshGantt()
})
},
dataWash() {
}
}
}
</script>
<style lang="scss">
.TfMomWebStep-model{
height: 100%;
.gatt{
height: 100%;
}
}
</style>
<template>
<div class="TfMomWeb-tree">
<el-tree
v-show="AircraftName"
ref="tree"
:data="treeData"
default-expand-all
:props="props"
node-key="id"
:expand-on-click-node="false"
@node-click="nodeClick"
>
<span slot-scope="{ node, data }" class="dee-as-tree-node" :class="{'disable-dee-as-tree-node': data.disabled, 'current':currentNode.id === data.id}">
<i v-show="data.subTypeName==='aircraft'" class="el-icon-s-promotion" />
<i v-show="data.subTypeName==='ExtPosition'" class="el-icon-s-tools" />
<span>{{ node.label }}</span>
</span>
</el-tree>
</div>
</template>
<script>
export default {
componentName: '单架次MBOM结构树',
name: 'TfMomWebTree',
data() {
return {
AircraftName: '',
AircraftSortiesId: '',
AircraftSortiesName: '',
currentNode: {},
postionList: [],
viewType: 'ExtPosition',
emitMethods: [
{
methods: 'getData',
methodsName: '获取结构树'
},
{
methods: 'setNode',
methodsName: '设置节点'
}
],
evenList: [
{
even: 'nodeClick',
name: '节点点击事件'
}
],
props: {
label: (data, node) => this.setLabel(data, node)
}
}
},
computed: {
treeData() {
return this.initTree(this.viewType, this.postionList)
}
},
mounted() {
},
methods: {
initTree(type, postionList) {
this.$nextTick(() => {
setTimeout(() => {
this.defaultNodeClick()
}, 100)
})
return [{
id: this.AircraftSortiesId,
subTypeName: 'aircraft',
serialNumber: `${this.AircraftName}-${this.AircraftSortiesName}`,
disabled: this.disableClickFun(type, { subTypeName: 'aircraft' }),
children: postionList.map(r => {
r.disabled = this.disableClickFun(type, r)
return r
})
}]
},
setLabel(data, node) {
return data.serialNumber
},
disableClickFun(type, data) {
if (type === 'unit') {
return data.subTypeName === 'aircraft'
}
return data.subTypeName === 'ExtPosition'
},
nodeClick(data, node) {
if (data.disabled) {
this.$refs.tree.setCurrentKey(null)
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNode.id)
})
return
}
this.currentNode = data
this.$emit('nodeClick', data)
},
getData(params) {
const items = params.items || params
const AircraftType = items.find(r => r.fieldName === 'AircraftType')
const AircraftSorties = items.find(r => r.fieldName === 'AircraftSorties')
if (AircraftType) {
this.AircraftName = AircraftType.value
}
if (AircraftSorties) {
const list = AircraftSorties.value.split('$$')
this.AircraftSortiesId = list[0]
this.AircraftSortiesName = list[1]
}
this.getPosition()
},
getPosition() {
const params = {
'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': this.AircraftSortiesId }] },
'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }]
}
this.$api.searchApi('ExtPosition', params).then(res => {
if (res.items.content) {
this.postionList = res.items.content
} else {
this.postionList = []
}
}).catch(() => {
this.postionList = []
})
},
setNode(type) {
this.viewType = type
},
defaultNodeClick() {
const tree = this.$refs.tree
if (!tree) {
return
}
const root = tree.getNode(this.AircraftSortiesId)
if (this.viewType === 'unit') {
this.currentNode = root.childNodes[0] && root.childNodes[0].data
} else {
this.currentNode = root.data
}
if (!this.currentNode) {
return
}
this.$nextTick(() => {
tree.setCurrentKey(this.currentNode.id)
this.$emit('nodeClick', this.currentNode)
})
}
}
}
</script>
<style lang="scss">
.TfMomWeb-tree{
.dee-as-tree-node{
width: 100%;
&.disable-dee-as-tree-node{
color: #ccc;
cursor: not-allowed;;
}
}
}
</style>
<template>
<div class="TfMomWebUnit-model">
<div class="search-bar">
<el-input>
<el-input v-model="AOname" placeholder="AO(号/名称)" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="search" />
</el-input>
</el-input>
</div>
<div id="unit-gatt" class="gatt" />
</div>
</template>
<script>
import config from './config'
import data from './data'
export default {
name: 'TfMomWebUnit',
mixins: [config, data],
props: {
node: {
type: Object,
default: () => null
},
showFlag: {
type: Boolean,
default: false
}
},
data() {
return {
currentId: '',
AOname: ''
}
},
watch: {
showFlag(val) {
if (!val) {
return
}
if (!this.node) {
return
}
if (this.node.id === this.currentId) {
return
}
this.getData()
},
node: {
immediate: true,
deep: true,
handler(val) {
if (!this.showFlag) {
return
}
if (!val) {
return
}
if (val.id === this.currentId) {
return
}
this.getData()
}
}
},
mounted() {
},
methods: {
search() {
},
getData() {
},
import() {
},
save() {
}
}
}
</script>
<style lang="scss">
.TfMomWebUnit-model{
height: 100%;
}
</style>
<template>
<div class="TfMomWebView-model">
<div class="search-bar">
<el-input>
<el-input v-model="AOname" placeholder="AO(号/名称)" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="search" />
</el-input>
</el-input>
</div>
<div :id="ganttElId" class="gatt" />
</div>
</template>
<script>
import config from './config'
import data from './data'
export default {
name: 'TfMomWebView',
mixins: [config, data],
props: {
node: {
type: Object,
default: () => null
},
showFlag: {
type: Boolean,
default: false
}
},
data() {
return {
ganttElId: 'view-gantt',
currentId: '',
AOname: ''
}
},
watch: {
showFlag(val) {
if (!val) {
return
}
if (!this.node) {
return
}
if (this.node.id === this.currentId) {
return
}
this.getData()
},
node: {
immediate: true,
deep: true,
handler(val) {
if (!this.showFlag) {
return
}
if (!val) {
return
}
if (val.id === this.currentId) {
return
}
this.getData()
}
}
},
mounted() {
},
methods: {
getData() {
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -1562,6 +1562,7 @@ export default {
value: item.defCode
}
})
this.$set(this.form, 'airModel', AIRMODEL.component.options[0].label)
})
},
// 根据机型带出架次
......
......@@ -259,7 +259,7 @@ export default {
},
icon: '/icons/components/new/add.png',
showFun: (row) => {
const value = row.extMaterial ? row.extMaterial.resType2.typeName : ''
const value = row.extMaterial ? row.extMaterial.resType2.typeName : row.materialTypeName
if (!row.isRoot || value !== '外购成品') {
return false
}
......
......@@ -116,14 +116,13 @@ export default {
// 初始化数据
},
mounted() {
console.log('this.basicData', { ...this.basicData })
this.timerId = setInterval(() => {
if (this.basicData.id) {
clearInterval(this.timerId)
this.timerId = null
this.searchInStorageRequestItem(this.basicData.id)
}
}, 200)
// this.timerId = setInterval(() => {
// if (this.basicData.id) {
// clearInterval(this.timerId)
// this.timerId = null
// }
// }, 200)
this.searchInStorageRequestItem(this.basicData.id)
},
methods: {
// 编辑采购入库明细查询InStorageRequestItem/search
......
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