From b46bc2dba51a3885a68e4c58316b41a31ea16bb2 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 14 二月 2023 13:35:03 +0800
Subject: [PATCH] 1.存货档案修改
---
src/views/scgl/sckbg.vue | 492 ++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 380 insertions(+), 112 deletions(-)
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 1da7ea2..027cbb0 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -7,20 +7,22 @@
<div style="display: flex;align-items: center">
<div style="width: 90px">鎵弿鏉$爜锛�</div>
<!-- oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"-->
-
<el-input
+ id="keyWords"
v-model="form.orderstepqrcode"
name="produceCode"
style="width: 300px"
@keyup.enter.native="val=>enterNative(val,'produceCode')"
/>
+ <!-- @keyup.native="e=>judgeIsScanning(e,'produceCode')"-->
+
</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>
@@ -29,6 +31,8 @@
<el-divider />
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
+ class="tableFixed"
:data="tableData"
:height="isIpad? (tableHeight+50):tableHeight"
border
@@ -39,19 +43,6 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
- <!-- <el-table-column-->
- <!-- width="50"-->
- <!-- fixed-->
- <!-- >-->
- <!-- <template slot-scope="{row}">-->
- <!-- <el-radio-->
- <!-- v-model="radioSelected"-->
- <!-- :label="row.wo"-->
- <!-- style="color: #fff;padding-left: 10px; margin-right: -25px;"-->
- <!-- @change.native="getCurrentRow(row.wo)"-->
- <!-- />-->
- <!-- </template>-->
- <!-- </el-table-column>-->
<el-table-column
prop="RowNum"
width="50"
@@ -60,6 +51,7 @@
/>
<el-table-column
prop="status"
+ show-tooltip-when-overflow
label="鐘舵��"
sortable="custom"
width="80"
@@ -69,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
@@ -83,6 +77,7 @@
label="浜у搧缂栫爜"
min-width="110"
sortable="custom"
+ show-tooltip-when-overflow
/>
<el-table-column
prop="partname"
@@ -114,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}">
@@ -126,6 +123,7 @@
</el-table-column>
<el-table-column
prop="good_qty"
+ show-tooltip-when-overflow
label="宸叉姤宸ユ暟閲�"
sortable="custom"
width="160"
@@ -133,6 +131,7 @@
<el-table-column
prop="ng_qty"
label="涓嶈壇鏁伴噺"
+ show-tooltip-when-overflow
width="150"
sortable="custom"
/>
@@ -140,16 +139,18 @@
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"
>
<template slot-scope="{row}">
- <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
+ <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
<div v-else>/</div>
</template>
</el-table-column>
@@ -158,10 +159,11 @@
label="璁″垝瀹屽伐鏃ユ湡"
width="150"
sortable="custom"
+ show-tooltip-when-overflow
fixed="right"
>
<template slot-scope="{row}">
- <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
+ <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
<div v-else>/</div>
</template>
</el-table-column>
@@ -172,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>-->
@@ -214,13 +216,15 @@
style="width: 300px"
@keyup.enter.native="val=>enterNative(val,'WXproduceCode')"
/>
+ <!-- @keyup.native="e=>judgeIsScanning(e,'WXproduceCode')"-->
+
</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>
@@ -229,6 +233,8 @@
<el-divider />
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
+ class="tableFixed"
:data="WXtableData"
:height="isIpad? (tableHeight+50):tableHeight"
border
@@ -239,19 +245,6 @@
:cell-style="this.$cellStyle"
@sort-change="WXsortChange"
>
- <!-- <el-table-column-->
- <!-- width="50"-->
- <!-- fixed-->
- <!-- >-->
- <!-- <template slot-scope="{row}">-->
- <!-- <el-radio-->
- <!-- v-model="radioSelected"-->
- <!-- :label="row.wo_code"-->
- <!-- style="color: #fff;padding-left: 10px; margin-right: -25px;"-->
- <!-- @change.native="getWXCurrentRow(row.wo_code)"-->
- <!-- />-->
- <!-- </template>-->
- <!-- </el-table-column>-->
<el-table-column
prop="RowNum"
width="50"
@@ -261,6 +254,7 @@
<el-table-column
prop="status"
label="鐘舵��"
+ show-tooltip-when-overflow
sortable="custom"
width="80"
>
@@ -281,6 +275,7 @@
<el-table-column
prop="partcode"
label="浜у搧缂栫爜"
+ show-tooltip-when-overflow
width="110"
sortable="custom"
/>
@@ -295,6 +290,7 @@
prop="stepname"
label="宸ュ簭"
width="120"
+ show-tooltip-when-overflow
sortable="custom"
/>
<!-- <el-table-column-->
@@ -311,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}">
@@ -326,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"
/>
@@ -340,27 +340,30 @@
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"
>
<template slot-scope="{row}">
- <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
+ <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
<div v-else>/</div>
</template>
</el-table-column>
<el-table-column
prop="plan_enddate"
label="璁″垝瀹屽伐鏃ユ湡"
+ show-tooltip-when-overflow
width="150"
sortable="custom"
fixed="right"
>
<template slot-scope="{row}">
- <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
+ <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
<div v-else>/</div>
</template>
</el-table-column>
@@ -371,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>-->
@@ -401,11 +404,15 @@
style="width: 300px"
@keyup.enter.native="val=>enterNative(val,'badProduceCode')"
/>
+ <!-- @keyup.native="e=>judgeIsScanning(e,'badProduceCode')"-->
+
</div>
</div>
<el-divider />
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
+ class="tableFixed"
:data="badTableData"
:height="isIpad? (tableHeight+50):tableHeight"
border
@@ -423,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="浜у搧鍚嶇О"
@@ -443,6 +453,7 @@
<el-table-column
prop="stepname"
label="宸ュ簭"
+ show-tooltip-when-overflow
min-width="120"
sortable="custom"
/>
@@ -450,6 +461,7 @@
prop="plan_qty"
label="浠诲姟鏁伴噺"
width="110"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
@@ -457,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
@@ -469,6 +483,7 @@
label="宸叉姤搴熸暟閲�"
width="120"
sortable="custom"
+ show-tooltip-when-overflow
/>
<el-table-column
label="鎿嶄綔"
@@ -477,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>
@@ -500,6 +515,7 @@
</div>
<el-dialog
+ v-el-drag-dialog
:title="dialogTitle"
:visible.sync="dialogVisible"
width="850px"
@@ -620,6 +636,7 @@
placeholder="璇烽�夋嫨"
:disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''"
multiple
+ collapse-tags
>
<el-option
v-for="item in badArr"
@@ -632,15 +649,31 @@
<!-- <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-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>
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 浜哄憳鍒楄〃
+ <el-button v-waves type="primary" style="margin: 10px 0" @click="userAdd">澧炶</el-button>
<el-table
+ ref="userTableDataRef"
:data="userTableData"
border
+ class="tableFixed"
:row-class-name="tableRowClassName"
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
@@ -657,6 +690,7 @@
<el-table-column
prop="username"
label="浜哄憳鍚嶇О"
+ show-tooltip-when-overflow
>
<template slot-scope="{row}">
<div v-if="row.isVisible===0">{{ row.username }}</div>
@@ -683,9 +717,9 @@
>
<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===0" v-waves type="text" @click="userDel(row)">鍒犻櫎</el-button>
+ <el-button v-if="row.isVisible===1&&!userIsSave" 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>
</div>
</template>
</el-table-column>
@@ -815,12 +849,13 @@
<el-form-item
v-if="dialogTitle==='澶栧崗鏀舵枡'"
label="涓嶈壇鍘熷洜锛�"
- prop="badcode"
>
+ <!-- prop="badcode"-->
<el-select
v-model="dialogForm.badcode"
style="width: 200px;"
multiple
+ collapse-tags
:disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''"
placeholder="璇烽�夋嫨"
>
@@ -832,23 +867,82 @@
/>
</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>
</el-form>
<span slot="footer" class="dialog-footer">
<div class="footerButton">
- <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
- <el-button v-if="dialogTitle==='鑷埗寮�濮�'" type="primary" @click="dialogVisibleConfirm">寮� 宸�</el-button>
- <el-button v-if="dialogTitle==='鑷埗鎶ュ伐'" type="primary" @click="dialogVisibleConfirm">鎻愪氦/鎵撳嵃</el-button>
- <el-button v-if="dialogTitle==='澶栧崗鍙戞枡'" type="primary" @click="dialogVisibleConfirm">鍙戞枡</el-button>
- <el-button v-if="dialogTitle==='澶栧崗鏀舵枡'" type="primary" @click="dialogVisibleConfirm">鏀舵枡/鎵撳嵃</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==='鑷埗鎶ュ伐'&&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==='澶栧崗鏀舵枡'&&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"
@@ -869,7 +963,9 @@
>
<div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
</div>
- <div style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center">
+ <div
+ style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
+ >
<div style="margin-left: 5px;width: 28px">鏁伴噺:</div>
{{ qrForm.startqty }}
</div>
@@ -915,14 +1011,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"
@@ -982,7 +1079,7 @@
</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
@@ -1040,8 +1137,8 @@
/>
<el-table-column
prop="repair_qty"
- label="缁翠慨鏁伴噺"
- width="90"
+ label="缁翠慨鍚堟牸鏁伴噺"
+ width="110"
>
<template slot-scope="{row}">
<!-- {{ row.repair_qty }}-->
@@ -1066,11 +1163,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>
@@ -1079,8 +1176,14 @@
</div>
<span slot="footer" class="dialog-footer">
<div class="footerButton">
- <el-button @click="badDialogVisibleCancel">鍙� 娑�</el-button>
- <el-button type="primary" @click="badDialogVisibleConfirm ">淇� 瀛�/鎵� 鍗�</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"
+ @click="badDialogVisibleConfirm "
+ >淇� 瀛�/鎵� 鍗�</el-button>
</div>
</span>
</el-dialog>
@@ -1110,6 +1213,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 {
@@ -1117,6 +1222,7 @@
components: {
Pagination
},
+ directives: { elDragDialog, waves },
data() {
const validateName = (rule, value, callback) => {
if (!value) {
@@ -1190,7 +1296,7 @@
taskqty: '', // 浠诲姟鏁伴噺
fqty: '', // 鍙戞枡鏁伴噺
- inuser: '', // 鏀舵枡浜哄憳
+ inuser: getCookie('navTabId'), // 鏀舵枡浜哄憳
sqty: '', // 鏀舵枡鏁伴噺
ngqty: '', // 涓嶈壇鏁伴噺
badcode: '', // 涓嶈壇鍘熷洜缂栫爜
@@ -1204,6 +1310,7 @@
startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
+ operation: getCookie('navTabId'), // 鎶ュ伐浜猴紙鏀舵枡浜猴級
remarks: ''// 澶囨敞
},
@@ -1296,23 +1403,39 @@
operation: getCookie('navTabId')
},
badTableDataDialog: [], // 涓嶈壇瀵硅瘽妗唗able琛ㄦ牸
- OperationArr: [] // 浜哄憳鏁扮粍
+ OperationArr: [], // 浜哄憳鏁扮粍
+ sendButtonIsDisabled: false, // 涓嬭揪鎸夐挳鏄惁鍙偣鍑�
+ judgeIsScanningArr: [], // 鍒ゆ柇鏄惁鎵爜鏁扮粍
+ countJudgeIsScanningInput: 0 // 鍒ゆ柇鎵爜妗嗙殑涓暟
}
},
- // computed: {
- // qrLink: function() {
- // return this.$store.getters.getPreviewUrl
- // }
- // },
- // watch: {
- // qrLink: function(newVal, oldNew) {
- // if (newVal !== oldNew) {
- // this.$nextTick(() => {
- // this.bindQRCode(newVal)
- // })
- // }
- // }
- // },
+ watch: {
+ // 'form.orderstepqrcode': {
+ // handler(newValue) {
+ // this.form.orderstepqrcode = newValue
+ //
+ // // 鍦ㄨ繖閲岃皟鐢紝骞舵墽琛宼his.fnThrottle(this.search, 500, 2000)();
+ // this.fnThrottle(this.enterNative, 500, 2000, 'produceCode')()
+ // }
+ // },
+ // 'WXform.orderstepqrcode': {
+ // handler(newValue) {
+ // this.form.orderstepqrcode = newValue
+ //
+ // // 鍦ㄨ繖閲岃皟鐢紝骞舵墽琛宼his.fnThrottle(this.search, 500, 2000)();
+ // this.fnThrottle(this.enterNative, 500, 2000, 'WXproduceCode')()
+ // }
+ // },
+ // 'badForm.orderstepqrcode': {
+ // handler(newValue) {
+ // this.form.orderstepqrcode = newValue
+ //
+ // // 鍦ㄨ繖閲岃皟鐢紝骞舵墽琛宼his.fnThrottle(this.search, 500, 2000)();
+ // this.fnThrottle(this.enterNative, 500, 2000, 'badProduceCode')()
+ // }
+ // }
+ },
+
created() {
this.getMesOrderStepSearch()
this.tabClick()
@@ -1327,8 +1450,11 @@
})
// webapp_urlprotocol_startup()
// webapp_ws_autoupdate(true)
+
+ this.getMesOrderSelectUserAll() // 鑾峰彇鎵�鏈変汉鍛�
},
methods: {
+
tableRowClassName({ row, rowIndex }) {
return 'custom-row'
},
@@ -1416,9 +1542,108 @@
})
}
},
+ // 闃叉姈 //鎵爜鐢ㄧ殑鏄槻鎶�
+ fnThrottle(method, delay, duration, belong) {
+ var that = this
+ var timer = this.timer
+ var begin = new Date().getTime()
+ return function() {
+ var current = new Date().getTime()
+ clearTimeout(timer)
+ if (current - begin >= duration) {
+ // method()
+ // that.VALUE()
+ begin = current
+ } else {
+ that.timer = setTimeout(function() {
+ // method()
+ if (belong === 'produceCode') {
+ that.enterNative(that.form.orderstepqrcode, belong)
+ }
+ if (belong === 'WXproduceCode') {
+ that.enterNative(that.WXform.orderstepqrcode, belong)
+ }
+ if (belong === 'badProduceCode') {
+ that.enterNative(that.badForm.orderstepqrcode, belong)
+ }
+ }, delay)
+ }
+ }
+ },
+ // 鍒ゆ柇鏄惁鏄壂鐮佹灙鎵爜
+ judgeIsScanning2(e, belong) {
+ if (belong === 'produceCode' && this.form.orderstepqrcode.toString().length === 0) {
+ this.judgeIsScanningArr = []
+ this.countJudgeIsScanningInput = 0
+ }
+ if (belong === 'WXproduceCode' && this.WXform.orderstepqrcode.toString().length === 0) {
+ this.judgeIsScanningArr = []
+ this.countJudgeIsScanningInput = 0
+ }
+ const timenow = e.timeStamp
+ // console.log(timenow, 1)
+ // let flag = true
+ let flag = false
+ this.judgeIsScanningArr.push(timenow)
+ let i
+
+ for (i in this.judgeIsScanningArr) {
+ console.log(Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]))
+ // flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
+ if (Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1) {
+ this.countJudgeIsScanningInput++
+ }
+ if (this.countJudgeIsScanningInput >= 3) {
+ flag = true
+ }
+ if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
+ if (flag) {
+ console.log(flag, 1)
+ this.fnThrottle(this.enterNative, 500, 2000, belong)()
+ return
+ }
+ }
+ }
+
+ // // for (i in this.judgeIsScanningArr) {
+ // // console.log(i)
+ // // console.log( this.judgeIsScanningArr)
+ // console.log(Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]))
+ // if (Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 10) {
+ // this.countJudgeIsScanningInput++
+ // }
+ // if (this.countJudgeIsScanningInput > this.judgeIsScanningArr.length / 2) {
+ // flag = true
+ // }
+ // // flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
+ // // if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
+ // if (flag) {
+ // console.log(flag, 2)
+ // this.fnThrottle(this.enterNative, 500, 2000, belong)()
+ // return
+ // }
+ // // }
+ // // }
+ },
+ // 鍒ゆ柇鏄惁鏄壂鐮佹灙鎵爜
+ judgeIsScanning(e, belong) {
+ const timenow = e.timeStamp
+ let flag = true
+ this.judgeIsScanningArr.push(timenow)
+ let i
+ for (i in this.judgeIsScanningArr) {
+ flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
+ if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
+ if (flag) {
+ this.fnThrottle(this.enterNative, 500, 2000, belong)()
+ return
+ }
+ }
+ }
+ },
// 鎵爜閿洏鍥炶溅浜嬩欢
async enterNative(val, belong) {
- console.log(val, belong)
+ console.log(val, belong, 89898989)
// 寮�宸ワ細code="200" count=0
// 鎶ュ伐锛歝ode="200" count=1
// 鍙戞枡锛歝ode="200" count=2
@@ -1593,7 +1818,7 @@
// 鐢熶骇鐝粍涓嬫媺鏀瑰彉
usergroupChange(val) {
this.dialogForm.usergroupcode = val
- this.getUserTableData()
+ this.getMesOrderSelectUserZZ2()
},
// 鑾峰彇鑷埗鎶ュ伐鐢熶骇鐝粍涓嬫媺鍒楄〃
async getMesOrderStepReportSelectUserGroup() {
@@ -1604,6 +1829,11 @@
async getMesOrderSelectUserZZ() {
const { data: res } = await MesOrderSelectUser({ usercode: this.dialogForm.usergroupcode })
this.ZZuserArr = res
+ },
+ async getMesOrderSelectUserZZ2() {
+ const { data: res } = await MesOrderSelectUser({ usercode: '' })
+ this.ZZuserArr = res
+ await this.getUserTableData()
},
// 鑾峰彇鑷埗鐢熶骇璁惧涓嬫媺
async getMesOrderStepStartSelectEqp() {
@@ -1642,9 +1872,16 @@
item.isVisible = 0
item.number = number
})
+
+ this.ZZuserArr = [...this.ZZuserArr].filter(x => [...this.userTableData].every(y => y.usercode !== x.usercode))
+
+ this.$refs.tableDataRef.doLayout()
},
// 鐢ㄦ埛娣诲姞
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)
@@ -1652,6 +1889,11 @@
},
// 鐢ㄦ埛鍒楄〃鍒犻櫎
userDel(row) {
+ this.ZZuserArr.splice(0, 0, {
+ usercode: row.usercode,
+ username: row.username
+ })
+
this.userTableData.forEach((item, index) => {
if (item.number === row.number) {
this.userTableData.splice(index, 1)
@@ -1664,6 +1906,13 @@
if (row.usercode === '') {
return this.$message.info('浜哄憳鍚嶇О涓嶈兘涓虹┖锛�')
}
+
+ this.ZZuserArr.forEach((item, index) => {
+ if (item.usercode === row.usercode) {
+ this.ZZuserArr.splice(index, 1)
+ }
+ })
+
this.userTableData.forEach(item => {
if (item.number === row.number) {
item.isVisible = 0
@@ -1694,6 +1943,11 @@
},
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
+ this.judgeIsScanningArr = []
+ this.form.orderstepqrcode = ''
+ this.WXform.orderstepqrcode = ''
+ this.badForm.orderstepqrcode = ''
+
this.dialogForm.wo_code = '', // 宸ュ崟缂栧彿
this.dialogForm.partcode = '', // 浜у搧缂栫爜
this.dialogForm.partname = '', // 浜у搧鍚嶇О
@@ -1713,7 +1967,7 @@
this.dialogForm.taskqty = '', // 浠诲姟鏁伴噺
this.dialogForm.fqty = '', // 鍙戞枡鏁伴噺
- this.dialogForm.inuser = '', // 鏀舵枡浜哄憳
+ this.dialogForm.inuser = getCookie('navTabId'), // 鏀舵枡浜哄憳 榛樿鐧诲綍浜哄憳
this.dialogForm.sqty = '', // 鏀舵枡鏁伴噺
this.dialogForm.ngqty = '', // 涓嶈壇鏁伴噺
this.dialogForm.badcode = '', // 涓嶈壇鍘熷洜缂栫爜
@@ -1730,7 +1984,7 @@
this.dialogForm.nextstepcode = '' // 涓嬮亾宸ュ簭缂栫爜
this.dialogForm.remarks = '' // 澶囨敞
-
+ this.dialogForm.operation = getCookie('navTabId') // 鎶ュ伐浜猴紙鏀舵枡浜猴級
this.userTableData = [] // 浜哄憳鍒楄〃
this.$refs.dialogForm.clearValidate()
@@ -1758,11 +2012,13 @@
taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
fqty: this.dialogForm.fqty // 鍙戞枡鏁伴噺
}
+ this.$store.state.app.buttonIsDisabled = true
SavaMesOrderStepOut(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 {
this.$message.error('鍙戞枡澶辫触!')
}
@@ -1793,16 +2049,17 @@
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('鏀舵枡鎴愬姛锛�')
this.dialogVisible = false
-
- if (this.dialogForm.nextstepcode !== '') {
- this.WXprint2()
+ this.$message.success('鏀舵枡鎴愬姛锛�')
+ if (this.dialogForm.nextstepcode === '') {
+ this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
this.dialogVisible2 = true
}
this.tabClick()
+ this.$store.state.app.buttonIsDisabled = false
} else {
this.$message.error('鏀舵枡澶辫触!')
}
@@ -1819,11 +2076,13 @@
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 {
this.$message.error('寮�宸ュけ璐�!')
}
@@ -1868,18 +2127,17 @@
ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
}
-
+ this.$store.state.app.buttonIsDisabled = true
SavaMesOrderStepReport(data).then(res => {
if (res.code === '200') {
- this.$message.success('鎶ュ伐鎴愬姛锛�')
this.dialogVisible = false
-
- console.log(this.dialogForm.nextstepcode, 1)
- if (this.dialogForm.nextstepcode !== '') {
- this.ZZprint2()
+ this.$message.success('鎶ュ伐鎴愬姛锛�')
+ if (this.dialogForm.nextstepcode === '') {
+ this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
this.dialogVisible2 = true
}
this.tabClick()
+ this.$store.state.app.buttonIsDisabled = false
} else {
this.$message.error('鎶ュ伐澶辫触!')
}
@@ -1901,27 +2159,27 @@
correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
})
},
- ZZprint2() {
+ ZZprint2(username) {
this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
this.qrForm.startqty = this.dialogForm.startqty
this.qrForm.wo_code = this.dialogForm.wo_code
this.qrForm.partcode = this.dialogForm.partcode
this.qrForm.partname = this.dialogForm.partname
this.qrForm.nextstepname = this.dialogForm.nextstepname
- this.qrForm.operator = getCookie('username')
+ this.qrForm.operator = username
this.qrForm.operatorTime = handleDatetime2(new Date())
this.$nextTick(() => {
this.bindQRCode(this.qrForm.qrvalue)
})
},
- WXprint2() {
+ WXprint2(username) {
this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
this.qrForm.startqty = this.dialogForm.sqty
this.qrForm.wo_code = this.dialogForm.wo_code
this.qrForm.partcode = this.dialogForm.partcode
this.qrForm.partname = this.dialogForm.partname
this.qrForm.nextstepname = this.dialogForm.nextstepname
- this.qrForm.operator = getCookie('username')
+ this.qrForm.operator = username
this.qrForm.operatorTime = handleDatetime2(new Date())
this.$nextTick(() => {
this.bindQRCode(this.qrForm.qrvalue)
@@ -1948,6 +2206,7 @@
if (window.innerHeight < 769) {
this.tableHeight = this.tableHeight - 50
}
+ this.$refs.tableDataRef.doLayout()
})
},
@@ -1964,13 +2223,16 @@
const data = {
Data: this.badTableDataDialog
}
+ this.$store.state.app.buttonIsDisabled = true
EditOrderNgStepSeave(data, this.badDialogForm.operation).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.dialogVisible2 = true
- return this.$message.success('淇濆瓨鎴愬姛锛�')
+ this.$message.success('淇濆瓨鎴愬姛锛�')
+
+ this.$store.state.app.buttonIsDisabled = false
}
})
},
@@ -1983,7 +2245,7 @@
this.qrForm.nextstepname = this.badDialogForm.nextstepname
this.qrForm.operator = username
this.qrForm.operatorTime = handleDatetime2(new Date())
- console.log(this.qrForm, 22)
+
this.$nextTick(() => {
this.bindQRCode(this.qrForm.qrvalue)
})
@@ -1993,13 +2255,14 @@
this.badDialogForm = {}
this.badDialogForm.operation = getCookie('navTabId')
this.badTableDataDialog = []
+ this.judgeIsScanningArr = []
+ },
+ async getMesOrderSelectUserAll() {
+ const { data: res } = await MesOrderSelectUser({ usercode: '' })
+ this.OperationArr = res
},
// 鐐瑰嚮缁翠慨澶勭悊鎸夐挳 鎴� 鎵弿鏉$爜鐨勬壂鎻忓洖杞︿簨浠�
async repairHandle(row) {
- const { data: res1 } = await MesOrderSelectUser({ usercode: '' })
- this.OperationArr = res1
-
- console.log(row)
let data
if (row.wo_code) {
data = {
@@ -2065,10 +2328,6 @@
})
},
badSave(row) {
- console.log(row, 1)
- // console.log(parseFloat(row.bad_qty) + parseFloat(row.repair_qty), 2)
- // console.log(parseFloat(row.ng_qty), 2)
- // console.log(parseFloat(row.bad_qty) + parseFloat(row.repair_qty) > parseFloat(row.ng_qty), 2)
if (parseFloat(row.bad_qty) + parseFloat(row.repair_qty) > parseFloat(row.ng_qty)) {
this.badCancel(row)
return this.$message.info('缁翠慨鏁伴噺涓庢姤搴熸暟閲忎箣鍜屼笉鑳藉ぇ浜庝笉鑹暟閲忥紒')
@@ -2076,8 +2335,8 @@
this.badTableDataDialog.forEach((item, index) => {
if (item.id === row.id && item.m_id === row.m_id) {
this.badTableDataDialog.splice(index, 1, {
- bad_qty: row.bad_qty,
- repair_qty: row.repair_qty,
+ bad_qty: parseFloat(row.bad_qty),
+ repair_qty: parseFloat(row.repair_qty),
isVisible: 0,
defect_code: row.defect_code,
defect_name: row.defect_name,
@@ -2281,6 +2540,15 @@
margin-bottom: 0;
}
+.tableFixed {
+ ::v-deep .el-table__fixed-right {
+ height: 100% !important;
+ }
+
+ ::v-deep .el-table__fixed {
+ height: 100% !important;
+ }
+}
</style>
<style>
--
Gitblit v1.9.3