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

350 lines
12 KiB
Vue
Raw Normal View History

2024-07-24 17:30:23 +08:00
<template>
2024-08-30 17:29:29 +08:00
<div class="container">
<button class="btn-close" :disabled="disabled" @click="toExit" />
<div class="m-content">
<p>{{ screenData.device_name }}</p>
</div>
2024-09-11 14:10:37 +08:00
<div class="button-wraper" :style="screenData.region_points.length <= 2 ? 'justify-content: center' : 'justify-content: space-between'">
<div v-for="(e, i) in screenData.region_points" :key="i" class="button-item" :class="{'button-item_3': screenData.region_points.length <= 3}">
2024-08-30 17:29:29 +08:00
<p v-if="e.type === '1'" class="point_name">{{ e.name }}</p>
<p v-if="e.type === '0'" class="point_name point_name_btn" @click="showPop('IN', e)">{{ e.name }}</p>
<p class="point_value">{{ e.device_code }}</p>
2024-09-05 16:33:48 +08:00
<div v-if="e.type === '1'" class="button" @click="showPop('CONTAINER', e)">呼叫空框</div>
<div v-if="e.type === '1'" class="button" @click="showPop('SCANER', e)">完成入库</div>
<div v-if="e.type === '0'" class="button" @click="showPop('BACK', e)">回库</div>
2024-07-31 16:25:04 +08:00
</div>
2024-08-30 17:29:29 +08:00
</div>
<div v-show="type === 'IN'" class="pop-wraper" :class="{'popshow': show, 'pophide': !show}">
<div class="pop-grid">
2024-07-31 16:25:04 +08:00
<el-row type="flex" justify="space-between">
2024-08-30 17:29:29 +08:00
<el-col :span="13">
2024-07-31 16:25:04 +08:00
<el-table
2024-08-30 17:29:29 +08:00
:data="popList"
2024-07-31 16:25:04 +08:00
style="width: 100%"
2024-08-30 17:29:29 +08:00
@current-change="handleCurrentChange"
2024-07-31 16:25:04 +08:00
>
2024-08-30 17:29:29 +08:00
<el-table-column
prop="vehicle_code"
label="载具号"
/>
2024-07-31 16:25:04 +08:00
<el-table-column
2024-08-13 17:28:37 +08:00
prop="order_code"
label="订单号"
2024-07-31 16:25:04 +08:00
/>
<el-table-column
2024-08-13 17:28:37 +08:00
prop="region_code"
label="工序"
2024-07-31 16:25:04 +08:00
/>
<el-table-column
2024-08-30 17:29:29 +08:00
prop="material_qty"
label="物料数量"
2024-07-31 16:25:04 +08:00
/>
<el-table-column
2024-08-30 17:29:29 +08:00
prop="due_date"
label="交期时间"
2024-07-31 16:25:04 +08:00
/>
2024-08-30 17:29:29 +08:00
</el-table>
</el-col>
<el-col :span="10">
<el-table
:data="popSecList"
style="width: 100%"
>
2024-07-31 16:25:04 +08:00
<el-table-column
2024-08-30 17:29:29 +08:00
prop="order_code"
label="订单号"
2024-07-31 16:25:04 +08:00
/>
<el-table-column
2024-08-21 15:20:57 +08:00
prop="due_date"
2024-08-13 17:28:37 +08:00
label="交期时间"
2024-07-31 16:25:04 +08:00
/>
<el-table-column
2024-08-30 17:29:29 +08:00
prop="material_qty"
label="物料数量"
2024-07-31 16:25:04 +08:00
/>
<el-table-column
2024-08-30 17:29:29 +08:00
prop="region_code"
label="工序"
2024-07-31 16:25:04 +08:00
/>
</el-table>
</el-col>
</el-row>
</div>
2024-08-30 17:29:29 +08:00
<el-row type="flex" justify="space-around">
<el-col :span="4">
<button class="login_button login_button_dis" @click="show = false">取消</button>
2024-07-31 16:25:04 +08:00
</el-col>
2024-08-30 17:29:29 +08:00
<el-col :span="4">
<button class="login_button" :disabled="disabled" @click="toSure">叫料</button>
2024-07-31 16:25:04 +08:00
</el-col>
</el-row>
2024-08-30 17:29:29 +08:00
</div>
<div v-show="type === 'CONTAINER'" class="pop-wraper pop-wraper-1" :class="{'popshow': show, 'pophide': !show}">
<div class="pop-h1">{{ popData.title }}</div>
<div class="pop-grid">
2024-07-31 16:25:04 +08:00
<el-row class="filter-wraper" type="flex" justify="space-between">
2024-08-13 17:28:37 +08:00
<el-col :span="5" class="p-label">托盘类型</el-col>
2024-08-20 13:57:21 +08:00
<el-col :span="18" class="select-wraper">
2024-08-30 17:29:29 +08:00
<el-select v-model="value" placeholder="请选择">
2024-08-20 13:57:21 +08:00
<el-option
2024-08-30 17:29:29 +08:00
v-for="item in options"
2024-08-20 13:57:21 +08:00
:key="item.value"
:label="item.label"
:value="item.value"
class="option-wraper"
/>
</el-select>
</el-col>
2024-07-31 16:25:04 +08:00
</el-row>
2024-08-13 17:28:37 +08:00
</div>
2024-08-30 17:29:29 +08:00
<el-row type="flex" justify="space-around">
<el-col :span="6">
<button class="login_button login_button_dis" @click="show = false">取消</button>
2024-08-13 17:28:37 +08:00
</el-col>
2024-08-30 17:29:29 +08:00
<el-col :span="6">
<button class="login_button" @click="toSure">确定</button>
2024-08-13 17:28:37 +08:00
</el-col>
</el-row>
2024-08-30 17:29:29 +08:00
</div>
<div v-show="type === 'SCANER'" class="pop-wraper" :class="{'popshow': show, 'pophide': !show}">
2024-09-05 16:33:48 +08:00
<el-row class="filter-wraper" type="flex" justify="space-between">
<el-col :span="2" class="p-label">目的地</el-col>
<el-col :span="8" class="select-wraper">
2024-09-10 10:07:19 +08:00
<el-select v-model="value1" placeholder="请选择">
2024-09-02 17:41:32 +08:00
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value"
class="option-wraper"
/>
</el-select>
</el-col>
2024-09-05 16:33:48 +08:00
<el-col :span="2" class="p-label" />
<el-col :span="2" class="p-label">载具号</el-col>
<el-col :span="8" class="select-wraper">
<input v-model="vcode" type="text" class="set-input">
</el-col>
2024-09-02 17:41:32 +08:00
</el-row>
<div class="pop-grid pop-grid_1">
2024-08-30 17:29:29 +08:00
<el-table
:data="popList"
style="width: 100%"
>
<el-table-column
label="订单号"
>
<template slot-scope="scope">
2024-09-05 16:33:48 +08:00
<div class="select-wraper">
2024-09-06 11:23:21 +08:00
<el-select
v-model="scope.row.order_code"
filterable
allow-create
default-first-option
placeholder="请选择"
>
2024-09-05 16:33:48 +08:00
<el-option
v-for="item in options2"
:key="item.order_code"
:label="item.order_code"
:value="item.order_code"
class="option-wraper"
/>
</el-select>
</div>
2024-08-30 17:29:29 +08:00
</template>
</el-table-column>
<el-table-column
label="数量"
>
<template slot-scope="scope">
2024-09-05 16:46:43 +08:00
<input v-model="scope.row.material_qty" type="text" class="set-input">
2024-08-30 17:29:29 +08:00
</template>
</el-table-column>
<el-table-column
label="操作"
>
<template>
2024-09-05 16:46:43 +08:00
<el-button circle type="primary" icon="el-icon-plus" @click="addRow" />
2024-08-30 17:29:29 +08:00
</template>
</el-table-column>
</el-table>
2024-07-31 16:25:04 +08:00
</div>
2024-08-30 17:29:29 +08:00
<el-row type="flex" justify="space-around">
<el-col :span="4">
<button class="login_button login_button_dis" @click="show = false">取消</button>
2024-07-31 16:25:04 +08:00
</el-col>
2024-08-30 17:29:29 +08:00
<el-col :span="4">
<button class="login_button" :disabled="disabled" @click="toSure">确定</button>
2024-08-20 13:57:21 +08:00
</el-col>
</el-row>
2024-08-30 17:29:29 +08:00
</div>
<div v-show="type === 'BACK'" class="pop-wraper" :class="{'popshow': show, 'pophide': !show}">
<div class="pop-grid">
<el-table
:data="popList"
style="width: 100%"
>
<el-table-column
prop="order_code"
label="订单号"
/>
<el-table-column
label="数量"
>
<template slot-scope="scope">
<input v-model="scope.row.material_qty" type="text" class="set-input">
</template>
</el-table-column>
</el-table>
2024-08-20 13:57:21 +08:00
</div>
2024-08-30 17:29:29 +08:00
<el-row type="flex" justify="space-around">
<el-col :span="4">
<button class="login_button login_button_dis" @click="show = false">取消</button>
2024-08-20 13:57:21 +08:00
</el-col>
2024-08-30 17:29:29 +08:00
<el-col :span="4">
<button class="login_button" :disabled="disabled" @click="toSure">确定</button>
2024-07-31 16:25:04 +08:00
</el-col>
</el-row>
2024-07-24 17:30:23 +08:00
</div>
2024-07-31 16:25:04 +08:00
<div v-show="show" class="modal" />
2024-07-24 17:30:23 +08:00
</div>
</template>
<script>
2024-08-13 17:28:37 +08:00
import crudProduceScreen from './produceScreen'
2024-09-05 16:33:48 +08:00
// import crudProduceScreen from './mork'
2024-07-24 17:30:23 +08:00
export default {
data() {
return {
2024-07-31 16:25:04 +08:00
show: false,
2024-08-30 17:29:29 +08:00
type: null,
popData: {},
popList: [],
popSecList: [],
currentRow: null,
value: '',
options: [{ value: 'G01', label: '钢托盘' }, { value: 'R01', label: '990mm笼框' }, { value: 'R02', label: '450mm 笼框' }, { value: 'S04', label: '1670mm料架' }, { value: 'S06', label: '1700mm料架' }],
2024-09-02 17:41:32 +08:00
value1: '',
2024-09-05 16:33:48 +08:00
options1: [{ value: '1', label: '货架' }, { value: '2', label: '内部' }, { value: '3', label: '外协' }],
value2: '',
options2: [],
vcode: '',
2024-08-30 17:29:29 +08:00
disabled: false
2024-07-24 17:30:23 +08:00
}
},
2024-08-30 17:29:29 +08:00
computed: {
screenData() {
let res = {}
if (this.$store.state.produceScreen.screenData !== '') {
res = JSON.parse(this.$store.state.produceScreen.screenData)
}
return res
}
2024-08-20 13:57:21 +08:00
},
2024-07-24 17:30:23 +08:00
methods: {
2024-08-30 17:29:29 +08:00
toExit() {
this.disabled = true
2024-09-02 13:41:17 +08:00
crudProduceScreen.loginOut({ username: this.screenData.username, device_code: this.screenData.device_code }).then(res => {
2024-08-30 17:29:29 +08:00
this.disabled = false
localStorage.removeItem('screenData')
this.$router.push('/produceScreen/setup')
}).catch(() => {
this.disabled = false
})
},
showPop(type, e) {
this.popData = {}
this.popList = []
this.popSecList = []
2024-09-02 13:58:19 +08:00
this.currentRow = null
2024-08-30 17:29:29 +08:00
this.value = ''
2024-09-02 17:41:32 +08:00
this.value1 = ''
2024-09-05 16:33:48 +08:00
this.vcode = ''
2024-07-31 16:25:04 +08:00
this.type = type
2024-08-30 17:29:29 +08:00
this.popData = e
if (type === 'IN') {
crudProduceScreen.regionOrder(this.screenData.device_code, this.popData.device_code).then(res => {
this.popList = [...res.content]
2024-08-13 17:28:37 +08:00
this.show = true
})
2024-08-30 17:29:29 +08:00
} else if (type === 'CONTAINER') {
this.popData.title = '选择托盘类型'
2024-08-20 13:57:21 +08:00
this.emptyObj = {}
this.val1 = ''
2024-08-13 17:28:37 +08:00
this.show = true
2024-08-30 17:29:29 +08:00
this.emptyObj.device_code = e.name
} else if (type === 'SCANER') {
2024-09-10 10:19:08 +08:00
crudProduceScreen.fabOrders({ device_code: this.screenData.in_code }).then(res => {
2024-09-05 16:33:48 +08:00
this.options2 = [...res]
})
2024-09-06 10:11:03 +08:00
crudProduceScreen.getPointVehicle({ device_code: this.popData.device_code }).then(res => {
2024-09-06 10:38:15 +08:00
this.vcode = res
2024-09-06 10:11:03 +08:00
})
2024-09-10 10:07:19 +08:00
this.popList.push({ order_code: '', material_qty: '' })
2024-08-20 13:57:21 +08:00
this.show = true
2024-08-30 17:29:29 +08:00
} else if (type === 'BACK') {
crudProduceScreen.fabOrders({ device_code: this.popData.device_code }).then(res => {
this.popList = [...res]
2024-08-30 17:29:29 +08:00
this.show = true
})
2024-08-13 17:28:37 +08:00
}
},
2024-08-30 17:29:29 +08:00
handleCurrentChange(val) {
this.currentRow = val
crudProduceScreen.fabMaterial({ vehicle_code: this.currentRow.vehicle_code }).then(res => {
this.popSecList = [...res]
2024-08-13 17:28:37 +08:00
})
},
2024-08-30 17:29:29 +08:00
toSure() {
this.disabled = true
if (this.type === 'IN') {
if (this.popSecList.length === 0) {
this.disabled = false
return
}
2024-09-02 13:58:19 +08:00
crudProduceScreen.callMater({ mater: this.popSecList, device_code: this.popData.device_code, vehicle_code: this.currentRow.vehicle_code }).then(res => {
2024-08-30 17:29:29 +08:00
this.disabled = false
this.$message(res.msg)
}).catch(() => {
this.disabled = false
})
} else if (this.type === 'CONTAINER') {
if (!this.value) {
this.disabled = false
this.$message.error('请选择托盘类型!')
return
}
2024-09-02 13:41:17 +08:00
crudProduceScreen.callEmp({ vehicle_type: this.value, device_code: this.popData.device_code }).then(res => {
2024-08-30 17:29:29 +08:00
this.disabled = false
this.$message(res.msg)
}).catch(() => {
this.disabled = false
})
} else if (this.type === 'SCANER') {
2024-09-10 10:19:08 +08:00
crudProduceScreen.sendMater({ device_code: this.popData.device_code, mater: this.popList, point_code: this.value1 }).then(res => {
2024-08-30 17:29:29 +08:00
this.disabled = false
this.$message(res.msg)
}).catch(() => {
this.disabled = false
})
} else if (this.type === 'BACK') {
2024-09-02 13:41:17 +08:00
crudProduceScreen.sendVehicle({ mater: this.popList, device_code: this.popData.device_code }).then(res => {
2024-08-30 17:29:29 +08:00
this.$message(res.msg)
}).catch(() => {
this.disabled = false
})
2024-08-20 13:57:21 +08:00
}
2024-08-13 17:28:37 +08:00
this.show = false
2024-08-20 13:57:21 +08:00
},
2024-08-30 17:29:29 +08:00
addRow() {
2024-09-10 10:07:19 +08:00
this.popList.push({ order_code: '', material_qty: '' })
2024-07-24 17:30:23 +08:00
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
2024-08-30 17:29:29 +08:00
@import './style.scss';
2024-07-24 17:30:23 +08:00
</style>