<template>
|
<el-dialog
|
width="95%"
|
title="工艺文件详情"
|
top="5vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
class="part-dialog"
|
>
|
<div style="height: 850px;position: relative;">
|
<div class="page-main">
|
<div class="document-basic">
|
<el-form
|
:model="dataForm"
|
:rules="dataRule"
|
ref="dataForm"
|
style="width: 100%"
|
class="l-mes"
|
:disabled="!editable"
|
label-width="110px"
|
>
|
<el-row>
|
<el-col :span="5">
|
<el-form-item prop="name" label="文件名称">
|
<el-input
|
v-model="dataForm.name"
|
placeholder="文件名称"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item prop="number" label="文件编号">
|
<el-input v-model="dataForm.number" placeholder="文件编号">
|
</el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item prop="version" label="版本号">
|
<el-input
|
v-model="dataForm.version"
|
placeholder="版本号"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item label="项目号" prop="projectNo">
|
<el-input
|
v-model="dataForm.projectNo"
|
placeholder="项目号"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item label="项目类别" prop="projectType">
|
<el-select
|
v-model="dataForm.projectType"
|
filterable
|
placeholder="请选择"
|
style="width:100%"
|
>
|
<el-option
|
v-for="(item, index) in projectTypeOptions"
|
:label="item.name"
|
:value="item.value"
|
:key="index"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="3">
|
<el-form-item label="国家" prop="country">
|
<countrySelector v-model="dataForm.country"></countrySelector>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="5">
|
<el-form-item label="产品零件号" prop="partNo">
|
<el-input v-model="dataForm.partNo" placeholder="请选择零件">
|
</el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item label="产品零件描述" prop="partName">
|
<el-input v-model="dataForm.partName" disabled> </el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="15">
|
<el-form-item label="备注" prop="remark">
|
<el-input
|
type="textarea"
|
v-model="dataForm.remark"
|
placeholder="备注"
|
style="width:360px"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
</div>
|
|
<div class="document-detail">
|
<el-tabs type="card" style="width: 100%;height: 100%">
|
<el-tab-pane
|
label="原材用量"
|
style="height: 100%"
|
class="orimaterial-quantity"
|
>
|
<el-card
|
shadow="never"
|
style="margin-top: 12px;border: 1px solid #cfd5de;"
|
>
|
<div slot="header">
|
<div>
|
<el-button
|
type="text"
|
size="small"
|
class="blue-but"
|
v-if="editable"
|
>计算用量
|
</el-button>
|
</div>
|
</div>
|
<el-table
|
:data="materialCostList"
|
border
|
height="650"
|
:span-method="objectSpanMethod"
|
:header-cell-style="{ color: '#999' }"
|
class="document-materialcost-table"
|
>
|
<el-table-column
|
label="成品"
|
prop="finishedProduct"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column
|
label="Bom编号"
|
prop="bomNumber"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column
|
label="工序"
|
prop="operationName"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column label="物料" prop="partName" align="center">
|
</el-table-column>
|
<el-table-column label="数量" prop="quantity" align="center">
|
</el-table-column>
|
<el-table-column label="单位" prop="unit" align="center">
|
</el-table-column>
|
</el-table>
|
</el-card>
|
</el-tab-pane>
|
<el-tab-pane
|
class="final-product-checkout"
|
label="成品检测"
|
style="height: 100%"
|
>
|
<TeststandardDialog
|
:editable="editable"
|
:documentId="Number(dataForm.id)"
|
>
|
</TeststandardDialog>
|
</el-tab-pane>
|
<el-tab-pane label="产品结构工序参数" style="height: 100%">
|
<div class="document-related-stock-part">
|
<div
|
style="padding-left:18px;font-size:14px;font-weight:700;color:#000;height:20px;line-height:20px;"
|
>
|
<span>相关库存零件</span>
|
</div>
|
<el-table
|
:data="relatedStockPartList"
|
@row-click="clickRelatedStockPart"
|
highlight-current-row
|
height="188px"
|
:header-cell-style="relatedStockPartTableHeaderCellStyle"
|
:row-style="{ height: '0' }"
|
:cell-style="{ padding: '1px' }"
|
>
|
<el-table-column
|
label="零件编号"
|
prop="partNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="零件描述"
|
prop="partName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="工艺路线编号"
|
prop="routingNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="工艺替代号"
|
prop="alternativeNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="BOM号"
|
prop="bomNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
</el-table>
|
</div>
|
<el-card class="document-bom" header="BOM-工序参数">
|
<div slot="header">
|
<span>BOM-工序参数</span>
|
</div>
|
<el-collapse
|
v-model="currTechnologyBomPartName"
|
accordion
|
@change="handleCompleteproductstructureChange"
|
>
|
<el-collapse-item
|
v-for="(item, i) in completeproductstructureData"
|
:key="i"
|
:name="item.bomRoutingId"
|
>
|
<template slot="title">
|
<el-checkbox
|
class="completeproductstructure-checkout"
|
v-model="item.expand"
|
disabled
|
>
|
<span style="font-weight:bold">工艺路线编号:</span
|
>{{ item.routingNo }}
|
<span style="font-weight:bold">零件名称:</span
|
>{{ item.partName }}
|
<span style="font-weight:bold">Bom编号:</span
|
>{{ item.number == null ? '无' : item.number }}
|
</el-checkbox>
|
</template>
|
<div style="display:flex;">
|
<div
|
style="font-size:13px;font-weight:bold;cursor: pointer;border-radius:2px 2px 0px 0px;width:80px;text-align:center;"
|
:class="[
|
item.showBom
|
? 'highlight-tab-class'
|
: 'unhighlight-tab-class'
|
]"
|
@click="item.showBom = true"
|
>
|
BOM结构
|
</div>
|
<div
|
style="font-size:13px;font-weight:bold;cursor: pointer;margin-left: 10px;border-radius:2px 2px 0px 0px;width:80px;text-align:center;"
|
:class="[
|
!item.showBom
|
? 'highlight-tab-class'
|
: 'unhighlight-tab-class'
|
]"
|
@click="item.showBom = false"
|
>
|
工序参数
|
</div>
|
</div>
|
|
<div class="document-bom-div" v-show="item.showBom">
|
<el-table
|
:data="completeproductstructureDetail"
|
row-key="id"
|
border
|
height="440"
|
default-expand-all
|
class="structure-detail-table"
|
>
|
<el-table-column
|
prop="partName"
|
label="零件名称"
|
width="400"
|
>
|
</el-table-column>
|
<el-table-column prop="qpa" label="数量" width="180">
|
</el-table-column>
|
<el-table-column prop="unit" label="单位">
|
</el-table-column>
|
</el-table>
|
</div>
|
<div class="document-technology-div" v-show="!item.showBom">
|
<div
|
style="border: 1px solid #ebeef5;height: 440px;overflow: auto;"
|
>
|
<el-collapse
|
v-model="currTechnologyOperationName"
|
accordion
|
@change="handleTechnologyOperationChange"
|
>
|
<el-collapse-item
|
v-for="(ele, j) in technologyOperationData"
|
:key="j"
|
:name="ele.id"
|
>
|
<template slot="title"
|
><span style="font-weight:300"
|
> 工序名称:</span
|
>{{ ele.operationName }}
|
<span style="font-weight:300">工序编号:</span
|
>{{ ele.operationNo }}
|
</template>
|
<el-tabs v-model="activeTemplateName" type="card">
|
<el-tab-pane
|
v-for="(paramTab, index) in paramTabs"
|
:key="index"
|
:label="paramTab.name"
|
:name="paramTab.name"
|
>
|
<el-table :data="paramTab.params">
|
<el-table-column
|
prop="parameterItem"
|
label="名称"
|
align="center"
|
>
|
<template slot-scope="scope">
|
<span
|
>{{ scope.row.parameterItem }}({{
|
scope.row.unit
|
}})</span
|
>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="paramValue"
|
label="值"
|
align="center"
|
></el-table-column>
|
</el-table>
|
</el-tab-pane>
|
<el-tab-pane label="备注" style="height: 100%">
|
<rich-text
|
:editorId="
|
'fwb' + item.id + '-' + ele.id + '-' + j
|
"
|
:richContent="ele.remark"
|
></rich-text>
|
</el-tab-pane>
|
<el-tab-pane label="检测标准">
|
<testStandardTable
|
ref="documentTestStandardTable"
|
:dataFormId="dataForm.id"
|
:routingOperationId="ele.id"
|
:paramTypeOptions="paramTypeOptions"
|
:operationTestStandardList="
|
operationTestStandardList
|
"
|
></testStandardTable>
|
</el-tab-pane>
|
</el-tabs>
|
</el-collapse-item>
|
</el-collapse>
|
</div>
|
</div>
|
</el-collapse-item>
|
</el-collapse>
|
</el-card>
|
</el-tab-pane>
|
<el-tab-pane label="图片上传" style="height: 100%">
|
<el-card class="document-structure">
|
<div slot="header">
|
<span>结构图</span>
|
</div>
|
<el-upload
|
class="upload-demo"
|
action="/mes/document/uploadJgt"
|
:headers="headers"
|
:on-preview="handleStructurePreview"
|
:on-remove="handleStructureRemove"
|
:on-success="handleStructureSuccess"
|
:data="paramStructureDatas"
|
:file-list="fileStructureList"
|
:limit="1"
|
:on-exceed="handleStructureExceed"
|
:before-upload="beforeStructureAvatarUpload"
|
list-type="picture"
|
:with-credentials="true"
|
:disabled="!editable"
|
>
|
<el-button size="small" type="primary">点击上传</el-button>
|
<div slot="tip" class="el-upload__tip">
|
只能上传jpg图片,且不超过2MB
|
</div>
|
</el-upload>
|
<el-dialog :visible.sync="dialogStructureVisible">
|
<img width="100%" :src="dialogStructureImageUrl" alt="" />
|
</el-dialog>
|
</el-card>
|
<el-card class="document-flow">
|
<div slot="header">
|
<span>流程图</span>
|
</div>
|
<span style="font-size:14px">备注:</span>
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 3, maxRows: 6 }"
|
placeholder="请输入备注内容"
|
v-model="flowRemark"
|
style="margin-bottom:10px"
|
:disabled="!editable"
|
>
|
</el-input>
|
<div style="overflow:auto;">
|
<span style="font-size:14px">节点名称:</span>
|
<el-select
|
v-model="currFlowNodeName"
|
filterable
|
placeholder="请选择"
|
style="width:80%"
|
>
|
<el-option
|
v-for="item in flowNodes"
|
:key="item.id"
|
:label="item.label"
|
:value="item.label"
|
>
|
</el-option>
|
</el-select>
|
<div id="demo" style="margin:5px auto;"></div>
|
</div>
|
<el-dialog :visible.sync="dialogFlowVisible">
|
<img width="100%" :src="dialogFlowImageUrl" alt="" />
|
</el-dialog>
|
</el-card>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</div>
|
</div>
|
</el-dialog>
|
</template>
|
<script>
|
import {
|
getObj,
|
getTemplateAndParam,
|
removeUploadJgt
|
} from '@/api/technology/document'
|
import { getObj as getTechnologyDetail } from '@/api/technology/routing'
|
import { getObj as getStructureDetail } from '@/api/technology/completeproductstructure'
|
import { getTestStandardParams } from '@/api/quality/teststandard'
|
import { remote } from '@/api/admin/dict'
|
import { fetchList as getStandard } from '@/api/quality/standardbind'
|
import { getStore } from '@/util/store.js'
|
import countrySelector from '@/views/common/country'
|
import RichText from '@/views/common/rich-text.vue'
|
import TeststandardDialog from '@/views/technology/document/teststandard'
|
import testStandardTable from '@/views/technology/document/teststandardtable'
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
docId: {
|
type: Number,
|
default: 0
|
}
|
},
|
data() {
|
return {
|
operationPart: {},
|
queryParam: {},
|
bomQueryParam: {},
|
currTechnologyName: null,
|
currTechnologyBomPartName: null,
|
currTechnologyBomPart: null,
|
completeproductstructureData: [],
|
completeproductstructureDetail: [],
|
currTechnologyOperationName: null,
|
currTechnologyOperation: null,
|
technologyOperationData: [],
|
activeTemplateName: null,
|
paramTabs: [],
|
qualityStandardList: [],
|
standardParamList: [],
|
materialCostList: [],
|
rowColSplitNodes: [],
|
projectTypeOptions: [
|
{ name: '国内项目', value: 0 },
|
{ name: '特缆研发项目', value: 1 }
|
],
|
dataForm: {
|
id: null,
|
number: null,
|
name: null,
|
version: null,
|
projectNo: null,
|
projectType: null,
|
country: null,
|
state: null,
|
remark: null,
|
partNo: null,
|
partId: null,
|
partName: null
|
},
|
dataRule: {},
|
fileStructureList: [],
|
headers: {
|
Authorization: 'Bearer ' + getStore({ name: 'access_token' })
|
},
|
paramStructureDatas: { documentId: null },
|
dialogStructureImageUrl: '',
|
dialogStructureVisible: false,
|
fileFlowList: [],
|
paramFlowDatas: { documentId: null, lctRemark: null },
|
dialogFlowImageUrl: '',
|
dialogFlowVisible: false,
|
flowRemark: null,
|
flowTemp: null,
|
currFlowNodeName: null,
|
curFlowNodeId: null,
|
curFlowNodeType: null,
|
flowNodes: [],
|
showPart: false,
|
relatedStockPartList: [],
|
currRelatedStockPart: null,
|
paramTypeOptions: [],
|
operationTestStandardList: [],
|
editable: false,
|
innerVisible: false
|
}
|
},
|
components: {
|
TeststandardDialog,
|
countrySelector,
|
RichText,
|
testStandardTable
|
},
|
mounted() {
|
// 将该方法暴露至全局,js可调用
|
window.winDbClick = this.getDbClick
|
},
|
methods: {
|
getDict() {
|
remote('document_flow_node').then((response) => {
|
if (response.data.code === 0) {
|
this.flowNodes = response.data.data
|
} else {
|
this.flowNodes = []
|
}
|
})
|
},
|
initFlowDesign() {
|
var property = {
|
width: 990,
|
height: 400,
|
toolBtns: ['chat', 'start'],
|
haveHead: true,
|
headLabel: true,
|
headBtns: ['save', 'print', 'reload'], // 如果haveHead=true,则定义HEAD区的按钮
|
haveTool: true,
|
haveGroup: false,
|
useOperStack: true
|
}
|
var toolBtnRemark = {
|
cursor: '选择指针',
|
direct: '结点连线',
|
chat: '流程节点',
|
start: '标题'
|
}
|
|
var _this = this
|
_this.flowTemp = $.createGooFlow($('#demo'), property)
|
_this.flowTemp.setTitle('流程图')
|
_this.flowTemp.setNodeRemarks(toolBtnRemark)
|
var headNodes = _this.flowTemp.$head[0].childNodes
|
for (let i = 0; i < headNodes.length; i++) {
|
if (headNodes[i].outerHTML.indexOf('save') > 0) {
|
headNodes[i].title = '保存流程图'
|
} else if (headNodes[i].outerHTML.indexOf('reload') > 0) {
|
headNodes[i].title = '重置流程图'
|
} else if (headNodes[i].outerHTML.indexOf('print') > 0) {
|
headNodes[i].title = '导出流程图'
|
}
|
}
|
},
|
// 双击节点时触发
|
getDbClick(text, id) {
|
this.currFlowNodeName = text
|
this.curFlowNodeId = id
|
},
|
// 根据工艺文件id,查询工艺文件所有的信息
|
getDocumentInfo(documentId) {
|
getObj(documentId).then((response) => {
|
const resData = response.data.data
|
this.dataForm = resData
|
const bomRoutings = resData.bomRoutings
|
const testStandards = resData.testStandards
|
const materialCosts = resData.materialCosts
|
const bomRoutingParts = resData.bomRoutingParts
|
this.relatedStockPartList = []
|
// 挂相关库存零件
|
if (bomRoutingParts != null && bomRoutingParts.length > 0) {
|
let bomRoutingPart
|
for (let i = 0; i < bomRoutingParts.length; i++) {
|
bomRoutingPart = {
|
id: bomRoutingParts[i].id,
|
partId: bomRoutingParts[i].partId,
|
partNo: bomRoutingParts[i].partNo,
|
partName: bomRoutingParts[i].partName,
|
routingNo: bomRoutingParts[i].routingNo,
|
alternativeNo: bomRoutingParts[i].alternativeNo,
|
bomNo: bomRoutingParts[i].bomNumber
|
}
|
this.relatedStockPartList.push(bomRoutingPart)
|
}
|
}
|
this.completeproductstructureData = []
|
// 挂工艺路线
|
if (bomRoutings != null && bomRoutings.length > 0) {
|
let completeproductstructure
|
for (let i = 0; i < bomRoutings.length; i++) {
|
completeproductstructure = {
|
id: bomRoutings[i].bomId,
|
number: bomRoutings[i].bomNumber,
|
partName: bomRoutings[i].partName,
|
partId: bomRoutings[i].partId,
|
expand: false,
|
routingId: bomRoutings[i].routingId,
|
routingNo: bomRoutings[i].routingNo,
|
bomRoutingId: bomRoutings[i].id,
|
showBom: true
|
}
|
this.completeproductstructureData.push(completeproductstructure)
|
}
|
}
|
// 挂成品检测
|
this.qualityStandardList = []
|
this.standardParamList = []
|
if (testStandards != null && testStandards.length > 0) {
|
var testStandard = testStandards[0]
|
var qualityStandard = {
|
standardNo: null,
|
standardName: null,
|
remark: null,
|
id: testStandard.testStandardId
|
}
|
this.qualityStandardList.push(qualityStandard)
|
this.getTestStandardParamData(testStandard.testStandardId)
|
}
|
// 挂原材料用量
|
this.materialCostList = []
|
if (materialCosts != null) {
|
this.calcRowColSplitNode(materialCosts)
|
}
|
// 挂结构图
|
this.fileStructureList = []
|
if (resData.jgt != null) {
|
var aa = {
|
name: '预览大图',
|
url: '/mes/document/file/' + resData.jgt
|
}
|
this.fileStructureList.push(aa)
|
}
|
// 挂流程图
|
this.fileFlowList = []
|
if (resData.lct != null) {
|
this.fileFlowList.push({
|
name: '预览大图',
|
url: '/mes/document/file/' + resData.lct
|
})
|
}
|
// 挂流程图
|
if (resData.lctJson != null) {
|
this.flowTemp.loadData(JSON.parse(resData.lctJson))
|
this.flowRemark = resData.lctRemark
|
}
|
})
|
},
|
handleCompleteproductstructureChange(val) {
|
if (val != null && val !== '') {
|
this.currTechnologyBomPart = this.completeproductstructureData.find(
|
(item) => {
|
return item.bomRoutingId === this.currTechnologyBomPartName
|
}
|
)
|
this.currTechnologyName = this.currTechnologyBomPart.routingId
|
let currSelectBomId = null
|
let currRoutingId = null
|
for (let i = 0; i < this.completeproductstructureData.length; i++) {
|
if (
|
this.completeproductstructureData[i].routingId ==
|
this.currTechnologyBomPart.routingId
|
) {
|
this.completeproductstructureData[i].expand = true
|
currSelectBomId = this.completeproductstructureData[i].id
|
currRoutingId = this.completeproductstructureData[i].routingId
|
} else {
|
this.completeproductstructureData[i].expand = false
|
}
|
}
|
// 若已有绑定Bom结构则查,没有则不查
|
this.completeproductstructureDetail = []
|
if (currSelectBomId != null) {
|
getStructureDetail(currSelectBomId).then((response) => {
|
var resultData = response.data.data
|
this.completeproductstructureDetail.push(resultData.tree)
|
})
|
}
|
|
// 若已有绑定工艺则查,没有则不查
|
this.currTechnologyOperationName = null
|
this.technologyOperationData = []
|
if (currRoutingId != null) {
|
getTechnologyDetail(currRoutingId).then((response) => {
|
const res = response.data
|
if (res.code === 0) {
|
if (res.data.operations.length > 0) {
|
const operations = res.data.operations
|
let technologyOperation
|
for (let i = 0; i < operations.length; i++) {
|
technologyOperation = {}
|
technologyOperation.id = operations[i].id
|
technologyOperation.operationName =
|
operations[i].operationName
|
technologyOperation.operationNo = operations[i].operationNo
|
technologyOperation.partName = operations[i].partName
|
technologyOperation.operationId = operations[i].operationId
|
technologyOperation.partId = operations[i].partId
|
this.technologyOperationData.push(technologyOperation)
|
}
|
|
this.$nextTick(() => {
|
this.technologyOperationData.forEach((item) => {
|
const op = operations.find((el) => {
|
return item.id === el.id
|
})
|
if (op) {
|
item.remark = op.remark
|
}
|
})
|
})
|
}
|
}
|
})
|
}
|
} else {
|
this.currTechnologyName = null
|
this.currTechnologyBomPart = null
|
for (let i = 0; i < this.completeproductstructureData.length; i++) {
|
this.completeproductstructureData[i].expand = false
|
}
|
}
|
},
|
handleTechnologyOperationChange(val) {
|
if (val != null && val !== '') {
|
this.currTechnologyOperation = this.technologyOperationData.find(
|
(item) => {
|
return this.currTechnologyOperationName == item.id
|
}
|
)
|
this.paramTabs = []
|
getTemplateAndParam(val).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
const datas = resData.data
|
if (datas != null && datas.length > 0) {
|
this.activeTemplateName = datas[0].operationTemplateName
|
let paramTab
|
for (let i = 0; i < datas.length; i++) {
|
paramTab = {}
|
paramTab.name = datas[i].operationTemplateName
|
paramTab.params = datas[i].paramList
|
this.paramTabs.push(paramTab)
|
}
|
}
|
}
|
})
|
// 查询检测类型字典
|
remote('quality_param_type').then((response) => {
|
if (response.data.code === 0) {
|
this.paramTypeOptions = response.data.data
|
}
|
})
|
// 根据工序、零件,查询出检测标准
|
getStandard(
|
Object.assign(
|
{
|
current: 1,
|
size: 100
|
},
|
{
|
operationId: this.currTechnologyOperation.operationId,
|
partId: this.currTechnologyOperation.partId
|
}
|
)
|
).then((response) => {
|
if (response.data.code === 0) {
|
this.operationTestStandardList = response.data.data.records
|
}
|
})
|
} else {
|
this.currTechnologyOperation = null
|
}
|
},
|
// 获取关联的检测标准参数信息
|
getTestStandardParamData(testStandardId) {
|
this.standardParamList = []
|
getTestStandardParams(
|
Object.assign({
|
testStandardId: testStandardId
|
})
|
).then((response) => {
|
this.standardParamList = response.data.data
|
})
|
},
|
calcRowColSplitNode(dataMap) {
|
let rowColSplitNode
|
let keyValues
|
let allKeyValues = []
|
let i = 0
|
this.rowColSplitNodes = []
|
for (var dataKey in dataMap) {
|
keyValues = dataMap[dataKey]
|
rowColSplitNode = {
|
key: dataKey,
|
node: i,
|
num: keyValues.length
|
}
|
this.rowColSplitNodes.push(rowColSplitNode)
|
allKeyValues = allKeyValues.concat(keyValues)
|
i = i + keyValues.length
|
}
|
this.materialCostList = allKeyValues
|
},
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
if (columnIndex === 0 || columnIndex === 1) {
|
var rowColSplitNode = this.rowColSplitNodes.find(
|
(item) => item.key == row.bomId && item.node === rowIndex
|
)
|
if (rowColSplitNode !== undefined) {
|
return {
|
rowspan: rowColSplitNode.num,
|
colspan: 1
|
}
|
} else {
|
return {
|
rowspan: 0,
|
colspan: 0
|
}
|
}
|
}
|
},
|
handleStructureRemove(file) {
|
removeUploadJgt(this.dataForm.id).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
this.$message.success('删除结构图成功')
|
} else {
|
this.$message.error('删除结构图失败')
|
}
|
})
|
},
|
handleStructurePreview(file) {
|
this.dialogStructureVisible = true
|
this.dialogStructureImageUrl = file.url
|
},
|
handleStructureSuccess(response, file, fileList) {
|
console.log('上传成功')
|
},
|
handleStructureExceed(files, fileList) {
|
this.$message.warning(
|
`当前限制选择 1 个结构图文件,本次选择了 ${
|
files.length
|
} 个结构图文件,共选择了 ${files.length + fileList.length} 个结构图文件`
|
)
|
},
|
beforeStructureAvatarUpload(file) {
|
if (this.dataForm.id) {
|
this.paramStructureDatas.documentId = this.dataForm.id
|
/* const isJPG = file.type === 'image/jpeg'
|
const isLt2M = file.size / 1024 / 1024 < 2
|
|
if (!isJPG) {
|
this.$message.error('结构图片只能是 JPG 格式!')
|
}
|
if (!isLt2M) {
|
this.$message.error('结构图片大小不能超过 2MB!')
|
}
|
return isJPG && isLt2M */
|
} else {
|
this.$message.error('请先填写主表信息')
|
return false
|
}
|
},
|
// 点击相关库存零件行的回调
|
clickRelatedStockPart(val) {
|
this.currRelatedStockPart = val
|
},
|
// 渲染相关库存零件表的表头
|
relatedStockPartTableHeaderCellStyle({
|
row,
|
column,
|
rowIndex,
|
columnIndex
|
}) {
|
const headerStyle = 'background:#ddd;color:#000;padding:1px 0px;'
|
return headerStyle
|
}
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
this.$nextTick(() => {
|
this.getDict()
|
// 初始化流程图实例
|
this.initFlowDesign()
|
this.getDocumentInfo(this.docId)
|
})
|
}
|
}
|
}
|
}
|
</script>
|
<style>
|
.document-detail {
|
width: 100%;
|
height: 800px;
|
padding: 10px 20px;
|
display: flex;
|
border: 1px solid #ddd;
|
background-color: #fff;
|
margin-top: 10px;
|
}
|
|
.document-basic {
|
background-color: #fff;
|
height: 133px;
|
display: flex;
|
align-items: flex-end;
|
padding: 10px 30px;
|
border: 1px solid #ddd;
|
}
|
|
.document-related-stock-part {
|
background-color: #fff;
|
width: 100%;
|
height: 220px;
|
border: 1px solid #ddd;
|
padding: 10px 20px 0px 20px;
|
}
|
|
.document-bom {
|
background-color: #fff;
|
width: 100%;
|
height: 499px;
|
border: 1px solid #ddd;
|
padding: 10px 20px;
|
}
|
|
.document-bom .el-card__header {
|
padding: 1px 20px;
|
border-bottom: 0px solid #ebeef5;
|
}
|
|
.document-bom .el-card__body {
|
height: calc(100% - 22px);
|
}
|
|
.document-bom .el-card__body .el-collapse {
|
height: 100%;
|
overflow: auto;
|
}
|
|
.document-technology-params {
|
background-color: #fff;
|
width: calc(52% - 20px);
|
float: left;
|
height: 719px;
|
border: 1px solid #ddd;
|
padding: 10px 20px;
|
margin-left: 20px;
|
}
|
|
.document-structure {
|
background-color: #fff;
|
width: 35%;
|
float: left;
|
height: 719px;
|
border: 1px solid #ddd;
|
padding: 10px 20px;
|
}
|
|
.document-flow {
|
background-color: #fff;
|
width: calc(65% - 20px);
|
float: left;
|
height: 719px;
|
border: 1px solid #ddd;
|
padding: 10px 20px;
|
margin-left: 20px;
|
}
|
|
/*自定义disabled状态下checkbox的样式*/
|
.completeproductstructure-checkout
|
.el-checkbox__input.is-disabled.is-checked
|
.el-checkbox__inner {
|
background-color: #006eff;
|
border-color: #006eff;
|
}
|
|
.completeproductstructure-checkout
|
.el-checkbox__input.is-disabled.is-checked
|
+ span.el-checkbox__label {
|
color: #006eff;
|
border-color: #006eff;
|
}
|
|
.completeproductstructure-checkout
|
.el-checkbox__input.is-disabled
|
.el-checkbox__inner {
|
background-color: #ffffff;
|
cursor: pointer;
|
}
|
|
.completeproductstructure-checkout
|
.el-checkbox__input.is-disabled
|
+ span.el-checkbox__label {
|
color: #606266;
|
cursor: pointer;
|
}
|
|
.completeproductstructure-checkout .el-checkbox__inner::after {
|
border: 1px solid #fff !important;
|
border-left: 0 !important;
|
border-top: 0 !important;
|
cursor: pointer !important;
|
}
|
|
.document-bom-div {
|
width: 100%;
|
margin-bottom: 5px;
|
}
|
|
.document-technology-div {
|
width: 100%;
|
margin-bottom: 5px;
|
margin-right: 10px;
|
}
|
|
.document-technology-div .el-collapse {
|
border-top: 0px;
|
border-bottom: 0px;
|
}
|
|
.structure-detail-table th.gutter {
|
display: table-cell !important;
|
width: 10px !important;
|
}
|
|
.structure-detail-table colgroup.gutter {
|
display: table-cell !important;
|
width: 10px !important;
|
}
|
|
.final-product-checkout .el-card__header {
|
padding: 0px 20px;
|
border-bottom: 0px;
|
}
|
|
.final-product-checkout .el-card__body {
|
padding: 0px 20px 20px;
|
}
|
|
.orimaterial-quantity .el-card__header {
|
padding: 0px 20px;
|
border-bottom: 0px;
|
}
|
|
.orimaterial-quantity .el-card__body {
|
padding: 0px 20px 20px;
|
}
|
|
.document-materialcost-table th.gutter {
|
display: table-cell !important;
|
width: 10px !important;
|
}
|
|
.document-materialcost-table colgroup.gutter {
|
display: table-cell !important;
|
width: 10px !important;
|
}
|
|
.GooFlow .ico .ico_start:before {
|
color: red;
|
}
|
.highlight-tab-class {
|
color: #006eff;
|
background: #e4e7ed;
|
border-top: 1px solid #006eff;
|
}
|
.unhighlight-tab-class {
|
border: 1px solid #e4e7ed;
|
border-bottom: none;
|
}
|
</style>
|