Commit b665f9e1 by lichengming

修改了委托单管理的页码和查询

parent ad142f26
...@@ -9,14 +9,6 @@ ...@@ -9,14 +9,6 @@
<Col span="24"> <Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false"> <Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<label class="label-sign" /> <label class="label-sign" />
<Form-item :label-width="70" label="授权资质仪器名称" >
<Input
v-model="code"
@on-enter="_pageChange(1)"
placeholder="授权资质仪器名称"
style="width: 100%"
/>
</Form-item>
<Form-item label="检测依据名称"> <Form-item label="检测依据名称">
<Input <Input
v-model="name" v-model="name"
...@@ -56,8 +48,8 @@ ...@@ -56,8 +48,8 @@
</Col> </Col>
<Col span="24"> <Col span="24">
<Page <Page
:total="getPage.total" :total="total"
:page-size="getPage.size" :page-size="size"
@on-change="_pageChange" @on-change="_pageChange"
@on-page-size-change="_pageRows" @on-page-size-change="_pageRows"
placement="top" placement="top"
...@@ -93,6 +85,8 @@ export default { ...@@ -93,6 +85,8 @@ export default {
}, },
loading: true, loading: true,
pageParams: { rows: 20 }, pageParams: { rows: 20 },
total: 0,
size: 0,
pageColumns: [ pageColumns: [
{ title: '检定依据', key: 'verification', width: 120 }, { title: '检定依据', key: 'verification', width: 120 },
{ title: '检定依据名称', key: 'name', width: 140 } { title: '检定依据名称', key: 'name', width: 140 }
...@@ -110,7 +104,8 @@ export default { ...@@ -110,7 +104,8 @@ export default {
modalTitle: '', modalTitle: '',
currentRowData: {}, currentRowData: {},
name: '', name: '',
code: '' code: '',
verification: ''
} }
}, },
methods: { methods: {
...@@ -118,6 +113,7 @@ export default { ...@@ -118,6 +113,7 @@ export default {
this.modalTitle = '选择检测依据' this.modalTitle = '选择检测依据'
this.name = '' this.name = ''
this.code = '' this.code = ''
this.verification = ''
this._judge() this._judge()
}, },
_judge() { _judge() {
...@@ -126,7 +122,7 @@ export default { ...@@ -126,7 +122,7 @@ export default {
this._page() this._page()
}, },
_page: async function() { _page: async function() {
const result = await meterAptitude.page(this.formObj) const result = await meterAptitude.page(this._searchParams())
if (result) { if (result) {
this.getPage = result.records this.getPage = result.records
console.log(this.getPage) console.log(this.getPage)
...@@ -134,6 +130,8 @@ export default { ...@@ -134,6 +130,8 @@ export default {
this.getPage[i].verification = this.getPage[i].verification =
this.getPage[i].code + this.getPage[i].name this.getPage[i].code + this.getPage[i].name
} }
this.total = result.total
this.size = result.size
this.loading = false this.loading = false
} }
}, },
...@@ -153,6 +151,9 @@ export default { ...@@ -153,6 +151,9 @@ export default {
if (this.code) { if (this.code) {
data.code = this.code data.code = this.code
} }
if (this.verification) {
data.verification = this.verification
}
return this.$extend(data, this.pageParams) return this.$extend(data, this.pageParams)
}, },
_search() { _search() {
......
...@@ -9,17 +9,17 @@ ...@@ -9,17 +9,17 @@
<Col span="24"> <Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false"> <Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<label class="label-sign" /> <label class="label-sign" />
<Form-item :label-width="70" label="授权资质仪器名称" > <Form-item :label-width="70" label="样品名称" >
<Input <Input
v-model="code" v-model="name"
placeholder="授权资质仪器名称" placeholder="请输入样品名称"
style="width: 100%" style="width: 100%"
@on-enter="_pageChange(1)" @on-enter="_pageChange(1)"
/> />
</Form-item> </Form-item>
<Form-item label="检测依据名称"> <Form-item label="检测依据名称">
<Input <Input
v-model="name" v-model="basis"
placeholder="请输入检测依据名称" placeholder="请输入检测依据名称"
style="width: 100%" style="width: 100%"
@on-enter="_pageChange(1)" @on-enter="_pageChange(1)"
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
</Col> </Col>
<Col span="24"> <Col span="24">
<Page <Page
:total="getPage.total" :total="total"
:page-size="getPage.size" :page-size="size"
placement="top" placement="top"
show-total show-total
show-elevator show-elevator
...@@ -90,6 +90,8 @@ export default { ...@@ -90,6 +90,8 @@ export default {
return { return {
loading: true, loading: true,
pageParams: { rows: 20 }, pageParams: { rows: 20 },
total: 0,
size: 0,
pageColumns: [ pageColumns: [
{ title: '样品名称', key: 'name' }, { title: '样品名称', key: 'name' },
{ title: '检定依据', key: 'code' }, { title: '检定依据', key: 'code' },
...@@ -100,7 +102,8 @@ export default { ...@@ -100,7 +102,8 @@ export default {
modalTitle: '', modalTitle: '',
currentRowData: {}, currentRowData: {},
name: '', name: '',
code: '' code: '',
basis: ''
} }
}, },
methods: { methods: {
...@@ -108,6 +111,7 @@ export default { ...@@ -108,6 +111,7 @@ export default {
this.modalTitle = '选择检测依据' this.modalTitle = '选择检测依据'
this.name = '' this.name = ''
this.code = '' this.code = ''
this.basis = ''
this._judge() this._judge()
}, },
_judge() { _judge() {
...@@ -121,6 +125,8 @@ export default { ...@@ -121,6 +125,8 @@ export default {
console.log('查询结果') console.log('查询结果')
console.log(result) console.log(result)
this.getPage = result.records this.getPage = result.records
this.total = result.total
this.size = result.size
this.loading = false this.loading = false
console.log(this.getPage) console.log(this.getPage)
} }
...@@ -141,6 +147,9 @@ export default { ...@@ -141,6 +147,9 @@ export default {
if (this.code) { if (this.code) {
data.code = this.code data.code = this.code
} }
if (this.basis) {
data.basis = this.basis
}
return this.$extend(data, this.pageParams) return this.$extend(data, this.pageParams)
}, },
_search() { _search() {
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
style="width: 100%" style="width: 100%"
/> />
</Form-item> </Form-item>
<Form-item class="search-btn">
<Button @click="_pageChange(1)" type="primary">搜索</Button>
</Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24" style="margin-bottom: 10px"> <Col span="24" style="margin-bottom: 10px">
......
...@@ -9,14 +9,6 @@ ...@@ -9,14 +9,6 @@
<Col span="24"> <Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false"> <Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<label class="label-sign" /> <label class="label-sign" />
<Form-item :label-width="70" label="授权资质仪器名称" >
<Input
v-model="code"
@on-enter="_pageChange(1)"
placeholder="授权资质仪器名称"
style="width: 100%"
/>
</Form-item>
<Form-item label="检测依据名称"> <Form-item label="检测依据名称">
<Input <Input
v-model="name" v-model="name"
...@@ -25,6 +17,9 @@ ...@@ -25,6 +17,9 @@
style="width: 100%" style="width: 100%"
/> />
</Form-item> </Form-item>
<Form-item class="search-btn">
<Button @click="_pageChange(1)" type="primary">搜索</Button>
</Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24" style="margin-bottom: 10px"> <Col span="24" style="margin-bottom: 10px">
...@@ -56,8 +51,8 @@ ...@@ -56,8 +51,8 @@
</Col> </Col>
<Col span="24"> <Col span="24">
<Page <Page
:total="getPage.total" :total="total"
:page-size="getPage.size" :page-size="size"
@on-change="_pageChange" @on-change="_pageChange"
@on-page-size-change="_pageRows" @on-page-size-change="_pageRows"
placement="top" placement="top"
...@@ -93,6 +88,8 @@ export default { ...@@ -93,6 +88,8 @@ export default {
}, },
loading: true, loading: true,
pageParams: { rows: 20 }, pageParams: { rows: 20 },
total: 0,
size: 0,
pageColumns: [ pageColumns: [
{ title: '检定依据', key: 'verification', width: 120 }, { title: '检定依据', key: 'verification', width: 120 },
{ title: '检定依据名称', key: 'name', width: 140 } { title: '检定依据名称', key: 'name', width: 140 }
...@@ -126,9 +123,11 @@ export default { ...@@ -126,9 +123,11 @@ export default {
this._page() this._page()
}, },
_page: async function() { _page: async function() {
const result = await meterAptitude.page(this.formObj) const result = await meterAptitude.page(this._searchParams())
if (result) { if (result) {
this.getPage = result.records this.getPage = result.records
this.total = result.total
this.size = result.size
console.log(this.getPage) console.log(this.getPage)
for (let i = 0; i < this.getPage.length; i++) { for (let i = 0; i < this.getPage.length; i++) {
this.getPage[i].verification = this.getPage[i].verification =
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
style="width: 100%" style="width: 100%"
/> />
</Form-item> </Form-item>
<Form-item class="search-btn">
<Button @click="_pageChange(1)" type="primary">搜索</Button>
</Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24" style="margin-bottom: 10px"> <Col span="24" style="margin-bottom: 10px">
......
...@@ -9,14 +9,6 @@ ...@@ -9,14 +9,6 @@
<Col span="24"> <Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false"> <Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<label class="label-sign" /> <label class="label-sign" />
<Form-item :label-width="70" label="授权资质仪器名称" >
<Input
v-model="code"
@on-enter="_pageChange(1)"
placeholder="授权资质仪器名称"
style="width: 100%"
/>
</Form-item>
<Form-item label="检测依据名称"> <Form-item label="检测依据名称">
<Input <Input
v-model="name" v-model="name"
...@@ -25,6 +17,9 @@ ...@@ -25,6 +17,9 @@
style="width: 100%" style="width: 100%"
/> />
</Form-item> </Form-item>
<Form-item class="search-btn">
<Button @click="_pageChange(1)" type="primary">搜索</Button>
</Form-item>
</Form> </Form>
</Col> </Col>
<Col span="24" style="margin-bottom: 10px"> <Col span="24" style="margin-bottom: 10px">
...@@ -56,8 +51,8 @@ ...@@ -56,8 +51,8 @@
</Col> </Col>
<Col span="24"> <Col span="24">
<Page <Page
:total="getPage.total" :total="total"
:page-size="getPage.size" :page-size="size"
@on-change="_pageChange" @on-change="_pageChange"
@on-page-size-change="_pageRows" @on-page-size-change="_pageRows"
placement="top" placement="top"
...@@ -93,6 +88,8 @@ export default { ...@@ -93,6 +88,8 @@ export default {
}, },
loading: true, loading: true,
pageParams: { rows: 20 }, pageParams: { rows: 20 },
total: 0,
size: 0,
pageColumns: [ pageColumns: [
{ title: '检定依据', key: 'verification', width: 120 }, { title: '检定依据', key: 'verification', width: 120 },
{ title: '检定依据名称', key: 'name', width: 140 } { title: '检定依据名称', key: 'name', width: 140 }
...@@ -126,9 +123,11 @@ export default { ...@@ -126,9 +123,11 @@ export default {
this._page() this._page()
}, },
_page: async function() { _page: async function() {
const result = await meterAptitude.page(this.formObj) const result = await meterAptitude.page(this._searchParams())
if (result) { if (result) {
this.getPage = result.records this.getPage = result.records
this.total = result.total
this.size = result.size
console.log(this.getPage) console.log(this.getPage)
for (let i = 0; i < this.getPage.length; i++) { for (let i = 0; i < this.getPage.length; i++) {
this.getPage[i].verification = this.getPage[i].verification =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment