From 4bcd72865f003a3e96066aecd3c418ae896f080d Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期二, 06 九月 2022 10:49:07 +0800
Subject: [PATCH] Default Changelist
---
src/views/specialWorkSystem/workTicket/workApply/components/hoist.vue | 10 +
src/views/specialWorkSystem/workTicket/workApply/components/plate.vue | 86 ++++++++++----
src/views/specialWorkSystem/workTicket/workApply/components/space.vue | 12 ++
src/views/specialWorkSystem/workTicket/workApply/components/power.vue | 12 ++
src/views/specialWorkSystem/workTicket/workApply/components/height.vue | 10 +
src/views/specialWorkSystem/workTicket/workApply/components/broken.vue | 90 ++++++++++----
src/views/specialWorkSystem/workTicket/workApply/components/ground.vue | 90 ++++++++++----
7 files changed, 229 insertions(+), 81 deletions(-)
diff --git a/src/views/specialWorkSystem/workTicket/workApply/components/broken.vue b/src/views/specialWorkSystem/workTicket/workApply/components/broken.vue
index 0187f0a..3800466 100644
--- a/src/views/specialWorkSystem/workTicket/workApply/components/broken.vue
+++ b/src/views/specialWorkSystem/workTicket/workApply/components/broken.vue
@@ -52,6 +52,16 @@
</el-form-item>
</el-col>
</el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="危害辨识" prop="hazardIdentification">
+ <el-input
+ v-model="form.hazardIdentification"
+ placeholder="请输入危害辨识"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
<el-divider border-style="dashed"/>
<el-row>
<el-col :span="12">
@@ -140,7 +150,8 @@
dialogImageUrl: string | null,
imgLimit: number,
casProps: {},
- casProps2: {}
+ casProps2: {},
+ isOverSize: boolean
}
interface file {
url: string;
@@ -159,6 +170,7 @@
workLevel: 0,
workContent: '',
workLocation: '',
+ hazardIdentification: '',
workDetail:{
operationDepId: null,
bcReason: '',
@@ -170,6 +182,7 @@
expStartTime: '',
expEndTime: ''
},
+ isOverSize: false,
fileList: [],
imgLimit: 3,
uploadUrl: '',
@@ -222,6 +235,7 @@
workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
+ hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.bcReason": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
@@ -269,10 +283,20 @@
};
const getUploadUrl = async (rawFile: any) => {
- const res = await workApplyApi().getUploadUrl(rawFile.name);
- state.form.workDetail.bcPath.push(res.data.data.fileName)
- state.uploadUrl = res.data.data.uploadUrl;
- console.log(res.data.data.fileName,'name')
+ const fileSize = rawFile.size / 1024 < 500 ? '1' : '0'
+ if(fileSize === '0'){
+ ElMessage({
+ type: 'warning',
+ message: '文件大小不能超过500k。'
+ });
+ state.isOverSize = true
+ return false
+ }else{
+ const res = await workApplyApi().getUploadUrl(rawFile.name);
+ state.form.workDetail.bcPath.push(res.data.data.fileName)
+ state.uploadUrl = res.data.data.uploadUrl;
+ console.log(res.data.data.fileName,'name')
+ }
};
const upload = async (params: any) => {
@@ -296,39 +320,51 @@
const beforeRemove = (file: {}, fileList: []) => {
const result = new Promise((resolve, reject) => {
- ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- // console.log(state.workDetail.bcPath,'path')
- const list = JSON.parse(JSON.stringify(state.form.workDetail.bcPath))
- fileList.map((item,index)=>{
- if(item.uid === file.uid){
- fileList.splice(index,1)
- state.form.workDetail.bcPath.splice(index,1)
- deletePic(list[index])
- }
+ if(!state.isOverSize){
+ ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(() => {
+ // console.log(state.workDetail.bcPath,'path')
+ const list = JSON.parse(JSON.stringify(state.form.workDetail.bcPath))
+ fileList.map((item,index)=>{
+ if(item.uid === file.uid){
+ fileList.splice(index,1)
+ state.form.workDetail.bcPath.splice(index,1)
+ deletePic(false,list[index])
+ }
+ })
+ // 请求删除接口
})
- // 请求删除接口
- })
- .catch(() => {
- reject(false);
- });
+ .catch(() => {
+ reject(false);
+ });
+ }else{
+ const list = JSON.parse(JSON.stringify(state.form.workDetail.bcPath))
+ fileList.map((item,index)=>{
+ if(item.uid === file.uid){
+ fileList.splice(index,1)
+ state.form.workDetail.bcPath.splice(index,1)
+ deletePic(true,list[index])
+ }
+ })
+ state.isOverSize = false
+ }
});
return result;
};
// 删除图片接口
- const deletePic = async(fileName)=>{
+ const deletePic = async(isOverSize:boolean,fileName:string)=>{
console.log(fileName,'fileName')
const res = await workApplyApi().deleteFile({fileName: fileName})
if (res.data.code === '200') {
ElMessage({
- type: 'success',
- message: '删除成功!'
+ type: isOverSize ? 'error' : 'success',
+ message: isOverSize ? '上传失败':'删除成功!'
});
} else {
ElMessage({
diff --git a/src/views/specialWorkSystem/workTicket/workApply/components/ground.vue b/src/views/specialWorkSystem/workTicket/workApply/components/ground.vue
index 2448e1b..1716f56 100644
--- a/src/views/specialWorkSystem/workTicket/workApply/components/ground.vue
+++ b/src/views/specialWorkSystem/workTicket/workApply/components/ground.vue
@@ -52,6 +52,16 @@
</el-form-item>
</el-col>
</el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="危害辨识" prop="hazardIdentification">
+ <el-input
+ v-model="form.hazardIdentification"
+ placeholder="请输入危害辨识"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
<el-divider border-style="dashed"/>
<el-row>
<el-col :span="12">
@@ -143,7 +153,8 @@
dialogVisible: Boolean,
dialogImageUrl: string | null,
imgLimit: number,
- casProps: {}
+ casProps: {},
+ isOverSize: Boolean
}
interface file {
url: string;
@@ -162,6 +173,7 @@
workLevel: 0,
workContent: '',
workLocation: '',
+ hazardIdentification: '',
workDetail:{
operationDepId: null,
gbScope: '',
@@ -173,6 +185,7 @@
expStartTime: '',
expEndTime: ''
},
+ isOverSize: false,
fileList: [],
imgLimit: 3,
uploadUrl: '',
@@ -253,6 +266,7 @@
workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
+ hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.gbScope": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
@@ -299,10 +313,19 @@
};
const getUploadUrl = async (rawFile: any) => {
- const res = await workApplyApi().getUploadUrl(rawFile.name);
- state.form.workDetail.gbPath.push(res.data.data.fileName)
- state.uploadUrl = res.data.data.uploadUrl;
- console.log(res.data.data.fileName,'name')
+ const fileSize = rawFile.size / 1024 < 500 ? '1' : '0'
+ if(fileSize === '0'){
+ ElMessage({
+ type: 'warning',
+ message: '文件大小不能超过500k。'
+ });
+ state.isOverSize = true
+ return false
+ }else{
+ const res = await workApplyApi().getUploadUrl(rawFile.name);
+ state.form.workDetail.gbPath.push(res.data.data.fileName)
+ state.uploadUrl = res.data.data.uploadUrl;
+ }
};
const upload = async (params: any) => {
@@ -326,39 +349,50 @@
const beforeRemove = (file: {}, fileList: []) => {
const result = new Promise((resolve, reject) => {
- ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- // console.log(state.workDetail.gbPath,'path')
- const list = JSON.parse(JSON.stringify(state.form.workDetail.gbPath))
- fileList.map((item,index)=>{
- if(item.uid === file.uid){
- fileList.splice(index,1)
- state.form.workDetail.gbPath.splice(index,1)
- deletePic(list[index])
- }
+ if(!state.isOverSize){
+ ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(() => {
+ // console.log(state.workDetail.gbPath,'path')
+ const list = JSON.parse(JSON.stringify(state.form.workDetail.gbPath))
+ fileList.map((item,index)=>{
+ if(item.uid === file.uid){
+ fileList.splice(index,1)
+ state.form.workDetail.gbPath.splice(index,1)
+ // 请求删除接口
+ deletePic(false,list[index])
+ }
+ })
})
- // 请求删除接口
- })
- .catch(() => {
- reject(false);
- });
+ .catch(() => {
+ reject(false);
+ });
+ }else{
+ const list = JSON.parse(JSON.stringify(state.form.workDetail.gbPath))
+ fileList.map((item,index)=>{
+ if(item.uid === file.uid){
+ fileList.splice(index,1)
+ state.form.workDetail.gbPath.splice(index,1)
+ deletePic(true,list[index])
+ }
+ })
+ state.isOverSize = false
+ }
});
return result;
};
// 删除图片接口
- const deletePic = async(fileName)=>{
- console.log(fileName,'fileName')
+ const deletePic = async(isOverSize:boolean,fileName:string)=>{
const res = await workApplyApi().deleteFile({fileName: fileName})
if (res.data.code === '200') {
ElMessage({
- type: 'success',
- message: '删除成功!'
+ type: isOverSize ? 'error' : 'success',
+ message: isOverSize ? '上传失败':'删除成功!'
});
} else {
ElMessage({
diff --git a/src/views/specialWorkSystem/workTicket/workApply/components/height.vue b/src/views/specialWorkSystem/workTicket/workApply/components/height.vue
index dc73325..27bc3ab 100644
--- a/src/views/specialWorkSystem/workTicket/workApply/components/height.vue
+++ b/src/views/specialWorkSystem/workTicket/workApply/components/height.vue
@@ -65,6 +65,14 @@
/>
</el-form-item>
</el-col>
+ <el-col :span="12">
+ <el-form-item label="危害辨识" prop="hazardIdentification">
+ <el-input
+ v-model="form.hazardIdentification"
+ placeholder="请输入危害辨识"
+ />
+ </el-form-item>
+ </el-col>
</el-row>
<el-divider border-style="dashed"/>
<el-row>
@@ -150,6 +158,7 @@
workLevel: null,
workContent: '',
workLocation: '',
+ hazardIdentification: '',
workDetail:{
operationDepId: '',
operationHeight: null,
@@ -263,6 +272,7 @@
workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
+ hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.operationHeight": [{ required: true, message: '该内容不能为空', trigger: 'blur' }]
diff --git a/src/views/specialWorkSystem/workTicket/workApply/components/hoist.vue b/src/views/specialWorkSystem/workTicket/workApply/components/hoist.vue
index 96038ec..e9a629a 100644
--- a/src/views/specialWorkSystem/workTicket/workApply/components/hoist.vue
+++ b/src/views/specialWorkSystem/workTicket/workApply/components/hoist.vue
@@ -65,6 +65,14 @@
/>
</el-form-item>
</el-col>
+ <el-col :span="12">
+ <el-form-item label="危害辨识" prop="hazardIdentification">
+ <el-input
+ v-model="form.hazardIdentification"
+ placeholder="请输入危害辨识"
+ />
+ </el-form-item>
+ </el-col>
</el-row>
<el-divider border-style="dashed"/>
<el-row>
@@ -129,6 +137,7 @@
workLevel: null,
workContent: '',
workLocation: '',
+ hazardIdentification: '',
workDetail:{
hoistingToolName: '',
weightMass: null
@@ -159,6 +168,7 @@
workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
+ hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.hoistingToolName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.weightMass": [{ required: true, message: '该内容不能为空', trigger: 'blur' }]
diff --git a/src/views/specialWorkSystem/workTicket/workApply/components/plate.vue b/src/views/specialWorkSystem/workTicket/workApply/components/plate.vue
index 8e31dfc..6bb7136 100644
--- a/src/views/specialWorkSystem/workTicket/workApply/components/plate.vue
+++ b/src/views/specialWorkSystem/workTicket/workApply/components/plate.vue
@@ -65,6 +65,14 @@
/>
</el-form-item>
</el-col>
+ <el-col :span="12">
+ <el-form-item label="危害辨识" prop="hazardIdentification">
+ <el-input
+ v-model="form.hazardIdentification"
+ placeholder="请输入危害辨识"
+ />
+ </el-form-item>
+ </el-col>
</el-row>
<el-divider border-style="dashed"/>
<el-row>
@@ -220,6 +228,7 @@
dialogVisible: Boolean,
dialogImageUrl: string | null,
imgLimit: number,
+ isOverSize: boolean
}
interface file {
url: string;
@@ -238,6 +247,7 @@
workLevel: null,
workContent: '',
workLocation: '',
+ hazardIdentification: '',
workDetail:{
bpCode: '',
mainMedia: '',
@@ -256,6 +266,7 @@
expStartTime: '',
expEndTime: ''
},
+ isOverSize: false,
fileList: [],
imgLimit: 3,
uploadUrl: '',
@@ -339,6 +350,7 @@
workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
+ hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.bpCode": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.mainMedia": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
@@ -395,10 +407,20 @@
};
const getUploadUrl = async (rawFile: any) => {
- const res = await workApplyApi().getUploadUrl(rawFile.name);
- state.form.workDetail.bpLocationMapPath.push(res.data.data.fileName)
- state.uploadUrl = res.data.data.uploadUrl;
- console.log(res.data.data.fileName,'name')
+ const fileSize = rawFile.size / 1024 < 500 ? '1' : '0'
+ if(fileSize === '0'){
+ ElMessage({
+ type: 'warning',
+ message: '文件大小不能超过500k。'
+ });
+ state.isOverSize = true
+ return false
+ }else{
+ const res = await workApplyApi().getUploadUrl(rawFile.name);
+ state.form.workDetail.bpLocationMapPath.push(res.data.data.fileName)
+ state.uploadUrl = res.data.data.uploadUrl;
+ console.log(res.data.data.fileName,'name')
+ }
};
const upload = async (params: any) => {
@@ -422,39 +444,51 @@
const beforeRemove = (file: {}, fileList: []) => {
const result = new Promise((resolve, reject) => {
- ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- // console.log(state.workDetail.bpLocationMapPath,'path')
- const list = JSON.parse(JSON.stringify(state.form.workDetail.bpLocationMapPath))
- fileList.map((item,index)=>{
- if(item.uid === file.uid){
- fileList.splice(index,1)
- state.form.workDetail.bpLocationMapPath.splice(index,1)
- deletePic(list[index])
- }
+ if(!state.isOverSize){
+ ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(() => {
+ // console.log(state.workDetail.bpLocationMapPath,'path')
+ const list = JSON.parse(JSON.stringify(state.form.workDetail.bpLocationMapPath))
+ fileList.map((item,index)=>{
+ if(item.uid === file.uid){
+ fileList.splice(index,1)
+ state.form.workDetail.bpLocationMapPath.splice(index,1)
+ deletePic(false,list[index])
+ }
+ })
+ // 请求删除接口
})
- // 请求删除接口
- })
- .catch(() => {
- reject(false);
- });
+ .catch(() => {
+ reject(false);
+ });
+ }else{
+ const list = JSON.parse(JSON.stringify(state.form.workDetail.bpLocationMapPath))
+ fileList.map((item,index)=>{
+ if(item.uid === file.uid){
+ fileList.splice(index,1)
+ state.form.workDetail.bpLocationMapPath.splice(index,1)
+ deletePic(true,list[index])
+ }
+ })
+ state.isOverSize = false
+ }
});
return result;
};
// 删除图片接口
- const deletePic = async(fileName)=>{
+ const deletePic = async(isOverSize:boolean,fileName:string)=>{
console.log(fileName,'fileName')
const res = await workApplyApi().deleteFile({fileName: fileName})
if (res.data.code === '200') {
ElMessage({
- type: 'success',
- message: '删除成功!'
+ type: isOverSize ? 'error' : 'success',
+ message: isOverSize ? '上传失败':'删除成功!'
});
} else {
ElMessage({
diff --git a/src/views/specialWorkSystem/workTicket/workApply/components/power.vue b/src/views/specialWorkSystem/workTicket/workApply/components/power.vue
index f81cac7..2940b9c 100644
--- a/src/views/specialWorkSystem/workTicket/workApply/components/power.vue
+++ b/src/views/specialWorkSystem/workTicket/workApply/components/power.vue
@@ -52,6 +52,16 @@
</el-form-item>
</el-col>
</el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="危害辨识" prop="hazardIdentification">
+ <el-input
+ v-model="form.hazardIdentification"
+ placeholder="请输入危害辨识"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
<el-divider border-style="dashed"/>
<el-row>
<el-col :span="12">
@@ -127,6 +137,7 @@
workLevel: 0,
workContent: '',
workLocation: '',
+ hazardIdentification: '',
workDetail:{
powerAccessPoint: '',
workingVoltage: null,
@@ -158,6 +169,7 @@
workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
+ hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.powerAccessPoint": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.workingVoltage": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
diff --git a/src/views/specialWorkSystem/workTicket/workApply/components/space.vue b/src/views/specialWorkSystem/workTicket/workApply/components/space.vue
index 6036dd3..c2904c9 100644
--- a/src/views/specialWorkSystem/workTicket/workApply/components/space.vue
+++ b/src/views/specialWorkSystem/workTicket/workApply/components/space.vue
@@ -52,6 +52,16 @@
</el-form-item>
</el-col>
</el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="危害辨识" prop="hazardIdentification">
+ <el-input
+ v-model="form.hazardIdentification"
+ placeholder="请输入危害辨识"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
<el-divider border-style="dashed" />
<el-row>
<el-col :span="12">
@@ -138,6 +148,7 @@
workLevel: 0,
workContent: '',
workLocation: '',
+ hazardIdentification: '',
workDetail:{
csDepId: null,
csName: '',
@@ -223,6 +234,7 @@
workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
+ hazardIdentification: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.csDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
"workDetail.csName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }],
--
Gitblit v1.9.2