Commit ae3cf41e authored by mzx's avatar mzx

标准库管理接口对接

parent 7b86cb3c
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
:before-close="handleClose" :before-close="handleClose"
> >
<el-form ref="form" :model="model" :rules="rules"> <el-form ref="form" :model="model" :rules="rules">
<el-form-item label="标准分类" prop="status"> <el-form-item label="标准分类" prop="standardType">
<el-select <el-select
v-model="model.status" v-model="model.standardType"
style="width: 100%" style="width: 100%"
placeholder="请选择" placeholder="请选择"
clearable clearable
...@@ -23,39 +23,49 @@ ...@@ -23,39 +23,49 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标准号" prop="status"> <el-form-item label="标准号" prop="standardNo">
<el-input v-model="model.status" placeholder="请输入" clearable /> <el-input
v-model="model.standardNo"
disabled
placeholder="请输入"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="标准名称" prop="status"> <el-form-item label="标准名称" prop="name">
<el-input v-model="model.status" placeholder="请输入" clearable /> <el-input
v-model="model.name"
disabled
placeholder="请输入"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="标准状态" prop="status"> <el-form-item label="标准状态" prop="standardStatus">
<el-select <el-select
v-model="model.status" v-model="model.standardStatus"
style="width: 100%" style="width: 100%"
placeholder="请选择" placeholder="请选择"
clearable clearable
> >
<el-option <el-option
v-for="dict in dict.type.sys_detailed_classification" v-for="dict in dict.type.sys_standard_status"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发布日期" prop="status"> <el-form-item label="发布日期" prop="releaseDate">
<el-date-picker <el-date-picker
v-model="model.status" v-model="model.releaseDate"
style="width: 100%" style="width: 100%"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="实施日期" prop="status"> <el-form-item label="实施日期" prop="implementationDate">
<el-date-picker <el-date-picker
v-model="model.status" v-model="model.implementationDate"
style="width: 100%" style="width: 100%"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
...@@ -77,43 +87,101 @@ export default { ...@@ -77,43 +87,101 @@ export default {
default() { default() {
return { return {
dialogVisible: false, dialogVisible: false,
source: {} dialogEditId: null
} }
} }
} }
}, },
dicts: ['sys_detailed_classification'], dicts: ['sys_detailed_classification', 'sys_standard_status'],
data() { data() {
return { return {
model: {}, model: this.$modelDataSource({
url: '/standard/getInfo',
dataKey: 'model',
attributes: {
standardType: '',
standardNo: '',
name: '',
standardStatus: '',
releaseDate: '',
implementationDate: ''
}
}),
rules: { rules: {
status: [ standardType: [
{ required: true, message: '菜单名称不能为空', trigger: 'blur' } { required: true, message: '菜单名称不能为空', trigger: 'blur' }
], ],
orderNum: [ standardNo: [
{ required: true, message: '菜单顺序不能为空', trigger: 'blur' } { required: true, message: '菜单顺序不能为空', trigger: 'blur' }
], ],
path: [{ required: true, message: '路由地址不能为空', trigger: 'blur' }] name: [
{ required: true, message: '路由地址不能为空', trigger: 'blur' }
],
standardStatus: [
{ required: true, message: '路由地址不能为空', trigger: 'blur' }
],
releaseDate: [
{ required: true, message: '路由地址不能为空', trigger: 'blur' }
],
implementationDate: [
{ required: true, message: '路由地址不能为空', trigger: 'blur' }
]
} }
} }
}, },
computed: { computed: {
modelTitle() { modelTitle() {
return this.dialogManger.source.id ? '编辑标准' : '新增标准' return this.dialogManger.dialogEditId ? '编辑标准' : '新增标准'
}
},
watch: {
'dialogManger.dialogEditId'(newValue) {
this.model.fetch(
newValue,
{},
() => {
this.dialogManger.dialogVisible = true
},
() => {
this.$emit('refresh')
}
)
} }
}, },
methods: { methods: {
handleClose() { handleClose() {
this.$emit('close') this.model.reset()
this.dialogManger.dialogEditId = null
this.dialogManger.dialogVisible = false
// this.$emit('close')
}, },
handleConfirm() { handleConfirm() {
// console.log('dialogManger', this.dialogManger)
// this.$refs['form'].validate(valid => {
// if (valid) {
// console.log(valid)
// console.log('体系审查')
// }
// })
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
console.log(valid) console.log('表单验证通过')
console.log('体系审查') this.model.save(
() => {
this.$message.success('保存成功')
this.$emit('refresh')
this.handleClose()
},
errors => {
this.handleClose()
}
)
} else {
console.log('表单验证失败')
} }
}) })
} }
} }
} }
</script> </script>
<style scoped></style>
...@@ -17,52 +17,59 @@ ...@@ -17,52 +17,59 @@
<el-table-column <el-table-column
label="标准分类" label="标准分类"
min-width="200" min-width="200"
prop="category" prop="standardType"
align="left" align="left"
> >
<!-- <template slot-scope="scope">-->
<!-- <div v-for="dict in classFicationList" :key="dict.dictValue">-->
<!-- <div-->
<!-- v-if="dict.dictValue == scope.row.standardType"-->
<!-- style="display: flex"-->
<!-- >-->
<!-- {{ dict.dictLabel }}-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="section" prop="standardNo"
label="标准号" label="标准号"
min-width="200" min-width="200"
align="left" align="left"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="request" prop="name"
label="标准名称" label="标准名称"
min-width="200" min-width="200"
align="left" align="left"
> />
<template slot-scope="scope">
<span class="font-color" @click="viewTemplate">{{
scope.row.request
}}</span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="resultYes"-->
<!-- label="标准文件"-->
<!-- min-width="200"-->
<!-- align="left"-->
<!-- >-->
<!-- </el-table-column>-->
<el-table-column <el-table-column
prop="resultNO" prop="standardStatus"
label="标准状态" label="标准状态"
min-width="200" min-width="200"
align="left" align="left"
> >
<template slot-scope="scope">
<div v-for="dict in standardFicationList" :key="dict.dictValue">
<div
v-if="dict.dictValue == scope.row.standardStatus"
style="display: flex"
>
{{ dict.dictLabel }}
</div>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="发布日期" label="发布日期"
min-width="200" min-width="200"
align="left" align="left"
sortable sortable
prop="createTime" prop="releaseDate"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.releaseDate) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -70,10 +77,10 @@ ...@@ -70,10 +77,10 @@
min-width="200" min-width="200"
align="left" align="left"
sortable sortable
prop="createTime" prop="implementationDate"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.implementationDate) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -90,7 +97,7 @@ ...@@ -90,7 +97,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(1, scope.row)" @click="handleUpdate(scope.row)"
>修改</el-button >修改</el-button
> >
</template> </template>
...@@ -99,12 +106,13 @@ ...@@ -99,12 +106,13 @@
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.page" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.size" :limit.sync="queryParams.pageSize"
@pagination="loadData" @pagination="loadData"
> >
</pagination> </pagination>
<tixi-dialog <tixi-dialog
ref="TixiDialog"
:dialog-manger="TixiDialogManger" :dialog-manger="TixiDialogManger"
@close="TixiDialogManger.dialogVisible = false" @close="TixiDialogManger.dialogVisible = false"
></tixi-dialog> ></tixi-dialog>
...@@ -123,16 +131,17 @@ export default { ...@@ -123,16 +131,17 @@ export default {
dicts: ['sys_detailed_classification'], dicts: ['sys_detailed_classification'],
data() { data() {
return { return {
listUrl: '/standard-list', listUrl: '/standard/findStandardList',
showSearch: true, showSearch: true,
list: [], list: [],
tableData: [], tableData: [],
queryParams: { type: '1' },
TixiDialogManger: { TixiDialogManger: {
dialogVisible: false, dialogVisible: false,
refreshList: false, refreshList: false,
source: {} dialogEditId: null
} },
classFicationList: [],
standardFicationList: []
} }
}, },
...@@ -144,6 +153,14 @@ export default { ...@@ -144,6 +153,14 @@ export default {
} }
} }
}, },
mounted() {
this.getDicts('sys_detailed_classification').then(response => {
this.classFicationList = response.data
})
this.getDicts('sys_standard_status').then(response => {
this.standardFicationList = response.data
})
},
methods: { methods: {
viewTemplate() { viewTemplate() {
// this.$router.push({ // this.$router.push({
...@@ -154,36 +171,7 @@ export default { ...@@ -154,36 +171,7 @@ export default {
) )
}, },
objectSpanMethod() {}, objectSpanMethod() {},
loadData() { handleAdd() {
this.loading = true
console.log(this.queryParams)
request({
url: this.listUrl,
method: 'get',
params: this.queryParams
})
.then(res => {
if (res.code === 200) {
console.log(res.rows)
this.list = res.rows
if (this.queryParams.type === '2') {
this.tableData = geSpanList(res.rows, ['way', 'object', 'scene'])
} else {
this.tableData = res.rows
}
this.total = res.total
}
this.loading = false
})
.catch(error => {
if (error.msg) {
this.$message.error(error.msg)
}
this.loading = false
})
},
handleAdd(type) {
this.TixiDialogManger.dialogVisible = true this.TixiDialogManger.dialogVisible = true
this.TixiDialogManger.source = {} this.TixiDialogManger.source = {}
}, },
...@@ -199,9 +187,10 @@ export default { ...@@ -199,9 +187,10 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
handleUpdate(type, row) { handleUpdate(row) {
console.log('row', row)
this.TixiDialogManger.dialogVisible = true this.TixiDialogManger.dialogVisible = true
this.TixiDialogManger.source = row this.TixiDialogManger.dialogEditId = row.id
} }
} }
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
:before-close="handleClose" :before-close="handleClose"
> >
<el-table <el-table
class="el-table"
v-loading="loading" v-loading="loading"
style="min-height: 88px; margin: 20px" style="min-height: 88px; margin: 20px"
border border
...@@ -94,4 +95,8 @@ export default { ...@@ -94,4 +95,8 @@ export default {
} }
</script> </script>
<style scoped></style> <style scoped>
.el-table {
width: auto;
}
</style>
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
queryParams: { queryParams: {
chapter: '', chapter: '',
text: '', text: '',
standardId: this.$store.getters.standard || '1', standardId: this.$store.getters.standard,
type: 'system' type: 'system'
}, },
vehicleModelDialogManger: { vehicleModelDialogManger: {
......
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
dicts: ['sys_detailed_classification'], dicts: ['sys_detailed_classification'],
data() { data() {
return { return {
classFicationList: undefined, classFicationList: [],
listUrl: '/system/type/getList', listUrl: '/system/type/getList',
showSearch: true, showSearch: true,
tableData: [], tableData: [],
......
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