From 61deb2d2585d52d93a2d298b78072ed6aee0d38d Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期五, 24 五月 2024 18:28:45 +0800
Subject: [PATCH] 1
---
src/views/console/product-process/process-route/add-craft-version.vue | 141 ++++---
src/views/console/product-process/process-route.vue | 130 ++----
src/views/console/product-process/process-route/workmanship.vue | 123 ++++++
src/views/console/product-process/process-route/addWorking.vue | 128 +++++++
src/views/console/basic-data/work-process.vue | 501 +++++++++++++++++++++++++++
5 files changed, 874 insertions(+), 149 deletions(-)
diff --git a/src/views/console/basic-data/work-process.vue b/src/views/console/basic-data/work-process.vue
new file mode 100644
index 0000000..1247d5e
--- /dev/null
+++ b/src/views/console/basic-data/work-process.vue
@@ -0,0 +1,501 @@
+<!--
+ * @Author: lzhe lzhe@example.com
+ * @Date: 2024-03-26 10:28:33
+ * @LastEditors: lzhe lzhe@example.com
+ * @LastEditTime: 2024-05-24 18:18:17
+ * @FilePath: /smart-web/src/views/master/person/main/index.vue
+ * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
+<template>
+ <div class="user-main">
+ <div class="user-top">
+ <div class="noteTop">
+ <import-table class="marginR12" :exportUrl="exportUrl" :uploadUrl="uploadUrl"></import-table>
+ <el-button type="primary" @click="getExport">瀵煎嚭</el-button>
+ <el-button type="danger" plain @click="delData">鍒犻櫎</el-button>
+ </div>
+ <el-form :inline="true" :model="searchData" label-width="80px" style="width: 381px;">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鐘舵��">
+ <el-select v-model="searchData.status" style="width: 100%" @change="searchChange">
+ <el-option key="1" label="鍚敤" value="1"/>
+ <el-option key="0" label="鍋滅敤" value="0"/>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="">
+ <el-input v-model="searchData.keyword" placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�" clearable style="width: 100%" @change="searchChange"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </div>
+ <div class="user-bottom">
+ <div class="user-table">
+ <div class="addLeftData" @click="addLeftData">+ 蹇�熷垱寤�</div>
+ <el-row style="margin-top: 12px;margin-bottom: 12px;" v-if="isAddData0">
+ <el-col :span="4">
+ <el-input v-model="addData0.name" size="small" placeholder="宸ュ簭鍚嶇О" style="padding-right: 20px;"></el-input>
+ </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-col>
+ <el-col :span="4">
+ <el-input v-model="addData0.description" size="small" placeholder="宸ュ簭鎻忚堪" style="padding-right: 20px;"></el-input>
+ </el-col>
+ <el-col :span="4">
+ <el-select v-model="addData0.status" size="small" style="padding-right: 20px;">
+ <el-option key="1" label="鍚敤" value="1"/>
+ <el-option key="0" label="鍋滅敤" value="0"/>
+ </el-select>
+ </el-col>
+ <el-col :span="4">
+ <el-button type="primary" size="small" @click="addData0Submit0">纭畾</el-button>
+ <el-button size="small" @click="addDataCencel0">鍙栨秷</el-button>
+ </el-col>
+ </el-row>
+ <el-table ref="multipleTableRef0" :data="tableData0" border style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange" @row-click="rowClick">
+ <el-table-column type="selection" width="55" />
+ <el-table-column prop="code" label="宸ュ簭缂栧彿"></el-table-column>
+ <el-table-column prop="name" label="宸ュ簭鍚嶇О"></el-table-column>
+ <el-table-column prop="typeName" label="宸ョ"></el-table-column>
+ <el-table-column prop="description" label="宸ュ簭鎻忚堪"></el-table-column>
+ <el-table-column prop="status" label="鐘舵��">
+ <template #default="scope">
+ <span>{{ scope.row.status == "1"?"鍚敤":"鍋滅敤" }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔">
+ <template #default="scope">
+ <el-button type="text" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination
+ style="margin-top: 12px;"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="currentPage4"
+ :page-sizes="[15, 50, 100]"
+ :page-size="15"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="total0">
+ </el-pagination>
+ </div>
+ <div class="working-detail">
+ <div class="container-title">宸ュ簭璇︽儏</div>
+ <ul>
+ <li>宸ュ簭缂栧彿<span>{{workDetail.code}}</span></li>
+ <li>宸ュ簭鍚嶇О<span>{{workDetail.name}}</span></li>
+ <li>宸ョ<span>{{workDetail.typeName}}</span></li>
+ <li>宸ュ簭鎻忚堪<span>{{workDetail.description}}</span></li>
+ </ul>
+ <div class="info-top-title">宸ヤ綅</div>
+ <div class="addRightData" @click="addRightData">+ 蹇�熷垱寤�</div>
+ <el-row style="margin-top: 12px;margin-bottom: 12px;" v-if="isAddData1">
+ <el-col :span="4">
+ <el-select v-model="addData1.bizId" placeholder="宸ヤ綅缂栧彿" size="small" style="padding-right: 20px;">
+ <el-option v-for="item in bizIdList" :key="item.id" :label="item.code" :value="item.id"/>
+ </el-select>
+ </el-col>
+ <el-col :span="4">
+ <el-button type="primary" size="small" @click="addData0Submit1">纭畾</el-button>
+ <el-button size="small" @click="addDataCencel1">鍙栨秷</el-button>
+ </el-col>
+ </el-row>
+ <el-table ref="multipleTableRef1" :data="tableData1" border style="width: 100%" class="multipleTableRef">
+ <el-table-column prop="workstationCode" label="宸ヤ綅缂栧彿"></el-table-column>
+ <el-table-column prop="workstationName" label="宸ヤ綅鍚嶇О"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔">
+ <template #default="scope">
+ <el-button type="text" size="small" @click="biz_table_del(scope.row, scope.$index)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ </div>
+ <!-- 鍒犻櫎 -->
+ <el-dialog title="" v-model="delTypeModel" :width="400" destroy-on-close>
+ <div>
+ <div style="margin-bottom: 6px;"><span class="delIcon">!</span>璇蜂綘璋ㄦ厧閫夋嫨锛�</div>
+ <div style="text-indent: 24px;">鍒犻櫎鏁版嵁浼氬奖鍝嶅凡鍏宠仈鐨勪笟鍔� ,鑻ユ偍鎯冲湪宸插叧鑱旂殑涓氬姟涓緷鐒舵樉绀鸿繖浜涙暟鎹�, 鎮ㄥ彲浠ラ�夋嫨 鍋滅敤 鎿嶄綔銆傚仠鐢ㄥ悗姝ゆ暟鎹皢涓嶈兘鍐嶈鏂颁笟鍔′娇鐢ㄣ��</div>
+ </div>
+ <template #footer>
+ <div class="footerDiv">
+ <div class="delBtn" @click="delTypeDataSingle(0)">鍒犻櫎</div>
+ <div class="delBtn" @click="delTypeDataSingle(1)">鍋滅敤</div>
+ </div>
+ </template>
+ </el-dialog>
+ <!-- 鍒犻櫎left -->
+ <el-dialog title="" v-model="delLeftModel" :width="400" destroy-on-close>
+ <div>
+ <div style="margin-bottom: 6px;"><span class="delIcon">!</span>璇蜂綘璋ㄦ厧閫夋嫨锛�</div>
+ <div style="text-indent: 24px;">鍒犻櫎鏁版嵁浼氬奖鍝嶅凡鍏宠仈鐨勪笟鍔� ,鑻ユ偍鎯冲湪宸插叧鑱旂殑涓氬姟涓緷鐒舵樉绀鸿繖浜涙暟鎹�, 鎮ㄥ彲浠ラ�夋嫨 鍋滅敤 鎿嶄綔銆傚仠鐢ㄥ悗姝ゆ暟鎹皢涓嶈兘鍐嶈鏂颁笟鍔′娇鐢ㄣ��</div>
+ </div>
+ <template #footer>
+ <div class="footerDiv">
+ <div class="delBtn" @click="delLeft(0)">鍒犻櫎</div>
+ <div class="delBtn" @click="delLeft(1)">鍋滅敤</div>
+ </div>
+ </template>
+ </el-dialog>
+</template>
+<script>
+ import importTable from '@/layout/components/importTable.vue'
+ export default {
+ name: "working",
+ data(){
+ return {
+ delleftId: "",
+ bizIdList: [],
+ leftId: "",
+ delTypeModel: false,
+ delLeftModel: false,
+ typeList: [],
+ addData0: {
+ name: "",
+ type: "",
+ description: "",
+ status: "1"
+ },
+ addData1: {
+ bizId: "",
+ processId: "",
+ type: "1"
+ },
+ isAddData0: false,
+ isAddData1: false,
+ uploadUrl: "/api/blade-cps/employee/import-employee",
+ exportUrl: "/api/blade-cps/employee/export-template",
+ categoryList: [],
+ selection: [],
+ searchData: {
+ status: "1",
+ keyword: "",
+ current: "1",
+ size: "15"
+ },
+ total0: 0,
+ total1: 0,
+ isSaveing: false,
+ dialog: {
+ save: false
+ },
+ tableData0: [],
+ tableData1: [],
+ workDetail: {
+ code: "",
+ name: "",
+ typeName: "",
+ description: ""
+ }
+ }
+ },
+ created(){
+
+ },
+ mounted(){
+ this.getData();
+ this.getTypeList(); //宸ョ
+ this.getBizIdList(); //宸ヤ綅缂栧彿
+ },
+ components: {
+ importTable
+ },
+ methods: {
+ rowClick(row, column, event) {
+ this.id = row.id;
+ this.getWorkDetail();
+ this.getPage1();
+ },
+ delLeft(type) {
+ var selStr = "";
+ this.selection.map(item=> {
+ selStr += item.id + ","
+ })
+ selStr = selStr.replace(/,$/, '');
+ var url = `/api/blade-cps/process/remove?processIds=${selStr}&type=${type}`;
+ this.$HTTP.delete(url).then(res=> {
+ if(res.code == 200) {
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.delLeftModel = false;
+ this.selection = [];
+ this.getData();
+ }
+ })
+ },
+ delTypeDataSingle(type) {
+ var url = `/api/blade-cps/process/remove?processIds=${this.leftId}&type=${type}`;
+ this.$HTTP.delete(url).then(res=> {
+ if(res.code == 200) {
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.delTypeModel = false;
+ this.leftId = "";
+ this.getData();
+ }
+ })
+ },
+ addData0Submit0() {
+ this.$HTTP.post(`/api/blade-cps/process/save`,this.addData0).then(res => {
+ if (res.code == 200) {
+ this.getData();
+ this.clearData0();
+ }
+ })
+ },
+ clearData0() {
+ this.isAddData0 = false;
+ this.addData0 = {
+ name: "",
+ type: "",
+ description: "",
+ status: "1"
+ }
+ },
+ addDataCencel0() {
+ this.clearData0();
+ },
+ addData0Submit1() {
+ this.addData1.processId = this.id;
+ this.$HTTP.post(`/api/blade-cps/process-association/save`,this.addData1).then(res => {
+ if (res.code == 200) {
+ this.getPage1();
+ this.clearData1();
+ }
+ })
+ },
+ clearData1() {
+ this.isAddData1 = false;
+ this.addData1 = {
+ bizId: "",
+ processId: "",
+ type: "1"
+ }
+ },
+ addDataCencel1() {
+ this.clearData1();
+ },
+ addLeftData() {
+ this.isAddData0 = true;
+ },
+ addRightData() {
+ this.isAddData1 = true;
+ },
+ getTypeList() {
+ this.$HTTP.get(`/api/blade-system/dict/dictionary?code=work_type`).then(res => {
+ if (res.code == 200) {
+ this.typeList = res.data;
+ }
+ })
+ },
+ getBizIdList() {
+ this.$HTTP.get(`/api/blade-cps/workstation/page?workstationCode=&workstationName=&size=-1&groupId=&keyWord=`).then(res => {
+ if (res.code == 200) {
+ this.bizIdList = res.data.records;
+ }
+ })
+ },
+ getExport() {
+ this.$HTTP.get(`/api/blade-cps/process/export-process?keyword=&status=1`).then(res => {
+ if (res.code == 200) {
+ window.open(res.data.link);
+ }
+ })
+ },
+ searchChange() {
+ this.getData();
+ },
+ addUserSuccess() {
+ this.getData();
+ },
+ getWorkDetail(id) {
+ this.$HTTP.get(`/api/blade-cps/process/get?processId=${this.id}`).then(res=> {
+ if(res.code == 200) {
+ this.workDetail = res.data;
+ }
+ })
+ },
+ getData() {
+ this.$HTTP.get(`/api/blade-cps/process/page?status=${this.searchData.status}&keyword=${this.searchData.keyword}¤t=${this.searchData.current}&size=${this.searchData.size}`).then(res=> {
+ if(res.code == 200) {
+ this.tableData0 = res.data.records;
+ if(this.tableData0.length != 0) {
+ this.id = this.tableData0[0].id;
+ this.getWorkDetail();
+ this.getPage1();
+ }else {
+ this.workDetail = {
+ code: "",
+ name: "",
+ typeName: "",
+ description: ""
+ }
+ }
+ }
+ })
+ },
+ getPage1() {
+ this.$HTTP.get(`/api/blade-cps/process-association/page?processId=${this.id}`).then(res=> {
+ if(res.code == 200) {
+ this.tableData1 = res.data.workstationList;
+ }
+ })
+ },
+ //鍒犻櫎
+ table_del(row) {
+ this.leftId = row.id;
+ this.delTypeModel = true;
+ },
+ //鍒犻櫎
+ biz_table_del(row) {
+ var url = `/api/blade-cps/process-association/remove?bizId=${row.id}&processId=${this.id}`;
+ this.$HTTP.delete(url).then(res=> {
+ if(res.code == 200) {
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.getPage1();
+ }
+ })
+ },
+ handleSelectionChange(selection) {
+ this.selection = selection;
+ },
+ delData() {
+ if(this.selection.length == 0) {
+ this.$message({
+ message: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�',
+ type: 'warning'
+ });
+ return;
+ }
+ this.delLeftModel = true;
+ },
+ handleSizeChange(val) {
+ console.log(`姣忛〉 ${val} 鏉);
+ this.searchData.current = "1";
+ this.searchData.size = val;
+ this.getData();
+ },
+ handleCurrentChange(val) {
+ console.log(`褰撳墠椤�: ${val}`);
+ this.searchData.current = val;
+ this.getData();
+ }
+ }
+ }
+</script>
+
+<style scoped>
+ .user-main {
+ background-color: #f9fafb;
+ border: 1px solid #dcdfe6;
+ box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
+ margin: 8px;
+ padding: 8px;
+ background-color: #fff;
+ }
+ .user-top {
+ width: 100%;
+ display: flex;
+ justify-content: space-between;
+ }
+ .user-table {
+ width: 50%;
+ margin-bottom: 8px;
+ margin-right: 12px;
+
+ }
+ .working-detail {
+ flex: 1;
+ }
+ .working-detail ul {
+ overflow: hidden;
+ padding: 12px 30px;
+ }
+ .working-detail ul li {
+ width: 50%;
+ float: left;
+ list-style: none;
+ margin-bottom:12px;
+ }
+ .working-detail ul li span {
+ margin-left:12px;
+ }
+ .multipleTableRef {
+ margin-bottom: 8px;
+ }
+ .user-bottom {
+ display: flex;
+ }
+ .container-title {
+ font-size: 16px;
+ text-align: center;
+ height: 38px;
+ line-height: 38px;
+ border-bottom: 1px solid #e2e2e2;
+ background-color: #409eff;
+ color: #fff;
+ border-radius: 2px 2px 0 0;
+ margin-bottom: 12px;
+ }
+ .marginR12 {
+ margin-right: 12px;
+ }
+ .info-top-title {
+ padding-left: 8px;
+ border-left: 4px solid #86bffa;
+ line-height: 18px;
+ margin-bottom: 16px;
+ font-weight: 700;
+ font-size: 16px;
+ color: #333;
+ }
+ .addLeftData,.addRightData {
+ font-size: 14px;
+ margin-bottom: 12px;
+ color: #1573f3;
+ text-decoration-line: underline;
+ cursor: pointer;
+ }
+ .delIcon {
+ color: #fff;
+ background: red;
+ border-radius: 50%;
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ font-size: 14px;
+ text-align: center;
+ line-height: 20px;
+ margin-right: 6px;
+ }
+ .footerDiv {
+ text-align: center;
+ }
+ .delBtn {
+ color: #fff;
+ width: 112px;
+ height: 32px;
+ display: inline-block;
+ color: #fa554c;
+ background-color: #fff;
+ border: 1px solid #fdbbb7;
+ text-align: center;
+ line-height: 32px;
+ cursor: pointer;
+ }
+
+ .delBtn:nth-child(1) {
+ margin-right: 4px;
+ }
+ .delBtn:hover {
+ background-color: #f34d5b;
+ border-color: #f34d5b;
+ color: #fff;
+ }
+</style>
diff --git a/src/views/console/product-process/process-route.vue b/src/views/console/product-process/process-route.vue
index e030f47..83ba948 100644
--- a/src/views/console/product-process/process-route.vue
+++ b/src/views/console/product-process/process-route.vue
@@ -23,7 +23,7 @@
<div class="process-main-tabs">
<div class="process-main-header">
<div class="main-header-label">宸ヨ壓璺嚎<span>{{productName}}</span></div>
- <div style="padding: 20px;border-bottom: 1px solid #dee;">
+ <div style="padding: 20px 20px 8px;border-bottom: 1px solid #dee;">
<div class="main-info">
<div class="info-top-title">宸ヨ壓璺嚎鐗堟湰</div>
<div class="main-info-tooltip">
@@ -32,13 +32,13 @@
</div>
</div>
<div>
- <div class="btn-box vistion-button" v-for="item in detail.dtos">
+ <div :class="{'btn-box':true, 'vistion-button': true, 'isBorder': item.isBorder}" v-for="(item,index) in detail.dtos" @click="changeDots(item,index)">
<span class="vistion-button-round"></span>
<el-tooltip trigger="click" class="detail-item" effect="dark" :content="vHtml" placement="bottom" raw-content>
<span class="vistion-button-name" @click="showDetail(item)">{{item.name}}</span>
</el-tooltip>
<el-icon class="vistion-button-icon"><DocumentCopy /></el-icon>
- <el-icon class="vistion-button-icon"><Delete /></el-icon>
+ <el-icon class="vistion-button-icon" @click="delIcon(item)"><Delete /></el-icon>
</div>
<div class="btn-box most-vision" @click="changeV">{{changVTitle}}</div>
<el-button @click="addVision">+ 娣诲姞鏂扮増鏈�</el-button>
@@ -47,35 +47,7 @@
</div>
<div class="correlation-product-line">鍏宠仈浜х嚎<span>鍗冩枃绉戞妧</span></div>
<div class="process-main-content">
- <div class="main-content-left">
- <div class="info-top-title">宸ヨ壓璺嚎</div>
- <div style="margin-bottom: 12px;">
- <el-button type="primary">鏂板</el-button>
- <el-button type="primary">瀹氱増</el-button>
- <el-button disabled>骞跺簭</el-button>
- </div>
- <el-table ref="multipleTableRef0" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="HandleSelectionChange">
- <el-table-column type="selection" width="55" />
- <el-table-column prop="name" label="宸ュ簭椤哄簭"></el-table-column>
- <el-table-column prop="code" label="宸ュ簭缂栧彿"></el-table-column>
- <el-table-column prop="typeName" 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="table_edit(scope.row, scope.$index)">鍒锋柊</el-button>
- <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">鍒犻櫎</el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="main-content-right">
- <div class="main-info-title">宸ュ簭淇℃伅</div>
- <ul>
- <li>宸ュ簭缂栧彿<span>-</span></li>
- <li>宸ュ簭鍚嶇О<span>-</span></li>
- <li>宸ュ簭椤哄簭<span>-</span></li>
- </ul>
- </div>
+ <workmanship :isCustomization = "true"></workmanship>
</div>
</div>
</div>
@@ -84,6 +56,7 @@
<script>
import saveDialog from './addRoute'
+ import workmanship from './process-route/workmanship' //宸ヨ壓璺嚎
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
let icons = []
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
@@ -91,15 +64,16 @@
}
export default {
name: 'route',
- components: {...ElementPlusIconsVue,saveDialog},
+ components: {...ElementPlusIconsVue,saveDialog,workmanship},
data() {
return {
+ craftId: "",
id: "",
changVTitle: "鏇村鐗堟湰...",
isMore: true,
productName: "",
vHtml: '',
- detail: {dtos: [{name: ""}]},
+ detail: {dtos: [{name: "",isBorder: false}]},
testList: [],
routeForm: {
test: ""
@@ -115,14 +89,36 @@
save: false
},
info: {},
- tableData: [],
- selection: []
+ delIconId: ""
}
},
mounted(){
this.getLeftTree();
},
methods: {
+ delIcon(item) {
+ this.delIconId = item.id;
+ var that = this;
+ this.$confirm(`纭瑕佸垹闄ゆ宸ヨ壓鐗堟湰鍚�?`, '', {
+ type: 'warning'
+ }).then(() => {
+ this.$HTTP.delete("/api/blade-cps/production-craft-version/remove/"+that.delIconId).then(res=> {
+ if(res.code == 200) {
+ that.$message.success("鎿嶄綔鎴愬姛");
+ that.getDetail();
+ }
+ })
+ }).catch(() => {
+
+ })
+ },
+ changeDots(item,index) {
+ this.detail.dtos.forEach(item=> {
+ item.isBorder = false;
+ })
+ this.detail.dtos[index].isBorder = true;
+ this.craftId = item.craftId;
+ },
addVision() {
this.$router.push({path: `/console/product-process/process-route/add-craft-version`,query: {id:this.id}})
},
@@ -153,7 +149,6 @@
})
},
table_edit(row){
- this.dialog.save = true
this.$HTTP.get(`/api/blade-cps/craft-routing/not-band-craft?craftId=${row.id}`).then(res=> {
if(res.code == 200) {
this.dialog.save = true;
@@ -165,9 +160,6 @@
},
addRouteSuccess() {
this.getLeftTree();
- },
- HandleSelectionChange(selection) {
- this.selection = selection;
},
routeSubmit() {
this.$refs.dialogForm.validate(async (valid) => {
@@ -195,9 +187,16 @@
this.leftData[index].active = true;
this.info = this.leftData[index];
},
- getDetail(id) {
- this.$HTTP.get(`/api/blade-cps/craft-routing/detail?id=${id}`).then(res=> {
+ getDetail() {
+ this.$HTTP.get(`/api/blade-cps/craft-routing/detail?id=${this.id}`).then(res=> {
if(res.code == 200) {
+ if(res.data.dtos) {
+ res.data.dtos.forEach(item=> {
+ item.isBorder = false;
+ })
+ res.data.dtos[0].isBorder = true;
+ this.craftId = res.data.dtos[0].craftId;
+ }
this.detail = res.data;
}
})
@@ -215,7 +214,7 @@
this.productName = res.data[0].name;
this.id = res.data[0].id;
}
- this.getDetail(res.data[0].id);
+ this.getDetail();
}
})
}
@@ -307,11 +306,6 @@
.main-header-label span {
margin-left: 12px;
}
-.main-info-title {
- font-size: 14px;
- padding-left: 8px;
- border-left: 2px solid #7ab3ee;
-}
.info-top-title {
padding-left: 8px;
border-left: 4px solid #86bffa;
@@ -335,38 +329,6 @@
margin-right: 4px;
display: inline-block;
}
-.main-info-conent {
- display: flex;
- margin: 8px 0px 12px;
-}
-.main-info-conent > span {
- margin-right: 12px;
- font-size: 14px;
-}
-.main-info-conent > span span {
- margin-left:12px;
-}
-.process-main-content {
- display: flex;
-}
-.main-content-left {
- width: 70%;
-}
-.main-content-right {
- flex: 1;
-}
-.main-content-right ul {
- padding: 12px 30px;
-}
-.main-content-right ul li {
- width: 50%;
- float: left;
- list-style: none;
- margin-bottom:12px;
-}
-.main-content-right ul li span {
- margin-left:12px;
-}
.addRoute {
color: #409eff;
padding: 12px 6px;
@@ -375,17 +337,20 @@
}
.btn-box {
display: inline-block;
- margin-right: 20px;
}
.most-vision {
border-bottom: 1px solid #86bffa;
font-size: 14px;
font-weight: 700;
cursor: pointer;
+ margin-right: 12px;
+ margin-left: 6px;
}
.vistion-button {
border: 1px solid #86bffa;
padding: 8px 12px;
+ margin-right: 6px;
+ margin-bottom: 12px;
}
.vistion-button-name {
vertical-align: middle;
@@ -415,6 +380,9 @@
.correlation-product-line span {
margin-left: 20px;
}
+.isBorder {
+ border: 1px solid #0176f0;
+}
</style>
<style>
.detailUl {
diff --git a/src/views/console/product-process/process-route/add-craft-version.vue b/src/views/console/product-process/process-route/add-craft-version.vue
index c4dc109..e9b3905 100644
--- a/src/views/console/product-process/process-route/add-craft-version.vue
+++ b/src/views/console/product-process/process-route/add-craft-version.vue
@@ -14,37 +14,15 @@
<el-form :model="addStepForm0" :rules="addStepRules0" ref="dialogForm0" label-width="80px" label-position="center" class="addStepRules0" v-show="active == 0">
<el-row>
<el-col :span="24">
- <el-form-item label="宸ヨ壓璺嚎" prop="name">
- <el-input v-model="addStepForm0.name" placeholder="宸ヨ壓璺嚎" clearable></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="浜у搧缂栧彿">
- <el-select v-model="addStepForm0.productId" style="width: 100%" placeholder="浜у搧缂栧彿">
- <el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="澶囨敞">
- <el-input v-model="addStepForm0.description" placeholder="澶囨敞" clearable></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <!-- 绗簩姝� -->
- <el-form :model="addStepForm1" :rules="addStepRules1" ref="dialogForm1" label-width="80px" label-position="center" class="addStepRules0" v-show="active == 1">
- <el-row>
- <el-col :span="24">
<el-row class="step1-top">
- <el-col :span="8"><span>宸ヨ壓璺嚎鍚嶇О</span><span>-</span></el-col>
- <el-col :span="8"><span>鍏宠仈浜у搧</span><span>-</span></el-col>
- <el-col :span="8"><span>宸ヨ壓璺嚎鎻忚堪</span><span>-</span></el-col>
+ <el-col :span="8"><span>宸ヨ壓璺嚎鍚嶇О</span><span style="margin-left: 12px">{{detail.name}}</span></el-col>
+ <el-col :span="8"><span>鍏宠仈浜у搧</span><span style="margin-left: 12px">{{detail.productName}}</span></el-col>
+ <el-col :span="8"><span>宸ヨ壓璺嚎鎻忚堪</span><span style="margin-left: 12px">{{detail.description}}</span></el-col>
</el-row>
</el-col>
<el-col :span="24">
<el-form-item label="鐗堟湰鍚嶇О">
- <el-input v-model="addStepForm1.name" disabled placeholder="鐗堟湰鍚嶇О" clearable></el-input>
+ <el-input v-model="addStepForm0.name" disabled placeholder="鐗堟湰鍚嶇О" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
@@ -52,7 +30,7 @@
<el-tree-select
node-key="id"
:props="{ label: 'title',children: 'children',hasChildren: 'ids'}"
- v-model="addStepForm1.groupIds"
+ v-model="addStepForm0.groupIds"
placeholder="鍏宠仈浜х嚎"
:data="step1TreeData"
multiple
@@ -65,8 +43,26 @@
</el-col>
<el-col :span="24">
<el-form-item label="鎻忚堪">
- <el-input v-model="addStepForm1.description" placeholder="璇疯緭鍏ュ伐鑹鸿矾绾跨増鏈弿杩�" clearable></el-input>
+ <el-input v-model="addStepForm0.description" placeholder="璇疯緭鍏ュ伐鑹鸿矾绾跨増鏈弿杩�" clearable></el-input>
</el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <!-- 绗簩姝� -->
+ <el-form :model="addStepForm1" :rules="addStepRules1" ref="dialogForm1" label-width="80px" label-position="center" class="addStepRules1" v-show="active == 1">
+ <el-row>
+ <el-col :span="24">
+ <el-row class="step1-top">
+ <el-col :span="8"><span>宸ヨ壓璺嚎鍚嶇О</span><span style="margin-left: 12px">{{detail.name}}</span></el-col>
+ <el-col :span="8"><span>鍏宠仈浜у搧</span><span style="margin-left: 12px">{{detail.productName}}</span></el-col>
+ <el-col :span="8"><span>宸ヨ壓璺嚎鎻忚堪</span><span style="margin-left: 12px">{{detail.description}}</span></el-col>
+ <el-col :span="8" style="margin-top: 6px;"><span>宸ヨ壓璺嚎鐗堟湰</span><span style="margin-left: 12px">{{versionDetail.name}}</span></el-col>
+ <el-col :span="8" style="margin-top: 6px;"><span>鍏宠仈浜х嚎</span><span style="margin-left: 12px">{{versionDetail.groupName}}</span></el-col>
+ <el-col :span="8" style="margin-top: 6px;"><span>宸ヨ壓璺嚎鎻忚堪</span><span style="margin-left: 12px">{{versionDetail.description}}</span></el-col>
+ </el-row>
+ </el-col>
+ <el-col :span="24">
+ <workmanship :isCustomization = "false"></workmanship>
</el-col>
</el-row>
</el-form>
@@ -75,9 +71,10 @@
</template>
<script>
+ import workmanship from './workmanship' //宸ヨ壓璺嚎
export default {
name: 'add-craft',
- components: {},
+ components: {workmanship},
data() {
var valiarrPass = (rule, value, callback) => {
if (value.length == 0) {
@@ -89,27 +86,38 @@
return {
step1TreeData: [],
active: 0,
- //琛ㄥ崟鏁版嵁
- addStepForm0: {
+ detail: {
name: "",
- productId: "",
+ productName: "",
description: "",
},
+ versionDetail: {
+ name: "",
+ groupName: "",
+ description: ""
+ },
+ //琛ㄥ崟鏁版嵁
+ addStepForm0: {
+ name: "",
+ groupIds: [],
+ description: ""
+ },
//楠岃瘉瑙勫垯
addStepRules0: {
- name:[{required: true, message: '璇疯緭鍏ュ伐鑹鸿矾绾�'}],
- },
+ groupIds:[{validator: valiarrPass,required: true, trigger:'change'}],
+ },//琛ㄥ崟鏁版嵁
addStepForm1: {
name: "",
groupIds: [],
description: "",
-
+ description: ""
},
//楠岃瘉瑙勫垯
addStepRules1: {
- groupIds:[{validator: valiarrPass,required: true, trigger:'change'}],
+ //name:[{required: true, message: '璇疯緭鍏ュ伐鑹鸿矾绾�'}],
},
+
productList: []
}
},
@@ -119,8 +127,8 @@
}
},
mounted(){
- //this.getProductList(); //for step0
- // this.getGroupWorkstation(); //for step1
+ this.getGroupWorkstation(); //for step0
+ this.getDetail(this.$route.query.id); //for step0
},
methods: {
getGroupWorkstation() {
@@ -142,7 +150,32 @@
}
})
this.step1TreeData = tree;
- console.log(this.step1TreeData)
+ }
+ })
+ },
+ setStep0() {
+ var obj = Object.assign({},this.addStepForm0);
+ this.$refs.dialogForm0.validate(async (valid) => {
+ if (valid) {
+ this.$HTTP.post(`/api/blade-cps/production-craft-version/insert?craftId=${this.$route.query.id}`,obj).then(res=> {
+ if(res.code == 200) {
+ this.active = 1;
+ this.getVersionDetail(res.data.id);
+ }else {
+ this.$alert(res.message, "鎻愮ず", {type: 'error'});
+ }
+ })
+ }else{
+ return false;
+ }
+ })
+ },
+ getVersionDetail(id) {
+ this.$HTTP.get(`/api/blade-cps/production-craft-version/detail/${id}`).then(res=> {
+ if(res.code == 200) {
+ this.versionDetail = res.data;
+ }else {
+ this.$alert(res.message, "鎻愮ず", {type: 'error'});
}
})
},
@@ -160,38 +193,10 @@
}
},
- setStep0() {
- var obj = Object.assign({},this.addStepForm1);
- obj.craftId = "";
- this.$refs.dialogForm1.validate(async (valid) => {
- if (valid) {
- this.$HTTP.post("/api/blade-cps/production-craft-version/insert",obj).then(res=> {
- this.isSaveing = false;
- if(res.code == 200) {
- this.active = 2;
- this.$message.success("鎿嶄綔鎴愬姛");
- }else {
- console.log(res,123)
- //this.$alert(res.message, "鎻愮ず", {type: 'error'});
- }
- })
- }else{
- return false;
- }
- })
- },
getDetail(id) {
this.$HTTP.get(`/api/blade-cps/craft-routing/detail?id=${this.$route.query.id}`).then(res=> {
if(res.code == 200) {
- this.addStepForm0 = res.data;
- }
- })
- },
- getProductList() {
- this.$HTTP.get(`/api/blade-cps/craft-routing/not-band-craft?craftId=${this.$route.query.id}`).then(res=> {
- if(res.code == 200) {
- this.productList = res.data;
- this.getDetail();
+ this.detail = res.data;
}
})
}
diff --git a/src/views/console/product-process/process-route/addWorking.vue b/src/views/console/product-process/process-route/addWorking.vue
new file mode 100644
index 0000000..f5bf065
--- /dev/null
+++ b/src/views/console/product-process/process-route/addWorking.vue
@@ -0,0 +1,128 @@
+<!--
+ * @Author: lzhe lzhe@example.com
+ * @Date: 2024-05-24 11:25:26
+ * @LastEditors: lzhe lzhe@example.com
+ * @LastEditTime: 2024-05-24 15:24:10
+ * @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-dialog :title="titleMap[mode]" v-model="visible" :width="700" destroy-on-close @closed="$emit('closed')">
+ <div class="add-btn">
+ <el-button type="primary" @click="addWorking">鏂板缓宸ヨ壓</el-button>
+ </div>
+ <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange">
+ <el-table-column type="selection" width="55" />
+ <el-table-column prop="postCode" label="宸ュ簭缂栧彿"></el-table-column>
+ <el-table-column prop="postName" label="宸ュ簭鍚嶇О"></el-table-column>
+ <el-table-column prop="postName" label="宸ョ"></el-table-column>
+ <el-table-column prop="postName" label="宸ュ簭鎻忚堪"></el-table-column>
+ </el-table>
+ <el-pagination
+ style="margin-top: 12px;"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :page-sizes="[15, 50, 100]"
+ :page-size="15"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="totle">
+ </el-pagination>
+ <template #footer>
+ <el-button @click="visible=false" >鍙栨秷</el-button>
+ <el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="workingSubmit">纭畾</el-button>
+ </template>
+ </el-dialog>
+</template>
+
+<script>
+ export default {
+ emits: ['success', 'closed'],
+ data() {
+ return {
+ current: 1,
+ size: 15,
+ totle: 0,
+ tableData: [],
+ selection: [],
+ mode: "add",
+ titleMap: {
+ add: '閫夋嫨宸ュ簭',
+ edit: '缂栬緫',
+ show: '鏌ョ湅'
+ },
+ visible: false,
+ isSaveing: false,
+ }
+ },
+ mounted() {
+ },
+ methods: {
+ workingSubmit() {
+
+ },
+ addWorking() {
+ this.$router.push({path: `/console/basic-data/work-process`});
+ },
+ handleSelectionChange(selection) {
+ this.selection = selection;
+ },
+ getTable() {
+ this.$HTTP.get(`/api/blade-cps/process/page?current=${this.current}&size=${this.size}&keyword=`).then(res=> {
+ if(res.code == 200) {
+ this.tableData = res.data.records;
+ }
+ })
+ },
+ //鏄剧ず
+ open(mode='add'){
+ this.getTable();
+ this.mode = mode;
+ this.visible = true;
+ return this
+ },
+ //琛ㄥ崟鎻愪氦鏂规硶
+ workingSubmit(){
+ var obj = Object.assign({},this.addWorkingForm);
+ this.$refs.dialogForm.validate(async (valid) => {
+ if (valid) {
+ this.isSaveing = true;
+ this.$HTTP.put("/api/blade-cps/craft-routing/update",obj).then(res=> {
+ this.isSaveing = false;
+ if(res.code == 200) {
+ this.$emit('success', this.addWorkingForm, this.mode);
+ this.visible = false;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ }else {
+ this.$alert(res.message, "鎻愮ず", {type: 'error'});
+ }
+ })
+ }else{
+ return false;
+ }
+ })
+ },
+ //琛ㄥ崟娉ㄥ叆鏁版嵁
+ setData(data,res){
+ //鍙互鍜屼笂闈竴鏍峰崟涓敞鍏ワ紝涔熷彲浠ュ儚涓嬮潰涓�鏍风洿鎺ュ悎骞惰繘鍘�
+ this.productList = res;
+ Object.assign(this.addWorkingForm, data);
+ },
+ handleSizeChange(val) {
+ this.size = val;
+ console.log(`姣忛〉 ${val} 鏉);
+ this.getTable();
+ },
+ handleCurrentChange(val) {
+ this.current = val;
+ console.log(`褰撳墠椤�: ${val}`);
+ this.getTable();
+ }
+ }
+ }
+</script>
+
+<style scoped>
+.add-btn {
+ margin-bottom: 12px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/console/product-process/process-route/workmanship.vue b/src/views/console/product-process/process-route/workmanship.vue
new file mode 100644
index 0000000..f3b847a
--- /dev/null
+++ b/src/views/console/product-process/process-route/workmanship.vue
@@ -0,0 +1,123 @@
+<!--
+ * @Author: lzhe lzhe@example.com
+ * @Date: 2024-05-24 11:25:26
+ * @LastEditors: lzhe lzhe@example.com
+ * @LastEditTime: 2024-05-24 15:05:44
+ * @FilePath: /src/views/console/product-process/process-route/workmanship.vue
+ * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
+<template>
+ <div class="workmanship">
+ <div class="main-content-left">
+ <div class="info-top-title">宸ヨ壓璺嚎</div>
+ <div style="margin-bottom: 12px;">
+ <el-button type="primary">鏂板</el-button>
+ <el-button type="primary" v-if="isCustomization">瀹氱増</el-button>
+ <el-button disabled>骞跺簭</el-button>
+ </div>
+ <el-table ref="multipleTableRef0" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="HandleSelectionChange">
+ <el-table-column type="selection" width="55" />
+ <el-table-column prop="name" label="宸ュ簭椤哄簭"></el-table-column>
+ <el-table-column prop="code" label="宸ュ簭缂栧彿"></el-table-column>
+ <el-table-column prop="typeName" 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="table_edit(scope.row, scope.$index)">鍒锋柊</el-button>
+ <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">鍒犻櫎</el-button> -->
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <div class="main-content-right">
+ <div class="main-info-title">宸ュ簭淇℃伅</div>
+ <div class="addWorking" @click="table_open">娣诲姞宸ュ簭</div>
+ <!-- <ul>
+ <li>宸ュ簭缂栧彿<span></span></li>
+ <li>宸ュ簭鍚嶇О<span></span></li>
+ <li>宸ュ簭椤哄簭<span></span></li>
+ </ul> -->
+ </div>
+ </div>
+ <save-dialog v-if="dialog.save" ref="saveDialog" @success="addRouteSuccess" @closed="dialog.save=false"></save-dialog>
+</template>
+
+<script>
+ import saveDialog from './addWorking'
+ export default {
+ name: 'workmanship',
+ components: {saveDialog},
+ props: ["isCustomization"],
+ data() {
+ return {
+ tableData: [],
+ selection: [],
+ dialog: {
+ save: false
+ }
+ }
+ },
+ mounted(){
+
+ },
+ methods: {
+ HandleSelectionChange(selection) {
+ this.selection = selection;
+ },
+ table_open() {
+ this.dialog.save = true
+ this.$nextTick(() => {
+ this.$refs.saveDialog.open();
+ })
+ }
+ }
+ }
+</script>
+
+<style scoped>
+.workmanship {
+ width: 100%;
+ display: flex;
+}
+.info-top-title {
+ padding-left: 8px;
+ border-left: 4px solid #86bffa;
+ line-height: 18px;
+ margin-bottom: 16px;
+ font-weight: 700;
+ font-size: 16px;
+ color: #333;
+}
+.main-content-left {
+ width: 70%;
+}
+.main-content-right {
+ flex: 1;
+}
+.main-content-right ul {
+ padding: 12px 30px;
+}
+.main-content-right ul li {
+ width: 50%;
+ float: left;
+ list-style: none;
+ margin-bottom:12px;
+}
+.main-content-right ul li span {
+ margin-left:12px;
+}
+.main-info-title {
+ font-size: 14px;
+ padding-left: 8px;
+ font-weight: 700;
+ font-size: 16px;
+ color: #333;
+ border-left: 4px solid #7ab3ee;
+}
+.addWorking {
+ color: #409eff;
+ padding: 12px 6px;
+ font-size: 14px;
+ cursor: pointer;
+}
+</style>
--
Gitblit v1.9.3