init: CATL电池线返修工位APP首次入库

This commit is contained in:
XingCheng3
2026-06-08 17:11:43 +08:00
commit 056af96557
71 changed files with 43178 additions and 0 deletions

46
src/App.vue Normal file
View File

@@ -0,0 +1,46 @@
<template>
<div id="app">
<div v-if="$route.meta.keepAlive">
<main-top-bar></main-top-bar>
<router-view></router-view>
<!-- <main-tab-bar v-show="showNav"></main-tab-bar>-->
</div>
<router-view v-if="!$route.meta.keepAlive"></router-view>
</div>
</template>
<script>
import MainTabBar from '@/components/TabBar/MainTabBar'
import MainTopBar from '@/components/TopBar/MainTopBar'
export default {
name: 'App',
components: { MainTabBar, MainTopBar },
data() {
return {
showNav: false
}
},
created() {
this.showNav = true
}
}
</script>
<style>
#app {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
box-sizing: border-box;
}
.el-select-dropdown__item {
font-size: 1.2rem !important;
}
.el-select-dropdown__item.selected {
color: red !important;
}
</style>

View File

@@ -0,0 +1,191 @@
import request from '@/utils/request'
import state from '@/store'
import router from '@/router'
// 查询项目名称
export function dialogtablevisible() {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '1',
name: '人事档案管理_部门关系_查询节点',
param: '子节点=0'
}
})
}
export function dialogtablevisible1() {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '1',
name: '人事档案管理_部门关系_查询节点',
param: '子节点=0'
}
})
}
export function addData1(code, groupNum) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: 2,
name: '菜单系统模块_项目角色员工综合_增加数据',
param: '人员编号=' + code + '=int&角色编号=' + groupNum + '=int&项目编号=10=int'
}
})
}
export function addData2(lsh, code, groupNum) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: 2,
name: '菜单系统模块_项目角色员工综合_修改数据',
param: '人员角色流水号=' + lsh + '&人员编号=' + code + '&角色编号=' + groupNum
}
})
}
// 初始化科室
export function initDepartment() {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '1',
name: '人事档案管理_部门关系_查询节点'
}
})
}
// 初始化人员信息 弹出框
export function getTree() {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: 1,
name: '人事档案管理_部门关系_查询节点',
param: '子节点=0=int'
}
})
}
export function fn(data, pid) {
const result = []
let temp
for (let i = 0; i < data.length; i++) {
if (data[i].父节点 === pid) {
const obj = { label: data[i].节点名称, id: data[i].子节点 }
temp = fn(data, data[i].子节点)
if (temp.length > 0) {
obj.children = temp
}
result.push(obj)
}
}
return result
}
export function fn2(data, pid) {
const result = []
let temp
for (let i = 0; i < data.length; i++) {
if (data[i].父节点 === pid) {
const obj = { text: data[i].节点名称, value: data[i].子节点 }
temp = fn2(data, data[i].子节点)
if (temp.length > 0) {
obj.children = temp
}
result.push(obj)
}
}
return result
}
export function getTable8(code) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: 1,
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=' + code + '=int'
}
})
}
export function handledelete(ryjslsh) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: 2,
name: '菜单系统模块_项目角色员工综合_删除数据',
param: '人员角色流水号=' + ryjslsh + '=string'
}
})
}
export function deleteData(Number) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '2',
name: '菜单系统模块_项目角色员工综合_删除数据',
param: '人员角色流水号=' + Number + '=int'
}
})
}
export function searchdesigner(num2) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '1',
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=' + num2 + '=int'
}
})
}
export function initOrderType() {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '1',
name: '菜单系统模块_项目角色_查询数据_new'
}
})
}
export function searchTable(check1, staffName, check2, systemAdministrator) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '1',
name: '菜单系统模块_项目角色员工综合_查询数据',
param: '姓名_check=' + check1 + '=int&姓名=' + staffName + '=string&角色编号_check=' + check2 + ' =int&角色编号=' + systemAdministrator + '=int'
}
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
src/assets/key.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
src/assets/loginOff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

BIN
src/assets/peo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,14 @@
<template>
<div></div>
</template>
<script>
export default {
data () {
return {}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,42 @@
<template>
<div>
<tab-bar>
<tab-bar-item path="/CheckPlanCreate" activeColor="#409eff">
<img slot="item-icon" src="@/assets/CheckPlanCreate.png" alt="" >
<img slot="item-icon-active" src="@/assets/CheckPlanCreateActive.png" alt="">
<div slot="item-text">检验计划</div>
</tab-bar-item>
<tab-bar-item path="/CheckPlanExec" activeColor="#409eff">
<img slot="item-icon" src="@/assets/CheckPlanExec.png" alt="" >
<img slot="item-icon-active" src="@/assets/CheckPlanExecActive.png" alt="">
<div slot="item-text">检验执行</div>
</tab-bar-item>
<tab-bar-item path="/CheckPlanSearch" activeColor="#409eff">
<img slot="item-icon" src="@/assets/CheckPlanSearch.png" alt="" >
<img slot="item-icon-active" src="@/assets/CheckPlanSearchActive.png" alt="">
<div slot="item-text">检验历史</div>
</tab-bar-item>
<tab-bar-item path="/login1" activeColor="#409eff">
<img slot="item-icon" src="@/assets/loginOff.png" alt="" >
<img slot="item-icon-active" src="@/assets/loginOff.png" alt="">
<div slot="item-text">退出</div>
</tab-bar-item>
</tab-bar>
</div>
</template>
<script>
import TabBar from './TabBar'
import TabBarItem from './TabBarItem'
export default {
name:"MainTabBar",
components:{
TabBar,
TabBarItem
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,14 @@
<template>
<div id="tab-bar">
<slot></slot>
</div>
</template>
<script>
export default {
name:'TabBar'
}
</script>
<style>
</style>

View File

@@ -0,0 +1,79 @@
<template>
<div class="tab-bar-item" @click="itemClick">
<div v-if="!isActive">
<slot name="item-icon"></slot>
</div>
<div v-else>
<slot name="item-icon-active"></slot>
</div>
<div :style="activeStyle"><slot name="item-text"></slot></div>
</div>
</template>
<script>
export default {
name:"TabBarItem",
props:{
path:String,
activeColor:{
type:String,
default:'red'
}
},
data(){
return {
// isActive:true
}
},
computed:{
isActive(){
//判断
//return this.$route.path.indexOf(this.path) !== -1
//return this.$route.path === this.path
return this.$route.path.indexOf(this.path) ? false : true
},
activeStyle(){
return this.isActive?{color:this.activeColor}:{}
}
},
methods:{
itemClick(){
this.$router.replace(this.path)
}
}
}
</script>
<style>
#tab-bar{
display: flex;
}
#tab-bar{
background-color: #f6f6f6;
border-top: 2px #ccc;
position: fixed;
left: 0;
right: 0;
bottom: 0;
box-shadow:0px -1px 1px rgba(100,100,100,.2) ;
}
.tab-bar-item{
flex: 1;
text-align: center;
height: 49px;
font-size: 14px;
}
.tab-bar-item img{
width: 24px;
height: 24px;
margin-top: 3px;
vertical-align: middle;
margin-bottom: 3px;
}
.active{
color: red;
}
</style>

View File

@@ -0,0 +1,50 @@
<template>
<div>
<top-bar>
<div style="flex: 10;display: flex;align-items:center;justify-content:center;height: 50px;font-size: 2rem;">
<span id="topPageName">首页</span>
<div style="position: absolute;right: 5px;top: 0px">
<van-button icon="home-o" style="background-color: #a5a5a5" @click="routeJump('main')"></van-button>
</div>
</div>
</top-bar>
</div>
</template>
<script>
import TopBar from './TopBar'
// import TopBarItem from './TopBarItem'
export default {
name:"MainTopBar",
components:{
TopBar,
// TopBarItem
},
methods: {
routeJump(val){
if (val.indexOf('/') !== -1) {
val = val.substring(1)
}
this.$router.push({
path: '/' + val
})
}
}
}
</script>
<style>
#top-bar{
display: flex;
align-items: center;
justify-content: center;
background-color: #e7e7e7;
border-top: 2px #ccc;
position: fixed;
left: 0;
right: 0;
top: 0;
box-shadow:0px -1px 1px rgba(100,100,100,.2) ;
}
</style>

View File

@@ -0,0 +1,14 @@
<template>
<div id="top-bar">
<slot></slot>
</div>
</template>
<script>
export default {
name:'TopBar'
}
</script>
<style>
</style>

View File

@@ -0,0 +1,78 @@
<template>
<div class="top-bar-item" @click="itemClick">
<div v-if="!isActive">
<slot name="item-icon"></slot>
</div>
<div v-else>
<slot name="item-icon-active"></slot>
</div>
<div :style="activeStyle"><slot name="item-text"></slot></div>
</div>
</template>
<script>
export default {
name:"TopBarItem",
props:{
path:String,
activeColor:{
type:String,
default:'red'
}
},
data(){
return {
// isActive:true
}
},
computed:{
isActive(){
//判断
//return this.$route.path.indexOf(this.path) !== -1
//return this.$route.path === this.path
return this.$route.path.indexOf(this.path) ? false : true
},
activeStyle(){
return this.isActive?{color:this.activeColor}:{}
}
},
methods:{
itemClick(){
this.$router.replace(this.path)
}
}
}
</script>
<style>
#top-bar{
display: flex;
align-items: center;
justify-content: center;
background-color: #a5a5a5;
border-top: 2px #ccc;
position: fixed;
left: 0;
right: 0;
top: 0;
box-shadow:0px -1px 1px rgba(100,100,100,.2) ;
}
.top-bar-item{
flex: 1;
text-align: center;
height: 49px;
font-size: 14px;
}
.top-bar-item img{
width: 24px;
height: 24px;
margin-top: 3px;
vertical-align: middle;
margin-bottom: 3px;
}
.active{
color: red;
}
</style>

114
src/main.js Normal file
View File

@@ -0,0 +1,114 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from '@/store/index.js'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios'
import tool from '@/utils/tool.js'
import Vant from 'vant'
import 'vant/lib/index.css'
import request from '@/utils/request'
Vue.use(Vant)
const throttle = {
bind: (el, binding) => {
let throttleTime = binding.value // 防抖时间
if (!throttleTime) { // 用户若不设置防抖时间则默认1s
throttleTime = 1000
}
let timer
let disable = false
el.addEventListener('click', event => {
if (timer) {
clearTimeout(timer)
}
if (!disable) { // 第一次执行(一点击触发当前事件)
disable = true
} else {
event && event.stopImmediatePropagation()
}
timer = setTimeout(() => {
timer = null
disable = false
}, throttleTime)
}, true)
}
}
Vue.directive('throttle', throttle);
Vue.config.productionTip = false
Vue.prototype.$axios = axios
Vue.prototype.$store = store
Vue.use(ElementUI)
Vue.use(tool)
Vue.prototype.CreateData = function(type, name, data, pageSize, pageList) {
var param_Str = ''
var param_array = []
if (type === '7') {
data.map(v => {
pageSize.map(h => {
const val = h.toString()
if (!v[val]) {
this.$set(v, val, '')
}
})
})
param_Str = data
} else {
if (data !== undefined) {
for (let i = 0; i < data.length; i++) {
param_array.push({
name: data[i][0],
value: data[i][1],
type: data[i][2],
output: data[i][3]
})
}
param_Str = JSON.stringify(param_array)
}
}
var obj = []
obj[0] = {}
obj[0].type = type
obj[0].name = name
obj[0].param = param_Str
obj[0].pageSize = pageSize
obj[0].pageList = pageList
// console.log(obj[0], 'obj[0]')
var numn = JSON.stringify(obj[0])
return numn
}
// 新通讯11/12---<
Vue.prototype.ExecDatabase = function(num) {
return request({
url: '',
method: 'post',
data: num
})
}
// router.beforeEach((to, from, next) => {
// let userInfo = localStorage.userInfo
// let pdaId = localStorage.pdaId
// // console.log(userInfo)
// // console.log(pdaId)
// if (to.path === '/' && !userInfo && !pdaId) {
// next()
// } else {
// next('/login')
// }
// })
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
components: {
App
},
template: '<App/>'
})

