Commit b9a05081 authored by zhang's avatar zhang

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

parent 433e6e32
......@@ -11,7 +11,6 @@ VUE_APP_BASE_API = '/dev-api'
VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 图片服务器地址
# 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.78/vvmpapi'
VUE_APP_CLIENT_API = 'https://10.12.48.77/vvmpapi'
......@@ -9,6 +9,6 @@ ENV = 'production'
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 = 周期性检测平台
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 @@
>
</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
class="img"
>
......@@ -89,6 +89,7 @@
import page from '@/mixins/page'
import { mapGetters } from 'vuex'
import { addFile, delFile } from '@/api/storage'
import request from '@/utils/request'
export default {
mixins: [page],
props: {
......@@ -96,7 +97,7 @@ export default {
default: () => {
return {
dialogVisible: false,
dialogEditId: null
dialogEditAddress: []
}
},
type: Object
......@@ -116,11 +117,38 @@ export default {
watch: {
'dialogManger.dialogVisible'(newValue) {
if (newValue) {
this.selectList = []
this.queryParams.pageNum = 1
this.queryParams.userId = this.userId
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: {
......@@ -152,6 +180,7 @@ export default {
this.dialogManger.dialogVisible = false
},
submit() {
console.log(this.selectList)
this.$emit('select', this.selectList)
this.selectList = []
this.dialogManger.dialogVisible = false
......@@ -212,7 +241,7 @@ export default {
this.selectList = this.selectList.splice(b, 1)
}
console.log(this.selectList)
}
},
}
}
</script>
......
......@@ -316,3 +316,8 @@ export default {
}
}
</script>
<style scoped>
.card-content{
width: 100%;
}
</style>
\ No newline at end of file
......@@ -2,7 +2,6 @@
<div>
<!-- //文件第一次提示 -->
<div class="warn-prompt">该文件第一次出现,请维护如下相关信息</div>
<div class="file-box">
<div class="file-box-header">车企文件信息</div>
<el-form
......@@ -96,7 +95,7 @@
</el-image>
<el-image
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"
>
</el-image>
......
......@@ -531,7 +531,7 @@ export default {
onRadioChange(e,passed) {
if(e.target.tagName == 'INPUT'){
if (passed == this.form.passed) {
this.form.passed = null;
this.form.passed = "";
}else{
this.form.passed = passed;
}
......@@ -747,14 +747,14 @@ export default {
this.taskModel = JSON.parse(JSON.stringify(this.detailsList[index]))
if (this.taskModel.result) {
this.form = {
passed: this.taskModel.result.passed,
passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id,
taskId: this.taskId,
comment: this.taskModel.result.comment,
fileList: this.taskModel.result.fileList
}
this.oldForm = {
passed: this.taskModel.result.passed,
passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id,
taskId: this.taskId,
comment: this.taskModel.result.comment,
......
......@@ -81,7 +81,7 @@
>
</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
class="img"
>
......
......@@ -18,11 +18,11 @@
width="100">
</el-table-column>
<el-table-column
prop="photo"
prop="name"
label="素材名称(点击预览)"
>
<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>
</el-table-column>
......
......@@ -245,14 +245,29 @@ export default {
methods: {
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++){
data.photo = photos[i]
documents.push(data)
photos[i]
documents.push( {
name : photosName[i] == null ? photos[i] : photosName[i] == 'null' ? photos[i] : photosName[i],
path : photos[i]
})
}
}
this.mDialogManger.documentInfo = documents
this.mDialogManger.dialogVisible = true
},
......
......@@ -57,7 +57,6 @@
<el-input
v-model="model.fileName"
placeholder="请输入"
:disabled="true"
></el-input>
</el-form-item>
<el-form-item label="发布日期" prop="publishDate">
......@@ -81,13 +80,13 @@
>
</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
class="img"
>
</el-image>
</div>
<div class="img-name">文件:{{ item.name }}</div>
<div class="img-name">文件:{{ item.name == null ? '' : item.name == 'null' ? '' : item.name}}</div>
<el-button
plain
type="danger"
......@@ -125,7 +124,8 @@ export default {
default() {
return {
dialogVisible: false,
dialogEditId: 0
dialogEditId: 0,
taskId:''
}
}
}
......@@ -160,21 +160,21 @@ export default {
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' }
]
// 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' }
// ]
}
}
},
......@@ -184,6 +184,9 @@ export default {
}
},
watch: {
'dialogManger.dialogVisible'(newValue){
this.model.taskId = this.dialogManger.taskId
},
'dialogManger.dialogEditId'(newValue) {
this.model.fetch(
newValue,
......@@ -235,9 +238,15 @@ export default {
this.$refs['fileRef'].validate(valid => {
if (valid) {
this.model.save(
() => {
res => {
this.dialogManger.dialogVisible = false
this.$emit('refresh')
if(res.code == 200){
this.$message({
type: 'success',
message: '保存成功!'
});
}
},
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 @@
>
</el-upload>
</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>
<!-- <el-form-item>
<right-toolbar
......@@ -159,7 +172,17 @@
align="left"
>
</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
prop="createBy"
label="创建人员"
......@@ -182,16 +205,22 @@
<el-table-column
label="操作"
align="center"
min-width="90"
min-width="120"
fixed="right"
class-name="fixed-width"
>
<template slot-scope="scope">
<template slot-scope="scope" style="display: inline flex;">
<page-button
style="margin: 0 auto"
style="display: inline flex;margin-right: 10px"
icon="edit"
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>
</template>
</el-table-column>
......@@ -201,6 +230,11 @@
@refresh="refreshList = true"
@close="dialogManger.dialogVisible = false"
></yan-dialog>
<material-dialog
:dialog-manger="mDialogManger"
@refresh="refreshList = true"
@close="mDialogManger.dialogVisible = false"
></material-dialog>
<pagination
:total="total"
:background="false"
......@@ -217,9 +251,13 @@ import page from '@/mixins/page'
import dialog from './components/dialog.vue'
import routerMixins from '@/mixins/router'
import { getToken } from '@/utils/auth'
import request from '@/utils/request'
import { method } from 'lodash';
import materialDialog from './components/materialDialog.vue';
export default {
components: {
'yan-dialog': dialog
'yan-dialog': dialog,
'material-dialog' : materialDialog
},
dicts: ['file_status'],
mixins: [page, routerMixins],
......@@ -253,7 +291,13 @@ export default {
fileList: [],
headers: {
Authorization: 'Bearer ' + getToken()
}
},
refreshList: false,
mDialogManger: {
dialogVisible: false,
refreshList: false,
documentInfo: []
},
}
},
watch: {
......@@ -277,6 +321,35 @@ export default {
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() {
this.download(
......@@ -305,9 +378,35 @@ export default {
}
this.handleQuery()
},
handleUpdate(id) {
this.dialogManger.dialogVisible = true
this.dialogManger.dialogEditId = id
handleUpdate(id,flag) {
if(flag!==1){
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 @@
<div v-if="!queryParams.standardId" class="inspection-standard">
检验依据:{{ item.standardNo }}{{ item.name }}
</div>
<div class="card-content">
<div class="card-content" >
<div class="card-cell">
<div class="cell-label">任务编号</div>
<div class="cell-value">
......@@ -306,3 +306,8 @@ export default {
}
}
</script>
<style scoped>
.card-content{
width: 100%;
}
</style>
\ No newline at end of file
......@@ -96,7 +96,7 @@
</el-image>
<el-image
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"
>
</el-image>
......
......@@ -288,6 +288,15 @@
</el-form-item>
</div>
</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-button
type="danger"
......@@ -361,6 +370,7 @@
<footer-button
v-if="detailsList.length"
type="default"
:disabled="loading"
icon="hard-disk-one"
plain
@click="submitQuestionnaire()"
......@@ -378,6 +388,7 @@
<!-- 发起场景评审 -->
<scene-dialog :dialog-manger="sceneManger"></scene-dialog>
<preview-view :dialog-manger="previewManger"></preview-view>
<edit-dialog :dialog-manger="dialogManger"></edit-dialog>
</div>
</template>
......@@ -396,12 +407,15 @@ import { mapGetters } from 'vuex'
import sceneDialog from './components/sceneDialog.vue'
import previewView from './components/previewView.vue'
import routerMixins from '@/mixins/router'
import editDialog from './components/editDialog.vue'
import request from '@/utils/request'
export default {
components: {
'scene-dialog': sceneDialog,
'preview-view': previewView,
'scene-view': sceneView,
'company-file': companyFile
'company-file': companyFile,
'edit-dialog' : editDialog
},
mixins: [routerMixins],
dicts: ['system_review_test'],
......@@ -423,6 +437,10 @@ export default {
}
}
},
dialogManger: {
dialogVisible: false,
editFileId:'',
},
form: {
passed: '',
reviewDetailsId: '',
......@@ -469,7 +487,9 @@ export default {
}
}),
loading: false,
choosed:''
choosed:'',
currentIndex:0,
loading:false
}
},
......@@ -550,10 +570,35 @@ export default {
this.handleCircle(0)
},
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) {
if(e.target.tagName == 'INPUT'){
if (passed == this.form.passed) {
this.form.passed = null;
this.form.passed = "";
}else{
this.form.passed = passed;
}
......@@ -638,7 +683,6 @@ export default {
v.order = k + 1
return v
})
console.log(this.model)
if (
this.model.reviewSceneChangeTasks &&
this.model.reviewSceneChangeTasks.length
......@@ -735,22 +779,24 @@ export default {
* @param item 圆圈对象
*/
changeStep(index) {
console.log(this.isAllPropertiesEqual())
if (
this.isAllPropertiesEqual() &&
!this.allPropertiesCheck(this.form.fileList, 'isFileUpdate')
) {
) {
this.currentIndex = index
this.handleCircle(index)
} else {
this.$message.error('您有未保存内容,请点击保存按钮')
}
},
isAllPropertiesEqual() {
for (var key in this.form) {
for (let key in this.form) {
if (key !== 'isFileUpdate') {
if (
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
}
}
......@@ -778,20 +824,21 @@ export default {
* @param item 圆圈对象
*/
handleCircle(index) {
console.log(index)
this.activeModel = index
if (this.detailsList.length) {
this.taskModel = JSON.parse(JSON.stringify(this.detailsList[index]))
console.log(this.taskModel)
if (this.taskModel.result) {
this.form = {
passed: this.taskModel.result.passed,
passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id,
taskId: this.taskId,
comment: this.taskModel.result.comment,
fileList: this.taskModel.result.fileList || []
}
this.oldForm = {
passed: this.taskModel.result.passed,
passed: this.taskModel.result.passed == null ? '' : this.taskModel.result.passed,
reviewDetailsId: this.taskModel.id,
taskId: this.taskId,
comment: this.taskModel.result.comment,
......@@ -830,6 +877,8 @@ export default {
},
// 保存当前条目
submitQuestionnaire(type) {
this.loading = true
this.$refs.form.validate(valid => {
if (valid) {
if (!this.allPropertiesCheck(this.form.fileList, 'isFileUpdate')) {
......@@ -845,6 +894,14 @@ export default {
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 => {
if (res.code === 200) {
await this.getTask()
......@@ -855,6 +912,7 @@ export default {
i.isFileUpdate = false
})
this.oldForm = this.form
this.loading = false
this.$modal.msgSuccess('保存当前条目成功')
this.$nextTick(() => {
this.$refs.form.clearValidate()
......
......@@ -620,3 +620,8 @@ export default {
}
}
</script>
<style scoped>
.card-content{
width: 100%;
}
</style>
......@@ -521,7 +521,7 @@ export default {
console.log(data)
if (data.length > 0) {
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') {
this.editParamsForm.trademark = data[0].path
......
......@@ -22,7 +22,7 @@ export default {
},
mounted() {
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: {}
}
......
......@@ -107,7 +107,7 @@ export default {
return {
number: 0,
uploadList: [],
showUrl: 'https://10.12.48.78',
showUrl: 'https://10.12.48.77',
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio', // 上传文件服务器地址
headers: {
......
......@@ -232,7 +232,8 @@
<span v-else-if="$index === 0">{{
row.dept.deptName || '-'
}}</span>
<span v-else-if="$index >= 1">{{ row.dept.deptName || '-' }}</span>
<span v-else-if="$index >= 1"> {{ row.dept.deptName || row.dept || '-' }}</span>
</template>
</el-table-column>
<!-- <el-table-column
......
......@@ -794,3 +794,8 @@ export default {
}
}
</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