优化
This commit is contained in:
@@ -24,6 +24,8 @@ public interface GenCodeService {
|
|||||||
|
|
||||||
public String codeDemo(Map form);
|
public String codeDemo(Map form);
|
||||||
|
|
||||||
|
public String codeDemo2(Map form);
|
||||||
|
|
||||||
public String queryIdByCode(String code);
|
public String queryIdByCode(String code);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,81 @@ public class GenCodeServiceImpl implements GenCodeService {
|
|||||||
return demo;
|
return demo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String codeDemo2(Map form) {
|
||||||
|
String code = (String) form.get("code");
|
||||||
|
String id = this.queryIdByCode(code);
|
||||||
|
//如果flag=1就执行更新数据库的操作
|
||||||
|
String flag = (String) form.get("flag");
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("sys_code_rule_detail");
|
||||||
|
JSONArray ja = wo.query("code_rule_id = '" + id + "'", " sort_num,type FOR UPDATE").getResultJSONArray(0);
|
||||||
|
String demo = "";
|
||||||
|
boolean is_same = true;
|
||||||
|
for (int i = 0; i < ja.size(); i++) {
|
||||||
|
String value = "";
|
||||||
|
JSONObject jo = ja.getJSONObject(i);
|
||||||
|
//固定直接取值
|
||||||
|
if (jo.getString("type").equals("01")) {
|
||||||
|
value = jo.getString("init_value");
|
||||||
|
}
|
||||||
|
//日期判断数据库的值与当前值是否相同来决定顺序的值
|
||||||
|
if (jo.getString("type").equals("02")) {
|
||||||
|
String current_value = jo.getString("current_value");
|
||||||
|
Date date = DateUtil.date();
|
||||||
|
String format = jo.getString("format");
|
||||||
|
String now_date = DateUtil.format(date, format);
|
||||||
|
if (!now_date.equals(current_value)) {
|
||||||
|
is_same = false;
|
||||||
|
}
|
||||||
|
if (flag.equals("1")) {
|
||||||
|
jo.put("init_value", now_date);
|
||||||
|
jo.put("current_value", now_date);
|
||||||
|
}
|
||||||
|
value = now_date;
|
||||||
|
}
|
||||||
|
//顺序的值:如果日期一样就+步长,等于最大值就归为初始值;日期不一样就归为初始值
|
||||||
|
if (jo.getString("type").equals("03")) {
|
||||||
|
String num_value = "";
|
||||||
|
int step = jo.getInteger("step");
|
||||||
|
Long max_value = jo.getLong("max_value");
|
||||||
|
if (!is_same || (jo.getLongValue("current_value") + step > max_value)) {
|
||||||
|
num_value = jo.getString("init_value");
|
||||||
|
} else {
|
||||||
|
num_value = (jo.getInteger("current_value") + step) + "";
|
||||||
|
}
|
||||||
|
int size = num_value.length();
|
||||||
|
int length = jo.getInteger("length");
|
||||||
|
String fillchar = jo.getString("fillchar");
|
||||||
|
for (int m = 0; m < (length - size); m++) {
|
||||||
|
value += fillchar;
|
||||||
|
}
|
||||||
|
value += num_value;
|
||||||
|
if (flag.equals("1")) {
|
||||||
|
if (!is_same) {
|
||||||
|
int init_value = jo.getInteger("init_value");
|
||||||
|
if (StrUtil.isEmpty((init_value + ""))) {
|
||||||
|
throw new BadRequestException("请完善编码数值的初始值!");
|
||||||
|
}
|
||||||
|
jo.put("current_value", init_value + "");
|
||||||
|
} else {
|
||||||
|
int num_curr = jo.getInteger("current_value");
|
||||||
|
if (num_curr >= max_value) {
|
||||||
|
num_curr = jo.getInteger("init_value");
|
||||||
|
jo.put("current_value", num_curr + "");
|
||||||
|
}else{
|
||||||
|
jo.put("current_value", (num_curr + step) + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
demo += value;
|
||||||
|
if (flag.equals("1")) {
|
||||||
|
wo.update(jo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return demo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String queryIdByCode(String code) {
|
public String queryIdByCode(String code) {
|
||||||
JSONObject jo = WQLObject.getWQLObject("sys_code_rule").query("code = '" + code + "'").uniqueResult(0);
|
JSONObject jo = WQLObject.getWQLObject("sys_code_rule").query("code = '" + code + "'").uniqueResult(0);
|
||||||
|
|||||||
@@ -16,4 +16,13 @@ public class CodeUtil {
|
|||||||
return service.codeDemo(map);
|
return service.codeDemo(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static synchronized String getNewCode2(String ruleCode){
|
||||||
|
GenCodeService service=new GenCodeServiceImpl();
|
||||||
|
String flag = "1";
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("flag",flag);
|
||||||
|
map.put("code",ruleCode);
|
||||||
|
return service.codeDemo2(map);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,11 @@ public class BucketrecordServiceImpl implements BucketrecordService {
|
|||||||
String storagevehicle_code2 = jo.getString("storagevehicle_code");
|
String storagevehicle_code2 = jo.getString("storagevehicle_code");
|
||||||
if(ObjectUtil.isNotEmpty(storagevehicle_code2)){
|
if(ObjectUtil.isNotEmpty(storagevehicle_code2)){
|
||||||
JSONObject base_point = sch_base_point.query("vehicle_code='"+storagevehicle_code2+"'").uniqueResult(0);
|
JSONObject base_point = sch_base_point.query("vehicle_code='"+storagevehicle_code2+"'").uniqueResult(0);
|
||||||
jo.put("point_code",base_point.getString("point_code"));
|
if(base_point!=null){
|
||||||
|
jo.put("point_code",base_point.getString("point_code"));
|
||||||
|
}else{
|
||||||
|
jo.put("point_code","");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
jo.put("point_code","");
|
jo.put("point_code","");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
|||||||
// 插入主表
|
// 插入主表
|
||||||
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
json.put("workordercard_id",json.getString("workorder_id"));
|
json.put("workordercard_id",json.getString("workorder_id"));
|
||||||
String workorder_code = CodeUtil.getNewCode("GL_CODE");
|
String workorder_code = CodeUtil.getNewCode2("GL_CODE");
|
||||||
json.put("workorder_code", workorder_code);
|
json.put("workorder_code", workorder_code);
|
||||||
json.put("is_delete", "0");
|
json.put("is_delete", "0");
|
||||||
json.put("create_id", currentUserId);
|
json.put("create_id", currentUserId);
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
|||||||
JSONArray tableDtl = whereJson.getJSONArray("tableDtl");
|
JSONArray tableDtl = whereJson.getJSONArray("tableDtl");
|
||||||
JSONObject Formula_01 = new JSONObject();
|
JSONObject Formula_01 = new JSONObject();
|
||||||
long formula_id = IdUtil.getSnowflake(1, 1).nextId();
|
long formula_id = IdUtil.getSnowflake(1, 1).nextId();
|
||||||
String formula_code = CodeUtil.getNewCode("PF_CODE");
|
String formula_code = CodeUtil.getNewCode2("PF_CODE");
|
||||||
Formula_01.put("formula_id",formula_id);
|
Formula_01.put("formula_id",formula_id);
|
||||||
Formula_01.put("formula_code",formula_code);
|
Formula_01.put("formula_code",formula_code);
|
||||||
Formula_01.put("workorder_id",order.getString("workorder_id"));
|
Formula_01.put("workorder_id",order.getString("workorder_id"));
|
||||||
@@ -427,7 +427,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
|||||||
if("1".equals(whereJson.getString("is_again_put")) && tabledis.size()>0){
|
if("1".equals(whereJson.getString("is_again_put")) && tabledis.size()>0){
|
||||||
JSONObject Formula_02 = new JSONObject();
|
JSONObject Formula_02 = new JSONObject();
|
||||||
long formula_id2 = IdUtil.getSnowflake(1, 1).nextId();
|
long formula_id2 = IdUtil.getSnowflake(1, 1).nextId();
|
||||||
String formula_code2 = CodeUtil.getNewCode("PF_CODE");
|
String formula_code2 = CodeUtil.getNewCode2("PF_CODE");
|
||||||
Formula_02.put("formula_id",formula_id2);
|
Formula_02.put("formula_id",formula_id2);
|
||||||
Formula_02.put("formula_code",formula_code2);
|
Formula_02.put("formula_code",formula_code2);
|
||||||
Formula_02.put("workorder_id",order.getString("workorder_id"));
|
Formula_02.put("workorder_id",order.getString("workorder_id"));
|
||||||
@@ -609,7 +609,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
|||||||
JSONArray tableDtl = whereJson.getJSONArray("tableDtl");
|
JSONArray tableDtl = whereJson.getJSONArray("tableDtl");
|
||||||
JSONObject Formula_01 = new JSONObject();
|
JSONObject Formula_01 = new JSONObject();
|
||||||
long formula_id = IdUtil.getSnowflake(1, 1).nextId();
|
long formula_id = IdUtil.getSnowflake(1, 1).nextId();
|
||||||
String formula_code = CodeUtil.getNewCode("PF_CODE");
|
String formula_code = CodeUtil.getNewCode2("PF_CODE");
|
||||||
Formula_01.put("formula_id",formula_id);
|
Formula_01.put("formula_id",formula_id);
|
||||||
Formula_01.put("formula_code",formula_code);
|
Formula_01.put("formula_code",formula_code);
|
||||||
Formula_01.put("workorder_id",order.getString("workorder_id"));
|
Formula_01.put("workorder_id",order.getString("workorder_id"));
|
||||||
@@ -729,7 +729,7 @@ public class InitformulaServiceImpl implements InitformulaService {
|
|||||||
if("1".equals(whereJson.getString("is_again_put")) && tabledis.size()>0){
|
if("1".equals(whereJson.getString("is_again_put")) && tabledis.size()>0){
|
||||||
JSONObject Formula_02 = new JSONObject();
|
JSONObject Formula_02 = new JSONObject();
|
||||||
long formula_id2 = IdUtil.getSnowflake(1, 1).nextId();
|
long formula_id2 = IdUtil.getSnowflake(1, 1).nextId();
|
||||||
String formula_code2 = CodeUtil.getNewCode("PF_CODE");
|
String formula_code2 = CodeUtil.getNewCode2("PF_CODE");
|
||||||
Formula_02.put("formula_id",formula_id2);
|
Formula_02.put("formula_id",formula_id2);
|
||||||
Formula_02.put("formula_code",formula_code2);
|
Formula_02.put("formula_code",formula_code2);
|
||||||
Formula_02.put("workorder_id",order.getString("workorder_id"));
|
Formula_02.put("workorder_id",order.getString("workorder_id"));
|
||||||
|
|||||||
@@ -274,6 +274,7 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
|
|||||||
JSONObject jsonMainMst = mainMstTab.query("maint_id = '" + whereJson.getString("maint_id") + "'").uniqueResult(0);
|
JSONObject jsonMainMst = mainMstTab.query("maint_id = '" + whereJson.getString("maint_id") + "'").uniqueResult(0);
|
||||||
jsonMainMst.put("invstatus", "03");
|
jsonMainMst.put("invstatus", "03");
|
||||||
jsonMainMst.put("update_optname",whereJson.getString("update_optname") );
|
jsonMainMst.put("update_optname",whereJson.getString("update_optname") );
|
||||||
|
jsonMainMst.put("update_optname",whereJson.getString("update_optname") );
|
||||||
jsonMainMst.put("real_start_date", DateUtil.now());
|
jsonMainMst.put("real_start_date", DateUtil.now());
|
||||||
mainMstTab.update(jsonMainMst);
|
mainMstTab.update(jsonMainMst);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
size="small"
|
size="small"
|
||||||
:controls="false"
|
:controls="false"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
precision="3"
|
precision="1"
|
||||||
:min="0"
|
:min="0"
|
||||||
@change="change($event,crud.data[scope.$index],scope.$index)"
|
@change="change($event,crud.data[scope.$index],scope.$index)"
|
||||||
/>
|
/>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
size="small"
|
size="small"
|
||||||
:controls="false"
|
:controls="false"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
precision="3"
|
precision="1"
|
||||||
:min="0"
|
:min="0"
|
||||||
@change="change($event,crud.data[scope.$index],scope.$index)"
|
@change="change($event,crud.data[scope.$index],scope.$index)"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -71,16 +71,6 @@
|
|||||||
>
|
>
|
||||||
添加物料
|
添加物料
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button
|
|
||||||
slot="left"
|
|
||||||
class="filter-item"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
@click="delRow"
|
|
||||||
>
|
|
||||||
删除一行
|
|
||||||
</el-button>-->
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -96,10 +86,10 @@
|
|||||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||||
<el-table-column show-overflow-tooltip v-if="false" prop="material_id" label="物料id" align="center" />
|
<el-table-column v-if="false" prop="material_id" label="物料id" align="center" />
|
||||||
<el-table-column show-overflow-tooltip v-if="false" prop="base_unit_id" label="单位id" align="center" />
|
<el-table-column v-if="false" prop="base_unit_id" label="单位id" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="material_code" label="备件物料编码" align="center" />
|
<el-table-column prop="material_code" label="备件物料编码" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="material_name" label="备件物料名称" align="center" />
|
<el-table-column prop="material_name" label="备件物料名称" align="center" />
|
||||||
<el-table-column prop="qty" label="标准数量" align="center">
|
<el-table-column prop="qty" label="标准数量" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
@@ -112,7 +102,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column show-overflow-tooltip prop="base_unit_id_name" label="单位" align="center" />
|
<el-table-column prop="base_unit_id_name" label="单位" align="center" />
|
||||||
<el-table-column prop="dtl_remark" label="备注" align="center">
|
<el-table-column prop="dtl_remark" label="备注" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-show="!scope.row.edit" v-model="scope.row.dtl_remark" class="input-with-select" :disabled="crud.status.view > 0" />
|
<el-input v-show="!scope.row.edit" v-model="scope.row.dtl_remark" class="input-with-select" :disabled="crud.status.view > 0" />
|
||||||
@@ -194,8 +184,6 @@ export default {
|
|||||||
}
|
}
|
||||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||||
this.class_idStr = res.class_idStr
|
this.class_idStr = res.class_idStr
|
||||||
// this.crud.query.class_idStr = this.class_idStr
|
|
||||||
// this.crud.toQuery()
|
|
||||||
this.queryClassId()
|
this.queryClassId()
|
||||||
})
|
})
|
||||||
const data = {
|
const data = {
|
||||||
@@ -236,7 +224,6 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.afterToCU](crud, form) {
|
[CRUD.HOOK.afterToCU](crud, form) {
|
||||||
debugger
|
|
||||||
if (!form.device_bom_code) {
|
if (!form.device_bom_code) {
|
||||||
this.queryClassId()
|
this.queryClassId()
|
||||||
} else {
|
} else {
|
||||||
@@ -247,9 +234,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSubTypes(id) {
|
getSubTypes(id) {
|
||||||
debugger
|
|
||||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||||
debugger
|
|
||||||
const date = res.content
|
const date = res.content
|
||||||
this.buildClass(date)
|
this.buildClass(date)
|
||||||
this.classes = date
|
this.classes = date
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col span="12">
|
<el-col span="12">
|
||||||
<el-form-item label="故障编码:" prop="device_faultclass_code">
|
<el-form-item label="故障编码:" prop="device_faultclass_code">
|
||||||
<el-input v-model="form.device_faultclass_name" style="width: 280px;" disabled placeholder="系统生成" />
|
<el-input v-model="form.device_faultclass_code" style="width: 280px;" disabled placeholder="系统生成" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col span="12">
|
<el-col span="12">
|
||||||
|
|||||||
@@ -251,6 +251,17 @@ export default {
|
|||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
[CRUD.HOOK.afterToCU](crud, form) {
|
||||||
|
debugger
|
||||||
|
if (!form.maint_item_code) {
|
||||||
|
this.queryClassId()
|
||||||
|
} else {
|
||||||
|
const data = {}
|
||||||
|
data.id = form.material_type_id
|
||||||
|
data.goal_id = this.classBj_id
|
||||||
|
this.getSubTypes(data)
|
||||||
|
}
|
||||||
|
},
|
||||||
changeQuery() {
|
changeQuery() {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
@@ -290,6 +301,25 @@ export default {
|
|||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getSubTypes(id) {
|
||||||
|
debugger
|
||||||
|
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||||
|
debugger
|
||||||
|
const date = res.content
|
||||||
|
this.buildClass(date)
|
||||||
|
this.classes = date
|
||||||
|
})
|
||||||
|
},
|
||||||
|
buildClass(classes) {
|
||||||
|
classes.forEach(data => {
|
||||||
|
if (data.children) {
|
||||||
|
this.buildClass(data.children)
|
||||||
|
}
|
||||||
|
if (data.hasChildren && !data.children) {
|
||||||
|
data.children = null
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,6 +187,16 @@ export default {
|
|||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
[CRUD.HOOK.afterToCU](crud, form) {
|
||||||
|
if (!form.repair_item_code) {
|
||||||
|
this.queryClassId()
|
||||||
|
} else {
|
||||||
|
const data = {}
|
||||||
|
data.id = form.material_type_id
|
||||||
|
data.goal_id = this.classBj_id
|
||||||
|
this.getSubTypes(data)
|
||||||
|
}
|
||||||
|
},
|
||||||
loadClass({ action, parentNode, callback }) {
|
loadClass({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||||
@@ -214,6 +224,25 @@ export default {
|
|||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getSubTypes(id) {
|
||||||
|
debugger
|
||||||
|
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||||
|
debugger
|
||||||
|
const date = res.content
|
||||||
|
this.buildClass(date)
|
||||||
|
this.classes = date
|
||||||
|
})
|
||||||
|
},
|
||||||
|
buildClass(classes) {
|
||||||
|
classes.forEach(data => {
|
||||||
|
if (data.children) {
|
||||||
|
this.buildClass(data.children)
|
||||||
|
}
|
||||||
|
if (data.hasChildren && !data.children) {
|
||||||
|
data.children = null
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,11 @@
|
|||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="query.createTime"
|
v-model="query.createTime"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
@input="onInput()"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
|
@input="onInput()"
|
||||||
@change="mytoQuery"
|
@change="mytoQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -246,8 +246,8 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :selectable="checkboxT" type="selection" min-width="35" />
|
<el-table-column :selectable="checkboxT" type="selection" min-width="35" />
|
||||||
<el-table-column prop="workorder_date" min-width="83" label="工令日期" :formatter="workorder_dateFormat"/>
|
<el-table-column prop="workorder_date" min-width="83" label="工令日期" :formatter="workorder_dateFormat" />
|
||||||
<el-table-column prop="workorder_code" min-width="130" label="工令号">
|
<el-table-column prop="workorder_code" min-width="130" label="工令号">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.workorder_code }}</el-link>
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.workorder_code }}</el-link>
|
||||||
@@ -255,28 +255,28 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="org_id" :formatter="orgFormat" min-width="105" label="所属组织" />
|
<el-table-column prop="org_id" :formatter="orgFormat" min-width="105" label="所属组织" />
|
||||||
<el-table-column prop="workorder_type" :formatter="bill_typeFormat" min-width="75" label="工令类型" />
|
<el-table-column prop="workorder_type" :formatter="bill_typeFormat" min-width="75" label="工令类型" />
|
||||||
<el-table-column :formatter="stateFormat" min-width="75" prop="status" label="工令状态" />
|
<el-table-column :formatter="stateFormat" min-width="75" prop="status" label="工令状态" />
|
||||||
<el-table-column prop="device_name" min-width="80" label="设备"/>
|
<el-table-column prop="device_name" min-width="80" label="设备" />
|
||||||
<el-table-column prop="material_code" min-width="130" label="物料编码"/>
|
<el-table-column prop="material_code" min-width="130" label="物料编码" />
|
||||||
<el-table-column prop="old_mark" min-width="100" label="牌号"/>
|
<el-table-column prop="old_mark" min-width="100" label="牌号" />
|
||||||
<el-table-column :formatter="seriesFormat" min-width="65" prop="product_series_id" label="系列" />
|
<el-table-column :formatter="seriesFormat" min-width="65" prop="product_series_id" label="系列" />
|
||||||
<el-table-column prop="pcsn" min-width="85" label="批次"/>
|
<el-table-column prop="pcsn" min-width="85" label="批次" />
|
||||||
<el-table-column prop="workorder_qty" min-width="75" label="计划重量" :formatter="crud.formatNum0"/>
|
<el-table-column prop="workorder_qty" min-width="75" label="计划重量" :formatter="crud.formatNum0" />
|
||||||
<el-table-column prop="bill_qty" min-width="90" label="开单总重量" :formatter="crud.formatNum3" />
|
<el-table-column prop="bill_qty" min-width="90" label="开单总重量" :formatter="crud.formatNum3" />
|
||||||
<el-table-column prop="productin_qty" min-width="90" label="实投总重量" :formatter="crud.formatNum3"/>
|
<el-table-column prop="productin_qty" min-width="90" label="实投总重量" :formatter="crud.formatNum3" />
|
||||||
<el-table-column prop="qty_unit_name" min-width="75" label="单位"/>
|
<el-table-column prop="qty_unit_name" min-width="75" label="单位" />
|
||||||
<el-table-column prop="planstart_time" min-width="100" label="计划开始时间" :formatter="workorder_dateFormat"/>
|
<el-table-column prop="planstart_time" min-width="100" label="计划开始时间" :formatter="workorder_dateFormat" />
|
||||||
<el-table-column prop="planend_time" min-width="100" label="计划结束时间" :formatter="planend_timeFormat" />
|
<el-table-column prop="planend_time" min-width="100" label="计划结束时间" :formatter="planend_timeFormat" />
|
||||||
<el-table-column prop="realstart_time" min-width="135" label="实际开始时间"/>
|
<el-table-column prop="realstart_time" min-width="135" label="实际开始时间" />
|
||||||
<el-table-column prop="realend_time" min-width="135" label="实际结束时间"/>
|
<el-table-column prop="realend_time" min-width="135" label="实际结束时间" />
|
||||||
<el-table-column min-width="70" prop="source_bill_type" :formatter="workorder_typeFormat2" label="源类型" />
|
<el-table-column min-width="70" prop="source_bill_type" :formatter="workorder_typeFormat2" label="源类型" />
|
||||||
<el-table-column prop="source_bill_code" label="来源单据编号" min-width="105" />
|
<el-table-column prop="source_bill_code" label="来源单据编号" min-width="105" />
|
||||||
<el-table-column min-width="75" prop="workprocedure_id" label="当前工序" :formatter="seriesFormat2" />
|
<el-table-column min-width="75" prop="workprocedure_id" label="当前工序" :formatter="seriesFormat2" />
|
||||||
<el-table-column prop="startwork_name" min-width="60" label="开工人"/>
|
<el-table-column prop="startwork_name" min-width="60" label="开工人" />
|
||||||
<el-table-column prop="endwork_name" min-width="60" label="完工人"/>
|
<el-table-column prop="endwork_name" min-width="60" label="完工人" />
|
||||||
<el-table-column prop="create_name" min-width="60" label="创建人"/>
|
<el-table-column prop="create_name" min-width="60" label="创建人" />
|
||||||
<el-table-column prop="update_optname" min-width="60" label="修改人"/>
|
<el-table-column prop="update_optname" min-width="60" label="修改人" />
|
||||||
<el-table-column prop="remark" min-width="180" label="备注"/>
|
<el-table-column prop="remark" min-width="180" label="备注" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
@@ -297,16 +297,16 @@ import pagination from '@crud/Pagination'
|
|||||||
import AddDialog from '@/views/wms/pdm/produce/workorder/AddDialog'
|
import AddDialog from '@/views/wms/pdm/produce/workorder/AddDialog'
|
||||||
import ViewDialog from '@/views/wms/pdm/produce/workorder/ViewDialog'
|
import ViewDialog from '@/views/wms/pdm/produce/workorder/ViewDialog'
|
||||||
import ChangeDialog from '@/views/wms/pdm/produce/workorder/ChangeDialog'
|
import ChangeDialog from '@/views/wms/pdm/produce/workorder/ChangeDialog'
|
||||||
import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
|
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
|
||||||
import {getLodop} from "@/assets/js/lodop/LodopFuncs";
|
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||||
import Date from "@/utils/datetime";
|
import Date from '@/utils/datetime'
|
||||||
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
|
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
|
||||||
import { download } from '@/api/data'
|
import { download } from '@/api/data'
|
||||||
import { downloadFile } from '@/utils'
|
import { downloadFile } from '@/utils'
|
||||||
import producetask from '@/api/wms/pdm/producetask'
|
import producetask from '@/api/wms/pdm/producetask'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'workorder',
|
name: 'Workorder',
|
||||||
components: { ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
components: { ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '工令',
|
return CRUD({ title: '工令',
|
||||||
@@ -378,7 +378,7 @@ export default {
|
|||||||
return row.status !== '10'
|
return row.status !== '10'
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
if(this.query_flag){
|
if (this.query_flag) {
|
||||||
this.crud.query.begin_time = (new Date()).strftime('%F', 'zh')
|
this.crud.query.begin_time = (new Date()).strftime('%F', 'zh')
|
||||||
this.crud.query.end_time = (new Date().daysLater(2)).strftime('%F', 'zh')
|
this.crud.query.end_time = (new Date().daysLater(2)).strftime('%F', 'zh')
|
||||||
this.query_flag = false
|
this.query_flag = false
|
||||||
@@ -413,16 +413,14 @@ export default {
|
|||||||
if (rows[i].status > '40' || rows.length !== 1) {
|
if (rows[i].status > '40' || rows.length !== 1) {
|
||||||
this.change_flag = true
|
this.change_flag = true
|
||||||
}
|
}
|
||||||
//选择工令标识的工令状态必须为50开工,选择工令标识的工序任务状态必须全为99结束生产
|
if (rows[i].status !== '50') { // 后台校验工序任务
|
||||||
if (rows[i].status !== '50') {//后台校验工序任务
|
|
||||||
this.confirm_flag = true
|
this.confirm_flag = true
|
||||||
}
|
}
|
||||||
//选择工令标识,若产品工艺路线第一个工序为配粉,工令状态必须40已开单; 否则,工令状态必须20已提交
|
if (!'40,20'.includes(rows[i].status)) { // 后台校验首道工序
|
||||||
if (!'40,20'.includes(rows[i].status)) {//后台校验首道工序
|
|
||||||
this.open_flag = true
|
this.open_flag = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.handleCurrentChange()
|
this.handleCurrentChange()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -476,7 +474,7 @@ export default {
|
|||||||
},
|
},
|
||||||
typeChange() {
|
typeChange() {
|
||||||
this.checkrows = this.$refs.table.selection
|
this.checkrows = this.$refs.table.selection
|
||||||
if(this.checkrows.length !== 1 ){
|
if (this.checkrows.length !== 1) {
|
||||||
this.crud.notify('只能勾选一条记录修改工令类型!')
|
this.crud.notify('只能勾选一条记录修改工令类型!')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -488,13 +486,17 @@ export default {
|
|||||||
},
|
},
|
||||||
submit(status) {
|
submit(status) {
|
||||||
this.checkrows = this.$refs.table.selection
|
this.checkrows = this.$refs.table.selection
|
||||||
if(this.checkrows.length === 0 ){
|
if (this.checkrows.length === 0) {
|
||||||
this.crud.notify('请勾选需要操作的记录!')
|
this.crud.notify('请勾选需要操作的记录!')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
workorder.submit({ 'status': status, rows: this.checkrows}).then(res => {
|
this.crud.loading = true
|
||||||
|
workorder.submit({ 'status': status, rows: this.checkrows }).then(res => {
|
||||||
this.crud.notify('操作成功!')
|
this.crud.notify('操作成功!')
|
||||||
|
this.crud.loading = false
|
||||||
this.querytable()
|
this.querytable()
|
||||||
|
}).catch(() => {
|
||||||
|
this.crud.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
downdData() {
|
downdData() {
|
||||||
@@ -508,31 +510,42 @@ export default {
|
|||||||
},
|
},
|
||||||
openWork() {
|
openWork() {
|
||||||
this.checkrows = this.$refs.table.selection
|
this.checkrows = this.$refs.table.selection
|
||||||
if(this.checkrows.length === 0 ){
|
if (this.checkrows.length === 0) {
|
||||||
this.crud.notify('请勾选需要操作的记录!')
|
this.crud.notify('请勾选需要操作的记录!')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
workorder.openWork({ rows: this.checkrows}).then(res => {
|
this.open_flag = true
|
||||||
|
this.crud.loading = true
|
||||||
|
workorder.openWork({ rows: this.checkrows }).then(res => {
|
||||||
this.crud.notify('操作成功!')
|
this.crud.notify('操作成功!')
|
||||||
|
this.crud.loading = false
|
||||||
|
this.open_flag = false
|
||||||
this.querytable()
|
this.querytable()
|
||||||
|
}).catch(() => {
|
||||||
|
this.crud.loading = false
|
||||||
|
this.open_flag = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
confirmWork() {
|
confirmWork() {
|
||||||
this.checkrows = this.$refs.table.selection
|
this.checkrows = this.$refs.table.selection
|
||||||
if(this.checkrows.length === 0 ){
|
if (this.checkrows.length === 0) {
|
||||||
this.crud.notify('请勾选需要操作的记录!')
|
this.crud.notify('请勾选需要操作的记录!')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
workorder.confirmWork({ rows: this.checkrows}).then(res => {
|
this.crud.loading = true
|
||||||
|
workorder.confirmWork({ rows: this.checkrows }).then(res => {
|
||||||
this.crud.notify('操作成功!')
|
this.crud.notify('操作成功!')
|
||||||
|
this.crud.loading = false
|
||||||
this.querytable()
|
this.querytable()
|
||||||
|
}).catch(() => {
|
||||||
|
this.crud.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mytoQuery(array1){
|
mytoQuery(array1) {
|
||||||
if(array1 === null){
|
if (array1 === null) {
|
||||||
this.crud.query.begin_time = ''
|
this.crud.query.begin_time = ''
|
||||||
this.crud.query.end_time = ''
|
this.crud.query.end_time = ''
|
||||||
}else{
|
} else {
|
||||||
this.crud.query.begin_time = array1[0]
|
this.crud.query.begin_time = array1[0]
|
||||||
this.crud.query.end_time = array1[1]
|
this.crud.query.end_time = array1[1]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ export default {
|
|||||||
name: 'Devicerepairrequest',
|
name: 'Devicerepairrequest',
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect, PicDialog },
|
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect, PicDialog },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
dicts: ['EM_FAULT_LEVEL'],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '设备报修处理',
|
title: '设备报修处理',
|
||||||
@@ -212,14 +213,8 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
formaLevelName(row, cloum) {
|
formaLevelName(row) {
|
||||||
if (row.fault_level === '01') {
|
return this.dict.label.EM_FAULT_LEVEL[row.fault_level]
|
||||||
return '一级'
|
|
||||||
} else if (row.fault_level === '02') {
|
|
||||||
return '二级'
|
|
||||||
} else if (row.fault_level === '03') {
|
|
||||||
return '三级'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
formatStatusName(row, cloum) {
|
formatStatusName(row, cloum) {
|
||||||
if (row.status === '01') {
|
if (row.status === '01') {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="120px" label-suffix=":">
|
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="120px" label-suffix=":">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="维修人" prop="update_optname">
|
<el-form-item label="保养人" prop="update_optname">
|
||||||
<el-input v-model="form4.update_optname" style="width: 200px;" />
|
<el-input v-model="form4.update_optname" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="120px" label-suffix=":">
|
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="120px" label-suffix=":">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="维修人" prop="update_optname">
|
<el-form-item label="保养人" prop="update_optname">
|
||||||
<el-input v-model="form4.update_optname" style="width: 200px;" />
|
<el-input v-model="form4.update_optname" style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@@ -114,17 +114,6 @@
|
|||||||
>
|
>
|
||||||
开始保养
|
开始保养
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button
|
|
||||||
slot="right"
|
|
||||||
class="filter-item"
|
|
||||||
type="success"
|
|
||||||
icon="el-icon-position"
|
|
||||||
size="mini"
|
|
||||||
:disabled="execu_flag"
|
|
||||||
@click="executeMaintain"
|
|
||||||
>
|
|
||||||
保养执行
|
|
||||||
</el-button>-->
|
|
||||||
<el-button
|
<el-button
|
||||||
slot="right"
|
slot="right"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
|
|||||||
Reference in New Issue
Block a user