From 1d739783b70e11e964d86a882b00c20d2e000997 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 29 八月 2022 10:20:06 +0800
Subject: [PATCH] 1.修改top5从顶部开始排列
---
src/views/scgl/sckbg.vue | 251 ++++++++++++++++++++++++++++++++++----------------
1 files changed, 170 insertions(+), 81 deletions(-)
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index b5cc98d..2641e18 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -62,7 +62,7 @@
prop="status"
label="鐘舵��"
sortable="custom"
- width="110"
+ width="80"
>
<template slot-scope="{row}">
<div v-if="row.status==='NEW'">鏂拌鍗�</div>
@@ -74,7 +74,8 @@
<el-table-column
prop="wo_code"
label="宸ュ崟鍙�"
- min-width="160"
+ width="160"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
@@ -85,14 +86,16 @@
/>
<el-table-column
prop="partname"
- min-width="160"
+ width="160"
+ show-tooltip-when-overflow
label="浜у搧鍚嶇О"
sortable="custom"
/>
<el-table-column
prop="stepname"
label="宸ュ簭"
- min-width="80"
+ show-tooltip-when-overflow
+ width="120"
sortable="custom"
/>
<!-- <el-table-column-->
@@ -142,18 +145,23 @@
<el-table-column
prop="plan_startdate"
label="璁″垝寮�宸ユ棩鏈�"
- width="185"
+ width="150"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <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="璁″垝瀹屽伐鏃ユ湡"
- width="185"
+ width="150"
sortable="custom"
fixed="right"
>
<template slot-scope="{row}">
- <div v-if="row.plan_startdate">{{ row.plan_startdate }}</div>
+ <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
<div v-else>/</div>
</template>
</el-table-column>
@@ -254,7 +262,7 @@
prop="status"
label="鐘舵��"
sortable="custom"
- width="110"
+ width="80"
>
<template slot-scope="{row}">
<div v-if="row.status==='NEW'">鏂拌鍗�</div>
@@ -266,25 +274,27 @@
<el-table-column
prop="wo_code"
label="宸ュ崟鍙�"
- min-width="160"
+ width="160"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
prop="partcode"
label="浜у搧缂栫爜"
- min-width="110"
+ width="110"
sortable="custom"
/>
<el-table-column
prop="partname"
label="浜у搧鍚嶇О"
- min-width="160"
+ width="160"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
prop="stepname"
label="宸ュ簭"
- min-width="80"
+ width="120"
sortable="custom"
/>
<!-- <el-table-column-->
@@ -334,18 +344,23 @@
<el-table-column
prop="plan_startdate"
label="璁″垝寮�宸ユ棩鏈�"
- width="185"
+ width="150"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <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="璁″垝瀹屽伐鏃ユ湡"
- width="185"
+ width="150"
sortable="custom"
fixed="right"
>
<template slot-scope="{row}">
- <div v-if="row.plan_startdate">{{ row.plan_startdate }}</div>
+ <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div>
<div v-else>/</div>
</template>
</el-table-column>
@@ -407,7 +422,6 @@
label="搴忓彿"
fixed
/>
-
<el-table-column
prop="wo_code"
label="宸ュ崟鍙�"
@@ -429,13 +443,13 @@
<el-table-column
prop="stepname"
label="宸ュ簭"
- min-width="80"
+ min-width="120"
sortable="custom"
/>
<el-table-column
prop="plan_qty"
label="浠诲姟鏁伴噺"
- min-width="110"
+ width="110"
sortable="custom"
/>
<el-table-column
@@ -447,13 +461,13 @@
<el-table-column
prop="ng_qty"
label="涓嶈壇鏁伴噺"
- min-width="150"
+ width="150"
sortable="custom"
/>
<el-table-column
prop="bad_qty"
label="宸叉姤搴熸暟閲�"
- min-width="120"
+ width="120"
sortable="custom"
/>
<el-table-column
@@ -614,6 +628,26 @@
:value="item.code"
/>
</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-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;" /> 浜哄憳鍒楄〃
@@ -812,7 +846,23 @@
/>
</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">
@@ -825,7 +875,7 @@
</span>
</el-dialog>
- <!--鎵撳嵃棰勮椤甸潰-->
+ <!--鎵撳嵃棰勮椤甸潰 灏忔爣绛�-->
<el-dialog
title="棰勮"
:visible.sync="dialogVisible2"
@@ -837,43 +887,54 @@
<!-- 瑕佹墦鍗扮殑鍖哄煙 -->
<div id="printMe2" style="padding: 30px;">
<div
- style="display: flex;width: 250px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
+ style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
>
- <div style="width: 60px;display: flex;flex-direction: column;border-right: 1px solid #000">
+ <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
<div
- style="display: flex;height: 75%;border-bottom:1px solid #000;justify-content: center;align-items: center "
+ style="display: flex;height: 90px;border-bottom:1px solid #000;
+ justify-content: center;align-items: center;position: relative"
>
- <div id="qrCode2" ref="qrCodeDiv2" />
+ <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
</div>
- <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center">
- <div style="margin-left: 5px;width: 40px">鏁伴噺:</div>
+ <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>
+ <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
+ <div style="margin-left: 5px;width: 42px">澶勭悊浜�:</div>
+ {{ qrForm.operator }}
</div>
</div>
<div style="width:190px;display: flex;flex-direction: column">
<div
- style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
+ style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
>
<div style="width: 60px;margin-left: 5px;">宸ュ崟缂栧彿:</div>
<div>{{ qrForm.wo_code }}</div>
</div>
<div
- style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
+ style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
>
<div style="width: 60px;margin-left: 5px;">浜у搧缂栫爜:</div>
<div>{{ qrForm.partcode }}</div>
</div>
<div
- style="display: flex;height: 25%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
+ style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
>
<div style="width:60px;margin-left: 5px;">浜у搧鍚嶇О:</div>
<div>{{ qrForm.partname }}</div>
</div>
- <div style="display: flex;height: 25%;justify-content: flex-start;align-items: center;text-align: left">
- <div style="width: 60px;margin-left: 5px;">涓嬮亾宸ュ簭:</div>
+ <div
+ style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
+ >
+ <div style="width:60px;margin-left: 5px;">涓嬮亾宸ュ簭:</div>
<div>{{ qrForm.nextstepname }}</div>
+ </div>
+ <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
+ <div style="width: 60px;margin-left: 5px;">澶勭悊鏃堕棿:</div>
+ <div>{{ qrForm.operatorTime }}</div>
</div>
</div>
@@ -930,6 +991,21 @@
</el-form-item>
<el-form-item label="涓嶈壇鏁伴噺锛�">
<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>
@@ -1060,6 +1136,8 @@
} from '@/api/scgl'
import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
import QRCode from 'qrcodejs2'
+import { getCookie } from '@/utils/auth'
+import { handleDatetime2 } from '@/utils/global'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -1152,7 +1230,10 @@
usergroupcode: '', // 鐝粍缂栫爜
reportuser: '', // 鎶ュ伐浜哄憳
- startqtySum: '' // 涓嶈兘瓒呰繃鐨勬暟鍊�
+ startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
+
+ operation: getCookie('navTabId'), // 鎶ュ伐浜猴紙鏀舵枡浜猴級
+ remarks: ''// 澶囨敞
},
ZZuserArr: [], // 鑷埗鐢ㄦ埛鎵�鏈�
@@ -1240,8 +1321,11 @@
badTableData: [], // 涓嶈壇澶勭悊鍒楄〃table鏁版嵁
badTotal: 0,
badDialogVisible: false,
- badDialogForm: {},
- badTableDataDialog: []// 涓嶈壇瀵硅瘽妗唗able琛ㄦ牸
+ badDialogForm: {
+ operation: getCookie('navTabId')
+ },
+ badTableDataDialog: [], // 涓嶈壇瀵硅瘽妗唗able琛ㄦ牸
+ OperationArr: [] // 浜哄憳鏁扮粍
}
},
// computed: {
@@ -1272,6 +1356,8 @@
})
// webapp_urlprotocol_startup()
// webapp_ws_autoupdate(true)
+
+ this.getMesOrderSelectUserAll() // 鑾峰彇鎵�鏈変汉鍛�
},
methods: {
tableRowClassName({ row, rowIndex }) {
@@ -1461,13 +1547,8 @@
// this.dialogForm.startqty = obj.startqty
this.dialogForm.startqty = obj.noreportqty
- if (obj.nextstepname === null || obj.nextstepcode === '') {
- this.dialogForm.nextstepname = obj.stepname
- this.dialogForm.nextstepcode = obj.stepcode
- } else {
- this.dialogForm.nextstepname = obj.nextstepname
- this.dialogForm.nextstepcode = obj.nextstepcode
- }
+ this.dialogForm.nextstepname = obj.nextstepname
+ this.dialogForm.nextstepcode = obj.nextstepcode
this.dialogForm.startqtySum = obj.noreportqty
})
@@ -1526,13 +1607,10 @@
this.dialogForm.reportqty = obj.reportqty
this.dialogForm.noreportqty = obj.noreportqty
this.dialogForm.stepcode = obj.stepcode
- if (obj.nextstepname === null || obj.nextstepcode === '') {
- this.dialogForm.nextstepname = obj.stepname
- this.dialogForm.nextstepcode = obj.stepcode
- } else {
- this.dialogForm.nextstepname = obj.nextstepname
- this.dialogForm.nextstepcode = obj.nextstepcode
- }
+
+ this.dialogForm.nextstepname = obj.nextstepname
+ this.dialogForm.nextstepcode = obj.nextstepcode
+
this.dialogForm.noputqty = obj.noputqty
this.dialogForm.stepseq = obj.seq
this.dialogForm.sqty = obj.startqty
@@ -1682,6 +1760,8 @@
this.dialogForm.nextstepcode = '' // 涓嬮亾宸ュ簭缂栫爜
+ this.dialogForm.remarks = '' // 澶囨敞
+ this.dialogForm.operation = getCookie('navTabId') // 鎶ュ伐浜猴紙鏀舵枡浜猴級
this.userTableData = [] // 浜哄憳鍒楄〃
this.$refs.dialogForm.clearValidate()
@@ -1740,18 +1820,19 @@
inuser: this.dialogForm.inuser, // 鍙戞枡浜哄憳
taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
sqty: this.dialogForm.sqty, // 鏀舵枡鏁伴噺
+ remarks: this.dialogForm.remarks, // 澶囨敞
ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
}
SavaMesOrderStepIn(data).then(res => {
if (res.code === '200') {
this.$message.success('鏀舵枡鎴愬姛锛�')
- this.dialogVisible = false
if (this.dialogForm.nextstepcode !== '') {
- this.WXprint2()
+ this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
+ this.dialogVisible2 = true
}
- this.dialogVisible2 = true
+ this.dialogVisible = false
this.tabClick()
} else {
this.$message.error('鏀舵枡澶辫触!')
@@ -1814,6 +1895,7 @@
startqty: this.dialogForm.reportqty, // 寮�宸ユ暟閲�
// reportqty: this.dialogForm.reportqty, // 鎶ュ伐鏁伴噺
reportqty: this.dialogForm.startqty, // 鎶ュ伐鏁伴噺
+ remarks: this.dialogForm.remarks, // 澶囨敞
ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
}
@@ -1821,13 +1903,13 @@
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.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
+ this.dialogVisible2 = true
}
- this.dialogVisible2 = true
+ this.dialogVisible = false
this.tabClick()
} else {
this.$message.error('鎶ュ伐澶辫触!')
@@ -1841,35 +1923,37 @@
bindQRCode(text) {
new QRCode(this.$refs.qrCodeDiv2, {
text: text,
- width: 50,
- height: 50,
+ // width: 50,
+ width: 60,
+ // height: 50,
+ height: 60,
colorDark: '#000', // 浜岀淮鐮侀鑹�
colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
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 = username
+ this.qrForm.operatorTime = handleDatetime2(new Date())
this.$nextTick(() => {
this.bindQRCode(this.qrForm.qrvalue)
- console.log(this.$refs.qrCodeDiv2, 123)
- // console.log(this.$refs.qrCodeDiv2.querySelectorAll('#qrCode2>img'), 1)
- // console.log(this.$refs.qrCodeDiv2.querySelectorAll('#qrCode2>canvas'), 2)
})
},
- 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 = username
+ this.qrForm.operatorTime = handleDatetime2(new Date())
this.$nextTick(() => {
this.bindQRCode(this.qrForm.qrvalue)
})
@@ -1881,7 +1965,9 @@
this.qrForm.partcode = ''
this.qrForm.partname = ''
this.qrForm.nextstepname = ''
- this.$refs.qrCodeDiv2 = ''
+ this.qrForm.operator = ''
+ this.qrForm.operatorTime = ''
+ // this.$refs.qrCodeDiv2 = ''
},
// 鑾峰彇椤甸潰楂樺害
@@ -1909,25 +1995,26 @@
const data = {
Data: this.badTableDataDialog
}
- // console.log(JSON.stringify(data), 1)
- // this.badPrint()
- // this.dialogVisible2 = true
-
- EditOrderNgStepSeave(data).then(res => {
+ 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('淇濆瓨鎴愬姛锛�')
}
})
},
- badPrint() {
+ badPrint(username) {
this.qrForm.qrvalue = this.badDialogForm.wo_code + ';' + this.badDialogForm.nextstepcode
this.qrForm.startqty = this.badDialogForm.plan_qty
this.qrForm.wo_code = this.badDialogForm.wo_code
this.qrForm.partcode = this.badDialogForm.partcode
this.qrForm.partname = this.badDialogForm.partname
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)
})
@@ -1935,11 +2022,15 @@
handleCloseBad() {
this.badDialogForm = {}
+ this.badDialogForm.operation = getCookie('navTabId')
this.badTableDataDialog = []
},
- // 鐐瑰嚮缁翠慨澶勭悊鎸夐挳
+ async getMesOrderSelectUserAll() {
+ const { data: res } = await MesOrderSelectUser({ usercode: '' })
+ this.OperationArr = res
+ },
+ // 鐐瑰嚮缁翠慨澶勭悊鎸夐挳 鎴� 鎵弿鏉$爜鐨勬壂鎻忓洖杞︿簨浠�
async repairHandle(row) {
- console.log(row)
let data
if (row.wo_code) {
data = {
@@ -1971,6 +2062,8 @@
item.repair_qty = 0
item.bad_qty = 0
item.isVisible = 0
+ // item.defect_code = [...new Set(item.defect_code.split(','))].join(',')
+ // item.defect_name = [...new Set(item.defect_name.split(','))].join(',')
})
console.log(this.badTableDataDialog, 321)
this.badDialogVisible = true
@@ -2003,10 +2096,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('缁翠慨鏁伴噺涓庢姤搴熸暟閲忎箣鍜屼笉鑳藉ぇ浜庝笉鑹暟閲忥紒')
@@ -2014,8 +2103,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,
--
Gitblit v1.9.3