fix: MES对接
This commit is contained in:
@@ -79,4 +79,12 @@ export function getClassName() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName }
|
||||
export function getClassByCode(data) {
|
||||
return request({
|
||||
url: 'api/Classstandard/getClassByCode',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName, getClassByCode }
|
||||
|
||||
271
lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue
Normal file
271
lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, 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="820px"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
size="mini"
|
||||
label-width="135px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属工序" prop="region_code">
|
||||
<el-select
|
||||
v-model="form.process"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.rh_production"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" style="width: 240px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择区域" prop="region_code">
|
||||
<el-select
|
||||
v-model="form.region_code"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
@change="setRegionName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:key="item.region_code"
|
||||
:label="item.region_code"
|
||||
:value="item.region_code"
|
||||
>
|
||||
<span style="float: left">{{ item.region_name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.region_code }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择设备" prop="point_code">
|
||||
<el-select
|
||||
v-model="form.point_code"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointList"
|
||||
:key="item.point_code"
|
||||
:label="item.point_code"
|
||||
:value="item.point_code"
|
||||
>
|
||||
<span style="float: left">{{ item.point_name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.point_code }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="废品重量" prop="fp_weight">
|
||||
<el-input-number
|
||||
v-model.number="form.fp_weight"
|
||||
:min="0"
|
||||
:max="999"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="废品数量" prop="fp_number">
|
||||
<el-input-number
|
||||
v-model.number="form.fp_number"
|
||||
:min="0"
|
||||
:max="999"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否降级" prop="is_jj">
|
||||
<el-radio-group v-model="form.is_jj" style="width: 240px">
|
||||
<el-radio label="1">是</el-radio>
|
||||
<el-radio label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.is_jj === '1'" label="降级物料" prop="jj_material">
|
||||
<el-input v-model="form.jj_material" style="width: 240px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="判废人" prop="pf_name">
|
||||
<el-input v-model="form.pf_name" style="width: 240px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="废品大类" prop="region_code">
|
||||
<el-select
|
||||
v-model="form.fp_big_type"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
@change="setFpTypeList"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.fp_big_type"
|
||||
:key="item.label"
|
||||
:label="item.label"
|
||||
:value="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="fpTypeList.length > 0" label="废品描述" prop="region_code">
|
||||
<el-radio-group v-model="form.fp_remark" style="width: 630px;">
|
||||
<el-radio
|
||||
v-for="item in fpTypeList"
|
||||
:key="item.class_name"
|
||||
style="margin: 8px 10px"
|
||||
:label="item.class_name"
|
||||
>
|
||||
{{ item.class_name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</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 type="selection" width="55" />
|
||||
<el-table-column prop="forder_NO" label="订单号" :min-width="flexWidth('forder_NO',crud.data,'订单号')" />
|
||||
<el-table-column prop="batchno" label="半成品批次" :min-width="flexWidth('batchno',crud.data,'半成品批次')" />
|
||||
<el-table-column prop="device" label="设备" :min-width="flexWidth('device',crud.data,'设备')" />
|
||||
<el-table-column prop="workunit" label="工序" :min-width="flexWidth('workunit',crud.data,'拆垛工位')" />
|
||||
<el-table-column prop="fteam" label="班组" :min-width="flexWidth('fteam',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="fp_NUM" label="废品重量" :min-width="flexWidth('fp_NUM',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="fp_UNIT" label="重量单位" :min-width="flexWidth('fp_UNIT',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="fp_SUBNUM" label="废品数量" :min-width="flexWidth('fp_SUBNUM',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="fp_SUBUNIT" label="数量单位" :min-width="flexWidth('fp_SUBUNIT',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="fp_REASON" label="废品大类" :min-width="flexWidth('fp_REASON',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="fp_REMARK" label="废品描述" :min-width="flexWidth('fp_REMARK',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="ifjj" label="降级" :min-width="flexWidth('ifjj',crud.data,'降级')" />
|
||||
<el-table-column prop="edtpfjj_PROMATNO" label="降级后物料编码" :min-width="flexWidth('edtpfjj_PROMATNO',crud.data,'降级后物料编码')" />
|
||||
<el-table-column prop="checkerin" label="判废人" :min-width="flexWidth('checkerin',crud.data,'判废人')" />
|
||||
<el-table-column prop="checkerin_TIM" label="判废时间" :min-width="flexWidth('checkerin_TIM',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="prodate" label="生产日期" :min-width="flexWidth('prodate',crud.data,'分拣工单')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, header, form, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
||||
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||
import crudParamBaseClassstandard from '@/views/wms/basedata/classification/mdBaseClassstandard'
|
||||
import crudScrap from './scrap'
|
||||
|
||||
const defaultForm = {
|
||||
process: null,
|
||||
region_code: null,
|
||||
point_code: null,
|
||||
fp_weight: null,
|
||||
fp_number: null,
|
||||
vehicle_code: null,
|
||||
fp_remark: null,
|
||||
pf_name: null,
|
||||
jj_material: null,
|
||||
fp_big_type: null,
|
||||
is_jj: '0'
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Scrap',
|
||||
dicts: ['rh_production', 'fp_big_type'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '工序报废',
|
||||
url: 'api/mes/mesScrapInfo',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudScrap }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
regionList: [],
|
||||
fpTypeList: [],
|
||||
regionCodeParam: null,
|
||||
pointList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getRegionList()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
setFpTypeList(data) {
|
||||
const res = this.dict.fp_big_type.filter(item => item.label === data).map(item => item.value)
|
||||
crudParamBaseClassstandard.getClassByCode(res[0]).then(res => {
|
||||
this.fpTypeList = res
|
||||
})
|
||||
},
|
||||
setRegionName(data) {
|
||||
// 清空
|
||||
this.form.point_code = null
|
||||
this.regionCodeParam = data
|
||||
this.getPointList()
|
||||
},
|
||||
getRegionList() { // 获取区域列表
|
||||
const param = {
|
||||
is_has_workder: true
|
||||
}
|
||||
crudSchBaseRegion.getRegionList(param).then(res => {
|
||||
this.regionList = res
|
||||
})
|
||||
},
|
||||
getPointList() { // 获取点位列表
|
||||
if (this.regionCodeParam) {
|
||||
const param = {
|
||||
region_code: this.regionCodeParam
|
||||
}
|
||||
crudSchBasePoint.getPointList(param).then(res => {
|
||||
this.pointList = res
|
||||
this.regionCodeParam = null
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
10
lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js
Normal file
10
lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/mes/addScrap',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add }
|
||||
Reference in New Issue
Block a user