From a5df491b3de1e9f7db126cda0a23a6fdf3564e9e Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Mon, 5 Feb 2024 10:35:49 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6=E8=AF=A6?=
=?UTF-8?q?=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Detail/src/DetailDeviceLedger.vue | 39 ++++++++++++-------
src/components/Tabs/src/Tabs.vue | 1 +
src/components/UploadFile/src/UploadFile.vue | 2 +-
.../deviceAccounts/deviceAccounts.data.ts | 8 ++--
src/views/eam/device/deviceAccounts/index.vue | 33 ++++++++--------
5 files changed, 49 insertions(+), 34 deletions(-)
diff --git a/src/components/Detail/src/DetailDeviceLedger.vue b/src/components/Detail/src/DetailDeviceLedger.vue
index d475014..e1df0c0 100644
--- a/src/components/Detail/src/DetailDeviceLedger.vue
+++ b/src/components/Detail/src/DetailDeviceLedger.vue
@@ -25,7 +25,7 @@
/>
-
+
@@ -55,7 +55,7 @@
/>
点击上传
-
+
- 点击上传
+ 点击上传
@@ -316,8 +316,14 @@ const props = defineProps({
type: Object,
required: true,
default: null
- }
+ },
+ subIndex: {
+ type: String,
+ required: false,
+ default: 'A'
+ },
})
+const subIndex = ref(props.subIndex)
const isShowDrawer = ref(false)
const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
@@ -345,14 +351,16 @@ const masterParmas = ref({
const HeadButttondata = ref()
// 列表-操作按钮
const buttondata = ref()
-
/** 打开弹窗 */
const detailData = ref()
const titleNameRef = ref()
const titleValueRef = ref()
+const tabsKay =ref(0)//刷新tabs组件key值
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName
titleValueRef.value = titleValue
+ current.value = 0
+ tabsKay.value+=1
// 加载明细列表
if (!props.isBasic || (props.isBasic && props.tabsExtend)) {
// 设置主表id
@@ -369,8 +377,12 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}
isShowDrawer.value = true
if (row) {
+ console.log(row)
detailLoading.value = true
try {
+ nextTick(() => {
+ imageFormRef.value.setValues(row)
+ })
detailData.value = row
// 判断详情新增按钮是否显示
if (routeName.value.indexOf('Job') > -1) {
@@ -607,28 +619,27 @@ const uploadImage =async () => {
emit(
'uploadImage',
masterParmas.value.number,
- imageFormRef.value.formModel.filePath.map((item) => item.url)
+ imageFormRef.value.formModel.filePathList.map((item) => item.url)
)
}
// 选择二级tabs
+const fileFormRef = ref()
const handleTabsChange=(e)=>{
- console.log(e)
emit('subTabsChick',e)
}
// 上传文件
-const fileFormRef = ref()
-const uploadFile=async(e,index)=>{
- console.log(proxy.$refs)
- console.log(proxy.$refs['fileFormRef'+(index+1)))
- const elForm = unref(fileFormRef)?.getElFormRef()
+const uploadFile=async(index)=>{
+ let _lists = fileFormRef.value?.map(v => unref(v)?.getElFormRef())
+ const elForm = _lists[index]
// 校验表单
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
+ console.log(fileFormRef.value.formModel)
emit(
'uploadFile',
masterParmas.value.number,
- fileFormRef.value.formModel.filePath.map((item) => item.url)
+ fileFormRef.value.formModel.filePathList.map((item) => item.url)
)
}
//监视属性
diff --git a/src/components/Tabs/src/Tabs.vue b/src/components/Tabs/src/Tabs.vue
index 8c66168..c07415c 100644
--- a/src/components/Tabs/src/Tabs.vue
+++ b/src/components/Tabs/src/Tabs.vue
@@ -27,6 +27,7 @@ const props = defineProps({
},
})
const current = ref(props.current);
+console.log('555',current.value)
const change = (item, index) => {
current.value = index
emit('change',item,index)
diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue
index ed92c4c..8db435b 100644
--- a/src/components/UploadFile/src/UploadFile.vue
+++ b/src/components/UploadFile/src/UploadFile.vue
@@ -8,7 +8,7 @@
v-model:file-list="fileList"
:show-file-list="true"
:auto-upload="autoUpload"
- :action="updateUrl+'?tableId='+upData?.tableId+'&tableName='+ upData?.tableName"
+ :action="updateUrl"
:headers="uploadHeaders"
:limit="props.limit"
:drag="drag"
diff --git a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
index ebf99f2..e9df4c0 100644
--- a/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
+++ b/src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
@@ -148,7 +148,7 @@ export const UpImageRules = reactive({
export const UpImage = useCrudSchemas(reactive([
{
label: '上传图片',
- field: 'filePath',
+ field: 'filePathList',
sort: 'custom',
isForm: true,
form:{
@@ -164,12 +164,14 @@ export const UpFileRules = reactive({
export const UploadFile = useCrudSchemas(reactive([
{
label: '上传文件',
- field: 'filePath',
+ field: 'filePathList',
sort: 'custom',
isForm: true,
form:{
component:'UploadFile',
-
+ componentProps:{
+ limit:10
+ }
}
},
]))
\ No newline at end of file
diff --git a/src/views/eam/device/deviceAccounts/index.vue b/src/views/eam/device/deviceAccounts/index.vue
index 85473ec..e36ec73 100644
--- a/src/views/eam/device/deviceAccounts/index.vue
+++ b/src/views/eam/device/deviceAccounts/index.vue
@@ -243,6 +243,7 @@ const formsSuccess = async (formType, data) => {
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
itemCodeRow.value = row.number
+ tabsExtend.value = 1
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts')
}
@@ -312,30 +313,30 @@ const changeTabs = (item) => {
} else if (item.prop == 'Word') {
tabsExtend.value = 2
funcCode.value = 'device_mould_attachment'
- apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
- detailAllSchemas.value = PurchaseMain.allSchemas
+ // apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
+ // detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') {
tabsExtend.value = 3
- apiPage.value = deviceRepairApi.getDeviceRepairPage
- detailAllSchemas.value = DeviceRepair.allSchemas
+ // apiPage.value = deviceRepairApi.getDeviceRepairPage
+ // detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'DeviceReportRecord') {
- tabsExtend.value = 3
- apiPage.value = BalanceApi.getBalancePage
- detailAllSchemas.value = Balance.allSchemas
+ tabsExtend.value = 3
+ apiPage.value = deviceRepairApi.getDeviceRepairPage
+ detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3
- apiPage.value = ExpectinApi.getExpectinPage
- detailAllSchemas.value = Expectin.allSchemas
+ // apiPage.value = ExpectinApi.getExpectinPage
+ // detailAllSchemas.value = Expectin.allSchemas
} else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3
- apiPage.value = ExpectinApi.getExpectinPage
- detailAllSchemas.value = Expectin.allSchemas
+ // apiPage.value = ExpectinApi.getExpectinPage
+ // detailAllSchemas.value = Expectin.allSchemas
}
- detailAllSchemas.value.tableColumns.map((item, index) => {
- if (item.field == 'action') {
- detailAllSchemas.value.tableColumns.splice(index, 1)
- }
- })
+ // detailAllSchemas.value.tableColumns.map((item, index) => {
+ // if (item.field == 'action') {
+ // detailAllSchemas.value.tableColumns.splice(index, 1)
+ // }
+ // })
// 当前物料代码作为条件
tableObjectExtend.value = [
{