|
|
@@ -97,7 +97,7 @@
|
|
|
<div class="equipmentList_box">
|
|
|
<header-title title="设备列表">
|
|
|
<div>
|
|
|
- <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
|
|
|
+ <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary" :disables="hasCategoryId"
|
|
|
@click="handleAdd(ruleIdList, ruleIdListIndex)">新增</el-button>
|
|
|
</div>
|
|
|
</header-title>
|
|
|
@@ -145,6 +145,26 @@
|
|
|
<span>{{ scope.$index + 1 }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="零部件编码" prop="categoryCode" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.isNew">
|
|
|
+ <el-input v-model="scope.row.categoryCode" placeholder="请输入零部件编码"></el-input>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <span>{{ scope.row.categoryCode }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="零部件名称" prop="categoryName" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="scope.row.isNew">
|
|
|
+ <el-input v-model="scope.row.categoryName" placeholder="请输入零部件名称"></el-input>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <span>{{ scope.row.categoryName }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="事项" prop="name" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.row.isNew">
|
|
|
@@ -447,7 +467,10 @@ export default {
|
|
|
taskId: null,
|
|
|
|
|
|
addDialog: false,
|
|
|
- tabsValue: null
|
|
|
+ tabsValue: null,
|
|
|
+
|
|
|
+ hasCategoryId:false,
|
|
|
+ getByIdData:{}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -610,6 +633,8 @@ export default {
|
|
|
},
|
|
|
/* 打开操作手册编辑款 */
|
|
|
openOperationGuideDialogDialog(row, index, isNew) {
|
|
|
+ console.log(isNew,'isNew');
|
|
|
+
|
|
|
if (isNew) {
|
|
|
this.$refs.operationGuideDialog.open(row, index);
|
|
|
}
|
|
|
@@ -621,10 +646,10 @@ export default {
|
|
|
this.ruleIdList[this.ruleIndex].ruleItems.splice(index, 1);
|
|
|
},
|
|
|
addPostscript() {
|
|
|
- console.log(
|
|
|
- 'this.matterRulesList---------------',
|
|
|
- this.matterRulesList
|
|
|
- );
|
|
|
+ // console.log(
|
|
|
+ // 'this.matterRulesList---------------',
|
|
|
+ // this.matterRulesList
|
|
|
+ // );
|
|
|
this.ruleIdList[this.ruleIndex].ruleItems.push({
|
|
|
sort: null,
|
|
|
name: '',
|
|
|
@@ -636,6 +661,7 @@ export default {
|
|
|
toolList: []
|
|
|
}
|
|
|
});
|
|
|
+ console.log(this.ruleIdList,'225')
|
|
|
},
|
|
|
async getInfo(id) {
|
|
|
console.log(id);
|
|
|
@@ -892,7 +918,13 @@ export default {
|
|
|
handleRuleNameChange(val) {
|
|
|
this.ruleId = val;
|
|
|
console.log('val----', val);
|
|
|
- // this._getMatterRulesDetails(val);
|
|
|
+ this.getRulesDetails(val);
|
|
|
+ },
|
|
|
+ async getRulesDetails(val) {
|
|
|
+ const res = await getDetail(val);
|
|
|
+ console.log('res------', res);
|
|
|
+ this.getByIdData=res;
|
|
|
+ this.hasCategoryId = res?.categoryId;
|
|
|
},
|
|
|
// 封装 - 获取规则下面的详情数据及事项
|
|
|
async _getMatterRulesDetails(val) {
|
|
|
@@ -901,6 +933,7 @@ export default {
|
|
|
// console.log('res------', res);
|
|
|
// this.matterRulesList = res.ruleItems;
|
|
|
},
|
|
|
+
|
|
|
async addRule() {
|
|
|
console.log(this.ruleIdList);
|
|
|
console.log(this.ruleId);
|
|
|
@@ -912,6 +945,17 @@ export default {
|
|
|
this.ruleObj.ruleItems = await this._getMatterRulesDetails(
|
|
|
this.ruleId
|
|
|
);
|
|
|
+
|
|
|
+ for (let i = 0; i < this.ruleObj.ruleItems.length; i++) {
|
|
|
+ const id = this.getByIdData?.categoryId;
|
|
|
+ const name = this.getByIdData?.categoryName;
|
|
|
+
|
|
|
+ this.ruleObj.ruleItems[i].categoryId = id;
|
|
|
+ this.ruleObj.ruleItems[i].categoryName = name;
|
|
|
+
|
|
|
+ this.ruleObj.ruleItems[i].isNew=true;
|
|
|
+ }
|
|
|
+
|
|
|
this.ruleIdList.push(deepClone(this.ruleObj));
|
|
|
console.log('this.ruleIdList--------', this.ruleIdList);
|
|
|
this.addDialog = false;
|