57
src/router/index.js Normal file
View File

@@ -0,0 +1,57 @@
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'login',
meta: {
keepAlive: false
},
component: () => import('@/views/login.vue')
},
{
path: '/login1',
name: 'login1',
meta: {
keepAlive: false
},
component: () => import('@/views/login.vue')
},
{
path: '/main',
name: 'main',
meta: {
keepAlive: true
},
component: () => import('@/views/main.vue')
},
{
path: '/ChangeMaterial',
name: 'ChangeMaterial',
meta: {
keepAlive: true
},
component: () => import('@/views/RepairManagement/ChangeMaterial/index.vue')
},
{
path: '/ProductScrapping',
name: 'ProductScrapping',
meta: {
keepAlive: true
},
component: () => import('@/views/RepairManagement/ProductScrapping/index.vue')
},
{
path: '/RepairSearch',
name: 'RepairSearch',
meta: {
keepAlive: true
},
component: () => import('@/views/RepairManagement/RepairSearch/index.vue')
},
]
})

30
src/store/actions.js Normal file
View File

@@ -0,0 +1,30 @@
export const saveArr = (context, payload) => {
context.commit('saveArr', payload)
}
export const saveObj = ({
commit
}, payload) => {
commit('saveObj', payload)
}
export const saveUserInfo = (context, payload) => {
context.commit('saveUserInfo', payload)
}
export const savePdaId = (context, payload) => {
context.commit('savePdaId', payload)
}
export const saveMqttConnection = (context, payload) => {
context.commit('saveMqttConnection', payload)
}
export const saveSubscription = (context, payload) => {
context.commit('saveSubscription', payload)
}
export const savePublication = (context, payload) => {
context.commit('savePublication', payload)
}
export const saveMqttClient = (context, payload) => {
context.commit('saveMqttClient', payload)
}
export const saveMqttMsg = (context, payload) => {
context.commit('saveMqttMsg', payload)
}

14
src/store/index.js Normal file
View File

@@ -0,0 +1,14 @@
import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import * as actions from './actions'
import * as mutations from './mutations'
Vue.use(Vuex)
export default new Vuex.Store({
state,
actions,
mutations
})

29
src/store/mutations.js Normal file
View File

@@ -0,0 +1,29 @@
export const saveArr = (state, arr) => {
state.arr = arr
}
export const saveObj = (state, obj) => {
state.obj = obj
}
export const saveUserInfo = (state, userInfo) => {
state.userInfo = userInfo
}
export const savePdaId = (state, pdaId) => {
state.pdaId = pdaId
}
export const saveMqttConnection = (state, mqttConnection) => {
state.mqttConnection = mqttConnection
}
export const saveSubscription = (state, subscription) => {
state.subscription = subscription
}
export const savePublication = (state, publication) => {
state.publication = publication
}
export const saveMqttClient = (state, mqttClient) => {
state.mqttClient = mqttClient
}
export const saveMqttMsg = (state, mqttMsg) => {
state.mqttMsg = mqttMsg
}

38
src/store/state.js Normal file
View File

@@ -0,0 +1,38 @@
export default {
arr: [1, 2, 3],
obj: {
'a': 'aa'
},
userInfo: null,
pdaId: 'PDA_5X_CK2_KK',
mqttConnection: null,
subscription: null,
publication: null,
mqttClient: null,
mqttMsg: null
}
/* 读取
import {
mapState,
mapActions
} from 'vuex';
computed: {
...mapState(['arr']),
...mapState({
obj: state => state.obj,
}),
},
this.arr this.obj this.$store.state.arr */
/* 存入
methods: {
...mapActions(['saveArr', 'saveObj']),
...mapActions({
add: 'saveArr'
})}
this.$store.dispatch('saveObj', {
'a': 'bb'
});
this.saveArr(['a']).then(res => {
console.log(this.arr);
}) */

103
src/utils/mqtt.js Normal file
View File

@@ -0,0 +1,103 @@
import { v4 as uuid } from 'uuid'
import mqtt from 'mqtt'
class Mqtt {
constructor (config) {
this.connection = {
host: config.host,
port: config.port,
endpoint: config.endpoint || '/mqtt',
clean: config.clean || true,
connectTimeout: config.connectTimeout || 4000,
reconnectPeriod: config.reconnectPeriod || 4000,
clientId: config.clientId || uuid(),
username: config.username || '',
password: config.password || ''
}
this.client = {
connected: false
}
}
// 创建连接
createConnection () {
// 连接字符串, 通过协议指定使用的连接方式
// ws 未加密 WebSocket 连接
// wss 加密 WebSocket 连接
// mqtt 未加密 TCP 连接
// mqtts 加密 TCP 连接
// wxs 微信小程序连接
// alis 支付宝小程序连接
const { host, port, endpoint, ...options } = this.connection
const connectUrl = `ws://${host}:${port}${endpoint}`
try {
this.client = mqtt.connect(connectUrl, options)
} catch (error) {
// 连接错位、
this.connectError(error)
}
}
connectError (error) {
console.log('mqtt.connect error', error)
}
// 订阅主题
doSubscribe (subscription) {
const { topic, qos } = subscription
let subscribeSuccess = false
this.client.subscribe(topic, { qos }, (error, res) => {
if (error) {
subscribeSuccess = false
console.log('Subscribe to topics error', error)
} else {
subscribeSuccess = true
console.log('Subscribe to topics res', res)
}
})
return subscribeSuccess
}
// 取消订阅
doUnSubscribe (subscription) {
const { topic } = subscription
let unSubscribeSuccess = false
this.client.unsubscribe(topic, error => {
if (error) {
unSubscribeSuccess = false
console.log('Unsubscribe error', error)
} else {
unSubscribeSuccess = true
}
})
return unSubscribeSuccess
}
// 发送消息
doPublish (publish) {
const { topic, qos, payload } = publish
let doPublishSuccess = false
this.client.publish(topic, payload, qos, error => {
if (error) {
doPublishSuccess = false
console.log('Publish error', error)
} else {
doPublishSuccess = true
}
})
return doPublishSuccess
}
// 断开连接
destroyConnection () {
let destroyConnectionSuccess = false
if (this.client.connected) {
try {
this.client.end()
this.client = {
connected: false
}
destroyConnectionSuccess = true
console.log('Successfully disconnected!')
} catch (error) {
destroyConnectionSuccess = false
console.log('Disconnect failed', error.toString())
}
}
return destroyConnectionSuccess
}
}
export { Mqtt }

90
src/utils/mqttStart.js Normal file
View File

@@ -0,0 +1,90 @@
import {
Mqtt
} from '@/utils/mqtt.js'
import store from '@/store/index.js'
function init (pdaId, mqttConnection, subscription, publication) {
store.dispatch('savePdaId', pdaId)
store.dispatch('saveMqttConnection', mqttConnection)
store.dispatch('saveSubscription', subscription)
store.dispatch('savePublication', publication)
// store.dispatch('saveMqttClient', );
// pdaId = pdaId
// mqttConnection = mqttConnection
// console.log(mqttConnection);
// subscription = subscription
// publication = publication
connectMqtt()
}
function connectMqtt () {
let mqttClient = store.state.mqttClient
mqttClient = new Mqtt(store.state.mqttConnection)
mqttClient.createConnection()
mqttClient.client.on('connect', () => {
console.log('MQTT Connection succeeded!')
})
mqttClient.doSubscribe(store.state.subscription)
// 使用过程中的报错 断开连接 服务端出问题
mqttClient.client.on('error', error => {
console.log('Connection failed', error)
})
mqttClient.client.on('message', (topic, message) => {
mqttOnMessage(topic, message)
})
}
function disConnectMqtt () {
if (store.state.mqttConnection) {
store.state.mqttConnection.destroyConnection()
store.state.mqttConnection = null
}
}
function mqttOnMessage (topic, message) {
let pdaId = 'PDA_1010'
// console.log(topic, message.toString())
const arraysSignal = message.toString().split('|')
const mSource = arraysSignal[0] // MES
// const m_Command = arraysSignal[1]
const mOpName = arraysSignal[2]
switch (mSource) {
case 'BarCode':
switch (mOpName) {
case pdaId:
// const BarValue = arraysSignal[3]
connectMessage(arraysSignal[3], message)
// uni.$emit("connect-mqttOnMessage", arraysSignal[3], message)
// this.mqttSendMessage(`PDABarCode|Bar|${mOpName}|${BarValue}`)
break
default:
console.log(`消息工位号不匹配:${message.toString()};工位号:${pdaId}`)
break
}
break
default:
console.log(`消息来源不匹配:${message.toString()};工位号:${pdaId}`)
break
}
}
function connectMessage (val, msg) {
// window.dispatchEvent(new CustomEvent('onmessageMqtt', {
// detail: {
// data: val
// }
// }))
// window.addEventListener('onmessageMqtt', this.getMqttMessage)
store.dispatch('saveMqttMsg', val)
}
// function mqttSendMessage (message) {
// publication.payload = message
// mqttClient.doPublish(this.publication)
// }
export {
init,
mqttOnMessage,
disConnectMqtt,
connectMessage
}

35
src/utils/request.js Normal file
View File

@@ -0,0 +1,35 @@
import axios from 'axios'
var requestConfig = window.dt_Config.requestConfig
// `baseURL` 将自动加在 `url` 前面,除非 `url` 是一个绝对 URL。
let baseURL = ''
const instance = axios.create({
baseURL: baseURL,
timeout: 10000,
headers: {}
})
// 另一种配置超时时间
instance.defaults.timeout = 25000
function request ({
url = '',
method = 'get',
data = {},
params = {}
}) {
if (!url) {
url = requestConfig
}
return new Promise((resolve, reject) => {
instance({
method: method,
url: url,
data: data,
params: params
}).then(resolve).catch(err => {
reject(err)
})
})
}
export default request

391
src/utils/tool.js Normal file
View File

