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> </ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" /> <Tabs :tabsList="tabsList" :current="current" @change="change" :key="tabsKay"/>
<div class="flex"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[100%]"> <ContentWrap class="w-[100%]">
@ -55,7 +55,7 @@
/> />
<el-button type="primary" @click="uploadImage">点击上传</el-button> <el-button type="primary" @click="uploadImage">点击上传</el-button>
</div> </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 <el-tab-pane
v-for="(item,index) in subTabsList" v-for="(item,index) in subTabsList"
:key="item.value" :key="item.value"
@ -63,12 +63,12 @@
:name="item.value" :name="item.value"
> >
<Form <Form
:ref="'fileFormRef'+ ( index + 1 )" :ref="'fileFormRef'"
:rules="upFileRules" :rules="upFileRules"
:schema="fileFormSchemas" :schema="fileFormSchemas"
:is-col="true" :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-tab-pane>
</el-tabs> </el-tabs>
<!-- 单表切换tabs 展现table --> <!-- 单表切换tabs 展现table -->
@ -316,8 +316,14 @@ const props = defineProps({
type: Object, type: Object,
required: true, required: true,
default: null default: null
} },
subIndex: {
type: String,
required: false,
default: 'A'
},
}) })
const subIndex = ref(props.subIndex)
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const detailLoading = ref(false) const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
@ -345,14 +351,16 @@ const masterParmas = ref({
const HeadButttondata = ref() const HeadButttondata = ref()
// - // -
const buttondata = ref() const buttondata = ref()
/** 打开弹窗 */ /** 打开弹窗 */
const detailData = ref() const detailData = ref()
const titleNameRef = ref() const titleNameRef = ref()
const titleValueRef = ref() const titleValueRef = ref()
const tabsKay =ref(0)//tabskey
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
titleNameRef.value = titleName titleNameRef.value = titleName
titleValueRef.value = titleValue titleValueRef.value = titleValue
current.value = 0
tabsKay.value+=1
// //
if (!props.isBasic || (props.isBasic && props.tabsExtend)) { if (!props.isBasic || (props.isBasic && props.tabsExtend)) {
// id // id
@ -369,8 +377,12 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
} }
isShowDrawer.value = true isShowDrawer.value = true
if (row) { if (row) {
console.log(row)
detailLoading.value = true detailLoading.value = true
try { try {
nextTick(() => {
imageFormRef.value.setValues(row)
})
detailData.value = row detailData.value = row
// //
if (routeName.value.indexOf('Job') > -1) { if (routeName.value.indexOf('Job') > -1) {
@ -607,28 +619,27 @@ const uploadImage =async () => {
emit( emit(
'uploadImage', 'uploadImage',
masterParmas.value.number, masterParmas.value.number,
imageFormRef.value.formModel.filePath.map((item) => item.url) imageFormRef.value.formModel.filePathList.map((item) => item.url)
) )
} }
// tabs // tabs
const fileFormRef = ref()
const handleTabsChange=(e)=>{ const handleTabsChange=(e)=>{
console.log(e)
emit('subTabsChick',e) emit('subTabsChick',e)
} }
// //
const fileFormRef = ref() const uploadFile=async(index)=>{
const uploadFile=async(e,index)=>{ let _lists = fileFormRef.value?.map(v => unref(v)?.getElFormRef())
console.log(proxy.$refs) const elForm = _lists[index]
console.log(proxy.$refs['fileFormRef'+(index+1)))
const elForm = unref(fileFormRef)?.getElFormRef()
// //
if (!elForm) return if (!elForm) return
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
console.log(fileFormRef.value.formModel)
emit( emit(
'uploadFile', 'uploadFile',
masterParmas.value.number, 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); const current = ref(props.current);
console.log('555',current.value)
const change = (item, index) => { const change = (item, index) => {
current.value = index current.value = index
emit('change',item,index) emit('change',item,index)

2
src/components/UploadFile/src/UploadFile.vue

@ -8,7 +8,7 @@
v-model:file-list="fileList" v-model:file-list="fileList"
:show-file-list="true" :show-file-list="true"
:auto-upload="autoUpload" :auto-upload="autoUpload"
:action="updateUrl+'?tableId='+upData?.tableId+'&tableName='+ upData?.tableName" :action="updateUrl"
:headers="uploadHeaders" :headers="uploadHeaders"
:limit="props.limit" :limit="props.limit"
:drag="drag" :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[]>([ export const UpImage = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '上传图片', label: '上传图片',
field: 'filePath', field: 'filePathList',
sort: 'custom', sort: 'custom',
isForm: true, isForm: true,
form:{ form:{
@ -164,12 +164,14 @@ export const UpFileRules = reactive({
export const UploadFile = useCrudSchemas(reactive<CrudSchema[]>([ export const UploadFile = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '上传文件', label: '上传文件',
field: 'filePath', field: 'filePathList',
sort: 'custom', sort: 'custom',
isForm: true, isForm: true,
form:{ form:{
component:'UploadFile', 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 detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
itemCodeRow.value = row.number itemCodeRow.value = row.number
tabsExtend.value = 1
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts') detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceAccounts')
} }
@ -312,30 +313,30 @@ const changeTabs = (item) => {
} else if (item.prop == 'Word') { } else if (item.prop == 'Word') {
tabsExtend.value = 2 tabsExtend.value = 2
funcCode.value = 'device_mould_attachment' funcCode.value = 'device_mould_attachment'
apiPage.value = PurchaseDetailApi.getPurchaseDetailPage // apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
detailAllSchemas.value = PurchaseMain.allSchemas // detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') { } else if (item.prop == 'Part') {
tabsExtend.value = 3 tabsExtend.value = 3
apiPage.value = deviceRepairApi.getDeviceRepairPage // apiPage.value = deviceRepairApi.getDeviceRepairPage
detailAllSchemas.value = DeviceRepair.allSchemas // detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'DeviceReportRecord') { } else if (item.prop == 'DeviceReportRecord') {
tabsExtend.value = 3 tabsExtend.value = 3
apiPage.value = BalanceApi.getBalancePage apiPage.value = deviceRepairApi.getDeviceRepairPage
detailAllSchemas.value = Balance.allSchemas detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'RepairRecord') { } else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3 tabsExtend.value = 3
apiPage.value = ExpectinApi.getExpectinPage // apiPage.value = ExpectinApi.getExpectinPage
detailAllSchemas.value = Expectin.allSchemas // detailAllSchemas.value = Expectin.allSchemas
} else if (item.prop == 'MaintenanceRecord') { } else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3 tabsExtend.value = 3
apiPage.value = ExpectinApi.getExpectinPage // apiPage.value = ExpectinApi.getExpectinPage
detailAllSchemas.value = Expectin.allSchemas // 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 = [ tableObjectExtend.value = [
{ {

Loading…
Cancel
Save