|
@@ -1,676 +1,676 @@
|
|
-<template>
|
|
|
|
- <el-dialog
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- :close-on-press-escape="false"
|
|
|
|
- :title="title"
|
|
|
|
- :append-to-body="true"
|
|
|
|
- :visible.sync="isVisible"
|
|
|
|
- width="90%"
|
|
|
|
- top="50px"
|
|
|
|
- >
|
|
|
|
- <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
|
|
|
|
- <el-row :gutter="20">
|
|
|
|
- <el-col :span="4">
|
|
|
|
- <el-table
|
|
|
|
- :key="100001"
|
|
|
|
- ref="table"
|
|
|
|
- v-loading="loading"
|
|
|
|
- :data="tableData.data"
|
|
|
|
- border
|
|
|
|
- fit
|
|
|
|
- :highlight-current-row="true"
|
|
|
|
- style="width: 100%;"
|
|
|
|
- @row-click="rowClick"
|
|
|
|
- @current-change="onSelectChange"
|
|
|
|
- header-row-class-name="technologTable"
|
|
|
|
- >
|
|
|
|
- <el-table-column prop="no" :label='$t("prepare.common.tcNo")' align="center" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="20">
|
|
|
|
- <!-- 工序内容 -->
|
|
|
|
- <div class="prossDiv">
|
|
|
|
- <div class="title">{{$t("prepare.common.tcContent")}}</div>
|
|
|
|
- <el-table
|
|
|
|
- ref="tableProcess"
|
|
|
|
- :data="tableData2"
|
|
|
|
- style="width: 100%"
|
|
|
|
- header-row-class-name="technologTable"
|
|
|
|
- >
|
|
|
|
- <!-- 工序编号 -->
|
|
|
|
- <el-table-column prop="id" :label='$t("prepare.table.techno.name")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <!-- 动态表头 -->
|
|
|
|
- <el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.field" :label='item.text' :show-overflow-tooltip="true" width="180px"></el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 工序分析 -->
|
|
|
|
- <div class="prossFenxi">
|
|
|
|
- <div class="title">{{$t("prepare.common.tcFenxi")}}</div>
|
|
|
|
- <div class="content">
|
|
|
|
- <!-- 可执行设备(位置) -->
|
|
|
|
- <equipment-form ref="equipment" @setProgram="setProgram"></equipment-form>
|
|
|
|
-
|
|
|
|
- <!-- 所需原材料 -->
|
|
|
|
- <!-- <material-form ref="material" :technology="currentRow"></material-form> -->
|
|
|
|
-
|
|
|
|
- <!-- 夹具 -->
|
|
|
|
- <tray-form ref="tray" :technology="currentRow" @clearProgram="clearProgram" @setProgram="setProgramByTray"></tray-form>
|
|
|
|
-
|
|
|
|
- <!-- NC程序 -->
|
|
|
|
- <program-form ref="program"></program-form>
|
|
|
|
-
|
|
|
|
- <!-- 人工质检 -->
|
|
|
|
- <!-- <quality-form ref="quality"></quality-form> -->
|
|
|
|
-
|
|
|
|
- <!-- 机械手臂 -->
|
|
|
|
- <!-- <robotarm-form ref="robotarm"></robotarm-form> -->
|
|
|
|
-
|
|
|
|
- <!-- 三坐标质检 -->
|
|
|
|
- <div class="szb">
|
|
|
|
- <!-- 按钮功能 -->
|
|
|
|
- <div class="itemDiv">
|
|
|
|
- <!-- 三坐标质检 -->
|
|
|
|
- <span class="titleSmall">{{$t("prepare.common.szbName")}}</span>
|
|
|
|
- <el-radio-group :disabled="type == 'view' ? true : false" v-model="tenant.threeDimensionalConf" style="margin-right: 15px;">
|
|
|
|
- <el-radio label="0">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
|
|
|
|
- <el-radio label="1">{{$t("prepare.common.idNeed.need")}}</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 输入框(需要) -->
|
|
|
|
- <div v-if="tenant.threeDimensionalConf == '1'" class="szbInput">
|
|
|
|
- <span>
|
|
|
|
- <span>{{ $t("prepare.form.threeDimensionalPrograme") }}:</span>
|
|
|
|
- <el-input v-model="tenant.threeDimensionalPrograme" :placeholder='$t("common.pleaseEnter")' style="width: 500px;"></el-input>
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 三坐标偏置点检测 -->
|
|
|
|
- <div class="szbpzd">
|
|
|
|
- <!-- 按钮功能 -->
|
|
|
|
- <div class="itemDiv">
|
|
|
|
- <!-- 三坐标偏置点检测 -->
|
|
|
|
- <span class="titleSmall">{{$t("prepare.common.threeDimensionalDeviationConf")}}</span>
|
|
|
|
- <el-radio-group :disabled="type == 'view' ? true : false" v-model="tenant.threeDimensionalDeviationConf" style="margin-right: 15px;">
|
|
|
|
- <el-radio label="0">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
|
|
|
|
- <el-radio label="1">{{$t("prepare.common.idNeed.need")}}</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 输入框(需要) -->
|
|
|
|
- <div v-if="tenant.threeDimensionalDeviationConf == '1'" class="szbInput">
|
|
|
|
- <span>
|
|
|
|
- <span>{{ $t("prepare.form.threeDimensionalPrograme") }}:</span>
|
|
|
|
- <el-input v-model="tenant.threeDimensionalDeviationPrograme" :placeholder='$t("common.pleaseEnter")' style="width: 500px;"></el-input>
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 工序抽检配置 -->
|
|
|
|
- <div class="szbpzd">
|
|
|
|
- <!-- 按钮功能 -->
|
|
|
|
- <div class="itemDiv">
|
|
|
|
- <!-- 工序抽检配置 -->
|
|
|
|
- <span class="titleSmall">{{$t("prepare.common.randomCheckConf")}}</span>
|
|
|
|
- <el-radio-group :disabled="type == 'view' ? true : false" v-model="tenant.randomCheckConf" style="margin-right: 15px;">
|
|
|
|
- <el-radio label="0">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
|
|
|
|
- <el-radio label="1">{{$t("prepare.common.idNeed.need")}}</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 输入框(需要) -->
|
|
|
|
- <div v-if="tenant.randomCheckConf == '1'" class="szbInput">
|
|
|
|
- <span>
|
|
|
|
- <span>{{ $t("prepare.form.threeDimensionalPrograme") }}:</span>
|
|
|
|
- <el-input v-model="tenant.randomCheckPrograme" :placeholder='$t("common.pleaseEnter")' style="width: 500px;"></el-input>
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
|
- <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
|
- <el-button plain type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.save') }}</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
-
|
|
|
|
-// 【工艺管理】-API
|
|
|
|
-import technologyMgrApi from "@/api/prepareProductMgr/technologyMgr"
|
|
|
|
-// 【BOM管理】-API
|
|
|
|
-import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
|
|
|
|
-// 【可执行设备(位置)】组件
|
|
|
|
-import EquipmentForm from "./equipmentForm/"
|
|
|
|
-// 【所需原材料】组件
|
|
|
|
-// import MaterialForm from "./materialForm/"
|
|
|
|
-// 【所需原材料】组件
|
|
|
|
-import TrayForm from "./trayForm/"
|
|
|
|
-// 【程序】组件
|
|
|
|
-import ProgramForm from "./programForm/"
|
|
|
|
-// 【人工质检】组件
|
|
|
|
-// import QualityForm from "./qualityForm/"
|
|
|
|
-// 【机械手臂】组件
|
|
|
|
-import RobotarmForm from "./robotarmForm/"
|
|
|
|
-// 【产品工艺版本管理】-API
|
|
|
|
-import technologyVersionApi from "@/api/prepareProductMgr/technologyVersion"
|
|
|
|
-
|
|
|
|
-export default {
|
|
|
|
- name: 'TenantEdit',
|
|
|
|
- components: {
|
|
|
|
- EquipmentForm,
|
|
|
|
- //MaterialForm,
|
|
|
|
- TrayForm,
|
|
|
|
- ProgramForm,
|
|
|
|
- RobotarmForm
|
|
|
|
- // QualityForm
|
|
|
|
- },
|
|
|
|
- props: {
|
|
|
|
- dialogVisible: {
|
|
|
|
- type: Boolean,
|
|
|
|
- default: false
|
|
|
|
- },
|
|
|
|
- title: {
|
|
|
|
- type: String,
|
|
|
|
- default: ''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- data () {
|
|
|
|
- return {
|
|
|
|
- type: 'add',
|
|
|
|
- isEnd: false,
|
|
|
|
- processModeling: null,
|
|
|
|
- loading: false,
|
|
|
|
- tableData: {
|
|
|
|
- count: 0,
|
|
|
|
- data: [], // 内容
|
|
|
|
- titleList: [] // 工序表头
|
|
|
|
- }, // 【左-工序列表】数据
|
|
|
|
- currentRow: null, // 【左-工序列表】当前选择的行数据对象
|
|
|
|
- oldCurrentRow: {}, // 【左-工序列表】前一条选择的行数据对象
|
|
|
|
-
|
|
|
|
- tableData2: [], // 工序内容-数据
|
|
|
|
- processTitleList: [],
|
|
|
|
-
|
|
|
|
- commList: {key: 1}, // 动态的数据对象,比如表单中的select、cascader、radio、checkbox等需要数据的控件
|
|
|
|
- filedList: [], // 字段数据
|
|
|
|
- tenant: this.initTenant(),
|
|
|
|
- screenWidth: 0,
|
|
|
|
- width: this.initWidth(),
|
|
|
|
- confirmDisabled: false,
|
|
|
|
- dicts:{
|
|
|
|
- NATION: {}
|
|
|
|
- },
|
|
|
|
- roles: [],
|
|
|
|
- rules: {
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // 三坐标质检-参数
|
|
|
|
- threeDimensionalConf: '0', // 默认不需要
|
|
|
|
- threeDimensionalPrograme: '', // 检测程序名
|
|
|
|
- // 三坐标偏置点检测
|
|
|
|
- threeDimensionalDeviationConf: '0',
|
|
|
|
- threeDimensionalDeviationPrograme: '',
|
|
|
|
- // 工序抽检配置
|
|
|
|
- randomCheckConf: '0',
|
|
|
|
- randomCheckPrograme: '',
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 监听数据的变化
|
|
|
|
- watch: {
|
|
|
|
- },
|
|
|
|
- // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
|
- created() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- isVisible: {
|
|
|
|
- get () {
|
|
|
|
- return this.dialogVisible
|
|
|
|
- },
|
|
|
|
- set () {
|
|
|
|
- this.close()
|
|
|
|
- this.reset()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // DOM已经加载
|
|
|
|
- mounted () {
|
|
|
|
- window.onresize = () => {
|
|
|
|
- return (() => {
|
|
|
|
- this.width = this.initWidth()
|
|
|
|
- })()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- // 判断是否禁用-【查看】的时候
|
|
|
|
- showRadio(){
|
|
|
|
- return this.type == "view" ? true : false
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- add(){
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- //【左-工序列表】,当某一行被点击时会触发该事件
|
|
|
|
- rowClick(row, column, event){
|
|
|
|
- this.$confirm(this.$t("prepare.tips.saveTips"), this.$t("common.tips"), {
|
|
|
|
- distinguishCancelAndClose: true,
|
|
|
|
- confirmButtonText: this.$t("common.confirm"),
|
|
|
|
- cancelButtonText: this.$t("common.cancel"),
|
|
|
|
- type: "warning"
|
|
|
|
- }).then(() => { // 【确定】按钮-事件
|
|
|
|
- // 切换的时候,保存
|
|
|
|
- this.submitForm('change')
|
|
|
|
- /*// 工序内容-数据
|
|
|
|
- this.tableData2 = [row]
|
|
|
|
- // 根据【工艺id】查询详情信息
|
|
|
|
- this.getDetail(row.id)*/
|
|
|
|
- }).catch(() => { // 【取消】按钮-事件
|
|
|
|
- // 工序内容-数据
|
|
|
|
- this.tableData2 = [row]
|
|
|
|
- // 根据【工艺id】查询详情信息
|
|
|
|
- this.getDetail(row.id)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 【左-工序列表】,Row当表格的当前行发生变化的时候会触发该事件
|
|
|
|
- onSelectChange (currentRow, oldCurrentRow) {
|
|
|
|
- console.log("当前Row数据:", currentRow, oldCurrentRow)
|
|
|
|
- //this.$refs.table.setCurrentRow(currentRow)
|
|
|
|
- // 赋值,上一次选中的行
|
|
|
|
- this.oldCurrentRow = oldCurrentRow
|
|
|
|
- // 赋值当前选中的行
|
|
|
|
- this.currentRow = currentRow
|
|
|
|
- },
|
|
|
|
- // 把【可执行设备(位置)】传来的【需要程序】的数据,赋值给子组件【程序-设备】
|
|
|
|
- setProgram(arr) {
|
|
|
|
- let list = []
|
|
|
|
- arr.map(item => {
|
|
|
|
- // 【需要程序】的设备,才需要设置【程序】
|
|
|
|
- if(item.cncProgram == "1"){
|
|
|
|
- list.push(item)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- this.$refs.program.selectedEq = list
|
|
|
|
- },
|
|
|
|
- // 把【托盘夹具组】传来的【夹具组】的数据,赋值给子组件【程序-夹具组】
|
|
|
|
- setProgramByTray(arr) {
|
|
|
|
- this.$refs.program.selectedTray = arr
|
|
|
|
- },
|
|
|
|
- // 通知【程序】,清空当前数据
|
|
|
|
- clearProgram(){
|
|
|
|
- // console.log("需要清除,程序的数据")
|
|
|
|
- this.$refs.program.tableData = []
|
|
|
|
- },
|
|
|
|
- initTenant () {
|
|
|
|
- return {
|
|
|
|
- // 三坐标质检-参数
|
|
|
|
- threeDimensionalConf: '0', // 默认不需要
|
|
|
|
- threeDimensionalPrograme: '', // 检测程序名
|
|
|
|
- // 三坐标偏置点检测
|
|
|
|
- threeDimensionalDeviationConf: '0',
|
|
|
|
- threeDimensionalDeviationPrograme: '',
|
|
|
|
- // 工序抽检配置
|
|
|
|
- randomCheckConf: '0',
|
|
|
|
- randomCheckPrograme: '',
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- initWidth () {
|
|
|
|
- this.screenWidth = document.body.clientWidth
|
|
|
|
- if (this.screenWidth < 991) {
|
|
|
|
- return '90%'
|
|
|
|
- } else if (this.screenWidth < 1400) {
|
|
|
|
- return '45%'
|
|
|
|
- } else {
|
|
|
|
- return '800px'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- setTenant (val, dicts, processModeling) {
|
|
|
|
- if(val){
|
|
|
|
- this.tenant = { ...val }
|
|
|
|
- }
|
|
|
|
- // 工艺版本信息
|
|
|
|
- this.processModeling = processModeling
|
|
|
|
- // 字典表
|
|
|
|
- this.dicts = dicts
|
|
|
|
- // 查查【工序列表】-左
|
|
|
|
- this.getProcessList()
|
|
|
|
- },
|
|
|
|
- close () {
|
|
|
|
- this.$emit('close')
|
|
|
|
- },
|
|
|
|
- reset () {
|
|
|
|
- // 先清除校验,再清除表单,不然有奇怪的bug
|
|
|
|
- this.$refs.form.clearValidate()
|
|
|
|
- this.$refs.form.resetFields()
|
|
|
|
- this.tenant = this.initTenant()
|
|
|
|
- // 清除【工序内容】
|
|
|
|
- this.tableData2 = []
|
|
|
|
- // 清除【可执行设备(位置)】
|
|
|
|
- this.$refs.equipment.tableData = []
|
|
|
|
- // 清除【所需原材料】
|
|
|
|
- //this.$refs.material.radio = null
|
|
|
|
- //this.$refs.material.tableData = []
|
|
|
|
- // 清除【托盘夹具组】
|
|
|
|
- this.$refs.tray.radio = null
|
|
|
|
- this.$refs.tray.tableData = []
|
|
|
|
- // 清除【程序】
|
|
|
|
- this.$refs.program.radio = null
|
|
|
|
- this.$refs.program.tableData = []
|
|
|
|
- },
|
|
|
|
- submitForm (isFlag) {
|
|
|
|
- // 工艺版本id
|
|
|
|
- this.tenant.id = this.currentRow.id
|
|
|
|
- // 如果是切换【工序】-左的时候保存
|
|
|
|
- if(isFlag == 'change'){
|
|
|
|
- console.log("不走这里阿?", isFlag)
|
|
|
|
- this.tenant.id = this.oldCurrentRow.id
|
|
|
|
- }
|
|
|
|
- // 获取【可执行设备(位置)】数据
|
|
|
|
- this.tenant.productionresourceList = this.$refs.equipment.tableData
|
|
|
|
- // 获取【所需原材料】数据
|
|
|
|
- //this.tenant.armMeterialConf = this.$refs.material.armMeterialConf ? '1' : '0'
|
|
|
|
- //this.tenant.meterialConf = this.$refs.material.radio
|
|
|
|
- //this.tenant.meterialList = this.$refs.material.tableData
|
|
|
|
- // 获取【托盘夹具组】数据
|
|
|
|
- this.tenant.armTrayConf = this.$refs.tray.armTrayConf ? '1' : '0'
|
|
|
|
- this.tenant.armFixtureConf = this.$refs.tray.armFixtureConf ? '1' : '0'
|
|
|
|
- this.tenant.trayConf = this.$refs.tray.radio
|
|
|
|
- this.tenant.procedureTrayList = this.$refs.tray.tableData
|
|
|
|
- // 获取【程序】数据
|
|
|
|
- this.tenant.programConf = this.$refs.program.radio
|
|
|
|
- this.tenant.programList = this.$refs.program.tableData
|
|
|
|
- // 获取【人工质检】数据
|
|
|
|
- //this.tenant.programTest = this.$refs.quality.radio
|
|
|
|
- //this.tenant.procedureTestList = this.$refs.quality.tableData
|
|
|
|
- // 方式
|
|
|
|
- //this.tenant.programTestWay = this.$refs.quality.programTestWay
|
|
|
|
- //this.tenant.directCuttingFlag = this.$refs.quality.directCuttingFlag
|
|
|
|
- //this.tenant.programTestPrograme = this.$refs.quality.programTestPrograme
|
|
|
|
- // 获取【机械手臂】数据
|
|
|
|
- //this.tenant.armConf = this.$refs.robotarm.radio
|
|
|
|
- // 如果是【需要】
|
|
|
|
- /*if(this.tenant.armConf == '2'){
|
|
|
|
- // 验证数据是否填写
|
|
|
|
- if(this.$refs.robotarm.submitForm()){
|
|
|
|
- this.tenant.procedureRobotArm = this.$refs.robotarm.submitForm()
|
|
|
|
- }else{
|
|
|
|
- this.$message({
|
|
|
|
- message: "请填写【机械手臂】信息~",
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
- console.log("表单的数据:", this.tenant)
|
|
|
|
- // 工序内容-简单验证
|
|
|
|
- if(!this.tenant.id){
|
|
|
|
- this.$message({
|
|
|
|
- message: "【工序内容】没有数据~",
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- // 可执行设备(位置)-简单验证
|
|
|
|
- /*if(this.tenant.productionresourceList.length <= 0){
|
|
|
|
- this.$message({
|
|
|
|
- message: "【可执行设备(位置)】没有数据~",
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
- }*/
|
|
|
|
- // 所需原材料-简单验证
|
|
|
|
- /*if(this.tenant.meterialList.length <= 0){
|
|
|
|
- this.$message({
|
|
|
|
- message: "【所需原材料】没有数据~",
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
- }*/
|
|
|
|
- // 托盘夹具组-简单验证
|
|
|
|
- /*if(this.tenant.procedureTrayList.length <= 0){
|
|
|
|
- this.$message({
|
|
|
|
- message: "【托盘夹具组)】没有数据~",
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
- }*/
|
|
|
|
- // 程序-简单验证
|
|
|
|
- /*if(this.tenant.programList.length <= 0){
|
|
|
|
- this.$message({
|
|
|
|
- message: "【程序)】没有数据~",
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
- }*/
|
|
|
|
- // return false
|
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.confirmDisabled = true
|
|
|
|
- this.save(isFlag)
|
|
|
|
- } else {
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- save (isFlag) {
|
|
|
|
- technologyVersionApi.saveProcessAnalysis(this.tenant)
|
|
|
|
- .then((response) => {
|
|
|
|
- const res = response.data
|
|
|
|
- if (res.isSuccess) {
|
|
|
|
- // 关闭页面
|
|
|
|
- // this.isVisible = false
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
|
- type: 'success'
|
|
|
|
- })
|
|
|
|
- // 通知列表
|
|
|
|
- this.$emit("success");
|
|
|
|
- // 如果是切换【工序】-左的保存
|
|
|
|
- if(isFlag == 'change'){
|
|
|
|
- // 工序内容-数据
|
|
|
|
- this.tableData2 = [this.currentRow]
|
|
|
|
- // 根据【工艺id】查询详情信息
|
|
|
|
- this.getDetail(this.currentRow.id)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }).finally(() => {
|
|
|
|
- this.confirmDisabled = false
|
|
|
|
- return true
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- update () {
|
|
|
|
- bomMgrApi.update(this.tenant)
|
|
|
|
- .then((response) => {
|
|
|
|
- const res = response.data
|
|
|
|
- if (res.isSuccess) {
|
|
|
|
- this.isVisible = false
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t('tips.optionSuccess'),
|
|
|
|
- type: 'success'
|
|
|
|
- })
|
|
|
|
- // 通知列表
|
|
|
|
- this.$emit("success");
|
|
|
|
- // 通知列表-并关闭弹出框
|
|
|
|
- this.$emit("close");
|
|
|
|
- }
|
|
|
|
- }).finally(() => {
|
|
|
|
- this.confirmDisabled = false
|
|
|
|
- return true
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 查询【工序列表】-左
|
|
|
|
- getProcessList (params = {}) {
|
|
|
|
- this.loading = true
|
|
|
|
- // 参数 bomVersionId 、bomId
|
|
|
|
- // 获取Bom产品的id
|
|
|
|
- let obj = {
|
|
|
|
- bizType: "0", // 0 : 是工艺版本的列表; 如果是1 的话,则是正式工艺的列表
|
|
|
|
- bomId: this.processModeling.bomId,
|
|
|
|
- bomVersionId: this.processModeling.id,
|
|
|
|
- size: 1000
|
|
|
|
- }
|
|
|
|
- technologyMgrApi.pageList(obj).then(response => {
|
|
|
|
- const res = response.data
|
|
|
|
- console.log("【工序列表111】-左:", res)
|
|
|
|
- if (res.isSuccess) {
|
|
|
|
- // 工序的数据
|
|
|
|
- this.tableData = res.data
|
|
|
|
- // 如果数据存在--默认选中第一条数据
|
|
|
|
- if(this.tableData.data.length > 0){
|
|
|
|
- // 把当前选择的行,设置checkbox
|
|
|
|
- this.$refs.table.setCurrentRow(this.tableData.data[0])
|
|
|
|
- // 初始化的时候,上一个数据也是本身
|
|
|
|
- this.oldCurrentRow = this.tableData.data[0]
|
|
|
|
- // 工序内容-数据
|
|
|
|
- this.tableData2 = [this.tableData.data[0]]
|
|
|
|
- // 根据【工艺id】查询详情信息
|
|
|
|
- this.getDetail(this.tableData.data[0].id)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // eslint-disable-next-line no-return-assign
|
|
|
|
- }).finally(() => this.loading = false)
|
|
|
|
- },
|
|
|
|
- // 根据【工艺id】查询详情信息
|
|
|
|
- getDetail(id){
|
|
|
|
- technologyVersionApi.getProcessAnalysis({id}).then(res => {
|
|
|
|
- res = res.data
|
|
|
|
- if(res.isSuccess){
|
|
|
|
- console.log("详情信息:", res.data)
|
|
|
|
-
|
|
|
|
- // 给各个组件赋值
|
|
|
|
- // 获取【可执行设备(位置)】数据
|
|
|
|
- let eqList = this.setKeyList(res.data.productionresourceList)
|
|
|
|
- this.$refs.equipment.setTableData(this.setKeyList(res.data.productionresourceList))
|
|
|
|
- // 把【设备】的数据,给【程序】使用
|
|
|
|
- // this.setProgram(eqList)
|
|
|
|
- // 获取【所需原材料】数据
|
|
|
|
- /*if(!!res.data.meterialConf){
|
|
|
|
- this.$refs.material.radio = res.data.meterialConf
|
|
|
|
- }*/
|
|
|
|
- //this.$refs.material.armMeterialConf = res.data.armMeterialConf == '1' ? true : false
|
|
|
|
- //this.$refs.material.tableData = this.setKeyList(res.data.meterialList)
|
|
|
|
- // 获取【托盘夹具组】数据
|
|
|
|
- if(!!res.data.trayConf){
|
|
|
|
- this.$refs.tray.radio = res.data.trayConf
|
|
|
|
- }
|
|
|
|
- this.$refs.tray.armTrayConf = res.data.armTrayConf == '1' ? true : false
|
|
|
|
- this.$refs.tray.armFixtureConf = res.data.armFixtureConf == '1' ? true : false
|
|
|
|
- this.$refs.tray.setDataMustSpan(this.setKeyList(res.data.procedureTrayList, 'tray'))
|
|
|
|
- // 获取【程序】数据
|
|
|
|
- if(!!res.data.programConf){
|
|
|
|
- this.$refs.program.radio = res.data.programConf
|
|
|
|
- }
|
|
|
|
- this.$refs.program.tableData = this.setKeyList(res.data.programList)
|
|
|
|
- // 赋值-三坐标系列
|
|
|
|
- this.tenant = {
|
|
|
|
- threeDimensionalConf: res.data.threeDimensionalConf==null? "0" : res.data.threeDimensionalConf,
|
|
|
|
- threeDimensionalPrograme: res.data.threeDimensionalPrograme==null? "": res.data.threeDimensionalPrograme,
|
|
|
|
- threeDimensionalDeviationConf: res.data.threeDimensionalDeviationConf==null? "0" : res.data.threeDimensionalDeviationConf,
|
|
|
|
- threeDimensionalDeviationPrograme: res.data.threeDimensionalDeviationPrograme==null? "":res.data.threeDimensionalDeviationPrograme,
|
|
|
|
- // 工序抽检配置
|
|
|
|
- randomCheckConf: res.data.randomCheckConf==null? "0" : res.data.randomCheckConf,
|
|
|
|
- randomCheckPrograme: res.data.randomCheckPrograme==null? "" : res.data.randomCheckPrograme
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- // 获取【人工质检】数据
|
|
|
|
- /*if(!!res.data.programTest){
|
|
|
|
- this.$refs.quality.radio = res.data.programTest
|
|
|
|
- // 方式
|
|
|
|
- this.$refs.quality.programTestWay = res.data.programTestWay
|
|
|
|
- this.$refs.quality.directCuttingFlag = res.data.directCuttingFlag
|
|
|
|
- this.$refs.quality.programTestPrograme = res.data.programTestPrograme
|
|
|
|
- }*/
|
|
|
|
- // this.$refs.quality.tableData = this.setKeyList(res.data.procedureTestList)
|
|
|
|
- // 获取【机械手臂】数据
|
|
|
|
- /*this.$refs.robotarm.radio = res.data.armConf
|
|
|
|
- if(res.data.armConf == '2'){
|
|
|
|
- if(res.data.procedureRobotArm){
|
|
|
|
- // this.$refs.robotarm.tenant = res.data.procedureRobotArm
|
|
|
|
- this.$refs.robotarm.setTenant(res.data.procedureRobotArm)
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 赋值前处理-添加key数据健
|
|
|
|
- setKeyList(list, flag){
|
|
|
|
- if(list && list.length > 0){
|
|
|
|
- let arr = []
|
|
|
|
- list.forEach(item => {
|
|
|
|
- // 添加唯一键
|
|
|
|
- item.key = ''+ Math.random()
|
|
|
|
- // 如果是托盘夹具的时候,组装分类
|
|
|
|
- if(flag == 'tray'){
|
|
|
|
- // 把【组序】和【优先级】改成字符串
|
|
|
|
- //item.groupSort = ''+ item.groupSort
|
|
|
|
- //item.groupPrority = ''+ item.groupPrority
|
|
|
|
- // 给图片一个列表数据,jjImgList
|
|
|
|
- item.jjImgList = []
|
|
|
|
- if(!!item.armorPic){
|
|
|
|
- item.jjImgList.push(item.armorPic)
|
|
|
|
- }
|
|
|
|
- // 添加类型
|
|
|
|
- /*if(item.bizType == '1'){
|
|
|
|
- item.category = {key: '03',data: '托盘'}
|
|
|
|
- }else{
|
|
|
|
- item.category = {key: '02',data: '夹具'}
|
|
|
|
- }*/
|
|
|
|
- }
|
|
|
|
- arr.push(item)
|
|
|
|
- })
|
|
|
|
- list = arr
|
|
|
|
- }else{
|
|
|
|
- list = []
|
|
|
|
- }
|
|
|
|
- return list
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</script>
|
|
|
|
-<style lang="scss" scoped="">
|
|
|
|
- .title{
|
|
|
|
- position: relative;
|
|
|
|
- padding-left: 20px;
|
|
|
|
- padding-bottom: 5px;
|
|
|
|
- border-bottom: 1px dotted #1890ff;
|
|
|
|
- }
|
|
|
|
- .title:before{
|
|
|
|
- content: '';
|
|
|
|
- position: absolute;
|
|
|
|
- background: #1890ff;
|
|
|
|
- width: 10px;
|
|
|
|
- height: 70%;
|
|
|
|
- left: 0;
|
|
|
|
- top: 1px;
|
|
|
|
- }
|
|
|
|
- .prossFenxi{
|
|
|
|
- margin-top: 15px;
|
|
|
|
- }
|
|
|
|
- .content{
|
|
|
|
- margin-top: 10px;
|
|
|
|
- }
|
|
|
|
- .titleSmall{
|
|
|
|
- position: relative;
|
|
|
|
- padding-left: 10px;
|
|
|
|
- margin-right: 15px;
|
|
|
|
- }
|
|
|
|
- .titleSmall:before{
|
|
|
|
- content: '';
|
|
|
|
- position: absolute;
|
|
|
|
- background: #1890ff;
|
|
|
|
- width: 5px;
|
|
|
|
- height: 90%;
|
|
|
|
- left: 0;
|
|
|
|
- top: 1px;
|
|
|
|
- }
|
|
|
|
- .itemDiv{
|
|
|
|
- margin: 10px 0;
|
|
|
|
- }
|
|
|
|
-</style>
|
|
|
|
|
|
+<template>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :close-on-press-escape="false"
|
|
|
|
+ :title="title"
|
|
|
|
+ :append-to-body="true"
|
|
|
|
+ :visible.sync="isVisible"
|
|
|
|
+ width="90%"
|
|
|
|
+ top="50px"
|
|
|
|
+ >
|
|
|
|
+ <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :span="4">
|
|
|
|
+ <el-table
|
|
|
|
+ :key="100001"
|
|
|
|
+ ref="table"
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="tableData.data"
|
|
|
|
+ border
|
|
|
|
+ fit
|
|
|
|
+ :highlight-current-row="true"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ @row-click="rowClick"
|
|
|
|
+ @current-change="onSelectChange"
|
|
|
|
+ header-row-class-name="technologTable"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column prop="no" :label='$t("prepare.common.tcNo")' align="center" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="20">
|
|
|
|
+ <!-- 工序内容 -->
|
|
|
|
+ <div class="prossDiv">
|
|
|
|
+ <div class="title">{{$t("prepare.common.tcContent")}}</div>
|
|
|
|
+ <el-table
|
|
|
|
+ ref="tableProcess"
|
|
|
|
+ :data="tableData2"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ header-row-class-name="technologTable"
|
|
|
|
+ >
|
|
|
|
+ <!-- 工序编号 -->
|
|
|
|
+<!-- <el-table-column prop="id" :label='$t("prepare.table.techno.name")' :show-overflow-tooltip="true"></el-table-column>-->
|
|
|
|
+ <!-- 动态表头 -->
|
|
|
|
+ <el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.field" :label='item.text' :show-overflow-tooltip="true" width="180px"></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 工序分析 -->
|
|
|
|
+ <div class="prossFenxi">
|
|
|
|
+ <div class="title">{{$t("prepare.common.tcFenxi")}}</div>
|
|
|
|
+ <div class="content">
|
|
|
|
+ <!-- 可执行设备(位置) -->
|
|
|
|
+ <equipment-form ref="equipment" @setProgram="setProgram"></equipment-form>
|
|
|
|
+
|
|
|
|
+ <!-- 所需原材料 -->
|
|
|
|
+ <!-- <material-form ref="material" :technology="currentRow"></material-form> -->
|
|
|
|
+
|
|
|
|
+ <!-- 夹具 -->
|
|
|
|
+ <tray-form ref="tray" :technology="currentRow" @clearProgram="clearProgram" @setProgram="setProgramByTray"></tray-form>
|
|
|
|
+
|
|
|
|
+ <!-- NC程序 -->
|
|
|
|
+ <program-form ref="program"></program-form>
|
|
|
|
+
|
|
|
|
+ <!-- 人工质检 -->
|
|
|
|
+ <!-- <quality-form ref="quality"></quality-form> -->
|
|
|
|
+
|
|
|
|
+ <!-- 机械手臂 -->
|
|
|
|
+ <!-- <robotarm-form ref="robotarm"></robotarm-form> -->
|
|
|
|
+
|
|
|
|
+ <!-- 三坐标质检 -->
|
|
|
|
+ <div class="szb">
|
|
|
|
+ <!-- 按钮功能 -->
|
|
|
|
+ <div class="itemDiv">
|
|
|
|
+ <!-- 三坐标质检 -->
|
|
|
|
+ <span class="titleSmall">{{$t("prepare.common.szbName")}}</span>
|
|
|
|
+ <el-radio-group :disabled="type == 'view' ? true : false" v-model="tenant.threeDimensionalConf" style="margin-right: 15px;">
|
|
|
|
+ <el-radio label="0">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
|
|
|
|
+ <el-radio label="1">{{$t("prepare.common.idNeed.need")}}</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 输入框(需要) -->
|
|
|
|
+ <div v-if="tenant.threeDimensionalConf == '1'" class="szbInput">
|
|
|
|
+ <span>
|
|
|
|
+ <span>{{ $t("prepare.form.threeDimensionalPrograme") }}:</span>
|
|
|
|
+ <el-input v-model="tenant.threeDimensionalPrograme" :placeholder='$t("common.pleaseEnter")' style="width: 500px;"></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 三坐标偏置点检测 -->
|
|
|
|
+ <div class="szbpzd">
|
|
|
|
+ <!-- 按钮功能 -->
|
|
|
|
+ <div class="itemDiv">
|
|
|
|
+ <!-- 三坐标偏置点检测 -->
|
|
|
|
+ <span class="titleSmall">{{$t("prepare.common.threeDimensionalDeviationConf")}}</span>
|
|
|
|
+ <el-radio-group :disabled="type == 'view' ? true : false" v-model="tenant.threeDimensionalDeviationConf" style="margin-right: 15px;">
|
|
|
|
+ <el-radio label="0">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
|
|
|
|
+ <el-radio label="1">{{$t("prepare.common.idNeed.need")}}</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 输入框(需要) -->
|
|
|
|
+ <div v-if="tenant.threeDimensionalDeviationConf == '1'" class="szbInput">
|
|
|
|
+ <span>
|
|
|
|
+ <span>{{ $t("prepare.form.threeDimensionalPrograme") }}:</span>
|
|
|
|
+ <el-input v-model="tenant.threeDimensionalDeviationPrograme" :placeholder='$t("common.pleaseEnter")' style="width: 500px;"></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 工序抽检配置 -->
|
|
|
|
+ <div class="szbpzd">
|
|
|
|
+ <!-- 按钮功能 -->
|
|
|
|
+ <div class="itemDiv">
|
|
|
|
+ <!-- 工序抽检配置 -->
|
|
|
|
+ <span class="titleSmall">{{$t("prepare.common.randomCheckConf")}}</span>
|
|
|
|
+ <el-radio-group :disabled="type == 'view' ? true : false" v-model="tenant.randomCheckConf" style="margin-right: 15px;">
|
|
|
|
+ <el-radio label="0">{{$t("prepare.common.idNeed.unneed")}}</el-radio>
|
|
|
|
+ <el-radio label="1">{{$t("prepare.common.idNeed.need")}}</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 输入框(需要) -->
|
|
|
|
+ <div v-if="tenant.randomCheckConf == '1'" class="szbInput">
|
|
|
|
+ <span>
|
|
|
|
+ <span>{{ $t("prepare.form.threeDimensionalPrograme") }}:</span>
|
|
|
|
+ <el-input v-model="tenant.randomCheckPrograme" :placeholder='$t("common.pleaseEnter")' style="width: 500px;"></el-input>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
|
|
|
|
+ <el-button plain type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.save') }}</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+
|
|
|
|
+// 【工艺管理】-API
|
|
|
|
+import technologyMgrApi from "@/api/prepareProductMgr/technologyMgr"
|
|
|
|
+// 【BOM管理】-API
|
|
|
|
+import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
|
|
|
|
+// 【可执行设备(位置)】组件
|
|
|
|
+import EquipmentForm from "./equipmentForm/"
|
|
|
|
+// 【所需原材料】组件
|
|
|
|
+// import MaterialForm from "./materialForm/"
|
|
|
|
+// 【所需原材料】组件
|
|
|
|
+import TrayForm from "./trayForm/"
|
|
|
|
+// 【程序】组件
|
|
|
|
+import ProgramForm from "./programForm/"
|
|
|
|
+// 【人工质检】组件
|
|
|
|
+// import QualityForm from "./qualityForm/"
|
|
|
|
+// 【机械手臂】组件
|
|
|
|
+import RobotarmForm from "./robotarmForm/"
|
|
|
|
+// 【产品工艺版本管理】-API
|
|
|
|
+import technologyVersionApi from "@/api/prepareProductMgr/technologyVersion"
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: 'TenantEdit',
|
|
|
|
+ components: {
|
|
|
|
+ EquipmentForm,
|
|
|
|
+ //MaterialForm,
|
|
|
|
+ TrayForm,
|
|
|
|
+ ProgramForm,
|
|
|
|
+ RobotarmForm
|
|
|
|
+ // QualityForm
|
|
|
|
+ },
|
|
|
|
+ props: {
|
|
|
|
+ dialogVisible: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ },
|
|
|
|
+ title: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ type: 'add',
|
|
|
|
+ isEnd: false,
|
|
|
|
+ processModeling: null,
|
|
|
|
+ loading: false,
|
|
|
|
+ tableData: {
|
|
|
|
+ count: 0,
|
|
|
|
+ data: [], // 内容
|
|
|
|
+ titleList: [] // 工序表头
|
|
|
|
+ }, // 【左-工序列表】数据
|
|
|
|
+ currentRow: null, // 【左-工序列表】当前选择的行数据对象
|
|
|
|
+ oldCurrentRow: {}, // 【左-工序列表】前一条选择的行数据对象
|
|
|
|
+
|
|
|
|
+ tableData2: [], // 工序内容-数据
|
|
|
|
+ processTitleList: [],
|
|
|
|
+
|
|
|
|
+ commList: {key: 1}, // 动态的数据对象,比如表单中的select、cascader、radio、checkbox等需要数据的控件
|
|
|
|
+ filedList: [], // 字段数据
|
|
|
|
+ tenant: this.initTenant(),
|
|
|
|
+ screenWidth: 0,
|
|
|
|
+ width: this.initWidth(),
|
|
|
|
+ confirmDisabled: false,
|
|
|
|
+ dicts:{
|
|
|
|
+ NATION: {}
|
|
|
|
+ },
|
|
|
|
+ roles: [],
|
|
|
|
+ rules: {
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 三坐标质检-参数
|
|
|
|
+ threeDimensionalConf: '0', // 默认不需要
|
|
|
|
+ threeDimensionalPrograme: '', // 检测程序名
|
|
|
|
+ // 三坐标偏置点检测
|
|
|
|
+ threeDimensionalDeviationConf: '0',
|
|
|
|
+ threeDimensionalDeviationPrograme: '',
|
|
|
|
+ // 工序抽检配置
|
|
|
|
+ randomCheckConf: '0',
|
|
|
|
+ randomCheckPrograme: '',
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 监听数据的变化
|
|
|
|
+ watch: {
|
|
|
|
+ },
|
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
|
+ created() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ isVisible: {
|
|
|
|
+ get () {
|
|
|
|
+ return this.dialogVisible
|
|
|
|
+ },
|
|
|
|
+ set () {
|
|
|
|
+ this.close()
|
|
|
|
+ this.reset()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // DOM已经加载
|
|
|
|
+ mounted () {
|
|
|
|
+ window.onresize = () => {
|
|
|
|
+ return (() => {
|
|
|
|
+ this.width = this.initWidth()
|
|
|
|
+ })()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 判断是否禁用-【查看】的时候
|
|
|
|
+ showRadio(){
|
|
|
|
+ return this.type == "view" ? true : false
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ add(){
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ //【左-工序列表】,当某一行被点击时会触发该事件
|
|
|
|
+ rowClick(row, column, event){
|
|
|
|
+ this.$confirm(this.$t("prepare.tips.saveTips"), this.$t("common.tips"), {
|
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(() => { // 【确定】按钮-事件
|
|
|
|
+ // 切换的时候,保存
|
|
|
|
+ this.submitForm('change')
|
|
|
|
+ /*// 工序内容-数据
|
|
|
|
+ this.tableData2 = [row]
|
|
|
|
+ // 根据【工艺id】查询详情信息
|
|
|
|
+ this.getDetail(row.id)*/
|
|
|
|
+ }).catch(() => { // 【取消】按钮-事件
|
|
|
|
+ // 工序内容-数据
|
|
|
|
+ this.tableData2 = [row]
|
|
|
|
+ // 根据【工艺id】查询详情信息
|
|
|
|
+ this.getDetail(row.id)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 【左-工序列表】,Row当表格的当前行发生变化的时候会触发该事件
|
|
|
|
+ onSelectChange (currentRow, oldCurrentRow) {
|
|
|
|
+ console.log("当前Row数据:", currentRow, oldCurrentRow)
|
|
|
|
+ //this.$refs.table.setCurrentRow(currentRow)
|
|
|
|
+ // 赋值,上一次选中的行
|
|
|
|
+ this.oldCurrentRow = oldCurrentRow
|
|
|
|
+ // 赋值当前选中的行
|
|
|
|
+ this.currentRow = currentRow
|
|
|
|
+ },
|
|
|
|
+ // 把【可执行设备(位置)】传来的【需要程序】的数据,赋值给子组件【程序-设备】
|
|
|
|
+ setProgram(arr) {
|
|
|
|
+ let list = []
|
|
|
|
+ arr.map(item => {
|
|
|
|
+ // 【需要程序】的设备,才需要设置【程序】
|
|
|
|
+ if(item.cncProgram == "1"){
|
|
|
|
+ list.push(item)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.$refs.program.selectedEq = list
|
|
|
|
+ },
|
|
|
|
+ // 把【托盘夹具组】传来的【夹具组】的数据,赋值给子组件【程序-夹具组】
|
|
|
|
+ setProgramByTray(arr) {
|
|
|
|
+ this.$refs.program.selectedTray = arr
|
|
|
|
+ },
|
|
|
|
+ // 通知【程序】,清空当前数据
|
|
|
|
+ clearProgram(){
|
|
|
|
+ // console.log("需要清除,程序的数据")
|
|
|
|
+ this.$refs.program.tableData = []
|
|
|
|
+ },
|
|
|
|
+ initTenant () {
|
|
|
|
+ return {
|
|
|
|
+ // 三坐标质检-参数
|
|
|
|
+ threeDimensionalConf: '0', // 默认不需要
|
|
|
|
+ threeDimensionalPrograme: '', // 检测程序名
|
|
|
|
+ // 三坐标偏置点检测
|
|
|
|
+ threeDimensionalDeviationConf: '0',
|
|
|
|
+ threeDimensionalDeviationPrograme: '',
|
|
|
|
+ // 工序抽检配置
|
|
|
|
+ randomCheckConf: '0',
|
|
|
|
+ randomCheckPrograme: '',
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ initWidth () {
|
|
|
|
+ this.screenWidth = document.body.clientWidth
|
|
|
|
+ if (this.screenWidth < 991) {
|
|
|
|
+ return '90%'
|
|
|
|
+ } else if (this.screenWidth < 1400) {
|
|
|
|
+ return '45%'
|
|
|
|
+ } else {
|
|
|
|
+ return '800px'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ setTenant (val, dicts, processModeling) {
|
|
|
|
+ if(val){
|
|
|
|
+ this.tenant = { ...val }
|
|
|
|
+ }
|
|
|
|
+ // 工艺版本信息
|
|
|
|
+ this.processModeling = processModeling
|
|
|
|
+ // 字典表
|
|
|
|
+ this.dicts = dicts
|
|
|
|
+ // 查查【工序列表】-左
|
|
|
|
+ this.getProcessList()
|
|
|
|
+ },
|
|
|
|
+ close () {
|
|
|
|
+ this.$emit('close')
|
|
|
|
+ },
|
|
|
|
+ reset () {
|
|
|
|
+ // 先清除校验,再清除表单,不然有奇怪的bug
|
|
|
|
+ this.$refs.form.clearValidate()
|
|
|
|
+ this.$refs.form.resetFields()
|
|
|
|
+ this.tenant = this.initTenant()
|
|
|
|
+ // 清除【工序内容】
|
|
|
|
+ this.tableData2 = []
|
|
|
|
+ // 清除【可执行设备(位置)】
|
|
|
|
+ this.$refs.equipment.tableData = []
|
|
|
|
+ // 清除【所需原材料】
|
|
|
|
+ //this.$refs.material.radio = null
|
|
|
|
+ //this.$refs.material.tableData = []
|
|
|
|
+ // 清除【托盘夹具组】
|
|
|
|
+ this.$refs.tray.radio = null
|
|
|
|
+ this.$refs.tray.tableData = []
|
|
|
|
+ // 清除【程序】
|
|
|
|
+ this.$refs.program.radio = null
|
|
|
|
+ this.$refs.program.tableData = []
|
|
|
|
+ },
|
|
|
|
+ submitForm (isFlag) {
|
|
|
|
+ // 工艺版本id
|
|
|
|
+ this.tenant.id = this.currentRow.id
|
|
|
|
+ // 如果是切换【工序】-左的时候保存
|
|
|
|
+ if(isFlag == 'change'){
|
|
|
|
+ console.log("不走这里阿?", isFlag)
|
|
|
|
+ this.tenant.id = this.oldCurrentRow.id
|
|
|
|
+ }
|
|
|
|
+ // 获取【可执行设备(位置)】数据
|
|
|
|
+ this.tenant.productionresourceList = this.$refs.equipment.tableData
|
|
|
|
+ // 获取【所需原材料】数据
|
|
|
|
+ //this.tenant.armMeterialConf = this.$refs.material.armMeterialConf ? '1' : '0'
|
|
|
|
+ //this.tenant.meterialConf = this.$refs.material.radio
|
|
|
|
+ //this.tenant.meterialList = this.$refs.material.tableData
|
|
|
|
+ // 获取【托盘夹具组】数据
|
|
|
|
+ this.tenant.armTrayConf = this.$refs.tray.armTrayConf ? '1' : '0'
|
|
|
|
+ this.tenant.armFixtureConf = this.$refs.tray.armFixtureConf ? '1' : '0'
|
|
|
|
+ this.tenant.trayConf = this.$refs.tray.radio
|
|
|
|
+ this.tenant.procedureTrayList = this.$refs.tray.tableData
|
|
|
|
+ // 获取【程序】数据
|
|
|
|
+ this.tenant.programConf = this.$refs.program.radio
|
|
|
|
+ this.tenant.programList = this.$refs.program.tableData
|
|
|
|
+ // 获取【人工质检】数据
|
|
|
|
+ //this.tenant.programTest = this.$refs.quality.radio
|
|
|
|
+ //this.tenant.procedureTestList = this.$refs.quality.tableData
|
|
|
|
+ // 方式
|
|
|
|
+ //this.tenant.programTestWay = this.$refs.quality.programTestWay
|
|
|
|
+ //this.tenant.directCuttingFlag = this.$refs.quality.directCuttingFlag
|
|
|
|
+ //this.tenant.programTestPrograme = this.$refs.quality.programTestPrograme
|
|
|
|
+ // 获取【机械手臂】数据
|
|
|
|
+ //this.tenant.armConf = this.$refs.robotarm.radio
|
|
|
|
+ // 如果是【需要】
|
|
|
|
+ /*if(this.tenant.armConf == '2'){
|
|
|
|
+ // 验证数据是否填写
|
|
|
|
+ if(this.$refs.robotarm.submitForm()){
|
|
|
|
+ this.tenant.procedureRobotArm = this.$refs.robotarm.submitForm()
|
|
|
|
+ }else{
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "请填写【机械手臂】信息~",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+ console.log("表单的数据:", this.tenant)
|
|
|
|
+ // 工序内容-简单验证
|
|
|
|
+ if(!this.tenant.id){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "【工序内容】没有数据~",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ // 可执行设备(位置)-简单验证
|
|
|
|
+ /*if(this.tenant.productionresourceList.length <= 0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "【可执行设备(位置)】没有数据~",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }*/
|
|
|
|
+ // 所需原材料-简单验证
|
|
|
|
+ /*if(this.tenant.meterialList.length <= 0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "【所需原材料】没有数据~",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }*/
|
|
|
|
+ // 托盘夹具组-简单验证
|
|
|
|
+ /*if(this.tenant.procedureTrayList.length <= 0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "【托盘夹具组)】没有数据~",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }*/
|
|
|
|
+ // 程序-简单验证
|
|
|
|
+ /*if(this.tenant.programList.length <= 0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "【程序)】没有数据~",
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }*/
|
|
|
|
+ // return false
|
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.confirmDisabled = true
|
|
|
|
+ this.save(isFlag)
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ save (isFlag) {
|
|
|
|
+ technologyVersionApi.saveProcessAnalysis(this.tenant)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ const res = response.data
|
|
|
|
+ if (res.isSuccess) {
|
|
|
|
+ // 关闭页面
|
|
|
|
+ // this.isVisible = false
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
|
+ type: 'success'
|
|
|
|
+ })
|
|
|
|
+ // 通知列表
|
|
|
|
+ this.$emit("success");
|
|
|
|
+ // 如果是切换【工序】-左的保存
|
|
|
|
+ if(isFlag == 'change'){
|
|
|
|
+ // 工序内容-数据
|
|
|
|
+ this.tableData2 = [this.currentRow]
|
|
|
|
+ // 根据【工艺id】查询详情信息
|
|
|
|
+ this.getDetail(this.currentRow.id)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.confirmDisabled = false
|
|
|
|
+ return true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ update () {
|
|
|
|
+ bomMgrApi.update(this.tenant)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ const res = response.data
|
|
|
|
+ if (res.isSuccess) {
|
|
|
|
+ this.isVisible = false
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
|
+ type: 'success'
|
|
|
|
+ })
|
|
|
|
+ // 通知列表
|
|
|
|
+ this.$emit("success");
|
|
|
|
+ // 通知列表-并关闭弹出框
|
|
|
|
+ this.$emit("close");
|
|
|
|
+ }
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.confirmDisabled = false
|
|
|
|
+ return true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 查询【工序列表】-左
|
|
|
|
+ getProcessList (params = {}) {
|
|
|
|
+ this.loading = true
|
|
|
|
+ // 参数 bomVersionId 、bomId
|
|
|
|
+ // 获取Bom产品的id
|
|
|
|
+ let obj = {
|
|
|
|
+ bizType: "0", // 0 : 是工艺版本的列表; 如果是1 的话,则是正式工艺的列表
|
|
|
|
+ bomId: this.processModeling.bomId,
|
|
|
|
+ bomVersionId: this.processModeling.id,
|
|
|
|
+ size: 1000
|
|
|
|
+ }
|
|
|
|
+ technologyMgrApi.pageList(obj).then(response => {
|
|
|
|
+ const res = response.data
|
|
|
|
+ console.log("【工序列表111】-左:", res)
|
|
|
|
+ if (res.isSuccess) {
|
|
|
|
+ // 工序的数据
|
|
|
|
+ this.tableData = res.data
|
|
|
|
+ // 如果数据存在--默认选中第一条数据
|
|
|
|
+ if(this.tableData.data.length > 0){
|
|
|
|
+ // 把当前选择的行,设置checkbox
|
|
|
|
+ this.$refs.table.setCurrentRow(this.tableData.data[0])
|
|
|
|
+ // 初始化的时候,上一个数据也是本身
|
|
|
|
+ this.oldCurrentRow = this.tableData.data[0]
|
|
|
|
+ // 工序内容-数据
|
|
|
|
+ this.tableData2 = [this.tableData.data[0]]
|
|
|
|
+ // 根据【工艺id】查询详情信息
|
|
|
|
+ this.getDetail(this.tableData.data[0].id)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
|
+ },
|
|
|
|
+ // 根据【工艺id】查询详情信息
|
|
|
|
+ getDetail(id){
|
|
|
|
+ technologyVersionApi.getProcessAnalysis({id}).then(res => {
|
|
|
|
+ res = res.data
|
|
|
|
+ if(res.isSuccess){
|
|
|
|
+ console.log("详情信息:", res.data)
|
|
|
|
+
|
|
|
|
+ // 给各个组件赋值
|
|
|
|
+ // 获取【可执行设备(位置)】数据
|
|
|
|
+ let eqList = this.setKeyList(res.data.productionresourceList)
|
|
|
|
+ this.$refs.equipment.setTableData(this.setKeyList(res.data.productionresourceList))
|
|
|
|
+ // 把【设备】的数据,给【程序】使用
|
|
|
|
+ // this.setProgram(eqList)
|
|
|
|
+ // 获取【所需原材料】数据
|
|
|
|
+ /*if(!!res.data.meterialConf){
|
|
|
|
+ this.$refs.material.radio = res.data.meterialConf
|
|
|
|
+ }*/
|
|
|
|
+ //this.$refs.material.armMeterialConf = res.data.armMeterialConf == '1' ? true : false
|
|
|
|
+ //this.$refs.material.tableData = this.setKeyList(res.data.meterialList)
|
|
|
|
+ // 获取【托盘夹具组】数据
|
|
|
|
+ if(!!res.data.trayConf){
|
|
|
|
+ this.$refs.tray.radio = res.data.trayConf
|
|
|
|
+ }
|
|
|
|
+ this.$refs.tray.armTrayConf = res.data.armTrayConf == '1' ? true : false
|
|
|
|
+ this.$refs.tray.armFixtureConf = res.data.armFixtureConf == '1' ? true : false
|
|
|
|
+ this.$refs.tray.setDataMustSpan(this.setKeyList(res.data.procedureTrayList, 'tray'))
|
|
|
|
+ // 获取【程序】数据
|
|
|
|
+ if(!!res.data.programConf){
|
|
|
|
+ this.$refs.program.radio = res.data.programConf
|
|
|
|
+ }
|
|
|
|
+ this.$refs.program.tableData = this.setKeyList(res.data.programList)
|
|
|
|
+ // 赋值-三坐标系列
|
|
|
|
+ this.tenant = {
|
|
|
|
+ threeDimensionalConf: res.data.threeDimensionalConf==null? "0" : res.data.threeDimensionalConf,
|
|
|
|
+ threeDimensionalPrograme: res.data.threeDimensionalPrograme==null? "": res.data.threeDimensionalPrograme,
|
|
|
|
+ threeDimensionalDeviationConf: res.data.threeDimensionalDeviationConf==null? "0" : res.data.threeDimensionalDeviationConf,
|
|
|
|
+ threeDimensionalDeviationPrograme: res.data.threeDimensionalDeviationPrograme==null? "":res.data.threeDimensionalDeviationPrograme,
|
|
|
|
+ // 工序抽检配置
|
|
|
|
+ randomCheckConf: res.data.randomCheckConf==null? "0" : res.data.randomCheckConf,
|
|
|
|
+ randomCheckPrograme: res.data.randomCheckPrograme==null? "" : res.data.randomCheckPrograme
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ // 获取【人工质检】数据
|
|
|
|
+ /*if(!!res.data.programTest){
|
|
|
|
+ this.$refs.quality.radio = res.data.programTest
|
|
|
|
+ // 方式
|
|
|
|
+ this.$refs.quality.programTestWay = res.data.programTestWay
|
|
|
|
+ this.$refs.quality.directCuttingFlag = res.data.directCuttingFlag
|
|
|
|
+ this.$refs.quality.programTestPrograme = res.data.programTestPrograme
|
|
|
|
+ }*/
|
|
|
|
+ // this.$refs.quality.tableData = this.setKeyList(res.data.procedureTestList)
|
|
|
|
+ // 获取【机械手臂】数据
|
|
|
|
+ /*this.$refs.robotarm.radio = res.data.armConf
|
|
|
|
+ if(res.data.armConf == '2'){
|
|
|
|
+ if(res.data.procedureRobotArm){
|
|
|
|
+ // this.$refs.robotarm.tenant = res.data.procedureRobotArm
|
|
|
|
+ this.$refs.robotarm.setTenant(res.data.procedureRobotArm)
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 赋值前处理-添加key数据健
|
|
|
|
+ setKeyList(list, flag){
|
|
|
|
+ if(list && list.length > 0){
|
|
|
|
+ let arr = []
|
|
|
|
+ list.forEach(item => {
|
|
|
|
+ // 添加唯一键
|
|
|
|
+ item.key = ''+ Math.random()
|
|
|
|
+ // 如果是托盘夹具的时候,组装分类
|
|
|
|
+ if(flag == 'tray'){
|
|
|
|
+ // 把【组序】和【优先级】改成字符串
|
|
|
|
+ //item.groupSort = ''+ item.groupSort
|
|
|
|
+ //item.groupPrority = ''+ item.groupPrority
|
|
|
|
+ // 给图片一个列表数据,jjImgList
|
|
|
|
+ item.jjImgList = []
|
|
|
|
+ if(!!item.armorPic){
|
|
|
|
+ item.jjImgList.push(item.armorPic)
|
|
|
|
+ }
|
|
|
|
+ // 添加类型
|
|
|
|
+ /*if(item.bizType == '1'){
|
|
|
|
+ item.category = {key: '03',data: '托盘'}
|
|
|
|
+ }else{
|
|
|
|
+ item.category = {key: '02',data: '夹具'}
|
|
|
|
+ }*/
|
|
|
|
+ }
|
|
|
|
+ arr.push(item)
|
|
|
|
+ })
|
|
|
|
+ list = arr
|
|
|
|
+ }else{
|
|
|
|
+ list = []
|
|
|
|
+ }
|
|
|
|
+ return list
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped="">
|
|
|
|
+ .title{
|
|
|
|
+ position: relative;
|
|
|
|
+ padding-left: 20px;
|
|
|
|
+ padding-bottom: 5px;
|
|
|
|
+ border-bottom: 1px dotted #1890ff;
|
|
|
|
+ }
|
|
|
|
+ .title:before{
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ background: #1890ff;
|
|
|
|
+ width: 10px;
|
|
|
|
+ height: 70%;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 1px;
|
|
|
|
+ }
|
|
|
|
+ .prossFenxi{
|
|
|
|
+ margin-top: 15px;
|
|
|
|
+ }
|
|
|
|
+ .content{
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ }
|
|
|
|
+ .titleSmall{
|
|
|
|
+ position: relative;
|
|
|
|
+ padding-left: 10px;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ }
|
|
|
|
+ .titleSmall:before{
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ background: #1890ff;
|
|
|
|
+ width: 5px;
|
|
|
|
+ height: 90%;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 1px;
|
|
|
|
+ }
|
|
|
|
+ .itemDiv{
|
|
|
|
+ margin: 10px 0;
|
|
|
|
+ }
|
|
|
|
+</style>
|