This commit is contained in:
helloDy 2024-04-22 09:43:02 +08:00
parent 4d87bcbd5b
commit 3e7ba1f519
14 changed files with 458 additions and 57 deletions

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-20 11:05:00 * @Date: 2023-11-20 11:05:00
* @LastEditTime: 2024-01-29 16:51:45 * @LastEditTime: 2024-04-22 09:03:11
* @LastEditors: DY * @LastEditors: DY
* @Description: 质量和报废 * @Description: 质量和报废
*/ */
@ -70,6 +70,15 @@ export function createInspection (data) {
}) })
} }
// 撤销质量检查信息
export function deleteByCancel (query) {
return request({
url: '/base/quality-inspection-record/deleteByCancel',
method: 'delete',
params: query
})
}
// 获得所有报废日志列表 // 获得所有报废日志列表
export function scrapLogList (data) { export function scrapLogList (data) {
return request({ return request({
@ -87,3 +96,12 @@ export function authList (data) {
params: data params: data
}) })
} }
// 重置按钮
export function resetBtn (data) {
return request({
url: '/base/quality-inspection-record/resetBtn',
method: 'get',
params: data
})
}

BIN
src/assets/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/cancel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

BIN
src/assets/cancel1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/cancel2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/refresh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

BIN
src/assets/reset.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-20 11:02:29 * @Date: 2023-11-20 11:02:29
* @LastEditTime: 2024-01-30 14:45:55 * @LastEditTime: 2024-04-22 09:39:49
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -14,7 +14,8 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
const service = axios.create({ const service = axios.create({
baseURL: 'http://192.168.0.33:48082/admin-api', baseURL: 'http://192.168.0.33:48082/admin-api',
// baseURL: 'http://10.70.2.2:8080/admin-api', // baseURL: 'http://192.168.1.104:48082/admin-api',
// baseURL: 'http://192.168.1.78:48082/admin-api',
timeout: 30000, timeout: 30000,
withCredentials: false withCredentials: false
}) })

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-12-28 11:21:53 * @Date: 2023-12-28 11:21:53
* @LastEditTime: 2024-01-31 10:38:46 * @LastEditTime: 2024-04-10 11:10:56
* @LastEditors: DY * @LastEditors: DY
* @Description: 登陆 * @Description: 登陆
--> -->
<template> <template>
<div class="login"> <div class="login">
<van-row style="width: 100%; height: 40px; padding-top: 5px" type="flex" justify="space-between"> <van-row style="width: 100%; height: 15px; padding-top: 5px" type="flex" justify="space-between">
<van-col span="20"></van-col> <van-col span="20"></van-col>
<van-col span="4" style="text-align: right"> <van-col span="4" style="text-align: right">
<img class="homeIcon" @click="goback" src="./../assets/back.png" alt=""> <img class="homeIcon" @click="goback" src="./../assets/back.png" alt="">

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2024-01-09 13:48:42 * @Date: 2024-01-09 13:48:42
* @LastEditTime: 2024-03-28 11:13:01 * @LastEditTime: 2024-04-22 09:33:28
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -15,7 +15,7 @@
<img class="homeIcon" @click="toHome" src="./../assets/home.png" alt=""> <img class="homeIcon" @click="toHome" src="./../assets/home.png" alt="">
</van-col> </van-col>
</van-row> </van-row>
<van-row gutter="20" style="margin-top: -20px;"> <van-row gutter="10" style="margin-top: -20px;">
<van-col span="12"> <van-col span="12">
<van-dropdown-menu > <van-dropdown-menu >
<van-dropdown-item v-model="listQuery.productionLineId" :options="lineArray" @change="getSection" /> <van-dropdown-item v-model="listQuery.productionLineId" :options="lineArray" @change="getSection" />
@ -27,9 +27,38 @@
</van-dropdown-menu> </van-dropdown-menu>
</van-col> </van-col>
</van-row> </van-row>
<div class="count"> <!-- <div class="count"> -->
本班次合计数量{{ count }} <van-row gutter="10">
<van-col span="12">
<div class="count">本班次合计数量{{ count }}</div>
</van-col>
<van-col span="12">
<van-row gutter="10" style="font-size: 9px">
<van-col span="8">
<div class="count" @click="getQuality">
<img style="width: 15px; height: 15px" src="./../assets/refresh.png" alt="">
<span style="margin-left: 10px"> </span>
</div> </div>
</van-col>
<van-col span="8">
<div class="count" :style="[{ background: isCancel ? '#FFA927' : '#FFFFFF' }]" @click="isCancel = !isCancel">
<img style="width: 15px; height: 15px" src="./../assets/cancel.png" alt="">
<span style="margin-left: 10px"> </span>
</div>
</van-col>
<van-col span="8">
<div v-show="showReset" class="count" @click="reset">
<img style="width: 15px; height: 15px" src="./../assets/reset.png" alt="">
<span style="margin-left: 10px"> </span>
</div>
</van-col>
</van-row>
</van-col>
</van-row>
<el-scrollbar class="scollbar" ref="scrollbar" style="height: 100%" >
<el-backtop target=".scollbar .el-scrollbar__wrap" :visibility-height="10" :bottom="20">
<i class="el-icon-caret-top" />
</el-backtop>
<div class="content" v-for="(item, index) in typeList" :key="index"> <div class="content" v-for="(item, index) in typeList" :key="index">
<van-row type="flex" align="center" style="margin-left: -20px"> <van-row type="flex" align="center" style="margin-left: -20px">
<van-col span="1"> <van-col span="1">
@ -41,7 +70,8 @@
</van-row> </van-row>
<van-row type="flex"> <van-row type="flex">
<van-col span="6" v-for="it in item" :key="it.id"> <van-col span="6" v-for="it in item" :key="it.id">
<div :class=" it.active ? 'flexActive' : 'flexItem'"> <div :class=" isCancel ? 'flexCancelItem' : 'flexItem'">
<!-- <div class="flexItem"> -->
<!-- <div> --> <!-- <div> -->
<div class="contain"> <div class="contain">
<div class="leftDiv">{{ it.count }}</div> <div class="leftDiv">{{ it.count }}</div>
@ -54,6 +84,7 @@
</van-col> </van-col>
</van-row> </van-row>
</div> </div>
</el-scrollbar>
<!-- <div class="ext"></div> --> <!-- <div class="ext"></div> -->
<!-- <el-backtop target=".quality" :visibility-height="10" :bottom="10"> <!-- <el-backtop target=".quality" :visibility-height="10" :bottom="10">
<i class="el-icon-caret-top" /> <i class="el-icon-caret-top" />
@ -62,13 +93,14 @@
</template> </template>
<script> <script>
import { qualityManage, createInspection, authList } from '@/api/quality' import { qualityManage, createInspection, deleteByCancel, authList, resetBtn } from '@/api/quality'
import { getUserId } from '@/utils/auth' import { getUserId } from '@/utils/auth'
export default { export default {
name: 'Quality', name: 'Quality',
data () { data () {
return { return {
isCancel: false,
lineArray: [], lineArray: [],
sectionArray: [], sectionArray: [],
listQuery: { listQuery: {
@ -76,34 +108,75 @@ export default {
sectionId: '' sectionId: ''
}, },
count: 0, count: 0,
typeList: [] typeList: [],
showReset: false
} }
}, },
mounted () { mounted () {
this.getLine() this.getLine()
}, },
methods: { methods: {
reset () {
resetBtn(this.listQuery).then(res => {
if (res.data.data === true) {
this.typeList.forEach(item => {
item.forEach(it => {
it.count = 0
})
})
this.count = 0
this.$message.success('重置完成!')
} else {
this.typeList = []
this.count = 0
}
})
},
addRecord (value) { addRecord (value) {
const now = new Date() // Date const now = new Date() // Date
const formattedTime = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')} ${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}` const formattedTime = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')} ${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`
// console.log(formattedTime) // console.log(formattedTime)
if (!this.isCancel) {
createInspection({ createInspection({
...this.listQuery, ...this.listQuery,
inspectionDetId: value.detId, inspectionDetId: value.detId,
checkTime: formattedTime checkTime: formattedTime
}).then(res => { }).then(res => {
if (res.data.code === 0) { if (res.data.code === 0) {
this.typeList.forEach(element => { // this.typeList.forEach(element => {
element.forEach(el => { // element.forEach(el => {
el.active = false // el.active = false
}) // })
}) // })
value.active = true // value.active = true
// this.$set(value, 'active', true) // this.$set(value, 'active', true)
value.count++ value.count++
this.count++ this.count++
} }
}) })
} else {
if (value.count > 0) {
deleteByCancel({
...this.listQuery,
inspectionDetId: value.detId,
checkTime: formattedTime
}).then(res => {
if (res.data.code === 0) {
// this.typeList.forEach(element => {
// element.forEach(el => {
// el.active = false
// })
// })
// value.active = true
// this.$set(value, 'active', true)
value.count--
this.count--
}
})
} else {
this.$message.warning('数量小于0不可操作')
}
}
}, },
toHome () { toHome () {
this.$router.push({ this.$router.push({
@ -111,10 +184,14 @@ export default {
}) })
}, },
getQuality () { getQuality () {
// qualityManage().then(res => {
qualityManage(this.listQuery).then(res => { qualityManage(this.listQuery).then(res => {
if (JSON.stringify(res.data.data) !== '{}') { if (JSON.stringify(res.data.data) !== '{}') {
this.typeList = Object.values(res.data.data) this.typeList = Object.values(res.data.data)
this.count = this.typeList[0][0].sunCount this.count = this.typeList[0][0].sunCount
if (this.typeList[0][0]?.resetMethod === 1) {
this.resetMethod = true
}
} else { } else {
this.typeList = [] this.typeList = []
this.count = 0 this.count = 0
@ -173,7 +250,27 @@ export default {
width: 226px; width: 226px;
line-height: 72px; line-height: 72px;
box-shadow: 5px 6px 8px 0px rgba(206,212,226,0.72), inset 6px 0px 6px 0px #FFFFFF; box-shadow: 5px 6px 8px 0px rgba(206,212,226,0.72), inset 6px 0px 6px 0px #FFFFFF;
background-color: #FFFFFF; /* background-color: #FFFFFF; */
background-image: url('./../assets/2.png');
background-size: 100%;
}
.flexItem:active {
background-image: url('./../assets/1.png');
background-size: cover;
}
.flexCancelItem {
display: flex;
margin-right: 20px;
width: 226px;
line-height: 72px;
box-shadow: 5px 6px 8px 0px rgba(206,212,226,0.72), inset 6px 0px 6px 0px #FFFFFF;
/* background-color: #FFFFFF; */
background-image: url('./../assets/cancel1.png');
background-size: 100%;
}
.flexCancelItem:active {
background-image: url('./../assets/cancel2.png');
background-size: cover;
} }
.flexActive { .flexActive {
display: flex; display: flex;
@ -181,7 +278,9 @@ export default {
width: 226px; width: 226px;
line-height: 72px; line-height: 72px;
box-shadow: 5px 6px 8px 0px rgba(206,212,226,0.72), inset 6px 0px 6px 0px #FFFFFF; box-shadow: 5px 6px 8px 0px rgba(206,212,226,0.72), inset 6px 0px 6px 0px #FFFFFF;
background-color: #456DFF; /* background-color: #456DFF; */
background-image: url('./../assets/1.png');
background-size: cover;
} }
.rightDiv { .rightDiv {
border-radius: 7px; border-radius: 7px;
@ -209,12 +308,12 @@ export default {
height: 72px; height: 72px;
width: 80px; width: 80px;
line-height: 72px; line-height: 72px;
background-color: #FFFFFF; /* background-color: #FFFFFF; */
/* margin: 5px 0 5px 0; */ /* margin: 5px 0 5px 0; */
} }
.leftDiv { .leftDiv {
border-radius: 7px 36px 36px 7px; border-radius: 7px 36px 36px 7px;
background-color: #456DFF; /* background-color: #456DFF; */
height: 72px; height: 72px;
width: 77px; width: 77px;
color: white; color: white;
@ -240,6 +339,8 @@ export default {
margin-top: 7px; margin-top: 7px;
padding: 0 20px 20px 20px; padding: 0 20px 20px 20px;
box-sizing: border-box; box-sizing: border-box;
/* overflow: scroll;
height: 100%; */
} }
.count { .count {
width: 100%; width: 100%;
@ -265,7 +366,7 @@ export default {
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
padding: 20px 20px; padding: 20px 20px;
overflow: auto; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2024-01-09 13:49:03 * @Date: 2024-01-09 13:49:03
* @LastEditTime: 2024-03-29 08:46:18 * @LastEditTime: 2024-04-22 09:36:10
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -13,6 +13,10 @@
<div style="height: 60px;"> <div style="height: 60px;">
<h2>报废管理</h2> <h2>报废管理</h2>
</div> --> </div> -->
<!-- <van-row type="flex" class="search" justify="center">
<el-input v-model="form.data" @focus="onInputFocus('form.data',form.data)" ref="searchInput" placeholder="请输入关键词" >
</el-input>
</van-row> -->
<van-row type="flex" justify="space-between"> <van-row type="flex" justify="space-between">
<van-col span="5" style="text-align: left"> <van-col span="5" style="text-align: left">
<h2>报废管理</h2> <h2>报废管理</h2>
@ -178,6 +182,7 @@
:input="inputValue3" :input="inputValue3"
:maxLength="30" :maxLength="30"
/> />
<!-- <KeysInput ref="keysInput" @input="updateInputValue" /> -->
</div> </div>
</template> </template>
@ -185,11 +190,15 @@
import { workOrderList, scrapDetList, createScrap, authList } from '@/api/quality' import { workOrderList, scrapDetList, createScrap, authList } from '@/api/quality'
import SimpleKeyboard from './components/simpleKeyboard.vue' import SimpleKeyboard from './components/simpleKeyboard.vue'
import { getUserId } from '@/utils/auth' import { getUserId } from '@/utils/auth'
// import KeysInput from './components/keyboard'
export default { export default {
components: { SimpleKeyboard }, components: { SimpleKeyboard },
data () { data () {
return { return {
// form: {
// data: '11'
// },
ruleForm: { ruleForm: {
workOrderId: '', workOrderId: '',
num: '', num: '',
@ -293,6 +302,28 @@ export default {
} }
}, },
methods: { methods: {
onInputFocus (event, value) {
// input
console.log('122', event, value)
this.$refs.keysInput.showKeyboard = true
//
this.$refs.keysInput.key = event
//
this.$refs.keysInput.setKeyboardInput(value)
},
updateInputValue (value) {
console.log('123232', value)
// key input
const parameter = value.key.split('.')
console.log('122', parameter)
if (parameter.length === 1) {
value.key = value.value
} else {
// let par0 = parameter[0]
// let par1 = parameter[1]
// par0.par1 = value.value
}
},
refresh () { refresh () {
this.ruleForm.logTime = new Date().getTime() this.ruleForm.logTime = new Date().getTime()
}, },

View File

@ -0,0 +1,176 @@
<template>
<div :class="keyboardClass"></div>
</template>
<script>
import Keyboard from 'simple-keyboard'
import 'simple-keyboard/build/css/index.css'
import layout from 'simple-keyboard-layouts/build/layouts/chinese' //
export default {
name: 'SimpleKeyboard',
props: {
keyboardClass: {
default: 'simple-keyboard',
type: String
},
maxLength: { default: '' }
},
data: () => ({
keyboard: null,
displayDefault: {
'{bksp}': 'backspace',
'{lock}': '切换',
'{enter}': '> enter',
'{tab}': 'tab',
'{shift}': 'shift',
'{change}': '中文',
'{space}': ' ',
'{clear}': '清空',
'{close}': '关闭'
}
}),
mounted () {
this.keyboard = new Keyboard(this.keyboardClass, {
onChange: this.onChange,
onKeyPress: this.onKeyPress,
layoutCandidates: layout.layoutCandidates,
layout: {
//
default: [
'` 1 2 3 4 5 6 7 8 9 0 - = {bksp}',
'{tab} q w e r t y u i o p [ ] \\',
"{lock} a s d f g h j k l ; ' {enter}",
'{shift} z x c v b n m , . / {clear}',
'{change} {space} {close}'
],
// shift
shift: [
'~ ! @ # $ % ^ & * ( ) _ + {bksp}',
'{tab} Q W E R T Y U I O P { } |',
'{lock} A S D F G H J K L : " {enter}',
'{shift} Z X C V B N M < > ? {clear}',
'{change} {space} {close}'
]
},
//
display: this.displayDefault,
//
buttonTheme: [
{
class: 'hg-red close',
buttons: '{close}'
},
{
class: 'change',
buttons: '{change}'
}
],
//
maxLength: this.maxLength
})
},
methods: {
onChange (input) {
this.$emit('on-change', input) //
},
//
onChangeKey () {
this.keyboard.setInput('')
this.$emit('empty')
},
// @focus
onChangeFocus (value) {
this.keyboard.setInput(value)
},
//
onKeyPress (button, $event) {
//
if (button === '{close}') {
//
this.$parent.closekeyboard()
return false
} else if (button === '{change}') {
//
if (this.keyboard.options.layoutCandidates !== null) {
this.$set(this.displayDefault, '{change}', '英文')
//
this.keyboard.setOptions({
layoutCandidates: null,
display: this.displayDefault
})
} else {
//
this.$set(this.displayDefault, '{change}', '中文')
this.keyboard.setOptions({
layoutCandidates: layout.layoutCandidates,
display: this.displayDefault
})
}
} else if (button === '{clear}') {
this.onChangeKey()
} else {
const value = $event.target.offsetParent.parentElement.children[0].children[0].value
//
if (value) {
this.keyboard.setInput(value)
}
this.$emit('on-key-press', button)
}
if (button === '{shift}' || button === '{lock}') this.handleShift()
},
// shift/
handleShift () {
const currentLayout = this.keyboard.options.layoutName
const shiftToggle = currentLayout === 'default' ? 'shift' : 'default'
this.keyboard.setOptions({
layoutName: shiftToggle
})
}
}
}
</script>
<style lang="less"> //
@deep: ~'>>>';
.hg-candidate-box{
position: fixed;
width: 100%;
font-size: 42px;
background: rgba(256, 256, 256);
z-index: 9999;
.hg-candidate-box-list{
.hg-candidate-box-list-item{
padding: 0 20px;
}
}
}
.hg-rows{
width: 100% !important;
.hg-row {
height: 50px;
.hg-button{
height: 50px;
font-size: 30px;
}
}
}
.hg-theme-default {
width: 100%;
height: 400px;
left: 0;
position: fixed;
bottom: 10px;
.hg-button {
&.hg-red {
background: #3e87db;
color: white;
&.close {
max-width: 200px;
}
}
&.change {
max-width: 200px;
}
}
}
</style>

View File

@ -0,0 +1,74 @@
<!--
* @Author: Do not edit
* @Date: 2024-04-03 15:01:04
* @LastEditTime: 2024-04-07 15:14:39
* @LastEditors: DY
* @Description:
-->
<template>
<div>
<div v-show="showKeyboard" >
<SimpleKeyboard ref="refSimpleKeyboard" class="Keyboard" @onChange="onChangeKeyboard" @empty="empty" />
</div>
</div>
</template>
<script>
import SimpleKeyboard from './SKeyboard.vue'
export default {
name: 'Keyboard',
components: {
SimpleKeyboard
},
data () {
return {
showKeyboard: false, //
value: '',
key: ''
}
},
watch: {
key (val) {
this.key = val
if (this.showKeyboard) {
this.showKeyboard = false
setTimeout(() => {
this.showKeyboard = true
}, 100)
}
}
},
methods: {
// inpuit
onInputFocus (res) {
this.showKeyboard = true
},
//
onChangeKeyboard (input) {
this.$emit('input', { value: input, key: this.key })
},
//
closeInputFocus () {
this.showKeyboard = false
},
//
closekeyboard () {
this.showKeyboard = false
},
//
empty () {
this.$emit('input', { value: '', key: this.key })
},
//
setKeyboardInput (input) {
console.log('给虚拟键盘赋当前输入框的值', input)
this.$refs.refSimpleKeyboard.onChangeFocus(input)
}
}
}
</script>
<style lang="less" scoped>
//
.Keyboard{
position: absolute;
}
</style>