Browse Source

rev 混料工单使用bom

master
张江玮 2 years ago
parent
commit
f55e0839dc
  1. 10
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java
  2. 8
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL_DETAIL.wql
  3. 8
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java
  4. 2
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java
  5. 25
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  6. 15
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql
  7. 1
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java
  8. 10
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
  9. 7
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql
  10. 4
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql
  11. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
  12. 51
      lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue
  13. 429
      lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue
  14. 26
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue
  15. 14
      lms/nladmin-ui/src/views/wms/pub/DeviceDialog.vue
  16. 2
      lms/nladmin-ui/src/views/wms/sch/point/index.vue

10
lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java

@ -119,15 +119,17 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
if (ObjectUtil.isEmpty(furnace_name)) { if (ObjectUtil.isEmpty(furnace_name)) {
throw new BadRequestException("物料编码解析错误:未知炉型!"); throw new BadRequestException("物料编码解析错误:未知炉型!");
} }
material_detail.put("furnace", furnace_code); material_detail.put("furnace", furnace_name.getString("label"));
String material_brick_code = material_code.substring(2, 5); String material_brick_code = material_code.substring(2, 5);
JSONObject material_brick_type = dict_detail_table.query("name = 'material_brick_type' AND value = '" + material_brick_code + "'").uniqueResult(0); JSONObject material_brick_type = dict_detail_table.query("name = 'material_brick_type' AND value = '" + material_brick_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(material_brick_type)) { if (ObjectUtil.isEmpty(material_brick_type)) {
throw new BadRequestException("物料编码解析错误:未知物料砖类型!"); throw new BadRequestException("物料编码解析错误:未知物料砖类型!");
} }
material_detail.put("material_brick_type", material_brick_code); material_detail.put("material_brick_type", material_brick_type.getString("label"));
String bom_code = material_code.substring(5, 11); String bom_code = material_code.substring(5, 11);
JSONObject old_bom = wo.query("material_code = '" + bom_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(old_bom)) {
JSONObject bom = new JSONObject(); JSONObject bom = new JSONObject();
bom.put("material_id", IdUtil.getSnowflake(1, 1).nextId()); bom.put("material_id", IdUtil.getSnowflake(1, 1).nextId());
bom.put("material_code", bom_code); bom.put("material_code", bom_code);
@ -135,8 +137,6 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
bom.put("create_id", currentUserId); bom.put("create_id", currentUserId);
bom.put("create_name", nickName); bom.put("create_name", nickName);
bom.put("create_time", now); bom.put("create_time", now);
JSONObject old_bom = wo.query("material_code = '" + bom_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(old_bom)) {
wo.insert(bom); wo.insert(bom);
} }
@ -148,7 +148,7 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
if (ObjectUtil.isEmpty(product_grade)) { if (ObjectUtil.isEmpty(product_grade)) {
throw new BadRequestException("物料编码解析错误:未知牌号!"); throw new BadRequestException("物料编码解析错误:未知牌号!");
} }
material_detail.put("product_grade", product_grade_code); material_detail.put("product_grade", product_grade.getString("label"));
material_detail.put("brick_type", material_code.substring(23)); material_detail.put("brick_type", material_code.substring(23));
material_detail.put("create_id", currentUserId); material_detail.put("create_id", currentUserId);
material_detail.put("create_name", nickName); material_detail.put("create_name", nickName);

8
lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL_DETAIL.wql

@ -40,15 +40,9 @@
IF 输入.flag = "1" IF 输入.flag = "1"
PAGEQUERY PAGEQUERY
SELECT SELECT
md.*, md.*
d1.label AS 'furnace_name',
d2.label AS 'material_brick_type_name',
d3.label AS 'product_grade_name'
FROM FROM
md_me_material_detail md md_me_material_detail md
LEFT JOIN sys_dict_detail d1 ON d1.`value` = md.furnace AND d1.`name` = 'furnace'
LEFT JOIN sys_dict_detail d2 ON d2.`value` = md.material_brick_type AND d2.`name` = 'material_brick_type'
LEFT JOIN sys_dict_detail d3 ON d3.`value` = md.product_grade AND d3.`name` = 'product_grade'
WHERE WHERE
md.is_delete = '0' md.is_delete = '0'
ENDSELECT ENDSELECT

8
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java

