Commit 2a43f0f0 by zhangtw

页面调整

parent 00ac51a9
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
<DatePicker v-model="usageStart" type="date" style="min-width:110px;margin-right:20px" /> <DatePicker v-model="usageStart" type="date" style="min-width:110px;margin-right:20px" />
<span>结束:</span> <span>结束:</span>
<DatePicker v-model="usageEnd" type="date" style="min-width:110px;margin-right:20px" /> <DatePicker v-model="usageEnd" type="date" style="min-width:110px;margin-right:20px" />
<span>用品:</span> <span>用品编码:</span>
<Input v-model="usageMaterial" placeholder="用品名称或编码" style="width: 150px" /> <Input v-model="usageMaterialCode" placeholder="请输入用品编码" style="width: 150px;margin-right:20px" />
<span>用品名称:</span>
<Input v-model="usageMaterialName" placeholder="请输入用品名称" style="width: 150px;margin-right:20px" />
</Col> </Col>
<Col :span="4" class="text-right"> <Col :span="4" class="text-right">
<Button type="primary" class="mr10" @click="loadUsage">统计</Button> <Button type="primary" class="mr10" @click="loadUsage">统计</Button>
...@@ -68,7 +70,8 @@ export default { ...@@ -68,7 +70,8 @@ export default {
activeTab: 'usage', activeTab: 'usage',
usageStart: new Date(new Date().getFullYear(), new Date().getMonth(), 1), usageStart: new Date(new Date().getFullYear(), new Date().getMonth(), 1),
usageEnd: new Date(), usageEnd: new Date(),
usageMaterial: '', usageMaterialCode: '',
usageMaterialName: '',
workStart: new Date(new Date().getFullYear(), new Date().getMonth(), 1), workStart: new Date(new Date().getFullYear(), new Date().getMonth(), 1),
workEnd: new Date(), workEnd: new Date(),
tables: { usage: [], workload: [] }, tables: { usage: [], workload: [] },
...@@ -76,7 +79,8 @@ export default { ...@@ -76,7 +79,8 @@ export default {
usageColumns: [ usageColumns: [
{ type: 'index', title: '序号', width: 60, align: 'center' }, { type: 'index', title: '序号', width: 60, align: 'center' },
{ title: '部门', key: 'department_name', align: 'center' }, { title: '部门', key: 'department_name', align: 'center' },
{ title: '用品', key: 'material_name', align: 'center' }, { title: '用品编码', key: 'material_code', align: 'center' },
{ title: '用品名称', key: 'material_name', align: 'center' },
{ title: '领用数量', key: 'total_quantity', align: 'center' }, { title: '领用数量', key: 'total_quantity', align: 'center' },
{ title: '操作', slot: 'action', width: 100, align: 'center' } { title: '操作', slot: 'action', width: 100, align: 'center' }
], ],
...@@ -114,13 +118,13 @@ export default { ...@@ -114,13 +118,13 @@ export default {
this.loading.usage = true this.loading.usage = true
const st = this.usageStart ? normalizeVisitTimeValue(this.usageStart) : null const st = this.usageStart ? normalizeVisitTimeValue(this.usageStart) : null
const et = this.usageEnd ? normalizeVisitTimeValue(this.usageEnd).substring(0, 10) + ' 23:59:59' : null const et = this.usageEnd ? normalizeVisitTimeValue(this.usageEnd).substring(0, 10) + ' 23:59:59' : null
const params = { start: st, end: et, material: this.usageMaterial } const params = { start: st, end: et, material_name: this.usageMaterialName, material_code: this.usageMaterialCode }
getUsageStats(params).then(ret => { getUsageStats(params).then(ret => {
if (ret.data && ret.data.errcode === 0) this.tables.usage = ret.data.data || [] if (ret.data && ret.data.errcode === 0) this.tables.usage = ret.data.data || []
else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg }) else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg })
}).finally(() => { this.loading.usage = false }) }).finally(() => { this.loading.usage = false })
}, },
resetUsage () { this.usageStart = null; this.usageEnd = null; this.usageMaterial = ''; this.tables.usage = []; this.loadUsage() }, resetUsage () { this.usageStart = null; this.usageEnd = null; this.usageMaterialName = ''; this.usageMaterialCode = ''; this.tables.usage = []; this.loadUsage() },
openUsageDetail (row) { openUsageDetail (row) {
this.detailModal.columns = [ this.detailModal.columns = [
{ title: '部门', key: 'department_name', align: 'center' }, { title: '部门', key: 'department_name', align: 'center' },
...@@ -134,6 +138,7 @@ export default { ...@@ -134,6 +138,7 @@ export default {
const st = this.usageStart ? normalizeVisitTimeValue(this.usageStart) : null const st = this.usageStart ? normalizeVisitTimeValue(this.usageStart) : null
const et = this.usageEnd ? normalizeVisitTimeValue(this.usageEnd).substring(0, 10) + ' 23:59:59' : null const et = this.usageEnd ? normalizeVisitTimeValue(this.usageEnd).substring(0, 10) + ' 23:59:59' : null
getUsageDetails({ start: st, end: et, material: row.material_id, department: row.department_id }).then(ret => { getUsageDetails({ start: st, end: et, material: row.material_id, department: row.department_id }).then(ret => {
console.log(ret)
if (ret.data && ret.data.errcode === 0) this.detailModal.rows = ret.data.data || [] if (ret.data && ret.data.errcode === 0) this.detailModal.rows = ret.data.data || []
else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg }) else this.$Notice.error({ title: '查询失败', desc: ret.data && ret.data.errmsg })
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论