fix
Showing
1 changed file
with
44 additions
and
11 deletions
| ... | @@ -489,7 +489,7 @@ const drawerInfo: any = ref({ | ... | @@ -489,7 +489,7 @@ const drawerInfo: any = ref({ |
| 489 | btns: [ | 489 | btns: [ |
| 490 | { type: 'default', label: '取消', value: 'cancel' }, | 490 | { type: 'default', label: '取消', value: 'cancel' }, |
| 491 | { type: 'primary', label: '保存', value: 'submit', visible: true }, | 491 | { type: 'primary', label: '保存', value: 'submit', visible: true }, |
| 492 | { type: 'primary', label: '保存并添加数据', value: 'submit', visible: true }, | 492 | { type: 'primary', label: '保存并添加数据', value: 'saveAndAdd', visible: true }, |
| 493 | ] | 493 | ] |
| 494 | }, | 494 | }, |
| 495 | }) | 495 | }) |
| ... | @@ -575,7 +575,7 @@ const getCodeRuleData = () => { | ... | @@ -575,7 +575,7 @@ const getCodeRuleData = () => { |
| 575 | const treePromise = ref(); | 575 | const treePromise = ref(); |
| 576 | 576 | ||
| 577 | const getTreeData = (needClick = false, currData = {}) => { | 577 | const getTreeData = (needClick = false, currData = {}) => { |
| 578 | getParamsList({ dictType: '标准类型'}).then((res:any) => { | 578 | return getParamsList({ dictType: '标准类型'}).then((res:any) => { |
| 579 | if (res.code === proxy.$passCode) { | 579 | if (res.code === proxy.$passCode) { |
| 580 | const data = res.data || [] | 580 | const data = res.data || [] |
| 581 | data.forEach(item => { | 581 | data.forEach(item => { |
| ... | @@ -864,7 +864,7 @@ const tableBtnClick = (scope, btn) => { | ... | @@ -864,7 +864,7 @@ const tableBtnClick = (scope, btn) => { |
| 864 | drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto' | 864 | drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto' |
| 865 | drawerInfo.value.type = type | 865 | drawerInfo.value.type = type |
| 866 | drawerInfo.value.footer.btns.forEach(item => { | 866 | drawerInfo.value.footer.btns.forEach(item => { |
| 867 | if (item.value === 'submit') { | 867 | if (item.value === 'submit' || item.value === 'saveAndAdd') { |
| 868 | item.visible = type === 'detail' ? false : true | 868 | item.visible = type === 'detail' ? false : true |
| 869 | } | 869 | } |
| 870 | }) | 870 | }) |
| ... | @@ -1094,6 +1094,10 @@ const loadDrawer = async () => { | ... | @@ -1094,6 +1094,10 @@ const loadDrawer = async () => { |
| 1094 | } | 1094 | } |
| 1095 | }) | 1095 | }) |
| 1096 | formTable.value.tableInfo.fields = fields | 1096 | formTable.value.tableInfo.fields = fields |
| 1097 | formItems.value.forEach(item => { | ||
| 1098 | item.default = '' | ||
| 1099 | item.disabled = false | ||
| 1100 | }) | ||
| 1097 | formInfo.value.formInfo.items = formItems.value | 1101 | formInfo.value.formInfo.items = formItems.value |
| 1098 | formTableData.value = JSON.parse(JSON.stringify(orginData)) | 1102 | formTableData.value = JSON.parse(JSON.stringify(orginData)) |
| 1099 | formTable.value.tableInfo.data = formTableData.value | 1103 | formTable.value.tableInfo.data = formTableData.value |
| ... | @@ -1103,6 +1107,9 @@ const loadDrawer = async () => { | ... | @@ -1103,6 +1107,9 @@ const loadDrawer = async () => { |
| 1103 | formTable.value.tableInfo.actionInfo.show = true | 1107 | formTable.value.tableInfo.actionInfo.show = true |
| 1104 | formTable.value.tableTool.visible = true | 1108 | formTable.value.tableTool.visible = true |
| 1105 | drawerInfo.value.container.contents = contents.value['add'] | 1109 | drawerInfo.value.container.contents = contents.value['add'] |
| 1110 | drawerInfo.value.footer.btns.forEach(item => { | ||
| 1111 | item.visible = true | ||
| 1112 | }) | ||
| 1106 | drawerInfo.value.visible = true | 1113 | drawerInfo.value.visible = true |
| 1107 | console.log('table', formTable.value) | 1114 | console.log('table', formTable.value) |
| 1108 | console.log('formInfo', formInfo) | 1115 | console.log('formInfo', formInfo) |
| ... | @@ -1263,7 +1270,8 @@ const setDetailInfo = (type) => { | ... | @@ -1263,7 +1270,8 @@ const setDetailInfo = (type) => { |
| 1263 | drawerInfo.value.container.contents = contents.value['add'] | 1270 | drawerInfo.value.container.contents = contents.value['add'] |
| 1264 | drawerInfo.value.visible = true | 1271 | drawerInfo.value.visible = true |
| 1265 | 1272 | ||
| 1266 | 1273 | // if (row.typeCode) | |
| 1274 | formItems.value.find(v => v.field === 'hierarchy')['visible'] = row.typeCode == 1 ? false : true | ||
| 1267 | 1275 | ||
| 1268 | setCodeOptions() | 1276 | setCodeOptions() |
| 1269 | } | 1277 | } |
| ... | @@ -1275,12 +1283,13 @@ const saveData = async (params, btnValue) => { | ... | @@ -1275,12 +1283,13 @@ const saveData = async (params, btnValue) => { |
| 1275 | request(params).then((res:any) => { | 1283 | request(params).then((res:any) => { |
| 1276 | if (res.code === proxy.$passCode) { | 1284 | if (res.code === proxy.$passCode) { |
| 1277 | ElMessage.success('操作成功') | 1285 | ElMessage.success('操作成功') |
| 1278 | getTreeData() | 1286 | getTreeData().then(() => { |
| 1279 | drawerInfo.value.visible = false | 1287 | drawerInfo.value.visible = false |
| 1280 | if (btnValue === 'saveAndAdd') { | 1288 | if (btnValue === 'saveAndAdd') { |
| 1281 | // 跳转代码详情 | 1289 | // 跳转代码详情 |
| 1282 | toStandardCodeDetail(res.data) | 1290 | toStandardCodeDetail(res.data) |
| 1283 | } | 1291 | } |
| 1292 | }) | ||
| 1284 | } else { | 1293 | } else { |
| 1285 | ElMessage.error(res.msg) | 1294 | ElMessage.error(res.msg) |
| 1286 | } | 1295 | } |
| ... | @@ -1289,7 +1298,31 @@ const saveData = async (params, btnValue) => { | ... | @@ -1289,7 +1298,31 @@ const saveData = async (params, btnValue) => { |
| 1289 | }) | 1298 | }) |
| 1290 | } | 1299 | } |
| 1291 | function toStandardCodeDetail (guid) { | 1300 | function toStandardCodeDetail (guid) { |
| 1292 | 1301 | if (drawerInfo.value.type === 'add') { | |
| 1302 | getStandardCodeDetail(guid).then((res:any) => { | ||
| 1303 | if (res.code == proxy.$passCode) { | ||
| 1304 | let { guid, standardName } = res.data | ||
| 1305 | showFiledsPage.value = true | ||
| 1306 | nextTick(() => { | ||
| 1307 | dictFiledsRef.value.standardGuid = guid | ||
| 1308 | dictFiledsRef.value.standardName = standardName | ||
| 1309 | treeCurrentNodeKey.value = guid | ||
| 1310 | dictFiledsRef.value.getFirstPageData() | ||
| 1311 | }) | ||
| 1312 | } | ||
| 1313 | }) | ||
| 1314 | } else { | ||
| 1315 | console.log('currentData', currTableData.value) | ||
| 1316 | let { guid, standardName } = currTableData.value | ||
| 1317 | showFiledsPage.value = true | ||
| 1318 | nextTick(() => { | ||
| 1319 | dictFiledsRef.value.standardGuid = guid | ||
| 1320 | dictFiledsRef.value.standardName = standardName | ||
| 1321 | treeCurrentNodeKey.value = guid | ||
| 1322 | dictFiledsRef.value.getFirstPageData() | ||
| 1323 | }) | ||
| 1324 | } | ||
| 1325 | |||
| 1293 | } | 1326 | } |
| 1294 | 1327 | ||
| 1295 | const scrollTable = (rowInfo) => { | 1328 | const scrollTable = (rowInfo) => { | ... | ... |
-
Please register or sign in to post a comment