修改
This commit is contained in:
@@ -32,7 +32,7 @@ public class RawAssistIStorController {
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(rawAssistIStorService.pageQuery(whereJson,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@Log("删除出入库单")
|
||||
@ApiOperation("删除出入库单")
|
||||
//@PreAuthorize("@el.check('sectattr:del')")
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/inandoutreturn',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/inandoutreturn/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/inandoutreturn',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function upload(data) {
|
||||
return request({
|
||||
url: '/api/inandoutreturn/upload',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function upload2(data) {
|
||||
return request({
|
||||
url: '/api/inandoutreturn/upload2',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function disupload(data) {
|
||||
return request({
|
||||
url: '/api/inandoutreturn/disupload',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, upload, upload2, disupload }
|
||||
466
lms/nladmin-ui/src/views/wms/st/inAndOutReturn/index.vue
Normal file
466
lms/nladmin-ui/src/views/wms/st/inAndOutReturn/index.vue
Normal file
@@ -0,0 +1,466 @@
|
||||
<template>
|
||||
<div v-loading.fullscreen.lock="fullscreenLoading" 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-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出入类型">
|
||||
<el-select
|
||||
v-model="query.io_type"
|
||||
size="mini"
|
||||
disabled
|
||||
placeholder="出入类型"
|
||||
class="filter-item"
|
||||
@change="ioTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.io_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="业务类型">
|
||||
<el-select
|
||||
v-model="query.bill_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in billtypelist"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.io_bill_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<el-input
|
||||
v-model="query.material_search"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="物料"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</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>
|
||||
<el-form-item label="模糊查询">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="出入库单号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否回传">
|
||||
<el-select
|
||||
v-model="query.is_upload"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="是否回传"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_upload"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</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"
|
||||
@click="upload"
|
||||
>
|
||||
回传
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="uploadMES"
|
||||
>
|
||||
回传mes
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="uploadSAP"
|
||||
>
|
||||
回传sap
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="disupload"
|
||||
>
|
||||
不回传
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
show-summary
|
||||
:summary-method="getSum"
|
||||
:highlight-current-row="true"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="is_upload" label="是否回传" :formatter="formatIsUpload" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stor_name" label="仓库" width="100" />
|
||||
<el-table-column min-width="130" show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
|
||||
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
:formatter="create_modeFormat"
|
||||
prop="create_mode"
|
||||
label="生成方式"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column label="明细数" align="center" prop="detail_count" width="100" />
|
||||
<el-table-column prop="total_qty" label="总重量" width="100" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" width="100" />
|
||||
<el-table-column prop="input_optname" label="制单人" width="100" />
|
||||
<el-table-column show-overflow-tooltip prop="input_time" label="制单时间" width="150" />
|
||||
<el-table-column prop="update_optname" label="修改人" width="100" />
|
||||
<el-table-column show-overflow-tooltip prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column prop="confirm_optname" label="审核人" width="100" />
|
||||
<el-table-column show-overflow-tooltip prop="confirm_time" label="审核时间" width="150" />
|
||||
<el-table-column prop="upload_name" label="回传人" width="100" />
|
||||
<el-table-column prop="upload_time" label="回传时间" width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import inandoutreturn from '@/views/wms/st/inAndOutReturn/inandoutreturn'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
import ViewDialog from '@/views/wms/st/inbill/ViewDialog'
|
||||
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
||||
|
||||
export default {
|
||||
name: 'Return',
|
||||
components: { crudOperation, rrOperation, pagination, ViewDialog },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '出入库单报表', idField: 'iostorinv_id', url: 'api/inandoutreturn', crudMethod: { ...inandoutreturn },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'io_type', 'is_upload'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
fullscreenLoading: false,
|
||||
storlist: [],
|
||||
billtypelist: []
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
crudRawAssist.getType({ 'io_code': '' }).then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
},
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
bill_typeFormat(row) {
|
||||
for (const item of this.billtypelist) {
|
||||
if (item.code === row.bill_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
create_modeFormat(row) {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
upload() {
|
||||
const res = this.$refs.table.selection
|
||||
if (!res || res.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const upload_flag = res.some(row => row.is_upload === '1')
|
||||
if (upload_flag) {
|
||||
this.$confirm('存在已经回传的单据, 是否继续回传?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.fullscreenLoading = true
|
||||
const data = {}
|
||||
data.rows = res
|
||||
inandoutreturn.upload(data).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('单据回传成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消回传'
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.fullscreenLoading = true
|
||||
const data = {}
|
||||
data.rows = res
|
||||
inandoutreturn.upload(data).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('单据回传成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
disupload() {
|
||||
const res = this.$refs.table.selection
|
||||
if (!res || res.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
const data = {}
|
||||
data.rows = res
|
||||
inandoutreturn.disupload(data).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
disuploadSAP() {
|
||||
const res = this.$refs.table.selection
|
||||
if (!res || res.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
const data = {}
|
||||
data.rows = res
|
||||
inandoutreturn.disupload(data).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
disuploadMES() {
|
||||
const res = this.$refs.table.selection
|
||||
if (!res || res.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.fullscreenLoading = true
|
||||
const data = {}
|
||||
data.rows = res
|
||||
inandoutreturn.disupload(data).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
},
|
||||
ioTypeChange(value) {
|
||||
if (value === '1') {
|
||||
crudRawAssist.getType({ 'io_code': '', 'io_flag': '01' }).then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
} else {
|
||||
crudRawAssist.getType({ 'io_code': '', 'io_flag': '00' }).then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatIsUpload(row) {
|
||||
if (row.is_upload === '0') {
|
||||
return '否'
|
||||
} else if (row.is_upload === '1') {
|
||||
return '是'
|
||||
}
|
||||
},
|
||||
getSum(param) {
|
||||
// 将所有number的字段合计
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
let values = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
values = data.map(item => Number(item[column.property]))
|
||||
if (column.property === 'total_qty') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'detail_count') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(0) // 保留三位小数
|
||||
} else {
|
||||
sums[index] = '--'
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user