Browse Source

保养工单调试

master
ljlong_2630 10 months ago
parent
commit
138cd9363e
  1. 2
      src/api/eam/device/deviceInspectionMain/index.ts
  2. 5
      src/api/eam/device/deviceMaintainOrderMain/index.ts
  3. 131
      src/components/Detail/src/Detail.vue
  4. 13
      src/views/eam/device/deviceInspectionMain/index.vue
  5. 9
      src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts
  6. 11
      src/views/eam/device/deviceMaintainOrderMain/index.vue

2
src/api/eam/device/deviceInspectionMain/index.ts

@ -54,4 +54,4 @@ export const exportDeviceInspectionMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/device-inspection-main/get-import-template' }) return request.download({ url: '/eam/device-inspection-main/get-import-template' })
} }

5
src/api/eam/device/deviceMaintainOrderMain/index.ts

@ -57,4 +57,9 @@ export const exportDeviceMaintainOrderMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/device-maintain-order-main/get-import-template' }) return request.download({ url: '/eam/device-maintain-order-main/get-import-template' })
}
// 保养接单
export const orderClick = (id: number) => {
return request.get({ url: '/eam/device-maintain-order-main/orderClick?id=' + id })
} }

131
src/components/Detail/src/Detail.vue

@ -1,14 +1,28 @@
<template> <template>
<div> <div>
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading"> <el-drawer
v-model="isShowDrawer"
title="详情"
direction="rtl"
size="80%"
v-loading="detailLoading"
>
<template #header> <template #header>
<div class="font-size-18px"> <div class="font-size-18px">
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> {{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span>
</div> </div>
</template> </template>
<ContentWrap v-if="!isBasic"> <ContentWrap v-if="!isBasic">
<Descriptions :data="detailData" labelClassName="label-class-name" label-align="left" direction="vertical" <Descriptions
:column="8" :schema="allSchemas.detailSchema" :columns="2" width="200px" /> :data="detailData"
labelClassName="label-class-name"
label-align="left"
direction="vertical"
:column="8"
:schema="allSchemas.detailSchema"
:columns="2"
width="200px"
/>
</ContentWrap> </ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" /> <Tabs :tabsList="tabsList" :current="current" @change="change" />
@ -16,15 +30,32 @@
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[100%]"> <ContentWrap class="w-[100%]">
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead v-if="!isBasic" :HeadButttondata="HeadButttondata" :number="masterParmas.maintenanceNumber" <TableHead
@button-base-click="buttonBaseClick" :routeName="routeName" @searchFormClick="searchFormClick" v-if="!isBasic"
:allSchemas="detailAllSchemas" /> :HeadButttondata="HeadButttondata"
:number="masterParmas.maintenanceNumber"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="detailAllSchemas"
/>
<!-- 默认单表展现 --> <!-- 默认单表展现 -->
<Descriptions v-if="isBasic && !tabsExtend" :data="detailData" :schema="allSchemas.detailSchema" :columns="2" /> <Descriptions
v-if="isBasic && !tabsExtend"
:data="detailData"
:schema="allSchemas.detailSchema"
:columns="2"
/>
<!-- 单表切换tabs 展现table --> <!-- 单表切换tabs 展现table -->
<Table v-if="isBasic && tabsExtend" :columns="detailAllSchemasRef.tableColumns" :data="tableObjectRef.tableList" <Table
:loading="tableObjectRef.loading" :pagination="{ total: tableObjectRef.total }" v-if="isBasic && tabsExtend"
v-model:pageSize="tableObjectRef.pageSize" v-model:currentPage="tableObjectRef.currentPage"> :columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
>
<!-- <template #action="{ row }"> <!-- <template #action="{ row }">
<ButtonBase <ButtonBase
:Butttondata="buttondata" :Butttondata="buttondata"
@ -32,34 +63,68 @@
/> />
</template> --> </template> -->
</Table> </Table>
<Table v-if="!isBasic && fromeWhere != 'countPlan'" :columns="detailAllSchemasRef.tableColumns" <Table
:data="tableObjectRef.tableList" :loading="tableObjectRef.loading" v-if="!isBasic && fromeWhere != 'countPlan'"
:pagination="{ total: tableObjectRef.total }" v-model:pageSize="tableObjectRef.pageSize" :columns="detailAllSchemasRef.tableColumns"
v-model:currentPage="tableObjectRef.currentPage"> :data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
>
<template #photos="{ row }"> <template #photos="{ row }">
<div v-for="(item, index) in row.photos.split(',')" :key="index" style="color: #409eff; cursor: pointer" <div
@click="openImage(item)">{{ item }}</div> v-for="(item, index) in row.photos.split(',')"
:key="index"
style="color: #409eff; cursor: pointer"
@click="openImage(item)"
>{{ item }}</div
>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="buttondata" @button-base-click="buttonTableClick($event, row)" /> <ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
<DetailTable v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer" <DetailTable
:columns="detailAllSchemasRef.tableColumns" :data="tableObjectRef.tableList" :allList="allList" v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer"
:countScopeType="countScopeType" :key="updateKey"> :columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:allList="allList"
:countScopeType="countScopeType"
:key="updateKey"
>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="buttondata" @button-base-click="buttonTableClick($event, row)" /> <ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</DetailTable> </DetailTable>
</ContentWrap> </ContentWrap>
</div> </div>
</el-drawer> </el-drawer>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="submitForm" :rules="detailAllSchemasRules" :formAllSchemas="detailAllSchemas" <BasicForm
:isBusiness="false" :apiUpdate="apiUpdate" :apiCreate="apiCreate" :fromeWhere="fromeWhere" :isDetail="true" ref="formRef"
@searchTableSuccess="searchTableSuccess" :detailData="detailData" @submitForm="submitForm" @success="submitForm"
@selectChangeDetail="selectChangeDetail" :formTypeDetail="formTypeDetail" :countPlanAllList="countPlanAllList" :rules="detailAllSchemasRules"
:isSearchTableItem="isSearchTableItem" /> :formAllSchemas="detailAllSchemas"
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
:fromeWhere="fromeWhere"
:isDetail="true"
@searchTableSuccess="searchTableSuccess"
:detailData="detailData"
@submitForm="submitForm"
@selectChangeDetail="selectChangeDetail"
:formTypeDetail="formTypeDetail"
:countPlanAllList="countPlanAllList"
:isSearchTableItem="isSearchTableItem"
/>
</div> </div>
</template> </template>
@ -283,11 +348,11 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
setBeiJian() setBeiJian()
let detailButtonAdd: any = [] let detailButtonAdd: any = []
detailButtonAdd = props.isShowAddBtn ? [ detailButtonAdd = props.isShowAddBtn?[
defaultButtons.defaultAddBtn({ defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row, ['1'])
}) })
] : [] ]:[]
HeadButttondata.value = [...detailButtonAdd] HeadButttondata.value = [...detailButtonAdd]
// //
if (!props.detailButtonIsShow) { if (!props.detailButtonIsShow) {
@ -374,8 +439,8 @@ const buttonBaseClick = (val, item) => {
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
console.log(val) console.log(val)
console.log(row) console.log(row)
if (val == 'edit') { if (val == 'edit') {
// //
openForm('update', row) openForm('update', row)
@ -397,7 +462,7 @@ const openForm = async (type: string, row?: number) => {
let isChargePeoples = false let isChargePeoples = false
let isItemNUmbersTrue = false let isItemNUmbersTrue = false
isTrue = detailAllSchemasRef.value.tableColumns.some((item) => item.field == 'maintenances') isTrue = detailAllSchemasRef.value.tableColumns.some((item) => item.field == 'maintenances')
isChargePeoples = detailAllSchemasRef.value.tableColumns.some( isChargePeoples = detailAllSchemasRef.value.tableColumns.some(
(item) => item.field == 'chargePeoples' (item) => item.field == 'chargePeoples'
) )
isItemNUmbersTrue = detailAllSchemasRef.value.tableColumns.some( isItemNUmbersTrue = detailAllSchemasRef.value.tableColumns.some(
@ -408,7 +473,7 @@ const openForm = async (type: string, row?: number) => {
row.maintenances = row.maintenances.split(',').map(Number) row.maintenances = row.maintenances.split(',').map(Number)
} }
} }
if (isChargePeoples) { if(isChargePeoples) {
if (row.chargePeoples && isString(row.chargePeoples)) { if (row.chargePeoples && isString(row.chargePeoples)) {
row.chargePeoples = row.chargePeoples.split(',').map(Number) row.chargePeoples = row.chargePeoples.split(',').map(Number)
} }
@ -453,7 +518,7 @@ const handleDelete = async (id: number) => {
await getList() await getList()
updateKey.value += 1 updateKey.value += 1
setBeiJian() setBeiJian()
} catch { } } catch {}
} }
// //
const searchFormClick = async (searchData) => { const searchFormClick = async (searchData) => {

13
src/views/eam/device/deviceInspectionMain/index.vue

@ -55,18 +55,22 @@
<!-- 详情 --> <!-- 详情 -->
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceInspectionDetail.allSchemas" /> --> <!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceInspectionDetail.allSchemas" /> -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="DeviceInspectionMain.allSchemas" <Detail ref="detailRef"
:isBasic="false"
:allSchemas="DeviceInspectionMain.allSchemas"
:detailAllSchemas="DeviceInspectionDetail.allSchemas" :detailAllSchemas="DeviceInspectionDetail.allSchemas"
:detailAllSchemasRules="DeviceInspectionDetailRules" :detailAllSchemasRules="DeviceInspectionDetailRules"
:apiCreate="DeviceInspectionDetailApi.createDeviceInspectionDetail" :apiCreate="DeviceInspectionDetailApi.createDeviceInspectionDetail"
:apiUpdate="DeviceInspectionDetailApi.updateDeviceInspectionDetail" :apiUpdate="DeviceInspectionDetailApi.updateDeviceInspectionDetail"
:apiPage="DeviceInspectionDetailApi.getDeviceInspectionDetailPage" :apiPage="DeviceInspectionDetailApi.getDeviceInspectionDetailPage"
:apiDelete="DeviceInspectionDetailApi.deleteDeviceInspectionDetail" :Echo="Echo" :apiDelete="DeviceInspectionDetailApi.deleteDeviceInspectionDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
@detailOpenForm="detailOpenForm" @detailOpenForm="detailOpenForm"
:detailValidate="detailValidate" :detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm" @detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true" /> :isSearchTableItem="true"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/device-inspection-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/eam/device-inspection-main/import" :importTemplateData="importTemplateData"
@ -308,7 +312,6 @@ const onChange = (field, cur, item) => {
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
debugger
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -412,13 +415,11 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
debugger
data.subList = tableData.value.map((item) => { data.subList = tableData.value.map((item) => {
item.chargePeoples = item.chargePeoples.join(','); item.chargePeoples = item.chargePeoples.join(',');
return item; return item;
}) // }) //
console.log(data.subList) console.log(data.subList)
debugger
try { try {
if (formType === 'create') { if (formType === 'create') {
await DeviceInspectionMainApi.createDeviceInspectionMain(data) await DeviceInspectionMainApi.createDeviceInspectionMain(data)

9
src/views/eam/device/deviceMaintainOrderMain/deviceMaintainOrderMain.data.ts

@ -10,9 +10,9 @@ import * as ItemApi from '@/api/eam/basic/item'
const userStore = useUserStore() const userStore = useUserStore()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: undefined, flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: undefined }) const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: undefined, flag: undefined })
const engineerList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 2}) const engineerList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: undefined, flag: 2})
const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE') const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE')
// 表单校验 // 表单校验
@ -310,7 +310,8 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
api: () => dutyUserList, api: () => dutyUserList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userList.filter(item=>cellValue.includes(item.id)).map(cur=>cur.name).join(',')
return userList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',')
}, },
form: { form: {
component: 'Select', component: 'Select',

11
src/views/eam/device/deviceMaintainOrderMain/index.vue

@ -82,7 +82,7 @@
@detailOpenForm="detailOpenForm" @detailOpenForm="detailOpenForm"
:detailValidate="detailValidate" :detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm" @detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true" :isSearchTableItem="true"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -222,9 +222,11 @@ const butttondata = (row) => {
return [ return [
// defaultButtons.mainListEditBtn(null), // // defaultButtons.mainListEditBtn(null), //
defaultButtons.acceptOrderBtn({ defaultButtons.acceptOrderBtn({
hide: !( hide: !(
row.status == 'PENDING' && row.status == 'PENDING' &&
userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker') (userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer') ||
userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker'))
) )
}), // }), //
// defaultButtons.turnOrderBtn({ // defaultButtons.turnOrderBtn({
@ -340,7 +342,10 @@ const searchFormClick = (searchData) => {
// //
function acceptOrder(row) { function acceptOrder(row) {
DeviceMaintainOrderMainApi.orderStepChange(row) DeviceMaintainOrderMainApi.orderClick(row.id).then(() => {
message.success('接单成功')
getList();
});
} }
// //
function turnOrder() {} function turnOrder() {}

Loading…
Cancel
Save