Compare commits
8 Commits
d290da2b80
...
zjl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e7ba1f519 | ||
|
|
4d87bcbd5b | ||
| 9f45efb1de | |||
| 890f9f4fb7 | |||
| d0ee6eb354 | |||
| 292b795bd1 | |||
| 0769e77c53 | |||
| 4ece565d5a |
14
package-lock.json
generated
@@ -11,7 +11,7 @@
|
||||
"axios": "^1.6.5",
|
||||
"core-js": "^3.8.3",
|
||||
"element-ui": "^2.15.14",
|
||||
"simple-keyboard": "^3.7.45",
|
||||
"simple-keyboard": "^3.7.47",
|
||||
"simple-keyboard-layouts": "^3.3.55",
|
||||
"vant": "^2.13.2",
|
||||
"vue": "^2.6.14",
|
||||
@@ -10891,9 +10891,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/simple-keyboard": {
|
||||
"version": "3.7.45",
|
||||
"resolved": "https://registry.npmmirror.com/simple-keyboard/-/simple-keyboard-3.7.45.tgz",
|
||||
"integrity": "sha512-53BSay9h99V8GuHvBmiUiNesG4oFwTJpMcE/nf3VXWYX95njPJeLdhDzgFljIITjZ6nKXe8E2Lp7OMArI+R/Cw=="
|
||||
"version": "3.7.47",
|
||||
"resolved": "https://registry.npmmirror.com/simple-keyboard/-/simple-keyboard-3.7.47.tgz",
|
||||
"integrity": "sha512-NwtNAJF0OEjT6Qyn22AgybJPkxEJVHL56NYA8z/4lyrDQAyC2SoNLHdFK1ugsmL27AS80Jk473rboC31roj/fQ=="
|
||||
},
|
||||
"node_modules/simple-keyboard-layouts": {
|
||||
"version": "3.3.55",
|
||||
@@ -21253,9 +21253,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"simple-keyboard": {
|
||||
"version": "3.7.45",
|
||||
"resolved": "https://registry.npmmirror.com/simple-keyboard/-/simple-keyboard-3.7.45.tgz",
|
||||
"integrity": "sha512-53BSay9h99V8GuHvBmiUiNesG4oFwTJpMcE/nf3VXWYX95njPJeLdhDzgFljIITjZ6nKXe8E2Lp7OMArI+R/Cw=="
|
||||
"version": "3.7.47",
|
||||
"resolved": "https://registry.npmmirror.com/simple-keyboard/-/simple-keyboard-3.7.47.tgz",
|
||||
"integrity": "sha512-NwtNAJF0OEjT6Qyn22AgybJPkxEJVHL56NYA8z/4lyrDQAyC2SoNLHdFK1ugsmL27AS80Jk473rboC31roj/fQ=="
|
||||
},
|
||||
"simple-keyboard-layouts": {
|
||||
"version": "3.3.55",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"axios": "^1.6.5",
|
||||
"core-js": "^3.8.3",
|
||||
"element-ui": "^2.15.14",
|
||||
"simple-keyboard": "^3.7.45",
|
||||
"simple-keyboard": "^3.7.47",
|
||||
"simple-keyboard-layouts": "^3.3.55",
|
||||
"vant": "^2.13.2",
|
||||
"vue": "^2.6.14",
|
||||
|
||||
16
src/App.vue
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-27 16:41:40
|
||||
* @LastEditTime: 2024-01-07 22:29:50
|
||||
* @LastEditTime: 2024-02-18 09:26:27
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -31,18 +31,6 @@ export default {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
nav {
|
||||
padding: 30px;
|
||||
|
||||
a {
|
||||
font-weight: bold;
|
||||
color: #2c3e50;
|
||||
|
||||
&.router-link-exact-active {
|
||||
color: #42b983;
|
||||
}
|
||||
}
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-20 11:05:00
|
||||
* @LastEditTime: 2024-01-29 16:51:45
|
||||
* @LastEditTime: 2024-04-22 09:03:11
|
||||
* @LastEditors: DY
|
||||
* @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) {
|
||||
return request({
|
||||
@@ -87,3 +96,12 @@ export function authList (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
|
After Width: | Height: | Size: 14 KiB |
BIN
src/assets/2.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
src/assets/cancel.png
Normal file
|
After Width: | Height: | Size: 374 B |
BIN
src/assets/cancel1.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/cancel2.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/form1.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/assets/form2.png
Normal file
|
After Width: | Height: | Size: 914 B |
BIN
src/assets/form3.png
Normal file
|
After Width: | Height: | Size: 673 B |
BIN
src/assets/form4.png
Normal file
|
After Width: | Height: | Size: 793 B |
BIN
src/assets/form5.png
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
src/assets/form6.png
Normal file
|
After Width: | Height: | Size: 918 B |
BIN
src/assets/form7.png
Normal file
|
After Width: | Height: | Size: 595 B |
BIN
src/assets/refresh.png
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
src/assets/reset.png
Normal file
|
After Width: | Height: | Size: 349 B |
BIN
src/assets/sub-right.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-27 16:41:40
|
||||
* @LastEditTime: 2024-01-09 17:50:38
|
||||
* @LastEditTime: 2024-03-28 10:45:26
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-20 11:02:29
|
||||
* @LastEditTime: 2024-01-30 14:45:55
|
||||
* @LastEditTime: 2024-04-22 09:39:49
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@@ -13,9 +13,9 @@ import { MessageBox } from 'element-ui'
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
||||
|
||||
const service = axios.create({
|
||||
// baseURL: 'http://192.168.1.20:48080',
|
||||
// baseURL: 'http://192.168.1.78:48082/admin-api',
|
||||
baseURL: 'http://192.168.0.33:48082/admin-api',
|
||||
// baseURL: 'http://192.168.1.104:48082/admin-api',
|
||||
// baseURL: 'http://192.168.1.78:48082/admin-api',
|
||||
timeout: 30000,
|
||||
withCredentials: false
|
||||
})
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-28 11:21:53
|
||||
* @LastEditTime: 2024-01-29 17:57:32
|
||||
* @LastEditTime: 2024-04-10 11:10:56
|
||||
* @LastEditors: DY
|
||||
* @Description: 登陆
|
||||
-->
|
||||
<template>
|
||||
<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="4" style="text-align: right">
|
||||
<img class="homeIcon" @click="goback" src="./../assets/back.png" alt="">
|
||||
@@ -195,6 +195,8 @@ export default {
|
||||
this.$router.push({
|
||||
path: 'home'
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-01-09 13:48:42
|
||||
* @LastEditTime: 2024-01-30 16:23:17
|
||||
* @LastEditTime: 2024-04-22 09:33:28
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -15,7 +15,7 @@
|
||||
<img class="homeIcon" @click="toHome" src="./../assets/home.png" alt="">
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row gutter="20" style="margin-top: -20px;">
|
||||
<van-row gutter="10" style="margin-top: -20px;">
|
||||
<van-col span="12">
|
||||
<van-dropdown-menu >
|
||||
<van-dropdown-item v-model="listQuery.productionLineId" :options="lineArray" @change="getSection" />
|
||||
@@ -27,44 +27,80 @@
|
||||
</van-dropdown-menu>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<div class="count">
|
||||
本班次合计数量:{{ count }}
|
||||
</div>
|
||||
<div class="content" v-for="(item, index) in typeList" :key="index">
|
||||
<van-row type="flex" align="center" style="margin-left: -20px">
|
||||
<van-col span="1">
|
||||
<img style="width: 20px; height: 20px;" src="./../assets/icon.png" alt="">
|
||||
</van-col>
|
||||
<van-col span="8">
|
||||
<p style="text-align: left; color: #276BFF">{{ item[0].typeName }}</p>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row type="flex">
|
||||
<van-col span="6" v-for="it in item" :key="it.id">
|
||||
<div :class=" it.active ? 'flexActive' : 'flexItem'">
|
||||
<!-- <div> -->
|
||||
<div class="contain">
|
||||
<div class="leftDiv">{{ it.count }}</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- <div> -->
|
||||
<div class="rightDiv" @click="addRecord(it)">{{ it.detContent }}</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</div>
|
||||
<!-- <div class="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>
|
||||
</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">
|
||||
<van-row type="flex" align="center" style="margin-left: -20px">
|
||||
<van-col span="1">
|
||||
<img style="width: 20px; height: 20px;" src="./../assets/icon.png" alt="">
|
||||
</van-col>
|
||||
<van-col span="8">
|
||||
<p style="text-align: left; color: #276BFF">{{ item[0].typeName }}</p>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row type="flex">
|
||||
<van-col span="6" v-for="it in item" :key="it.id">
|
||||
<div :class=" isCancel ? 'flexCancelItem' : 'flexItem'">
|
||||
<!-- <div class="flexItem"> -->
|
||||
<!-- <div> -->
|
||||
<div class="contain">
|
||||
<div class="leftDiv">{{ it.count }}</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- <div> -->
|
||||
<div class="rightDiv" @click="addRecord(it)">{{ it.detContent }}</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<!-- <div class="ext"></div> -->
|
||||
<!-- <el-backtop target=".quality" :visibility-height="10" :bottom="10">
|
||||
<i class="el-icon-caret-top" />
|
||||
</el-backtop> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { qualityManage, createInspection, authList } from '@/api/quality'
|
||||
import { qualityManage, createInspection, deleteByCancel, authList, resetBtn } from '@/api/quality'
|
||||
import { getUserId } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: 'Quality',
|
||||
data () {
|
||||
return {
|
||||
isCancel: false,
|
||||
lineArray: [],
|
||||
sectionArray: [],
|
||||
listQuery: {
|
||||
@@ -72,28 +108,75 @@ export default {
|
||||
sectionId: ''
|
||||
},
|
||||
count: 0,
|
||||
typeList: []
|
||||
typeList: [],
|
||||
showReset: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getLine()
|
||||
},
|
||||
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) {
|
||||
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')}`
|
||||
// console.log(formattedTime)
|
||||
createInspection({
|
||||
...this.listQuery,
|
||||
inspectionDetId: value.detId,
|
||||
checkTime: formattedTime
|
||||
}).then(res => {
|
||||
if (res.data.code === 0) {
|
||||
this.$set(value, 'active', true)
|
||||
value.count++
|
||||
this.count++
|
||||
if (!this.isCancel) {
|
||||
createInspection({
|
||||
...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 {
|
||||
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 () {
|
||||
this.$router.push({
|
||||
@@ -101,10 +184,14 @@ export default {
|
||||
})
|
||||
},
|
||||
getQuality () {
|
||||
// qualityManage().then(res => {
|
||||
qualityManage(this.listQuery).then(res => {
|
||||
if (JSON.stringify(res.data.data) !== '{}') {
|
||||
this.typeList = Object.values(res.data.data)
|
||||
this.count = this.typeList[0][0].sunCount
|
||||
if (this.typeList[0][0]?.resetMethod === 1) {
|
||||
this.resetMethod = true
|
||||
}
|
||||
} else {
|
||||
this.typeList = []
|
||||
this.count = 0
|
||||
@@ -113,8 +200,7 @@ export default {
|
||||
},
|
||||
getLine () {
|
||||
authList({ userId: getUserId() }).then(res => {
|
||||
console.log('res', res.data.data)
|
||||
if (res && res.data.data.datas.length > 0) {
|
||||
if (res && res?.data?.data?.datas?.length > 0) {
|
||||
this.lineArray = res.data.data.datas.map(item => {
|
||||
item.text = item.name
|
||||
item.value = item.id
|
||||
@@ -164,7 +250,27 @@ export default {
|
||||
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-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 {
|
||||
display: flex;
|
||||
@@ -172,18 +278,22 @@ export default {
|
||||
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: #276BFF;
|
||||
/* background-color: #456DFF; */
|
||||
background-image: url('./../assets/1.png');
|
||||
background-size: cover;
|
||||
}
|
||||
.rightDiv {
|
||||
border-radius: 7px;
|
||||
height: 72px;
|
||||
line-height: 36px;
|
||||
/* height: 72px; */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
line-height: 24px;
|
||||
width: 140px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
overflow: hidden;
|
||||
-webkit-line-clamp: 2;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-pack: center;
|
||||
/* text-align: justify; */
|
||||
@@ -198,14 +308,15 @@ export default {
|
||||
height: 72px;
|
||||
width: 80px;
|
||||
line-height: 72px;
|
||||
background-color: #FFFFFF;
|
||||
/* background-color: #FFFFFF; */
|
||||
/* margin: 5px 0 5px 0; */
|
||||
}
|
||||
.leftDiv {
|
||||
border-radius: 7px 36px 36px 7px;
|
||||
background-color: #276BFF;
|
||||
/* background-color: #456DFF; */
|
||||
height: 72px;
|
||||
width: 77px;
|
||||
color: white;
|
||||
line-height: 72px;
|
||||
/* margin: 5px 0 5px 0; */
|
||||
}
|
||||
@@ -228,6 +339,8 @@ export default {
|
||||
margin-top: 7px;
|
||||
padding: 0 20px 20px 20px;
|
||||
box-sizing: border-box;
|
||||
/* overflow: scroll;
|
||||
height: 100%; */
|
||||
}
|
||||
.count {
|
||||
width: 100%;
|
||||
@@ -249,9 +362,11 @@ export default {
|
||||
}
|
||||
.quality {
|
||||
background-image: url('./../assets/quality-bg.png');
|
||||
min-height: 100vh;
|
||||
background-size: cover;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
padding: 20px 20px;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-01-09 13:49:03
|
||||
* @LastEditTime: 2024-01-30 14:59:42
|
||||
* @LastEditTime: 2024-04-22 09:36:10
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -13,6 +13,10 @@
|
||||
<div style="height: 60px;">
|
||||
<h2>报废管理</h2>
|
||||
</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-col span="5" style="text-align: left">
|
||||
<h2>报废管理</h2>
|
||||
@@ -26,6 +30,10 @@
|
||||
<el-col :span="12">
|
||||
<div class="whiteForm">
|
||||
<el-form-item label="工单选择" prop="workOrderId">
|
||||
<div slot="label" class="labelDiv">
|
||||
<img class="formLabelIcon" src="./../assets/form1.png" alt="">
|
||||
工单选择
|
||||
</div>
|
||||
<el-select v-model="ruleForm.workOrderId" filterable clearable @focus="focusInput($event)" placeholder="请选择工单" style="width: 100%; display: block">
|
||||
<el-option v-for="(item, index) in workOrderList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
@@ -35,7 +43,11 @@
|
||||
<el-col :span="12">
|
||||
<div class="whiteForm">
|
||||
<el-form-item label="报废数量" prop="num">
|
||||
<el-input v-model="ruleForm.num" @focus="show = true" controls-position="right" :min="0" style="width: 100%; display: block"></el-input>
|
||||
<div slot="label" class="labelDiv">
|
||||
<img class="formLabelIcon" src="./../assets/form2.png" alt="">
|
||||
报废数量
|
||||
</div>
|
||||
<el-input v-model="ruleForm.num" @focus="showNumber" clearable controls-position="right" :min="0" placeholder="请输入报废数量" style="width: 100%; display: block"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -48,6 +60,10 @@
|
||||
@delete="onDelete"
|
||||
/>
|
||||
<el-form-item label="报废原因" prop="detName" class="reson">
|
||||
<div slot="label" class="labelDiv">
|
||||
<img class="formLabelIcon" src="./../assets/form3.png" alt="">
|
||||
报废原因
|
||||
</div>
|
||||
<br>
|
||||
<div class="resonDiv">
|
||||
<el-checkbox-group v-model="ruleForm.detName" style="width: 100%; display: block; text-align: left">
|
||||
@@ -59,6 +75,10 @@
|
||||
<el-col :span="12">
|
||||
<div class="whiteForm">
|
||||
<el-form-item label="产线" prop="lineId">
|
||||
<div slot="label" class="labelDiv">
|
||||
<img class="formLabelIcon" src="./../assets/form4.png" alt="">
|
||||
产线
|
||||
</div>
|
||||
<el-select v-model="ruleForm.lineId" filterable clearable placeholder="请选择产线" @focus="focusInput1($event)" style="width: 100%; display: block" @change="getSection">
|
||||
<el-option v-for="(item, index) in lineArray" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
@@ -68,6 +88,10 @@
|
||||
<el-col :span="12">
|
||||
<div class="whiteForm">
|
||||
<el-form-item label="工段" prop="sectionId">
|
||||
<div slot="label" class="labelDiv">
|
||||
<img class="formLabelIcon" src="./../assets/form5.png" alt="">
|
||||
工段
|
||||
</div>
|
||||
<el-select v-model="ruleForm.sectionId" filterable clearable placeholder="请选择产线" @focus="focusInput2($event)" style="width: 100%; display: block">
|
||||
<el-option v-for="(item, index) in sectionArray" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
@@ -79,14 +103,28 @@
|
||||
<el-col :span="12">
|
||||
<div class="whiteForm">
|
||||
<el-form-item label="时间" prop="logTime">
|
||||
<el-date-picker type="datetime" placeholder="选择日期" value-format="timestamp" v-model="ruleForm.logTime" style="width: 100%;"></el-date-picker>
|
||||
<div slot="label" class="labelDiv">
|
||||
<img class="formLabelIcon" src="./../assets/form6.png" alt="">
|
||||
时间
|
||||
</div>
|
||||
<div class="timeDiv">
|
||||
<el-date-picker type="datetime" placeholder="选择日期" value-format="timestamp" v-model="ruleForm.logTime" style="width: 100%;">
|
||||
</el-date-picker>
|
||||
<div style="margin-right: 10px" @click="refresh">
|
||||
<i class="el-icon-refresh-right" />
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="whiteForm">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="ruleForm.remark" @focus="focusInput3($event)"></el-input>
|
||||
<div slot="label" class="labelDiv">
|
||||
<img class="formLabelIcon" src="./../assets/form7.png" alt="">
|
||||
备注
|
||||
</div>
|
||||
<el-input v-model="ruleForm.remark" @focus="focusInput3($event)" placeholder="请输入备注"></el-input>
|
||||
<!-- <el-date-picker type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" v-model="ruleForm.logTime" style="width: 100%;"></el-date-picker> -->
|
||||
</el-form-item>
|
||||
</div>
|
||||
@@ -95,7 +133,8 @@
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="resetForm('ruleForm')">取消</el-button> -->
|
||||
<el-button class="subButton" :disabled="disabled" type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
||||
<!-- <el-button :disabled="disabled" type="primary" @click="submitForm('ruleForm')"> <i class="el-icon-sub"></i>11</el-button> -->
|
||||
<el-button class="subButton" icon="el-icon-circle-check" :disabled="disabled" type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@@ -143,6 +182,7 @@
|
||||
:input="inputValue3"
|
||||
:maxLength="30"
|
||||
/>
|
||||
<!-- <KeysInput ref="keysInput" @input="updateInputValue" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -150,11 +190,15 @@
|
||||
import { workOrderList, scrapDetList, createScrap, authList } from '@/api/quality'
|
||||
import SimpleKeyboard from './components/simpleKeyboard.vue'
|
||||
import { getUserId } from '@/utils/auth'
|
||||
// import KeysInput from './components/keyboard'
|
||||
|
||||
export default {
|
||||
components: { SimpleKeyboard },
|
||||
data () {
|
||||
return {
|
||||
// form: {
|
||||
// data: '11'
|
||||
// },
|
||||
ruleForm: {
|
||||
workOrderId: '',
|
||||
num: '',
|
||||
@@ -182,6 +226,7 @@ export default {
|
||||
scrapList: [],
|
||||
sectionArray: [],
|
||||
disabled: true,
|
||||
subIconUrl: require('@/assets/sub-right.png'),
|
||||
rules: {
|
||||
// workOrderId: [
|
||||
// { required: true, message: '请选择工单', trigger: 'change' }
|
||||
@@ -257,6 +302,31 @@ export default {
|
||||
}
|
||||
},
|
||||
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 () {
|
||||
this.ruleForm.logTime = new Date().getTime()
|
||||
},
|
||||
getSection (value) {
|
||||
const temp = this.lineArray.filter(item => {
|
||||
return item.id === value
|
||||
@@ -274,6 +344,13 @@ export default {
|
||||
inputFun () {
|
||||
this.$emit('input')
|
||||
},
|
||||
showNumber () {
|
||||
this.show = true
|
||||
this.simpleShow = false
|
||||
this.simpleShow1 = false
|
||||
this.simpleShow2 = false
|
||||
this.simpleShow3 = false
|
||||
},
|
||||
focusInput (e) {
|
||||
this.inputEle = e.srcElement
|
||||
// 关闭所有keyboard
|
||||
@@ -288,6 +365,7 @@ export default {
|
||||
this.simpleShow1 = false
|
||||
this.simpleShow2 = false
|
||||
this.simpleShow3 = false
|
||||
this.show = false
|
||||
// this.$emit('focus')
|
||||
},
|
||||
focusInput1 (e) {
|
||||
@@ -296,6 +374,7 @@ export default {
|
||||
this.simpleShow = false
|
||||
this.simpleShow2 = false
|
||||
this.simpleShow3 = false
|
||||
this.show = false
|
||||
},
|
||||
focusInput2 (e) {
|
||||
this.inputEle2 = e.srcElement
|
||||
@@ -303,6 +382,7 @@ export default {
|
||||
this.simpleShow1 = false
|
||||
this.simpleShow = false
|
||||
this.simpleShow3 = false
|
||||
this.show = false
|
||||
},
|
||||
focusInput3 (e) {
|
||||
this.inputEle3 = e.srcElement
|
||||
@@ -310,6 +390,7 @@ export default {
|
||||
this.simpleShow2 = false
|
||||
this.simpleShow1 = false
|
||||
this.simpleShow = false
|
||||
this.show = false
|
||||
},
|
||||
onChange1 (input) {
|
||||
this.inputValue1 = input
|
||||
@@ -349,7 +430,6 @@ export default {
|
||||
console.log('onKeyPress', button)
|
||||
},
|
||||
onInput (value) {
|
||||
// Toast(value);
|
||||
console.log('value', value, this.ruleForm.num)
|
||||
},
|
||||
onDelete () {
|
||||
@@ -373,8 +453,8 @@ export default {
|
||||
// })
|
||||
// })
|
||||
await authList({ userId: getUserId() }).then(res => {
|
||||
console.log('res', res.data.data)
|
||||
if (res && res.data.data.datas.length > 0) {
|
||||
// console.log('res', res.data.data)
|
||||
if (res && res?.data?.data?.datas.length > 0) {
|
||||
this.lineArray = res.data.data.datas
|
||||
this.ruleForm.lineId = this.lineArray[0].id
|
||||
this.getSection(this.ruleForm.lineId)
|
||||
@@ -403,6 +483,8 @@ export default {
|
||||
this.$router.push({
|
||||
path: 'list'
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.data.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -419,22 +501,42 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.labelDiv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100px;
|
||||
}
|
||||
.formLabelIcon {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.timeDiv {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.subButton {
|
||||
background-color: #456DFF;
|
||||
width: 168px;
|
||||
height: 56px;
|
||||
box-shadow: 0px 16px 16px 0px rgba(25,70,170,0.31);
|
||||
border-radius: 31px;
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.el-checkbox {
|
||||
background: #EDF0FD;
|
||||
box-shadow: 0px 6px 8px 0px #D2D9E8, inset 0px 6px 6px 0px #FFFFFF;
|
||||
width: 216px;
|
||||
width: 206px;
|
||||
height: 56px;
|
||||
border-radius: 7px;
|
||||
line-height: 56px;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.reson {
|
||||
background-color: #FFFFFF;
|
||||
@@ -484,6 +586,7 @@ export default {
|
||||
}
|
||||
.scrap {
|
||||
background-image: url('./../assets/quality-bg.png');
|
||||
background-size: cover;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
padding: 20px 24px;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-29 10:01:55
|
||||
* @LastEditTime: 2024-01-30 14:42:15
|
||||
* @LastEditTime: 2024-03-28 09:07:41
|
||||
* @LastEditors: DY
|
||||
* @Description: 报废列表
|
||||
-->
|
||||
@@ -24,6 +24,7 @@
|
||||
border
|
||||
:header-cell-style="{ background: 'rgba(210, 220, 242, 1)', color: '#000', height: '33px' }"
|
||||
show-header
|
||||
max-height="600"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
type="index" label="序号" width="60" />
|
||||
@@ -107,7 +108,7 @@ export default {
|
||||
},
|
||||
getList () {
|
||||
scrapLogList(this.listQuery).then(res => {
|
||||
if (res.data.code === 0) {
|
||||
if (res && res?.data?.code === 0) {
|
||||
this.tableData = res.data.data.list.map(item => {
|
||||
item.sources = item.source === 1 ? '平板端' : '网页端'
|
||||
item.scrapTime = parseTime(item.logTime)
|
||||
@@ -140,12 +141,14 @@ export default {
|
||||
background-color: #a76c6c; /* 奇数行背景颜色 */
|
||||
}
|
||||
.pagination {
|
||||
margin-top: 10px;
|
||||
margin-top: 15px;
|
||||
float: right;
|
||||
}
|
||||
.list {
|
||||
background-image: url('./../assets/quality-bg.png');
|
||||
height: 100vh;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
min-height: 100vh;
|
||||
width: 100vw;
|
||||
padding: 20px 24px;
|
||||
box-sizing: border-box;
|
||||
|
||||
176
src/views/components/SKeyboard.vue
Normal 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>
|
||||
74
src/views/components/keyboard.vue
Normal 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>
|
||||
@@ -8,7 +8,7 @@
|
||||
const { defineConfig } = require('@vue/cli-service')
|
||||
module.exports = defineConfig({
|
||||
transpileDependencies: true,
|
||||
|
||||
publicPath: './',
|
||||
// 配置代理服务器
|
||||
devServer: {
|
||||
// proxy: {
|
||||
|
||||