From 4eeaec1eddd5ef2be4b79423154fa2dce81d5566 Mon Sep 17 00:00:00 2001
From: 黄何裕 <1053952480@qq.com>
Date: 星期五, 26 七月 2024 15:28:09 +0800
Subject: [PATCH] 大屏重构
---
src/views/system/work-order/distribute/index.vue | 77 +++++++++++++++++++++++++++++---------
1 files changed, 58 insertions(+), 19 deletions(-)
diff --git a/src/views/system/work-order/distribute/index.vue b/src/views/system/work-order/distribute/index.vue
index 1db483d..80d3b32 100644
--- a/src/views/system/work-order/distribute/index.vue
+++ b/src/views/system/work-order/distribute/index.vue
@@ -13,14 +13,36 @@
</el-col>
</el-row>
- <el-row class="op-warp" type="flex" justify="left" >
- <el-col :span="24">
- <el-button size="small" type="info" @click="selectedDistribute" class="op">涓嬪彂閫変腑宸ュ崟</el-button>
+ <el-row class="op-warp">
+ <el-row v-show="showSearch">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
+ <el-form-item label="鍏抽敭璇�" prop="keyword">
+ <el-input
+ v-model="queryParams.menuName"
+ placeholder="鍏抽敭璇嶆悳绱�"
+ clearable
+ @keyup.enter.native="page"
+ />
+ </el-form-item>
+ <el-form-item label="涓嬪彂鐘舵��" prop="status">
+ <el-select v-model="queryParams.status" @change="page" placeholder="涓嬪彂鐘舵��" clearable>
+ <el-option label="鏈笅鍙�" value="WAIT_DISTRIBUTE"/>
+ <el-option label="宸蹭笅鍙�" value="DISTRIBUTED"/>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" size="small" @click="page">鎼滅储</el-button>
+ </el-form-item>
+ </el-form>
+ </el-row>
+
+ <el-row>
+ <el-button size="mini" plain type="info" @click="selectedDistribute" class="op">涓嬪彂閫変腑宸ュ崟</el-button>
<el-popconfirm
@confirm="allDistribute"
title="纭畾瑕佷笅鍙戞墍鏈夊伐鍗曞悧锛�"
>
- <el-button size="small" type="danger" class="op" slot="reference">鍏ㄩ儴涓嬪彂</el-button>
+ <el-button size="mini" plain type="danger" class="op" slot="reference">鍏ㄩ儴涓嬪彂</el-button>
</el-popconfirm>
<el-popover
@@ -56,17 +78,17 @@
</el-select>
</el-form-item>
<el-form-item label="鏁伴噺闄愬埗" prop="fastNumLimit">
- <el-input v-model="fastDistributeForm.fastNumLimit" size="small" type="number" placeholder="姝ゆ宸ュ崟涓嬪彂鏈�澶ф暟閲�"></el-input>
+ <el-input v-model="fastDistributeForm.fastNumLimit" type="number" placeholder="姝ゆ宸ュ崟涓嬪彂鏈�澶ф暟閲�"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="fastDistribute">绔嬪嵆涓嬪彂</el-button>
</el-form-item>
</el-form>
- <el-button slot="reference" type="primary" size="small">蹇嵎涓嬪彂</el-button>
+ <el-button slot="reference" type="primary" size="mini" plain>蹇嵎涓嬪彂</el-button>
</el-popover>
- <el-button size="small" type="primary" @click="page">鍒锋柊</el-button>
- <el-button size="small" type="primary" @click="handleAdd">鏂板</el-button>
- </el-col>
+ <el-button size="mini" plain type="success" @click="handleAdd">鎵嬪姩鏂板宸ュ崟</el-button>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="page"></right-toolbar>
+ </el-row>
</el-row>
<el-row class="content-warp" type="flex" justify="left">
@@ -112,6 +134,7 @@
reserve-keyword
placeholder="璇烽�夋嫨鏉ユ簮"
:remote-method="remoteGetPoints"
+ @change="setPointId"
:loading="selectLoading">
<el-option
v-for="item in pointList"
@@ -123,15 +146,15 @@
</el-form-item>
<el-form-item label="鏁呴殰绫诲瀷" prop="errorType">
<el-select v-model="form.errorType">
- <el-option label="甯傛斂鏂藉伐" value="甯傛斂鏂藉伐"/>
- <el-option label="璁惧鏁呴殰" value="璁惧鏁呴殰"/>
- <el-option label="璁惧閬楀け" value="璁惧閬楀け"/>
+ <el-option v-for="dict in dict.type.error_type"
+ :value="dict.value"
+ :label="dict.label"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
<el-button @click="cancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
</div>
</el-dialog>
@@ -143,9 +166,15 @@
import {workList} from "@/api/platform/unit";
import { pointSelectData } from "@/api/platform/point";
export default {
+ dicts: ['error_type'],
name: 'index',
data() {
return {
+ showSearch: true,
+ selectedIdsDistributeForm: {
+ ids: [],
+ unitId: null
+ },
unitList: [],
settingForm: {
// 绂荤嚎
@@ -196,8 +225,10 @@
},
queryParams: {
unitId: null,
+ keyword: '',
+ status: 'WAIT_DISTRIBUTE',
pageNum: 1,
- pageSize: 20,
+ pageSize: 10,
},
// 鎬绘潯鏁�
total: 0,
@@ -243,6 +274,10 @@
},
},
methods: {
+ setPointId(selectedValue) {
+ const selectedItem = this.pointList.find(item => item.value === selectedValue);
+ this.form.pointId = selectedItem.id
+ },
submitSetting() {
this.$refs['settingForm'].validate((valid) => {
if (valid) {
@@ -257,7 +292,7 @@
this.loading = true;
this.selectUnit();
distributeWorkOrder(this.queryParams).then(res => {
- this.workOrderList = res.data;
+ this.workOrderList = res.data.records;
this.total = res.total;
this.loading = false;
})
@@ -278,7 +313,8 @@
},
// 鍏ㄩ儴涓嬪彂
allDistribute() {
- selectedIdsDistribute([], this.unitId).then(res => {
+ this.selectedIdsDistributeForm.unitId = this.unitId
+ selectedIdsDistribute(this.selectedIdsDistributeForm).then(res => {
this.$message.success("宸ュ崟涓嬪彂鎴愬姛")
this.page();
})
@@ -296,16 +332,19 @@
this.page();
})
}
- })
+ })
},
// 閫変腑宸ュ崟涓嬪彂
selectedDistribute() {
if (this.multipleSelection.length < 1) {
this.$message.warning("璇峰厛閫夋嫨瑕佷笅鍙戠殑宸ュ崟")
return
- }
- selectedIdsDistribute(this.multipleSelection, this.unitId).then(res => {
+ }
+ this.selectedIdsDistributeForm.unitId = this.unitId;
+ this.selectedIdsDistributeForm.ids = this.multipleSelection;
+ selectedIdsDistribute(this.selectedIdsDistributeForm).then(res => {
this.$message.success("宸ュ崟涓嬪彂鎴愬姛")
+ this.selectedIdsDistributeForm.ids = [];
this.page();
})
},
--
Gitblit v1.8.0