张江玮
2 years ago
16 changed files with 536 additions and 86 deletions
Binary file not shown.
@ -0,0 +1,429 @@ |
|||
<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="90px" |
|||
label-suffix=":" |
|||
> |
|||
<!-- 搜索 --> |
|||
<el-form-item label="工单编号"> |
|||
<el-input |
|||
v-model="query.produceorder_code" |
|||
clearable |
|||
placeholder="工单编号" |
|||
style="width: 200px;" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="BOM编码"> |
|||
<el-input |
|||
v-model="query.material" |
|||
clearable |
|||
placeholder="BOM编码" |
|||
style="width: 200px;" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="工单状态"> |
|||
<el-select |
|||
v-model="order_status" |
|||
style="width: 200px" |
|||
clearable |
|||
multiple |
|||
placeholder="请选择" |
|||
@change="handTaskStatus" |
|||
> |
|||
<el-option |
|||
label="未完成" |
|||
value="-1" |
|||
/> |
|||
<el-option |
|||
v-for="item in dict.pdm_workorder_status" |
|||
:key="item.id" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="生产日期"> |
|||
<el-date-picker |
|||
v-model="query.createTime" |
|||
type="daterange" |
|||
value-format="yyyy-MM-dd" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="结束日期" |
|||
:default-time="['00:00:00','23:59:59']" |
|||
@change="crud.toQuery" |
|||
/> |
|||
</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 |
|||
slot="right" |
|||
class="filter-item" |
|||
type="danger" |
|||
icon="el-icon-position" |
|||
size="mini" |
|||
:disabled="crud.selections.length !== 1" |
|||
@click="forceFinish(crud.selections[0])" |
|||
> |
|||
强制完成 |
|||
</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="600px" |
|||
> |
|||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px" label-suffix=":"> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="生产设备" prop="device_name"> |
|||
<el-input |
|||
v-model="form.device_name" |
|||
:disabled="crud.status.edit" |
|||
style="width: 300px" |
|||
clearable |
|||
@focus="deviceShow=true" |
|||
@clear="form.device_code=''; form.device_id=''; form.device_name=''; from.region_code = ''" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="BOM编码" prop="material_code"> |
|||
<el-input |
|||
v-model="form.material_code" |
|||
:disabled="crud.status.edit" |
|||
style="width: 300px" |
|||
clearable |
|||
@focus="bomShow=true" |
|||
@clear="form.material_id=''; form.material_code=''; form.material_name=''" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="计划数量/重量" prop="plan_qty"> |
|||
<el-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="是否加急" prop="is_urgent"> |
|||
<el-radio v-model="form.is_urgent" :disabled="crud.status.edit" label="1">是</el-radio> |
|||
<el-radio v-model="form.is_urgent" :disabled="crud.status.edit" label="0">否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="是否新料" prop="is_new"> |
|||
<el-radio v-model="form.is_new" :disabled="crud.status.edit" label="1">是</el-radio> |
|||
<el-radio v-model="form.is_new" :disabled="crud.status.edit" label="0">否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</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 v-if="false" prop="workorder_id" label="生产班次工单标识" /> |
|||
<el-table-column prop="workorder_code" label="工单编号" :min-width="flexWidth('workorder_code',crud.data,'工单编号')"> |
|||
<!-- <template slot-scope="scope">--> |
|||
<!-- <el-link type="warning" @click="toView(scope.row)">{{ scope.row.produceorder_code }}</el-link>--> |
|||
<!-- </template>--> |
|||
</el-table-column> |
|||
<el-table-column prop="order_status" label="工单状态" :min-width="flexWidth('order_status',crud.data,'工单状态')"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.pdm_workorder_status[scope.row.order_status] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="device_name" label="设备" :min-width="flexWidth('device_name',crud.data,'设备')" /> |
|||
<el-table-column prop="material_code" label="BOM编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> |
|||
<el-table-column prop="plan_qty" label="计划重量" :min-width="flexWidth('plan_qty',crud.data,'计划数量/重量')" /> |
|||
<el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.true_or_false[scope.row.is_urgent] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="is_new" label="是否新料" :min-width="flexWidth('is_new',crud.data,'是否新料')"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.true_or_false[scope.row.is_new] }} |
|||
</template> |
|||
</el-table-column> |
|||
<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="real_qty" label="实际重量" :min-width="flexWidth('real_qty',crud.data,'实际数量')" /> |
|||
<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_optname" label="修改人" :min-width="flexWidth('update_optname',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> |
|||
<DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" @tableChanged="tableChanged" /> |
|||
<BOMDtl :dialog-show.sync="bomShow" :is-single="true" @setBOMValue="setBOMValue" /> |
|||
<ViewDialog ref="child3" /> |
|||
<!--表单组件--> |
|||
<el-dialog |
|||
:close-on-click-modal="false" |
|||
:visible.sync="finishShow" |
|||
title="强制完成" |
|||
width="600px" |
|||
> |
|||
<el-form ref="form" :model="orderData" :rules="rules" size="mini" label-width="160px" label-suffix=":"> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="实际重量" prop="material_id"> |
|||
<el-input-number |
|||
v-model="orderData.qty" |
|||
style="width: 150px" |
|||
:min="0" |
|||
/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="info" @click="cancelFinish">取消</el-button> |
|||
<el-button type="primary" @click="toForceFinish">确认</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudWorkorder from '@/api/wms/pdm/workorder' |
|||
import CRUD, { presenter, header, form, crud } 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 ViewDialog from '@/views/wms/pdm/workerorder/ViewDialog' |
|||
import DeviceDialog from '@/views/wms/pub/DeviceDialog' |
|||
import BOMDtl from '@/views/wms/pub/BOMDialog.vue' |
|||
|
|||
const defaultForm = { |
|||
workorder_id: null, |
|||
produceorder_code: null, |
|||
producedeviceorder_code: null, |
|||
shift_type_scode: '01', |
|||
workprocedure_id: null, |
|||
produce_date: null, |
|||
plan_qty: null, |
|||
real_qty: null, |
|||
material_id: null, |
|||
material_code: null, |
|||
material_weight: null, |
|||
vehicle_type: '1', |
|||
planproducestart_date: null, |
|||
planproduceend_date: null, |
|||
realproducestart_date: null, |
|||
realproduceend_date: null, |
|||
order_status: '1', |
|||
is_needmove: '1', |
|||
order_type_scode: '1', |
|||
create_id: null, |
|||
create_name: null, |
|||
create_time: null, |
|||
update_optid: null, |
|||
update_optname: null, |
|||
update_time: null, |
|||
sysdeptid: null, |
|||
syscompanyid: null, |
|||
is_delete: null, |
|||
material_name: null, |
|||
device_id: null, |
|||
device_code: null, |
|||
device_name: null, |
|||
is_canupdate_update: '1', |
|||
material_spec: null, |
|||
sale_id: null, |
|||
is_new: '1', |
|||
is_package: '1', |
|||
warn_time: '0', |
|||
standing_time: '0', |
|||
is_urgent: '0', |
|||
is_pri: '0', |
|||
ext_code: null, |
|||
qualified_qty: '0', |
|||
unqualified_qty: '0', |
|||
region_code: null |
|||
} |
|||
export default { |
|||
name: 'HLWorkorder', |
|||
components: { BOMDtl, pagination, crudOperation, rrOperation, udOperation, ViewDialog, DeviceDialog }, |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '工单', url: 'api/workorder', idField: 'workorder_id', sort: 'workorder_id,desc', |
|||
optShow: { |
|||
add: true, |
|||
edit: false, |
|||
del: false, |
|||
download: false, |
|||
reset: true |
|||
}, |
|||
query: { |
|||
order_status: '-1', |
|||
region_code: 'HL' |
|||
}, |
|||
crudMethod: { ...crudWorkorder } |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
classes3: [], |
|||
materType: '01', |
|||
materialShow: false, |
|||
deviceShow: false, |
|||
bomShow: false, |
|||
workprocedureList: [], |
|||
order_status: ['-1'], |
|||
permission: {}, |
|||
orderData: {}, |
|||
finishShow: false, |
|||
rules: { |
|||
plan_qty: [ |
|||
{ required: true, message: '计划数量不能为空', trigger: 'blur' } |
|||
], |
|||
material_code: [ |
|||
{ required: true, message: '物料编码不能为空', trigger: 'change' } |
|||
], |
|||
vehicle_type: [ |
|||
{ required: true, message: '木托盘类型不能为空', trigger: 'blur' } |
|||
], |
|||
device_name: [ |
|||
{ required: true, message: '生产设备不能为空', trigger: 'change' } |
|||
], |
|||
is_urgent: [ |
|||
{ required: true, message: '是否加急不能为空', trigger: 'blur' } |
|||
], |
|||
is_pri: [ |
|||
{ required: true, message: '是否优先包装不能为空', trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
}, |
|||
methods: { |
|||
// 工单状态多选搜索 |
|||
handTaskStatus(value) { |
|||
this.$forceUpdate() |
|||
if (value) { |
|||
this.order_status = JSON.parse(JSON.stringify(value)) |
|||
this.query.order_status = this.order_status.toString() |
|||
} |
|||
this.crud.toQuery() |
|||
}, |
|||
// 查看 |
|||
toView(row) { |
|||
console.log(row) |
|||
if (row !== null) { |
|||
this.$refs.child3.setForm(row) |
|||
} |
|||
}, |
|||
clearForm() { |
|||
this.orderData = {} |
|||
}, |
|||
cancelFinish() { |
|||
this.clearForm() |
|||
this.finishShow = false |
|||
}, |
|||
// 强制完成 |
|||
forceFinish(data) { |
|||
this.orderData = data |
|||
this.finishShow = true |
|||
}, |
|||
toForceFinish() { |
|||
crudWorkorder.forceFinish({ row: this.orderData }).then(res => { |
|||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|||
this.crud.toQuery() |
|||
}) |
|||
}, |
|||
// 取两位小数点 |
|||
rounding(row, column) { |
|||
return parseFloat(row[column.property]).toFixed(2) |
|||
}, |
|||
// 下发按钮禁用条件 |
|||
is_disabled(len, row) { |
|||
if (len === 1 && row.order_status === '00') { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
}, |
|||
// 新增编辑给form表单物料相关信息赋值 |
|||
tableChanged(row) { |
|||
this.form.device_code = row.device_code |
|||
this.form.device_id = row.device_id |
|||
this.form.device_name = row.device_name |
|||
this.form.region_code = row.region_code |
|||
}, |
|||
setBOMValue(row) { |
|||
this.form.material_id = row.material_id |
|||
this.form.material_code = row.material_code |
|||
}, |
|||
// 下发 |
|||
submits(row) { |
|||
crudWorkorder.submits({ workorder_id: row.workorder_id }).then(res => { |
|||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|||
this.crud.toQuery() |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue