rev:增加库存等级修改功能
This commit is contained in:
@@ -944,6 +944,8 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
||||
//500*0.35
|
||||
double a = NumberUtil.mul(masterbucket_qty, liquid_rate);
|
||||
|
||||
|
||||
|
||||
data2.put("value", NumberUtil.round(NumberUtil.sub(a, QM006_qty), 3));
|
||||
}
|
||||
//卸料酒精每次加量设定值:开单重量*工艺参数"每次卸料酒精加量(改为比例)"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.statistics.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -9,10 +10,7 @@ import org.nl.wms.statistics.service.IvtQueryService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -57,4 +55,12 @@ public class IvtQueryController {
|
||||
ivtQueryService.download(whereJson, response);
|
||||
}
|
||||
|
||||
@PostMapping("/updateIvt")
|
||||
@Log("更新库存记录")
|
||||
@ApiOperation("更新库存记录")
|
||||
public ResponseEntity<Object> updateIvt(@RequestBody JSONObject whereJson) {
|
||||
ivtQueryService.updateIvt(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.statistics.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -41,4 +42,13 @@ public interface IvtQueryService {
|
||||
Map<String, Object> bagQuery(Map whereJson, Pageable page);
|
||||
|
||||
void download(Map whereJson, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 更新库存记录
|
||||
* @param whereJson {
|
||||
* pcsn: 批次
|
||||
* ivt_level: 库存等级
|
||||
* }
|
||||
*/
|
||||
void updateIvt(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -7,13 +7,16 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.utils.FileUtil;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.statistics.service.IvtQueryService;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -195,4 +198,27 @@ public class IvtQueryServiceImpl implements IvtQueryService {
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateIvt(JSONObject whereJson) {
|
||||
String pcsn = whereJson.getString("pcsn");
|
||||
String ivt_level = whereJson.getString("ivt_level");
|
||||
if (ObjectUtil.isEmpty(pcsn)) {
|
||||
throw new BadRequestException("批次不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(ivt_level)) {
|
||||
throw new BadRequestException("库存等级不能为空!");
|
||||
}
|
||||
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
|
||||
WQLObject buckTab = WQLObject.getWQLObject("md_pb_bucketrecord");
|
||||
// 更新库存等级
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
jsonParam.put("ivt_level",ivt_level);
|
||||
ivtTab.update(jsonParam, "pcsn = '"+pcsn+"'");
|
||||
|
||||
// 更新桶记录等级
|
||||
buckTab.update(jsonParam, "pcsn = '"+pcsn+"'");
|
||||
}
|
||||
}
|
||||
|
||||
35
mes/qd/src/api/wms/statistics/updateIvt.js
Normal file
35
mes/qd/src/api/wms/statistics/updateIvt.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/ivtQuery',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/ivtQuery/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/ivtQuery',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateIvt(data) {
|
||||
return request({
|
||||
url: 'api/ivtQuery/updateIvt',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, updateIvt }
|
||||
@@ -180,6 +180,7 @@ export default {
|
||||
}
|
||||
},
|
||||
tableChanged(rows) {
|
||||
debugger
|
||||
let flag1 = true
|
||||
if (rows.length > 0) {
|
||||
let sum = 0.0
|
||||
@@ -189,7 +190,7 @@ export default {
|
||||
if (rows[i].device_code.includes('PWT')) {
|
||||
if (flag1) {
|
||||
sum = sum + parseFloat(rows[i].device_capacity_qty)
|
||||
flag1 = false
|
||||
// flag1 = false
|
||||
}
|
||||
} else {
|
||||
sum = sum + parseFloat(rows[i].device_capacity_qty)
|
||||
|
||||
134
mes/qd/src/views/wms/statistics/ivtQuery/UpdateIvtDialog.vue
Normal file
134
mes/qd/src/views/wms/statistics/ivtQuery/UpdateIvtDialog.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="修改库存等级"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="600px"
|
||||
@close="close"
|
||||
>
|
||||
<div class="head-container">
|
||||
<el-form
|
||||
size="mini"
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料批次">
|
||||
<el-input
|
||||
v-model="form2.pcsn"
|
||||
clearable
|
||||
placeholder="物料批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存等级">
|
||||
<el-select
|
||||
v-model="form2.ivt_level"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="库存等级"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_IVT_LEVEL"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="24" style="padding-top: 20px">
|
||||
<el-col :span="16" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" @click="updateIvt">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { presenter, header } from '@crud/crud'
|
||||
import updateIvt from '@/api/wms/statistics/updateIvt'
|
||||
|
||||
export default {
|
||||
name: 'UpdateIvtDialog',
|
||||
dicts: ['ST_IVT_LEVEL'],
|
||||
components: {},
|
||||
mixins: [presenter(), header()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
form2: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.form2 = {}
|
||||
},
|
||||
updateIvt() {
|
||||
if (!this.form2.pcsn) {
|
||||
this.crud.notify('物料批次不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (!this.form2.ivt_level) {
|
||||
this.crud.notify('库存等级不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
|
||||
updateIvt.updateIvt(this.form2).then(res => {
|
||||
this.close()
|
||||
this.$parent.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -144,6 +144,16 @@
|
||||
>
|
||||
导出Excel
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="updateIvt"
|
||||
>
|
||||
修改库存等级
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<!--表格渲染-->
|
||||
@@ -191,6 +201,7 @@
|
||||
<pagination />
|
||||
</div>
|
||||
<BucketDialog :dialog-show.sync="bucketDialog" :open-param="openParam" />
|
||||
<UpdateIvtDialog :dialog-show.sync="updateIvtDialogShow" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -202,6 +213,7 @@ import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import BucketDialog from '@/views/wms/statistics/ivtQuery/BucketDialog'
|
||||
import UpdateIvtDialog from '@/views/wms/statistics/ivtQuery/UpdateIvtDialog'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
@@ -213,7 +225,7 @@ import crudBucketrecord from '@/api/wms/basedata/master/bucketrecord'
|
||||
export default {
|
||||
name: 'IvtQuery',
|
||||
dicts: ['ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_usable'],
|
||||
components: { pagination, rrOperation, crudOperation, BucketDialog, Treeselect },
|
||||
components: { pagination, rrOperation, crudOperation, BucketDialog, Treeselect, UpdateIvtDialog },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -240,6 +252,7 @@ export default {
|
||||
return {
|
||||
sects: [],
|
||||
classes: [],
|
||||
updateIvtDialogShow: false,
|
||||
permission: {
|
||||
},
|
||||
class_idStr: null,
|
||||
@@ -349,6 +362,12 @@ export default {
|
||||
this.crud.toQuery()
|
||||
})
|
||||
})
|
||||
},
|
||||
updateIvt() {
|
||||
this.updateIvtDialogShow = true
|
||||
},
|
||||
toQuery() {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user