Commit ccdb7e46 by lichengming

修改了资质管理

parent 11685485
<template>
<div>
<Modal v-model="showUserGroupModal">
<p slot="header">
{{ modalTitle }}
</p>
<Row>
<!--查询条件-->
<Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<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="检测依据名称">
<Input
v-model="name"
@on-enter="_pageChange(1)"
placeholder="请输入检测依据名称"
style="width: 100%"
/>
</Form-item>
</Form>
</Col>
<Col span="24" style="margin-bottom: 10px">
<el-table
:height="300"
@row-click="_rowChange"
@row-dblclick="_dbClick"
:data="getPage"
border
size="small"
highlight-current-row
style="width: 100%"
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
:prop="item.key"
:label="item.title"
:min-width="item.width"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="item.key==='status'">
{{ scope.row[item.key]?scope.row[item.key].display:'' }}
</span>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</el-table>
</Col>
<Col span="24">
<Page
:total="getPage.total"
:page-size="getPage.size"
@on-change="_pageChange"
@on-page-size-change="_pageRows"
placement="top"
show-total
show-elevator
show-sizer
/>
<div style="clear: both" />
</Col>
</Row>
<div slot="footer" class="btn-width">
<Button @click="_cancel" style="margin-left: 8px">
取消
</Button>
<Button @click="_ok" type="primary">
确定
</Button>
</div>
</Modal>
</div>
</template>
<script>
// import { meterAptitude } from '../../../api'
import { meterManage } from '../../../api'
export default {
name: 'EditModal',
data() {
return {
loading: true,
pageParams: { rows: 20 },
pageColumns: [{ title: '样品名称', key: 'name' }],
getPage: [],
showUserGroupModal: false,
modalTitle: '',
currentRowData: {},
name: '',
code: ''
}
},
methods: {
_open() {
this.modalTitle = '选择检测依据'
this.name = ''
this.code = ''
this._judge()
},
_judge() {
this.showUserGroupModal = true
this.currentRowData = {}
this._page()
},
_page: async function() {
const result = await meterManage.page(this._searchParams())
if (result) {
console.log('查询结果')
console.log(result)
this.getPage = result.records
this.loading = false
console.log(this.getPage)
}
},
_pageChange(page) {
this.pageParams.page = page
this._page()
},
_pageRows(rows) {
this.pageParams.rows = rows
this._page()
},
_searchParams() {
const data = this.$serialize('test-item-form')
if (this.name) {
data.name = this.name
}
if (this.code) {
data.code = this.code
}
return this.$extend(data, this.pageParams)
},
_search() {
this._page()
},
_rowChange(data) {
this.currentRowData = data // 选中的行数据;
},
_cancel() {
this.showUserGroupModal = false
},
_ok() {
if (JSON.stringify(this.currentRowData) === '{}') {
switch (this.modalTitle) {
case '选择检测依据':
this.$Message.warning('请选择一条检测依据!')
break
}
} else {
this.$emit('on-result-change', this.currentRowData)
this.showUserGroupModal = false
}
},
// 双击
_dbClick(data, event) {
this.currentRowData = data
// 选中的行数据;
this._ok()
}
}
}
</script>
<style scoped>
</style>
......@@ -69,7 +69,7 @@
>
<template slot-scope="scope">
<div v-if="item.key==='name'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.name" blur placeholder="请输入或选择样品名称"
<el-input v-model="scope.row.name" @on-result-change="_judgeBasisChange" @click.native="_selectjudgeBasis(scope.$rowIndex)" blur placeholder="请输入或选择样品名称"
></el-input>
</div>
<div v-if="item.key==='spec'" @click.stop="_handleRow(scope)">
......@@ -107,6 +107,7 @@
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
<EditModal ref="EditModal" @on-result-change="_backData" is-change />
</Modal>
</div>
</template>
......@@ -115,9 +116,10 @@
* 添加编辑分包商
*/
import { lmsBaseDict, meterEntrust } from '../../../api'
import EditModal from './EditModal'
export default {
components: {},
components: { EditModal },
data() {
return {
formId: 'meterSendTestEditFormId',
......@@ -147,6 +149,7 @@ export default {
name: '外观检查'
}
],
index: 0,
id: '',
modalTitle: '',
subcontractorId: '',
......@@ -189,6 +192,55 @@ export default {
}
},
methods: {
_backData(data) {
// this.formObj.code = data.code
// this.formObj.basis = data.name
// this.formObj.standardId = data.id
console.log(typeof this.index)
this.getPage.records[this.index].name = data.name
console.log('返回的数据')
console.log(data)
console.log(this.getPage.records)
},
_selectjudgeBasis(index) {
console.log(index)
this.index = index
this.$refs.EditModal._open()
},
_getJudgeBasisList(data) {
const obj = { classify: 0 }
if (data) {
obj.stdNum = data
}
// this.$store.dispatch('StandardInfo/list', obj).then(() => {
// this.judgeBasisData = this.$store.state.StandardInfo.list
// })
},
_judgeBasisChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.stdId = data.id
this.formObj.code = data.stdNum
this.formObj.name = data.name
this.$refs.formObj.validateField('code')
break
case 'query':
this.formObj.stdId = ''
this.formObj.code = data.stdNum
this.formObj.name = ''
this._getJudgeBasisList(data.stdNum)
break
case 'focus':
this._getJudgeBasisList()
break
case 'blur':
if (this.formObj.stdId === '') {
this.formObj.code = ''
this._getJudgeBasisList()
}
this.$refs.formObj.validateField('code')
}
},
_add() {
const data = {
name: '',
......
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