@@ -0,0 +1,391 @@
import request from '@/utils/request'
// 传通讯服务器参数
export default {
install (Vue) {
// 用于生成传通讯服务器参数。
// 传入参数
// 1type11查询12增删改必须
// 2name存储过程名必须
// 3data存储过程参数名和对应值例如
// param[0] = ['设备类型编码', '3', 'string', '0']
// param[1] = ['output', '3', 'int', '1'],必须
// 数组里四个分别对应存储过程参数名必须存储过程参数值必须参数类型若是output必须参数是否为output0否1是
// 4pageSizepageList分页使用可选
// 旧通讯格式
Vue.prototype.CreateData1 = function (type, name, data, pageSize, pageList) {
var paramStr = ''
var paramarray = []
if (type === '7') {
data.map(v => {
pageSize.map(h => {
const val = h.toString()
if (!v[val]) {
this.$set(v, val, '')
}
})
})
paramStr = data
} else {
if (data !== undefined) {
for (let i = 0; i < data.length; i++) {
paramarray.push({
name: data[i][0],
value: data[i][1],
type: data[i][2],
output: data[i][3]
})
}
paramStr = JSON.stringify(paramarray)
}
}
var obj = []
obj[0] = {}
obj[0].type = type
obj[0].name = name
obj[0].param = paramStr
obj[0].pageSize = pageSize
obj[0].pageList = pageList
var numn = JSON.stringify(obj[0])
return numn
}
// 新通讯格式
Vue.prototype.CreateData = (cmd, tbname, fieldshow, other) => {
const Param = JSON.stringify({
cmd,
tbname,
fieldshow,
...other
})
const data = {
type: 3001,
Param,
Name: '',
Pagination: '',
UserID: '',
HasReturn: false
}
return JSON.stringify(data)
}
// 新通讯11/12---<
Vue.prototype.ExecDatabase = function (num) {
return request({
url: '',
method: 'post',
data: num
})
}
// 设置字段宽度
Vue.prototype.setColumnWidth = function (str) {
let columnWidth = 0
if (str === '日期') {
columnWidth = 100
} else if (str === '工单号' || str === '产品名称') {
columnWidth = 160
} else if (str === '规则型号' || str === '产品编号') {
columnWidth = 150
} else if (str === '大数') {
columnWidth = 110
} else if (str === '状态') {
columnWidth = 100
} else if (str === '序号') {
columnWidth = 60
} else if (str === '单位') {
columnWidth = 60
} else if (str === '数量' || str === '库存') {
columnWidth = 80
} else if (str === '单价') {
columnWidth = 90
} else if (str === '金额') {
columnWidth = 120
} else if (str === '状态' || str === '类型' || str === '选入' || str === '选出') {
columnWidth = 80
} else if (str === '付款方式') {
columnWidth = 100
} else if (str === '买方' || str === '买方名称') {
columnWidth = 150
} else if (str === '外协厂家' || str === '调入仓库' || str === '调出仓库') {
columnWidth = 150
} else if (str === '姓名') {
columnWidth = 80
} else if (str === '日期时间') {
columnWidth = 140
} else if (str === '工序') {
columnWidth = 80
} else if (str === '物料名称' || str === '工件名称' || str === '零件名称') {
columnWidth = 140
} else if (str === '图号或型号' || str === '规格' || str === '零件图号' || str === '图号' || str === '图号/型号') {
columnWidth = 120
} else if (str === '物料编码' || str === '物料编号') {
columnWidth = 120
} else if (str === '材料') {
columnWidth = 80
} else if (str === '仓位' || str === '库位') {
columnWidth = 90
} else if (str === '品名/规格/型号') {
columnWidth = 140
} else if (str === '备注') {
columnWidth = 120
} else if (str === '工序名称') {
columnWidth = 150
} else if (str === '工序说明') {
columnWidth = 300
} else if (str === '加工工时M' || str === '加工时长H' || str === '加工时长M') {
columnWidth = 90
} else if (str === '加工设备') {
columnWidth = 130
} else if (str === '产品详情' || str === '详情') {
columnWidth = 340
} else if (str === '最低库存') {
columnWidth = 110
} else if (str === '本次到货数' || str === '本次入库' || str === '补货数') {
columnWidth = 100
} else {
columnWidth = 110
}
return columnWidth
}
}
}
export function getNowTime2() {
const date = new Date()
const month = zeroFill2(date.getMonth() + 1)
const day = zeroFill(date.getDate())
const time = date.getFullYear() + '-' + month + '-' + day
return time
}
function zeroFill2(i) {
if (i >= 0 && i <= 9) {
if (i === 0) {
return '01'
} else {
return '0' + i
}
} else {
return i
}
}
export function getBeforeOrAfterTime(AddDayCount) {
var dd = new Date()
dd.setDate(dd.getDate() + AddDayCount)// 获取AddDayCount天后的日期
var y = dd.getFullYear()
var m = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 获取当前月份的日期不足10补0
var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 获取当前几号不足10补0
return y + '-' + m + '-' + d
}
// 数组去重s
export function arrayUnique (arr) {
arr.filter((element, index, arr) => {
return arr.indexOf(element) === index
})
}
// 时间转时间戳
export function timeToStamp (time) {
const date = new Date(time)
return date.getTime()
}
// 数组的深度拷贝
export function arrDeepCopy (arr) {
const newArr = []
for (const prop in arr) newArr[prop] = typeof arr[prop] === 'object' ? arrDeepCopy(arr[prop]) : arr[prop]
return newArr
}
// 对象的深度拷贝
export function objDeepCopy (obj) {
const newObj = {}
for (const prop in obj) newObj[prop] = typeof obj[prop] === 'object' ? objDeepCopy(obj[prop]) : obj[prop]
return newObj
}
function zeroFill (i) {
if (i >= 0 && i <= 9) {
return '0' + i
} else {
return i
}
}
// 获取当前日期时间
export function getNowTime () {
const date = new Date()
const month = zeroFill(date.getMonth() + 1)
const day = zeroFill(date.getDate())
const hour = zeroFill(date.getHours())
const minute = zeroFill(date.getMinutes())
const second = zeroFill(date.getSeconds())
const time = date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
return time
}
export function formatDate(date) {
const month = zeroFill2(date.getMonth() + 1)
const day = zeroFill(date.getDate())
const time = date.getFullYear() + '-' + month + '-' + day
return time//时间戳转日期格式
}
// 获取当前日期
export function getNowDate () {
const date = new Date()
const month = zeroFill(date.getMonth() + 1)
const day = zeroFill(date.getDate())
const time = date.getFullYear() + '-' + month + '-' + day
return time
}
// 获取当前时间
export function getNowDate1 () {
const date = new Date()
const hour = zeroFill(date.getHours())
const minute = zeroFill(date.getMinutes())
const second = zeroFill(date.getSeconds())
const time = hour + ':' + minute + ':' + second
return time
}
// 每月1号
export function getTime1 () {
const date = new Date()
const month = zeroFill(date.getMonth() + 1)
const time = date.getFullYear() + '-' + month + '-' + '01'
return time
}
// 工时统计上个月26-本月25
export function getTime26 () {
const date = new Date()
const day = date.getDate()
if (day > 25) {
var month = zeroFill(date.getMonth() + 1)
if (month === 0) {
month = 12
const day = 26
const time = date.getFullYear() - 1 + '-' + month + '-' + day
return time
} else {
const day = 26
const time = date.getFullYear() + '-' + month + '-' + day
return time
}
} else {
var month2 = zeroFill(date.getMonth() + 1) - 1
if (month2 === 0) {
month2 = 12
const day = 26
const time = date.getFullYear() - 1 + '-' + month2 + '-' + day
return time
} else {
const day = 26
const time = date.getFullYear() + '-' + month2 + '-' + day
return time
}
}
}
export function getTime25 () {
const date = new Date()
const day = date.getDate()
var time
if (day > 25) {
const month = zeroFill(date.getMonth() + 2)
const day2 = 25
if (month === 13) {
const month = 1
time = (date.getFullYear() + 1) + '-' + month + '-' + day2
} else {
time = date.getFullYear() + '-' + month + '-' + day2
}
return time
} else {
const month = zeroFill(date.getMonth() + 1)
const day2 = 25
if (month === 13) {
const month = 1
time = (date.getFullYear() + 1) + '-' + month + '-' + day2
} else {
time = date.getFullYear() + '-' + month + '-' + day2
}
return time
}
}
// 判断类型
export function type (target) {
const ret = typeof (target)
const template = {
'[object Array]': 'array',
'[object Object]': 'object',
'[object String]': 'string - object',
'[object Number]': 'Number - object',
'[object Boolean]': 'Boolean - object'
}
if (target === null) {
return 'null'
}
if (ret === 'object') {
const str = Object.prototype.toString.call(target)
return template[str]
} else {
return ret
}
}
export function SectionToChinese (section) {
const chnNumChar = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']
const chnUnitChar = ['', '十', '百', '千']
let strIns = ''
let chnStr = ''
let unitPos = 0
let zero = true
while (section > 0) {
const v = section % 10
if (v === 0) {
if (!zero) {
zero = true
chnStr = chnNumChar[v] + chnStr
}
} else {
zero = false
strIns = chnNumChar[v]
strIns += chnUnitChar[unitPos]
chnStr = strIns + chnStr
}
unitPos++
section = Math.floor(section / 10)
}
return chnStr
}
export function sleep (time) {
return new Promise(resolve => {
setTimeout(resolve, time)
})
}
export function groupBy (datas, keys) {
const list = datas || []
const groups = []
const result = []
list.forEach(v => {
const key = {}
keys.forEach(k => {
key[k] = v[k]
})
let group = groups.find(v => {
return v._key === JSON.stringify(key)
})
if (!group) {
group = {
_key: JSON.stringify(key),
key: key
}
groups.push(group)
}
group.data1 = group.data1 || 0
group.key.数量 = group.data1 += v.数量
group.data2 = group.data2 || ''
group.key.机床图号_组号 = group.data2 += (v.机床图号 || '') + '-' + (v.组号 ? v.组号.split('组')[0] : '') + ';'
})
groups.map(v => {
result.push(v.key)
})
return result
}

View File

@@ -0,0 +1,41 @@
<template>
<div class="app-container">
<pass-station :page-type="0"></pass-station>
</div>
</template>
<script>
import {Dialog, Toast} from 'vant'
import passStation from '../passStation/index.vue'
export default {
name: 'index',
components: {
passStation
},
data() {
return {
userInfo: ''
}
},
created() {
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
},
mounted () {
document.getElementById('topPageName').innerText = '更换物料'
},
methods: {
forbid(){
//禁止软键盘弹出
document.activeElement.blur();
}
}
}
</script>
<style scoped>
.app-container{
margin-top: 50px;
}
</style>

View File

@@ -0,0 +1,39 @@
<template>
<div class="app-container">
<pass-station :page-type="1"></pass-station>
</div>
</template>
<script>
import {Dialog, Toast} from 'vant'
import passStation from '../passStation/index.vue'
export default {
name: 'index',
components: {passStation},
data() {
return {
userInfo: ''
}
},
created() {
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
},
mounted () {
document.getElementById('topPageName').innerText = '报废解体'
},
methods: {
forbid(){
//禁止软键盘弹出
document.activeElement.blur();
}
}
}
</script>
<style scoped>
.app-container{
margin-top: 50px;
}
</style>

View File

