Commit 624fafa9 by peiqiQQQ

修改

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