From 8a867e704dd4ffeea6f175aab1e74f6ef532e736 Mon Sep 17 00:00:00 2001
From: caill <815519168@qq.com>
Date: Mon, 10 Apr 2023 11:16:58 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/config/getData2.js | 9 +--
src/pages/Login.vue | 2 +-
src/pages/assignment/workordermanage.vue | 77 +++++++++---------------
src/pages/homeset/Home.vue | 45 ++++++--------
src/pages/homeset/index.vue | 8 +--
src/style/layout.styl | 12 ++--
src/vuex/modules/com.js | 4 +-
src/vuex/modules/user.js | 32 +---------
src/vuex/types.js | 2 -
9 files changed, 67 insertions(+), 124 deletions(-)
diff --git a/src/config/getData2.js b/src/config/getData2.js
index fa97d95..acf6b33 100644
--- a/src/config/getData2.js
+++ b/src/config/getData2.js
@@ -11,14 +11,11 @@ export const getDevice = () => post('api/produceshiftorder/getDeviceList', {
})
// 2.工单管理
-export const getTable = (code, val, d1, d2, is, ids, qc) => post('api/produceshiftorder/getTable', {
+export const getTable = (code, val, d1, d2) => post('api/produceshiftorder/getOrderList', {
device_code: code,
key_value: val,
- order_date1: d1,
- order_date2: d2,
- is_finished: is,
- is_producted: ids,
- is_qc: qc
+ realproducestart_date: d1,
+ realproduceend_date: d2
})
// 3.设备开工
diff --git a/src/pages/Login.vue b/src/pages/Login.vue
index b5e22a0..63cfb0d 100644
--- a/src/pages/Login.vue
+++ b/src/pages/Login.vue
@@ -150,7 +150,7 @@ export default {
async loginApi () {
try {
let res = await handLogin(this.loginname, encrypt(this.password))
- this.$store.dispatch('setUserInfo', JSON.stringify(res.user.user))
+ this.$store.dispatch('saveUserInfo', JSON.stringify(res.user.user))
this.$store.dispatch('saveToken', res.token)
this.$router.push('/home')
this.disabled = false
diff --git a/src/pages/assignment/workordermanage.vue b/src/pages/assignment/workordermanage.vue
index 6ce46f8..179c448 100644
--- a/src/pages/assignment/workordermanage.vue
+++ b/src/pages/assignment/workordermanage.vue
@@ -18,10 +18,10 @@
-
-
-
-
+
+
+
+
@@ -32,24 +32,24 @@
| 物料名称 |
工序 |
工单状态 |
- 生产数量 |
- 上报残次数 |
- 本次加工 |
+ 计划数量 |
+ 实际数量 |
+ 报工数量 |
开始时间 |
结束时间 |
-
+
|
-
+
|
- {{e.produceorder_code}} |
- {{e.shift_type_scode_name}} |
+ {{e.workorder_code}} |
+ {{e.shift_type_scode}} |
{{e.material_name}} |
{{e.workprocedure_name}} |
- {{['未生产','生产中','生产完成','已报工'][Number(e.order_status)]}} |
- {{e.produce_qty}} |
- {{e.unqualified_qty}} |
- {{e.this_qty}} |
+ {{['创建','下发','生产中','暂停', '完成'][Number(e.order_status) - 1]}} |
+ {{e.plan_qty}} |
+ {{e.real_qty}} |
+ {{e.report_qty}} |
{{e.realproducestart_date}} |
{{e.realproduceend_date}} |
@@ -75,7 +75,7 @@ export default {
value1: [new Date(), new Date()],
deviceCode: this.$route.query.code,
keyValue: '',
- datas: [],
+ dataList: [],
pkId: '',
pkObj: {},
disabled1: false,
@@ -86,9 +86,6 @@ export default {
computed: {
closeIcon1 () {
return this.keyValue !== ''
- },
- closeIcon2 () {
- return this.produceQty !== ''
}
},
created () {
@@ -106,30 +103,12 @@ export default {
}
},
async getDatas () {
- let res = await getTable(this.$route.query.code, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '', '0', '', '0')
- this.datas = [...res]
- },
- toSearch () {
- this.getDatas()
+ let res = await getTable(this.$route.query.code, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '')
+ this.dataList = [...res.content]
},
toRadio (e) {
- this.pkId = this.pkId === e.pk_id ? '' : e.pk_id
- this.pkObj = this.pkId === e.pk_id ? e : {}
- },
- closeModalCall () {
- this.mdShow = false
- },
- comfirmCall () {
- this.disabled = true
- if (this.produceQty === '' || this.produceQty === null) {
- this.toast('请输入追加数量')
- this.disabled = false
- return
- }
- this.addProduceData()
- },
- addProduce () {
- this.mdShow = true
+ this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
+ this.pkObj = this.pkId === e.workorder_id ? e : {}
},
async _openStart () {
this.disabled1 = true
@@ -139,9 +118,11 @@ export default {
return
}
try {
- let res = await openStart()
- this.toast(res.desc)
+ let res = await openStart(this.pkId, this.deviceCode)
+ this.toast(res.message)
this.disabled1 = false
+ this.pkId = ''
+ this.pkObj = {}
this.getDatas()
} catch (e) {
this.disabled1 = false
@@ -155,9 +136,11 @@ export default {
return
}
try {
- let res = await saveReport()
- this.toast(res.desc)
+ let res = await saveReport(this.pkId, this.pkObj.report_qty)
+ this.toast(res.message)
this.disabled2 = false
+ this.pkId = ''
+ this.pkObj = {}
this.getDatas()
} catch (e) {
this.disabled2 = false
@@ -171,8 +154,8 @@ export default {
return
}
try {
- let res = await tofinish()
- this.toast(res.desc)
+ let res = await tofinish(this.pkObj)
+ this.toast(res.message)
this.disabled3 = false
this.getDatas()
} catch (e) {
diff --git a/src/pages/homeset/Home.vue b/src/pages/homeset/Home.vue
index f2be97e..6808256 100644
--- a/src/pages/homeset/Home.vue
+++ b/src/pages/homeset/Home.vue
@@ -2,25 +2,22 @@
-
-
-
-
-
{{item.device_name}}
-
任务数: {{item.job_count}}
-
工单: {{item.produceorder_code}}
-
+
+
+
+
{{e.deviceName}}
+
任务数: {{e.job_count}}
+
工单: {{e.workorderCode}}
+
@@ -40,7 +37,7 @@ export default {
data () {
return {
timer: null,
- list: []
+ dataList: []
}
},
mounted () {
@@ -51,29 +48,21 @@ export default {
refresh () {
this.timer = setInterval(() => {
this.getList()
- }, 30000)
+ }, 3000)
},
async getList () {
let res = await getDevice()
let newArr = []
res.map(el => {
- newArr.push(Object.assign({}, el, {imgurl: this.$store.getters.imgBaseUrl + el.device_icon}))
+ newArr.push(Object.assign({}, el, {imgurl: this.$store.getters.imgBaseUrl + '/' + el.device_icon}))
})
- this.list = [...newArr]
- // this.$store.dispatch('getIsProplan', res.result.is_productonplan)
+ this.dataList = [...newArr]
},
- toIfWork () {
- // this.$router.push('/ifwork')
- },
- toOperation (item) {
- if (item.is_run === '1') {
- // let obj = {
- // code: item.device_code
- // }
- // this.$store.dispatch('setDevice', obj)
+ toOperation (e) {
+ if (e.is_run === '1') {
this.$router.push({
path: '/workordermanage',
- query: {code: item.device_code}
+ query: {code: e.deviceCode}
})
}
}
@@ -161,7 +150,9 @@ export default {
line-height .25rem
p
font-size .13rem
+ color #fff
.device_name
max-height .5rem
overflow hidden
+ color #fff
diff --git a/src/pages/homeset/index.vue b/src/pages/homeset/index.vue
index bbd18a8..7aaa3e0 100644
--- a/src/pages/homeset/index.vue
+++ b/src/pages/homeset/index.vue
@@ -2,9 +2,8 @@
-
+
- - 部门: {{this.$store.getters.deptName}}
- 退出
@@ -22,6 +21,7 @@ export default {
name: 'homeset',
data () {
return {
+ userName: this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : '',
timer: null,
time: '',
date: '',
@@ -36,10 +36,10 @@ export default {
methods: {
getInfo () {
this.cwidth = this.$refs.logo.clientWidth
- this.drift = this.drift === 0 ? 1 : 0
+ this.drift = this.drift === 0 ? 0.5 : 0
},
exit () {
- this.$store.dispatch('setSignOut')
+ this.$store.dispatch('delUserInfo')
this.$router.push('/login')
},
updateTime () {
diff --git a/src/style/layout.styl b/src/style/layout.styl
index 1eb5937..83f1638 100644
--- a/src/style/layout.styl
+++ b/src/style/layout.styl
@@ -88,9 +88,9 @@
padding 0 .1rem
border-radius 5px
.button--defalut
- color #606266
- border 1px solid #dcdfe6
- background-color #fff
+ color #fff
+ border 1px solid #c9c9c9
+ background-color #c9c9c9
/**header*/
header
@@ -101,6 +101,7 @@ header
.header-tip
line-height .6rem
font-size .2rem
+ color #fff
.header-btn
margin-top .15rem
@@ -219,4 +220,7 @@ input::-webkit-input-placeholder
.el-select-dropdown__item
height .26rem !important
line-height .26rem !important
- font-size .16rem !important
\ No newline at end of file
+ font-size .16rem !important
+.el-input__inner
+ height .3rem
+ line-height .3rem
\ No newline at end of file
diff --git a/src/vuex/modules/com.js b/src/vuex/modules/com.js
index ccb1035..b98a504 100644
--- a/src/vuex/modules/com.js
+++ b/src/vuex/modules/com.js
@@ -1,8 +1,8 @@
import * as types from '../types'
import { getStore, setStore } from '@config/utils.js'
-const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.107:8080/hlapp' : 'http://192.168.81.100:8081/hl_nlapp'
-const imgBaseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.100/' : 'http://192.168.81.107/'
+const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.171:8018' : 'http://192.168.81.171:8018'
+const imgBaseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.171:8018' : 'http://192.168.81.171:8018'
const state = {
baseUrl: getStore('baseUrl') || baseUrl,
imgBaseUrl: getStore('imgBaseUrl') || imgBaseUrl,
diff --git a/src/vuex/modules/user.js b/src/vuex/modules/user.js
index 62cad26..580cfee 100644
--- a/src/vuex/modules/user.js
+++ b/src/vuex/modules/user.js
@@ -2,10 +2,6 @@ import * as types from '../types'
import { getStore, setStore } from '@config/utils.js'
const state = {
- accountId: getStore('accountId') || '',
- accountName: getStore('accountName') || '',
- userName: getStore('userName') || '',
- deptName: getStore('deptName') || '',
userInfo: getStore('userInfo') ? getStore('userInfo') : '',
saveToken: getStore('saveToken') || ''
}
@@ -20,26 +16,13 @@ const getters = {
}
const actions = {
- setUserInfo ({ commit }, res) {
- setStore('accountId', res.account_id)
- setStore('accountName', res.account_name)
- setStore('userName', res.user_name)
- setStore('deptName', res.dept_name)
- commit(types.SET_USER_INFO, res)
- },
- setSignOut ({ commit }) {
- localStorage.removeItem('accountId')
- localStorage.removeItem('accountName')
- localStorage.removeItem('userName')
- localStorage.removeItem('deptName')
- commit(types.SET_SIGN_OUT)
- },
saveUserInfo ({commit}, res) {
setStore('userInfo', res)
commit(types.SAVE_USER_INFO, res)
},
delUserInfo ({commit}, res) {
localStorage.removeItem('userInfo')
+ localStorage.removeItem('saveToken')
commit(types.DEL_USER_INFO, res)
},
saveToken ({commit}, res) {
@@ -49,23 +32,10 @@ const actions = {
}
const mutations = {
- [types.SET_USER_INFO] (state, res) {
- state.accountId = res.account_id
- state.accountName = res.account_name
- state.userName = res.user_name
- state.deptName = res.dept_name
- },
- [types.SET_SIGN_OUT] (state) {
- state.accountId = ''
- state.accountName = ''
- state.userName = ''
- state.deptName = ''
- },
[types.SAVE_USER_INFO] (state, res) {
state.userInfo = res
},
[types.DEL_USER_INFO] (state, res) {
- state.userInfo = res
},
[types.SAVE_TOKEN] (state, res) {
state.saveToken = res
diff --git a/src/vuex/types.js b/src/vuex/types.js
index 64b0b29..769b415 100644
--- a/src/vuex/types.js
+++ b/src/vuex/types.js
@@ -9,8 +9,6 @@ export const COM_SHOW_ALERT = 'COM_SHOW_ALERT'
export const COM_ALERT_MSG = 'COM_ALERT_MSG'
// 用户
-export const SET_USER_INFO = 'SET_USER_INFO'
-export const SET_SIGN_OUT = 'SET_SIGN_OUT'
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
export const DEL_USER_INFO = 'DEL_USER_INFO'
export const SAVE_TOKEN = 'SAVE_TOKEN'