@@ -0,0 +1,324 @@
<template>
<div class="app-container">
<el-row>
<div style="display: flex;margin: 20px 0">
<van-field v-model="barcode" left-icon="scan" style="width: 270px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px;" @click="getTable2">查询</el-button>
</div>
</el-row>
<el-row style="overflow: auto;height: 660px">
<van-list
v-model="loading_checkOrder"
:finished="true"
finished-text="没有更多了"
>
<van-cell v-for="(item,index) in RepairManagementDataLogTable" :key="index" style="padding: 10px 5px">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.5rem">
<van-tag type="primary" size="large">{{index+1 }}{{ item.工位号 }}</van-tag>
<van-tag type="primary" size="large"> {{ item.物料号 }}</van-tag>
<van-tag v-if="item.操作类型代码 === 6" size="large" type="warning">{{item.操作类型名称}}</van-tag>
<van-tag v-if="item.操作类型代码 === 7" size="large" type="danger">{{item.操作类型名称}}</van-tag>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="24" style="margin-top: 10px">
<div style="margin: 10px 10px 0 0;">
<van-icon name="orders-o" color="#1989fa"/>
<span>生产订单</span>
<span> {{item.订单号 }}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="comment-o" color="#1989fa"/>
<span>物料名称</span>
{{item.零件名称}}
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="scan" color="#1989fa"/>
<span>新条码</span>
{{item.更换物料条码}}
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="scan" color="#1989fa"/>
<span>旧条码</span>
<span> {{item.物料条码}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="clock-o" color="#1989fa"/>
<span>更换时间</span>
<span> {{item.更换时间}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="contact-o" color="#1989fa"/>
<span>操作人员</span>
<span> {{item.更换人}}</span>
</div>
</van-col>
</van-row>
</template>
</van-card>
</van-cell>
</van-list>
</el-row>
</div>
<!-- <el-tab-pane label="返修记录">-->
<!-- <span style="font-size: 1.2rem">产品编号</span>-->
<!-- <el-input v-model="partCode" clearable style="width: 200px" />-->
<!-- <el-button type="primary" icon="el-icon-search" style="margin-left: 15px" @click="getTable2">查询</el-button>-->
<!-- <div style="margin-top: 5px">-->
<!-- <el-table-->
<!-- :data="RepairManagementDataLogTable"-->
<!-- :header-cell-style="{ background: '#F5F5F5', fontSize: '22px' }"-->
<!-- style="width: 100%; border: 1px solid #9e9b9b"-->
<!-- border-->
<!-- height="790px"-->
<!-- tooltip-effect="dark"-->
<!-- @row-click="getTable1"-->
<!-- >-->
<!-- <el-table-column type="index" align="center" label="序号" width="80px" />-->
<!-- <el-table-column align="center" label="订单号" width="180px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.订单号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="工位号" width="120px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.工位号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="物料号" width="180px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.物料号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="物料名称" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.零件名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="数量" width="100px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.零件数量 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="操作方式">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.操作类型名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="新条码">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.更换物料条码 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="旧条码">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.物料条码 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="操作人" width="140px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.更换人 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="返修时间" width="220px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.更换时间 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </div>-->
<!-- </el-tab-pane>-->
<!-- </el-tabs>-->
<!-- </el-row>-->
<!-- &lt;!&ndash; 更换物料 &ndash;&gt;-->
<!-- <el-dialog :visible.sync="RepairManagementReplaceDialogVisible" :append-to-body="true" title="更换物料" center width="400px">-->
<!-- <el-form ref="RepairManagementReplaceForm" :model="RepairManagementReplaceForm" :rules="RepairManagementReplaceRules" label-position="center" label-width="110px" class="demo-ruleForm">-->
<!-- <el-form-item label="物料号" prop="materialCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料名称" prop="materialName">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialName" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原物料条码" prop="materialBarCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="数量" prop="materialCount">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCount" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="更换物料" prop="materialBarCodeNew">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCodeNew" size="small" clearable style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="工位物料" prop="isUsedOpMaterial">-->
<!-- <el-checkbox v-model="RepairManagementReplaceForm.isUsedOpMaterial"></el-checkbox>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button size="small" @click="RepairManagementReplaceCancel('RepairManagementReplaceForm')">取消</el-button>-->
<!-- <el-button type="primary" size="small" @click="RepairManagementReplaceSubmit('RepairManagementReplaceForm')">确定</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- &lt;!&ndash; 物料报废 &ndash;&gt;-->
<!-- <el-dialog :visible.sync="RepairManagementDestroyAllDialogVisible" :append-to-body="true" title="整件报废" center width="400px">-->
<!-- <el-form ref="RepairManagementReplaceForm" :model="RepairManagementReplaceForm" :rules="RepairManagementReplaceRules" label-position="center" label-width="110px" class="demo-ruleForm">-->
<!-- <el-form-item label="物料号" prop="materialCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料名称" prop="materialName">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialName" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原物料条码" prop="materialBarCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="数量" prop="materialCount">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCount" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="更换物料" prop="materialBarCodeNew">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCodeNew" size="small" clearable style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button size="small" @click="RepairManagementReplaceCancel('RepairManagementReplaceForm')">取消</el-button>-->
<!-- <el-button type="primary" size="small" @click="RepairManagementReplaceSubmit('RepairManagementReplaceForm')">确定</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- </div>-->
</template>
<script>
import {Dialog, Toast} from 'vant'
export default {
name: 'RepairManagement',
props: {
pageType: {
type: Number,
default: 0
}
},
data() {
return {
barcode: 'CG1A6220NS241202001',
barcodeMaterial: '',
loading_checkOrder: false,
RepairManagementDataTable: [],
userInfo: '',
showTableData_content: false,
loading_checkOrder_content: false,
RepairManagementMaterialDataTable: [],
showTableData_content_exchange: false,
loading_checkOrder_content_exchange: false,
RepairType: 1,
currentSelectRow: {},
RepairManagementReplaceDialogVisible: false,
RepairManagementDestroyAllDialogVisible: false,
RepairManagementReplaceForm: {
ID: 0,
OpCode: '',
EngineID: '',
isUsedOpMaterial: true,
TraceabilityCode: 0,
materialCount: 0,
materialCode: '',
materialBarCode: '',
materialName: '',
materialBarCodeNew: ''
},
RepairManagementReplaceRules: {
materialBarCodeNew: [{ required: true, message: '请输入/扫描新物料码!', trigger: 'blur' }]
},
RepairManagementType: '1',
partCode: '',
opCode: '',
opCodeS: [],
stationArr: [],
RepairManagementDataLogTable: [],
RepairManagementDataTableOrigin: [],
engineValue: {
OpName: null,
EngineID: null, // 产品编号
EngineType: null, // 产品型号
EngineTypeID: null, // 机型代码
PalletCode: null,
ProcessCode: null, // 程序号
PartPalletCode: null, // 托盘号
PalletInfo: null, // 托盘信息
RepairPartStatusPLC: null,
QualityMask: null,
OrderForm: null, // 订单号
EngineTypeString: null // 产品型号字符串北汽专用
}
}
},
created() {
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
},
mounted() {
document.getElementById('topPageName').innerText = '返修记录'
},
methods: {
getTable2() {
if (this.barcode === '') {
this.$message.error('请输入产品编号!')
return
}
this.RepairManagementDataLogTable = []
const param = []
param[0] = ['发动机号', this.barcode]
const Data = this.CreateData('11', '电子看板_装配零件_返修件_返修记录_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
console.log(response.data)
this.RepairManagementDataLogTable = response.data
} else {
this.RepairManagementDataLogTable = []
}
})
}
}
}
</script>
<style scoped>
.app-container{
margin-top: 50px;
}
.dialog-content {
display: flex;
flex-direction: column;
height: 100%;
}
.dialog-header,
.dialog-footer {
position: sticky;
z-index: 10;
}
.dialog-header {
top: 0;
background-color: white;
padding-top: 26px;
font-weight: 500;
line-height: 24px;
text-align: center;
}
.dialog-footer {
bottom: -3px;
background-color: white;
text-align: center;
margin-top: 10px;
display: flex;
}
.scrollable-content {
flex: 1;
overflow-y: auto;
padding: 10px;
}
</style>

View File

