|
@@ -8,21 +8,18 @@
|
|
|
width="80%"
|
|
width="80%"
|
|
|
:maxable="true"
|
|
:maxable="true"
|
|
|
>
|
|
>
|
|
|
- <el-form label-width="115px" :model="formData" ref="formRef">
|
|
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ label-width="115px"
|
|
|
|
|
+ :model="formData"
|
|
|
|
|
+ :rules="formRules"
|
|
|
|
|
+ ref="formRef"
|
|
|
|
|
+ >
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
|
|
- label="记录规则分类"
|
|
|
|
|
- prop="classifyId"
|
|
|
|
|
- :rules="{
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请选择记录表分类',
|
|
|
|
|
- trigger: 'change'
|
|
|
|
|
- }"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-form-item label="记录规则类型" prop="classify" required>
|
|
|
<el-select
|
|
<el-select
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- v-model="formData.classifyId"
|
|
|
|
|
|
|
+ v-model="formData.classify"
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
@@ -35,25 +32,28 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="7">
|
|
|
|
|
- <el-form-item label="规则编码" prop="name">
|
|
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="记录规则编码" prop="code">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="formData.code"
|
|
v-model="formData.code"
|
|
|
size="small"
|
|
size="small"
|
|
|
:disabled="true"
|
|
:disabled="true"
|
|
|
|
|
+ placeholder="系统自动生成"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label="规则名称"
|
|
|
|
|
- prop="name"
|
|
|
|
|
- :rules="{
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入规则名称',
|
|
|
|
|
- trigger: 'change'
|
|
|
|
|
- }"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="记录规则版本" prop="version">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ :value="versionText"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ placeholder="系统自动生成"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="记录规则名称" prop="name">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="formData.name"
|
|
v-model="formData.name"
|
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
@@ -62,35 +62,78 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
- <el-col :span="5">
|
|
|
|
|
- <el-form-item label="状态" label-width="70px" required>
|
|
|
|
|
- <el-switch
|
|
|
|
|
- v-model="formData.enable"
|
|
|
|
|
- active-text="生效"
|
|
|
|
|
- inactive-text="失效"
|
|
|
|
|
- :active-value="true"
|
|
|
|
|
- :inactive-value="false"
|
|
|
|
|
- >
|
|
|
|
|
- </el-switch>
|
|
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="启用时间" required prop="startDate">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="formData.startDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择启用时间"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ ></el-date-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
|
|
- <el-form-item label="周期" required>
|
|
|
|
|
- <RuleCycle
|
|
|
|
|
- ref="cycleMultipleRef"
|
|
|
|
|
- :isOnce="true"
|
|
|
|
|
- :formData="formData"
|
|
|
|
|
- pageType="1"
|
|
|
|
|
- :isBindPlan="false"
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="停止时间" required prop="stopDate">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="formData.stopDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择停止时间"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 100%"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="周期" required prop="frequencyValue">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ class="cycle_value"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ v-model.number="formData.frequencyValue"
|
|
|
|
|
+ placeholder="请输入频率数值"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item required prop="frequencyUnit" label-width="0">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="formData.frequencyUnit"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ placeholder="请选择频率单位"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in recordRulesFrequency"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col v-if="formData.classify == 3" :span="8">
|
|
|
|
|
+ <el-form-item label="关联设备" prop="deviceName" required>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="formData.deviceName"
|
|
|
|
|
+ placeholder="请选择设备"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :readonly="true"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #append>
|
|
|
|
|
+ <el-button size="small" @click="selectDeviceId"
|
|
|
|
|
+ >选择设备</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
ref="table"
|
|
|
:columns="bankColumns"
|
|
:columns="bankColumns"
|
|
|
- :datasource="formData.ruleItems"
|
|
|
|
|
- :toolkit="[]"
|
|
|
|
|
|
|
+ :datasource="formData.recordRulesDetailList"
|
|
|
:need-page="false"
|
|
:need-page="false"
|
|
|
row-key="id"
|
|
row-key="id"
|
|
|
class="table_list"
|
|
class="table_list"
|
|
@@ -101,77 +144,174 @@
|
|
|
type="primary"
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
icon="el-icon-plus"
|
|
|
class="ele-btn-icon"
|
|
class="ele-btn-icon"
|
|
|
- @click="add({})"
|
|
|
|
|
|
|
+ @click="addRow"
|
|
|
>
|
|
>
|
|
|
新建
|
|
新建
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:tools="{ row }">
|
|
|
|
|
- <div
|
|
|
|
|
- style="display: inline-block"
|
|
|
|
|
- v-for="(item, idx) in row.tools"
|
|
|
|
|
- :key="idx"
|
|
|
|
|
- >{{ item.name }}
|
|
|
|
|
- <span v-if="row.tools && idx != row.tools.length - 1">, </span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <template v-slot:paramType="{ row }">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="row.paramType"
|
|
|
|
|
+ placeholder="请选择参数类型"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ required
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label="数值" :value="1" />
|
|
|
|
|
+ <el-option label="选择" :value="2" />
|
|
|
|
|
+ <el-option label="上下限" :value="3" />
|
|
|
|
|
+ <el-option label="规格" :value="4" />
|
|
|
|
|
+ <el-option label="时间" :value="5" />
|
|
|
|
|
+ <el-option label="范围" :value="6" />
|
|
|
|
|
+ <el-option label="文本" :value="7" />
|
|
|
|
|
+ <!-- <el-option label="枚举" :value="8" /> -->
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template v-slot:paramValue="{ row }">
|
|
|
|
|
+ <!-- 根据参数类型渲染不同的输入组件 -->
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="row.paramValue"
|
|
|
|
|
+ placeholder="请输入参数内容"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:defaultValue="{ row }">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <!-- <el-select
|
|
|
|
|
+ v-if="row.paramType != 7"
|
|
|
|
|
+ v-model="row.symbol"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label=">" value=">"> </el-option>
|
|
|
|
|
+ <el-option label="<" value="<"> </el-option>
|
|
|
|
|
+ <el-option label="!=" value="!="> </el-option>
|
|
|
|
|
+ <el-option label=">=" value=">="> </el-option>
|
|
|
|
|
+ <el-option label="<=" value="<="> </el-option>
|
|
|
|
|
+ <el-option label="~~" value="~~"> </el-option>
|
|
|
|
|
+ <el-option label="+-" value="+-"> </el-option>
|
|
|
|
|
+ <el-option label="......" value="......"> </el-option>
|
|
|
|
|
+ </el-select> -->
|
|
|
|
|
+ <DictSelection
|
|
|
|
|
+ v-if="row.paramType != 7"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ dictName="数学字符"
|
|
|
|
|
+ v-model="row.numberOperator"
|
|
|
|
|
+ placeholder="请选择逻辑"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></DictSelection>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="row.paramType != 7 ? 12 : 24">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="row.defaultValue"
|
|
|
|
|
+ placeholder="请输入默认值"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:maxValue="{ row }">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="row.paramType == 3 || row.paramType == 6"
|
|
|
|
|
+ v-model="row.maxValue"
|
|
|
|
|
+ placeholder="请输入参数上限"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:minValue="{ row }">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="row.paramType == 3 || row.paramType == 6"
|
|
|
|
|
+ v-model="row.minValue"
|
|
|
|
|
+ placeholder="请输入参数下限"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:unitName="{ row }">
|
|
|
|
|
+ <!-- <el-input
|
|
|
|
|
+ v-model="row.unitName"
|
|
|
|
|
+ placeholder="请输入参数单位"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input> -->
|
|
|
|
|
+ <DictSelection
|
|
|
|
|
+ v-if="row.paramType != 7"
|
|
|
|
|
+ dictName="工艺参数单位"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ v-model="row.unitName"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ >
|
|
|
|
|
+ </DictSelection>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:toolName="{ row }">
|
|
|
|
|
+ <el-link :underline="false" style="cursor: pointer">
|
|
|
|
|
+ <div class="ele-cell">
|
|
|
|
|
+ <!-- class="ele-elip" style="width: 90px" -->
|
|
|
|
|
+ <div @click="handleAdd(row)">
|
|
|
|
|
+ {{
|
|
|
|
|
+ row.tools && row.tools.length > 0
|
|
|
|
|
+ ? row.tools.map((i) => i.toolName).join(',')
|
|
|
|
|
+ : '请选择'
|
|
|
|
|
+ }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <i
|
|
|
|
|
+ v-if="row.tools.length == 0"
|
|
|
|
|
+ class="el-icon-arrow-down"
|
|
|
|
|
+ @click="handleAdd(row)"
|
|
|
|
|
+ ></i>
|
|
|
|
|
+ <i v-else class="el-icon-close" @click="clearTool(row)"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:toolCodes="{ row }">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ :value="
|
|
|
|
|
+ row.tools && row.tools.length > 0
|
|
|
|
|
+ ? row.tools.map((i) => i.toolCode).join(',')
|
|
|
|
|
+ : ''
|
|
|
|
|
+ "
|
|
|
|
|
+ placeholder="工具自动带出"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:textType="{ row }">
|
|
|
|
|
- {{
|
|
|
|
|
- row.textType == 1
|
|
|
|
|
- ? '数值'
|
|
|
|
|
- : row.textType == 2
|
|
|
|
|
- ? '选择'
|
|
|
|
|
- : row.textType == 3
|
|
|
|
|
- ? '上下限'
|
|
|
|
|
- : row.textType == 4
|
|
|
|
|
- ? '规格'
|
|
|
|
|
- : row.textType == 5
|
|
|
|
|
- ? '时间'
|
|
|
|
|
- : row.textType == 6
|
|
|
|
|
- ? '范围'
|
|
|
|
|
- : row.textType == 7
|
|
|
|
|
- ? '文本'
|
|
|
|
|
- : row.textType == 8
|
|
|
|
|
- ? '枚举'
|
|
|
|
|
- : ''
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ <template v-slot:remark="{ row }">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="row.remark"
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:action="{ row, $index }">
|
|
|
|
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
<el-link
|
|
<el-link
|
|
|
- type="primary"
|
|
|
|
|
- @click="edit(row, $index)"
|
|
|
|
|
|
|
+ type="danger"
|
|
|
:underline="false"
|
|
:underline="false"
|
|
|
- icon="el-icon-edit"
|
|
|
|
|
- >编辑</el-link
|
|
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ @click="deleteRow(row)"
|
|
|
>
|
|
>
|
|
|
- <el-popconfirm
|
|
|
|
|
- class="ele-action"
|
|
|
|
|
- title="确定要删除当前数据吗?"
|
|
|
|
|
- @confirm="itemDel($index)"
|
|
|
|
|
- >
|
|
|
|
|
- <template v-slot:reference>
|
|
|
|
|
- <el-link type="danger" :underline="false" icon="el-icon-delete"
|
|
|
|
|
- >删除</el-link
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-popconfirm>
|
|
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-link>
|
|
|
</template>
|
|
</template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
- <operation-guideDialog ref="operationGuideDialog" @save="saveEdit" />
|
|
|
|
|
- <Details
|
|
|
|
|
- ref="userEdit"
|
|
|
|
|
- :visible.sync="showEdit"
|
|
|
|
|
- :data="current"
|
|
|
|
|
- :dataIndex="dataIndex"
|
|
|
|
|
- @done="save"
|
|
|
|
|
- />
|
|
|
|
|
<template v-slot:footer>
|
|
<template v-slot:footer>
|
|
|
- <el-button :loading="btnLoading" @click="handleClose">取消</el-button>
|
|
|
|
|
|
|
+ <el-button :loading="btnLoading" type="primary" @click="saveAndPublish">
|
|
|
|
|
+ 保存并发布
|
|
|
|
|
+ </el-button>
|
|
|
<el-button :loading="btnLoading" type="primary" @click="confirm">
|
|
<el-button :loading="btnLoading" type="primary" @click="confirm">
|
|
|
保存
|
|
保存
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button :loading="btnLoading" @click="handleClose">取消</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
|
|
+ <ProductModal ref="productRefs" @chooseModal="chooseModal" />
|
|
|
|
|
+
|
|
|
|
|
+ <MaterialAdd
|
|
|
|
|
+ ref="deviceSelectDialog"
|
|
|
|
|
+ selectType="single"
|
|
|
|
|
+ @chooseEquipment="chooseEquipment"
|
|
|
|
|
+ />
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -181,26 +321,36 @@
|
|
|
import RuleCycle from './rule-cycle.vue';
|
|
import RuleCycle from './rule-cycle.vue';
|
|
|
import OperationGuideDialog from '@/views/rulesManagement/matterRules/components/operationGuideDialog.vue';
|
|
import OperationGuideDialog from '@/views/rulesManagement/matterRules/components/operationGuideDialog.vue';
|
|
|
import Details from './details.vue';
|
|
import Details from './details.vue';
|
|
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
+ import ProductModal from './ProductModal.vue';
|
|
|
|
|
+ import MaterialAdd from '../../components/MaterialAdd.vue';
|
|
|
import {
|
|
import {
|
|
|
- releasePermitRules,
|
|
|
|
|
- updatePermitRules
|
|
|
|
|
- } from '@/api/releasePermitRules/index';
|
|
|
|
|
|
|
+ recordrulesSave,
|
|
|
|
|
+ recordrulesDetailPage,
|
|
|
|
|
+ recordrulesUpdate,
|
|
|
|
|
+ recordrulesPublish,
|
|
|
|
|
+ recordrulesSaveAndPublish,
|
|
|
|
|
+ recordrulesUpdateVersion
|
|
|
|
|
+ } from '@/api/recordrules/index';
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
- components: { OperationGuideDialog, RuleCycle, Details },
|
|
|
|
|
|
|
+ components: {
|
|
|
|
|
+ OperationGuideDialog,
|
|
|
|
|
+ RuleCycle,
|
|
|
|
|
+ Details,
|
|
|
|
|
+ ProductModal,
|
|
|
|
|
+ MaterialAdd
|
|
|
|
|
+ },
|
|
|
|
|
+ mixins: [dictMixins],
|
|
|
computed: {
|
|
computed: {
|
|
|
bankColumns() {
|
|
bankColumns() {
|
|
|
return [
|
|
return [
|
|
|
{
|
|
{
|
|
|
- prop: 'name',
|
|
|
|
|
- label: '参数名称',
|
|
|
|
|
|
|
+ width: 110,
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ columnKey: 'index',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- minWidth: 130
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'code',
|
|
|
|
|
- label: '参数编码',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- minWidth: 130
|
|
|
|
|
|
|
+ label: '序号'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'paramType',
|
|
prop: 'paramType',
|
|
@@ -210,56 +360,75 @@
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'defaultVal',
|
|
|
|
|
|
|
+ prop: 'paramValue',
|
|
|
|
|
+ label: '参数内容',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'paramValue',
|
|
|
|
|
+ minWidth: 180
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'defaultValue',
|
|
|
label: '默认值',
|
|
label: '默认值',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
|
|
+ slot: 'defaultValue',
|
|
|
|
|
+ minWidth: 150
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
{
|
|
{
|
|
|
- prop: 'upperLimit',
|
|
|
|
|
|
|
+ prop: 'maxValue',
|
|
|
label: '参数上限',
|
|
label: '参数上限',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
|
|
+ slot: 'maxValue',
|
|
|
|
|
+ minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- slot: 'lowerLimit',
|
|
|
|
|
|
|
+ prop: 'minValue',
|
|
|
label: '参数下限',
|
|
label: '参数下限',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
|
|
+ slot: 'minValue',
|
|
|
|
|
+ minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'paramUnit',
|
|
|
|
|
|
|
+ prop: 'unitName',
|
|
|
label: '参数单位',
|
|
label: '参数单位',
|
|
|
- align: 'center'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'unitName',
|
|
|
|
|
+ minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- prop: 'tools',
|
|
|
|
|
- slot: 'tools',
|
|
|
|
|
|
|
+ prop: 'toolName',
|
|
|
label: '工具名称',
|
|
label: '工具名称',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- minWidth: 150
|
|
|
|
|
|
|
+ slot: 'toolName',
|
|
|
|
|
+ minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: '状态',
|
|
|
|
|
- prop: 'enable',
|
|
|
|
|
- formatter: (row, column, cellValue) => {
|
|
|
|
|
- return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ prop: 'toolCodes',
|
|
|
|
|
+ label: '工具编码',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'toolCodes',
|
|
|
|
|
+ minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ prop: 'remark',
|
|
|
label: '备注',
|
|
label: '备注',
|
|
|
- prop: 'remarks'
|
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ slot: 'remark',
|
|
|
|
|
+ minWidth: 110
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
columnKey: 'action',
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
label: '操作',
|
|
|
- width: 140,
|
|
|
|
|
|
|
+ width: 110,
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
resizable: false,
|
|
resizable: false,
|
|
|
slot: 'action'
|
|
slot: 'action'
|
|
|
}
|
|
}
|
|
|
];
|
|
];
|
|
|
|
|
+ },
|
|
|
|
|
+ versionText() {
|
|
|
|
|
+ return this.formData.version
|
|
|
|
|
+ ? `V${this.formData.version.toFixed(1)}`
|
|
|
|
|
+ : 'V1.0';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -267,21 +436,81 @@
|
|
|
dialogTitle: '',
|
|
dialogTitle: '',
|
|
|
visible: false,
|
|
visible: false,
|
|
|
formData: {
|
|
formData: {
|
|
|
- ruleItems: [],
|
|
|
|
|
- classifyId: '',
|
|
|
|
|
- code: '',
|
|
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ classify: null,
|
|
|
|
|
+ deviceId: null,
|
|
|
|
|
+ deviceName: '',
|
|
|
|
|
+ frequencyUnit: null,
|
|
|
|
|
+ frequencyValue: null,
|
|
|
name: '',
|
|
name: '',
|
|
|
- enable: true
|
|
|
|
|
|
|
+ recordRulesDetailList: [
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ defaultValue: '',
|
|
|
|
|
+ maxValue: null,
|
|
|
|
|
+ minValue: null,
|
|
|
|
|
+ paramType: null,
|
|
|
|
|
+ paramValue: null,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ symbol: null,
|
|
|
|
|
+ tools: [],
|
|
|
|
|
+ unitName: null
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ startDate: null,
|
|
|
|
|
+ stopDate: null,
|
|
|
|
|
+ version: 1,
|
|
|
|
|
+ code: '',
|
|
|
|
|
+ fromId: null
|
|
|
|
|
+ },
|
|
|
|
|
+ formRules: {
|
|
|
|
|
+ name: [
|
|
|
|
|
+ { required: true, message: '请输入规则名称', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ frequencyValue: [
|
|
|
|
|
+ { required: true, message: '请输入频率数值', trigger: 'blur' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ frequencyUnit: [
|
|
|
|
|
+ { required: true, message: '请选择频率单位', trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ classify: [
|
|
|
|
|
+ { required: true, message: '请选择规则类型', trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ // startDate 启用时间要大于当前时间
|
|
|
|
|
+ // stopDate 停用时间要大于当前时间并且大于启用时间
|
|
|
|
|
+ startDate: [
|
|
|
|
|
+ { required: true, message: '请选择启用时间', trigger: 'change' },
|
|
|
|
|
+ { validator: this.validateStartDate, trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ stopDate: [
|
|
|
|
|
+ { required: true, message: '请选择停用时间', trigger: 'change' },
|
|
|
|
|
+ { validator: this.validateStopDate, trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ deviceName: [
|
|
|
|
|
+ { required: true, message: '请输入选择设备', trigger: 'blur' }
|
|
|
|
|
+ ]
|
|
|
},
|
|
},
|
|
|
recordSheet: [], // 记录表
|
|
recordSheet: [], // 记录表
|
|
|
current: {},
|
|
current: {},
|
|
|
dataIndex: null,
|
|
dataIndex: null,
|
|
|
showEdit: false,
|
|
showEdit: false,
|
|
|
- btnLoading: false
|
|
|
|
|
|
|
+ btnLoading: false,
|
|
|
|
|
+ recordRulesFrequency: [],
|
|
|
|
|
+ currentRow: null
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getByCodeData();
|
|
this.getByCodeData();
|
|
|
|
|
+
|
|
|
|
|
+ this.requestDict('记录规则频率').then(() => {
|
|
|
|
|
+ if (this.$store.state.dict['record_rules_frequency']) {
|
|
|
|
|
+ this.recordRulesFrequency = this.$store.state.dict[
|
|
|
|
|
+ 'record_rules_frequency'
|
|
|
|
|
+ ].map((i) => {
|
|
|
|
|
+ return { label: i.dictValue, value: Number(i.dictCode) };
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
open(row, type, title) {
|
|
open(row, type, title) {
|
|
@@ -289,11 +518,37 @@
|
|
|
this.dialogTitle = title;
|
|
this.dialogTitle = title;
|
|
|
this.type = type;
|
|
this.type = type;
|
|
|
console.log('type', type, row);
|
|
console.log('type', type, row);
|
|
|
|
|
+
|
|
|
if (type == 'edit') {
|
|
if (type == 'edit') {
|
|
|
- this.$util.assignObject(this.formData, this.$util.deepClone(row));
|
|
|
|
|
- // string 转换 number
|
|
|
|
|
- this.formData.classifyId = Number(row.classifyId);
|
|
|
|
|
- console.log('this.formData', this.formData);
|
|
|
|
|
|
|
+ this.$util.assignObject(this.formData, row);
|
|
|
|
|
+
|
|
|
|
|
+ this.formData.startDate = new Date(row.startDate);
|
|
|
|
|
+ this.formData.stopDate = new Date(row.stopDate);
|
|
|
|
|
+
|
|
|
|
|
+ this.recordrulesDetailPage(row);
|
|
|
|
|
+
|
|
|
|
|
+ console.log('this.formData', this.formData, this.formData.version);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (type == 'clone') {
|
|
|
|
|
+ this.$util.assignObject(this.formData, row);
|
|
|
|
|
+
|
|
|
|
|
+ this.formData.name = this.formData.name + '-副本';
|
|
|
|
|
+ this.formData.version += 1;
|
|
|
|
|
+
|
|
|
|
|
+ this.formData.fromId = row.id;
|
|
|
|
|
+ this.formData.id = null;
|
|
|
|
|
+ this.formData.startDate = new Date(row.stopDate);
|
|
|
|
|
+ this.formData.stopDate = new Date('2099-12-31 00:00:00');
|
|
|
|
|
+
|
|
|
|
|
+ this.recordrulesDetailPage(row);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (type == 'add') {
|
|
|
|
|
+ this.formData.version = 1;
|
|
|
|
|
+
|
|
|
|
|
+ // 停用日期 默认为 2099-12-31
|
|
|
|
|
+ this.formData.stopDate = new Date('2099-12-31 00:00:00');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async getByCodeData() {
|
|
async getByCodeData() {
|
|
@@ -301,26 +556,23 @@
|
|
|
let list = res.data.map((item) => {
|
|
let list = res.data.map((item) => {
|
|
|
let values = Object.keys(item);
|
|
let values = Object.keys(item);
|
|
|
return {
|
|
return {
|
|
|
- value: Number(values[0]),
|
|
|
|
|
|
|
+ value: values[0],
|
|
|
label: item[values[0]]
|
|
label: item[values[0]]
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
this.recordSheet = list;
|
|
this.recordSheet = list;
|
|
|
- console.log('this.recordSheet', this.recordSheet);
|
|
|
|
|
- },
|
|
|
|
|
- add(row) {
|
|
|
|
|
- this.current = row;
|
|
|
|
|
- this.showEdit = true;
|
|
|
|
|
- this.$refs.userEdit.$refs.form &&
|
|
|
|
|
- this.$refs.userEdit.$refs.form.clearValidate();
|
|
|
|
|
},
|
|
},
|
|
|
// 保存数据
|
|
// 保存数据
|
|
|
save(data, idx) {
|
|
save(data, idx) {
|
|
|
if (idx || idx === 0) {
|
|
if (idx || idx === 0) {
|
|
|
- this.$set(this.formData.ruleItems, idx, data);
|
|
|
|
|
|
|
+ this.$set(this.formData.recordRulesDetailList, idx, data);
|
|
|
} else {
|
|
} else {
|
|
|
- this.formData.ruleItems.push(data);
|
|
|
|
|
|
|
+ this.formData.recordRulesDetailList.push(data);
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(
|
|
|
|
|
+ 'this.formData.recordRulesDetailList',
|
|
|
|
|
+ this.formData.recordRulesDetailList
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
edit(row, index) {
|
|
edit(row, index) {
|
|
|
this.current = row;
|
|
this.current = row;
|
|
@@ -330,65 +582,214 @@
|
|
|
this.$refs.userEdit.$refs.form.clearValidate();
|
|
this.$refs.userEdit.$refs.form.clearValidate();
|
|
|
},
|
|
},
|
|
|
itemDel(index) {
|
|
itemDel(index) {
|
|
|
- this.formData.ruleItems.splice(index, 1);
|
|
|
|
|
|
|
+ this.formData.recordRulesDetailList.splice(index, 1);
|
|
|
},
|
|
},
|
|
|
/* 打开操作手册编辑款 */
|
|
/* 打开操作手册编辑款 */
|
|
|
openOperationGuideDialogDialog(row, index) {
|
|
openOperationGuideDialogDialog(row, index) {
|
|
|
this.$refs.operationGuideDialog.open(row, index);
|
|
this.$refs.operationGuideDialog.open(row, index);
|
|
|
},
|
|
},
|
|
|
- saveEdit(data, index) {
|
|
|
|
|
- this.$set(this.formData.ruleItems[index], 'operationGuide', data);
|
|
|
|
|
- },
|
|
|
|
|
handleClose() {
|
|
handleClose() {
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
this.$refs['formRef'].resetFields();
|
|
this.$refs['formRef'].resetFields();
|
|
|
// 清空表单数据
|
|
// 清空表单数据
|
|
|
this.formData = {
|
|
this.formData = {
|
|
|
- ruleItems: [],
|
|
|
|
|
- classifyId: '',
|
|
|
|
|
- code: '',
|
|
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ classify: null,
|
|
|
|
|
+ deviceId: null,
|
|
|
|
|
+ deviceName: '',
|
|
|
|
|
+ frequencyUnit: null,
|
|
|
|
|
+ frequencyValue: null,
|
|
|
name: '',
|
|
name: '',
|
|
|
- enable: true
|
|
|
|
|
|
|
+ recordRulesDetailList: [
|
|
|
|
|
+ {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ defaultValue: '',
|
|
|
|
|
+ maxValue: null,
|
|
|
|
|
+ minValue: null,
|
|
|
|
|
+ paramType: null,
|
|
|
|
|
+ paramValue: null,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ symbol: null,
|
|
|
|
|
+ toolCodes: null,
|
|
|
|
|
+ tools: []
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ startDate: null,
|
|
|
|
|
+ stopDate: null,
|
|
|
|
|
+ version: 1,
|
|
|
|
|
+ code: '',
|
|
|
|
|
+ fromId: null
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ // 保存
|
|
|
confirm() {
|
|
confirm() {
|
|
|
- if (!this.formData.cycleValue || !this.formData.cycleType) {
|
|
|
|
|
- return this.$message.warning('请填写周期参数');
|
|
|
|
|
- }
|
|
|
|
|
- if (this.formData.ruleItems.length == 0) {
|
|
|
|
|
- return this.$message.warning('至少条件一条规则项');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ console.log('this.formData', this.formData);
|
|
|
|
|
|
|
|
- this.$refs.formRef.validate((valid) => {
|
|
|
|
|
|
|
+ // 验证表单规则
|
|
|
|
|
+ this.$refs.formRef.validate(async (valid) => {
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- let data = {
|
|
|
|
|
- name: this.formData.name,
|
|
|
|
|
- classifyId: this.formData.classifyId,
|
|
|
|
|
- enable: this.formData.enable,
|
|
|
|
|
- frequencyUnit: this.formData.cycleType,
|
|
|
|
|
- frequencyValue: this.formData.cycleValue,
|
|
|
|
|
- items: this.formData.ruleItems
|
|
|
|
|
- };
|
|
|
|
|
- let cycle = this.$refs.cycleMultipleRef.ruleCycleList;
|
|
|
|
|
- if (cycle.length > 0) {
|
|
|
|
|
- data.frequencyTimes = cycle;
|
|
|
|
|
|
|
+ if (this.formData.recordRulesDetailList.length == 0) {
|
|
|
|
|
+ return this.$message.warning('至少条件一条规则项');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.btnLoading = true;
|
|
|
|
|
+
|
|
|
|
|
+ const body = { ...this.formData };
|
|
|
|
|
+
|
|
|
|
|
+ body.startDate = this.$util.toDateString(
|
|
|
|
|
+ body.startDate,
|
|
|
|
|
+ 'yyyy-MM-dd HH:mm:ss'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ body.stopDate = this.$util.toDateString(
|
|
|
|
|
+ body.stopDate,
|
|
|
|
|
+ 'yyyy-MM-dd HH:mm:ss'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ if (this.type == 'add') {
|
|
|
|
|
+ await recordrulesSave(body);
|
|
|
|
|
+ } else if (this.type == 'clone') {
|
|
|
|
|
+ await recordrulesUpdateVersion(body);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 编辑
|
|
|
|
|
+ body.fromId = null;
|
|
|
|
|
+ await recordrulesUpdate(body);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
|
+
|
|
|
|
|
+ this.handleClose();
|
|
|
|
|
+ this.$emit('reload');
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 保存并发布
|
|
|
|
|
+ saveAndPublish() {
|
|
|
|
|
+ // 验证表单规则
|
|
|
|
|
+ this.$refs.formRef.validate(async (valid) => {
|
|
|
|
|
+ if (!valid) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.formData.recordRulesDetailList.length == 0) {
|
|
|
|
|
+ return this.$message.warning('至少条件一条规则项');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ this.btnLoading = true;
|
|
|
|
|
+
|
|
|
|
|
+ const body = { ...this.formData };
|
|
|
|
|
+
|
|
|
|
|
+ body.startDate = this.$util.toDateString(
|
|
|
|
|
+ body.startDate,
|
|
|
|
|
+ 'yyyy-MM-dd HH:mm:ss'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ body.stopDate = this.$util.toDateString(
|
|
|
|
|
+ body.stopDate,
|
|
|
|
|
+ 'yyyy-MM-dd HH:mm:ss'
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ await recordrulesSaveAndPublish(body);
|
|
|
|
|
+
|
|
|
|
|
+ this.btnLoading = false;
|
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
|
+
|
|
|
|
|
+ this.handleClose();
|
|
|
|
|
+ this.$emit('reload');
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.btnLoading = false;
|
|
|
}
|
|
}
|
|
|
- this.btnLoading = true;
|
|
|
|
|
- releasePermitRules(data)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- this.btnLoading = false;
|
|
|
|
|
- if (res) {
|
|
|
|
|
- this.$message.success('操作成功');
|
|
|
|
|
- this.handleClose();
|
|
|
|
|
- this.$emit('reload');
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch((err) => {
|
|
|
|
|
- this.btnLoading = false;
|
|
|
|
|
- });
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ // startDate 启用时间要大于当前时间
|
|
|
|
|
+ validateStartDate(rule, value, callback) {
|
|
|
|
|
+ const startDate = this.formData.startDate;
|
|
|
|
|
+ if (!startDate) {
|
|
|
|
|
+ return callback(new Error('启用时间不能为空'));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ callback();
|
|
|
|
|
+ },
|
|
|
|
|
+ // stopDate 停用时间要大于当前时间并且大于启用时间
|
|
|
|
|
+ validateStopDate(rule, value, callback) {
|
|
|
|
|
+ const startDate = this.formData.startDate;
|
|
|
|
|
+ const stopDate = this.formData.stopDate;
|
|
|
|
|
+ if (
|
|
|
|
|
+ stopDate &&
|
|
|
|
|
+ startDate &&
|
|
|
|
|
+ new Date(stopDate) <= new Date(startDate)
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return callback(new Error('停用时间必须大于启用时间'));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ callback();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 去选择设备
|
|
|
|
|
+ selectDeviceId() {
|
|
|
|
|
+ this.$refs.deviceSelectDialog.open([]);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 选择设备回调
|
|
|
|
|
+ chooseEquipment(data, index, categoryId) {
|
|
|
|
|
+ console.log('data', data, index, categoryId);
|
|
|
|
|
+ this.formData.deviceId = data[0]?.id || null;
|
|
|
|
|
+ this.formData.deviceName = data[0]?.name || '';
|
|
|
|
|
+ },
|
|
|
|
|
+ // 添加
|
|
|
|
|
+ addRow() {
|
|
|
|
|
+ this.formData.recordRulesDetailList.push({
|
|
|
|
|
+ id: new Date().getTime(),
|
|
|
|
|
+ defaultValue: '',
|
|
|
|
|
+ maxValue: null,
|
|
|
|
|
+ minValue: null,
|
|
|
|
|
+ paramType: null,
|
|
|
|
|
+ paramValue: null,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ symbol: null,
|
|
|
|
|
+ tools: [],
|
|
|
|
|
+ unitName: null
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ deleteRow(row) {
|
|
|
|
|
+ const index = this.formData.recordRulesDetailList.indexOf(row);
|
|
|
|
|
+ if (index !== -1) {
|
|
|
|
|
+ this.formData.recordRulesDetailList.splice(index, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleAdd(row) {
|
|
|
|
|
+ this.currentRow = row;
|
|
|
|
|
+ this.$refs.productRefs.open(row.toolCodes);
|
|
|
|
|
+ },
|
|
|
|
|
+ chooseModal(data) {
|
|
|
|
|
+ console.log('data', data);
|
|
|
|
|
+ this.currentRow.tools = data.map((i) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ toolCode: i.code,
|
|
|
|
|
+ toolName: i.name
|
|
|
|
|
+ // rulesDetailId: this.currentRow.id,
|
|
|
|
|
+ // rulesId: this.formData.id
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 规则明细表
|
|
|
|
|
+ async recordrulesDetailPage(row) {
|
|
|
|
|
+ const { list } = await recordrulesDetailPage({
|
|
|
|
|
+ // deptId: row.deptId,
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ rulesId: row.id,
|
|
|
|
|
+ size: 9999
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('list 数据', list);
|
|
|
|
|
+ this.formData.recordRulesDetailList = list;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 清空工具
|
|
|
|
|
+ clearTool(row) {
|
|
|
|
|
+ row.tools = [];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|