add:日库存
This commit is contained in:
@@ -13,10 +13,7 @@ import org.nl.wms.masterdata_manage.storage.service.storage.dto.SectattrQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -40,12 +37,19 @@ public class StIvtStructivtDailyController {
|
||||
public ResponseEntity<Object> query(DailyStructivtQuery query, PageQuery page){
|
||||
return new ResponseEntity<>(TableDataInfo.build(stIvtStructivtDailyService.page(page.build(),query.build())),HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/sync")
|
||||
@PostMapping("/sync")
|
||||
@Log("同步日库区")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> sync(String[] structivts){
|
||||
public ResponseEntity<Object> sync(@RequestBody String[] structivts){
|
||||
stIvtStructivtDailyService.dailyStructivt(structivts);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
// @GetMapping("/download")
|
||||
// @Log("导出数据")
|
||||
// @SaIgnore
|
||||
// public ResponseEntity<Object> download(){
|
||||
// return new ResponseEntity<>(HttpStatus.OK);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class StIvtStructivtDailyServiceImpl extends ServiceImpl<StIvtStructivtDa
|
||||
@Override
|
||||
@Transactional
|
||||
public void dailyStructivt(String... structivts) {
|
||||
if (structivts.length == 0){
|
||||
if (structivts==null || structivts.length == 0){
|
||||
return;
|
||||
}
|
||||
ArrayList<StIvtStructivtDaily> list = new ArrayList<>();
|
||||
|
||||
@@ -53,11 +53,11 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="PCL型号" disabled prop="plc_model">
|
||||
<label slot="label">PCL型号:</label>
|
||||
<el-input v-model.trim="form.plc_model" clearable style="width: 210px" />
|
||||
<el-input v-model.trim="form.plc_model" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="功率" disabled prop="manufacturer">
|
||||
<label slot="label">功率:</label>
|
||||
<el-input v-model.trim="form.power" clearable style="width: 210px" />
|
||||
<el-input v-model.trim="form.power" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出厂编号" prop="leavefactory_number">
|
||||
<label slot="label">出厂编号:</label>
|
||||
|
||||
@@ -272,19 +272,29 @@ export default {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
if (form.material_type_id != null) {
|
||||
this.getSubTypes(form.material_type_id)
|
||||
if (form.class_id != null) {
|
||||
this.getSubTypes({'id':form.class_id,'parent_id':"1704039126057226240"})
|
||||
} else {
|
||||
this.getClass()
|
||||
}
|
||||
},
|
||||
getSubTypes(id) {
|
||||
crudClassstandard.getClassSuperior(id).then(res => {
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
getClass() {
|
||||
//queryClassById?class_idStr=1528555443906023424
|
||||
crudClassstandard.queryClassById({ enabled: true, 'class_idStr': '1704039126057226240' }).then(res => {
|
||||
|
||||
@@ -268,19 +268,29 @@ export default {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
if (form.material_type_id != null) {
|
||||
this.getSubTypes(form.material_type_id)
|
||||
if (form.class_id != null) {
|
||||
this.getSubTypes({'id':form.class_id,'parent_id':"1704039126057226240"})
|
||||
} else {
|
||||
this.getClass()
|
||||
}
|
||||
},
|
||||
getSubTypes(id) {
|
||||
crudClassstandard.getClassSuperior(id).then(res => {
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
getClass() {
|
||||
crudClassstandard.queryClassById({ enabled: true, 'class_idStr': '1704039126057226240' }).then(res => {
|
||||
this.classes = res.content.map(function(obj) {
|
||||
|
||||
@@ -15,6 +15,13 @@ export function del(ids) {
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
export function sync(param) {
|
||||
return request({
|
||||
url: 'api/structivtDaily/sync',
|
||||
method: 'post',
|
||||
param
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
@@ -23,4 +30,4 @@ export function edit(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del }
|
||||
export default { add, edit, del,sync }
|
||||
|
||||
@@ -32,7 +32,30 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="confirm_flag"
|
||||
@click="sync"
|
||||
>
|
||||
同步
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="confirm_flag"-->
|
||||
<!-- @click="sync"-->
|
||||
<!-- >-->
|
||||
<!-- 导出-->
|
||||
<!-- </el-button>-->
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -72,6 +95,8 @@ import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
struct_id: null,
|
||||
@@ -150,6 +175,7 @@ export default {
|
||||
return {
|
||||
measure_unit:[],
|
||||
sects: [],
|
||||
downloadLoading: false,
|
||||
permission: {
|
||||
add: ['admin', 'dept:add'],
|
||||
edit: ['admin', 'dept:edit'],
|
||||
@@ -167,6 +193,24 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
sync(){
|
||||
dailyStructivt.sync({'structivts':'st_ivt_structivt_bcp'}).then(result => {
|
||||
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => { })
|
||||
},
|
||||
downloadMethod() {
|
||||
this.beforeInit()
|
||||
this.downloadLoading = true
|
||||
download(this.url + '/download', this.params).then(result => {
|
||||
this.downloadFile(result, this.title + '数据', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
},
|
||||
beforeInit() {
|
||||
return true
|
||||
},
|
||||
sectChange(val) {
|
||||
this.form.sect_id = val[1]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user