接口
This commit is contained in:
@@ -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.设备开工
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
||||
</div>
|
||||
<div class="fr mgt10">
|
||||
<button class="mgr5 button--primary" @click="toSearch">查 询</button>
|
||||
<button class="button--primary" :disabled="disabled1" @click="_openStart">开工</button>
|
||||
<button class="button--primary" :disabled="disabled2" @click="addProduce">报工</button>
|
||||
<button class="button--primary" :disabled="disabled3" @click="addProduce">完工</button>
|
||||
<button class="mgr5 button--primary" @click="getDatas">查 询</button>
|
||||
<button class="button--primary" :class="{'button--defalut': !pkId}" :disabled="disabled1" @click="_openStart">开工</button>
|
||||
<button class="button--primary" :class="{'button--defalut': !pkId}" :disabled="disabled2" @click="_saveReport">报工</button>
|
||||
<button class="button--primary" :class="{'button--defalut': !pkId}" :disabled="disabled3" @click="_tofinish">完工</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="filter-table">
|
||||
@@ -32,24 +32,24 @@
|
||||
<th width="9%">物料名称</th>
|
||||
<th width="8%">工序</th>
|
||||
<th width="9%">工单状态</th>
|
||||
<th width="10%">生产数量</th>
|
||||
<th width="9%">上报残次数</th>
|
||||
<th width="9%">本次加工</th>
|
||||
<th width="10%">计划数量</th>
|
||||
<th width="9%">实际数量</th>
|
||||
<th width="9%">报工数量</th>
|
||||
<th width="13%">开始时间</th>
|
||||
<th width="13%">结束时间</th>
|
||||
</tr>
|
||||
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
|
||||
<tr v-for="e in dataList" :key="e.workorder_id" @click="toRadio(e)">
|
||||
<td>
|
||||
<button class="iconfont select_icon" :class="pkId === e.pk_id ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
<button class="iconfont select_icon" :class="pkId === e.workorder_id ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
</td>
|
||||
<td>{{e.produceorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.shift_type_scode}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{['未生产','生产中','生产完成','已报工'][Number(e.order_status)]}}</td>
|
||||
<td>{{e.produce_qty}}</td>
|
||||
<td>{{e.unqualified_qty}}</td>
|
||||
<td>{{e.this_qty}}</td>
|
||||
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.order_status) - 1]}}</td>
|
||||
<td>{{e.plan_qty}}</td>
|
||||
<td>{{e.real_qty}}</td>
|
||||
<td>{{e.report_qty}}</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
<td>{{e.realproduceend_date}}</td>
|
||||
</tr>
|
||||
@@ -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) {
|
||||
|
||||
@@ -2,25 +2,22 @@
|
||||
<div>
|
||||
<section class="content">
|
||||
<div class="device-status">
|
||||
<button class="fl mgt10 mgl10 button--primary" @click="toIfWork">设备开/完工</button>
|
||||
<p><span class="icon red"></span><span class="txt">有任务</span></p>
|
||||
<p><span class="icon green"></span><span class="txt">生产中</span></p>
|
||||
<p><span class="icon blue"></span><span class="txt">停机</span></p>
|
||||
<p><span class="icon white"></span><span class="txt">待机</span></p>
|
||||
</div>
|
||||
<div class="list-box">
|
||||
<div class="device"
|
||||
:class="{bg1:item.is_run=='1',bg2:item.is_run=='0'}"
|
||||
v-for="(item, index) in list" :key="index"
|
||||
@click="toOperation(item)"
|
||||
<div class="device" v-for="e in dataList" :key="e.device_code" :class="{bg1:e.is_run=='1',bg2:e.is_run=='0'}" @click="toOperation(e)"
|
||||
>
|
||||
<div class="device-top"><div class="img"><img v-show="item.device_icon" :src="item.imgurl" alt=""></div></div>
|
||||
<div class="fl icon" :class="{blue:item.device_status=='3',red:item.device_status=='2',green:item.device_status=='1',white:item.device_status=='0'}"></div>
|
||||
<div class="fl desc">
|
||||
<p class="device_name">{{item.device_name}}</p>
|
||||
<p class="ellipsis">任务数: {{item.job_count}}</p>
|
||||
<p class="ellipsis">工单: {{item.produceorder_code}}</p>
|
||||
</div>
|
||||
<div class="device-top">
|
||||
<div class="img"><img v-show="e.device_icon" :src="e.imgurl" alt=""></div></div>
|
||||
<div class="fl icon" :class="['white', 'green', 'red', 'blue'][Number(e.device_status)]"></div>
|
||||
<div class="fl desc">
|
||||
<p class="device_name">{{e.deviceName}}</p>
|
||||
<p class="ellipsis">任务数: {{e.job_count}}</p>
|
||||
<p class="ellipsis">工单: {{e.workorderCode}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Back></Back>
|
||||
@@ -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
|
||||
</style>
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
<div>
|
||||
<header>
|
||||
<div class="left-box">
|
||||
<button class="fl logo iconfont dropdown_icon" ref="logo" @click="getInfo">登录人员: {{this.$store.getters.userName}}</button>
|
||||
<button class="fl logo iconfont dropdown_icon" ref="logo" @click="getInfo">登录人员: {{userName}}</button>
|
||||
<ul class="drift dropdown-ul" id="dropdown-ul" :style="{'height': drift+'rem','width' : cwidth + 'px'}">
|
||||
<li>部门: {{this.$store.getters.deptName}}</li>
|
||||
<li @click="exit">退出</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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
|
||||
font-size .16rem !important
|
||||
.el-input__inner
|
||||
height .3rem
|
||||
line-height .3rem
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user