From 9d3c76e932ba02327306f7d5050131f0bf2132f1 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 01 四月 2025 17:04:08 +0800
Subject: [PATCH] 完善可靠性计划审批流程
---
src/views/business/reliabilityPlan/plan.vue | 8 ++--
src/views/business/reliabilityPlan/index.vue | 97 ++++++++++++++++++++++++++++++------------------
2 files changed, 64 insertions(+), 41 deletions(-)
diff --git a/src/views/business/reliabilityPlan/index.vue b/src/views/business/reliabilityPlan/index.vue
index 0c08a30..0ff4d4e 100644
--- a/src/views/business/reliabilityPlan/index.vue
+++ b/src/views/business/reliabilityPlan/index.vue
@@ -49,19 +49,21 @@
<el-cascader v-model="proPlanForm.productName" :options="itemParameterData.cascaderField.sample.tree"
:props="{ value: 'name', label: 'name', checkStrictly: false, multiple: false, emitPath: false }"
:show-all-levels="false" clearable filterable placeholder="璇烽�夋嫨浜у搧鍚嶇О" size="small" style="width: 100%;"
- :disabled="operationType === 'review'" @change="handleProductNameChange">
+ :disabled="operationType === 'review' || operationType === 'submit'" @change="handleProductNameChange">
</el-cascader>
</el-form-item>
<el-form-item label="浜у搧鍨嬪彿" prop="productType">
<el-select v-model="proPlanForm.productType" clearable filterable placeholder="璇烽�夋嫨浜у搧鍨嬪彿"
- :disabled="operationType === 'review' || !proPlanForm.productName" style="width: 100%;">
+ :disabled="operationType === 'review' || !proPlanForm.productName || operationType === 'submit'"
+ style="width: 100%;">
<el-option v-for="item in typeOption" :key="item.id" :label="item.modelName" :value="item.modelName">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="闆朵欢鍙�" prop="partNo">
<el-select v-model="proPlanForm.partNo" placeholder="璇烽�夋嫨" clearable filterable
- :disabled="operationType === 'review' || !proPlanForm.productName" style="width: 100%;">
+ :disabled="operationType === 'review' || !proPlanForm.productName || operationType === 'submit'"
+ style="width: 100%;">
<el-option v-for="item in partNoOption" :key="item.id" :label="item.partNo" :value="item.partNo">
</el-option>
</el-select>
@@ -76,12 +78,17 @@
</el-form>
<div slot="footer" class="foot">
<el-button v-if="operationType !== 'review'" @click="closeProDia">鍙� 娑�</el-button>
- <el-button v-if="operationType !== 'review'" type="primary" :loading="submitProLoading" @click="submitProForm">淇�
+ <el-button v-if="operationType !== 'review' && operationType !== 'submit'" type="primary"
+ :loading="submitProLoading" @click="submitProForm">淇�
瀛�</el-button>
+ <el-button v-if="operationType == 'submit'" type="primary" :loading="submitProLoading"
+ @click="submitProForm(1)">鎻� 浜�</el-button>
<el-button v-if="operationType === 'review'" :loading="submitProLoading"
- @click="submitProForm(0)">涓嶉�氳繃</el-button>
+ @click="submitProForm(3)">涓嶉�氳繃</el-button>
<el-button v-if="operationType === 'review'" type="primary" :loading="submitProLoading"
- @click="submitProForm(1)">閫氳繃</el-button>
+ @click="submitProForm(2)">閫氳繃</el-button>
+ <el-button v-if="operationType === 'review'" type="primary" :loading="submitMatLoading"
+ @click="submitProForm(0)">鍙� 鏇�</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="materialDia" title="鍘熻緟鏉愯鍒�">
@@ -90,11 +97,11 @@
<el-cascader v-model="materialForm.materialName" :options="itemParameterData.cascaderField.sample.tree"
:props="{ value: 'name', label: 'name', checkStrictly: false, multiple: false }" :show-all-levels="false"
clearable filterable placeholder="璇烽�夋嫨鍘熻緟鏉愬悕绉�" size="small" style="width: 100%;"
- :disabled="operationType === 'review'"></el-cascader>
+ :disabled="operationType === 'review' || operationType === 'submit'"></el-cascader>
</el-form-item>
<el-form-item label="闆朵欢鍙�" prop="partNo">
<el-input v-model="materialForm.partNo" placeholder="璇峰~鍐欓浂浠跺彿"
- :disabled="operationType === 'review'"></el-input>
+ :disabled="operationType === 'review' || operationType === 'submit'"></el-input>
</el-form-item>
<!-- <el-form-item label="瀹℃牳浜�" prop="reviewerId">
<el-select v-model="proPlanForm.reviewerId" clearable filterable size="small" style="width: 50%;"
@@ -105,13 +112,18 @@
</el-form-item> -->
</el-form>
<div slot="footer" class="foot">
- <el-button v-if="operationType !== 'review'" @click="closeMaterialRulesDia">鍙� 娑�</el-button>
- <el-button v-if="operationType !== 'review'" type="primary" :loading="submitMatLoading"
- @click="submitMaterialRulesForm">淇� 瀛�</el-button>
+ <el-button v-if="operationType !== 'review'" @click="closeMaterialRulesDia">鍙�
+ 娑�</el-button>
+ <el-button v-if="operationType !== 'review' && operationType !== 'submit'" type="primary"
+ :loading="submitMatLoading" @click="submitMaterialRulesForm">淇� 瀛�</el-button>
+ <el-button v-if="operationType == 'submit'" type="primary" :loading="submitProLoading"
+ @click="submitMaterialRulesForm(1)">鎻� 浜�</el-button>
<el-button v-if="operationType === 'review'" :loading="submitMatLoading"
- @click="submitMaterialRulesForm(0)">涓嶉�氳繃</el-button>
+ @click="submitMaterialRulesForm(3)">涓嶉�氳繃</el-button>
<el-button v-if="operationType === 'review'" type="primary" :loading="submitMatLoading"
- @click="submitMaterialRulesForm(1)">閫氳繃</el-button>
+ @click="submitMaterialRulesForm(2)">閫� 杩�</el-button>
+ <el-button v-if="operationType === 'review'" type="primary" :loading="submitMatLoading"
+ @click="submitMaterialRulesForm(0)">鍙� 鏇�</el-button>
</div>
</el-dialog>
</div>
@@ -163,21 +175,25 @@
label: '瀹℃牳鐘舵��',
prop: 'state',
formatData: (params) => {
- if (params == 1) {
+ if (params == 0 || !params) {
+ return '寰呮彁浜�'
+ } else if (params == 1) {
+ return '寰呭鏍�'
+ } else if (params == 2) {
return '閫氳繃'
- } else if (params == 0) {
+ } else if (params == 3) {
return '涓嶉�氳繃'
- } else {
- return null
}
},
formatType: (params) => {
- if (params == 1) {
- return 'success'
- } else if (params == 0) {
+ if (params == 0 || !params) {
+ return 'warning'
+ } else if (params == 1) {
return 'danger'
- } else {
- return null
+ } else if (params == 2) {
+ return 'success'
+ } else if (params == 3) {
+ return 'danger'
}
}
},
@@ -193,7 +209,7 @@
this.openAddDia('edit', row);
},
disabled: (row) => {
- return row.state == 1
+ return row.state > 0
},
},
{
@@ -216,7 +232,7 @@
this.openAddDia('submit', row);
},
disabled: (row) => {
- return row.state == 1
+ return row.state > 0
},
},
{
@@ -233,7 +249,7 @@
this.handleDelete(row);
},
disabled: (row) => {
- return row.state == 1
+ return row.state > 0
},
},
]
@@ -256,21 +272,25 @@
label: '瀹℃牳鐘舵��',
prop: 'state',
formatData: (params) => {
- if (params == 1) {
+ if (params == 0 || !params) {
+ return '寰呮彁浜�'
+ } else if (params == 1) {
+ return '寰呭鏍�'
+ } else if (params == 2) {
return '閫氳繃'
- } else if (params == 0) {
+ } else if (params == 3) {
return '涓嶉�氳繃'
- } else {
- return null
}
},
formatType: (params) => {
- if (params == 1) {
- return 'success'
- } else if (params == 0) {
+ if (params == 0 || !params) {
+ return 'warning'
+ } else if (params == 1) {
return 'danger'
- } else {
- return null
+ } else if (params == 2) {
+ return 'success'
+ } else if (params == 3) {
+ return 'danger'
}
}
},
@@ -284,7 +304,10 @@
type: 'text',
clickFun: (row) => {
this.openAddDia('edit', row);
- }
+ },
+ disabled: (row) => {
+ return row.state > 0
+ },
},
{
name: '璁″垝',
@@ -306,7 +329,7 @@
this.openAddDia('submit', row);
},
disabled: (row) => {
- return row.state == 1
+ return row.state > 0
},
},
{
@@ -323,7 +346,7 @@
this.handleDeleteM(row);
},
disabled: (row) => {
- return row.state == 1
+ return row.state > 0
},
},
]
diff --git a/src/views/business/reliabilityPlan/plan.vue b/src/views/business/reliabilityPlan/plan.vue
index 279d2d2..7434c2c 100644
--- a/src/views/business/reliabilityPlan/plan.vue
+++ b/src/views/business/reliabilityPlan/plan.vue
@@ -3,9 +3,9 @@
<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 type="primary" size="small" @click="openAdd" v-if="planState == 0">鏂板</el-button>
+ <el-button type="primary" size="small" @click="isEdit = true" v-if="planState == 0">缂栬緫</el-button>
+ <el-button type="primary" size="small" @click="save" :loading="saveLoading" v-if="planState == 0">淇濆瓨</el-button>
<el-button size="small" @click="goback">杩斿洖</el-button>
</div>
</div>
@@ -38,7 +38,7 @@
<span v-else>{{ scope.row.address }}</span>
</template>
</el-table-column>
- <el-table-column fixed="right" label="鎿嶄綔" width="100" v-if="planState != 1">
+ <el-table-column fixed="right" label="鎿嶄綔" width="100" v-if="planState == 0">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleDelete(scope.row)" style="color: red;">鍒犻櫎</el-button>
</template>
--
Gitblit v1.9.3