Browse Source

加工看板

master
蔡玲玲 7 months ago
parent
commit
b7b0c3c7c2
  1. BIN
      lms/nladmin-ui/src/assets/images/screen_1.png
  2. BIN
      lms/nladmin-ui/src/assets/images/screen_2.png
  3. BIN
      lms/nladmin-ui/src/assets/images/screen_3.png
  4. BIN
      lms/nladmin-ui/src/assets/images/screen_4.png
  5. BIN
      lms/nladmin-ui/src/assets/images/screen_bg.jpg
  6. 692
      lms/nladmin-ui/src/views/wms/produceScreen/index.vue
  7. 235
      lms/nladmin-ui/src/views/wms/produceScreen/index_back.vue
  8. 37
      lms/nladmin-ui/src/views/wms/produceScreen/produceScreen.js

BIN
lms/nladmin-ui/src/assets/images/screen_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
lms/nladmin-ui/src/assets/images/screen_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

BIN
lms/nladmin-ui/src/assets/images/screen_3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
lms/nladmin-ui/src/assets/images/screen_4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

BIN
lms/nladmin-ui/src/assets/images/screen_bg.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

692
lms/nladmin-ui/src/views/wms/produceScreen/index.vue

@ -1,235 +1,531 @@
<template>
<div style="border: 1px solid #938d8d;margin-left: 10px;margin-right: 10px;">
<el-row>
<el-col :span="18">
<div class="grid-content bg-purple"><h2 style="margin-left: 30px;padding-top: 10px;">车间加工看板</h2></div>
<div class="grid-content bg-purple">
&ensp;&ensp;
<!-- <el-button type="primary" icon="el-icon-search" @click="queryTask(query.device_code)">搜索</el-button>-->
<el-button type="primary" icon="el-icon-thumb" @click="fresh">界面刷新</el-button>
<el-button style="margin-left: 30px;" type="warning" icon="el-icon-position" @click="callMaterial">生产叫料</el-button>
<el-button style="margin-left: 30px;" type="success" icon="el-icon-finished" @click="finish">生产完成</el-button>
<el-button style="margin-left: 30px;" type="danger" icon="el-icon-top-left" @click="materialBack">余料回库</el-button>
<el-button style="margin-left: 30px;" type="info" icon="el-icon-top-left" @click="emptyVehicleBack">空托回库</el-button>
</div>
<div class="container ver-center">
<el-row type="flex" justify="center" class="height-30">
<el-col :span="5" class="height-100 ver-justify">
<el-row type="flex" justify="space-between" class="btns-wrap">
<el-col :span="9" class="height-100 ver-justify">
<div class="s-btn-1">Container</div>
<div class="s-btn-1">Scaner</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple-light">
<h2 style="text-align:right;margin-right: 140px;">{{ getTime }}</h2>
<el-col :span="13" class="height-100">
<div class="s-btn-2"><p>OUT1</p></div>
</el-col>
</el-row>
<el-row type="flex" justify="space-between" class="btns-wrap">
<el-col :span="9" class="height-100 ver-justify">
<div class="s-btn-1">Container</div>
<div class="s-btn-1">Scaner</div>
</el-col>
<el-col :span="13" class="height-100">
<div class="s-btn-2" @click="showPop(3)"><p>OUT3</p></div>
</el-col>
</el-row>
</el-col>
<el-col :span="9" class="height-100 ver-justify mg2">
<div class="m-content ver-center" @click="showPop(1)">
<p>{{ pkObj.label }}</p>
</div>
<div class="grid-content bg-purple-light">
<p style="text-align:right;margin-right: 110px;"><b>{{ getDate }}</b></p>
<el-row type="flex" justify="space-between" class="btns-wrap-2">
<el-col :span="7" class="height-100">
<div class="s-btn-2" @click="showPop(2)"><p>N1</p></div>
</el-col>
<el-col :span="4" class="height-100 ver-center">
<div class="s-btn-1"><p>&radic;</p></div>
</el-col>
<el-col :span="7" class="height-100">
<div class="s-btn-2"><p>N2</p></div>
</el-col>
<el-col :span="4" class="height-100 ver-center">
<div class="s-btn-1"><p>&radic;</p></div>
</el-col>
</el-row>
</el-col>
<el-col :span="5" class="height-100 ver-justify">
<el-row type="flex" justify="space-between" class="btns-wrap">
<el-col :span="13" class="height-100">
<div class="s-btn-2"><p>OUT2</p></div>
</el-col>
<el-col :span="9" class="height-100 ver-justify">
<div class="s-btn-1">Container</div>
<div class="s-btn-1">Scaner</div>
</el-col>
</el-row>
<el-row type="flex" justify="space-between" class="btns-wrap">
<el-col :span="13" class="height-100">
<div class="s-btn-2"><p>OUT4</p></div>
</el-col>
<el-col :span="9" class="height-100 ver-justify">
<div class="s-btn-1">Container</div>
<div class="s-btn-1">Scaner</div>
</el-col>
</el-row>
</el-col>
</el-row>
<div class="pop-wraper" :class="{'popshow': show, 'pophide': !show, 'pop-wraper-1': type === 3}">
<div v-show="type === 1" class="pop-h1">选择设备</div>
<div v-show="type === 1" class="pop-grid">
<el-table
ref="singleTable"
:data="machineData"
height="100%"
highlight-current-row
style="width: 100%"
@current-change="handleCurrentChange1"
>
<el-table-column
prop="value"
label="设备号"
/>
<el-table-column
prop="label"
label="设备名称"
/>
</el-table>
</div>
<el-row v-show="type === 1" class="pop-btns">
<el-col :span="3" :offset="6" class="height-100">
<div class="s-btn-1 s-btn-3" @click="toSure">确定</div>
</el-col>
<el-col :span="3" :offset="6" class="height-100">
<div class="s-btn-1 s-btn-3" @click="show = false, vechineList = []">取消</div>
</el-col>
</el-row>
<br>
<br>
<div>
<!--表格渲染-->
<div v-show="type === 2" class="pop-grid">
<el-row type="flex" justify="space-between">
<el-col :span="14">
<el-table
ref="table"
:data="tableData"
size="small"
style="width: 100%;"
@selection-change="handleSelectionChange"
ref="singleTable"
:data="n1List"
height="100%"
highlight-current-row
style="width: 100%"
@current-change="handleCurrentChange2"
>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column v-if="false" prop="produce_uuid" label="生产标识"/>
<el-table-column prop="produce_code" label="生产编码"/>
<el-table-column prop="produce_status_name" label="生产状态" :formatter="formatStatusName"/>
<el-table-column prop="device_code" label="生产设备"/>
<el-table-column prop="produce_qty" label="加工数量"/>
<el-table-column prop="finishproduce_qty" label="完工数量"/>
<el-table-column prop="order_seq" label="顺序号"/>
<el-table-column prop="formula" label="配方"/>
<el-table-column prop="pcsn" label="批次"/>
<el-table-column v-if="false" prop="material_code" label="物料编码"/>
<el-table-column prop="material_name" label="物料名字"/>
<el-table-column prop="start_time" label="开始生产时间"/>
prop="order"
label="订单编码"
/>
<el-table-column
prop="work_code"
label="工序编码"
/>
<el-table-column
prop="material_code"
label="物料编码"
/>
<el-table-column
prop="material_type"
label="物料类型"
/>
<el-table-column
prop="material_name"
label="物料名称"
/>
<el-table-column
prop="qty"
label="额定数量"
/>
<el-table-column
prop="plan_date"
label="交货日期"
/>
</el-table>
<!--分页组件-->
</el-col>
<el-col :span="9">
<el-table
ref="singleTable"
:data="vechineList"
height="100%"
highlight-current-row
style="width: 100%"
@current-change="handleCurrentChange3"
>
<el-table-column
prop="载具编码"
label="载具编码"
/>
<el-table-column
prop="order"
label="订单编码"
/>
<el-table-column
prop="qty"
label="物料数量"
/>
<el-table-column
prop="point_code"
label="所在货位"
/>
</el-table>
</el-col>
</el-row>
</div>
<el-row v-show="type === 2" class="pop-btns">
<el-col :span="3" :offset="3" class="height-100">
<div class="s-btn-1 s-btn-3" @click="toSure">确定</div>
</el-col>
<el-col :span="3" :offset="3" class="height-100">
<div class="s-btn-1 s-btn-3" @click="show = false, vechineList = []">取消</div>
</el-col>
<el-col :span="3" :offset="6" class="height-100">
<div class="s-btn-1 s-btn-3" @click="toCall">叫料</div>
</el-col>
</el-row>
<div v-show="type === 3" class="pop-grid">
<el-row class="filter-wraper" type="flex" justify="space-between">
<el-col :span="5" class="p-label">订单编号</el-col>
<el-col :span="18"><input type="text" class="p-value"></el-col>
</el-row>
<el-row class="filter-wraper" type="flex" justify="space-between">
<el-col :span="5" class="p-label">额定数量</el-col>
<el-col :span="18"><input type="text" class="p-value"></el-col>
</el-row>
<el-row class="filter-wraper" type="flex" justify="space-between">
<el-col :span="5" class="p-label">工序</el-col>
<el-col :span="18"><input type="text" class="p-value"></el-col>
</el-row>
<el-row class="filter-wraper" type="flex" justify="space-between">
<el-col :span="5" class="p-label">合格品</el-col>
<el-col :span="18"><input type="number" class="p-value"></el-col>
</el-row>
<el-row class="filter-wraper" type="flex" justify="space-between">
<!-- <el-checkbox v-model="checked">备选项</el-checkbox> -->
<el-col :span="5" class="p-label">是否报功</el-col>
<el-col :span="18"><el-checkbox v-model="checked" /></el-col>
</el-row>
<el-row class="filter-wraper" type="flex" justify="space-between">
<el-col :span="5" class="p-label">托盘编码</el-col>
<el-col :span="18"><input type="text" class="p-value"></el-col>
</el-row>
<el-row class="filter-wraper" type="flex" justify="space-between">
<el-col :span="5" class="p-label">地面点位</el-col>
<el-col :span="18"><input type="text" class="p-value"></el-col>
</el-row>
</div>
<el-row v-show="type === 3" class="pop-btns">
<el-col :span="5" :offset="5" class="height-100">
<div class="s-btn-1 s-btn-3" @click="show = false">确定</div>
</el-col>
<el-col :span="5" :offset="5" class="height-100">
<div class="s-btn-1 s-btn-3" @click="show = false">取消</div>
</el-col>
</el-row>
</div>
<div v-show="show" class="modal" />
</div>
</template>
<script>
import crudProduceTask from '@/views/wms/produceScreen/produceScreen'
import crud from '@/mixins/crud'
import { machine, n1list, n1list2 } from '@/views/wms/produceScreen/produceScreen'
export default {
name: 'ProduceScreen',
mixins: [crud],
data() {
return {
currentDate: new Date(),
getTime: '',
getDate: '',
deviceList: [],
choice: '',
ProduceStatusList: [],
materialList: [],
tableData: [],
id: null
type: null,
show: false,
machineData: [],
n1List: [],
vechineList: [],
currentRow1: null,
currentRow2: null,
currentRow3: null,
pkObj: { label: 'MACHINE' },
checked: false
}
},
created() {
this.id = this.$route.params.id
crudProduceTask.getDevice().then(res => {
this.deviceList = res
})
crudProduceTask.getProduceStatus().then(res => {
this.ProduceStatusList = res
})
crudProduceTask.getMaterial().then(res => {
this.materialList = res
})
this.queryId()
},
mounted() {
//
const timer = setInterval(() => {
this.settime()//
}, 1000)
//
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)
})
},
methods: {
settime() {
const _this = this
const yy = new Date().getFullYear()
const mm = new Date().getMonth() + 1
const dd = new Date().getDate()
const hh = new Date().getHours()
const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
_this.getDate = yy + '年' + mm + '月' + dd + '日 ' + '星期' + '日一二三四五六'.charAt(new Date().getDay())
_this.getTime = hh + ':' + mf + ':' + ss
showPop(type) {
this.type = type
if (type === 1) {
this._machine()
} else if (type === 2) {
this._n1list()
} else if (type === 3) {
this.show = true
}
},
queryTask(value) {
crudProduceTask.queryTask(value).then(res => {
this.tableData = res
})
async _machine() {
const res = await machine()
this.machineData = [...res]
this.show = true
},
notify(title, type) {
this.$notify({
title: title,
type: type,
duration: 2500
})
async _n1list() {
const res = await n1list()
this.n1List = [...res]
this.vechineList = []
this.show = true
},
fresh() {
this.queryId()
this.notify('操作成功', 'success')
async _n1list2() {
const res = await n1list2()
this.vechineList = [...res]
},
callMaterial() {
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
const data = this.$refs.table.selection[0]
crudProduceTask.callMaterial(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
handleCurrentChange1(val) {
this.currentRow1 = val
},
finish() {
debugger
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
// <
for (const i in this.$refs.table.selection) {
console.log(this.$refs.table.selection[i])
if (this.$refs.table.selection[i].finishproduce_qty <= this.$refs.table.selection[i].produce_qty) {
this.$confirm('完工数量小于加工数量,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = this.$refs.table.selection[0]
crudProduceTask.finish(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
}).catch(() => {
/*this.$message({
type: 'info',
message: '已取消'
})*/
})
}
}
handleCurrentChange2(val) {
this.currentRow2 = val
this._n1list2()
},
materialBack() {
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
const data = this.$refs.table.selection[0]
crudProduceTask.materialBack(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
handleCurrentChange3(val) {
this.currentRow3 = val
},
emptyVehicleBack() {
const data = {
id: this.id
}
debugger
crudProduceTask.emptyVehicleBack(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
toSure() {
this.pkObj = this.currentRow1
this.show = false
},
formatStatusName(row, column) {
for (const item of this.ProduceStatusList) {
if (item.code === row.produce_status) {
return item.name
toCall() {
this.$message('操作成功')
this.show = false
}
}
},
changeFun(val) {
this.choice = val[0]
if (val.length > 1) {
return this.$message.error('请选择一条信息操作')
}
},
handleSelectionChange(val) {
this.multipleSelection = val
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
}
},
</script>
queryId() {
const id = this.$route.params.id
crudProduceTask.queryIdDevice(id).then(res => {
this.tableData = res
})
<style rel="stylesheet/scss" lang="scss" scoped>
.container {
// width: 1280px;
// height: 960px;
width: 100%;
height: 100%;
padding: 1.5%;
box-sizing: border-box;
background: center / 100% 100% url('~@/assets/images/screen_bg.jpg') no-repeat;
}
.height-10 {
height: 10%;
}
.height-20 {
height: 20%;
}
.height-30 {
height: 30%;
}
.height-100 {
height: 100%;
}
.mg2 {
margin: 0 2%;
}
.ver-justify {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.ver-center {
display: flex;
flex-direction: column;
justify-content: center;
}
.s-btn-1 {
display: flex;
align-items: center;
justify-content: center;
height: 45%;
font-size: 14px;
line-height: 1;
text-align: center;
color: #fff;
padding: 0 15px;
background: center / 100% 100% url('~@/assets/images/screen_1.png') no-repeat;
}
.s-btn-2 {
position: relative;
height: 100%;
background-color: #b3d8ff;
border: 1px solid #53a8ff;
border-radius: 16px;
&::before {
position: absolute;
content: '';
left: 0;
top: 20%;
width: 100%;
height: 80%;
background-image: linear-gradient(to bottom, #66b1ff, #a0cfff);
border-radius: 16px;
}
p {
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
line-height: 22px;
font-weight: 700;
color: #fff;
margin: 0;
}
}
.s-btn-3 {
height: 100%;
}
.btns-wrap {
height: 40%;
}
.btns-wrap-2 {
height: 35%;
}
.m-content {
height: 54%;
border: 1px solid #4aaee2;
border-radius: 10px;
padding: 10px;
box-sizing: border-box;
background-image: linear-gradient(to right, rgba(36, 128, 207, 0.5), rgba(15, 61, 101, 0.5));
box-shadow: inset 1px 1px 4px 2px rgb(74 174 226 / 40%), inset -1px -1px 4px 2px rgb(74 174 226 / 40%);
p {
font-size: 24px;
line-height: 1;
font-weight: 700;
text-align: center;
color: #3CC1FF;
margin: 0;
}
}
.m-content-2 {
width: 60%;
height: 65%;
margin: 1% auto 0;
}
.m-content-inner {
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
height: 100%;
// background-color: #fff;
border-radius: 10px;
padding: 2% 1%
}
.grid {
height: 90%;
padding-top: 2%;
}
.pop-wraper {
position: fixed;
top: 50%;
left: 5%;
z-index: 20;
width: 90%;
height: 80%;
border-radius: 15px;
padding: 3%;
background: center / 100% 100% url('~@/assets/images/screen_2.png') no-repeat;
}
.pop-wraper-1 {
width: 50%;
left: 25%;
height: 70%;
padding: 5% 3% 3% 3%;
background: center / 100% 100% url('~@/assets/images/screen_4.png') no-repeat;
}
.popshow {
transform: translateY(-50%);
}
.pophide {
transform: translateY(80%);
}
.modal {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
z-index: 10;
}
.pop-h1 {
font-size: 22px;
line-height: 1;
font-weight: 700;
text-align: left;
color: #F6F9FE;
margin: 0;
background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(49,190,255,0.9) 0%, rgba(239,252,254,1) 40%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.pop-btns {
height: 8%;
}
.pop-grid {
height: calc(92% - 24px);
padding: 2% 0;
}
>>>.el-table {
background-color: transparent;
}
>>>.el-table--border {
border: none;
}
>>>.el-table .el-table__header-wrapper th {
height: 40px;
}
>>>.el-table thead tr {
background: center / 100% 100% url('~@/assets/images/screen_3.png') no-repeat;
}
>>>.el-table .el-table__header-wrapper th {
background-color: transparent;
color: #AFBED8;
font-size: 16px;
}
>>>.el-table th.el-table__cell.is-leaf {
border-bottom-color: #5D92FF;
}
>>>.el-table--border .el-table__cell {
border-right: none;
}
>>>.el-table--mini .el-table__cell {
padding: 8px 0;
}
>>>.el-table {
color: #fff;
font-size: 14px;
tr {
background-color: rgba(31,46,73,0.3);
}
}
>>>.el-table td.el-table__cell {
border-bottom-color: rgba(122,159,224,0.17);
}
>>>.el-table::before, .el-table--group::after, .el-table--border::after {
background-color: rgba(122,159,224,0.17);
}
>>>.el-table__body tr.current-row>td.el-table__cell {
background-color: #3F6ACA;
}
.filter-wraper {
margin-bottom: 20px;
}
.p-label {
font-size: 18px;
line-height: 40px;
text-align: right;
color: #fff;
margin: 0;
}
.p-value {
width: 100%;
font-size: 18px;
line-height: 40px;
height: 40px;
text-align: left;
color: #fff;
margin: 0;
background: rgba(45,88,184,0.25);
border: 1px solid #21D0F2;
}
>>>.el-checkbox__inner {
width: 40px;
height: 40px;
line-height: 40px;
font-size: 40px;
}
>>>.el-checkbox__inner::after {
width: 6px;
height: 20px;
left: 15px;
top: 3px;
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

235
lms/nladmin-ui/src/views/wms/produceScreen/index_back.vue

@ -0,0 +1,235 @@
<template>
<div style="border: 1px solid #938d8d;margin-left: 10px;margin-right: 10px;">
<el-row>
<el-col :span="18">
<div class="grid-content bg-purple"><h2 style="margin-left: 30px;padding-top: 10px;">车间加工看板</h2></div>
<div class="grid-content bg-purple">
&ensp;&ensp;
<!-- <el-button type="primary" icon="el-icon-search" @click="queryTask(query.device_code)">搜索</el-button>-->
<el-button type="primary" icon="el-icon-thumb" @click="fresh">界面刷新</el-button>
<el-button style="margin-left: 30px;" type="warning" icon="el-icon-position" @click="callMaterial">生产叫料</el-button>
<el-button style="margin-left: 30px;" type="success" icon="el-icon-finished" @click="finish">生产完成</el-button>
<el-button style="margin-left: 30px;" type="danger" icon="el-icon-top-left" @click="materialBack">余料回库</el-button>
<el-button style="margin-left: 30px;" type="info" icon="el-icon-top-left" @click="emptyVehicleBack">空托回库</el-button>
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple-light">
<h2 style="text-align:right;margin-right: 140px;">{{ getTime }}</h2>
</div>
<div class="grid-content bg-purple-light">
<p style="text-align:right;margin-right: 110px;"><b>{{ getDate }}</b></p>
</div>
</el-col>
</el-row>
<br>
<br>
<div>
<!--表格渲染-->
<el-table
ref="table"
:data="tableData"
size="small"
style="width: 100%;"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
/>
<el-table-column v-if="false" prop="produce_uuid" label="生产标识" />
<el-table-column prop="produce_code" label="生产编码" />
<el-table-column prop="produce_status_name" label="生产状态" :formatter="formatStatusName" />
<el-table-column prop="device_code" label="生产设备" />
<el-table-column prop="produce_qty" label="加工数量" />
<el-table-column prop="finishproduce_qty" label="完工数量" />
<el-table-column prop="order_seq" label="顺序号" />
<el-table-column prop="formula" label="配方" />
<el-table-column prop="pcsn" label="批次" />
<el-table-column v-if="false" prop="material_code" label="物料编码" />
<el-table-column prop="material_name" label="物料名字" />
<el-table-column prop="start_time" label="开始生产时间" />
</el-table>
<!--分页组件-->
</div>
</div>
</template>
<script>
import crudProduceTask from '@/views/wms/produceScreen/produceScreen'
import crud from '@/mixins/crud'
export default {
name: 'ProduceScreen',
mixins: [crud],
data() {
return {
currentDate: new Date(),
getTime: '',
getDate: '',
deviceList: [],
choice: '',
ProduceStatusList: [],
materialList: [],
tableData: [],
id: null
}
},
created() {
this.id = this.$route.params.id
crudProduceTask.getDevice().then(res => {
this.deviceList = res
})
crudProduceTask.getProduceStatus().then(res => {
this.ProduceStatusList = res
})
crudProduceTask.getMaterial().then(res => {
this.materialList = res
})
this.queryId()
},
mounted() {
//
const timer = setInterval(() => {
this.settime()//
}, 1000)
//
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)
})
},
methods: {
settime() {
const _this = this
const yy = new Date().getFullYear()
const mm = new Date().getMonth() + 1
const dd = new Date().getDate()
const hh = new Date().getHours()
const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
_this.getDate = yy + '年' + mm + '月' + dd + '日 ' + '星期' + '日一二三四五六'.charAt(new Date().getDay())
_this.getTime = hh + ':' + mf + ':' + ss
},
queryTask(value) {
crudProduceTask.queryTask(value).then(res => {
this.tableData = res
})
},
notify(title, type) {
this.$notify({
title: title,
type: type,
duration: 2500
})
},
fresh() {
this.queryId()
this.notify('操作成功', 'success')
},
callMaterial() {
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
const data = this.$refs.table.selection[0]
crudProduceTask.callMaterial(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
},
finish() {
debugger
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
// <
for (const i in this.$refs.table.selection) {
console.log(this.$refs.table.selection[i])
if (this.$refs.table.selection[i].finishproduce_qty <= this.$refs.table.selection[i].produce_qty) {
this.$confirm('完工数量小于加工数量,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = this.$refs.table.selection[0]
crudProduceTask.finish(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
}).catch(() => {
/* this.$message({
type: 'info',
message: '已取消'
})*/
})
}
}
},
materialBack() {
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
const data = this.$refs.table.selection[0]
crudProduceTask.materialBack(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
},
emptyVehicleBack() {
const data = {
id: this.id
}
debugger
crudProduceTask.emptyVehicleBack(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
}).cache(err => {
console.log(err.response.data.message)
})
},
formatStatusName(row, column) {
for (const item of this.ProduceStatusList) {
if (item.code === row.produce_status) {
return item.name
}
}
},
changeFun(val) {
this.choice = val[0]
if (val.length > 1) {
return this.$message.error('请选择一条信息操作')
}
},
handleSelectionChange(val) {
this.multipleSelection = val
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
}
},
queryId() {
const id = this.$route.params.id
crudProduceTask.queryIdDevice(id).then(res => {
this.tableData = res
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

37
lms/nladmin-ui/src/views/wms/produceScreen/produceScreen.js

@ -142,6 +142,43 @@ export function queryIvtByPscn(data) {
})
}
export const machine = () => {
const res = [
{ value: '111-02', label: 'TP5000冲床加工' },
{ value: '111 03', label: '警平' },
{ value: '111-04', label: '激光切闻' },
{ value: '111-05', label: '复合机' },
{ value: '111-06', label: 'Amada 801冲床' },
{ value: '111-07', label: 'TruBend 7038' },
{ value: '111-08', label: 'TruBend 5170' },
{ value: '111 09', label: 'TruBend Cell 7000' },
{ value: '111-10', label: 'LAG Robot Bending Cell' },
{ value: '111-12', label: '气保焊' },
{ value: '111-13', label: '姆柱焊、点焊' },
{ value: '111-14', label: '林肯焊接机器人' },
{ value: '111-15', label: '铜冲机' },
{ value: '111-16', label: '铜弯机' },
{ value: '111-22', label: '钳床' },
{ value: '111-23', label: '压铆机' },
{ value: '111-24', label: '斯图加特焊接机器人' }
]
return res
}
export const n1list = () => {
const res = [
{ order: '800034202869', work_code: '111-07', material_code: 'A7E0019008760_00', material_type: 'S39_SA01', material_name: 'BBC支撑板后上', qty: '120', plan_date: '2024/8/11' }
]
return res
}
export const n1list2 = () => {
const res = [
{ vehicle_code: 'XXS23023012334', order: '800034202869', qty: '120', point_code: 'ZW01-03-02' }
]
return res
}
export default {
add, edit, del, getDevice, getMaterial,
getProduceStatus, importExcel, queryTask, querAllTask,

Loading…
Cancel
Save