刻字机

This commit is contained in:
2023-07-31 17:44:36 +08:00
parent 39b1837b9f
commit cd864d03b3
8 changed files with 695 additions and 18 deletions

View File

@@ -25,7 +25,8 @@ export const authority = () => {
path: 'RF03',
name: '成品管理',
sonTree: [
{menu_id: '1', name: '成品入库', path: '/finishedinstore'}
{menu_id: '1', name: '批量入库', path: '/batchinstore'},
{menu_id: '2', name: '成品入库', path: '/finishedinstore'}
]
},
{menu_id: '4',

View File

@@ -0,0 +1,171 @@
<template>
<div class="order-wraper">
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item">
<div class="search-label">仓库</div>
<div class="filter_input_wraper">
<el-select v-model="value1" filterable clearable placeholder="请选择">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">单据类型</div>
<div class="filter_input_wraper">
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">入库点</div>
<div class="filter_input_wraper">
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="search-item_3">
<button class="button button--primary" @click="_washQuery">查询</button>
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': checkArr.length === 0}" @click="_washSubmitWash">设置站点</button>
<button class="button button--primary">确认入库</button>
<button class="button button--primary" @click="toJump">托盘明细</button>
<button class="button button--primary">删除一行</button>
</div>
</div>
</div>
<div class="grid_wraper">
<table class="filter-table">
<thead>
<tr>
<th>选择</th>
<th>序号</th>
<th>托盘号</th>
<th>订单号</th>
<th>订单行号</th>
<th>规格</th>
<th>数量</th>
<th>明细数</th>
<th>入库点</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toRadio(e)">
<td>
<button class="iconfont select_icon select_square_icon" :class="e.checked ? 'selected_icon' : 'unselect_icon'"></button>
</td>
<td>{{ i+1 }}</td>
<td>{{ e.device_code }}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.deviceinstor_weight | unitskg}}</td>
<td>{{ e.deviceinstor_qty | numeric(3) }}</td>
<td>{{ e.task_code }}</td>
<td>{{ e.update_time }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script>
import {dictAll, washSpecList, washQuery, washSubmitWash} from '@config/getData2.js'
export default {
name: 'batchinstore',
data () {
return {
options1: [],
value1: '',
options2: [],
value2: '',
dataList: [],
checkArr: [],
disabled1: false
}
},
created () {
this._dictAll()
this._washSpecList()
},
methods: {
// 车间下拉框
async _dictAll () {
let res = await dictAll()
if (res.code === 200) {
this.options1 = [...res.content]
this.value1 = this.options1[0].value
this._washQuery()
}
},
// 规格下拉框
async _washSpecList () {
let res = await washSpecList()
if (res.code === 200) {
this.options2 = [...res.content]
}
},
// grid
async _washQuery () {
let res = await washQuery(this.value1, this.value2)
if (res.code === 200) {
this.checkArr = []
res.content.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.content]
}
},
// 确认上料
async _washSubmitWash () {
this.disabled1 = true
if (this.checkArr.length === 0) {
this.disabled1 = false
return
}
try {
let arr = []
this.checkArr.map(el => {
arr.push(el.device_code)
})
let res = await washSubmitWash(arr)
if (res.code === 200) {
this.toast(res.msg)
this._washQuery()
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
toJump () {
this.$router.push('/palletdetail')
},
toRadio (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
}
}
}
</script>
<style lang="stylus" scoped>
.grid_wraper
height calc(100% - 1.1rem)
</style>

View File

@@ -5,6 +5,13 @@
@switchColor="switchColor"
/>
<div class="body-container">
<div v-show="Number($route.meta.guidePath) > 3" class="tabs_wrap">
<ul class="tabs">
<li v-for="i in menus" :key="i.index">
<router-link :to="i.router" :class="{'router-link-active': i.router === $route.path || i.router2 === $route.path}">{{i.label}}</router-link>
</li>
</ul>
</div>
<div class="main-container">
<keep-alive :include="keepAlive" >
<router-view/>
@@ -22,15 +29,30 @@ export default {
jxHeader
},
data () {
return {}
return {
menus: [
{
label: '批量入库',
router: '/batchinstore',
router2: '/palletdetail'
},
{
label: '作业查询',
router: '/batchtasksearch'
}
]
}
},
computed: {
title () {
let res = ['成品入库', '选择销售订单', '成品入库查询'][Number(this.$route.meta.guidePath) - 1]
let res = ['成品入库', '选择销售订单', '成品入库查询', '批量入库', '作业查询'][Number(this.$route.meta.guidePath) - 1]
return res
},
...mapGetters(['keepAlive'])
},
created () {
console.log(this.$route.meta.guidePath)
},
methods: {
switchColor (type) {
switch (type) {
@@ -58,6 +80,26 @@ export default {
margin 0 auto 10px
padding 5px
border 1px solid #484cce
.tabs_wrap
height 34px
.tabs
height 34px
li
float left
line-height 32px
text-align center
padding-right 10px
a
display inline-block
color #fff
width 100%
padding 0 10px
font-size 14px
border-bottom 1px solid #2aa6f9
.router-link-active
background linear-gradient(#0de0ff 0%,#2aa6f9 100%)
border-top-left-radius 12px
border-top-right-radius 12px
.main-container
_wh(100%, 100%)
_wh(100%, calc(100% - 34px))
</style>

View File

@@ -0,0 +1,182 @@
<template>
<div class="order-wraper">
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item_2">
<div class="search-label">工单日期</div>
<div class="filter_input_wraper">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-label">单据号</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input filter-input_1" placeholder="工单号、物料编码">
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
</div>
</div>
<div class="search-item">
<div class="search-label">物料</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input filter-input_1" placeholder="工单号、物料编码">
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
</div>
</div>
<div class="search-item_2">
<button class="button button--primary" @click="_bypda">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button>
<button class="button button--primary">清除</button>
<button class="button button--primary">关闭</button>
</div>
</div>
</div>
<div class="grid_wraper" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
<table class="filter-table">
<thead>
<tr>
<th>选择</th>
<th>序号</th>
<th>日期</th>
<th>单据号</th>
<th>客户</th>
<th>箱号</th>
<th>物料编码</th>
<th>物料名称</th>
<th>物料类别</th>
<th>数量</th>
<th>单位</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.struct_code}" @click="toRadio(e)">
<td>{{ i + 1 }}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.canuse_qty | numeric(3)}}</td>
<td>{{ e.material_code }}</td>
<td>{{ e.instorage_time }}</td>
<td>{{ e.is_pick === true ? '是' : '否' }}</td>
<td>{{ e.instorage_type }}</td>
</tr>
</tbody>
</table>
<div class="loading-tips">{{desc}}</div>
</div>
</div>
</template>
<script>
import { bypda } from '@config/getData2.js'
export default {
name: 'palletdetail',
data () {
return {
dataList: [],
pkId: '',
pkObj: {},
page: 1,
size: '99',
busy: false,
desc: ''
}
},
created () {
this._bypda()
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login' || to.path === '/letteringtasklist') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
},
methods: {
clearData (e) {
switch (e) {
case 1:
this.keyValue = ''
break
}
},
// grid
async _bypda () {
this.page = 1
this.busy = false
this.desc = ''
let res = await bypda(this.page + '', this.size)
this.dataList = []
this.dataList = [...res.content]
if (res.content.length < 99) {
this.busy = true
this.desc = '已加载全部数据'
}
},
async loadMore () {
this.busy = true
this.page++
let res = await bypda(this.page + '', this.size)
this.dataList = [...this.dataList, ...res.content]
if (res.content.length < 99) {
this.busy = true
this.desc = '已加载全部数据'
} else {
this.busy = false
}
},
toRadio (e) {
this.pkId = this.pkId === e.struct_code ? '' : e.struct_code
this.pkObj = this.pkId === e.struct_code ? e : {}
},
toSure () {
if (!this.pkId) {
return
}
this.$router.push({
path: '/letteringmachineselect',
query: {
code: this.pkObj.struct_code,
weight: this.pkObj.canuse_qty
}
})
}
}
}
</script>
<style lang="stylus" scoped>
.filter_item
&:nth-child(1)
width 37%
&:nth-child(2)
width calc(30% - 10px)
&:nth-child(3)
width calc(33% - 10px)
.filter-input_1
padding-right 30px
.close_icon
width 20px
height 20px
font-size 15px
line-height 20px
top 5px
right 10px
.search-item_2
margin-left 0
&:nth-child(4)
margin-left 2%
margin-right 0
.search-item
&:nth-child(2)
margin-left 2%
margin-right 0
.grid_wraper
height calc(100% - 1.1rem)
</style>

View File

@@ -0,0 +1,261 @@
<template>
<div class="order-wraper">
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item_2">
<div class="search-label">工单日期</div>
<div class="filter_input_wraper">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-label">设备</div>
<div class="filter_input_wraper">
<el-select v-model="value" filterable placeholder="请选择">
<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 class="search-item">
<div class="search-label">关键字</div>
<div class="filter_input_wraper">
<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>
<div class="search-item_2">
<button class="button button--primary" @click="getDatas">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled1" @click="showDialog">残次品报工</button>
</div>
</div>
</div>
<div class="grid_wraper">
<table class="filter-table">
<tr>
<!-- <th width="4%"></th> -->
<th width="8%">工单日期</th>
<th width="8%">工单号</th>
<th width="7%">设备</th>
<th width="5%">状态</th>
<th width="9%">物料名称</th>
<th width="8%">物料规格</th>
<th width="5%">工序</th>
<th width="8%">工单数量</th>
<th width="8%">实际数量</th>
<th width="8%">报废数量</th>
<th width="8%">报修数量</th>
<th width="9%">开始时间</th>
<th width="9%">结束时间</th>
</tr>
<tr v-for="e in dataList" :key="e.workorder_id" :class="{'selected_icon': pkId === e.workorder_id}" @click="toRadio(e)">
<!-- <td>
<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.device_code}}</td>
<td>{{e.workorder_status_name}}</td>
<td>{{ e.material_name }}</td>
<td>{{e.material_spec}}</td>
<td>{{e.workprocedure_name}}</td>
<td>{{e.plan_qty}}</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>
<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="nokQty">
</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="repareQty">
</div>
</div>
</div>
</div>
</jxDialog>
</div>
</template>
<script>
import {dateFtt} from '@config/utils.js'
import jxDialog from '@components/dialog.vue'
import { deviceList, getTable, unqualReport, orderStatus } from '../../../config/getData2.js'
export default {
components: {
jxDialog
},
data () {
return {
value1: [new Date((new Date().getTime() - 24 * 60 * 60 * 1000)), new Date((new Date().getTime() + 24 * 60 * 60 * 1000))],
options: [],
value: '',
keyValue: '',
disabled1: false,
dataList: [],
pkId: '',
pkObj: {},
nokQty: '',
repareQty: '',
status: []
}
},
computed: {
closeIcon1 () {
return this.keyValue !== ''
}
},
watch: {
keyValue () {
this.debouncedgetDatas()
}
},
created () {
this._deviceList()
this.debouncedgetDatas = this.debounce(this.getDatas, 500)
this._orderStatus()
},
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 _orderStatus () {
let res = await orderStatus()
this.status = [...res]
this.getDatas()
},
async getDatas () {
let res = await getTable(this.value, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '')
if (res.code === 200) {
res.content.map(el => {
this.status.map(e => {
if (e.value === Number(el.workorder_status)) {
this.$set(el, 'workorder_status_name', e.label)
}
})
})
this.dataList = [...res.content]
}
this.dataList = [...res.content]
},
clearData (e) {
switch (e) {
case 1:
this.keyValue = ''
break
}
},
toRadio (e) {
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
this.pkObj = this.pkId === e.workorder_id ? e : {}
},
showDialog () {
if (!this.pkId) {
this.toast('请选择一行')
return
}
this.nokQty = ''
this.repareQty = ''
this.$refs.child.active = true
},
toSureDialog () {
this._unqualReport()
},
// 残次品报工
async _unqualReport () {
this.$refs.child.disabled = true
this.disabled1 = true
if (!this.pkId) {
this.toast('请选择一行')
this.disabled1 = false
return
}
try {
let res = await unqualReport(this.pkId, this.nokQty, this.repareQty)
this.toast(res.message)
this.disabled1 = false
this.pkId = ''
this.pkObj = {}
this.$refs.child.active = false
this.$refs.child.disabled = false
this.getDatas()
} catch (e) {
this.disabled1 = false
this.$refs.child.active = false
this.$refs.child.disabled = false
}
}
}
}
</script>
<style lang="stylus" scoped>
.filter_item
&:nth-child(1)
width 37%
&:nth-child(2)
width calc(30% - 10px)
&:nth-child(3)
width calc(33% - 10px)
.filter-input_1
padding-right 30px
.close_icon
width 20px
height 20px
font-size 15px
line-height 20px
top 5px
right 10px
.search-item_2
margin-left 0
&:nth-child(4)
margin-left 2%
margin-right 0
.search-item
&:nth-child(2)
margin-left 2%
margin-right 0
.grid_wraper
height calc(100% - 1.1rem)
</style>

View File

@@ -3,11 +3,17 @@
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item">
<div class="search-label">载具</div>
<div class="search-label">货位</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="$route.query.code" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">规格</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="$route.query.spec" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">重量</div>
<div class="filter_input_wraper">
@@ -86,10 +92,15 @@ export default {
}
},
distribute () {
let weight = accDiv(this.$route.query.weight, this.dataList.length)
if (this.checkArr.length === 0) {
return
}
let weight = accDiv(this.$route.query.weight, this.checkArr.length)
weight = Number(weight).toFixed(3)
this.dataList.map(el => {
this.$set(el, 'weight', weight)
if (el.checked === true) {
this.$set(el, 'weight', weight)
}
})
},
toCancle () {
@@ -125,7 +136,7 @@ export default {
try {
let arr = []
this.checkArr.map(el => {
arr.push({device_code: el.device_code, weight: el.weight})
arr.push({device_code: el.device_code, weight: el.weight, struct_code: this.$route.query.code})
})
let res = await kzSubmitkz(arr)
if (res.code === 200) {
@@ -149,13 +160,6 @@ export default {
</script>
<style lang="stylus" scoped>
.search-item
&:nth-child(1), &:nth-child(2)
width 24%
&:nth-child(3)
width 48%
.search-label
width .55rem
.filter_input_wraper
width calc(100% - .55rem)
.grid_wraper
height calc(100% - 1.1rem)
</style>

View File

@@ -106,7 +106,8 @@ export default {
path: '/letteringmachineselect',
query: {
code: this.pkObj.struct_code,
weight: this.pkObj.canuse_qty
weight: this.pkObj.canuse_qty,
spec: this.pkObj.material_spec
}
})
}

View File

@@ -11,6 +11,9 @@ const finishedIndex = r => require.ensure([], () => r(require('@page/modules/fin
const finishedInstore = r => require.ensure([], () => r(require('@page/modules/finished/finished-instore')), 'finished')
const selectFinishedMater = r => require.ensure([], () => r(require('@page/modules/finished/select-finished-mater')), 'finished')
const finishedInstoreSearch = r => require.ensure([], () => r(require('@page/modules/finished/finished-instore-search')), 'finished')
const batchInstore = r => require.ensure([], () => r(require('@page/modules/finished/batch-instore')), 'finished')
const batchTaskSearch = r => require.ensure([], () => r(require('@page/modules/finished/task-search')), 'finished')
const palletDetail = r => require.ensure([], () => r(require('@page/modules/finished/pallet-detail')), 'finished')
const semifinishedIndex = r => require.ensure([], () => r(require('@page/modules/semifinished/index')), 'semifinished')
const semiFinishedInstore = r => require.ensure([], () => r(require('@page/modules/semifinished/semi-finished-instore')), 'semifinished')
@@ -94,6 +97,18 @@ export default new Router({
path: '/finishedinstoresearch', // 成品入库查询
component: finishedInstoreSearch,
meta: {guidePath: '3'}
}, {
path: '/batchinstore', // 批量入库
component: batchInstore,
meta: {guidePath: '4'}
}, {
path: '/batchtasksearch', // 作业查询
component: batchTaskSearch,
meta: {guidePath: '5'}
}, {
path: '/palletdetail', // 托盘明细
component: palletDetail,
meta: {guidePath: '6'}
}]
},
{