rev:新增老车间工单下发和打印功能
This commit is contained in:
@@ -6,50 +6,119 @@
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-width="120px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属库区">
|
||||
<el-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
class="filter-item"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="锁定类型">
|
||||
<el-select
|
||||
v-model="query.lock_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="锁定类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.d_lock_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="仓位编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
<!--每箱袋数、每袋数量、箱数、箱型、目标巷道、是否翻转、托盘满托数量、袋数-->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="每箱袋数">
|
||||
<el-input-number
|
||||
v-model="query.one_box_package_qty"
|
||||
clearable
|
||||
size="small"
|
||||
precision="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="每袋数量">
|
||||
<el-input-number
|
||||
v-model="query.one_package_qty"
|
||||
clearable
|
||||
precision="0"
|
||||
size="small"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="托盘满托数量">
|
||||
<el-input-number
|
||||
v-model="query.tray_full_num"
|
||||
clearable
|
||||
size="small"
|
||||
precision="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="箱型">
|
||||
<el-input
|
||||
v-model="query.box_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="箱型"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="目标巷道">
|
||||
<el-select
|
||||
v-model="query.target_roadway"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 180px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in roadList"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="是否翻转">
|
||||
<el-select
|
||||
v-model="query.is_flip"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 180px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IS_OR_NOT"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<rrOperation />
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="confirm_flag"
|
||||
@click="startWork()"
|
||||
>
|
||||
开工
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
@click="print"
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -197,51 +266,64 @@
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<!--
|
||||
<el-table-column type="selection" width="55" />
|
||||
-->
|
||||
<el-table-column prop="struct_code" label="仓位编码" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="struct_name" label="仓位名称" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="simple_name" label="仓位简称" width="100" />
|
||||
<el-table-column prop="sect_name" label="所属库区" width="150" />
|
||||
<el-table-column prop="stor_name" label="所属仓库" width="150" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="lock_type" label="锁定类型" min-width="120" show-overflow-tooltip>
|
||||
<el-table-column v-if="false" prop="workorder_id" label="生产班次工单标识" />
|
||||
<el-table-column prop="workorder_code" label="工单编号" width="140px" />
|
||||
<el-table-column prop="shift_type_scode" label="班次类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.d_lock_type[scope.row.lock_type] }}
|
||||
{{ dict.label.PDM_BI_SHIFTTYPE[scope.row.shift_type_scode] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sect_name" label="库区名称" />
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<!-- <el-table-column prop="workprocedure_code" label="工序编码" />-->
|
||||
<el-table-column prop="product_area" label="生产车间" />
|
||||
<el-table-column prop="plan_qty" label="计划数量" />
|
||||
<el-table-column prop="real_qty" label="实际数量" />
|
||||
<el-table-column prop="person_name" label="生产人员" />
|
||||
<el-table-column prop="person_real_qty" label="人员实际数量" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="dq_real_qty" label="电气实际数量" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="material_weight" label="物料单重" width="100" :formatter="crud.formatQlNum4" />
|
||||
<el-table-column prop="planproducestart_date" label="计划开始时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="planproduceend_date" label="计划结束时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="realproducestart_date" label="实际开始时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="realproduceend_date" label="实际结束时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="device_code" label="当前设备编码" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="is_canupdate_update" label="操作工是否允许修改报工数量" width="200" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row)"
|
||||
/>
|
||||
{{ dict.label.IS_OR_NOT[scope.row.is_canupdate_update] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskdtl_type" label="锁定任务类型" width="150" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_code" label="锁定任务编码" width="150" />
|
||||
<el-table-column prop="inv_code" label="锁定单据编码" width="150" />
|
||||
<el-table-column prop="inv_type" label="锁定单据类型" width="150" :formatter="invtypeFormat" />
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-permission="['admin','structattr:edit','structattr:del']"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="120px"
|
||||
align="center"
|
||||
>
|
||||
<el-table-column prop="workorder_status" label="工单状态">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
{{ dict.label.MPS_BD_ORDERSTATUS[scope.row.workorder_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_needmove" label="是否搬运">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.IS_OR_NOT[scope.row.is_needmove] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_type" label="创建类型" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.WORKORDER_CREATE_TYPE[scope.row.create_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_error" label="是否异常">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.IS_OR_NOT[scope.row.is_error] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="error_info" label="异常信息" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_name" label="创建人" show-overflow-tooltip />
|
||||
<el-table-column prop="create_time" label="创建时间" show-overflow-tooltip />
|
||||
<el-table-column prop="update_name" label="修改人" show-overflow-tooltip />
|
||||
<el-table-column prop="update_time" label="修改时间" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -257,7 +339,9 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
/* import checkoutbill from "@/api/wms/st/core/outbill/checkoutbill";*/
|
||||
import crudProduceshiftorder from '@/views/wms/product_manage/workorder/produceshiftorder'
|
||||
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||
import orderExt from '@/views/wms/product_manage/workorder/orderExt'
|
||||
|
||||
const defaultForm = {
|
||||
struct_id: null,
|
||||
@@ -306,14 +390,22 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_HEIGHT_TYPE', 'd_lock_type', 'SCH_TASK_TYPE_DTL'],
|
||||
dicts: ['ST_HEIGHT_TYPE', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'IS_OR_NOT', 'MPS_BD_ORDERSTATUS', 'WORKORDER_CREATE_TYPE', 'PDM_BI_SHIFTTYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '仓位',
|
||||
optShow: { add: true, reset: true },
|
||||
url: 'api/structattr',
|
||||
optShow: {
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
workorder_status: '2',
|
||||
product_area: 'A2',
|
||||
workprocedure_code: 'BZ',
|
||||
is_error: '0'
|
||||
},
|
||||
url: 'api/produceWorkorder',
|
||||
idField: 'struct_id',
|
||||
crudMethod: { ...crudStructattr }
|
||||
})
|
||||
@@ -334,7 +426,10 @@ export default {
|
||||
}
|
||||
return {
|
||||
sects: [],
|
||||
currentRow: null,
|
||||
invtypelist: [],
|
||||
roadList: ['1', '2', '3', '4', '5', '6', '7'],
|
||||
confirm_flag: true,
|
||||
permission: {},
|
||||
rules: {
|
||||
struct_id: [
|
||||
@@ -382,13 +477,11 @@ export default {
|
||||
crudSectattr.getSect({}).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
/* checkoutbill.getInvTypes().then(res => {
|
||||
this.invtypelist = res
|
||||
})*/
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.currentRow = {}
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit](crud, form) {
|
||||
@@ -397,6 +490,33 @@ export default {
|
||||
val[1] = form.sect_id
|
||||
form.cascader = val
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.buttonChange(row)
|
||||
} else if (val.length === 1) {
|
||||
this.buttonChange(row)
|
||||
} else {
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
},
|
||||
buttonChange(currentRow) {
|
||||
if (currentRow !== null) {
|
||||
this.currentRow = currentRow
|
||||
this.confirm_flag = false
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.confirm_flag = true
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
sectChange(val) {
|
||||
this.form.sect_id = val[1]
|
||||
},
|
||||
@@ -410,6 +530,23 @@ export default {
|
||||
taskdtl_typeFormat(row) {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
},
|
||||
startWork() {
|
||||
if (!this.crud.query.one_box_package_qty || !this.crud.query.one_package_qty || !this.crud.query.box_type ||
|
||||
!this.crud.query.target_roadway || !this.crud.query.is_flip ||
|
||||
!this.crud.query.tray_full_num) {
|
||||
this.crud.notify('缺少开工必要参数,保证输入框内不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
debugger
|
||||
this.currentRow.extra_map = this.crud.query
|
||||
this.currentRow.extra_map.package_qty = Math.ceil(this.currentRow.plan_qty / this.currentRow.extra_map.one_package_qty)
|
||||
this.currentRow.extra_map.box_num = Math.ceil(this.currentRow.extra_map.package_qty / this.currentRow.extra_map.one_box_package_qty)
|
||||
orderExt.add(this.currentRow).then(res => {
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
crudProduceshiftorder.openStart(this.currentRow).then(res => {
|
||||
})
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
@@ -425,6 +562,33 @@ export default {
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
print() {
|
||||
if (!this.currentRow) {
|
||||
this.crud.notify('请选择一条工单记录进行打印', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
orderExt.getExtList(this.currentRow).then(res => {
|
||||
debugger
|
||||
const item = res[0]
|
||||
// res.forEach((item) => {
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '50mm', '')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '48mm', '28mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE('10mm', '12mm', '60mm', '25mm', '128Auto', item.bar_code)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
||||
LODOP.ADD_PRINT_TEXT('35mm', '22mm', '40mm', '20mm', item.bar_code.substring(0, 9))
|
||||
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
|
||||
LODOP.ADD_PRINT_TEXT('42mm', '25mm', '40mm', '20mm', item.bar_code.substring(9, 16))
|
||||
console.log(item.barcode)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
|
||||
// LODOP.PRINT()// 打印
|
||||
// LODOP.PREVIEW()
|
||||
})
|
||||
// })
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 改变状态
|
||||
format_is_used(is_used) {
|
||||
return is_used === true
|
||||
|
||||
19
mes/qd/src/views/wms/product_manage/workorder/orderExt.js
Normal file
19
mes/qd/src/views/wms/product_manage/workorder/orderExt.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/mpsSaleOrderIcExt',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getExtList(data) {
|
||||
return request({
|
||||
url: 'api/mpsSaleOrderIcExt/getExtList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, getExtList }
|
||||
@@ -65,7 +65,7 @@ export function getTable(data) {
|
||||
|
||||
export function openStart(data) {
|
||||
return request({
|
||||
url: 'api/produceWorkorder/openStart',
|
||||
url: 'api/produceshiftorder/openStart',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user