项目管理添加密码校验

This commit is contained in:
cwchen 2024-09-11 18:29:33 +08:00
parent 6a9fb2a8a5
commit 56c8a64a5e
1 changed files with 75 additions and 97 deletions

View File

@ -1,20 +1,9 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input
v-model="listQuery.keyWord"
placeholder="关键字"
style="width: 200px"
class="filter-item"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
<el-button
style="margin-left: 40px"
class="filter-item"
type="primary"
@click="handleFilter"
>
<el-input v-model="listQuery.keyWord" placeholder="关键字" style="width: 200px" class="filter-item" :maxlength="30"
@keyup.enter.native="handleFilter" />
<el-button style="margin-left: 40px" class="filter-item" type="primary" @click="handleFilter">
查询
</el-button>
<el-button class="filter-item" style="margin-left: 10px" type="primary" @click="handleCreate">
@ -22,16 +11,8 @@
</el-button>
</div>
<el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%"
:max-height="tableHeight"
>
<el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%"
:max-height="tableHeight">
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<span>{{ (listQuery.pageNum - 1) * 10 + scope.$index + 1 }}</span>
@ -59,24 +40,14 @@
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize"
@pagination="getList" />
<!-- 编辑模态框-->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="630px" @closed="handleClosedModal">
<el-form
ref="dataForm"
:rules="rules"
:model="temp"
label-position="right"
label-width="150px"
style="height: 550px;overflow-y: scroll;"
>
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="630px"
@closed="handleClosedModal">
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="150px"
style="height: 550px;overflow-y: scroll;">
<el-form-item label="项目名称:" prop="proName">
<el-input v-model="temp.proName" placeholder="项目名称" :maxlength="50" />
</el-form-item>
@ -89,12 +60,7 @@
<el-form-item label="电压等级:" prop="vlotage">
<!-- <el-input v-model="temp.vlotage" placeholder="电压等级" :maxlength="50" /> -->
<el-select v-model="temp.vlotage" placeholder="请选择电压等级" style="width: 100%" clearable>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- <el-form-item label="工程类型:" prop="proType">-->
@ -116,49 +82,24 @@
<el-input v-model="temp.power" placeholder="建设规模-变电" :maxlength="50" />
</el-form-item>
<el-form-item label="计划开始时间:" prop="planStartTime">
<el-date-picker
v-model="temp.planStartTime"
style="width: 100%"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
<el-date-picker v-model="temp.planStartTime" style="width: 100%" type="date" value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
<el-form-item label="实际开始时间:" prop="startTime">
<el-date-picker
v-model="temp.startTime"
style="width: 100%"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
<el-date-picker v-model="temp.startTime" style="width: 100%" type="date" value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
<el-form-item label="计划结束时间:" prop="planEndTime">
<el-date-picker
v-model="temp.planEndTime"
style="width: 100%"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
<el-date-picker v-model="temp.planEndTime" style="width: 100%" type="date" value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
<el-form-item label="实际结束时间:" prop="endTime">
<el-date-picker
v-model="temp.endTime"
style="width: 100%"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
<el-date-picker v-model="temp.endTime" style="width: 100%" type="date" value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
<el-form-item label="投产时间:" prop="tcTime">
<el-date-picker
v-model="temp.tcTime"
style="width: 100%"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
<el-date-picker v-model="temp.tcTime" style="width: 100%" type="date" value-format="yyyy-MM-dd"
placeholder="选择日期" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -168,6 +109,10 @@
</el-button>
</div>
</el-dialog>
<modul-dialog ref="pwdVerifiersDialog" :title="componentDialog.title" :width="componentDialog.width"
v-model="componentDialog.openFalg">
<component :is="componentDialog.modulName" />
</modul-dialog>
</div>
</template>
@ -177,7 +122,8 @@ import _ from 'lodash/fp'
import { getDictSelectList } from '@/api/public'
import { addPMItem, deletePMItem, getPMItemDetail, getPMList, updatePMItem } from '@/api/basic/pm'
import BuildSelect from '@/views/basic/project/components/BuildSelect.vue'
import modulDialog from '@/components/pwdVerifiers/pwdVerifiers.vue'
import { verifyPwd } from '@/api/verifyPwd'
const defaultTmp = {
proName: '',
proNo: '',
@ -196,9 +142,15 @@ const defaultTmp = {
}
export default {
components: { BuildSelect, Pagination },
components: { BuildSelect, Pagination, modulDialog },
data() {
return {
componentDialog: {
modulName: '', //
title: '',
width: '',
openFalg: false
},
tableKey: 0,
list: [],
total: 0,
@ -217,7 +169,7 @@ export default {
update: '编辑',
create: '新增'
},
options:[],
options: [],
rules: {
proName: [{ required: true, message: '不能为空', trigger: 'blur' }],
proNo: [{ required: true, message: '不能为空', trigger: 'blur' }],
@ -240,6 +192,29 @@ export default {
this.getList()
},
methods: {
openModulDialog(title, modulName, width, openFalg) {
this.componentDialog.title = title
this.componentDialog.modulName = modulName
this.componentDialog.width = width
this.componentDialog.openFalg = openFalg
},
verifiersPwd(data) {
verifyPwd(data).then((response) => {
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 500
})
//
this.componentDialog.openFalg = false;
if (this.$refs.pwdVerifiersDialog) {
this.$refs.pwdVerifiersDialog.resetForm();
}
this.commitUpdateData();
})
},
getSelect() {
getDictSelectList(10).then(res => {
this.options = res.data.map(item => {
@ -265,9 +240,9 @@ export default {
})
this.total = response.total
})
setTimeout(()=>{
setTimeout(() => {
this.listLoading = false
},500)
}, 500)
},
//
handleFilter() {
@ -306,25 +281,28 @@ export default {
updateData() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
updatePMItem(this.temp).then((response) => {
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
this.dialogFormVisible = false
})
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
}
})
},
commitUpdateData() {
updatePMItem(this.temp).then((response) => {
this.$message({
showClose: true,
message: response.msg,
type: 'success',
duration: 2000
})
this.getList()
this.dialogFormVisible = false
})
},
//
handleDelete(row, index) {
this.$confirm(`确定要删除该数据吗?`, {
type: 'warning',
title: '操作提示',
beforeClose: async(action, instance, done) => {
beforeClose: async (action, instance, done) => {
if (action === 'confirm') {
deletePMItem({ id: row.id, proNo: row.proNo }).then((response) => {
done()