版本1
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
const getters = {
|
||||
sidebar: state => state.app.sidebar,
|
||||
size: state => state.app.size,
|
||||
device: state => state.app.device,
|
||||
visitedViews: state => state.tagsView.visitedViews,
|
||||
cachedViews: state => state.tagsView.cachedViews,
|
||||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
name: state => state.user.name,
|
||||
userId: state => state.user.userInfo.userId,
|
||||
introduction: state => state.user.introduction,
|
||||
roles: state => state.user.roles,
|
||||
permissions: state => state.user.permissions,
|
||||
permission_routes: state => state.permission.routes,
|
||||
userinfo: state => state.user.userInfo,
|
||||
topbarRouters: state => state.permission.topbarRouters,
|
||||
defaultRoutes: state => state.permission.defaultRoutes,
|
||||
sidebarRouters: state => state.permission.sidebarRouters,
|
||||
onlineUserNum: state => state.socket.onlineNum,
|
||||
noticeList: state => state.socket.noticeList
|
||||
sidebar: (state) => state.app.sidebar,
|
||||
size: (state) => state.app.size,
|
||||
device: (state) => state.app.device,
|
||||
visitedViews: (state) => state.tagsView.visitedViews,
|
||||
cachedViews: (state) => state.tagsView.cachedViews,
|
||||
token: (state) => state.user.token,
|
||||
avatar: (state) => state.user.avatar,
|
||||
name: (state) => state.user.name,
|
||||
userId: (state) => state.user.userInfo.userId,
|
||||
introduction: (state) => state.user.introduction,
|
||||
roles: (state) => state.user.roles,
|
||||
permissions: (state) => state.user.permissions,
|
||||
permission_routes: (state) => state.permission.routes,
|
||||
userinfo: (state) => state.user.userInfo,
|
||||
topbarRouters: (state) => state.permission.topbarRouters,
|
||||
defaultRoutes: (state) => state.permission.defaultRoutes,
|
||||
sidebarRouters: (state) => state.permission.sidebarRouters,
|
||||
onlineUserNum: (state) => state.socket.onlineNum,
|
||||
noticeList: (state) => state.socket.noticeList,
|
||||
counterList: (state) => state.socket.counter,
|
||||
}
|
||||
export default getters
|
||||
export default getters
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
const state = {
|
||||
onlineNum: 0,
|
||||
noticeList: []
|
||||
noticeList: [],
|
||||
counter:0
|
||||
|
||||
}
|
||||
const mutations = {
|
||||
SET_ONLINEUSER_NUM: (state, num) => {
|
||||
@@ -8,7 +10,10 @@ const mutations = {
|
||||
},
|
||||
SET_NOTICE_list: (state, data) => {
|
||||
state.noticeList = data;
|
||||
}
|
||||
},
|
||||
SET_GetCache: (state, data) => {
|
||||
state.counter = data;
|
||||
},
|
||||
}
|
||||
|
||||
const actions = {
|
||||
@@ -19,9 +24,17 @@ const actions = {
|
||||
// 更新系统通知
|
||||
getNoticeList({ commit }, data) {
|
||||
commit('SET_NOTICE_list', data)
|
||||
},
|
||||
|
||||
//更新缺陷点击
|
||||
GetCache({commit},data){
|
||||
commit("SET_GetCache",data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
// 接收欢迎语
|
||||
connection.on('welcome', (data) => {
|
||||
console.log('welcome', data)
|
||||
// Notification.info(data)
|
||||
// Notification.info(data)
|
||||
})
|
||||
// 接收后台手动推送消息
|
||||
connection.on('receiveNotice', (title, data) => {
|
||||
@@ -83,6 +83,11 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
//接受缓存
|
||||
connection.on('GetCache', (checkid, sum) => {
|
||||
store.dispatch('socket/GetCache', {checkid,sum})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
@@ -104,13 +104,13 @@ export default {
|
||||
name: 'firstFQC',
|
||||
data() {
|
||||
return {
|
||||
|
||||
paint: [{ inspectionModule: '' }],
|
||||
device: [{ inspectionModule: '' }],
|
||||
blank: [{ inspectionModule: '' }], // 毛坯
|
||||
program: [{ inspectionModule: '' }], // 程序
|
||||
team: [{ inspectionModule: '' }], //班组
|
||||
|
||||
checkItemTable: {
|
||||
paint: [{ inspectionModule: '' }],
|
||||
device: [{ inspectionModule: '' }],
|
||||
blank: [{ inspectionModule: '' }], // 毛坯
|
||||
program: [{ inspectionModule: '' }], // 程序
|
||||
team: [{ inspectionModule: '' }], //班组
|
||||
},
|
||||
ProductSituationForm: {
|
||||
name: '',
|
||||
},
|
||||
@@ -129,6 +129,21 @@ export default {
|
||||
.then((result) => {
|
||||
if (result.code == 200) {
|
||||
this.checkItemTable = result.data
|
||||
this.checkItemTable.paint.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
})
|
||||
this.checkItemTable.device.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
})
|
||||
this.checkItemTable.blank.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
})
|
||||
this.checkItemTable.program.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
})
|
||||
this.checkItemTable.team.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((err) => {})
|
||||
@@ -18,52 +18,62 @@
|
||||
<div>
|
||||
<div class="grid">
|
||||
<div class="a">
|
||||
<div class="title_sub">{{ checkItemTable.paint[0].inspectionModule }}</div>
|
||||
<div class="title_sub">{{ paint[0].inspectionModule }}</div>
|
||||
<div class="grid_sub">
|
||||
<div class="a_11" v-for="(item, index) of checkItemTable.paint" :key="index">
|
||||
<el-badge :value="item.Counter" type="primary"
|
||||
><div class="context" @click="Accumulator(item, index)">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
<div class="a_11" v-for="(item, index) of paint" :key="index">
|
||||
<div @click="Accumulator(item, index)" class="button_">
|
||||
<el-badge :value="item.counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b">
|
||||
<div class="title_sub">{{ checkItemTable.device[0].inspectionModule }}</div>
|
||||
<div class="title_sub">{{ device[0].inspectionModule }}</div>
|
||||
<div class="grid_sub">
|
||||
<div class="a_11" v-for="(item, index) of checkItemTable.device" :key="index">
|
||||
<el-badge :value="item.Counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
<div class="a_11" v-for="(item, index) of device" :key="index">
|
||||
<div @click="Accumulator(item, index)" class="button_">
|
||||
<el-badge :value="item.counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="c">
|
||||
<div class="title_sub">{{ checkItemTable.blank[0].inspectionModule }}</div>
|
||||
<div class="title_sub">{{ blank[0].inspectionModule }}</div>
|
||||
<div class="grid_sub">
|
||||
<div class="a_11" v-for="(item, index) of checkItemTable.blank" :key="index">
|
||||
<el-badge :value="item.Counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
<div class="a_11" v-for="(item, index) of blank" :key="index">
|
||||
<div @click="Accumulator(item, index)" class="button_">
|
||||
<el-badge :value="item.counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d">
|
||||
<div class="title_sub">{{ checkItemTable.program[0].inspectionModule }}</div>
|
||||
<div class="title_sub">{{ program[0].inspectionModule }}</div>
|
||||
<div class="grid_sub">
|
||||
<div class="a_11" v-for="(item, index) of checkItemTable.program" :key="index">
|
||||
<el-badge :value="item.Counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
<div class="a_11" v-for="(item, index) of program" :key="index">
|
||||
<div @click="Accumulator(item, index)" class="button_">
|
||||
<el-badge :value="item.counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="e">
|
||||
<div class="title_sub">{{ checkItemTable.team[0].inspectionModule }}</div>
|
||||
<div class="title_sub">{{ team[0].inspectionModule }}</div>
|
||||
<div class="grid_sub">
|
||||
<div class="a_11" v-for="(item, index) of checkItemTable.team" :key="index">
|
||||
<el-badge :value="item.Counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
<div class="a_11" v-for="(item, index) of team" :key="index">
|
||||
<div @click="Accumulator(item, index)" class="button_">
|
||||
<el-badge :value="item.counter" type="primary"
|
||||
><div class="context">{{ item.inspectionName }}</div></el-badge
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,17 +110,17 @@
|
||||
|
||||
<script>
|
||||
import { GetcheckItemTable } from '@/api/qualityManagement/firstFQC.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'firstFQC',
|
||||
data() {
|
||||
return {
|
||||
checkItemTable: {
|
||||
paint: [{ inspectionModule: '' }],
|
||||
device: [{ inspectionModule: '' }],
|
||||
blank: [{ inspectionModule: '' }], // 毛坯
|
||||
program: [{ inspectionModule: '' }], // 程序
|
||||
team: [{ inspectionModule: '' }], //班组
|
||||
},
|
||||
paint: [{ inspectionModule: '' }],
|
||||
device: [{ inspectionModule: '' }],
|
||||
blank: [{ inspectionModule: '' }], // 毛坯
|
||||
program: [{ inspectionModule: '' }], // 程序
|
||||
team: [{ inspectionModule: '' }], //班组
|
||||
|
||||
ProductSituationForm: {
|
||||
name: '',
|
||||
},
|
||||
@@ -118,6 +128,12 @@ export default {
|
||||
data: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['counterList']),
|
||||
},
|
||||
created() {
|
||||
this.getCheckItemList()
|
||||
},
|
||||
@@ -128,21 +144,25 @@ export default {
|
||||
GetcheckItemTable()
|
||||
.then((result) => {
|
||||
if (result.code == 200) {
|
||||
this.checkItemTable = result.data
|
||||
this.checkItemTable.paint.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
this.paint = result.data.paint
|
||||
this.paint.forEach((item) => {
|
||||
if (item.counter == null) item.counter = 0
|
||||
})
|
||||
this.checkItemTable.device.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
this.device = result.data.device
|
||||
this.device.forEach((item) => {
|
||||
if (item.counter == null) item.counter = 0
|
||||
})
|
||||
this.checkItemTable.blank.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
this.blank = result.data.blank
|
||||
this.blank.forEach((item) => {
|
||||
if (item.counter == null) item.counter = 0
|
||||
})
|
||||
this.checkItemTable.program.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
this.program = result.data.program
|
||||
this.program.forEach((item) => {
|
||||
if (item.counter == null) item.counter = 0
|
||||
})
|
||||
this.checkItemTable.team.forEach((item, index) => {
|
||||
item.Counter = 0
|
||||
this.team = result.data.team
|
||||
this.team.forEach((item) => {
|
||||
if (item.counter == null) item.counter = 0
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -152,14 +172,37 @@ export default {
|
||||
Accumulator(item, index) {
|
||||
switch (item.inspectionModule) {
|
||||
case '油漆':
|
||||
this.checkItemTable.paint.filter((it) => it.id == item.id)[0].Counter++
|
||||
console.log(
|
||||
'this.checkItemTable.paint.filter((it) => it.id == item.id)[0].Counter',
|
||||
this.checkItemTable.paint.filter((it) => it.id == item.id)[0].Counter,
|
||||
// 把数据传递到redis
|
||||
this.signalr.SR.invoke('SaveCacheInformation', '工单号', 'id', this.paint.filter((it) => it.id == item.id)[0].counter + 1).catch(
|
||||
(err) => {
|
||||
console.log(err)
|
||||
},
|
||||
)
|
||||
// redis再将数据返回
|
||||
this.paint.filter((it) => it.id == item.id)[0].counter = this.counterList.sum
|
||||
break
|
||||
case '设备':
|
||||
this.device.filter((it) => it.id == item.id)[0].counter++
|
||||
break
|
||||
case '毛坯':
|
||||
this.blank.filter((it) => it.id == item.id)[0].counter++
|
||||
break
|
||||
case '程序':
|
||||
this.program.filter((it) => it.id == item.id)[0].counter++
|
||||
break
|
||||
case '班组操作':
|
||||
this.team.filter((it) => it.id == item.id)[0].counter++
|
||||
break
|
||||
default:
|
||||
this.$notify.warning('异常操作,警告')
|
||||
break
|
||||
}
|
||||
},
|
||||
//todo 数据同步
|
||||
/*
|
||||
1.从后台获取数据
|
||||
|
||||
*/
|
||||
|
||||
//todo 初始话 signalR
|
||||
/*initSignalR() {
|
||||
@@ -321,4 +364,8 @@ export default {
|
||||
.context {
|
||||
margin: 0.5em 1em;
|
||||
}
|
||||
.button_ {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user