Browse Source

设备台账详情

master
zhang_li 10 months ago
parent
commit
a5df491b3d
  1. 39
      src/components/Detail/src/DetailDeviceLedger.vue
  2. 1
      src/components/Tabs/src/Tabs.vue
  3. 2
      src/components/UploadFile/src/UploadFile.vue
  4. 8
      src/views/eam/device/deviceAccounts/deviceAccounts.data.ts
  5. 31
      src/views/eam/device/deviceAccounts/index.vue

39
src/components/Detail/src/DetailDeviceLedger.vue

@ -25,7 +25,7 @@
/>
</ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" />
<Tabs :tabsList="tabsList" :current="current" @change="change" :key="tabsKay"/>
<div class="flex">
<!-- 详情 -->
<ContentWrap class="w-[100%]">
@ -55,7 +55,7 @@
/>
<el-button type="primary" @click="uploadImage">点击上传</el-button>
</div>
<el-tabs type="border-card" class="demo-tabs" v-if="isBasic && tabsExtend == 2" @tab-change="handleTabsChange">
<el-tabs type="border-card" class="demo-tabs" v-model="subIndex" v-if="isBasic && tabsExtend == 2" @tab-change="handleTabsChange">
<el-tab-pane
v-for="(item,index) in subTabsList"
:key="item.value"
@ -63,12 +63,12 @@
:name="item.value"
>
<Form
:ref="'fileFormRef'+ ( index + 1 )"
:ref="'fileFormRef'"
:rules="upFileRules"
:schema="fileFormSchemas"
:is-col="true"
/>
<el-button type="primary" @click="uploadFile($event,index)">点击上传</el-button>
<el-button type="primary" @click="uploadFile(index)">点击上传</el-button>
</el-tab-pane>
</el-tabs>
<!-- 单表切换tabs 展现table -->
@ -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)//tabskey
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)
)
}
//

1
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)

2
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"

8
src/views/eam/device/deviceAccounts/deviceAccounts.data.ts

@ -148,7 +148,7 @@ export const UpImageRules = reactive({
export const UpImage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '上传图片',
field: 'filePath',
field: 'filePathList',
sort: 'custom',
isForm: true,
form:{
@ -164,12 +164,14 @@ export const UpFileRules = reactive({
export const UploadFile = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '上传文件',
field: 'filePath',
field: 'filePathList',
sort: 'custom',
isForm: true,
form:{
component:'UploadFile',
componentProps:{
limit:10
}
}
},
]))

31
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
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
}
detailAllSchemas.value.tableColumns.map((item, index) => {
if (item.field == 'action') {
detailAllSchemas.value.tableColumns.splice(index, 1)
// apiPage.value = ExpectinApi.getExpectinPage
// detailAllSchemas.value = Expectin.allSchemas
}
})
// detailAllSchemas.value.tableColumns.map((item, index) => {
// if (item.field == 'action') {
// detailAllSchemas.value.tableColumns.splice(index, 1)
// }
// })
//
tableObjectExtend.value = [
{

Loading…
Cancel
Save