add:产线叫料单
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterial',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterial/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterial',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
233
wms/nladmin-ui/src/views/wms/pdm/callmaterial/index.vue
Normal file
233
wms/nladmin-ui/src/views/wms/pdm/callmaterial/index.vue
Normal file
@@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机台编码">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="机台编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单状态">
|
||||
<el-select
|
||||
v-model="query.bom_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.BOM_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1100px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @change="queryMater" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="机台编码" prop="device_code">
|
||||
<el-input v-model="form.device_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="叫料重量" prop="call_qty">
|
||||
<el-input-number v-model="form.call_qty" :precision="2" :controls="false" :min="1" style="width: 200px" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="bom_status" label="工单状态" :formatter="formattStatus" :min-width="flexWidth('bom_status',crud.data,'工单状态')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="device_code" label="机台编码" :min-width="flexWidth('device_code',crud.data,'机台编码')" />
|
||||
<el-table-column prop="call_qty" label="叫料重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="real_qty" label="实际重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="create_name" label="叫料人" :min-width="flexWidth('create_name',crud.data,'叫料人')" />
|
||||
<el-table-column prop="create_time" label="叫料时间" :min-width="flexWidth('create_time',crud.data,'叫料时间')" />
|
||||
<el-table-column prop="confirm_time" label="结束时间" :min-width="flexWidth('confirm_time',crud.data,'结束时间')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
lign="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:disabled-dle="scope.row.bom_status !== '1'"
|
||||
:disabled-edit="scope.row.bom_status !== '1'"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudCallMaterial from '@/views/wms/pdm/callmaterial/callmaterial'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudGroup from '@/views/wms/basedata/group/group'
|
||||
|
||||
const defaultForm = {
|
||||
material_spec: null,
|
||||
material_name: null,
|
||||
material_code: null,
|
||||
material_id: null,
|
||||
bom_id: null,
|
||||
device_code: null,
|
||||
call_qty: null,
|
||||
real_qty: null,
|
||||
bom_status: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
confirm_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'CallMaterial',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['BOM_STATUS'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '产线叫料',
|
||||
url: 'api/bomCallMaterial',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'bom_id',
|
||||
sort: 'bom_id,desc',
|
||||
crudMethod: { ...crudCallMaterial }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
call_qty: [
|
||||
{ required: true, message: '叫料重量不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
queryMater(value) {
|
||||
crudGroup.queryMater({ 'material_code': value }).then(row => {
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
}).catch(() => {
|
||||
this.form.material_spec = ''
|
||||
this.form.material_name = ''
|
||||
this.form.material_code = ''
|
||||
this.form.material_id = ''
|
||||
})
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.BOM_STATUS[row.bom_status]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user