Commit 9e8d1b63 by zhangtw

入库页面调整

parent c02ff50e
...@@ -4,64 +4,67 @@ ...@@ -4,64 +4,67 @@
<TabPane label="办公用品入库" name="inbound"> <TabPane label="办公用品入库" name="inbound">
<div class="search-div"> <div class="search-div">
<Row type="flex" :gutter="16"> <Row type="flex" :gutter="16">
<Col span="20"> <Col span="18">
<div class="search-form"> <span>入库单号:</span>
<Form :inline="true" :model="filters.return" class="form-inline">
<FormItem label="入库单号:" class="form-item">
<Input <Input
v-model="filters.inbound.inbound_no" v-model="filters.inbound.inbound_no"
placeholder="请输入入库单号:" placeholder="请输入入库单号:"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> <span>批次号:</span>
<FormItem label="批次号:" class="form-item">
<Input <Input
v-model="filters.inbound.batch_no" v-model="filters.inbound.batch_no"
placeholder="请输入批次号:" placeholder="请输入批次号:"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> <span>开始时间:</span>
<FormItem label="入库日期" class="form-item">
<DatePicker <DatePicker
v-model="inboundDateRange" v-model="filters.inbound.startDate"
type="daterange" type="date"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
clearable placeholder="请选择开始时间"
class="mr10"
style="width: 200px"
/> />
</FormItem> <span>结束时间:</span>
<FormItem label="入库类型:" class="form-item"> <DatePicker
v-model="filters.inbound.endDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="请选择结束时间"
class="mr10"
style="width: 200px"
/>
<br>
<span>入库类型:</span>
<Select <Select
v-model="filters.inbound.inbound_type" v-model="filters.inbound.inbound_type"
placeholder="请选择入库类型" placeholder="请选择入库类型"
class="form-input" class="mr10"
style="width: 200px"
> >
<Option :value='1'>手工入库</Option> <Option :value='1'>手工入库</Option>
<Option :value='2'>归还入库</Option> <Option :value='2'>归还入库</Option>
</Select> </Select>
</FormItem> <span>入库状态:</span>
<FormItem label="入库类型:" class="form-item">
<Select <Select
v-model="filters.inbound.inbound_status" v-model="filters.inbound.inbound_status"
placeholder="请选择入库类型" placeholder="请选择入库状态"
class="form-input" class="mr10"
style="width: 200px"
> >
<Option :value='0'>待入库</Option> <Option :value='0'>待入库</Option>
<Option :value='1'>已入库</Option> <Option :value='1'>已入库</Option>
</Select> </Select>
</FormItem>
<FormItem class="form-item-actions">
<Button type="primary" @click="handleSearch('inbound')">搜索</Button>
<Button @click="handleReset('inbound')" style="margin-left: 8px;">重置</Button>
</FormItem>
</Form>
</div>
</Col> </Col>
<Col span="4" class="text-right"> <Col span="6" class="text-right">
<Button type="success" @click="openInboundModal">新增入库</Button> <Button type="primary" class="mr10" @click="handleSearch('inbound')">搜索</Button>
<Button type="primary" class="mr10" @click="handleReset('inbound')">重置</Button>
<Button type="primary" class="mr10" @click="openInboundModal">新增入库</Button>
</Col> </Col>
</Row> </Row>
</div> </div>
...@@ -84,29 +87,25 @@ ...@@ -84,29 +87,25 @@
<TabPane label="办公用品归还" name="return"> <TabPane label="办公用品归还" name="return">
<div class="search-div"> <div class="search-div">
<Row type="flex" :gutter="16"> <Row type="flex" :gutter="16">
<Col span="10"> <Col span="18">
<div class="search-form"> <span>部门:</span>
<Form :inline="true" :model="filters.return" class="form-inline">
<FormItem label="申请单号:" class="form-item">
<Input <Input
v-model="filters.return.application_no" v-model="filters.return.department_name"
placeholder="请输入申请单号" placeholder="请输入部门"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> <span>申领人:</span>
<FormItem label="申请人:" class="form-item">
<Input <Input
v-model="filters.return.applicant_name" v-model="filters.return.applicant_name"
placeholder="请输入申请人" placeholder="请输入申请人"
class="form-input" class="mr10"
style="width: 200px"
/> />
</FormItem> </Col>
<FormItem class="form-item-actions"> <Col span="6" class="action-col">
<Button type="primary" @click="handleSearch('return')">搜索</Button> <Button type="primary" class="mr10" @click="handleSearch('return')">搜索</Button>
<Button @click="handleReset('return')" style="margin-left: 8px;">重置</Button> <Button type="primary" class="mr10" @click="handleReset('return')" >重置</Button>
</FormItem>
</Form>
</div>
</Col> </Col>
</Row> </Row>
</div> </div>
...@@ -122,10 +121,25 @@ ...@@ -122,10 +121,25 @@
<TabPane label="库存查询" name="inventory"> <TabPane label="库存查询" name="inventory">
<div class="search-div"> <div class="search-div">
<Row type="flex" :gutter="16"> <Row type="flex" :gutter="16">
<Col span="10"> <Col span="18">
<Input v-model="filters.inventory.material_name" placeholder="物料名称/编码" style="width:60%" /> <span>物料编码:</span>
<Input
v-model="filters.inventory.material_code"
placeholder="请输入物料编码"
class="mr10"
style="width: 200px"
/>
<span>物料名称:</span>
<Input
v-model="filters.inventory.material_name"
placeholder="请输入物料名称"
class="mr10"
style="width: 200px"
/>
</Col>
<Col span="6" class="action-col">
<Button type="primary" class="mr10" @click="handleSearch('inventory')">搜索</Button> <Button type="primary" class="mr10" @click="handleSearch('inventory')">搜索</Button>
<Button @click="handleReset('inventory')">重置</Button> <Button type="primary" class="mr10" @click="handleReset('inventory')">重置</Button>
</Col> </Col>
</Row> </Row>
</div> </div>
...@@ -283,9 +297,26 @@ export default { ...@@ -283,9 +297,26 @@ export default {
], ],
returnColumns: [ returnColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' }, { type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申请人', key: 'applicant_name', align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' }, { title: '部门', key: 'department_name', align: 'center' },
// { title: '申请单号', key: 'application_no', align: 'center' },
{ title: '申领人', key: 'applicant_name', align: 'center' },
{ title: '申领用途', key: 'borrow_purpose', align: 'center' },
{
title: '提交审批时间',
key: 'submit_time',
align: 'center',
render: (h, { row }) => {
return h('span', this.formatDateTime(row.submit_time) || '-')
}
},
{
title: '审批通过时间',
key: 'approval_time',
align: 'center',
render: (h, { row }) => {
return h('span', this.formatDateTime(row.approval_time) || '-')
}
},
{ {
title: '发放状态', title: '发放状态',
key: 'issue_status', key: 'issue_status',
...@@ -425,17 +456,7 @@ export default { ...@@ -425,17 +456,7 @@ export default {
detailModal: { visible: false, loading: false, data: {}, details: [], logs: [] } detailModal: { visible: false, loading: false, data: {}, details: [], logs: [] }
} }
}, },
watch: { watch: {},
inboundDateRange (newVal) {
if (newVal && Array.isArray(newVal)) {
this.filters.inbound.startDate = normalizeVisitTimeValue(newVal[0])
this.filters.inbound.endDate = normalizeVisitTimeValue(newVal[1])
} else {
this.filters.inbound.startDate = null
this.filters.inbound.endDate = null
}
}
},
created () { this.fetchList('inbound') }, created () { this.fetchList('inbound') },
methods: { methods: {
// 获取当天日期,格式为 yyyy-MM-dd // 获取当天日期,格式为 yyyy-MM-dd
...@@ -455,7 +476,20 @@ export default { ...@@ -455,7 +476,20 @@ export default {
const apiMap = { inbound: getInboundList, return: getPendingReturnList, inventory: getInventoryList } const apiMap = { inbound: getInboundList, return: getPendingReturnList, inventory: getInventoryList }
const api = apiMap[tab]; if (!api) return const api = apiMap[tab]; if (!api) return
this.loading[tab] = true this.loading[tab] = true
const payload = Object.assign({}, this.pagers[tab] || {}, { params: this.filters[tab] || {} }) // 清理空值,防止参数传递问题
const cleanParams = (obj) => {
obj.startDate = normalizeVisitTimeValue(obj.startDate)
obj.endDate = normalizeVisitTimeValue(obj.endDate)
const cleaned = {}
for (let key in obj) {
const value = obj[key]
if (value !== null && value !== undefined && value !== '') {
cleaned[key] = value
}
}
return cleaned
}
const payload = Object.assign({}, this.pagers[tab] || {}, { params: cleanParams(this.filters[tab]) || {} })
api(payload).then(ret => { api(payload).then(ret => {
if (ret.data && ret.data.errcode === 0) { if (ret.data && ret.data.errcode === 0) {
const data = ret.data.data || {} const data = ret.data.data || {}
......
...@@ -628,10 +628,8 @@ export default { ...@@ -628,10 +628,8 @@ export default {
this.loading[tab] = true this.loading[tab] = true
// 清理空值,防止参数传递问题 // 清理空值,防止参数传递问题
const cleanParams = (obj) => { const cleanParams = (obj) => {
console.log(obj)
obj.startDate = normalizeVisitTimeValue(obj.startDate) obj.startDate = normalizeVisitTimeValue(obj.startDate)
obj.endDate = normalizeVisitTimeValue(obj.endDate) obj.endDate = normalizeVisitTimeValue(obj.endDate)
console.log(obj)
const cleaned = {} const cleaned = {}
for (let key in obj) { for (let key in obj) {
const value = obj[key] const value = obj[key]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论