标准代码表复制
Showing
1 changed file
with
19 additions
and
13 deletions
| ... | @@ -132,11 +132,12 @@ const tableInfo: any = ref({ | ... | @@ -132,11 +132,12 @@ const tableInfo: any = ref({ |
| 132 | actionInfo: { | 132 | actionInfo: { |
| 133 | label: "操作", | 133 | label: "操作", |
| 134 | type: "btn", | 134 | type: "btn", |
| 135 | width: 132, //不要刚好90.缩小浏览器会因为小数点的差距而换行, | 135 | width: 172, //不要刚好90.缩小浏览器会因为小数点的差距而换行, |
| 136 | fixed: 'right', | 136 | fixed: 'right', |
| 137 | btns: [ | 137 | btns: [ |
| 138 | { label: '查看', value: 'detail'}, | 138 | { label: '查看', value: 'detail'}, |
| 139 | { label: "编辑", value: "edit" }, | 139 | { label: "编辑", value: "edit" }, |
| 140 | { label: '复制', value: 'copy' }, | ||
| 140 | { label: "删除", value: "delete" }, | 141 | { label: "删除", value: "delete" }, |
| 141 | ], | 142 | ], |
| 142 | }, | 143 | }, |
| ... | @@ -865,11 +866,11 @@ const tableBtnClick = (scope, btn) => { | ... | @@ -865,11 +866,11 @@ const tableBtnClick = (scope, btn) => { |
| 865 | 866 | ||
| 866 | const type = btn.value; | 867 | const type = btn.value; |
| 867 | const row = scope.row; | 868 | const row = scope.row; |
| 868 | if (type == "edit") { | 869 | if (type == "edit" || type === 'copy') { |
| 869 | fieldTableInfo.value.tableInfo.fields = [] | 870 | fieldTableInfo.value.tableInfo.fields = [] |
| 870 | fieldTableInfo.value.tableInfo.data = [] | 871 | fieldTableInfo.value.tableInfo.data = [] |
| 871 | drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "标准代码详情"; | 872 | drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "复制标准代码"; |
| 872 | drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto' | 873 | // drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto' |
| 873 | drawerInfo.value.type = type | 874 | drawerInfo.value.type = type |
| 874 | drawerInfo.value.footer.btns.forEach(item => { | 875 | drawerInfo.value.footer.btns.forEach(item => { |
| 875 | if (item.value === 'submit' || item.value === 'saveAndAdd') { | 876 | if (item.value === 'submit' || item.value === 'saveAndAdd') { |
| ... | @@ -886,9 +887,12 @@ const tableBtnClick = (scope, btn) => { | ... | @@ -886,9 +887,12 @@ const tableBtnClick = (scope, btn) => { |
| 886 | let data = res.data | 887 | let data = res.data |
| 887 | currTableData.value = data; | 888 | currTableData.value = data; |
| 888 | setDetailInfo(type) | 889 | setDetailInfo(type) |
| 889 | checkDelete().then((res:any) => { | 890 | if (type === 'edit') { |
| 890 | formItems.value.find(v => v.field === 'typeCode')['disabled'] = res ? true : false | 891 | checkDelete().then((res:any) => { |
| 891 | }) | 892 | formItems.value.find(v => v.field === 'typeCode')['disabled'] = res ? true : false |
| 893 | }) | ||
| 894 | } | ||
| 895 | |||
| 892 | } else { | 896 | } else { |
| 893 | ElMessage({ | 897 | ElMessage({ |
| 894 | type: "error", | 898 | type: "error", |
| ... | @@ -1315,7 +1319,7 @@ const setDetailInfo = (type) => { | ... | @@ -1315,7 +1319,7 @@ const setDetailInfo = (type) => { |
| 1315 | const saveData = async (params, btnValue) => { | 1319 | const saveData = async (params, btnValue) => { |
| 1316 | // const passInfo = await checkParamsData() | 1320 | // const passInfo = await checkParamsData() |
| 1317 | console.log('params', params) | 1321 | console.log('params', params) |
| 1318 | let request = drawerInfo.value.type === 'add' ? saveStandardCode : updateStandardCode | 1322 | let request = drawerInfo.value.type === 'edit' ? updateStandardCode : saveStandardCode |
| 1319 | request(params).then((res:any) => { | 1323 | request(params).then((res:any) => { |
| 1320 | if (res.code === proxy.$passCode) { | 1324 | if (res.code === proxy.$passCode) { |
| 1321 | ElMessage.success('操作成功') | 1325 | ElMessage.success('操作成功') |
| ... | @@ -1336,27 +1340,29 @@ const saveData = async (params, btnValue) => { | ... | @@ -1336,27 +1340,29 @@ const saveData = async (params, btnValue) => { |
| 1336 | }) | 1340 | }) |
| 1337 | } | 1341 | } |
| 1338 | function toStandardCodeDetail (guid) { | 1342 | function toStandardCodeDetail (guid) { |
| 1339 | if (drawerInfo.value.type === 'add') { | 1343 | if (drawerInfo.value.type === 'add' || drawerInfo.value.type === 'copy') { |
| 1340 | getStandardCodeDetail(guid).then((res:any) => { | 1344 | getStandardCodeDetail(guid).then((res:any) => { |
| 1341 | if (res.code == proxy.$passCode) { | 1345 | if (res.code == proxy.$passCode) { |
| 1342 | let { guid, standardName } = res.data | 1346 | let { guid, codeName } = res.data |
| 1343 | showFiledsPage.value = true | 1347 | showFiledsPage.value = true |
| 1344 | nextTick(() => { | 1348 | nextTick(() => { |
| 1345 | dictFiledsRef.value.standardGuid = guid | 1349 | dictFiledsRef.value.standardGuid = guid |
| 1346 | dictFiledsRef.value.standardName = standardName | 1350 | dictFiledsRef.value.standardName = codeName |
| 1347 | treeCurrentNodeKey.value = guid | 1351 | treeCurrentNodeKey.value = guid |
| 1352 | treeInfo.value.currentNodeKey = guid | ||
| 1348 | dictFiledsRef.value.getFirstPageData() | 1353 | dictFiledsRef.value.getFirstPageData() |
| 1349 | }) | 1354 | }) |
| 1350 | } | 1355 | } |
| 1351 | }) | 1356 | }) |
| 1352 | } else { | 1357 | } else { |
| 1353 | console.log('currentData', currTableData.value) | 1358 | console.log('currentData', currTableData.value) |
| 1354 | let { guid, standardName } = currTableData.value | 1359 | let { guid, codeName } = currTableData.value |
| 1355 | showFiledsPage.value = true | 1360 | showFiledsPage.value = true |
| 1356 | nextTick(() => { | 1361 | nextTick(() => { |
| 1357 | dictFiledsRef.value.standardGuid = guid | 1362 | dictFiledsRef.value.standardGuid = guid |
| 1358 | dictFiledsRef.value.standardName = standardName | 1363 | dictFiledsRef.value.standardName = codeName |
| 1359 | treeCurrentNodeKey.value = guid | 1364 | treeCurrentNodeKey.value = guid |
| 1365 | treeInfo.value.currentNodeKey = guid | ||
| 1360 | dictFiledsRef.value.getFirstPageData() | 1366 | dictFiledsRef.value.getFirstPageData() |
| 1361 | }) | 1367 | }) |
| 1362 | } | 1368 | } | ... | ... |
-
Please register or sign in to post a comment