From e49e5481e62288c7158ca17ed902695e6c0fbf58 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期六, 26 八月 2023 16:10:58 +0800
Subject: [PATCH] 新任务弹框 产品+工艺参数弹框合为一个 增加一个倒计时的操作
---
public/confirm1.png | 0
public/confirm2.png | 0
public/confirm3.png | 0
public/tank.png | 0
public/btn1.png | 0
src/views/visualization.vue | 24 +-
src/components/AddControl.vue | 22 --
public/number.png | 0
src/components/AddIssue.vue | 403 ++++++++++++++++++++++++++++++++++++++++++--------
9 files changed, 358 insertions(+), 91 deletions(-)
diff --git a/public/btn1.png b/public/btn1.png
new file mode 100644
index 0000000..ab67d43
--- /dev/null
+++ b/public/btn1.png
Binary files differ
diff --git a/public/confirm1.png b/public/confirm1.png
new file mode 100644
index 0000000..e23afe1
--- /dev/null
+++ b/public/confirm1.png
Binary files differ
diff --git a/public/confirm2.png b/public/confirm2.png
new file mode 100644
index 0000000..7f0a74a
--- /dev/null
+++ b/public/confirm2.png
Binary files differ
diff --git a/public/confirm3.png b/public/confirm3.png
new file mode 100644
index 0000000..8c37905
--- /dev/null
+++ b/public/confirm3.png
Binary files differ
diff --git a/public/number.png b/public/number.png
new file mode 100644
index 0000000..45e09a3
--- /dev/null
+++ b/public/number.png
Binary files differ
diff --git a/public/tank.png b/public/tank.png
new file mode 100644
index 0000000..c60eb9f
--- /dev/null
+++ b/public/tank.png
Binary files differ
diff --git a/src/components/AddControl.vue b/src/components/AddControl.vue
index b913beb..c3a3672 100644
--- a/src/components/AddControl.vue
+++ b/src/components/AddControl.vue
@@ -54,17 +54,16 @@
export default {
components: {},
props: {
- id:{
- type: [Number,String],
+ Arr:{
+ type: [Array],
default: () => {
- return '';
+ return [];
},
}
},
data() {
return {
islook: false,
- Arr:[]
};
},
mounted() {
@@ -73,24 +72,11 @@
watch: {
islook(val) {
if (val) {
- this.getStartInfo()
-
}
},
},
methods: {
- getStartInfo(){
- if(this.id){
- startTask({id:this.id}).then(res=>{
- if(res.code==200){
- this.Arr=res.data.Params;
- }
- })
- }else{
- this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�");
- }
-
- },
+
validatorNum(rule, value, callback) {
if (value) {
if (value == undefined || value == null) {
diff --git a/src/components/AddIssue.vue b/src/components/AddIssue.vue
index e074ee0..d3cb897 100644
--- a/src/components/AddIssue.vue
+++ b/src/components/AddIssue.vue
@@ -1,80 +1,266 @@
<template>
+ <!-- top="10vh" -->
<el-dialog
:close-on-click-modal="false"
:visible.sync="islook"
- width="250px"
- top="50vh"
+ width="700px"
class="add-event-dialog"
:show-close="false"
>
- <div slot="title" class="tac drawerHeader">涓嬪彂鐢熶骇鏁版嵁</div>
- <div class="dialog-content-box">
- <div style=" margin:0 auto; width:100%;overflow:hidden;margin-bottom:30px;text-align:left;">
-
- <div class="circel-text">
+ <div class="tank-box">
+ <div slot="title" class="tac drawerHeader">鏂颁换鍔�</div>
+ <div class="dialog-content-box">
+ <div
+ style="
+ margin: 0 auto;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ margin-bottom: 30px;
+ text-align: left;
+ "
+ >
+ <div class="title-box margin_bottom_13">
+ <div class="title-item color_4efefa font_size_20 title-bng">
+ 褰撳墠浠诲姟锛歿{ taskData.Procedure.procedure.procedureName || "" }}
+ </div>
+ <div class="title-item title-bng color_4efefa font_size_20">
+ 鐢熶骇鏁伴噺锛�<span>{{ taskData.Order.amount || 0 }}</span>
+ </div>
+ </div>
+ <div class="title-auto-box">
+ <div class="title-box margin_bottom_20">
+ <div class="title-item">
+ 璁㈠崟缂栧彿锛歿{ taskData.Order.orderId || "" }}
+ </div>
+ <div class="title-item">
+ 宸ュ崟缂栧彿锛歿{ taskData.Order.workOrderId || "" }}
+ </div>
+ <div class="title-item">
+ 浜у搧鍚嶇О锛歿{ taskData.Order.productName || "" }}
+ </div>
+ <div class="title-item">
+ 鏁伴噺锛歿{ taskData.Order.amount || 0 }}{{ taskData.Order.unit }}
+ </div>
+ <div class="title-item">
+ 浜よ揣鏃ユ湡锛歿{ taskData.Order.deliverDate || "" }}
+ </div>
+ <div class="title-item">
+ 宸ユ椂锛� {{ taskData.Procedure.procedure.workHours || "" }}
+ </div>
+ <div class="title-item">
+ 璧锋鏃堕棿锛� {{ formatDate(taskData.Order.startTime) || "" }}
+ -
+ {{ formatDate(taskData.Order.endTime) }}
+ </div>
+ <div class="title-item">
+ 瀹㈡埛鍚嶇О锛歿{ taskData.Order.customer || "" }}
+ </div>
+ <div class="title-item title-item-two">
+ 璐х墿鎻忚堪锛� {{ taskData.Order.orderAttr || "" }}
+ </div>
+
+ <div class="title-item title-item-two">
+ 鍙傛暟瑕佹眰锛歿{ taskData.Order.parameter || "" }}
+ </div>
+ </div>
+ <div class="title-box margin_bottom_20">
+ <div
+ style="
+ color: #fff;
+ font-size: 18px;
+ font-weight: 700;
+ margin-bottom: 10px;
+ margin-top: 20px;
+ "
+ >
+ 宸ヨ壓鍙傛暟
+ </div>
+ <div
+ class="title-item title-item-two"
+ v-for="(item, index) in Arr"
+ :key="index"
+ >
+ {{ item.Key }}锛歿{ item.Value || "" }}
+ </div>
+ </div>
+ </div>
+ <div class="process-box" v-if="showBtn==2||showBtn==3">
+ <div
+ style="
+ color: red;
+ font-size: 16px;
+ width: 100%;
+ text-align: center;
+ font-weight: 700;
+ margin-bottom: 20px;
+ margin-top: 10px;
+ "
+ >
+ 璇风‘璁ょ敓浜у畨鍏紒
+ </div>
+ <div class="progress-item">
+ <span>{{ parseInt(num/60*100) }}%</span>
+ <el-progress
+ style="width:calc(100% - 50px);float:right"
+ define-back-color="#CDC6C6"
+ color="#00cc66"
+ text-color="#fff"
+ :text-inside="true"
+ :stroke-width="20"
+ :percentage="parseInt(num/60*100)"
+ ></el-progress>
+ </div>
+ </div>
+ <!-- <div class="circel-text">
<div class="circel-text-b">
鐢熶骇鏁伴噺锛�<span>{{ Order.amount||0 }}</span>{{ Order.unit||'' }}
</div>
+ </div> -->
</div>
</div>
- </div>
- <div slot="footer" class="dialog-footer tac">
- <el-button type="primary" @click="onSubmit()">涓嬪彂</el-button>
+ <div slot="footer" class="dialog-footer tac" style="overflow: hidden">
+ <div class="btn" @click="closeClick">
+ <img src="../../public/btn1.png" />
+ </div>
+ <div class="btn" v-if="showBtn==1" @click="confirmClick1">
+ <img src="../../public/confirm3.png" />
+ </div>
+ <div class="btn" v-if="showBtn==2">
+ <img src="../../public/confirm2.png" />
+ </div>
+ <div class="btn" v-if="showBtn==3" @click="onSubmit()">
+ <img src="../../public/confirm1.png" />
+ </div>
+ </div>
</div>
</el-dialog>
</template>
<script>
-
-import {
- startTask,
- setProductNumber,
-} from "@/api/home/index"; // 浜х嚎
+import { startTask, setProductNumber,sendProcessParams } from "@/api/home/index"; // 浜х嚎
export default {
components: {},
props: {
- Order:{
+ Order: {
type: [Object],
default: () => {
return {
- amount:0,
- unit:''
+ amount: 0,
+ unit: "",
};
},
},
- taskData:{
+ taskData: {
type: [Object],
- }
+ },
+ Arr: {
+ type: [Array],
+ default: () => {
+ return [];
+ },
+ },
},
data() {
return {
- islook: false,
+ islook: true,
+ showBtn:1,
+ num:0,
+ timer:null,
};
},
mounted() {
- this.getInfo()
+ this.getInfo();
},
watch: {
taskData(val) {
- this.getInfo()
+ this.getInfo();
},
+ num(){
+ if(this.num==60){
+ clearInterval(this.timer)
+ this.showBtn=3;
+ }
+ }
},
methods: {
- getInfo(){
- if (Object.keys(this.taskData).length > 0 && this.taskData.Procedure.ID) {
- this.islook=true
- }else{
- this.islook=false;
+ confirmClick1(){
+ this.num=0;
+ this.showBtn=2;
+ this.timer=setInterval(()=>{
+ this.num=this.num+1;
+ },1000)
+
+ },
+ closeClick(){
+ if(this.timer){
+ clearInterval(this.timer)
+ }
+ this.num=0;
+ this.shutdown();
+ },
+ getInfo() {
+ // if (Object.keys(this.taskData).length > 0 && this.taskData.Procedure.ID) {
+ // this.islook=true
+ // }else{
+ // this.islook=false;
+ // }
+ },
+ getDateObj(date, fmt) {
+ if (/(y+)/.test(fmt)) {
+ fmt = fmt.replace(
+ RegExp.$1,
+ (date.getFullYear() + "").substr(4 - RegExp.$1.length)
+ );
+ }
+ let o = {
+ "M+": date.getMonth() + 1,
+ "d+": date.getDate(),
+ "h+": date.getHours(),
+ "m+": date.getMinutes(),
+ "s+": date.getSeconds(),
+ };
+ for (let k in o) {
+ if (new RegExp(`(${k})`).test(fmt)) {
+ let str = o[k] + "";
+ fmt = fmt.replace(
+ RegExp.$1,
+ RegExp.$1.length === 1 ? str : this.padLeftZero(str)
+ );
+ }
+ }
+ return fmt;
+ },
+ padLeftZero(str) {
+ return ("00" + str).substr(str.length);
+ },
+ // 鏍煎紡鍖栨椂闂� ==> yyyy-mm-dd
+ formatDate(value) {
+ if (value) {
+ const now = value ? new Date(value * 1000) : new Date();
+ let time = this.getDateObj(now, "yyyy-MM-dd");
+ return time;
+ } else {
+ return "";
}
},
onSubmit() {
- setProductNumber().then(res=>{
+ if(this.taskData.Procedure.ID){
+ sendProcessParams({id:this.taskData.Procedure.ID}).then(res=>{
if(res.code==200){
- this.$message.success("涓嬪彂鎴愬姛锛�");
- this.$emit('getSetProductNumber')
- this.shutdown();
+ setProductNumber().then((res) => {
+ if (res.code == 200) {
+ this.$message.success("涓嬪彂鎴愬姛锛�");
+ // this.$message.success("涓嬪彂鐢熶骇鏁伴噺鎴愬姛锛�");
+ this.$emit("getSetProductNumber");
+ this.shutdown();
+ }
+ });
}
- })
+ })
+
+ }
+
},
shutdown() {
this.islook = false;
@@ -84,6 +270,78 @@
</script>
<style lang="scss" scoped>
+.tank-box {
+ width: 638px;
+ height: 630px;
+ padding: 0 20px;
+ background: url("../../public/tank.png") no-repeat center center / cover;
+ position: relative;
+ .dialog-footer {
+ position: absolute;
+ bottom: 40px;
+ }
+}
+.color_4efefa {
+ color: #4efefa !important;
+}
+.font_size_20 {
+ font-size: 20px !important;
+}
+.margin_bottom_13 {
+ margin-bottom: 13px;
+}
+.title-box {
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ .title-item {
+ width: 45%;
+ float: left;
+ height: 35px;
+ line-height: 35px;
+ font-size: 16px;
+ color: #fff;
+ &:nth-of-type(odd) {
+ width: 55%;
+ }
+ }
+ .title-bng {
+ height: 42px;
+ line-height: 42px;
+ span {
+ width: calc(100% - 110px);
+ height: 42px;
+ text-align: center;
+ display: inline-block;
+ background: url("../../public/number.png") no-repeat center center / cover;
+ }
+ }
+ .title-item-two {
+ width: 100% !important;
+ }
+}
+::v-deep .el-dialog {
+ background: transparent;
+}
+::v-deep .el-dialog__header {
+ padding: 0 !important;
+}
+::v-deep .el-dialog__body {
+ padding: 0 !important;
+}
+.btn {
+ width: 200px;
+ height: auto;
+ float: left;
+ display: inline-block;
+ img {
+ width: 100%;
+ }
+ &:nth-of-type(1) {
+ margin-right: 30px;
+ margin-left: 110px;
+ }
+}
::v-deep .el-tabs__content {
height: calc(100% - 55px);
overflow-y: auto;
@@ -94,7 +352,7 @@
border-radius: 50%;
border: 2px solid rgba(12, 79, 218, 1);
position: relative;
- float:left;
+ float: left;
.circel-two {
width: 75px;
height: 75px;
@@ -105,31 +363,30 @@
border: 2px solid rgba(12, 79, 218, 1);
}
}
-.circel-text{
- color:#333;
- margin-left:20px;
- .circel-text-t{
- font-size:18px;
- line-height:40px;
+.circel-text {
+ color: #fff;
+ margin-left: 20px;
+ .circel-text-t {
+ font-size: 18px;
+ line-height: 40px;
}
- .circel-text-b{
+ .circel-text-b {
font-weight: 700;
- font-size:14px;
-
- span{
- color:rgba(12, 79, 218, 1);
- font-size:38px;
- margin-right:10px;
+ font-size: 14px;
+
+ span {
+ color: rgba(12, 79, 218, 1);
+ font-size: 38px;
+ margin-right: 10px;
}
}
}
-.color_red{
- width:100%;
- color:red;
- margin:0 auto;
- text-align:center;
- font-size:14px;
- margin-bottom:25px;
+.color_red {
+ width: 100%;
+ margin: 0 auto;
+ text-align: center;
+ font-size: 14px;
+ margin-bottom: 25px;
}
.form-item {
width: calc(50% - 20px);
@@ -160,12 +417,31 @@
width: 100%;
}
.dialog-content-box {
- height: 100px;
- padding-bottom: 50px;
- overflow-y: auto;
- padding: 0 10px;
+ height: calc(100% - 200px);
+ overflow: hidden;
+ padding: 50px 20px 20px;
.el-form {
overflow: hidden;
+ }
+ .title-auto-box {
+ height: calc(100% - 130px);
+ overflow: auto;
+ }
+ .progress-item{
+ width:55%;
+ padding:2px 8px;
+ height:20px;
+ background:#fff;
+ border-radius:30px;
+ margin:0 auto;
+ border:2px solid rgba(255,255,255,0.5);
+ box-shadow: 1px 5px 5px rgba(255,255,255,0.5);
+ span{
+ float:left;
+ font-weight: 700;
+ color:#333;
+ font-size:15px;
+ }
}
}
.num-identify {
@@ -177,13 +453,12 @@
font-weight: 600;
}
.drawerHeader {
- // position:relative;
- border-bottom: 1px solid #eee;
- height: 40px;
- line-height: 30px;
- color: #333;
font-weight: 700;
- font-size: 18px;
+ font-size: 20px;
+ text-align: center;
+ color: #fff;
+ height: 35px;
+ line-height: 35px;
.identify {
width: 80px;
height: 25px;
diff --git a/src/views/visualization.vue b/src/views/visualization.vue
index fefc625..066ebe2 100644
--- a/src/views/visualization.vue
+++ b/src/views/visualization.vue
@@ -1,7 +1,8 @@
<template>
<div class="home">
- <template v-if="Object.keys(taskData).length > 0 && taskData.Procedure.ID">
+ <!-- v-if="Object.keys(taskData).length > 0 && taskData.Procedure.ID" -->
+ <template >
<div class="left">
<p class="title">
鐢熶骇绠$悊鐪嬫澘
@@ -109,7 +110,7 @@
text-color="#fff"
:text-inside="true"
:stroke-width="30"
- :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount):0"
+ :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount*100):0"
></el-progress>
</el-descriptions-item>
<!-- <el-descriptions-item label="鍚堟牸鐜�" style="width: 100%">
@@ -198,7 +199,7 @@
</div>
<div class="card_top-3">
<span class="card-top-r-t"
- >瀹屾垚杩涘害锛歿{ taskData.Order?parseInt(finishNumber/taskData.Order.amount):0}}</span
+ >瀹屾垚杩涘害锛歿{ taskData.Order?parseInt(finishNumber/taskData.Order.amount*100):0}}</span
>
<span class="card-top-r-b">
<el-progress
@@ -207,7 +208,7 @@
text-color="#fff"
:text-inside="true"
:stroke-width="10"
- :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount):0"
+ :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount*100):0"
:show-text="false"
></el-progress>
</span>
@@ -364,7 +365,7 @@
</span>
</div>
<div class="right-top-m-btn">
- <el-button type="primary" @click="controlClick"> 鎺у埗</el-button>
+ <!-- <el-button type="primary" @click="controlClick"> 鎺у埗</el-button> -->
</div>
<div class="right_dutyLst">
<div class="right-small-title">褰撳墠鍊肩彮</div>
@@ -418,7 +419,8 @@
</div>
</div>
</template>
- <template v-else>
+ <!-- v-else -->
+ <template >
<div class="home-img-box">
<div class="bg-title">
<img src="../../public/bg-title.png" />
@@ -442,9 +444,9 @@
</div>
</template>
<!-- 鎺у埗鐨勫脊妗� -->
- <AddControl ref="control" :id="taskData.Procedure.ID" />
+ <AddControl ref="control" :Arr="Arr" />
<!-- 鎺у埗鐨勫脊妗� -->
- <AddIssue ref="control" :taskData="taskData" :Order="taskData.Order" @getSetProductNumber="getTaskInfo" />
+ <AddIssue ref="control" :Arr="Arr" :taskData="taskData" :Order="taskData.Order" @getSetProductNumber="getTaskInfo" />
</div>
</template>
@@ -528,6 +530,7 @@
showCountDown:false,
countDownHour:0,
countDownMinute:0,
+ Arr:[],
};
},
mounted() {
@@ -545,6 +548,7 @@
this.getTaskInfo();
},
methods: {
+
reloadPage() {
// window.location.reload();
this.getTaskInfo();
@@ -686,6 +690,7 @@
number: res.data.Number,
name: "宸ヨ壓",
});
+ this.Arr=res.data.Params?res.data.Params:[];
}
});
this.getProgressInfo();
@@ -1257,7 +1262,8 @@
}
.right_dutyLst {
width: calc(100% - 20px);
- height: 270px;
+ // height: 270px;
+ height: 310px;
border-radius: 4px;
line-height: 30px;
overflow: hidden;
--
Gitblit v1.8.0