@ -194,4 +194,12 @@ public class AcsToWmsController {
public ResponseEntity<Object> getVehicleInfo(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> getVehicleInfo(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(acsToWmsService.getVehicleInfo(whereJson), HttpStatus.OK); return new ResponseEntity<>(acsToWmsService.getVehicleInfo(whereJson), HttpStatus.OK);
} }
@PostMapping("/outKiln")
@Log("出窑分配")
@ApiOperation("出窑分配")
@SaIgnore
public ResponseEntity<Object> outKiln(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(acsToWmsService.outKiln(whereJson), HttpStatus.OK);
}
} }

2
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java

@ -106,4 +106,6 @@ public interface AcsToWmsService {
JSONObject feedbackVehicleType(JSONObject param); JSONObject feedbackVehicleType(JSONObject param);
JSONObject getVehicleInfo(JSONObject whereJson); JSONObject getVehicleInfo(JSONObject whereJson);
JSONObject outKiln(JSONObject whereJson);
} }

25
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -864,4 +864,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.put("data", data); result.put("data", data);
return result; return result;
} }
@Override
public JSONObject outKiln(JSONObject whereJson) {
String vehicle_code = TaskUtils.formatVehicleCode(whereJson.getString("vehicle_code"));
if ("0000".equals(vehicle_code)) {
throw new BadRequestException("载具编码不能为空!");
}
boolean to_package = false;
JSONObject workorder = WQL
.getWO("ACS_TO_WMS")
.addParam("flag", "2")
.addParam("vehicle_code", vehicle_code)
.process()
.uniqueResult(0);
if (ObjectUtil.isNotEmpty(workorder)) {
to_package = TrueOrFalse.trueOrFalse("is_pri");
}
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "分配完成!");
result.put("data", to_package);
return result;
}
} }

15
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql

@ -58,3 +58,18 @@
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "2"
QUERY
SELECT
workorder.*
FROM
st_ivt_vehicle_detail vd
LEFT JOIN pdm_bd_workorder workorder ON vd.workorder_id = workorder.workorder_id
WHERE
vd.is_delete = '0'
AND vd.vehicle_type = '2'
AND vd.vehicle_code = 输入.vehicle_code
ENDSELECT
ENDQUERY
ENDIF

1
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java

@ -46,6 +46,7 @@ public class DeviceServiceImpl implements DeviceService {
if (!StrUtil.isEmpty(search)) { if (!StrUtil.isEmpty(search)) {
map.put("search", "%" + search + "%"); map.put("search", "%" + search + "%");
} }
map.put("region_str", MapUtil.getStr(whereJson, "region_str"));
JSONObject json = WQL.getWO("PDM_BI_DEVICE01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "device.device_model ASC, device.device_code ASC"); JSONObject json = WQL.getWO("PDM_BI_DEVICE01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "device.device_model ASC, device.device_code ASC");
return json; return json;
} }

10
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java

