Commit 624fafa9 by peiqiQQQ

修改

1 parent 83286629
......@@ -41,7 +41,7 @@
<script>
import ListPage from '@/components/ListPage.vue'
import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/components/TableConfig.vue'
import TableConfig from '@/views/collectDataConfiguration/TableConfig.vue'
import AddTabelList from './AddTabelList.vue'
import { artPolicyExamine, examineSearch } from '@/api/architectureInspection'
......
......@@ -38,7 +38,7 @@
<script>
import Form from './Form.vue'
import TableConfig from '@/components/TableConfig.vue'
import TableConfig from './TableConfig.vue'
import AddTabelList from './AddTabelList.vue'
import { materialTypeList } from '@/utils/architectureInspectionDis'
......@@ -102,13 +102,13 @@ export default {
prop: 'supervName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
// rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '收集材料类型', // label文字
prop: 'materialType', // 字段名
__slotName: 'materialType',
// rules: [{ required: true, trigger: 'change', message: '不能为空' }],
// rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '开始时间', // label文字
......@@ -118,6 +118,7 @@ export default {
element: 'el-date-picker', // 指定elementui组件
initValue: new Date().format('yyyy-MM-dd'), // 字段初始值
placeholder: '请选择', // elementui组件属性
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '截止时间', // label文字
......@@ -127,12 +128,13 @@ export default {
element: 'el-date-picker', // 指定elementui组件
initValue: new Date().format('yyyy-MM-dd'), // 字段初始值
placeholder: '请选择', // elementui组件属性
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '督查清单', // label文字
prop: 'supervision', // 字段名
__slotName: 'supervision',
// rules: [{ required: true, trigger: 'change', message: '不能为空' }],
// rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '备注', // label文字
......@@ -221,10 +223,13 @@ export default {
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
if (v.prop === 'createTime' || v.prop === 'endTime' ) {
if (v.prop === 'createTime' || v.prop === 'endTime') {
v.initValue = new Date().format('yyyy-MM-dd')
}
} else {
v.initValue = ''
}
})
this.formInfo.materialType = []
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
......@@ -246,8 +251,8 @@ export default {
})
} else {
this.$nextTick(() => {
this.$refs['addForm'].onReset()
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
this.formInfo.materialType = []
})
}
......
......@@ -48,7 +48,7 @@
>
</el-table-column> -->
<template v-for="item in columns">
<template v-for="(item, index) in columns">
<!-- v-html存在安全问题暂时弃用 -->
<!-- 如果接口返回的内容需要我们解析出来并渲染到页面中 比如:0 代表 已停用 1 代表 已发布 2 代表 暂存 -->
<!-- <el-table-column
......@@ -61,9 +61,17 @@
<span v-html="item.callback && item.callback(scope.row)"></span>
</template>
</el-table-column> -->
<el-table-column
v-if="item.type === 'index'"
v-bind="item"
align="center"
:key="index"
:index="indexMethod"
>
</el-table-column>
<!-- 操作列 -->
<el-table-column
v-if="item.type === 'operation'"
v-else-if="item.type === 'operation'"
:key="item.prop"
v-bind="item"
align="center"
......@@ -214,6 +222,11 @@ export default {
this.queryData()
},
methods: {
indexMethod(index) {
return (
(this.pagination.current - 1) * this.pagination.pageSize + index + 1
)
},
clearSelection() {
this.$refs.tableConfig.clearSelection()
},
......
......@@ -92,9 +92,9 @@ export default {
size: 'mini',
plain: true,
icon: 'el-icon-edit',
// disabledCallback: (row, title) => {
// return row.state == '1' ? true : false
// },
disabledCallback: (row, title) => {
return row.state == '1' ? true : false
},
},
{
title: '删除',
......@@ -168,7 +168,6 @@ export default {
* @author: pan
*/
fnOperation(row, title) {
console.log('1111');
switch (title) {
case '编辑':
this.fnEdit(row)
......
......@@ -11,54 +11,55 @@
<div>
<div style="text-align: left; margin-left: 10px">资料清单:</div>
<el-table :data="tableData" stripe border>
<el-table-column
type="index"
label="序号"
width="80"
align="center"
></el-table-column>
<el-table-column
prop="busiFileName"
label="资料类型"
align="center"
></el-table-column>
<el-table-column label="资料名称" align="center">
<template slot-scope="scope">
<el-upload
class="upload-demo"
action="/api/file/oss/upload"
ref="upload"
:on-remove="
(file, fileList) => handleRemove(file, fileList, scope.row)
"
:on-success="
(res, file, fileList) =>
handleFileUploadSuccess(res, file, fileList, scope.row)
"
:limit="1"
:file-list="scope.row.fileUrl ? [scope.row] : []"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</template>
</el-table-column>
</el-table>
<el-table-column
type="index"
label="序号"
width="80"
align="center"
></el-table-column>
<el-table-column
prop="label"
label="资料类型"
align="center"
></el-table-column>
<el-table-column label="资料名称" align="center">
<template slot-scope="scope">
<el-upload
class="upload-demo"
action="/eadc-shared-ability/oss/upload"
ref="upload"
:on-remove="
(file, fileList) => handleRemove(file, fileList, scope.row)
"
:on-success="
(res, file, fileList) =>
handleFileUploadSuccess(res, file, fileList, scope.row)
"
:limit="1"
:file-list="scope.row.fileList"
>
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="fnOperation('save')" size="mini">保 存</el-button>
<el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button @click="fnOperation('save')" size="mini">保 存</el-button>
<el-button type="primary" @click="fnOperation('submit')" size="mini"
>提 交</el-button
>
</span></el-dialog
>
</span>
</el-dialog >
</div>
</template>
<script>
import { materialTypeList, superStateCode } from '@/utils/architectureInspectionDis'
import { editNeedInfo, queryPrjNeedFile } from '@/api'
import { getDictTypeOptions } from '@/utils'
import {
queryProjectInfoManageTable,
editDeleteProjectInfoManageTable,
} from '@/api/index.js'
export default {
props: {
title: {
......@@ -76,7 +77,14 @@ export default {
},
data() {
return {
tableData: [],
tableData: [
// { id: 1, tableLet1: '技术规范书', fileList: [], fileArray: [] },
// { id: 2, tableLet1: '可行性研究报告', fileList: [], fileArray: [] },
// { id: 3, tableLet1: '需求规格说明书', fileList: [], fileArray: [] },
// { id: 4, tableLet1: '概要设计说明书', fileList: [], fileArray: [] },
// { id: 5, tableLet1: '安全防护方案', fileList: [], fileArray: [] },
// { id: 5, tableLet1: '其他', fileList: [], fileArray: [] },
],
}
},
components: {},
......@@ -90,35 +98,56 @@ export default {
},
},
},
mounted() {},
methods: {
getDicts() {
getDictTypeOptions('prj_data').then((res) => {
this.tableData = res.map((v) => {
return {
label: v.label,
value: v.value,
fileList: [],
fileArray: [],
}
})
})
},
fnOperation(type) {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
let params = {
approveState: this.rowData.approveState,
needId: this.rowData.needId,
state: this.rowData.state,
}
if (type === 'save') {
params = {
...params,
state: 2,
}
} else {
params = {
...params,
approveState: 2,
let filesValue = []
this.tableData.forEach((item) => {
if (item.fileArray.length > 0) {
filesValue.push({
busiFileName: item.label,
busiFileType: item.value,
fileId: item.fileArray[0].fileId,
fileName: item.fileArray[0].fileName,
fileUrl: item.fileArray[0].fileUrl,
})
}
})
const params = {
appCode : "b17be13e-4915-42ba-9ae0-cee63780f5b3",
appId : 13,
appName : "我的测试系统-勿动",
buildOrg : 1,
buildType : 1,
manageDeptId : 1,
manageOrgId : 1,
prjId : 28,
prjName : "我的测试项目-勿动",
prjPlanClass : 1,
filesValue,
// prjId: this.rowData.prjCode
}
editNeedInfo(params).then((res) => {
loading.close()
if (res.code === 200) {
editDeleteProjectInfoManageTable(params).then((res) => {
if (res.code == 200) {
loading.close()
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
} else {
......@@ -136,42 +165,50 @@ export default {
},
handleFileUploadSuccess(res, file, fileList, row) {
//文件上传
row = {
fileName: file.name,
fileId: file.response.data.fileId,
fileUrl: file.response.data.viewUrl,
}
console.log('file', row)
row.fileArray = [
{
fileName: file.name,
fileId: file.response.data.fileId,
fileUrl: file.response.data.viewUrl,
},
]
},
// 打开弹框操作
fnQueryPrjNeedFile() {
console.log('this.rowData', this.rowData)
let materialTypeArr = this.rowData.materialType.split(',')
// materialTypeList
let busiFileNameList = []
materialTypeArr.forEach(item => {
let obj = materialTypeList.find(type => type.value == item )
console.log(obj);
busiFileNameList.push(obj.label)
})
// let busiFileNameList = this.rowData.fileList?.split(',')
this.getDicts()
const params = {
busiFileNameList,
busiId: this.rowData.id,
// busiFileNameList: ['技术规范书'],
// busiId: 25,
busiIdType: 1,
prjName: this.rowData.prjName,
}
queryPrjNeedFile(params).then((res) => {
if (res.code === 200) {
this.tableData = res.data.map((v) => {
return {
...v,
name: v.fileName,
url: v.fileUrl,
}
})
console.log(this.tableData);
}
queryProjectInfoManageTable(params).then((res) => {
let filesValue = []
if (res.code == 200) {
let { records } = res.data
filesValue = records.filesValue || []
this.tableData.forEach((item, index) => {
filesValue.forEach((v) => {
if (item.value == v.busiFileType) {
item.fileList = [
{
name: v.busiFileName,
url: v.fileUrl,
fileId: v.fileId,
fileName: v.fileName,
fileUrl: v.fileUrl,
},
]
item.fileArray = [
{
name: v.busiFileName,
url: v.fileUrl,
fileId: v.fileId,
fileName: v.fileName,
fileUrl: v.fileUrl,
},
]
}
})
})
}
})
},
},
......
......@@ -192,18 +192,12 @@ export default {
})
.catch(() => {})
},
// 上传
fnEdit(row) {
// this.dialogTitle = '收集资料配置'
this.rowData = row
this.demandSubVisible = true
// this.visible = true
},
}
}
</script>
<style>
</style>
\ No newline at end of file
</script>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!