From b08411e811e003ae2711e7ba8d92deaec9239de3 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 24 三月 2023 14:01:44 +0800
Subject: [PATCH] 1.生产开报工优化
---
src/views/scgl/sckbg.vue | 413 ++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 308 insertions(+), 105 deletions(-)
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 265672a..80685d2 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -18,11 +18,11 @@
</div>
<div v-if="false" style="display: flex;padding-right: 10px">
- <el-button @click="ZZstart">
+ <el-button v-waves @click="ZZstart">
<svg-icon icon-class="start_time" style="margin-right: 2px" />
寮�濮�
</el-button>
- <el-button @click="ZZreport">
+ <el-button v-waves @click="ZZreport">
<svg-icon icon-class="report_work" style="margin-right: 2px" />
鎶ュ伐
</el-button>
@@ -51,6 +51,7 @@
/>
<el-table-column
prop="status"
+ show-tooltip-when-overflow
label="鐘舵��"
sortable="custom"
width="80"
@@ -60,6 +61,8 @@
<div v-if="row.status==='ALLO'">宸叉淳鍙�</div>
<div v-if="row.status==='START'">寮�宸�</div>
<div v-if="row.status==='CLOSED'">瀹屽伐</div>
+ <div v-if="row.status==='NOSCHED'">寰呮帓绋�</div>
+ <div v-if="row.status==='SCHED'">宸叉帓绋�</div>
</template>
</el-table-column>
<el-table-column
@@ -74,6 +77,7 @@
label="浜у搧缂栫爜"
min-width="110"
sortable="custom"
+ show-tooltip-when-overflow
/>
<el-table-column
prop="partname"
@@ -105,10 +109,12 @@
label="浠诲姟鏁伴噺"
width="110"
sortable="custom"
+ show-tooltip-when-overflow
/>
<el-table-column
label="鏈姤宸ユ暟閲�"
width="120"
+ show-tooltip-when-overflow
>
<!-- sortable="custom"-->
<template slot-scope="{row}">
@@ -117,6 +123,7 @@
</el-table-column>
<el-table-column
prop="good_qty"
+ show-tooltip-when-overflow
label="宸叉姤宸ユ暟閲�"
sortable="custom"
width="160"
@@ -124,6 +131,7 @@
<el-table-column
prop="ng_qty"
label="涓嶈壇鏁伴噺"
+ show-tooltip-when-overflow
width="150"
sortable="custom"
/>
@@ -131,11 +139,13 @@
prop="bad_qty"
label="宸叉姤搴熸暟閲�"
width="120"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
prop="plan_startdate"
label="璁″垝寮�宸ユ棩鏈�"
+ show-tooltip-when-overflow
width="150"
sortable="custom"
>
@@ -149,6 +159,7 @@
label="璁″垝瀹屽伐鏃ユ湡"
width="150"
sortable="custom"
+ show-tooltip-when-overflow
fixed="right"
>
<template slot-scope="{row}">
@@ -163,8 +174,8 @@
<!-- >-->
<!-- <template slot-scope="{row}">-->
<!-- <div class="operationClass">-->
- <!-- <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
- <!-- <el-button type="text" @click="del(row)">鍒犻櫎</el-button>-->
+ <!-- <el-button v-waves type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
+ <!-- <el-button v-waves type="text" @click="del(row)">鍒犻櫎</el-button>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
@@ -209,11 +220,11 @@
</div>
<div v-if="false" style="display: flex;padding-right: 10px">
- <el-button @click="WXsend">
+ <el-button v-waves @click="WXsend">
<svg-icon icon-class="start_time" style="margin-right: 2px" />
鍙戞枡
</el-button>
- <el-button @click="WXback">
+ <el-button v-waves @click="WXback">
<svg-icon icon-class="report_work" style="margin-right: 2px" />
鏀舵枡
</el-button>
@@ -243,6 +254,7 @@
<el-table-column
prop="status"
label="鐘舵��"
+ show-tooltip-when-overflow
sortable="custom"
width="80"
>
@@ -263,6 +275,7 @@
<el-table-column
prop="partcode"
label="浜у搧缂栫爜"
+ show-tooltip-when-overflow
width="110"
sortable="custom"
/>
@@ -277,6 +290,7 @@
prop="stepname"
label="宸ュ簭"
width="120"
+ show-tooltip-when-overflow
sortable="custom"
/>
<!-- <el-table-column-->
@@ -293,12 +307,14 @@
<el-table-column
prop="plan_qty"
label="浠诲姟鏁伴噺"
+ show-tooltip-when-overflow
width="110"
sortable="custom"
/>
<el-table-column
- label="鏈姤宸ユ暟閲�"
+ label="鏈敹鏂欐暟閲�"
width="120"
+ show-tooltip-when-overflow
>
<!-- sortable="custom"-->
<template slot-scope="{row}">
@@ -308,12 +324,14 @@
<el-table-column
prop="good_qty"
label="宸叉敹鏂欐暟閲�"
+ show-tooltip-when-overflow
sortable="custom"
width="160"
/>
<el-table-column
prop="ng_qty"
label="涓嶈壇鏁伴噺"
+ show-tooltip-when-overflow
width="150"
sortable="custom"
/>
@@ -322,10 +340,12 @@
label="宸叉姤搴熸暟閲�"
min-width="120"
sortable="custom"
+ show-tooltip-when-overflow
/>
<el-table-column
prop="plan_startdate"
label="璁″垝寮�宸ユ棩鏈�"
+ show-tooltip-when-overflow
width="150"
sortable="custom"
>
@@ -337,6 +357,7 @@
<el-table-column
prop="plan_enddate"
label="璁″垝瀹屽伐鏃ユ湡"
+ show-tooltip-when-overflow
width="150"
sortable="custom"
fixed="right"
@@ -353,8 +374,8 @@
<!-- >-->
<!-- <template slot-scope="{row}">-->
<!-- <div class="operationClass">-->
- <!-- <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
- <!-- <el-button type="text" @click="del(row)">鍒犻櫎</el-button>-->
+ <!-- <el-button v-waves type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
+ <!-- <el-button v-waves type="text" @click="del(row)">鍒犻櫎</el-button>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
@@ -409,18 +430,21 @@
fixed
/>
<el-table-column
+ show-tooltip-when-overflow
prop="wo_code"
label="宸ュ崟鍙�"
min-width="160"
sortable="custom"
/>
<el-table-column
+ show-tooltip-when-overflow
prop="partcode"
label="浜у搧缂栫爜"
min-width="110"
sortable="custom"
/>
<el-table-column
+ show-tooltip-when-overflow
prop="partname"
min-width="160"
label="浜у搧鍚嶇О"
@@ -429,6 +453,7 @@
<el-table-column
prop="stepname"
label="宸ュ簭"
+ show-tooltip-when-overflow
min-width="120"
sortable="custom"
/>
@@ -436,6 +461,7 @@
prop="plan_qty"
label="浠诲姟鏁伴噺"
width="110"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
@@ -443,11 +469,13 @@
label="宸叉姤宸ユ暟閲�"
sortable="custom"
min-width="160"
+ show-tooltip-when-overflow
/>
<el-table-column
prop="ng_qty"
label="涓嶈壇鏁伴噺"
width="150"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
@@ -455,6 +483,7 @@
label="宸叉姤搴熸暟閲�"
width="120"
sortable="custom"
+ show-tooltip-when-overflow
/>
<el-table-column
label="鎿嶄綔"
@@ -463,7 +492,7 @@
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-button type="text" @click="repairHandle(row)">缁翠慨澶勭悊</el-button>
+ <el-button v-waves type="text" @click="repairHandle(row)">缁翠慨澶勭悊</el-button>
</div>
</template>
</el-table-column>
@@ -486,6 +515,7 @@
</div>
<el-dialog
+ v-el-drag-dialog
:title="dialogTitle"
:visible.sync="dialogVisible"
width="850px"
@@ -502,19 +532,19 @@
:model="dialogForm"
label-width="110px"
>
- <el-form-item label="宸ュ崟缂栧彿锛�">
+ <el-form-item label="宸ュ崟缂栧彿锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.wo_code }}</div>
</el-form-item>
- <el-form-item label="浜у搧缂栫爜锛�">
+ <el-form-item label="浜у搧缂栫爜锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.partcode }}</div>
</el-form-item>
- <el-form-item label="浜у搧鍚嶇О锛�">
+ <el-form-item label="浜у搧鍚嶇О锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.partname }}</div>
</el-form-item>
- <el-form-item label="浜у搧瑙勬牸锛�">
+ <el-form-item label="浜у搧瑙勬牸锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.partspec }}</div>
</el-form-item>
- <el-form-item label="褰撳墠宸ュ簭锛�">
+ <el-form-item label="褰撳墠宸ュ簭锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.stepname }}</div>
</el-form-item>
<el-form-item v-if="false" label="宸ュ簭鎻忚堪锛�">
@@ -524,20 +554,20 @@
</div>
<!-- </el-tooltip>-->
</el-form-item>
- <el-form-item label="浠诲姟鏁伴噺锛�">
+ <el-form-item label="浠诲姟鏁伴噺锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.planqty }}</div>
</el-form-item>
- <el-form-item v-if="dialogTitle==='鑷埗寮�濮�'" label="鏈紑/宸插紑锛�">
+ <el-form-item v-if="dialogTitle==='鑷埗寮�濮�'" label="鏈紑/宸插紑锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div>
</el-form-item>
- <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鏈姤/宸叉姤锛�">
+ <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鏈姤/宸叉姤锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div>
</el-form-item>
- <el-form-item v-if="dialogTitle==='澶栧崗鍙戞枡'" label="鏈彂/宸插彂锛�">
+ <el-form-item v-if="dialogTitle==='澶栧崗鍙戞枡'" label="鏈彂/宸插彂锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div>
</el-form-item>
- <el-form-item v-if="dialogTitle==='澶栧崗鏀舵枡'" label="鏈敹/宸叉敹锛�">
+ <el-form-item v-if="dialogTitle==='澶栧崗鏀舵枡'" label="鏈敹/宸叉敹锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div>
</el-form-item>
<!--鑷埗寮�濮�-->
@@ -560,10 +590,19 @@
</el-select>
</el-form-item>
<!-- 鑷埗鎶ュ伐 -->
- <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="涓嬮亾宸ュ簭锛�">
+ <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="涓嬮亾宸ュ簭锛�" style="margin: 0 10px 0 0">
<div style="width: 200px">{{ dialogForm.nextstepname }}</div>
</el-form-item>
- <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" prop="usergroupcode" label="鐢熶骇鐝粍锛�">
+
+ <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" prop="reckway" label="璁′欢鏂瑰紡锛�">
+
+ <el-radio-group v-model="dialogForm.reckway" style="width: 200px;" @change="reckwayChange">
+ <el-radio label="group">鐝粍</el-radio>
+ <el-radio label="person">涓汉</el-radio>
+ </el-radio-group>
+ </el-form-item>
+
+ <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'&&dialogForm.reckway==='group'" prop="usergroupcode" label="鐢熶骇鐝粍锛�">
<el-select
v-model="dialogForm.usergroupcode"
style="width: 200px;"
@@ -578,6 +617,23 @@
/>
</el-select>
</el-form-item>
+
+ <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'&&dialogForm.reckway==='person'" prop="operation" label="鎶ュ伐浜哄憳锛�">
+ <el-select
+ v-model="dialogForm.operation"
+ style="width: 200px;"
+ placeholder="璇烽�夋嫨"
+ @change="usergroupChange"
+ >
+ <el-option
+ v-for="item in OperationArr"
+ :key="item.usercode"
+ :label="item.username"
+ :value="item.usercode"
+ />
+ </el-select>
+ </el-form-item>
+
<el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="璁惧鍚嶇О锛�" prop="eqpcode">
<el-select
v-model="dialogForm.eqpcode"
@@ -619,26 +675,30 @@
<!-- <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜哄憳锛�">-->
<!-- <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />-->
<!-- </el-form-item>-->
- <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜猴細">
- <el-select
- v-model="dialogForm.operation"
- style="width: 200px;"
- placeholder="璇烽�夋嫨"
- >
- <el-option
- v-for="item in OperationArr"
- :key="item.usercode"
- :label="item.username"
- :value="item.usercode"
- />
- </el-select>
- </el-form-item>
+ <!-- 娉ㄩ噴-->
+ <!-- <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜猴細">-->
+ <!-- <el-select-->
+ <!-- v-model="dialogForm.operation"-->
+ <!-- style="width: 200px;"-->
+ <!-- placeholder="璇烽�夋嫨"-->
+ <!-- >-->
+ <!-- <el-option-->
+ <!-- v-for="item in OperationArr"-->
+ <!-- :key="item.usercode"-->
+ <!-- :label="item.username"-->
+ <!-- :value="item.usercode"-->
+ <!-- />-->
+ <!-- </el-select>-->
+ <!-- </el-form-item>-->
<el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="澶囨敞锛�">
<el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />
</el-form-item>
- <div v-if="dialogTitle==='鑷埗鎶ュ伐'">
- <i class="el-icon-s-operation" style="color:#42b983;" /> 浜哄憳鍒楄〃
- <el-button type="primary" style="margin: 10px 0" @click="userAdd">澧炶</el-button>
+ <div v-if="dialogTitle==='鑷埗鎶ュ伐'&&dialogForm.reckway==='group'">
+ <div style="display: flex;align-items:center;height: 40px;margin-bottom: 10px">
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" />
+ <div style="margin: 0 15px 0 5px;">浜哄憳鍒楄〃</div>
+ <el-button v-waves type="primary" style="margin: 10px 0" @click="userAdd">澧炶</el-button>
+ </div>
<el-table
ref="userTableDataRef"
:data="userTableData"
@@ -647,7 +707,7 @@
:row-class-name="tableRowClassName"
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
- height="180"
+ height="188"
highlight-current-row
style="width: 100%"
>
@@ -660,9 +720,10 @@
<el-table-column
prop="username"
label="浜哄憳鍚嶇О"
+ show-tooltip-when-overflow
>
<template slot-scope="{row}">
- <div v-if="row.isVisible===0">{{ row.username }}</div>
+
<el-select
v-if="row.isVisible===1"
v-model="row.username"
@@ -677,8 +738,25 @@
:value="item.usercode"
/>
</el-select>
+ <div v-else>{{ row.username }}</div>
</template>
</el-table-column>
+ <el-table-column
+ prop="ratio"
+ label="鍒嗛厤姣斾緥(%)"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-if="row.isVisible===1||row.isVisible===2"
+ v-model="row.ratio"
+ oninput="value=value.replace(/[^0-9.]/g,'')"
+ placeholder="璇疯緭鍏�"
+ />
+ <div v-else> {{ row.ratio }}</div>
+ </template>
+ </el-table-column>
+
<el-table-column
prop="RowNum"
label="鎿嶄綔"
@@ -686,9 +764,16 @@
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-button v-if="row.isVisible===0" type="text" @click="userDel(row)">鍒犻櫎</el-button>
- <el-button v-if="row.isVisible===1&&!userIsSave" type="text" @click="userSave(row)">淇濆瓨</el-button>
- <el-button v-if="row.isVisible===1" type="text" @click="userCancel(row)">鍙栨秷</el-button>
+ <el-button
+ v-if="(row.isVisible===1&&!userIsSave)||row.isVisible===2"
+ v-waves
+ type="text"
+ @click="userSave(row)"
+ >淇濆瓨
+ </el-button>
+ <el-button v-if="row.isVisible===1" v-waves type="text" @click="userCancel(row)">鍙栨秷</el-button>
+ <el-button v-if="row.isVisible===0" v-waves type="text" @click="userDel(row)">鍒犻櫎</el-button>
+ <el-button v-if="row.isVisible===0" v-waves type="text" @click="editRatio(row)">淇敼姣斾緥</el-button>
</div>
</template>
</el-table-column>
@@ -856,41 +941,62 @@
</el-form>
<span slot="footer" class="dialog-footer">
<div class="footerButton">
- <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
<el-button
v-if="dialogTitle==='鑷埗寮�濮�'"
+ v-waves
:loading="$store.state.app.buttonIsDisabled"
:disabled="$store.state.app.buttonIsDisabled"
type="primary"
@click="dialogVisibleConfirm"
>寮� 宸�</el-button>
<el-button
- v-if="dialogTitle==='鑷埗鎶ュ伐'"
+ v-if="dialogTitle==='鑷埗鎶ュ伐'&&dialogForm.nextstepname===''"
+ v-waves
:loading="$store.state.app.buttonIsDisabled"
:disabled="$store.state.app.buttonIsDisabled"
type="primary"
@click="dialogVisibleConfirm"
>鎻愪氦/鎵撳嵃</el-button>
<el-button
+ v-if="dialogTitle==='鑷埗鎶ュ伐'&&dialogForm.nextstepname!==''"
+ v-waves
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ type="primary"
+ @click="dialogVisibleConfirm"
+ >鎻愪氦</el-button>
+ <el-button
v-if="dialogTitle==='澶栧崗鍙戞枡'"
+ v-waves
:loading="$store.state.app.buttonIsDisabled"
:disabled="$store.state.app.buttonIsDisabled"
type="primary"
@click="dialogVisibleConfirm"
>鍙戞枡</el-button>
<el-button
- v-if="dialogTitle==='澶栧崗鏀舵枡'"
+ v-if="dialogTitle==='澶栧崗鏀舵枡'&&dialogForm.nextstepname===''"
+ v-waves
:loading="$store.state.app.buttonIsDisabled"
:disabled="$store.state.app.buttonIsDisabled"
type="primary"
@click="dialogVisibleConfirm"
>鏀舵枡/鎵撳嵃</el-button>
+ <el-button
+ v-if="dialogTitle==='澶栧崗鏀舵枡'&&dialogForm.nextstepname!==''"
+ v-waves
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ type="primary"
+ @click="dialogVisibleConfirm"
+ >鏀舵枡</el-button>
</div>
</span>
</el-dialog>
<!--鎵撳嵃棰勮椤甸潰 灏忔爣绛�-->
<el-dialog
+ v-el-drag-dialog
title="棰勮"
:visible.sync="dialogVisible2"
width="1140"
@@ -959,14 +1065,15 @@
</div>
<span slot="footer" class="dialog-footer">
<div class="footerButton">
- <el-button @click="dialogVisible2 = false">鍙� 娑�</el-button>
- <el-button v-print="printObj2" type="primary">纭� 瀹�</el-button>
+ <el-button v-waves @click="dialogVisible2 = false">鍙� 娑�</el-button>
+ <el-button v-waves v-print="printObj2" type="primary">纭� 瀹�</el-button>
</div>
</span>
</el-dialog>
<!-- 涓嶈壇澶勭悊鍒楄〃瀵硅瘽妗�-->
<el-dialog
+ v-el-drag-dialog
title="缁翠慨澶勭悊"
:visible.sync="badDialogVisible"
width="990px"
@@ -1009,24 +1116,25 @@
<div style="width: 200px">{{ badDialogForm.ng_qty }}</div>
</el-form-item>
- <el-form-item label="缁翠慨浜哄憳锛�">
- <el-select
- v-model="badDialogForm.operation"
- style="width: 200px;"
- placeholder="璇烽�夋嫨"
- >
- <el-option
- v-for="item in OperationArr"
- :key="item.usercode"
- :label="item.username"
- :value="item.usercode"
- />
- </el-select>
- </el-form-item>
+ <!-- 娉ㄩ噴-->
+ <!-- <el-form-item label="缁翠慨浜哄憳锛�">-->
+ <!-- <el-select-->
+ <!-- v-model="badDialogForm.operation"-->
+ <!-- style="width: 200px;"-->
+ <!-- placeholder="璇烽�夋嫨"-->
+ <!-- >-->
+ <!-- <el-option-->
+ <!-- v-for="item in OperationArr"-->
+ <!-- :key="item.usercode"-->
+ <!-- :label="item.username"-->
+ <!-- :value="item.usercode"-->
+ <!-- />-->
+ <!-- </el-select>-->
+ <!-- </el-form-item>-->
</el-form>
<div style="margin-bottom:20px">
- <i class="el-icon-s-operation" style="color:#42b983;" /> 涓嶈壇淇℃伅鏄庣粏锛�
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 涓嶈壇淇℃伅鏄庣粏锛�
</div>
<div class="elTableDiv">
<el-table
@@ -1110,11 +1218,11 @@
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-button v-if="row.isVisible===0" type="text" @click="badEdit(row)">缂栬緫</el-button>
- <el-button v-if="row.isVisible===0" type="text" @click="badDel(row)">鍒犻櫎</el-button>
+ <el-button v-if="row.isVisible===0" v-waves type="text" @click="badEdit(row)">缂栬緫</el-button>
+ <el-button v-if="row.isVisible===0" v-waves type="text" @click="badDel(row)">鍒犻櫎</el-button>
- <el-button v-if="row.isVisible===1" type="text" @click="badSave(row)">纭</el-button>
- <el-button v-if="row.isVisible===1" type="text" @click="badCancel(row)">鍙栨秷</el-button>
+ <el-button v-if="row.isVisible===1" v-waves type="text" @click="badSave(row)">纭</el-button>
+ <el-button v-if="row.isVisible===1" v-waves type="text" @click="badCancel(row)">鍙栨秷</el-button>
</div>
</template>
</el-table-column>
@@ -1123,8 +1231,9 @@
</div>
<span slot="footer" class="dialog-footer">
<div class="footerButton">
- <el-button @click="badDialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button v-waves @click="badDialogVisibleCancel">鍙� 娑�</el-button>
<el-button
+ v-waves
type="primary"
:loading="$store.state.app.buttonIsDisabled"
:disabled="$store.state.app.buttonIsDisabled"
@@ -1159,6 +1268,8 @@
import QRCode from 'qrcodejs2'
import { getCookie } from '@/utils/auth'
import { handleDatetime2 } from '@/utils/global'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -1166,6 +1277,7 @@
components: {
Pagination
},
+ directives: { elDragDialog, waves },
data() {
const validateName = (rule, value, callback) => {
if (!value) {
@@ -1253,6 +1365,8 @@
startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
+ reckway: 'group', // 璁′欢鏂瑰紡
+
operation: getCookie('navTabId'), // 鎶ュ伐浜猴紙鏀舵枡浜猴級
remarks: ''// 澶囨敞
@@ -1297,6 +1411,9 @@
],
startqty: [
{ required: true, message: '璇疯緭鍏ユ姤宸ユ暟閲�', trigger: ['blur', 'change'] }
+ ],
+ operation: [
+ { required: true, message: '璇烽�夋嫨鎶ュ伐浜哄憳', trigger: ['blur', 'change'] }
]
},
activeName: '',
@@ -1388,7 +1505,7 @@
this.getHeight()
this.$nextTick(() => {
- $("input[name='produceCode']")[0].focus()
+ $('input[name=\'produceCode\']')[0].focus()
// this.bindQRCode('10001;001')
})
// webapp_urlprotocol_startup()
@@ -1397,7 +1514,17 @@
this.getMesOrderSelectUserAll() // 鑾峰彇鎵�鏈変汉鍛�
},
methods: {
-
+ // 璁′欢鏂瑰紡鍊兼敼鍙樻椂
+ reckwayChange() {
+ this.dialogForm.usergroupcode = ''
+ this.dialogForm.operation = ''
+ this.userTableData = []
+ this.UserTotal = 0
+ // console.log(this.$refs.dialogForm, 'log')
+ // this.$nextTick(() => {
+ // this.$refs.dialogForm.resetFields()
+ // })
+ },
tableRowClassName({ row, rowIndex }) {
return 'custom-row'
},
@@ -1466,21 +1593,21 @@
if (this.$refs.elTabs.currentName === '0') {
this.$nextTick(() => {
this.getMesOrderStepSearch()
- $("input[name='produceCode']")[0].focus()
+ $('input[name=\'produceCode\']')[0].focus()
this.WXform.orderstepqrcode = ''
})
}
if (this.$refs.elTabs.currentName === '1') {
this.$nextTick(() => {
this.getMesOrderWxStepSearch()
- $("input[name='WXproduceCode']")[0].focus()
+ $('input[name=\'WXproduceCode\']')[0].focus()
this.form.orderstepqrcode = ''
})
}
if (this.$refs.elTabs.currentName === '2') {
this.$nextTick(() => {
this.getBadList()
- $("input[name='badProduceCode']")[0].focus()
+ $('input[name=\'badProduceCode\']')[0].focus()
this.badForm.orderstepqrcode = ''
})
}
@@ -1685,9 +1812,11 @@
this.dialogForm.startqty = obj.noreportqty
this.dialogForm.nextstepname = obj.nextstepname
- this.dialogForm.nextstepcode = obj.nextstepcode
+ this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
this.dialogForm.startqtySum = obj.noreportqty
+
+ this.$refs.userTableDataRef.doLayout()
})
await this.getMesOrderStepStartSelectEqp()
@@ -1746,7 +1875,7 @@
this.dialogForm.stepcode = obj.stepcode
this.dialogForm.nextstepname = obj.nextstepname
- this.dialogForm.nextstepcode = obj.nextstepcode
+ this.dialogForm.nextstepcode = obj.nextstepcode ? obj.nextstepcode : obj.stepcode
this.dialogForm.noputqty = obj.noputqty
this.dialogForm.stepseq = obj.seq
@@ -1809,23 +1938,67 @@
async getUserTableData() {
const { data: res } = await MesOrderGroupSelectUser({ usergroupcode: this.dialogForm.usergroupcode })
this.userTableData = res
+ this.UserTotal = res.length
this.userTableData.forEach(item => {
let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
number = number === 0 ? (10 + Math.random()) : number
item.isVisible = 0
item.number = number
+ // item.ratio = parseFloat((100 / this.userTableData.length).toFixed(2))
})
this.ZZuserArr = [...this.ZZuserArr].filter(x => [...this.userTableData].every(y => y.usercode !== x.usercode))
- this.$refs.tableDataRef.doLayout()
+ this.calculatedValue()
+ this.$nextTick(() => {
+ this.$refs.tableDataRef.doLayout()
+ this.$refs.userTableDataRef.doLayout()
+ })
},
+ calculatedValue() {
+ const total = 100
+ let value = 0
+ this.userTableData.forEach(item => {
+ item.ratio = parseFloat((100 / this.userTableData.length).toFixed(2))
+ value += item.ratio
+ })
+ console.log(value, 1)
+ this.UserTotal = this.userTableData.length
+ if (value !== total) {
+ // let temp = this.userTableData
+ // temp[temp.length-1].ratio=temp[temp.length-1].ratio+(total-value)
+ this.userTableData[this.userTableData.length - 1].ratio = parseFloat((this.userTableData[this.userTableData.length - 1].ratio + (total - value)).toFixed(2))
+ }
+ },
+ // 淇敼鍒嗛厤姣斿垪
+ editRatio(row) {
+ // console.log(row, 'row')
+ this.userTableData.forEach((item, index) => {
+ if (item.number === row.number) {
+ const number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+
+ this.userTableData.splice(index, 1, {
+ usercode: row.usercode,
+ username: row.username,
+ ratio: row.ratio,
+ isVisible: 2,
+ number: number === 0 ? (10 + Math.random()) : number
+
+ })
+ }
+ })
+ },
+
// 鐢ㄦ埛娣诲姞
userAdd() {
+ if (this.userTableData.find(i => i.isVisible === 1)) {
+ return this.$message.info('璇峰厛淇濆瓨褰撳墠琛屼俊鎭紒')
+ }
let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
number = number === 0 ? (10 + Math.random()) : number
console.log(this.userTableData, 6)
- this.userTableData.unshift({ usercode: '', username: '', isVisible: 1, number: number })
+ this.userTableData.unshift({ usercode: '', username: '', isVisible: 1, number: number, ratio: 0 })
+ this.calculatedValue()
},
// 鐢ㄦ埛鍒楄〃鍒犻櫎
userDel(row) {
@@ -1839,12 +2012,17 @@
this.userTableData.splice(index, 1)
}
})
+
+ this.calculatedValue()
},
// 鐢ㄦ埛鍒楄〃淇濆瓨
userSave(row) {
console.log(row, 123)
if (row.usercode === '') {
return this.$message.info('浜哄憳鍚嶇О涓嶈兘涓虹┖锛�')
+ }
+ if (row.ratio === '') {
+ return this.$message.info('鍒嗛厤姣斿垪涓嶈兘涓虹┖锛�')
}
this.ZZuserArr.forEach((item, index) => {
@@ -1866,6 +2044,7 @@
this.userTableData.splice(index, 1)
}
})
+ this.UserTotal = this.userTableData.length
},
// 鐢ㄦ埛鍒楄〃浜哄憳鍚嶇О鍊奸�変腑
usernameChange(val, row) {
@@ -1921,7 +2100,11 @@
this.dialogForm.startqtySum = '' // 涓嶈兘瓒呰繃鐨勬暟鍊�
+ this.dialogForm.reckway = '' // 璁′欢鏂瑰紡
+
this.dialogForm.nextstepcode = '' // 涓嬮亾宸ュ簭缂栫爜
+
+ this.dialogForm.reckway = 'group'
this.dialogForm.remarks = '' // 澶囨敞
this.dialogForm.operation = getCookie('navTabId') // 鎶ュ伐浜猴紙鏀舵枡浜猴級
@@ -1938,7 +2121,6 @@
dialogVisibleConfirm() {
this.$refs.dialogForm.validate(valid => {
if (valid) {
- this.$store.state.app.buttonIsDisabled = true
if (this.dialogTitle === '澶栧崗鍙戞枡') {
if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) {
return this.$message.info('鍙戞枡鏁伴噺涓嶈兘澶т簬鏈彂鏁伴噺!')
@@ -1953,6 +2135,7 @@
taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
fqty: this.dialogForm.fqty // 鍙戞枡鏁伴噺
}
+ this.$store.state.app.buttonIsDisabled = true
SavaMesOrderStepOut(data).then(res => {
if (res.code === '200') {
this.dialogVisible = false
@@ -1989,16 +2172,16 @@
ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
}
+ this.$store.state.app.buttonIsDisabled = true
SavaMesOrderStepIn(data).then(res => {
if (res.code === '200') {
- this.$message.success('鏀舵枡鎴愬姛锛�')
-
- if (this.dialogForm.nextstepcode === '') {
- this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
- this.dialogVisible2 = true
- }
this.dialogVisible = false
-
+ this.$message.success('鏀舵枡鎴愬姛锛�')
+ // if (this.dialogForm.nextstepcode === '') {
+ // this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
+ this.WXprint2(this.OperationArr.find(item => item.usercode === getCookie('navTabId')).username)
+ this.dialogVisible2 = true
+ // }
this.tabClick()
this.$store.state.app.buttonIsDisabled = false
} else {
@@ -2017,10 +2200,11 @@
taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
startqty: this.dialogForm.startqty// 寮�濮嬫暟閲�
}
+ this.$store.state.app.buttonIsDisabled = true
SavaMesOrderStepStart(data).then(res => {
if (res.code === '200') {
- this.$message.success('寮�宸ユ垚鍔燂紒')
this.dialogVisible = false
+ this.$message.success('寮�宸ユ垚鍔燂紒')
this.tabClick()
this.$store.state.app.buttonIsDisabled = false
} else {
@@ -2033,14 +2217,8 @@
if (parseFloat(this.dialogForm.startqtySum) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) {
return this.$message.info('鎶ュ伐鏁伴噺鍔犱笉鑹暟閲忎笉鑳藉ぇ浜庝簡鏈姤鏁伴噺!')
}
- if (this.userTableData.length < 1) {
+ if (this.userTableData.length < 1 && this.dialogForm.reckway === 'group') {
return this.$message.info('浜哄憳鍒楄〃涓嶈兘涓虹┖!')
- }
-
- if (parseFloat(this.dialogForm.noputqty) > 0) {
- if (this.dialogForm.badcode.length < 1) {
- return this.$message.info('璇烽�夋嫨涓嶈壇鍘熷洜锛�')
- }
}
// this.userTableData = [...new Set(this.userTableData)]// 鏁扮粍鍘婚噸
this.userTableData = this.userTableData.filter(item => item.usercode !== '')
@@ -2048,8 +2226,26 @@
this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => {
return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex
})
+
+ if (this.dialogForm.reckway === 'group') {
+ let sum = 0
+ this.userTableData.forEach(item => {
+ sum += parseFloat(item.ratio)
+ })
+ if (Math.round(sum * 100) / 100 !== 100) {
+ return this.$message.info('鍒嗛厤姣斾緥鎬诲拰蹇呴』涓�100锛�')
+ }
+ }
+
+ if (parseFloat(this.dialogForm.noputqty) > 0) {
+ if (this.dialogForm.badcode.length < 1) {
+ return this.$message.info('璇烽�夋嫨涓嶈壇鍘熷洜锛�')
+ }
+ }
+
// console.log(this.userTableData, 1)
- const reportuser = this.userTableData.map(item => item.usercode).join(';')
+ // const reportuser = this.userTableData.map(item => item.usercode).join(';')// 涓昏鏀圭殑鏄繖閲岀殑鏍煎紡
+ console.log(this.dialogForm.operation, 'dialogForm.operation')
const data = {
mesordercode: this.dialogForm.wo_code, // 宸ュ崟缂栧彿
partcode: this.dialogForm.partcode, // 浜у搧缂栫爜
@@ -2057,28 +2253,35 @@
stepcode: this.dialogForm.stepcode, // 宸ュ簭缂栫爜
eqpcode: this.dialogForm.eqpcode, // 璁惧缂栫爜
usergroupcode: this.dialogForm.usergroupcode, // 鐝粍缂栫爜
- reportuser: reportuser, // 鎶ュ伐浜哄憳
+ // reportuser: reportuser, // 鎶ュ伐浜哄憳
+ reportuser: this.dialogForm.reckway === 'group' ? this.userTableData : [{
+ usercode: this.dialogForm.operation,
+ ratio: 100
+ }],
taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
// startqty: this.dialogForm.startqty, // 寮�宸ユ暟閲�
startqty: this.dialogForm.reportqty, // 寮�宸ユ暟閲�
// reportqty: this.dialogForm.reportqty, // 鎶ュ伐鏁伴噺
reportqty: this.dialogForm.startqty, // 鎶ュ伐鏁伴噺
remarks: this.dialogForm.remarks, // 澶囨敞
+ reckway: this.dialogForm.reckway, // 璁′欢鏂瑰紡
ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
}
+ // console.log(JSON.stringify(data), 'data')
+ console.log(data, 'data')
+ this.$store.state.app.buttonIsDisabled = true
SavaMesOrderStepReport(data).then(res => {
if (res.code === '200') {
- this.$message.success('鎶ュ伐鎴愬姛锛�')
-
- if (this.dialogForm.nextstepcode === '') {
- this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
- this.dialogVisible2 = true
- this.$store.state.app.buttonIsDisabled = false
- }
this.dialogVisible = false
+ this.$message.success('鎶ュ伐鎴愬姛锛�')
+ // if (this.dialogForm.nextstepcode === '') {
+ this.ZZprint2(this.OperationArr.find(item => item.usercode === getCookie('navTabId')).username)
+ this.dialogVisible2 = true
+ // }
this.tabClick()
+ this.$store.state.app.buttonIsDisabled = false
} else {
this.$message.error('鎶ュ伐澶辫触!')
}
@@ -2165,11 +2368,11 @@
Data: this.badTableDataDialog
}
this.$store.state.app.buttonIsDisabled = true
- EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
+ EditOrderNgStepSeave(data, getCookie('navTabId')).then(res => {
if (res.code === '200' || res.code === '301') {
this.getBadList()
this.badDialogVisible = false
- this.badPrint(this.OperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
+ this.badPrint(this.OperationArr.find(item => item.usercode === getCookie('navTabId')).username)
this.dialogVisible2 = true
this.$message.success('淇濆瓨鎴愬姛锛�')
--
Gitblit v1.9.3