1b45aaba by fanguang Committed by lihua

fix

1 parent 3277f5d5
......@@ -489,7 +489,7 @@ const drawerInfo: any = ref({
btns: [
{ type: 'default', label: '取消', value: 'cancel' },
{ type: 'primary', label: '保存', value: 'submit', visible: true },
{ type: 'primary', label: '保存并添加数据', value: 'submit', visible: true },
{ type: 'primary', label: '保存并添加数据', value: 'saveAndAdd', visible: true },
]
},
})
......@@ -575,7 +575,7 @@ const getCodeRuleData = () => {
const treePromise = ref();
const getTreeData = (needClick = false, currData = {}) => {
getParamsList({ dictType: '标准类型'}).then((res:any) => {
return getParamsList({ dictType: '标准类型'}).then((res:any) => {
if (res.code === proxy.$passCode) {
const data = res.data || []
data.forEach(item => {
......@@ -864,7 +864,7 @@ const tableBtnClick = (scope, btn) => {
drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto'
drawerInfo.value.type = type
drawerInfo.value.footer.btns.forEach(item => {
if (item.value === 'submit') {
if (item.value === 'submit' || item.value === 'saveAndAdd') {
item.visible = type === 'detail' ? false : true
}
})
......@@ -1094,6 +1094,10 @@ const loadDrawer = async () => {
}
})
formTable.value.tableInfo.fields = fields
formItems.value.forEach(item => {
item.default = ''
item.disabled = false
})
formInfo.value.formInfo.items = formItems.value
formTableData.value = JSON.parse(JSON.stringify(orginData))
formTable.value.tableInfo.data = formTableData.value
......@@ -1103,6 +1107,9 @@ const loadDrawer = async () => {
formTable.value.tableInfo.actionInfo.show = true
formTable.value.tableTool.visible = true
drawerInfo.value.container.contents = contents.value['add']
drawerInfo.value.footer.btns.forEach(item => {
item.visible = true
})
drawerInfo.value.visible = true
console.log('table', formTable.value)
console.log('formInfo', formInfo)
......@@ -1263,7 +1270,8 @@ const setDetailInfo = (type) => {
drawerInfo.value.container.contents = contents.value['add']
drawerInfo.value.visible = true
// if (row.typeCode)
formItems.value.find(v => v.field === 'hierarchy')['visible'] = row.typeCode == 1 ? false : true
setCodeOptions()
}
......@@ -1275,12 +1283,13 @@ const saveData = async (params, btnValue) => {
request(params).then((res:any) => {
if (res.code === proxy.$passCode) {
ElMessage.success('操作成功')
getTreeData()
getTreeData().then(() => {
drawerInfo.value.visible = false
if (btnValue === 'saveAndAdd') {
// 跳转代码详情
toStandardCodeDetail(res.data)
}
})
} else {
ElMessage.error(res.msg)
}
......@@ -1289,6 +1298,30 @@ const saveData = async (params, btnValue) => {
})
}
function toStandardCodeDetail (guid) {
if (drawerInfo.value.type === 'add') {
getStandardCodeDetail(guid).then((res:any) => {
if (res.code == proxy.$passCode) {
let { guid, standardName } = res.data
showFiledsPage.value = true
nextTick(() => {
dictFiledsRef.value.standardGuid = guid
dictFiledsRef.value.standardName = standardName
treeCurrentNodeKey.value = guid
dictFiledsRef.value.getFirstPageData()
})
}
})
} else {
console.log('currentData', currTableData.value)
let { guid, standardName } = currTableData.value
showFiledsPage.value = true
nextTick(() => {
dictFiledsRef.value.standardGuid = guid
dictFiledsRef.value.standardName = standardName
treeCurrentNodeKey.value = guid
dictFiledsRef.value.getFirstPageData()
})
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!