From 8b685e0b3bb920dc5fb5a4c29e71ce27b1d36248 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期日, 10 八月 2025 00:23:18 +0800
Subject: [PATCH] 1
---
src/views/wel/index.vue | 187 ++++++++++
yarn.lock | 2
src/views/wel/components/TodolistLeft.vue | 236 +++++++++++++
src/views/wel/todolist.vue | 500 +++++++++++++++++++++++++++
src/views/wel/components/TodolistRightTop.vue | 99 +++++
5 files changed, 1,016 insertions(+), 8 deletions(-)
diff --git a/src/views/wel/components/TodolistLeft.vue b/src/views/wel/components/TodolistLeft.vue
new file mode 100644
index 0000000..72874c0
--- /dev/null
+++ b/src/views/wel/components/TodolistLeft.vue
@@ -0,0 +1,236 @@
+<!--
+ * @Date: 2025-07-01 20:45:15
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2025-08-06 20:40:36
+ * @FilePath: /mdmweb/src/views/flow/components/TodolistLeft.vue
+-->
+<template>
+ <basic-container>
+ <div class="tool">
+ <avue-form :option="attOption"
+ v-model="attForm"
+ :upload-after="uploadAfter" class="att-box"></avue-form>
+ </div>
+ <el-table :data="tableData" border @row-click="showContent" max-height="200">
+ <!-- <el-table-column prop="machineCode" label="鍔犲伐鏈哄簥">
+ </el-table-column> -->
+ <el-table-column prop="name" label="绋嬪簭鍚嶇О">
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="60" align="center">
+ <template #default="scope" >
+ <el-button type="text" size="small" @click.stop="del(scope.$index,scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <h4>绋嬪簭鍐呭</h4>
+ <div v-html="appContent" class="app-content">
+ </div>
+ <el-dialog title="绋嬪簭閫夋嫨" v-model="appDialog" width="50%" v-if="appDialog">
+ <avue-crud :option="optionApp" v-model="form" v-model:page="page" ref="crud" :data="appData"
+ @current-change="currentChange" @size-change="sizeChange"
+ @on-load="onLoad" @selection-change="selectionChange">
+ <template #search="{ }"></template>
+ <template #search-menu="{ }"></template>
+ </avue-crud>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="appDialog = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="add">纭� 瀹�</el-button>
+ </div>
+ </el-dialog>
+ </basic-container>
+</template>
+
+<script>
+import { getAppList,getSelectedAppList,getContent,removeAtt} from '@/api/flow/todolist';
+export default {
+ props: {
+ row: {
+ type: Object,
+ }
+ },
+ data() {
+ return {
+ showContentId: '',
+ attForm: {
+ att: '',
+ }, //绋嬪簭涓婁紶琛ㄥ崟
+ attOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ menu: false,
+ column: [
+ {
+ label: '娣诲姞绋嬪簭',
+ prop: 'att',
+ type: 'upload',
+ multiple: true,
+ action: '/api/blade-mdm/flow/mgr/ncupload',
+ span: 24,
+ data: {
+ processInstanceId: this.row.processInstanceId
+ },
+ }
+ ]
+ }, //绋嬪簭涓婁紶
+ tableData: [],//宸查�夌▼搴�
+ appContent: '',//绋嬪簭鍐呭
+ appDialog: false,
+ form: {},
+ page: {
+ page: 1,
+ size: 10,
+ total: 0,
+ },
+ appData: [],
+ selectionList: [],
+ optionApp: {
+ menu: false,
+ gridBtn: false,
+ addBtn: false,
+ editBtn: false,
+ delBtn: false,
+ columnBtn: false,
+ refreshBtn: false,
+ searchShowBtn: false,
+ tip: false,
+ searchShow: false,
+ dialogWidth: '60%',
+ border: true,
+ index: true,
+ selection: true,
+ menuWidth: 100,
+ dialogClickModal: false,
+ column: [
+ {
+ label: '鍔犲伐鏈哄簥',
+ prop: 'machineCode',
+ },
+ {
+ label: '绋嬪簭鍚嶇О',
+ prop: 'name',
+ },
+ // {
+ // label: '宸ュ簭鍚嶇О',
+ // prop: 'processName',
+ // },
+ ],
+ },
+ }
+ },
+ mounted() {
+ this.getAttList();
+ this.onLoad(this.page);
+ },
+ methods: {
+ uploadAfter(res, done, loading, column) {
+ if (res.code === 200) {
+ this.getAttList();
+ this.$message.success('涓婁紶鎴愬姛');
+ this.attForm.att = '';
+ return done();
+ } else {
+ console.log(res)
+ this.$message.warning(res.msg || '涓婁紶澶辫触');
+ done()
+ }
+ },
+ getAttList () {
+ getSelectedAppList(this.row.processInstanceId).then(res => {
+ if (res.data.code !== 200) {
+ this.$message.error('鑾峰彇宸查�夌▼搴忓け璐�');
+ return;
+ } else {
+ this.tableData = res.data.data || [];
+ }
+ // this.$emit('selection-change',this.tableData)
+ })
+ },
+ addApp() {
+ this.appDialog = true;
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ onLoad(page, params = {}) {
+ const query = {}
+ getAppList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.appData = data.records;
+ });
+ },
+ add () {
+ console.log('add')
+ this.tableData = this.tableData.concat(this.selectionList.filter(item => {
+ return !this.tableData.some(existingItem => existingItem.id === item.id);
+ }));
+ this.appDialog = false;
+ this.$emit('selection-change',this.tableData)
+ },
+ showContent (row, column, event) {
+ if(!row?.id) {
+ this.showContentId = ''
+ return this.appContent = '';
+ }
+ this.showContentId = row.id
+ getContent(row.id).then(res => {
+ if(res.data.code === 200) {
+ this.appContent = res.data.data
+ } else {
+ this.appContent = '绋嬪簭鍐呭鍔犺浇澶辫触'
+ }
+ })
+ },
+ del (index,row) {
+ if(row.id === this.showContentId) {
+ this.showContentId = '';
+ this.showContent(null, null, null);
+ }
+ removeAtt(row.id).then(res => {
+ if(res.data.code === 200) {
+ this.$message.success('鍒犻櫎鎴愬姛');
+ this.getAttList();
+ } else {
+ this.$message.error('鍒犻櫎澶辫触');
+ }
+ })
+ }
+ },
+}
+</script>
+
+<style lang="scss" scoped>
+.tool {
+ text-align: right;
+ margin-bottom: 10px;
+}
+
+.dialog-footer {
+ text-align: center;
+}
+.app-content {
+ background-color: #fffee1;
+ padding: 10px 30px;
+ min-height: 100px;
+ overflow: auto;
+ max-height: 400px;
+ white-space: pre-wrap;
+}
+
+</style>
+<style lang="scss">
+ .att-box {
+ .el-form-item--default {
+ margin-bottom: 0;
+ }
+ .avue-form__menu--center {
+ display: none;
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/src/views/wel/components/TodolistRightTop.vue b/src/views/wel/components/TodolistRightTop.vue
new file mode 100644
index 0000000..ddab39f
--- /dev/null
+++ b/src/views/wel/components/TodolistRightTop.vue
@@ -0,0 +1,99 @@
+<!--
+ * @Date: 2025-07-01 20:45:15
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2025-08-02 21:54:27
+ * @FilePath: /mdmweb/src/views/flow/components/TodolistRightTop.vue
+-->
+<template>
+ <basic-container>
+ <el-form :inline="true" :model="formInline" class="demo-form-inline" label-width="120px" disabled>
+ <el-form-item label="浠诲姟鍚嶇О">
+ <el-input v-model="formInline.processDefinitionName" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="鍒涘缓浜�">
+ <el-input v-model="formInline.startUserName" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="鍥惧彿鐗堟">
+ <el-input v-model="formInline.drawingNoEdition" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="宸ヨ壓鐗堟">
+ <el-input v-model="formInline.craftEdition" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="浠诲姟杞﹂棿">
+ <el-input v-model="formInline.workShop" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="浜у搧鍨嬪彿">
+ <el-input v-model="formInline.productModel" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="宸ュ簭鍙�">
+ <el-input v-model="formInline.processNo" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="宸ュ簭鍚嶇О">
+ <el-input v-model="formInline.processName" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="宸ュ簭鐗堟">
+ <el-input v-model="formInline.processEdition" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="闆剁粍浠跺彿">
+ <el-input v-model="formInline.drawingNo" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="鍔犲伐鏈哄簥">
+ <el-input v-model="formInline.machineCode" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="杩囩▼鍗″彿">
+ <el-input v-model="formInline.empty" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="鍒涘缓鏃堕棿">
+ <el-input v-model="formInline.createTime" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="璁″垝鍔犲伐鏃堕棿">
+ <el-input v-model="formInline.planStartTime" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="绋嬪簭鍖呭悕">
+ <el-input v-model="formInline.programPackageName" placeholder=""></el-input>
+ </el-form-item>
+ <el-form-item label="褰撳墠鑺傜偣">
+ <el-input v-model="formInline.taskName" placeholder=""></el-input>
+ </el-form-item>
+ </el-form>
+ </basic-container>
+</template>
+
+<script>
+export default {
+ props: {
+ row: {
+ type: Object,
+ }
+ },
+ data() {
+ return {
+ formInline: {}
+ }
+ },
+ mounted() {
+ // Initialize formInline with row data
+ // this.formInline = {
+ // ...this.row,
+ // processDefinitionName: this.row.processDefinitionName || '',
+ // taskName: this.row.taskName || '',
+ // createTime: this.row.createTime || '',
+ // startUserName: this.row.startUserName || '',
+ // drawingNoEdition: this.row.variables.drawingNoEdition || '',
+ // craftEdition: this.row.variables.craftEdition || '',
+ // machineCode: this.row.variables.machineCode || '',
+ // processName: this.row.variables.processName || '',
+ // processNo: this.row.variables.processNo || '',
+ // processEdition: this.row.variables.processEdition || '',
+
+ // planStartTime: this.row.variables.planStartTime || '',
+ // productModel: this.row.variables.productModel || '',
+ // programPackageName: this.row.variables.programPackageName || '',
+ // workShop: this.row.variables.workShop || '',
+ // drawingNo: this.row.variables.drawingNo || '',
+ // }
+ }
+}
+</script>
+
+<style lang="scss" scoped></style>
\ No newline at end of file
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 18963a0..357c73f 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -36,14 +36,17 @@
</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 != 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 == 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 && isSM" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="鍗囩増" title="鍗囩増"></el-button>
+ <!-- <el-button :size="size" text v-if="row.nodeType == 70 && isSM" icon="el-icon-pie-chart" type="primary" @click="upgrade(row)" placeholder="鍗囩増" title="鍗囩増"></el-button> -->
<!-- 宸ユ帶缃戞墠鏈� -->
- <el-button :size="size" text v-if="row.nodeType == 70 && !isSM" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button>
+ <!-- <el-button :size="size" text v-if="row.nodeType == 70 && !isSM" icon="el-icon-position" type="primary" @click="downsend(row)" placeholder="涓嬪彂" title="涓嬪彂"></el-button> -->
+ <!-- 鏇挎崲 -->
+ <el-button :size="size" text v-if="row.nodeType == 60 && isSM" icon="el-icon-switch" type="primary" @click="replacement(row)" placeholder="鏇挎崲" title="鏇挎崲"></el-button>
+ <!-- <el-icon><Switch /></el-icon> -->
</template>
</avue-crud>
<!-- 鏂板鑺傜偣 -->
@@ -84,13 +87,96 @@
<code-diff :old-string="this.content1" :new-string="this.content2" output-format="side-by-side" :hideStat="true" :filename="codeDiffFileName1" :newFilename="codeDiffFileName2"/>
</div>
</el-drawer>
+ <!-- 鏇挎崲 -->
+ <el-drawer title="鏇挎崲" append-to-body v-model="todolistModel" size="100%" class="code-box">
+ <div class="approve-box">
+ <div class="left">
+ <TodolistLeft :row="row" @selection-change="todoSelectionChange" />
+ </div>
+ <div class="right">
+ <TodolistRightTop :row="row" />
+ <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" />
+ </div>
+ </div>
+ </el-drawer>
</template>
<script>
import { ElMessage } from 'element-plus';
+import TodolistLeft from './components/TodolistLeft.vue';
+import TodolistRightTop from './components/TodolistRightTop.vue';
export default {
+ components: {
+ TodolistLeft,
+ TodolistRightTop
+ },
data() {
+ let rejectText = '椹冲洖';//+this.row.categoryName;
return {
+ replaceDataId: "",
+ formApprove: {
+ title: '',
+ comment: '',
+ approve: '', // 榛樿鍚屾剰
+ assignee: ''
+ },
+ optionApprove: {
+ labelWidth: 100,
+ column: [
+ {
+ label: '娴佺▼鏍囬',
+ prop: 'title',
+ rules: [{ required: true, message: '璇疯緭鍏ユ祦绋嬫爣棰�', trigger: 'blur' }],
+ },
+ {
+ label: '鍙戦�佺粰',
+ prop: 'assignee',
+ type: 'select',
+ dicUrl: `/api/blade-mdm/flow/flow-user-list?deptId=0`,
+ dicFlag: true,
+ props: {
+ label: 'name',
+ value: 'id',
+ },
+ filterable: true,
+ span: 24,
+ disabled: false,
+ rules: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }],
+ },
+ {
+ label: '宸ュ簭鐗堟',
+ prop: 'processEdition',
+ type: 'input',
+ span: 24,
+ // disabled: true,
+ display: false,// 闅愯棌鏄剧ず
+ // rules: [{ required: true, message: '璇烽�夋嫨涓嬩竴瀹℃壒鐢ㄦ埛', trigger: 'blur' }],
+ },
+ {
+ label: '澶囨敞',
+ span: 24,
+ prop: 'comment',
+ type: 'textarea',
+ // rules: [{ required: true, message: '璇疯緭鍏ュ鎵规剰瑙�', trigger: 'blur' }],
+ rules: [
+ {
+ validator: (rule, value, callback) => {
+ console.log('-------',this.formApprove)
+ if (value === '' && this.formApprove.approve !== 'Y') {
+ callback(new Error('璇疯緭鍏ュ娉�'));
+ } else {
+ callback();
+ }
+ },
+ trigger: 'blur'
+ }
+ ]
+ },
+ ],
+ },
+ applist: [],
+ row: {},
+ todolistModel: false,
diffBox: false,
content1: "",
content2: "",
@@ -299,6 +385,12 @@
menu: false,
searchBtn: false,
emptyBtn: false,
+ refreshBtn: false,
+ columnBtn: false,
+ searchShowBtn: false,
+ refreshBtn: false,
+ copyBtn: false,
+ gridBtn: false,
column: [
{
label: '鐩綍',
@@ -528,11 +620,77 @@
}
},
watch: {
- uploadmodalBox(old) {
- //this.onLoad();
- }
+
},
methods: {
+ handleSubmit(form, done) {
+ //鍙戣捣绋嬪簭鏇挎崲娴佺▼
+ var obj = {
+ title: this.formApprove.title,
+ nodeId: this.id,
+ tempInstanceId: this.replaceDataId,
+ assignee: this.formApprove.assignee
+ }
+ axios({
+ url: '/blade-mdm/flow/replace/start',
+ method: 'post',
+ data: obj
+ }).then(
+ resp => {
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!',
+ });
+ done();
+ this.todolistModel = false;
+ });
+ // 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);
+ // });
+ },
+ todoSelectionChange(applist) {
+ this.applist = applist;
+ },
+ replacement(row) { //鏇挎崲
+ this.id = row.id;
+ this.formApprove = {
+ comment: '',
+ approve: 'Y', // 榛樿鍚�
+ }
+ //鍑嗗绋嬪簭鏇挎崲娴佺▼
+ axios({
+ url: '/blade-mdm/flow/replace/prestart',
+ method: 'post',
+ params: {nodeId: row.id}
+ }).then(
+ resp => {
+ this.row = row;
+ this.replaceDataId = resp.data.data;
+ this.todolistModel = true;
+ });
+ },
convertToHtml(text) {
return text.replace(/\r\n/g, '<br>');
},
@@ -985,6 +1143,21 @@
.highlight-row:hover {
background-color: #e6f0ff !important;
}
+.approve-box {
+ display: flex;
+
+ &>div {
+ border: 1px solid #ccc;
+ }
+
+ .left {
+ width: 400px;
+ }
+
+ .right {
+ flex: 1;
+ }
+}
</style>
<style>
.highlight-row {
diff --git a/src/views/wel/todolist.vue b/src/views/wel/todolist.vue
new file mode 100644
index 0000000..d44b60d
--- /dev/null
+++ b/src/views/wel/todolist.vue
@@ -0,0 +1,500 @@
+<template>
+ <basic-container>
+ <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud"
+ @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
+ @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
+ @selection-change="selectionTransferTask">
+ <template #menu-left>
+ <el-button type="primary" plain @click="reassign">閲嶆柊鎸囨淳
+ </el-button>
+ </template>
+ <template #menu="scope">
+ <el-button type="primary" text size="default" @click.stop="handleAction(scope.row, scope.index)">瀹℃壒
+ </el-button>
+ </template>
+ </avue-crud>
+ <el-dialog title="鎸囨淳" append-to-body v-model="reassignBox" width="30%">
+ <avue-form ref="reassginform" :option="reassignOption" v-model="reassignForm" @submit="toPerson"></avue-form>
+ </el-dialog>
+ <el-drawer title="瀹℃壒" append-to-body v-model="approveBox" size="100%" v-if="approveBox">
+ <div class="approve-box">
+ <div class="left">
+ <TodolistLeft :row="row" @selection-change="selectionChange" />
+ </div>
+ <div class="right">
+ <TodolistRightTop :row="row" />
+ <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" />
+ </div>
+ </div>
+ </el-drawer>
+ </basic-container>
+</template>
+
+<script>
+import { getList, approve, getAssignee,reassgin } from '@/api/flow/todolist';
+import { mapGetters } from 'vuex';
+import dayjs from 'dayjs';
+import TodolistLeft from './components/TodolistLeft.vue';
+import TodolistRightTop from './components/TodolistRightTop.vue';
+export default {
+ components: {
+ TodolistLeft,
+ TodolistRightTop
+ },
+ data() {
+ let rejectText = '椹冲洖';//+this.row.categoryName;
+ console.log(this,'ttt');
+ return {
+
+ applist: [],
+ assigneeData: [],
+ row: {},
+ approveBox: false,
+ formApprove: {
+ comment: '',
+ approve: '', // 榛樿鍚屾剰
+ assignee: ''
+ },
+ optionApprove: {
+ labelWidth: 100,
+ column: [
+
+ {
+ label: '瀹℃壒缁撴灉',
+ prop: 'approve',
+ type: 'radio',
+ span: 24,
+ dicData: [
+ { label: '閫氳繃', value: 'Y' },
+ { label: rejectText, value: 'N' },
+ ],
+ rules: [{ required: true, message: '璇烽�夋嫨瀹℃壒缁撴灉', trigger: 'blur' }],
+ },
+ {
+ label: '鍙戦�佺粰',
+ prop: 'assignee',
+ type: 'select',
+ // dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
+ // dicFlag: true,
+ props: {
+ label: 'name',
+ value: 'id',
+ },
+ filterable: true,
+ span: 24,
+ disabled: false,
+ dicData: [
+
+ ],
+ // rules: [{ required: true, message: '璇烽�夋嫨涓嬩竴瀹℃壒鐢ㄦ埛', trigger: 'blur' }],
+ },
+ {
+ label: '宸ュ簭鐗堟',
+ prop: 'processEdition',
+ type: 'input',
+ span: 24,
+ // disabled: true,
+ display: false,// 闅愯棌鏄剧ず
+ // rules: [{ required: true, message: '璇烽�夋嫨涓嬩竴瀹℃壒鐢ㄦ埛', trigger: 'blur' }],
+ },
+ {
+ label: '澶囨敞',
+ span: 24,
+ prop: 'comment',
+ type: 'textarea',
+ // rules: [{ required: true, message: '璇疯緭鍏ュ鎵规剰瑙�', trigger: 'blur' }],
+ rules: [
+ {
+ validator: (rule, value, callback) => {
+ console.log('-------',this.formApprove)
+ if (value === '' && this.formApprove.approve !== 'Y') {
+ callback(new Error('璇疯緭鍏ュ娉�'));
+ } else {
+ callback();
+ }
+ },
+ trigger: 'blur'
+ }
+ ]
+ },
+ ],
+ },
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ form: {},
+ query: {},
+ loading: true,
+ option: {
+ rowKey: "taskId",
+ addBtn: false,
+ editBtn: false,
+ delBtn: false,
+ columnBtn: false,
+ tip: false,
+ // simplePage: true,
+ searchShow: true,
+ searchMenuSpan: 6,
+ dialogWidth: '60%',
+ // tree: true,
+ border: true,
+ index: true,
+ selection: true,
+ // viewBtn: true,
+ menuWidth: 100,
+ dialogClickModal: false,
+ column: [
+ {
+ label: '鍏抽敭瀛�',
+ prop: 'keyword',
+ width: 300,
+ search: true,
+ searchType: 'input',
+ hide: true,
+ dicData: [
+ {
+ label: '娑夊瘑缃戠▼搴�',
+ value: 1,
+ },
+ {
+ label: '宸ユ帶缃戣溅搴婄▼搴�',
+ value: 2,
+ },
+ ],
+ },
+ {
+ label: '鏍囬',
+ prop: '',
+ width: 100,
+ render: ({ row }) => {
+ return h('p',
+ {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.title)
+ }
+ },
+ {
+ label: '娴佺▼鍚嶇О',
+ prop: 'processDefinitionName',
+ width: 100,
+ },/*
+ {
+ label: '娴佺▼绫诲瀷',
+ width: 100,
+ prop: 'categoryName',
+ },*/
+
+ {
+ label: '鏈哄簥',
+ width: 100,
+ prop: '',
+ formatter: (val, value, label) => {
+ return `${val?.variables?.machineCode}`;
+ },
+ },
+ {
+ label: '鍒涘缓浜�',
+ width: 100,
+ prop: 'startUserName',
+ },
+ {
+ label: '鍒涘缓鏃堕棿',
+ width: 200,
+ prop: 'processCreateTime',
+ type: 'datetime',
+ format: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ search: true,
+ searchRange: true,
+ searchSpan: 8,
+ // hide: true,
+ },
+ {
+ label: '涓婁竴姝ョ敤鎴�',
+ width: 200,
+ prop: '',
+ formatter: (val, value, label) => {
+ return `${val?.variables?.approveUserNickName || ''}`;
+ },
+ },
+ {
+ label: '褰撳墠鑺傜偣',
+ width: 200,
+ prop: 'taskName',
+ },
+ {
+ label: '鏂囦欢',
+ width: 200,
+ prop: 'file',
+ },
+ {
+ label: '鍒拌揪鏃堕棿',
+ width: 200,
+ prop: 'createTime',
+ },
+ {
+ label: '鍒拌揪鎻忚堪',
+ width: 200,
+ prop: 'comment',
+ },
+
+ ],
+ },
+ data: [],
+ transferTaskSelection: [],
+ reassignBox: false,
+ reassignOption: {
+ submitBtn: true,
+ emptyBtn: false,
+ column: [
+ {
+ label: '鍙戦�佺粰',
+ prop: 'newAssigneeId',
+ type: 'select',
+ // dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
+ // dicFlag: true,
+ props: {
+ label: 'name',
+ value: 'id',
+ },
+ span: 24,
+ disabled: false,
+ dicData: [
+
+ ],
+ rules: [{ required: true, message: '璇疯緭鍏ラ�夋嫨', trigger: 'blur' }],
+ },
+ {
+ label: '澶囨敞',
+ span: 24,
+ prop: 'comment',
+ type: 'textarea',
+ rules: [{ required: true, message: '璇疯緭鍏ュ鎵规剰瑙�', trigger: 'blur' }],
+ },
+ ],
+ },
+ reassignForm: {}
+ };
+ },
+ watch: {
+ // 'form.category'() {
+ // const category = func.toInt(this.form.category);
+ // this.$refs.crud.option.column.filter(item => {
+ // if (item.prop === 'path') {
+ // item.rules[0].required = category === 1;
+ // }
+ // if (item.prop === 'isOpen') {
+ // item.disabled = category === 2;
+ // }
+ // });
+ // },
+ 'formApprove.approve'(val) {
+ if (val === 'Y' && ["approveTask", 'seniorApproveTask'].includes(this.row.taskDefinitionKey)) {// 楂樺笀
+ this.optionApprove.column[1].disabled = true;
+ this.formApprove.assignee = ''; // 濡傛灉鏄�氳繃锛屽垯榛樿鎸囨淳缁欒嚜宸�
+ } else if(val === 'Y'){
+ this.setAssignee(this.row);
+ } else if(val === 'N') {
+ this.formApprove.assignee = ''
+ // this.formApprove.assignee = row.variables.senior;
+ }
+ if(val === 'Y' && ['confirmIsUseableTask'].includes(this.row.taskDefinitionKey) && this.row.variables.isProcessEditionSame=='N') {
+ this.optionApprove.column[2].display = true; // 鏄剧ず宸ュ簭鐗堟
+ } else {
+ this.optionApprove.column[2].display = false; // 闅愯棌宸ュ簭鐗堟
+ }
+
+ },
+ },
+ computed: {
+ ...mapGetters(['userInfo', 'permission']),
+ // permissionList() {
+ // return {
+ // addBtn: this.validData(this.permission.menu_add, false),
+ // viewBtn: this.validData(this.permission.menu_view, false),
+ // delBtn: this.validData(this.permission.menu_delete, false),
+ // editBtn: this.validData(this.permission.menu_edit, false),
+ // };
+ // },
+ },
+ mounted() {
+ getAssignee().then(res => {
+ this.assigneeData = res.data.data;
+ this.optionApprove.column[1].dicData = this.assigneeData;
+ this.reassignOption.column[0].dicData = this.assigneeData;
+ })
+ },
+ methods: {
+ selectionTransferTask(list) {
+ this.transferTaskSelection = list;
+ },
+ reassign() {// 閲嶆柊鎸囨淳
+ if (this.transferTaskSelection.length === 0) {
+ this.$message.warning('璇烽�夋嫨闇�瑕侀噸鏂版寚娲剧殑浠诲姟');
+ return;
+ }
+ if (this.transferTaskSelection.length > 1) {
+ this.$message.warning('璇烽�夋嫨涓�鏉�');
+ return;
+ }
+ this.reassignBox = true;
+ },
+ toPerson(form, done) {
+ this.$confirm('璇风‘璁ゆ槸鍚︽寚娲�', '', {
+ confirmButtonText: this.$t('submitText'),
+ cancelButtonText: this.$t('cancelText'),
+ type: 'warning',
+ }).then(() => {
+ console.log('toPerson', form);
+ reassgin({
+ ...form,
+ taskId: this.transferTaskSelection[0].taskId,
+ processInstanceId: this.transferTaskSelection[0].processInstanceId,
+ }).then(res => {
+ this.$message.success('鎸囨淳鎴愬姛');
+ this.reassignBox = false;
+ this.$refs?.reassginform?.resetForm();
+ this.onLoad(this.page, this.query);
+ done()
+
+ }).catch(err => {
+ console.error(err);
+ done()
+ })
+ });
+ done();
+ },
+ setAssignee (row) {
+ if (["check", 'cureCheckTask '].includes(row.taskDefinitionKey)) {// 鏍″
+ this.formApprove.assignee = row.variables.senior;
+ } else if (["programmingTask",'cureProgramTask'].includes(row.taskDefinitionKey)) {// 缂栧埗锛屾牎瀵�
+ this.formApprove.assignee = row.variables.checker;
+ } else if (row.taskDefinitionKey == "teamLeaderTask") {
+ this.formApprove.assignee = row.variables.programmer
+ } else if (row.taskDefinitionKey == "confirmIsUseableTask") {
+ this.formApprove.assignee = row.variables.checker
+ } else if (["approveTask", 'seniorApproveTask'].includes(row.taskDefinitionKey)) {// 楂樺笀瀹℃牳
+
+ }
+ },
+ handleAction(row, index) {
+ this.formApprove = {
+ comment: '',
+ approve: 'Y', // 榛樿鍚�
+ }
+ this.approveBox = true;
+ this.row = row
+ this.setAssignee(row);
+ console.log('handleAction', row, index);
+ },
+ handleSubmit(form, 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);
+ });
+ },
+ searchChange(params, done) {
+ let data = {}
+ this.query = params;
+ this.page.currentPage = 1;
+ console.log('searchChange', params);
+ params.createTimeBegin = params?.processCreateTime?.[0] || '';
+ params.createTimeEnd = params?.processCreateTime?.[1] || '';
+ console.log(params);
+ // data = {
+ // createTimeBegin: dayjs(params.createTimeBegin).isValid() ? dayjs(params.createTimeBegin).format('YYYY-MM-DD') : '',
+ // createTimeEnd: dayjs(params.createTimeEnd).isValid() ? dayjs(params.createTimeEnd).format('YYYY-MM-DD') : '',
+ // keyword: params.keyword || ''
+ // }
+ data = {
+ createTimeBegin: params.createTimeBegin,
+ createTimeEnd: params.createTimeEnd,
+ keyword: params.keyword || ''
+ }
+ this.query = data
+ this.onLoad(this.page, data);
+ done();
+ },
+ searchReset() {
+ this.query = {};
+ this.onLoad(this.page);
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+
+ onLoad(page, params = {}) {
+ const query = {
+ ...this.query,
+ // category: params.category ? flowCategory(params.category) : null,
+ mode: this.mode,
+ };
+ try {
+ delete query.processCreateTime; // 鍒犻櫎涓嶅繀瑕佺殑鏌ヨ鏉′欢
+ } catch (error) {
+ console.error('鏃ユ湡鏍煎紡鍖栭敊璇�', error);
+ }
+
+ this.loading = true;
+ getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ });
+ },
+ selectionChange(applist) {
+ this.applist = applist
+ },
+ },
+};
+</script>
+
+<style scoped="scoped" lang="scss">
+.approve-box {
+ display: flex;
+
+ &>div {
+ border: 1px solid #ccc;
+ }
+
+ .left {
+ width: 400px;
+ }
+
+ .right {
+ flex: 1;
+ }
+}
+</style>
diff --git a/yarn.lock b/yarn.lock
index 29121e5..557bcc1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2014,7 +2014,7 @@
v-code-diff@^1.13.1:
version "1.13.1"
- resolved "https://registry.npmmirror.com/v-code-diff/-/v-code-diff-1.13.1.tgz"
+ resolved "https://registry.yarnpkg.com/v-code-diff/-/v-code-diff-1.13.1.tgz#acead9aeec90ecf0769fdd23dc2e6ca2ecaa631f"
integrity sha512-9LTV1dZhC1oYTntyB94vfumGgsfIX5u0fEDSI2Txx4vCE5sI5LkgeLJRRy2SsTVZmDcV+R73sBr0GpPn0TJxMw==
dependencies:
diff "^5.2.0"
--
Gitblit v1.9.3