From 9424330fa330506d24ed84e5c3680063ca6c6a97 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期一, 03 六月 2024 11:22:38 +0800
Subject: [PATCH] 1
---
src/views/console/product-process/process-route/addWorkmanship.vue | 339 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 277 insertions(+), 62 deletions(-)
diff --git a/src/views/console/product-process/process-route/addWorkmanship.vue b/src/views/console/product-process/process-route/addWorkmanship.vue
index f5341ab..dbca07a 100644
--- a/src/views/console/product-process/process-route/addWorkmanship.vue
+++ b/src/views/console/product-process/process-route/addWorkmanship.vue
@@ -2,12 +2,12 @@
* @Author: lzhe lzhe@example.com
* @Date: 2024-05-24 11:25:26
* @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-05-24 15:24:10
+ * @LastEditTime: 2024-05-27 17:55:54
* @FilePath: /src/views/console/product-process/process-route/addWorking.vue
* @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
- <el-form :inline="true" :model="workmanshipForm" :rules="workmanshipRules" label-width="80px" class="form-view-data">
+ <el-form :inline="true" :model="workmanshipForm" :rules="workmanshipRules" label-width="100px" class="form-view-data">
<el-row>
<el-col :span="24">
<el-form-item label="宸ュ簭缂栧彿" prop="test0">
@@ -33,7 +33,7 @@
<el-input-number v-model="workmanshipForm.sort" :min="1" :max="10" @change="handleChange" />
</el-form-item>
</el-col>
- <el-col :span="24">
+ <el-col :span="24" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-form-item label="鏍囧噯鐢ㄦ椂">
<el-input v-model="workmanshipForm.d" style="width: 20%;margin-right: 12px;">
<template #suffix>澶�</template>
@@ -49,14 +49,14 @@
</el-input>
</el-form-item>
</el-col>
- <el-col :span="8">
+ <el-col :span="8" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-form-item label="鍑嗗宸ユ椂">
<el-input v-model="workmanshipForm.prepareTime">
<template #suffix>鍒�</template>
</el-input>
</el-form-item>
</el-col>
- <el-col :span="8">
+ <el-col :span="8" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-form-item label="瑁呭嵏宸ユ椂">
<el-input v-model="workmanshipForm.disassemblyTime">
<template #suffix>鍒�</template>
@@ -70,7 +70,7 @@
</el-input>
</el-form-item>
</el-col>
- <el-col :span="12">
+ <el-col :span="12" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-form-item label="鍔犲伐绋嬪簭">
<el-tree-select
v-if="workmanshipForm.isSelectProgramFiles"
@@ -89,12 +89,12 @@
<el-input v-if="!workmanshipForm.isSelectProgramFiles" v-model="workmanshipForm.programName"></el-input>
</el-form-item>
</el-col>
- <el-col :span="12">
+ <el-col :span="12" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-form-item label="">
<el-checkbox v-model="workmanshipForm.isSelectProgramFiles" label="閫夋嫨绋嬪簭鏂囦欢" size="small"/>
</el-form-item>
</el-col>
- <el-col :span="12">
+ <el-col :span="12" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-form-item label="宸ヨ壓鍖�">
<el-tree-select
@change = "bagIdChange"
@@ -111,6 +111,25 @@
:render-after-expand="false" />
</el-form-item>
</el-col>
+ <el-col :span="24" v-if="workmanshipForm.processTypeName == '娴嬮噺'">
+ <el-form-item label="娴嬮噺鏂瑰紡">
+ <el-checkbox-group v-model="workmanshipForm.checkListData" class="flexColumn">
+ <el-checkbox v-for="item in checkList" :label="item.name"></el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ <el-input-number v-model="workmanshipForm.meaMethodValue" :min="1" :max="10" />
+ <span style="margin-left: 12px;">缁存姢涓�0锛屽垯涓哄繀妫�宸ュ簭锛涚淮鎶や负闈�0锛屽垯涓洪娆℃娊妫�</span>
+ </el-col>
+ <el-col :span="24" v-if="workmanshipForm.processTypeName == '娴嬮噺'">
+ <el-form-item label="涓嶅悎鏍煎鐞嗘柟寮�">
+ <el-radio-group v-model="workmanshipForm.handlerMethod" class="flexColumn">
+ <el-radio :label="0">鍑虹嚎</el-radio>
+ <el-radio :label="1">杩旂嚎锛屼笂涓�搴忚繑宸�</el-radio>
+ <el-radio :label="2">杩旂嚎锛屾墽琛屽悗缁伐搴�</el-radio>
+ <el-radio :label="3">HMI閫夋嫨</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
<el-col :span="24">
<el-form-item label="闄勪欢">
<span style="cursor: pointer;">+ 娣诲姞</span>
@@ -118,70 +137,103 @@
</el-col>
<el-col :span="24">
<el-form-item label="澶瑰叿">
- <el-button>鍏宠仈澶瑰叿</el-button>
- <el-button>鎵归噺鍏宠仈</el-button>
+ <el-button type="primary" size="small" @click="isShowFirstFixtures = true" :disabled="isShowFirstFixtures">鍏宠仈澶瑰叿</el-button>
+ <el-button size="small">鎵归噺鍏宠仈</el-button>
</el-form-item>
</el-col>
-
- <!-- <el-col :span="24">
- <el-row style="margin-top: 12px;margin-bottom: 12px;" v-if="isAddData0">
+ <!-- 娣诲姞澶瑰叿 -->
+ <el-col :span="24" v-if="isShowFirstFixtures">
+ <el-row style="margin-top: 12px;margin-bottom: 12px;">
<el-col :span="4">
- <el-select v-model="addData0.type" placeholder="澶瑰叿缁�" size="small" style="padding-right: 20px;">
- <el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
+ <el-tree-select
+ @change = "fixturesChange"
+ default-expand-all
+ v-model="fixturesFirstData.groupId"
+ clearable
+ size="small"
+ node-key="id"
+ placeholder="澶瑰叿缁�"
+ ref="fixturesFirstData"
+ :data="fixturesFirstTree"
+ check-strictly
+ :props="{ label: 'name' }"
+ style="width:100%;"
+ :render-after-expand="false" />
+ </el-col>
+ <el-col :span="4">
+ <el-select v-model="fixturesFirstData.fixtureCode" size="small" style="width: 100%" placeholder="澶瑰叿缂栧彿" @change="fixtureCodeChange">
+ <el-option v-for="item in fixtureCodeList" :key="item.code" :label="item.code" :value="item.code"/>
</el-select>
</el-col>
<el-col :span="4">
- <el-select v-model="addData0.type" placeholder="澶瑰叿缂栧彿" size="small" style="padding-right: 20px;">
- <el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
- </el-select>
+ <el-input v-model="fixturesFirstData.name" disabled size="small" placeholder="澶瑰叿鍚嶇О" style="padding-right: 20px;"></el-input>
</el-col>
<el-col :span="4">
- <el-input v-model="addData0.description" disabled size="small" placeholder="澶瑰叿鍚嶇О" style="padding-right: 20px;"></el-input>
+ <el-button type="primary" size="small" @click="saveFirstFixture">淇濆瓨</el-button>
+ <el-button size="small" @click="cencelFirstFixture">鍙栨秷</el-button>
</el-col>
</el-row>
- </el-col> -->
-
+ </el-col>
+ <!-- 澶瑰叿table -->
<el-col :span="24">
<el-table ref="multipleTableRef" :data="fixtures" border style="width: 100%;margin-bottom:12px;" class="multipleTableRef">
<el-table-column prop="fixtureGroupName" label="澶瑰叿缁�">
- <template #default="scope">
- <el-tree-select
- @change = "fixturesChange"
- default-expand-all
- v-model="item.fixtureCode"
- clearable
- node-key="id"
- placeholder="澶瑰叿缁�"
- ref="parentTree"
- :data="fixturesData"
- check-strictly
- :props="{ label: 'name' }"
- style="width:100%;"
- :render-after-expand="false" />
- </template>
+ <template #default="scope">{{scope.row.fixtureGroupName}}</template>
</el-table-column>
<el-table-column prop="name" label="澶瑰叿缂栧彿">
- <template #default="scope">
- <el-select v-model="item.fixtureCode" style="width: 100%" placeholder="鍒�鍏峰瀷鍙�">
- <el-option v-for="item in numJQList" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </template>
+ <template #default="scope">{{scope.row.fixtureCode}}</template>
</el-table-column>
<el-table-column prop="fixtureName" label="澶瑰叿鍚嶇О"></el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" width="200px">
<template #default="scope">
- <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">鍒犻櫎</el-button>
+ <el-button text type="primary" size="small" @click="fixtures_del(scope.row, scope.$index)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
- <el-col :span="24">
+ <el-col :span="24" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-form-item label="鍒�鍏�">
- <el-button>鍏宠仈鍒�鍏�</el-button>
- <el-button>鎵归噺鍏宠仈</el-button>
+ <el-button type="primary" size="small" @click="isShowFirstTools = true" :disabled="isShowFirstTools">鍏宠仈鍒�鍏�</el-button>
+ <el-button size="small">鎵归噺鍏宠仈</el-button>
</el-form-item>
</el-col>
- <el-col :span="24">
+ <!-- 娣诲姞鍒�鍏� -->
+ <el-col :span="24" v-if="isShowFirstTools">
+ <el-row style="margin-top: 12px;margin-bottom: 12px;">
+ <el-col :span="4">
+ <el-tree-select
+ @change = "toolsChange"
+ default-expand-all
+ v-model="toolsFirstData.groupId"
+ clearable
+ size="small"
+ node-key="id"
+ placeholder="鍒�鍏风粍"
+ ref="toolsFirstData"
+ :data="toolsFirstTree"
+ check-strictly
+ :props="{ label: 'name' }"
+ style="width:100%;"
+ :render-after-expand="false" />
+ </el-col>
+ <el-col :span="4">
+ <el-select v-model="toolsFirstData.test" size="small" style="width: 100%" placeholder="鍒�鍏峰瀷鍙�">
+ <el-option v-for="item in testList" :key="item.code" :label="item.code" :value="item.code"/>
+ </el-select>
+ </el-col>
+ <el-col :span="4">
+ <el-select v-model="fixturesFirstData.test" size="small" style="padding-right: 20px;" placeholder="鍒�鍏风紪鍙�">
+ <el-option v-for="item in testList" :key="item.code" :label="item.code" :value="item.code"/>
+ </el-select>
+ </el-col>
+ <el-col :span="4">
+ <el-button type="primary" size="small" @click="saveFirstTools">淇濆瓨</el-button>
+ <el-button size="small" @click="cencelFirstTools">鍙栨秷</el-button>
+ </el-col>
+ </el-row>
+ </el-col>
+ <!-- 鍒�鍏穞able -->
+ <el-col :span="24" v-if="workmanshipForm.processTypeName != '娴嬮噺'">
<el-table ref="multipleTableRef" :data="tools" border style="width: 100%;" class="multipleTableRef">
<el-table-column prop="code" label="鍒�鍏风被鍨�">
<template #default="scope">
@@ -214,7 +266,7 @@
</el-row>
</el-form>
<div style="margin-top:12px;">
- <el-button>鍙栨秷</el-button>
+ <el-button @click="closeDrawer">鍙栨秷</el-button>
<el-button type="primary" @click="craftSave">淇濆瓨</el-button>
</div>
</template>
@@ -223,20 +275,36 @@
export default {
data() {
return {
+ toolsFirstTree: {},
+ isShowFirstTools: false,
+ fixtureCodeList: [],
+ isShowFirstFixtures: false,
+ toolsFirstData: {
+ test: ""
+ },
+ fixturesFirstData: {
+ fixtureId: "",
+ fixtureCode: "",
+ name: "",
+ groupId: ""
+ },
+ testList: [],
+ fixturesFirstTree: {},
programIdData: {},
numDQList: [],
modelDQList: [],
typeDQList: [],
- numJQList: [],
- fixturesData: [],
- parentDQData: [],
fixtures: [],
tools: [],
bagIdData: {},
testList: [],
processCodeList: [],
processNameList: [],
+ checkList: [{name:'棰戞鎶芥',code: 0},{name: '淇″彿鎶芥',code: 1},{name: '棣栦欢妫�',code: 2},{name: '鏈欢妫�',code: 3}],
workmanshipForm: {
+ checkListData: [], //娴嬮噺
+ meaMethodValue: null, //娴嬮噺
+ handlerMethod: "", //娴嬮噺
processCode: "",
processId: "",
processName: "",
@@ -253,17 +321,14 @@
programName: "", //鍔犲伐椤哄簭
bagId: "", //宸ュ叿鍖�
bagName: "",
- isSelectProgramFiles: false,
- test0: "",
- test: "",
- num: null,
- box: false
+ isSelectProgramFiles: false
},
workmanshipRules: {
sort: [{ required: true, message: '璇烽�夋嫨 宸ュ簭椤哄簭' }],
},
}
},
+ props: ["craftId","isClear"],
mounted() {
this.getToolingTree(); //澶瑰叿缁則ree
this.getCategoryTree(); //鍒�鍏风被鍨�
@@ -271,19 +336,147 @@
this.getNumberAndName(); //宸ュ簭缂栧彿鍜屽悕绉�
this.getCatalogueTree(); //鍔犲伐绋嬪簭
},
+ watch: {
+ isClear(val) {
+ if(val) {
+ this.resetAll();
+ }
+ }
+ },
methods: {
+ closeDrawer() {
+ this.resetAll();
+ this.$emit('success', {});
+ },
+ saveFirstTools() {
+ this.$message.error("璇烽�夋嫨鍒�鍏风被鍨�");
+ return;
+ },
+ cencelFirstTools() {
+ this.isShowFirstTools = false;
+ this.toolsFirstData = {
+ // fixtureId: "",
+ // fixtureCode: "",
+ // name: ""
+ }
+ //this.fixtureCodeList = [];
+ },
+ fixtures_del(row,index) {
+ this.fixtures.splice(index,1);
+ },
+ fixtureCodeChange(value) {
+ this.fixtureCodeList.forEach(item=> {
+ if(item.code == value) {
+ this.fixturesFirstData.name = item.name;
+ this.fixturesFirstData.fixtureId = item.id;
+ this.fixturesFirstData.fixtureGroupName = item.fixtureGroupName;
+ this.fixturesFirstData.fixtureName = item.name;
+ }
+ })
+ },
+ saveFirstFixture() {
+ if(this.fixturesFirstData.fixtureCode == "") {
+ this.$message.error("璇烽�夋嫨澶瑰叿");
+ return;
+ }
+ this.fixturesFirstData.code = this.fixturesFirstData.fixtureCode;
+ this.fixtures.push(this.fixturesFirstData);
+ this.cencelFirstFixture();
+ },
+ cencelFirstFixture() {
+ this.isShowFirstFixtures = false;
+ this.fixturesFirstData = {
+ fixtureId: "",
+ fixtureCode: "",
+ name: ""
+ }
+ this.fixtureCodeList = [];
+ },
+ fixturesChange(value) {
+ var row = this.$refs.fixturesFirstData.getCurrentNode();
+ this.fixturesFirstData.groupName = row.name;
+ this.$HTTP.get(`/api/blade-cps/fixture/list?groupId=${value}`).then(res=> {
+ if(res.code == 200) {
+ this.fixtureCodeList = res.data;
+ }
+ })
+ },
+ toolsChange(value) {
+
+ },
craftSave() { //淇濆瓨
- console.log(this.workmanshipForm)
+ if(this.isShowFirstFixtures) {
+ this.$message.error("璇峰厛淇濆瓨褰撳墠鍏宠仈鐨勫す鍏�");
+ return;
+ }
+ if(this.isShowFirstTools) {
+ this.$message.error("璇峰厛淇濆瓨褰撳墠鍏宠仈鐨勫垁鍏�");
+ return;
+ }
+ var obj = Object.assign({},this.workmanshipForm);
+ obj.id = "";
+ obj.fixtures = this.fixtures;
+ obj.tools = this.tools;
+ console.log(this.workmanshipForm.checkListData)
+ //for娴嬮噺
+ var meaMethodArray = [];
+ for (let name of this.workmanshipForm.checkListData) {
+ for (let item of this.checkList) {
+ if (item.name === name) {
+ meaMethodArray.push(item.code);
+ }
+ }
+ }
+ obj.meaMethod = meaMethodArray.join(",");
+ return;
+ this.$HTTP.post(`/api/blade-cps/production-craft-process/insert?versionId=${this.craftId}`,[obj]).then(res=> {
+ if(res.code == 200) {
+ this.$emit('success', obj);
+ this.resetAll();
+ }
+ })
+ },
+ resetAll() {
+ this.workmanshipForm = {
+ processCode: "",
+ processId: "",
+ processName: "",
+ processTypeName: "-",
+ sort: null,
+ d: "",
+ h: "",
+ m: "",
+ s: "",
+ prepareTime: "",
+ disassemblyTime: "",
+ transportTime: "",
+ programId: "",
+ programName: "", //鍔犲伐椤哄簭
+ bagId: "", //宸ュ叿鍖�
+ bagName: "",
+ isSelectProgramFiles: false
+ };
+ this.fixtures = [];
+ this.tools = [];
+ this.toolsFirstData = {
+ test: ""
+ };
+ this.fixturesFirstData = {
+ fixtureId: "",
+ fixtureCode: "",
+ name: "",
+ groupId: ""
+ };
},
processChange(val) {
if(val) {
this.processCodeList.forEach(item=> {
if(val == item.id) {
- console.log(item)
this.workmanshipForm.processId = item.id;
this.workmanshipForm.processCode = item.code;
this.workmanshipForm.processName = item.name;
this.workmanshipForm.processTypeName = item.typeName;
+ this.workmanshipForm.processType = item.type;
}
})
}
@@ -309,7 +502,6 @@
if(res.code == 200) {
this.processCodeList = res.data.records;
this.processNameList = res.data.records;
- console.log(res.data);
}
})
},
@@ -345,14 +537,11 @@
}
this.$HTTP.post("/api/blade-cps/tray/tooling-tree",obj).then(res=> {
if(res.code == 200) {
- this.fixturesData = res.data;
+ this.fixturesFirstTree = res.data;
}
})
},
programIdChange() {
-
- },
- fixturesChange() {
},
bagIdChange(val) {
@@ -360,10 +549,36 @@
},
table_edit() {
+ },
+ setData(data) {
+ this.$HTTP.get(`/api/blade-cps/production-craft-process/get/${data.id}`).then(res=> {
+ if(res.code == 200) {
+ //for娴嬮噺
+ var meaMethodArray = [];
+ for (let name of res.data.meaMethod) {
+ for (let item of this.checkList) {
+ if (item.code === name) {
+ meaMethodArray.push(item.name);
+ }
+ }
+ }
+ this.workmanshipForm = res.data;
+ this.workmanshipForm.checkListData = meaMethodArray;
+ this.fixtures = res.data.fixtures;
+ this.tools = res.data.tools;
+ console.log(res.data,123)
+ }
+ })
+
}
}
}
</script>
<style scoped>
+.flexColumn {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3