ea46d321 by fanguang Committed by lihua

标准代码表复制

1 parent 103ba0cc
......@@ -132,11 +132,12 @@ const tableInfo: any = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 132, //不要刚好90.缩小浏览器会因为小数点的差距而换行,
width: 172, //不要刚好90.缩小浏览器会因为小数点的差距而换行,
fixed: 'right',
btns: [
{ label: '查看', value: 'detail'},
{ label: "编辑", value: "edit" },
{ label: '复制', value: 'copy' },
{ label: "删除", value: "delete" },
],
},
......@@ -865,11 +866,11 @@ const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
if (type == "edit") {
if (type == "edit" || type === 'copy') {
fieldTableInfo.value.tableInfo.fields = []
fieldTableInfo.value.tableInfo.data = []
drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "标准代码详情";
drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto'
drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "复制标准代码";
// drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto'
drawerInfo.value.type = type
drawerInfo.value.footer.btns.forEach(item => {
if (item.value === 'submit' || item.value === 'saveAndAdd') {
......@@ -886,9 +887,12 @@ const tableBtnClick = (scope, btn) => {
let data = res.data
currTableData.value = data;
setDetailInfo(type)
checkDelete().then((res:any) => {
formItems.value.find(v => v.field === 'typeCode')['disabled'] = res ? true : false
})
if (type === 'edit') {
checkDelete().then((res:any) => {
formItems.value.find(v => v.field === 'typeCode')['disabled'] = res ? true : false
})
}
} else {
ElMessage({
type: "error",
......@@ -1315,7 +1319,7 @@ const setDetailInfo = (type) => {
const saveData = async (params, btnValue) => {
// const passInfo = await checkParamsData()
console.log('params', params)
let request = drawerInfo.value.type === 'add' ? saveStandardCode : updateStandardCode
let request = drawerInfo.value.type === 'edit' ? updateStandardCode : saveStandardCode
request(params).then((res:any) => {
if (res.code === proxy.$passCode) {
ElMessage.success('操作成功')
......@@ -1336,27 +1340,29 @@ const saveData = async (params, btnValue) => {
})
}
function toStandardCodeDetail (guid) {
if (drawerInfo.value.type === 'add') {
if (drawerInfo.value.type === 'add' || drawerInfo.value.type === 'copy') {
getStandardCodeDetail(guid).then((res:any) => {
if (res.code == proxy.$passCode) {
let { guid, standardName } = res.data
let { guid, codeName } = res.data
showFiledsPage.value = true
nextTick(() => {
dictFiledsRef.value.standardGuid = guid
dictFiledsRef.value.standardName = standardName
dictFiledsRef.value.standardName = codeName
treeCurrentNodeKey.value = guid
treeInfo.value.currentNodeKey = guid
dictFiledsRef.value.getFirstPageData()
})
}
})
} else {
console.log('currentData', currTableData.value)
let { guid, standardName } = currTableData.value
let { guid, codeName } = currTableData.value
showFiledsPage.value = true
nextTick(() => {
dictFiledsRef.value.standardGuid = guid
dictFiledsRef.value.standardName = standardName
dictFiledsRef.value.standardName = codeName
treeCurrentNodeKey.value = guid
treeInfo.value.currentNodeKey = 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!