From ce70bd97c7f2577f0978b39b9da1ccdd8d5b768f Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 19 九月 2025 22:50:14 +0800
Subject: [PATCH] 机床增加设备编号
---
src/views/wel/shemi.vue | 907 +++++++++++++++++++------------------------------------
1 files changed, 317 insertions(+), 590 deletions(-)
diff --git a/src/views/wel/shemi.vue b/src/views/wel/shemi.vue
index 3a48b74..855fab8 100644
--- a/src/views/wel/shemi.vue
+++ b/src/views/wel/shemi.vue
@@ -14,20 +14,20 @@
<el-checkbox value="3" label="鍋忕" />
</el-checkbox-group>
</el-col>
- <el-col :span="6" class="search-data-flex">
+ <el-col :span="4" class="search-data-flex">
<span class="search-data-title">闆剁粍浠跺彿:</span>
- <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="杈撳叆鑷冲皯3涓瓧绗﹁繃婊ゆ暟鎹�"
+ <el-select v-model="searchTreeData.drawingNo" clearable filterable remote reserve-keyword placeholder="杈撳叆鑷冲皯3涓瓧绗﹁繃婊ゆ暟鎹�"
:remote-method="remoteMethod" :loading="searchLoading">
<el-option v-for="item in drawingNoList" :key="item.value" :label="item.label"
:value="item.value" /></el-select>
</el-col>
- <el-col :span="8" class="search-data-flex">
- <span class="search-data-title">鏃堕棿鑼冨洿:</span>
+ <el-col :span="6" class="search-data-flex">
+ <span class="search-data-title">鏃堕棿:</span>
<el-date-picker v-model="searchTreeData.createTime" type="daterange" start-placeholder="寮�濮嬫椂闂�"
end-placeholder="缁撴潫鏃堕棿" :size="size" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="createTimeChange" /><!--:disabled-date="disabledDate" 涓嶉渶瑕佺鐢ㄦ棩鏈�-->
</el-col>
- <el-col :span="4" class="search-data-flex">
+ <el-col :span="6" class="search-data-flex">
<el-button type="primary" @click="searchTree" :loading="treeSearchLoad"><el-icon class="el-icon--right"
style="margin-right: 6px;">
<Search />
@@ -36,32 +36,24 @@
style="margin-right: 6px;">
<Delete />
</el-icon>娓呯┖</el-button>
+ <el-button type="danger" @click="refresh()">閲嶇疆琛ㄦ牸</el-button>
</el-col>
</el-row>
</template>
- <!-- <template #menu-left>
- <el-button :size="size" type="primary" @click="showAdd()">鏂板鏍硅妭鐐�</el-button>
- </template> -->
+
<template #name="{ row }">
<span>{{ row.name }}</span>
- <!-- <el-button :size="size" text v-if="row.nodeType != 70" icon="el-icon-setting" type="primary" placeholder="淇敼" @click="showEdit(row)" title="淇敼"></el-button>
- <el-button :size="size" text v-if="row.nodeType != 10" icon="el-icon-delete" type="primary" @click="showDel(row)" placeholder="鍒犻櫎" title="鍒犻櫎"></el-button>
- <el-button :size="size" text v-if="row.nodeType != 60 && row.nodeType != 70" icon="el-icon-document-add" type="primary" @click="showAdd(row)" placeholder="鏂板瀛愮骇" title="鏂板瀛愮骇"></el-button>
- <el-button :size="size" text v-if="row.nodeType == 60 || row.nodeType == 50" icon="el-icon-upload" type="primary" @click="showUpload(row)" placeholder="鏂囦欢涓婁紶" title="鏂囦欢涓婁紶"></el-button> -->
- <!-- 娑夊瘑缃戞墠鏈� -->
- <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="鍗囩増" title="鍗囩増"></el-button> -->
- <!-- 宸ユ帶缃戞墠鏈� -->
- <!-- <el-button :size="size" text v-if="row.nodeType == 70" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button> -->
-
- <!-- 鏇挎崲 v-if="permission.auto_dispatch"-->
- <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
+ <el-tag v-if="row.nodeType == 60" size="mini" effect="plain">v{{ row.versionNumber }}</el-tag>
+ <el-button icon="el-icon-download" @click="handleDownload(row)" class="treebtn" v-if="row.nodeType == 70" :size="size" text title="涓嬭浇"></el-button>
+ <el-button class="treebtn" :size="size" text v-if="permission.replace_button && row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
- <el-button :size="size" text
- v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
- icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
- <el-button :size="size" text
- v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
- icon="el-icon-unlock" type="primary" @click="startUnlock(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
+ <!---->
+ <el-button icon="el-icon-unlock" class="treebtn" v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"text type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
+
+ <el-button icon="el-icon-lock" class="treebtn" :size="size" text
+ v-if="permission.lock_button && row.nodeType == 60 && (row.parentIds.indexOf('0,2') > -1 || row.parentIds.indexOf('0,3') > -1)&& row.isLocked == 1"
+ type="primary" @click="showUnLockDlg(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
+
</template>
</avue-crud>
</div>
@@ -79,15 +71,15 @@
<el-checkbox value="3" label="鍋忕" />
</el-checkbox-group>
</el-col>
- <el-col :span="4" class="search-data-flex">
+ <el-col :span="6" class="search-data-flex">
<span class="search-data-title">闆剁粍浠跺彿:</span>
- <el-select v-model="searchTreeData.drawingNo" filterable remote reserve-keyword placeholder="杈撳叆鑷冲皯3涓瓧绗﹁繃婊ゆ暟鎹�"
+ <el-select v-model="searchTreeData.drawingNo" clearable filterable remote reserve-keyword placeholder="杈撳叆鑷冲皯3涓瓧绗﹁繃婊ゆ暟鎹�"
:remote-method="remoteMethod" :loading="searchLoading">
<el-option v-for="item in drawingNoList" :key="item.value" :label="item.label"
:value="item.value" /></el-select>
</el-col>
- <el-col :span="8" class="search-data-flex">
- <span class="search-data-title">鏃堕棿鑼冨洿:</span>
+ <el-col :span="6" class="search-data-flex">
+ <span class="search-data-title">鏃堕棿:</span>
<el-date-picker v-model="searchTreeData.createTime" type="daterange" start-placeholder="寮�濮嬫椂闂�"
end-placeholder="缁撴潫鏃堕棿" :size="size" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="createTimeChange" /><!--:disabled-date="disabledDate" 涓嶉渶瑕佺鐢ㄦ棩鏈�-->
@@ -101,6 +93,7 @@
style="margin-right: 6px;">
<Delete />
</el-icon>娓呯┖</el-button>
+ <el-button type="danger" @click="refresh()">閲嶇疆琛ㄦ牸</el-button>
</el-col>
</el-row>
</template>
@@ -109,40 +102,28 @@
</template> -->
<template #name="{ row }">
<span>{{ row.name }}</span>
-
+ <el-tag v-if="row.nodeType == 60" size="mini" effect="plain">v{{ row.versionNumber }}</el-tag>
+ <el-button icon="el-icon-download" @click="handleDownload(row)" class="treebtn" v-if="row.nodeType == 70" :size="size" text title="涓嬭浇"></el-button>
<!-- 鏇挎崲 v-if="permission.auto_dispatch"-->
- <el-button :size="size" text v-if="row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
+ <el-button class="treebtn" :size="size" text v-if="permission.replace_button && row.nodeType == 60 && row.parentIds.indexOf('0,1,') > -1"
icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
- <el-button :size="size" text
+ <el-button class="treebtn" :size="size" text
v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked != 1"
- icon="el-icon-lock" type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
- <el-button :size="size" text
- v-if="permission.lock_button && row.nodeType == 60 && row.parentIds.indexOf('0,2') > -1 && row.isLocked == 1"
- icon="el-icon-unlock" type="primary" @click="startUnlock(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
+ icon="el-icon-unlock" type="primary" @click="showLockDlg(row)" placeholder="閿佸畾" title="閿佸畾"></el-button>
+ <el-button class="treebtn" :size="size" text
+ v-if="permission.lock_button && row.nodeType == 60 && (row.parentIds.indexOf('0,2') > -1 || row.parentIds.indexOf('0,3') > -1)&& row.isLocked == 1"
+ icon="el-icon-lock" type="primary" @click="showUnLockDlg(row)" placeholder="瑙i攣" title="瑙i攣"></el-button>
</template>
</avue-crud>
</div>
- <!-- 鏂板鑺傜偣 -->
- <el-dialog :title="modalTitle" append-to-body v-model="modalBox">
- <avue-form :option="modalOption" v-model="modalForm" @submit="modalSubmit" @reset-change="modalCancel" />
- </el-dialog>
- <el-dialog title="涓婁紶鏂囦欢" append-to-body v-model="uploadmodalBox">
- <avue-form :option="uploadmodalOption" v-model="uploadmodalForm" @submit="uploadmodalSubmit"
- @reset-change="uploadmodalCancel" :upload-before="uploadBefore" :upload-after="uploadAfter">
- <template #fileList="{ }" slot-scope="{ value }">
- <div v-for="(file, index) in fileList" :key="index" v-if="fileList.length != 0">
- {{ file.name }}
- </div>
- <div v-else>娌℃湁涓婁紶鏂囦欢</div>
- </template>
- </avue-form>
- </el-dialog>
<!-- 閿佸畾瀵硅瘽妗� -->
<el-dialog title="绋嬪簭閿佸畾" append-to-body v-model="lockBox">
<avue-form :option="lockOption" v-model="lockForm" @submit="lockSubmit" @reset-change="lockCancel" />
</el-dialog>
-
+ <el-dialog title="绋嬪簭瑙i攣" append-to-body v-model="unlockBox">
+ <avue-form :option="unlockOption" v-model="unlockForm" @submit="unlockSubmit" @reset-change="unlockCancel" />
+ </el-dialog>
<avue-tabs :option="tabsOption" @change="tabsHandleChange" style="margin-top: 30px;" v-if="isShowTabs"></avue-tabs>
<avue-form v-if="tabsType == 'tab1'" :option="tabsFormOption" v-model="tabsForm"></avue-form>
<!--<span v-else-if="tabsType == 'tab2'">鐗堟湰淇℃伅</span>-->
@@ -150,19 +131,38 @@
<div v-html="convertToHtml(fileContent)" class="convertToHtml"></div>
</template>
<template v-else-if="tabsType == 'tab4'">
+ <!--
<avue-crud :addBtn="false" :option="tabsFormOption4" :data="tabsForm4" ref="crud4"
@selection-change="selectionChange">
+
<template #menu-left>
<el-button :size="size" type="primary" @click="comparison"
:disabled="selectionList.length != 2">瀵规瘮</el-button>
</template>
+
</avue-crud>
+ -->
+ <el-table :data="tabsForm4" border :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" max-height="220" highlight-current-row>
+
+ <el-table-column type="index" label="#" width="40" align="center" />
+ <el-table-column prop="name" label="绋嬪簭鍖呭悕">
+ </el-table-column>
+ <el-table-column prop="versionNumber" label="绋嬪簭鐗堟湰">
+ </el-table-column>
+ <el-table-column prop="createTime" label="鍒涘缓鏃堕棿">
+ </el-table-column>
+ <el-table-column prop="createUserName" label="鍒涘缓浜�">
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
+ <template #default="scope">
+ <a style="color: blue;cursor: pointer;font-size: 12px;margin-right: 4px;" type="text" size="small"
+ @click.stop="showHisFileDlg(scope.$index, scope.row)">绋嬪簭鏂囦欢</a>
+
+ </template>
+ </el-table-column>
+ </el-table>
</template>
- <el-dialog title="鍗囩増" append-to-body v-model="upgradeModal" width="500">
- <avue-form :option="upgradeModalOption" v-model="upgradeModalForm" @submit="upgradeSubmit"
- @reset-change="upgradeCancel"></avue-form>
- </el-dialog>
</basic-container>
<!-- 鏂囦欢瀵规瘮 -->
<el-drawer title="鏂囦欢瀵规瘮" append-to-body v-model="diffBox" size="100%" class="code-box">
@@ -171,34 +171,59 @@
:filename="codeDiffFileName1" :newFilename="codeDiffFileName2" />
</div>
</el-drawer>
+
+ <el-dialog title="鏌ョ湅鍘嗗彶鏂囦欢" append-to-body v-model="hisFileViewModel">
+ <el-table :data="hisFileTableData" ref="hisFilesTable" border @row-click="showHisContent" max-height="200" highlight-current-row>
+ <el-table-column type="index" label="#" width="40" align="center"/>
+ <el-table-column prop="name" label="鏂囦欢鍚嶇О"></el-table-column>
+ <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="180"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="80" align="center">
+ <template #default="scope">
+ <a style="color: blue;cursor: pointer;font-size: 12px;margin-right: 4px;" type="text" size="small"
+ @click.stop="handleDownload(scope.row)">涓嬭浇</a>
+ </template>
+ </el-table-column>
+ </el-table>
+ <h4>绋嬪簭鍐呭</h4>
+ <div v-html="hisFileContent" class="app-content"></div>
+ </el-dialog>
+
<!-- 鏇挎崲 -->
- <el-drawer title="鏇挎崲" append-to-body v-model="todolistModel" size="100%" class="code-box">
+ <el-drawer title="鏇挎崲" append-to-body v-model="replaceModel" size="100%" class="code-box">
<div class="approve-box">
<div class="left">
- <TodolistLeft :row="row" :replaceDataId="replaceDataId" :drawingNo="drawingNo" :processNo="processNo"
+ <ReplaceLeft ref="replaceLeft" v-if="replaceModel" :row="row" :replaceDataId="replaceDataId" :drawingNo="drawingNo" :processNo="processNo"
:processEdition="processEdition" @selection-change="todoSelectionChange" />
</div>
<div class="right">
- <TodolistRightTop :row="row" :name="name" />
- <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" />
+ <ReplaceRightTop :row="row" :name="name" />
+ <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleReplace" />
</div>
</div>
</el-drawer>
+
</template>
<script>
+
+import { Delete, Edit, Search, Share, Upload ,Lock,Unlock} from '@element-plus/icons-vue'
import debounce from 'lodash/debounce';
+import NProgress from 'nprogress';
+import { downloadXls } from '@/utils/util';
+import { exportBlob } from '@/api/common';
import { ElMessage } from 'element-plus';
-import TodolistLeft from './components/TodolistLeft.vue';
-import TodolistRightTop from './components/TodolistRightTop.vue';
+import ReplaceLeft from './components/ReplaceLeft.vue';
+import ReplaceRightTop from './components/ReplaceRightTop.vue';
+import qs from 'qs';
export default {
components: {
- TodolistLeft,
- TodolistRightTop
+ ReplaceLeft,
+ ReplaceRightTop
},
data() {
- let rejectText = '椹冲洖';//+this.row.categoryName;
+
return {
+ size:'large',//鏍戦噷鎸夐挳鐨勫昂瀵�
isSearch: null,
treeSearchLoad: false,
drawingNoList: [],
@@ -275,7 +300,7 @@
},
applist: [],
row: {},
- todolistModel: false,
+ replaceModel: false,
diffBox: false,
content1: "",
content2: "",
@@ -283,55 +308,50 @@
codeDiffFileName2: "",
selectionList: [],
targetRow: {},
- upgradeModal: false,
file: null,
fileContent: "",
isShowTabs: true,
nodeTypeList: [],
- fileList: [],
+
tabsType: "tab1",
- upgradeModalForm: {},
- upgradeModalOption: {
- emptyText: "鍙栨秷",
- menuPosition: "right",
- column: [{
- label: '宸ュ簭鐗堟',
- prop: 'processEdition',
- labelWidth: "80",
- span: 22
- }]
- },
tabsOption: {},
tabsOption1: {
column: [{
icon: 'el-icon-info',
label: '鑺傜偣淇℃伅',
prop: 'tab1',
- }/*, {
- icon: 'el-icon-warning',
- label: '鐗堟湰淇℃伅',
- prop: 'tab2',
- }*/]
+ }
+ ]
},
tabsOption2: {
column: [{
icon: 'el-icon-info',
label: '鑺傜偣淇℃伅',
prop: 'tab1',
- },/* {
- icon: 'el-icon-warning',
- label: '鐗堟湰淇℃伅',
- prop: 'tab2',
- }, */{
+ },
+ {
icon: 'el-icon-warning',
label: '鏂囦欢鍐呭',
prop: 'tab3'
- }, {
+ }
+ ]
+ },
+ tabsOptionPackage: {
+ column: [{
+ icon: 'el-icon-info',
+ label: '鑺傜偣淇℃伅',
+ prop: 'tab1',
+ },
+ {
icon: 'el-icon-warning',
label: '鍘嗗彶璁板綍',
prop: 'tab4'
}]
},
+ hisFileViewModel: false,//鍘嗗彶鏂囦欢鍒楄〃瀵硅瘽妗�
+ hisFileTableData:[], //鍘嗗彶鏂囦欢鍒楄〃鏁版嵁
+ hisFileContent:'',//鍘嗗彶鏂囦欢鍐呭
+
tabsFormOption: {
submitBtn: false,
emptyBtn: false,
@@ -359,86 +379,20 @@
prop: 'createTime',
disabled: true,
placeholder: " "
- },/*
- {
- label: '鑺傜偣鎻忚堪',
- prop: 'description',
- disabled: true,
- placeholder: " "
- },*/
+ },
{
label: '淇敼鏃堕棿',
prop: 'updateTime',
disabled: true,
placeholder: " "
- }/*,
- {
- label: '澶囨敞',
- prop: 'remark',
- disabled: true,
- placeholder: " "
- }*/
- ]
- },
- tabsForm: {},
- uploadmodalBox: false,
- uploadmodalForm: {},
- selectedColumn: {},
- modalForm: {},
- modalOption: {
- submitText: "淇濆瓨",
- emptyText: "鍙栨秷",
- menuPosition: "right",
- column: [
- {
- label: '鑺傜偣绫诲瀷1',
- prop: 'nodeType',
- labelWidth: "120",
- type: 'select',
- dicUrl: '/blade-system/dict-biz/dictionary?code=nc_node_type',
- props: {
- label: 'dictValue',
- value: 'dictKey',
- },
- disabled: true
- },
- {
- label: '璁惧锛堟満搴婏級',
- prop: 'machineCode',
- labelWidth: "120",
- type: 'select',
- dicUrl: '/blade-mdm/machine/page',
- props: {
- label: 'name',
- value: 'code',
- },
- dicFormatter(res) {
- return res.data.records;
- }
- },
- {
- label: '鑺傜偣鍚嶇О',
- prop: 'name',
- labelWidth: "120",
- },
- {
- label: '鑺傜偣鎻忚堪',
- prop: 'description',
- labelWidth: "120",
- hide: true
- },
- {
- label: '澶囨敞',
- prop: 'remark',
- type: "textarea",
- labelWidth: "120",
- span: 24
}
]
},
- modalBox: false,
- modalTitle: "",
-
+ tabsForm: {},
+
+ selectedColumn: {},
+ modalForm: {},
+
lockOption: {
submitText: "閿佸畾",
emptyText: "鍙栨秷",
@@ -464,6 +418,38 @@
lockForm: {},
lockBox: false,
+ unlockOption: {
+ submitText: "鍚姩瑙i攣娴佺▼",
+ emptyText: "鍙栨秷",
+ menuPosition: "right",
+ column: [
+ {
+ label: '绋嬪簭鍖呭悕',
+ prop: 'name',
+ disabled:true,
+ labelWidth: "120",
+ },
+ {
+ label: '閿佸畾鍘熷洜',
+ prop: 'remark',
+ type: "textarea",
+ placeholder:'<鍐呭涓虹┖>',
+ disabled:true,
+ labelWidth: "120",
+ span: 24,
+ },
+ {
+ label: '瑙i攣鍘熷洜',
+ prop: 'unlockReason',
+ type: "textarea",
+ labelWidth: "120",
+ span: 24,
+ }
+ ]
+ },
+ unlockForm: {},
+ unlockBox: false,
+
id: "",
parentId: 1,
loading: true,
@@ -472,6 +458,7 @@
current: 1,
total: 0,
},
+ /*
tabsFormOption4: {
rowKey: "id",
selection: true,
@@ -486,7 +473,7 @@
{ label: '鍒涘缓鏃堕棿', prop: 'createTime' },
{ label: '鍒涘缓浜�', prop: 'createUserName' },
]
- },
+ },*/
tabsForm4: {},
defaultExpandedKeys: [],
option: {
@@ -518,10 +505,10 @@
{
label: '鐩綍',
prop: 'name',
- width: '360'
+ width: '420'
},
- {
- label: '鐗堟湰',
+ /*{
+ label: '绋嬪簭鐗堟湰',
prop: 'versionNumber',
formatter: (val, value, label) => {
if (val.nodeType == '60') {
@@ -534,16 +521,11 @@
return '';
}
}
- },
+ },*/
{
label: '绫诲瀷',
prop: 'nodeTypeName'
- },/*
- {
- label: '璁惧',
- prop: 'machineCode'
},
- */
{
label: '閿佸畾鐘舵��',
prop: 'isLocked',
@@ -591,143 +573,11 @@
],
},
treeData: [],
- upData: []
};
},
computed: {
...mapGetters(['userInfo', 'permission']),
- uploadmodalOption() {
- return {
- submitText: "淇濆瓨",
- emptyText: "鍙栨秷",
- menuPosition: "right",
- column: [
- {
- label: '鑺傜偣绫诲瀷',
- prop: 'nodeType',
- labelWidth: "120",
- type: 'select',
- dicUrl: '/blade-system/dict-biz/dictionary?code=nc_node_type',
- props: {
- label: 'dictValue',
- value: 'dictKey',
- },
- disabled: true
- },
- {
- label: '璁惧缂栧彿',
- prop: 'machineCode',
- labelWidth: "120",
- type: 'select',
- dicUrl: '/blade-mdm/machine/page',
- props: {
- label: 'name',
- value: 'code',
- },
- dicFormatter(res) {
- return res.data.records;
- },
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ヨ澶囩紪鍙�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '闆剁粍浠跺彿/鍥惧彿',
- prop: 'drawingNo',
- labelWidth: "120",
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ラ浂缁勪欢鍙�/鍥惧彿',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '宸ュ簭',
- prop: 'processName',
- labelWidth: "120",
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ュ伐搴�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '宸ュ簭鐗堟湰',
- prop: 'processEdition',
- labelWidth: "120",
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ュ伐搴忕増鏈�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '鏂囦欢鍒嗙被',
- prop: 'category',
- labelWidth: "120",
- type: 'select',
- dicUrl: '/blade-system/dict-biz/dictionary?code=node_file_type',
- props: {
- label: 'dictValue',
- value: 'dictKey',
- },
- rules: [
- {
- required: true,
- message: '璇烽�夋嫨鏂囦欢鍒嗙被',
- trigger: 'change'
- }
- ]
- },
- {
- label: '閫夋嫨鏂囦欢',
- prop: 'uploadFile',
- labelWidth: "120",
- type: 'upload',
- data: { nodeId: this.id },
- action: "",
- showFileList: false,
- span: 24,
- tip: "璇蜂笂浼犳枃浠讹紝灏嗗湪鎻愪氦鏃剁粺涓�澶勭悊",
- action: "/blade-mdm/program/ncfile/upload",
- rules: [
- {
- validator: (rule, value, callback) => {
- if (this.fileList.length === 0) {
- callback(new Error('璇蜂笂浼犳枃浠�'));
- } else {
- callback();
- }
- },
- trigger: 'blur'
- }
- ]
- },
- {
- label: '宸蹭笂浼犳枃浠�',
- prop: 'fileList',
- labelWidth: "120"
- },
- {
- label: '澶囨敞',
- prop: 'remark',
- type: "textarea",
- labelWidth: "120",
- span: 24
- }
- ]
- }
- }
+
},
watch: {
@@ -748,7 +598,6 @@
return time.getTime() > today.getTime() || time.getTime() < threeMonthsAgo.getTime();//
},
createTimeChange(value) {
- console.log('createTimeChange', value)
this.searchTreeData.createTimeBegin = value[0];
this.searchTreeData.createTimeEnd = value[1];
},
@@ -779,10 +628,33 @@
this.drawingNoList = drawingNoList;
});
},
+ refresh(){
+ //琛ㄦ牸閲嶇疆
+ this.treeData=[];
+ //this.$refs.curd.refreshTable();
+ let curS = this.isSearch;
+ this.isSearch = null;
+ this.onLoad();
+ this.isSearch = !curS
+
+ },
+ handleDownload(row){
+ NProgress.start();
+ exportBlob(
+ `/blade-mdm/program/nodehis/download-by-nodeid?nodeId=${row.id}`
+ ).then(res => {
+ if (res.status !== 200) {
+ return this.$message.error(res.msg);
+ }
+ downloadXls(res.data, `${row.name}`);
+ NProgress.done();
+ });
+ },
showLockDlg(row){
- this.lockForm = row;
- //this.lockForm.name = row.name;
- // this.lockForm.id = row.id;
+ //this.lockForm = row;
+ this.lockForm.id = row.id;
+ this.lockForm.name = row.name
+ this.lockForm.parentId = row.parentId;
this.lockForm.remark = '';
this.lockBox = true;
},
@@ -790,33 +662,41 @@
this.lockBox = false;
this.lockForm = {};
},
- lockSubmit() {
+ showUnLockDlg(row){
+ this.unlockForm.id = row.id;
+ this.unlockForm.name = row.name
+ this.unlockForm.remark = row.remark;
+ this.unlockForm.unlockReason='';
+ this.unlockForm.parentId = row.parentId;
+ this.unlockBox = true;
+ },
+ lockSubmit(row,done) {
//閿佸畾鎻愪氦
this.$confirm('鏄惁閿佸畾', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning',
}).then(() => {
- axios({
- url: '/blade-mdm/program/node/lock',
- method: 'post',
- params: this.lockForm
- }).then(res => {
+ axios.post('/blade-mdm/program/node/lock',qs.stringify(this.lockForm)).then(res=>{
if (res.data.code == 200) {
this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛!' });
this.addLocalTreeNode(this.lockForm.parentId);
this.lockBox = false;
} else {
- this.$message({ type: 'success', message: res.data.msg });
+ this.$message({ type: 'error', message: res.data.msg });
}
+ this.lockBox = false;
+ }).catch(error => {
+ this.$message({ type: 'error', message: res.data.msg });
});
+ done();
}).catch(action => {
console.log('cancel')
});
},
- startUnlock(row) {
+ unlockSubmit(row,done) {
//鍚姩瑙i攣娴佺▼
- this.$confirm(`鏄惁瑙i攣`, {
+ this.$confirm(`纭瑙i攣`, {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning',
@@ -824,20 +704,69 @@
axios({
url: '/blade-mdm/flow/lock/start-unlock',
method: 'post',
- params: {nodeId: row.id }
+ params: {nodeId: row.id,unlockReason:row.unlockReason }
}).then(res => {
if (res.data.code == 200) {
this.$message({ type: 'success', message: '瑙i攣娴佺▼宸插惎鍔�!' });
- this.addLocalTreeNode(row.parentId);
+ //this.addLocalTreeNode(row.parentId);
+ this.unlockBox = false;
} else {
- this.$message({ type: 'success', message: res.data.msg });
+ this.$message({ type: 'error', message: res.data.msg });
}
});
+ done();
}).catch(action => {
console.log('cancel')
});
},
- handleSubmit(form, done) {
+ unlockCancel() {
+ this.unlockBox = false;
+ },
+ replacement(row) { //鏇挎崲
+ this.id = row.id;
+ this.formApprove = {
+ comment: '',
+ approve: 'Y', // 榛樿鍚�
+ }
+ //鍑嗗绋嬪簭鏇挎崲娴佺▼
+ axios({
+ url: '/blade-mdm/flow/replace/pre',
+ method: 'post',
+ params: { nodeId: row.id }
+ }).then(resp => {
+ this.row = row;
+
+ this.drawingNo = resp.data.data.drawingNo;
+ this.replaceDataId = resp.data.data.processInstanceId;
+ //console.log('replaceDataId',this.replaceDataId)
+ this.processNo = resp.data.data.processNo;
+ this.processEdition = resp.data.data.processEdition;
+
+ this.formApprove.title = resp.data.data.name + "鏇挎崲";
+
+ this.getHandler(); //鑾峰彇澶勭悊浜�
+ this.$nextTick(() => {
+ //绛夊緟dom鏇存柊鍐嶆樉绀虹晫闈�
+ this.replaceModel = true;
+ })
+
+ });
+ },
+ getHandler() { //鑾峰彇澶勭悊浜�
+ axios({
+ url: '/blade-mdm/flow/replace/default-assignees',
+ method: 'get',
+ params: { drawingNo: this.drawingNo }
+ }).then(
+ resp => {
+ if (resp.data.code == 200) {
+ this.formApprove.assignee = resp.data.data.checkerId;
+ } else {
+ this.$message.success(resp.msg);
+ }
+ });
+ },
+ handleReplace(form, done) {
//鍙戣捣绋嬪簭鏇挎崲娴佺▼
var obj = {
title: this.formApprove.title,
@@ -856,87 +785,54 @@
message: '鎿嶄綔鎴愬姛!',
});
done();
- this.todolistModel = false;
+ this.replaceModel = false;
}).catch(error => {
- window.console.log('haha', error);
done();
});
- // if(this.row.taskDefinitionKey === 'programmingTask') {
- // // if(this.applist.length !== 1) {
- // // done();
- // // return this.$message.success('璇烽�夋嫨1涓▼搴�');
- // // }
- // }
- // approve({
- // ...this.formApprove,
- // taskId: this.row.taskId,
- // processInstanceId: this.row.processInstanceId,
- // // programIds: this.row.taskDefinitionKey === 'programmingTask' ? this.applist.map(v => v.id).join(',') : '',
- // }).then(res => {
- // if(res.data.code !== 200) {
- // this.$message.error(res.data.msg);
- // done();
- // return;
- // }
- // this.$message.success('瀹℃壒鎴愬姛');
- // this.approveBox = false;
- // this.onLoad(this.page, this.query);
- // done();
- // }).catch(err => {
- // done();
- // console.error(err);
- // });
+
+ },
+
+ showHisFileDlg(index,row){
+ this.hisFileViewModel = true;
+
+ //鏌ヨ鏂囦欢鍒楄〃
+ axios({
+ url: '/blade-mdm/program/nodehis/files-by-parent-id',
+ method: 'get',
+ params: {id: row.id}
+ }).then(
+ res => {
+
+ if(res.data.code === 200) {
+ this.hisFileTableData = res.data.data;
+ if(this.hisFileTableData.length > 0){
+ this.showHisContent(this.hisFileTableData[0])
+ this.$refs.hisFilesTable.setCurrentRow(this.hisFileTableData[0]);
+ }
+
+ } else {
+ this.$message.error('绋嬪簭鍐呭鍔犺浇澶辫触');
+ }
+ });
+ },
+ showHisContent(row, column, event) {
+
+ axios({
+ url: '/blade-mdm/program/nodehis/content-by-nodeid',
+ method: 'get',
+ params: {nodeId: row.id}
+ }).then(
+ res => {
+
+ if(res.data.code === 200) {
+ this.hisFileContent = res.data.data;
+ } else {
+ this.hisFileContent = '绋嬪簭鍐呭鍔犺浇澶辫触'
+ }
+ });
},
todoSelectionChange(applist) {
this.applist = applist;
- },
- showReplaceDlg(row) { //鏇挎崲瀵硅瘽妗�
-
- if (row.nodeType == 60) { //绋嬪簭鍖�
- return;
- }
- //111
- this.modalTitle = "鏂板瀛愯妭鐐�";
- this.selectedColumn.parentId = row.id;
- this.modalForm = this.selectedColumn;
-
- this.modalBox = true;
- },
- replacement(row) { //鏇挎崲
- this.id = row.id;
- this.formApprove = {
- comment: '',
- approve: 'Y', // 榛樿鍚�
- }
- //鍑嗗绋嬪簭鏇挎崲娴佺▼
- axios({
- url: '/blade-mdm/flow/replace/pre',
- method: 'post',
- params: { nodeId: row.id }
- }).then(resp => {
- this.row = row;
- this.replaceDataId = resp.data.data.processInstanceId;
- this.processNo = resp.data.data.processNo;
- this.processEdition = resp.data.data.processEdition;
- this.drawingNo = resp.data.data.drawingNo;
- this.formApprove.title = resp.data.data.name + "鏇挎崲";
- this.getHandler(); //鑾峰彇澶勭悊浜�
- this.todolistModel = true;
- });
- },
- getHandler() { //鑾峰彇澶勭悊浜�
- axios({
- url: '/blade-mdm/flow/replace/default-assignees',
- method: 'get',
- params: { drawingNo: this.drawingNo }
- }).then(
- resp => {
- if (resp.data.code == 200) {
- this.formApprove.assignee = resp.data.data.checkerId;
- } else {
- this.$message.success(resp.msg);
- }
- });
},
convertToHtml(text) {
return text.replace(/\n/g, '<br>');
@@ -965,7 +861,6 @@
return treeData.map(node => {
if (node.children && node.children.length > 0) {
this.defaultExpandedKeys.push(node.id);
- console.log('>>>>>>>>', this.defaultExpandedKeys)
node.children = this.removeHasChildren(node.children);
}
if (node.children.length > 0) {
@@ -978,10 +873,10 @@
});
},
searchTree() {
- if (this.searchTreeData.programStatus.length == 0 || this.searchTreeData.drawingNo == ""){
+ if (this.searchTreeData.programStatus.length == 0 || !this.searchTreeData.drawingNo){
this.$message.warning('璇疯緭鍏ョ▼搴忕姸鎬佸拰闆剁粍浠跺彿杩涜鎼滅储');
return;
- }
+ }
this.treeSearchLoad = true;
this.isSearch = !this.isSearch
@@ -1001,7 +896,6 @@
};
// this.option.defaultExpandAll = true;
let treeData = this.removeHasChildren(res.data.data);
- console.log('treeData', treeData)
this.option = Object.assign({},this.option,{defaultExpandedKeys: this.defaultExpandedKeys,lazy: true,defaultExpandAll: true});
setTimeout(() => {
this.treeSearchLoad = false;
@@ -1039,23 +933,7 @@
this.onLoad();
})
},
- upgradeSubmit(row, done) { //鍗囩増
- axios({
- url: '/blade-mdm/program/ncfile/upgrade-process-edition',
- method: 'post',
- params: { bindNcNodeId: row.id, newProcessEdition: row.processEdition },
- }).then(
- res => {
- done();
- this.upgradeModal = false;
- this.$message.success('鎿嶄綔鎴愬姛');
- this.addLocalTreeNode(row.parentId);
- }
- );
- },
- upgradeCancel() {
- this.upgradeModal = false;
- },
+
downsend(row) { //涓嬪彂
this.loading = true;
axios({
@@ -1087,64 +965,7 @@
}
);
},
- uploadBefore(file, done, loading, column) {
- this.file = file;
- this.fileList.push(file);
- //done(); 鏀惧紑灏变笂浼犱簡
- return false;
- },
- uploadAfter() {
- },
- uploadmodalSubmit(row, done) { //涓婁紶鎻愪氦鎺ュ彛
- if (this.file == null) {
- this.$message.error('璇蜂笂浼犳枃浠�');
- return;
- }
- var formData = new FormData();
- formData.append('file', this.file);
- formData.append('nodeId', this.id);
- if (this.isRepeatUpload) {
- formData.append('cofirm', '1');
- }
- Object.keys(this.uploadmodalForm).forEach(key => {
- formData.append(key, this.uploadmodalForm[key]);
- });
- this.loading = true;
- axios({
- url: '/blade-mdm/program/ncfile/upload',
- method: 'post',
- data: formData,
- }).then(res => {
- this.loading = false;
- if (res.data.code == 2) {
- this.$confirm('鏂囦欢鍚嶅凡瀛樺湪锛岀‘瀹氫笂浼犲悧?', '鎻愮ず', {
- distinguishCancelAndClose: true,
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- this.isRepeatUpload = true;
- this.uploadmodalSubmit(row, done);
- }).catch(action => {
- this.isRepeatUpload = false;
- this.$message({
- type: 'info',
- message: '鍙栨秷涓婁紶'
- })
- });
- } else if (res.data.success) {
- this.isRepeatUpload = false;
- this.uploadmodalBox = false;
- this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛!' });
- this.addLocalTreeNode(row.id); //閲嶆柊鍔犺浇涓嬩竴绾�
- } else {
- this.isRepeatUpload = false;
- alert(1)
- }
- done();
- }
- );
- },
+
rowClick(row) {
this.tabsForm = row;
this.id = row.id;
@@ -1154,17 +975,22 @@
this.tabsForm.nodeTypeName = item.dictValue;
}
})
- if (this.tabsForm.nodeType != 70) {
- this.tabsOption = this.tabsOption1;
- } else {
- this.tabsOption = this.tabsOption2;
- //鑾峰彇鏂囦欢list
- this.getFile(row.id);
+ if (this.tabsForm.nodeType == 60) {
+ //鍖呭悕鑺傜偣
+ this.tabsOption = this.tabsOptionPackage;
//鑾峰彇鍘嗗彶璁板綍
this.getHistory(row.id);
+ } else if (this.tabsForm.nodeType == 70){
+ //鏂囦欢鑺傜偣
+ this.tabsOption = this.tabsOption2;
+ //鑾峰彇鏂囦欢鍐呭
+ this.getFile(row.id);
+
//娓呯┖瀵规瘮璁板綍
this.content1 = "";
this.content2 = "";
+ }else{
+ this.tabsOption = this.tabsOption1;
}
this.$nextTick(() => {
this.tabsType = 'tab1';
@@ -1174,26 +1000,11 @@
tabsHandleChange(tabs) {
this.tabsType = tabs.prop;
},
- showUpload(row) {//鑾峰彇闄勪欢鍐呭锛堟殏鏃舵病鐢級
- this.fileList = [];
- this.uploadmodalForm = row;
- this.loading = true;
- var obj = { parentId: row.id }
- axios({
- url: '/blade-mdm/program/node/lazy-list',
- method: 'get',
- params: obj,
- }).then(
- res => {
- this.loading = false;
- this.uploadmodalBox = true;
- }
- );
- },
+
getFile(id) { //鏌ョ湅鏂囦欢鍐呭
this.loading = true;
axios({
- url: '/blade-mdm/program/ncfile/content-by-nodeid',
+ url: '/blade-mdm/program/nodehis/content-by-nodeid',
method: 'get',
params: { nodeId: id },
}).then(
@@ -1206,7 +1017,7 @@
getHistory(id) { //鏌ョ湅鍘嗗彶璁板綍
this.loading = true;
axios({
- url: '/blade-mdm/program/node/history-by-nodeid',
+ url: '/blade-mdm/program/nodehis/history-by-nodeid',
method: 'get',
params: { id },
}).then(
@@ -1236,86 +1047,7 @@
selectionChange(list) {
this.selectionList = list;
},
- showEdit(row, done) {
- this.modalTitle = "淇敼";
- this.modalBox = true;
- this.modalForm = row;
- },
- showDel(row) {
- this.$confirm('灏嗕細鍒犻櫎璇ヨ妭鐐瑰強鍏跺瓙鑺傜偣锛屾槸鍚︾‘璁ゅ垹闄�?', {
- confirmButtonText: '鏄�',
- cancelButtonText: '鍚�',
- type: 'warning',
- }).then(() => {
- //璋冪敤鎺ュ彛
- this.loading = true;
- axios({
- url: '/blade-mdm/program/node/remove',
- method: 'post',
- params: { id: row.id },
- }).then(
- res => {
- this.loading = false;
- this.addLocalTreeNode(row.parentId);
- }
- );
- })
- },
- showAdd(row) { //鏂板瀛愯妭鐐�
- if (!row) {
- this.modalTitle = "鏂板鏍硅妭鐐�";
- this.modalForm.nodeType = this.nodeTypeList[0].dictKey;
- this.modalForm.parentId = 0;
- } else {
- if (row.nodeType == 60) { //绋嬪簭鍖�
- return;
- }
- var defalutNodeType = ""; //涓嬩竴绾ц妭鐐圭被鍨�
- for (var i = 0; i < this.nodeTypeList.length; i++) {
- if (row.nodeType == this.nodeTypeList[i].dictKey) {
- defalutNodeType = this.nodeTypeList[i + 1].dictKey;
- }
- }
- this.modalTitle = "鏂板瀛愯妭鐐�";
- this.selectedColumn.nodeType = defalutNodeType;
- this.selectedColumn.parentId = row.id;
- this.selectedColumn.name = "";
- this.selectedColumn.id = "";
- this.modalForm = this.selectedColumn;
- }
- this.modalBox = true;
- },
- modalSubmit(row, done) { //鏂板瀛愯妭鐐逛繚瀛�/淇敼
- if (this.modalTitle == "淇敼") {
- var url = "/blade-mdm/program/node/update";
- } else {
- var url = "/blade-mdm/program/node/save";
- }
- //璋冪敤鎺ュ彛
- this.loading = true;
- axios({
- url,
- method: 'post',
- data: this.modalForm,
- }).then(
- res => {
- this.$message.success('鎿嶄綔鎴愬姛');
- this.modalBox = false;
- // 淇敼锛屾洿鏂版湰鍦版暟鎹�
- if (this.modalTitle === "淇敼") {
- this.addLocalTreeNode(row.parentId);
- } else {
- // 濡傛灉鏄柊澧炴搷浣滐紝鍙兘闇�瑕侀噸鏂板姞杞芥暟鎹�
- //this.$refs.crud.refreshTable();
- //this.onLoad();
- //鏂板锛屾洿鏂版湰鍦版暟鎹�
- this.addLocalTreeNode(row.parentId);
- }
- this.loading = false;
- done(row);
- }
- );
- },
+
addLocalTreeNode(parentId) {
if (this.modalTitle == "鏂板鏍硅妭鐐�") {
this.onLoad();
@@ -1333,20 +1065,14 @@
if (parentId == 0) {
this.treeData = [...children];
} else {
+
this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[parentId] = [...children];
}
this.loading = false;
}
);
},
- modalCancel() {
- this.modalBox = false;
- },
- uploadmodalCancel() {
- this.uploadmodalBox = false;
- },
treeLoad(tree, treeNode, resolve) {
- console.log('tree', tree, treeNode, this.option)
this.loading = true;
var obj = { parentId: tree.id }
@@ -1397,9 +1123,7 @@
}
);
},
- getPre() {
- alert(1)
- },
+
subtractMonths(date, months) {
const newDate = new Date(date);
const currentMonth = newDate.getMonth();
@@ -1434,6 +1158,9 @@
</script>
<style lang="scss">
+.treebtn {
+ font-size:16px;
+}
.norightmenu .avue-crud .avue-crud__header {
display: none !important;
}
--
Gitblit v1.9.3