From a4a6032a323343837d3cfe86dd8f8cca1260d759 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期日, 28 四月 2024 17:04:31 +0800
Subject: [PATCH] 点位完善
---
src/views/system/work-order/distribute/index.vue | 127 ++++++++++++++++++------------------------
1 files changed, 55 insertions(+), 72 deletions(-)
diff --git a/src/views/system/work-order/distribute/index.vue b/src/views/system/work-order/distribute/index.vue
index 45fae99..142e0dc 100644
--- a/src/views/system/work-order/distribute/index.vue
+++ b/src/views/system/work-order/distribute/index.vue
@@ -4,48 +4,12 @@
<el-col :span="24" style="position: relative">
<el-menu :default-active="activeIndex" class="el-menu" mode="horizontal" @select="handleSelect">
<el-menu-item index="0" @click="changeUnit(null, '鍏ㄩ儴')">
- 鍏ㄩ儴鍗曚綅(430)
+ 鍏ㄩ儴鍗曚綅锛坽{ totalWorkOrders }}锛�
</el-menu-item>
- <el-menu-item index="1">
- 鑷祦浜曡繍缁村崟浣�(70)
+ <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-item index="2">
- 澶у畨杩愮淮(50)
- </el-menu-item>
- <el-menu-item index="3">瀵岄『杩愮淮鍗曚綅(70)</el-menu-item>
- <el-menu-item index="4">楂樻柊杩愮淮鍗曚綅(15)</el-menu-item>
- <el-menu-item index="5">鑽e幙杩愮淮鍗曚綅(90)</el-menu-item>
- <el-menu-item index="6">璐′簳杩愮淮鍗曚綅(45)</el-menu-item>
- <el-menu-item index="7">娌挎哗杩愮淮鍗曚綅(70)</el-menu-item>
</el-menu>
- <el-popover
- placement="right"
- width="400"
- trigger="click">
- <el-form :model="settingForm" :rules="settingRules" ref="settingForm" label-width="120px">
- <el-form-item label="褰曞儚璐ㄩ噺" prop="videoQuality">
- <el-select style="width: 100%" v-model="settingForm.videoQuality" placeholder="鏈�浣庡綍鍍忚川閲�">
- <el-option label="鍏ㄥ綍鍍�" value="鍏ㄥ綍鍍�"/>
- <el-option label="閮ㄥ垎褰曞儚" value="閮ㄥ垎褰曞儚"/>
- <el-option label="鏃犲綍鍍�" value="鏃犲綍鍍�"/>
- </el-select>
- </el-form-item>
- <el-form-item label="鐐逛綅绂荤嚎鏃堕暱" prop="outLine">
- <el-input type="number" v-model="settingForm.outLine" placeholder="涓嶈兘瓒呰繃澶氫箙">
- <template slot="append">鍒嗛挓</template>
- </el-input>
- </el-form-item>
- <el-form-item label="瑙嗛鏍囨敞鍑嗙‘鐜�" prop="videoLabel">
- <el-input type="number" v-model="settingForm.videoLabel" placeholder="鏈�浣庡噯纭巼">
- <template slot="append">%</template>
- </el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="submitSetting">淇濆瓨</el-button>
- </el-form-item>
- </el-form>
- <el-button title="鑷姩鐢熸垚宸ュ崟璁剧疆" slot="reference" class="setting" style="" type="success" icon="el-icon-s-tools" circle></el-button>
- </el-popover>
</el-col>
</el-row>
@@ -67,19 +31,20 @@
<span style="font-weight: bold;font-size: 16px">蹇嵎涓嬪彂</span>
<el-form ref="fastDistributeForm" :model="fastDistributeForm" :rules="fastDistributeRules" label-width="80px">
<el-form-item label="蹇嵎鏂瑰紡" prop="fastWay">
- <el-radio v-model="fastDistributeForm.fastWay" label="0">鏈�杩�30鍒嗛挓</el-radio>
- <el-radio v-model="fastDistributeForm.fastWay" label="01">鏈�杩�1灏忔椂</el-radio>
- <el-radio v-model="fastDistributeForm.fastWay" label="10">鏈�杩�2灏忔椂</el-radio>
- <el-radio v-model="fastDistributeForm.fastWay" label="11">鏈�杩�1澶�</el-radio>
- <el-radio v-model="fastDistributeForm.fastWay" label="101">鑷畾涔�</el-radio>
+ <el-radio v-model="fastDistributeForm.fastWay" label="LAST_HALF_HOUR">鏈�杩�30鍒嗛挓</el-radio>
+ <el-radio v-model="fastDistributeForm.fastWay" label="LAST_HOUR">鏈�杩�1灏忔椂</el-radio>
+ <el-radio v-model="fastDistributeForm.fastWay" label="LAST_TWO_HOUR">鏈�杩�2灏忔椂</el-radio>
+ <el-radio v-model="fastDistributeForm.fastWay" label="LAST_DAY">鏈�杩�1澶�</el-radio>
+ <el-radio v-model="fastDistributeForm.fastWay" label="CUSTOM">鑷畾涔�</el-radio>
</el-form-item>
- <el-form-item v-if="fastDistributeForm.fastWay === '101'" label="鏃堕棿鑼冨洿">
+ <el-form-item v-if="fastDistributeForm.fastWay === 'CUSTOM'" label="鏃堕棿鑼冨洿">
<el-date-picker
style="width: 100%"
v-model="fastTimeRange"
type="datetimerange"
range-separator="鑷�"
start-placeholder="寮�濮嬫棩鏈�"
+ value-format="yyyy-MM-dd HH:mm:ss"
end-placeholder="缁撴潫鏃ユ湡">
</el-date-picker>
</el-form-item>
@@ -134,7 +99,7 @@
<el-option
v-for="item in unitList"
:key="item.id"
- :label="item.value"
+ :label="item.unitName"
:value="item.id">
</el-option>
</el-select>
@@ -147,6 +112,7 @@
reserve-keyword
placeholder="璇烽�夋嫨鏉ユ簮"
:remote-method="remoteGetPoints"
+ @change="setPointId"
:loading="selectLoading">
<el-option
v-for="item in pointList"
@@ -174,13 +140,18 @@
</template>
<script>
-import {distributeWorkOrder, fastDistribute, addWorkOrder, updateWorkOrder} from '@/api/platform/work-order'
-import {unitSelect} from "@/api/platform/unit";
+import {distributeWorkOrder, fastDistribute, addWorkOrder, updateWorkOrder, selectedIdsDistribute} from '@/api/platform/work-order'
+import {workList} from "@/api/platform/unit";
import { pointSelectData } from "@/api/platform/point";
export default {
name: 'index',
data() {
return {
+ selectedIdsDistributeForm: {
+ ids: [],
+ unitId: null
+ },
+ unitList: [],
settingForm: {
// 绂荤嚎
outLine: null,
@@ -219,13 +190,13 @@
// 涓嬪彂琛ㄥ崟楠岃瘉
fastDistributeRules: {
fastWay: [
- { required: true, message: "璇烽�夋嫨蹇�熷垎鍙戞柟寮�", trigger: "change" }
+ { required: true, message: "璇烽�夋嫨蹇�熷垎鍙戞柟寮�", trigger: "blur" }
],
fastNumLimit: [
- { required: true, message: "璇疯緭鍏ュ揩閫熷垎鍙戞暟閲忛檺鍒�", trigger: "change" }
+ { required: true, message: "璇疯緭鍏ュ揩閫熷垎鍙戞暟閲忛檺鍒�", trigger: "blur" }
],
errorType: [
- { required: true, message: "璇锋晠闅滅被鍨�", trigger: "change" }
+ { required: true, message: "璇锋晠闅滅被鍨�", trigger: "blur" }
],
},
queryParams: {
@@ -270,9 +241,17 @@
},
mounted() {
this.page();
- this.selectUnit();
+ },
+ computed: {
+ totalWorkOrders() {
+ return this.unitList.reduce((total, item) => total + item.workOrderCount, 0);
+ },
},
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) {
@@ -285,6 +264,7 @@
},
page() {
this.loading = true;
+ this.selectUnit();
distributeWorkOrder(this.queryParams).then(res => {
this.workOrderList = res.data;
this.total = res.total;
@@ -303,41 +283,44 @@
this.fastDistributeForm.end = null
this.fastDistributeForm.fastNumLimit = null
this.fastTimeRange = []
+ this.fastDistributeForm.errorType = null
},
// 鍏ㄩ儴涓嬪彂
allDistribute() {
- this.fastDistribute();
+ this.selectedIdsDistributeForm.unitId = this.unitId
+ selectedIdsDistribute(this.selectedIdsDistributeForm).then(res => {
+ this.$message.success("宸ュ崟涓嬪彂鎴愬姛")
+ this.page();
+ })
},
// 蹇�熶笅鍙�
fastDistribute() {
- // this.$refs['fastDistributeForm'].validate((valid) => {
- // if (valid) {
- // 濡傛灉鏄嚜瀹氫箟鏂瑰紡锛岄偅涔堟椂闂存蹇呭~
- if (this.fastDistributeForm.fastWay === '101' && !this.fastTimeRange.length > 0) {
- this.$message.warning("璇烽�夋嫨鏃堕棿鑼冨洿")
- return false
- }
- if (this.fastTimeRange.length > 0) {
- this.fastDistributeForm.start = this.fastTimeRange[0]
- this.fastDistributeForm.end = this.fastTimeRange[1]
- }
+ this.$refs['fastDistributeForm'].validate((valid) => {
+ if (valid) {
+ this.fastDistributeForm.start = this.fastTimeRange[0]
+ this.fastDistributeForm.end = this.fastTimeRange[1]
this.fastDistributeForm.unitId = this.unitId
fastDistribute(this.fastDistributeForm).then(res => {
- // this.clearFastDistributeForm();
+ res.code == 200 ? this.$message.success(res.msg) : this.$message.warning(res.msg)
+ this.clearFastDistributeForm();
this.page();
})
- // } else {
- // return false
- // }
- // })
+ }
+ })
},
// 閫変腑宸ュ崟涓嬪彂
selectedDistribute() {
if (this.multipleSelection.length < 1) {
this.$message.warning("璇峰厛閫夋嫨瑕佷笅鍙戠殑宸ュ崟")
return
- }
- this.fastDistribute();
+ }
+ this.selectedIdsDistributeForm.unitId = this.unitId;
+ this.selectedIdsDistributeForm.ids = this.multipleSelection;
+ selectedIdsDistribute(this.selectedIdsDistributeForm).then(res => {
+ this.$message.success("宸ュ崟涓嬪彂鎴愬姛")
+ this.selectedIdsDistributeForm.ids = [];
+ this.page();
+ })
},
handleSelect(key, keyPath) {
console.log(key, keyPath);
@@ -387,7 +370,7 @@
},
// 杩愮淮鍏徃涓嬫媺鏁版嵁
selectUnit() {
- unitSelect().then(res => {
+ workList().then(res => {
this.unitList = res.data;
})
},
--
Gitblit v1.8.0