opt: 格式
This commit is contained in:
@@ -129,7 +129,7 @@ export default {
|
||||
},
|
||||
initWebSocket() {
|
||||
// const wsUri = (process.env.VUE_APP_WS_API === '/' ? '/' : (process.env.VUE_APP_WS_API + '/')) + 'messageInfo'
|
||||
const wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/' + 'messageInfo'
|
||||
const wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/' + 'messageInfo'
|
||||
this.websock = new WebSocket(wsUri)
|
||||
this.websock.onerror = this.webSocketOnError
|
||||
this.websock.onmessage = this.webSocketOnMessage
|
||||
|
||||
@@ -73,12 +73,12 @@
|
||||
开工
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
disabled
|
||||
@click="synchronize()"
|
||||
>
|
||||
同步
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
开工
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -480,7 +481,7 @@ export default {
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '工单管理',
|
||||
title: '混碾工单',
|
||||
url: 'api/pdmBdWorkorder',
|
||||
idField: 'workorder_id',
|
||||
sort: 'workorder_id,desc',
|
||||
|
||||
703
lms/nladmin-ui/src/views/wms/pdm/workerorder/pressedOrder.vue
Normal file
703
lms/nladmin-ui/src/views/wms/pdm/workerorder/pressedOrder.vue
Normal file
@@ -0,0 +1,703 @@
|
||||
<template>
|
||||
<div v-loading.fullscreen.lock="fullscreenLoading" 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.workorder_code"
|
||||
clearable
|
||||
placeholder="工单编号"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码">
|
||||
<el-input
|
||||
v-model="query.point_code"
|
||||
clearable
|
||||
placeholder="设备编码"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="datetimerange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单状态">
|
||||
<el-select
|
||||
v-model="query.workorder_status"
|
||||
multiple
|
||||
placeholder="工单状态"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@change="handOrderStatus"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.pdm_workorder_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud"/>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="!(crud.selections[0]) || crud.selections[1]"
|
||||
@click="submits(crud.selections[0])"
|
||||
>
|
||||
开工
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
disabled
|
||||
@click="synchronize()"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<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 v-if="false" label="所属车间">
|
||||
<el-select
|
||||
v-model="form.workshop_code"
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workShopList"
|
||||
:label="item.workshop_name"
|
||||
:value="item.workshop_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属工序" prop="region_code">
|
||||
<el-select
|
||||
v-model="form.region_code"
|
||||
disabled
|
||||
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="工序名称">
|
||||
<el-input v-model="form.region_name" style="width: 240px;" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="point_code">
|
||||
<el-select
|
||||
v-model="form.point_code"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
@change="setPointName"
|
||||
>
|
||||
<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="设备名称">
|
||||
<el-input v-model="form.point_name" style="width: 240px;" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" style="width: 240px;" @focus="getMaterial(1)"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input v-model="form.material_code" style="width: 240px;" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格">
|
||||
<el-input v-model="form.material_spec" style="width: 240px;" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="半成品编码" prop="material_name">
|
||||
<el-input v-model="form.half_material_code" style="width: 240px;" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="原料编码">
|
||||
<el-input v-model="form.raw_material_code" style="width: 240px;" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="新料比例" v-if="form.region_code === 'YZ'">
|
||||
<el-input-number
|
||||
v-model.number="form.material_ratio"
|
||||
:min="0"
|
||||
:max="999"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code === 'HN' || form.region_code === 'YZ'" label="计划重量" prop="plan_weight">
|
||||
<el-input-number
|
||||
v-model.number="form.plan_weight"
|
||||
:min="0"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code != 'HN'" label="计划数量" prop="plan_qty">
|
||||
<el-input-number
|
||||
v-model.number="form.plan_qty"
|
||||
:min="0"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划开始时间" prop="planproducestart_date">
|
||||
<el-date-picker
|
||||
v-model="form.planproducestart_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划结束时间" prop="planproduceend_date">
|
||||
<el-date-picker
|
||||
v-model="form.planproduceend_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="crud.status.edit" label="实际开始时间">
|
||||
<el-date-picker
|
||||
v-model="form.realproducestart_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="crud.status.edit" label="实际结束时间">
|
||||
<el-date-picker
|
||||
v-model="form.realproduceend_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验员" v-if="form.region_code === 'YZ'">
|
||||
<el-select
|
||||
v-model="form.inspector"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="静置时间(分钟)" prop="standing_time" v-if="form.region_code === 'HN'">
|
||||
<el-input-number
|
||||
v-model.number="form.standing_time"
|
||||
:min="0"
|
||||
:max="999"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="crud.status.edit" label="实际数量" prop="real_qty">
|
||||
<el-input-number
|
||||
v-model.number="form.real_qty"
|
||||
:min="0"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code !== 'HN'" label="客户编码">
|
||||
<el-select v-model="form.customer" clearable filterable placeholder="请选择" style="width: 240px;">
|
||||
<el-option
|
||||
v-for="item in custerList"
|
||||
:key="item.cust_id"
|
||||
:label="item.cust_name"
|
||||
:value="item.cust_id"
|
||||
>
|
||||
<span style="float: left">{{ item.cust_code }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.cust_name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具类型">
|
||||
<el-select
|
||||
v-model="form.vehicle_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.vehicle_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="item.value !== 'GTP'"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="工单类型" prop="workorder_type">
|
||||
<el-input v-model="form.workorder_type" style="width: 240px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否自动搬运" prop="is_needmove">
|
||||
<el-radio-group v-model="form.is_needmove" style="width: 240px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否加急" prop="is_needmove">
|
||||
<el-radio-group v-model="form.is_urgent" style="width: 240px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code === 'HN'" label="是否新料" prop="is_new">
|
||||
<el-radio-group v-model="form.is_new" style="width: 240px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @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="workorder_code"
|
||||
label="工单编号"
|
||||
:min-width="flexWidth('workorder_code',crud.data,'工单编号')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workorder_status"
|
||||
label="工单状态"
|
||||
:min-width="flexWidth('workorder_status',crud.data,'工单状态')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.pdm_workorder_status[scope.row.workorder_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')" />
|
||||
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')" />
|
||||
<el-table-column prop="plan_weight" label="计划重量" :min-width="flexWidth('plan_weight',crud.data,'计划数量')" />
|
||||
<el-table-column prop="real_weight" label="实际重量" :min-width="flexWidth('real_weight',crud.data,'实际数量')" />
|
||||
<!-- <el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />-->
|
||||
<el-table-column
|
||||
prop="region_name"
|
||||
label="区域名称"
|
||||
:min-width="flexWidth('region_name',crud.data,'区域名称')"
|
||||
/>
|
||||
<el-table-column prop="point_code" label="设备编码" :min-width="flexWidth('point_code',crud.data,'设备编码')" />
|
||||
<el-table-column prop="point_name" label="设备名称" :min-width="flexWidth('point_name',crud.data,'设备名称')" />
|
||||
<el-table-column
|
||||
prop="material_code"
|
||||
label="成品编码"
|
||||
:min-width="flexWidth('material_name',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="half_material_code"
|
||||
label="半成品编码"
|
||||
:min-width="flexWidth('half_material_code',crud.data,'半成品编码')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="raw_material_code"
|
||||
label="泥料编码"
|
||||
:min-width="flexWidth('raw_material_code',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="material_name"
|
||||
label="物料名称"
|
||||
:min-width="flexWidth('material_name',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="material_spec"
|
||||
label="物料规格"
|
||||
:min-width="flexWidth('material_spec',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="vehicle_type"
|
||||
label="载具类型"
|
||||
:min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="produce_date"
|
||||
label="生产日期"
|
||||
:min-width="flexWidth('produce_date',crud.data,'生产日期')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="planproducestart_date"
|
||||
label="计划开始时间"
|
||||
:min-width="flexWidth('planproducestart_date',crud.data,'计划开始时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="planproduceend_date"
|
||||
label="计划结束时间"
|
||||
:min-width="flexWidth('planproduceend_date',crud.data,'计划结束时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="realproducestart_date"
|
||||
label="实际开始时间"
|
||||
:min-width="flexWidth('realproducestart_date',crud.data,'实际开始时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="realproduceend_date"
|
||||
label="实际结束时间"
|
||||
:min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="standing_time"
|
||||
label="静置时间(分钟)"
|
||||
:min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="is_needmove"
|
||||
label="是否自动搬运"
|
||||
:min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_needmove ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_urgent ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')"/>
|
||||
<el-table-column
|
||||
prop="update_time"
|
||||
label="修改时间"
|
||||
:min-width="flexWidth('update_time',crud.data,'修改时间')"
|
||||
/>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" :flag="flag" @tableChanged="tableChanged"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPdmBdWorkorder from './pdmBdWorkorder'
|
||||
import crudMdCsCustomerbase from '@/views/wms/basedata/customer/mdCsCustomerbase'
|
||||
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
||||
import CRUD, { crud, form, header, 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 crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
||||
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue'
|
||||
import item from '@/layout/components/Sidebar/Item.vue'
|
||||
|
||||
const defaultForm = {
|
||||
workorder_id: null,
|
||||
workorder_code: null,
|
||||
plan_weight: null,
|
||||
plan_qty: null,
|
||||
real_qty: null,
|
||||
material_id: null,
|
||||
half_material_code: null,
|
||||
raw_material_code: null,
|
||||
vehicle_type: 'GTP',
|
||||
planproducestart_date: null,
|
||||
planproduceend_date: null,
|
||||
realproducestart_date: null,
|
||||
realproduceend_date: null,
|
||||
material_spec: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
standing_time: null,
|
||||
point_code: null,
|
||||
point_name: null,
|
||||
region_code: 'YZ',
|
||||
region_name: null,
|
||||
workorder_status: null,
|
||||
is_needmove: true,
|
||||
workorder_type: null,
|
||||
passback_status: null,
|
||||
workshop_code: null,
|
||||
ext_id: null,
|
||||
is_delete: false,
|
||||
is_urgent: false,
|
||||
is_new: true,
|
||||
inspector: null,
|
||||
material_ratio: 100,
|
||||
pack_method: null,
|
||||
customer: null,
|
||||
ext_data: 0
|
||||
}
|
||||
export default {
|
||||
name: 'PressedOrder',
|
||||
dicts: ['vehicle_type', 'pdm_workorder_status'],
|
||||
components: { MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '压制工单',
|
||||
url: 'api/pdmBdWorkorder',
|
||||
idField: 'workorder_id',
|
||||
sort: 'workorder_id,desc',
|
||||
query: {
|
||||
region_code: 'YZ'
|
||||
},
|
||||
crudMethod: { ...crudPdmBdWorkorder }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_qty: [
|
||||
{ required: true, message: '计划数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_weight: [
|
||||
{ required: true, message: '计划重量不能为空', trigger: 'blur' }
|
||||
],
|
||||
planproducestart_date: [
|
||||
{ required: true, message: '计划开始不能为空', trigger: 'change' }
|
||||
],
|
||||
planproduceend_date: [
|
||||
{ required: true, message: '计划结束不能为空', trigger: 'change' }
|
||||
],
|
||||
point_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'change' }
|
||||
],
|
||||
region_code: [
|
||||
{ required: true, message: '区域编码不能为空', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'workorder_code', display_name: '工单编号' },
|
||||
{ key: 'point_code', display_name: '设备编码' }
|
||||
],
|
||||
workShopList: [],
|
||||
regionList: [],
|
||||
pointList: [],
|
||||
custerList: [],
|
||||
userList: [],
|
||||
regionCodeParam: null,
|
||||
materialDialog: false,
|
||||
orderDialog: false,
|
||||
fullscreenLoading: false,
|
||||
flag: 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorkShopList()
|
||||
this.getRegionList()
|
||||
this.getUserList()
|
||||
this.getCustomerList()
|
||||
},
|
||||
methods: {
|
||||
item() {
|
||||
return item
|
||||
},
|
||||
getCustomerList() {
|
||||
// 获取客户列表
|
||||
crudMdCsCustomerbase.getCustomerList().then(res => {
|
||||
this.custerList = res
|
||||
})
|
||||
},
|
||||
getUserList() {
|
||||
// 获取检验员列表
|
||||
crudPdmBdWorkorder.userList().then(res => {
|
||||
this.userList = res
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeToCU]() {
|
||||
this.setRegionName('YZ')
|
||||
const extData = this.form.ext_data
|
||||
if (extData !== undefined || extData !== null || extData !== '') {
|
||||
const ext = JSON.parse(extData)
|
||||
this.form.order_no = ext.order_no
|
||||
this.form.order_subnum = ext.custer_no
|
||||
}
|
||||
},
|
||||
getWorkShopList() { // 获取车间列表
|
||||
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
||||
this.workShopList = res
|
||||
})
|
||||
},
|
||||
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
|
||||
})
|
||||
}
|
||||
},
|
||||
getMaterial(flag) {
|
||||
this.materialDialog = true
|
||||
this.flag = flag
|
||||
},
|
||||
tableChanged(row, flag) {
|
||||
if (flag === 1) {
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.material_code = row.material_code
|
||||
this.form.half_material_code = row.half_material_code
|
||||
this.form.raw_material_code = row.raw_material_code
|
||||
} else {
|
||||
this.form.raw_material_name = row.material_name
|
||||
this.form.raw_material_id = row.material_id
|
||||
this.form.raw_material_code = row.material_code
|
||||
}
|
||||
this.form.pack_method = row.pack_method
|
||||
this.form.standing_time = row.standing_time === null ? 0 : row.standing_time
|
||||
},
|
||||
setRegionName(data) {
|
||||
// 清空
|
||||
this.form.point_code = null
|
||||
this.form.point_name = null
|
||||
this.regionCodeParam = data
|
||||
var region = this.regionList.find(item => item.region_code === data)
|
||||
this.form.region_name = region.region_name
|
||||
this.getPointList()
|
||||
},
|
||||
setPointName(data) {
|
||||
var point = this.pointList.find(item => item.point_code === data)
|
||||
this.form.point_name = point.point_name
|
||||
},
|
||||
handOrderStatus(value) {
|
||||
this.crud.query.more_order_status = null
|
||||
if (value) {
|
||||
this.crud.query.more_order_status = value.toString()
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 下发
|
||||
submits(row) {
|
||||
this.fullscreenLoading = true
|
||||
crudPdmBdWorkorder.submits(row).then(res => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
}).finally(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
synchronize() {
|
||||
this.fullscreenLoading = true
|
||||
crudPdmBdWorkorder.orderSynchronize(this.crud.query).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('同步成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
}).finally(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
695
lms/nladmin-ui/src/views/wms/pdm/workerorder/sortedOrder.vue
Normal file
695
lms/nladmin-ui/src/views/wms/pdm/workerorder/sortedOrder.vue
Normal file
@@ -0,0 +1,695 @@
|
||||
<template>
|
||||
<div v-loading.fullscreen.lock="fullscreenLoading" 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.workorder_code"
|
||||
clearable
|
||||
placeholder="工单编号"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码">
|
||||
<el-input
|
||||
v-model="query.point_code"
|
||||
clearable
|
||||
placeholder="设备编码"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="datetimerange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单状态">
|
||||
<el-select
|
||||
v-model="query.workorder_status"
|
||||
multiple
|
||||
placeholder="工单状态"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@change="handOrderStatus"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.pdm_workorder_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="!(crud.selections[0]) || crud.selections[1]"
|
||||
@click="submits(crud.selections[0])"
|
||||
>
|
||||
开工
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
disabled
|
||||
@click="synchronize()"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<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 v-if="false" label="所属车间">
|
||||
<el-select
|
||||
v-model="form.workshop_code"
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workShopList"
|
||||
:label="item.workshop_name"
|
||||
:value="item.workshop_code"
|
||||
/>
|
||||
</el-select>
|
||||
</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="工序名称">
|
||||
<el-input v-model="form.region_name" style="width: 240px;" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="point_code">
|
||||
<el-select
|
||||
v-model="form.point_code"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
@change="setPointName"
|
||||
>
|
||||
<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="设备名称">
|
||||
<el-input v-model="form.point_name" style="width: 240px;" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" style="width: 240px;" @focus="getMaterial(1)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input v-model="form.material_code" style="width: 240px;" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格">
|
||||
<el-input v-model="form.material_spec" style="width: 240px;" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="半成品编码" prop="material_name">
|
||||
<el-input v-model="form.half_material_code" style="width: 240px;" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="原料编码">
|
||||
<el-input v-model="form.raw_material_code" style="width: 240px;" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code === 'HN' || form.region_code === 'YZ'" label="计划重量" prop="plan_weight">
|
||||
<el-input-number
|
||||
v-model.number="form.plan_weight"
|
||||
:min="0"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code != 'HN'" label="计划数量" prop="plan_qty">
|
||||
<el-input-number
|
||||
v-model.number="form.plan_qty"
|
||||
:min="0"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划开始时间" prop="planproducestart_date">
|
||||
<el-date-picker
|
||||
v-model="form.planproducestart_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划结束时间" prop="planproduceend_date">
|
||||
<el-date-picker
|
||||
v-model="form.planproduceend_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="crud.status.edit" label="实际开始时间">
|
||||
<el-date-picker
|
||||
v-model="form.realproducestart_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="crud.status.edit" label="实际结束时间">
|
||||
<el-date-picker
|
||||
v-model="form.realproduceend_date"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code === 'YZ'" label="新料比例">
|
||||
<el-input-number
|
||||
v-model.number="form.material_ratio"
|
||||
:min="0"
|
||||
:max="999"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code === 'YZ'" label="检验员">
|
||||
<el-select
|
||||
v-model="form.inspector"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code === 'HN'" label="静置时间(分钟)" prop="standing_time">
|
||||
<el-input-number
|
||||
v-model.number="form.standing_time"
|
||||
:min="0"
|
||||
:max="999"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="crud.status.edit" label="实际数量" prop="real_qty">
|
||||
<el-input-number
|
||||
v-model.number="form.real_qty"
|
||||
:min="0"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code !== 'HN'" label="客户编码">
|
||||
<el-select v-model="form.customer" clearable filterable placeholder="请选择" style="width: 240px;">
|
||||
<el-option
|
||||
v-for="item in custerList"
|
||||
:key="item.cust_id"
|
||||
:label="item.cust_name"
|
||||
:value="item.cust_id"
|
||||
>
|
||||
<span style="float: left">{{ item.cust_code }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.cust_name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具类型">
|
||||
<el-select
|
||||
v-model="form.vehicle_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
style="width: 240px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.vehicle_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="工单类型" prop="workorder_type">
|
||||
<el-input v-model="form.workorder_type" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否自动搬运" prop="is_needmove">
|
||||
<el-radio-group v-model="form.is_needmove" style="width: 240px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否加急" prop="is_needmove">
|
||||
<el-radio-group v-model="form.is_urgent" style="width: 240px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.region_code === 'HN'" label="是否新料" prop="is_new">
|
||||
<el-radio-group v-model="form.is_new" style="width: 240px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @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="workorder_code"
|
||||
label="工单编号"
|
||||
:min-width="flexWidth('workorder_code',crud.data,'工单编号')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workorder_status"
|
||||
label="工单状态"
|
||||
:min-width="flexWidth('workorder_status',crud.data,'工单状态')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.pdm_workorder_status[scope.row.workorder_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')" />
|
||||
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')" />
|
||||
<el-table-column prop="plan_weight" label="计划重量" :min-width="flexWidth('plan_weight',crud.data,'计划数量')" />
|
||||
<el-table-column prop="real_weight" label="实际重量" :min-width="flexWidth('real_weight',crud.data,'实际数量')" />
|
||||
<!-- <el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />-->
|
||||
<el-table-column
|
||||
prop="region_name"
|
||||
label="区域名称"
|
||||
:min-width="flexWidth('region_name',crud.data,'区域名称')"
|
||||
/>
|
||||
<el-table-column prop="point_code" label="设备编码" :min-width="flexWidth('point_code',crud.data,'设备编码')" />
|
||||
<el-table-column prop="point_name" label="设备名称" :min-width="flexWidth('point_name',crud.data,'设备名称')" />
|
||||
<el-table-column
|
||||
prop="material_code"
|
||||
label="成品编码"
|
||||
:min-width="flexWidth('material_name',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="half_material_code"
|
||||
label="半成品编码"
|
||||
:min-width="flexWidth('half_material_code',crud.data,'半成品编码')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="raw_material_code"
|
||||
label="泥料编码"
|
||||
:min-width="flexWidth('raw_material_code',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="material_name"
|
||||
label="物料名称"
|
||||
:min-width="flexWidth('material_name',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="material_spec"
|
||||
label="物料规格"
|
||||
:min-width="flexWidth('material_spec',crud.data,'物料标识')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="vehicle_type"
|
||||
label="载具类型"
|
||||
:min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="produce_date"
|
||||
label="生产日期"
|
||||
:min-width="flexWidth('produce_date',crud.data,'生产日期')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="planproducestart_date"
|
||||
label="计划开始时间"
|
||||
:min-width="flexWidth('planproducestart_date',crud.data,'计划开始时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="planproduceend_date"
|
||||
label="计划结束时间"
|
||||
:min-width="flexWidth('planproduceend_date',crud.data,'计划结束时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="realproducestart_date"
|
||||
label="实际开始时间"
|
||||
:min-width="flexWidth('realproducestart_date',crud.data,'实际开始时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="realproduceend_date"
|
||||
label="实际结束时间"
|
||||
:min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="standing_time"
|
||||
label="静置时间(分钟)"
|
||||
:min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="is_needmove"
|
||||
label="是否自动搬运"
|
||||
:min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_needmove ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_urgent ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||
<el-table-column
|
||||
prop="update_time"
|
||||
label="修改时间"
|
||||
:min-width="flexWidth('update_time',crud.data,'修改时间')"
|
||||
/>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" :flag="flag" @tableChanged="tableChanged" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPdmBdWorkorder from './pdmBdWorkorder'
|
||||
import crudMdCsCustomerbase from '@/views/wms/basedata/customer/mdCsCustomerbase'
|
||||
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||
import crudSchBasePoint from '@/views/wms/sch/point/schBasePoint'
|
||||
import CRUD, { crud, form, header, 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 crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
||||
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue'
|
||||
import item from '@/layout/components/Sidebar/Item.vue'
|
||||
|
||||
const defaultForm = {
|
||||
workorder_id: null,
|
||||
workorder_code: null,
|
||||
plan_weight: null,
|
||||
plan_qty: null,
|
||||
real_qty: null,
|
||||
material_id: null,
|
||||
half_material_code: null,
|
||||
raw_material_code: null,
|
||||
vehicle_type: null,
|
||||
planproducestart_date: null,
|
||||
planproduceend_date: null,
|
||||
realproducestart_date: null,
|
||||
realproduceend_date: null,
|
||||
material_spec: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
standing_time: null,
|
||||
point_code: null,
|
||||
point_name: null,
|
||||
region_code: null,
|
||||
region_name: null,
|
||||
workorder_status: null,
|
||||
is_needmove: true,
|
||||
workorder_type: null,
|
||||
passback_status: null,
|
||||
workshop_code: null,
|
||||
ext_id: null,
|
||||
is_delete: false,
|
||||
is_urgent: false,
|
||||
is_new: true,
|
||||
inspector: null,
|
||||
material_ratio: 0,
|
||||
pack_method: null,
|
||||
customer: null,
|
||||
ext_data: 0
|
||||
}
|
||||
export default {
|
||||
name: 'SortedOrder',
|
||||
dicts: ['vehicle_type', 'pdm_workorder_status'],
|
||||
components: { MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '分拣工单',
|
||||
url: 'api/pdmBdWorkorder',
|
||||
idField: 'workorder_id',
|
||||
sort: 'workorder_id,desc',
|
||||
query: {
|
||||
region_code: 'FJ'
|
||||
},
|
||||
crudMethod: { ...crudPdmBdWorkorder }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'blur' }
|
||||
],
|
||||
plan_qty: [
|
||||
{ required: true, message: '计划数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
planproducestart_date: [
|
||||
{ required: true, message: '计划开始不能为空', trigger: 'change' }
|
||||
],
|
||||
planproduceend_date: [
|
||||
{ required: true, message: '计划结束不能为空', trigger: 'change' }
|
||||
],
|
||||
point_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'change' }
|
||||
],
|
||||
region_code: [
|
||||
{ required: true, message: '区域编码不能为空', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'workorder_code', display_name: '工单编号' },
|
||||
{ key: 'point_code', display_name: '设备编码' }
|
||||
],
|
||||
workShopList: [],
|
||||
regionList: [],
|
||||
pointList: [],
|
||||
custerList: [],
|
||||
userList: [],
|
||||
regionCodeParam: null,
|
||||
materialDialog: false,
|
||||
orderDialog: false,
|
||||
fullscreenLoading: false,
|
||||
flag: 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorkShopList()
|
||||
this.getRegionList()
|
||||
this.getUserList()
|
||||
this.getCustomerList()
|
||||
},
|
||||
methods: {
|
||||
item() {
|
||||
return item
|
||||
},
|
||||
getCustomerList() {
|
||||
// 获取客户列表
|
||||
crudMdCsCustomerbase.getCustomerList().then(res => {
|
||||
this.custerList = res
|
||||
})
|
||||
},
|
||||
getUserList() {
|
||||
// 获取检验员列表
|
||||
crudPdmBdWorkorder.userList().then(res => {
|
||||
this.userList = res
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeToCU]() {
|
||||
const extData = this.form.ext_data
|
||||
if (extData !== undefined || extData !== null || extData !== '') {
|
||||
const ext = JSON.parse(extData)
|
||||
this.form.order_no = ext.order_no
|
||||
this.form.order_subnum = ext.custer_no
|
||||
}
|
||||
},
|
||||
getWorkShopList() { // 获取车间列表
|
||||
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
||||
this.workShopList = res
|
||||
})
|
||||
},
|
||||
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
|
||||
})
|
||||
}
|
||||
},
|
||||
getMaterial(flag) {
|
||||
this.materialDialog = true
|
||||
this.flag = flag
|
||||
},
|
||||
tableChanged(row, flag) {
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.material_code = row.material_code
|
||||
this.form.half_material_code = row.half_material_code
|
||||
this.form.raw_material_code = row.raw_material_code
|
||||
this.form.pack_method = row.pack_method
|
||||
const result = Object.keys(this.dict.label.vehicle_type).find(key => this.dict.label.vehicle_type[key] === row.pack_palletspec)
|
||||
if (result) {
|
||||
this.form.vehicle_type = result
|
||||
}
|
||||
this.form.standing_time = row.standing_time === null ? 0 : row.standing_time
|
||||
},
|
||||
setRegionName(data) {
|
||||
// 清空
|
||||
this.form.point_code = null
|
||||
this.form.point_name = null
|
||||
this.regionCodeParam = data
|
||||
var region = this.regionList.find(item => item.region_code === data)
|
||||
this.form.region_name = region.region_name
|
||||
this.getPointList()
|
||||
},
|
||||
setPointName(data) {
|
||||
var point = this.pointList.find(item => item.point_code === data)
|
||||
this.form.point_name = point.point_name
|
||||
},
|
||||
handOrderStatus(value) {
|
||||
this.crud.query.more_order_status = null
|
||||
if (value) {
|
||||
this.crud.query.more_order_status = value.toString()
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 下发
|
||||
submits(row) {
|
||||
this.fullscreenLoading = true
|
||||
crudPdmBdWorkorder.submits(row).then(res => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
}).finally(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
synchronize() {
|
||||
this.fullscreenLoading = true
|
||||
crudPdmBdWorkorder.orderSynchronize(this.crud.query).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('同步成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
}).finally(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user