Commit a6b4a771 by 史敦盼

批次计划审批和提交,功能重复风险审批

1 parent e16534b4
......@@ -627,3 +627,11 @@ export function exportRiskReport(params) {
export function getByKeword(params) {
return post('/network/prel-des-rvw/getByKeword', params)
}
// 需求管理-新增接口
export function addNeedInfo(params) {
return post('/network/need-info/ad', params)
}
export function editNeedInfo(params) {
return post('/network/need-info/upd', params)
}
......@@ -6,3 +6,9 @@ export const queryConceptualReview = '/network/prel-des-rvw/' ///network/prel-de
export const queryAppArchiControlRequirements =
'/network/app-archi-control-requirements/'
// 需求管理-需求发布分页查询
export const queryDemandManagement = '/network/need-info/'
// 项目列表
export const queryProjectInfo = '/network/prj-info/'
......@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-12 14:55:59
* @LastEditors: pan
* @LastEditTime: 2024-03-18 14:41:17
* @LastEditTime: 2024-03-20 09:29:25
-->
<!-- /**
* 搜索栏公共组件
......@@ -18,16 +18,23 @@
:label-position="labelPosition"
>
<el-col
:span="item.span || 12"
:span="item.span || 8"
v-for="(item, index) in formOptions"
:key="newKeys[index]"
>
<el-form-item :prop="item.prop" :label="item.label" :rules="item.rules">
<SearchFormItem v-model="formData[item.prop]" :itemOptions="item" />
<!-- 自定义插槽,可用于特殊表单块 -->
<template v-if="item.__slotName">
<slot :name="item.__slotName" :data="item"></slot>
</template>
<SearchFormItem
v-else
v-model="formData[item.prop]"
:itemOptions="item"
/>
</el-form-item>
</el-col>
<!-- 自定义插槽,可用于特殊表单块 -->
<slot></slot>
</el-form>
</div>
</template>
......@@ -153,7 +160,8 @@ export default {
}
// el-input宽度
/deep/ .form-item {
.el-input {
.el-input,
.el-select {
width: 100% !important;
}
}
......
......@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-11 14:53:40
* @LastEditors: pan
* @LastEditTime: 2024-03-18 15:42:37
* @LastEditTime: 2024-03-19 20:34:36
-->
<!-- 示例
columns: [{ label: '头像', prop: 'avatar', align: 'center', __slotName: 'avatar',callback: (row, title) => {
......@@ -27,6 +27,7 @@
<template>
<div class="tableConfig">
<el-table
ref="tableConfig"
class="config-table"
v-loading="loading"
v-bind="$attrs"
......@@ -207,6 +208,9 @@ export default {
this.queryData()
},
methods: {
clearSelection() {
this.$refs.tableConfig.clearSelection()
},
handleToText(item, state) {
const obj = item.options.find((v) => v.value == state) || {}
return obj['label']
......
......@@ -114,4 +114,5 @@ $color-primary: #0d867f;
.searchTable {
width: 100%;
height: 100%;
}
......@@ -43,3 +43,13 @@ export const archiPrjReviewEnum = [
{ label: '功能重复风险', value: 'FUNCTION_S_RISK' },
{ label: '数据重复录入风险', value: 'DATA_S_INSERT_RISK' },
]
// 材料清单
export const materialOptions = [
{ label: '技术规范书', value: '技术规范书' },
{ label: '可行性研究报告', value: '可行性研究报告' },
{ label: '需求规格说明书', value: '需求规格说明书' },
{ label: '概要设计说明书', value: '概要设计说明书' },
{ label: '安全防护方案', value: '安全防护方案' },
{ label: '其他', value: '其他' },
]
......@@ -4,7 +4,7 @@
:visible.sync="showDialog"
:close-on-click-modal="false"
width="60%"
@close="handleClose"
@close="handleClose()"
@open="handleOpen"
>
<div>
......@@ -15,7 +15,7 @@
></Form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="showDialog = false" size="mini">取 消</el-button>
<el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button type="primary" @click="handleSubmit" size="mini"
>提 交</el-button
>
......@@ -148,6 +148,17 @@ export default {
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
if (v.prop === 'createTime') {
v.initValue = new Date().format('yyyy-MM-dd')
} else if (v.prop === 'year') {
v.initValue = new Date().format('yyyy')
} else {
v.initValue = ''
}
})
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
handleOpen() {
......@@ -160,7 +171,8 @@ export default {
})
} else {
this.$nextTick(() => {
this.handleClose()
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
})
}
},
......
<template>
<el-dialog
:title="title"
:visible.sync="showDialog"
:close-on-click-modal="false"
width="30%"
@close="handleClose()"
@open="handleOpen"
>
<div>
<template>
<el-radio v-model="radio" :label="3">同意</el-radio>
<el-radio v-model="radio" :label="4">不同意</el-radio>
</template>
<Form
ref="addForm"
:form-options="formOptions"
label-width="120px"
></Form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button type="primary" @click="handleSubmit" size="mini"
>提 交</el-button
>
</span></el-dialog
>
</template>
<script>
import Form from '@/components/Form.vue'
import { editBatchPlan } from '@/api/index.js'
export default {
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
},
data() {
return {
radio: 3,
}
},
components: {
Form,
},
computed: {
formOptions() {
return [
{
label: '意见描述', // label文字
prop: 'remark', // 字段名
type: 'textarea',
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
span: 24,
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
},
mounted() {},
methods: {
handleSubmit() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
const formInfo = this.$refs['addForm'].getData()
const params = {
...this.rowData,
...formInfo,
state: this.radio,
}
editBatchPlan(params).then((res) => {
if (res.code === 200) {
loading.close()
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
} else {
this.$message.error(res.msg)
}
})
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
v.initValue = ''
})
this.radio = 3
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
handleOpen() {
this.$refs['addForm'].onReset()
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/elementui.scss';
</style>
......@@ -36,6 +36,12 @@
:row-data="rowData"
:title="dialogTitle"
></Add>
<ApprovalDialog
:row-data="rowData"
@querySearch="querySearch"
title="审批"
:visible.sync="approvalVisible"
/>
</div>
</template>
......@@ -44,8 +50,9 @@ import ListPage from '@/components/ListPage.vue'
import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/components/TableConfig.vue'
import Add from './Add.vue'
import ApprovalDialog from './ApprovalDialog.vue'
import { getDianXingAnLiSelectData, editBatchPlan } from '@/api/index.js'
import { editBatchPlan } from '@/api/index.js'
import { batchPlanManagement } from '@/api/interface'
import { approvalStatusOptions } from '@/utils/dictionary'
export default {
......@@ -54,10 +61,10 @@ export default {
SearchForm,
TableConfig,
Add,
ApprovalDialog,
},
data() {
return {
constructionTypeOptions: [],
selectRows: [],
query: {
url: batchPlanManagement,
......@@ -67,6 +74,7 @@ export default {
visible: false,
rowData: {},
dialogTitle: '',
approvalVisible: false,
}
},
computed: {
......@@ -151,16 +159,7 @@ export default {
]
},
},
created() {
const params = {
key: 'build_type',
}
getDianXingAnLiSelectData(params).then((res) => {
if (res.code == 200) {
this.constructionTypeOptions = res.data
}
})
},
created() {},
methods: {
// 表格勾选的数据
selectionChange(data) {
......@@ -174,9 +173,9 @@ export default {
this.$refs.searchTable.queryData()
},
fnAdd() {
this.rowData = {}
this.dialogTitle = '新增批次计划'
this.visible = true
this.rowData = {}
},
/**
* @description: 操作按钮
......@@ -192,10 +191,43 @@ export default {
case '删除':
this.fnDel(row)
break
case '提交':
this.fnSubmit(row)
break
case '审批':
this.fnApproval(row)
break
default:
break
}
},
fnApproval(row) {
this.rowData = row
this.approvalVisible = true
},
fnSubmit(row) {
this.$confirm('是否确认提交?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const params = {
...row,
state: 2,
}
console.log(params)
editBatchPlan(params).then((res) => {
if (res.code === 200) {
this.$message.success('提交成功')
this.$refs.searchTable.queryData()
} else {
this.$message.error(res.msg)
}
})
})
.catch(() => {})
},
fnDel(row) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确认',
......
......@@ -75,7 +75,7 @@ export default {
return `经检测,关键字:${this.keyWord},在数据中台数据台账、主数据台账,数据实体类别中,总计重复数`
}
},
resultTitle() {
totalNum() {
let num = 0
for (const key in this.repeatList) {
if (Object.hasOwnProperty.call(this.repeatList, key)) {
......@@ -83,10 +83,13 @@ export default {
num += val
}
}
return `${this.tipsText}:【${num}】`
return num
},
resultTitle() {
return `${this.tipsText}:【${this.totalNum}】`
},
strCancat() {
let str = ''
let str = `关键字:${this.keyWord},总计重复数:${this.totalNum}】 \n`
this.checkList.forEach((v, i) => {
str += `${v.label}:【${v.num}${
i != this.checkList.length ? '\n' : ''
......
......@@ -185,14 +185,14 @@ export default {
},
{
label: '需求名称', // label文字
prop: 'batName1', // 字段名
prop: 'needName', // 字段名
element: 'el-input', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请输入内容', // elementui组件属性
},
{
label: '建设类型', // label文字
prop: 'username3', // 字段名
prop: 'needType', // 字段名
element: 'el-select', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请选择', // elementui组件属性
......@@ -200,7 +200,7 @@ export default {
},
{
label: '项目名称', // label文字
prop: 'batName2', // 字段名
prop: 'prjName', // 字段名
element: 'el-input', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请输入内容', // elementui组件属性
......
<template>
<div>
<el-dialog
:title="title"
:visible.sync="showDialog"
:close-on-click-modal="false"
width="60%"
@close="handleClose()"
@open="handleOpen"
>
<div>
<Form ref="addForm" :form-options="formOptions" label-width="120px">
<!-- 选择项目自定义 -->
<template slot="choosePrj" slot-scope="{ data }">
<el-input v-model="prjName" readonly>
<div slot="append" @click="operation('openChoosePrj', data)">
选择项目
</div>
</el-input>
</template>
</Form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button type="primary" @click="handleSubmit" size="mini"
>提 交</el-button
>
</span></el-dialog
>
<ChoosePrjDialog
@selectData="selectData"
title="选择项目"
:visible.sync="choosePrjVisible"
/>
</div>
</template>
<script>
import Form from '@/components/Form.vue'
import ChoosePrjDialog from './ChoosePrjDialog.vue'
import { addNeedInfo, editNeedInfo } from '@/api'
import { materialOptions } from '@/utils/dictionary'
export default {
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => {},
},
},
data() {
return {
prjName: '',
choosePrjVisible: false,
}
},
components: {
Form,
ChoosePrjDialog,
},
computed: {
formOptions() {
return [
{
label: '批次计划', // label文字
prop: 'batName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '选择项目', // label文字
prop: 'prjName', // 字段名
__slotName: 'choosePrj',
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '需求名称', // label文字
prop: 'needName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '关联机构', // label文字
prop: 'orgName', // 字段名
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
{
label: '材料清单', // label文字
prop: 'filesValue', // 字段名
element: 'el-select', // 指定elementui组件
placeholder: '请选择', // elementui组件属性
options: materialOptions,
multiple: true,
rules: [{ required: true, trigger: 'change', message: '不能为空' }],
},
{
label: '创建人', // label文字
prop: 'createMan', // 字段名
element: 'el-input', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请输入内容', // elementui组件属性
},
{
label: '创建时间', // label文字
prop: 'createTime', // 字段名
type: 'date',
valueFormat: 'yyyy-MM-dd',
element: 'el-date-picker', // 指定elementui组件
initValue: new Date().format('yyyy-MM-dd'), // 字段初始值
placeholder: '请选择', // elementui组件属性
},
{
label: '备注', // label文字
prop: 'remark', // 字段名
type: 'textarea',
element: 'el-input', // 指定elementui组件
placeholder: '请输入内容', // elementui组件属性
span: 24,
rules: [{ required: true, trigger: 'blur', message: '不能为空' }],
},
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
isEdit() {
if (this.title === '修改批次计划') {
return true
} else {
return false
}
},
},
mounted() {},
methods: {
selectData(data) {
this.prjName = data[0].prjName
this.$nextTick(() => {
this.$set(this.$refs['addForm'].formData, 'prjName', this.prjName)
this.$refs['addForm'].$refs['formRef'].clearValidate('prjName')
})
},
operation() {
this.choosePrjVisible = true
},
handleSubmit() {
this.$refs['addForm'].onValidate(() => {
const loading = this.$loading({
lock: true,
text: '保存中',
spinner: 'el-icon-loading',
})
const formInfo = this.$refs['addForm'].getData()
const typeApi = this.isEdit ? editNeedInfo : addNeedInfo
const params = {
...this.rowData,
...formInfo,
state: 1,
}
typeApi(params).then((res) => {
loading.close()
if (res.code === 200) {
this.$message.success('保存成功')
this.showDialog = false
this.handleClose()
this.$emit('querySearch')
} else {
this.$message.error(res.msg)
}
})
})
},
handleClose() {
this.showDialog = false
this.formOptions.forEach((v) => {
if (v.prop === 'createTime') {
v.initValue = new Date().format('yyyy-MM-dd')
} else {
v.initValue = ''
}
})
this.prjName = ''
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
},
handleOpen() {
if (Object.keys(this.rowData).length) {
this.formOptions.forEach((v) => {
v.initValue = this.rowData[v.prop]
})
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
})
} else {
this.$nextTick(() => {
this.$refs['addForm'].addInitValue()
this.$refs['addForm'].onReset()
})
}
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/elementui.scss';
::v-deep .el-input-group__append {
background-color: $color-primary;
color: #fff;
cursor: pointer;
}
</style>
<template>
<el-dialog
title="选择项目"
:visible.sync="showDialog"
:center="false"
:close-on-click-modal="false"
width="80%"
>
<div class="searchTable">
<list-page>
<!-- 查询表单插槽 -->
<template #formWrap>
<SearchForm @onSearch="querySearch" :form-options="formOptions" />
</template>
<!-- 表格插槽 -->
<template #tableWrap>
<table-config
ref="searchTable"
@selection-change="selectionChange"
:query="query"
:columns="columns"
>
</table-config>
</template>
</list-page>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose()" size="mini">取 消</el-button>
<el-button type="primary" @click="handleConfirm()" size="mini"
>确 定</el-button
>
</span></el-dialog
>
</template>
<script>
import ListPage from '@/components/ListPage.vue'
import SearchForm from '@/components/SearchForm.vue'
import TableConfig from '@/components/TableConfig.vue'
import { queryProjectInfo } from '@/api/interface'
import { buildType, prjPlanClass } from '@/utils/dictionary'
export default {
props: {
title: {
type: String,
default: '',
},
visible: {
type: Boolean,
default: false,
},
},
data() {
return {
query: {
url: queryProjectInfo,
method: 'post',
queryParam: {},
},
selectRows: [],
}
},
components: { ListPage, SearchForm, TableConfig },
computed: {
formOptions() {
return [
{
label: '单位', // label文字
prop: 'manageOrgId', // 字段名
element: 'el-input', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请输入内容', // elementui组件属性
},
{
label: '部门', // label文字
prop: 'manageDeptId', // 字段名
element: 'el-input', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请输入内容', // elementui组件属性
},
{
label: '系统名称', // label文字
prop: 'appName', // 字段名
element: 'el-input', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请输入内容', // elementui组件属性
},
{
label: '建设类型', // label文字
prop: 'needType', // 字段名
element: 'el-select', // 指定elementui组件
initValue: '', // 字段初始值
placeholder: '请选择', // elementui组件属性
dictType: 'build_type',
},
]
},
columns() {
return [
{ type: 'selection', width: '55px' },
{ label: '序号', type: 'index', width: '80px' },
{ label: '单位', prop: 'manageOrgId' },
{ label: '部门', prop: 'manageDeptId' },
{ label: '系统名称', prop: 'appName', width: '200px' },
{
label: '建设类型',
width: '100px',
prop: 'buildType',
options: buildType,
collectionType: 'buildType',
},
{
label: '项目名称',
prop: 'prjName',
width: '320px',
},
{
label: '是否续建',
prop: 'prjPlanClass',
options: prjPlanClass,
collectionType: 'prjPlanClass',
},
{ label: '承建单位', prop: 'buildOrg' },
{ label: '项目经理', prop: 'projectManager' },
{ label: '创建人', prop: 'createMan' },
{ label: '创建时间', prop: 'createTime' },
]
},
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
},
mounted() {},
methods: {
clearSelection() {
this.$refs['searchTable'].clearSelection()
},
handleClose() {
this.showDialog = false
this.selectRows = []
this.clearSelection()
},
handleConfirm() {
if (this.selectRows.length === 0) {
return this.$message.warning('请选择至少一条数据')
} else if (this.selectRows.length > 1) {
return this.$message.warning('只能选择一条数据')
}
this.$emit('selectData', this.selectRows)
this.handleClose()
},
// 表格勾选的数据
selectionChange(data) {
console.log('selectionChange', data)
this.selectRows = data
},
querySearch(data) {
this.query.queryParam = {
...this.query.queryParam,
...data,
}
this.$refs.searchTable.queryData()
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/common.scss';
::v-deep .el-dialog__body {
height: 500px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!