| | |
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div class="bodyTopButtonGroup"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> |
| | | <el-button icon="el-icon-download" @click="upload">导入</el-button> |
| | | </div> |
| | |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="org_code" |
| | | prop="code" |
| | | label="标准编码" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="org_name" |
| | | prop="name" |
| | | label="标准名称" |
| | | sortable="custom" |
| | | /> |
| | | |
| | | <el-table-column |
| | | prop="parentorg_name" |
| | | prop="description" |
| | | label="标准描述" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="parentorg_name" |
| | | prop="iscontr" |
| | | label="点检管控" |
| | | sortable="custom" |
| | | /> |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.iscontr==='Y'"> |
| | | <svg-icon icon-class="circleYes" style="margin-right: 2px" /> |
| | | 是 |
| | | </div> |
| | | <div v-if="row.iscontr==='N'"> |
| | | <svg-icon icon-class="circleNo" style="margin-right: 2px" /> |
| | | 否 |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="parentorg_name" |
| | | prop="is_checkeqp" |
| | | label="关联设备" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <i v-if="row.is_checkeqp==='Y'" class="el-icon-share" @click="checkeqpClick(row)" /> |
| | | <i |
| | | v-if="row.is_checkeqp==='N'" |
| | | class="el-icon-share" |
| | | style="color: rgb(180 ,181, 185)" |
| | | @click="checkeqpClick(row)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="lm_user" |
| | | label="创建人员" |
| | |
| | | /> |
| | | <el-table-column |
| | | label="操作" |
| | | fixed="right" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button type="text" @click="edit('edit',row)">编辑</el-button> |
| | | <el-button type="text" @click="del(row)">删除</el-button> |
| | | <el-tooltip class="item" effect="dark" content="编辑" placement="top"> |
| | | <i 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 class="el-icon-delete" @click="del(row)" /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 关联设备--> |
| | | <el-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:#42b983;" /> 标准名称:{{ dialogFormEqp.name }} |
| | | </div> |
| | | <el-divider /> |
| | | <div> |
| | | <div style="margin-bottom:20px"> |
| | | <i class="el-icon-s-operation" style="color:#42b983;" /> 设备所属车间集合: |
| | | </div> |
| | | <div class="myCheckboxGroup"> |
| | | <div |
| | | v-for="item in dialogFormEqp.eqpArr" |
| | | :key="item.code" |
| | | :style="{border:item.isSelected1?'1px solid #42b983':'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"--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-divider /> |
| | | <div> |
| | | <div style="margin-bottom:20px"> |
| | | <i class="el-icon-s-operation" style="color:#42b983;" /> 角色: |
| | | </div> |
| | | <el-tree |
| | | ref="roleTree" |
| | | :data="dialogFormEqp.eqpTree" |
| | | show-checkbox |
| | | node-key="code" |
| | | default-expand-all |
| | | style="height: 300px" |
| | | :props="defaultPropsOfEqpTree" |
| | | @check="checkBoxClick" |
| | | /> |
| | | <!-- @check-change="checkChange"--> |
| | | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="eqpDialogVisibleCancel">取 消</el-button> |
| | | <el-button type="primary" @click="eqpDialogVisibleConfirm">确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!--导入组件--> |
| | | <import-picker |
| | | ref="importPickerFunc" |
| | |
| | | import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz' |
| | | import { getCookie } from '@/utils/auth' |
| | | import ImportPicker from '@/components/ImportPicker' |
| | | import { AddUpdateDeviceCheckStandArd, DeviceCheckItemSelect, DeviceCheckStandArdSearch } from '@/api/sbgl' |
| | | import { |
| | | AddUpdateDeviceCheckStandArd, |
| | | DeviceCheckItemSelect, |
| | | DeviceCheckStandArdSearch, |
| | | ViewDeviceCheckStanedSearch |
| | | } from '@/api/sbgl' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | |
| | | tableDataDialog: [], // 表格数据 |
| | | tableDataDialogSelected: [], // 已选code |
| | | checkItemSelectArr: [], |
| | | |
| | | dialogVisibleEqp: false, |
| | | |
| | | dialogFormEqp: { |
| | | name: '', |
| | | eqpArr: [], |
| | | eqpTree: [] |
| | | }, |
| | | defaultPropsOfEqpTree: { |
| | | value: 'code', |
| | | label: 'name', |
| | | children: 'children' |
| | | }, |
| | | |
| | | title_value: '数据导入 / 点检部位', |
| | | code: '4', |
| | |
| | | this.$refs.tableDataDialogRef.doLayout() |
| | | }) |
| | | this.$nextTick(() => { |
| | | this.dialogForm.OrgCode = row.org_code |
| | | this.dialogForm.OrgName = row.org_name |
| | | this.dialogForm.SupUnit = row.parent_id |
| | | this.dialogForm.code = row.code |
| | | this.dialogForm.name = row.name |
| | | this.dialogForm.enable = row.enable |
| | | this.dialogForm.description = row.description |
| | | }) |
| | | }, |
| | | // 删除按钮 |
| | |
| | | this.$message.info('已取消删除') |
| | | }) |
| | | }, |
| | | // 修改前请求接口 |
| | | // async getViewDeviceCheckStanedSearch(checkstand_code) { |
| | | // const { data: res } = await ViewDeviceCheckStanedSearch() |
| | | // }, |
| | | // 对话框关闭事件 |
| | | handleClose() { |
| | | this.dialogForm.code = '' |
| | |
| | | }, |
| | | |
| | | selectChange(val, row) { |
| | | row.checkitem_descr = this.checkItemSelectArr.find(item => { |
| | | const res = this.checkItemSelectArr.find(item => { |
| | | return item.code === val || item.name === val |
| | | }).description |
| | | |
| | | row.checkitem_code = this.checkItemSelectArr.find(item => { |
| | | return item.code === val || item.name === val |
| | | }).code |
| | | row.checkitem_name = this.checkItemSelectArr.find(item => { |
| | | return item.code === val || item.name === val |
| | | }).name |
| | | }) |
| | | row.checkitem_descr = res.description |
| | | row.checkitem_code = res.code |
| | | row.checkitem_name = res.name |
| | | // row.checkitem_descr = this.checkItemSelectArr.find(item => { |
| | | // return item.code === val || item.name === val |
| | | // }).description |
| | | // |
| | | // row.checkitem_code = this.checkItemSelectArr.find(item => { |
| | | // return item.code === val || item.name === val |
| | | // }).code |
| | | // row.checkitem_name = this.checkItemSelectArr.find(item => { |
| | | // return item.code === val || item.name === val |
| | | // }).name |
| | | }, |
| | | // 新增行 |
| | | addRow() { |
| | |
| | | console.log(this.tableDataDialog) |
| | | }, |
| | | cancelRow(row) { |
| | | console.log(row, 111) |
| | | this.tableDataDialog.forEach((item, index) => { |
| | | if (item.checkitem_code === row.checkitem_code && item.isVisible === 1) { |
| | | console.log(item) |
| | |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | | // 关联设备 |
| | | checkeqpClick(row) { |
| | | this.dialogVisibleEqp = true |
| | | }, |
| | | handleCloseEqp() { |
| | | |
| | | }, |
| | | // 大盒子点击 |
| | | myCheckboxClick() { |
| | | |
| | | }, |
| | | // 小盒子点击 |
| | | myCheckboxInputClick() { |
| | | |
| | | }, |
| | | checkBoxClick() { |
| | | |
| | | }, |
| | | eqpDialogVisibleCancel() { |
| | | this.dialogVisibleEqp = false |
| | | }, |
| | | eqpDialogVisibleConfirm() { |
| | | this.dialogVisibleEqp = false |
| | | } |
| | | } |
| | | } |
| | |
| | | <!--公共页面样式--> |
| | | <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; |
| | | |
| | | .myCheckboxInput { |
| | | margin: 1px 5px 0 0; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | } |
| | | |
| | | //.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; |
| | |
| | | .userDialogVisible ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | ::v-deep .el-select__caret{ |
| | | display: flex; |
| | | align-items: center; |