@@ -0,0 +1,891 @@
<template>
<div>
<el-row>
<div style="display: flex;margin: 20px 0">
<van-field v-model="barcode" left-icon="scan" style="width: 270px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px;" @click="getTable">查询</el-button>
</div>
</el-row>
<el-row v-if="pageType === 1">
<div style="display: flex;margin: 0">
<el-button type="warning" icon="el-icon-refresh-right" size="small" style="margin-left: 10px;" @click="RepairManagementReturnOp">物料回仓</el-button>
<el-button type="danger" icon="el-icon-refresh-right" size="small" style="margin-left: 10px;" @click="RepairManagementDestroyShow">扫码报废</el-button>
</div>
</el-row>
<el-row style="overflow: auto;height: 660px">
<van-list
v-model="loading_checkOrder"
:finished="true"
finished-text="没有更多了"
>
<van-cell v-for="(item,index) in RepairManagementDataTable" :key="index" style="padding: 10px 5px">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.5rem">
<van-tag type="primary" size="large">{{ item.工位号 }}{{item.扫码数量 }}</van-tag>
<van-tag v-if="item.是否合格 === '1'" size="large" type="success">OK</van-tag>
<van-tag v-if="item.是否合格 === '2'" size="large" type="danger">NG</van-tag>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="20" style="margin-top: 10px">
<div style="margin: 10px 10px 0 0;">
<van-icon name="contact-o" color="#1989fa"/>
<span>生产订单</span>
<span> {{item.订单号 }}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="contact-o" color="#1989fa"/>
<span>装配人员</span>
{{item.操作者}}
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="clock-o" color="#1989fa"/>
<span>进站时间</span>
{{item.到达时间}}
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="clock-o" color="#1989fa"/>
<span>离站时间</span>
<span> {{item.离开时间}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="comment-o" color="#1989fa"/>
<span>车底盘码</span>
<span> {{item.车体二维码}}</span>
</div>
</van-col>
<van-col span="4" style="margin-top: 10px">
<van-button plain icon="eye-o" size="small" type="info" style="margin-top: 10px" @click="getTable1(item)">查看物料</van-button>
<br/>
<van-button v-if="pageType === 0" plain icon="exchange" size="small" type="warning" style="margin-top: 10px" @click="RepairManagementReplace(item)">更换物料</van-button>
</van-col>
</van-row>
</template>
</van-card>
</van-cell>
</van-list>
</el-row>
<van-dialog
v-model="showTableData_content"
width="95%"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<div class="dialog-content">
<!-- 固定顶部的内容 -->
<div class="dialog-header">物料详情{{currentSelectRow['工位号']}}</div>
<!-- 可滚动的内容区域 -->
<div class="scrollable-content">
<van-list
v-model="loading_checkOrder_content"
:finished="true"
>
<van-cell v-for="(item,index) in RepairManagementMaterialDataTable" :key="index">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.5rem">
<van-tag type="primary" size="large">{{ index+1 }}</van-tag>
</van-row>
<van-row style="font-size: 1.3rem">
<van-col span="20">
<div style="margin: 10px 10px 0 0;">
<van-icon name="location-o" color="#1989fa"/>
<span>物料号</span>
<span> {{item.物料号}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="description-o" color="#1989fa"/>
<span>物料名称</span>
<span> {{item.零件名称}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="scan" color="#1989fa"/>
<span>物料条码</span>
<span> {{item.物料条码}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="bar-chart-o" color="#1989fa"/>
<span>零件数量</span>
<span> {{item.零件数量}}</span>
</div>
</van-col>
<van-col span="4" style="margin-top: 10px">
<van-button v-if="pageType === 1" plain icon="delete" size="small" type="warning" style="margin-top: 10px" @click="RepairManagementDestroy(item)">报废</van-button>
</van-col>
</van-row>
</template>
</van-card>
</van-cell>
</van-list>
</div>
<!-- 固定底部的内容 -->
<div class="dialog-footer">
<van-button plain size="small" style="width: 100%;font-size: 16px;height: 48px;" @click="showTableData_content=false">关闭</van-button>
<!-- <van-button plain size="small" style="width: 100%;font-size: 16px;height: 48px;background-color: #1989fa;color: #fff" @click="editCheckOrder_Finish()">结束工单</van-button>-->
</div>
</div>
</van-dialog>
<van-dialog
v-model="showTableData_content_exchange"
width="95%"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<div class="dialog-content">
<!-- 固定顶部的内容 -->
<div class="dialog-header">物料详情{{RepairManagementReplaceForm.OpCode}}</div>
<!-- 可滚动的内容区域 -->
<div class="scrollable-content">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.3rem;display: flex">
<van-field v-model="barcodeMaterial" left-icon="scan" style="width: 400px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px;" @click="getTableByBarcode">查询</el-button>
</van-row>
<van-radio-group v-if="foundMaterials.length > 1" v-model="selectedMaterialId" @change="onMaterialSelectChange">
<van-cell-group inset style="margin:10px 0;">
<van-cell v-for="material in foundMaterials" :key="material.ID" :title="`${material.零件名称} (${material.物料号})`" clickable style="font-size: 2rem" @click="selectedMaterialId = material.ID">
<template #right-icon>
<van-radio :name="material.ID" />
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
<van-row style="font-size: 2rem">
<div style="margin: 10px 10px 0 0;">
<van-icon name="location-o" color="#1989fa"/>
<span>物料号</span>
<span> {{RepairManagementReplaceForm.materialCode}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="description-o" color="#1989fa"/>
<span>物料名称</span>
<span> {{RepairManagementReplaceForm.materialName}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="bar-chart-o" color="#1989fa"/>
<span>零件数量</span>
<span> {{RepairManagementReplaceForm.materialCount}}</span>
</div>
<van-divider>更换物料</van-divider>
<div style="margin: 10px 10px 0 0;">
<van-form validate-first ref="RepairManagementReplaceForm">
<van-field
v-model="RepairManagementReplaceForm.materialBarCodeNew"
label="新物料条码"
name="checkOrderValue"
placeholder="新物料条码"
:rules="[{ required: true, message: '请输入新物料条码' }]"
/>
<br/>
<van-checkbox v-model="RepairManagementReplaceForm.isUsedOpMaterial" shape="square">线边物料</van-checkbox>
</van-form>
</div>
</van-row>
</template>
</van-card>
</div>
<!-- 固定底部的内容 -->
<div class="dialog-footer">
<van-button plain size="small" style="width: 100%;font-size: 16px;height: 48px;" @click="showTableData_content_exchange=false">关闭</van-button>
<van-button :disabled="!RepairManagementReplaceForm.ID" plain size="small" style="width: 100%;font-size: 16px;height: 48px;background-color: #1989fa;color: #fff" @click="RepairManagementReplaceSubmit('RepairManagementReplaceForm')">确认更换</van-button>
</div>
</div>
</van-dialog>
<van-dialog
v-model="showTableData_content_destroy"
width="95%"
:lock-scroll="false"
:show-cancel-button="false"
:show-confirm-button="false"
style="max-height: 70%!important;overflow: auto"
>
<div class="dialog-content">
<!-- 固定顶部的内容 -->
<div class="dialog-header">物料详情{{RepairManagementReplaceForm.OpCode}}</div>
<!-- 可滚动的内容区域 -->
<div class="scrollable-content">
<van-card class="s-card">
<template #tags>
<van-row style="font-size: 1.3rem;display: flex">
<van-field v-model="barcodeMaterial" left-icon="scan" style="width: 400px;border-radius: 4px;border:1px solid #DCDFE6;height: 36px;line-height: 18px" />
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px;" @click="getTableByBarcode">查询</el-button>
</van-row>
<van-radio-group v-if="foundMaterials.length > 1" v-model="selectedMaterialId" @change="onMaterialSelectChange">
<van-cell-group inset style="margin:10px 0;">
<van-cell v-for="material in foundMaterials" :key="material.ID" :title="`${material.零件名称} (${material.物料号})`" clickable style="font-size: 1.3rem" @click="selectedMaterialId = material.ID">
<template #right-icon>
<van-radio :name="material.ID" />
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
<van-row style="font-size: 1.3rem">
<div style="margin: 10px 10px 0 0;">
<van-icon name="location-o" color="#1989fa"/>
<span>物料号</span>
<span> {{RepairManagementReplaceForm.materialCode}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="description-o" color="#1989fa"/>
<span>物料名称</span>
<span> {{RepairManagementReplaceForm.materialName}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="bar-chart-o" color="#1989fa"/>
<span>零件数量</span>
<span> {{RepairManagementReplaceForm.materialCount}}</span>
</div>
<div style="margin: 10px 10px 0 0;">
<van-icon name="bar-chart-o" color="#1989fa"/>
<span>物料条码</span>
<span> {{RepairManagementReplaceForm.materialBarCode}}</span>
</div>
</van-row>
</template>
</van-card>
</div>
<!-- 固定底部的内容 -->
<div class="dialog-footer">
<van-button plain size="small" style="width: 100%;font-size: 16px;height: 48px;" @click="showTableData_content_destroy=false">关闭</van-button>
<van-button :disabled="!RepairManagementReplaceForm.ID" plain size="small" style="width: 100%;font-size: 16px;height: 48px;background-color: #ff0000;color: #fff" @click="RepairManagementDestroy2(RepairManagementReplaceForm)">报废</van-button>
</div>
</div>
</van-dialog>
</div>
<!-- <div style="width: 99.4%; height: 99%; background-color: #d7dee6; padding: 5px; border: 2px solid #9e9b9b">-->
<!-- <el-row>-->
<!-- <el-tabs type="border-card">-->
<!-- <el-tab-pane label="返修操作">-->
<!-- <el-input v-model="barcode" clearable style="width: 200px" />-->
<!-- <el-button type="primary" icon="el-icon-full-screen" style="margin-left: 15px" @click="getTable">扫描条码</el-button>-->
<!-- <el-radio-group v-model="RepairType" class="myRadio" style="margin-left: 20px">-->
<!-- <el-radio :label="1"><span style="font-size: 20px">物料更换模式</span></el-radio>-->
<!-- <el-radio :label="2"><span style="font-size: 20px">整件报废模式</span></el-radio>-->
<!-- </el-radio-group>-->
<!-- <el-button v-if="RepairType === 2" type="warning" icon="el-icon-delete" style="margin-left: 100px" @click="RepairManagementReturnOp">物料回仓</el-button>-->
<!-- <div style="margin-top: 5px">-->
<!-- <el-col :span="10">-->
<!-- <el-table-->
<!-- :data="RepairManagementDataTable"-->
<!-- :header-cell-style="{ background: '#F5F5F5', fontSize: '22px' }"-->
<!-- style="width: 100%; border: 1px solid #9e9b9b"-->
<!-- border-->
<!-- height="790px"-->
<!-- tooltip-effect="dark"-->
<!-- @row-click="getTable1"-->
<!-- >-->
<!-- <el-table-column align="center" label="工位号" property="工位号" width="180" :filters="stationArr" :filter-method="filterHandler">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.工位号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="订单号">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.订单号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- &lt;!&ndash; <el-table-column align="center" label="车体号" width="100px">&ndash;&gt;-->
<!-- &lt;!&ndash; <template slot-scope="scope">&ndash;&gt;-->
<!-- &lt;!&ndash; {{ scope.row.车体二维码 }}&ndash;&gt;-->
<!-- &lt;!&ndash; </template>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-table-column>&ndash;&gt;-->
<!-- <el-table-column align="center" label="装配人员" width="120px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.装配人员 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="结果" width="120px">-->
<!-- <template slot-scope="scope">-->
<!-- <span v-if="parseInt(scope.row.是否合格) === 1" style="color: #00893d">OK</span>-->
<!-- <span v-else style="color: #ff0000">NG</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </el-col>-->
<!-- <el-col :span="14">-->
<!-- <el-table-->
<!-- :data="RepairManagementMaterialDataTable"-->
<!-- :header-cell-style="{ background: '#F5F5F5', fontSize: '22px' }"-->
<!-- style="width: 99.9%; border: 1px solid #9e9b9b;margin-left: 5px"-->
<!-- border-->
<!-- height="790px"-->
<!-- tooltip-effect="dark"-->
<!-- >-->
<!-- <el-table-column type="index" align="center" label="序号" width="80px" />-->
<!-- <el-table-column align="center" label="物料号" width="200">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.物料号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="物料名称" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.零件名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="物料条码">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.物料条码 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="数量" width="100px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.零件数量 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="操作" width="100px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button v-if="RepairType === 1" type="primary" size="mini" style="font-size: 1rem" @click="RepairManagementReplace(scope.row)" >更换</el-button>-->
<!-- <el-button v-if="RepairType === 2" type="danger" size="mini" style="font-size: 1rem" @click="RepairManagementDestroy(scope.row)" >报废</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </el-col>-->
<!-- </div>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="返修记录">-->
<!-- <span style="font-size: 1.2rem">产品编号</span>-->
<!-- <el-input v-model="partCode" clearable style="width: 200px" />-->
<!-- <el-button type="primary" icon="el-icon-search" style="margin-left: 15px" @click="getTable2">查询</el-button>-->
<!-- <div style="margin-top: 5px">-->
<!-- <el-table-->
<!-- :data="RepairManagementDataLogTable"-->
<!-- :header-cell-style="{ background: '#F5F5F5', fontSize: '22px' }"-->
<!-- style="width: 100%; border: 1px solid #9e9b9b"-->
<!-- border-->
<!-- height="790px"-->
<!-- tooltip-effect="dark"-->
<!-- @row-click="getTable1"-->
<!-- >-->
<!-- <el-table-column type="index" align="center" label="序号" width="80px" />-->
<!-- <el-table-column align="center" label="订单号" width="180px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.订单号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="工位号" width="120px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.工位号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="物料号" width="180px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.物料号 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="物料名称" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.零件名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="数量" width="100px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.零件数量 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="操作方式">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.操作类型名称 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="新条码">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.更换物料条码 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="旧条码">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.物料条码 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="操作人" width="140px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.更换人 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="返修时间" width="220px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.更换时间 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </div>-->
<!-- </el-tab-pane>-->
<!-- </el-tabs>-->
<!-- </el-row>-->
<!-- &lt;!&ndash; 更换物料 &ndash;&gt;-->
<!-- <el-dialog :visible.sync="RepairManagementReplaceDialogVisible" :append-to-body="true" title="更换物料" center width="400px">-->
<!-- <el-form ref="RepairManagementReplaceForm" :model="RepairManagementReplaceForm" :rules="RepairManagementReplaceRules" label-position="center" label-width="110px" class="demo-ruleForm">-->
<!-- <el-form-item label="物料号" prop="materialCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料名称" prop="materialName">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialName" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原物料条码" prop="materialBarCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="数量" prop="materialCount">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCount" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="更换物料" prop="materialBarCodeNew">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCodeNew" size="small" clearable style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="工位物料" prop="isUsedOpMaterial">-->
<!-- <el-checkbox v-model="RepairManagementReplaceForm.isUsedOpMaterial"></el-checkbox>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button size="small" @click="RepairManagementReplaceCancel('RepairManagementReplaceForm')">取消</el-button>-->
<!-- <el-button type="primary" size="small" @click="RepairManagementReplaceSubmit('RepairManagementReplaceForm')">确定</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- &lt;!&ndash; 物料报废 &ndash;&gt;-->
<!-- <el-dialog :visible.sync="RepairManagementDestroyAllDialogVisible" :append-to-body="true" title="整件报废" center width="400px">-->
<!-- <el-form ref="RepairManagementReplaceForm" :model="RepairManagementReplaceForm" :rules="RepairManagementReplaceRules" label-position="center" label-width="110px" class="demo-ruleForm">-->
<!-- <el-form-item label="物料号" prop="materialCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料名称" prop="materialName">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialName" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原物料条码" prop="materialBarCode">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCode" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="数量" prop="materialCount">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialCount" size="small" disabled style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="更换物料" prop="materialBarCodeNew">-->
<!-- <el-input v-model="RepairManagementReplaceForm.materialBarCodeNew" size="small" clearable style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button size="small" @click="RepairManagementReplaceCancel('RepairManagementReplaceForm')">取消</el-button>-->
<!-- <el-button type="primary" size="small" @click="RepairManagementReplaceSubmit('RepairManagementReplaceForm')">确定</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- </div>-->
</template>
<script>
import {Dialog, Toast} from 'vant'
export default {
name: 'RepairManagement',
props: {
pageType: {
type: Number,
default: 0
}
},
data() {
return {
barcode: '',
barcodeMaterial: '',
loading_checkOrder: false,
RepairManagementDataTable: [],
userInfo: '',
showTableData_content: false,
loading_checkOrder_content: false,
RepairManagementMaterialDataTable: [],
showTableData_content_exchange: false,
showTableData_content_destroy: false,
loading_checkOrder_content_exchange: false,
foundMaterials: [],
selectedMaterialId: null,
RepairType: 1,
currentSelectRow: {},
RepairManagementReplaceDialogVisible: false,
RepairManagementDestroyAllDialogVisible: false,
RepairManagementReplaceForm: {
ID: 0,
OpCode: '',
EngineID: '',
isUsedOpMaterial: true,
TraceabilityCode: 0,
materialCount: 0,
materialCode: '',
materialBarCode: '',
materialName: '',
materialBarCodeNew: ''
},
RepairManagementReplaceRules: {
materialBarCodeNew: [{ required: true, message: '请输入/扫描新物料码!', trigger: 'blur' }]
},
RepairManagementType: '1',
partCode: '',
opCode: '',
opCodeS: [],
stationArr: [],
RepairManagementDataLogTable: [],
RepairManagementDataTableOrigin: [],
engineValue: {
OpName: null,
EngineID: null, // 产品编号
EngineType: null, // 产品型号
EngineTypeID: null, // 机型代码
PalletCode: null,
ProcessCode: null, // 程序号
PartPalletCode: null, // 托盘号
PalletInfo: null, // 托盘信息
RepairPartStatusPLC: null,
QualityMask: null,
OrderForm: null, // 订单号
EngineTypeString: null // 产品型号字符串北汽专用
}
}
},
created() {
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
console.log(this.userInfo)
this.getStation()
},
mounted() {
},
methods: {
getStation() {
this.stationArr = []
const Data = this.CreateData('11', '工位与名称_视图_查询')
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.stationArr.push({
label: `${response.data[i].工位号}${response.data[i].工位名称}`,
value: response.data[i].工位号,
text: `${response.data[i].工位号}${response.data[i].工位名称}`,
MesWebCode: response.data[i].MesWebCode
})
}
// this.stationArr.unshift({
// label: `全部工位`,
// value: 'ALL'
// })
// this.opCode = 'ALL'
})
},
getTable() {
this.RepairManagementDataTable = []
this.RepairManagementMaterialDataTable = []
this.currentSelectRow = {}
this.RepairManagementReplaceForm.EngineID = ''
if (this.barcode === '') {
Toast.fail('请先扫描条码!')
return
}
const param = []
param[0] = ['发动机号', this.barcode]
const Data = this.CreateData('11', '质量数据查询_测量数据发动机在线状态_返修工位', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
this.RepairManagementDataTable = response.data
this.RepairManagementReplaceForm.EngineID = response.data[0].发动机号
console.log(this.RepairManagementReplaceForm.EngineID)
} else {
this.RepairManagementDataTable = []
}
// this.$emit('initEngineValue', this.engineValue)
})
},
getTable1(row, isShow = true) {
this.currentSelectRow = row
this.RepairManagementMaterialDataTable = []
const param = []
param[0] = ['工位号', row.工位号]
param[1] = ['发动机号', row.发动机号]
param[2] = ['发动机号_ischeck', 1]
param[3] = ['工位号_ischeck', 1]
param[4] = ['是否禁用', 0]
param[5] = ['PageCurrent', 1]
param[6] = ['PageSize', 1000]
param[7] = ['PageCount', '1111', 'int', '1']
param[8] = ['ItemCount', '1111', 'int', '1']
const Data = this.CreateData('11', '物料数据_视图_查询_返修', param)
this.ExecDatabase(Data).then(response => {
if (response.data.result.length > 0) {
this.RepairManagementMaterialDataTable = response.data.result
this.showTableData_content = isShow
} else {
this.RepairManagementMaterialDataTable = []
}
})
},
getTableByBarcode() {
if (this.barcodeMaterial === '') {
Toast.fail('请输入物料条码!')
return
}
this.RepairManagementReplaceForm.materialCode = ''
this.RepairManagementReplaceForm.materialName = ''
this.RepairManagementReplaceForm.TraceabilityCode = ''
this.RepairManagementReplaceForm.ID = ''
this.RepairManagementReplaceForm.materialCount = ''
this.RepairManagementReplaceForm.materialBarCode = ''
this.RepairManagementReplaceForm.materialBarCodeNew = ''
this.foundMaterials = []
this.selectedMaterialId = null
const param = []
param[0] = ['工位号', this.RepairManagementReplaceForm.OpCode]
param[1] = ['发动机号', this.RepairManagementReplaceForm.EngineID]
param[2] = ['发动机号_ischeck', 1]
param[3] = ['工位号_ischeck', 0]
param[4] = ['二维码_ischeck', 1]
param[5] = ['二维码', this.barcodeMaterial]
param[6] = ['是否禁用', 0]
param[7] = ['PageCurrent', 1]
param[8] = ['PageSize', 1000]
param[9] = ['PageCount', '1111', 'int', '1']
param[10] = ['ItemCount', '1111', 'int', '1']
const Data = this.CreateData('11', '物料数据_视图_查询_返修', param)
this.ExecDatabase(Data).then(response => {
if (response.data.result.length > 0) {
this.foundMaterials = response.data.result
if (this.foundMaterials.length === 1) {
this.selectedMaterialId = this.foundMaterials[0].ID
this.onMaterialSelectChange(this.selectedMaterialId)
}
} else {
Toast.fail('未查询到物料信息!')
}
}).catch(error => {
Toast.fail('查询物料信息失败!')
})
},
onMaterialSelectChange(selectedId) {
const row = this.foundMaterials.find(item => item.ID === selectedId)
if (row) {
this.RepairManagementReplaceForm.materialCode = row.物料号
this.RepairManagementReplaceForm.materialName = row.零件名称
this.RepairManagementReplaceForm.TraceabilityCode = row.追溯代码
this.RepairManagementReplaceForm.ID = row.ID
this.RepairManagementReplaceForm.materialCount = row.零件数量
this.RepairManagementReplaceForm.materialBarCode = row.物料条码
this.RepairManagementReplaceForm.materialBarCodeNew = ''
this.RepairManagementReplaceForm.OpCode = row.工位号
}
},
RepairManagementReplace(row) {
this.RepairManagementReplaceForm.OpCode = row.工位号
this.RepairManagementReplaceForm.EngineID = row.发动机号
this.RepairManagementReplaceForm.materialCode = ''
this.RepairManagementReplaceForm.materialName = ''
this.RepairManagementReplaceForm.TraceabilityCode = ''
this.RepairManagementReplaceForm.ID = ''
this.RepairManagementReplaceForm.materialCount = ''
this.RepairManagementReplaceForm.materialBarCode = ''
this.RepairManagementReplaceForm.materialBarCodeNew = ''
this.barcodeMaterial = ''
this.foundMaterials = []
this.selectedMaterialId = null
this.showTableData_content_exchange = true
},
// 返修替换提交
RepairManagementReplaceSubmit(formName) {
this.$refs[formName].validate().then(()=>{
const param = []
param[0] = ['工位号', this.RepairManagementReplaceForm.OpCode]
param[1] = ['ID', this.RepairManagementReplaceForm.ID]
param[2] = ['追溯代码', this.RepairManagementReplaceForm.TraceabilityCode]
param[3] = ['操作者', this.userInfo.姓名]
param[4] = ['新物料条码', this.RepairManagementReplaceForm.materialBarCodeNew]
param[5] = ['是否消耗工位物料', this.RepairManagementReplaceForm.isUsedOpMaterial ? 1 : 0]
const Data = this.CreateData('11', '电子看板_装配零件_返修件_更换物料_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === 1) {
Toast.success('物料更换成功!')
this.showTableData_content_exchange = false
} else if (response.data[0].result === 2) {
// 物料验证失败,显示具体错误信息
Toast.fail(response.data[0].msg || '物料验证失败!')
} else {
Toast.fail('物料更换失败!')
}
} else {
Toast.fail('物料更换失败!')
}
})
})
},
RepairManagementDestroyShow() {
this.RepairManagementReplaceForm.OpCode = ''
this.RepairManagementReplaceForm.materialCode = ''
this.RepairManagementReplaceForm.materialName = ''
this.RepairManagementReplaceForm.TraceabilityCode = ''
this.RepairManagementReplaceForm.ID = ''
this.RepairManagementReplaceForm.materialCount = ''
this.RepairManagementReplaceForm.materialBarCode = ''
this.RepairManagementReplaceForm.materialBarCodeNew = ''
this.barcodeMaterial = ''
this.foundMaterials = []
this.selectedMaterialId = null
this.showTableData_content_destroy = true
},
getTableAfterDestroy(row) {
const param = []
param[0] = ['发动机号', row.发动机号]
const Data = this.CreateData('11', '质量数据查询_测量数据发动机在线状态_返修工位', param)
this.ExecDatabase(Data).then(response => {
console.log(response.data)
if (response.data.length > 0) {
this.RepairManagementDataTable = response.data
} else {
this.RepairManagementDataTable = []
}
// this.$emit('initEngineValue', this.engineValue)
})
},
// 返修报废提交
RepairManagementDestroy(row) {
Dialog.confirm({
title: '物料报废',
message: `是否报废当前物料【${row.物料号}】【${row.零件名称}】?`
}).then(() => {
const param = []
param[0] = ['工位号', '']
param[1] = ['ID', row.ID]
param[2] = ['追溯代码', row.追溯代码]
param[3] = ['操作者', this.userInfo.姓名]
param[4] = ['新物料条码', '']
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('物料报废成功!')
this.getTable1(this.currentSelectRow, false)
this.getTableAfterDestroy(this.currentSelectRow)
} else {
Toast.success('物料报废失败!')
}
} else {
Toast.success('物料报废失败!')
}
})
}).catch(() => {
Toast({
message: '已取消操作',
icon: 'close',
});
})
},
// 返修报废提交
RepairManagementDestroy2() {
const row = this.RepairManagementReplaceForm
if(row.materialCode === '') {
Toast.fail('请查询物料信息!')
return
}
Dialog.confirm({
title: '物料报废',
message: `是否报废当前物料【${row.materialCode}】【${row.materialName}】?`
}).then(() => {
const param = []
param[0] = ['工位号', '']
param[1] = ['ID', row.ID]
param[2] = ['追溯代码', row.TraceabilityCode]
param[3] = ['操作者', this.userInfo.姓名]
param[4] = ['新物料条码', '']
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('物料报废成功!')
this.getTable1(this.currentSelectRow, false)
this.getTableAfterDestroy(this.currentSelectRow)
this.showTableData_content_destroy = false
} else {
Toast.fail('物料报废失败!')
}
} else {
Toast.fail('物料报废失败!')
}
})
}).catch(() => {
Toast({
message: '已取消操作',
icon: 'close',
});
})
},
// 返修报废 物料回仓
RepairManagementReturnOp() {
if (this.RepairManagementDataTable.length === 0) {
Toast.fail('请先查询产品信息!')
return
}
Dialog.confirm({
title: '物料返回提示',
message: '剩余物料将返回线边库位?'
}).then(() => {
const param = []
param[0] = ['发动机号', this.barcode]
param[1] = ['操作者', this.userInfo.姓名]
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_返回', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
Toast.success('物料回仓成功!')
this.getTableAfterDestroy(this.currentSelectRow)
} else {
Toast.fail('物料回仓失败!')
}
} else {
Toast.fail('物料回仓失败!')
}
})
})
.catch(() => {
Toast({
message: '已取消操作',
icon: 'close',
});
})
}
}
}
</script>
<style scoped>
.dialog-content {
display: flex;
flex-direction: column;
height: 100%;
}
.dialog-header,
.dialog-footer {
position: sticky;
z-index: 10;
}
.dialog-header {
top: 0;
background-color: white;
padding-top: 26px;
font-weight: 500;
line-height: 24px;
text-align: center;
}
.dialog-footer {
bottom: -3px;
background-color: white;
text-align: center;
margin-top: 10px;
display: flex;
}
.scrollable-content {
flex: 1;
overflow-y: auto;
padding: 10px;
}
</style>

