优化
This commit is contained in:
@@ -227,6 +227,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
WQLObject PDM_BI_WorkOrder = WQLObject.getWQLObject("PDM_BI_WorkOrder");
|
||||
WQLObject PDM_BI_Formula = WQLObject.getWQLObject("PDM_BI_Formula");
|
||||
WQLObject PDM_BI_WorkTask = WQLObject.getWQLObject("PDM_BI_WorkTask");
|
||||
WQLObject PDM_BI_WorkTaskJob = WQLObject.getWQLObject("PDM_BI_WorkTaskJob");
|
||||
WQLObject PDM_BI_ProduceProcessRoute = WQLObject.getWQLObject("pdm_bi_productprocessroute");
|
||||
@@ -256,6 +257,11 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
if (jsonMst == null) {
|
||||
throw new BadRequestException(jo.getString("workorder_code") + "当前工令记录状态异常,操作失败!");
|
||||
}
|
||||
|
||||
JSONObject Formula = PDM_BI_Formula.query("workorder_id ='" + jo.getString("workorder_id") + "' and is_delete = '0' and is_audit='0' ").uniqueResult(0);
|
||||
if (Formula != null) {
|
||||
throw new BadRequestException(jo.getString("workorder_code") + "工令对应配方未审核,操作失败!");
|
||||
}
|
||||
String nowStatus = jsonMst.getString("status");
|
||||
JSONObject Route = PDM_BI_ProduceProcessRoute.query("is_delete='0' and productprocess_status='20' and material_id='" + jsonMst.getString("material_id") + "'").uniqueResult(0);
|
||||
if (Route == null) {
|
||||
|
||||
@@ -58,6 +58,14 @@ public class FormulaController {
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(formulaService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/audit")
|
||||
@Log("保存")
|
||||
@ApiOperation("保存")
|
||||
public ResponseEntity<Object> audit(@RequestBody JSONObject whereJson){
|
||||
formulaService.audit(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/cancel")
|
||||
@Log("保存")
|
||||
@ApiOperation("保存")
|
||||
|
||||
@@ -25,6 +25,11 @@ public interface FormulaService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
void cancel(JSONObject whereJson);
|
||||
/**
|
||||
* 编辑
|
||||
* @param whereJson /
|
||||
*/
|
||||
void audit(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 提交
|
||||
|
||||
@@ -66,6 +66,10 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
if (StrUtil.isNotEmpty(workorder_code)) {
|
||||
map.put("workorder_code", "%" + workorder_code + "%");
|
||||
}
|
||||
String formula_code = map.get("formula_code");
|
||||
if (StrUtil.isNotEmpty(formula_code)) {
|
||||
map.put("formula_code", "%" + formula_code + "%");
|
||||
}
|
||||
String pcsn = map.get("pcsn");
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
@@ -145,6 +149,30 @@ public class FormulaServiceImpl implements FormulaService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void audit(JSONObject whereJson) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
WQLObject PDM_BI_Formula = WQLObject.getWQLObject("PDM_BI_Formula");
|
||||
JSONArray rows = whereJson.getJSONArray("rows");
|
||||
for(int i=0;i<rows.size();i++){
|
||||
JSONObject jo = rows.getJSONObject(i);
|
||||
String formula_id = jo.getString("formula_id");
|
||||
JSONObject jo_old = PDM_BI_Formula.query("is_delete='0' and formula_id ='"+formula_id+"' and status='20'").uniqueResult(0);
|
||||
if(jo_old ==null){
|
||||
throw new BadRequestException("当前配方 "+jo.getString("formula_code")+"非提交状态,不可审核!");
|
||||
}
|
||||
jo_old.put("is_audit","1");
|
||||
jo_old.put("audit_id",currentUserId);
|
||||
jo_old.put("audit_name",nickName);
|
||||
jo_old.put("audit_time",now);
|
||||
PDM_BI_Formula.update(jo_old);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void submit(JSONObject whereJson) {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.formula_id TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.is_audit TYPEAS s_string
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
@@ -75,6 +76,9 @@
|
||||
OPTION 输入.status <> ""
|
||||
Formula.status = 输入.status
|
||||
ENDOPTION
|
||||
OPTION 输入.is_audit <> ""
|
||||
Formula.is_audit = 输入.is_audit
|
||||
ENDOPTION
|
||||
OPTION 输入.formula_code <> ""
|
||||
Formula.formula_code like 输入.formula_code
|
||||
ENDOPTION
|
||||
|
||||
@@ -7,6 +7,13 @@ export function cancel(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function audit(data) {
|
||||
return request({
|
||||
url: 'api/formula/audit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function submit(data) {
|
||||
return request({
|
||||
url: 'api/formula/submit',
|
||||
@@ -49,4 +56,4 @@ export function print(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { cancel, getform, submit, getView, pointCard, preview, print }
|
||||
export default { audit, cancel, getform, submit, getView, pointCard, preview, print }
|
||||
|
||||
@@ -90,6 +90,22 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否审核" prop="is_audit">
|
||||
<el-select
|
||||
v-model="form.is_audit"
|
||||
style="width: 210px"
|
||||
placeholder="是否审核"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_again_put"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="配粉槽" prop="storagevehicle_code">
|
||||
<label slot="label">配 粉 槽:</label>
|
||||
<el-input v-model="form.storagevehicle_code" disabled style="width: 210px" />
|
||||
|
||||
@@ -40,6 +40,15 @@
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配方编号">
|
||||
<el-input
|
||||
v-model="query.formula_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="配方编号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配方状态">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
@@ -56,15 +65,32 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
</el-form-item>
|
||||
<el-form-item label="是否审核">
|
||||
<el-select
|
||||
v-model="query.is_audit"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="是否审核"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_again_put"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
@@ -82,6 +108,17 @@
|
||||
>
|
||||
作废
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
:disabled="audit_flag"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="audit"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -161,16 +198,19 @@
|
||||
<el-table-column prop="detail_count" min-width="100" label="明细数"/>
|
||||
<el-table-column prop="masterbucket_qty" min-width="100" label="重量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="status" :formatter="stateFormat" min-width="80" label="状态" />
|
||||
<el-table-column prop="create_time" min-width="150" label="开单时间"/>
|
||||
<el-table-column prop="create_name" min-width="150" label="开单人"/>
|
||||
<el-table-column prop="update_time" min-width="150" label="修改时间"/>
|
||||
<el-table-column prop="update_optname" min-width="150" label="修改人"/>
|
||||
<el-table-column prop="start_time" min-width="150" label="开始时间"/>
|
||||
<el-table-column prop="start_name" min-width="150" label="开始人"/>
|
||||
<el-table-column prop="end_time" min-width="150" label="结束时间"/>
|
||||
<el-table-column prop="end_name" min-width="150" label="结束人"/>
|
||||
<el-table-column prop="add_time" min-width="150" label="补料时间"/>
|
||||
<el-table-column prop="add_name" min-width="150" label="补料人"/>
|
||||
<el-table-column prop="is_audit" :formatter="stateFormat2" min-width="80" label="是否审核" />
|
||||
<el-table-column prop="audit_time" min-width="140" label="审核时间"/>
|
||||
<el-table-column prop="audit_name" min-width="80" label="审核人"/>
|
||||
<el-table-column prop="create_time" min-width="140" label="开单时间"/>
|
||||
<el-table-column prop="create_name" min-width="80" label="开单人"/>
|
||||
<el-table-column prop="update_time" min-width="140" label="修改时间"/>
|
||||
<el-table-column prop="update_optname" min-width="80" label="修改人"/>
|
||||
<el-table-column prop="start_time" min-width="140" label="开始时间"/>
|
||||
<el-table-column prop="start_name" min-width="80" label="开始人"/>
|
||||
<el-table-column prop="end_time" min-width="140" label="结束时间"/>
|
||||
<el-table-column prop="end_name" min-width="80" label="结束人"/>
|
||||
<el-table-column prop="add_time" min-width="140" label="补料时间"/>
|
||||
<el-table-column prop="add_name" min-width="80" label="补料人"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -244,7 +284,7 @@ export default {
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['formula_status', 'workorder_type', 'product_series', 'bucket_type'],
|
||||
dicts: ['formula_status', 'workorder_type', 'product_series', 'bucket_type', 'is_again_put'],
|
||||
data() {
|
||||
return {
|
||||
dialogUpload: false,
|
||||
@@ -256,6 +296,7 @@ export default {
|
||||
},
|
||||
divShow: false,
|
||||
dissub_flag: true,
|
||||
audit_flag: true,
|
||||
change_flag: true,
|
||||
Export_flag: true,
|
||||
show_flag: true,
|
||||
@@ -301,6 +342,7 @@ export default {
|
||||
buttonChange(rows) {
|
||||
if (rows.length !== 0) {
|
||||
this.dissub_flag = false
|
||||
this.audit_flag = false
|
||||
this.change_flag = false
|
||||
this.Export_flag = false
|
||||
this.show_flag = false
|
||||
@@ -308,10 +350,13 @@ export default {
|
||||
if (rows[i].status !== '20') {
|
||||
this.dissub_flag = true
|
||||
}
|
||||
if (rows[i].status !== '20' || rows[i].is_audit !== '0') {
|
||||
this.audit_flag = true
|
||||
}
|
||||
if (rows[i].status === '99') {
|
||||
this.Export_flag = true
|
||||
}
|
||||
if (!'30,20'.includes(rows[i].status) || rows.length !== 1) {//后台校验首道工序
|
||||
if (!'30,20'.includes(rows[i].status) || rows.length !== 1) {
|
||||
this.change_flag = true
|
||||
}
|
||||
}
|
||||
@@ -322,6 +367,9 @@ export default {
|
||||
stateFormat(row) {
|
||||
return this.dict.label.formula_status[row.status]
|
||||
},
|
||||
stateFormat2(row) {
|
||||
return this.dict.label.is_again_put[row.is_audit]
|
||||
},
|
||||
bill_typeFormat(row) {
|
||||
return this.dict.label.workorder_type[row.workorder_type]
|
||||
},
|
||||
@@ -339,6 +387,7 @@ export default {
|
||||
this.checkrows = []
|
||||
this.mstrow = {}
|
||||
this.dissub_flag = true
|
||||
this.audit_flag = true
|
||||
this.change_flag = true
|
||||
this.Export_flag = true
|
||||
this.show_flag = true
|
||||
@@ -366,6 +415,17 @@ export default {
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
audit(){
|
||||
this.checkrows = this.$refs.table.selection
|
||||
if(this.checkrows.length === 0){
|
||||
this.crud.notify('请先选择需要审核的配方记录!')
|
||||
return false
|
||||
}
|
||||
formula.audit({'rows':this.checkrows}).then(res => {
|
||||
this.crud.notify('审核配方成功!')
|
||||
this.querytable()
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange()
|
||||
|
||||
Reference in New Issue
Block a user