diff --git a/src/api/qualityManagement/thirtyFQC.js b/src/api/qualityManagement/thirtyFQC.js index 1ee551c..1eed949 100644 --- a/src/api/qualityManagement/thirtyFQC.js +++ b/src/api/qualityManagement/thirtyFQC.js @@ -56,4 +56,14 @@ export function calculate_packagingInvestment(query) { method: 'get', params: query, }) +} + + +// 更改工单状态 +export function update_workorder_status(query) { + return request({ + url: '/mes/qc/FQC/update_workorder_status', + method: 'get', + params: query, + }) } \ No newline at end of file diff --git a/src/permission.js b/src/permission.js index 8b2c75f..76793c8 100644 --- a/src/permission.js +++ b/src/permission.js @@ -9,7 +9,7 @@ NProgress.configure({ showSpinner: false }) -const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/demo',"/firstFQC","/thirtyFQC"] //白名单 +const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/demo',"/firstFQC","/againFQC","/thirtyFQC"] //白名单 router.beforeEach((to, from, next) => { NProgress.start() diff --git a/src/store/getters.js b/src/store/getters.js index f746252..6c55599 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -21,7 +21,7 @@ const getters = { counterList_v1: (state) => state.socket.counter_v1, counterList_v2: (state) => state.socket.counter_v2, counterList_v3: (state) => state.socket.counter_v3, - polishetotalNumber:(state)=>state.inspection.polishetotalNumber + } diff --git a/src/store/index.js b/src/store/index.js index fd1d0db..ecbbcd7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,7 +1,6 @@ import Vue from 'vue' import Vuex from 'vuex' import app from './modules/app' -import inspection from './modules/inspection' import user from './modules/user' import tagsView from './modules/tagsView' import permission from './modules/permission' @@ -20,7 +19,6 @@ const state = { const store = new Vuex.Store({ modules: { app, - inspection, user, tagsView, permission, diff --git a/src/store/modules/inspection.js b/src/store/modules/inspection.js deleted file mode 100644 index c0a03d9..0000000 --- a/src/store/modules/inspection.js +++ /dev/null @@ -1,30 +0,0 @@ -import { calculate_polish_total_number } from '@/api/qualityManagement/firstFQC.js' -const state = { - polishetotalNumber: 0, -} - -const mutations = { - SET_polish_total_number: (state, num) => { - state.polishetotalNumber = num - }, -} - -const actions = { - //传入工单号 - change_polish_total_number({ commit }, workorder_id) { - //计算抛光数总数 - calculate_polish_total_number({ workorder_id }).then((res) => { - if (res.code == 200) { - commit('SET_polish_total_number', res.data) - } - }) - }, -} - - -export default { - namespaced: true, - state, - mutations, - actions -} \ No newline at end of file diff --git a/src/views/qualityManagement/FQC/againFQC.vue b/src/views/qualityManagement/FQC/againFQC.vue index 76042b2..4e5125d 100644 --- a/src/views/qualityManagement/FQC/againFQC.vue +++ b/src/views/qualityManagement/FQC/againFQC.vue @@ -994,18 +994,17 @@ export default { }) }, - //todo 累加器 这里是值传递还是引用传递?????????????????????????????? - Accumulator(item) { + //todo 累加器 这里是值传递还是引用传递?????????????????????????????? + Accumulator(item) { let query = {} query.workorder_id = this.CurrentWorkorder.clientWorkorder query.checkid = item.id - item.counter++ - query.counter = item.counter + query.number = 1 + query.inspectionModule = item.inspectionModule accumulator_query(query).then((res) => { if (res.code == 200) { item.counter = res.data - console.log(item.counter) } }) }, @@ -1026,25 +1025,69 @@ export default { confirm() { switch (this.toname) { case 'paint': - this.paint[this.toindex].counter = this.toUpdateNum - 1 + let query = {} + query.workorder_id = this.CurrentWorkorder.clientWorkorder + query.checkid = this.paint[this.toindex].id + query.number = this.toUpdateNum - this.paint[this.toindex].counter + query.inspectionModule = this.paint[this.toindex].inspectionModule - this.Accumulator(this.paint[this.toindex]) + accumulator_query(query).then((res) => { + if (res.code == 200) { + this.paint[this.toindex].counter = res.data + } + }) break case 'blank': - this.blank[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.blank[this.toindex]) + let query1 = {} + query1.workorder_id = this.CurrentWorkorder.clientWorkorder + query1.checkid = this.blank[this.toindex].id + query1.number = this.toUpdateNum - this.blank[this.toindex].counter + query1.inspectionModule = this.blank[this.toindex].inspectionModule + + accumulator_query(query1).then((res) => { + if (res.code == 200) { + this.blank[this.toindex].counter = res.data + } + }) break case 'team': - this.team[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.team[this.toindex]) + let query2 = {} + query2.workorder_id = this.CurrentWorkorder.clientWorkorder + query2.checkid = this.team[this.toindex].id + query2.number = this.toUpdateNum - this.team[this.toindex].counter + query2.inspectionModule = this.team[this.toindex].inspectionModule + + accumulator_query(query2).then((res) => { + if (res.code == 200) { + this.team[this.toindex].counter = res.data + } + }) break case 'device': - this.device[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.device[this.toindex]) + let query3 = {} + query3.workorder_id = this.CurrentWorkorder.clientWorkorder + query3.checkid = this.device[this.toindex].id + query3.number = this.toUpdateNum - this.device[this.toindex].counter + query3.inspectionModule = this.device[this.toindex].inspectionModule + + accumulator_query(query3).then((res) => { + if (res.code == 200) { + this.device[this.toindex].counter = res.data + } + }) break case 'program': - this.program[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.program[this.toindex]) + let query4 = {} + query4.workorder_id = this.CurrentWorkorder.clientWorkorder + query4.checkid = this.program[this.toindex].id + query4.number = this.toUpdateNum - this.program[this.toindex].counter + query4.inspectionModule = this.program[this.toindex].inspectionModule + + accumulator_query(query3).then((res) => { + if (res.code == 200) { + this.program[this.toindex].counter = res.data + } + }) break } @@ -1091,7 +1134,8 @@ export default { border: 1px solid #000; padding: 8px; text-align: left; - font-size: 0.7rem; + font-size: 1.2rem; + font-weight: bold; } th { @@ -1198,7 +1242,7 @@ export default { .button_ { width: 60px; height: 85px; - background-color: #76e01a; + background-color: #11a983; color: white; border-radius: 0.2em; transition: all 0.2s ease-in-out; @@ -1234,7 +1278,7 @@ export default { .button_ { width: 60px; height: 85px; - background-color: #c9e20b; + background-color: #11a983; color: white; border-radius: 0.2em; transition: all 0.2s ease-in-out; diff --git a/src/views/qualityManagement/FQC/firstFQC.vue b/src/views/qualityManagement/FQC/firstFQC.vue index 8644120..a17a58f 100644 --- a/src/views/qualityManagement/FQC/firstFQC.vue +++ b/src/views/qualityManagement/FQC/firstFQC.vue @@ -819,15 +819,12 @@ export default { let query = {} query.workorder_id = this.CurrentWorkorder.clientWorkorder query.checkid = item.id - item.counter++ - query.counter = item.counter + query.number = 1 + query.inspectionModule = item.inspectionModule accumulator_query(query).then((res) => { if (res.code == 200) { item.counter = res.data - - - } }) }, @@ -848,25 +845,69 @@ export default { confirm() { switch (this.toname) { case 'paint': - this.paint[this.toindex].counter = this.toUpdateNum - 1 + let query = {} + query.workorder_id = this.CurrentWorkorder.clientWorkorder + query.checkid = this.paint[this.toindex].id + query.number = this.toUpdateNum - this.paint[this.toindex].counter + query.inspectionModule = this.paint[this.toindex].inspectionModule - this.Accumulator(this.paint[this.toindex]) + accumulator_query(query).then((res) => { + if (res.code == 200) { + this.paint[this.toindex].counter = res.data + } + }) break case 'blank': - this.blank[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.blank[this.toindex]) + let query1 = {} + query1.workorder_id = this.CurrentWorkorder.clientWorkorder + query1.checkid = this.blank[this.toindex].id + query1.number = this.toUpdateNum - this.blank[this.toindex].counter + query1.inspectionModule = this.blank[this.toindex].inspectionModule + + accumulator_query(query1).then((res) => { + if (res.code == 200) { + this.blank[this.toindex].counter = res.data + } + }) break case 'team': - this.team[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.team[this.toindex]) + let query2 = {} + query2.workorder_id = this.CurrentWorkorder.clientWorkorder + query2.checkid = this.team[this.toindex].id + query2.number = this.toUpdateNum - this.team[this.toindex].counter + query2.inspectionModule = this.team[this.toindex].inspectionModule + + accumulator_query(query2).then((res) => { + if (res.code == 200) { + this.team[this.toindex].counter = res.data + } + }) break case 'device': - this.device[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.device[this.toindex]) + let query3 = {} + query3.workorder_id = this.CurrentWorkorder.clientWorkorder + query3.checkid = this.device[this.toindex].id + query3.number = this.toUpdateNum - this.device[this.toindex].counter + query3.inspectionModule = this.device[this.toindex].inspectionModule + + accumulator_query(query3).then((res) => { + if (res.code == 200) { + this.device[this.toindex].counter = res.data + } + }) break case 'program': - this.program[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.program[this.toindex]) + let query4 = {} + query4.workorder_id = this.CurrentWorkorder.clientWorkorder + query4.checkid = this.program[this.toindex].id + query4.number = this.toUpdateNum - this.program[this.toindex].counter + query4.inspectionModule = this.program[this.toindex].inspectionModule + + accumulator_query(query3).then((res) => { + if (res.code == 200) { + this.program[this.toindex].counter = res.data + } + }) break } @@ -886,6 +927,7 @@ export default { table { border-collapse: collapse; width: 100%; + } th, @@ -893,7 +935,8 @@ export default { border: 1px solid #000; padding: 8px; text-align: left; - font-size: 0.7rem; + font-weight: bold; + font-size: 1.2rem; } th { @@ -1000,7 +1043,7 @@ export default { .button_ { width: 60px; height: 85px; - background-color: #76e01a; + background-color: #11a983; color: white; border-radius: 0.2em; transition: all 0.2s ease-in-out; @@ -1036,7 +1079,7 @@ export default { .button_ { width: 60px; height: 85px; - background-color: #c9e20b; + background-color: #11a983; color: white; border-radius: 0.2em; transition: all 0.2s ease-in-out; diff --git a/src/views/qualityManagement/FQC/thirtyFQC.vue b/src/views/qualityManagement/FQC/thirtyFQC.vue index 28035e9..8a43a09 100644 --- a/src/views/qualityManagement/FQC/thirtyFQC.vue +++ b/src/views/qualityManagement/FQC/thirtyFQC.vue @@ -680,7 +680,8 @@ import { get_next_current_workorder, get_previous_current_workorder, accumulator_query, - calculate_packagingInvestment + calculate_packagingInvestment, + update_workorder_status, } from '@/api/qualityManagement/thirtyFQC.js' export default { name: 'firstFQC', @@ -886,9 +887,18 @@ export default { }, //todo 工单完成 workOrderCompleted() { - this.$modal.confirm('是否确认完成的数据项?').then(() => { - this.getNext_current_workorder() - }) + this.$modal + .confirm('是否确认完成的数据项?') + .then(() => { + this.getNext_current_workorder() + //todo 更改这个工单状态为2 + return update_workorder_status({ workorderID: this.CurrentWorkorder.clientWorkorder }) + }) + .then((res) => { + if (res.code == 200) { + this.$notify.success('工单完成') + } + }) }, //todo 获取下一个工单号 getNext_current_workorder() { @@ -961,30 +971,15 @@ export default { let query = {} query.workorder_id = this.CurrentWorkorder.clientWorkorder query.checkid = item.id - item.counter++ - query.counter = item.counter + query.number = 1 + query.inspectionModule = item.inspectionModule accumulator_query(query).then((res) => { if (res.code == 200) { item.counter = res.data - console.log(item.counter) } }) }, - //todo 定时任务 ,每3s 获取一次当前工单下的抛光数 - startTimer() { - this.timer = setInterval(() => { - //计算包装投入数 - calculate_packagingInvestment({ workorder_id: this.CurrentWorkorder.clientWorkorder }).then((res) => { - if (res.code == 200) { - this.CurrentWorkorder.previousNumber = res.data - } - }) - }, 4000) - }, - stopTimer() { - clearInterval(this.timer) - }, //todo 长按事件 startimer(value, name, index) { @@ -1002,34 +997,92 @@ export default { confirm() { switch (this.toname) { case 'paint': - this.paint[this.toindex].counter = this.toUpdateNum - 1 + let query = {} + query.workorder_id = this.CurrentWorkorder.clientWorkorder + query.checkid = this.paint[this.toindex].id + query.number = this.toUpdateNum - this.paint[this.toindex].counter + query.inspectionModule = this.paint[this.toindex].inspectionModule - this.Accumulator(this.paint[this.toindex]) + accumulator_query(query).then((res) => { + if (res.code == 200) { + this.paint[this.toindex].counter = res.data + } + }) break case 'blank': - this.blank[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.blank[this.toindex]) + let query1 = {} + query1.workorder_id = this.CurrentWorkorder.clientWorkorder + query1.checkid = this.blank[this.toindex].id + query1.number = this.toUpdateNum - this.blank[this.toindex].counter + query1.inspectionModule = this.blank[this.toindex].inspectionModule + + accumulator_query(query1).then((res) => { + if (res.code == 200) { + this.blank[this.toindex].counter = res.data + } + }) break case 'team': - this.team[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.team[this.toindex]) + let query2 = {} + query2.workorder_id = this.CurrentWorkorder.clientWorkorder + query2.checkid = this.team[this.toindex].id + query2.number = this.toUpdateNum - this.team[this.toindex].counter + query2.inspectionModule = this.team[this.toindex].inspectionModule + + accumulator_query(query2).then((res) => { + if (res.code == 200) { + this.team[this.toindex].counter = res.data + } + }) break case 'device': - this.device[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.device[this.toindex]) + let query3 = {} + query3.workorder_id = this.CurrentWorkorder.clientWorkorder + query3.checkid = this.device[this.toindex].id + query3.number = this.toUpdateNum - this.device[this.toindex].counter + query3.inspectionModule = this.device[this.toindex].inspectionModule + + accumulator_query(query3).then((res) => { + if (res.code == 200) { + this.device[this.toindex].counter = res.data + } + }) break case 'program': - this.program[this.toindex].counter = this.toUpdateNum - 1 - this.Accumulator(this.program[this.toindex]) + let query4 = {} + query4.workorder_id = this.CurrentWorkorder.clientWorkorder + query4.checkid = this.program[this.toindex].id + query4.number = this.toUpdateNum - this.program[this.toindex].counter + query4.inspectionModule = this.program[this.toindex].inspectionModule + + accumulator_query(query3).then((res) => { + if (res.code == 200) { + this.program[this.toindex].counter = res.data + } + }) break } this.DMLdialog.visiable = false }, - beforeDestroy() { - this.stopTimer() + //todo 定时任务 ,每4s 获取一次当前工单下的包装投入数 + startTimer() { + this.timer = setInterval(() => { + //计算包装投入数 + calculate_packagingInvestment({ workorder_id: this.CurrentWorkorder.clientWorkorder }).then((res) => { + if (res.code == 200) { + this.CurrentWorkorder.previousNumber = res.data + } + }) + }, 4000) }, + stopTimer() { + clearInterval(this.timer) + }, + }, + beforeDestroy() { + this.stopTimer() }, } @@ -1051,7 +1104,8 @@ export default { border: 1px solid #000; padding: 8px; text-align: left; - font-size: 0.7rem; + font-size: 1.2rem; + font-weight: bold; } th { @@ -1158,7 +1212,7 @@ export default { .button_ { width: 60px; height: 85px; - background-color: #76e01a; + background-color: #11a983; color: white; border-radius: 0.2em; transition: all 0.2s ease-in-out; @@ -1194,7 +1248,7 @@ export default { .button_ { width: 60px; height: 85px; - background-color: #c9e20b; + background-color: #11a983; color: white; border-radius: 0.2em; transition: all 0.2s ease-in-out;