From 4ae49d50244c67d5e2bda208019be4944870c695 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 25 八月 2022 19:06:01 +0800
Subject: [PATCH] 1.点检部位增删查改实现
---
src/views/sbgl/djbw.vue | 538 +++++++++++++++
src/views/sbgl/sbqd.vue | 6
src/api/sbgl.js | 159 ++++
src/views/sbgl/djbz.vue | 743 +++++++++++++++++++++
src/views/template.vue | 43 +
src/views/kb/zhkb.vue | 12
src/router/index.js | 2
src/views/sbgl/bybw.vue | 515 +++++++++++++++
8 files changed, 1,994 insertions(+), 24 deletions(-)
diff --git a/src/api/sbgl.js b/src/api/sbgl.js
index 6c02711..8f5e37e 100644
--- a/src/api/sbgl.js
+++ b/src/api/sbgl.js
@@ -102,3 +102,162 @@
params: data
})
}
+// 璁惧鐐规椤瑰垪琛ㄦ煡璇�
+export function DeviceCheckItemSearch(data) {
+ return request({
+ url: 'DeviceManager/DeviceCheckItemSearch',
+ method: 'get',
+ params: data
+ })
+}
+
+// 璁惧鐐规椤规柊澧炵紪杈�
+export function AddUpdateDeviceCheckItem(data) {
+ return request({
+ url: 'DeviceManager/AddUpdateDeviceCheckItem',
+ method: 'post',
+ data
+ })
+}
+// 璁惧鐐规椤瑰垹闄�
+export function DeleteDeviceCheckItem(data) {
+ return request({
+ url: 'DeviceManager/DeleteDeviceCheckItem',
+ method: 'post',
+ params: data
+ })
+}
+// 璁惧淇濆吇椤瑰垪琛ㄦ煡璇�
+export function DeviceMaiItemSearch(data) {
+ return request({
+ url: 'DeviceManager/DeviceMaiItemSearch',
+ method: 'get',
+ params: data
+ })
+}
+// 璁惧淇濆吇椤规柊澧炵紪杈�
+export function AddUpdateDeviceMaiItem(data) {
+ return request({
+ url: 'DeviceManager/AddUpdateDeviceMaiItem',
+ method: 'post',
+ data
+ })
+}
+// 璁惧淇濆吇椤瑰垹闄�
+export function DeleteDeviceMaiItem(data) {
+ return request({
+ url: 'DeviceManager/DeleteDeviceMaiItem',
+ method: 'post',
+ params: data
+ })
+}
+// 璁惧鐐规鏍囧噯鍒楄〃鏌ヨ
+export function DeviceCheckStandArdSearch(data) {
+ return request({
+ url: 'DeviceManager/DeviceCheckStandArdSearch',
+ method: 'get',
+ params: data
+ })
+}
+// 璁惧鐐规鏍囧噯鏂板銆佺紪杈戣幏鍙栨楠岄」鐩笅鎷夊垪琛�
+export function DeviceCheckItemSelect() {
+ return request({
+ url: 'DeviceManager/DeviceCheckItemSelect',
+ method: 'get'
+ })
+}
+// 璁惧鐐规鏍囧噯缂栬緫/鏌ョ湅鑾峰彇鏁版嵁
+export function ViewDeviceCheckStanedSearch(data) {
+ return request({
+ url: 'DeviceManager/ViewDeviceCheckStanedSearch',
+ method: 'post',
+ params: data
+ })
+}
+// 璁惧鐐规鏍囧噯鏂板缂栬緫
+export function AddUpdateDeviceCheckStandArd(data, opertype) {
+ return request({
+ url: 'DeviceManager/AddUpdateDeviceCheckStandArd?opertype=' + opertype,
+ method: 'post',
+ data
+ })
+}
+// 璁惧鐐规鏍囧噯鍒犻櫎
+export function DeleteDeviceCheckStaned(data) {
+ return request({
+ url: 'DeviceManager/DeleteDeviceCheckStaned',
+ method: 'post',
+ params: data
+ })
+}
+// 璁惧鐐规鏍囧噯鍏宠仈宸ヤ綔绔欐煡璇�
+export function DeviceCheckStanedAssociationEqp(data) {
+ return request({
+ url: 'DeviceManager/DeviceCheckStanedAssociationEqp',
+ method: 'get',
+ params: data
+ })
+}
+// 璁惧鐐规鏍囧噯鍏宠仈宸ヤ綔绔欐彁浜�
+export function SaveDeviceCheckStanedAssociationEqp(data, checkstand_code) {
+ return request({
+ url: 'DeviceManager/SaveDeviceCheckStanedAssociationEqp?checkstand_code=' + checkstand_code,
+ method: 'post',
+ data
+ })
+}
+// 璁惧淇濆吇鏍囧噯鍒楄〃鏌ヨ
+export function DeviceRepairStandArdSearch(data) {
+ return request({
+ url: 'DeviceManager/DeviceRepairStandArdSearch',
+ method: 'get',
+ params: data
+ })
+}
+// 璁惧淇濆吇鏍囧噯鏂板銆佺紪杈戣幏鍙栦繚鍏婚」鐩笅鎷夊垪琛�
+export function DeviceRepairItemSelect() {
+ return request({
+ url: 'DeviceManager/DeviceRepairItemSelect',
+ method: 'get'
+ })
+}
+// 璁惧淇濆吇鏍囧噯缂栬緫/鏌ョ湅鑾峰彇鏁版嵁
+export function ViewDeviceRepairStanedSearch(data) {
+ return request({
+ url: 'DeviceManager/ViewDeviceRepairStanedSearch',
+ method: 'post',
+ params: data
+ })
+}
+// 璁惧淇濆吇鏍囧噯鏂板缂栬緫
+export function AddUpdateDeviceRepairStandArd(data, opertype) {
+ return request({
+ url: 'DeviceManager/AddUpdateDeviceRepairStandArd?opertype=' + opertype,
+ method: 'post',
+ data
+ })
+}
+// 璁惧淇濆吇鏍囧噯鍒犻櫎
+export function DeleteDeviceRepairStaned(data) {
+ return request({
+ url: 'DeviceManager/DeleteDeviceRepairStaned',
+ method: 'post',
+ params: data
+ })
+}
+// 璁惧淇濆吇鏍囧噯鍏宠仈宸ヤ綔绔欐煡璇�
+export function DeviceRepairStanedAssociationEqp(data) {
+ return request({
+ url: 'DeviceManager/DeviceRepairStanedAssociationEqp',
+ method: 'get',
+ params: data
+ })
+}
+// 璁惧淇濆吇鏍囧噯鍏宠仈宸ヤ綔绔欐彁浜�
+export function SaveDeviceRepairStanedAssociationEqp(data, repairstand_code) {
+ return request({
+ url: 'DeviceManager/SaveDeviceRepairStanedAssociationEqp?repairstand_code=' + repairstand_code,
+ method: 'post',
+ params: data
+ })
+}
diff --git a/src/router/index.js b/src/router/index.js
index 829ea53..7a23416 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -158,7 +158,7 @@
meta: { code: '1021', title: '璁惧缁�', icon: '', keepAlive: true }
}, {
path: 'sbqd',
- name: '璁惧娓呭崟Cancel',
+ name: 'sbqdCancel',
code: '1022',
component: () => import('@/views/sbgl/sbqd'),
meta: { code: '1022', title: '璁惧娓呭崟', icon: '', keepAlive: true }
diff --git a/src/views/kb/zhkb.vue b/src/views/kb/zhkb.vue
index e5ef746..9949b6d 100644
--- a/src/views/kb/zhkb.vue
+++ b/src/views/kb/zhkb.vue
@@ -612,7 +612,8 @@
leftTopData: [],
tableData: [],
- tableDataRank: []
+ tableDataRank: [],
+ lineCodeArr: []
}
},
@@ -642,6 +643,7 @@
this.lineArr.forEach((item, index) => {
// if (index === 0) {
this.handleEveryLine(item, index)
+ this.lineCodeArr.push(item.code)
// }
})
},
@@ -650,16 +652,16 @@
const res = await LineSearchTopLeftData([item])
console.log(res, 7)
let res1, res2, res3, res4
- if (res.data[0].linecode === 'CXSB001') {
+ if (res.data[0].linecode === this.lineCodeArr[0]) {
res1 = res
}
- if (res.data[0].linecode === 'CXSB002') {
+ if (res.data[0].linecode === this.lineCodeArr[1]) {
res2 = res
}
- if (res.data[0].linecode === 'CXSB003') {
+ if (res.data[0].linecode === this.lineCodeArr[2]) {
res3 = res
}
- if (res.data[0].linecode === 'CXSB004') {
+ if (res.data[0].linecode === this.lineCodeArr[3]) {
res4 = res
}
diff --git a/src/views/sbgl/bybw.vue b/src/views/sbgl/bybw.vue
index 7957ce5..367e671 100644
--- a/src/views/sbgl/bybw.vue
+++ b/src/views/sbgl/bybw.vue
@@ -1,11 +1,520 @@
-<template />
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+ <div class="bodyTopButtonGroup">
+ <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>
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="80px"
+ inline
+ style="display: flex;justify-content: space-between"
+ >
+ <div class="elForm">
+ <el-form-item label="閮ㄤ綅缂栫爜" style=" display: flex;">
+ <el-input v-model="form.checkitemcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="閮ㄤ綅鍚嶇О" style=" display: flex;">
+ <el-input v-model="form.checkitemname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="淇濆吇瑕佹眰" style=" display: flex;">
+ <el-input v-model="form.maidescr" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="閫変腑鎵爜" style=" display: flex;">
+ <el-select v-model="form.isqrcode" style="width: 200px" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="item in isqrcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鐐规鍛ㄦ湡" style=" display: flex;">
+ <el-select v-model="form.cycle" 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>
+ </div>
+ <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <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>
+
+ <div class="elTableDiv">
+ <el-table
+ :data="tableData"
+ :height="tableHeight+'px'"
+ border
+ :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-->
+ <!-- type="selection"-->
+ <!-- width="50"-->
+ <!-- />-->
+ <el-table-column
+ prop="RowNum"
+ width="50"
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="org_code"
+ label="閮ㄤ綅缂栫爜"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="org_name"
+ label="閮ㄤ綅鍚嶇О"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="description"
+ label="淇濆吇瑕佹眰"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="parentorg_name"
+ label="閫夋嫨鎵爜"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="parentorg_name"
+ label="鐐规鍛ㄦ湡"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="lm_user"
+ label="鍒涘缓浜哄憳"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="lm_date"
+ label="鍒涘缓鏃堕棿"
+ width="160"
+ sortable="custom"
+ />
+ <el-table-column
+ label="鎿嶄綔"
+ >
+ <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>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="prev, pager, next,sizes"
+ popper-class="select_bottom"
+ @pagination="getDeviceMaiItemSearch"
+ />
+ </div>
+
+ <el-dialog
+ :title="operation==='add'?'鏂板':'缂栬緫'"
+ :visible.sync="dialogVisible"
+ width="800px"
+ :close-on-click-modal="false"
+ top="15vh"
+ @closed="handleClose"
+ @close="handleClose"
+ >
+ <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
+ <el-form-item label="閮ㄤ綅缂栫爜" prop="OrgCode">
+ <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="閮ㄤ綅鍚嶇О" prop="OrgName">
+ <el-input v-model="dialogForm.OrgName" style="width: 200px" />
+ </el-form-item>
+ <el-form-item prop="SupUnit" label="淇濆吇鍛ㄦ湡">
+ <el-select
+ v-model="dialogForm.SupUnit"
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in SupUnitArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item prop="SupUnit" label="閫夋嫨鎵爜">
+ <el-select
+ v-model="dialogForm.SupUnit"
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in SupUnitArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="淇濆吇瑕佹眰" prop="OrgName">
+ <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <!--瀵煎叆缁勪欢-->
+ <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+
+ </div>
+</template>
<script>
+import Pagination from '@/components/Pagination'
+import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
+import { getCookie } from '@/utils/auth'
+import { DeviceCheckItemSearch, DeviceMaiItemSearch } from '@/api/sbgl'
+import ImportPicker from '@/components/ImportPicker'
+
+const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
- name: 'Bybw'
+ 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,
+ form: {
+ checkitemcode: '', // 閮ㄤ綅缂栫爜
+ checkitemname: '', // 閮ㄤ綅鍚嶇О
+ maidescr: '', // 淇濆吇瑕佹眰
+ isqrcode: '', // 閫変腑鎵爜
+ cycle: '', // 鐐规鍛ㄦ湡
+ prop: 'lm_date', // 鎺掑簭瀛楁
+ order: 'desc', // 鎺掑簭瀛楁
+ page: 1, // 绗嚑椤�
+ rows: 20 // 姣忛〉澶氬皯鏉�
+ },
+ isqrcodeArr: [
+
+ ],
+ cycleArr: [
+
+ ],
+
+ total: 10,
+ tableData: [],
+ dialogVisible: false,
+ dialogForm: {
+ OrgType: '',
+ OrgCode: '',
+ OrgName: '',
+ SupUnit: ''// 涓婄骇鍗曚綅
+ },
+ operation: '',
+ dialogFormRules: {
+ OrgType: [
+ { required: true, message: '璇疯緭鍏ラ�夋嫨绫诲瀷', trigger: ['blur', 'change'] }
+ ],
+ OrgCode: [
+ { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ ],
+ OrgName: [
+ { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
+ ],
+ SupUnit: [
+ { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
+ ]
+ },
+
+ title_value: '鏁版嵁瀵煎叆 / 淇濆吇閮ㄤ綅',
+ code: '4',
+ shows: false
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getDeviceMaiItemSearch()
+ }
+ }
+ },
+ created() {
+ this.getDeviceMaiItemSearch()
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ methods: {
+ async getDeviceMaiItemSearch() {
+ const res = await DeviceMaiItemSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ },
+ // 鎺掑簭鏀瑰彉鏃�
+ 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.getDeviceMaiItemSearch()
+ },
+ // 鏌ヨ
+ search() {
+ this.getDeviceMaiItemSearch()
+ },
+ // 瀵煎叆鎸夐挳
+ upload() {
+ this.shows = true
+ this.$refs.importPickerFunc.newDataFunc()
+ },
+ colos() {
+ this.shows = false
+ },
+ // 閲嶇疆
+ reset() {
+ this.form.OrgCode = ''
+ this.form.OrgName = ''
+ this.form.OrgType = ''
+ this.form.UserName = ''
+ this.getDeviceMaiItemSearch()
+ },
+
+ // 鏂板鎸夐挳
+ add(operation) {
+ this.operation = operation
+ this.dialogVisible = true
+ },
+ // 淇敼鎸夐挳
+ edit(operation, row) {
+ this.operation = operation
+ this.dialogVisible = true
+
+ this.$nextTick(() => {
+ this.dialogForm.OrgCode = row.org_code
+ this.dialogForm.OrgName = row.org_name
+ this.dialogForm.SupUnit = row.parent_id
+ })
+ },
+ // 鍒犻櫎鎸夐挳
+ async del(row) {
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ DeleteOrganization({ orgid: row.code }).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍒犻櫎鎴愬姛!')
+ this.getDeviceMaiItemSearch()
+ }
+ })
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝垹闄�')
+ })
+ },
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogForm.OrgType = ''
+ this.dialogForm.OrgCode = ''
+ this.dialogForm.OrgName = ''
+ this.dialogForm.SupUnit = ''
+ this.$refs.dialogForm.clearValidate()
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+ this.$refs.dialogForm.validate(valid => {
+ if (valid) {
+ const data = {
+ OrganCode: this.dialogForm.OrgCode,
+ OrganName: this.dialogForm.OrgName,
+ OperType: this.operation === 'add' ? 'Add' : 'Update',
+ Operator: getCookie('admin')
+ }
+ AddUpdateOrganization(data).then(res => {
+ if (res.code === '200') {
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogVisible = false
+ this.getDeviceMaiItemSearch()
+ } else {
+ this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
+ }
+ })
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ }
+ }
}
</script>
-<style scoped>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::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 .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;
+}
+
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
</style>
diff --git a/src/views/sbgl/djbw.vue b/src/views/sbgl/djbw.vue
index f04795d..45dab0e 100644
--- a/src/views/sbgl/djbw.vue
+++ b/src/views/sbgl/djbw.vue
@@ -1,11 +1,543 @@
-<template />
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+ <div class="bodyTopButtonGroup">
+ <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>
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="80px"
+ inline
+ style="display: flex;justify-content: space-between"
+ >
+ <div class="elForm">
+ <el-form-item label="閮ㄤ綅缂栫爜" style=" display: flex;">
+ <el-input v-model="form.checkitemcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="閮ㄤ綅鍚嶇О" style=" display: flex;">
+ <el-input v-model="form.checkitemname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鐐规瑕佹眰" style=" display: flex;">
+ <el-input v-model="form.checkdescr" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="閫変腑鎵爜" style=" display: flex;">
+ <el-select v-model="form.isqrcode" style="width: 200px" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="item in isqrcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鐐规鍛ㄦ湡" style=" display: flex;">
+ <el-select v-model="form.cycle" 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>
+ </div>
+ <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <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>
+
+ <div class="elTableDiv">
+ <el-table
+ :data="tableData"
+ :height="tableHeight+'px'"
+ border
+ :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-->
+ <!-- type="selection"-->
+ <!-- width="50"-->
+ <!-- />-->
+ <el-table-column
+ prop="RowNum"
+ width="50"
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="code"
+ label="閮ㄤ綅缂栫爜"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="name"
+ label="閮ㄤ綅鍚嶇О"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="description"
+ label="鐐规瑕佹眰"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="isscan"
+ label="閫夋嫨鎵爜"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isscan==='Y'">鏄�</div>
+ <div v-if="row.isscan==='N'">鍚�</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="cycle"
+ label="鐐规鍛ㄦ湡"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.cycle==='D'">鏃�</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="lm_user"
+ label="鍒涘缓浜哄憳"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="lm_date"
+ label="鍒涘缓鏃堕棿"
+ width="160"
+ sortable="custom"
+ />
+ <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 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>
+ </el-table>
+ </div>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="prev, pager, next,sizes"
+ popper-class="select_bottom"
+ @pagination="getDeviceCheckItemSearch"
+ />
+ </div>
+
+ <el-dialog
+ :title="operation==='add'?'鏂板':'缂栬緫'"
+ :visible.sync="dialogVisible"
+ width="800px"
+ :close-on-click-modal="false"
+ top="15vh"
+ @closed="handleClose"
+ @close="handleClose"
+ >
+ <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
+ <el-form-item label="閮ㄤ綅缂栫爜" prop="checkitemcode">
+ <el-input v-model="dialogForm.checkitemcode" :disabled="operation!=='add'" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="閮ㄤ綅鍚嶇О" prop="checkitemname">
+ <el-input v-model="dialogForm.checkitemname" style="width: 200px" />
+ </el-form-item>
+ <el-form-item prop="cycle" label="鐐规鍛ㄦ湡">
+ <el-select
+ v-model="dialogForm.cycle"
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in cycleArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item prop="isqrcode" label="閫夋嫨鎵爜">
+ <el-select
+ v-model="dialogForm.isqrcode"
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in isqrcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鐐规瑕佹眰" prop="checkitemdescr">
+ <el-input v-model="dialogForm.checkitemdescr" type="textarea" style="width: 200px" />
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <!--瀵煎叆缁勪欢-->
+ <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+
+ </div>
+</template>
<script>
+import Pagination from '@/components/Pagination'
+import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
+import { getCookie } from '@/utils/auth'
+import { AddUpdateDeviceCheckItem, DeleteDeviceCheckItem, DeviceCheckItemSearch } from '@/api/sbgl'
+import ImportPicker from '@/components/ImportPicker'
+
+const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
- name: 'Djbw'
+ 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()
+ }
+ }
+ }
+ return {
+ mainHeight: 0,
+ tableHeight: 0,
+ form: {
+ checkitemcode: '', // 閮ㄤ綅缂栫爜
+ checkitemname: '', // 閮ㄤ綅鍚嶇О
+ checkdescr: '', // 鐐规瑕佹眰
+ isqrcode: '', // 閫変腑鎵爜
+ cycle: '', // 鐐规鍛ㄦ湡
+ prop: 'lm_date', // 鎺掑簭瀛楁
+ order: 'desc', // 鎺掑簭瀛楁
+ page: 1, // 绗嚑椤�
+ rows: 20 // 姣忛〉澶氬皯鏉�
+ },
+ isqrcodeArr: [
+ { code: 'Y', name: '鏄�' },
+ { code: 'N', name: '鍚�' }
+ ],
+ cycleArr: [
+ { code: 'D', name: '鏃�' }
+ ],
+
+ total: 10,
+ tableData: [],
+ dialogVisible: false,
+ dialogForm: {
+ id: '',
+ checkitemcode: '', // 璁惧鐐规閮ㄤ綅缂栫爜
+ checkitemname: '', // 璁惧鐐规閮ㄤ綅鍚嶇О
+ checkitemdescr: '', // 璁惧鐐规閮ㄤ綅瑕佹眰
+ cycle: 'D', // 璁惧鐐规閮ㄤ綅鍛ㄦ湡
+ isqrcode: 'Y', // 鏄惁鎵爜
+ OperType: '' // 鎿嶄綔绫诲瀷
+ },
+ operation: '',
+ dialogFormRules: {
+ checkitemcode: [
+ { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ ],
+ checkitemname: [
+ { required: true, message: '璇疯緭鍏ラ儴浣嶅悕绉�', trigger: ['blur', 'change'] }
+ ],
+ cycle: [
+ { required: true, message: '', trigger: ['blur', 'change'] }
+ ],
+ isqrcode: [
+ { required: true, message: '', trigger: ['blur', 'change'] }
+ ]
+ },
+
+ title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
+ code: '10',
+ shows: false
+
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getDeviceCheckItemSearch()
+ }
+ }
+ },
+ created() {
+ this.getDeviceCheckItemSearch()
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ methods: {
+ async getDeviceCheckItemSearch() {
+ const res = await DeviceCheckItemSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ },
+ // 鎺掑簭鏀瑰彉鏃�
+ 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.getDeviceCheckItemSearch()
+ },
+ // 鏌ヨ
+ search() {
+ this.getDeviceCheckItemSearch()
+ },
+ // 閲嶇疆
+ reset() {
+ this.form.checkitemcode = ''
+ this.form.checkitemname = ''
+ this.form.checkitemdescr = ''
+ this.form.isqrcode = ''
+ this.form.cycle = ''
+ this.getDeviceCheckItemSearch()
+ },
+
+ // 鏂板鎸夐挳
+ add(operation) {
+ this.operation = operation
+ this.dialogVisible = true
+ },
+ // 淇敼鎸夐挳
+ edit(operation, row) {
+ this.operation = operation
+ this.dialogVisible = true
+
+ this.$nextTick(() => {
+ this.dialogForm.id = row.id
+ this.dialogForm.cycle = row.cycle
+ this.dialogForm.isscan = row.isqrcode
+ this.dialogForm.checkitemcode = row.code
+ this.dialogForm.checkitemname = row.name
+ this.dialogForm.checkitemdescr = row.description
+ })
+ },
+ // 鍒犻櫎鎸夐挳
+ async del(row) {
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ DeleteDeviceCheckItem({ checkitemcode: row.code }).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍒犻櫎鎴愬姛!')
+ this.getDeviceCheckItemSearch()
+ }
+ })
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝垹闄�')
+ })
+ },
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogForm.id = ''
+ this.dialogForm.checkitemcode = ''
+ this.dialogForm.checkitemname = ''
+ this.dialogForm.checkitemdescr = ''
+ this.dialogForm.cycle = 'D'
+ this.dialogForm.isqrcode = 'Y'
+ this.$refs.dialogForm.clearValidate()
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+ this.$refs.dialogForm.validate(valid => {
+ if (valid) {
+ const data = {
+ id: this.dialogForm.id,
+ checkitemcode: this.dialogForm.checkitemcode,
+ checkitemname: this.dialogForm.checkitemname,
+ checkitemdescr: this.dialogForm.checkitemdescr,
+ cycle: this.dialogForm.cycle,
+ isqrcode: this.dialogForm.isqrcode,
+ OperType: this.operation === 'add' ? 'Add' : 'Update'
+ // Operator: getCookie('admin')
+ }
+ AddUpdateDeviceCheckItem(data).then(res => {
+ if (res.code === '200') {
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogVisible = false
+ this.getDeviceCheckItemSearch()
+ } else {
+ this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
+ }
+ })
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ },
+ // 瀵煎叆鎸夐挳
+ upload() {
+ this.shows = true
+ this.$refs.importPickerFunc.newDataFunc()
+ },
+ colos() {
+ this.shows = false
+ }
+ }
}
</script>
-<style scoped>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::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 .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;
+}
+
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
</style>
diff --git a/src/views/sbgl/djbz.vue b/src/views/sbgl/djbz.vue
index b334a97..c858a88 100644
--- a/src/views/sbgl/djbz.vue
+++ b/src/views/sbgl/djbz.vue
@@ -1,11 +1,748 @@
-<template />
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+ <div class="bodyTopButtonGroup">
+ <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>
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="80px"
+ inline
+ style="display: flex;justify-content: space-between"
+ >
+ <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 style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <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>
+
+ <div class="elTableDiv">
+ <el-table
+ :data="tableData"
+ :height="tableHeight+'px'"
+ border
+ :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-->
+ <!-- type="selection"-->
+ <!-- width="50"-->
+ <!-- />-->
+ <el-table-column
+ prop="RowNum"
+ width="50"
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="org_code"
+ label="鏍囧噯缂栫爜"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="org_name"
+ label="鏍囧噯鍚嶇О"
+ sortable="custom"
+ />
+
+ <el-table-column
+ prop="parentorg_name"
+ label="鏍囧噯鎻忚堪"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="parentorg_name"
+ label="鐐规绠℃帶"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="parentorg_name"
+ label="鍏宠仈璁惧"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="lm_user"
+ label="鍒涘缓浜哄憳"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="lm_date"
+ label="鍒涘缓鏃堕棿"
+ width="160"
+ sortable="custom"
+ />
+ <el-table-column
+ label="鎿嶄綔"
+ >
+ <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>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="prev, pager, next,sizes"
+ popper-class="select_bottom"
+ @pagination="getDeviceCheckStandArdSearch"
+ />
+ </div>
+
+ <el-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:#42b983;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 prop="SupUnit" 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:#42b983;margin: -20px 10px 20px 0" />璁惧鐐规鐐规淇℃伅
+ </div>
+ <div style="margin-bottom:10px">
+ <el-button type="primary" icon="el-icon-circle-plus-outline" @click="addRow">鏂板</el-button>
+ </div>
+ <div class="elTableDiv">
+ <el-table
+ :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="鐐规閮ㄤ綅缂栫爜"
+ >
+ <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="鐐规閮ㄤ綅鍚嶇О"
+ >
+ <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="chkdesc"
+ label="鐐规瑕佹眰"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isVisible===0">{{ row.chkdesc }}</div>
+ <el-input v-else v-model="row.chkdesc" />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="isscan"
+ label="閫夋嫨鎵爜"
+ >
+ <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="鐐规鍛ㄦ湡"
+ >
+ <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" type="text" @click="editRow(row)">缂栬緫</el-button>
+ <el-button v-if="row.isVisible===0" type="text" @click="delRow(row)">鍒犻櫎</el-button>
+
+ <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">纭</el-button>
+ <el-button v-if="row.isVisible===1" 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 @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <!--瀵煎叆缁勪欢-->
+ <import-picker
+ ref="importPickerFunc"
+ class="importPickerClass"
+ :shows.sync="shows"
+ :title="title_value"
+ :colos="colos"
+ :code="code"
+ />
+
+ </div>
+</template>
<script>
+import Pagination from '@/components/Pagination'
+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'
+
+const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
- name: 'Djbz'
+ 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,
+ 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: [],
+ dialogVisible: false,
+ dialogForm: {
+ code: '',
+ name: '',
+ enable: 'Y',
+ description: ''// 涓婄骇鍗曚綅
+ },
+ operation: '',
+ dialogFormRules: {
+
+ code: [
+ { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ ],
+ name: [
+ { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�', trigger: ['blur', 'change'] }
+ ],
+ enable: [
+ { required: true, message: '', trigger: ['blur', 'change'] }
+ ]
+ },
+ tableDataDialog: [], // 琛ㄦ牸鏁版嵁
+ tableDataDialogSelected: [], // 宸查�塩ode
+ checkItemSelectArr: [],
+
+ title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
+ code: '4',
+ shows: false
+
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getDeviceCheckStandArdSearch()
+ }
+ }
+ },
+ created() {
+ this.getDeviceCheckStandArdSearch()
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ methods: {
+ async getDeviceCheckStandArdSearch() {
+ console.log(this.form, 11)
+ const res = await DeviceCheckStandArdSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ },
+ // 鎺掑簭鏀瑰彉鏃�
+ 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.OrgCode = ''
+ this.form.OrgName = ''
+ this.form.OrgType = ''
+ this.form.UserName = ''
+ this.getDeviceCheckStandArdSearch()
+ },
+
+ async getDeviceCheckItemSelect() {
+ const { data: res } = await DeviceCheckItemSelect()
+ this.checkItemSelectArr = res
+ },
+
+ // 鏂板鎸夐挳
+ add(operation) {
+ this.operation = operation
+ this.dialogVisible = true
+ this.getDeviceCheckItemSelect()
+ },
+ // 淇敼鎸夐挳
+ edit(operation, row) {
+ this.operation = operation
+ this.dialogVisible = true
+ this.getDeviceCheckItemSelect()
+
+ this.$nextTick(() => {
+ this.dialogForm.OrgCode = row.org_code
+ this.dialogForm.OrgName = row.org_name
+ this.dialogForm.SupUnit = row.parent_id
+ })
+ },
+ // 鍒犻櫎鎸夐挳
+ async del(row) {
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ DeleteOrganization({ orgid: row.code }).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍒犻櫎鎴愬姛!')
+ this.getDeviceCheckStandArdSearch()
+ }
+ })
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝垹闄�')
+ })
+ },
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogForm.code = ''
+ this.dialogForm.name = ''
+ this.dialogForm.enable = 'Y'
+ this.dialogForm.description = ''
+ this.tableDataDialog = []
+ this.$refs.dialogForm.clearValidate()
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+ this.$refs.dialogForm.validate(valid => {
+ if (valid) {
+ 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
+ })
+ console.log(Data, 999)
+ const data = {
+ 'code': this.dialogForm.code,
+ 'name': this.dialogForm.name,
+ 'enable': this.dialogForm.enable,
+ 'description': this.dialogForm.description,
+ 'Data': Data
+ }
+ console.log(data, 111)
+ AddUpdateDeviceCheckStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
+ if (res.code === '200') {
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogVisible = false
+ this.getDeviceCheckStandArdSearch()
+ } else {
+ this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
+ }
+ })
+ },
+
+ selectChange(val, row) {
+ row.chkdesc = 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() {
+ 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: '',
+ chkdesc: '',
+ isscan: 'Y',
+ cycle: 'D',
+ isVisible: 1
+ })
+ },
+ editRow(row) {
+ this.tableDataDialogSelected.forEach((item, index) => {
+ if (item === row.checkitem_code) {
+ this.tableDataDialogSelected.splice(index, 1)
+ }
+ })
+
+ 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,
+ chkdesc: row.chkdesc,
+ isscan: row.isscan,
+ cycle: row.cycle,
+ isVisible: 1
+ })
+ }
+ })
+ },
+ delRow(row) {
+ this.tableDataDialog.forEach((item, index) => {
+ if (item.checkitem_code === row.checkitem_code) {
+ this.tableDataDialog.splice(index, 1)
+ }
+ })
+
+ this.tableDataDialogSelected.forEach((item, index) => {
+ if (item === row.checkitem_code) {
+ this.tableDataDialogSelected.splice(index, 1)
+ }
+ })
+ },
+ saveRow(row) {
+ if (this.tableDataDialogSelected.includes(row.checkitem_code)) {
+ return this.$message.info('鐐规閮ㄤ綅涓嶈兘閫夋嫨鐩稿悓锛�')
+ }
+ this.tableDataDialogSelected.push(row.checkitem_code)
+ row.isVisible = 0
+ 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)
+ row.isVisible = 0
+ this.tableDataDialog.splice(index, 1)
+ }
+ })
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ }
+ }
}
</script>
-<style scoped>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::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;
+}
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
</style>
diff --git a/src/views/sbgl/sbqd.vue b/src/views/sbgl/sbqd.vue
index cd938bd..7a0a7d5 100644
--- a/src/views/sbgl/sbqd.vue
+++ b/src/views/sbgl/sbqd.vue
@@ -1183,7 +1183,11 @@
.userDialogVisible ::v-deep .el-form-item {
margin-bottom: 0;
}
-
+::v-deep .el-select__caret{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
</style>
<style>
diff --git a/src/views/template.vue b/src/views/template.vue
index b15a11b..dfae3e6 100644
--- a/src/views/template.vue
+++ b/src/views/template.vue
@@ -3,7 +3,7 @@
<div class="body" :style="{height:mainHeight+'px'}">
<div class="bodyTopButtonGroup">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
+ <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
</div>
<div class="bodyTopFormGroup">
@@ -22,7 +22,7 @@
<el-input v-model="form.OrgName" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="缁勭粐绫诲瀷" style=" display: flex;">
- <el-select v-model="form.OrgType" :popper-append-to-body="false" style="width: 200px" placeholder="璇烽�夋嫨">
+ <el-select v-model="form.OrgType" style="width: 200px" placeholder="璇烽�夋嫨">
<el-option
v-for="item in OrgTypeArr"
:key="item.code"
@@ -129,7 +129,8 @@
<el-dialog
:title="operation==='add'?'鏂板':'缂栬緫'"
:visible.sync="dialogVisible"
- width="800"
+ width="800px"
+ :close-on-click-modal="false"
top="15vh"
@closed="handleClose"
@close="handleClose"
@@ -164,6 +165,10 @@
</div>
</span>
</el-dialog>
+
+ <!--瀵煎叆缁勪欢-->
+ <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+
</div>
</template>
@@ -171,12 +176,13 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
+import ImportPicker from '@/components/ImportPicker'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
name: 'Zzjg',
components: {
- Pagination
+ Pagination, ImportPicker
},
data() {
const validateName = (rule, value, callback) => {
@@ -241,8 +247,19 @@
SupUnit: [
{ required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
]
- }
+ },
+ title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
+ code: '4',
+ shows: false
+
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getOrganizationSearch()
+ }
}
},
created() {
@@ -275,8 +292,13 @@
search() {
this.getOrganizationSearch()
},
+ // 瀵煎叆鎸夐挳
upload() {
-
+ this.shows = true
+ this.$refs.importPickerFunc.newDataFunc()
+ },
+ colos() {
+ this.shows = false
},
// 閲嶇疆
reset() {
@@ -357,8 +379,8 @@
// 鑾峰彇椤甸潰楂樺害
getHeight() {
this.$nextTick(() => {
- this.mainHeight = window.innerHeight - 250
- this.tableHeight = this.mainHeight - 100
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
})
},
tableRowClassName({ row, rowIndex }) {
@@ -462,6 +484,11 @@
margin-bottom: 0;
}
+::v-deep .el-select__caret{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
</style>
<style>
--
Gitblit v1.9.3