View File

@@ -0,0 +1,529 @@
<template>
<div style="width: 99.4%; height: 99%; background-color: #d7dee6; padding: 5px; border: 2px solid #9e9b9b">
<el-row>
<el-tabs type="border-card">
<el-tab-pane label="返修操作">
<el-input v-model="barcode" clearable style="width: 200px" />
<el-button type="primary" icon="el-icon-full-screen" style="margin-left: 15px" @click="getTable">扫描条码</el-button>
<el-radio-group v-model="RepairType" class="myRadio" style="margin-left: 20px">
<el-radio :label="1"><span style="font-size: 20px">物料更换模式</span></el-radio>
<el-radio :label="2"><span style="font-size: 20px">整件报废模式</span></el-radio>
</el-radio-group>
<el-button v-if="RepairType === 2" type="warning" icon="el-icon-delete" style="margin-left: 100px" @click="RepairManagementReturnOp">物料回仓</el-button>
<div style="margin-top: 5px">
<el-col :span="10">
<el-table
:data="RepairManagementDataTable"
:header-cell-style="{ background: '#F5F5F5', fontSize: '22px' }"
style="width: 100%; border: 1px solid #9e9b9b"
border
height="790px"
tooltip-effect="dark"
@row-click="getTable1"
>
<el-table-column align="center" label="工位号" property="工位号" width="180" :filters="stationArr" :filter-method="filterHandler">
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column align="center" label="订单号">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<!-- <el-table-column align="center" label="车体号" width="100px">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.车体二维码 }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="装配人员" width="120px">
<template slot-scope="scope">
{{ scope.row.装配人员 }}
</template>
</el-table-column>
<el-table-column align="center" label="结果" width="120px">
<template slot-scope="scope">
<span v-if="parseInt(scope.row.是否合格) === 1" style="color: #00893d">OK</span>
<span v-else style="color: #ff0000">NG</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="14">
<el-table
:data="RepairManagementMaterialDataTable"
:header-cell-style="{ background: '#F5F5F5', fontSize: '22px' }"
style="width: 99.9%; border: 1px solid #9e9b9b;margin-left: 5px"
border
height="790px"
tooltip-effect="dark"
>
<el-table-column type="index" align="center" label="序号" width="80px" />
<el-table-column align="center" label="物料号" width="200">
<template slot-scope="scope">
{{ scope.row.物料号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料条码">
<template slot-scope="scope">
{{ scope.row.物料条码 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="100px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template slot-scope="scope">
<el-button v-if="RepairType === 1" type="primary" size="mini" style="font-size: 1rem" @click="RepairManagementReplace(scope.row)" >更换</el-button>
<el-button v-if="RepairType === 2" type="danger" size="mini" style="font-size: 1rem" @click="RepairManagementDestroy(scope.row)" >报废</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</div>
</el-tab-pane>
<el-tab-pane label="返修记录">
<span style="font-size: 1.2rem">产品编号</span>
<el-input v-model="partCode" clearable style="width: 200px" />
<el-button type="primary" icon="el-icon-search" style="margin-left: 15px" @click="getTable2">查询</el-button>
<div style="margin-top: 5px">
<el-table
:data="RepairManagementDataLogTable"
:header-cell-style="{ background: '#F5F5F5', fontSize: '22px' }"
style="width: 100%; border: 1px solid #9e9b9b"
border
height="790px"
tooltip-effect="dark"
@row-click="getTable1"
>
<el-table-column type="index" align="center" label="序号" width="80px" />
<el-table-column align="center" label="订单号" width="180px">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column align="center" label="工位号" width="120px">
<template slot-scope="scope">
{{ scope.row.工位号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料号" width="180px">
<template slot-scope="scope">
{{ scope.row.物料号 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" width="100px">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作方式">
<template slot-scope="scope">
{{ scope.row.操作类型名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="新条码">
<template slot-scope="scope">
{{ scope.row.更换物料条码 }}
</template>
</el-table-column>
<el-table-column align="center" label="旧条码">
<template slot-scope="scope">
{{ scope.row.物料条码 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作人" width="140px">
<template slot-scope="scope">
{{ scope.row.更换人 }}
</template>
</el-table-column>
<el-table-column align="center" label="返修时间" width="220px">
<template slot-scope="scope">
{{ scope.row.更换时间 }}
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
</el-row>
<!-- 更换物料 -->
<el-dialog :visible.sync="RepairManagementReplaceDialogVisible" :append-to-body="true" title="更换物料" center width="400px">
<el-form ref="RepairManagementReplaceForm" :model="RepairManagementReplaceForm" :rules="RepairManagementReplaceRules" label-position="center" label-width="110px" class="demo-ruleForm">
<el-form-item label="物料号" prop="materialCode">
<el-input v-model="RepairManagementReplaceForm.materialCode" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="RepairManagementReplaceForm.materialName" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="原物料条码" prop="materialBarCode">
<el-input v-model="RepairManagementReplaceForm.materialBarCode" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="数量" prop="materialCount">
<el-input v-model="RepairManagementReplaceForm.materialCount" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="更换物料" prop="materialBarCodeNew">
<el-input v-model="RepairManagementReplaceForm.materialBarCodeNew" size="small" clearable style="width:200px"/>
</el-form-item>
<el-form-item label="工位物料" prop="isUsedOpMaterial">
<el-checkbox v-model="RepairManagementReplaceForm.isUsedOpMaterial"></el-checkbox>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="RepairManagementReplaceCancel('RepairManagementReplaceForm')">取消</el-button>
<el-button type="primary" size="small" @click="RepairManagementReplaceSubmit('RepairManagementReplaceForm')">确定</el-button>
</div>
</el-dialog>
<!-- 物料报废 -->
<el-dialog :visible.sync="RepairManagementDestroyAllDialogVisible" :append-to-body="true" title="整件报废" center width="400px">
<el-form ref="RepairManagementReplaceForm" :model="RepairManagementReplaceForm" :rules="RepairManagementReplaceRules" label-position="center" label-width="110px" class="demo-ruleForm">
<el-form-item label="物料号" prop="materialCode">
<el-input v-model="RepairManagementReplaceForm.materialCode" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="RepairManagementReplaceForm.materialName" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="原物料条码" prop="materialBarCode">
<el-input v-model="RepairManagementReplaceForm.materialBarCode" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="数量" prop="materialCount">
<el-input v-model="RepairManagementReplaceForm.materialCount" size="small" disabled style="width:200px"/>
</el-form-item>
<el-form-item label="更换物料" prop="materialBarCodeNew">
<el-input v-model="RepairManagementReplaceForm.materialBarCodeNew" size="small" clearable style="width:200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="RepairManagementReplaceCancel('RepairManagementReplaceForm')">取消</el-button>
<el-button type="primary" size="small" @click="RepairManagementReplaceSubmit('RepairManagementReplaceForm')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'RepairManagement',
data() {
return {
RepairType: 1,
currentSelectRow: {},
RepairManagementReplaceDialogVisible: false,
RepairManagementDestroyAllDialogVisible: false,
RepairManagementReplaceForm: {
ID: 0,
isUsedOpMaterial: true,
TraceabilityCode: 0,
materialCount: 0,
materialCode: '',
materialBarCode: '',
materialName: '',
materialBarCodeNew: ''
},
RepairManagementReplaceRules: {
materialBarCodeNew: [{ required: true, message: '请输入/扫描新物料码!', trigger: 'blur' }]
},
RepairManagementType: '1',
partCode: '',
barcode: '',
opCode: '',
opCodeS: [],
stationArr: [],
RepairManagementDataTable: [],
RepairManagementDataLogTable: [],
RepairManagementDataTableOrigin: [],
RepairManagementMaterialDataTable: [],
engineValue: {
OpName: null,
EngineID: null, // 产品编号
EngineType: null, // 产品型号
EngineTypeID: null, // 机型代码
PalletCode: null,
ProcessCode: null, // 程序号
PartPalletCode: null, // 托盘号
PalletInfo: null, // 托盘信息
RepairPartStatusPLC: null,
QualityMask: null,
OrderForm: null, // 订单号
EngineTypeString: null // 产品型号字符串北汽专用
}
}
},
created() {
this.getStation()
},
mounted() {
},
methods: {
getStation() {
this.stationArr = []
const Data = this.CreateData('11', '工位与名称_视图_查询')
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.stationArr.push({
label: `${response.data[i].工位号}${response.data[i].工位名称}`,
value: response.data[i].工位号,
text: `${response.data[i].工位号}${response.data[i].工位名称}`,
MesWebCode: response.data[i].MesWebCode
})
}
// this.stationArr.unshift({
// label: `全部工位`,
// value: 'ALL'
// })
// this.opCode = 'ALL'
})
},
getTable() {
this.RepairManagementDataTable = []
this.RepairManagementMaterialDataTable = []
this.currentSelectRow = {}
if (this.barcode === '') {
this.$message.error('请先扫描条码!')
return
}
const param = []
param[0] = ['工位号', '']
param[1] = ['工位号_check', false]
param[2] = ['发动机号', this.barcode]
param[3] = ['发动机号_check', true]
param[4] = ['开始时间', null]
param[5] = ['结束时间', null]
param[6] = ['PageCurrent', 1]
param[7] = ['PageSize', 100]
param[8] = ['PageCount', '1111', 'int', '1']
param[9] = ['ItemCount', '1111', 'int', '1']
const Data = this.CreateData('11', '质量数据查询_测量数据发动机在线状态', param)
this.ExecDatabase(Data).then(response => {
console.log(response.data)
if (response.data.result.length > 0) {
this.RepairManagementDataTable = response.data.result
this.engineValue.OrderForm = response.data.result[0]['订单号']
this.engineValue.EngineType = response.data.result[0]['机型']
// this.engineValue.EngineTypeID = response.data.result[0]['机型ID']
this.engineValue.EngineID = response.data.result[0]['发动机号']
this.engineValue.PalletInfo = response.data.result[0]['车体二维码']
// this.engineValue.ProcessCode = response.data.result[0]['上线总排序']
} else {
this.RepairManagementDataTable = []
this.engineValue.OrderForm = ''
this.engineValue.EngineType = ''
// this.engineValue.EngineTypeID = response.data.result[0]['机型ID']
this.engineValue.EngineID = ''
this.engineValue.PalletInfo = ''
// this.engineValue.ProcessCode = response.data.result[0]['上线总排序']
}
this.$emit('initEngineValue', this.engineValue)
})
},
getTable1(row) {
this.currentSelectRow = row
this.RepairManagementMaterialDataTable = []
const param = []
param[0] = ['工位号', row.工位号]
param[1] = ['发动机号', row.发动机号]
param[2] = ['发动机号_ischeck', 1]
param[3] = ['工位号_ischeck', 1]
param[4] = ['是否禁用', 0]
param[5] = ['PageCurrent', 1]
param[6] = ['PageSize', 100]
param[7] = ['PageCount', '1111', 'int', '1']
param[8] = ['ItemCount', '1111', 'int', '1']
const Data = this.CreateData('11', '物料数据_视图_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.result.length > 0) {
console.log(response.data.result)
this.RepairManagementMaterialDataTable = response.data.result
} else {
this.RepairManagementMaterialDataTable = []
}
})
},
getTable2() {
if (this.partCode === '') {
this.$message.error('请输入产品编号!')
return
}
this.RepairManagementDataLogTable = []
const param = []
param[0] = ['发动机号', this.partCode]
const Data = this.CreateData('11', '电子看板_装配零件_返修件_返修记录_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
console.log(response.data)
this.RepairManagementDataLogTable = response.data
} else {
this.RepairManagementDataLogTable = []
}
})
},
filterHandler(value, row, column) {
const property = column['property']
this.RepairManagementMaterialDataTable = []
return row[property] === value
},
RepairManagementReplace(row) {
this.RepairManagementReplaceForm.materialCode = row.物料号
this.RepairManagementReplaceForm.materialName = row.零件名称
this.RepairManagementReplaceForm.TraceabilityCode = row.追溯代码
this.RepairManagementReplaceForm.ID = row.ID
this.RepairManagementReplaceForm.materialCount = row.零件数量
this.RepairManagementReplaceForm.materialBarCode = row.物料条码
this.RepairManagementReplaceForm.materialBarCodeNew = ''
this.RepairManagementReplaceDialogVisible = true
},
// 返修替换提交
RepairManagementReplaceSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
const param = []
param[0] = ['工位号', this.$store.state.station.stationName]
param[1] = ['ID', this.RepairManagementReplaceForm.ID]
param[2] = ['追溯代码', this.RepairManagementReplaceForm.TraceabilityCode]
param[3] = ['操作者', this.$store.state.user.name]
param[4] = ['新物料条码', this.RepairManagementReplaceForm.materialBarCodeNew]
param[5] = ['是否消耗工位物料', this.RepairManagementReplaceForm.isUsedOpMaterial ? 1 : 0]
const Data = this.CreateData('11', '电子看板_装配零件_返修件_更换物料_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result == 1) {
this.$message.success('物料更换成功!')
this.RepairManagementReplaceDialogVisible = false
this.getTable1(this.currentSelectRow)
} else if (response.data[0].result == 2) {
// 物料验证失败,显示具体错误信息
this.$message.error(response.data[0].msg || '物料验证失败!')
} else {
this.$message.error('物料更换失败!')
}
} else {
this.$message.error('物料更换失败!')
}
})
}
})
},
// 返修替换取消
RepairManagementReplaceCancel(formName) {
if (this.$refs[formName] !== undefined) {
this.$refs[formName].resetFields()
}
this.RepairManagementReplaceDialogVisible = false
},
RepairManagementDestroy(row) {
this.$confirm(`是否报废当前物料【${row.物料号}】【${row.零件名称}】?`, '物料报废', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = []
param[0] = ['工位号', this.$store.state.station.stationName]
param[1] = ['ID', row.ID]
param[2] = ['追溯代码', row.追溯代码]
param[3] = ['操作者', this.$store.state.user.name]
param[4] = ['新物料条码', '']
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
this.$message.success('物料报废成功!')
this.getTable1(this.currentSelectRow)
} else {
this.$message.error('物料报废失败!')
}
} else {
this.$message.error('物料报废失败!')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作!'
})
})
},
RepairManagementReturnOp() {
if (this.barcode === '') {
this.$message.error('请先扫描条码!')
return
}
this.$confirm(`剩余物料将返回线边库位?`, '物料返回', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const param = []
param[0] = ['发动机号', this.barcode]
param[1] = ['操作者', this.$store.state.user.name]
const Data = this.CreateData('12', '电子看板_装配零件_返修件_报废物料_返回', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
if (response.data[0].result === '1') {
this.$message.success('物料回仓成功!')
this.getTable1(this.currentSelectRow)
} else {
this.$message.error('物料回仓失败!')
}
} else {
this.$message.error('物料回仓失败!')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作!'
})
})
}
}
}
</script>
<style scoped>
::v-deep.el-table .el-table__row .cell{
line-height: 24px;
font-size: 20px !important;
}
::v-deep.el-table .el-table__cell {
padding: 11px 0;
}
::v-deep .el-table__column-filter-trigger {
line-height: 24px;
}
::v-deep .el-tabs__item {
padding: 0 32px !important;
color: #005bac !important;
}
::v-deep.el-tabs__item.is-active {
background-color: #005bac;
}
::v-deep.el-tabs--border-card>.el-tabs__header .el-tabs__item {
font-size: 33px;
font-weight: bolder;
font-family: 等线, serif;
width: 214px;
height: 64px;
line-height: 64px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 2px solid #0758bf !important;
}
::v-deep.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active {
background-color: #005bac;
color: #fff !important;
font-weight: bolder;
}
</style>

264
src/views/login.vue Normal file
View File

@@ -0,0 +1,264 @@
<template>
<div class="main">
<div class="content">
<div class="h01">离线返修</div>
<div class="c_in">
<el-input
placeholder="账户"
prefix-icon="el-icon-user"
v-model="username"
class="inp">
</el-input>
</div>
<div class="c_in">
<el-input
placeholder="密码"
prefix-icon="el-icon-lock"
v-model="password"
show-password
class="inp">
</el-input>
</div>
<el-button class="btn" :loading="loading" @click.native.prevent="signIn">登陆</el-button>
</div>
</div>
</template>
<script>
import request from '@/utils/request'
export default {
created() {
console.log('login')
this.$parent.showNav = true
let _this = this
this.setFontSize()
window.onresize = function() {
_this.setFontSize()
}
},
mounted() {
localStorage.userInfo = ''
localStorage.pdaId = ''
this.showNav = false
},
data() {
return {
pda: '',
pdaId: 'PDA_5X_CK2_KK',
loading: false,
username: '',
password: '',
pickerShow: false,
columns: [
// {
// label: 'GF9机加车间',
// id: 'PDA_5X_GF9_JJ'
// },
// {
// label: '493机加车间',
// id: 'PDA_5X_493_JJ'
// },
// {
// label: '375装配车间',
// id: 'PDA_5X_375_ZP'
// },
// {
// label: '375机加车间',
// id: 'PDA_5X_375_JJ'
// },
// {
// label: 'GF9装配车间',
// id: 'PDA_5X_GF9_ZP'
// },
// {
// label: '机油泵车间',
// id: 'PDA_5X_OilPump'
// },
// {
// label: '电子泵车间',
// id: 'PDA_5X_ElectronicPump'
// }
{
label: '仓库1',
id:'PDA_5X_CK1_KK'
},
{
label: '仓库2',
id:'PDA_5X_CK2_KK'
}
]
}
},
methods: {
setFontSize() {
document.documentElement.style.fontSize = document.documentElement.clientWidth * 8 / 320 + 'px'
},
signIn() {
if (this.username === '' || this.password === '' || this.pdaId === '') {
this.$message.warning('用户名,密码为空')
} else {
this.loading = true
const param = {
method: 'post',
data: {
type: '1',
name: '菜单模块系统_用户名密码_查询数据_改造新增',
param: `用户名=${this.username}&密码=${this.password}`
}
}
request(param).then(res => {
this.loading = false
if (res.data.length === 0 || res.data[0].result === '0') {
this.$message.error('用户名或密码错误')
} else {
this.$store.dispatch('saveUserInfo', res.data[0])
localStorage.userInfo = JSON.stringify(res.data[0])
localStorage.pdaId = JSON.stringify(this.pdaId)
this.$router.push({
path: '/main'
})
}
}).catch(err => {
console.log(err)
this.loading = false
this.$message.error(err)
})
}
}
},
computed: {},
components: {},
watch: {},
props: {}
}
</script>
<style lang="less" scoped>
.main {
height: 100%;
width: 100%;
display: flex;
justify-content: center;
background-size: cover;
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
padding-top: 12rem;
overflow: auto;
box-sizing: border-box;
}
.content {
display: flex;
align-items: center;
flex-direction: column;
//overflow: hidden;
/deep/.el-range-editor.is-active,
/deep/.el-range-editor.is-active:hover,
/deep/.el-select .el-input.is-focus .el-input__inner {
border-color: #000;
}
/deep/.el-select .el-input__inner:focus {
border-color: #000;
}
.eSelect {
width: 26rem;
margin-top: 2rem;
}
/deep/.el-input__inner {
background-color: transparent;
border-top: 0;
border-left: 0;
border-right: 0;
border-radius: 0;
border: none;
color: #000;
font-size: 2.5rem;
height: 2.5rem;
line-height: 2.5rem;
/deep/.el-input__icon {
line-height: 1;
font-size: 1.5rem;
}
}
/deep/.el-input .el-input__clear{
font-size: 1.5rem;
}
}
input::input-placeholder {
color: #000;
}
input::-webkit-input-placeholder {
color: #000;
}
input::-moz-placeholder {
/* Mozilla Firefox 19+ */
color:#000;
}
input:-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color:#000;
}
input:-ms-input-placeholder {
/* Internet Explorer 10-11 */
color:#000;
}
.c_in {
display: flex;
justify-content: center;
img {
//position: absolute;
left: 7rem;
margin-top: 3rem;
height: 3rem;
width: 3rem;
}
}
.content .inp {
//margin-left: -70px;
border-style: none;
outline: none;
background: none;
border-bottom: 1px solid #000 !important;
color: #000;
font-size: 2.5rem;
margin-top: 3rem;
width: 22rem;
padding-left: 2.5rem;
}
.content .btn {
width: 26rem;
margin-top: 3rem;
border-style: none;
outline: none;
border-radius: 3rem;
font-size: 2rem;
background-color: #0128a9;
cursor: pointer;
color: #fff;
}
.content .h01 {
color: #0128a9;
font-weight: bold;
font-size: 3.2rem;
}
.content .h02 {
color: #000;
font-size: 1.4rem;
padding-bottom: 2rem;
}
</style>

