| | |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="80px" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;justify-content: space-between" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="标准编码" style=" display: flex;"> |
| | | <el-form-item label-width="70px" 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-select> |
| | | </el-form-item> |
| | | </div> |
| | | <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2"> |
| | | <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}"> |
| | | <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button> |
| | | <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | </el-form> |
| | | |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | /> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :data="tableData" |
| | | :height="tableHeight+'px'" |
| | | border |
| | | class="tableFixed" |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | |
| | | <el-table-column |
| | | prop="code" |
| | | label="标准编码" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="标准名称" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | |
| | |
| | | prop="iscontr" |
| | | label="点检管控" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.iscontr==='Y'"> |
| | |
| | | <el-table-column |
| | | prop="is_checkeqp" |
| | | label="关联设备" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | |
| | | prop="lm_user" |
| | | label="创建人员" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="创建时间" |
| | | width="160" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | label="操作" |
| | |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="prev, pager, next,sizes" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getDeviceCheckStandArdSearch" |
| | | /> |
| | |
| | | <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-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-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-table-column |
| | | prop="isscan" |
| | | label="选择扫码" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '是' : '否' }}</div> |
| | |
| | | <el-table-column |
| | | prop="cycle" |
| | | label="点检周期" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.cycle === 'D' ? '日' : '' }}</div> |
| | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> |
| | | <el-button |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="eqpDialogVisibleCancel">取 消</el-button> |
| | | <el-button type="primary" @click="eqpDialogVisibleConfirm">确 定</el-button> |
| | | <el-button |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="eqpDialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | ViewDeviceCheckStanedSearch |
| | | } from '@/api/sbgl' |
| | | import $ from 'jquery' |
| | | import { validateCode } from '@/utils/global' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'Zzjg', |
| | | components: { |
| | | Pagination, ImportPicker |
| | | }, |
| | | data() { |
| | | const validateName = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请输入编码')) |
| | | } else { |
| | | if (SER_HZ.test(value)) { |
| | | return callback(new Error('编码不能为中文')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | const validateTypeCode = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请选择上级')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | |
| | | dialogFormRules: { |
| | | |
| | | code: [ |
| | | { required: true, validator: validateName, trigger: ['blur', 'change'] } |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | name: [ |
| | | { required: true, message: '请输入标准名称', trigger: ['blur', 'change'] } |
| | |
| | | }, |
| | | |
| | | title_value: '数据导入 / 点检部位', |
| | | code: '4', |
| | | code: '22', |
| | | shows: false |
| | | |
| | | } |
| | |
| | | dialogVisibleConfirm() { |
| | | 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) |
| | |
| | | |
| | | AddUpdateDeviceCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.dialogVisible = false |
| | | this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.getDeviceCheckStandArdSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | | } |
| | |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 200 |
| | | this.tableHeight = this.mainHeight - 195 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | | // 关联设备 |
| | | async checkeqpClick(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 |
| | | |
| | | const { data: res } = await DeviceCheckStanedAssociationEqp({ checkstand_code: row.code }) |
| | | this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0) |
| | | 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 (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) |
| | | }) |
| | | } |
| | | 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() |
| | | } |
| | | }) |
| | | }, |
| | | // 关联设备对话框关闭 |
| | |
| | | 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) { |
| | |
| | | |
| | | SaveDeviceCheckStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisibleEqp = false |
| | | this.$message.success('关联成功!') |
| | | this.getDeviceCheckStandArdSearch() |
| | | this.dialogVisibleEqp = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } |
| | | }) |
| | | } |
| | |
| | | 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; |
| | | } |