Commit ae3cf41e authored by mzx's avatar mzx

标准库管理接口对接

parent 7b86cb3c
......@@ -8,9 +8,9 @@
:before-close="handleClose"
>
<el-form ref="form" :model="model" :rules="rules">
<el-form-item label="标准分类" prop="status">
<el-form-item label="标准分类" prop="standardType">
<el-select
v-model="model.status"
v-model="model.standardType"
style="width: 100%"
placeholder="请选择"
clearable
......@@ -23,39 +23,49 @@
/>
</el-select>
</el-form-item>
<el-form-item label="标准号" prop="status">
<el-input v-model="model.status" placeholder="请输入" clearable />
<el-form-item label="标准号" prop="standardNo">
<el-input
v-model="model.standardNo"
disabled
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="标准名称" prop="status">
<el-input v-model="model.status" placeholder="请输入" clearable />
<el-form-item label="标准名称" prop="name">
<el-input
v-model="model.name"
disabled
placeholder="请输入"
clearable
/>
</el-form-item>
<el-form-item label="标准状态" prop="status">
<el-form-item label="标准状态" prop="standardStatus">
<el-select
v-model="model.status"
v-model="model.standardStatus"
style="width: 100%"
placeholder="请选择"
clearable
>
<el-option
v-for="dict in dict.type.sys_detailed_classification"
v-for="dict in dict.type.sys_standard_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="发布日期" prop="status">
<el-form-item label="发布日期" prop="releaseDate">
<el-date-picker
v-model="model.status"
v-model="model.releaseDate"
style="width: 100%"
type="date"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="实施日期" prop="status">
<el-form-item label="实施日期" prop="implementationDate">
<el-date-picker
v-model="model.status"
v-model="model.implementationDate"
style="width: 100%"
type="date"
placeholder="选择日期"
......@@ -77,43 +87,101 @@ export default {
default() {
return {
dialogVisible: false,
source: {}
dialogEditId: null
}
}
}
},
dicts: ['sys_detailed_classification'],
dicts: ['sys_detailed_classification', 'sys_standard_status'],
data() {
return {
model: {},
model: this.$modelDataSource({
url: '/standard/getInfo',
dataKey: 'model',
attributes: {
standardType: '',
standardNo: '',
name: '',
standardStatus: '',
releaseDate: '',
implementationDate: ''
}
}),
rules: {
status: [
standardType: [
{ required: true, message: '菜单名称不能为空', trigger: 'blur' }
],
orderNum: [
standardNo: [
{ 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: {
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: {
handleClose() {
this.$emit('close')
this.model.reset()
this.dialogManger.dialogEditId = null
this.dialogManger.dialogVisible = false
// this.$emit('close')
},
handleConfirm() {
// console.log('dialogManger', this.dialogManger)
// this.$refs['form'].validate(valid => {
// if (valid) {
// console.log(valid)
// console.log('体系审查')
// }
// })
this.$refs['form'].validate(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>
<style scoped></style>
......@@ -17,52 +17,59 @@
<el-table-column
label="标准分类"
min-width="200"
prop="category"
prop="standardType"
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
prop="section"
prop="standardNo"
label="标准号"
min-width="200"
align="left"
>
</el-table-column>
<el-table-column
prop="request"
prop="name"
label="标准名称"
min-width="200"
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
prop="resultNO"
prop="standardStatus"
label="标准状态"
min-width="200"
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
label="发布日期"
min-width="200"
align="left"
sortable
prop="createTime"
prop="releaseDate"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.releaseDate) }}</span>
</template>
</el-table-column>
<el-table-column
......@@ -70,10 +77,10 @@
min-width="200"
align="left"
sortable
prop="createTime"
prop="implementationDate"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.implementationDate) }}</span>
</template>
</el-table-column>
<el-table-column
......@@ -90,7 +97,7 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(1, scope.row)"
@click="handleUpdate(scope.row)"
>修改</el-button
>
</template>
......@@ -99,12 +106,13 @@
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.size"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="loadData"
>
</pagination>
<tixi-dialog
ref="TixiDialog"
:dialog-manger="TixiDialogManger"
@close="TixiDialogManger.dialogVisible = false"
></tixi-dialog>
......@@ -123,16 +131,17 @@ export default {
dicts: ['sys_detailed_classification'],
data() {
return {
listUrl: '/standard-list',
listUrl: '/standard/findStandardList',
showSearch: true,
list: [],
tableData: [],
queryParams: { type: '1' },
TixiDialogManger: {
dialogVisible: false,
refreshList: false,
source: {}
}
dialogEditId: null
},
classFicationList: [],
standardFicationList: []
}
},
......@@ -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: {
viewTemplate() {
// this.$router.push({
......@@ -154,36 +171,7 @@ export default {
)
},
objectSpanMethod() {},
loadData() {
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) {
handleAdd() {
this.TixiDialogManger.dialogVisible = true
this.TixiDialogManger.source = {}
},
......@@ -199,9 +187,10 @@ export default {
})
.catch(() => {})
},
handleUpdate(type, row) {
handleUpdate(row) {
console.log('row', row)
this.TixiDialogManger.dialogVisible = true
this.TixiDialogManger.source = row
this.TixiDialogManger.dialogEditId = row.id
}
}
}
......
......@@ -7,6 +7,7 @@
:before-close="handleClose"
>
<el-table
class="el-table"
v-loading="loading"
style="min-height: 88px; margin: 20px"
border
......@@ -94,4 +95,8 @@ export default {
}
</script>
<style scoped></style>
<style scoped>
.el-table {
width: auto;
}
</style>
......@@ -160,7 +160,7 @@ export default {
queryParams: {
chapter: '',
text: '',
standardId: this.$store.getters.standard || '1',
standardId: this.$store.getters.standard,
type: 'system'
},
vehicleModelDialogManger: {
......
......@@ -128,7 +128,7 @@ export default {
dicts: ['sys_detailed_classification'],
data() {
return {
classFicationList: undefined,
classFicationList: [],
listUrl: '/system/type/getList',
showSearch: true,
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