Commit a36c960f by yubin
parents 9432eb8f 9e8d1b63
...@@ -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"> <Input
<FormItem label="入库单号:" class="form-item"> v-model="filters.inbound.inbound_no"
<Input placeholder="请输入入库单号:"
v-model="filters.inbound.inbound_no" class="mr10"
placeholder="请输入入库单号:" style="width: 200px"
class="form-input" />
/> <span>批次号:</span>
</FormItem> <Input
<FormItem label="批次号:" class="form-item"> v-model="filters.inbound.batch_no"
<Input placeholder="请输入批次号:"
v-model="filters.inbound.batch_no" class="mr10"
placeholder="请输入批次号:" style="width: 200px"
class="form-input" />
/> <span>开始时间:</span>
</FormItem> <DatePicker
<FormItem label="入库日期" class="form-item"> v-model="filters.inbound.startDate"
<DatePicker type="date"
v-model="inboundDateRange" format="yyyy-MM-dd"
type="daterange" value-format="yyyy-MM-dd"
range-separator="至" placeholder="请选择开始时间"
start-placeholder="开始日期" class="mr10"
end-placeholder="结束日期" style="width: 200px"
format="yyyy-MM-dd" />
value-format="yyyy-MM-dd" <span>结束时间:</span>
clearable <DatePicker
/> v-model="filters.inbound.endDate"
</FormItem> type="date"
<FormItem label="入库类型:" class="form-item"> format="yyyy-MM-dd"
<Select value-format="yyyy-MM-dd"
v-model="filters.inbound.inbound_type" placeholder="请选择结束时间"
placeholder="请选择入库类型" class="mr10"
class="form-input" style="width: 200px"
> />
<Option :value='1'>手工入库</Option> <br>
<Option :value='2'>归还入库</Option> <span>入库类型:</span>
</Select> <Select
</FormItem> v-model="filters.inbound.inbound_type"
<FormItem label="入库类型:" class="form-item"> placeholder="请选择入库类型"
<Select class="mr10"
v-model="filters.inbound.inbound_status" style="width: 200px"
placeholder="请选择入库类型" >
class="form-input" <Option :value='1'>手工入库</Option>
> <Option :value='2'>归还入库</Option>
<Option :value='0'>待入库</Option> </Select>
<Option :value='1'>已入库</Option> <span>入库状态:</span>
</Select> <Select
</FormItem> v-model="filters.inbound.inbound_status"
<FormItem class="form-item-actions"> placeholder="请选择入库状态"
<Button type="primary" @click="handleSearch('inbound')">搜索</Button> class="mr10"
<Button @click="handleReset('inbound')" style="margin-left: 8px;">重置</Button> style="width: 200px"
</FormItem> >
</Form> <Option :value='0'>待入库</Option>
</div> <Option :value='1'>已入库</Option>
</Select>
</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"> <Input
<FormItem label="申请单号:" class="form-item"> v-model="filters.return.department_name"
<Input placeholder="请输入部门"
v-model="filters.return.application_no" class="mr10"
placeholder="请输入申请单号" style="width: 200px"
class="form-input" />
/> <span>申领人:</span>
</FormItem> <Input
<FormItem label="申请人:" class="form-item"> v-model="filters.return.applicant_name"
<Input placeholder="请输入申请人"
v-model="filters.return.applicant_name" class="mr10"
placeholder="请输入申请人" style="width: 200px"
class="form-input" />
/> </Col>
</FormItem> <Col span="6" class="action-col">
<FormItem class="form-item-actions"> <Button type="primary" class="mr10" @click="handleSearch('return')">搜索</Button>
<Button type="primary" @click="handleSearch('return')">搜索</Button> <Button type="primary" class="mr10" @click="handleReset('return')" >重置</Button>
<Button @click="handleReset('return')" style="margin-left: 8px;">重置</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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论