feature: 标准跟踪清单-修改

This commit is contained in:
zyn
2024-01-31 11:37:25 +08:00
parent 9d8f3f9451
commit 3e679e64b8
3 changed files with 41 additions and 6 deletions
@@ -64,7 +64,7 @@
round round
class="common-button-default" class="common-button-default"
icon="el-icon-check" icon="el-icon-check"
@click="importFailed.importFailed = false" @click="importFailed.visible = false"
> >
确认 确认
</el-button> </el-button>
@@ -101,7 +101,7 @@ export default {
rules, rules,
url: { url: {
uploadNew: 'api/att/attFile/uploadNew', uploadNew: 'api/att/attFile/uploadNew',
importExcelUrl: 'api/standardTrackingCheckList/importTrackingChecklist', importExcelUrl: 'standardTrackingCheckList/importTrackingChecklist',
exportTemplateFile: 'api/standardTrackingCheckList/exportTemplateFile', exportTemplateFile: 'api/standardTrackingCheckList/exportTemplateFile',
}, },
importModalShowFlag: false, importModalShowFlag: false,
@@ -123,7 +123,7 @@ export default {
this.$refs.formRef.validate(valid => { this.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
const config = { _this: this, loading: 'loading' } const config = { _this: this, loading: 'loading' }
this.$http._postData(this.url.importExcelUrl, this.form, config).then(res => { this.$http._post(this.url.importExcelUrl, this.form, config).then(res => {
if (res.ok) { if (res.ok) {
this.$message.success('导入成功') this.$message.success('导入成功')
this.visible = false this.visible = false
@@ -131,7 +131,7 @@ export default {
} else { } else {
this.importFailed.importFailedText = res.message this.importFailed.importFailedText = res.message
this.importFailed.visible = true this.importFailed.visible = true
this.$message.warning(res.message) // this.$message.warning(res.message)
} }
}) })
} }
@@ -64,7 +64,9 @@
label="产品类型" label="产品类型"
> >
<template slot-scope="{row, column, $index}"> <template slot-scope="{row, column, $index}">
<span v-if="disabled">{{ trackingChecklistProductTypeMap[row.productType] || '-' }}</span>
<el-select <el-select
v-else
v-model="row.productType" v-model="row.productType"
placeholder="请选择产品类型" placeholder="请选择产品类型"
size="mini" size="mini"
@@ -87,7 +89,9 @@
label="实施日期" label="实施日期"
> >
<template slot-scope="{row, column, $index}"> <template slot-scope="{row, column, $index}">
<span v-if="disabled">{{ row.implTime || '-' }}</span>
<el-date-picker <el-date-picker
v-else
v-model="row.implTime" v-model="row.implTime"
size="mini" size="mini"
type="date" type="date"
@@ -104,7 +108,9 @@
label="实施要求" label="实施要求"
> >
<template slot-scope="{row, column, $index}"> <template slot-scope="{row, column, $index}">
<span v-if="disabled">{{ trackingChecklistPutDemandMap[row.implRequire] || '-' }}</span>
<el-select <el-select
v-else
v-model="row.implRequire" v-model="row.implRequire"
placeholder="请选择实施要求" placeholder="请选择实施要求"
clearable clearable
@@ -149,6 +155,24 @@ export default {
dict: {} dict: {}
} }
}, },
computed: {
trackingChecklistProductTypeMap () {
return this.dict.trackingChecklistProductType
? this.dict.trackingChecklistProductType.reduce((obj, item) => {
obj[item.value] = item.label
return obj
}, {})
: []
},
trackingChecklistPutDemandMap () {
return this.dict.trackingChecklistPutDemand
? this.dict.trackingChecklistPutDemand.reduce((obj, item) => {
obj[item.value] = item.label
return obj
}, {})
: []
}
},
created () { created () {
this.getDicTypeListCode() this.getDicTypeListCode()
}, },
@@ -203,7 +227,7 @@ export default {
confirmButtonClass: 'common-button-primary', confirmButtonClass: 'common-button-primary',
roundButton: true roundButton: true
}).then(() => { }).then(() => {
const list = this.value.filter(item => !this.selectedList.some(i => i.id === item.id)) const list = this.value.filter(item => !this.selectedList.some(i => i.lawId === item.lawId))
this.$emit('input', list) this.$emit('input', list)
}) })
}, },
@@ -218,8 +242,11 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
.table{ .table{
/deep/ .el-select.el-select--mini{
width: 100% !important;
}
/deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner { /deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner {
width: 130px !important; width: 100% !important;
} }
} }
</style> </style>
@@ -168,6 +168,7 @@ export default {
}, },
add () { add () {
this.title = '新增' this.title = '新增'
this.disabled = false
// this.form = JSON.parse(JSON.stringify(this.initForm)) // this.form = JSON.parse(JSON.stringify(this.initForm))
Object.keys(this.initForm).forEach(key => this.form[key] = this.initForm[key]) Object.keys(this.initForm).forEach(key => this.form[key] = this.initForm[key])
this.roleForm = JSON.parse(JSON.stringify(this.initRoleForm)) this.roleForm = JSON.parse(JSON.stringify(this.initRoleForm))
@@ -250,9 +251,16 @@ export default {
.el-form-item__content{ .el-form-item__content{
line-height: 50px; line-height: 50px;
} }
.el-input.is-disabled .el-input__inner {
background-color: transparent;
border-color: #E4E7ED;
color: #666;
cursor: not-allowed;
}
} }
.form-item-first { .form-item-first {
/deep/ .el-input__inner{ /deep/ .el-input__inner{
padding-left: 0;
border: none; border: none;
} }
} }