From 9bf2a515f5ede3acd76ac9312132d49b2e97a44c Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 01 四月 2025 16:30:37 +0800
Subject: [PATCH] 可靠性计划详情页编写
---
src/api/standard/standardLibrary.js | 10 ++
src/views/business/reliabilityPlan/plan.vue | 136 ++++++++++++++++++++++++++++++++++
src/views/business/reliabilityPlan/index.vue | 51 ++++++++++++
src/views/performance/manHour/workTimeConfig.vue | 11 +-
src/router/index.js | 20 +++++
5 files changed, 221 insertions(+), 7 deletions(-)
diff --git a/src/api/standard/standardLibrary.js b/src/api/standard/standardLibrary.js
index 785c6fb..3c87f74 100644
--- a/src/api/standard/standardLibrary.js
+++ b/src/api/standard/standardLibrary.js
@@ -92,7 +92,6 @@
});
}
-
// 閫氳繃妫�楠屾爣鍑嗘煡璇㈡楠岄」鐩�
export function selectStandardProductListByMethodId(query) {
return request({
@@ -254,3 +253,12 @@
params: query,
});
}
+
+// 鏍囧噯鏍�--瀹℃牳
+export function productListCheck(data) {
+ return request({
+ url: "/standardTree/productListCheck",
+ method: "post",
+ data: data,
+ });
+}
diff --git a/src/router/index.js b/src/router/index.js
index 804b5d8..89a0732 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -178,6 +178,26 @@
],
},
{
+ // 鍙潬鎬ц鍒�
+ path: "/reliabilityPlan",
+ component: Layout,
+ hidden: true,
+ permissions: ["business:reliabilityPlan"],
+ children: [
+ {
+ // 璁″垝璇︽儏
+ path: "plan",
+ component: () => import("@/views/business/reliabilityPlan/plan"),
+ name: "plan",
+ meta: {
+ title: "璁″垝璇︽儏",
+ activeMenu: "/business/reliabilityPlan",
+ keepAlive: true,
+ },
+ },
+ ],
+ },
+ {
// 鐢ㄦ埛绠$悊
path: "/system/user-auth",
component: Layout,
diff --git a/src/views/business/reliabilityPlan/index.vue b/src/views/business/reliabilityPlan/index.vue
index a9c2486..020e451 100644
--- a/src/views/business/reliabilityPlan/index.vue
+++ b/src/views/business/reliabilityPlan/index.vue
@@ -169,7 +169,33 @@
type: 'text',
clickFun: (row) => {
this.openAddDia('edit', row);
- }
+ },
+ disabled: (row) => {
+ return row.state == 1
+ },
+ },
+ {
+ name: '璁″垝',
+ type: 'text',
+ clickFun: (row) => {
+ this.$router.push({
+ path: "/reliabilityPlan/plan", query: {
+ id: row.id,
+ type: '鎴愬搧',
+ state: row.state
+ }
+ });
+ },
+ },
+ {
+ name: '鎻愪氦',
+ type: 'text',
+ clickFun: (row) => {
+ this.openAddDia('submit', row);
+ },
+ disabled: (row) => {
+ return row.state == 1
+ },
},
{
name: '瀹℃牳',
@@ -239,6 +265,29 @@
}
},
{
+ name: '璁″垝',
+ type: 'text',
+ clickFun: (row) => {
+ this.$router.push({
+ path: "/reliabilityPlan/plan", query: {
+ id: row.id,
+ type: '鍘熻緟鏉�',
+ state: row.state
+ }
+ });
+ },
+ },
+ {
+ name: '鎻愪氦',
+ type: 'text',
+ clickFun: (row) => {
+ this.openAddDia('submit', row);
+ },
+ disabled: (row) => {
+ return row.state == 1
+ },
+ },
+ {
name: '瀹℃牳',
type: 'text',
clickFun: (row) => {
diff --git a/src/views/business/reliabilityPlan/plan.vue b/src/views/business/reliabilityPlan/plan.vue
new file mode 100644
index 0000000..279d2d2
--- /dev/null
+++ b/src/views/business/reliabilityPlan/plan.vue
@@ -0,0 +1,136 @@
+<template>
+ <div class="app-container">
+ <div class="search">
+ <span></span>
+ <div class="btn">
+ <el-button type="primary" size="small" @click="openAdd" v-if="planState != 1">鏂板</el-button>
+ <el-button type="primary" size="small" @click="isEdit = true" v-if="planState != 1">缂栬緫</el-button>
+ <el-button type="primary" size="small" @click="save" :loading="saveLoading" v-if="planState != 1">淇濆瓨</el-button>
+ <el-button size="small" @click="goback">杩斿洖</el-button>
+ </div>
+ </div>
+ <el-table :data="tableData" style="width: 100%">
+ <el-table-column prop="date" label="妫�娴嬮」" width="180">
+ </el-table-column>
+ <el-table-column prop="name" label="娴嬭瘯鏍囧噯" width="180">
+ <template slot-scope="scope">
+ <el-select v-model="scope.row.name" placeholder="璇烽�夋嫨" v-if="isEdit" size="small">
+ <el-option v-for="item in standardList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ <span v-else>{{ scope.row.name }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="address" label="棰戞">
+ <template slot-scope="scope">
+ <el-select v-model="scope.row.name" placeholder="璇烽�夋嫨" v-if="isEdit" size="small">
+ <el-option v-for="item in dict.type.planned_frequency" :key="item.value" :label="item.label"
+ :value="item.value">
+ </el-option>
+ </el-select>
+ <span v-else>{{ scope.row.name }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="address" label="澶囨敞">
+ <template slot-scope="scope">
+ <el-input size="small" placeholder="璇疯緭鍏�" v-model="scope.row.address" v-if="isEdit">
+ </el-input>
+ <span v-else>{{ scope.row.address }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="100" v-if="planState != 1">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" @click="handleDelete(scope.row)" style="color: red;">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-dialog title="鏂板" :visible.sync="addDia" width="500px">
+ <el-form :model="addForm" ref="addForm" :rules="addRules" label-position="right" label-width="120px">
+ <el-form-item label="妫�楠岄」" prop="name">
+ <el-select v-model="addForm.name" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+ <el-option v-for="item in itemList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="娴嬭瘯鏍囧噯" prop="number">
+ <el-select v-model="addForm.name" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+ <el-option v-for="item in standardList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="棰戞" prop="number">
+ <el-select v-model="addForm.name" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+ <el-option v-for="item in dict.type.planned_frequency" :key="item.value" :label="item.label"
+ :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="澶囨敞" prop="number">
+ <el-input size="small" placeholder="璇疯緭鍏�" v-model="addForm.address">
+ </el-input>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addDia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitProduct('addForm')">纭� 璁�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+export default {
+ dicts: ["planned_frequency"],
+ data() {
+ return {
+ tableData: [
+ {}
+ ],
+ isEdit: false,
+ standardList: [],//鏍囧噯鍒楄〃
+ saveLoading: false,
+ addForm: {},
+ addRules: {
+ name: [{ required: true, message: "璇疯緭鍏ユ楠岄」", trigger: "blur" }],
+ },
+ addDia: false,
+ itemList: [],//妫�楠岄」鍒楄〃
+ planId: null,//涓昏鍒掕〃id
+ planType: null,//涓昏鍒掕〃绫诲瀷
+ planState: null,//涓昏鍒掕〃瀹℃牳鐘舵��
+ }
+ },
+ mounted() {
+ const { id, type, state } = this.$route.query
+ this.planId = id;
+ this.planType = type;
+ this.planState = state
+ },
+ methods: {
+ // 鍒犻櫎
+ handleDelete(row) { },
+ // 淇濆瓨
+ save() {
+ this.saveLoading = true;
+ this.isEdit = false
+ },
+ goback() {
+ this.$tab.closePage();
+ },
+ openAdd() {
+ this.addForm = {}
+ this.addDia = true;
+ },
+ submitProduct() { }
+ }
+}
+</script>
+
+<style scoped>
+.search {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 16px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/performance/manHour/workTimeConfig.vue b/src/views/performance/manHour/workTimeConfig.vue
index d02ceba..0d54d8f 100644
--- a/src/views/performance/manHour/workTimeConfig.vue
+++ b/src/views/performance/manHour/workTimeConfig.vue
@@ -5,17 +5,18 @@
<el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
<el-form-item label="缂栧彿" prop="number">
<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.number"
- @keyup.enter.native="refreshTable()"></el-input>
+ @keyup.enter.native="refreshTable()"></el-input>
</el-form-item>
<el-form-item label="瀹為獙瀹�" prop="laboratory">
- <el-select v-model="queryParams.laboratory" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()" clearable>
+ <el-select v-model="queryParams.laboratory" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()"
+ clearable>
<el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="閮ㄩ棬" prop="department">
<el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.department"
- @keyup.enter.native="refreshTable()"></el-input>
+ @keyup.enter.native="refreshTable()"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
@@ -25,7 +26,7 @@
</div>
<div>
<el-button size="small" type="primary" @click="openAdd('鏂板')"
- v-if="checkPermi(['performance:manHour:workTimeConfig:add'])">鏂� 澧�</el-button>
+ v-if="checkPermi(['performance:manHour:workTimeConfig:add'])">鏂� 澧�</el-button>
</div>
</div>
<div class="table">
@@ -275,7 +276,7 @@
})
.then(() => {
deleteAuxiliaryWorkingHours({ id: row.id }).then((res) => {
- if (res.code == 200){
+ if (res.code == 200) {
this.$message.success("鍒犻櫎鎴愬姛");
this.refresh();
}
--
Gitblit v1.9.3