增加表单配置页面

main
252535409 2 years ago
parent 7ff5bfb476
commit 745e0367e2

@ -83,6 +83,8 @@
<a v-else @click="author(record.id)" style="color: red;">取消授权</a>
<a> | </a>
<a @click="cancel(record.id)" style="color: red;">删除</a>
<a> | </a>
<a @click="setFormField(record)"></a>
</span>
<span slot="handlePrint" slot-scope="text, record">
<a-upload name="file" :data="{'id':record.id,'filed':'printTemplateUrl'}" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" :customRequest="customUpload">
@ -114,6 +116,7 @@
</div>
</div>
<ysDirectoryAdd-modal ref="modalForm" @ok="modalFormOk"></ysDirectoryAdd-modal>
<ysDirectoryField-modal ref="modalfieldForm" @ok="modalFormOk"></ysDirectoryField-modal>
<a-modal ref="modalEditForm" v-model="editvisible" title="编辑" @ok="handleOk">
<a-form class="ant-advanced-edit-form" :form="form" layout="inline" labelAlign="right">
<a-form-item label="事项名称" props="displayNameEdit">
@ -128,6 +131,7 @@
import MenuTitle from '@/views/ai/MenuTitle'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import YsDirectoryAddModal from './modules/YsDirectoryAddModal'
import YsDirectoryFieldModal from './modules/YsDirectoryFieldModal'
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
import { httpAction, getAction} from '@/api/manage'
import moment from 'moment'
@ -136,7 +140,7 @@
components: {
MenuTitle,
YsDirectoryAddModal,
// InIure,
YsDirectoryFieldModal,
},
data() {
return {
@ -150,6 +154,7 @@
getNumber: '/application/offline/route/get/number/each/flow/state',
importExcelUrl: "/sys/common/upload",
editUrl: "/ai/preExaminationMatters/edit",
saveMattersFieldUrl: "/ai/preExaminationMattersField/save",
},
that: this,
//
@ -275,6 +280,11 @@
this.getList()
},
methods: {
setFormField(record){
this.$refs.modalfieldForm.edit(record);
this.$refs.modalfieldForm.title = "设置表单字段";
this.$refs.modalfieldForm.disableSubmit = false;
},
handleOk(){
httpAction(this.url.editUrl, {id:this.$refs.modalEditForm.id,displayName:this.queryParams.displayNameEdit},"POST").then((res) => {
if (res.success) {
@ -288,6 +298,19 @@
}
})
},
handleOkField(){
httpAction(this.url.saveMattersFieldUrl, {id:this.$refs.modalEditForm.id,displayName:this.queryParams.displayNameEdit},"POST").then((res) => {
if (res.success) {
this.$message.success(res.message)
this.editvisible = false;
this.queryParams.displayNameEdit = null
this.$refs.modalEditForm.id=null
this.getList()
} else {
this.$message.warning(res.message)
}
})
},
customUpload(info){
console.log("------info------->",info)
const formData = new FormData();

@ -184,6 +184,7 @@
selectedKeysBefore: [],
//
expandedKeys: [],
tableData: [],
selectTreeRow: {},
selectTreeId: '',
selectedTableRow: [],
@ -516,6 +517,7 @@
edit() {
this.visible = true
this.getTreeData();
this.loadData(1);
},
close() {
this.$emit('close')

@ -0,0 +1,208 @@
<template>
<a-modal
:title="title"
:width="1100"
:visible="visible"
:maskClosable="false"
@cancel="handleCancel"
cancelText="关闭">
</j-modal>
<a-spin :tip="aSpinLoading" :spinning="spinning" class="spinOuter">
<el-table
:data="materialFields"
stripe
style="width: 100%">
<el-table-column
prop="fieldCode"
label="字段名称"
width="260">
<template slot-scope="scope">
<el-input v-model="scope.row.fieldCode" ></el-input>
</template>
</el-table-column>
<el-table-column
prop="fieldName"
label="字段编码"
width="260">
<template slot-scope="scope">
<el-input v-model="scope.row.fieldName"></el-input>
</template>
</el-table-column>
<el-table-column
prop="materialCode"
label="选择材料"
width="280">
<template slot-scope="scope">
<el-select v-model="scope.row.materialCode">
<el-option v-for="(i, index) in materials" :key="index" :label="i.materialName" v-bind:value="i.materialCode"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="operate"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="success"
icon="el-icon-save"
@click="handlesaveAnnualAssessment(scope.$index, scope.row)">保存
</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDeleteAnnualAssessment(scope.$index, scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 5px;">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAddAnnualAssessmentLine">新增字段
</el-button>
</div>
</a-spin>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { httpAction, getAction} from '@/api/manage'
import { duplicateCheck } from '@/api/api'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
export default {
components: {
JDictSelectTag
},
data () {
return {
url: {
listMattersField:'/ai/preExaminationMattersField/list',
listMaterial:'/ai/preReviewMaterial/queryList',
},
title:'',
width:800,
visible: false,
queryParam: {},
materials: {},
materialFields: [{id:"",fieldCode:"",fieldName:"",materialCode:""}],
disableSubmit: false,
aSpinLoading: '',
eventCode: '',
spinning: false,
loadingTable: false,
}
},
methods: {
//
handleAddAnnualAssessmentLine() {
if (this.materialFields == undefined) {
this.materialFields = new Array();
}
let obj = {};
this.materialFields.push(obj);
},
//
handlesaveAnnualAssessment(a, b) {
console.log(a);
console.log(b);
if(!b.fieldName){
this.$message.warning("请输入字段名称")
return;
}
if(!b.fieldCode){
this.$message.warning("请输入字段编码")
return;
}
if(!b.materialCode){
this.$message.warning("请选择材料")
return;
}
if(b.id){
httpAction("/ai/preExaminationMattersField/edit", {id:b.id,fieldCode:b.fieldCode,fieldName:b.fieldName,materialCode:b.materialCode}, "post").then((res) => {
if (res.success) {
this.$message.success(res.message)
console.log(123)
} else {
this.$message.warning(res.message)
}
})
}else{
httpAction("/ai/preExaminationMattersField/add", {eventCode:this.eventCode,fieldCode:b.fieldCode,fieldName:b.fieldName,materialCode:b.materialCode}, "post").then((res) => {
if (res.success) {
this.$message.success(res.message)
console.log(123)
} else {
this.$message.warning(res.message)
}
})
}
},
//
handleDeleteAnnualAssessment(index,data) {
console.log(data);
httpAction("/ai/preExaminationMattersField/delete", {id:data.id}, "post").then((res) => {
if (res.success) {
this.$message.success(res.message)
this.materialFields.splice(index, 1)
} else {
this.$message.warning(res.message)
}
})
},
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
get_material_data(){
},
edit (record) {
this.visible=true
this.eventCode = record.eventCode;
this.queryParams={
eventCode:record.eventCode,
status:1
}
getAction(this.url.listMattersField, this.queryParams).then((res) => {
if (res.success) {
this.materialFields = res.result;
console.log("--------------->",res.result);
}
})
getAction(this.url.listMaterial, this.queryParams).then((res) => {
if (res.success) {
console.log("--------------->",res.result);
this.materials = res.result;
}
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -105,12 +105,17 @@
dataIndex: 'materialName'
},
{
title: '详情',
title: '材料类型',
align: "center",
dataIndex: 'materialUrl',
scopedSlots: { customRender: 'materialUrl' },
dataIndex: 'materialType'
},
{
title: '核发部门',
align: "center",
dataIndex: 'departName'
},
],
tableData: [],
title: '操作',
visible: false,
model: {},
@ -138,6 +143,7 @@
},
edit() {
this.visible = true
this.loadData(1);
},
getNumber() {
getAction(this.url.getNumber, this.queryParam).then((res) => {

Loading…
Cancel
Save