117
src/views/main.vue Normal file
View File

@@ -0,0 +1,117 @@
<template>
<div class="main">
<van-row>
<div style="margin-left: 50px;display: flex;align-items: center;">
<van-icon name="friends-o" size="50" color="#1989fa" />
<span style="font-size: 30px">{{userInfo.姓名}}</span>
</div>
</van-row>
<van-row>
<van-col span="12">
<van-button class="big-btn" type="info" @click="routeJump('ChangeMaterial')">
<van-icon name="notes-o" size="60" color="#ffffff" />
<br>
<i>更换物料</i>
</van-button>
</van-col>
<van-col span="12">
<van-button class="big-btn" type="primary" @click="routeJump('ProductScrapping')">
<van-icon name="records-o" size="60" color="#ffffff" />
<br>
<i>报废解体</i>
</van-button>
</van-col>
</van-row>
<van-row>
<van-col span="12">
<van-button class="big-btn" type="warning" @click="routeJump('RepairSearch')">
<van-icon name="todo-list-o" size="60" color="#ffffff" />
<br>
<i>返修记录</i>
</van-button>
</van-col>
<van-col span="12">
<van-button class="big-btn" type="danger" @click="routeJump('')">
<van-icon name="notes-o" size="60" color="#ffffff" />
<br>
<i>退出登录</i>
</van-button>
</van-col>
</van-row>
<!-- <van-row v-if="planCount !== 0">-->
<!-- <div style="margin-left: 50px;display: flex;align-items: center;">-->
<!-- <van-icon name="info-o" size="30" color="#1989fa" />-->
<!-- <span style="font-size: 20px">消息提醒</span>-->
<!-- <span style="font-size: 20px">共有{{planCount}}待执行的计划<a style="font-size: 25px;padding: 0 10px;color: #3a8ee6" @click="routeJump('CheckPlanExec')">前去执行</a></span>-->
<!-- </div>-->
<!-- </van-row>-->
</div>
</template>
<script>
import {getBeforeOrAfterTime, getNowTime2} from '../utils/tool'
export default {
computed: {},
components: {},
watch: {},
props: {},
data() {
return {
planCount: 0,
pageCurrent: 1,
pageSize: 10000,
dateTime: [],
userInfo: {
姓名: ''
}
}
},
created() {
this.dateTime = [getBeforeOrAfterTime(-30), getNowTime2()]
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
// this.fetchData()
},
mounted() {
document.getElementById('topPageName').innerText = '首页'
},
methods: {
routeJump(val){
if (val.indexOf('/') !== -1) {
val = val.substring(1)
}
this.$router.push({
path: '/' + val
})
},
fetchData() {
var param = []
param[0] = ['开始日期', this.dateTime[0]]
param[1] = ['结束日期', this.dateTime[1]]
param[2] = ['检验员id', this.userInfo['人员编号']]
param[3] = ['PageCurrent', this.pageCurrent]
param[4] = ['PageSize', this.pageSize]
param[5] = ['PageCount', 1000, 'int', '1']
param[6] = ['ItemCount', 1000, 'int', '1']
var Data = this.CreateData('11', '质检_工单_未完成_查询', param)
this.ExecDatabase(Data).then(response => {
this.planCount = parseInt(response.data.output[0].ItemCount)
})
},
},
}
</script>
<style lang="less" scoped>
.main {
margin-top: 60px;
}
.big-btn {
margin: 20px 30px;
height: 250px;
width: 85%;
font-size: 3rem;
}
</style>