修改 标准入库流程修订页面 起草单位与归口化管理部门需要有维护按钮

This commit is contained in:
baoyu
2024-04-16 16:47:34 +08:00
parent c6635b3497
commit 849d0edb7c
@@ -1026,17 +1026,28 @@
<el-select
v-model="form.gkdw"
:popper-append-to-body="false"
style="width: 82%;"
filterable
clearable
placeholder="请选择归口管理部门"
>
<el-option v-for="item in gkglbmOptions" :key="item.value" :value="item.value" :label="item.label" />
</el-select>
<el-button
class="common-button-primary add-button"
type="primary"
icon="add"
size="small"
@click="productAddGk"
>
维护
</el-button>
</el-form-item>
<el-form-item v-if="form.standInData === '0'" label="起草单位" prop="qcdw" class="add-form-item form-item-disabled">
<el-select
v-model="form.qcdw"
clearable
style="width: 82%;"
placeholder="请选择起草单位"
multiple
filterable
@@ -1049,6 +1060,15 @@
:label="item.label"
/>
</el-select>
<el-button
class="common-button-primary add-button"
type="primary"
icon="add"
size="small"
@click="productAdd"
>
维护
</el-button>
</el-form-item>
<!--<el-form-item v-if="form.standInData === '0'" label="体系类别" prop="txlb" class="add-form-item form-item-disabled">
<el-select v-model="form.txlb" placeholder="请选择体系类别" multiple>
@@ -1775,6 +1795,69 @@
@checkedRole="checkedRole2"
/>
<loading :loading="ccc">加载数据</loading>
<el-drawer
:wrapperClosable="false"
:title="productTitle"
:visible.sync="productModal"
size="800px"
:before-close="closeDrawerProductModelAdd"
label-width="130px"
>
<div class="demo-drawer-content">
<el-form
ref="productModelAdd"
:model="productModelAdd"
:rules="productRules"
class="label-input-form"
label-width="130px"
>
<el-row>
<el-col>
<el-form-item label="选项" prop="dicTypeName" class="add-form-item">
<el-input v-model.trim="productModelAdd.dicTypeName" placeholder="请输入选项" clearable />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="排序号" prop="showIndex" class="add-form-item">
<el-input
v-model.number="productModelAdd.showIndex"
number
placeholder="请输入排序号"
:maxlength="4"
clearable
/>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="描述" prop="describes" class="add-form-item">
<el-input
v-model.trim="productModelAdd.describes"
placeholder="请输入描述"
clearable
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="demo-drawer-footer">
<el-button
class="common-button-primary"
icon="el-icon-check"
type="primary"
@click="saveProduct('productModelAdd')"
>
提交
</el-button>
<el-button
class="common-button-default"
icon="el-icon-close"
@click="closeModal"
>
取消
</el-button>
</div>
</el-drawer>
</div>
</template>
@@ -1814,7 +1897,42 @@ export default {
TreeSelectNew
},
data () {
const validStandNumInCompile2 = (rule, value, callback) => {
// let pattern = /^\d+$/
const pattern = /^[1-9]\d*$/
setTimeout(() => {
if (!pattern.test(value)) {
return callback(new Error('仅能输入正整数'))
} else {
callback()
}
})
}
return {
productTitle: '',
productModal: false,
productModelAdd: {
// 模态框信息
dicTypeName: '',
showIndex: '',
// 描述
describes: '',
// 唯一辨识
dicId: '' // 写死 数据字段ID
},
productRules: {
dicTypeName: [
{ required: true, message: '选项不能为空', trigger: 'blur' },
{ type: 'string', max: 100, message: '最多输入100位', trigger: 'blur' }
],
showIndex: [
{ type: 'number', required: true, message: '排序号不能为空且为正整数', trigger: 'blur' },
{ type: 'string', validator: validStandNumInCompile2, trigger: 'blur' }
],
describes: [
{ type: 'string', max: 500, message: '最多输入500位', trigger: 'blur' }
]
},
openModifyFileNameDialog: false,
modifyFile: {
fileName: '',
@@ -2147,6 +2265,66 @@ export default {
this.modelFunc()
},
methods: {
productAdd () {
this.productModal = true
this.productTitle = '维护起草单位'
this.productModelAdd.dicTypeCode = ''
},
closeModal () {
this.productModal = false
this.closeDrawerProductModelAdd()
},
saveProduct (name) {
this.$refs[name].validate((valid) => {
if (valid) {
if(this.productTitle == '维护归口管理部门') {
this.productModelAdd.dicId = 'DNDYWNSJKH4H8LYTV2CJ'
} else if(this.productTitle == '维护起草单位') {
this.productModelAdd.dicId = '4upkjyo34koluwmld5us'
}
this.$http.postData('sys/dictype/create', this.productModelAdd, {
_this: this
}, res => {
if (res.ok) {
this.getDataAsync()
this.productModal = false
this.productModelAdd = {
// 模态框信息
dicTypeName: '',
showIndex: '',
// 描述
describes: '',
// 唯一辨识
dicId: '4upkjyo34koluwmld5us'
}
} else {
this.productModal = true
}
}, e => {})
} else {
}
})
},
closeDrawerProductModelAdd () {
this.$nextTick(() => {
this.$refs['productModelAdd'].resetFields()
this.productModelAdd = {
// 模态框信息
dicTypeName: '',
showIndex: '',
// 描述
describes: '',
// 唯一辨识
dicId: '4upkjyo34koluwmld5us'
}
})
this.productModal = false
},
productAddGk () {
this.productModal = true
this.productTitle = '维护归口管理部门'
this.productModelAdd.dicTypeCode = ''
},
handleRemoveFile (file) {
const fileList = []
this.fileList.forEach(item => {