工单作业、工单查询、报工查询
This commit is contained in:
111
src/components/dialog.vue
Normal file
111
src/components/dialog.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="active" class="dialog_wrapper">
|
||||
<div class="dialog">
|
||||
<div class="dialog_header">
|
||||
<span class="dialog_title">{{title}}</span>
|
||||
<button class="dialog_headerbtn" @click="toCancle">
|
||||
<i class="iconfont close_icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dialog_body">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div class="dialog_footer">
|
||||
<button class="button button--primary" @click="toCancle">取消</button>
|
||||
<button class="button button--primary" :class="{'button--info': unclick === true}" :disabled="disabled" @click="toSure">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="active" class="modal"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'jxDialog',
|
||||
props: {
|
||||
title: String,
|
||||
type: String,
|
||||
unclick: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
active: false,
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toCancle () {
|
||||
this.active = false
|
||||
this.$emit('toCancle', this.type)
|
||||
},
|
||||
toSure () {
|
||||
this.$emit('toSure', this.type)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.modal
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: .5;
|
||||
background: #000;
|
||||
z-index: 101;
|
||||
.dialog_wrapper
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
z-index: 102;
|
||||
.dialog
|
||||
position: relative;
|
||||
margin: 0 auto 50px;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.3);
|
||||
box-sizing: border-box;
|
||||
width: 65%;
|
||||
margin-top: 15vh;
|
||||
.dialog_header
|
||||
padding: 20px 20px 10px;
|
||||
.dialog_title
|
||||
line-height: 24px;
|
||||
font-size: 18px;
|
||||
color: #303133;
|
||||
.dialog_headerbtn
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
.close_icon
|
||||
width 24px
|
||||
height 24px
|
||||
font-size 15px
|
||||
line-height 24px
|
||||
top 0
|
||||
.dialog_body
|
||||
padding: 30px 20px;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
.dialog_footer
|
||||
padding: 10px 20px 20px;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
</style>
|
||||
@@ -25,12 +25,53 @@ export const openStart = (id, code) => post('api/produceshiftorder/openStart', {
|
||||
})
|
||||
|
||||
// 4.设备报工
|
||||
export const saveReport = (id, code) => post('api/produceshiftorder/saveReport', {
|
||||
export const saveReport = (id, qty, nqty, rqty) => post('api/produceshiftorder/saveReport', {
|
||||
workorder_id: id,
|
||||
report_qty: code
|
||||
report_qty: qty,
|
||||
nok_qty: nqty,
|
||||
repare_qty: rqty
|
||||
})
|
||||
|
||||
// 5.设备完工
|
||||
export const tofinish = (row) => post('api/produceshiftorder/finish', {
|
||||
row: row
|
||||
})
|
||||
|
||||
// 设备下拉列表
|
||||
export const deviceList = (search) => post('api/device/list', {
|
||||
search: search
|
||||
})
|
||||
// export const deviceList = (search) => {
|
||||
// let res = {
|
||||
// 'totalElements': 4,
|
||||
// 'content': [
|
||||
// {
|
||||
// 'device_name': 'A1_旋压下料_80_1',
|
||||
// 'device_code': 'A1_XY_80_1'
|
||||
// },
|
||||
// {
|
||||
// 'device_name': 'A1_旋压下料_80_2',
|
||||
// 'device_code': 'A1_XY_80_2'
|
||||
// },
|
||||
// {
|
||||
// 'device_name': 'A1_旋压下料_80_3',
|
||||
// 'device_code': 'A1_XY_80_3'
|
||||
// },
|
||||
// {
|
||||
// 'device_name': 'A1_旋压下料_80_4',
|
||||
// 'device_code': 'A1_XY_80_4'
|
||||
// }
|
||||
// ],
|
||||
// 'code': 200,
|
||||
// 'msg': '查询成功'
|
||||
// }
|
||||
// return res
|
||||
// }
|
||||
|
||||
// 报工查询
|
||||
export const reportQuery = (st, et, code, wcode) => post('api/produceWorkorder/reportQuery', {
|
||||
start_time: st,
|
||||
end_time: et,
|
||||
device_code: code,
|
||||
workorder_code: wcode
|
||||
})
|
||||
|
||||
@@ -69,3 +69,81 @@ export const dateTimeFtt = date => {
|
||||
let ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
||||
return `${year}-${month}-${day} ${hh}:${mm}:${ss}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数加法
|
||||
*/
|
||||
export const accAdd = (arg1, arg2) => {
|
||||
var r1, r2, m, c
|
||||
try {
|
||||
r1 = arg1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = arg2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
c = Math.abs(r1 - r2)
|
||||
m = Math.pow(10, Math.max(r1, r2))
|
||||
if (c > 0) {
|
||||
var cm = Math.pow(10, c)
|
||||
if (r1 > r2) {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', '')) * cm
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', '')) * cm
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
return (arg1 + arg2) / m
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数减法
|
||||
*/
|
||||
export const accSubtract = (arg1, arg2) => {
|
||||
var r1, r2, m, c
|
||||
try {
|
||||
r1 = arg1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = arg2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
c = Math.abs(r1 - r2)
|
||||
m = Math.pow(10, Math.max(r1, r2))
|
||||
if (c > 0) {
|
||||
var cm = Math.pow(10, c)
|
||||
if (r1 > r2) {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', '')) * cm
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', '')) * cm
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
return (arg1 - arg2) / m
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数乘法
|
||||
*/
|
||||
export const accMul = (arg1, arg2) => {
|
||||
var m = 0
|
||||
var s1 = arg1.toString()
|
||||
var s2 = arg2.toString()
|
||||
try { m += s1.split('.')[1].length } catch (e) {}
|
||||
try { m += s2.split('.')[1].length } catch (e) {}
|
||||
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m)
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
timer: null,
|
||||
dataList: [{device_code: '1', is_run: '1'}]
|
||||
dataList: []
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
@@ -6,21 +6,21 @@
|
||||
<div class="filter_label">设备</div>
|
||||
<div class="filter-input-wrap">
|
||||
<el-select v-model="value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap-buttons">
|
||||
<button class="button button--primary" @click="getDatas">查询</button>
|
||||
<button class="button button--primary" :disabled="disabled1" @click="_openStart">开工</button>
|
||||
<button class="button button--primary" :disabled="disabled2" @click="_saveReport">报工</button>
|
||||
<button class="button button--primary" :disabled="disabled3" @click="_tofinish">强制完成</button>
|
||||
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled1" @click="_openStart">开工</button>
|
||||
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled2" @click="_saveReport">报工</button>
|
||||
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled3" @click="showDialog">强制完成</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_wraper">
|
||||
@@ -40,63 +40,136 @@
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.workorder_id">
|
||||
<td>
|
||||
<button class="iconfont select_icon" :class="pkId === e.workorder_id ? 'selected_icon' : 'unselect_icon'" @click="toRadio(e)"></button>
|
||||
<button class="iconfont select_icon" :class="{'selected_icon': pkId === e.workorder_id}" @click="toRadio(e)"></button>
|
||||
</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.workorder_status) - 1]}}</td>
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.order_status) - 1]}}</td>
|
||||
<td>{{e.plan_qty}}</td>
|
||||
<td>{{e.real_qty}}</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
<td>{{e.realproduceend_date}}</td>
|
||||
<td>{{ e.report_qty }}</td>
|
||||
<td>{{ e.real_qty }}</td>
|
||||
<td>{{ e.realproducestart_date }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<jxDialog
|
||||
ref="child"
|
||||
title="提示"
|
||||
@toSure="toSureDialog"
|
||||
>
|
||||
<div class="form_wraper">当前操作为强制确认,确定继续操作吗?</div>
|
||||
</jxDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deviceList, getTable, openStart, tofinish, saveReport } from '../../../config/getData2.js'
|
||||
import jxDialog from '@components/dialog.vue'
|
||||
import {accSubtract} from '@config/utils.js'
|
||||
export default {
|
||||
components: {
|
||||
jxDialog
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
options: [{
|
||||
value: '选项1',
|
||||
label: '超级管理员'
|
||||
}, {
|
||||
value: '选项2',
|
||||
label: '系统管理员'
|
||||
}, {
|
||||
value: '选项3',
|
||||
label: '普通用户'
|
||||
}, {
|
||||
value: '选项4',
|
||||
label: '开发人员'
|
||||
}],
|
||||
options: [],
|
||||
value: '',
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
dataList: [{workorder_id: '1'}, {workorder_id: '2'}],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._deviceList()
|
||||
},
|
||||
methods: {
|
||||
getDatas () {
|
||||
|
||||
async _deviceList () {
|
||||
let res = await deviceList()
|
||||
if (res.code === 200) {
|
||||
this.options = [...res.content]
|
||||
}
|
||||
},
|
||||
_openStart () {
|
||||
|
||||
async getDatas () {
|
||||
let res = await getTable(this.value)
|
||||
res.content.map(el => {
|
||||
let qty = '0'
|
||||
if (Number(accSubtract(el.plan_qty, el.real_qty)) > 0) {
|
||||
qty = accSubtract(el.plan_qty, el.real_qty)
|
||||
}
|
||||
this.$set(el, 'report_qty', qty)
|
||||
})
|
||||
this.dataList = [...res.content]
|
||||
},
|
||||
_saveReport () {
|
||||
|
||||
// 开工
|
||||
async _openStart () {
|
||||
this.disabled1 = true
|
||||
if (!this.pkId) {
|
||||
this.toast('请选择一行')
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await openStart(this.pkId, this.value)
|
||||
this.toast(res.message)
|
||||
this.disabled1 = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.getDatas()
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
_tofinish () {
|
||||
|
||||
// 报工
|
||||
async _saveReport () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.toast('请选择一行')
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await saveReport(this.pkId, this.pkObj.report_qty, this.pkObj.nok_qty, this.pkObj.repare_qty)
|
||||
this.toast(res.message)
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.getDatas()
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
showDialog () {
|
||||
if (!this.pkId) {
|
||||
this.toast('请选择一行')
|
||||
return
|
||||
}
|
||||
this.$refs.child.active = true
|
||||
},
|
||||
// 完工
|
||||
async _tofinish () {
|
||||
this.$refs.child.disabled = true
|
||||
this.disabled3 = true
|
||||
try {
|
||||
let res = await tofinish(this.pkObj)
|
||||
this.toast(res.message)
|
||||
this.disabled3 = false
|
||||
this.$refs.child.active = false
|
||||
this.$refs.child.disabled = false
|
||||
this.getDatas()
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
this.$refs.child.active = false
|
||||
this.$refs.child.disabled = false
|
||||
}
|
||||
},
|
||||
toSureDialog () {
|
||||
this._tofinish()
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<div class="filter_label">工单日期</div>
|
||||
<div class="filter-input-wrap">
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
v-model="value1"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
@@ -20,9 +20,9 @@
|
||||
<el-select v-model="value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="filter_item">
|
||||
<div class="filter_label filter_label_z3">关键字</div>
|
||||
<div class="filter-input-wrap filter-input-wrap_z3">
|
||||
<input type="text" class="filter-input" v-model="keyValue" placeholder="请输入工单号、物料编码">
|
||||
<input type="text" class="filter-input filter-input_1" v-model="keyValue" placeholder="请输入工单号、物料编码">
|
||||
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -42,7 +42,6 @@
|
||||
<div class="grid_wraper">
|
||||
<table class="filter-table">
|
||||
<tr>
|
||||
<th width="4%"></th>
|
||||
<th width="8%">工单日期</th>
|
||||
<th width="8%">工单号</th>
|
||||
<th width="8%">设备</th>
|
||||
@@ -52,27 +51,23 @@
|
||||
<th width="8%">工单数量</th>
|
||||
<th width="8%">实际数量</th>
|
||||
<th width="8%">报废数量</th>
|
||||
<th width="7%">报修数量</th>
|
||||
<th width="8%">报修数量</th>
|
||||
<th width="8%">开始时间</th>
|
||||
<th width="8%">开始时间</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.workorder_id">
|
||||
<td>
|
||||
<button class="iconfont select_icon" :class="pkId === e.workorder_id ? 'selected_icon' : 'unselect_icon'" @click="toRadio(e)"></button>
|
||||
</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.workorder_status) - 1]}}</td>
|
||||
<td>{{ e.material_name }}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.order_status) - 1]}}</td>
|
||||
<td>{{e.plan_qty}}</td>
|
||||
<td>{{e.real_qty}}</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
<td>{{e.realproduceend_date}}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{{ e.real_qty }}</td>
|
||||
<td>{{e.nok_qty}}</td>
|
||||
<td>{{e.repare_qty}}</td>
|
||||
<td>{{ e.realproducestart_date }}</td>
|
||||
<td>{{ e.realproduceend_date }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -80,6 +75,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {dateFtt} from '@config/utils.js'
|
||||
import { deviceList, getTable } from '../../../config/getData2.js'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
@@ -90,7 +87,7 @@ export default {
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
dataList: [{workorder_id: '1'}, {workorder_id: '2'}],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
}
|
||||
@@ -100,16 +97,44 @@ export default {
|
||||
return this.keyValue !== ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
keyValue () {
|
||||
this.debouncedgetDatas()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._deviceList()
|
||||
this.debouncedgetDatas = this.debounce(this.getDatas, 500)
|
||||
},
|
||||
methods: {
|
||||
debounce (fn, delay = 500) {
|
||||
let timer = null
|
||||
return function () {
|
||||
if (timer) {
|
||||
clearTimeout(timer)
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, arguments)
|
||||
timer = null
|
||||
}, delay)
|
||||
}
|
||||
},
|
||||
async _deviceList () {
|
||||
let res = await deviceList()
|
||||
if (res.code === 200) {
|
||||
this.options = [...res.content]
|
||||
}
|
||||
},
|
||||
async getDatas () {
|
||||
let res = await getTable(this.value, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '')
|
||||
this.dataList = [...res.content]
|
||||
},
|
||||
clearData (e) {
|
||||
switch (e) {
|
||||
case 1:
|
||||
this.keyValue = ''
|
||||
break
|
||||
}
|
||||
},
|
||||
getDatas () {
|
||||
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
|
||||
@@ -137,4 +162,13 @@ export default {
|
||||
width 55%
|
||||
&:nth-child(2)
|
||||
width calc(45% - 10px)
|
||||
.filter-input_1
|
||||
padding-right 30px
|
||||
.close_icon
|
||||
width 20px
|
||||
height 20px
|
||||
font-size 15px
|
||||
line-height 20px
|
||||
top 5px
|
||||
right 10px
|
||||
</style>
|
||||
|
||||
@@ -20,17 +20,24 @@
|
||||
<el-select v-model="value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter_item">
|
||||
<div class="filter_label filter_label_z3">工单号</div>
|
||||
<div class="filter-input-wrap filter-input-wrap_z3">
|
||||
<input type="text" class="filter-input filter-input_1" v-model="workorder">
|
||||
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrap-buttons">
|
||||
<button class="button button--primary" @click="getDatas">查询</button>
|
||||
<button class="button button--primary" :disabled="disabled1">修改</button>
|
||||
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled1" @click="showDialog">修改</button>
|
||||
<button class="button button--primary" :disabled="disabled2">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,66 +45,157 @@
|
||||
<table class="filter-table">
|
||||
<tr>
|
||||
<th width="4%"></th>
|
||||
<th width="7%">工单号</th>
|
||||
<th width="6%">工单号</th>
|
||||
<th width="6%">设备</th>
|
||||
<th width="8%">顺序号</th>
|
||||
<th width="8%">班次</th>
|
||||
<th width="6%">顺序号</th>
|
||||
<th width="4%">班次</th>
|
||||
<th width="8%">物料名称</th>
|
||||
<th width="8%">开始时间</th>
|
||||
<th width="8%">结束时间</th>
|
||||
<th width="7%">电气数量</th>
|
||||
<th width="10%">上报合格数</th>
|
||||
<th width="7%">上报报废数</th>
|
||||
<th width="6%">上报报修数</th>
|
||||
<th width="10%">上报报废数</th>
|
||||
<th width="10%">上报报修数</th>
|
||||
<th width="6%">操作工</th>
|
||||
<th width="5%">状态</th>
|
||||
</tr>
|
||||
<tr v-for="e in dataList" :key="e.workorder_id">
|
||||
<tr v-for="e in dataList" :key="e.macoperate_id">
|
||||
<td>
|
||||
<button class="iconfont select_icon" :class="pkId === e.workorder_id ? 'selected_icon' : 'unselect_icon'" @click="toRadio(e)"></button>
|
||||
<button class="iconfont select_icon" :class="{'selected_icon': pkId === e.macoperate_id}" @click="toRadio(e)"></button>
|
||||
</td>
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.seq_number}}</td>
|
||||
<td>{{e.shift_type_scode}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.order_status) - 1]}}</td>
|
||||
<td>{{e.plan_qty}}</td>
|
||||
<td>{{e.real_qty}}</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
<td>{{e.realproduceend_date}}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{{e.operatetime_start}}</td>
|
||||
<td>{{e.operatetime_end}}</td>
|
||||
<td>{{ e.dq_report_qty }}</td>
|
||||
<td>{{e.report_qty}}</td>
|
||||
<td>{{e.nok_qty}}</td>
|
||||
<td>{{ e.repare_qty }}</td>
|
||||
<td>{{ e.produce_person_name }}</td>
|
||||
<td>{{ ['生成','报工','审核'][Number(e.report_status) - 1] }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<jxDialog
|
||||
ref="child"
|
||||
title="请输入数量"
|
||||
@toSure="toSureDialog"
|
||||
>
|
||||
<div class="form_wraper">
|
||||
<div class="form">
|
||||
<div class="form_item">
|
||||
<div class="form_item__label">合格数量</div>
|
||||
<div class="form_item__content">
|
||||
<input type="number" class="form_item__input" v-model="reportQty">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_item">
|
||||
<div class="form_item__label">报废数量</div>
|
||||
<div class="form_item__content">
|
||||
<input type="number" class="form_item__input" v-model="nokQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form">
|
||||
<div class="form_item">
|
||||
<div class="form_item__label">报修数量</div>
|
||||
<div class="form_item__content">
|
||||
<input type="number" class="form_item__input" v-model="repareQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</jxDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deviceList, reportQuery } from '../../../config/getData2.js'
|
||||
import jxDialog from '@components/dialog.vue'
|
||||
import {dateFtt} from '@config/utils.js'
|
||||
export default {
|
||||
components: {
|
||||
jxDialog
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
options: [],
|
||||
value: '',
|
||||
value1: [new Date(), new Date()],
|
||||
workorder: '',
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false,
|
||||
dataList: [{workorder_id: '1'}, {workorder_id: '2'}],
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
pkObj: {},
|
||||
reportQty: '',
|
||||
nokQty: '',
|
||||
repareQty: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
closeIcon1 () {
|
||||
return this.keyValue !== ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
workorder () {
|
||||
this.debouncedgetDatas()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._deviceList()
|
||||
this.debouncedgetDatas = this.debounce(this.getDatas, 500)
|
||||
},
|
||||
methods: {
|
||||
getDatas () {
|
||||
|
||||
debounce (fn, delay = 500) {
|
||||
let timer = null
|
||||
return function () {
|
||||
if (timer) {
|
||||
clearTimeout(timer)
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, arguments)
|
||||
timer = null
|
||||
}, delay)
|
||||
}
|
||||
},
|
||||
clearData (e) {
|
||||
switch (e) {
|
||||
case 1:
|
||||
this.workorder = ''
|
||||
break
|
||||
}
|
||||
},
|
||||
async _deviceList () {
|
||||
let res = await deviceList()
|
||||
if (res.code === 200) {
|
||||
this.options = [...res.content]
|
||||
}
|
||||
},
|
||||
async getDatas () {
|
||||
let res = await reportQuery(this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '', this.value, this.workorder)
|
||||
this.dataList = [...res.content]
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
|
||||
this.pkObj = this.pkId === e.workorder_id ? e : {}
|
||||
this.pkId = this.pkId === e.macoperate_id ? '' : e.macoperate_id
|
||||
this.pkObj = this.pkId === e.macoperate_id ? e : {}
|
||||
},
|
||||
showDialog () {
|
||||
if (!this.pkId) {
|
||||
this.toast('请选择一行')
|
||||
return
|
||||
}
|
||||
this.reportQty = this.pkObj.report_qty
|
||||
this.nokQty = this.pkObj.nok_qty
|
||||
this.repareQty = this.pkObj.repare_qty
|
||||
this.$refs.child.active = true
|
||||
},
|
||||
toSureDialog () {
|
||||
this.$refs.child.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,16 +203,29 @@ export default {
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.wrap-filters
|
||||
width calc(100% - 270px)
|
||||
width calc(100% - 178px)
|
||||
.wrap-buttons
|
||||
width 270px
|
||||
width 178px
|
||||
.filter_label_z2
|
||||
width 32px
|
||||
.filter-input-wrap_z2
|
||||
width calc(100% - 32px)
|
||||
.filter_item
|
||||
&:nth-child(1)
|
||||
width 55%
|
||||
width 43%
|
||||
&:nth-child(2)
|
||||
width calc(45% - 10px)
|
||||
width calc(30% - 10px)
|
||||
&:nth-child(3)
|
||||
width calc(27% - 10px)
|
||||
.close_icon
|
||||
width 20px
|
||||
height 20px
|
||||
font-size 15px
|
||||
line-height 20px
|
||||
top 5px
|
||||
right 10px
|
||||
.filter_label_z3
|
||||
width 43px
|
||||
.filter-input-wrap_z3
|
||||
width calc(100% - 43px)
|
||||
</style>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
content '\e608'
|
||||
.close_icon::before
|
||||
content '\e60f'
|
||||
.selected_icon::before
|
||||
.select_icon::before
|
||||
content '\e608'
|
||||
|
||||
// new
|
||||
|
||||
@@ -78,11 +78,14 @@
|
||||
line-height .3rem
|
||||
text-align center
|
||||
.select_icon
|
||||
width .2rem
|
||||
height .2rem
|
||||
line-height .2rem
|
||||
width 18px
|
||||
height 18px
|
||||
line-height 18px
|
||||
font-size 16px
|
||||
text-align center
|
||||
border-radius 100%
|
||||
background-color #c0c4cc
|
||||
color #c0c4cc
|
||||
overflow hidden
|
||||
.select_square_icon
|
||||
border-radius 3px
|
||||
@@ -186,7 +189,11 @@ header
|
||||
.wrap-buttons
|
||||
width 40%
|
||||
height 100%
|
||||
text-align right
|
||||
display flex
|
||||
justify-content flex-end
|
||||
align-items center
|
||||
.button+.button
|
||||
margin-left 5px
|
||||
.filter_item
|
||||
width calc(50% - 10px)
|
||||
display flex
|
||||
@@ -224,13 +231,14 @@ header
|
||||
z-index 1
|
||||
color #606266
|
||||
border-left 1px solid #8B90A6
|
||||
padding 5px 0
|
||||
th,td
|
||||
line-height 18px
|
||||
font-size 12px
|
||||
padding 5px
|
||||
color #fff
|
||||
td
|
||||
border 1px solid #8B90A6
|
||||
padding 5px
|
||||
&:first-child
|
||||
border-left 0
|
||||
&:last-child
|
||||
@@ -310,10 +318,51 @@ input::-webkit-input-placeholder
|
||||
font-size .13rem
|
||||
.el-range-editor.el-input__inner
|
||||
width 100%
|
||||
// .el-select-dropdown__item
|
||||
// height .26rem !important
|
||||
// line-height .26rem !important
|
||||
// font-size .16rem !important
|
||||
// .el-input__inner
|
||||
// height .3rem
|
||||
// line-height .3rem
|
||||
.el-icon-arrow-up
|
||||
vertical-align top
|
||||
|
||||
.form_wraper
|
||||
width 100%
|
||||
.form
|
||||
width 100%
|
||||
_fj(flex-start, flex-start)
|
||||
.form_item
|
||||
width 48%
|
||||
margin-bottom: 20px
|
||||
.form_item+.form_item
|
||||
margin-left 4%
|
||||
.form_item__label
|
||||
width: 74px;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
float: left;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
line-height: 30px;
|
||||
padding: 0 12px 0 0;
|
||||
box-sizing: border-box;
|
||||
i
|
||||
color $red2
|
||||
.form_item__content
|
||||
width: calc(100% - 74px)
|
||||
margin-left: 74px;
|
||||
line-height: 30px;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
.form_item__input
|
||||
width 100%
|
||||
-webkit-appearance: none;
|
||||
background-color: #fff;
|
||||
background-image: none;
|
||||
border-radius: 4px;
|
||||
border: 1px solid $gray1;
|
||||
box-sizing: border-box;
|
||||
color: #696969;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
outline: none;
|
||||
padding: 0 15px;
|
||||
transition: border-color .2s cubic-bezier(.645,.045,.355,1);
|
||||
width: 100%;
|
||||
@@ -1,11 +1,17 @@
|
||||
$red = #e74f1a
|
||||
$red1 = #E74F19
|
||||
$red2 = #FA6400
|
||||
$green = #6CBE8B
|
||||
$green1 = #00d246
|
||||
$yellow = #E9B451
|
||||
$blue = #6798ef
|
||||
$gray = #c9c9c9
|
||||
$gray1 = #8B90A6
|
||||
$gray2 = #DFE1E6
|
||||
$fc1 = #323232
|
||||
|
||||
|
||||
|
||||
//宽高
|
||||
_wh(w, h)
|
||||
width: w
|
||||
|
||||
Reference in New Issue
Block a user