From d9493eb7905545e5509689eae73a450c576418e0 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 26 八月 2022 17:16:02 +0800
Subject: [PATCH] 1.修改bug2.新增工序检验记录
---
src/views/sbgl/djbz.vue | 263 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 236 insertions(+), 27 deletions(-)
diff --git a/src/views/sbgl/djbz.vue b/src/views/sbgl/djbz.vue
index bb1d835..e4d0130 100644
--- a/src/views/sbgl/djbz.vue
+++ b/src/views/sbgl/djbz.vue
@@ -1,7 +1,7 @@
<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>
@@ -61,31 +61,52 @@
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="鍒涘缓浜哄憳"
@@ -99,11 +120,17 @@
/>
<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>
@@ -241,7 +268,7 @@
label="閫夋嫨鎵爜"
>
<template slot-scope="{row}">
- <div v-if="row.isVisible===0">{{ row.isscan==='Y'?'鏄�':'鍚�' }}</div>
+ <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '鏄�' : '鍚�' }}</div>
<el-select
v-if="row.isVisible===1"
v-model="row.isscan"
@@ -261,7 +288,7 @@
label="鐐规鍛ㄦ湡"
>
<template slot-scope="{row}">
- <div v-if="row.isVisible===0">{{ row.cycle==='D'?'鏃�':'' }}</div>
+ <div v-if="row.isVisible===0">{{ row.cycle === 'D' ? '鏃�' : '' }}</div>
<el-select
v-if="row.isVisible===1"
v-model="row.cycle"
@@ -301,6 +328,74 @@
</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"
@@ -319,7 +414,12 @@
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 {
@@ -390,6 +490,19 @@
tableDataDialog: [], // 琛ㄦ牸鏁版嵁
tableDataDialogSelected: [], // 宸查�塩ode
checkItemSelectArr: [],
+
+ dialogVisibleEqp: false,
+
+ dialogFormEqp: {
+ name: '',
+ eqpArr: [],
+ eqpTree: []
+ },
+ defaultPropsOfEqpTree: {
+ value: 'code',
+ label: 'name',
+ children: 'children'
+ },
title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
code: '4',
@@ -475,9 +588,10 @@
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
})
},
// 鍒犻櫎鎸夐挳
@@ -497,6 +611,10 @@
this.$message.info('宸插彇娑堝垹闄�')
})
},
+ // 淇敼鍓嶈姹傛帴鍙�
+ // async getViewDeviceCheckStanedSearch(checkstand_code) {
+ // const { data: res } = await ViewDeviceCheckStanedSearch()
+ // },
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
this.dialogForm.code = ''
@@ -545,16 +663,22 @@
},
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() {
@@ -619,7 +743,6 @@
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)
@@ -637,6 +760,30 @@
},
tableRowClassName({ row, rowIndex }) {
return 'custom-row'
+ },
+ // 鍏宠仈璁惧
+ checkeqpClick(row) {
+ this.dialogVisibleEqp = true
+ },
+ handleCloseEqp() {
+
+ },
+ // 澶х洅瀛愮偣鍑�
+ myCheckboxClick() {
+
+ },
+ // 灏忕洅瀛愮偣鍑�
+ myCheckboxInputClick() {
+
+ },
+ checkBoxClick() {
+
+ },
+ eqpDialogVisibleCancel() {
+ this.dialogVisibleEqp = false
+ },
+ eqpDialogVisibleConfirm() {
+ this.dialogVisibleEqp = false
}
}
}
@@ -645,6 +792,67 @@
<!--鍏叡椤甸潰鏍峰紡-->
<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;
@@ -740,7 +948,8 @@
.userDialogVisible ::v-deep .el-form-item {
margin-bottom: 0;
}
-::v-deep .el-select__caret{
+
+::v-deep .el-select__caret {
display: flex;
align-items: center;
justify-content: center;
--
Gitblit v1.9.3