合并
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台
|
|||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
||||||
# VITE_APP_BASE_API = 'http://58.17.134.85:8899'
|
# VITE_APP_BASE_API = 'http://58.17.134.85:8899'
|
||||||
# GO开发环境
|
# GO开发环境
|
||||||
VITE_APP_BASE_API_GO = 'http://xny.yj-3d.com:7464'
|
VITE_APP_BASE_API_GO = 'http://xny.yj-3d.com:7464'
|
||||||
|
@ -16,6 +16,17 @@ export const listContactnotice = (query?: ContactnoticeQuery): AxiosPromise<Cont
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id查询项目班组班组长信息列表
|
||||||
|
* @param projectId
|
||||||
|
*/
|
||||||
|
export const listProjectTeamForeman = (projectId: string | number): AxiosPromise<any[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/project/projectTeam/listForeman/' + projectId,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询联系单详细
|
* 查询联系单详细
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import request from '@/utils/request-go';
|
import request from '@/utils/request-go';
|
||||||
|
import request1 from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import {
|
import {
|
||||||
QualityVO,
|
QualityVO,
|
||||||
@ -172,7 +173,7 @@ export const getweatherList = (): AxiosPromise<weatherVO[]> => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const getSafetyDay = (id?: string): AxiosPromise<safetyDayVO> => {
|
export const getSafetyDay = (id?: string): AxiosPromise<safetyDayVO> => {
|
||||||
return request({
|
return request1({
|
||||||
url: '/project/project/safetyDay/' + id,
|
url: '/project/project/safetyDay/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
|
@ -1,63 +1,45 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request-go';
|
||||||
import { AxiosPromise } from 'axios';
|
// 查询机械列表
|
||||||
import { MachineryForm, MachineryQuery, MachineryVO } from '@/api/machinery/machinery/types';
|
export function listBusMachinery(query: object) {
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询机械列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listMachinery = (query?: MachineryQuery): AxiosPromise<MachineryVO[]> => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machinery/list',
|
url: '/zm/api/v1/system/busMachinery/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 查询机械详细
|
||||||
/**
|
export function getBusMachinery(id: number) {
|
||||||
* 查询机械详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getMachinery = (id: string | number): AxiosPromise<MachineryVO> => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machinery/' + id,
|
url: '/zm/api/v1/system/busMachinery/get',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id: id.toString()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 新增机械
|
||||||
/**
|
export function addBusMachinery(data: object) {
|
||||||
* 新增机械
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addMachinery = (data: MachineryForm): AxiosPromise<string | number> => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machinery',
|
url: '/zm/api/v1/system/busMachinery/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 修改机械
|
||||||
/**
|
export function updateBusMachinery(data: object) {
|
||||||
* 修改机械
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateMachinery = (data: MachineryForm) => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machinery',
|
url: '/zm/api/v1/system/busMachinery/edit',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 删除机械
|
||||||
/**
|
export function delBusMachinery(ids: number[]) {
|
||||||
* 删除机械
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delMachinery = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machinery/' + id,
|
url: '/zm/api/v1/system/busMachinery/delete',
|
||||||
method: 'delete'
|
method: 'delete',
|
||||||
|
data: {
|
||||||
|
ids: ids
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
@ -1,63 +1,45 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request-go';
|
||||||
import { AxiosPromise } from 'axios';
|
// 查询机械详情列表
|
||||||
import { MachineryDetailForm, MachineryDetailQuery, MachineryDetailVO } from '@/api/machinery/machineryDetail/types';
|
export function listBusMachineryDetail(query: object) {
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询机械详情列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listMachineryDetail = (query?: MachineryDetailQuery): AxiosPromise<MachineryDetailVO[]> => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machineryDetail/list',
|
url: '/zm/api/v1/system/busMachineryDetail/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 查询机械详情详细
|
||||||
/**
|
export function getBusMachineryDetail(id: number) {
|
||||||
* 查询机械详情详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getMachineryDetail = (id: string | number): AxiosPromise<MachineryDetailVO> => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machineryDetail/' + id,
|
url: '/zm/api/v1/system/busMachineryDetail/get',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id: id.toString()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 新增机械详情
|
||||||
/**
|
export function addBusMachineryDetail(data: object) {
|
||||||
* 新增机械详情
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addMachineryDetail = (data: MachineryDetailForm): AxiosPromise<string | number> => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machineryDetail',
|
url: '/zm/api/v1/system/busMachineryDetail/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 修改机械详情
|
||||||
/**
|
export function updateBusMachineryDetail(data: object) {
|
||||||
* 修改机械详情
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateMachineryDetail = (data: MachineryDetailForm) => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machineryDetail',
|
url: '/zm/api/v1/system/busMachineryDetail/edit',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
// 删除机械详情
|
||||||
/**
|
export function delBusMachineryDetail(ids: number[]) {
|
||||||
* 删除机械详情
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delMachineryDetail = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/machinery/machineryDetail/' + id,
|
url: '/zm/api/v1/system/busMachineryDetail/delete',
|
||||||
method: 'delete'
|
method: 'delete',
|
||||||
|
data: {
|
||||||
|
ids: ids
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import request from '@/utils/request-go';
|
import requestGo from '@/utils/request-go';
|
||||||
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { CompanyForm, CompanyQuery, CompanyVO } from '@/api/materials/company/types';
|
import { CompanyForm, CompanyQuery, CompanyVO } from '@/api/materials/company/types';
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ import { CompanyForm, CompanyQuery, CompanyVO } from '@/api/materials/company/ty
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const listCompany = (query?: CompanyQuery): AxiosPromise<CompanyVO[]> => {
|
export const listCompany = (query?: CompanyQuery): AxiosPromise<CompanyVO[]> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busCompany/list',
|
url: '/zm/api/v1/system/busCompany/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import request from '@/utils/request-go';
|
import requestGo from '@/utils/request-go';
|
||||||
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { MaterialsForm, MaterialsQuery, MaterialsVO } from '@/api/materials/materials/types';
|
import { MaterialsForm, MaterialsQuery, MaterialsVO } from '@/api/materials/materials/types';
|
||||||
|
|
||||||
@ -8,7 +9,7 @@ import { MaterialsForm, MaterialsQuery, MaterialsVO } from '@/api/materials/mate
|
|||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const listMaterials = (query?: MaterialsQuery): AxiosPromise<MaterialsVO[]> => {
|
export const listMaterials = (query?: MaterialsQuery): AxiosPromise<MaterialsVO[]> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busEquipmentMaterials/list',
|
url: '/zm/api/v1/system/busEquipmentMaterials/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
@ -20,7 +21,7 @@ export const listMaterials = (query?: MaterialsQuery): AxiosPromise<MaterialsVO[
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const getMaterials = (id: string | number): AxiosPromise<MaterialsVO> => {
|
export const getMaterials = (id: string | number): AxiosPromise<MaterialsVO> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busEquipmentMaterials/get',
|
url: '/zm/api/v1/system/busEquipmentMaterials/get',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import request from '@/utils/request-go';
|
import requestGo from '@/utils/request-go';
|
||||||
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { MaterialsInventoryForm, MaterialsInventoryQuery, MaterialsInventoryVO } from '@/api/materials/materialsInventory/types';
|
import { MaterialsInventoryForm, MaterialsInventoryQuery, MaterialsInventoryVO } from '@/api/materials/materialsInventory/types';
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ import { MaterialsInventoryForm, MaterialsInventoryQuery, MaterialsInventoryVO }
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const listMaterialsInventory = (query?: MaterialsInventoryQuery): AxiosPromise<MaterialsInventoryVO[]> => {
|
export const listMaterialsInventory = (query?: MaterialsInventoryQuery): AxiosPromise<MaterialsInventoryVO[]> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busEquipmentMaterialsInventory/excellist',
|
url: '/zm/api/v1/system/busEquipmentMaterialsInventory/excellist',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request-go';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import {
|
import {
|
||||||
ConstructionUserForm,
|
ConstructionUserForm,
|
||||||
@ -23,7 +23,7 @@ import requestGo from '@/utils/request-go';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const listConstructionMonth = (query?: ConstructionMonthQuery): AxiosPromise<AttendanceMonthVO[]> => {
|
export const listConstructionMonth = (query?: ConstructionMonthQuery): AxiosPromise<AttendanceMonthVO[]> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/wxApplet/wxApplet/busAttendance/byOpenId',
|
url: '/zm/api/wxApplet/wxApplet/busAttendance/byOpenId',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
@ -62,7 +62,7 @@ export const listConstructionUserInTeam = (query?: ConstructionUserQuery): Axios
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const getConstructionUser = (id: string | number): AxiosPromise<ConstructionUserVO> => {
|
export const getConstructionUser = (id: string | number): AxiosPromise<ConstructionUserVO> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/getDetails?id=' + id,
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/getDetails?id=' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
@ -73,7 +73,7 @@ export const getConstructionUser = (id: string | number): AxiosPromise<Construct
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const transferConstructionUser = (data: skipType) => {
|
export const transferConstructionUser = (data: skipType) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/changePay',
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/changePay',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
@ -84,7 +84,7 @@ export const transferConstructionUser = (data: skipType) => {
|
|||||||
* 查询项目以及项目下的分包公司列表
|
* 查询项目以及项目下的分包公司列表
|
||||||
*/
|
*/
|
||||||
export const getProjectContractorList = () => {
|
export const getProjectContractorList = () => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/sysProject/list?pageNum=1&pageSize=1000',
|
url: '/zm/api/v1/system/sysProject/list?pageNum=1&pageSize=1000',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
@ -95,7 +95,7 @@ export const getProjectContractorList = () => {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<string | number> => {
|
export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<string | number> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/add',
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
@ -107,7 +107,7 @@ export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<st
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const updateConstructionUser = (data: ConstructionUserForm) => {
|
export const updateConstructionUser = (data: ConstructionUserForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionUser/pcEdit',
|
url: '/zm/api/v1/system/busConstructionUser/pcEdit',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
@ -119,7 +119,7 @@ export const updateConstructionUser = (data: ConstructionUserForm) => {
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const delConstructionUser = (data) => {
|
export const delConstructionUser = (data) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/delete',
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/delete',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data
|
data
|
||||||
@ -131,7 +131,7 @@ export const delConstructionUser = (data) => {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) => {
|
export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/changeState',
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/changeState',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: data
|
data: data
|
||||||
@ -143,7 +143,7 @@ export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) =
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayCardForm) => {
|
export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayCardForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionUser/oneClickOpen',
|
url: '/zm/api/v1/system/busConstructionUser/oneClickOpen',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
@ -155,7 +155,7 @@ export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayC
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPlayCardForm) => {
|
export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPlayCardForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionUser/clockingCondition',
|
url: '/zm/api/v1/system/busConstructionUser/clockingCondition',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
@ -167,7 +167,7 @@ export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPl
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) => {
|
export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/payEdit',
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/payEdit',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
@ -179,7 +179,7 @@ export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) =
|
|||||||
* @param query
|
* @param query
|
||||||
*/
|
*/
|
||||||
export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionUser/departureRecord',
|
url: '/zm/api/v1/system/busConstructionUser/departureRecord',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: query
|
data: query
|
||||||
@ -191,7 +191,7 @@ export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
|||||||
* @param query
|
* @param query
|
||||||
*/
|
*/
|
||||||
export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionUser/templateExport',
|
url: '/zm/api/v1/system/busConstructionUser/templateExport',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
@ -208,7 +208,7 @@ export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateF
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionUser/departure',
|
url: '/zm/api/v1/system/busConstructionUser/departure',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import request from '@/utils/request-go';
|
import requestGo from '@/utils/request-go';
|
||||||
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { QualityConstructionLogVO, QualityConstructionLogForm, QualityConstructionLogQuery } from '@/api/quality/qualityConstructionLog/types';
|
import { QualityConstructionLogVO, QualityConstructionLogForm, QualityConstructionLogQuery } from '@/api/quality/qualityConstructionLog/types';
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ import { QualityConstructionLogVO, QualityConstructionLogForm, QualityConstructi
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const listQualityConstructionLog = (query?: QualityConstructionLogQuery): AxiosPromise<QualityConstructionLogVO[]> => {
|
export const listQualityConstructionLog = (query?: QualityConstructionLogQuery): AxiosPromise<QualityConstructionLogVO[]> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionLog/list',
|
url: '/zm/api/v1/system/busConstructionLog/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
@ -21,8 +22,8 @@ export const listQualityConstructionLog = (query?: QualityConstructionLogQuery):
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const getQualityConstructionLog = (id: string | number): AxiosPromise<QualityConstructionLogVO> => {
|
export const getQualityConstructionLog = (id: string | number): AxiosPromise<QualityConstructionLogVO> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: 'zm/api/v1/system/busConstructionLog/get',
|
url: '/zm/api/v1/system/busConstructionLog/get',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id }
|
params: { id }
|
||||||
});
|
});
|
||||||
@ -57,7 +58,7 @@ export const updateQualityConstructionLog = (data: QualityConstructionLogForm) =
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const delQualityConstructionLog = (id: string | number | Array<string | number>) => {
|
export const delQualityConstructionLog = (id: string | number | Array<string | number>) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busConstructionLog/delete',
|
url: '/zm/api/v1/system/busConstructionLog/delete',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: { ids: id }
|
data: { ids: id }
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import request from '@/utils/request-go';
|
import requestGo from '@/utils/request-go';
|
||||||
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { SafetyWeeklyReportForm, SafetyWeeklyReportQuery, SafetyWeeklyReportVO } from '@/api/safety/safetyWeeklyReport/types';
|
import { SafetyWeeklyReportForm, SafetyWeeklyReportQuery, SafetyWeeklyReportVO } from '@/api/safety/safetyWeeklyReport/types';
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ import { SafetyWeeklyReportForm, SafetyWeeklyReportQuery, SafetyWeeklyReportVO }
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const listSafetyWeeklyReport = (query?: SafetyWeeklyReportQuery): AxiosPromise<SafetyWeeklyReportVO[]> => {
|
export const listSafetyWeeklyReport = (query?: SafetyWeeklyReportQuery): AxiosPromise<SafetyWeeklyReportVO[]> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busWeeklySecurityReport/list',
|
url: '/zm/api/v1/system/busWeeklySecurityReport/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
@ -32,7 +33,7 @@ export const getSafetyWeeklyReport = (id: string | number): AxiosPromise<SafetyW
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const addSafetyWeeklyReport = (data: SafetyWeeklyReportForm) => {
|
export const addSafetyWeeklyReport = (data: SafetyWeeklyReportForm) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busWeeklySecurityReport/add',
|
url: '/zm/api/v1/system/busWeeklySecurityReport/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
@ -56,7 +57,7 @@ export const updateSafetyWeeklyReport = (data: SafetyWeeklyReportForm) => {
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const delSafetyWeeklyReport = (id: string | number | Array<string | number>) => {
|
export const delSafetyWeeklyReport = (id: string | number | Array<string | number>) => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/zm/api/v1/system/busWeeklySecurityReport/delete',
|
url: '/zm/api/v1/system/busWeeklySecurityReport/delete',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: { ids: id }
|
data: { ids: id }
|
||||||
|
@ -226,7 +226,12 @@ watch(
|
|||||||
);
|
);
|
||||||
// 上传前校检格式和大小
|
// 上传前校检格式和大小
|
||||||
const handleBeforeUpload = (file: any) => {
|
const handleBeforeUpload = (file: any) => {
|
||||||
if (!validateFile(file)) return false;
|
if (!validateFile(file)) {
|
||||||
|
if (props.isGo) {
|
||||||
|
fileList.value = [];
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
proxy?.$modal.loading('正在上传文件,请稍候...');
|
proxy?.$modal.loading('正在上传文件,请稍候...');
|
||||||
number.value++;
|
number.value++;
|
||||||
return true;
|
return true;
|
||||||
@ -266,7 +271,6 @@ interface UploadFileWithOssId extends UploadFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => {
|
const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => {
|
||||||
console.log('🚀 ~ handleUploadSuccess ~ res:', res.code);
|
|
||||||
if (res.code === 200 || res.code === 0) {
|
if (res.code === 200 || res.code === 0) {
|
||||||
console.log('上传成功');
|
console.log('上传成功');
|
||||||
// 上传成功,不管 data 是否为空
|
// 上传成功,不管 data 是否为空
|
||||||
@ -277,6 +281,9 @@ const handleUploadSuccess = (res: any, file: UploadFileWithOssId) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('失败', res);
|
console.log('失败', res);
|
||||||
|
if (props.isGo) {
|
||||||
|
fileList.value = [];
|
||||||
|
}
|
||||||
|
|
||||||
number.value--;
|
number.value--;
|
||||||
proxy?.$modal.closeLoading();
|
proxy?.$modal.closeLoading();
|
||||||
@ -330,12 +337,15 @@ const handleDelete = async (index: string | number, type?: string) => {
|
|||||||
delOss(index);
|
delOss(index);
|
||||||
fileList.value = fileList.value.filter((f) => f.ossId !== index);
|
fileList.value = fileList.value.filter((f) => f.ossId !== index);
|
||||||
} else {
|
} else {
|
||||||
let ossId = fileList.value[index].ossId;
|
if (!props.isGo) {
|
||||||
delOss(ossId);
|
let ossId = fileList.value[index].ossId;
|
||||||
|
delOss(ossId);
|
||||||
|
}
|
||||||
index = parseInt(index as string);
|
index = parseInt(index as string);
|
||||||
fileList.value.splice(index, 1);
|
fileList.value.splice(index, 1);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
// fileList.value = [];
|
||||||
emit('handleRemove');
|
emit('handleRemove');
|
||||||
emit('update:modelValue', listToString(fileList.value));
|
emit('update:modelValue', listToString(fileList.value));
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,15 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
isGo: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 图片上传路径
|
||||||
|
action: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
// 是否支持压缩,默认否
|
// 是否支持压缩,默认否
|
||||||
compressSupport: {
|
compressSupport: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -79,8 +88,8 @@ const uploadList = ref<any[]>([]);
|
|||||||
const dialogImageUrl = ref('');
|
const dialogImageUrl = ref('');
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
|
|
||||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
const baseUrl = props.isGo ? import.meta.env.VITE_APP_BASE_API_GO : import.meta.env.VITE_APP_BASE_API;
|
||||||
const uploadImgUrl = ref(baseUrl + '/resource/oss/upload'); // 上传的图片服务器地址
|
const uploadImgUrl = ref(baseUrl + props.action ? props.action : '/resource/oss/upload'); // 上传的图片服务器地址
|
||||||
const headers = ref(globalHeaders());
|
const headers = ref(globalHeaders());
|
||||||
|
|
||||||
const fileList = ref<any[]>([]);
|
const fileList = ref<any[]>([]);
|
||||||
|
@ -51,7 +51,7 @@ const instance = axios.create({
|
|||||||
});
|
});
|
||||||
import sign from '@/utils/sign.js';
|
import sign from '@/utils/sign.js';
|
||||||
import { getGoToken } from '@/utils/auth';
|
import { getGoToken } from '@/utils/auth';
|
||||||
const BASE_URL = 'http://58.17.134.85:8919';
|
const BASE_URL = 'http://58.17.134.85:8920';
|
||||||
const acceptConfig = ['.zip', '.rar']; //文件
|
const acceptConfig = ['.zip', '.rar']; //文件
|
||||||
// const acceptConfig = {
|
// const acceptConfig = {
|
||||||
// // image: ['gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp'],
|
// // image: ['gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp'],
|
||||||
|
244
src/components/uploadImg/index.vue
Normal file
244
src/components/uploadImg/index.vue
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
<template>
|
||||||
|
<div class="up-img" v-if="limit > 1">
|
||||||
|
<el-upload
|
||||||
|
v-model:file-list="dataFileList"
|
||||||
|
:limit="limit"
|
||||||
|
:action="action"
|
||||||
|
:multiple="multiple"
|
||||||
|
:list-type="listType"
|
||||||
|
:on-success="handleAvatarSuccess"
|
||||||
|
:on-preview="handlePictureCardPreview"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:before-upload="beforeAvatarUpload"
|
||||||
|
:data="dataParam"
|
||||||
|
:name="fileName"
|
||||||
|
:headers="headers"
|
||||||
|
ref="elUploadRef"
|
||||||
|
>
|
||||||
|
<el-icon><Plus /></el-icon>
|
||||||
|
</el-upload>
|
||||||
|
<el-dialog v-model="dialogVisible">
|
||||||
|
<img w-full :src="dialogImageUrl" alt="Preview Image" />
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div class="up-img">
|
||||||
|
<el-upload
|
||||||
|
ref="elUploadRef"
|
||||||
|
v-model:file-list="dataFileList"
|
||||||
|
:limit="limit"
|
||||||
|
class="avatar-uploader"
|
||||||
|
:action="action"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-success="handleAvatarSuccess"
|
||||||
|
:before-upload="beforeAvatarUpload"
|
||||||
|
:on-preview="handlePictureCardPreview"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:data="dataParam"
|
||||||
|
:name="fileName"
|
||||||
|
:headers="headers"
|
||||||
|
>
|
||||||
|
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
|
||||||
|
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||||
|
</el-upload>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, ref, computed, getCurrentInstance, reactive, toRefs } from 'vue';
|
||||||
|
import type { UploadProps, UploadUserFile, UploadInstance } from 'element-plus';
|
||||||
|
import { ElMessage, genFileId } from 'element-plus';
|
||||||
|
import _ from 'lodash';
|
||||||
|
import sign from '@/utils/sign.js';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'uploadImg',
|
||||||
|
props: {
|
||||||
|
action: { type: String, default: '' }, //上传地址
|
||||||
|
name: { type: String, default: 'file' }, //上传文件类型
|
||||||
|
limit: { type: Number, default: 1 }, //上传最大数量
|
||||||
|
method: { type: String, default: 'post' }, //设置上传请求方法
|
||||||
|
multiple: { type: Boolean, default: true }, //是否支持多选文件
|
||||||
|
showFileList: { type: Boolean, default: true }, //是否显示已上传文件列表
|
||||||
|
drag: { type: Boolean, default: false }, //是否启用拖拽上传
|
||||||
|
accept: { type: String, default: '' }, //接受上传的文件类型格式
|
||||||
|
disabled: { type: Boolean, default: false }, //是否是否禁止上传
|
||||||
|
listType: { type: String, default: 'picture-card' }, //是否启用拖拽上传
|
||||||
|
uploadSize: { type: Number, default: 100 }, //上传文件大小
|
||||||
|
modelValue: {
|
||||||
|
type: Array,
|
||||||
|
default: function () {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uploadData: { type: Object, default: {} },
|
||||||
|
fileName: {
|
||||||
|
type: String,
|
||||||
|
default: 'file'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const baseURL: string | undefined | boolean = import.meta.env.VITE_APP_BASE_API_GO;
|
||||||
|
const { proxy } = getCurrentInstance() as any;
|
||||||
|
const token = proxy?.$cache.local.get('goToken');
|
||||||
|
const dialogImageUrl = ref('');
|
||||||
|
const elUploadRef = ref<UploadInstance>();
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const imageUrl = ref('');
|
||||||
|
const state = reactive({
|
||||||
|
fileName: props.fileName
|
||||||
|
});
|
||||||
|
const headers = reactive({
|
||||||
|
Authorization: 'Bearer ' + token,
|
||||||
|
...sign({ token: token, ...props.uploadData })
|
||||||
|
});
|
||||||
|
const dataParam = reactive({
|
||||||
|
token: token,
|
||||||
|
...props.uploadData
|
||||||
|
});
|
||||||
|
let uploadedFile: Array<any> = [];
|
||||||
|
const dataFileList = computed({
|
||||||
|
get: () => {
|
||||||
|
let value: Array<UploadUserFile> = (props.modelValue as UploadUserFile[]) || [];
|
||||||
|
if (value.length) {
|
||||||
|
value.map((item: UploadUserFile) => {
|
||||||
|
if (item.url) {
|
||||||
|
// item.url = proxy.getUpFileUrl(item.url);
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
uploadedFile = _.cloneDeep(value);
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
set: (val) => {
|
||||||
|
emit('uploadData', val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
||||||
|
if (rawFile.type.substring(0, 5) !== 'image') {
|
||||||
|
ElMessage.error('请上传图片文件');
|
||||||
|
return false;
|
||||||
|
} else if (rawFile.size / 1024 / 1024 > props.uploadSize) {
|
||||||
|
ElMessage.error('上传文件超过' + props.uploadSize + 'M');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
const handleRemove: UploadProps['onRemove'] = (file) => {
|
||||||
|
uploadedFile.splice(
|
||||||
|
uploadedFile.findIndex((item: any) => item.uid === file.uid),
|
||||||
|
1
|
||||||
|
);
|
||||||
|
setDataFileList();
|
||||||
|
};
|
||||||
|
const handleExceed = (files) => {
|
||||||
|
elUploadRef.value!.clearFiles();
|
||||||
|
const file = files[0];
|
||||||
|
file.uid = genFileId();
|
||||||
|
elUploadRef.value!.handleStart(file);
|
||||||
|
elUploadRef.value!.submit();
|
||||||
|
// ElMessage.error('最多可上传' + props.limit + '个文件,已超出最大限制数。');
|
||||||
|
};
|
||||||
|
const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
|
||||||
|
dialogImageUrl.value = uploadFile.url!;
|
||||||
|
dialogVisible.value = true;
|
||||||
|
};
|
||||||
|
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
|
||||||
|
emit('uploadImageAuth', response); //返回认证的数据
|
||||||
|
if (props.limit == 1) {
|
||||||
|
uploadedFile = [];
|
||||||
|
imageUrl.value = URL.createObjectURL(uploadFile.raw!);
|
||||||
|
}
|
||||||
|
uploadedFile = uploadedFile.filter((item: UploadUserFile) => {
|
||||||
|
return item.raw?.uid != uploadFile.raw?.uid;
|
||||||
|
});
|
||||||
|
if (response.code === 0) {
|
||||||
|
// if (response.data.name) {
|
||||||
|
// uploadedFile.push({
|
||||||
|
// // 单图
|
||||||
|
// name: response.data.name,
|
||||||
|
// url: response.data.path,
|
||||||
|
// fileType: response.data.type,
|
||||||
|
// size: response.data.size,
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// console.log(response.data);
|
||||||
|
// if (response.data.list) {
|
||||||
|
// uploadedFile.push({
|
||||||
|
// // 多图
|
||||||
|
// name: response.data.list[0].name,
|
||||||
|
// url: response.data.list[0].path,
|
||||||
|
// fileType: response.data.list[0].type,
|
||||||
|
// size: response.data.list[0].size,
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
uploadedFile.push({
|
||||||
|
// 多图
|
||||||
|
name: response.data[0].name,
|
||||||
|
url: response.data[0].path,
|
||||||
|
fileType: response.data[0].type,
|
||||||
|
size: response.data[0].size
|
||||||
|
});
|
||||||
|
// }
|
||||||
|
|
||||||
|
setDataFileList();
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.message);
|
||||||
|
imageUrl.value = '';
|
||||||
|
}
|
||||||
|
emit('uploadImageAuth1', uploadedFile); //返回认证的数据
|
||||||
|
};
|
||||||
|
const setDataFileList = () => {
|
||||||
|
dataFileList.value = uploadedFile;
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
dataFileList,
|
||||||
|
imageUrl,
|
||||||
|
baseURL,
|
||||||
|
dialogVisible,
|
||||||
|
dialogImageUrl,
|
||||||
|
handleExceed,
|
||||||
|
beforeAvatarUpload,
|
||||||
|
handleRemove,
|
||||||
|
handlePictureCardPreview,
|
||||||
|
handleAvatarSuccess,
|
||||||
|
dataParam,
|
||||||
|
headers,
|
||||||
|
elUploadRef,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.up-img :deep(.avatar-uploader .avatar) {
|
||||||
|
width: 178px;
|
||||||
|
height: 178px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.up-img :deep(.avatar-uploader .el-upload) {
|
||||||
|
border: 1px dashed var(--el-border-color);
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: var(--el-transition-duration-fast);
|
||||||
|
}
|
||||||
|
|
||||||
|
.up-img :deep(.avatar-uploader .el-upload:hover) {
|
||||||
|
border-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.up-img :deep(.el-icon.avatar-uploader-icon) {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #8c939d;
|
||||||
|
width: 178px;
|
||||||
|
height: 178px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
@ -70,9 +70,11 @@ const exceptionStr = '/api/v1/test/'; // /api/v1/test/*接口拦截
|
|||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
(config: any) => {
|
(config: any) => {
|
||||||
// 在发送请求之前做些什么 token
|
// 在发送请求之前做些什么 token
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers = config.headers || {};
|
config.headers = config.headers || {};
|
||||||
(config.headers as any)['Authorization'] = `Bearer ${token}`;
|
(config.headers as any)['Authorization'] = `Bearer ${token}`;
|
||||||
|
console.log('🚀 ~ config.headers:', config.headers);
|
||||||
}
|
}
|
||||||
const stores = useUserStore();
|
const stores = useUserStore();
|
||||||
if (!whiteUrl.includes(config.url) && !config.url.includes(exceptionStr)) {
|
if (!whiteUrl.includes(config.url) && !config.url.includes(exceptionStr)) {
|
||||||
|
232
src/views/busMachineryDetail/list/component/add.vue
Normal file
232
src/views/busMachineryDetail/list/component/add.vue
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busMachineryDetail-add">
|
||||||
|
<el-dialog v-model="isShowDialog" width="769px" :close-on-click-modal="false" :destroy-on-close="true">
|
||||||
|
<template #header>
|
||||||
|
<div v-drag="['.system-busMachineryDetail-add .el-dialog', '.system-busMachineryDetail-add .el-dialog__header']">添加机械入场记录</div>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="130px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="合格证编号" prop="checkoutNumber">
|
||||||
|
<el-input v-model="formData.checkoutNumber" placeholder="请输入合格证编号" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="生产厂家" prop="checkoutUnit">
|
||||||
|
<el-input v-model="formData.checkoutUnit" placeholder="请输入生产厂家" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="生产日期/有效期" prop="checkoutDate">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 250px"
|
||||||
|
v-model="formData.checkoutDate"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择检定日期/有效期"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
:disabled-date="disabledDate"
|
||||||
|
>
|
||||||
|
</el-date-picker> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<!-- <el-radio v-for="dict in typeOptions" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio> -->
|
||||||
|
<!-- <el-col :span="12"
|
||||||
|
><el-form-item label="出入场" prop="type">
|
||||||
|
<el-radio-group v-model="formData.type">
|
||||||
|
<el-radio label="2">入场</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item></el-col
|
||||||
|
> -->
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="施工类型状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio v-for="dict in statusOptions" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item></el-col
|
||||||
|
>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="入场时间" prop="entryTime">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 250px"
|
||||||
|
v-model="formData.entryTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择入场时间"
|
||||||
|
format="YYYY年MM月DD日 hh时mm分ss秒"
|
||||||
|
value-format="YYYY-MM-DD hh:mm:ss"
|
||||||
|
>
|
||||||
|
</el-date-picker> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24"
|
||||||
|
><el-form-item label="备注" prop="remark"> <el-input v-model="formData.remark" placeholder="请输入备注" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="图片" prop="picture">
|
||||||
|
<upload-img :action="baseURL + '/zm/api/v1/system/upload/multipleImg'" @uploadImageAuth1="setUpImgListPicture($event)" :limit="4">
|
||||||
|
</upload-img> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
<el-button @click="onCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, unref, getCurrentInstance } from 'vue';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { addBusMachineryDetail } from '@/api/machinery/machineryDetail';
|
||||||
|
import uploadImg from '@/components/uploadImg/index.vue';
|
||||||
|
import { BusMachineryDetailEditState } from './model';
|
||||||
|
import { stat } from 'fs';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
components: {
|
||||||
|
uploadImg
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
statusOptions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const baseURL: string | undefined | boolean = import.meta.env.VITE_APP_BASE_API_GO;
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive<BusMachineryDetailEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
typeOptions: [
|
||||||
|
{ value: '2', label: '入场' },
|
||||||
|
{ value: '1', label: '出场' }
|
||||||
|
],
|
||||||
|
formData: {
|
||||||
|
id: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
entryTime: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
picture: [],
|
||||||
|
type: '2'
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
checkoutNumber: [{ required: true, message: '检验证编号不能为空', trigger: 'blur' }],
|
||||||
|
checkoutUnit: [{ required: true, message: '检验单位不能为空', trigger: 'blur' }],
|
||||||
|
checkoutDate: [{ required: true, message: '检定日期/有效期不能为空', trigger: 'blur' }],
|
||||||
|
type: [{ required: true, message: '出入场不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
imageList: [],
|
||||||
|
propsRow: {}
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row: any) => {
|
||||||
|
resetForm();
|
||||||
|
if (row) {
|
||||||
|
state.formData.machinery_id = row.id;
|
||||||
|
state.propsRow = row;
|
||||||
|
}
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 提交
|
||||||
|
const onSubmit = () => {
|
||||||
|
// 去重
|
||||||
|
// state.formData.picture = state.formData.picture.join(',');
|
||||||
|
const formWrap = unref(formRef) as any;
|
||||||
|
if (!formWrap) return;
|
||||||
|
formWrap.validate((valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
state.loading = true;
|
||||||
|
//添加
|
||||||
|
state.formData.type = '2';
|
||||||
|
addBusMachineryDetail(state.formData)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功');
|
||||||
|
closeDialog(); // 关闭弹窗
|
||||||
|
emit('busMachineryDetailList', state.propsRow.children, state.propsRow.id);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const resetForm = () => {
|
||||||
|
state.formData = {
|
||||||
|
id: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
entryTime: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
picture: []
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const setUpImgListPicture = (val: any) => {
|
||||||
|
// console.log(val);
|
||||||
|
// if (val.length > 0 && val[0].url && !val[0].raw) {
|
||||||
|
// let path = '';
|
||||||
|
// val.forEach((item) => {
|
||||||
|
// // 判断是否存在http
|
||||||
|
// if (item.url.indexOf('http') != -1) {
|
||||||
|
// path = path + ',' + item.url.slice(item.url.indexOf('/upload_file') + 1);
|
||||||
|
// } else {
|
||||||
|
// path = path + ',' + item.url;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// path = path.slice(1);
|
||||||
|
state.formData.picture = [];
|
||||||
|
val.forEach((item) => {
|
||||||
|
state.formData.picture.push(item.url);
|
||||||
|
});
|
||||||
|
// }
|
||||||
|
};
|
||||||
|
const disabledDate = (time) => {
|
||||||
|
return time.getTime() >= Date.now(); // 8.64e7 毫秒数代表一天
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
onSubmit,
|
||||||
|
menuRef,
|
||||||
|
formRef,
|
||||||
|
setUpImgListPicture,
|
||||||
|
baseURL,
|
||||||
|
disabledDate,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.el-col {
|
||||||
|
margin: 10px 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
219
src/views/busMachineryDetail/list/component/detail.vue
Normal file
219
src/views/busMachineryDetail/list/component/detail.vue
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 机械详情详情抽屉 -->
|
||||||
|
<div class="system-busMachineryDetail-detail">
|
||||||
|
<el-drawer v-model="isShowDialog" class="busMachineryDetail_detail" size="40%" direction="ltr">
|
||||||
|
<template #header>
|
||||||
|
<h4>机械出入场记录详情</h4>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="130px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合格证编号">{{ formData.checkoutNumber }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生产厂家">{{ formData.checkoutUnit }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生产日期/有效期">{{ formData.checkoutDate }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="出入场">{{ formData.type == 1 ? '出场' : formData.type == 2 ? '入场' : '' }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="施工类型状态">{{ getOptionValue(formData.status, statusOptions, 'value', 'label') }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="入场时间">{{ formData.entryTime }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="创建时间">{{ formData.createdAt }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注">{{ formData.remark }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="图片">
|
||||||
|
<div class="pic-block" v-if="formData.picture.length" v-for="(img, key) in formData.picture" :key="'picture-' + key">
|
||||||
|
<el-image
|
||||||
|
style="width: 140px; height: 150px; margin: 0 5px"
|
||||||
|
v-if="img"
|
||||||
|
:src="'http://58.17.134.85:8920' + img"
|
||||||
|
fit="contain"
|
||||||
|
:preview-src-list="['http://58.17.134.85:8920' + img]"
|
||||||
|
:zoom-rate="1.2"
|
||||||
|
preview-teleported="true"
|
||||||
|
></el-image>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-table v-loading="loading" :data="formData.recordList">
|
||||||
|
<el-table-column label="出入场" align="center" prop="type">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.type == 1">出场</span>
|
||||||
|
<span v-if="scope.row.type == 2">入场</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="施工类型状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.status == 0">正常</span>
|
||||||
|
<span v-if="scope.row.status == 1">停用</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="填报人" align="center" prop="createdBy" min-width="100px" /> -->
|
||||||
|
<el-table-column label="记录时间" align="center" prop="recordTime">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ proxy.parseTime(scope.row.recordTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, getCurrentInstance } from 'vue';
|
||||||
|
import { getBusMachineryDetail } from '@/api/machinery/machineryDetail';
|
||||||
|
import { ElLoading } from 'element-plus';
|
||||||
|
import uploadImg from '@/components/uploadImg/index.vue';
|
||||||
|
import { BusMachineryDetailInfoData, BusMachineryDetailEditState } from './model';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
components: {
|
||||||
|
uploadImg
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
statusOptions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const baseURL: string | undefined | boolean = import.meta.env.VITE_API_URL;
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive<BusMachineryDetailEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
formData: {
|
||||||
|
id: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
entryTime: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
picture: []
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '序号不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '施工类型状态不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row?: BusMachineryDetailInfoData) => {
|
||||||
|
resetForm();
|
||||||
|
if (row) {
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '正在加载中……',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
target: '.busMachineryDetail_detail'
|
||||||
|
});
|
||||||
|
getBusMachineryDetail(row.id!).then((res: any) => {
|
||||||
|
loading.close();
|
||||||
|
const data = res.data;
|
||||||
|
state.formData = data;
|
||||||
|
if (state.formData.picture && state.formData.picture.includes('[')) {
|
||||||
|
state.formData.picture = state.formData.picture ? JSON.parse(state.formData.picture) : [];
|
||||||
|
} else {
|
||||||
|
state.formData.picture = state.formData.picture ? state.formData.picture.split(',') : [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
const resetForm = () => {
|
||||||
|
state.formData = {
|
||||||
|
id: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
entryTime: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
picture: []
|
||||||
|
};
|
||||||
|
};
|
||||||
|
function getOptionValue(key: any, options: Array<any>, keyName: string, valName: string) {
|
||||||
|
keyName = keyName ?? 'key';
|
||||||
|
valName = valName ?? 'value';
|
||||||
|
const option = options.find((value) => {
|
||||||
|
return key + '' === value[keyName];
|
||||||
|
});
|
||||||
|
if (option !== undefined) {
|
||||||
|
return option[valName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const setUpImgListPicture = (data: any) => {
|
||||||
|
state.formData.picture = data;
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
menuRef,
|
||||||
|
getOptionValue,
|
||||||
|
formRef,
|
||||||
|
setUpImgListPicture,
|
||||||
|
baseURL,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.system-busMachineryDetail-detail :deep(.el-form-item--large .el-form-item__label) {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
.pic-block {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.file-block {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: var(--el-transition-duration-fast);
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding: 3px 6px;
|
||||||
|
}
|
||||||
|
.ml-2 {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
253
src/views/busMachineryDetail/list/component/edit.vue
Normal file
253
src/views/busMachineryDetail/list/component/edit.vue
Normal file
@ -0,0 +1,253 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busMachineryDetail-edit">
|
||||||
|
<el-dialog v-model="isShowDialog" width="769px" :close-on-click-modal="false" :destroy-on-close="true" custom-class="busMachineryDetail_edit">
|
||||||
|
<template #header>
|
||||||
|
<div v-drag="['.system-busMachineryDetail-edit .el-dialog', '.system-busMachineryDetail-edit .el-dialog__header']">
|
||||||
|
{{ formData.id ? '修改' : '添加' }}机械出入场记录
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="130px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="合格证编号" prop="checkoutNumber">
|
||||||
|
<el-input v-model="formData.checkoutNumber" placeholder="请输入合格证编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生产厂家" prop="checkoutUnit">
|
||||||
|
<el-input v-model="formData.checkoutUnit" placeholder="请输入生产厂家" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生产日期/有效期" prop="checkoutDate">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 250px"
|
||||||
|
v-model="formData.checkoutDate"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择检定日期/有效期"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
:disabled-date="disabledDate"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="出入场" prop="type">
|
||||||
|
<el-radio-group v-model="formData.type">
|
||||||
|
<el-radio v-for="dict in typeOptions" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="施工类型状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio v-for="dict in statusOptions" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="出入场时间" prop="entryTime">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 250px"
|
||||||
|
v-model="formData.entryTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择入场时间"
|
||||||
|
format="YYYY年MM月DD日 hh时mm分ss秒"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="图片" prop="picture">
|
||||||
|
<UploadImg
|
||||||
|
:action="baseURL + '/zm/api/v1/system/upload/multipleImg'"
|
||||||
|
v-model="formData.picture"
|
||||||
|
@uploadData="setUpImgListPicture"
|
||||||
|
:limit="4"
|
||||||
|
ref="uploadRef"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
<el-button @click="onCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, ref, toRefs, defineComponent, unref } from 'vue';
|
||||||
|
import { ElMessage, ElLoading } from 'element-plus';
|
||||||
|
import { getBusMachineryDetail, addBusMachineryDetail, updateBusMachineryDetail } from '@/api/machinery/machineryDetail';
|
||||||
|
import UploadImg from '@/components/uploadImg/index.vue';
|
||||||
|
import { BusMachineryDetailInfoData, BusMachineryDetailEditState } from './model';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'editMachineChild',
|
||||||
|
components: { UploadImg },
|
||||||
|
props: {
|
||||||
|
statusOptions: { type: Array, default: () => [] }
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const baseURL = import.meta.env.VITE_APP_BASE_API_GO;
|
||||||
|
const formRef = ref(null);
|
||||||
|
const uploadRef = ref(null);
|
||||||
|
|
||||||
|
const state = reactive<BusMachineryDetailEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
typeOptions: [
|
||||||
|
{ value: '2', label: '入场' },
|
||||||
|
{ value: '1', label: '出场' }
|
||||||
|
],
|
||||||
|
formData: {
|
||||||
|
id: undefined,
|
||||||
|
checkoutNumber: '',
|
||||||
|
checkoutUnit: '',
|
||||||
|
checkoutDate: undefined,
|
||||||
|
type: '',
|
||||||
|
status: '',
|
||||||
|
entryTime: undefined,
|
||||||
|
remark: '',
|
||||||
|
picture: []
|
||||||
|
},
|
||||||
|
propsRow: {},
|
||||||
|
rules: {
|
||||||
|
checkoutNumber: [{ required: true, message: '检验证编号不能为空', trigger: 'blur' }],
|
||||||
|
checkoutUnit: [{ required: true, message: '检验单位不能为空', trigger: 'blur' }],
|
||||||
|
checkoutDate: [{ required: true, message: '检定日期/有效期不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '施工类型状态不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
Object.assign(state.formData, {
|
||||||
|
id: undefined,
|
||||||
|
checkoutNumber: '',
|
||||||
|
checkoutUnit: '',
|
||||||
|
checkoutDate: undefined,
|
||||||
|
type: '',
|
||||||
|
status: '',
|
||||||
|
entryTime: undefined,
|
||||||
|
remark: '',
|
||||||
|
picture: []
|
||||||
|
});
|
||||||
|
if (uploadRef.value) {
|
||||||
|
uploadRef.value.clearFiles && uploadRef.value.clearFiles(); // 清空上传组件历史
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const openDialog = (props: any, row?: BusMachineryDetailInfoData) => {
|
||||||
|
resetForm();
|
||||||
|
if (props) state.propsRow = props;
|
||||||
|
|
||||||
|
if (row) {
|
||||||
|
const loadingInstance = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '正在加载中……',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
target: '.busMachineryDetail_edit'
|
||||||
|
});
|
||||||
|
getBusMachineryDetail(row.id!).then((res: any) => {
|
||||||
|
loadingInstance.close();
|
||||||
|
const data = res.data;
|
||||||
|
let pictureArr: any[] = [];
|
||||||
|
|
||||||
|
if (data.picture) {
|
||||||
|
if (data.picture.includes('[')) {
|
||||||
|
data.picture = JSON.parse(data.picture);
|
||||||
|
} else {
|
||||||
|
data.picture = data.picture.split(',');
|
||||||
|
}
|
||||||
|
pictureArr = data.picture.map((item, index) => ({
|
||||||
|
url: 'http://58.17.134.85:8920' + item,
|
||||||
|
name: `img_${index}`
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(state.formData, {
|
||||||
|
...data,
|
||||||
|
type: data.type ?? '',
|
||||||
|
status: data.status ?? '',
|
||||||
|
picture: pictureArr
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
const onCancel = () => closeDialog();
|
||||||
|
|
||||||
|
const setUpImgListPicture = (val: any) => {
|
||||||
|
state.formData.picture.splice(0, state.formData.picture.length, ...val);
|
||||||
|
};
|
||||||
|
|
||||||
|
const pictureConvert = () => {
|
||||||
|
if (Array.isArray(state.formData.picture)) {
|
||||||
|
state.formData.picture = state.formData.picture.map((item) => item.url.substring(item.url.indexOf('/file')));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSubmit = () => {
|
||||||
|
pictureConvert();
|
||||||
|
const formWrap = unref(formRef) as any;
|
||||||
|
if (!formWrap) return;
|
||||||
|
|
||||||
|
formWrap.validate((valid: boolean) => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
state.loading = true;
|
||||||
|
const apiCall = state.formData.id ? updateBusMachineryDetail : addBusMachineryDetail;
|
||||||
|
|
||||||
|
apiCall(state.formData)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success(state.formData.id ? '修改成功' : '添加成功');
|
||||||
|
closeDialog();
|
||||||
|
emit('busMachineryDetailList', state.propsRow.children, state.propsRow.id);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const disabledDate = (time: Date) => time.getTime() >= Date.now();
|
||||||
|
|
||||||
|
return {
|
||||||
|
...toRefs(state),
|
||||||
|
formRef,
|
||||||
|
uploadRef,
|
||||||
|
baseURL,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
onSubmit,
|
||||||
|
setUpImgListPicture,
|
||||||
|
disabledDate
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-col {
|
||||||
|
margin: 10px 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
55
src/views/busMachineryDetail/list/component/model.ts
Normal file
55
src/views/busMachineryDetail/list/component/model.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
export interface BusMachineryDetailTableColumns {
|
||||||
|
id:number; // 序号
|
||||||
|
checkoutNumber:string; // 检验证编号
|
||||||
|
checkoutUnit:string; // 检验单位
|
||||||
|
checkoutDate:string; // 检定日期/有效期
|
||||||
|
status:string; // 施工类型状态
|
||||||
|
entryTime:string; // 入场时间
|
||||||
|
createdAt:string; // 创建时间
|
||||||
|
remark:string; // 备注
|
||||||
|
picture:any[]; // 4张图片,逗号分隔
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusMachineryDetailInfoData {
|
||||||
|
id:number|undefined; // 序号
|
||||||
|
checkoutNumber:string|undefined; // 检验证编号
|
||||||
|
checkoutUnit:string|undefined; // 检验单位
|
||||||
|
checkoutDate:string|undefined; // 检定日期/有效期
|
||||||
|
status:string|undefined; // 施工类型状态
|
||||||
|
entryTime:string|undefined; // 入场时间
|
||||||
|
createBy:string|undefined; // 创建者
|
||||||
|
updateBy:string|undefined; // 更新者
|
||||||
|
createdAt:string|undefined; // 创建时间
|
||||||
|
updatedAt:string|undefined; // 更新时间
|
||||||
|
deletedAt:string|undefined; // 删除时间
|
||||||
|
remark:string|undefined; // 备注
|
||||||
|
picture:any[]; // 4张图片,逗号分隔
|
||||||
|
type: undefined, // 出入场
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusMachineryDetailTableDataState {
|
||||||
|
ids:any[];
|
||||||
|
tableData: {
|
||||||
|
data: Array<BusMachineryDetailTableColumns>;
|
||||||
|
total: number;
|
||||||
|
loading: boolean;
|
||||||
|
param: {
|
||||||
|
pageNum: number;
|
||||||
|
pageSize: number;
|
||||||
|
checkoutNumber: string|undefined;
|
||||||
|
status: string|undefined;
|
||||||
|
entryTime: string|undefined;
|
||||||
|
dateRange: string[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusMachineryDetailEditState{
|
||||||
|
loading:boolean;
|
||||||
|
isShowDialog: boolean;
|
||||||
|
formData:BusMachineryDetailInfoData;
|
||||||
|
rules: object;
|
||||||
|
}
|
339
src/views/busMachineryDetail/list/index.vue
Normal file
339
src/views/busMachineryDetail/list/index.vue
Normal file
@ -0,0 +1,339 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busMachineryDetail-container">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<div class="system-busMachineryDetail-search mb15">
|
||||||
|
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8" class="colBlock">
|
||||||
|
<el-form-item label="合格证编号" prop="checkoutNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="tableData.param.checkoutNumber"
|
||||||
|
placeholder="请输入合格证编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="busMachineryDetailList"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" class="colBlock">
|
||||||
|
<el-form-item label="施工类型状态" prop="status">
|
||||||
|
<el-select v-model="tableData.param.status" placeholder="请选择施工类型状态" clearable>
|
||||||
|
<el-option v-for="dict in account_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :class="!showAll ? 'colBlock' : 'colNone'">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="busMachineryDetailList"
|
||||||
|
><el-icon><Search /></el-icon>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button @click="resetQuery(queryRef)"
|
||||||
|
><el-icon><Refresh /></el-icon>重置</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" link @click="toggleSearch">
|
||||||
|
{{ word }}
|
||||||
|
<el-icon v-show="showAll"><ArrowUp /></el-icon>
|
||||||
|
<el-icon v-show="!showAll"><ArrowDown /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :class="showAll ? 'colBlock' : 'colNone'">
|
||||||
|
<el-form-item label="入场时间" prop="entryTime">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
v-model="tableData.param.entryTime"
|
||||||
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择入场时间"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :class="showAll ? 'colBlock' : 'colNone'">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="busMachineryDetailList"
|
||||||
|
><el-icon><Search /></el-icon>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button @click="resetQuery(queryRef)"
|
||||||
|
><el-icon><Refresh /></el-icon>重置</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" link @click="toggleSearch">
|
||||||
|
{{ word }}
|
||||||
|
<el-icon v-show="showAll"><ArrowUp /></el-icon>
|
||||||
|
<el-icon v-show="!showAll"><ArrowDown /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" @click="handleAdd" v-auth="'api/v1/system/busMachineryDetail/add'"
|
||||||
|
><el-icon><Plus /></el-icon>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" :disabled="single" @click="handleUpdate(null)" v-auth="'api/v1/system/busMachineryDetail/edit'"
|
||||||
|
><el-icon><Edit /></el-icon>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busMachineryDetail/delete'"
|
||||||
|
><el-icon><Delete /></el-icon>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<el-table v-loading="loading" :data="tableData.data" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="序号" align="center" type="index" :index="indexMethod" width="60" />
|
||||||
|
<el-table-column label="合格证编号" align="center" prop="checkoutNumber" min-width="100px" />
|
||||||
|
<el-table-column label="生产厂家" align="center" prop="checkoutUnit" min-width="100px" />
|
||||||
|
<el-table-column label="检定日期/有效期" align="center" prop="checkoutDate" min-width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.checkoutDate }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="施工类型状态" align="center" prop="status" :formatter="statusFormat" min-width="100px" />
|
||||||
|
<el-table-column label="入场时间" align="center" prop="entryTime" min-width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.entryTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createdAt" min-width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.createdAt }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" min-width="100px" />
|
||||||
|
<el-table-column label="图片" align="center" prop="picture" min-width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<el-image
|
||||||
|
style="width: 100px; height: 50px"
|
||||||
|
:initial-index="1"
|
||||||
|
v-if="scope.row.image"
|
||||||
|
:src="'http://58.17.134.85:8920' + scope.row.image"
|
||||||
|
fit="contain"
|
||||||
|
:preview-src-list="['http://58.17.134.85:8920' + scope.row.picture]"
|
||||||
|
:z-index="999999999"
|
||||||
|
></el-image>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding" min-width="160px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link @click="handleUpdate(scope.row)"
|
||||||
|
><el-icon><EditPen /></el-icon>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" link @click="handleDelete(scope.row)"
|
||||||
|
><el-icon><DeleteFilled /></el-icon>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="tableData.total > 0"
|
||||||
|
:total="tableData.total"
|
||||||
|
v-model:page="tableData.param.pageNum"
|
||||||
|
v-model:limit="tableData.param.pageSize"
|
||||||
|
@pagination="busMachineryDetailList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<apiV1SystemBusMachineryDetailAdd
|
||||||
|
ref="addRef"
|
||||||
|
:statusOptions="account_status"
|
||||||
|
@busMachineryDetailList="busMachineryDetailList"
|
||||||
|
></apiV1SystemBusMachineryDetailAdd>
|
||||||
|
<apiV1SystemBusMachineryDetailEdit
|
||||||
|
ref="editRef"
|
||||||
|
:statusOptions="account_status"
|
||||||
|
@busMachineryDetailList="busMachineryDetailList"
|
||||||
|
></apiV1SystemBusMachineryDetailEdit>
|
||||||
|
<apiV1SystemBusMachineryDetailDetail
|
||||||
|
ref="detailRef"
|
||||||
|
:statusOptions="account_status"
|
||||||
|
@busMachineryDetailList="busMachineryDetailList"
|
||||||
|
></apiV1SystemBusMachineryDetailDetail>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { toRefs, reactive, onMounted, ref, defineComponent, computed, getCurrentInstance, toRaw } from 'vue';
|
||||||
|
import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
|
||||||
|
import { listBusMachineryDetail, delBusMachineryDetail } from '@/api/machinery/machineryDetail';
|
||||||
|
import { BusMachineryDetailTableColumns, BusMachineryDetailInfoData, BusMachineryDetailTableDataState } from './component/model';
|
||||||
|
import apiV1SystemBusMachineryDetailAdd from './component/add.vue';
|
||||||
|
import apiV1SystemBusMachineryDetailEdit from './component/edit.vue';
|
||||||
|
import apiV1SystemBusMachineryDetailDetail from './component/detail.vue';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
components: {
|
||||||
|
apiV1SystemBusMachineryDetailAdd,
|
||||||
|
apiV1SystemBusMachineryDetailEdit,
|
||||||
|
apiV1SystemBusMachineryDetailDetail
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const loading = ref(false);
|
||||||
|
const queryRef = ref();
|
||||||
|
const addRef = ref();
|
||||||
|
const editRef = ref();
|
||||||
|
const detailRef = ref();
|
||||||
|
// 是否显示所有搜索选项
|
||||||
|
const showAll = ref(false);
|
||||||
|
// 非单个禁用
|
||||||
|
const single = ref(true);
|
||||||
|
// 非多个禁用
|
||||||
|
const multiple = ref(true);
|
||||||
|
const word = computed(() => {
|
||||||
|
if (showAll.value === false) {
|
||||||
|
//对文字进行处理
|
||||||
|
return '展开搜索';
|
||||||
|
} else {
|
||||||
|
return '收起搜索';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 字典选项数据
|
||||||
|
const { account_status } = proxy.useDict('account_status');
|
||||||
|
const state = reactive<BusMachineryDetailTableDataState>({
|
||||||
|
ids: [],
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
param: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
entryTime: undefined,
|
||||||
|
dateRange: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 页面加载时
|
||||||
|
onMounted(() => {
|
||||||
|
initTableData();
|
||||||
|
});
|
||||||
|
// 初始化表格数据
|
||||||
|
const initTableData = () => {
|
||||||
|
busMachineryDetailList();
|
||||||
|
};
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = (formEl: FormInstance | undefined) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
busMachineryDetailList();
|
||||||
|
};
|
||||||
|
// 获取列表数据
|
||||||
|
const busMachineryDetailList = () => {
|
||||||
|
loading.value = true;
|
||||||
|
listBusMachineryDetail(state.tableData.param).then((res: any) => {
|
||||||
|
let list = res.data.list ?? [];
|
||||||
|
state.tableData.data = list;
|
||||||
|
state.tableData.data.forEach((item) => {
|
||||||
|
if (item.picture) {
|
||||||
|
item.image = item.picture.split(',')[0];
|
||||||
|
item.imageList = item.picture.split(',');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
state.tableData.total = res.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const toggleSearch = () => {
|
||||||
|
showAll.value = !showAll.value;
|
||||||
|
};
|
||||||
|
// 施工类型状态字典翻译
|
||||||
|
const statusFormat = (row: BusMachineryDetailTableColumns) => {
|
||||||
|
return proxy.selectDictLabel(account_status.value, row.status);
|
||||||
|
};
|
||||||
|
// 多选框选中数据
|
||||||
|
const handleSelectionChange = (selection: Array<BusMachineryDetailInfoData>) => {
|
||||||
|
state.ids = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
const handleAdd = () => {
|
||||||
|
addRef.value.openDialog();
|
||||||
|
};
|
||||||
|
const handleUpdate = (row: BusMachineryDetailTableColumns) => {
|
||||||
|
if (!row) {
|
||||||
|
row = state.tableData.data.find((item: BusMachineryDetailTableColumns) => {
|
||||||
|
return item.id === state.ids[0];
|
||||||
|
}) as BusMachineryDetailTableColumns;
|
||||||
|
}
|
||||||
|
editRef.value.openDialog(toRaw(row));
|
||||||
|
};
|
||||||
|
const handleDelete = (row: BusMachineryDetailTableColumns) => {
|
||||||
|
let msg = '你确定要删除所选数据?';
|
||||||
|
let id: number[] = [];
|
||||||
|
if (row) {
|
||||||
|
msg = `此操作将永久删除数据,是否继续?`;
|
||||||
|
id = [row.id];
|
||||||
|
} else {
|
||||||
|
id = state.ids;
|
||||||
|
}
|
||||||
|
if (id.length === 0) {
|
||||||
|
ElMessage.error('请选择要删除的数据。');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(msg, '提示', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delBusMachineryDetail(id).then(() => {
|
||||||
|
ElMessage.success('删除成功');
|
||||||
|
busMachineryDetailList();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
const handleView = (row: BusMachineryDetailTableColumns) => {
|
||||||
|
detailRef.value.openDialog(toRaw(row));
|
||||||
|
};
|
||||||
|
/** 自定义编号 */
|
||||||
|
const indexMethod = (index) => {
|
||||||
|
let pageNum = state.tableData.param.pageNum - 1;
|
||||||
|
if (pageNum !== -1 && pageNum !== 0) {
|
||||||
|
return index + 1 + pageNum * state.tableData.param.pageSize;
|
||||||
|
} else {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
addRef,
|
||||||
|
editRef,
|
||||||
|
detailRef,
|
||||||
|
showAll,
|
||||||
|
loading,
|
||||||
|
single,
|
||||||
|
multiple,
|
||||||
|
word,
|
||||||
|
queryRef,
|
||||||
|
resetQuery,
|
||||||
|
busMachineryDetailList,
|
||||||
|
toggleSearch,
|
||||||
|
statusFormat,
|
||||||
|
account_status,
|
||||||
|
handleSelectionChange,
|
||||||
|
handleAdd,
|
||||||
|
handleUpdate,
|
||||||
|
handleDelete,
|
||||||
|
indexMethod,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.colBlock {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.colNone {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
@ -111,8 +111,7 @@ import { useUserStoreHook } from '@/store/modules/user';
|
|||||||
import type { FormInstance, FormRules } from 'element-plus';
|
import type { FormInstance, FormRules } from 'element-plus';
|
||||||
import Notice from './components/notice.vue';
|
import Notice from './components/notice.vue';
|
||||||
import { listContactTypeformtemplate } from '@/api/cory/contactformtemplate';
|
import { listContactTypeformtemplate } from '@/api/cory/contactformtemplate';
|
||||||
import { addContactnotice, delContactnotice, listContactnotice } from '@/api/cory/contactnotice';
|
import { addContactnotice, delContactnotice, listContactnotice, listProjectTeamForeman } from '@/api/cory/contactnotice';
|
||||||
import { listProjectTeamForeman } from '@/api/project/projectTeam';
|
|
||||||
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@ -265,6 +264,7 @@ const getList = async () => {
|
|||||||
tableData.value = res.rows;
|
tableData.value = res.rows;
|
||||||
total.value = res.total || 0;
|
total.value = res.total || 0;
|
||||||
// 获取项目班组信息
|
// 获取项目班组信息
|
||||||
|
console.log('🚀 ~ getList ~ currentProject.value?.id:', currentProject.value?.id);
|
||||||
const teamRes = await listProjectTeamForeman(currentProject.value?.id);
|
const teamRes = await listProjectTeamForeman(currentProject.value?.id);
|
||||||
teamList.value = teamRes.data;
|
teamList.value = teamRes.data;
|
||||||
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog title="添加机械出入场详情" v-model="visible" width="500px" append-to-body>
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px">
|
|
||||||
<el-form-item label="出入场" prop="outPut">
|
|
||||||
<el-select v-model="form.type" clearable placeholder="请选择出入场">
|
|
||||||
<el-option v-for="item in machinery_entry_exit_type" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="检验证编号" prop="checkoutNumber">
|
|
||||||
<el-input v-model="form.checkoutNumber" placeholder="请输入检验证编号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="检验单位" prop="checkoutUnit">
|
|
||||||
<el-input v-model="form.checkoutUnit" placeholder="请输入检验单位" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="检定日期/有效期" prop="checkoutDate">
|
|
||||||
<el-date-picker clearable v-model="form.checkoutDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择检定日期/有效期">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="施工类型状态" prop="outPut">
|
|
||||||
<el-select v-model="form.status" clearable placeholder="请选择施工类型状态">
|
|
||||||
<el-option v-for="item in sys_normal_disable" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="入场时间" prop="checkoutDate">
|
|
||||||
<el-date-picker clearable v-model="form.entryTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择入场时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="图片" prop="picture">
|
|
||||||
<image-upload v-model="form.picture" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="loading" type="primary" @click="submitForm">提 交</el-button>
|
|
||||||
<el-button @click="closeDialog">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { defineExpose, reactive, ref } from 'vue';
|
|
||||||
import { ElMessage } from 'element-plus';
|
|
||||||
import { MachineryDetailForm } from '@/api/machinery/machineryDetail/types';
|
|
||||||
import { addMachineryDetail } from '@/api/machinery/machineryDetail';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { machinery_entry_exit_type, sys_normal_disable } = toRefs<any>(proxy?.useDict('machinery_entry_exit_type', 'sys_normal_disable'));
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
machineryId: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
|
||||||
const emit = defineEmits(['submit']);
|
|
||||||
const visible = ref<boolean>(false);
|
|
||||||
const loading = ref<boolean>(false);
|
|
||||||
|
|
||||||
// 定义表单数据,注意结构与校验规则需要与接口对应
|
|
||||||
const form = reactive<MachineryDetailForm>({
|
|
||||||
machineryId: props.machineryId,
|
|
||||||
checkoutNumber: '',
|
|
||||||
checkoutUnit: '',
|
|
||||||
checkoutDate: '',
|
|
||||||
status: undefined,
|
|
||||||
type: undefined,
|
|
||||||
entryTime: '',
|
|
||||||
remark: '',
|
|
||||||
picture: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
// 定义校验规则
|
|
||||||
const rules = reactive({
|
|
||||||
checkoutNumber: [{ required: true, message: '请输入检验证编号', trigger: 'blur' }],
|
|
||||||
checkoutUnit: [{ required: true, message: '请输入检验单位', trigger: 'blur' }],
|
|
||||||
checkoutDate: [{ required: true, message: '请选择检定日期', trigger: 'blur' }],
|
|
||||||
entryTime: [{ required: true, message: '请选择进场时间', trigger: 'blur' }]
|
|
||||||
});
|
|
||||||
|
|
||||||
const formRef = ref();
|
|
||||||
const imageValue = ref([]);
|
|
||||||
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value.validate(async (valid: boolean) => {
|
|
||||||
if (!valid) return;
|
|
||||||
loading.value = true;
|
|
||||||
try {
|
|
||||||
// 调用接口提交数据
|
|
||||||
await addMachineryDetail({ ...form, machineryId: props.machineryId }).finally(() => (loading.value = false));
|
|
||||||
ElMessage.success('提交成功');
|
|
||||||
emit('submit');
|
|
||||||
closeDialog();
|
|
||||||
} catch (error) {
|
|
||||||
ElMessage.error('提交失败');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
visible.value = false;
|
|
||||||
// 重置表单数据
|
|
||||||
formRef.value.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 供外部调用的打开方法
|
|
||||||
const openDialog = () => {
|
|
||||||
visible.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
openDialog
|
|
||||||
});
|
|
||||||
</script>
|
|
@ -1,206 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-table size="small" v-if="machineryDetailList.length !== 0" :data="machineryDetailList">
|
|
||||||
<el-table-column label="出入场" align="center" prop="type">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="machinery_entry_exit_type" :value="scope.row.type" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="检验证编号" align="center" prop="checkoutNumber" />
|
|
||||||
<el-table-column label="检验单位" align="center" prop="checkoutUnit" />
|
|
||||||
<el-table-column label="检定日期/有效期" align="center" prop="checkoutDate" />
|
|
||||||
<el-table-column label="入场时间" align="center" prop="entryTime" />
|
|
||||||
<el-table-column label="图片" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-image
|
|
||||||
:z-index="9999"
|
|
||||||
:preview-src-list="imgList(scope.row.pictureList)"
|
|
||||||
preview-teleported
|
|
||||||
:src="scope.row.pictureList ? scope.row.pictureList[0].url : ''"
|
|
||||||
class="w20"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-space wrap>
|
|
||||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['machinery:machineryDetail:edit']">
|
|
||||||
修改
|
|
||||||
</el-button>
|
|
||||||
</el-space>
|
|
||||||
<el-space wrap>
|
|
||||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['machinery:machineryDetail:remove']">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</el-space>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<pagination
|
|
||||||
size="small"
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<el-dialog title="修改机械出入场详情" v-model="dialogRef" width="700px" append-to-body>
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px">
|
|
||||||
<el-form-item label="出入场" prop="type">
|
|
||||||
<el-select v-model="form.type" clearable placeholder="请选择出入场">
|
|
||||||
<el-option v-for="item in machinery_entry_exit_type" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="检验证编号" prop="checkoutNumber">
|
|
||||||
<el-input v-model="form.checkoutNumber" placeholder="请输入检验证编号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="检验单位" prop="checkoutUnit">
|
|
||||||
<el-input v-model="form.checkoutUnit" placeholder="请输入检验单位" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="检定日期/有效期" prop="checkoutDate">
|
|
||||||
<el-date-picker
|
|
||||||
clearable
|
|
||||||
v-model="form.checkoutDate"
|
|
||||||
type="datetime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
placeholder="请选择检定日期/有效期"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="施工类型状态" prop="status">
|
|
||||||
<el-select v-model="form.status" clearable placeholder="请选择施工类型状态">
|
|
||||||
<el-option v-for="item in sys_normal_disable" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="入场时间" prop="checkoutDate">
|
|
||||||
<el-date-picker clearable v-model="form.entryTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择入场时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="图片" prop="picture">
|
|
||||||
<image-upload v-model="form.picture" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="loading" type="primary" @click="submitForm">提 交</el-button>
|
|
||||||
<el-button @click="closeDialog">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { MachineryDetailForm, MachineryDetailQuery, MachineryDetailVO } from '@/api/machinery/machineryDetail/types';
|
|
||||||
import { delMachineryDetail, getMachineryDetail, listMachineryDetail, updateMachineryDetail } from '@/api/machinery/machineryDetail';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { machinery_entry_exit_type, sys_normal_disable } = toRefs<any>(proxy?.useDict('machinery_entry_exit_type', 'sys_normal_disable'));
|
|
||||||
interface Props {
|
|
||||||
machineryId: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const formRef = ref();
|
|
||||||
const loading = ref(true);
|
|
||||||
const total = ref<number>(0);
|
|
||||||
const initFormData: MachineryDetailForm = {
|
|
||||||
id: undefined,
|
|
||||||
checkoutNumber: undefined,
|
|
||||||
checkoutUnit: undefined,
|
|
||||||
checkoutDate: undefined,
|
|
||||||
status: undefined,
|
|
||||||
type: undefined,
|
|
||||||
entryTime: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
picture: undefined,
|
|
||||||
machineryId: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<MachineryDetailForm, MachineryDetailQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
checkoutNumber: undefined,
|
|
||||||
checkoutUnit: undefined,
|
|
||||||
checkoutDate: undefined,
|
|
||||||
status: undefined,
|
|
||||||
type: undefined,
|
|
||||||
entryTime: undefined,
|
|
||||||
picture: undefined,
|
|
||||||
machineryId: props.machineryId
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
checkoutNumber: [{ required: true, message: '请输入检验证编号', trigger: 'blur' }],
|
|
||||||
checkoutUnit: [{ required: true, message: '请输入检验单位', trigger: 'blur' }],
|
|
||||||
checkoutDate: [{ required: true, message: '请选择检定日期', trigger: 'blur' }],
|
|
||||||
entryTime: [{ required: true, message: '请选择进场时间', trigger: 'blur' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
const imgList = computed(() => (list) => {
|
|
||||||
let newList;
|
|
||||||
if (list) {
|
|
||||||
newList = list.map((item) => item.url);
|
|
||||||
} else {
|
|
||||||
newList = [''];
|
|
||||||
}
|
|
||||||
return newList;
|
|
||||||
});
|
|
||||||
|
|
||||||
const machineryDetailList = ref<MachineryDetailVO[]>([]);
|
|
||||||
/** 展开选中数据 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
const res = await listMachineryDetail(queryParams.value);
|
|
||||||
machineryDetailList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
loading.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: MachineryDetailVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('是否确认删除机械详情编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
|
||||||
await delMachineryDetail(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = async (row?: MachineryDetailVO) => {
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
const res = await getMachineryDetail(_id);
|
|
||||||
Object.assign(form.value, res.data);
|
|
||||||
dialogRef.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const dialogRef = ref();
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
loading.value = true;
|
|
||||||
await updateMachineryDetail(form.value).finally(() => (loading.value = false));
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialogRef.value = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/** 取消按钮 */
|
|
||||||
const closeDialog = () => {
|
|
||||||
dialogRef.value = false;
|
|
||||||
};
|
|
||||||
onMounted(async () => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
154
src/views/machinery/component/add.vue
Normal file
154
src/views/machinery/component/add.vue
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busMachinery-add">
|
||||||
|
<!-- 添加或修改机械对话框 -->
|
||||||
|
<el-dialog v-model="isShowDialog" width="600px" :close-on-click-modal="false" :destroy-on-close="true">
|
||||||
|
<template #header>
|
||||||
|
<div v-drag="['.system-busMachinery-add .el-dialog', '.system-busMachinery-add .el-dialog__header']"></div>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="机械名称" prop="machineryName">
|
||||||
|
<el-input v-model="formData.machineryName" placeholder="请输入机械名称" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="型号" prop="machineryNumber">
|
||||||
|
<el-input v-model="formData.machineryNumber" placeholder="请输入型号" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="负责人" prop="principal">
|
||||||
|
<el-input v-model="formData.principal" :rows="5" placeholder="请输入负责人" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24"
|
||||||
|
><el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" :rows="5" type="textarea" placeholder="请输入备注" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
<el-button @click="onCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, unref, getCurrentInstance } from 'vue';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { addBusMachinery } from '@/api/machinery/machinery';
|
||||||
|
import { BusMachineryEditState } from './model';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
props: {
|
||||||
|
statusOptions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive<BusMachineryEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
formData: {
|
||||||
|
id: undefined,
|
||||||
|
machineryName: undefined,
|
||||||
|
machineryNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
number: undefined,
|
||||||
|
entryTime: undefined,
|
||||||
|
principal: undefined,
|
||||||
|
remark: undefined
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '序号不能为空', trigger: 'blur' }],
|
||||||
|
machineryName: [{ required: true, message: '机械名称不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '施工类型状态不能为空', trigger: 'blur' }],
|
||||||
|
principal: [{ required: true, message: '负责人不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = () => {
|
||||||
|
resetForm();
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 提交
|
||||||
|
const onSubmit = () => {
|
||||||
|
const formWrap = unref(formRef) as any;
|
||||||
|
if (!formWrap) return;
|
||||||
|
formWrap.validate((valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
state.loading = true;
|
||||||
|
//添加
|
||||||
|
addBusMachinery(state.formData)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功');
|
||||||
|
closeDialog(); // 关闭弹窗
|
||||||
|
emit('busMachineryList');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const resetForm = () => {
|
||||||
|
state.formData = {
|
||||||
|
id: undefined,
|
||||||
|
machineryName: undefined,
|
||||||
|
machineryNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
entryTime: undefined,
|
||||||
|
principal: undefined,
|
||||||
|
remark: undefined
|
||||||
|
};
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
onSubmit,
|
||||||
|
menuRef,
|
||||||
|
formRef,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.el-col {
|
||||||
|
margin: 10px 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
156
src/views/machinery/component/detail.vue
Normal file
156
src/views/machinery/component/detail.vue
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 机械详情抽屉 -->
|
||||||
|
<div class="system-busMachinery-detail">
|
||||||
|
<el-drawer v-model="isShowDialog" class="busMachinery_detail" size="30%" direction="ltr">
|
||||||
|
<template #header>
|
||||||
|
<h4>机械详情</h4>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="机械名称">{{ formData.machineryName }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="型号">{{ formData.machineryNumber }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="数量">{{ formData.ct }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="负责人">{{ formData.principal }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注">{{ formData.remark }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="创建者">{{ formData.createBy }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="创建时间">{{ formData.createdAt }}</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, getCurrentInstance } from 'vue';
|
||||||
|
import { getBusMachinery } from '@/api/machinery/machinery';
|
||||||
|
import { ElLoading } from 'element-plus';
|
||||||
|
import { BusMachineryInfoData, BusMachineryEditState } from './model';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
props: {
|
||||||
|
statusOptions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive<BusMachineryEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
formData: {
|
||||||
|
id: undefined,
|
||||||
|
machineryName: undefined,
|
||||||
|
machineryNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
ct: undefined
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '序号不能为空', trigger: 'blur' }],
|
||||||
|
machineryName: [{ required: true, message: '机械名称不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '施工类型状态不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row?: BusMachineryInfoData) => {
|
||||||
|
resetForm();
|
||||||
|
if (row) {
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '正在加载中……',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
target: '.busMachinery_detail'
|
||||||
|
});
|
||||||
|
getBusMachinery(row.id!).then((res: any) => {
|
||||||
|
loading.close();
|
||||||
|
const data = res.data;
|
||||||
|
state.formData = data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
const resetForm = () => {
|
||||||
|
state.formData = {
|
||||||
|
id: undefined,
|
||||||
|
machineryName: undefined,
|
||||||
|
machineryNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
ct: undefined
|
||||||
|
};
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
menuRef,
|
||||||
|
formRef,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.system-busMachinery-detail :deep(.el-form-item--large .el-form-item__label) {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
.pic-block {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.file-block {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: var(--el-transition-duration-fast);
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding: 3px 6px;
|
||||||
|
}
|
||||||
|
.ml-2 {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
184
src/views/machinery/component/edit.vue
Normal file
184
src/views/machinery/component/edit.vue
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busMachinery-edit">
|
||||||
|
<!-- 添加或修改机械对话框 -->
|
||||||
|
<el-dialog v-model="isShowDialog" width="600px" :close-on-click-modal="false" :destroy-on-close="true" custom-class="busMachinery_edit">
|
||||||
|
<template #header>
|
||||||
|
<div v-drag="['.system-busMachinery-edit .el-dialog', '.system-busMachinery-edit .el-dialog__header']">
|
||||||
|
{{ (!formData.id || formData.id == 0 ? '添加' : '修改') + '机械' }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="110px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="机械名称" prop="machineryName">
|
||||||
|
<el-input v-model="formData.machineryName" placeholder="请输入机械名称" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="型号" prop="machineryNumber">
|
||||||
|
<el-input v-model="formData.machineryNumber" placeholder="请输入型号" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12"
|
||||||
|
><el-form-item label="负责人" prop="principal">
|
||||||
|
<el-input v-model="formData.principal" :rows="5" placeholder="请输入负责人" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24"
|
||||||
|
><el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" :rows="5" type="textarea" placeholder="请输入备注" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
<el-button @click="onCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, unref, getCurrentInstance } from 'vue';
|
||||||
|
import { ElMessage, ElLoading } from 'element-plus';
|
||||||
|
import { getBusMachinery, addBusMachinery, updateBusMachinery } from '@/api/machinery/machinery';
|
||||||
|
import { BusMachineryInfoData, BusMachineryEditState } from './model';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
props: {
|
||||||
|
statusOptions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive<BusMachineryEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
formData: {
|
||||||
|
id: undefined,
|
||||||
|
machineryName: undefined,
|
||||||
|
machineryNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
entryTime: undefined,
|
||||||
|
principal: undefined,
|
||||||
|
remark: undefined
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '序号不能为空', trigger: 'blur' }],
|
||||||
|
machineryName: [{ required: true, message: '机械名称不能为空', trigger: 'blur' }],
|
||||||
|
principal: [{ required: true, message: '负责人不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '施工类型状态不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row?: BusMachineryInfoData) => {
|
||||||
|
resetForm();
|
||||||
|
if (row) {
|
||||||
|
nextTick(() => {
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '正在加载中……',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
target: '.busMachinery_edit'
|
||||||
|
});
|
||||||
|
getBusMachinery(row.id!).then((res: any) => {
|
||||||
|
loading.close();
|
||||||
|
const data = res.data;
|
||||||
|
data.status = '' + data.status;
|
||||||
|
state.formData = data;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 提交
|
||||||
|
const onSubmit = () => {
|
||||||
|
const formWrap = unref(formRef) as any;
|
||||||
|
if (!formWrap) return;
|
||||||
|
formWrap.validate((valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
state.loading = true;
|
||||||
|
if (!state.formData.id || state.formData.id === 0) {
|
||||||
|
//添加
|
||||||
|
addBusMachinery(state.formData)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功');
|
||||||
|
closeDialog(); // 关闭弹窗
|
||||||
|
emit('busMachineryList');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//修改
|
||||||
|
updateBusMachinery(state.formData)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('修改成功');
|
||||||
|
closeDialog(); // 关闭弹窗
|
||||||
|
emit('busMachineryList');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const resetForm = () => {
|
||||||
|
state.formData = {
|
||||||
|
id: undefined,
|
||||||
|
machineryName: undefined,
|
||||||
|
machineryNumber: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
checkoutNumber: undefined,
|
||||||
|
checkoutUnit: undefined,
|
||||||
|
checkoutDate: undefined,
|
||||||
|
status: false,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
entryTime: undefined,
|
||||||
|
principal: undefined,
|
||||||
|
remark: undefined
|
||||||
|
};
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
onSubmit,
|
||||||
|
menuRef,
|
||||||
|
formRef,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.el-col {
|
||||||
|
margin: 10px 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
59
src/views/machinery/component/model.ts
Normal file
59
src/views/machinery/component/model.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
export interface BusMachineryTableColumns {
|
||||||
|
id:number; // 序号
|
||||||
|
machineryName:string; // 机械名称
|
||||||
|
machineryNumber:string; // 编号
|
||||||
|
checkoutNumber:string; // 检验证编号
|
||||||
|
checkoutUnit:string; // 检验单位
|
||||||
|
checkoutDate:string; // 检定日期/有效期
|
||||||
|
status:string; // 施工类型状态
|
||||||
|
createdAt:string; // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusMachineryInfoData {
|
||||||
|
id:number|undefined; // 序号
|
||||||
|
machineryName:string|undefined; // 机械名称
|
||||||
|
machineryNumber:string|undefined; // 编号
|
||||||
|
projectId:number|undefined; // 项目id
|
||||||
|
checkoutNumber:string|undefined; // 检验证编号
|
||||||
|
checkoutUnit:string|undefined; // 检验单位
|
||||||
|
checkoutDate:string|undefined; // 检定日期/有效期
|
||||||
|
status:boolean; // 施工类型状态
|
||||||
|
createBy:string|undefined; // 创建者
|
||||||
|
updateBy:string|undefined; // 更新者
|
||||||
|
createdAt:string|undefined; // 创建时间
|
||||||
|
updatedAt:string|undefined; // 更新时间
|
||||||
|
deletedAt:string|undefined; // 删除时间
|
||||||
|
number:number|undefined; //数量
|
||||||
|
entryTime: string|undefined; // 进场时间
|
||||||
|
principal: string|undefined; // 负责人
|
||||||
|
remark: string|undefined; // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusMachineryTableDataState {
|
||||||
|
ids:any[];
|
||||||
|
tableData: {
|
||||||
|
data: Array<BusMachineryTableColumns>;
|
||||||
|
total: number;
|
||||||
|
loading: boolean;
|
||||||
|
param: {
|
||||||
|
pageNum: number;
|
||||||
|
pageSize: number;
|
||||||
|
id: number|undefined;
|
||||||
|
machineryName: string|undefined;
|
||||||
|
status: string|undefined;
|
||||||
|
createdAt: string|undefined;
|
||||||
|
dateRange: string[];
|
||||||
|
projectId: undefined,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusMachineryEditState{
|
||||||
|
loading:boolean;
|
||||||
|
isShowDialog: boolean;
|
||||||
|
formData:BusMachineryInfoData;
|
||||||
|
rules: object;
|
||||||
|
}
|
@ -1,295 +1,532 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="system-busMachinery-container">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<el-card shadow="hover">
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div class="system-busMachinery-search mb15">
|
||||||
<el-card shadow="hover">
|
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-row>
|
||||||
<el-form-item label="机械名称" prop="machineryName">
|
<el-col :span="5" class="colBlock">
|
||||||
<el-input v-model="queryParams.machineryName" placeholder="请输入机械名称" clearable @keyup.enter="handleQuery" />
|
<el-form-item label="机械名称" prop="machineryName">
|
||||||
</el-form-item>
|
<el-input v-model="tableData.param.machineryName" placeholder="请输入机械名称" clearable @keyup.enter="busMachineryList" />
|
||||||
<el-form-item label="负责人" prop="principal">
|
</el-form-item>
|
||||||
<el-input v-model="queryParams.principal" placeholder="请输入负责人" clearable @keyup.enter="handleQuery" />
|
</el-col>
|
||||||
</el-form-item>
|
<!-- <el-col :span="5">
|
||||||
<el-form-item>
|
<el-form-item label="施工类型状态" prop="status">
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-select v-model="tableData.param.status" placeholder="请选择施工类型状态" clearable>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-option v-for="dict in account_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
</el-form-item>
|
</el-select>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
</el-card>
|
</el-col> -->
|
||||||
</div>
|
<!-- <el-col :span="5">
|
||||||
</transition>
|
<el-form-item label="创建时间" prop="createdAt">
|
||||||
|
<el-date-picker
|
||||||
<el-card shadow="never">
|
clearable
|
||||||
<template #header>
|
style="width: 200px"
|
||||||
|
v-model="tableData.param.createdAt"
|
||||||
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择创建时间"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="busMachineryList"
|
||||||
|
><el-icon><Search /></el-icon>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button @click="resetQuery(queryRef)"
|
||||||
|
><el-icon><Refresh /></el-icon>重置</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['machinery:machinery:add']"> 新增 </el-button>
|
<el-button type="primary" @click="handleAdd" v-auth="'api/v1/system/busMachinery/add'"
|
||||||
|
><el-icon><Plus /></el-icon>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['machinery:machinery:edit']">
|
<el-button type="success" :disabled="single" @click="handleUpdate(null)" v-auth="'api/v1/system/busMachinery/edit'"
|
||||||
修改
|
><el-icon><Edit /></el-icon>修改</el-button
|
||||||
</el-button>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['machinery:machinery:remove']">
|
<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busMachinery/delete'"
|
||||||
删除
|
><el-icon><Delete /></el-icon>删除</el-button
|
||||||
</el-button>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['machinery:machinery:export']">导出 </el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</div>
|
||||||
|
<el-table
|
||||||
<el-table v-loading="loading" :data="machineryList" @selection-change="handleSelectionChange">
|
v-loading="loading"
|
||||||
<el-table-column type="expand">
|
:data="tableData.data"
|
||||||
<template #default="{ row }">
|
@selection-change="handleSelectionChange"
|
||||||
<machinery-detail-table :machinery-id="row.id" />
|
:expand-row-keys="expandKeys"
|
||||||
|
:row-key="getRowKeys"
|
||||||
|
@expand-change="expandChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="expand" width="80vw">
|
||||||
|
<template #default="props">
|
||||||
|
<el-table :data="props.row.children.data" v-loading="props.row.children.loading">
|
||||||
|
<el-table-column
|
||||||
|
prop="checkoutNumber"
|
||||||
|
label="合格证编号"
|
||||||
|
align="center"
|
||||||
|
:filters="props.row.children.filterOptions"
|
||||||
|
:filter-method="filterHandler"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column prop="checkoutUnit" label="生产厂家" align="center"> </el-table-column>
|
||||||
|
<el-table-column prop="checkoutDate" label="生产日期/有效期" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="type" label="出入场" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.type == 1 ? '出场' : scope.row.type == 2 ? '入场' : '' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="status" label="施工类型状态" :formatter="statusFormat" align="center"> </el-table-column>
|
||||||
|
<el-table-column prop="entryTime" label="入场时间" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="remark" label="备注" align="center" width="200px"> </el-table-column>
|
||||||
|
<el-table-column prop="picture" label="图片" align="center" width="220px">
|
||||||
|
<template #default="scope">
|
||||||
|
<div style="display: flex; justify-content: center">
|
||||||
|
<span v-if="scope.row.picture.length" v-for="item in scope.row.picture">
|
||||||
|
<el-image
|
||||||
|
style="width: 100px; height: 50px"
|
||||||
|
v-if="item"
|
||||||
|
:src="'http://58.17.134.85:8920' + item"
|
||||||
|
fit="contain"
|
||||||
|
:zoom-rate="1.2"
|
||||||
|
:preview-src-list="['http://58.17.134.85:8920' + item]"
|
||||||
|
preview-teleported="true"
|
||||||
|
></el-image>
|
||||||
|
</span>
|
||||||
|
<span v-else>暂无图片</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="200px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link @click="childView(scope.row)"
|
||||||
|
><el-icon><View /></el-icon>详情</el-button
|
||||||
|
>
|
||||||
|
<el-button type="success" link @click="childUpdate(props.row, scope.row)"
|
||||||
|
><el-icon><EditPen /></el-icon>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button type="danger" link @click="childDelete(props.row, scope.row)"
|
||||||
|
><el-icon><DeleteFilled /></el-icon>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="props.row.children.total > 0"
|
||||||
|
:total="props.row.children.total"
|
||||||
|
v-model:page="childrenData.param.pageNum"
|
||||||
|
v-model:limit="childrenData.param.pageSize"
|
||||||
|
@pagination="busMachineryDetailList(props.row.children, props.row.id)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
<el-table-column label="序号" align="center" type="index" :index="indexMethod" width="60" />
|
||||||
<el-table-column label="机械名称" align="center" prop="machineryName" />
|
<el-table-column label="机械名称" align="center" prop="machineryName" min-width="100px" />
|
||||||
<el-table-column label="机械型号" align="center" prop="machineryNumber" />
|
<el-table-column label="型号" align="center" prop="machineryNumber" min-width="100px" />
|
||||||
<el-table-column label="数量" align="center" prop="number" />
|
<el-table-column label="数量" align="center" prop="ct" min-width="50px" />
|
||||||
<el-table-column label="负责人" align="center" prop="principal" />
|
<el-table-column label="负责人" align="center" prop="principal" min-width="100px" />
|
||||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" />
|
<el-table-column label="备注" align="center" prop="remark" min-width="100px" />
|
||||||
<el-table-column label="供应商" align="center" prop="provider" />
|
<el-table-column label="创建时间" align="center" prop="createdAt" min-width="150px">
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding" width="300">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-space wrap>
|
<span>{{ scope.row.createdAt }}</span>
|
||||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['machinery:machinery:edit']">修改 </el-button>
|
</template>
|
||||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['machinery:machinery:remove']">
|
</el-table-column>
|
||||||
删除
|
<el-table-column label="操作" align="center" class-name="small-padding" min-width="250px" fixed="right">
|
||||||
</el-button>
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAddMachineryDetail(scope.row)"> 入场</el-button>
|
<el-button type="primary" link @click="handleView(scope.row)" v-auth="'api/v1/system/busMachinery/get'"
|
||||||
</el-space>
|
><el-icon><View /></el-icon>详情</el-button
|
||||||
|
>
|
||||||
|
<el-button type="success" link @click="handleUpdate(scope.row)" v-auth="'api/v1/system/busMachinery/edit'"
|
||||||
|
><el-icon><EditPen /></el-icon>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busMachinery/delete'"
|
||||||
|
><el-icon><DeleteFilled /></el-icon>删除</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" link @click="handleaddChild(scope.row)"
|
||||||
|
><el-icon><Plus /></el-icon>入场</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<pagination
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
v-show="tableData.total > 0"
|
||||||
|
:total="tableData.total"
|
||||||
|
v-model:page="tableData.param.pageNum"
|
||||||
|
v-model:limit="tableData.param.pageSize"
|
||||||
|
@pagination="busMachineryList"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改机械对话框 -->
|
<apiV1SystemBusMachineryAdd ref="addRef" :statusOptions="account_status" @busMachineryList="busMachineryList"></apiV1SystemBusMachineryAdd>
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
<apiV1SystemBusMachineryEdit ref="editRef" :statusOptions="account_status" @busMachineryList="busMachineryList"></apiV1SystemBusMachineryEdit>
|
||||||
<el-form ref="machineryFormRef" :model="form" :rules="rules" label-width="90px">
|
<apiV1SystemBusMachineryDetail
|
||||||
<el-form-item label="机械名称" prop="machineryName">
|
ref="detailRef"
|
||||||
<el-input v-model="form.machineryName" placeholder="请输入机械名称" />
|
:statusOptions="account_status"
|
||||||
</el-form-item>
|
@busMachineryList="busMachineryList"
|
||||||
<el-form-item label="机械型号" prop="machineryNumber">
|
></apiV1SystemBusMachineryDetail>
|
||||||
<el-input v-model="form.machineryNumber" placeholder="请输入机械型号" />
|
<addMachineChild
|
||||||
</el-form-item>
|
ref="addChildRef"
|
||||||
<el-form-item label="数量" prop="number">
|
:typeOptions="typeOption"
|
||||||
<el-input v-model="form.number" placeholder="请输入数量" />
|
:statusOptions="account_status"
|
||||||
</el-form-item>
|
@busMachineryDetailList="busMachineryDetailList"
|
||||||
<el-form-item label="负责人" prop="principal">
|
></addMachineChild>
|
||||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
<editMachineChild
|
||||||
</el-form-item>
|
ref="editChildRef"
|
||||||
<el-form-item label="负责人电话" prop="principalPhone">
|
:typeOptions="typeOption"
|
||||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" type="number" />
|
:statusOptions="account_status"
|
||||||
</el-form-item>
|
@busMachineryDetailList="busMachineryDetailList"
|
||||||
<el-form-item label="供应商" prop="provider">
|
></editMachineChild>
|
||||||
<el-input v-model="form.provider" placeholder="请输入供应商" />
|
<detailMachineChild
|
||||||
</el-form-item>
|
ref="deatilChildRef"
|
||||||
<el-form-item label="备注" prop="remark">
|
:typeOptions="typeOption"
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
:statusOptions="account_status"
|
||||||
</el-form-item>
|
@busMachineryDetailList="busMachineryDetailList"
|
||||||
</el-form>
|
></detailMachineChild>
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
<machinery-detail-add-dialog :machinery-id="currentMachineryId" ref="dialogRef" @submit="getList" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { toRefs, reactive, onMounted, ref, defineComponent, computed, getCurrentInstance, toRaw } from 'vue';
|
||||||
|
import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
|
||||||
|
import { listBusMachinery, delBusMachinery } from '@/api/machinery/machinery';
|
||||||
|
import { BusMachineryTableColumns, BusMachineryInfoData, BusMachineryTableDataState } from './component/model';
|
||||||
|
import apiV1SystemBusMachineryAdd from './component/add.vue';
|
||||||
|
import apiV1SystemBusMachineryEdit from './component/edit.vue';
|
||||||
|
import apiV1SystemBusMachineryDetail from './component/detail.vue';
|
||||||
|
import addMachineChild from '@/views/busMachineryDetail/list/component/add.vue';
|
||||||
|
import editMachineChild from '@/views/busMachineryDetail/list/component/edit.vue';
|
||||||
|
import detailMachineChild from '@/views/busMachineryDetail/list/component/detail.vue';
|
||||||
|
|
||||||
<script setup name="Machinery" lang="ts">
|
import { listBusMachineryDetail, delBusMachineryDetail } from '@/api/machinery/machineryDetail';
|
||||||
import { addMachinery, delMachinery, getMachinery, listMachinery, updateMachinery } from '@/api/machinery/machinery';
|
import useUserStore from '@/store/modules/user';
|
||||||
import { MachineryForm, MachineryQuery, MachineryVO } from '@/api/machinery/machinery/types';
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
components: {
|
||||||
import MachineryDetailTable from '@/views/machinery/component/MachineryDetailTable.vue';
|
apiV1SystemBusMachineryAdd,
|
||||||
import MachineryDetailAddDialog from '@/views/machinery/component/MachineryDetailAddDialog.vue';
|
apiV1SystemBusMachineryEdit,
|
||||||
|
apiV1SystemBusMachineryDetail,
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
addMachineChild,
|
||||||
|
editMachineChild,
|
||||||
// 获取用户 store
|
detailMachineChild
|
||||||
const userStore = useUserStoreHook();
|
|
||||||
// 从 store 中获取项目列表和当前选中的项目
|
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
|
||||||
const machineryList = ref<MachineryVO[]>([]);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
const machineryFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: MachineryForm = {
|
|
||||||
id: undefined,
|
|
||||||
machineryName: undefined,
|
|
||||||
machineryNumber: undefined,
|
|
||||||
projectId: currentProject.value?.id,
|
|
||||||
number: undefined,
|
|
||||||
principal: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
principalPhone: undefined,
|
|
||||||
provider: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<MachineryForm, MachineryQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
machineryName: undefined,
|
|
||||||
machineryNumber: undefined,
|
|
||||||
projectId: currentProject.value?.id,
|
|
||||||
number: undefined,
|
|
||||||
principal: undefined,
|
|
||||||
params: {},
|
|
||||||
principalPhone: undefined,
|
|
||||||
provider: undefined
|
|
||||||
},
|
},
|
||||||
rules: {
|
setup() {
|
||||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
const { proxy } = <any>getCurrentInstance();
|
||||||
}
|
const loading = ref(false);
|
||||||
});
|
const childLoading = ref(false);
|
||||||
|
const queryRef = ref();
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const addRef = ref();
|
||||||
|
const editRef = ref();
|
||||||
/** 查询机械列表 */
|
const detailRef = ref();
|
||||||
const getList = async () => {
|
const addChildRef = ref();
|
||||||
loading.value = true;
|
const editChildRef = ref();
|
||||||
const res = await listMachinery(queryParams.value);
|
const deatilChildRef = ref();
|
||||||
machineryList.value = res.rows;
|
// 是否显示所有搜索选项
|
||||||
total.value = res.total;
|
const showAll = ref(false);
|
||||||
loading.value = false;
|
// 非单个禁用
|
||||||
};
|
const single = ref(true);
|
||||||
|
// 非多个禁用
|
||||||
/** 取消按钮 */
|
const multiple = ref(true);
|
||||||
const cancel = () => {
|
const word = computed(() => {
|
||||||
reset();
|
if (showAll.value === false) {
|
||||||
dialog.visible = false;
|
//对文字进行处理
|
||||||
};
|
return '展开搜索';
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
machineryFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: MachineryVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = '添加机械';
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = async (row?: MachineryVO) => {
|
|
||||||
reset();
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
const res = await getMachinery(_id);
|
|
||||||
Object.assign(form.value, res.data);
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = '修改机械';
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
machineryFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
form.value.projectId = currentProject.value?.id;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateMachinery(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
} else {
|
} else {
|
||||||
await addMachinery(form.value).finally(() => (buttonLoading.value = false));
|
return '收起搜索';
|
||||||
}
|
}
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
});
|
||||||
dialog.visible = false;
|
// 字典选项数据
|
||||||
await getList();
|
const account_status = ref([
|
||||||
}
|
{
|
||||||
});
|
label: '正常',
|
||||||
};
|
value: '0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '停用',
|
||||||
|
value: '1'
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
const stores = useUserStore();
|
||||||
|
const state = reactive<BusMachineryTableDataState>({
|
||||||
|
ids: [],
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
param: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
machineryName: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
dateRange: [],
|
||||||
|
projectId: stores.selectedProject.goId
|
||||||
|
}
|
||||||
|
},
|
||||||
|
childrenData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
param: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
expandKeys: [], // 需要展开行的sourceId数组
|
||||||
|
typeOption: [
|
||||||
|
{
|
||||||
|
label: '入场',
|
||||||
|
value: '2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '出场',
|
||||||
|
value: '1'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
// 页面加载时
|
||||||
|
onMounted(() => {
|
||||||
|
initTableData();
|
||||||
|
});
|
||||||
|
// 初始化表格数据
|
||||||
|
const initTableData = () => {
|
||||||
|
busMachineryList();
|
||||||
|
};
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = (formEl: FormInstance | undefined) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
busMachineryList();
|
||||||
|
};
|
||||||
|
// 获取列表数据
|
||||||
|
const busMachineryList = () => {
|
||||||
|
loading.value = true;
|
||||||
|
listBusMachinery(state.tableData.param).then((res: any) => {
|
||||||
|
console.log('🚀 ~ busMachineryList ~ res:', res);
|
||||||
|
let list = res.data.list ?? [];
|
||||||
|
state.tableData.data = list.map((item) => {
|
||||||
|
item.children = {};
|
||||||
|
item.children.data = [];
|
||||||
|
item.children.total = 0;
|
||||||
|
item.children.loading = false;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
state.tableData.total = res.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 施工类型状态字典翻译
|
||||||
|
const statusFormat = (row: BusMachineryTableColumns) => {
|
||||||
|
return proxy.selectDictLabel(account_status.value, row.status);
|
||||||
|
};
|
||||||
|
// 多选框选中数据
|
||||||
|
const handleSelectionChange = (selection: Array<BusMachineryInfoData>) => {
|
||||||
|
state.ids = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
const handleAdd = () => {
|
||||||
|
addRef.value.openDialog();
|
||||||
|
};
|
||||||
|
const handleUpdate = (row: BusMachineryTableColumns) => {
|
||||||
|
if (!row) {
|
||||||
|
row = state.tableData.data.find((item: BusMachineryTableColumns) => {
|
||||||
|
return item.id === state.ids[0];
|
||||||
|
}) as BusMachineryTableColumns;
|
||||||
|
}
|
||||||
|
editRef.value.openDialog(toRaw(row));
|
||||||
|
};
|
||||||
|
/** 自定义编号 */
|
||||||
|
const indexMethod = (index) => {
|
||||||
|
let pageNum = state.tableData.param.pageNum - 1;
|
||||||
|
if (pageNum !== -1 && pageNum !== 0) {
|
||||||
|
return index + 1 + pageNum * state.tableData.param.pageSize;
|
||||||
|
} else {
|
||||||
|
return index + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const childDelete = (props, row: BusMachineryTableColumns) => {
|
||||||
|
let msg = '你确定要删除所选数据?';
|
||||||
|
let id: number[] = [];
|
||||||
|
if (row) {
|
||||||
|
msg = `此操作将永久删除数据,是否继续?`;
|
||||||
|
id = [row.id];
|
||||||
|
} else {
|
||||||
|
id = state.ids;
|
||||||
|
}
|
||||||
|
if (id.length === 0) {
|
||||||
|
ElMessage.error('请选择要删除的数据。');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(msg, '提示', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delBusMachineryDetail(id).then(() => {
|
||||||
|
ElMessage.success('删除成功');
|
||||||
|
busMachineryDetailList(props.children, props.id);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
const handleView = (row: BusMachineryTableColumns) => {
|
||||||
|
detailRef.value.openDialog(toRaw(row));
|
||||||
|
};
|
||||||
|
// 获取当前行key
|
||||||
|
const getRowKeys = (row: any) => {
|
||||||
|
return row.id;
|
||||||
|
};
|
||||||
|
// 展开行change事件
|
||||||
|
const expandChange = (row: any, expandedRows: any) => {
|
||||||
|
// state.expandKeys = [row.id];
|
||||||
|
//当行展示时调用接口
|
||||||
|
if (expandedRows.length) {
|
||||||
|
// state.expandKeys = [];
|
||||||
|
// if(row) {
|
||||||
|
// state.expandKeys.push(row.id)
|
||||||
|
// }
|
||||||
|
busMachineryDetailList(row.children, row.id);
|
||||||
|
} else {
|
||||||
|
// state.expandKeys = [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 获取子级数据
|
||||||
|
const busMachineryDetailList = (row, machinery_id: any) => {
|
||||||
|
row.loading = true;
|
||||||
|
listBusMachineryDetail({ ...state.childrenData.param, machinery_id: machinery_id }).then((res: any) => {
|
||||||
|
let list = res.data.list ?? [];
|
||||||
|
let filterOptions = [];
|
||||||
|
if (list.length) {
|
||||||
|
list = list.map((item) => {
|
||||||
|
if (item.picture && item.picture.includes('[')) {
|
||||||
|
item.picture = item.picture ? JSON.parse(item.picture) : [];
|
||||||
|
} else {
|
||||||
|
item.picture = item.picture ? item.picture.split(',') : [];
|
||||||
|
}
|
||||||
|
filterOptions.push({ text: item.checkoutNumber, value: item.checkoutNumber });
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
row.data = list;
|
||||||
|
console.log('🚀 ~ busMachineryDetailList ~ row.data :', row.data);
|
||||||
|
row.total = res.data.total;
|
||||||
|
row.filterOptions = filterOptions;
|
||||||
|
row.loading = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 添加子级数据
|
||||||
|
const handleaddChild = (row: any) => {
|
||||||
|
addChildRef.value.openDialog(toRaw(row));
|
||||||
|
};
|
||||||
|
const childUpdate = (props, row: any) => {
|
||||||
|
if (!row) {
|
||||||
|
row = state.tableData.data.find((item: any) => {
|
||||||
|
return item.id === state.ids[0];
|
||||||
|
}) as any;
|
||||||
|
}
|
||||||
|
editChildRef.value.openDialog(toRaw(props), toRaw(row));
|
||||||
|
};
|
||||||
|
const childView = (row: any) => {
|
||||||
|
deatilChildRef.value.openDialog(toRaw(row));
|
||||||
|
};
|
||||||
|
const handleDelete = (row: any) => {
|
||||||
|
let msg = '你确定要删除所选数据?';
|
||||||
|
let id: number[] = [];
|
||||||
|
if (row) {
|
||||||
|
msg = `此操作将永久删除数据,是否继续?`;
|
||||||
|
id = [row.id];
|
||||||
|
} else {
|
||||||
|
id = state.ids;
|
||||||
|
}
|
||||||
|
if (id.length === 0) {
|
||||||
|
ElMessage.error('请选择要删除的数据。');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(msg, '提示', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delBusMachinery(id).then(() => {
|
||||||
|
ElMessage.success('删除成功');
|
||||||
|
busMachineryList();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
const filterHandler = (value: string, row: any, column: any) => {
|
||||||
|
const property = column['property'];
|
||||||
|
return row[property] === value;
|
||||||
|
};
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 监听项目ID变化,刷新数据 */
|
||||||
const handleDelete = async (row?: MachineryVO) => {
|
const listeningProject = watch(
|
||||||
const _ids = row?.id || ids.value;
|
() => stores.selectedProject.goId,
|
||||||
await proxy?.$modal.confirm('是否确认删除机械编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
(newId, oldId) => {
|
||||||
await delMachinery(_ids);
|
if (newId !== oldId && newId) {
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
state.tableData.param.projectId = newId;
|
||||||
await getList();
|
initTableData();
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 页面卸载时清理监听 */
|
||||||
const handleExport = () => {
|
onUnmounted(() => {
|
||||||
proxy?.download(
|
listeningProject();
|
||||||
'machinery/machinery/export',
|
});
|
||||||
{
|
|
||||||
...queryParams.value
|
|
||||||
},
|
|
||||||
`machinery_${new Date().getTime()}.xlsx`
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const dialogRef = ref();
|
return {
|
||||||
const currentMachineryId = ref<number | string>(0);
|
proxy,
|
||||||
/** 添加机械出入场详情 */
|
addRef,
|
||||||
const handleAddMachineryDetail = (row?: MachineryVO) => {
|
editRef,
|
||||||
currentMachineryId.value = row.id ?? 0;
|
detailRef,
|
||||||
dialogRef.value.openDialog();
|
showAll,
|
||||||
};
|
loading,
|
||||||
|
single,
|
||||||
//监听项目id刷新数据
|
multiple,
|
||||||
const listeningProject = watch(
|
word,
|
||||||
() => currentProject.value?.id,
|
queryRef,
|
||||||
(nid, oid) => {
|
resetQuery,
|
||||||
queryParams.value.projectId = nid;
|
busMachineryList,
|
||||||
form.value.projectId = nid;
|
statusFormat,
|
||||||
getList();
|
account_status,
|
||||||
|
handleSelectionChange,
|
||||||
|
handleAdd,
|
||||||
|
handleUpdate,
|
||||||
|
handleDelete,
|
||||||
|
handleView,
|
||||||
|
indexMethod,
|
||||||
|
getRowKeys,
|
||||||
|
handleaddChild,
|
||||||
|
childView,
|
||||||
|
childUpdate,
|
||||||
|
childDelete,
|
||||||
|
addChildRef,
|
||||||
|
editChildRef,
|
||||||
|
deatilChildRef,
|
||||||
|
busMachineryDetailList,
|
||||||
|
childLoading,
|
||||||
|
expandChange,
|
||||||
|
filterHandler,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
listeningProject();
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.colBlock {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.colNone {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -137,12 +137,7 @@
|
|||||||
@change="(val) => selectName(val, scope.row, scope.$index)"
|
@change="(val) => selectName(val, scope.row, scope.$index)"
|
||||||
>
|
>
|
||||||
<!-- 动态过滤:排除当前行外已选中的物资ID -->
|
<!-- 动态过滤:排除当前行外已选中的物资ID -->
|
||||||
<el-option
|
<el-option v-for="item in getAvailableNameList(scope.$index)" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
v-for="item in getAvailableNameList(scope.$index)"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -426,11 +421,11 @@ const getAvailableNameList = (currentIndex: number) => {
|
|||||||
// 收集除当前行外已选中的物资ID
|
// 收集除当前行外已选中的物资ID
|
||||||
const selectedIds = form.value.planList
|
const selectedIds = form.value.planList
|
||||||
.filter((_, index) => index !== currentIndex)
|
.filter((_, index) => index !== currentIndex)
|
||||||
.map(item => item.suppliespriceId)
|
.map((item) => item.suppliespriceId)
|
||||||
.filter(id => id !== undefined && id !== null);
|
.filter((id) => id !== undefined && id !== null);
|
||||||
|
|
||||||
// 过滤掉已选中的物资
|
// 过滤掉已选中的物资
|
||||||
return nameList.value.filter(item => !selectedIds.includes(item.id));
|
return nameList.value.filter((item) => !selectedIds.includes(item.id));
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 选择物资名称触发 */
|
/** 选择物资名称触发 */
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -34,9 +34,9 @@
|
|||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-image
|
<el-image
|
||||||
:z-index="9999"
|
:z-index="9999"
|
||||||
:preview-src-list="['http://58.17.134.85:8919' + scope.row.path]"
|
:preview-src-list="['http://58.17.134.85:8920' + scope.row.path]"
|
||||||
preview-teleported
|
preview-teleported
|
||||||
:src="'http://58.17.134.85:8919' + scope.row.path"
|
:src="'http://58.17.134.85:8920' + scope.row.path"
|
||||||
class="w20"
|
class="w20"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
@ -416,7 +416,11 @@ const handleDayAdd = (row: ProgressCategoryVO) => {
|
|||||||
if (row.unitType === '2') {
|
if (row.unitType === '2') {
|
||||||
dailyRef.value.openDialog(row);
|
dailyRef.value.openDialog(row);
|
||||||
} else {
|
} else {
|
||||||
dailyRateRef.value.openDialog(row);
|
if (!row.workType) {
|
||||||
|
dailyRef.value.openDialog(row);
|
||||||
|
} else {
|
||||||
|
dailyRateRef.value.openDialog(row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
395
src/views/project/attendance/component/detail.vue
Normal file
395
src/views/project/attendance/component/detail.vue
Normal file
@ -0,0 +1,395 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wxApplet-busAttendance-Detail">
|
||||||
|
<el-dialog v-model="isShowDialog" width="1300px" :close-on-click-modal="false" :destroy-on-close="true" custom-class="busAttendance_detail">
|
||||||
|
<template #header>
|
||||||
|
<div v-drag="['.wxApplet-busAttendance-Detail .el-dialog', '.wxApplet-busAttendance-Detail .el-dialog__header']"></div>
|
||||||
|
</template>
|
||||||
|
<div class="content">
|
||||||
|
<el-calendar ref="calendarRef" v-model="queryParams.dateStr">
|
||||||
|
<template #header="{ date }">
|
||||||
|
<div class="title">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button type="primary" @click="selectDate('prev-month')">
|
||||||
|
<el-icon class="el-icon--right"><ArrowLeft /></el-icon>上一月
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="selectDate('next-month')">
|
||||||
|
下一月<el-icon class="el-icon--right"><ArrowRight /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
<span class="label">{{ date }} — {{ userInfo.UserName }}出勤</span>
|
||||||
|
<div class="status-detail">
|
||||||
|
<div class="dot1">全天考勤正常</div>
|
||||||
|
<div class="dot2">当天存在异常迟到、早退、缺卡</div>
|
||||||
|
<div class="dot3">当天提交过补卡申请</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #date-cell="{ data }">
|
||||||
|
<div class="time-cell" v-if="getTime(data.day, true) || getTime(data.day, false)">
|
||||||
|
<div class="status">
|
||||||
|
<p class="time">{{ data.day.split('-').slice(1).join('-') }}</p>
|
||||||
|
<div class="flex-r">
|
||||||
|
<div class="circle status1" v-if="setFilterDay(data.day, 1)"></div>
|
||||||
|
<div class="circle status2" v-if="setFilterDay(data.day, 2)"></div>
|
||||||
|
<div class="circle status3" v-if="setFilterDay(data.day, 3)"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-c">
|
||||||
|
<div class="row normal" v-if="getTime(data.day, true)">
|
||||||
|
<span>{{ getTime(data.day, true) }}</span>
|
||||||
|
<span style="padding-left: 5px">上班打卡</span>
|
||||||
|
</div>
|
||||||
|
<div class="row abnormal2" v-if="getTime(data.day, false)">
|
||||||
|
<span>{{ getTime(data.day, false) }}</span>
|
||||||
|
<span style="padding-left: 5px">下班打卡</span>
|
||||||
|
</div>
|
||||||
|
<div class="row abnormal3" v-if="getTime(data.day, false, true)">
|
||||||
|
<span style="padding-left: 5px">下班缺卡</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template v-else>
|
||||||
|
<div class="flex-c">
|
||||||
|
<p class="time">{{ data.day.split('-').slice(1).join('-') }}</p>
|
||||||
|
<img src="@/assets/icons/svg/empty-CZvxqguX.png" />
|
||||||
|
<span>暂无打卡记录</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-calendar>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, unref, getCurrentInstance, nextTick } from 'vue';
|
||||||
|
import { ElMessage, ElLoading } from 'element-plus';
|
||||||
|
import { listAttendanceMonth } from '@/api/project/attendance';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
props: {
|
||||||
|
isPinchOptions: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const calendarRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
isNormal: true,
|
||||||
|
userInfo: {},
|
||||||
|
queryParams: {
|
||||||
|
openid: '',
|
||||||
|
dateStr: ''
|
||||||
|
},
|
||||||
|
Daylist: [] //
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.isShowDialog = true;
|
||||||
|
if (row) {
|
||||||
|
state.queryParams.openid = row.Openid;
|
||||||
|
state.queryParams.dateStr = proxy.parseTime(new Date(), '{y}-{m}');
|
||||||
|
state.userInfo = row;
|
||||||
|
nextTick(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//获取数据
|
||||||
|
const getList = () => {
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '正在加载中……',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
target: '.busAttendance_detail'
|
||||||
|
});
|
||||||
|
listAttendanceMonth(state.queryParams as any).then((res: any) => {
|
||||||
|
loading.close();
|
||||||
|
let list = res.data.list ?? [];
|
||||||
|
state.Daylist = list;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
const selectDate = (val: any) => {
|
||||||
|
if (!calendarRef.value) return;
|
||||||
|
calendarRef.value.selectDate(val);
|
||||||
|
state.queryParams.dateStr = proxy.parseTime(new Date(state.queryParams.dateStr), '{y}-{m}');
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
const setFilterDay = (day, key) => {
|
||||||
|
let arr = [1, 2, 3, 4, 5]; //1正常,2迟到,3早退,4缺勤,5补卡
|
||||||
|
let flag = false;
|
||||||
|
if (state.Daylist && state.Daylist.length) {
|
||||||
|
let arr = state.Daylist;
|
||||||
|
for (let index = 0; index < arr.length; index++) {
|
||||||
|
const item = arr[index];
|
||||||
|
if (item.PrintingDate == day) {
|
||||||
|
let IsPinch1 = item.threelist[0].IsPinch; //状态
|
||||||
|
let IsPinch2 = 1;
|
||||||
|
if (item.threelist.length > 1) {
|
||||||
|
IsPinch2 = item.threelist[1].IsPinch; //状态
|
||||||
|
}
|
||||||
|
if (key == 1) {
|
||||||
|
// 都是全勤的情况
|
||||||
|
if (IsPinch1 == 1 && IsPinch2 == 1) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (key == 2) {
|
||||||
|
// 存在缺卡 迟到 早退
|
||||||
|
if (['2', '3', '4'].includes(IsPinch1) || ['2', '3', '4'].includes(IsPinch2)) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (key == 3) {
|
||||||
|
// 出现补卡申请
|
||||||
|
if (IsPinch1 == 5 || IsPinch2 == 5) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
};
|
||||||
|
const getTime = (day, bool, flag = false) => {
|
||||||
|
let time = '';
|
||||||
|
if (state.Daylist && state.Daylist.length) {
|
||||||
|
let arr = state.Daylist;
|
||||||
|
for (let index = 0; index < arr.length; index++) {
|
||||||
|
const item = arr[index];
|
||||||
|
if (item.PrintingDate == day) {
|
||||||
|
if (bool) {
|
||||||
|
time = item.threelist[0].Clock.split(' ')[1];
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
if (item.threelist.length > 1) {
|
||||||
|
time = item.threelist[1].Clock.split(' ')[1]; //状态
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
if (item.threelist.length <= 1) {
|
||||||
|
time = '1';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (item.threelist[1] && item.threelist[1].IsPinch == 4) {
|
||||||
|
//缺卡显示
|
||||||
|
time = '1';
|
||||||
|
} else {
|
||||||
|
//不显示
|
||||||
|
time = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return time;
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
menuRef,
|
||||||
|
getTime,
|
||||||
|
formRef,
|
||||||
|
calendarRef,
|
||||||
|
selectDate,
|
||||||
|
setFilterDay,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.wxApplet-busAttendance-Detail {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
.label {
|
||||||
|
font-size: 24px;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 0;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
color: #000;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.status-detail {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
> div {
|
||||||
|
margin: 0 15px;
|
||||||
|
position: relative;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.dot1::before,
|
||||||
|
.dot2::before,
|
||||||
|
.dot3::before {
|
||||||
|
position: absolute;
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
left: -15px;
|
||||||
|
top: 30%;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.dot1::before {
|
||||||
|
background: rgba(29, 111, 233, 1);
|
||||||
|
}
|
||||||
|
.dot2::before {
|
||||||
|
background: rgba(245, 95, 78, 1);
|
||||||
|
}
|
||||||
|
.dot3::before {
|
||||||
|
background: rgba(255, 141, 26, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
height: 700px;
|
||||||
|
.time-cell {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
position: relative;
|
||||||
|
.status {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
.flex-r {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: -14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.flex-c {
|
||||||
|
top: 40%;
|
||||||
|
height: 60%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
.row {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: baseline;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
}
|
||||||
|
.normal {
|
||||||
|
color: rgba(64, 158, 255, 1);
|
||||||
|
background: rgba(236, 245, 255, 1);
|
||||||
|
border: 1px solid rgba(64, 158, 255, 1);
|
||||||
|
}
|
||||||
|
.abnormal1 {
|
||||||
|
color: rgba(255, 141, 26, 1);
|
||||||
|
background: rgba(255, 246, 237, 1);
|
||||||
|
border: 1px solid rgba(64, 158, 255, 1);
|
||||||
|
}
|
||||||
|
.abnormal2 {
|
||||||
|
color: rgba(255, 141, 26, 1);
|
||||||
|
background: rgba(255, 246, 237, 1);
|
||||||
|
border: 1px solid rgba(255, 141, 26, 1);
|
||||||
|
}
|
||||||
|
.abnormal3 {
|
||||||
|
color: rgb(245, 95, 78);
|
||||||
|
background: rgba(255, 246, 237, 1);
|
||||||
|
border: 1px solid rgb(245, 95, 78);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.circle {
|
||||||
|
width: 7px;
|
||||||
|
height: 7px;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin: 0 2px;
|
||||||
|
}
|
||||||
|
.status1 {
|
||||||
|
background: rgba(29, 111, 233, 1);
|
||||||
|
}
|
||||||
|
.status2 {
|
||||||
|
background: rgba(245, 95, 78, 1);
|
||||||
|
}
|
||||||
|
.status3 {
|
||||||
|
background: rgba(255, 141, 26, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-c {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
.time {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
> img {
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
> span {
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgba(204, 204, 204, 1);
|
||||||
|
padding-top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-calendar) {
|
||||||
|
--el-calendar-cell-width: 110px;
|
||||||
|
}
|
||||||
|
:deep(.el-calendar__header) {
|
||||||
|
padding: 12px 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-calendar__body) {
|
||||||
|
max-height: 635px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
:deep(.el-dialog__body) {
|
||||||
|
max-height: calc(90vh - 0px) !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -62,9 +62,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="出勤(天)" align="center" prop="Attendance" />
|
<el-table-column label="出勤(天)" align="center" prop="Attendance" />
|
||||||
<el-table-column label="迟到(次)" align="center" prop="LackOfCard" />
|
<el-table-column label="迟到(次)" align="center" prop="BeLate" />
|
||||||
<el-table-column label="早退(次)" align="center" prop="LeaveEarly" />
|
<el-table-column label="早退(次)" align="center" prop="LeaveEarly" />
|
||||||
<el-table-column label="缺卡(次)" align="center" prop="BeLate" />
|
<el-table-column label="缺卡(次)" align="center" prop="LackOfCard" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="View" @click="handleDetails(scope.row)" v-hasPermi="['project:attendance:edit']">详情</el-button>
|
<el-button link type="primary" icon="View" @click="handleDetails(scope.row)" v-hasPermi="['project:attendance:edit']">详情</el-button>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 考勤详情对话框 -->
|
<!-- 考勤详情对话框 -->
|
||||||
<el-dialog v-model="dialog.details" width="1300px">
|
<!-- <el-dialog v-model="dialog.details" width="1300px">
|
||||||
<el-calendar ref="calendar" v-model="calendarDay" class="h170 pos-relative">
|
<el-calendar ref="calendar" v-model="calendarDay" class="h170 pos-relative">
|
||||||
<template #header="{ date }">
|
<template #header="{ date }">
|
||||||
<span>
|
<span>
|
||||||
@ -103,7 +103,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-calendar>
|
</el-calendar>
|
||||||
</el-dialog>
|
</el-dialog> -->
|
||||||
<el-dialog title="导出考勤列表" width="30%" v-model="exportDialogVisible">
|
<el-dialog title="导出考勤列表" width="30%" v-model="exportDialogVisible">
|
||||||
<el-form :model="exportForm" :rules="rules" ref="formRef" label-width="90px">
|
<el-form :model="exportForm" :rules="rules" ref="formRef" label-width="90px">
|
||||||
<el-form-item label="导出时间" prop="years">
|
<el-form-item label="导出时间" prop="years">
|
||||||
@ -114,6 +114,7 @@
|
|||||||
<el-button type="primary" @click="onSubmit">导出</el-button>
|
<el-button type="primary" @click="onSubmit">导出</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<detail ref="detailRef"></detail>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -126,7 +127,7 @@ import { useUserStoreHook } from '@/store/modules/user';
|
|||||||
import { parseTime } from '@/utils/ruoyi';
|
import { parseTime } from '@/utils/ruoyi';
|
||||||
const commandstats = ref();
|
const commandstats = ref();
|
||||||
import { pcSelectBelowProjectOfPersonnel, getSysProjectTeamList, pcCollectDataForTwoWeeks } from '@/api/project/goUser/index';
|
import { pcSelectBelowProjectOfPersonnel, getSysProjectTeamList, pcCollectDataForTwoWeeks } from '@/api/project/goUser/index';
|
||||||
|
import detail from './component/detail.vue';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { type_of_work } = toRefs<any>(proxy?.useDict('clock_status_type', 'type_of_work'));
|
const { type_of_work } = toRefs<any>(proxy?.useDict('clock_status_type', 'type_of_work'));
|
||||||
import type { CalendarInstance } from 'element-plus';
|
import type { CalendarInstance } from 'element-plus';
|
||||||
@ -136,7 +137,22 @@ const userStore = useUserStoreHook();
|
|||||||
// 从 store 中获取项目列表和当前选中的项目
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const exportDialogVisible = ref(false);
|
const exportDialogVisible = ref(false);
|
||||||
|
const nowMonth = computed(() => {
|
||||||
|
// 获取当前日期
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
|
// 获取年份
|
||||||
|
const year = today.getFullYear();
|
||||||
|
|
||||||
|
// 获取月份(注意:getMonth()返回0-11,所以需要+1)
|
||||||
|
let month = today.getMonth() + 1;
|
||||||
|
|
||||||
|
// 月份补零处理
|
||||||
|
month = month < 10 ? '0' + month : month;
|
||||||
|
|
||||||
|
// 拼接成"YYYY-MM"格式
|
||||||
|
return `${year}-${month}`;
|
||||||
|
});
|
||||||
const attendanceList = ref<AttendanceVO[]>([]);
|
const attendanceList = ref<AttendanceVO[]>([]);
|
||||||
const attendanceTwoWeekList = ref<AttendanceTwoWeekVO[]>([]);
|
const attendanceTwoWeekList = ref<AttendanceTwoWeekVO[]>([]);
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
@ -187,7 +203,7 @@ const data = reactive<PageData<AttendanceForm, any>>({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
dateStr: undefined,
|
dateStr: nowMonth.value,
|
||||||
fuzzyQuery: undefined,
|
fuzzyQuery: undefined,
|
||||||
projectId: currentProject.value.goId,
|
projectId: currentProject.value.goId,
|
||||||
typeOfWork: undefined,
|
typeOfWork: undefined,
|
||||||
@ -209,7 +225,9 @@ const day = computed(() => (date) => {
|
|||||||
});
|
});
|
||||||
//是否打卡
|
//是否打卡
|
||||||
const isplayCard = computed(() => (date) => {
|
const isplayCard = computed(() => (date) => {
|
||||||
return calendarList.value.some((item) => item.dateStr == date.day);
|
console.log('🚀 ~ date:', date);
|
||||||
|
|
||||||
|
return calendarList.value.some((item) => item.PrintingDate == date.day);
|
||||||
});
|
});
|
||||||
//打卡时间下标
|
//打卡时间下标
|
||||||
const playCardIdx = computed(() => (date) => {
|
const playCardIdx = computed(() => (date) => {
|
||||||
@ -227,7 +245,7 @@ const workFromTime = computed(() => (date) => {
|
|||||||
|
|
||||||
//考勤状态
|
//考勤状态
|
||||||
const attendanceStatus = computed(() => (date) => {
|
const attendanceStatus = computed(() => (date) => {
|
||||||
return calendarList.value[playCardIdx.value(date)].status;
|
return calendarList.value[playCardIdx.value(date)].Status;
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
@ -328,13 +346,9 @@ const incrementMonth = (dateStr: string, monthsToAdd: number) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** 详情按钮操作 */
|
/** 详情按钮操作 */
|
||||||
|
const detailRef = ref<any>();
|
||||||
const handleDetails = async (row?: AttendanceVO) => {
|
const handleDetails = async (row?: AttendanceVO) => {
|
||||||
const res = await listAttendanceMonth({ openid: row?.openid, dateStr: queryParams.value.dateStr });
|
detailRef.value.openDialog(toRaw(row));
|
||||||
calendarList.value = res.data.list || [];
|
|
||||||
console.log('🚀 ~ handleDetails ~ calendarList.value:', calendarList.value);
|
|
||||||
dialog.details = true;
|
|
||||||
dialog.id = row?.id;
|
|
||||||
dialog.title = row?.userName || '';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
<el-row :gutter="20" justify="space-around">
|
<el-row :gutter="20" justify="space-around">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="人脸照">
|
<el-form-item label="人脸照">
|
||||||
<el-image :src="userDetail?.pacePhoto" style="width: 150px; height: 150px" />
|
<el-image
|
||||||
|
:src="'http://58.17.134.85:8920' + userDetail?.pacePhoto"
|
||||||
|
:preview-src-list="['http://58.17.134.85:8920' + userDetail?.pacePhoto]"
|
||||||
|
style="width: 150px; height: 150px"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -154,6 +158,7 @@ const userDetail = ref<ConstructionUserVO>();
|
|||||||
const getUserDetail = async () => {
|
const getUserDetail = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await getConstructionUser(props.userId);
|
const res = await getConstructionUser(props.userId);
|
||||||
|
console.log('🚀 ~ getUserDetail ~ res:', res);
|
||||||
if (res.data && res.code === 0) {
|
if (res.data && res.code === 0) {
|
||||||
userDetail.value = res.data;
|
userDetail.value = res.data;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="never">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="110px">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="110px">
|
||||||
<el-form-item label="对应地块" prop="landBlockId">
|
<el-form-item label="对应地块" prop="landBlockId">
|
||||||
<el-select v-model="queryParams.landBlockId" clearable placeholder="请选择对应地块">
|
<el-select v-model="queryParams.landBlockId" clearable placeholder="请选择对应地块">
|
||||||
@ -48,15 +48,6 @@
|
|||||||
<el-form-item label="责任人" prop="responsiblePerson">
|
<el-form-item label="责任人" prop="responsiblePerson">
|
||||||
<el-input v-model="queryParams.responsiblePerson" placeholder="请输入责任人" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.responsiblePerson" placeholder="请输入责任人" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预计完成时间" prop="expectedFinishDate">
|
|
||||||
<el-date-picker
|
|
||||||
clearable
|
|
||||||
v-model="queryParams.expectedFinishDate"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择预计完成时间"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
@ -71,28 +62,22 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['land:landTransferLedger:add']">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['land:landTransferLedger:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="6"></el-col>
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['land:landTransferLedger:remove']"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="landTransferLedgerList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="landTransferLedgerList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column label="土地类型" align="center" prop="landType" />
|
<el-table-column label="土地类型" align="center" prop="landTypeName" />
|
||||||
<el-table-column label="地块" align="center" prop="landName" />
|
<el-table-column label="地块" align="center" prop="landName" />
|
||||||
<el-table-column label="进场道路" align="center" prop="roadName" />
|
<el-table-column label="进场道路" align="center" prop="roadName" />
|
||||||
<el-table-column label="设计面积" align="center" prop="designArea" />
|
<el-table-column label="设计面积(亩)" align="center" prop="designArea" width="180" />
|
||||||
<el-table-column label="责任人" align="center" prop="responsiblePerson" />
|
<el-table-column label="责任人" align="center" prop="responsiblePerson" />
|
||||||
<el-table-column label="预计完成时间" align="center" prop="expectedFinishDate" width="180"> </el-table-column>
|
<el-table-column label="预计完成时间" align="center" prop="expectedFinishDate" width="180"> </el-table-column>
|
||||||
<el-table-column label="流转状态" align="center" prop="transferStatusName" />
|
<el-table-column label="流转状态" align="center" prop="type" />
|
||||||
<el-table-column label="已流转面积(亩)" align="center" prop="transferArea" width="180" />
|
<el-table-column label="已流转面积(亩)" align="center" prop="transferArea" width="180" />
|
||||||
<el-table-column label="不流转数据" align="center" prop="noTrans" width="180" />
|
<el-table-column label="不流转面积(亩)" align="center" prop="noTrans" width="180" />
|
||||||
<el-table-column label="未流转数据" align="center" prop="noTransferAea" width="180" />
|
<el-table-column label="未流转面积(亩)" align="center" prop="noTransferAea" width="180" />
|
||||||
<el-table-column label="流转比例(%)" align="center" width="180">
|
<el-table-column label="流转比例(%)" align="center" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ scope.row.transferArea && scope.row.designArea ? ((scope.row.transferArea / scope.row.designArea) * 100).toFixed(2) : '0.00' }}
|
{{ scope.row.transferArea && scope.row.designArea ? ((scope.row.transferArea / scope.row.designArea) * 100).toFixed(2) : '0.00' }}
|
||||||
@ -135,7 +120,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="summary-item transfer-area">
|
<div class="summary-item transfer-area">
|
||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<span class="summary-label">已流转面积</span>
|
<span class="summary-label">已流转面积(亩)</span>
|
||||||
<span class="summary-value">{{ sonSummaryInfo.totalTransferArea }} 亩</span>
|
<span class="summary-value">{{ sonSummaryInfo.totalTransferArea }} 亩</span>
|
||||||
</div>
|
</div>
|
||||||
<el-icon class="summary-icon" :size="50" color="#3176ff">
|
<el-icon class="summary-icon" :size="50" color="#3176ff">
|
||||||
@ -144,7 +129,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="summary-item non-transfer-area">
|
<div class="summary-item non-transfer-area">
|
||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<span class="summary-label">不流转面积</span>
|
<span class="summary-label">不流转面积(亩)</span>
|
||||||
<span class="summary-value">{{ sonSummaryInfo.totalNonTransferArea }} 亩</span>
|
<span class="summary-value">{{ sonSummaryInfo.totalNonTransferArea }} 亩</span>
|
||||||
</div>
|
</div>
|
||||||
<el-icon class="summary-icon" :size="50" color="#3176ff">
|
<el-icon class="summary-icon" :size="50" color="#3176ff">
|
||||||
@ -153,7 +138,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="summary-item remaining-area">
|
<div class="summary-item remaining-area">
|
||||||
<div class="summary-content">
|
<div class="summary-content">
|
||||||
<span class="summary-label">未流转面积</span>
|
<span class="summary-label">未流转面积(亩)</span>
|
||||||
<span class="summary-value">{{ sonSummaryInfo.remainingArea }} 亩</span>
|
<span class="summary-value">{{ sonSummaryInfo.remainingArea }} 亩</span>
|
||||||
</div>
|
</div>
|
||||||
<el-icon class="summary-icon" :size="50" color="#3176ff">
|
<el-icon class="summary-icon" :size="50" color="#3176ff">
|
||||||
@ -307,7 +292,7 @@
|
|||||||
<el-form-item label="已流转面积(亩)" prop="areaValue">
|
<el-form-item label="已流转面积(亩)" prop="areaValue">
|
||||||
<el-input v-model="sonForm.areaValue" type="number" placeholder="请输入已流转面积" @input="calcSonTransferRatio" />
|
<el-input v-model="sonForm.areaValue" type="number" placeholder="请输入已流转面积" @input="calcSonTransferRatio" />
|
||||||
<div style="color: #ff4d4f; font-size: 12px; margin-top: 4px">
|
<div style="color: #ff4d4f; font-size: 12px; margin-top: 4px">
|
||||||
{{ sonForm.areaValue && sonForm.transferStatus == '1' ? `提示:已流转面积不能超过设计面积 ${sonForm.designArea} 亩` : '' }}
|
{{ sonForm.areaValue && sonForm.transferStatus == '1' ? `提示:当前剩余${sonSummaryInfo.remainingArea} 亩` : '' }}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -340,7 +325,7 @@
|
|||||||
<el-form-item label="不流转面积(亩)" prop="areaValue">
|
<el-form-item label="不流转面积(亩)" prop="areaValue">
|
||||||
<el-input v-model="sonForm.areaValue" type="number" placeholder="请输入不流转面积" />
|
<el-input v-model="sonForm.areaValue" type="number" placeholder="请输入不流转面积" />
|
||||||
<div style="color: #ff4d4f; font-size: 12px; margin-top: 4px">
|
<div style="color: #ff4d4f; font-size: 12px; margin-top: 4px">
|
||||||
{{ sonForm.areaValue && sonForm.transferStatus == '2' ? `提示:不流转面积不能超过设计面积 ${sonForm.designArea} 亩` : '' }}
|
{{ sonForm.areaValue && sonForm.transferStatus == '2' ? `提示:当前剩余 ${sonSummaryInfo.remainingArea} 亩` : '' }}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -526,13 +511,14 @@
|
|||||||
|
|
||||||
<el-col :span="24" v-if="form.transferStatus == '1'">
|
<el-col :span="24" v-if="form.transferStatus == '1'">
|
||||||
<el-form-item label="下一步策略" prop="nextStrategy">
|
<el-form-item label="下一步策略" prop="nextStrategy">
|
||||||
<el-input v-model="form.nextStrategy" type="textarea" placeholder="请输入内容" /> </el-form-item
|
<el-input v-model="form.nextStrategy" type="textarea" placeholder="请输入内容" />
|
||||||
></el-col>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button v-hasPermi="['land:landTransferLedger:add']" :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -588,7 +574,8 @@ const landBlockList = ref([]);
|
|||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const landTransferLedgerFormRef = ref<ElFormInstance>();
|
const landTransferLedgerFormRef = ref<ElFormInstance>();
|
||||||
const enterRoadList = ref([]);
|
const enterRoadList = ref([]);
|
||||||
const { land_type, transfer_status } = toRefs<any>(proxy?.useDict('land_type', 'transfer_status'));
|
// 字典数据
|
||||||
|
const { land_type, land_transfer_status } = toRefs<any>(proxy?.useDict('land_type', 'land_transfer_status'));
|
||||||
|
|
||||||
// 主项弹窗配置
|
// 主项弹窗配置
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
@ -646,14 +633,20 @@ const initFormData: LandTransferLedgerForm = {
|
|||||||
transferStatus: undefined,
|
transferStatus: undefined,
|
||||||
statusDescription: undefined,
|
statusDescription: undefined,
|
||||||
issueSummary: undefined,
|
issueSummary: undefined,
|
||||||
nextStrategy: undefined
|
nextStrategy: undefined,
|
||||||
|
noContractArea: undefined,
|
||||||
|
noContractReason: undefined,
|
||||||
|
noSurveyArea: undefined,
|
||||||
|
nonTransferReason: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 核心数据响应式对象
|
||||||
const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>({
|
const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
projectId: currentProject.value.id,
|
projectId: currentProject.value?.id,
|
||||||
landType: undefined,
|
landType: undefined,
|
||||||
landBlockId: undefined,
|
landBlockId: undefined,
|
||||||
enterRoadId: undefined,
|
enterRoadId: undefined,
|
||||||
@ -758,6 +751,16 @@ const sonRules = {
|
|||||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||||
parentId: [{ required: true, message: '父级ID不能为空', trigger: 'blur' }],
|
parentId: [{ required: true, message: '父级ID不能为空', trigger: 'blur' }],
|
||||||
landType: [{ required: true, message: '土地类型不能为空', trigger: 'change' }],
|
landType: [{ required: true, message: '土地类型不能为空', trigger: 'change' }],
|
||||||
|
landRent: [{ required: true, message: '土地租金不能为空', trigger: 'blur' }],
|
||||||
|
seedlingCompensation: [{ required: true, message: '青苗赔偿不能为空', trigger: 'blur' }],
|
||||||
|
totalAmount: [{ required: true, message: '总金额不能为空', trigger: 'blur' }],
|
||||||
|
statusDescription: [{ required: true, message: '状态说明不能为空', trigger: 'blur' }],
|
||||||
|
issueSummary: [{ required: true, message: '问题总结不能为空', trigger: 'blur' }],
|
||||||
|
nextStrategy: [{ required: true, message: '下一步策略不能为空', trigger: 'blur' }],
|
||||||
|
noContractArea: [{ required: true, message: '不签约面积不能为空', trigger: 'blur' }],
|
||||||
|
noSurveyArea: [{ required: true, message: '不测量面积不能为空', trigger: 'blur' }],
|
||||||
|
noContractReason: [{ required: true, message: '不签约原因不能为空', trigger: 'blur' }],
|
||||||
|
nonTransferReason: [{ required: true, message: '不流转原因不能为空', trigger: 'blur' }],
|
||||||
transferRatio: [
|
transferRatio: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@ -931,7 +934,6 @@ const getLandBlockList = async () => {
|
|||||||
|
|
||||||
/** 取消按钮(主项) */
|
/** 取消按钮(主项) */
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
resetForm();
|
resetForm();
|
||||||
};
|
};
|
||||||
@ -997,6 +999,7 @@ const handleAdd = () => {
|
|||||||
form.value.transferStatus = '0'; // 默认待流转
|
form.value.transferStatus = '0'; // 默认待流转
|
||||||
enterRoadList.value = [];
|
enterRoadList.value = [];
|
||||||
dialog.title = '添加项目土地流转台账';
|
dialog.title = '添加项目土地流转台账';
|
||||||
|
dialog.visible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 查看子项按钮操作(打开子项弹窗时) */
|
/** 查看子项按钮操作(打开子项弹窗时) */
|
||||||
@ -1089,9 +1092,10 @@ const submitForm = () => {
|
|||||||
proxy?.$modal.msgSuccess('操作成功');
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
await getList();
|
await getList();
|
||||||
|
await getLandBlockList(); // 刷新统计信息
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('操作失败:', error);
|
|
||||||
proxy?.$modal.msgError('操作失败,请重试');
|
proxy?.$modal.msgError('操作失败,请重试');
|
||||||
|
console.error('提交表单失败:', error);
|
||||||
} finally {
|
} finally {
|
||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
}
|
}
|
||||||
@ -1159,25 +1163,45 @@ const submitSonForm = () => {
|
|||||||
/** 删除主项按钮操作 */
|
/** 删除主项按钮操作 */
|
||||||
const handleDelete = async (row?: LandTransferLedgerVO) => {
|
const handleDelete = async (row?: LandTransferLedgerVO) => {
|
||||||
const _ids = row?.id || ids.value;
|
const _ids = row?.id || ids.value;
|
||||||
await proxy?.$modal.confirm('是否确认删除项目土地流转台账编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
if (!_ids.length) return;
|
||||||
await delLandTransferLedger(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
try {
|
||||||
await getList();
|
await proxy?.$modal.confirm(`是否确认删除项目土地流转台账编号为"${_ids}"的数据项?`);
|
||||||
|
await delLandTransferLedger(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
await getLandBlockList(); // 刷新统计信息
|
||||||
|
} catch (error) {
|
||||||
|
console.error('删除数据失败:', error);
|
||||||
|
if (error !== 'cancel') {
|
||||||
|
// 排除用户取消确认的情况
|
||||||
|
proxy?.$modal.msgError('删除失败,请重试');
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// 选择地块
|
|
||||||
const handleLandBlockChange = (val) => {
|
/** 选择地块后加载对应道路 */
|
||||||
getListRoad();
|
const handleLandBlockChange = async () => {
|
||||||
|
await getListRoad();
|
||||||
};
|
};
|
||||||
/** 查询地块信息列表 */
|
|
||||||
|
/** 查询地块列表 */
|
||||||
const getListLand = async () => {
|
const getListLand = async () => {
|
||||||
const res = await listLandBlock({
|
try {
|
||||||
pageNum: 1,
|
const res = await listLandBlock({
|
||||||
pageSize: 10000,
|
pageNum: 1,
|
||||||
projectId: currentProject.value.id
|
pageSize: 10000,
|
||||||
});
|
projectId: currentProject.value?.id
|
||||||
landBlockList.value = res.rows;
|
});
|
||||||
|
landBlockList.value = res.rows;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取地块列表失败:', error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
/** 查询进场道路信息列表 */
|
|
||||||
|
/** 查询进场道路列表(按地块筛选) */
|
||||||
const getListRoad = async () => {
|
const getListRoad = async () => {
|
||||||
try {
|
try {
|
||||||
// 优先使用子项表单的地块ID,否则使用主项表单的
|
// 优先使用子项表单的地块ID,否则使用主项表单的
|
||||||
@ -1208,12 +1232,14 @@ const listeningProject = watch(
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** 组件卸载时清理监听 */
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
listeningProject();
|
listeningProject();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** 组件挂载时初始化数据 */
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
Promise.all([getLandBlockList(), getListLand(), getList()]);
|
||||||
getListLand();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
<el-form ref="projectTeamMemberFormRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="projectTeamMemberFormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="施工人员" prop="memberId" v-if="!form.id">
|
<el-form-item label="施工人员" prop="memberId" v-if="!form.id">
|
||||||
<el-select v-model="form.memberId" clearable placeholder="请选择人员" filterable>
|
<el-select v-model="form.memberId" clearable placeholder="请选择人员" remote :remote-method="getUserListNotInTeam" filterable>
|
||||||
<el-option v-for="item in userNotInTeamOpt" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in userNotInTeamOpt" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
<pagination
|
<pagination
|
||||||
size="small"
|
size="small"
|
||||||
@ -188,7 +188,16 @@ const userStore = useUserStoreHook();
|
|||||||
// 从 store 中获取项目列表和当前选中的项目
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { user_post_type } = toRefs<any>(proxy?.useDict('user_post_type'));
|
const user_post_type = ref([
|
||||||
|
{
|
||||||
|
label: '普通员工',
|
||||||
|
value: '4'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '班组长',
|
||||||
|
value: '10'
|
||||||
|
}
|
||||||
|
]);
|
||||||
const memberStatus = ref(false);
|
const memberStatus = ref(false);
|
||||||
interface Props {
|
interface Props {
|
||||||
projectTeamVo: ProjectTeamVO;
|
projectTeamVo: ProjectTeamVO;
|
||||||
@ -262,6 +271,7 @@ const cancel = () => {
|
|||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = { ...initFormData };
|
form.value = { ...initFormData };
|
||||||
projectTeamMemberFormRef.value?.resetFields();
|
projectTeamMemberFormRef.value?.resetFields();
|
||||||
|
userQueryParams.value.userName = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@ -298,13 +308,15 @@ const userQueryParams = ref<ConstructionUserQuery>({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderByColumn: 'createTime',
|
orderByColumn: 'createTime',
|
||||||
isAsc: 'desc',
|
isAsc: 'desc',
|
||||||
projectId: currentProject.value.goId
|
projectId: currentProject.value.goId,
|
||||||
|
userName: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取不在当前班组的成员
|
// 获取不在当前班组的成员
|
||||||
const getUserListNotInTeam = async () => {
|
const getUserListNotInTeam = async (query?: string) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
console.log(currentProject.value.goId);
|
console.log('query', query, userQueryParams.value);
|
||||||
|
if (query && !query.page) userQueryParams.value.userName = query;
|
||||||
|
|
||||||
const res = await listConstructionUser({ ...userQueryParams.value, notTeamId: props.projectTeamVo.id });
|
const res = await listConstructionUser({ ...userQueryParams.value, notTeamId: props.projectTeamVo.id });
|
||||||
userNotInTeamOpt.value = res.data.list.map((user: ConstructionUserVO) => ({
|
userNotInTeamOpt.value = res.data.list.map((user: ConstructionUserVO) => ({
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
<el-row :gutter="20" justify="space-around">
|
<el-row :gutter="20" justify="space-around">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="人脸照">
|
<el-form-item label="人脸照">
|
||||||
<el-image :src="'http://58.17.134.85:8919' + userDetail?.pacePhoto" style="width: 150px; height: 150px" />
|
<el-image
|
||||||
|
:src="'http://58.17.134.85:8920' + userDetail?.pacePhoto"
|
||||||
|
:preview-src-list="['http://58.17.134.85:8920' + userDetail?.pacePhoto]"
|
||||||
|
style="width: 150px; height: 150px"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -154,9 +158,11 @@ const userDetail = ref<ConstructionUserVO>();
|
|||||||
const getUserDetail = async () => {
|
const getUserDetail = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await getDetails(props.userId);
|
const res = await getDetails(props.userId);
|
||||||
|
console.log('🚀 ~ getUserDetail ~ res:', res);
|
||||||
if (res.data && res.code === 0) {
|
if (res.data && res.code === 0) {
|
||||||
userDetail.value = res.data;
|
userDetail.value = res.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -467,7 +467,9 @@
|
|||||||
<el-timeline-item color="rgb(255, 73, 73)">
|
<el-timeline-item color="rgb(255, 73, 73)">
|
||||||
<div class="mb">{{ '退场时间:' + item.leaveDate }}</div>
|
<div class="mb">{{ '退场时间:' + item.leaveDate }}</div>
|
||||||
<div class="pl-xl">
|
<div class="pl-xl">
|
||||||
<span class="text-coolgray font-bold">退场文件:<image-preview :src="item.path" width="100px" class="mr" /></span><br />
|
<span class="text-coolgray font-bold"
|
||||||
|
>退场文件:<image-preview :src="'http://58.17.134.85:8920' + item.path" width="100px" class="mr" /></span
|
||||||
|
><br />
|
||||||
<p class="mt text-coolgray">
|
<p class="mt text-coolgray">
|
||||||
备注:<span class="text-blue">{{ item.remark }}</span>
|
备注:<span class="text-blue">{{ item.remark }}</span>
|
||||||
</p>
|
</p>
|
||||||
@ -753,12 +755,12 @@ const { queryParams, form, rules } = toRefs(data);
|
|||||||
|
|
||||||
//打卡时间下标
|
//打卡时间下标
|
||||||
const playCardIdx = computed(() => (date) => {
|
const playCardIdx = computed(() => (date) => {
|
||||||
return calendarList.value.findIndex((item) => item.clockDate == date.day);
|
return calendarList.value.findIndex((item) => item.printingDate == date.day);
|
||||||
});
|
});
|
||||||
|
|
||||||
//打卡状态颜色
|
//打卡状态颜色
|
||||||
const playCardColor = computed(() => (date) => {
|
const playCardColor = computed(() => (date) => {
|
||||||
const idx = calendarList.value[playCardIdx.value(date)]?.status;
|
const idx = calendarList.value[playCardIdx.value(date)]?.type;
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
case '1':
|
case '1':
|
||||||
return 'green';
|
return 'green';
|
||||||
@ -858,6 +860,7 @@ const handleCalendarMonth = async (e?) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const res = await listConstructionMonth({ openid: dialog.id, years: clockMonth });
|
const res = await listConstructionMonth({ openid: dialog.id, years: clockMonth });
|
||||||
|
console.log('🚀 ~ handleCalendarMonth ~ res:', res.data.list);
|
||||||
calendarList.value = res.data.list;
|
calendarList.value = res.data.list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,28 +29,30 @@
|
|||||||
<el-table-column label="申请人" align="center" prop="userName" />
|
<el-table-column label="申请人" align="center" prop="userName" />
|
||||||
<el-table-column label="申请补卡说明" align="center" prop="explain" />
|
<el-table-column label="申请补卡说明" align="center" prop="explain" />
|
||||||
<el-table-column label="所属班组" align="center" prop="teamName" />
|
<el-table-column label="所属班组" align="center" prop="teamName" />
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<!-- <el-table-column label="状态" align="center" prop="status">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="user_review_status_type" :value="scope.row.status" />
|
<dict-tag :options="user_review_status_type" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="班组长意见" align="center" prop="gangerOpinion">
|
<el-table-column label="班组长意见" align="center" prop="gangerOpinion" min-width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="user_opinion_type" :value="scope.row.gangerOpinion" />
|
<el-tag :type="typeList[scope.row.gangerOpinion - 1]">{{ filterStatus(scope.row.gangerOpinion) }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="班组长说明" align="center" prop="gangerExplain" />
|
<el-table-column label="班组长说明" align="center" prop="gangerExplain" />
|
||||||
<el-table-column label="班组长操作时间" align="center" prop="gangerTime" width="180"> </el-table-column>
|
<el-table-column label="班组长操作时间" align="center" prop="gangerTime" width="180"> </el-table-column>
|
||||||
<el-table-column label="管理员意见" align="center" prop="managerOpinion">
|
<el-table-column label="管理员意见" align="center" prop="managerOpinion" min-width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="user_opinion_type" :value="scope.row.managerOpinion" />
|
<el-tag :type="typeList[scope.row.managerOpinion - 1]">{{ filterStatus(scope.row.managerOpinion) }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="管理员说明" align="center" prop="managerExplain" />
|
<el-table-column label="管理员说明" align="center" prop="managerExplain" />
|
||||||
<el-table-column label="补卡申请时间" align="center" prop="createdAt" width="180"> </el-table-column>
|
<el-table-column label="补卡申请时间" align="center" prop="createdAt" width="180"> </el-table-column>
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status" min-width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="user_review_status_type" :value="scope.row.cardNumber" />
|
<!-- <div v-for="item in statusOptions" :key="item.value"> -->
|
||||||
|
<el-tag :type="typeList2[Number(scope.row.cardNumber)]">{{ scope.row.cardMode }}</el-tag>
|
||||||
|
<!-- </div> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -150,6 +152,8 @@ const loading = ref(true);
|
|||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const typeList = ref(['warning', 'success', 'danger']);
|
||||||
|
const typeList2 = ref(['info', 'warning', 'success', 'danger']);
|
||||||
const auditForm = reactive<AuditReissueCardForm>({
|
const auditForm = reactive<AuditReissueCardForm>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
managerOpinion: '2',
|
managerOpinion: '2',
|
||||||
@ -228,6 +232,15 @@ const managerStatus = computed(() => {
|
|||||||
return 'error';
|
return 'error';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const filterStatus = (val) => {
|
||||||
|
if (val == 1) {
|
||||||
|
return '未读';
|
||||||
|
} else if (val == 2) {
|
||||||
|
return '同意';
|
||||||
|
} else {
|
||||||
|
return '拒绝';
|
||||||
|
}
|
||||||
|
};
|
||||||
//班组审核状态
|
//班组审核状态
|
||||||
// eslint-disable-next-line vue/return-in-computed-property
|
// eslint-disable-next-line vue/return-in-computed-property
|
||||||
const teamStatus = computed(() => {
|
const teamStatus = computed(() => {
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
<el-row :gutter="20" justify="space-around">
|
<el-row :gutter="20" justify="space-around">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="人脸照">
|
<el-form-item label="人脸照">
|
||||||
<el-image :src="userDetail?.facePicUrl" style="width: 150px; height: 150px" />
|
<el-image
|
||||||
|
:src="'http://58.17.134.85:8920' + userDetail?.facePicUrl"
|
||||||
|
:preview-src-list="['http://58.17.134.85:8920' + userDetail?.facePicUrl]"
|
||||||
|
style="width: 150px; height: 150px"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -227,7 +227,8 @@ const reset = () => {
|
|||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
if (contractorList.value.length == 1) queryParams.value.contractorId = contractorList.value[0].id;
|
console.log('🚀 ~ handleQuery ~ contractorList.value:', contractorList.value);
|
||||||
|
if (contractorList.value?.length == 1) queryParams.value.contractorId = contractorList.value[0].id;
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,12 +55,12 @@
|
|||||||
<el-image
|
<el-image
|
||||||
v-else-if="item.suffix == 'image'"
|
v-else-if="item.suffix == 'image'"
|
||||||
style="width: 100%; height: 100%"
|
style="width: 100%; height: 100%"
|
||||||
:src="item.filenPathCoding"
|
:src="'http://58.17.134.85:8920' + item.filenPathCoding"
|
||||||
:zoom-rate="1.2"
|
:zoom-rate="1.2"
|
||||||
:max-scale="7"
|
:max-scale="7"
|
||||||
:min-scale="0.2"
|
:min-scale="0.2"
|
||||||
:initial-index="4"
|
:initial-index="4"
|
||||||
:preview-src-list="[item.filenPathCoding]"
|
:preview-src-list="['http://58.17.134.85:8920' + item.filenPathCoding]"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
/>
|
/>
|
||||||
<img :src="'/image/' + item.suffix.replace('.', '').toUpperCase() + '.png'" v-else />
|
<img :src="'/image/' + item.suffix.replace('.', '').toUpperCase() + '.png'" v-else />
|
||||||
|
@ -5,34 +5,52 @@
|
|||||||
<div class="box_info">
|
<div class="box_info">
|
||||||
<div class="tree_left1" id="tree_left1">
|
<div class="tree_left1" id="tree_left1">
|
||||||
<div class="file_upload check_select">
|
<div class="file_upload check_select">
|
||||||
<div class="box_btn" v-auth="'/zm/api/v1/system/documentData/add'"
|
<div class="box_btn" v-auth="'/zm/api/v1/system/documentData/add'" v-hasPermi="['quality:knowledgeDocument:file']">
|
||||||
v-hasPermi="['quality:knowledgeDocument:file']">
|
<file-upload
|
||||||
|
v-model="state.paramsQuery.file"
|
||||||
<file-upload v-model="state.paramsQuery.file" :limit="100" :uploadUrl="uploadUrl" :params="uploadParams"
|
:limit="100"
|
||||||
:on-upload-success="uploadFile">
|
:uploadUrl="uploadUrl"
|
||||||
|
:params="uploadParams"
|
||||||
|
:on-upload-success="uploadFile"
|
||||||
|
>
|
||||||
<el-button type="primary" style="float: left" :disabled="!state.parentPid">
|
<el-button type="primary" style="float: left" :disabled="!state.parentPid">
|
||||||
<el-icon size="small">
|
<el-icon size="small">
|
||||||
<Plus />
|
<Plus /> </el-icon
|
||||||
</el-icon>上传文件
|
>上传文件
|
||||||
</el-button>
|
</el-button>
|
||||||
</file-upload>
|
</file-upload>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary" v-auth="'/zm/api/v1/system/documentProject/dataCompressedDownload'"
|
<el-button
|
||||||
v-hasPermi="['quality:knowledgeDocument:fileList']" :disabled="!state.parentPid"
|
type="primary"
|
||||||
@click="onExport"><el-icon>
|
v-auth="'/zm/api/v1/system/documentProject/dataCompressedDownload'"
|
||||||
<Download />
|
v-hasPermi="['quality:knowledgeDocument:fileList']"
|
||||||
</el-icon>下载</el-button>
|
:disabled="!state.parentPid"
|
||||||
<el-button type="primary" @click="onBook"
|
@click="onExport"
|
||||||
v-auth="'/zm/api/v1/system/documentData/dataFileQuery'"><el-icon>
|
><el-icon>
|
||||||
<View />
|
<Download /> </el-icon
|
||||||
</el-icon>查看全项目文件</el-button>
|
>下载</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="onBook" v-auth="'/zm/api/v1/system/documentData/dataFileQuery'"
|
||||||
|
><el-icon>
|
||||||
|
<View /> </el-icon
|
||||||
|
>查看全项目文件</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="file_upload check_select">
|
<div class="file_upload check_select">
|
||||||
<el-input class="input_left" v-model="filterText" size="small" placeholder="请输入文件名称" />
|
<el-input class="input_left" v-model="filterText" size="small" placeholder="请输入文件名称" />
|
||||||
</div>
|
</div>
|
||||||
<el-tree ref="treeRef" highlight-current :default-expand-all="state.checked"
|
<el-tree
|
||||||
:filter-node-method="filterFolder" :data="state.treeList" node-key="id" accordion
|
ref="treeRef"
|
||||||
:expand-on-click-node="false" @node-click="handleNodeClick" :current-node-key="state.selectedNodeId">
|
highlight-current
|
||||||
|
:default-expand-all="state.checked"
|
||||||
|
:filter-node-method="filterFolder"
|
||||||
|
:data="state.treeList"
|
||||||
|
node-key="id"
|
||||||
|
accordion
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
:current-node-key="state.selectedNodeId"
|
||||||
|
>
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
<span class="custom-tree-node">
|
<span class="custom-tree-node">
|
||||||
<el-icon color="#f1a81a">
|
<el-icon color="#f1a81a">
|
||||||
@ -50,18 +68,26 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="7" class="colBlock">
|
<el-col :span="7" class="colBlock">
|
||||||
<el-form-item label="文件名称" prop="fileName">
|
<el-form-item label="文件名称" prop="fileName">
|
||||||
<el-input v-model="state.paramsQuery.fileName" placeholder="请输入文件名称" clearable
|
<el-input
|
||||||
@keyup.enter.native="getdocumentDataList" />
|
v-model="state.paramsQuery.fileName"
|
||||||
|
placeholder="请输入文件名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="getdocumentDataList"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6" class="m-l10">
|
<el-col :span="6" class="m-l10">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="searchInfo"><el-icon>
|
<el-button type="primary" @click="searchInfo"
|
||||||
<Search />
|
><el-icon>
|
||||||
</el-icon>搜索</el-button>
|
<Search /> </el-icon
|
||||||
<el-button @click="resetQuery"><el-icon>
|
>搜索</el-button
|
||||||
<Refresh />
|
>
|
||||||
</el-icon>重置</el-button>
|
<el-button @click="resetQuery"
|
||||||
|
><el-icon>
|
||||||
|
<Refresh /> </el-icon
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="4">
|
<!-- <el-col :span="4">
|
||||||
@ -84,38 +110,65 @@
|
|||||||
<el-table-column label="上传时间" align="center" prop="createTime"> </el-table-column>
|
<el-table-column label="上传时间" align="center" prop="createTime"> </el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="300">
|
<el-table-column label="操作" align="center" width="300">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="primary" v-auth="'/zm/api/v1/system/documentData/get'"
|
<el-button
|
||||||
v-if="acceptType.includes(scope.row.fileSuffix)" link @click="handleView(scope.row)"><el-icon>
|
type="primary"
|
||||||
<View />
|
v-auth="'/zm/api/v1/system/documentData/get'"
|
||||||
</el-icon>查看</el-button>
|
v-if="acceptType.includes(scope.row.fileSuffix)"
|
||||||
<el-button type="primary" v-auth="'/zm/api/v1/system/documentData/complaintBoxAdd'"
|
link
|
||||||
v-hasPermi="['quality:knowledgeDocument:file']" v-if="state.wordType.includes(scope.row.fileSuffix)"
|
@click="handleView(scope.row)"
|
||||||
link @click="updataView(scope.row)"><el-icon>
|
><el-icon>
|
||||||
<EditPen />
|
<View /> </el-icon
|
||||||
</el-icon>修改文件</el-button>
|
>查看</el-button
|
||||||
<el-button type="primary" v-auth="'/zm/api/v1/system/documentData/uniFolderDownload'" link
|
>
|
||||||
v-hasPermi="['quality:knowledgeDocument:file']" @click="onExportView(scope.row)"><el-icon>
|
<el-button
|
||||||
<Download />
|
type="primary"
|
||||||
</el-icon>下载</el-button>
|
v-auth="'/zm/api/v1/system/documentData/complaintBoxAdd'"
|
||||||
<el-button type="success" v-auth="'/zm/api/v1/system/documentData/edit'" link
|
v-hasPermi="['quality:knowledgeDocument:file']"
|
||||||
@click="updateName(scope.row)" v-hasPermi="['quality:knowledgeDocument:file']"><el-icon>
|
v-if="state.wordType.includes(scope.row.fileSuffix)"
|
||||||
<EditPen />
|
link
|
||||||
</el-icon>修改名称</el-button>
|
@click="updataView(scope.row)"
|
||||||
<el-button type="danger" v-auth="'/zm/api/v1/system/documentData/delete'" link
|
><el-icon>
|
||||||
@click="handleDelete(scope.row)"><el-icon>
|
<EditPen /> </el-icon
|
||||||
<DeleteFilled />
|
>修改文件</el-button
|
||||||
</el-icon>删除</el-button>
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
v-auth="'/zm/api/v1/system/documentData/uniFolderDownload'"
|
||||||
|
link
|
||||||
|
v-hasPermi="['quality:knowledgeDocument:file']"
|
||||||
|
@click="onExportView(scope.row)"
|
||||||
|
><el-icon>
|
||||||
|
<Download /> </el-icon
|
||||||
|
>下载</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
v-auth="'/zm/api/v1/system/documentData/edit'"
|
||||||
|
link
|
||||||
|
@click="updateName(scope.row)"
|
||||||
|
v-hasPermi="['quality:knowledgeDocument:file']"
|
||||||
|
><el-icon>
|
||||||
|
<EditPen /> </el-icon
|
||||||
|
>修改名称</el-button
|
||||||
|
>
|
||||||
|
<el-button type="danger" v-auth="'/zm/api/v1/system/documentData/delete'" link @click="handleDelete(scope.row)"
|
||||||
|
><el-icon>
|
||||||
|
<DeleteFilled /> </el-icon
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination :total="state.total" v-model:page="state.paramsQuery.pageNum"
|
<pagination
|
||||||
v-model:limit="state.paramsQuery.pageSize" @pagination="getdocumentDataList" />
|
:total="state.total"
|
||||||
|
v-model:page="state.paramsQuery.pageNum"
|
||||||
|
v-model:limit="state.paramsQuery.pageSize"
|
||||||
|
@pagination="getdocumentDataList"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<documentsDeailsVue ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose">
|
<documentsDeailsVue ref="documentDetailRef" v-if="state.showDocumentDetail" @onClose="onClose"> </documentsDeailsVue>
|
||||||
</documentsDeailsVue>
|
<documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit"> </documentsEdit>
|
||||||
<documentsEdit ref="documentDataEditRef" v-if="state.showdocumentDataEdit" @onClose="onCloseEdit">
|
|
||||||
</documentsEdit>
|
|
||||||
<!-- <uploadFileder
|
<!-- <uploadFileder
|
||||||
ref="uploadFilederRef"
|
ref="uploadFilederRef"
|
||||||
v-if="state.showUploadFileder"
|
v-if="state.showUploadFileder"
|
||||||
@ -135,8 +188,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
<el-image-viewer ref="imageRef" style="width: 100%; height: 100%" :url-list="[imgUrl]" v-if="imgUrl" show-progress
|
<el-image-viewer
|
||||||
fit="cover" @close="imgUrl = ''" />
|
ref="imageRef"
|
||||||
|
style="width: 100%; height: 100%"
|
||||||
|
:url-list="['http://58.17.134.85:8920' + imgUrl]"
|
||||||
|
v-if="imgUrl"
|
||||||
|
show-progress
|
||||||
|
fit="cover"
|
||||||
|
@close="imgUrl = ''"
|
||||||
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="回收站" name="second">
|
<el-tab-pane label="回收站" name="second">
|
||||||
<RecyclingStation ref="recylingRef"></RecyclingStation>
|
<RecyclingStation ref="recylingRef"></RecyclingStation>
|
||||||
@ -446,7 +506,7 @@ const delFile = (msg, data, cb) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
const editName = (data, title, type) => {
|
const editName = (data, title, type) => {
|
||||||
ElMessageBox.prompt(title, '温馨提示', {
|
ElMessageBox.prompt(title, '温馨提示', {
|
||||||
@ -476,7 +536,7 @@ const editName = (data, title, type) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
getUniFolderDownloadList(state.paramsQuery.folderId).then((res: any) => {
|
getUniFolderDownloadList(state.paramsQuery.folderId).then((res: any) => {
|
||||||
@ -521,7 +581,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
|
||||||
background-color: #354e67 !important;
|
background-color: #354e67 !important;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
@ -535,7 +595,7 @@ onMounted(() => {
|
|||||||
padding: 10px 0 !important;
|
padding: 10px 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
>div {
|
> div {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@ -573,7 +633,7 @@ onMounted(() => {
|
|||||||
margin: 0 10px 0 20px;
|
margin: 0 10px 0 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
>span {
|
> span {
|
||||||
padding: 4px 10px;
|
padding: 4px 10px;
|
||||||
background: #67c23a;
|
background: #67c23a;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
><el-space wrap>
|
><el-space wrap>
|
||||||
<div>
|
<div>
|
||||||
<span>
|
<span>
|
||||||
<image-preview :src="'http://58.17.134.85:8919' + safetyInspectionDetail?.path" width="200px" />
|
<image-preview :src="'http://58.17.134.85:8920' + safetyInspectionDetail?.path" width="200px" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-space>
|
</el-space>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
||||||
<div class="w75% m-a">
|
<div class="w75% m-a">
|
||||||
<div id="printMe" class="pos-relative">
|
<div id="printMe" class="pos-relative">
|
||||||
<div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" /></div>
|
<div class="resultIcon"><img :src="'/image/svg/' + inspectionType + '.png'" alt="" /></div>
|
||||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">整改通知单</h2>
|
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">整改通知单</h2>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.fill }}</el-col>
|
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.fill }}</el-col>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
<image-preview :src="item.url" width="200px" />
|
<image-preview :src="item.url" width="200px" />
|
||||||
</span>
|
</span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<el-link :href="`http://58.17.134.85:8919${item.url}`" :underline="false" type="primary" target="_blank">
|
<el-link :href="`http://58.17.134.85:8920${item.url}`" :underline="false" type="primary" target="_blank">
|
||||||
<span> {{ item.originalName }} </span>
|
<span> {{ item.originalName }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
</span>
|
</span>
|
||||||
|
@ -75,9 +75,17 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="整改人" align="center" prop="two" />
|
<el-table-column label="整改人" align="center" prop="two" />
|
||||||
<el-table-column label="工单状态" align="center" prop="status">
|
<el-table-column label="处理状态" align="center" prop="status" min-width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="quality_inspection_status_type" :value="scope.row.status" />
|
<template v-if="scope.row.isReply == '1'">
|
||||||
|
<el-tag type="primary" v-if="scope.row.status && scope.row.status == '1'">通知</el-tag>
|
||||||
|
<el-tag type="warning" v-if="scope.row.status && scope.row.status == '2'">整改</el-tag>
|
||||||
|
<el-tag type="success" v-if="scope.row.status && scope.row.status == '3' && scope.row.verificationType == '1'">通过</el-tag>
|
||||||
|
<el-tag type="danger" v-if="scope.row.status && scope.row.status == '3' && scope.row.verificationType == '2'">未通过</el-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="scope.row.isReply == '2'">
|
||||||
|
<el-tag type="success">通过</el-tag>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="创建者" align="center" prop="createBy" /> -->
|
<!-- <el-table-column label="创建者" align="center" prop="createBy" /> -->
|
||||||
@ -123,6 +131,7 @@
|
|||||||
<file-upload
|
<file-upload
|
||||||
ref="uploadRef"
|
ref="uploadRef"
|
||||||
v-model="form.inspectionFile"
|
v-model="form.inspectionFile"
|
||||||
|
:limit="1"
|
||||||
isGo
|
isGo
|
||||||
upload-url="/zm/api/v1/system/busInspectionTicket/add"
|
upload-url="/zm/api/v1/system/busInspectionTicket/add"
|
||||||
:data="form"
|
:data="form"
|
||||||
@ -166,10 +175,25 @@ import {
|
|||||||
import { QualityInspectionVO, QualityInspectionQuery, QualityInspectionForm } from '@/api/quality/qualityInspection/types';
|
import { QualityInspectionVO, QualityInspectionQuery, QualityInspectionForm } from '@/api/quality/qualityInspection/types';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import QualityInspectionDetail from './component/qualityInspectionDetail.vue';
|
import QualityInspectionDetail from './component/qualityInspectionDetail.vue';
|
||||||
|
import { getDictData } from '@/api/project/goUser';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { quality_inspection_check_type, quality_inspection_status_type, rectification_unit_type } = toRefs<any>(
|
const { quality_inspection_check_type, rectification_unit_type } = toRefs<any>(
|
||||||
proxy?.useDict('quality_inspection_check_type', 'quality_inspection_status_type', 'rectification_unit_type')
|
proxy?.useDict('quality_inspection_check_type', 'rectification_unit_type')
|
||||||
);
|
);
|
||||||
|
const quality_inspection_status_type = [
|
||||||
|
{
|
||||||
|
label: '通知',
|
||||||
|
value: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '整改',
|
||||||
|
value: '2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '验证',
|
||||||
|
value: '3'
|
||||||
|
}
|
||||||
|
];
|
||||||
// 获取用户 store
|
// 获取用户 store
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
// 从 store 中获取项目列表和当前选中的项目
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
@ -241,6 +265,7 @@ const getList = async () => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await listQualityInspection(queryParams.value);
|
const res = await listQualityInspection(queryParams.value);
|
||||||
qualityInspectionList.value = res.data.list;
|
qualityInspectionList.value = res.data.list;
|
||||||
|
console.log('🚀 ~ getList ~ res.data.list:', res.data.list);
|
||||||
total.value = res.data.total;
|
total.value = res.data.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
@ -55,12 +55,12 @@
|
|||||||
<el-image
|
<el-image
|
||||||
v-else-if="item.suffix == 'image'"
|
v-else-if="item.suffix == 'image'"
|
||||||
style="width: 100%; height: 100%"
|
style="width: 100%; height: 100%"
|
||||||
:src="item.filenPathCoding"
|
:src="'http://58.17.134.85:8920' + item.filenPathCoding"
|
||||||
:zoom-rate="1.2"
|
:zoom-rate="1.2"
|
||||||
:max-scale="7"
|
:max-scale="7"
|
||||||
:min-scale="0.2"
|
:min-scale="0.2"
|
||||||
:initial-index="4"
|
:initial-index="4"
|
||||||
:preview-src-list="[item.filenPathCoding]"
|
:preview-src-list="['http://58.17.134.85:8920' + item.filenPathCoding]"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
/>
|
/>
|
||||||
<img :src="'/image/' + item.suffix.replace('.', '').toUpperCase() + '.png'" v-else />
|
<img :src="'/image/' + item.suffix.replace('.', '').toUpperCase() + '.png'" v-else />
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
<el-image-viewer
|
<el-image-viewer
|
||||||
ref="imageRef"
|
ref="imageRef"
|
||||||
style="width: 100%; height: 100%"
|
style="width: 100%; height: 100%"
|
||||||
:url-list="[imgUrl]"
|
:url-list="['http://58.17.134.85:8920' + imgUrl]"
|
||||||
v-if="imgUrl"
|
v-if="imgUrl"
|
||||||
show-progress
|
show-progress
|
||||||
fit="cover"
|
fit="cover"
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="图片路径" align="center" prop="picture" width="100">
|
<el-table-column label="图片路径" align="center" prop="picture" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<image-preview :src="'http://58.17.134.85:8919' + scope.row.picture" :width="50" :height="50" />
|
<image-preview :src="'http://58.17.134.85:8920' + scope.row.picture" :width="50" :height="50" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="故障描述" align="center" prop="describe" />
|
<el-table-column label="故障描述" align="center" prop="describe" />
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
||||||
<div class="w75% m-a">
|
<div class="w75% m-a">
|
||||||
<div id="printMe" class="pos-relative">
|
<div id="printMe" class="pos-relative">
|
||||||
<div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" /></div>
|
<div class="resultIcon"><img :src="'/image/svg/' + inspectionType + '.png'" alt="" /></div>
|
||||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2>
|
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">安全生产监督检查通知书</h2>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.fill }}</el-col>
|
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.fill }}</el-col>
|
||||||
@ -34,6 +34,18 @@
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
|
<div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.id">
|
||||||
|
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
|
||||||
|
<image-preview :src="'http://58.17.134.85:8920' + item.path" width="200px" />
|
||||||
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
<el-link :href="`${'http://58.17.134.85:8920' + item.path}`" type="primary" :underline="false" target="_blank">
|
||||||
|
<span> {{ item.name }} </span>
|
||||||
|
</el-link>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-space>
|
||||||
|
<!-- <el-space wrap>
|
||||||
<div v-for="item in checkFileList" :key="item.ossId">
|
<div v-for="item in checkFileList" :key="item.ossId">
|
||||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||||
<image-preview :src="item.url" width="200px" />
|
<image-preview :src="item.url" width="200px" />
|
||||||
@ -44,7 +56,7 @@
|
|||||||
</el-link>
|
</el-link>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-space>
|
</el-space> -->
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
|
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
|
||||||
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.status)" finish-status="finish">
|
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.status)" finish-status="finish">
|
||||||
@ -67,13 +79,13 @@
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
<div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.id">
|
<div v-for="item in safetyInspectionDetail.abarbeitungAttachment" :key="item.id">
|
||||||
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
|
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
|
||||||
<image-preview :src="'http://58.17.134.85:8919' + item.path" width="200px" />
|
<image-preview :src="'http://58.17.134.85:8920' + item.path" width="200px" />
|
||||||
</span>
|
</span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<el-link :href="`${'http://58.17.134.85:8919' + item.url}`" :underline="false" target="_blank">
|
<el-link :href="`${'http://58.17.134.85:8920' + item.path}`" type="primary" :underline="false" target="_blank">
|
||||||
<span> {{ item.originalName }} </span>
|
<span> {{ item.name }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -149,7 +161,9 @@ const get = async () => {
|
|||||||
const res = await getSafetyInspection({ id: props.safetyInspectionId });
|
const res = await getSafetyInspection({ id: props.safetyInspectionId });
|
||||||
if (res.data && res.code === 0) {
|
if (res.data && res.code === 0) {
|
||||||
safetyInspectionDetail.value = res.data;
|
safetyInspectionDetail.value = res.data;
|
||||||
|
console.log('🚀 ~ get ~ res.data:', res.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<el-descriptions-item :span="2" label="班会图片">
|
<el-descriptions-item :span="2" label="班会图片">
|
||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
<span :key="item" v-for="item in teamMeetingDetail?.pictureUrlList">
|
<span :key="item" v-for="item in teamMeetingDetail?.pictureUrlList">
|
||||||
<image-preview :src="'http://xny.yj-3d.com:7363' + item" width="200px" />
|
<image-preview :src="'http://58.17.134.85:8920' + item" width="200px" />
|
||||||
</span>
|
</span>
|
||||||
</el-space>
|
</el-space>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
<div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.ossId">
|
<div v-for="item in safetyInspectionDetail.checkAttachment" :key="item.ossId">
|
||||||
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
|
<span v-if="['png', 'jpg', 'jpeg'].includes(item.fileType)">
|
||||||
<image-preview :src="'http://58.17.134.85:8919' + item.path" width="200px" />
|
<image-preview :src="'http://58.17.134.85:8920' + item.path" width="200px" />
|
||||||
</span>
|
</span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<el-link :href="`${item.path}`" type="primary" :underline="false" target="_blank">
|
<el-link :href="`${item.path}`" type="primary" :underline="false" target="_blank">
|
||||||
|
Reference in New Issue
Block a user