Commit b9a05081 authored by zhang's avatar zhang

feat: 填写体系审查审查结果可取消,未保存文件提示

parent 433e6e32
...@@ -11,7 +11,6 @@ VUE_APP_BASE_API = '/dev-api' ...@@ -11,7 +11,6 @@ VUE_APP_BASE_API = '/dev-api'
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 图片服务器地址 # 图片服务器地址
# VUE_APP_IMAGE_API ='http://106.3.99.64:22013' # VUE_APP_IMAGE_API ='http://106.3.99.64:22013'
VUE_APP_IMAGE_API ='https://10.12.48.78' VUE_APP_IMAGE_API ='https://10.12.48.77'
VUE_APP_CLIENT_API = 'https://10.12.48.77/vvmpapi'
VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi'
...@@ -9,6 +9,6 @@ ENV = 'production' ...@@ -9,6 +9,6 @@ ENV = 'production'
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
# 图片服务器地址 # 图片服务器地址
VUE_APP_IMAGE_API ='https://10.12.48.78' VUE_APP_IMAGE_API ='https://10.12.48.77'
VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi' VUE_APP_CLIENT_API = 'https://10.12.48.77/vvmpapi'
...@@ -5,8 +5,8 @@ VUE_APP_TITLE = 周期性检测平台 ...@@ -5,8 +5,8 @@ VUE_APP_TITLE = 周期性检测平台
ENV = 'staging' ENV = 'staging'
# 中汽研安全检测平台管理系统/开发环境 # 中汽研安全检测平台管理系统/开发环境
VUE_APP_BASE_API = 'http://106.3.99.64:22016' VUE_APP_BASE_API = 'https://10.12.48.77'
# 图片服务器地址 # 图片服务器地址
VUE_APP_IMAGE_API ='http://106.3.99.64:22013' VUE_APP_IMAGE_API ='https://10.12.48.77'
VUE_APP_CLIENT_API = 'https://10.12.48.78/vvmpapi' VUE_APP_CLIENT_API = 'https://10.12.48.77/vvmpapi'
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
> >
</el-image> </el-image>
<el-image <el-image
src="https://10.12.48.78/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png" src="https://10.12.48.77/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png"
v-else v-else
class="img" class="img"
> >
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
import page from '@/mixins/page' import page from '@/mixins/page'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { addFile, delFile } from '@/api/storage' import { addFile, delFile } from '@/api/storage'
import request from '@/utils/request'
export default { export default {
mixins: [page], mixins: [page],
props: { props: {
...@@ -96,7 +97,7 @@ export default { ...@@ -96,7 +97,7 @@ export default {
default: () => { default: () => {
return { return {
dialogVisible: false, dialogVisible: false,
dialogEditId: null dialogEditAddress: []
} }
}, },
type: Object type: Object
...@@ -116,11 +117,38 @@ export default { ...@@ -116,11 +117,38 @@ export default {
watch: { watch: {
'dialogManger.dialogVisible'(newValue) { 'dialogManger.dialogVisible'(newValue) {
if (newValue) { if (newValue) {
this.selectList = []
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.userId = this.userId this.queryParams.userId = this.userId
this.queryParams.username = this.name this.queryParams.username = this.name
this.loadData() request({
url:'/review/storage/list',
method:'post',
data:{
pageNum: 1,
pageSize: 99,
userId: this.userId,
username: this.name
}
}).then(res=>{
this.tableData = res.rows
console.log(this.tableData)
if(this.dialogManger.dialogEditAddress){
for(let i=0;i < this.tableData.length; i++){
for(let j=0;j < this.tableData[i].userPhotoStorageList.length;j++){
let obj = this.dialogManger.dialogEditAddress.find(item => item.path == this.tableData[i].userPhotoStorageList[j].path)
if(obj){
this.selectImage(i, j, this.tableData[i].userPhotoStorageList[j].name,this.tableData[i].userPhotoStorageList[j].path, this.tableData[i].userPhotoStorageList[j].id)
}
}
}
}
})
} }
},
'dialogManger.dialogEditAddress'(newVal){
} }
}, },
computed: { computed: {
...@@ -152,6 +180,7 @@ export default { ...@@ -152,6 +180,7 @@ export default {
this.dialogManger.dialogVisible = false this.dialogManger.dialogVisible = false
}, },
submit() { submit() {
console.log(this.selectList)
this.$emit('select', this.selectList) this.$emit('select', this.selectList)
this.selectList = [] this.selectList = []
this.dialogManger.dialogVisible = false this.dialogManger.dialogVisible = false
...@@ -212,7 +241,7 @@ export default { ...@@ -212,7 +241,7 @@ export default {
this.selectList = this.selectList.splice(b, 1) this.selectList = this.selectList.splice(b, 1)
} }
console.log(this.selectList) console.log(this.selectList)
} },
} }
} }
</script> </script>
......
...@@ -316,3 +316,8 @@ export default { ...@@ -316,3 +316,8 @@ export default {
} }
} }
</script> </script>
<style scoped>
.card-content{
width: 100%;
}
</style>
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<div> <div>
<!-- //文件第一次提示 --> <!-- //文件第一次提示 -->
<div class="warn-prompt">该文件第一次出现,请维护如下相关信息</div> <div class="warn-prompt">该文件第一次出现,请维护如下相关信息</div>
<div class="file-box"> <div class="file-box">
<div class="file-box-header">车企文件信息</div> <div class="file-box-header">车企文件信息</div>
<el-form <el-form
...@@ -96,7 +95,7 @@ ...@@ -96,7 +95,7 @@
</el-image> </el-image>
<el-image <el-image
v-else v-else
src="https://10.12.48.78/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png" src="https://10.12.48.77/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png"
class="img" class="img"
> >
</el-image> </el-image>
......
...@@ -531,7 +531,7 @@ export default { ...@@ -531,7 +531,7 @@ export default {
onRadioChange(e,passed) { onRadioChange(e,passed) {
if(e.target.tagName == 'INPUT'){ if(e.target.tagName == 'INPUT'){
if (passed == this.form.passed) { if (passed == this.form.passed) {
this.form.passed = null; this.form.passed = "";
}else{ }else{
this.form.passed = passed; this.form.passed = passed;
} }
...@@ -747,14 +747,14 @@ export default { ...@@ -747,14 +747,14 @@ export default {
this.taskModel = JSON.parse(JSON.stringify(this.detailsList[index])) this.taskModel = JSON.parse(JSON.stringify(this.detailsList[index]))
if (this.taskModel.result) { if (this.taskModel.result) {
this.form = { this.form = {
passed: this.taskModel.result.passed, passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id, reviewDetailsId: this.taskModel.id,
taskId: this.taskId, taskId: this.taskId,
comment: this.taskModel.result.comment, comment: this.taskModel.result.comment,
fileList: this.taskModel.result.fileList fileList: this.taskModel.result.fileList
} }
this.oldForm = { this.oldForm = {
passed: this.taskModel.result.passed, passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id, reviewDetailsId: this.taskModel.id,
taskId: this.taskId, taskId: this.taskId,
comment: this.taskModel.result.comment, comment: this.taskModel.result.comment,
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
> >
</el-image> </el-image>
<el-image <el-image
src="https://10.12.48.78/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png" src="https://10.12.48.77/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png"
v-else v-else
class="img" class="img"
> >
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
width="100"> width="100">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="photo" prop="name"
label="素材名称(点击预览)" label="素材名称(点击预览)"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="jumpLookUp(scope.row.photo)">{{ scope.row.photo }}</el-button> <el-button type="text" @click="jumpLookUp(scope.row.path)">{{ scope.row.name }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -245,14 +245,29 @@ export default { ...@@ -245,14 +245,29 @@ export default {
methods: { methods: {
showMaterial(data){ showMaterial(data){
let documents = [] let documents = []
// 这里可能需要后端攒一个对象
/*
{
name :
path :
}
*/
// 没有名字时用地址替代
if(data.photo){ if(data.photo){
console.log(data)
let photos = data.photo.split(',') let photos = data.photo.split(',')
let photosName = []
if(data.photoName){
photosName = data.photoName.split(',')
}
for(let i=0;i<photos.length;i++){ for(let i=0;i<photos.length;i++){
data.photo = photos[i] photos[i]
documents.push(data) documents.push( {
name : photosName[i] == null ? photos[i] : photosName[i] == 'null' ? photos[i] : photosName[i],
path : photos[i]
})
} }
} }
this.mDialogManger.documentInfo = documents this.mDialogManger.documentInfo = documents
this.mDialogManger.dialogVisible = true this.mDialogManger.dialogVisible = true
}, },
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
<el-input <el-input
v-model="model.fileName" v-model="model.fileName"
placeholder="请输入" placeholder="请输入"
:disabled="true"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发布日期" prop="publishDate"> <el-form-item label="发布日期" prop="publishDate">
...@@ -81,13 +80,13 @@ ...@@ -81,13 +80,13 @@
> >
</el-image> </el-image>
<el-image <el-image
src="https://10.12.48.78/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png" src="https://10.12.48.77/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png"
v-else v-else
class="img" class="img"
> >
</el-image> </el-image>
</div> </div>
<div class="img-name">文件:{{ item.name }}</div> <div class="img-name">文件:{{ item.name == null ? '' : item.name == 'null' ? '' : item.name}}</div>
<el-button <el-button
plain plain
type="danger" type="danger"
...@@ -125,7 +124,8 @@ export default { ...@@ -125,7 +124,8 @@ export default {
default() { default() {
return { return {
dialogVisible: false, dialogVisible: false,
dialogEditId: 0 dialogEditId: 0,
taskId:''
} }
} }
} }
...@@ -160,21 +160,21 @@ export default { ...@@ -160,21 +160,21 @@ export default {
fileName: [ fileName: [
{ required: true, message: '请输入文件名称', trigger: 'blur' } { required: true, message: '请输入文件名称', trigger: 'blur' }
], ],
version: [ // version: [
{ required: true, message: '请输入文件版本', trigger: 'blur' } // { required: true, message: '请输入文件版本', trigger: 'blur' }
], // ],
publishDate: [ // publishDate: [
{ required: true, message: '请选择发布日期', trigger: 'change' } // { required: true, message: '请选择发布日期', trigger: 'change' }
], // ],
status: [ // status: [
{ required: true, message: '请选择文件状态', trigger: 'change' } // { required: true, message: '请选择文件状态', trigger: 'change' }
], // ],
storage: [ // storage: [
{ required: true, message: '请输入存储位置', trigger: 'blur' } // { required: true, message: '请输入存储位置', trigger: 'blur' }
], // ],
identifyNumber: [ // identifyNumber: [
{ required: true, message: '请输入文件识别号', trigger: 'blur' } // { required: true, message: '请输入文件识别号', trigger: 'blur' }
] // ]
} }
} }
}, },
...@@ -184,6 +184,9 @@ export default { ...@@ -184,6 +184,9 @@ export default {
} }
}, },
watch: { watch: {
'dialogManger.dialogVisible'(newValue){
this.model.taskId = this.dialogManger.taskId
},
'dialogManger.dialogEditId'(newValue) { 'dialogManger.dialogEditId'(newValue) {
this.model.fetch( this.model.fetch(
newValue, newValue,
...@@ -235,9 +238,15 @@ export default { ...@@ -235,9 +238,15 @@ export default {
this.$refs['fileRef'].validate(valid => { this.$refs['fileRef'].validate(valid => {
if (valid) { if (valid) {
this.model.save( this.model.save(
() => { res => {
this.dialogManger.dialogVisible = false this.dialogManger.dialogVisible = false
this.$emit('refresh') this.$emit('refresh')
if(res.code == 200){
this.$message({
type: 'success',
message: '保存成功!'
});
}
}, },
errors => {} errors => {}
) )
......
<template>
<el-dialog
:visible.sync="dialogManger.dialogVisible"
title="查看素材"
width="1200"
append-to-body
destroy-on-close
:close-on-click-modal="false"
:before-close="handleClose"
>
<el-table
:data="dialogManger.documentInfo"
border
stripe>
<el-table-column
type="index"
label="序号"
width="100">
</el-table-column>
<el-table-column
prop="name"
label="素材名称(点击预览)"
>
<template slot-scope="scope">
<el-button type="text" @click="jumpLookUp(scope.row.path)">{{ scope.row.name }}</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer">
<el-button @click="handleClose()">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import fileSelect from '@/components/fileSelect.vue'
export default {
components: {
fileSelect
},
props: {
dialogManger: {
type: Object,
default() {
return {
dialogVisible: false,
dialogEditId: 0,
documentInfo: []
}
}
}
},
created(){
console.log(this.dialogManger)
},
data() {
return {
}
},
watch: {
'dialogManger.dialogEditId'(newValue) {
this.model.fetch(
newValue,
{},
() => {
this.dialogManger.dialogVisible = true
},
() => {
this.$emit('refresh')
}
)
}
},
methods: {
selectFile(e) {
this.model.url = e
},
jumpLookUp(url){
window.open(url)
},
isImageFile(filename) {
/**
* 判断文件名是否对应于常见的图片格式。
*
* 参数:
* filename (string): 需要检查的文件名。
*
* 返回:
* boolean: 如果文件名对应的扩展名是图片格式,则返回true,否则返回false。
*/
// 常见图片格式列表
const imageExtensions = ['jpg', 'jpeg', 'png']
// 获取文件扩展名(不包括点)
const extension = filename
.slice(((filename.lastIndexOf('.') - 1) >>> 0) + 2)
.toLowerCase()
// 检查文件扩展名是否在图片格式列表中
return imageExtensions.includes(extension)
},
handleClose() {
this.$emit('close')
},
selectSampleMaterial() {
this.fileManger.dialogVisible = true
},
handleConfirm() {
this.$refs['fileRef'].validate(valid => {
if (valid) {
this.model.save(
() => {
this.dialogManger.dialogVisible = false
this.$emit('refresh')
},
errors => {}
)
}
})
}
}
}
</script>
...@@ -71,6 +71,19 @@ ...@@ -71,6 +71,19 @@
> >
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row :gutter="10" class="mb10">
<el-col :span="1.5">
<el-button
v-hasPermi="['setting:company:add']"
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleUpdate(0,0)"
>新建</el-button
>
</el-col>
</el-row>
</template> </template>
<!-- <el-form-item> <!-- <el-form-item>
<right-toolbar <right-toolbar
...@@ -159,7 +172,17 @@ ...@@ -159,7 +172,17 @@
align="left" align="left"
> >
</el-table-column> </el-table-column>
<el-table-column
prop=""
label="素材"
min-width="100"
show-overflow-tooltip
align="left"
>
<template slot-scope="scope">
<el-button type="text" @click="showMaterial(scope.row)"> 素材文件 </el-button>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="createBy" prop="createBy"
label="创建人员" label="创建人员"
...@@ -182,16 +205,22 @@ ...@@ -182,16 +205,22 @@
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
min-width="90" min-width="120"
fixed="right" fixed="right"
class-name="fixed-width" class-name="fixed-width"
> >
<template slot-scope="scope"> <template slot-scope="scope" style="display: inline flex;">
<page-button <page-button
style="margin: 0 auto" style="display: inline flex;margin-right: 10px"
icon="edit" icon="edit"
title="修改" title="修改"
@click.native="handleUpdate(scope.row.id)" @click.native="handleUpdate(scope.row.id,0)"
></page-button>
<page-button
style="display: inline flex;"
icon="delete"
title="删除"
@click.native="handleUpdate(scope.row.id,1)"
></page-button> ></page-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -201,6 +230,11 @@ ...@@ -201,6 +230,11 @@
@refresh="refreshList = true" @refresh="refreshList = true"
@close="dialogManger.dialogVisible = false" @close="dialogManger.dialogVisible = false"
></yan-dialog> ></yan-dialog>
<material-dialog
:dialog-manger="mDialogManger"
@refresh="refreshList = true"
@close="mDialogManger.dialogVisible = false"
></material-dialog>
<pagination <pagination
:total="total" :total="total"
:background="false" :background="false"
...@@ -217,9 +251,13 @@ import page from '@/mixins/page' ...@@ -217,9 +251,13 @@ import page from '@/mixins/page'
import dialog from './components/dialog.vue' import dialog from './components/dialog.vue'
import routerMixins from '@/mixins/router' import routerMixins from '@/mixins/router'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import request from '@/utils/request'
import { method } from 'lodash';
import materialDialog from './components/materialDialog.vue';
export default { export default {
components: { components: {
'yan-dialog': dialog 'yan-dialog': dialog,
'material-dialog' : materialDialog
}, },
dicts: ['file_status'], dicts: ['file_status'],
mixins: [page, routerMixins], mixins: [page, routerMixins],
...@@ -253,7 +291,13 @@ export default { ...@@ -253,7 +291,13 @@ export default {
fileList: [], fileList: [],
headers: { headers: {
Authorization: 'Bearer ' + getToken() Authorization: 'Bearer ' + getToken()
} },
refreshList: false,
mDialogManger: {
dialogVisible: false,
refreshList: false,
documentInfo: []
},
} }
}, },
watch: { watch: {
...@@ -277,6 +321,35 @@ export default { ...@@ -277,6 +321,35 @@ export default {
this.$message.error(file.msg) this.$message.error(file.msg)
} }
}, },
showMaterial(data){
let documents = []
// 这里可能需要后端攒一个对象
/*
{
name :
path :
}
*/
// 没有名字时用地址替代
if(data.photo){
console.log(data)
let photos = data.photo.split(',')
let photosName = []
if(data.photoName){
photosName = data.photoName.split(',')
}
for(let i=0;i<photos.length;i++){
photos[i]
documents.push( {
name : photosName[i] == null ? photos[i] : photosName[i] == 'null' ? photos[i] : photosName[i],
path : photos[i]
})
}
}
console.log(documents)
this.mDialogManger.documentInfo = documents
this.mDialogManger.dialogVisible = true
},
/** 下载模板操作 */ /** 下载模板操作 */
downTemplate() { downTemplate() {
this.download( this.download(
...@@ -305,9 +378,35 @@ export default { ...@@ -305,9 +378,35 @@ export default {
} }
this.handleQuery() this.handleQuery()
}, },
handleUpdate(id) { handleUpdate(id,flag) {
this.dialogManger.dialogVisible = true if(flag!==1){
this.dialogManger.dialogEditId = id this.dialogManger.dialogVisible = true
this.dialogManger.dialogEditId = id
this.dialogManger.taskId = this.$route.query.id
}else{
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
request({
url:'/review/enterprise/archive/delete',
method: 'post',
data:{
id:id
}
}).then(res=>{
if(res.code == 200){
this.$message({
type: 'success',
message: '删除成功!'
});
this.loadData()
}
})
})
}
} }
} }
} }
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<div v-if="!queryParams.standardId" class="inspection-standard"> <div v-if="!queryParams.standardId" class="inspection-standard">
检验依据:{{ item.standardNo }}{{ item.name }} 检验依据:{{ item.standardNo }}{{ item.name }}
</div> </div>
<div class="card-content"> <div class="card-content" >
<div class="card-cell"> <div class="card-cell">
<div class="cell-label">任务编号</div> <div class="cell-label">任务编号</div>
<div class="cell-value"> <div class="cell-value">
...@@ -306,3 +306,8 @@ export default { ...@@ -306,3 +306,8 @@ export default {
} }
} }
</script> </script>
<style scoped>
.card-content{
width: 100%;
}
</style>
\ No newline at end of file
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</el-image> </el-image>
<el-image <el-image
v-else v-else
src="https://10.12.48.78/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png" src="https://10.12.48.77/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png"
class="img" class="img"
> >
</el-image> </el-image>
......
<template>
<div>
<!-- //文件第一次提示 -->
<el-dialog
title="编辑文件信息"
:visible.sync="dialogManger.dialogVisible"
width="60%"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<div class="file-box">
<div class="file-box-header">车企文件信息</div>
<el-form
ref="fileRef"
:model="model"
label-width="100px"
label-position="top"
class="file-form-class"
:rules="fileRules"
>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="企业名称" prop="enterpriseName">
<el-input
v-model="model.enterpriseName"
placeholder="请输入"
:disabled="true"
@input="updateFocus"
></el-input>
</el-form-item>
<el-form-item label="文件版本" prop="version">
<el-input
v-model="model.version"
placeholder="请输入"
@input="updateFocus"
></el-input>
</el-form-item>
<el-form-item label="文件状态" prop="status">
<el-select
v-model="model.status"
placeholder="请选择"
style="width: 100%"
@input="updateFocus"
>
<el-option
v-for="item in dict.type.file_status"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="文件识别号" prop="identifyNumber">
<el-input
v-model="model.identifyNumber"
placeholder="请输入"
@input="updateFocus"
></el-input>
</el-form-item>
<el-form-item label="存储位置" prop="storage">
<el-input
v-model="model.storage"
placeholder="请输入"
@input="updateFocus"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="文件名称" prop="fileName">
<el-input
v-model="model.fileName"
placeholder="请输入"
input="updateFocus"
@input="handleUpdateFile"
></el-input>
</el-form-item>
<el-form-item label="发布日期" prop="publishDate">
<el-date-picker
v-model="model.publishDate"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期"
style="width: 100%"
@input="updateFocus"
>
</el-date-picker>
</el-form-item>
<el-form-item label="附件" prop="url">
<div
v-if="model.url && model.url.length > 0"
class="imageContnet"
>
<div v-for="(item, i) in model.url" :key="i" class="image">
<div class="img-card">
<el-image
v-if="isImageFile(item.path)"
:src="item.path"
class="img"
>
</el-image>
<!-- <el-image
v-else
src="https://10.12.48.77/vehicle-quality-review-oss/2024/07/02/doc_d_20240702133702A019.png"
class="img"
>
</el-image> -->
</div>
<div class="img-name">文件:{{ item.name }}</div>
<el-button
plain
type="danger"
icon="el-icon-delete"
@click="delFile(i)"
></el-button>
</div>
</div>
<el-link type="primary" @click="selectSampleMaterial(model.url)">
从素材库选择</el-link
>
</el-form-item>
</el-col>
</el-row>
</el-form>
<fileSelect :dialog-manger="mDialogManger" @select="selectFile"></fileSelect>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleSaveFile(dialogManger.file)">保存车企文件</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import fileSelect from '@/components/fileSelect.vue'
// import { delFile } from '@/api/storage'
export default {
dicts: ['file_status'],
components: {
fileSelect
},
props: {
enterpriseName: {
type: String,
default: 'xiaomi'
},
fileName: {
type: String,
default: ''
},
dialogManger: {
type: Object,
default() {
return {
dialogVisible: false,
file:{}
}
}
}
},
created(){
console.log(111)
},
data() {
return {
fileRules: {
enterpriseName: [
{ required: true, message: '请输入企业名称', trigger: 'blur' }
],
fileName: [
{ required: true, message: '请输入文件名称', trigger: 'blur' }
],
// version: [
// { required: true, message: '请输入文件版本', trigger: 'blur' }
// ],
// publishDate: [
// { required: true, message: '请选择发布日期', trigger: 'change' }
// ],
// status: [
// { required: true, message: '请选择文件状态', trigger: 'change' }
// ],
// storage: [
// { required: true, message: '请输入存储位置', trigger: 'blur' }
// ],
// identifyNumber: [
// { required: true, message: '请输入文件识别号', trigger: 'blur' }
// ]
},
mDialogManger: {
dialogVisible: false,
dialogEditAddress: ''
},
model: this.$modelDataSource({
url: '/review/enterprise/archive',
dataKey: 'model',
attributes: {
id: 0,
enterpriseName: '',
fileName: '',
version: '',
publishDate: '',
status: '',
storage: '',
identifyNumber: '',
url: [],
taskId: ''
}
})
}
},
watch: {
fileName(newValue) {
this.model.fileName = newValue
this.model.enterpriseName = this.enterpriseName
this.model.taskId = this.$route.query.taskId
},
'dialogManger.dialogVisible'(newValue){
this.model.enterpriseName = this.dialogManger.file.enterpriseName
this.model.fileName = this.dialogManger.file.fileName
this.model.id = this.dialogManger.file.id
this.model.identifyNumber = this.dialogManger.file.identifyNumber
this.model.publishDate = this.dialogManger.file.publishDate
this.model.status = this.dialogManger.file.status
this.model.storage = this.dialogManger.file.storage
this.model.taskId = this.dialogManger.file.taskId
this.model.url = this.dialogManger.file.url
this.model.version = this.dialogManger.file.version
this.model.uuid = 1
console.log(this.model.url)
},
'dialogManger.dialogEditId'(newValue) {
this.model.fetch(
newValue,
{},
() => {},
() => {}
)
}
},
methods: {
isImageFile(filename) {
/**
* 判断文件名是否对应于常见的图片格式。
*
* 参数:
* filename (string): 需要检查的文件名。
*
* 返回:
* boolean: 如果文件名对应的扩展名是图片格式,则返回true,否则返回false。
*/
// 常见图片格式列表
const imageExtensions = ['jpg', 'jpeg', 'png']
// 获取文件扩展名(不包括点)
const extension = filename
.slice(((filename.lastIndexOf('.') - 1) >>> 0) + 2)
.toLowerCase()
// 检查文件扩展名是否在图片格式列表中
console.log( imageExtensions.includes(extension))
return imageExtensions.includes(extension)
},
selectFile(e) {
this.model.url = e
this.$forceUpdate()
},
selectSampleMaterial(url) {
this.mDialogManger.dialogEditAddress = url
this.mDialogManger.dialogVisible = true
},
handleUpdateFile(newValue) {
this.$emit('fileNameUpdate', newValue)
},
/**
* 失去焦点回调
*/
updateFocus() {
this.$emit('handleUpdate', this.isAllPropertiesNull(this.model))
},
isAllPropertiesNull(obj) {
for (var key in obj) {
if (obj[key] !== '' && typeof obj[key] !== 'undefined') {
return true
}
}
return false
},
delFile(index) {
this.dialogManger.file.url.splice(index, 1)
this.$forceUpdate()
},
handleSaveFile(file) {
// vue表单校验
this.$refs.fileRef.validate(valid => {
//this.model.attributes = file
if (valid) {
this.model.save(
res => {
this.model.reset()
this.$store.dispatch('processing/getCompanyFiles', {
taskId: file.taskId
})
//console.log(res.code)
if(res.code == 200){
this.dialogManger.dialogVisible = false
}
this.$emit('handleSave', res.data)
this.$modal.msgSuccess('提交文件成功')
this.$nextTick(() => {
this.$refs.fileRef.clearValidate()
})
},
errors => {}
)
}
})
}
}
}
</script>
<style scoped lang="scss">
.file-form-class {
::v-deep.el-form-item {
margin-bottom: 20px;
}
}
</style>
...@@ -288,6 +288,15 @@ ...@@ -288,6 +288,15 @@
</el-form-item> </el-form-item>
</div> </div>
</el-col> </el-col>
<el-col :span="1" :offset="1">
<el-button
type="text"
size="default"
style="margin-top: 20px"
@click="editFile(file)"
v-if="file && file.id"
>编辑文件</el-button>
</el-col>
<el-col :span="1" :offset="1"> <el-col :span="1" :offset="1">
<el-button <el-button
type="danger" type="danger"
...@@ -361,6 +370,7 @@ ...@@ -361,6 +370,7 @@
<footer-button <footer-button
v-if="detailsList.length" v-if="detailsList.length"
type="default" type="default"
:disabled="loading"
icon="hard-disk-one" icon="hard-disk-one"
plain plain
@click="submitQuestionnaire()" @click="submitQuestionnaire()"
...@@ -378,6 +388,7 @@ ...@@ -378,6 +388,7 @@
<!-- 发起场景评审 --> <!-- 发起场景评审 -->
<scene-dialog :dialog-manger="sceneManger"></scene-dialog> <scene-dialog :dialog-manger="sceneManger"></scene-dialog>
<preview-view :dialog-manger="previewManger"></preview-view> <preview-view :dialog-manger="previewManger"></preview-view>
<edit-dialog :dialog-manger="dialogManger"></edit-dialog>
</div> </div>
</template> </template>
...@@ -396,12 +407,15 @@ import { mapGetters } from 'vuex' ...@@ -396,12 +407,15 @@ import { mapGetters } from 'vuex'
import sceneDialog from './components/sceneDialog.vue' import sceneDialog from './components/sceneDialog.vue'
import previewView from './components/previewView.vue' import previewView from './components/previewView.vue'
import routerMixins from '@/mixins/router' import routerMixins from '@/mixins/router'
import editDialog from './components/editDialog.vue'
import request from '@/utils/request'
export default { export default {
components: { components: {
'scene-dialog': sceneDialog, 'scene-dialog': sceneDialog,
'preview-view': previewView, 'preview-view': previewView,
'scene-view': sceneView, 'scene-view': sceneView,
'company-file': companyFile 'company-file': companyFile,
'edit-dialog' : editDialog
}, },
mixins: [routerMixins], mixins: [routerMixins],
dicts: ['system_review_test'], dicts: ['system_review_test'],
...@@ -423,6 +437,10 @@ export default { ...@@ -423,6 +437,10 @@ export default {
} }
} }
}, },
dialogManger: {
dialogVisible: false,
editFileId:'',
},
form: { form: {
passed: '', passed: '',
reviewDetailsId: '', reviewDetailsId: '',
...@@ -469,7 +487,9 @@ export default { ...@@ -469,7 +487,9 @@ export default {
} }
}), }),
loading: false, loading: false,
choosed:'' choosed:'',
currentIndex:0,
loading:false
} }
}, },
...@@ -550,10 +570,35 @@ export default { ...@@ -550,10 +570,35 @@ export default {
this.handleCircle(0) this.handleCircle(0)
}, },
methods: { methods: {
editFile(file){
//let fileObj = this.detailsList[this.currentIndex].result.fileList[key] || file
request({
url: '/review/enterprise/archive/getById',
method: 'post',
data: {
id: file.id
}
}).then(res=>{
this.dialogManger.file = res.data
this.dialogManger.dialogVisible = true
})
// 根据id请求返回文件信息
/**
* request({
* url:xxx
* method:post
* data:{ id: fileObj.id}
* }).then(res=>{
*
* })
*
*/
},
onRadioChange(e,passed) { onRadioChange(e,passed) {
if(e.target.tagName == 'INPUT'){ if(e.target.tagName == 'INPUT'){
if (passed == this.form.passed) { if (passed == this.form.passed) {
this.form.passed = null; this.form.passed = "";
}else{ }else{
this.form.passed = passed; this.form.passed = passed;
} }
...@@ -638,7 +683,6 @@ export default { ...@@ -638,7 +683,6 @@ export default {
v.order = k + 1 v.order = k + 1
return v return v
}) })
console.log(this.model)
if ( if (
this.model.reviewSceneChangeTasks && this.model.reviewSceneChangeTasks &&
this.model.reviewSceneChangeTasks.length this.model.reviewSceneChangeTasks.length
...@@ -735,22 +779,24 @@ export default { ...@@ -735,22 +779,24 @@ export default {
* @param item 圆圈对象 * @param item 圆圈对象
*/ */
changeStep(index) { changeStep(index) {
console.log(this.isAllPropertiesEqual())
if ( if (
this.isAllPropertiesEqual() && this.isAllPropertiesEqual() &&
!this.allPropertiesCheck(this.form.fileList, 'isFileUpdate') !this.allPropertiesCheck(this.form.fileList, 'isFileUpdate')
) { ) {
this.currentIndex = index
this.handleCircle(index) this.handleCircle(index)
} else { } else {
this.$message.error('您有未保存内容,请点击保存按钮') this.$message.error('您有未保存内容,请点击保存按钮')
} }
}, },
isAllPropertiesEqual() { isAllPropertiesEqual() {
for (var key in this.form) { for (let key in this.form) {
if (key !== 'isFileUpdate') { if (key !== 'isFileUpdate') {
if ( if (
JSON.stringify(this.form[key]) !== JSON.stringify(this.oldForm[key]) JSON.stringify(this.form[key]) !== JSON.stringify(this.oldForm[key])
) { ) {
console.log(JSON.stringify(this.form[key]))
console.log(JSON.stringify(this.oldForm[key]))
return false return false
} }
} }
...@@ -778,20 +824,21 @@ export default { ...@@ -778,20 +824,21 @@ export default {
* @param item 圆圈对象 * @param item 圆圈对象
*/ */
handleCircle(index) { handleCircle(index) {
console.log(index)
this.activeModel = index this.activeModel = index
if (this.detailsList.length) { if (this.detailsList.length) {
this.taskModel = JSON.parse(JSON.stringify(this.detailsList[index])) this.taskModel = JSON.parse(JSON.stringify(this.detailsList[index]))
console.log(this.taskModel) console.log(this.taskModel)
if (this.taskModel.result) { if (this.taskModel.result) {
this.form = { this.form = {
passed: this.taskModel.result.passed, passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id, reviewDetailsId: this.taskModel.id,
taskId: this.taskId, taskId: this.taskId,
comment: this.taskModel.result.comment, comment: this.taskModel.result.comment,
fileList: this.taskModel.result.fileList || [] fileList: this.taskModel.result.fileList || []
} }
this.oldForm = { this.oldForm = {
passed: this.taskModel.result.passed, passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id, reviewDetailsId: this.taskModel.id,
taskId: this.taskId, taskId: this.taskId,
comment: this.taskModel.result.comment, comment: this.taskModel.result.comment,
...@@ -830,6 +877,8 @@ export default { ...@@ -830,6 +877,8 @@ export default {
}, },
// 保存当前条目 // 保存当前条目
submitQuestionnaire(type) { submitQuestionnaire(type) {
this.loading = true
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
if (!this.allPropertiesCheck(this.form.fileList, 'isFileUpdate')) { if (!this.allPropertiesCheck(this.form.fileList, 'isFileUpdate')) {
...@@ -845,6 +894,14 @@ export default { ...@@ -845,6 +894,14 @@ export default {
file.id = null // 未找到则将审核企业档案ID设为null file.id = null // 未找到则将审核企业档案ID设为null
} }
}) })
if(this.form.fileList.find(item => item.id == '' || item.id == null)){
this.$message({
message: '存在未保存的文件',
type: 'warning'
});
this.loading = false
return;
}
reviewDetailsSubmit(this.form).then(async res => { reviewDetailsSubmit(this.form).then(async res => {
if (res.code === 200) { if (res.code === 200) {
await this.getTask() await this.getTask()
...@@ -855,6 +912,7 @@ export default { ...@@ -855,6 +912,7 @@ export default {
i.isFileUpdate = false i.isFileUpdate = false
}) })
this.oldForm = this.form this.oldForm = this.form
this.loading = false
this.$modal.msgSuccess('保存当前条目成功') this.$modal.msgSuccess('保存当前条目成功')
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.clearValidate() this.$refs.form.clearValidate()
......
...@@ -620,3 +620,8 @@ export default { ...@@ -620,3 +620,8 @@ export default {
} }
} }
</script> </script>
<style scoped>
.card-content{
width: 100%;
}
</style>
...@@ -521,7 +521,7 @@ export default { ...@@ -521,7 +521,7 @@ export default {
console.log(data) console.log(data)
if (data.length > 0) { if (data.length > 0) {
data.forEach(item => { data.forEach(item => {
item.path = item.path.replace('https://10.12.48.78', '') item.path = item.path.replace('https://10.12.48.77', '')
}) })
if (this.materialFlag === 'trademark') { if (this.materialFlag === 'trademark') {
this.editParamsForm.trademark = data[0].path this.editParamsForm.trademark = data[0].path
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
}, },
mounted() { mounted() {
const id = this.$route.query.id const id = this.$route.query.id
this.url = `https://10.12.48.78:8090/car/caseManage/case/casePublishDetail/${id}` this.url = `https://10.12.48.77:8090/car/caseManage/case/casePublishDetail/${id}`
}, },
methods: {} methods: {}
} }
......
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
return { return {
number: 0, number: 0,
uploadList: [], uploadList: [],
showUrl: 'https://10.12.48.78', showUrl: 'https://10.12.48.77',
baseUrl: process.env.VUE_APP_BASE_API, baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio', // 上传文件服务器地址 uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio', // 上传文件服务器地址
headers: { headers: {
......
...@@ -232,7 +232,8 @@ ...@@ -232,7 +232,8 @@
<span v-else-if="$index === 0">{{ <span v-else-if="$index === 0">{{
row.dept.deptName || '-' row.dept.deptName || '-'
}}</span> }}</span>
<span v-else-if="$index >= 1">{{ row.dept.deptName || '-' }}</span>
<span v-else-if="$index >= 1"> {{ row.dept.deptName || row.dept || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
......
...@@ -794,3 +794,8 @@ export default { ...@@ -794,3 +794,8 @@ export default {
} }
} }
</script> </script>
<style scoped>
.card-content{
width: 100%;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment