add:库存查看
This commit is contained in:
@@ -386,3 +386,15 @@ export function downloadFile(obj, name, suffix) {
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
}
|
||||
export function downloadFile2(data, name) {
|
||||
debugger
|
||||
let blob = new Blob([data],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8'});
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
let link = document.createElement('a');
|
||||
link.style.display = 'none';
|
||||
link.href = url;
|
||||
link.setAttribute('download', name+'.xlsx');
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,63 +20,20 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="变动日期" prop="analyseData">
|
||||
<el-date-picker
|
||||
v-model="query.datepick"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<!--表单组件-->
|
||||
<!-- <el-dialog-->
|
||||
<!-- :close-on-click-modal="false"-->
|
||||
<!-- :before-close="crud.cancelCU"-->
|
||||
<!-- :visible.sync="crud.status.cu > 0"-->
|
||||
<!-- :title="crud.status.title"-->
|
||||
<!-- width="500px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">-->
|
||||
<!-- <el-form-item label="仓位编码" prop="struct_code">-->
|
||||
<!-- <el-input v-model="form.struct_code" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型描述">-->
|
||||
<!-- <el-input v-model="form.description" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型KEY">-->
|
||||
<!-- <el-input v-model="form.model_key" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型注释">-->
|
||||
<!-- <el-input v-model="form.model_comment" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item v-if="crud.status.edit" label="版本号">-->
|
||||
<!-- <el-input disabled v-model="form.version" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型数据">-->
|
||||
<!-- <el-input v-model="form.model_editor_json" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型封面">-->
|
||||
<!-- <el-input v-model="form.thumbnail" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型类型">-->
|
||||
<!-- <el-input v-model="form.model_type" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="单据类型">-->
|
||||
<!-- <el-select v-model="form.form_type" placeholder="请选择" style="width: 370px;">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in formTypes"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="归属租户">-->
|
||||
<!-- <el-input v-model="form.tenant_id" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="text" @click="crud.cancelCU">取消</el-button>-->
|
||||
<!-- <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
@@ -182,7 +139,15 @@ export default {
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
if (this.query.datepick){
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length>1){
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
}else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
@@ -65,63 +66,30 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="analyseData">
|
||||
<el-date-picker
|
||||
v-model="query.datepick"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-s-operation"
|
||||
@click="downloadMethod"
|
||||
>
|
||||
导出库存
|
||||
</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<!-- <el-dialog-->
|
||||
<!-- :close-on-click-modal="false"-->
|
||||
<!-- :before-close="crud.cancelCU"-->
|
||||
<!-- :visible.sync="crud.status.cu > 0"-->
|
||||
<!-- :title="crud.status.title"-->
|
||||
<!-- width="500px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">-->
|
||||
<!-- <el-form-item label="仓位编码" prop="struct_code">-->
|
||||
<!-- <el-input v-model="form.struct_code" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型描述">-->
|
||||
<!-- <el-input v-model="form.description" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型KEY">-->
|
||||
<!-- <el-input v-model="form.model_key" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型注释">-->
|
||||
<!-- <el-input v-model="form.model_comment" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item v-if="crud.status.edit" label="版本号">-->
|
||||
<!-- <el-input disabled v-model="form.version" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型数据">-->
|
||||
<!-- <el-input v-model="form.model_editor_json" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型封面">-->
|
||||
<!-- <el-input v-model="form.thumbnail" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="模型类型">-->
|
||||
<!-- <el-input v-model="form.model_type" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="单据类型">-->
|
||||
<!-- <el-select v-model="form.form_type" placeholder="请选择" style="width: 370px;">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in formTypes"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="归属租户">-->
|
||||
<!-- <el-input v-model="form.tenant_id" style="width: 370px;"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="text" @click="crud.cancelCU">取消</el-button>-->
|
||||
<!-- <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
@@ -135,7 +103,7 @@
|
||||
<el-table-column prop="material_code" label="物料编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="material_name" label="物料名称" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="parent_vehicle_code" label="父载具编码" width="150" show-tooltip-when-overflow />
|
||||
<!-- <el-table-column prop="parent_vehicle_code" label="父载具编码" width="150" show-tooltip-when-overflow />-->
|
||||
<el-table-column prop="pcsn" label="批次" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="qty" label="总库存" min-width="150" show-tooltip-when-overflow />
|
||||
<el-table-column prop="frozen_qty" label="冻结库存" show-tooltip-when-overflow />
|
||||
@@ -145,7 +113,7 @@
|
||||
<el-table-column prop="lock_type" label="库存锁定" show-tooltip-when-overflow>
|
||||
<template slot-scope="scope">{{ statusEnum.label.LOCK[scope.row.lock_type] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="update_time" label="修改时间" width="120" show-tooltip-when-overflow />
|
||||
<el-table-column prop="create_time" label="组盘入库时间" width="120" show-tooltip-when-overflow />
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="操作"-->
|
||||
<!-- fixed="right"-->
|
||||
@@ -170,6 +138,8 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import structattr from './structattr'
|
||||
import { downloadFile,downloadFile2 } from '@/utils/index'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
@@ -217,7 +187,39 @@ export default {
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.query.datepick){
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length>1){
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
}else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
return true
|
||||
},
|
||||
downloadMethod() {
|
||||
if (this.query.datepick){
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
if (this.query.datepick.length>1){
|
||||
this.query.end_time = this.query.datepick[1]
|
||||
}
|
||||
}else {
|
||||
this.query.start_time = ''
|
||||
this.query.end_time = ''
|
||||
}
|
||||
structattr.exportFile(this.query).then(res => {
|
||||
const url = window.URL.createObjectURL(new Blob([res]))
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
const fileName = new Date() + '-' + '库存' + '.xlsx'
|
||||
link.setAttribute('download', fileName)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
this.crud.notify('导出成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,15 @@ export function confirmTask(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function exportFile(data) {
|
||||
return request({
|
||||
url: '/api/structattr/exportFile',
|
||||
method: 'post',
|
||||
renponseType: 'blob',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
@@ -111,5 +120,6 @@ export default {
|
||||
inDecision,
|
||||
cancelDecision,
|
||||
taskOpen,
|
||||
confirm
|
||||
confirm,
|
||||
exportFile
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user