| | |
| | | |
| | | # 文件下载地址 下载数据模板地址 |
| | | # 本地服务器 |
| | | VUE_APP_BASE_API_FILE = 'http://121.196.36.24:8019/' |
| | | VUE_APP_BASE_API_FILE = 'http://192.168.2.138:8080/' |
| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" :style="{height:mainHeight+'px'}">
|
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between">
|
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
|
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=10_1')">导入</el-button>
|
| | | </div>
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | | <el-form-item label="标准编码" style=" display: flex;">
|
| | | <el-input v-model="form.checkstandcode" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准名称" style=" display: flex;">
|
| | | <el-input v-model="form.checkstandname" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="点检管控" style=" display: flex;">
|
| | | <el-select v-model="form.checkcontr" style="width: 200px" placeholder="请选择">
|
| | | <el-option
|
| | | v-for="item in checkcontrArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </div>
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | |
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | />
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <!-- <TableColumnSettings-->
|
| | | <!-- :list1="tableColumnSettingsArray"-->
|
| | | <!-- @tableColumnUpdate="tableColumnUpdate"-->
|
| | | <!-- />-->
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | :key="tableTimeStampKey"
|
| | | :data="tableData"
|
| | | :height="tableHeight+'px'"
|
| | | border
|
| | | class="tableFixed"
|
| | | :row-class-name="tableRowClassName"
|
| | | :style="{width: 100+'%',height:tableHeight+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | @sort-change="sortChange"
|
| | | >
|
| | |
|
| | | <el-table-column
|
| | | v-for="item in tableColumnSettingsArray"
|
| | | v-if="item.show"
|
| | | :key="item.id"
|
| | | :sortable="item.sortable"
|
| | | :prop="item.prop"
|
| | | :min-width="item.minWidth"
|
| | | :label="item.label"
|
| | | :width="item.width"
|
| | | show-tooltip-when-overflow
|
| | | :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="!row[item.prop]">/</div>
|
| | | <div v-else-if="item.prop==='is_checkeqp'">
|
| | | <i
|
| | | v-if="row[item.prop]==='Y'"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | class="el-icon-share"
|
| | | @click="checkeqpClick(row)"
|
| | | />
|
| | | <i
|
| | | v-if="row[item.prop]==='N'"
|
| | | class="el-icon-share"
|
| | | style="color: rgb(180 ,181, 185)"
|
| | | @click="checkeqpClick(row)"
|
| | | />
|
| | | </div>
|
| | | <div v-else-if="item.prop==='iscontr'">
|
| | | <div v-if="row[item.prop]==='Y'">
|
| | | <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
|
| | | 是
|
| | | </div>
|
| | | <div v-if="row[item.prop]==='N'">
|
| | | <i class="el-icon-info" style="margin-right: 2px" />
|
| | | 否
|
| | | </div>
|
| | | </div>
|
| | | <div v-else>{{ row[item.prop] }}</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | label="操作"
|
| | | fixed="right"
|
| | | width="120"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
| | | <i
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | class="el-icon-edit-outline"
|
| | | @click="edit('edit',row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">
|
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <!--分页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes"
|
| | | popper-class="select_bottom"
|
| | | @pagination="getDeviceCheckStandArdSearch"
|
| | | />
|
| | | </div>
|
| | |
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="operation==='add'?'新增':'编辑'"
|
| | | :visible.sync="dialogVisible"
|
| | | width="800px"
|
| | | :close-on-click-modal="false"
|
| | | top="8vh"
|
| | | @closed="handleClose"
|
| | | >
|
| | | <!-- @close="handleClose"-->
|
| | | <div>
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备点检标准信息:
|
| | | </div>
|
| | | <div style="margin: 0 30px;">
|
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
|
| | | <el-form-item label="标准编码" prop="code">
|
| | | <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准名称" prop="name">
|
| | | <el-input v-model="dialogForm.name" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item required label="点检管控">
|
| | | <el-select
|
| | | v-model="dialogForm.enable"
|
| | | style="width: 200px"
|
| | | placeholder="请选择"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in checkcontrArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="标准描述" prop="description">
|
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" />
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </div>
|
| | | <div>
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备关联点检项信息:
|
| | | </div>
|
| | | <div style="margin-bottom:10px">
|
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="addRow">新增</el-button>
|
| | | </div>
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataDialogRef"
|
| | | :data="tableDataDialog"
|
| | | :height="(tableHeight-300)+'px'"
|
| | | border
|
| | | :row-class-name="tableRowClassName"
|
| | | :style="{width: 100+'%',height:(tableHeight-300)+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | width="50"
|
| | | label="序号"
|
| | | />
|
| | | <el-table-column
|
| | | prop="checkitem_code"
|
| | | label="点检部位编码"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.checkitem_code }}</div>
|
| | | <el-select
|
| | | v-if="row.isVisible===1"
|
| | | v-model="row.checkitem_code"
|
| | | placeholder="请选择"
|
| | | @change="val=>selectChange(val,row)"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in checkItemSelectArr"
|
| | | :key="item.name"
|
| | | :label="item.code"
|
| | | :value="item.name"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="checkitem_name"
|
| | | label="点检部位名称"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.checkitem_name }}</div>
|
| | | <el-select
|
| | | v-if="row.isVisible===1"
|
| | | v-model="row.checkitem_code"
|
| | | placeholder="请选择"
|
| | | @change="val=>selectChange(val,row)"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in checkItemSelectArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | prop="checkitem_descr"
|
| | | label="点检要求"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.checkitem_descr }}</div>
|
| | | <el-input v-else v-model="row.checkitem_descr" />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="isscan"
|
| | | label="选择扫码"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '是' : '否' }}</div>
|
| | | <el-select
|
| | | v-if="row.isVisible===1"
|
| | | v-model="row.isscan"
|
| | | placeholder="请选择"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in checkcontrArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="cycle"
|
| | | label="点检周期"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.cycle === 'D' ? '日' : '' }}</div>
|
| | | <el-select
|
| | | v-if="row.isVisible===1"
|
| | | v-model="row.cycle"
|
| | | placeholder="请选择"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in cycleArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | label="操作"
|
| | | width="120"
|
| | | fixed="right"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="editRow(row)">编辑</el-button>
|
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="delRow(row)">删除</el-button>
|
| | |
|
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveRow(row)">确认</el-button>
|
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancelRow(row)">取消</el-button>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- 关联设备-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | title="关联设备"
|
| | | :visible.sync="dialogVisibleEqp"
|
| | | width="800px"
|
| | | top="10vh"
|
| | | :close-on-click-modal="false"
|
| | | class="dialogVisibleEqp"
|
| | | @closed="handleCloseEqp"
|
| | | @close="handleCloseEqp"
|
| | | >
|
| | | <!-- @opened="handleOpenedRoles"-->
|
| | |
|
| | | <div>
|
| | | <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 标准名称:{{ dialogFormEqp.name }}
|
| | | </div>
|
| | | <el-divider />
|
| | | <div>
|
| | | <div style="margin-bottom:20px">
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备所属车间集合:
|
| | | </div>
|
| | | <div class="myCheckboxGroup">
|
| | |
|
| | | <div
|
| | | v-for="item in dialogFormEqp.eqpArr"
|
| | | :key="item.code"
|
| | | :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}"
|
| | | class="myCheckbox"
|
| | | @click="myCheckboxClick(item)"
|
| | | >
|
| | | <!-- <input-->
|
| | | <!-- class="myCheckboxInput"-->
|
| | | <!-- type="checkbox"-->
|
| | | <!-- :value="item.code"-->
|
| | | <!-- :name="item.name"-->
|
| | | <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"-->
|
| | | <!-- @click="myCheckboxInputClick(item)"-->
|
| | | <!-- >{{ item.name }}-->
|
| | | <!-- 父子点击事件不影响-->
|
| | | <!-- onClick="event.cancelBubble = true"-->
|
| | |
|
| | | <el-checkbox
|
| | | :key="item.code"
|
| | | v-model="item.isSelected2"
|
| | | class="myCheckboxInput"
|
| | | :value="item.code"
|
| | | :name="item.name"
|
| | | :checked="item.isSelected2"
|
| | | :label="item.name"
|
| | | @change="myCheckboxInputClick(item)"
|
| | | />
|
| | | <div class="myCheckboxInputLabel">{{ item.name }}</div>
|
| | |
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <el-divider />
|
| | | <div>
|
| | | <div style="margin-bottom:20px">
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备信息:
|
| | | </div>
|
| | | <el-tree
|
| | | ref="epqTree"
|
| | | :data="dialogFormEqp.eqpTree"
|
| | | show-checkbox
|
| | | node-key="code"
|
| | | default-expand-all
|
| | | style="height: 320px;overflow: auto"
|
| | | :props="defaultPropsOfEqpTree"
|
| | | @check="checkBoxClick"
|
| | | />
|
| | | <!-- @check-change="checkChange"-->
|
| | |
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="eqpDialogVisibleCancel">取 消</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="eqpDialogVisibleConfirm"
|
| | | >确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import Pagination from '@/components/Pagination'
|
| | | import {
|
| | | AddUpdateDeviceCheckStandArd, DeleteDeviceCheckStaned,
|
| | | DeviceCheckItemSelect,
|
| | | DeviceCheckStandArdSearch, DeviceCheckStanedAssociationEqp, SaveDeviceCheckStanedAssociationEqp,
|
| | | ViewDeviceCheckStanedSearch
|
| | | } from '@/api/DeviceManager'
|
| | | import $ from 'jquery'
|
| | | import { validateCode } from '@/utils/global'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import waves from '@/directive/waves'
|
| | | import TableColumnSettings from '@/components/TableColumnSettings'
|
| | |
|
| | | export default {
|
| | | name: 'CheckStandard',
|
| | | components: {
|
| | | Pagination, TableColumnSettings
|
| | | },
|
| | | directives: { elDragDialog, waves },
|
| | | data() {
|
| | | return {
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | form: {
|
| | | checkstandcode: '', // 标准编码
|
| | | checkstandname: '', // 标准名称
|
| | | checkcontr: '', // 点检管控
|
| | | prop: 'lm_date', // 排序字段
|
| | | order: 'desc', // 排序字段
|
| | | page: 1, // 第几页
|
| | | rows: 20 // 每页多少条
|
| | | },
|
| | | checkcontrArr: [
|
| | | { code: 'Y', name: '是' },
|
| | | { code: 'N', name: '否' }
|
| | | ],
|
| | | cycleArr: [
|
| | | { code: 'D', name: '日' }
|
| | | ],
|
| | | total: 10,
|
| | | tableData: [],
|
| | | tableColumnSettingsArray: [
|
| | | { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 隐藏列 show: false隐藏,true显示
|
| | | { minWidth: false, width: 55, prop: 'rowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom
|
| | | {
|
| | | minWidth: 110,
|
| | | width: false,
|
| | | prop: 'code',
|
| | | label: '标准编码',
|
| | | id: 3,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: 110,
|
| | | width: false,
|
| | | prop: 'name',
|
| | | label: '标准名称',
|
| | | id: 4,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: 330,
|
| | | width: false,
|
| | | prop: 'description',
|
| | | label: '标准描述',
|
| | | id: 5,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'iscontr',
|
| | | label: '点检管控',
|
| | | id: 6,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'is_checkeqp',
|
| | | label: '关联设备',
|
| | | id: 7,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'lm_user',
|
| | | label: '创建人员',
|
| | | id: 8,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 160,
|
| | | prop: 'lm_date',
|
| | | label: '创建时间',
|
| | | id: 9,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | }
|
| | | ],
|
| | | tableTimeStampKey: new Date().getTime(), // 表格key
|
| | |
|
| | | dialogVisible: false,
|
| | | dialogForm: {
|
| | | code: '',
|
| | | name: '',
|
| | | enable: 'Y',
|
| | | description: ''
|
| | | },
|
| | | operation: '',
|
| | | dialogFormRules: {
|
| | |
|
| | | code: [
|
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | name: [
|
| | | { required: true, message: '请输入标准名称', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | enable: [
|
| | | { required: true, message: '', trigger: ['blur', 'change'] }
|
| | | ]
|
| | | },
|
| | | tableDataDialog: [], // 表格数据
|
| | | // tableDataDialogSelected: [], // 已选code
|
| | | checkItemSelectArr: [],
|
| | | checkItemIsCancel: true,
|
| | | dialogVisibleEqp: false,
|
| | |
|
| | | dialogFormEqp: {
|
| | | name: '',
|
| | | code: '',
|
| | | eqpAll: [], // 车间及设备所有
|
| | | eqpArr: [], // 车间集合所有
|
| | | eqpTree: [], // 设备树形所有
|
| | | eqpCodeSelectedArr: []// 设备树形选中
|
| | | },
|
| | | defaultPropsOfEqpTree: {
|
| | | value: 'code',
|
| | | label: 'name',
|
| | | children: 'children'
|
| | | },
|
| | |
|
| | | title_value: '数据导入 / 点检部位',
|
| | | code: '22',
|
| | | shows: false
|
| | |
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | shows() {
|
| | | if (!this.shows) {
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | }
|
| | | }
|
| | | },
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | | this.handleRequest()
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | | },
|
| | | methods: {
|
| | | tableColumnUpdate(val, isCopyTrue) {
|
| | | if (isCopyTrue) {
|
| | | this.tableColumnSettingsArray = val
|
| | | }
|
| | | this.tableTimeStampKey = new Date().getTime()
|
| | |
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | },
|
| | | handleRequest() {
|
| | | this.getDeviceCheckStandArdSearch().then(res => {
|
| | | if (res.code === '200') {
|
| | | this.getDeviceCheckItemSelect()
|
| | | }
|
| | | })
|
| | | },
|
| | | async getDeviceCheckStandArdSearch() {
|
| | | const res = await DeviceCheckStandArdSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | return { code: res.code }
|
| | | },
|
| | | // 排序改变时
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | },
|
| | | // 查询
|
| | | search() {
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | },
|
| | | // 导入按钮
|
| | | upload() {
|
| | | this.shows = true
|
| | | this.$refs.importPickerFunc.newDataFunc()
|
| | | },
|
| | | colos() {
|
| | | this.shows = false
|
| | | },
|
| | | // 重置
|
| | | reset() {
|
| | | this.form.checkstandcode = ''
|
| | | this.form.checkstandname = ''
|
| | | this.form.checkcontr = ''
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | },
|
| | |
|
| | | async getDeviceCheckItemSelect() {
|
| | | const { data: res } = await DeviceCheckItemSelect()
|
| | | this.checkItemSelectArr = res
|
| | | },
|
| | |
|
| | | // 新增按钮
|
| | | add(operation) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | // this.getDeviceCheckItemSelect()
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tableDataDialogRef.doLayout()
|
| | | })
|
| | | },
|
| | | // 修改按钮
|
| | | edit(operation, row) {
|
| | | // this.getDeviceCheckItemSelect()
|
| | | this.operation = operation
|
| | | this.getViewDeviceCheckStanedSearch(row.code)
|
| | | this.dialogVisible = true
|
| | |
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tableDataDialogRef.doLayout()
|
| | | })
|
| | | // this.$nextTick(() => {
|
| | | // this.dialogForm.code = row.code
|
| | | // this.dialogForm.name = row.name
|
| | | // this.dialogForm.enable = row.enable
|
| | | // this.dialogForm.description = row.description
|
| | | // })
|
| | | },
|
| | | // 修改前请求接口
|
| | | async getViewDeviceCheckStanedSearch(checkstand_code) {
|
| | | const { data: res } = await ViewDeviceCheckStanedSearch({ checkstand_code })
|
| | | this.tableDataDialog = res.Data
|
| | |
|
| | | this.dialogForm.code = res.code
|
| | | this.dialogForm.name = res.name
|
| | | this.dialogForm.enable = res.enable
|
| | | this.dialogForm.description = res.description
|
| | |
|
| | | this.tableDataDialog.forEach(item => {
|
| | | item.isVisible = 0
|
| | | item.checkitem_code = item.code
|
| | | item.checkitem_name = item.name
|
| | | item.checkitem_descr = item.chkdesc
|
| | | })
|
| | |
|
| | | this.checkItemSelectArr = [...this.checkItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.checkitem_code !== x.code))
|
| | | },
|
| | | // 删除按钮
|
| | | async del(row) {
|
| | | this.$confirm('是否确认删除?', '提示', {
|
| | | confirmButtonText: '确定',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | DeleteDeviceCheckStaned({ checkstand_code: row.code }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('删除成功!')
|
| | | if (this.form.page > 1 && this.tableData.length === 1) {
|
| | | this.form.page--
|
| | | }
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$notify.info('已取消删除')
|
| | | })
|
| | | },
|
| | |
|
| | | // 对话框关闭事件
|
| | | handleClose() {
|
| | | this.dialogForm.code = ''
|
| | | this.dialogForm.name = ''
|
| | | this.dialogForm.enable = 'Y'
|
| | | this.dialogForm.description = ''
|
| | | this.tableDataDialog = []
|
| | | this.getDeviceCheckItemSelect()
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // 对话框取消
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | },
|
| | | // 对话框确认
|
| | | dialogVisibleConfirm() {
|
| | | if (this.tableDataDialog.length === 0) {
|
| | | return this.$message.info('设备关联点检项信息不能为空!')
|
| | | }
|
| | |
|
| | | this.$refs.dialogForm.validate(valid => {
|
| | | if (valid) {
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | // this.tableDataDialog.forEach((item, index) => { // 去掉正在编辑且是空checkitem_code
|
| | | // if (item.isVisible === 1 && item.checkitem_code === '') {
|
| | | // this.tableDataDialog.splice(index, 1)
|
| | | // }
|
| | | // })
|
| | |
|
| | | this.tableDataDialog.filter(item => item.checkitem_code !== '')
|
| | |
|
| | | let Data = []
|
| | | // 数组中对象相同的去重
|
| | | Data = this.tableDataDialog.filter((currentValue, currentIndex, selfArr) => {
|
| | | return selfArr.findIndex(item => item.checkitem_code === currentValue.checkitem_code) === currentIndex
|
| | | })
|
| | | Data.forEach((item, index) => {
|
| | | item.checkitem_seq = index + 1
|
| | | })
|
| | |
|
| | | const data = {
|
| | | 'code': this.dialogForm.code,
|
| | | 'name': this.dialogForm.name,
|
| | | 'enable': this.dialogForm.enable,
|
| | | 'description': this.dialogForm.description,
|
| | | 'Data': Data
|
| | | }
|
| | |
|
| | | AddUpdateDeviceCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
|
| | | if (res.code === '200') {
|
| | | this.dialogVisible = false
|
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | } else {
|
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | selectChange(val, row) {
|
| | | const res = this.checkItemSelectArr.find(item => {
|
| | | return item.code === val || item.name === val
|
| | | })
|
| | | row.checkitem_descr = res.description
|
| | | row.checkitem_code = res.code
|
| | | row.checkitem_name = res.name
|
| | | },
|
| | | // 新增行
|
| | | addRow() {
|
| | | let flag = false
|
| | | this.tableDataDialog.forEach(item => {
|
| | | if (item.isVisible === 1) {
|
| | | // return this.$message.info('请先确认或取消上条记录!')
|
| | | flag = true
|
| | | }
|
| | | })
|
| | | if (flag) {
|
| | | return this.$message.info('请先确认或取消上条记录!')
|
| | | }
|
| | | this.tableDataDialog.push({
|
| | | checkitem_code: '',
|
| | | checkitem_name: '',
|
| | | checkitem_descr: '',
|
| | | isscan: 'Y',
|
| | | cycle: 'D',
|
| | | isVisible: 1
|
| | | })
|
| | |
|
| | | this.checkItemIsCancel = false
|
| | | },
|
| | | editRow(row) {
|
| | | let flag = false
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.isVisible === 1) {
|
| | | flag = true
|
| | | }
|
| | | })
|
| | | if (flag) {
|
| | | return this.$message.info('请先确认或取消其它行!')
|
| | | }
|
| | |
|
| | | this.checkItemIsCancel = false
|
| | | this.checkItemSelectArr.splice(0, 0, {
|
| | | code: row.checkitem_code,
|
| | | name: row.checkitem_name,
|
| | | description: row.checkitem_descr
|
| | | })
|
| | |
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.checkitem_code === row.checkitem_code) {
|
| | | this.tableDataDialog.splice(index, 1, {
|
| | | checkitem_code: row.checkitem_code,
|
| | | checkitem_name: row.checkitem_name,
|
| | | checkitem_descr: row.checkitem_descr,
|
| | | isscan: row.isscan,
|
| | | cycle: row.cycle,
|
| | | isVisible: 1
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | | delRow(row) {
|
| | | this.checkItemSelectArr.splice(0, 0, {
|
| | | code: row.checkitem_code,
|
| | | name: row.checkitem_name,
|
| | | description: row.checkitem_descr
|
| | | })
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.checkitem_code === row.checkitem_code) {
|
| | | this.tableDataDialog.splice(index, 1)
|
| | | }
|
| | | })
|
| | | },
|
| | | saveRow(row) {
|
| | | if (row.checkitem_code === '' && row.checkitem_name === '') {
|
| | | return this.$message.info('点检部位不能为空!')
|
| | | }
|
| | | row.isVisible = 0
|
| | | this.checkItemSelectArr.forEach((item, index) => {
|
| | | if (item.code === row.checkitem_code) {
|
| | | this.checkItemSelectArr.splice(index, 1)
|
| | | }
|
| | | })
|
| | | },
|
| | | cancelRow(row) {
|
| | | // this.checkItemSelectArr.forEach((item, index) => {
|
| | | // if (item.code === row.checkitem_code) {
|
| | | if (this.checkItemIsCancel) {
|
| | | this.checkItemSelectArr.splice(0, 0, {
|
| | | code: row.checkitem_code,
|
| | | name: row.checkitem_name,
|
| | | description: row.checkitem_descr
|
| | | })
|
| | | }
|
| | | this.JYIsCancel = true
|
| | | // }
|
| | | // })
|
| | |
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.checkitem_code === row.checkitem_code && item.isVisible === 1) {
|
| | | row.isVisible = 0
|
| | | this.tableDataDialog.splice(index, 1)
|
| | | }
|
| | | })
|
| | | },
|
| | | // 获取页面高度
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 195
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | },
|
| | | tableRowClassName({ row, rowIndex }) {
|
| | | return 'custom-row'
|
| | | },
|
| | | // 关联设备
|
| | | checkeqpClick(row) {
|
| | | const loading = this.$loading({
|
| | | lock: true,
|
| | | text: '正在加载数据,请稍等...',
|
| | | spinner: 'el-icon-loading',
|
| | | customClass: 'osloading',
|
| | | background: 'rgba(0, 0, 0, 0.7)'
|
| | | })
|
| | | this.dialogFormEqp.name = row.name
|
| | | this.dialogFormEqp.code = row.code
|
| | |
|
| | | DeviceCheckStanedAssociationEqp({ checkstand_code: row.code }).then(res => {
|
| | | if (res.code === '200') {
|
| | | setTimeout(() => {
|
| | | loading.close()
|
| | | this.dialogFormEqp.eqpAll = res.data.filter(item => item.children.length > 0)
|
| | |
|
| | | if (this.dialogFormEqp.eqpAll.length > 0) {
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | this.dialogFormEqp.eqpArr.push({
|
| | | code: item.code,
|
| | | name: item.name,
|
| | | type: item.type,
|
| | | isSelected1: index === 0,
|
| | | isSelected2: item.flag === 'Y'
|
| | | })
|
| | | if (item.flag === 'Y') {
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | if (it.flag === 'Y') {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpAll[0].name = '全部'
|
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]]
|
| | | }
|
| | |
|
| | | this.dialogVisibleEqp = true
|
| | |
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | }, 1000)
|
| | | } else {
|
| | | loading.close()
|
| | | }
|
| | | })
|
| | | },
|
| | | // 关联设备对话框关闭
|
| | | handleCloseEqp() {
|
| | | this.$refs.epqTree.setCheckedKeys([])
|
| | | this.dialogFormEqp.code = ''
|
| | | this.dialogFormEqp.name = ''
|
| | | this.dialogFormEqp.eqpAll = []
|
| | | this.dialogFormEqp.eqpArr = []
|
| | | this.dialogFormEqp.eqpTree = []
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = []
|
| | | },
|
| | | // 大盒子点击
|
| | | myCheckboxClick(val) {
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | item.isSelected1 = item.code === val.code
|
| | | if (item.code === val.code) {
|
| | | this.dialogFormEqp.eqpAll[index].name = '全部'
|
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]]
|
| | | }
|
| | | })
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | },
|
| | | // 小盒子点击
|
| | | myCheckboxInputClick(val) {
|
| | | console.log(val)
|
| | | val.isSelected2 = !!val.isSelected2
|
| | | if (val.isSelected2) { // 从没选中到选中
|
| | | console.log('从没选中到选中')
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === val.code) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 1)
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | } else { // 从选中到没选中
|
| | | console.log('从选中到没选中')
|
| | | const temp = []
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === val.code) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | temp.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x))
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | }
|
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 999)
|
| | | },
|
| | | // 树形复选框点击事件
|
| | | checkBoxClick(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) {
|
| | | let checkedFatherCode = '' // 找到 checkedFatherCode 父code值
|
| | | console.log(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys })
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === obj.code) {
|
| | | checkedFatherCode = item.code
|
| | | }
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach((it, ind) => {
|
| | | if (it.code === obj.code) {
|
| | | checkedFatherCode = item.code
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | console.log(checkedFatherCode, 1)
|
| | |
|
| | | // 1.第一种情况当树形 半叶 不为零 全叶 不为零
|
| | | if (halfCheckedKeys.length !== 0 && checkedKeys.length !== 0) {
|
| | | console.log('// 1.第一种情况当树形 半叶 不为零 全叶 不为零')
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | console.log(item.code, 777)
|
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.forEach((item, index) => {
|
| | | if (item === obj.code) {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.splice(index, 1)
|
| | | }
|
| | | })
|
| | | checkedKeys.forEach(item => {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(item)
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...new Set(this.dialogFormEqp.eqpCodeSelectedArr)]
|
| | | }
|
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 666)
|
| | | // 2.第二种情况当树形 半叶 为零 全叶 为零
|
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length === 0) {
|
| | | console.log('// 2.第二种情况当树形 半叶 为零 全叶 为零')
|
| | | const temp = []
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = false
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', false)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | temp.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x))
|
| | | }
|
| | |
|
| | | // 3.第三种种情况当树形 半叶 为零 全叶 不为零
|
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length !== 0) {
|
| | | console.log('// 3.第三种种情况当树形 半叶 为零 全叶 不为零')
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | })
|
| | |
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | }
|
| | | },
|
| | | // 取消事件
|
| | | eqpDialogVisibleCancel() {
|
| | | this.dialogVisibleEqp = false
|
| | | },
|
| | | // 确认事件
|
| | | eqpDialogVisibleConfirm() {
|
| | | // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888)
|
| | | // this.dialogVisibleEqp = false
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const data = []
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | if (this.dialogFormEqp.eqpCodeSelectedArr.includes(it.code)) {
|
| | | data.push({
|
| | | name: it.name,
|
| | | code: it.code
|
| | | })
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | |
|
| | | SaveDeviceCheckStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.dialogVisibleEqp = false
|
| | | this.$notify.success('关联成功!')
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | }
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | | <!--公共页面样式-->
|
| | | <style lang="scss" scoped>
|
| | | $main_color: #42b983;
|
| | |
|
| | | .dialogVisibleEqp {
|
| | | .myCheckboxGroup {
|
| | | display: flex;
|
| | | flex-wrap: wrap;
|
| | |
|
| | | .myCheckbox {
|
| | | //border: 1px solid $main_color;
|
| | | border: 1px solid #eee;
|
| | | display: flex;
|
| | | min-width: 100px;
|
| | | padding: 10px;
|
| | | margin: 10px 30px 0 0;
|
| | | border-radius: 5px;
|
| | | cursor: default;
|
| | | position: relative;
|
| | |
|
| | | .myCheckboxInput {
|
| | | margin: 1px 5px 0 0;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .myCheckboxInputLabel {
|
| | | position: absolute;
|
| | | left: 29px;
|
| | | padding: 5px;
|
| | | top: 6px;
|
| | | color: transparent;
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | //.myCheckbox{
|
| | | // border: 1px solid $main_color;
|
| | | //}
|
| | |
|
| | | input[type=checkbox] {
|
| | | cursor: pointer;
|
| | | position: relative;
|
| | | width: 14px;
|
| | | height: 14px;
|
| | | font-size: 14px;
|
| | | }
|
| | |
|
| | | input[type=checkbox]::after {
|
| | | position: absolute;
|
| | | top: 0;
|
| | | //color: rgb(130, 35, 35);
|
| | | color: $main_color;
|
| | | width: 14px;
|
| | | height: 14px;
|
| | | display: inline-block;
|
| | | visibility: visible;
|
| | | padding-left: 0px;
|
| | | text-align: center;
|
| | | content: ' ';
|
| | | border-radius: 3px
|
| | | }
|
| | |
|
| | | input[type=checkbox]:checked::after {
|
| | | //content: "✓";
|
| | | content: "√";
|
| | | color: #fff;
|
| | | font-size: 12px;
|
| | | font-weight: bold;
|
| | | background-color: $main_color;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--text {
|
| | | font-size: 14px;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .el-icon-share, .el-icon-delete, .el-icon-edit-outline {
|
| | | color: $main_color;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .el-icon-edit-outline {
|
| | | margin-right: 15px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--primary, .el-button--default, .el-button--info {
|
| | | height: 34px;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | padding: 0 15px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--primary {
|
| | | //background-color: $main_color !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--default {
|
| | | background-color: #f8f8fa;
|
| | | border: none;
|
| | | }
|
| | |
|
| | | ::v-deep .el-input__inner {
|
| | | height: 34px;
|
| | | line-height: 34px;
|
| | | //color: #a7a7a7;
|
| | | }
|
| | |
|
| | | //::v-deep .el-dialog__body {
|
| | | // padding: 20px 100px !important;
|
| | | //}
|
| | | ::v-deep .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .dialogVisibleRoles .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .importPickerClass .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog__footer {
|
| | | display: flex;
|
| | | justify-content: flex-end;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table .caret-wrapper {
|
| | | transform: scale(0.8);
|
| | | }
|
| | |
|
| | | ::v-deep .cell {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table::before {
|
| | | height: 0;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__body-wrapper {
|
| | | background-color: #f8f8fa;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__body .el-table__row.hover-row td {
|
| | | background-color: #eaecef;
|
| | | }
|
| | |
|
| | | ::v-deep .el-form--inline .el-form-item__label {
|
| | | color: #a7a7a7;
|
| | | }
|
| | |
|
| | | .body ::v-deep .el-divider {
|
| | | border: 1px solid #eee;
|
| | | width: 99%;
|
| | | margin: 10px auto;
|
| | | }
|
| | |
|
| | | .body ::v-deep .el-form-item {
|
| | | margin-bottom: 0;
|
| | | }
|
| | |
|
| | | .userDialogVisible ::v-deep .el-form-item {
|
| | | margin-bottom: 0;
|
| | | }
|
| | |
|
| | | ::v-deep .el-select__caret {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | |
|
| | | .tableFixed {
|
| | | ::v-deep .el-table__fixed-right {
|
| | | height: 100% !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__fixed {
|
| | | height: 100% !important;
|
| | | }
|
| | | }
|
| | | </style>
|
| | | <style>
|
| | | .osloading {
|
| | | font-size: 26px !important;
|
| | | }
|
| | |
|
| | | .el-loading-text {
|
| | | font-size: 26px !important;
|
| | | }
|
| | |
|
| | | .el-table .custom-row {
|
| | | background: #f8f8fa;
|
| | | }
|
| | | </style>
|
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> |
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=10_1')">导入</el-button> |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="标准编码" style=" display: flex;"> |
| | | <el-input v-model="form.checkstandcode" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准名称" style=" display: flex;"> |
| | | <el-input v-model="form.checkstandname" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="点检管控" style=" display: flex;"> |
| | | <el-select v-model="form.checkcontr" style="width: 200px" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in checkcontrArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | </el-form> |
| | | |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | /> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <!-- <TableColumnSettings--> |
| | | <!-- :list1="tableColumnSettingsArray"--> |
| | | <!-- @tableColumnUpdate="tableColumnUpdate"--> |
| | | <!-- />--> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :key="tableTimeStampKey" |
| | | :data="tableData" |
| | | :height="tableHeight+'px'" |
| | | border |
| | | class="tableFixed" |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | |
| | | <el-table-column |
| | | v-for="item in tableColumnSettingsArray" |
| | | v-if="item.show" |
| | | :key="item.id" |
| | | :sortable="item.sortable" |
| | | :prop="item.prop" |
| | | :min-width="item.minWidth" |
| | | :label="item.label" |
| | | :width="item.width" |
| | | show-tooltip-when-overflow |
| | | :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="!row[item.prop]">/</div> |
| | | <div v-else-if="item.prop==='is_checkeqp'"> |
| | | <i |
| | | v-if="row[item.prop]==='Y'" |
| | | :style="{color:$store.state.settings.theme}" |
| | | class="el-icon-share" |
| | | @click="checkeqpClick(row)" |
| | | /> |
| | | <i |
| | | v-if="row[item.prop]==='N'" |
| | | class="el-icon-share" |
| | | style="color: rgb(180 ,181, 185)" |
| | | @click="checkeqpClick(row)" |
| | | /> |
| | | </div> |
| | | <div v-else-if="item.prop==='iscontr'"> |
| | | <div v-if="row[item.prop]==='Y'"> |
| | | <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" /> |
| | | 是 |
| | | </div> |
| | | <div v-if="row[item.prop]==='N'"> |
| | | <i class="el-icon-info" style="margin-right: 2px" /> |
| | | 否 |
| | | </div> |
| | | </div> |
| | | <div v-else>{{ row[item.prop] }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | fixed="right" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="编辑" placement="top"> |
| | | <i |
| | | :style="{color:$store.state.settings.theme}" |
| | | class="el-icon-edit-outline" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top"> |
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--分页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getDeviceCheckStandArdSearch" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="8vh" |
| | | @closed="handleClose" |
| | | > |
| | | <!-- @close="handleClose"--> |
| | | <div> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备点检标准信息: |
| | | </div> |
| | | <div style="margin: 0 30px;"> |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="标准编码" prop="code"> |
| | | <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准名称" prop="name"> |
| | | <el-input v-model="dialogForm.name" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item required label="点检管控"> |
| | | <el-select |
| | | v-model="dialogForm.enable" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in checkcontrArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="标准描述" prop="description"> |
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备关联点检项信息: |
| | | </div> |
| | | <div style="margin-bottom:10px"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="addRow">新增</el-button> |
| | | </div> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataDialogRef" |
| | | :data="tableDataDialog" |
| | | :height="(tableHeight-300)+'px'" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:(tableHeight-300)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | width="50" |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="checkitem_code" |
| | | label="点检部位编码" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.checkitem_code }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.checkitem_code" |
| | | placeholder="请选择" |
| | | @change="val=>selectChange(val,row)" |
| | | > |
| | | <el-option |
| | | v-for="item in checkItemSelectArr" |
| | | :key="item.name" |
| | | :label="item.code" |
| | | :value="item.name" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="checkitem_name" |
| | | label="点检部位名称" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.checkitem_name }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.checkitem_code" |
| | | placeholder="请选择" |
| | | @change="val=>selectChange(val,row)" |
| | | > |
| | | <el-option |
| | | v-for="item in checkItemSelectArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="checkitem_descr" |
| | | label="点检要求" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.checkitem_descr }}</div> |
| | | <el-input v-else v-model="row.checkitem_descr" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="isscan" |
| | | label="选择扫码" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '是' : '否' }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.isscan" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in checkcontrArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="cycle" |
| | | label="点检周期" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.cycle === 'D' ? '日' : '' }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.cycle" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in cycleArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="editRow(row)">编辑</el-button> |
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="delRow(row)">删除</el-button> |
| | | |
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveRow(row)">确认</el-button> |
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancelRow(row)">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 关联设备--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | title="关联设备" |
| | | :visible.sync="dialogVisibleEqp" |
| | | width="800px" |
| | | top="10vh" |
| | | :close-on-click-modal="false" |
| | | class="dialogVisibleEqp" |
| | | @closed="handleCloseEqp" |
| | | @close="handleCloseEqp" |
| | | > |
| | | <!-- @opened="handleOpenedRoles"--> |
| | | |
| | | <div> |
| | | <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 标准名称:{{ dialogFormEqp.name }} |
| | | </div> |
| | | <el-divider /> |
| | | <div> |
| | | <div style="margin-bottom:20px"> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备所属车间集合: |
| | | </div> |
| | | <div class="myCheckboxGroup"> |
| | | |
| | | <div |
| | | v-for="item in dialogFormEqp.eqpArr" |
| | | :key="item.code" |
| | | :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}" |
| | | class="myCheckbox" |
| | | @click="myCheckboxClick(item)" |
| | | > |
| | | <!-- <input--> |
| | | <!-- class="myCheckboxInput"--> |
| | | <!-- type="checkbox"--> |
| | | <!-- :value="item.code"--> |
| | | <!-- :name="item.name"--> |
| | | <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"--> |
| | | <!-- @click="myCheckboxInputClick(item)"--> |
| | | <!-- >{{ item.name }}--> |
| | | <!-- 父子点击事件不影响--> |
| | | <!-- onClick="event.cancelBubble = true"--> |
| | | |
| | | <el-checkbox |
| | | :key="item.code" |
| | | v-model="item.isSelected2" |
| | | class="myCheckboxInput" |
| | | :value="item.code" |
| | | :name="item.name" |
| | | :checked="item.isSelected2" |
| | | :label="item.name" |
| | | @change="myCheckboxInputClick(item)" |
| | | /> |
| | | <div class="myCheckboxInputLabel">{{ item.name }}</div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-divider /> |
| | | <div> |
| | | <div style="margin-bottom:20px"> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备信息: |
| | | </div> |
| | | <el-tree |
| | | ref="epqTree" |
| | | :data="dialogFormEqp.eqpTree" |
| | | show-checkbox |
| | | node-key="code" |
| | | default-expand-all |
| | | style="height: 320px;overflow: auto" |
| | | :props="defaultPropsOfEqpTree" |
| | | @check="checkBoxClick" |
| | | /> |
| | | <!-- @check-change="checkChange"--> |
| | | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="eqpDialogVisibleCancel">取 消</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="eqpDialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateDeviceCheckStandArd, DeleteDeviceCheckStaned, |
| | | DeviceCheckItemSelect, |
| | | DeviceCheckStandArdSearch, DeviceCheckStanedAssociationEqp, SaveDeviceCheckStanedAssociationEqp, |
| | | ViewDeviceCheckStanedSearch |
| | | } from '@/api/DeviceManager' |
| | | import $ from 'jquery' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import TableColumnSettings from '@/components/TableColumnSettings' |
| | | |
| | | export default { |
| | | name: 'CheckStandard', |
| | | components: { |
| | | Pagination, TableColumnSettings |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | checkstandcode: '', // 标准编码 |
| | | checkstandname: '', // 标准名称 |
| | | checkcontr: '', // 点检管控 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | checkcontrArr: [ |
| | | { code: 'Y', name: '是' }, |
| | | { code: 'N', name: '否' } |
| | | ], |
| | | cycleArr: [ |
| | | { code: 'D', name: '日' } |
| | | ], |
| | | total: 10, |
| | | tableData: [], |
| | | tableColumnSettingsArray: [ |
| | | { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 隐藏列 show: false隐藏,true显示 |
| | | { minWidth: false, width: 55, prop: 'rowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'code', |
| | | label: '标准编码', |
| | | id: 3, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'name', |
| | | label: '标准名称', |
| | | id: 4, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 330, |
| | | width: false, |
| | | prop: 'description', |
| | | label: '标准描述', |
| | | id: 5, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'iscontr', |
| | | label: '点检管控', |
| | | id: 6, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'is_checkeqp', |
| | | label: '关联设备', |
| | | id: 7, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'lm_user', |
| | | label: '创建人员', |
| | | id: 8, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 160, |
| | | prop: 'lm_date', |
| | | label: '创建时间', |
| | | id: 9, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | } |
| | | ], |
| | | tableTimeStampKey: new Date().getTime(), // 表格key |
| | | |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | code: '', |
| | | name: '', |
| | | enable: 'Y', |
| | | description: '' |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | |
| | | code: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | name: [ |
| | | { required: true, message: '请输入标准名称', trigger: ['blur', 'change'] } |
| | | ], |
| | | enable: [ |
| | | { required: true, message: '', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | tableDataDialog: [], // 表格数据 |
| | | // tableDataDialogSelected: [], // 已选code |
| | | checkItemSelectArr: [], |
| | | checkItemIsCancel: true, |
| | | dialogVisibleEqp: false, |
| | | |
| | | dialogFormEqp: { |
| | | name: '', |
| | | code: '', |
| | | eqpAll: [], // 车间及设备所有 |
| | | eqpArr: [], // 车间集合所有 |
| | | eqpTree: [], // 设备树形所有 |
| | | eqpCodeSelectedArr: []// 设备树形选中 |
| | | }, |
| | | defaultPropsOfEqpTree: { |
| | | value: 'code', |
| | | label: 'name', |
| | | children: 'children' |
| | | }, |
| | | |
| | | title_value: '数据导入 / 点检部位', |
| | | code: '22', |
| | | shows: false |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | shows() { |
| | | if (!this.shows) { |
| | | this.getDeviceCheckStandArdSearch() |
| | | } |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | this.handleRequest() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | tableColumnUpdate(val, isCopyTrue) { |
| | | if (isCopyTrue) { |
| | | this.tableColumnSettingsArray = val |
| | | } |
| | | this.tableTimeStampKey = new Date().getTime() |
| | | |
| | | this.$refs.tableDataRef.doLayout() |
| | | }, |
| | | handleRequest() { |
| | | this.getDeviceCheckStandArdSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getDeviceCheckItemSelect() |
| | | } |
| | | }) |
| | | }, |
| | | async getDeviceCheckStandArdSearch() { |
| | | const res = await DeviceCheckStandArdSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | return { code: res.code } |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getDeviceCheckStandArdSearch() |
| | | }, |
| | | // 查询 |
| | | search() { |
| | | this.getDeviceCheckStandArdSearch() |
| | | }, |
| | | // 导入按钮 |
| | | upload() { |
| | | this.shows = true |
| | | this.$refs.importPickerFunc.newDataFunc() |
| | | }, |
| | | colos() { |
| | | this.shows = false |
| | | }, |
| | | // 重置 |
| | | reset() { |
| | | this.form.checkstandcode = '' |
| | | this.form.checkstandname = '' |
| | | this.form.checkcontr = '' |
| | | this.getDeviceCheckStandArdSearch() |
| | | }, |
| | | |
| | | async getDeviceCheckItemSelect() { |
| | | const { data: res } = await DeviceCheckItemSelect() |
| | | this.checkItemSelectArr = res |
| | | }, |
| | | |
| | | // 新增按钮 |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | // this.getDeviceCheckItemSelect() |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataDialogRef.doLayout() |
| | | }) |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | | // this.getDeviceCheckItemSelect() |
| | | this.operation = operation |
| | | this.getViewDeviceCheckStanedSearch(row.code) |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataDialogRef.doLayout() |
| | | }) |
| | | // this.$nextTick(() => { |
| | | // this.dialogForm.code = row.code |
| | | // this.dialogForm.name = row.name |
| | | // this.dialogForm.enable = row.enable |
| | | // this.dialogForm.description = row.description |
| | | // }) |
| | | }, |
| | | // 修改前请求接口 |
| | | async getViewDeviceCheckStanedSearch(checkstand_code) { |
| | | const { data: res } = await ViewDeviceCheckStanedSearch({ checkstand_code }) |
| | | this.tableDataDialog = res.Data |
| | | |
| | | this.dialogForm.code = res.code |
| | | this.dialogForm.name = res.name |
| | | this.dialogForm.enable = res.enable |
| | | this.dialogForm.description = res.description |
| | | |
| | | this.tableDataDialog.forEach(item => { |
| | | item.isVisible = 0 |
| | | item.checkitem_code = item.code |
| | | item.checkitem_name = item.name |
| | | item.checkitem_descr = item.chkdesc |
| | | }) |
| | | |
| | | this.checkItemSelectArr = [...this.checkItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.checkitem_code !== x.code)) |
| | | }, |
| | | // 删除按钮 |
| | | async del(row) { |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteDeviceCheckStaned({ checkstand_code: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('删除成功!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getDeviceCheckStandArdSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已取消删除') |
| | | }) |
| | | }, |
| | | |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm.code = '' |
| | | this.dialogForm.name = '' |
| | | this.dialogForm.enable = 'Y' |
| | | this.dialogForm.description = '' |
| | | this.tableDataDialog = [] |
| | | this.getDeviceCheckItemSelect() |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // 对话框确认 |
| | | dialogVisibleConfirm() { |
| | | if (this.tableDataDialog.length === 0) { |
| | | return this.$message.info('设备关联点检项信息不能为空!') |
| | | } |
| | | if (this.tableDataDialog.filter(i => !i.checkitem_code).length > 0) { |
| | | return this.$message.info('设备关联点检项信息不能为空!') |
| | | } |
| | | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | // this.tableDataDialog.forEach((item, index) => { // 去掉正在编辑且是空checkitem_code |
| | | // if (item.isVisible === 1 && item.checkitem_code === '') { |
| | | // this.tableDataDialog.splice(index, 1) |
| | | // } |
| | | // }) |
| | | |
| | | this.tableDataDialog.filter(item => item.checkitem_code !== '') |
| | | |
| | | let Data = [] |
| | | // 数组中对象相同的去重 |
| | | Data = this.tableDataDialog.filter((currentValue, currentIndex, selfArr) => { |
| | | return selfArr.findIndex(item => item.checkitem_code === currentValue.checkitem_code) === currentIndex |
| | | }) |
| | | Data.forEach((item, index) => { |
| | | item.checkitem_seq = index + 1 |
| | | }) |
| | | |
| | | const data = { |
| | | 'code': this.dialogForm.code, |
| | | 'name': this.dialogForm.name, |
| | | 'enable': this.dialogForm.enable, |
| | | 'description': this.dialogForm.description, |
| | | 'Data': Data |
| | | } |
| | | |
| | | AddUpdateDeviceCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.getDeviceCheckStandArdSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | selectChange(val, row) { |
| | | const res = this.checkItemSelectArr.find(item => { |
| | | return item.code === val || item.name === val |
| | | }) |
| | | row.checkitem_descr = res.description |
| | | row.checkitem_code = res.code |
| | | row.checkitem_name = res.name |
| | | }, |
| | | // 新增行 |
| | | addRow() { |
| | | let flag = false |
| | | this.tableDataDialog.forEach(item => { |
| | | if (item.isVisible === 1) { |
| | | // return this.$message.info('请先确认或取消上条记录!') |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | return this.$message.info('请先确认或取消上条记录!') |
| | | } |
| | | this.tableDataDialog.push({ |
| | | checkitem_code: '', |
| | | checkitem_name: '', |
| | | checkitem_descr: '', |
| | | isscan: 'Y', |
| | | cycle: 'D', |
| | | isVisible: 1 |
| | | }) |
| | | |
| | | this.checkItemIsCancel = false |
| | | }, |
| | | editRow(row) { |
| | | let flag = false |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.isVisible === 1) { |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | return this.$message.info('请先确认或取消其它行!') |
| | | } |
| | | |
| | | this.checkItemIsCancel = false |
| | | this.checkItemSelectArr.splice(0, 0, { |
| | | code: row.checkitem_code, |
| | | name: row.checkitem_name, |
| | | description: row.checkitem_descr |
| | | }) |
| | | |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.checkitem_code === row.checkitem_code) { |
| | | this.tableDataDialog.splice(index, 1, { |
| | | checkitem_code: row.checkitem_code, |
| | | checkitem_name: row.checkitem_name, |
| | | checkitem_descr: row.checkitem_descr, |
| | | isscan: row.isscan, |
| | | cycle: row.cycle, |
| | | isVisible: 1 |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | delRow(row) { |
| | | this.checkItemSelectArr.splice(0, 0, { |
| | | code: row.checkitem_code, |
| | | name: row.checkitem_name, |
| | | description: row.checkitem_descr |
| | | }) |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.checkitem_code === row.checkitem_code) { |
| | | this.tableDataDialog.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | saveRow(row) { |
| | | if (row.checkitem_code === '' && row.checkitem_name === '') { |
| | | return this.$message.info('点检部位不能为空!') |
| | | } |
| | | row.isVisible = 0 |
| | | this.checkItemSelectArr.forEach((item, index) => { |
| | | if (item.code === row.checkitem_code) { |
| | | this.checkItemSelectArr.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | cancelRow(row) { |
| | | // this.checkItemSelectArr.forEach((item, index) => { |
| | | // if (item.code === row.checkitem_code) { |
| | | if (this.checkItemIsCancel) { |
| | | this.checkItemSelectArr.splice(0, 0, { |
| | | code: row.checkitem_code, |
| | | name: row.checkitem_name, |
| | | description: row.checkitem_descr |
| | | }) |
| | | } |
| | | this.JYIsCancel = true |
| | | // } |
| | | // }) |
| | | |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.checkitem_code === row.checkitem_code && item.isVisible === 1) { |
| | | row.isVisible = 0 |
| | | this.tableDataDialog.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 195 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | | // 关联设备 |
| | | checkeqpClick(row) { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: '正在加载数据,请稍等...', |
| | | spinner: 'el-icon-loading', |
| | | customClass: 'osloading', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }) |
| | | this.dialogFormEqp.name = row.name |
| | | this.dialogFormEqp.code = row.code |
| | | |
| | | DeviceCheckStanedAssociationEqp({ checkstand_code: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | setTimeout(() => { |
| | | loading.close() |
| | | this.dialogFormEqp.eqpAll = res.data.filter(item => item.children.length > 0) |
| | | |
| | | if (this.dialogFormEqp.eqpAll.length > 0) { |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | this.dialogFormEqp.eqpArr.push({ |
| | | code: item.code, |
| | | name: item.name, |
| | | type: item.type, |
| | | isSelected1: index === 0, |
| | | isSelected2: item.flag === 'Y' |
| | | }) |
| | | if (item.flag === 'Y') { |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | if (it.flag === 'Y') { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpAll[0].name = '全部' |
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]] |
| | | } |
| | | |
| | | this.dialogVisibleEqp = true |
| | | |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | }, 1000) |
| | | } else { |
| | | loading.close() |
| | | } |
| | | }) |
| | | }, |
| | | // 关联设备对话框关闭 |
| | | handleCloseEqp() { |
| | | this.$refs.epqTree.setCheckedKeys([]) |
| | | this.dialogFormEqp.code = '' |
| | | this.dialogFormEqp.name = '' |
| | | this.dialogFormEqp.eqpAll = [] |
| | | this.dialogFormEqp.eqpArr = [] |
| | | this.dialogFormEqp.eqpTree = [] |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [] |
| | | }, |
| | | // 大盒子点击 |
| | | myCheckboxClick(val) { |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | item.isSelected1 = item.code === val.code |
| | | if (item.code === val.code) { |
| | | this.dialogFormEqp.eqpAll[index].name = '全部' |
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]] |
| | | } |
| | | }) |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | }, |
| | | // 小盒子点击 |
| | | myCheckboxInputClick(val) { |
| | | console.log(val) |
| | | val.isSelected2 = !!val.isSelected2 |
| | | if (val.isSelected2) { // 从没选中到选中 |
| | | console.log('从没选中到选中') |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === val.code) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 1) |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | } else { // 从选中到没选中 |
| | | console.log('从选中到没选中') |
| | | const temp = [] |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === val.code) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | temp.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x)) |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | } |
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 999) |
| | | }, |
| | | // 树形复选框点击事件 |
| | | checkBoxClick(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) { |
| | | let checkedFatherCode = '' // 找到 checkedFatherCode 父code值 |
| | | console.log(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === obj.code) { |
| | | checkedFatherCode = item.code |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach((it, ind) => { |
| | | if (it.code === obj.code) { |
| | | checkedFatherCode = item.code |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | console.log(checkedFatherCode, 1) |
| | | |
| | | // 1.第一种情况当树形 半叶 不为零 全叶 不为零 |
| | | if (halfCheckedKeys.length !== 0 && checkedKeys.length !== 0) { |
| | | console.log('// 1.第一种情况当树形 半叶 不为零 全叶 不为零') |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | console.log(item.code, 777) |
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr.forEach((item, index) => { |
| | | if (item === obj.code) { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.splice(index, 1) |
| | | } |
| | | }) |
| | | checkedKeys.forEach(item => { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(item) |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...new Set(this.dialogFormEqp.eqpCodeSelectedArr)] |
| | | } |
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 666) |
| | | // 2.第二种情况当树形 半叶 为零 全叶 为零 |
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length === 0) { |
| | | console.log('// 2.第二种情况当树形 半叶 为零 全叶 为零') |
| | | const temp = [] |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = false |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', false)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | temp.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x)) |
| | | } |
| | | |
| | | // 3.第三种种情况当树形 半叶 为零 全叶 不为零 |
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length !== 0) { |
| | | console.log('// 3.第三种种情况当树形 半叶 为零 全叶 不为零') |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 取消事件 |
| | | eqpDialogVisibleCancel() { |
| | | this.dialogVisibleEqp = false |
| | | }, |
| | | // 确认事件 |
| | | eqpDialogVisibleConfirm() { |
| | | // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888) |
| | | // this.dialogVisibleEqp = false |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const data = [] |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | if (this.dialogFormEqp.eqpCodeSelectedArr.includes(it.code)) { |
| | | data.push({ |
| | | name: it.name, |
| | | code: it.code |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | SaveDeviceCheckStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisibleEqp = false |
| | | this.$notify.success('关联成功!') |
| | | this.getDeviceCheckStandArdSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <!--公共页面样式--> |
| | | <style lang="scss" scoped> |
| | | $main_color: #42b983; |
| | | |
| | | .dialogVisibleEqp { |
| | | .myCheckboxGroup { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | |
| | | .myCheckbox { |
| | | //border: 1px solid $main_color; |
| | | border: 1px solid #eee; |
| | | display: flex; |
| | | min-width: 100px; |
| | | padding: 10px; |
| | | margin: 10px 30px 0 0; |
| | | border-radius: 5px; |
| | | cursor: default; |
| | | position: relative; |
| | | |
| | | .myCheckboxInput { |
| | | margin: 1px 5px 0 0; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .myCheckboxInputLabel { |
| | | position: absolute; |
| | | left: 29px; |
| | | padding: 5px; |
| | | top: 6px; |
| | | color: transparent; |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | //.myCheckbox{ |
| | | // border: 1px solid $main_color; |
| | | //} |
| | | |
| | | input[type=checkbox] { |
| | | cursor: pointer; |
| | | position: relative; |
| | | width: 14px; |
| | | height: 14px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | input[type=checkbox]::after { |
| | | position: absolute; |
| | | top: 0; |
| | | //color: rgb(130, 35, 35); |
| | | color: $main_color; |
| | | width: 14px; |
| | | height: 14px; |
| | | display: inline-block; |
| | | visibility: visible; |
| | | padding-left: 0px; |
| | | text-align: center; |
| | | content: ' '; |
| | | border-radius: 3px |
| | | } |
| | | |
| | | input[type=checkbox]:checked::after { |
| | | //content: "✓"; |
| | | content: "√"; |
| | | color: #fff; |
| | | font-size: 12px; |
| | | font-weight: bold; |
| | | background-color: $main_color; |
| | | } |
| | | } |
| | | } |
| | | |
| | | ::v-deep .el-button--text { |
| | | font-size: 14px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .el-icon-share, .el-icon-delete, .el-icon-edit-outline { |
| | | color: $main_color; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .el-icon-edit-outline { |
| | | margin-right: 15px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary, .el-button--default, .el-button--info { |
| | | height: 34px; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 15px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary { |
| | | //background-color: $main_color !important; |
| | | } |
| | | |
| | | ::v-deep .el-button--default { |
| | | background-color: #f8f8fa; |
| | | border: none; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner { |
| | | height: 34px; |
| | | line-height: 34px; |
| | | //color: #a7a7a7; |
| | | } |
| | | |
| | | //::v-deep .el-dialog__body { |
| | | // padding: 20px 100px !important; |
| | | //} |
| | | ::v-deep .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .dialogVisibleRoles .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .importPickerClass .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | ::v-deep .el-table .caret-wrapper { |
| | | transform: scale(0.8); |
| | | } |
| | | |
| | | ::v-deep .cell { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | ::v-deep .el-table::before { |
| | | height: 0; |
| | | } |
| | | |
| | | ::v-deep .el-table__body-wrapper { |
| | | background-color: #f8f8fa; |
| | | } |
| | | |
| | | ::v-deep .el-table__body .el-table__row.hover-row td { |
| | | background-color: #eaecef; |
| | | } |
| | | |
| | | ::v-deep .el-form--inline .el-form-item__label { |
| | | color: #a7a7a7; |
| | | } |
| | | |
| | | .body ::v-deep .el-divider { |
| | | border: 1px solid #eee; |
| | | width: 99%; |
| | | margin: 10px auto; |
| | | } |
| | | |
| | | .body ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .userDialogVisible ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | ::v-deep .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .tableFixed { |
| | | ::v-deep .el-table__fixed-right { |
| | | height: 100% !important; |
| | | } |
| | | |
| | | ::v-deep .el-table__fixed { |
| | | height: 100% !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style> |
| | | .osloading { |
| | | font-size: 26px !important; |
| | | } |
| | | |
| | | .el-loading-text { |
| | | font-size: 26px !important; |
| | | } |
| | | |
| | | .el-table .custom-row { |
| | | background: #f8f8fa; |
| | | } |
| | | </style> |
| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" :style="{height:mainHeight+'px'}">
|
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between">
|
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
|
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=11_1')">导入</el-button>
|
| | | </div>
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | | <el-form-item label="标准编码" style=" display: flex;">
|
| | | <el-input v-model="form.repairstandcode" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准名称" style=" display: flex;">
|
| | | <el-input v-model="form.repairstandname" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准描述" style=" display: flex;">
|
| | | <el-input v-model="form.repairstanddescr" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | </div>
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | />
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <!-- <TableColumnSettings-->
|
| | | <!-- :list1="tableColumnSettingsArray"-->
|
| | | <!-- @tableColumnUpdate="tableColumnUpdate"-->
|
| | | <!-- />-->
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | :key="tableTimeStampKey"
|
| | | :data="tableData"
|
| | | :height="tableHeight+'px'"
|
| | | border
|
| | | class="tableFixed"
|
| | | :row-class-name="tableRowClassName"
|
| | | :style="{width: 100+'%',height:tableHeight+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | @sort-change="sortChange"
|
| | | >
|
| | |
|
| | | <el-table-column
|
| | | v-for="item in tableColumnSettingsArray"
|
| | | v-if="item.show"
|
| | | :key="item.id"
|
| | | :sortable="item.sortable"
|
| | | :prop="item.prop"
|
| | | :min-width="item.minWidth"
|
| | | :label="item.label"
|
| | | :width="item.width"
|
| | | show-tooltip-when-overflow
|
| | | :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="!row[item.prop]">/</div>
|
| | | <div v-else-if="item.prop==='main_cycle'">{{ cycleArr.find(i=>i.code===row[item.prop]).name }}</div>
|
| | | <div v-else-if="item.prop==='is_repaireqp'">
|
| | | <i
|
| | | v-if="row[item.prop]==='Y'"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | class="el-icon-share"
|
| | | @click="checkeqpClick(row)"
|
| | | />
|
| | | <i
|
| | | v-if="row[item.prop]==='N'"
|
| | | class="el-icon-share"
|
| | | style="color: rgb(180 ,181, 185)"
|
| | | @click="checkeqpClick(row)"
|
| | | />
|
| | | </div>
|
| | | <div v-else>{{ row[item.prop] }}</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | label="操作"
|
| | | fixed="right"
|
| | | width="120"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-edit-outline" @click="edit('edit',row)" />
|
| | | </el-tooltip>
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">
|
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <!--分页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes"
|
| | | popper-class="select_bottom"
|
| | | @pagination="getDeviceRepairStandArdSearch"
|
| | | />
|
| | | </div>
|
| | |
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="operation==='add'?'新增':'编辑'"
|
| | | :visible.sync="dialogVisible"
|
| | | width="800px"
|
| | | :close-on-click-modal="false"
|
| | | top="8vh"
|
| | | @closed="handleClose"
|
| | | >
|
| | | <!-- @close="handleClose"-->
|
| | | <div>
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备保养标准信息:
|
| | | </div>
|
| | | <div style="margin: 0 30px;">
|
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
|
| | | <el-form-item label="标准编码" prop="code">
|
| | | <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准名称" prop="name">
|
| | | <el-input v-model="dialogForm.name" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item required label="保养周期">
|
| | | <el-select
|
| | | v-model="dialogForm.repaircycle"
|
| | | style="width: 200px"
|
| | | placeholder="请选择"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in cycleArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="标准描述" prop="description">
|
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" />
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </div>
|
| | | <div>
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备关联保养项信息:
|
| | | </div>
|
| | | <div style="margin-bottom:10px">
|
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="addRow">新增</el-button>
|
| | | </div>
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataDialogRef"
|
| | | :data="tableDataDialog"
|
| | | :height="(tableHeight-300)+'px'"
|
| | | border
|
| | | :row-class-name="tableRowClassName"
|
| | | :style="{width: 100+'%',height:(tableHeight-300)+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | width="50"
|
| | | label="序号"
|
| | | />
|
| | | <el-table-column
|
| | | prop="repairitem_code"
|
| | | show-tooltip-when-overflow
|
| | | label="保养部位编码"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.repairitem_code }}</div>
|
| | | <el-select
|
| | | v-if="row.isVisible===1"
|
| | | v-model="row.repairitem_code"
|
| | | placeholder="请选择"
|
| | | @change="val=>selectChange(val,row)"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in repairItemSelectArr"
|
| | | :key="item.name"
|
| | | :label="item.code"
|
| | | :value="item.name"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="repairitem_name"
|
| | | label="保养部位名称"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.repairitem_name }}</div>
|
| | | <el-select
|
| | | v-if="row.isVisible===1"
|
| | | v-model="row.repairitem_code"
|
| | | placeholder="请选择"
|
| | | @change="val=>selectChange(val,row)"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in repairItemSelectArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | prop="repairitem_descr"
|
| | | label="保养要求"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.repairitem_descr }}</div>
|
| | | <el-input v-else v-model="row.repairitem_descr" />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="isscan"
|
| | | label="选择扫码"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '是' : '否' }}</div>
|
| | | <el-select
|
| | | v-if="row.isVisible===1"
|
| | | v-model="row.isscan"
|
| | | placeholder="请选择"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in checkcontrArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | label="操作"
|
| | | width="120"
|
| | | fixed="right"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="editRow(row)">编辑</el-button>
|
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="delRow(row)">删除</el-button>
|
| | |
|
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveRow(row)">确认</el-button>
|
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancelRow(row)">取消</el-button>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- 关联设备-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | title="关联设备"
|
| | | :visible.sync="dialogVisibleEqp"
|
| | | width="800px"
|
| | | top="10vh"
|
| | | :close-on-click-modal="false"
|
| | | class="dialogVisibleEqp"
|
| | | @closed="handleCloseEqp"
|
| | | @close="handleCloseEqp"
|
| | | >
|
| | | <!-- @opened="handleOpenedRoles"-->
|
| | |
|
| | | <div>
|
| | | <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 标准名称:{{ dialogFormEqp.name }}
|
| | | </div>
|
| | | <el-divider />
|
| | | <div>
|
| | | <div style="margin-bottom:20px">
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备所属车间集合:
|
| | | </div>
|
| | | <div class="myCheckboxGroup">
|
| | |
|
| | | <div
|
| | | v-for="item in dialogFormEqp.eqpArr"
|
| | | :key="item.code"
|
| | | :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}"
|
| | | class="myCheckbox"
|
| | | @click="myCheckboxClick(item)"
|
| | | >
|
| | | <!-- <input-->
|
| | | <!-- class="myCheckboxInput"-->
|
| | | <!-- type="checkbox"-->
|
| | | <!-- :value="item.code"-->
|
| | | <!-- :name="item.name"-->
|
| | | <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"-->
|
| | | <!-- @click="myCheckboxInputClick(item)"-->
|
| | | <!-- >{{ item.name }}-->
|
| | | <!-- 父子点击事件不影响-->
|
| | | <!-- onClick="event.cancelBubble = true"-->
|
| | | <el-checkbox
|
| | | :key="item.code"
|
| | | v-model="item.isSelected2"
|
| | | class="myCheckboxInput"
|
| | | :value="item.code"
|
| | | :name="item.name"
|
| | | :label="item.name"
|
| | | :checked="item.isSelected2"
|
| | | @change="myCheckboxInputClick(item)"
|
| | | />
|
| | | <div class="myCheckboxInputLabel">{{ item.name }}</div>
|
| | |
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <el-divider />
|
| | | <div>
|
| | | <div style="margin-bottom:20px">
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备信息:
|
| | | </div>
|
| | | <el-tree
|
| | | ref="epqTree"
|
| | | :data="dialogFormEqp.eqpTree"
|
| | | show-checkbox
|
| | | node-key="code"
|
| | | default-expand-all
|
| | | style="height: 320px;overflow: auto"
|
| | | :props="defaultPropsOfEqpTree"
|
| | | @check="checkBoxClick"
|
| | | />
|
| | | <!-- @check-change="checkChange"-->
|
| | |
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="eqpDialogVisibleCancel">取 消</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="eqpDialogVisibleConfirm"
|
| | | >确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import Pagination from '@/components/Pagination'
|
| | | import {
|
| | | AddUpdateDeviceRepairStandArd,
|
| | | DeleteDeviceRepairStaned,
|
| | | DeviceRepairItemSelect,
|
| | | DeviceRepairStandArdSearch,
|
| | | DeviceRepairStanedAssociationEqp,
|
| | | SaveDeviceRepairStanedAssociationEqp,
|
| | | ViewDeviceRepairStanedSearch
|
| | | } from '@/api/DeviceManager'
|
| | | import $ from 'jquery'
|
| | | import { validateCode } from '@/utils/global'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import waves from '@/directive/waves'
|
| | | import TableColumnSettings from '@/components/TableColumnSettings'
|
| | |
|
| | | export default {
|
| | | name: 'MaintainStandard',
|
| | | components: {
|
| | | Pagination, TableColumnSettings
|
| | | },
|
| | | directives: { elDragDialog, waves },
|
| | | data() {
|
| | | return {
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | form: {
|
| | | repairstandcode: '', // 标准编码
|
| | | repairstandname: '', // 标准名称
|
| | | repairstanddescr: '', // 点检管控
|
| | | prop: 'lm_date', // 排序字段
|
| | | order: 'desc', // 排序字段
|
| | | page: 1, // 第几页
|
| | | rows: 20 // 每页多少条
|
| | | },
|
| | | checkcontrArr: [
|
| | | { code: 'Y', name: '是' },
|
| | | { code: 'N', name: '否' }
|
| | | ],
|
| | | cycleArr: [
|
| | | { code: 'Y', name: '年' },
|
| | | { code: 'S', name: '季' },
|
| | | { code: 'M', name: '月' },
|
| | | { code: 'W', name: '周' }
|
| | | ],
|
| | | total: 10,
|
| | | tableData: [],
|
| | | tableColumnSettingsArray: [
|
| | | { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 隐藏列 show: false隐藏,true显示
|
| | | { minWidth: false, width: 55, prop: 'rowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom
|
| | | {
|
| | | minWidth: 110,
|
| | | width: false,
|
| | | prop: 'code',
|
| | | label: '标准编码',
|
| | | id: 3,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: 110,
|
| | | width: false,
|
| | | prop: 'name',
|
| | | label: '标准名称',
|
| | | id: 4,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: 330,
|
| | | width: false,
|
| | | prop: 'description',
|
| | | label: '标准描述',
|
| | | id: 5,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'main_cycle',
|
| | | label: '保养周期',
|
| | | id: 6,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'is_repaireqp',
|
| | | label: '关联设备',
|
| | | id: 7,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'lm_user',
|
| | | label: '创建人员',
|
| | | id: 8,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 160,
|
| | | prop: 'lm_date',
|
| | | label: '创建时间',
|
| | | id: 9,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | }
|
| | | ],
|
| | | tableTimeStampKey: new Date().getTime(), // 表格key
|
| | |
|
| | | dialogVisible: false,
|
| | | dialogForm: {
|
| | | code: '',
|
| | | name: '',
|
| | | repaircycle: 'M',
|
| | | description: ''
|
| | | },
|
| | | operation: '',
|
| | | dialogFormRules: {
|
| | |
|
| | | code: [
|
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | name: [
|
| | | { required: true, message: '请输入标准名称', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | enable: [
|
| | | { required: true, message: '', trigger: ['blur', 'change'] }
|
| | | ]
|
| | | },
|
| | | tableDataDialog: [], // 表格数据
|
| | |
|
| | | repairItemSelectArr: [],
|
| | | repairItemIsCancel: true,
|
| | | dialogVisibleEqp: false,
|
| | |
|
| | | dialogFormEqp: {
|
| | | name: '',
|
| | | code: '',
|
| | | eqpAll: [], // 车间及设备所有
|
| | | eqpArr: [], // 车间集合所有
|
| | | eqpTree: [], // 设备树形所有
|
| | | eqpCodeSelectedArr: []// 设备树形选中
|
| | | },
|
| | | defaultPropsOfEqpTree: {
|
| | | value: 'code',
|
| | | label: 'name',
|
| | | children: 'children'
|
| | | },
|
| | |
|
| | | title_value: '数据导入 / 点检部位',
|
| | | code: '23',
|
| | | shows: false
|
| | |
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | shows() {
|
| | | if (!this.shows) {
|
| | | this.getDeviceRepairStandArdSearch()
|
| | | }
|
| | | }
|
| | | },
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | | this.handleRequest()
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | | },
|
| | | methods: {
|
| | | tableColumnUpdate(val, isCopyTrue) {
|
| | | if (isCopyTrue) {
|
| | | this.tableColumnSettingsArray = val
|
| | | }
|
| | | this.tableTimeStampKey = new Date().getTime()
|
| | |
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | },
|
| | | handleRequest() {
|
| | | this.getDeviceRepairStandArdSearch().then(res => {
|
| | | if (res.code === '200') {
|
| | | this.getDeviceRepairItemSelect()
|
| | | }
|
| | | })
|
| | | },
|
| | | async getDeviceRepairStandArdSearch() {
|
| | | const res = await DeviceRepairStandArdSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | return { code: res.code }
|
| | | },
|
| | | // 排序改变时
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.getDeviceRepairStandArdSearch()
|
| | | },
|
| | | // 查询
|
| | | search() {
|
| | | this.getDeviceRepairStandArdSearch()
|
| | | },
|
| | | // 导入按钮
|
| | | upload() {
|
| | | this.shows = true
|
| | | this.$refs.importPickerFunc.newDataFunc()
|
| | | },
|
| | | colos() {
|
| | | this.shows = false
|
| | | },
|
| | | // 重置
|
| | | reset() {
|
| | | this.form.repairstandcode = ''
|
| | | this.form.repairstandname = ''
|
| | | this.form.repairstanddescr = ''
|
| | | this.getDeviceRepairStandArdSearch()
|
| | | },
|
| | |
|
| | | async getDeviceRepairItemSelect() {
|
| | | const { data: res } = await DeviceRepairItemSelect()
|
| | | this.repairItemSelectArr = res
|
| | | },
|
| | |
|
| | | // 新增按钮
|
| | | add(operation) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tableDataDialogRef.doLayout()
|
| | | })
|
| | | },
|
| | | // 修改按钮
|
| | | edit(operation, row) {
|
| | | this.operation = operation
|
| | | this.getViewDeviceRepairStanedSearch(row.code)
|
| | | this.dialogVisible = true
|
| | |
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tableDataDialogRef.doLayout()
|
| | | })
|
| | | // this.$nextTick(() => {
|
| | | // this.dialogForm.code = row.code
|
| | | // this.dialogForm.name = row.name
|
| | | // this.dialogForm.enable = row.enable
|
| | | // this.dialogForm.description = row.description
|
| | | // })
|
| | | },
|
| | | // 修改前请求接口
|
| | | async getViewDeviceRepairStanedSearch(repairstand_code) {
|
| | | const { data: res } = await ViewDeviceRepairStanedSearch({ repairstand_code })
|
| | | this.tableDataDialog = res.Data
|
| | |
|
| | | this.dialogForm.code = res.code
|
| | | this.dialogForm.name = res.name
|
| | | this.dialogForm.enable = res.enable
|
| | | this.dialogForm.description = res.description
|
| | |
|
| | | this.tableDataDialog.forEach(item => {
|
| | | item.isVisible = 0
|
| | | item.repairitem_code = item.code
|
| | | item.repairitem_name = item.name
|
| | | item.repairitem_descr = item.chk_desc
|
| | | })
|
| | |
|
| | | this.repairItemSelectArr = [...this.repairItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.repairitem_code !== x.code))
|
| | | },
|
| | | // 删除按钮
|
| | | async del(row) {
|
| | | this.$confirm('是否确认删除?', '提示', {
|
| | | confirmButtonText: '确定',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | DeleteDeviceRepairStaned({ repairstand_code: row.code }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('删除成功!')
|
| | | if (this.form.page > 1 && this.tableData.length === 1) {
|
| | | this.form.page--
|
| | | }
|
| | | this.getDeviceRepairStandArdSearch()
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$notify.info('已取消删除')
|
| | | })
|
| | | },
|
| | |
|
| | | // 对话框关闭事件
|
| | | handleClose() {
|
| | | this.dialogForm.code = ''
|
| | | this.dialogForm.name = ''
|
| | | this.dialogForm.enable = 'Y'
|
| | | this.dialogForm.description = ''
|
| | | this.tableDataDialog = []
|
| | | this.getDeviceRepairItemSelect()
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // 对话框取消
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | },
|
| | | // 对话框确认
|
| | | dialogVisibleConfirm() {
|
| | | if (this.tableDataDialog.length === 0) {
|
| | | return this.$message.info('设备关联保养项信息不能为空!')
|
| | | }
|
| | |
|
| | | this.$refs.dialogForm.validate(valid => {
|
| | | if (valid) {
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | this.tableDataDialog.filter(item => item.repairitem_code !== '')
|
| | |
|
| | | let Data = []
|
| | | // 数组中对象相同的去重
|
| | | Data = this.tableDataDialog.filter((currentValue, currentIndex, selfArr) => {
|
| | | return selfArr.findIndex(item => item.repairitem_code === currentValue.repairitem_code) === currentIndex
|
| | | })
|
| | | Data.forEach((item, index) => {
|
| | | item.repairitem_seq = index + 1
|
| | | })
|
| | |
|
| | | const data = {
|
| | | 'code': this.dialogForm.code,
|
| | | 'name': this.dialogForm.name,
|
| | | 'repaircycle': this.dialogForm.repaircycle,
|
| | | 'description': this.dialogForm.description,
|
| | | 'Data': Data
|
| | | }
|
| | |
|
| | | AddUpdateDeviceRepairStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
|
| | | if (res.code === '200') {
|
| | | this.dialogVisible = false
|
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
|
| | | this.getDeviceRepairStandArdSearch()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | } else {
|
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | selectChange(val, row) {
|
| | | const res = this.repairItemSelectArr.find(item => {
|
| | | return item.code === val || item.name === val
|
| | | })
|
| | | row.repairitem_descr = res.description
|
| | | row.repairitem_code = res.code
|
| | | row.repairitem_name = res.name
|
| | | },
|
| | | // 新增行
|
| | | addRow() {
|
| | | let flag = false
|
| | | this.tableDataDialog.forEach(item => {
|
| | | if (item.isVisible === 1) {
|
| | | // return this.$message.info('请先确认或取消上条记录!')
|
| | | flag = true
|
| | | }
|
| | | })
|
| | | if (flag) {
|
| | | return this.$message.info('请先确认或取消上条记录!')
|
| | | }
|
| | | this.tableDataDialog.push({
|
| | | repairitem_code: '',
|
| | | repairitem_name: '',
|
| | | repairitem_descr: '',
|
| | | isscan: 'Y',
|
| | | isVisible: 1
|
| | | })
|
| | |
|
| | | this.repairItemIsCancel = false
|
| | | },
|
| | | editRow(row) {
|
| | | let flag = false
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.isVisible === 1) {
|
| | | flag = true
|
| | | }
|
| | | })
|
| | | if (flag) {
|
| | | return this.$message.info('请先确认或取消其它行!')
|
| | | }
|
| | |
|
| | | this.repairItemIsCancel = false
|
| | | this.repairItemSelectArr.splice(0, 0, {
|
| | | code: row.repairitem_code,
|
| | | name: row.repairitem_name,
|
| | | description: row.repairitem_descr
|
| | | })
|
| | |
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.repairitem_code === row.repairitem_code) {
|
| | | this.tableDataDialog.splice(index, 1, {
|
| | | repairitem_code: row.repairitem_code,
|
| | | repairitem_name: row.repairitem_name,
|
| | | repairitem_descr: row.repairitem_descr,
|
| | | isscan: row.isscan,
|
| | | isVisible: 1
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | | delRow(row) {
|
| | | this.repairItemSelectArr.splice(0, 0, {
|
| | | code: row.repairitem_code,
|
| | | name: row.repairitem_name,
|
| | | description: row.repairitem_descr
|
| | | })
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.repairitem_code === row.repairitem_code) {
|
| | | this.tableDataDialog.splice(index, 1)
|
| | | }
|
| | | })
|
| | | },
|
| | | saveRow(row) {
|
| | | if (row.repairitem_code === '' && row.repairitem_name === '') {
|
| | | return this.$message.info('点检部位不能为空!')
|
| | | }
|
| | | row.isVisible = 0
|
| | | this.repairItemSelectArr.forEach((item, index) => {
|
| | | if (item.code === row.repairitem_code) {
|
| | | this.repairItemSelectArr.splice(index, 1)
|
| | | }
|
| | | })
|
| | | },
|
| | | cancelRow(row) {
|
| | | if (this.repairItemIsCancel) {
|
| | | this.repairItemSelectArr.splice(0, 0, {
|
| | | code: row.repairitem_code,
|
| | | name: row.repairitem_name,
|
| | | description: row.repairitem_descr
|
| | | })
|
| | | }
|
| | | this.JYIsCancel = true
|
| | |
|
| | | this.tableDataDialog.forEach((item, index) => {
|
| | | if (item.repairitem_code === row.repairitem_code && item.isVisible === 1) {
|
| | | row.isVisible = 0
|
| | | this.tableDataDialog.splice(index, 1)
|
| | | }
|
| | | })
|
| | | },
|
| | | // 获取页面高度
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 195
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | },
|
| | | tableRowClassName({ row, rowIndex }) {
|
| | | return 'custom-row'
|
| | | },
|
| | | // 关联设备
|
| | | checkeqpClick(row) {
|
| | | const loading = this.$loading({
|
| | | lock: true,
|
| | | text: '正在加载数据,请稍等...',
|
| | | spinner: 'el-icon-loading',
|
| | | customClass: 'osloading',
|
| | | background: 'rgba(0, 0, 0, 0.7)'
|
| | | })
|
| | |
|
| | | this.dialogFormEqp.name = row.name
|
| | | this.dialogFormEqp.code = row.code
|
| | |
|
| | | DeviceRepairStanedAssociationEqp({ repairstand_code: row.code }).then(res => {
|
| | | if (res.code === '200') {
|
| | | setTimeout(() => {
|
| | | loading.close()
|
| | | this.dialogFormEqp.eqpAll = res.data.filter(item => item.children.length > 0)
|
| | |
|
| | | if (this.dialogFormEqp.eqpAll.length > 0) {
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | this.dialogFormEqp.eqpArr.push({
|
| | | code: item.code,
|
| | | name: item.name,
|
| | | type: item.type,
|
| | | isSelected1: index === 0,
|
| | | isSelected2: item.flag === 'Y'
|
| | | })
|
| | | if (item.flag === 'Y') {
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | if (it.flag === 'Y') {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpAll[0].name = '全部'
|
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]]
|
| | | }
|
| | |
|
| | | this.dialogVisibleEqp = true
|
| | |
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | }, 1000)
|
| | | } else {
|
| | | loading.close()
|
| | | }
|
| | | })
|
| | | },
|
| | | // 关联设备对话框关闭
|
| | | handleCloseEqp() {
|
| | | this.$refs.epqTree.setCheckedKeys([])
|
| | | this.dialogFormEqp.code = ''
|
| | | this.dialogFormEqp.name = ''
|
| | | this.dialogFormEqp.eqpAll = []
|
| | | this.dialogFormEqp.eqpArr = []
|
| | | this.dialogFormEqp.eqpTree = []
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = []
|
| | | },
|
| | | // 大盒子点击
|
| | | myCheckboxClick(val) {
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | item.isSelected1 = item.code === val.code
|
| | | if (item.code === val.code) {
|
| | | this.dialogFormEqp.eqpAll[index].name = '全部'
|
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]]
|
| | | }
|
| | | })
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | },
|
| | | // 小盒子点击
|
| | | myCheckboxInputClick(val) {
|
| | | // console.log(val)
|
| | | val.isSelected2 = !!val.isSelected2
|
| | | if (val.isSelected2) { // 从没选中到选中
|
| | | console.log('从没选中到选中')
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === val.code) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 1)
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | } else { // 从选中到没选中
|
| | | console.log('从选中到没选中')
|
| | | const temp = []
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === val.code) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | temp.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x))
|
| | | this.$nextTick(() => { // 树形回显
|
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
|
| | | })
|
| | | }
|
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 999)
|
| | | },
|
| | | // 树形复选框点击事件
|
| | | checkBoxClick(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) {
|
| | | let checkedFatherCode = '' // 找到 checkedFatherCode 父code值
|
| | | console.log(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys })
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === obj.code) {
|
| | | checkedFatherCode = item.code
|
| | | }
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach((it, ind) => {
|
| | | if (it.code === obj.code) {
|
| | | checkedFatherCode = item.code
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | console.log(checkedFatherCode, 1)
|
| | |
|
| | | // 1.第一种情况当树形 半叶 不为零 全叶 不为零
|
| | | if (halfCheckedKeys.length !== 0 && checkedKeys.length !== 0) {
|
| | | console.log('// 1.第一种情况当树形 半叶 不为零 全叶 不为零')
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | console.log(item.code, 777)
|
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.forEach((item, index) => {
|
| | | if (item === obj.code) {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.splice(index, 1)
|
| | | }
|
| | | })
|
| | | checkedKeys.forEach(item => {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(item)
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...new Set(this.dialogFormEqp.eqpCodeSelectedArr)]
|
| | | }
|
| | |
|
| | | // 2.第二种情况当树形 半叶 为零 全叶 为零
|
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length === 0) {
|
| | | console.log('// 2.第二种情况当树形 半叶 为零 全叶 为零')
|
| | | const temp = []
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = false
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', false)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | temp.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x))
|
| | | }
|
| | |
|
| | | // 3.第三种种情况当树形 半叶 为零 全叶 不为零
|
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length !== 0) {
|
| | | console.log('// 3.第三种种情况当树形 半叶 为零 全叶 不为零')
|
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显
|
| | | })
|
| | | }
|
| | | })
|
| | |
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.code === checkedFatherCode) {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | }
|
| | | },
|
| | | // 取消事件
|
| | | eqpDialogVisibleCancel() {
|
| | | this.dialogVisibleEqp = false
|
| | | },
|
| | | // 确认事件
|
| | | eqpDialogVisibleConfirm() {
|
| | | // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888)
|
| | | // this.dialogVisibleEqp = false
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const data = []
|
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => {
|
| | | if (item.children && item.children.length > 0) {
|
| | | item.children.forEach(it => {
|
| | | if (this.dialogFormEqp.eqpCodeSelectedArr.includes(it.code)) {
|
| | | data.push({
|
| | | name: it.name,
|
| | | code: it.code
|
| | | })
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | |
|
| | | SaveDeviceRepairStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.dialogVisibleEqp = false
|
| | | this.$notify.success('关联成功!')
|
| | | this.getDeviceRepairStandArdSearch()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | }
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <!--公共页面样式-->
|
| | | <style lang="scss" scoped>
|
| | | $main_color: #42b983;
|
| | |
|
| | | .dialogVisibleEqp {
|
| | | .myCheckboxGroup {
|
| | | display: flex;
|
| | | flex-wrap: wrap;
|
| | |
|
| | | .myCheckbox {
|
| | | //border: 1px solid $main_color;
|
| | | border: 1px solid #eee;
|
| | | display: flex;
|
| | | min-width: 100px;
|
| | | padding: 10px;
|
| | | margin: 10px 30px 0 0;
|
| | | border-radius: 5px;
|
| | | cursor: default;
|
| | | position: relative;
|
| | |
|
| | | .myCheckboxInput {
|
| | | margin: 1px 5px 0 0;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .myCheckboxInputLabel {
|
| | | position: absolute;
|
| | | left: 29px;
|
| | | padding: 5px;
|
| | | top: 6px;
|
| | | color: transparent;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | //.myCheckbox{
|
| | | // border: 1px solid $main_color;
|
| | | //}
|
| | |
|
| | | input[type=checkbox] {
|
| | | cursor: pointer;
|
| | | position: relative;
|
| | | width: 14px;
|
| | | height: 14px;
|
| | | font-size: 14px;
|
| | | }
|
| | |
|
| | | input[type=checkbox]::after {
|
| | | position: absolute;
|
| | | top: 0;
|
| | | //color: rgb(130, 35, 35);
|
| | | color: $main_color;
|
| | | width: 14px;
|
| | | height: 14px;
|
| | | display: inline-block;
|
| | | visibility: visible;
|
| | | padding-left: 0px;
|
| | | text-align: center;
|
| | | content: ' ';
|
| | | border-radius: 3px
|
| | | }
|
| | |
|
| | | input[type=checkbox]:checked::after {
|
| | | //content: "✓";
|
| | | content: "√";
|
| | | color: #fff;
|
| | | font-size: 12px;
|
| | | font-weight: bold;
|
| | | background-color: $main_color;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--text {
|
| | | font-size: 14px;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .el-icon-share, .el-icon-delete, .el-icon-edit-outline {
|
| | | color: $main_color;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .el-icon-edit-outline {
|
| | | margin-right: 15px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--primary, .el-button--default, .el-button--info {
|
| | | height: 34px;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | padding: 0 15px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--primary {
|
| | | //background-color: $main_color !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--default {
|
| | | background-color: #f8f8fa;
|
| | | border: none;
|
| | | }
|
| | |
|
| | | ::v-deep .el-input__inner {
|
| | | height: 34px;
|
| | | line-height: 34px;
|
| | | //color: #a7a7a7;
|
| | | }
|
| | |
|
| | | //::v-deep .el-dialog__body {
|
| | | // padding: 20px 100px !important;
|
| | | //}
|
| | | ::v-deep .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .dialogVisibleRoles .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .importPickerClass .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog__footer {
|
| | | display: flex;
|
| | | justify-content: flex-end;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table .caret-wrapper {
|
| | | transform: scale(0.8);
|
| | | }
|
| | |
|
| | | ::v-deep .cell {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table::before {
|
| | | height: 0;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__body-wrapper {
|
| | | background-color: #f8f8fa;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__body .el-table__row.hover-row td {
|
| | | background-color: #eaecef;
|
| | | }
|
| | |
|
| | | ::v-deep .el-form--inline .el-form-item__label {
|
| | | color: #a7a7a7;
|
| | | }
|
| | |
|
| | | .body ::v-deep .el-divider {
|
| | | border: 1px solid #eee;
|
| | | width: 99%;
|
| | | margin: 10px auto;
|
| | | }
|
| | |
|
| | | .body ::v-deep .el-form-item {
|
| | | margin-bottom: 0;
|
| | | }
|
| | |
|
| | | .userDialogVisible ::v-deep .el-form-item {
|
| | | margin-bottom: 0;
|
| | | }
|
| | |
|
| | | ::v-deep .el-select__caret {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | |
|
| | | .tableFixed {
|
| | | ::v-deep .el-table__fixed-right {
|
| | | height: 100% !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__fixed {
|
| | | height: 100% !important;
|
| | | }
|
| | | }
|
| | |
|
| | | </style>
|
| | | <style>
|
| | | .osloading{
|
| | | font-size: 26px !important;
|
| | | }
|
| | |
|
| | | .el-loading-text{
|
| | | font-size: 26px !important;
|
| | | }
|
| | | .el-table .custom-row {
|
| | | background: #f8f8fa;
|
| | | }
|
| | | </style>
|
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> |
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=11_1')">导入</el-button> |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="标准编码" style=" display: flex;"> |
| | | <el-input v-model="form.repairstandcode" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准名称" style=" display: flex;"> |
| | | <el-input v-model="form.repairstandname" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准描述" style=" display: flex;"> |
| | | <el-input v-model="form.repairstanddescr" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | </el-form> |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | /> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <!-- <TableColumnSettings--> |
| | | <!-- :list1="tableColumnSettingsArray"--> |
| | | <!-- @tableColumnUpdate="tableColumnUpdate"--> |
| | | <!-- />--> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :key="tableTimeStampKey" |
| | | :data="tableData" |
| | | :height="tableHeight+'px'" |
| | | border |
| | | class="tableFixed" |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | |
| | | <el-table-column |
| | | v-for="item in tableColumnSettingsArray" |
| | | v-if="item.show" |
| | | :key="item.id" |
| | | :sortable="item.sortable" |
| | | :prop="item.prop" |
| | | :min-width="item.minWidth" |
| | | :label="item.label" |
| | | :width="item.width" |
| | | show-tooltip-when-overflow |
| | | :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="!row[item.prop]">/</div> |
| | | <div v-else-if="item.prop==='main_cycle'">{{ cycleArr.find(i=>i.code===row[item.prop]).name }}</div> |
| | | <div v-else-if="item.prop==='is_repaireqp'"> |
| | | <i |
| | | v-if="row[item.prop]==='Y'" |
| | | :style="{color:$store.state.settings.theme}" |
| | | class="el-icon-share" |
| | | @click="checkeqpClick(row)" |
| | | /> |
| | | <i |
| | | v-if="row[item.prop]==='N'" |
| | | class="el-icon-share" |
| | | style="color: rgb(180 ,181, 185)" |
| | | @click="checkeqpClick(row)" |
| | | /> |
| | | </div> |
| | | <div v-else>{{ row[item.prop] }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | fixed="right" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="编辑" placement="top"> |
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-edit-outline" @click="edit('edit',row)" /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top"> |
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--分页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getDeviceRepairStandArdSearch" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="8vh" |
| | | @closed="handleClose" |
| | | > |
| | | <!-- @close="handleClose"--> |
| | | <div> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备保养标准信息: |
| | | </div> |
| | | <div style="margin: 0 30px;"> |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="标准编码" prop="code"> |
| | | <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准名称" prop="name"> |
| | | <el-input v-model="dialogForm.name" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item required label="保养周期"> |
| | | <el-select |
| | | v-model="dialogForm.repaircycle" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in cycleArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="标准描述" prop="description"> |
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />设备关联保养项信息: |
| | | </div> |
| | | <div style="margin-bottom:10px"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="addRow">新增</el-button> |
| | | </div> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataDialogRef" |
| | | :data="tableDataDialog" |
| | | :height="(tableHeight-300)+'px'" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:(tableHeight-300)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | width="50" |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="repairitem_code" |
| | | show-tooltip-when-overflow |
| | | label="保养部位编码" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.repairitem_code }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.repairitem_code" |
| | | placeholder="请选择" |
| | | @change="val=>selectChange(val,row)" |
| | | > |
| | | <el-option |
| | | v-for="item in repairItemSelectArr" |
| | | :key="item.name" |
| | | :label="item.code" |
| | | :value="item.name" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="repairitem_name" |
| | | label="保养部位名称" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.repairitem_name }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.repairitem_code" |
| | | placeholder="请选择" |
| | | @change="val=>selectChange(val,row)" |
| | | > |
| | | <el-option |
| | | v-for="item in repairItemSelectArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="repairitem_descr" |
| | | label="保养要求" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.repairitem_descr }}</div> |
| | | <el-input v-else v-model="row.repairitem_descr" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="isscan" |
| | | label="选择扫码" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '是' : '否' }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.isscan" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in checkcontrArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="editRow(row)">编辑</el-button> |
| | | <el-button v-if="row.isVisible===0" v-waves type="text" @click="delRow(row)">删除</el-button> |
| | | |
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveRow(row)">确认</el-button> |
| | | <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancelRow(row)">取消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 关联设备--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | title="关联设备" |
| | | :visible.sync="dialogVisibleEqp" |
| | | width="800px" |
| | | top="10vh" |
| | | :close-on-click-modal="false" |
| | | class="dialogVisibleEqp" |
| | | @closed="handleCloseEqp" |
| | | @close="handleCloseEqp" |
| | | > |
| | | <!-- @opened="handleOpenedRoles"--> |
| | | |
| | | <div> |
| | | <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 标准名称:{{ dialogFormEqp.name }} |
| | | </div> |
| | | <el-divider /> |
| | | <div> |
| | | <div style="margin-bottom:20px"> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备所属车间集合: |
| | | </div> |
| | | <div class="myCheckboxGroup"> |
| | | |
| | | <div |
| | | v-for="item in dialogFormEqp.eqpArr" |
| | | :key="item.code" |
| | | :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}" |
| | | class="myCheckbox" |
| | | @click="myCheckboxClick(item)" |
| | | > |
| | | <!-- <input--> |
| | | <!-- class="myCheckboxInput"--> |
| | | <!-- type="checkbox"--> |
| | | <!-- :value="item.code"--> |
| | | <!-- :name="item.name"--> |
| | | <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"--> |
| | | <!-- @click="myCheckboxInputClick(item)"--> |
| | | <!-- >{{ item.name }}--> |
| | | <!-- 父子点击事件不影响--> |
| | | <!-- onClick="event.cancelBubble = true"--> |
| | | <el-checkbox |
| | | :key="item.code" |
| | | v-model="item.isSelected2" |
| | | class="myCheckboxInput" |
| | | :value="item.code" |
| | | :name="item.name" |
| | | :label="item.name" |
| | | :checked="item.isSelected2" |
| | | @change="myCheckboxInputClick(item)" |
| | | /> |
| | | <div class="myCheckboxInputLabel">{{ item.name }}</div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-divider /> |
| | | <div> |
| | | <div style="margin-bottom:20px"> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 设备信息: |
| | | </div> |
| | | <el-tree |
| | | ref="epqTree" |
| | | :data="dialogFormEqp.eqpTree" |
| | | show-checkbox |
| | | node-key="code" |
| | | default-expand-all |
| | | style="height: 320px;overflow: auto" |
| | | :props="defaultPropsOfEqpTree" |
| | | @check="checkBoxClick" |
| | | /> |
| | | <!-- @check-change="checkChange"--> |
| | | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="eqpDialogVisibleCancel">取 消</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="eqpDialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateDeviceRepairStandArd, |
| | | DeleteDeviceRepairStaned, |
| | | DeviceRepairItemSelect, |
| | | DeviceRepairStandArdSearch, |
| | | DeviceRepairStanedAssociationEqp, |
| | | SaveDeviceRepairStanedAssociationEqp, |
| | | ViewDeviceRepairStanedSearch |
| | | } from '@/api/DeviceManager' |
| | | import $ from 'jquery' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import TableColumnSettings from '@/components/TableColumnSettings' |
| | | |
| | | export default { |
| | | name: 'MaintainStandard', |
| | | components: { |
| | | Pagination, TableColumnSettings |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | repairstandcode: '', // 标准编码 |
| | | repairstandname: '', // 标准名称 |
| | | repairstanddescr: '', // 点检管控 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | checkcontrArr: [ |
| | | { code: 'Y', name: '是' }, |
| | | { code: 'N', name: '否' } |
| | | ], |
| | | cycleArr: [ |
| | | { code: 'Y', name: '年' }, |
| | | { code: 'S', name: '季' }, |
| | | { code: 'M', name: '月' }, |
| | | { code: 'W', name: '周' } |
| | | ], |
| | | total: 10, |
| | | tableData: [], |
| | | tableColumnSettingsArray: [ |
| | | { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 隐藏列 show: false隐藏,true显示 |
| | | { minWidth: false, width: 55, prop: 'rowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'code', |
| | | label: '标准编码', |
| | | id: 3, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'name', |
| | | label: '标准名称', |
| | | id: 4, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 330, |
| | | width: false, |
| | | prop: 'description', |
| | | label: '标准描述', |
| | | id: 5, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'main_cycle', |
| | | label: '保养周期', |
| | | id: 6, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'is_repaireqp', |
| | | label: '关联设备', |
| | | id: 7, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'lm_user', |
| | | label: '创建人员', |
| | | id: 8, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 160, |
| | | prop: 'lm_date', |
| | | label: '创建时间', |
| | | id: 9, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | } |
| | | ], |
| | | tableTimeStampKey: new Date().getTime(), // 表格key |
| | | |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | code: '', |
| | | name: '', |
| | | repaircycle: 'M', |
| | | description: '' |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | |
| | | code: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | name: [ |
| | | { required: true, message: '请输入标准名称', trigger: ['blur', 'change'] } |
| | | ], |
| | | enable: [ |
| | | { required: true, message: '', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | tableDataDialog: [], // 表格数据 |
| | | |
| | | repairItemSelectArr: [], |
| | | repairItemIsCancel: true, |
| | | dialogVisibleEqp: false, |
| | | |
| | | dialogFormEqp: { |
| | | name: '', |
| | | code: '', |
| | | eqpAll: [], // 车间及设备所有 |
| | | eqpArr: [], // 车间集合所有 |
| | | eqpTree: [], // 设备树形所有 |
| | | eqpCodeSelectedArr: []// 设备树形选中 |
| | | }, |
| | | defaultPropsOfEqpTree: { |
| | | value: 'code', |
| | | label: 'name', |
| | | children: 'children' |
| | | }, |
| | | |
| | | title_value: '数据导入 / 点检部位', |
| | | code: '23', |
| | | shows: false |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | shows() { |
| | | if (!this.shows) { |
| | | this.getDeviceRepairStandArdSearch() |
| | | } |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | this.handleRequest() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | tableColumnUpdate(val, isCopyTrue) { |
| | | if (isCopyTrue) { |
| | | this.tableColumnSettingsArray = val |
| | | } |
| | | this.tableTimeStampKey = new Date().getTime() |
| | | |
| | | this.$refs.tableDataRef.doLayout() |
| | | }, |
| | | handleRequest() { |
| | | this.getDeviceRepairStandArdSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getDeviceRepairItemSelect() |
| | | } |
| | | }) |
| | | }, |
| | | async getDeviceRepairStandArdSearch() { |
| | | const res = await DeviceRepairStandArdSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | return { code: res.code } |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getDeviceRepairStandArdSearch() |
| | | }, |
| | | // 查询 |
| | | search() { |
| | | this.getDeviceRepairStandArdSearch() |
| | | }, |
| | | // 导入按钮 |
| | | upload() { |
| | | this.shows = true |
| | | this.$refs.importPickerFunc.newDataFunc() |
| | | }, |
| | | colos() { |
| | | this.shows = false |
| | | }, |
| | | // 重置 |
| | | reset() { |
| | | this.form.repairstandcode = '' |
| | | this.form.repairstandname = '' |
| | | this.form.repairstanddescr = '' |
| | | this.getDeviceRepairStandArdSearch() |
| | | }, |
| | | |
| | | async getDeviceRepairItemSelect() { |
| | | const { data: res } = await DeviceRepairItemSelect() |
| | | this.repairItemSelectArr = res |
| | | }, |
| | | |
| | | // 新增按钮 |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataDialogRef.doLayout() |
| | | }) |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | | this.operation = operation |
| | | this.getViewDeviceRepairStanedSearch(row.code) |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataDialogRef.doLayout() |
| | | }) |
| | | // this.$nextTick(() => { |
| | | // this.dialogForm.code = row.code |
| | | // this.dialogForm.name = row.name |
| | | // this.dialogForm.enable = row.enable |
| | | // this.dialogForm.description = row.description |
| | | // }) |
| | | }, |
| | | // 修改前请求接口 |
| | | async getViewDeviceRepairStanedSearch(repairstand_code) { |
| | | const { data: res } = await ViewDeviceRepairStanedSearch({ repairstand_code }) |
| | | this.tableDataDialog = res.Data |
| | | |
| | | this.dialogForm.code = res.code |
| | | this.dialogForm.name = res.name |
| | | this.dialogForm.enable = res.enable |
| | | this.dialogForm.description = res.description |
| | | |
| | | this.tableDataDialog.forEach(item => { |
| | | item.isVisible = 0 |
| | | item.repairitem_code = item.code |
| | | item.repairitem_name = item.name |
| | | item.repairitem_descr = item.chk_desc |
| | | }) |
| | | |
| | | this.repairItemSelectArr = [...this.repairItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.repairitem_code !== x.code)) |
| | | }, |
| | | // 删除按钮 |
| | | async del(row) { |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteDeviceRepairStaned({ repairstand_code: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('删除成功!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getDeviceRepairStandArdSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已取消删除') |
| | | }) |
| | | }, |
| | | |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm.code = '' |
| | | this.dialogForm.name = '' |
| | | this.dialogForm.enable = 'Y' |
| | | this.dialogForm.description = '' |
| | | this.tableDataDialog = [] |
| | | this.getDeviceRepairItemSelect() |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // 对话框确认 |
| | | dialogVisibleConfirm() { |
| | | if (this.tableDataDialog.length === 0) { |
| | | return this.$message.info('设备关联保养项信息不能为空!') |
| | | } |
| | | |
| | | if (this.tableDataDialog.filter(i => !i.repairitem_code).length > 0) { |
| | | return this.$message.info('设备关联保养项信息不能为空!') |
| | | } |
| | | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | this.tableDataDialog.filter(item => item.repairitem_code !== '') |
| | | |
| | | let Data = [] |
| | | // 数组中对象相同的去重 |
| | | Data = this.tableDataDialog.filter((currentValue, currentIndex, selfArr) => { |
| | | return selfArr.findIndex(item => item.repairitem_code === currentValue.repairitem_code) === currentIndex |
| | | }) |
| | | Data.forEach((item, index) => { |
| | | item.repairitem_seq = index + 1 |
| | | }) |
| | | |
| | | const data = { |
| | | 'code': this.dialogForm.code, |
| | | 'name': this.dialogForm.name, |
| | | 'repaircycle': this.dialogForm.repaircycle, |
| | | 'description': this.dialogForm.description, |
| | | 'Data': Data |
| | | } |
| | | |
| | | AddUpdateDeviceRepairStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.getDeviceRepairStandArdSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | selectChange(val, row) { |
| | | const res = this.repairItemSelectArr.find(item => { |
| | | return item.code === val || item.name === val |
| | | }) |
| | | row.repairitem_descr = res.description |
| | | row.repairitem_code = res.code |
| | | row.repairitem_name = res.name |
| | | }, |
| | | // 新增行 |
| | | addRow() { |
| | | let flag = false |
| | | this.tableDataDialog.forEach(item => { |
| | | if (item.isVisible === 1) { |
| | | // return this.$message.info('请先确认或取消上条记录!') |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | return this.$message.info('请先确认或取消上条记录!') |
| | | } |
| | | this.tableDataDialog.push({ |
| | | repairitem_code: '', |
| | | repairitem_name: '', |
| | | repairitem_descr: '', |
| | | isscan: 'Y', |
| | | isVisible: 1 |
| | | }) |
| | | |
| | | this.repairItemIsCancel = false |
| | | }, |
| | | editRow(row) { |
| | | let flag = false |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.isVisible === 1) { |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | return this.$message.info('请先确认或取消其它行!') |
| | | } |
| | | |
| | | this.repairItemIsCancel = false |
| | | this.repairItemSelectArr.splice(0, 0, { |
| | | code: row.repairitem_code, |
| | | name: row.repairitem_name, |
| | | description: row.repairitem_descr |
| | | }) |
| | | |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.repairitem_code === row.repairitem_code) { |
| | | this.tableDataDialog.splice(index, 1, { |
| | | repairitem_code: row.repairitem_code, |
| | | repairitem_name: row.repairitem_name, |
| | | repairitem_descr: row.repairitem_descr, |
| | | isscan: row.isscan, |
| | | isVisible: 1 |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | delRow(row) { |
| | | this.repairItemSelectArr.splice(0, 0, { |
| | | code: row.repairitem_code, |
| | | name: row.repairitem_name, |
| | | description: row.repairitem_descr |
| | | }) |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.repairitem_code === row.repairitem_code) { |
| | | this.tableDataDialog.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | saveRow(row) { |
| | | if (row.repairitem_code === '' && row.repairitem_name === '') { |
| | | return this.$message.info('点检部位不能为空!') |
| | | } |
| | | row.isVisible = 0 |
| | | this.repairItemSelectArr.forEach((item, index) => { |
| | | if (item.code === row.repairitem_code) { |
| | | this.repairItemSelectArr.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | cancelRow(row) { |
| | | if (this.repairItemIsCancel) { |
| | | this.repairItemSelectArr.splice(0, 0, { |
| | | code: row.repairitem_code, |
| | | name: row.repairitem_name, |
| | | description: row.repairitem_descr |
| | | }) |
| | | } |
| | | this.JYIsCancel = true |
| | | |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.repairitem_code === row.repairitem_code && item.isVisible === 1) { |
| | | row.isVisible = 0 |
| | | this.tableDataDialog.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 195 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | | // 关联设备 |
| | | checkeqpClick(row) { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: '正在加载数据,请稍等...', |
| | | spinner: 'el-icon-loading', |
| | | customClass: 'osloading', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }) |
| | | |
| | | this.dialogFormEqp.name = row.name |
| | | this.dialogFormEqp.code = row.code |
| | | |
| | | DeviceRepairStanedAssociationEqp({ repairstand_code: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | setTimeout(() => { |
| | | loading.close() |
| | | this.dialogFormEqp.eqpAll = res.data.filter(item => item.children.length > 0) |
| | | |
| | | if (this.dialogFormEqp.eqpAll.length > 0) { |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | this.dialogFormEqp.eqpArr.push({ |
| | | code: item.code, |
| | | name: item.name, |
| | | type: item.type, |
| | | isSelected1: index === 0, |
| | | isSelected2: item.flag === 'Y' |
| | | }) |
| | | if (item.flag === 'Y') { |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | if (it.flag === 'Y') { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpAll[0].name = '全部' |
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]] |
| | | } |
| | | |
| | | this.dialogVisibleEqp = true |
| | | |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | }, 1000) |
| | | } else { |
| | | loading.close() |
| | | } |
| | | }) |
| | | }, |
| | | // 关联设备对话框关闭 |
| | | handleCloseEqp() { |
| | | this.$refs.epqTree.setCheckedKeys([]) |
| | | this.dialogFormEqp.code = '' |
| | | this.dialogFormEqp.name = '' |
| | | this.dialogFormEqp.eqpAll = [] |
| | | this.dialogFormEqp.eqpArr = [] |
| | | this.dialogFormEqp.eqpTree = [] |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [] |
| | | }, |
| | | // 大盒子点击 |
| | | myCheckboxClick(val) { |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | item.isSelected1 = item.code === val.code |
| | | if (item.code === val.code) { |
| | | this.dialogFormEqp.eqpAll[index].name = '全部' |
| | | this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]] |
| | | } |
| | | }) |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | }, |
| | | // 小盒子点击 |
| | | myCheckboxInputClick(val) { |
| | | // console.log(val) |
| | | val.isSelected2 = !!val.isSelected2 |
| | | if (val.isSelected2) { // 从没选中到选中 |
| | | console.log('从没选中到选中') |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === val.code) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 1) |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | } else { // 从选中到没选中 |
| | | console.log('从选中到没选中') |
| | | const temp = [] |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === val.code) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | temp.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x)) |
| | | this.$nextTick(() => { // 树形回显 |
| | | this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr) |
| | | }) |
| | | } |
| | | console.log(this.dialogFormEqp.eqpCodeSelectedArr, 999) |
| | | }, |
| | | // 树形复选框点击事件 |
| | | checkBoxClick(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) { |
| | | let checkedFatherCode = '' // 找到 checkedFatherCode 父code值 |
| | | console.log(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === obj.code) { |
| | | checkedFatherCode = item.code |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach((it, ind) => { |
| | | if (it.code === obj.code) { |
| | | checkedFatherCode = item.code |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | console.log(checkedFatherCode, 1) |
| | | |
| | | // 1.第一种情况当树形 半叶 不为零 全叶 不为零 |
| | | if (halfCheckedKeys.length !== 0 && checkedKeys.length !== 0) { |
| | | console.log('// 1.第一种情况当树形 半叶 不为零 全叶 不为零') |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | console.log(item.code, 777) |
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr.forEach((item, index) => { |
| | | if (item === obj.code) { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.splice(index, 1) |
| | | } |
| | | }) |
| | | checkedKeys.forEach(item => { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(item) |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...new Set(this.dialogFormEqp.eqpCodeSelectedArr)] |
| | | } |
| | | |
| | | // 2.第二种情况当树形 半叶 为零 全叶 为零 |
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length === 0) { |
| | | console.log('// 2.第二种情况当树形 半叶 为零 全叶 为零') |
| | | const temp = [] |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = false |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', false)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | temp.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x)) |
| | | } |
| | | |
| | | // 3.第三种种情况当树形 半叶 为零 全叶 不为零 |
| | | if (halfCheckedKeys.length === 0 && checkedKeys.length !== 0) { |
| | | console.log('// 3.第三种种情况当树形 半叶 为零 全叶 不为零') |
| | | this.dialogFormEqp.eqpArr.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | this.dialogFormEqp.eqpArr[index].isSelected2 = true |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', true)// 自定义单选框回显 |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.code === checkedFatherCode) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | this.dialogFormEqp.eqpCodeSelectedArr.push(it.code) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 取消事件 |
| | | eqpDialogVisibleCancel() { |
| | | this.dialogVisibleEqp = false |
| | | }, |
| | | // 确认事件 |
| | | eqpDialogVisibleConfirm() { |
| | | // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888) |
| | | // this.dialogVisibleEqp = false |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const data = [] |
| | | this.dialogFormEqp.eqpAll.forEach((item, index) => { |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(it => { |
| | | if (this.dialogFormEqp.eqpCodeSelectedArr.includes(it.code)) { |
| | | data.push({ |
| | | name: it.name, |
| | | code: it.code |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | SaveDeviceRepairStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisibleEqp = false |
| | | this.$notify.success('关联成功!') |
| | | this.getDeviceRepairStandArdSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!--公共页面样式--> |
| | | <style lang="scss" scoped> |
| | | $main_color: #42b983; |
| | | |
| | | .dialogVisibleEqp { |
| | | .myCheckboxGroup { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | |
| | | .myCheckbox { |
| | | //border: 1px solid $main_color; |
| | | border: 1px solid #eee; |
| | | display: flex; |
| | | min-width: 100px; |
| | | padding: 10px; |
| | | margin: 10px 30px 0 0; |
| | | border-radius: 5px; |
| | | cursor: default; |
| | | position: relative; |
| | | |
| | | .myCheckboxInput { |
| | | margin: 1px 5px 0 0; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .myCheckboxInputLabel { |
| | | position: absolute; |
| | | left: 29px; |
| | | padding: 5px; |
| | | top: 6px; |
| | | color: transparent; |
| | | } |
| | | |
| | | } |
| | | |
| | | //.myCheckbox{ |
| | | // border: 1px solid $main_color; |
| | | //} |
| | | |
| | | input[type=checkbox] { |
| | | cursor: pointer; |
| | | position: relative; |
| | | width: 14px; |
| | | height: 14px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | input[type=checkbox]::after { |
| | | position: absolute; |
| | | top: 0; |
| | | //color: rgb(130, 35, 35); |
| | | color: $main_color; |
| | | width: 14px; |
| | | height: 14px; |
| | | display: inline-block; |
| | | visibility: visible; |
| | | padding-left: 0px; |
| | | text-align: center; |
| | | content: ' '; |
| | | border-radius: 3px |
| | | } |
| | | |
| | | input[type=checkbox]:checked::after { |
| | | //content: "✓"; |
| | | content: "√"; |
| | | color: #fff; |
| | | font-size: 12px; |
| | | font-weight: bold; |
| | | background-color: $main_color; |
| | | } |
| | | } |
| | | } |
| | | |
| | | ::v-deep .el-button--text { |
| | | font-size: 14px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .el-icon-share, .el-icon-delete, .el-icon-edit-outline { |
| | | color: $main_color; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .el-icon-edit-outline { |
| | | margin-right: 15px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary, .el-button--default, .el-button--info { |
| | | height: 34px; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 15px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary { |
| | | //background-color: $main_color !important; |
| | | } |
| | | |
| | | ::v-deep .el-button--default { |
| | | background-color: #f8f8fa; |
| | | border: none; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner { |
| | | height: 34px; |
| | | line-height: 34px; |
| | | //color: #a7a7a7; |
| | | } |
| | | |
| | | //::v-deep .el-dialog__body { |
| | | // padding: 20px 100px !important; |
| | | //} |
| | | ::v-deep .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .dialogVisibleRoles .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .importPickerClass .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | ::v-deep .el-table .caret-wrapper { |
| | | transform: scale(0.8); |
| | | } |
| | | |
| | | ::v-deep .cell { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | ::v-deep .el-table::before { |
| | | height: 0; |
| | | } |
| | | |
| | | ::v-deep .el-table__body-wrapper { |
| | | background-color: #f8f8fa; |
| | | } |
| | | |
| | | ::v-deep .el-table__body .el-table__row.hover-row td { |
| | | background-color: #eaecef; |
| | | } |
| | | |
| | | ::v-deep .el-form--inline .el-form-item__label { |
| | | color: #a7a7a7; |
| | | } |
| | | |
| | | .body ::v-deep .el-divider { |
| | | border: 1px solid #eee; |
| | | width: 99%; |
| | | margin: 10px auto; |
| | | } |
| | | |
| | | .body ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .userDialogVisible ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | ::v-deep .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .tableFixed { |
| | | ::v-deep .el-table__fixed-right { |
| | | height: 100% !important; |
| | | } |
| | | |
| | | ::v-deep .el-table__fixed { |
| | | height: 100% !important; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | | <style> |
| | | .osloading{ |
| | | font-size: 26px !important; |
| | | } |
| | | |
| | | .el-loading-text{ |
| | | font-size: 26px !important; |
| | | } |
| | | .el-table .custom-row { |
| | | background: #f8f8fa; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <div class="kb_dashboard" style="display:flex;flex-direction: column;justify-content: space-between"> |
| | | <div |
| | | class="kb_dashboard" |
| | | :style="{transform:'scale('+zoomX+','+zoomY+')',top:topDistance+'px',left:leftDistance+'px'}" |
| | | style="display:flex;flex-direction: column;justify-content: space-between" |
| | | > |
| | | |
| | | <div class="kb_backgroundCustom" /> |
| | | |
| | |
| | | name: 'Cjsc', |
| | | data() { |
| | | return { |
| | | zoomX: 1, |
| | | zoomY: 1, |
| | | topDistance: 0, |
| | | leftDistance: 0, |
| | | |
| | | headTime: '', |
| | | |
| | | cjzl03_xData: [], |
| | |
| | | setInterval(() => { |
| | | this.getWorkShopProduceBottomRightData() |
| | | }, 30 * 1000) |
| | | |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.zoomX = window.innerWidth / 1920 |
| | | this.zoomY = window.innerHeight / 1080 |
| | | this.topDistance = (window.innerHeight - 1080) / 2 |
| | | this.leftDistance = (window.innerWidth - 1920) / 2 |
| | | }, |
| | | getWorkShopProduceTopData() { |
| | | WorkShopProduceTopData({ wkshopcode: '0503' }).then(res => { |
| | | const flag = this.compareArrays(this.configTableTop.data, res.data) |
| | |
| | | <template> |
| | | <div> |
| | | <div class="kb_dashboard"> |
| | | <div |
| | | class="kb_dashboard" |
| | | :style="{transform:'scale('+zoomX+','+zoomY+')',top:topDistance+'px',left:leftDistance+'px'}" |
| | | > |
| | | |
| | | <div class="kb_backgroundCustom" /> |
| | | <div class="kb_header"> |
| | |
| | | |
| | | data() { |
| | | return { |
| | | zoomX: 1, |
| | | zoomY: 1, |
| | | topDistance: 0, |
| | | leftDistance: 0, |
| | | |
| | | onLine: navigator.onLine, // 监听网络是否在线 |
| | | |
| | | headTime: '', |
| | |
| | | setInterval(() => { |
| | | this.getPurchaseRight() |
| | | }, 20 * 1000) |
| | | |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('online', this.updateOnlineStatus) |
| | | window.removeEventListener('offline', this.updateOnlineStatus) |
| | | }, |
| | | methods: { |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.zoomX = window.innerWidth / 1920 |
| | | this.zoomY = window.innerHeight / 1080 |
| | | this.topDistance = (window.innerHeight - 1080) / 2 |
| | | this.leftDistance = (window.innerWidth - 1920) / 2 |
| | | }, |
| | | // 更新网络状态 |
| | | updateOnlineStatus(e) { |
| | | if (e.isFirst) { |
| | |
| | | <template> |
| | | <div> |
| | | <div class="kb_dashboard"> |
| | | <div |
| | | class="kb_dashboard" |
| | | :style="{transform:'scale('+zoomX+','+zoomY+')',top:topDistance+'px',left:leftDistance+'px'}" |
| | | > |
| | | |
| | | <div class="kb_backgroundCustom" /> |
| | | <div class="kb_header"> |
| | |
| | | |
| | | data() { |
| | | return { |
| | | zoomX: 1, |
| | | zoomY: 1, |
| | | topDistance: 0, |
| | | leftDistance: 0, |
| | | onLine: navigator.onLine, // 监听网络是否在线 |
| | | |
| | | headTime: '', |
| | |
| | | }, 20 * 1000) |
| | | |
| | | this.getEcharts() |
| | | |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('online', this.updateOnlineStatus) |
| | | window.removeEventListener('offline', this.updateOnlineStatus) |
| | | }, |
| | | methods: { |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.zoomX = window.innerWidth / 1920 |
| | | this.zoomY = window.innerHeight / 1080 |
| | | this.topDistance = (window.innerHeight - 1080) / 2 |
| | | this.leftDistance = (window.innerWidth - 1920) / 2 |
| | | }, |
| | | // 更新网络状态 |
| | | updateOnlineStatus(e) { |
| | | if (e.isFirst) { |
| | |
| | | <template> |
| | | <div> |
| | | <div class="kb_dashboard" style="display:flex;flex-direction: column;justify-content: space-between"> |
| | | <div |
| | | class="kb_dashboard" |
| | | :style="{transform:'scale('+zoomX+','+zoomY+')',top:topDistance+'px',left:leftDistance+'px'}" |
| | | style="display:flex;flex-direction: column;justify-content: space-between" |
| | | > |
| | | |
| | | <div class="kb_backgroundCustom" /> |
| | | |
| | |
| | | name: 'Cjsc', |
| | | data() { |
| | | return { |
| | | zoomX: 1, |
| | | zoomY: 1, |
| | | topDistance: 0, |
| | | leftDistance: 0, |
| | | headTime: '', |
| | | |
| | | cjzl03_xData: [], |
| | |
| | | setInterval(() => { |
| | | this.getWorkShopProduceBottomRightData() |
| | | }, 30 * 1000) |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.zoomX = window.innerWidth / 1920 |
| | | this.zoomY = window.innerHeight / 1080 |
| | | this.topDistance = (window.innerHeight - 1080) / 2 |
| | | this.leftDistance = (window.innerWidth - 1920) / 2 |
| | | }, |
| | | getWorkShopProduceTopData() { |
| | | WorkShopProduceTopData({ wkshopcode: '0502' }).then(res => { |
| | | const flag = this.compareArrays(this.configTableTop.data, res.data) |
| | |
| | | <template> |
| | | <div> |
| | | <div class="kb_dashboard" style="display:flex;flex-direction: column;justify-content: space-between"> |
| | | <div |
| | | class="kb_dashboard" |
| | | :style="{transform:'scale('+zoomX+','+zoomY+')',top:topDistance+'px',left:leftDistance+'px'}" |
| | | style="display:flex;flex-direction: column;justify-content: space-between" |
| | | > |
| | | |
| | | <div class="kb_backgroundCustom" /> |
| | | |
| | |
| | | name: 'Cjsc', |
| | | data() { |
| | | return { |
| | | zoomX: 1, |
| | | zoomY: 1, |
| | | topDistance: 0, |
| | | leftDistance: 0, |
| | | headTime: '', |
| | | |
| | | LeftTopData01: [], |
| | |
| | | setInterval(() => { |
| | | this.getWorkShopCompreRightBottom() |
| | | }, 25 * 1000) |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.zoomX = window.innerWidth / 1920 |
| | | this.zoomY = window.innerHeight / 1080 |
| | | this.topDistance = (window.innerHeight - 1080) / 2 |
| | | this.leftDistance = (window.innerWidth - 1920) / 2 |
| | | }, |
| | | getWorkShopCompreLeftTop() { |
| | | const res = [ |
| | | { org_code: '0501', org_name: '装配车间' }, |
| | |
| | | <template> |
| | | <div> |
| | | <div class="kb_dashboard" style="display:flex;flex-direction: column;justify-content: space-between"> |
| | | <div |
| | | class="kb_dashboard" |
| | | :style="{transform:'scale('+zoomX+','+zoomY+')',top:topDistance+'px',left:leftDistance+'px'}" |
| | | style="display:flex;flex-direction: column;justify-content: space-between" |
| | | > |
| | | |
| | | <div class="kb_backgroundCustom" /> |
| | | |
| | |
| | | name: 'Cjsc', |
| | | data() { |
| | | return { |
| | | zoomX: 1, |
| | | zoomY: 1, |
| | | topDistance: 0, |
| | | leftDistance: 0, |
| | | headTime: '', |
| | | |
| | | cjzl03_xData: [], |
| | |
| | | setInterval(() => { |
| | | this.getWorkShopProduceBottomRightData() |
| | | }, 30 * 1000) |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.zoomX = window.innerWidth / 1920 |
| | | this.zoomY = window.innerHeight / 1080 |
| | | this.topDistance = (window.innerHeight - 1080) / 2 |
| | | this.leftDistance = (window.innerWidth - 1920) / 2 |
| | | }, |
| | | getWorkShopProduceTopData() { |
| | | WorkShopProduceTopData({ wkshopcode: '0501' }).then(res => { |
| | | const flag = this.compareArrays(this.configTableTop.data, res.data) |
| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" :style="{height:mainHeight+'px'}">
|
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between">
|
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
|
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=13_1')">导入</el-button>
|
| | | </div>
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | | <el-form-item label="标准编码" style=" display: flex;">
|
| | | <el-input v-model="form.checkstandcode" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准名称" style=" display: flex;">
|
| | | <el-input v-model="form.checkstandname" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准描述" style=" display: flex;">
|
| | | <el-input v-model="form.checkstandescr" placeholder="请输入" style="width: 200px" />
|
| | | </el-form-item>
|
| | | </div>
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | |
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | style="height:5px"
|
| | | />
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <!-- <TableColumnSettings-->
|
| | | <!-- :list1="tableColumnSettingsArray"-->
|
| | | <!-- @tableColumnUpdate="tableColumnUpdate"-->
|
| | | <!-- />-->
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | :key="tableTimeStampKey"
|
| | | :data="tableData"
|
| | | :height="tableHeight+'px'"
|
| | | border
|
| | | class="tableFixed"
|
| | | :row-class-name="tableRowClassName"
|
| | | :style="{width: 100+'%',height:tableHeight+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | @sort-change="sortChange"
|
| | | >
|
| | |
|
| | | <el-table-column
|
| | | v-for="item in tableColumnSettingsArray"
|
| | | v-if="item.show"
|
| | | :key="item.id"
|
| | | :sortable="item.sortable"
|
| | | :prop="item.prop"
|
| | | :min-width="item.minWidth"
|
| | | :label="item.label"
|
| | | :width="item.width"
|
| | | show-tooltip-when-overflow
|
| | | :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="!row[item.prop]">/</div>
|
| | | <div v-else-if="item.prop==='is_checkmould'">
|
| | | <i
|
| | | v-if="row[item.prop]==='Y'"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | class="el-icon-share"
|
| | | style="cursor: pointer"
|
| | | @click="connectClick(row)"
|
| | | />
|
| | | <i
|
| | | v-if="row[item.prop]==='N'"
|
| | | class="el-icon-share"
|
| | | style="color: rgb(180 ,181, 185);cursor:pointer;"
|
| | | @click="connectClick(row)"
|
| | | />
|
| | | </div>
|
| | | <div v-else>{{ row[item.prop] }}</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | label="操作"
|
| | | fixed="right"
|
| | | width="120"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
| | | <i
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | class="el-icon-edit-outline"
|
| | | @click="edit('edit',row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">
|
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <!--分页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes"
|
| | | popper-class="select_bottom"
|
| | | @pagination="getDeviceCheckStandArdSearch"
|
| | | />
|
| | | </div>
|
| | |
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="operation==='add'?'新增':'编辑'"
|
| | | :visible.sync="dialogVisible"
|
| | | width="1100px"
|
| | | :close-on-click-modal="false"
|
| | | top="8vh"
|
| | | @closed="handleClose"
|
| | | @close="handleClose"
|
| | | >
|
| | | <div style="margin: 0 30px;">
|
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
|
| | | <el-divider content-position="left">模具点检标准信息</el-divider>
|
| | |
|
| | | <el-form-item label="标准编码" prop="code">
|
| | | <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准名称" prop="name">
|
| | | <el-input v-model="dialogForm.name" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="标准描述" prop="description">
|
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" />
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </div>
|
| | | <el-divider content-position="left">指定点检项信息</el-divider>
|
| | | <div style="display: flex;align-items: center">
|
| | | <!-- <div style="font-weight: bolder">点检项选择:</div>-->
|
| | | <el-drag-select
|
| | | v-model="checkSelectedValue"
|
| | | style="width:940px;"
|
| | | multiple
|
| | | placeholder="请选择相对应指定项"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in checkSelectArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-drag-select>
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataDialogRef"
|
| | | :data="tableDataDialog"
|
| | | :height="(tableHeight-300)+'px'"
|
| | | border
|
| | | :row-class-name="tableRowClassName"
|
| | | :style="{width: 100+'%',height:(tableHeight-300)+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | width="50"
|
| | | label="序号"
|
| | | />
|
| | | <el-table-column
|
| | | prop="code"
|
| | | width="150"
|
| | | label="点检部位编码"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <el-table-column
|
| | | prop="name"
|
| | | label="点检部位名称"
|
| | | width="150"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | |
|
| | | <el-table-column
|
| | | prop="description"
|
| | | label="点检要求"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input v-model="row.description" />
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | </el-table>
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | title="关联模具"
|
| | | :visible.sync="mouldDialogVisible"
|
| | | width="800px"
|
| | | :close-on-click-modal="false"
|
| | | top="8vh"
|
| | | @closed="handleMouldClose"
|
| | | @close="handleMouldClose"
|
| | | >
|
| | | <div>
|
| | | <el-input
|
| | | v-model="filterText"
|
| | | placeholder="输入关键字进行过滤"
|
| | | />
|
| | | <el-tree
|
| | | ref="tree"
|
| | | class="filter-tree"
|
| | | :data="tree"
|
| | | :props="defaultProps"
|
| | | show-checkbox
|
| | | node-key="code"
|
| | | style="margin-top:15px;height: 550px;overflow: auto"
|
| | | default-expand-all
|
| | | :filter-node-method="filterNode"
|
| | | />
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="mouldDialogVisibleCancel">取 消</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="mouldDialogVisibleConfirm"
|
| | | >确 定</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import Pagination from '@/components/Pagination'
|
| | | import { validateCode } from '@/utils/global'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import waves from '@/directive/waves'
|
| | | import TableColumnSettings from '@/components/TableColumnSettings'
|
| | | import {
|
| | | AddUpdateMouldCheckStandArd, CheckStanedAssociationMould,
|
| | | DeleteMouldCheckStaned,
|
| | | DeviceCheckStandArdSearch, SaveCheckStanedAssociationMould,
|
| | | ViewMouldCheckStanedSearch
|
| | | } from '@/api/MouldManager'
|
| | | import ElDragSelect from '@/components/DragSelect'
|
| | | import { MouldCheckItemSelect } from '@/api/GeneralBasicData'
|
| | | import arrayToTree from 'array-to-tree'
|
| | |
|
| | | export default {
|
| | | name: 'MouldCheckStand',
|
| | | components: {
|
| | | Pagination, TableColumnSettings, ElDragSelect
|
| | | },
|
| | | directives: { elDragDialog, waves },
|
| | | data() {
|
| | | return {
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | form: {
|
| | | checkstandcode: '', // 标准编码
|
| | | checkstandname: '', // 标准名称
|
| | | checkstandescr: '', // 点检管控
|
| | | prop: 'lm_date', // 排序字段
|
| | | order: 'desc', // 排序字段
|
| | | page: 1, // 第几页
|
| | | rows: 20 // 每页多少条
|
| | | },
|
| | | checkcontrArr: [
|
| | | { code: 'Y', name: '是' },
|
| | | { code: 'N', name: '否' }
|
| | | ],
|
| | | cycleArr: [
|
| | | { code: 'D', name: '日' }
|
| | | ],
|
| | | total: 10,
|
| | | tableData: [],
|
| | | tableColumnSettingsArray: [
|
| | | { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 隐藏列 show: false隐藏,true显示
|
| | | { minWidth: false, width: 55, prop: 'rowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom
|
| | | {
|
| | | minWidth: 110,
|
| | | width: false,
|
| | | prop: 'code',
|
| | | label: '标准编码',
|
| | | id: 3,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: 110,
|
| | | width: false,
|
| | | prop: 'name',
|
| | | label: '标准名称',
|
| | | id: 4,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: 330,
|
| | | width: false,
|
| | | prop: 'description',
|
| | | label: '标准描述',
|
| | | id: 5,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'is_checkmould',
|
| | | label: '关联模具',
|
| | | id: 6,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | // {
|
| | | // minWidth: false,
|
| | | // width: 110,
|
| | | // prop: 'is_checkeqp',
|
| | | // label: '关联设备',
|
| | | // id: 7,
|
| | | // show: true,
|
| | | // fixed: false,
|
| | | // sortable: true
|
| | | // },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 110,
|
| | | prop: 'lm_user',
|
| | | label: '创建人员',
|
| | | id: 8,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | },
|
| | | {
|
| | | minWidth: false,
|
| | | width: 160,
|
| | | prop: 'lm_date',
|
| | | label: '创建时间',
|
| | | id: 9,
|
| | | show: true,
|
| | | fixed: false,
|
| | | sortable: true
|
| | | }
|
| | | ],
|
| | | tableTimeStampKey: new Date().getTime(), // 表格key
|
| | |
|
| | | dialogVisible: false,
|
| | | dialogForm: {
|
| | | code: '',
|
| | | name: '',
|
| | | description: ''
|
| | | },
|
| | | operation: '',
|
| | | dialogFormRules: {
|
| | | code: [
|
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | name: [
|
| | | { required: true, message: '请输入标准名称', trigger: ['blur', 'change'] }
|
| | | ]
|
| | |
|
| | | },
|
| | | tableDataDialog: [], // 表格数据
|
| | |
|
| | | checkSelectedValue: [],
|
| | | checkSelectArr: [],
|
| | |
|
| | | mouldDialogVisible: false,
|
| | | tree: [
|
| | | {
|
| | | code: '-1',
|
| | | name: '全部'
|
| | | }
|
| | | ],
|
| | | filterText: '',
|
| | | defaultProps: {
|
| | | children: 'children',
|
| | | label: 'name'
|
| | | },
|
| | | checkstand_code: ''
|
| | |
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | filterText(val) {
|
| | | this.$refs.tree.filter(val)
|
| | | },
|
| | | 'checkSelectedValue': {
|
| | | handler: function(val) {
|
| | | const arr = JSON.parse(JSON.stringify(this.tableDataDialog))
|
| | | const arrCheckcode = arr.map(i => i.code)
|
| | | this.tableDataDialog = []
|
| | | val.forEach(i => {
|
| | | this.tableDataDialog.push(
|
| | | {
|
| | | code: i,
|
| | | name: this.checkSelectArr.find(j => j.code === i).name,
|
| | | description: arrCheckcode.includes(i) ? arr.find(j => j.code === i).description : this.checkSelectArr.find(j => j.code === i).description
|
| | | }
|
| | | )
|
| | | })
|
| | | }
|
| | | }
|
| | | },
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | | this.handleRequest()
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | | },
|
| | | methods: {
|
| | |
|
| | | tableColumnUpdate(val, isCopyTrue) {
|
| | | if (isCopyTrue) {
|
| | | this.tableColumnSettingsArray = val
|
| | | }
|
| | | this.tableTimeStampKey = new Date().getTime()
|
| | |
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | },
|
| | | handleRequest() {
|
| | | this.getDeviceCheckStandArdSearch().then(res => {
|
| | | if (res.code === '200') {
|
| | | this.getMouldCheckItemSelect()
|
| | | }
|
| | | })
|
| | | },
|
| | | async getDeviceCheckStandArdSearch() {
|
| | | const res = await DeviceCheckStandArdSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | return { code: res.code }
|
| | | },
|
| | | // 排序改变时
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | },
|
| | | // 查询
|
| | | search() {
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | },
|
| | | // 导入按钮
|
| | | upload() {
|
| | | this.shows = true
|
| | | this.$refs.importPickerFunc.newDataFunc()
|
| | | },
|
| | | colos() {
|
| | | this.shows = false
|
| | | },
|
| | | // 重置
|
| | | reset() {
|
| | | this.form.checkstandcode = ''
|
| | | this.form.checkstandname = ''
|
| | | this.form.checkstandescr = ''
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | },
|
| | |
|
| | | async getMouldCheckItemSelect() {
|
| | | const { data: res } = await MouldCheckItemSelect()
|
| | | this.checkSelectArr = res
|
| | | },
|
| | |
|
| | | // 新增按钮
|
| | | add(operation) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tableDataDialogRef.doLayout()
|
| | | })
|
| | | },
|
| | | // 修改按钮
|
| | | edit(operation, row) {
|
| | | this.operation = operation
|
| | | this.getViewDeviceCheckStanedSearch(row.code)
|
| | | this.dialogVisible = true
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tableDataDialogRef.doLayout()
|
| | | })
|
| | | },
|
| | | // 修改前请求接口
|
| | | async getViewDeviceCheckStanedSearch(checkstand_code) {
|
| | | const { data: res } = await ViewMouldCheckStanedSearch({ checkstand_code })
|
| | | this.tableDataDialog = res.data
|
| | | this.checkSelectedValue = res.data.map(i => i.code)
|
| | |
|
| | | this.dialogForm.code = res.code
|
| | | this.dialogForm.name = res.name
|
| | | this.dialogForm.description = res.description
|
| | |
|
| | | this.tableDataDialog.forEach(item => {
|
| | | item.description = item.chkdesc
|
| | | })
|
| | | },
|
| | | // 删除按钮
|
| | | async del(row) {
|
| | | this.$confirm('是否确认删除?', '提示', {
|
| | | confirmButtonText: '确定',
|
| | | cancelButtonText: '取消',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | DeleteMouldCheckStaned({ checkstand_code: row.code }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('删除成功!')
|
| | | if (this.form.page > 1 && this.tableData.length === 1) {
|
| | | this.form.page--
|
| | | }
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$notify.info('已取消删除')
|
| | | })
|
| | | },
|
| | |
|
| | | // 对话框关闭事件
|
| | | handleClose() {
|
| | | this.dialogForm.code = ''
|
| | | this.dialogForm.name = ''
|
| | | this.dialogForm.description = ''
|
| | | this.tableDataDialog = []
|
| | | this.checkSelectedValue = []
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // 对话框取消
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | },
|
| | | // 对话框确认
|
| | | dialogVisibleConfirm() {
|
| | | this.$refs.dialogForm.validate(valid => {
|
| | | if (valid) {
|
| | | if (this.tableDataDialog.length === 0) {
|
| | | return this.$message.info('点检项信息不能为空!')
|
| | | }
|
| | |
|
| | | const Data = []
|
| | | this.tableDataDialog.forEach((i, index) => {
|
| | | Data.push({
|
| | | checkitem_seq: index + 1,
|
| | | checkitem_code: i.code,
|
| | | checkitem_name: i.name,
|
| | | checkitem_descr: i.description,
|
| | | cycle: '',
|
| | | isscan: ''
|
| | | })
|
| | | })
|
| | | const data = {
|
| | | 'code': this.dialogForm.code,
|
| | | 'name': this.dialogForm.name,
|
| | | 'description': this.dialogForm.description,
|
| | | 'Data': Data
|
| | | }
|
| | |
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | AddUpdateMouldCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
|
| | | if (res.code === '200') {
|
| | | this.dialogVisible = false
|
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | // this.getMouldCheckItemSelect()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | } else {
|
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | // 关联模具点击
|
| | | async connectClick(row) {
|
| | | const { data: res } = await CheckStanedAssociationMould({ checkstand_code: row.code })
|
| | | this.checkstand_code = row.code
|
| | |
|
| | | const keySelected = []
|
| | | res.forEach(i => {
|
| | | i.parentid = '-1'
|
| | | i.name = i.code + ' / ' + i.name
|
| | |
|
| | | if (i.flag === 'Y') {
|
| | | keySelected.push(i.code)
|
| | | }
|
| | | })
|
| | | this.tree = arrayToTree(this.tree.concat(res), {
|
| | | parentProperty: 'parentid',
|
| | | customID: 'code',
|
| | | childrenProperty: 'children'
|
| | | })
|
| | | this.mouldDialogVisible = true
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tree.setCheckedKeys(keySelected)
|
| | | })
|
| | | },
|
| | | filterNode(value, data) {
|
| | | if (!value) return true
|
| | | return data.name.indexOf(value) !== -1
|
| | | },
|
| | | handleMouldClose() {
|
| | | this.tree = [
|
| | | {
|
| | | code: '-1',
|
| | | name: '全部'
|
| | | }
|
| | | ]
|
| | | },
|
| | | mouldDialogVisibleCancel() {
|
| | | this.mouldDialogVisible = false
|
| | | },
|
| | | mouldDialogVisibleConfirm() {
|
| | | const treeKey = this.$refs.tree.getCheckedKeys()
|
| | | const arr = []
|
| | | this.tree[0].children.forEach(i => {
|
| | | // i.flag = treeKey.includes(i.code) ? 'Y' : 'N'
|
| | | if (treeKey.includes(i.code)) {
|
| | | arr.push({
|
| | | code: i.code,
|
| | | name: i.name.split('/')[1].trim()
|
| | | })
|
| | | }
|
| | | })
|
| | |
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | SaveCheckStanedAssociationMould(arr, this.checkstand_code).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('绑定成功!')
|
| | | this.mouldDialogVisible = false
|
| | | this.getDeviceCheckStandArdSearch()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('绑定失败!')
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | // 获取页面高度
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 205
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | },
|
| | | tableRowClassName({ row, rowIndex }) {
|
| | | return 'custom-row'
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | </script>
|
| | | <style scoped lang="scss">
|
| | | ::v-deep .el-select__caret {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | | </style>
|
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> |
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=13_1')">导入</el-button> |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="标准编码" style=" display: flex;"> |
| | | <el-input v-model="form.checkstandcode" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准名称" style=" display: flex;"> |
| | | <el-input v-model="form.checkstandname" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准描述" style=" display: flex;"> |
| | | <el-input v-model="form.checkstandescr" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | </el-form> |
| | | |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | style="height:5px" |
| | | /> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <!-- <TableColumnSettings--> |
| | | <!-- :list1="tableColumnSettingsArray"--> |
| | | <!-- @tableColumnUpdate="tableColumnUpdate"--> |
| | | <!-- />--> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :key="tableTimeStampKey" |
| | | :data="tableData" |
| | | :height="tableHeight+'px'" |
| | | border |
| | | class="tableFixed" |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | |
| | | <el-table-column |
| | | v-for="item in tableColumnSettingsArray" |
| | | v-if="item.show" |
| | | :key="item.id" |
| | | :sortable="item.sortable" |
| | | :prop="item.prop" |
| | | :min-width="item.minWidth" |
| | | :label="item.label" |
| | | :width="item.width" |
| | | show-tooltip-when-overflow |
| | | :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="!row[item.prop]">/</div> |
| | | <div v-else-if="item.prop==='is_checkmould'"> |
| | | <i |
| | | v-if="row[item.prop]==='Y'" |
| | | :style="{color:$store.state.settings.theme}" |
| | | class="el-icon-share" |
| | | style="cursor: pointer" |
| | | @click="connectClick(row)" |
| | | /> |
| | | <i |
| | | v-if="row[item.prop]==='N'" |
| | | class="el-icon-share" |
| | | style="color: rgb(180 ,181, 185);cursor:pointer;" |
| | | @click="connectClick(row)" |
| | | /> |
| | | </div> |
| | | <div v-else>{{ row[item.prop] }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | fixed="right" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="编辑" placement="top"> |
| | | <i |
| | | :style="{color:$store.state.settings.theme}" |
| | | class="el-icon-edit-outline" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top"> |
| | | <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--分页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getDeviceCheckStandArdSearch" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="1100px" |
| | | :close-on-click-modal="false" |
| | | top="8vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <div style="margin: 0 30px;"> |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-divider content-position="left">模具点检标准信息</el-divider> |
| | | |
| | | <el-form-item label="标准编码" prop="code"> |
| | | <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准名称" prop="name"> |
| | | <el-input v-model="dialogForm.name" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准描述" prop="description"> |
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <el-divider content-position="left">指定点检项信息</el-divider> |
| | | <div style="display: flex;align-items: center"> |
| | | <!-- <div style="font-weight: bolder">点检项选择:</div>--> |
| | | <el-drag-select |
| | | v-model="checkSelectedValue" |
| | | style="width:940px;" |
| | | multiple |
| | | placeholder="请选择相对应指定项" |
| | | > |
| | | <el-option |
| | | v-for="item in checkSelectArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-drag-select> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataDialogRef" |
| | | :data="tableDataDialog" |
| | | :height="(tableHeight-300)+'px'" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:(tableHeight-300)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | width="50" |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="code" |
| | | width="150" |
| | | label="点检部位编码" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="点检部位名称" |
| | | width="150" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | |
| | | <el-table-column |
| | | prop="description" |
| | | label="点检要求" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.description" /> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | title="关联模具" |
| | | :visible.sync="mouldDialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="8vh" |
| | | @closed="handleMouldClose" |
| | | @close="handleMouldClose" |
| | | > |
| | | <div> |
| | | <el-input |
| | | v-model="filterText" |
| | | placeholder="输入关键字进行过滤" |
| | | /> |
| | | <el-tree |
| | | ref="tree" |
| | | class="filter-tree" |
| | | :data="tree" |
| | | :props="defaultProps" |
| | | show-checkbox |
| | | node-key="code" |
| | | style="margin-top:15px;height: 550px;overflow: auto" |
| | | default-expand-all |
| | | :filter-node-method="filterNode" |
| | | /> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="mouldDialogVisibleCancel">取 消</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="mouldDialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import TableColumnSettings from '@/components/TableColumnSettings' |
| | | import { |
| | | AddUpdateMouldCheckStandArd, CheckStanedAssociationMould, |
| | | DeleteMouldCheckStaned, |
| | | DeviceCheckStandArdSearch, SaveCheckStanedAssociationMould, |
| | | ViewMouldCheckStanedSearch |
| | | } from '@/api/MouldManager' |
| | | import ElDragSelect from '@/components/DragSelect' |
| | | import { MouldCheckItemSelect } from '@/api/GeneralBasicData' |
| | | import arrayToTree from 'array-to-tree' |
| | | |
| | | export default { |
| | | name: 'MouldCheckStand', |
| | | components: { |
| | | Pagination, TableColumnSettings, ElDragSelect |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | checkstandcode: '', // 标准编码 |
| | | checkstandname: '', // 标准名称 |
| | | checkstandescr: '', // 点检管控 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | checkcontrArr: [ |
| | | { code: 'Y', name: '是' }, |
| | | { code: 'N', name: '否' } |
| | | ], |
| | | cycleArr: [ |
| | | { code: 'D', name: '日' } |
| | | ], |
| | | total: 10, |
| | | tableData: [], |
| | | tableColumnSettingsArray: [ |
| | | { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 隐藏列 show: false隐藏,true显示 |
| | | { minWidth: false, width: 55, prop: 'rowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'code', |
| | | label: '标准编码', |
| | | id: 3, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'name', |
| | | label: '标准名称', |
| | | id: 4, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 330, |
| | | width: false, |
| | | prop: 'description', |
| | | label: '标准描述', |
| | | id: 5, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'is_checkmould', |
| | | label: '关联模具', |
| | | id: 6, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | // { |
| | | // minWidth: false, |
| | | // width: 110, |
| | | // prop: 'is_checkeqp', |
| | | // label: '关联设备', |
| | | // id: 7, |
| | | // show: true, |
| | | // fixed: false, |
| | | // sortable: true |
| | | // }, |
| | | { |
| | | minWidth: false, |
| | | width: 110, |
| | | prop: 'lm_user', |
| | | label: '创建人员', |
| | | id: 8, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: false, |
| | | width: 160, |
| | | prop: 'lm_date', |
| | | label: '创建时间', |
| | | id: 9, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | } |
| | | ], |
| | | tableTimeStampKey: new Date().getTime(), // 表格key |
| | | |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | code: '', |
| | | name: '', |
| | | description: '' |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | code: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | name: [ |
| | | { required: true, message: '请输入标准名称', trigger: ['blur', 'change'] } |
| | | ] |
| | | |
| | | }, |
| | | tableDataDialog: [], // 表格数据 |
| | | |
| | | checkSelectedValue: [], |
| | | checkSelectArr: [], |
| | | |
| | | mouldDialogVisible: false, |
| | | tree: [ |
| | | { |
| | | code: '-1', |
| | | name: '全部' |
| | | } |
| | | ], |
| | | filterText: '', |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'name' |
| | | }, |
| | | checkstand_code: '' |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | filterText(val) { |
| | | this.$refs.tree.filter(val) |
| | | }, |
| | | 'checkSelectedValue': { |
| | | handler: function(val) { |
| | | const arr = JSON.parse(JSON.stringify(this.tableDataDialog)) |
| | | const arrCheckcode = arr.map(i => i.code) |
| | | this.tableDataDialog = [] |
| | | val.forEach(i => { |
| | | this.tableDataDialog.push( |
| | | { |
| | | code: i, |
| | | name: this.checkSelectArr.find(j => j.code === i).name, |
| | | description: arrCheckcode.includes(i) ? arr.find(j => j.code === i).description : this.checkSelectArr.find(j => j.code === i).description |
| | | } |
| | | ) |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | this.handleRequest() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | |
| | | tableColumnUpdate(val, isCopyTrue) { |
| | | if (isCopyTrue) { |
| | | this.tableColumnSettingsArray = val |
| | | } |
| | | this.tableTimeStampKey = new Date().getTime() |
| | | |
| | | this.$refs.tableDataRef.doLayout() |
| | | }, |
| | | handleRequest() { |
| | | this.getDeviceCheckStandArdSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getMouldCheckItemSelect() |
| | | } |
| | | }) |
| | | }, |
| | | async getDeviceCheckStandArdSearch() { |
| | | const res = await DeviceCheckStandArdSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | return { code: res.code } |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getDeviceCheckStandArdSearch() |
| | | }, |
| | | // 查询 |
| | | search() { |
| | | this.getDeviceCheckStandArdSearch() |
| | | }, |
| | | // 导入按钮 |
| | | upload() { |
| | | this.shows = true |
| | | this.$refs.importPickerFunc.newDataFunc() |
| | | }, |
| | | colos() { |
| | | this.shows = false |
| | | }, |
| | | // 重置 |
| | | reset() { |
| | | this.form.checkstandcode = '' |
| | | this.form.checkstandname = '' |
| | | this.form.checkstandescr = '' |
| | | this.getDeviceCheckStandArdSearch() |
| | | }, |
| | | |
| | | async getMouldCheckItemSelect() { |
| | | const { data: res } = await MouldCheckItemSelect() |
| | | this.checkSelectArr = res |
| | | }, |
| | | |
| | | // 新增按钮 |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataDialogRef.doLayout() |
| | | }) |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | | this.operation = operation |
| | | this.getViewDeviceCheckStanedSearch(row.code) |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataDialogRef.doLayout() |
| | | }) |
| | | }, |
| | | // 修改前请求接口 |
| | | async getViewDeviceCheckStanedSearch(checkstand_code) { |
| | | const { data: res } = await ViewMouldCheckStanedSearch({ checkstand_code }) |
| | | this.tableDataDialog = res.data |
| | | this.checkSelectedValue = res.data.map(i => i.code) |
| | | |
| | | this.dialogForm.code = res.code |
| | | this.dialogForm.name = res.name |
| | | this.dialogForm.description = res.description |
| | | |
| | | this.tableDataDialog.forEach(item => { |
| | | item.description = item.chkdesc |
| | | }) |
| | | }, |
| | | // 删除按钮 |
| | | async del(row) { |
| | | this.$confirm('是否确认删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteMouldCheckStaned({ checkstand_code: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('删除成功!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getDeviceCheckStandArdSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已取消删除') |
| | | }) |
| | | }, |
| | | |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm.code = '' |
| | | this.dialogForm.name = '' |
| | | this.dialogForm.description = '' |
| | | this.tableDataDialog = [] |
| | | this.checkSelectedValue = [] |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // 对话框确认 |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | if (this.tableDataDialog.length === 0) { |
| | | return this.$message.info('点检项信息不能为空!') |
| | | } |
| | | |
| | | const Data = [] |
| | | this.tableDataDialog.forEach((i, index) => { |
| | | Data.push({ |
| | | checkitem_seq: index + 1, |
| | | checkitem_code: i.code, |
| | | checkitem_name: i.name, |
| | | checkitem_descr: i.description, |
| | | cycle: '', |
| | | isscan: '' |
| | | }) |
| | | }) |
| | | const data = { |
| | | 'code': this.dialogForm.code, |
| | | 'name': this.dialogForm.name, |
| | | 'description': this.dialogForm.description, |
| | | 'Data': Data |
| | | } |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | AddUpdateMouldCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |
| | | this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.getDeviceCheckStandArdSearch() |
| | | // this.getMouldCheckItemSelect() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 关联模具点击 |
| | | async connectClick(row) { |
| | | const { data: res } = await CheckStanedAssociationMould({ checkstand_code: row.code }) |
| | | this.checkstand_code = row.code |
| | | |
| | | const keySelected = [] |
| | | res.forEach(i => { |
| | | i.parentid = '-1' |
| | | i.name = i.code + ' / ' + i.name |
| | | |
| | | if (i.flag === 'Y') { |
| | | keySelected.push(i.code) |
| | | } |
| | | }) |
| | | this.tree = arrayToTree(this.tree.concat(res), { |
| | | parentProperty: 'parentid', |
| | | customID: 'code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | this.mouldDialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCheckedKeys(keySelected) |
| | | }) |
| | | }, |
| | | filterNode(value, data) { |
| | | if (!value) return true |
| | | return data.name.indexOf(value) !== -1 |
| | | }, |
| | | handleMouldClose() { |
| | | this.tree = [ |
| | | { |
| | | code: '-1', |
| | | name: '全部' |
| | | } |
| | | ] |
| | | }, |
| | | mouldDialogVisibleCancel() { |
| | | this.mouldDialogVisible = false |
| | | }, |
| | | mouldDialogVisibleConfirm() { |
| | | const treeKey = this.$refs.tree.getCheckedKeys() |
| | | const arr = [] |
| | | this.tree[0].children.forEach(i => { |
| | | // i.flag = treeKey.includes(i.code) ? 'Y' : 'N' |
| | | if (treeKey.includes(i.code)) { |
| | | arr.push({ |
| | | code: i.code, |
| | | name: i.name.split('/')[1].trim() |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | SaveCheckStanedAssociationMould(arr, this.checkstand_code).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('绑定成功!') |
| | | this.mouldDialogVisible = false |
| | | this.getDeviceCheckStandArdSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('绑定失败!') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 205 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | ::v-deep .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | </style> |
| | |
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('合格数量加不良数量不能大于了未报数量!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.startqty) === 0 && this.defectTableData.length === 0) { |
| | | return this.$message.info('合格数量不能为零!') |
| | | } |
| | | |
| | | let inbarcode = '' |
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') { |
| | | const data1 = { |
| | |
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('合格数量加不良数量不能大于了未报数量!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.startqty) === 0 && this.defectTableData.length === 0) { |
| | | return this.$message.info('合格数量不能为零!') |
| | | } |
| | | |
| | | let inbarcode = '' |
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') { |
| | | const data1 = { |
| | |
| | | }, |
| | | proxy: { |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | target: 'http://121.196.36.24:8039', // 本地 |
| | | // target: 'http://192.168.2.138:8080', // 大岛2.0 |
| | | // target: 'http://121.196.36.24:8039', // 本地 |
| | | target: 'http://192.168.2.138:8080', // 大岛2.0 |
| | | changeOrigin: true, // 请求跨域时,需 配置此项 |
| | | pathRewrite: { // 路径重写,替换target中的请求地址 |
| | | ['^' + process.env.VUE_APP_BASE_API]: '/api/' |