From e5d499ae6a4e6b320f71c49987b76cc11f6bc1e4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 28 十月 2025 14:13:10 +0800
Subject: [PATCH] 首页问题
---
src/views/system/work-order/index.vue | 72 ++++++++++++++++++++++++++++--------
1 files changed, 56 insertions(+), 16 deletions(-)
diff --git a/src/views/system/work-order/index.vue b/src/views/system/work-order/index.vue
index 0e1789f..36fa82f 100644
--- a/src/views/system/work-order/index.vue
+++ b/src/views/system/work-order/index.vue
@@ -6,7 +6,7 @@
<el-menu-item index="0" @click="changeUnit(null, '鍏ㄩ儴')">
鍏ㄩ儴鍗曚綅锛坽{ totalWorkOrders }}锛�
</el-menu-item>
- <el-menu-item :index="index + 1" v-for="(item, index) in unitList" :key="index" @click="changeUnit(item.id, item.value)">
+ <el-menu-item :index="index + 1 +''" v-for="(item, index) in unitList" :key="index" @click="changeUnit(item.id, item.value)">
{{ item.unitName }}锛坽{ item.workOrderCount }}锛�
</el-menu-item>
</el-menu>
@@ -99,6 +99,7 @@
v-hasPermi="['work:order:delete']"
>鍒犻櫎
</el-button>
+ <el-button size="mini" plain type="primary" @click="selectedDistribute" class="op">鎵归噺涓婃姤</el-button>
</el-col>
</el-row>
@@ -113,7 +114,7 @@
<el-row style="display: flex;">
<el-checkbox v-if="$store.state.user.roles.includes('admin')"
v-model="isItemSelected[item.workOrderNo]"
- @change="toggleSelection(item.workOrderNo)"
+ @change="toggleSelection(item)"
style="margin-right: 10px; "></el-checkbox>
<el-tooltip
effect="dark"
@@ -200,6 +201,7 @@
@click="handleYwCondition(item)"
>澶勭悊涓婃姤
</el-button>
+
<el-button
class="my-button"
size="mini"
@@ -221,7 +223,7 @@
size="mini"
type="text"
@click="handleDetail(item)"
- v-hasPermi="['system:workorder:detail']"
+ v-hasPermi="['work:order:detail']"
>璇︽儏
</el-button>
<el-button
@@ -348,14 +350,14 @@
<el-dialog title="杩愮淮鎯呭喌璁板綍" :visible.sync="ywConditionOpen" width="500px" append-to-body>
<el-form ref="ywConditionForm" :model="form" :rules="ywConditionRules" label-width="80px">
- <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
+ <el-form-item label="宸ュ崟鍙�" prop="workOrderNo" v-if="!isConditionList">
<el-input v-model="ywConditionForm.workOrderNo" disabled/>
</el-form-item>
- <el-form-item label="杩愮淮鍗曚綅" prop="unitName">
+ <el-form-item label="杩愮淮鍗曚綅" prop="unitName" v-if="!isConditionList">
<el-input v-model="ywConditionForm.unitName" disabled/>
</el-form-item>
- <el-form-item label="鐜板満鎯呭喌" prop="ywCondition">
- <editor v-model="form.ywCondition" :min-height="192"/>
+ <el-form-item label="鐜板満鎯呭喌" prop="ywCondition" >
+ <editor ref="ywEditor" v-model="form.ywCondition" :min-height="192" />
</el-form-item>
<el-form-item label="浣愯瘉鏉愭枡" prop="ywProofMaterials">
<file-upload v-model="form.ywProofMaterials"/>
@@ -561,6 +563,7 @@
</style>
<script>
import {
+ ywConditionList,
listWorkOrder,
getWorkOrder,
delWorkOrder,
@@ -585,6 +588,7 @@
components: {WorkOrderAuditing},
data() {
return {
+ isConditionList:false,
isSelectAll: false, // 鍏ㄩ�夋寜閽�
activeIndex: '0',
drawer: false,
@@ -721,7 +725,8 @@
ywData: {
content: '',
fileList: 'process.env.VUE_APP_BASE_API'
- }
+ },
+
}
},
created() {
@@ -733,6 +738,28 @@
this.getList()
},
methods: {
+ activateEditor() {
+ console.log("瑙﹀彂鐐瑰嚮浜嬩欢")
+ // 鑾峰彇缂栬緫鍣ㄥ疄渚嬪苟瑙﹀彂鑱氱劍锛堝叿浣撴柟娉曞彇鍐充簬editor缁勪欢鐨凙PI锛�
+ const editor = this.$refs.ywEditor;
+ if (editor && editor.focus) {
+ editor.focus(); // 瑙﹀彂缂栬緫鐘舵��
+ } else if (editor && editor.$el) {
+ // 鍏煎鎬у鐞嗭細鐩存帴鑱氱劍缂栬緫鍣ㄧ殑DOM鍏冪礌
+ editor.$el.focus();
+ }
+ },
+ selectedDistribute(){
+ this.form = {}
+ if (this.workOrderNumbers.length < 1) {
+ this.$message.warning("璇峰厛閫夋嫨瑕佷笅鍙戠殑宸ュ崟")
+ return
+ }
+ this.form.workOrderNumbers = this.workOrderNumbers;
+ this.ywConditionOpen = true
+ this.isConditionList = true
+ },
+
//鍏ㄩ�夋寜閽�
toggleSelectAll() {
this.isSelectAll = !this.isSelectAll;
@@ -833,6 +860,7 @@
this.form = {}
this.ywConditionForm = row
this.ywConditionOpen = true
+ this.isConditionList = false
this.form.id = row.id
},
// 杩愮淮缁撴灉鎸夐挳
@@ -905,17 +933,27 @@
submitYwCondition() {
this.$refs['ywConditionForm'].validate(valid => {
if (valid) {
- ywCondition(this.form).then(res => {
- this.ywConditionOpen = false
- this.$modal.msgSuccess('鎿嶄綔鎴愬姛')
- this.getList()
- })
+ if(this.isConditionList){
+ ywConditionList(this.form).then(res => {
+ this.ywConditionOpen = false
+ this.$modal.msgSuccess('鎿嶄綔鎴愬姛')
+ this.getList()
+ })
+ }else {
+ ywCondition(this.form).then(res => {
+ this.ywConditionOpen = false
+ this.$modal.msgSuccess('鎿嶄綔鎴愬姛')
+ this.getList()
+ })
+ }
+
}
})
},
cancelYwCondition() {
this.ywConditionForm = {}
this.ywConditionOpen = false
+ this.isConditionList = false
},
// 鎻愪氦杩愮淮缁撴灉
submitYwResult() {
@@ -1027,12 +1065,14 @@
this.multiple = !selection.length
},
// 澶氶�夋閫変腑鏁版嵁
- toggleSelection(workOrderNo) {
- const index = this.workOrderNumbers.indexOf(workOrderNo);
+ toggleSelection(item) {
+ console.log(item.workOrderNo)
+ console.log(this.workOrderNumbers)
+ const index = this.workOrderNumbers.indexOf(item.workOrderNo);
if (index > -1) {
this.workOrderNumbers.splice(index, 1); // 绉婚櫎閫変腑椤�
} else {
- this.workOrderNumbers.push(workOrderNo); // 娣诲姞閫変腑椤�
+ this.workOrderNumbers.push(item.workOrderNo); // 娣诲姞閫変腑椤�
}
},
/** 鏂板鎸夐挳鎿嶄綔 */
--
Gitblit v1.8.0