@ -58,6 +58,7 @@ public class WorkorderServiceImpl implements WorkordeService {
map.put("flag", "1"); map.put("flag", "1");
map.put("begin_time", begin_time); map.put("begin_time", begin_time);
map.put("end_time", end_time); map.put("end_time", end_time);
map.put("region_code", MapUtil.getStr(whereJson, "region_code"));
if (StrUtil.isNotEmpty(order_status)) { if (StrUtil.isNotEmpty(order_status)) {
order_status = order_status.replace("[\"", "").replace("\"]", "").replace("\"", ""); order_status = order_status.replace("[\"", "").replace("\"]", "").replace("\"", "");
} }
@ -408,12 +409,19 @@ public class WorkorderServiceImpl implements WorkordeService {
public void finish(JSONObject param) { public void finish(JSONObject param) {
String workorder_id = param.getString("workorder_id"); String workorder_id = param.getString("workorder_id");
WQLObject workorder_table = WQLObject.getWQLObject("pdm_bd_workorder"); WQLObject workorder_table = WQLObject.getWQLObject("pdm_bd_workorder");
JSONObject workorder = workorder_table.query("workorder_id = " + workorder_id).uniqueResult(0); JSONObject workorder = workorder_table.query("is_delete = '0' AND workorder_id = " + workorder_id).uniqueResult(0);
if (ObjectUtil.isEmpty(workorder)) {
throw new BadRequestException("工单不存在或已删除!");
}
if (workorder.getIntValue("order_status") < 5) { if (workorder.getIntValue("order_status") < 5) {
workorder.put("order_status", WorkOrderEnum.ORDER_STATUS_FINISH.value()); workorder.put("order_status", WorkOrderEnum.ORDER_STATUS_FINISH.value());
String qty = param.getString("qty"); String qty = param.getString("qty");
if (StrUtil.isBlank(qty)) { if (StrUtil.isBlank(qty)) {
JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("device_id = " + workorder.getString("device_id")).uniqueResult(0);
if (Region.HL.value().equals(device.getString("region_code"))) {
throw new BadRequestException("重量不能为空!");
}
throw new BadRequestException("数量不能为空!"); throw new BadRequestException("数量不能为空!");
} }
workorder.put("real_qty", qty); workorder.put("real_qty", qty);

7
lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql

@ -26,6 +26,7 @@
输入.material TYPEAS s_string 输入.material TYPEAS s_string
输入.workprocedure_ids TYPEAS f_string 输入.workprocedure_ids TYPEAS f_string
输入.unFinish TYPEAS s_string 输入.unFinish TYPEAS s_string
输入.region_code TYPEAS s_string
[临时表] [临时表]
@ -81,6 +82,12 @@
( (
material.material_code like 输入.material material.material_code like 输入.material
) )
ENDOPTION
OPTION 输入.region_code <> ""
device.region_code = 'HL'
ENDOPTION
OPTION 输入.region_code = ""
device.region_code IN ('YZ', 'FJ')
ENDOPTION ENDOPTION
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY

4
lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql

@ -15,6 +15,7 @@
################################################# #################################################
输入.flag TYPEAS s_string 输入.flag TYPEAS s_string
输入.search TYPEAS s_string 输入.search TYPEAS s_string
输入.region_str TYPEAS f_string
[临时表] [临时表]
@ -54,6 +55,9 @@
(device.device_code like 输入.search or (device.device_code like 输入.search or
device.device_name like 输入.search) device.device_name like 输入.search)
ENDOPTION ENDOPTION
OPTION 输入.region_str <> ""
device.region_code IN 输入.region_str
ENDOPTION
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY

BIN
lms/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.

51
lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue

@ -20,36 +20,10 @@
<el-input v-model="form.material_name" placeholder="物料名称" style="width: 300px;" /> <el-input v-model="form.material_name" placeholder="物料名称" style="width: 300px;" />
</el-form-item> </el-form-item>
<el-form-item label="炉型" prop="furnace"> <el-form-item label="炉型" prop="furnace">
<el-select <el-input v-model="form.furnace" placeholder="炉型" style="width: 300px;" />
v-model="form.furnace"
placeholder="炉型"
style="width: 300px"
clearable
filterable
>
<el-option
v-for="item in dict.furnace"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="物料砖类型" prop="material_brick_type"> <el-form-item label="物料砖类型" prop="material_brick_type">
<el-select <el-input v-model="form.material_brick_type" placeholder="物料砖类型" style="width: 300px;" />
v-model="form.material_brick_type"
placeholder="物料砖类型"
style="width: 300px"
clearable
filterable
>
<el-option
v-for="item in dict.material_brick_type"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="BOM编码" prop="bom_code"> <el-form-item label="BOM编码" prop="bom_code">
<el-input v-model="form.bom_code" placeholder="BOM编码" style="width: 300px;" /> <el-input v-model="form.bom_code" placeholder="BOM编码" style="width: 300px;" />
@ -61,20 +35,7 @@
<el-input v-model="form.customer_code" placeholder="客户编码" style="width: 300px;" /> <el-input v-model="form.customer_code" placeholder="客户编码" style="width: 300px;" />
</el-form-item> </el-form-item>
<el-form-item label="牌号" prop="product_grade"> <el-form-item label="牌号" prop="product_grade">
<el-select <el-input v-model="form.product_grade" placeholder="牌" style="width: 300px;" />
v-model="form.product_grade"
placeholder="物料砖类型"
style="width: 300px"
clearable
filterable
>
<el-option
v-for="item in dict.product_grade"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="砖型" prop="brick_type"> <el-form-item label="砖型" prop="brick_type">
<el-input v-model="form.brick_type" placeholder="砖型" style="width: 300px;" /> <el-input v-model="form.brick_type" placeholder="砖型" style="width: 300px;" />
@ -104,12 +65,12 @@
:min-width="flexWidth('material_name',crud.data,'物料名称')" :min-width="flexWidth('material_name',crud.data,'物料名称')"
/> />
<el-table-column <el-table-column
prop="furnace_name" prop="furnace"
label="炉型" label="炉型"
:min-width="flexWidth('furnace_name',crud.data,'炉型')" :min-width="flexWidth('furnace_name',crud.data,'炉型')"
/> />
<el-table-column <el-table-column
prop="material_brick_type_name" prop="material_brick_type"
label="物料砖类型" label="物料砖类型"
:min-width="flexWidth('material_brick_type_name',crud.data,'物料砖类型')" :min-width="flexWidth('material_brick_type_name',crud.data,'物料砖类型')"
/> />
@ -129,7 +90,7 @@
:min-width="flexWidth('customer_code',crud.data,'客户编码')" :min-width="flexWidth('customer_code',crud.data,'客户编码')"
/> />
<el-table-column <el-table-column
prop="product_grade_name" prop="product_grade"
label="牌号" label="牌号"
:min-width="flexWidth('product_grade_name',crud.data,'牌号')" :min-width="flexWidth('product_grade_name',crud.data,'牌号')"
/> />

429
lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue

@ -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>

26
lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

@ -107,14 +107,14 @@
style="width: 300px" style="width: 300px"
clearable clearable
@focus="deviceShow=true" @focus="deviceShow=true"
@clear="form.device_code=''; form.device_id=''; form.device_name=''" @clear="form.device_code=''; form.device_id=''; form.device_name=''; form.region_code = ''"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-show="typeof (form.region_code) === 'string' && form.region_code !== 'HL'" label="物料编码" prop="material_code"> <el-form-item label="物料编码" prop="material_code">
<el-input <el-input
v-model="form.material_code" v-model="form.material_code"
:disabled="crud.status.edit" :disabled="crud.status.edit"
@ -128,21 +128,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-show="typeof (form.region_code) === 'string' && form.region_code === 'HL'" label="BOM编码" prop="material_code"> <el-form-item label="计划数量" prop="plan_qty">
<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-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -244,8 +230,7 @@
<pagination /> <pagination />
</div> </div>
<MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" /> <MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" />
<DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" @tableChanged="tableChanged" /> <DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" :region-str="'(\'YZ\', \'FJ\')'" @tableChanged="tableChanged" />
<BOMDtl :dialog-show.sync="bomShow" :is-single="true" @setBOMValue="setBOMValue" />
<ViewDialog ref="child3" /> <ViewDialog ref="child3" />
<!--表单组件--> <!--表单组件-->
<el-dialog <el-dialog
@ -307,7 +292,6 @@ import pagination from '@crud/Pagination'
import MaterDtl from '@/views/wms/pub/MaterDialog' import MaterDtl from '@/views/wms/pub/MaterDialog'
import ViewDialog from '@/views/wms/pdm/workerorder/ViewDialog' import ViewDialog from '@/views/wms/pdm/workerorder/ViewDialog'
import DeviceDialog from '@/views/wms/pub/DeviceDialog' import DeviceDialog from '@/views/wms/pub/DeviceDialog'
import BOMDtl from '@/views/wms/pub/BOMDialog.vue'
const defaultForm = { const defaultForm = {
workorder_id: null, workorder_id: null,
@ -358,7 +342,7 @@ const defaultForm = {
} }
export default { export default {
name: 'Produceshiftorder', name: 'Produceshiftorder',
components: { BOMDtl, pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog }, components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl, ViewDialog, DeviceDialog },
mixins: [presenter(), header(), form(defaultForm), crud()], 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'], dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'],
cruds() { cruds() {

14
lms/nladmin-ui/src/views/wms/pub/DeviceDialog.vue

@ -79,7 +79,12 @@ export default {
dicts: ['pdm_device_type'], dicts: ['pdm_device_type'],
components: { rrOperation, pagination }, components: { rrOperation, pagination },
cruds() { cruds() {
return CRUD({ title: '设备', url: 'api/device', crudMethod: { ...crudDevice }, optShow: {}}) return CRUD({
title: '设备',
url: 'api/device',
crudMethod: { ...crudDevice },
optShow: {}
})
}, },
mixins: [presenter(), header()], mixins: [presenter(), header()],
props: { props: {
@ -94,6 +99,10 @@ export default {
openParam: { openParam: {
type: Object, type: Object,
default: null default: null
},
regionStr: {
type: String,
default: '(\'HL\')'
} }
}, },
data() { data() {
@ -114,6 +123,9 @@ export default {
} }
}, },
methods: { methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.region_str = this.regionStr
},
clickChange(item) { clickChange(item) {
this.tableRadio = item this.tableRadio = item
}, },

2
lms/nladmin-ui/src/views/wms/sch/point/index.vue

@ -265,7 +265,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" /> <el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> <el-table-column prop="material_code" label="物料编码/BOM编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" show-overflow-tooltip /> <el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" show-overflow-tooltip />
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',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="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />

Loading…
Cancel
Save