From 81a36e224bc95d7041bdaadd0fc12c35d4498850 Mon Sep 17 00:00:00 2001 From: XiaoRuby <3114200645@qq.com> Date: 星期六, 26 八月 2023 11:47:04 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/api/inspection/commisioninspection.js | 24 src/views/chart/work/index.vue | 417 +++++- src/api/laboratory/role.js | 25 src/api/url.js | 1 src/views/login/index.vue | 6 src/layout/components/Navbar.vue | 83 + src/views/laboratory/role/index.vue | 226 +++ src/layout/components/Sidebar/Item.vue | 2 src/api/home/index.js | 0 src/router/index.js | 45 src/views/inspectionManagement/commissionInspection/addCommision.vue | 995 ++++++++-------- .env.staging | 2 src/api/chart/work/index.js | 36 src/views/home/index.vue | 6 src/main.js | 5 src/views/laboratory/role/menuPower.vue | 21 src/views/template_testReport/index.vue | 651 +++++++++++ package.json | 1 .env.production | 2 src/layout/components/Sidebar/index.vue | 1 src/views/CNAS/satisfactionSurveys/index.vue | 105 src/views/experiment/checkTheReport/index.vue | 50 src/layout/components/Sidebar/SidebarItem.vue | 1 src/views/inspectionManagement/commissionInspection/index.vue | 797 +++++++----- 24 files changed, 2,412 insertions(+), 1,090 deletions(-) diff --git a/.env.production b/.env.production index 64b7d95..d5166db 100644 --- a/.env.production +++ b/.env.production @@ -3,5 +3,5 @@ # base api # VUE_APP_BASE_API = '/prod-api' -VUE_APP_BASE_API = 'http://192.168.110.254:1234/' +VUE_APP_BASE_API = 'http://192.168.110.167:1234/' diff --git a/.env.staging b/.env.staging index d5bc70f..65e5ce8 100644 --- a/.env.staging +++ b/.env.staging @@ -5,6 +5,6 @@ # base api # VUE_APP_BASE_API = '/stage-api' -VUE_APP_BASE_API = 'http://192.168.110.87:1234/' +VUE_APP_BASE_API = 'http://192.168.110.167:1234/' diff --git a/package.json b/package.json index 00e6b41..048f7b0 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "path-to-regexp": "2.4.0", "postcss-pxtorem": "^5.1.1", "vue": "2.6.10", + "vue-clipboard2": "^0.3.3", "vue-router": "3.0.6", "vuex": "3.1.0" }, diff --git a/src/api/chart/work/index.js b/src/api/chart/work/index.js new file mode 100644 index 0000000..b948d37 --- /dev/null +++ b/src/api/chart/work/index.js @@ -0,0 +1,36 @@ +import request from '@/utils/request' + +//鑾峰彇璐d换浜洪」鐩暟缁熻 +export function getDutyMater(params) { + return request({ + url: '/work/dutyMater', + method: 'get', + params + }) +} + +//鑾峰彇璐d换浜哄強鏃剁巼 +export function getDutyTimely(params) { + return request({ + url: '/work/dutytimely', + method: 'get', + params + }) +} +//鑾峰彇鎵ц浜洪」鐩暟缁熻 +export function getExecuteMater(params) { + return request({ + url: '/work/executeMater', + method: 'get', + params + }) +} + +//鑾峰彇鎵ц浜哄強鏃剁巼 +export function getExecuteTimely(params) { + return request({ + url: '/work/executetimely', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/api/home.js b/src/api/home/index.js similarity index 100% rename from src/api/home.js rename to src/api/home/index.js diff --git a/src/api/inspection/commisioninspection.js b/src/api/inspection/commisioninspection.js index ce4a93f..982a2f0 100644 --- a/src/api/inspection/commisioninspection.js +++ b/src/api/inspection/commisioninspection.js @@ -40,4 +40,28 @@ method: 'post', data }) +} + +export function getViewUUID(params){ + return request({ + url: '/link-basic/getViewUUID', + method: 'get', + params + }) +} + +export function selectViewUUID(){ + return request({ + url: '/link-basic/selectViewUUID', + method: 'get' + }) +} + + +export function isIfViewUUID(params){ + return request({ + url: '/link-basic/isIfViewUUID', + method: 'get', + params + }) } \ No newline at end of file diff --git a/src/api/laboratory/role.js b/src/api/laboratory/role.js index 64a2930..9744850 100644 --- a/src/api/laboratory/role.js +++ b/src/api/laboratory/role.js @@ -6,4 +6,29 @@ method: 'get', params }) + } + + export function addRoleInfo(data) { + return request({ + url: '/role-manager/addRoleInfo', + method: 'post', + data + }) + } + + export function assertRepeat(params) { + return request({ + url: '/role-manager/assertRepeat', + method: 'get', + params + }) + } + + //getAllRoleAndMenuInfo + export function getAllRoleAndMenuInfo(params) { + return request({ + url: '/role-manager/getAllRoleAndMenuInfo', + method: 'get', + params + }) } \ No newline at end of file diff --git a/src/api/url.js b/src/api/url.js index 8849e20..fbaa55b 100644 --- a/src/api/url.js +++ b/src/api/url.js @@ -5,6 +5,7 @@ "reported": "/plan/reported",//涓婃姤 "distribution": "/plan/distribution",//鍒嗛厤 "check": "/plan/check",//妫�楠� + "info": "/user/info",//鐧诲綍-->鑾峰彇鐢ㄦ埛淇℃伅 } export default function(Vue) { diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 41a57c4..3876bf3 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -6,25 +6,41 @@ <div class="right-menu"> <div class="right-serves"> - <i class="el-icon-setting" /> - <i class="el-icon-bell" /> - <i class="el-icon-time" /> + <!-- <i class="el-icon-setting" /> --> + + <p @click="toMessage"><el-badge is-dot class="el-icon-bell message-icon"></el-badge></p> + <!-- <i class="el-icon-time" /> --> </div> <el-dropdown class="avatar-container" trigger="click"> <div class="avatar-wrapper"> - <a class="user-avatar">{{ '涓ぉ'.slice(0,1) }}</a> + <a class="user-avatar">{{ user.name.slice(0,1) }}</a> </div> <el-dropdown-menu slot="dropdown" class="user-dropdown"> - <router-link to="/"> - <el-dropdown-item> - 淇敼瀵嗙爜 + <el-dropdown-item > + <p @click="dialogFormVisible = true">淇敼瀵嗙爜</p> </el-dropdown-item> - </router-link> <el-dropdown-item divided @click.native="logout"> <span style="display:block;">閫�鍑虹櫥褰�</span> </el-dropdown-item> </el-dropdown-menu> </el-dropdown> + <el-dialog title="淇敼瀵嗙爜" :visible.sync="dialogFormVisible" :append-to-body="true"> + <el-form :model="form"> + <el-form-item label="鏃у瘑鐮�" :label-width="formLabelWidth"> + <el-input v-model="form.oldPwd" autocomplete="off"></el-input> + </el-form-item> + <el-form-item label="鏂板瘑鐮�" :label-width="formLabelWidth"> + <el-input maxlength="30" show-word-limit v-model="form.newPwd" autocomplete="off"></el-input> + </el-form-item> + <el-form-item label="纭瀵嗙爜" :label-width="formLabelWidth"> + <el-input maxlength="30" show-word-limit v-model="form.confirmPwd" autocomplete="off"></el-input> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button @click="reset()">鍙� 娑�</el-button> + <el-button type="primary" @click="editPwd">纭� 瀹�</el-button> + </div> + </el-dialog> </div> </div> </template> @@ -33,8 +49,29 @@ import { mapGetters } from 'vuex' // import Breadcrumb from '@/components/Breadcrumb' // import Hamburger from '@/components/Hamburger' + import { + get, + post, + wpost, + postFile + } from "@/api/util/requestUtil.js" export default { + data(){ + return { + form: { + oldPwd: '', + newPwd: '', + confirmPwd: '' + }, + dialogFormVisible: false, + formLabelWidth: '120px', + user: { + id: null, + name: 'value' + } + } + }, components: { // Breadcrumb, // Hamburger @@ -45,14 +82,34 @@ 'avatar' ]) }, + mounted() { + this.getUser() + }, methods: { + reset(){ + this.dialogFormVisible = false; + this.form.oldPwd = ''; + this.form.newPwd = ''; + this.form.confirmPwd = ''; + }, + toMessage(){ + this.$router.push('/message/toDo'); + }, + editPwd(){ + console.log(1); + }, toggleSideBar() { this.$store.dispatch('app/toggleSideBar') }, async logout() { // await this.$store.dispatch('user/logout') this.$router.push(`/login?redirect=${this.$route.fullPath}`) - } + }, + getUser(){ + get(this.$url.info).then(res=>{ + this.user = res.data + }) + } } } </script> @@ -67,7 +124,13 @@ border-bottom: 1px solid #f0f2f5; // box-shadow: 0 0 0.857143rem rgba(0, 0, 0, 0.12); // box-shadow: 0 1px 4px rgba(0,21,41,.08); - + .message-icon{ + margin-right: 10px; + cursor: pointer; + } + .v-modal{ + z-index: 8; + } .hamburger-container { line-height: 46px; height: 100%; diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue index 7785af0..454e81b 100644 --- a/src/layout/components/Sidebar/Item.vue +++ b/src/layout/components/Sidebar/Item.vue @@ -19,9 +19,7 @@ render(h, context) { const { icon, title } = context.props const vnodes = [] - // console.log(show) // if (!show) return - // console.log(icon, title) if (icon) { if (icon.includes('el-icon')) { vnodes.push(<i class={[icon, 'sub-el-icon']} />) diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index e5b588f..498db1c 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -63,7 +63,6 @@ return {} }, created() { - // console.log(this.item) }, methods: { hasOneShowingChild(children = [], parent) { diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index e093b2b..1187cbb 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -31,7 +31,6 @@ 'sidebar' ]), routes() { - console.log(this.$router.options.routes); return this.$router.options.routes }, activeMenu() { diff --git a/src/main.js b/src/main.js index beb2705..1eda87c 100644 --- a/src/main.js +++ b/src/main.js @@ -7,6 +7,8 @@ import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n +import VueClipboard from 'vue-clipboard2' +Vue.use(VueClipboard) import '@/styles/index.scss' // global css @@ -41,6 +43,8 @@ return JSON.parse(JSON.stringify(val)) } +Vue.prototype.vueIp = "http://localhost:8080/" + // set ElementUI lang to EN Vue.use(ElementUI, { locale }) // 濡傛灉鎯宠涓枃鐗� element-ui锛屾寜濡備笅鏂瑰紡澹版槑 @@ -50,6 +54,7 @@ Vue.config.productionTip = false + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index d21d534..25cd92c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,6 +42,16 @@ hidden: true }, { + path: '/addCommision', + component: () => import('@/views/inspectionManagement/commissionInspection/addCommision'), + hidden:true + }, + { + path: '/testReport', + component: () => import('@/views/template_testReport/index'), + hidden:true + }, + { path: '/', component: Layout, redirect: '/home', @@ -53,6 +63,11 @@ meta: { title: '涓婚〉', icon: 'el-icon-s-home' } }] }, + { + path: '/addCommision/:viewId', + hidden: true, + component: () => import('@/views/inspectionManagement/commissionInspection/addCommision'), + }, { path: '/standardLibrary', component: Layout, @@ -164,16 +179,7 @@ path: 'commissionInspection', name: 'CommissionInspection', component: () => import('@/views/inspectionManagement/commissionInspection/index'), - meta: { title: '濮旀墭妫�楠�', icon: 'table' }, - children: [ - { - path: 'addCommision', - name: 'AddCommision', - hidden: true, - component: () => import('@/views/inspectionManagement/commissionInspection/addCommision'), - meta: { title: '妫�娴嬩俊鎭�', icon: 'table' } - } - ] + meta: { title: '濮旀墭妫�楠�', icon: 'table' } }, { path: 'reportForInspection', @@ -418,22 +424,23 @@ { path: '/message', component: Layout, - redirect: '/message/message', + redirect: '/message/toDo', name: 'Message', meta: { title: '娑堟伅寰呭姙', icon: 'el-icon-s-help' }, children: [ + { + path: 'toDo', + name: 'ToDo', + component: () => import('@/views/message/toDo/index'), + meta: { title: '鎴戠殑寰呭姙', icon: 'tree' } + }, { path: 'message', name: 'Message', + // hidden: true, component: () => import('@/views/message/message/index'), - meta: { title: '鎴戠殑娑堟伅', icon: 'table' } + // meta: { title: '鎴戠殑娑堟伅', icon: 'table' } }, - { - path: 'toDo', - name: 'ToDo', - component: () => import('@/views/message/toDo/index'), - meta: { title: '鎴戠殑寰呭姙', icon: 'tree' } - } ] }, { @@ -476,7 +483,7 @@ ] const createRouter = () => new Router({ - // mode: 'history', // require service support + mode: 'history', scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) diff --git a/src/views/CNAS/satisfactionSurveys/index.vue b/src/views/CNAS/satisfactionSurveys/index.vue index f1e2efb..05f49fe 100644 --- a/src/views/CNAS/satisfactionSurveys/index.vue +++ b/src/views/CNAS/satisfactionSurveys/index.vue @@ -482,74 +482,73 @@ </script> <style lang="scss" scoped> -.top-bar { - margin: -25px -15px; - background: #fff; - display: flex; - justify-content: space-between; - padding: 5px 24px 0px 24px; +.content-main { + .el-form .el-form-item .el-form-item__content { + width: 100% !important; + } - .input-form { - width: 800px; - } - - .el-dropdown-link { - cursor: pointer; - color: #409EFF !important; - } - - .el-icon-arrow-down { - font-size: 12px !important; - } - - -} - -.library-table { - background-color: #fff; - flex: 1; - margin: 0px -15px; - margin-top: 40px; - display: flex; - flex-direction: column; - - .table-header { - padding: 20px; + .top-bar { + margin: -25px -15px; + background: #fff; display: flex; justify-content: space-between; + padding: 5px 24px 0px 24px; - .el-form-item { - margin-bottom: 30px !important; + .input-form { + width: 800px; } + + .el-dropdown-link { + cursor: pointer; + color: #409EFF !important; + } + + .el-icon-arrow-down { + font-size: 12px !important; + } + + } - .table-box { - padding: 0px 20px; - margin-top: 20px; + .library-table { + background-color: #fff; flex: 1; - background: #fff; + margin: 0px -15px; + margin-top: 40px; display: flex; flex-direction: column; - >div:nth-child(2) { + .table-header { + padding: 20px; display: flex; - justify-content: end; - margin: 10px 0; + justify-content: space-between; + + .el-form-item { + margin-bottom: 30px !important; + } } - } -} + .table-box { + padding: 0px 20px; + margin-top: 20px; + flex: 1; + background: #fff; + display: flex; + flex-direction: column; -.table, -tr, -td { - padding: 10px; -} -</style> -<style > -.content-main { - .el-form .el-form-item .el-form-item__content { - width: 100% !important; + >div:nth-child(2) { + display: flex; + justify-content: end; + margin: 10px 0; + } + + } + } + + .table, + tr, + td { + padding: 10px; } } </style> diff --git a/src/views/chart/work/index.vue b/src/views/chart/work/index.vue index 59b9b32..e04f144 100644 --- a/src/views/chart/work/index.vue +++ b/src/views/chart/work/index.vue @@ -4,27 +4,31 @@ <el-row :gutter="10"> <el-col :span="24"> <el-card> - <el-form :inline="true" :model="formInline" class="demo-form-inline"> - <el-form-item> + <el-form :rules="rules" ref="formInline" :inline="true" + :model="formInline" class="demo-form-inline"> + <el-form-item prop="date"> <p><span>*</span>妫�娴嬫棩鏈�:</p> <el-date-picker - v-model="dateTime" + v-model="formInline.date" + format="yyyy-MM-dd" + value-format="yyyy-MM-dd" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"> </el-date-picker> </el-form-item> - <el-form-item> + <el-form-item prop="type"> <p><span>*</span>妫�楠岀被鍨�:</p> - <el-select v-model="formInline.region" placeholder="閲囪喘鍏ュ簱"> - <el-option label="鍖哄煙涓�" value="shanghai"></el-option> - <el-option label="鍖哄煙浜�" value="beijing"></el-option> + <el-select v-model="formInline.type" placeholder="閲囪喘鍏ュ簱"> + <el-option label="鍘熸潗鏂�" value="0"></el-option> + <el-option label="鎴愬搧" value="1"></el-option> + <el-option label="濮旀墭鍝�" value="2"></el-option> </el-select> </el-form-item> <el-form-item class="buttons"> - <el-button>娓呯┖</el-button> - <el-button type="primary" @click="onSubmit">鏌ヨ</el-button> + <el-button @click="resetForm('formInline')">娓呯┖</el-button> + <el-button type="primary" @click="onSubmit('formInline')">鏌ヨ</el-button> </el-form-item> </el-form> </el-card> @@ -48,59 +52,105 @@ <el-col :span="12"> <el-card> <p>璐熻矗浜哄強鏃剁巼</p> - <div id="leaderTimly" style="width:100%;height:400px;"></div> + <div id="leaderTimely" style="width:100%;height:400px;"></div> </el-card> </el-col> <el-col :span="12"> <el-card> <p>瀹為獙鍛樺強鏃剁巼</p> - <div id="testerTimly" style="width:100%;height:400px;"></div> + <div id="testerTimely" style="width:100%;height:400px;"></div> </el-card> </el-col> </el-row> </div> - <div class="work-foot"></div> + <div class="work-foot"> + <el-button type="primary">鏁版嵁瀵煎嚭</el-button> + </div> </div> </template> <script> import * as echarts from 'echarts'; +import { getDutyMater,getDutyTimely,getExecuteMater,getExecuteTimely +} from '@/api/chart/work/index' export default { data() { return { formInline: { - user: '', - region: '' + date: null, + type: '' }, - dateTime: '', + rules: { + type: [ + { required: true, message: '璇烽�夋嫨妫�娴嬬被鍨�', trigger: 'change' } + ], + date: [ + {required: true, message: '璇烽�夋嫨鏃ユ湡', trigger: 'change' } + ] + }, } }, mounted(){ - this.initLeaderStatiChart('leaderStati'); - this.initLeaderTimlyChart(); - this.initLeaderStatiChart('testerStati'); - this.initTesterTimlyChart(); + // this.initLeaderStatiChart(""); + this.initLeaderTimelyChart("leaderTimely"); + this.initTesterStatiChart("testerStati"); + this.initTesterTimelyChart("testerTimely"); }, methods: { - onSubmit() { - console.log('submit!'); + async queryData(){ + let date = this.formInline.date; + let obj = { + startTime : date[0], + endTime : date[1], + type : this.formInline.type + } + const dutyMater = await getDutyMater(obj); + const dutyTimely = await getDutyTimely(obj); + const executeMater = await getExecuteMater(obj); + const executeTimely = await getExecuteTimely(obj); + console.log("dm",dutyMater.data); + console.log("dt",dutyTimely.data); + console.log("em",executeMater.data.length); + console.log("et",executeTimely.data); + this.initLeaderStatiChart("leaderStati",dutyMater.data); + this.initLeaderTimelyChart("leaderTimely",dutyTimely.data); + this.initTesterStatiChart("testerStati",executeMater.data); + this.initTesterTimelyChart("testerTimely",executeTimely.data); }, - initLeaderStatiChart(id){ + onSubmit(formName) { + this.$refs[formName].validate((valid) => { + if (valid) { + this.queryData(); + } else { + console.log('error submit!!'); + return false; + } + }); + }, + resetForm(formName) { + this.formInline.date = null; + this.formInline.type = null; + this.$refs[formName].resetFields(); + }, + initLeaderStatiChart(id,dutyMater){ var chartDom = document.getElementById(id); var myChart = echarts.init(chartDom); + window.addEventListener('resize', function() { + myChart.resize(); + }); var option; - + let max = 0; let xAxisData = []; let data1 = []; let data2 = []; - let data3 = []; - let data4 = []; - for (let i = 0; i < 10; i++) { - xAxisData.push('Class' + i); - data1.push(+(Math.random() * 2).toFixed(2)); - data2.push(+(Math.random() * 5).toFixed(2)); - data3.push(+(Math.random() + 0.3).toFixed(2)); - data4.push(+Math.random().toFixed(2)); + for(let i=0;i<dutyMater.length;i++){ + xAxisData.push(dutyMater[i].name); + data1.push(dutyMater[i].finsh); + data2.push(dutyMater[i].unfinish); + let sum = dutyMater[i].finsh + dutyMater[i].unfinish; + if( sum > max ){ + max = sum; + } } var emphasisStyle = { itemStyle: { @@ -110,7 +160,7 @@ }; option = { legend: { - data: ['bar', 'bar2'], + data: ['宸插畬鎴�', '鏈畬鎴�'], left: 'center' }, tooltip: {}, @@ -121,59 +171,282 @@ splitLine: { show: false }, splitArea: { show: false } }, - yAxis: {}, + yAxis: { + min: 0, + max: max, + interval: max, + }, grid: { bottom: 100 }, series: [ { - name: 'bar', + name: '宸插畬鎴�', + barWidth: '20%', type: 'bar', stack: 'one', emphasis: emphasisStyle, - data: data1 + data: data1, + itemStyle: { + color: '#80d9c5' + } }, { - name: 'bar2', + name: '鏈畬鎴�', + barWidth: '20%', type: 'bar', stack: 'one', emphasis: emphasisStyle, - data: data2 + data: data2, + itemStyle: { + color: '#f2d09d' + }, } ] }; - myChart.on('brushSelected', function (params) { - var brushed = []; - var brushComponent = params.batch[0]; - for (var sIdx = 0; sIdx < brushComponent.selected.length; sIdx++) { - var rawIndices = brushComponent.selected[sIdx].dataIndex; - brushed.push('[Series ' + sIdx + '] ' + rawIndices.join(', ')); + option && myChart.setOption(option); + }, + initTesterStatiChart(id,executeMater){ + console.log("qqq----",executeMater); + var chartDom = document.getElementById(id); + var myChart = echarts.init(chartDom); + window.addEventListener('resize', function() { + myChart.resize(); + }); + var option; + + let xAxisData = []; + let data1 = []; + let data2 = []; + // for(let i=0;i<executeMater.length;i++){ + // xAxisData.push(executeMater[i].name); + // data1.push(executeMater[i].finsh); + // data2.push(executeMater[i].unfinsh); + // } + var emphasisStyle = { + itemStyle: { + shadowBlur: 10, + shadowColor: 'rgba(0,0,0,0.3)' } - myChart.setOption({ - title: { - backgroundColor: '#333', - text: 'SELECTED DATA INDICES: \n' + brushed.join('\n'), - bottom: 0, - right: '10%', - width: 100, - textStyle: { - fontSize: 12, - color: '#fff' + }; + option = { + legend: { + data: ['鏁版嵁1', '鏁版嵁2'], + left: 'center' + }, + tooltip: {}, + xAxis: { + data: xAxisData, + name: '濮撳悕', + axisLine: { onZero: true }, + splitLine: { show: false }, + splitArea: { show: false } + }, + yAxis: { + min: 0, + max: 60, + interval: 10, + }, + grid: { + bottom: 100 + }, + series: [ + { + name: '鏁版嵁1', + type: 'bar', + stack: 'one', + emphasis: emphasisStyle, + data: data1, + itemStyle:{ + color: "#d97559" + } + }, + { + name: '鏁版嵁2', + type: 'bar', + stack: 'one', + emphasis: emphasisStyle, + data: data2, + itemStyle:{ + color: "#e4c477" } } - }); + ] + }; + option && myChart.setOption(option); + }, + initLeaderTimelyChart(id,dutyTimely){ + var chartDom = document.getElementById(id); + var myChart = echarts.init(chartDom); + window.addEventListener('resize', function() { + myChart.resize(); }); + var option; + option = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + } + }, + legend: { + data: ['鏍峰搧鏁�', '瀹屾垚鍙婃椂鐜�'] + }, + xAxis: [ + { + name: '濮撳悕', + type: 'category', + data: ['娌愮',], + axisPointer: { + type: 'shadow' + }, + itemStyle: { + top: '20px' + } + } + ], + yAxis: [ + { + type: 'value', + name: '鏁伴噺', + min: 0, + max: 10, + interval: 1, + axisLabel: { + formatter: '{value}' + } + }, + { + type: 'value', + name: '鐧惧垎姣�', + min: 0, + max: 100, + interval: 10, + axisLabel: { + formatter: '{value} %' + } + } + ], + series: [ + { + name: '鏍峰搧鏁�', + type: 'bar', + barWidth: '20%', + tooltip: { + valueFormatter: function (value) { + return value; + } + }, + data: [4.0], + itemStyle: { + color: '#9fceff' + } + }, + { + name: '瀹屾垚鍙婃椂鐜�', + type: 'line', + tooltip: { + valueFormatter: function (value) { + return value + ' %'; + } + }, + data: [7.5], + itemStyle: { + color: '#d2eec5' + } + }, + ] + }; option && myChart.setOption(option); }, - initTesterStatiChart(){ + initTesterTimelyChart(id,executeTimely){ + var chartDom = document.getElementById(id); + var myChart = echarts.init(chartDom); + window.addEventListener('resize', function() { + myChart.resize(); + }); + var option; + option = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + } + }, + legend: { + data: ['椤圭洰鏁�', '瀹屾垚鍙婃椂鐜�'], + show: true + }, + xAxis: [ + { + type: 'category', + data: ["","",""], + axisPointer: { + type: 'shadow' + } + } + ], + yAxis: [ + { + type: 'value', + name: '', + min: 0, + max: 50, + interval: 5, + axisLabel: { + formatter: '{value}' + } + }, + { + type: 'value', + name: '', + min: 0, + max: 100, + interval: 10, + axisLabel: { + formatter: '{value} %' + } + } + ], + series: [ + { + name: '椤圭洰鏁�', + type: 'bar', + tooltip: { + valueFormatter: function (value) { + return value ; + } + }, + data: [2.0, 4.9, 7.0], + itemStyle: { + color: '#5087ec' + } + }, + { + name: '瀹屾垚鍙婃椂鐜�', + type: 'line', + yAxisIndex: 1, + tooltip: { + valueFormatter: function (value) { + return value + ' %'; + } + }, + data: [2.0, 2.2, 3.3], + itemStyle: { + color: '#68bbc4' + } + } + ] + }; - }, - initLeaderTimlyChart(){ - - }, - initTesterTimlyChart(){ - + option && myChart.setOption(option); }, } } @@ -186,7 +459,7 @@ padding: 0; .work-head{ width:94%; - height:100; + height:100px; margin: 5px 10px; position: fixed; z-index: 10; @@ -203,16 +476,32 @@ } } .buttons{ - margin: 40px 0px 0px 900px; + margin: 40px 0px 0px 50%; } } } .work-center{ - margin: 0px 0px 5px 10px; + margin: 0px 0px 150px 10px; padding: 18vh 0px 5px 0px; .el-card{ margin: 5px 0px; height:500px; + p{ + font-size: 22px; + margin: 0; + padding: 0; + } + } + } + .work-foot{ + width:100%; + height:50px; + position: fixed; + bottom: 0px; + z-index: 10; + text-align: right; + .el-button{ + margin-right: 7%; } } } diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue index 2a92de3..a127c10 100644 --- a/src/views/experiment/checkTheReport/index.vue +++ b/src/views/experiment/checkTheReport/index.vue @@ -1,27 +1,33 @@ <template> <div class="content-main"> <div class="top-bar"> - <el-form ref="form" :inline="true"> - <el-form-item class="sermargin"> + <el-form ref="form" :inline="true" :model="searchData" label-position="left"> + <el-form-item label="鏍峰搧缂栧彿:"> <el-input - v-model="input" + v-model="searchData.sample_code" class="input-form" - placeholder="璇风洿鎺ヨ緭鍏ユ牱寮忕紪鍙�/鎶ュ憡鍗曞彿/鏍峰搧缂栧彿/杩涜鎼滅储鎴栦笅鎷夐�夋嫨杩涜缁勫悎鏌ヨ" + placeholder="璇疯緭鍏ユ牱鍝佺紪鍙�" @keyup.enter.native="getData" + /> + </el-form-item> + <el-form-item label="鎶ュ憡鍗曞彿:"> + <el-input + v-model="searchData.reportCode" + class="input-form" + placeholder="璇疯緭鍏ユ姤鍛婂崟鍙�" + /> + </el-form-item> + <el-form-item label="鐢宠鍗曞彿:"> + <el-input + v-model="searchData.application_code" + class="input-form" + placeholder="璇疯緭鍏ョ敵璇峰崟鍙�" /> </el-form-item> <el-form-item> <el-button type="primary" @click="getData()">鏌ヨ</el-button> <el-button type="primary" plain @click="resetData()">閲嶇疆</el-button> </el-form-item> - <el-dropdown> - <span class="el-dropdown-link"> - 楂樼骇鎼滅储<i class="el-icon-arrow-down el-icon--right"></i> - </span> - <el-dropdown-menu slot="dropdown"> - <el-dropdown-item>楂樼骇鎼滅储</el-dropdown-item> - </el-dropdown-menu> - </el-dropdown> </el-form> <el-form> <el-button class="rightBtn" type="primary" icon="el-icon-document" @@ -36,7 +42,8 @@ <el-radio-button>鍏ㄩ儴</el-radio-button> <el-radio-button label="0">寰呮彁浜�</el-radio-button> <el-radio-button label="1">寰呭鏍�</el-radio-button> - <el-radio-button label="2">宸插鏍�</el-radio-button> + <el-radio-button label="2">寰呯瀛�</el-radio-button> + <el-radio-button label="3">宸插畬鎴�</el-radio-button> </el-radio-group> <el-checkbox v-model="checked" style="margin-left: 20px" @@ -165,7 +172,11 @@ export default { data() { return { - input: "", + searchData:{ + sample_code:'', + reportCode:'', + application_code: '' + }, checkStatus: undefined, reportTable: [], page: 1, @@ -196,7 +207,11 @@ }, // 閲嶇疆鎸夐挳 resetData() { - this.input = undefined; + this.searchData={ + sample_code:'', + reportCode:'', + application_code: '' + }, this.page = 1; this.pageSize = 10; this.checkStatus = undefined; @@ -207,7 +222,7 @@ const params = { page: this.page, pageSize: this.pageSize, - name: this.input ? this.input : undefined, + name: this.searchData.sample_code ? this.searchData.sample_code : undefined, status: this.checkStatus ? this.checkStatus : undefined, }; const { data } = await selectAllReport(params); @@ -226,7 +241,8 @@ justify-content: space-between; padding: 5px 24px 0px 24px; .input-form { - width: 700px; + width: 250px; + margin-right: 30px; } .el-dropdown-link { cursor: pointer; diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 9173448..d7201cd 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -71,7 +71,7 @@ </el-col> <el-col :span="12"> <el-card :body-style="{ padding: '0px',height:'25vh' }"> - <p style="z-index: 10;position: absolute;font-size: 10px;margin-left: 10px;color: #ff0000;">鏈楠�</p> + <p style="z-index: 2;position: absolute;font-size: 10px;margin-left: 10px;color: #ff0000;">鏈楠�</p> <el-table :data="uncheckedData" :cell-style="cell" @@ -105,7 +105,7 @@ import * as echarts from 'echarts'; import { getVerifiedTop3,getUncheckedTop4,getMatAndFinshQualified, getCheckAndProjectNum,getTurno -} from '@/api/home' +} from '@/api/home/index' export default { name: "home", data() { @@ -113,7 +113,7 @@ insNum: 0, insUnNum: 0, insproNum: 0, - insproUnNum: 1110, + insproUnNum: 0, radioType: "鏈勾", imgSrc: require("@/assets/404_images/bg.png"), verifiedData: new Array(), diff --git a/src/views/inspectionManagement/commissionInspection/addCommision.vue b/src/views/inspectionManagement/commissionInspection/addCommision.vue index cd441b4..ace97d5 100644 --- a/src/views/inspectionManagement/commissionInspection/addCommision.vue +++ b/src/views/inspectionManagement/commissionInspection/addCommision.vue @@ -1,529 +1,492 @@ <template> - <div v-if="!showDetail"> - <div class="content-main"> - <div class="firstBox"> - <div class="title">妫�娴嬩俊鎭�</div> - <div class="tableBox"> - <div class="tableBox-header"> - <el-button class="split" @click="dialogueFormVisible = true" type="primary" size="small" style="background-color: rgb(1, 102, 226);">娣诲姞鏍峰搧</el-button> - <el-input + <div class="add_commision"> + <div class="content-main"> + <div class="firstBox"> + <div class="title">濮旀墭淇℃伅</div> + <div class="tableBox"> + <div class="tableBox-header"> + <el-button class="split" @click="dialogueFormVisible = true" type="primary" size="small" + style="background-color: rgb(1, 102, 226);">娣诲姞鏍峰搧</el-button> + <!-- <el-input v-model="searchData" class="input-form split" placeholder="鎵弿浜岀淮鐮佸綍鍏ユ牱鍝�..." prefix-icon="el-icon-search" style="width: 200px;" > - </el-input> - <el-button type="primary" size="small" style="background-color: rgb(1, 102, 226);">閲嶇疆</el-button> - </div> - <el-table - ref="detectionInfo" - :max-height="800" - :cell-style="{textAlign: 'center'}" - :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" - :data="detectionInfo" - style="width: 100%" - > - <el-table-column - type="index" - label="搴忓彿" - min-width="10%" - /> - <el-table-column - prop="sampleNumber" - label="鏍峰搧缂栧彿" - min-width="8%" - /> - <el-table-column - prop="sampleName" - label="鏍峰搧鍚嶇О" - min-width="10%" - /> - <el-table-column - prop="specificationsModels" - label="瑙勬牸鍨嬪彿" - min-width="10%" - /> - <el-table-column - prop="unit" - label="鍗曚綅" - min-width="8%" - /> - <el-table-column - prop="samplesNumber" - label="鏁伴噺" - min-width="8%" - /> - <el-table-column - prop="addway" - label="娣诲姞鏂瑰紡" - min-width="8%"> - <template slot-scope="scope"> - <div v-if="scope.row.addway === 0"> - <el-tag :type= 'success' disable-transitions>鎵弿</el-tag> - </div> - <div v-if="scope.row.addway === 1"> - <el-tag :type= 'primary' disable-transitions>褰曞叆</el-tag> - </div> - <div v-else></div> - </template> - </el-table-column> - <el-table-column - prop="experiment" - label="璇曢獙" - min-width="8%" - /> - <el-table-column - prop="remarks" - label="澶囨敞" - min-width="8%" - /> - <el-table-column - label="鎿嶄綔" - min-width="8%" - > - <template slot-scope="scope"> - <el-button type="text" size="small">淇敼</el-button> - <el-button type="text" size="small" @click="deleteRow(scope.row)">鍒犻櫎</el-button> - </template> - </el-table-column> - </el-table> - <!-- 鍒嗛〉鍣� --> - <div> - <el-pagination - class="pagination" - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - :current-page="currentPage" - :page-sizes="[100, 200, 300, 400]" - :page-size="100" - layout="total, sizes, prev, pager, next, jumper" - :total="400"> - </el-pagination> - </div> - </div> - <div class="secondBox"> - <el-row class="header"> - <el-col :span="12">鍩烘湰淇℃伅</el-col> - <el-col :span="12" style="text-align: right;"> - <!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false --> - <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">鎵撳嵃濮旀墭鍗�</el-button> - </el-col> - </el-row> - <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="right" label-width="100px" size="mini" > - <div class="formwrapper"> - <el-row :gutter="200"> - <el-col :span="5"> - <el-form-item label="濮旀墭缂栧彿锛�"> - <el-input style="width: 160px" type="text" :value="infoForm.commisioncode" readonly disabled="true" autocomplete="off" /> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="濮旀墭鍗曚綅锛�"> - <el-input style="width: 160px" v-model="infoForm.department" placeholder="璇疯緭鍏ュ鎵樺崟浣�" /> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="鑱旂郴浜猴細"> - <el-input style="width: 160px" v-model="infoForm.contacter" placeholder="璇疯緭鍏ュ鎵樺崟浣�" /> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="鑱旂郴鐢佃瘽锛�"> - <el-input style="width: 160px" v-model="infoForm.tel" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" /> - </el-form-item> - </el-col> - </el-row> - <el-row :gutter="200"> - <el-col :span="5"> - <el-form-item label="鑱旂郴鍦板潃锛�" > - <el-input style="width: 160px;" v-model="infoForm.address" placeholder="璇疯緭鍏ヨ仈绯诲湴鍧�" autocomplete="off" /> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="瀹屾垚鏈熼檺锛�"> - <el-date-picker - v-model="infoForm.deadline" - type="date" - placeholder="閫夋嫨鏃ユ湡" - style="width: 160px;"> - </el-date-picker> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="閫佹牱鏃堕棿锛�"> - <el-date-picker - v-model="infoForm.time" - type="date" - placeholder="閫夋嫨鏃ユ湡" - style="width: 160px;"> - </el-date-picker> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="閫佹牱鏂瑰紡锛�"> - <el-select style="width: 160px;" v-model="infoForm.way" size="small" placeholder="閫佹牱"> - <el-option v-for="options in sampleDeliveryMode" :key="options.key" :value="options.value">{{ options.value }}</el-option> - </el-select> - </el-form-item> - </el-col> - </el-row> - <el-row :gutter="200"> - <el-col :span="5"> - <el-form-item label="閫佹牱浜猴細" > - <el-input style="width: 160px;" v-model="infoForm.sender" placeholder="璇疯緭鍏ラ�佹牱浜�" autocomplete="off" /> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="閫佹牱浜虹數璇濓細" > - <el-input style="width: 160px;" v-model="infoForm.sendertel" placeholder="璇疯緭鍏ラ�佹牱浜虹數璇�" autocomplete="off" /> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="鎶ュ憡鏁帮細"> - <el-input style="width: 160px;" v-model="infoForm.num" placeholder="璇疯緭鍏ユ姤鍛婃暟" autocomplete="off" /> - </el-form-item> - </el-col> - <el-col :span="5"> - <el-form-item label="濮旀墭澶囨敞锛�"> - <el-input style="width: 160px;" v-model="infoForm.other" placeholder="澶囨敞" autocomplete="off" /> - </el-form-item> - </el-col> - </el-row> - </div> - <div class="submitBtn"> - <el-button type="primary" size="small" @click="submitInspection" style="background-color: rgb(1, 102, 226);">鎻愪氦</el-button> - </div> - </el-form> - </div> - </div> - <div class="checkType"> - <el-dialog - title="娣诲姞鎸囨爣" - :visible.sync="dialogueFormVisible" - width="40%" - > - <el-form :model="addPointerForm" ref="addPointerForm" class="addPointerForm" label-position="right" label-width="100px" size="mini"> - <el-row :gutter="50"> - <el-col :span="10"> - <el-form-item label="鏍峰搧缂栧彿锛�"> - <el-select style="width: 160px;" v-model="addPointerForm.sampleNumber" size="small" placeholder="璇烽�夋嫨鏍峰搧缂栧彿"> - <el-option v-for="options in samplecodeoptions" :value="options.value" :key="options.key" >{{ options.value }}</el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :span="10"> - <el-form-item label="鏍峰搧鍚嶇О锛�"> - <el-select style="width: 160px;" v-model="addPointerForm.sampleName" size="small" placeholder="璇烽�夋嫨鏍峰搧鍚嶇О"> - <el-option v-for="options in sampleoptions" :value="options.value" :key="options.key">{{ options.value }}</el-option> - </el-select> - </el-form-item> - </el-col> - </el-row> - <el-row :gutter="50"> - <el-col :span="10"> - <el-form-item label="瑙勬牸鍨嬪彿锛�"> - <el-select style="width: 160px;" v-model="addPointerForm.specificationsModels" size="small" placeholder="璇烽�夋嫨鏍峰搧鍚嶇О"> - <el-option v-for="options in model_spe_options" :value="options.value" :key="options.key">{{ options.value }}</el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :span="10"> - <el-form-item label="鏍峰搧鍗曚綅锛�"> - <el-input style="width: 160px" type="text" v-model="addPointerForm.unit" placeholder="璇疯緭鍏ュ崟浣�" autocomplete="off" /> - </el-form-item> - </el-col> - </el-row> - <el-row :gutter="50"> - <el-col :span="10"> - <el-form-item label="鏍峰搧鏁伴噺锛�"> - <el-input style="width: 160px" type="text" v-model="addPointerForm.samplesNumber" placeholder="璇疯緭鍏ユ暟閲�" autocomplete="off" /> - </el-form-item> - </el-col> - <el-col :span="10"> - <el-form-item label="澶囨敞锛�"> - <el-input style="width: 160px" type="text" v-model="addPointerForm.remarks" placeholder="璇疯緭鍏ュ娉�" autocomplete="off" /> - </el-form-item> - </el-col> - </el-row> - <el-row :gutter="50"> - <el-col :span="10"> - <el-form-item label="娣诲姞瀹為獙锛�"> - <el-checkbox-group v-model="addPointerForm.experiment" style="display: flex; flex-direction: column;"> - <el-checkbox v-for="expers in experList" :label="expers.label" :key="expers.key">{{ expers.label }}</el-checkbox> - </el-checkbox-group> - </el-form-item> - </el-col> - </el-row> - </el-form> - <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="addInspection">娣诲姞</el-button> - <el-button @click="dialogueFormVisible = false">鍙� 娑�</el-button> - </span> - </el-dialog> - </div> - </div> -</div> -<div v-else> - <router-view></router-view> -</div> + </el-input>--> + <el-button type="primary" size="small" style="background-color: rgb(1, 102, 226);">閲嶇疆</el-button> + </div> + <el-table ref="detectionInfo" :max-height="800" :cell-style="{textAlign: 'center'}" + :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" + :data="detectionInfo" style="width: 100%;margin-bottom: 20px;"> + <el-table-column type="index" label="搴忓彿" min-width="10%" /> + <el-table-column prop="sampleNumber" label="鏍峰搧缂栧彿" min-width="8%" /> + <el-table-column prop="sampleName" label="鏍峰搧鍚嶇О" min-width="10%" /> + <el-table-column prop="specificationsModels" label="瑙勬牸鍨嬪彿" min-width="10%" /> + <el-table-column prop="unit" label="鍗曚綅" min-width="8%" /> + <el-table-column prop="samplesNumber" label="鏁伴噺" min-width="8%" /> + <el-table-column prop="addway" label="娣诲姞鏂瑰紡" min-width="8%"> + <template slot-scope="scope"> + <div v-if="scope.row.addway === 0"> + <el-tag type="success" disable-transitions>鎵弿</el-tag> + </div> + <div v-if="scope.row.addway === 1"> + <el-tag type="primary" disable-transitions>褰曞叆</el-tag> + </div> + <div v-else></div> + </template> + </el-table-column> + <el-table-column prop="remarks" label="澶囨敞" min-width="8%" /> + <el-table-column label="鎿嶄綔" min-width="8%"> + <template slot-scope="scope"> + <el-button type="text" size="small">淇敼</el-button> + <el-button type="text" size="small" @click="deleteRow(scope.row)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + </div> + <div class="secondBox"> + <el-row class="header"> + <el-col :span="12" style="font-size: 16px;margin-bottom: 5px;">鍩烘湰淇℃伅</el-col> + <el-col :span="12" style="text-align: right;"> + </el-col> + </el-row> + <el-form :model="infoForm" ref="infoForm" class="infoForm" label-position="right" label-width="100px" + size="mini"> + <div class="formwrapper"> + <el-row :gutter="200"> + <el-col :span="5"> + <el-form-item label="濮旀墭缂栧彿锛�"> + <el-input style="width: 200px" type="text" :value="infoForm.commisioncode" readonly disabled + autocomplete="off" size="small" /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="濮旀墭鍗曚綅锛�"> + <el-input style="width: 200px" v-model="infoForm.department" placeholder="璇疯緭鍏ュ鎵樺崟浣�" size="small" /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="鑱旂郴浜猴細"> + <el-input style="width: 200px" v-model="infoForm.contacter" placeholder="璇疯緭鍏ュ鎵樺崟浣�" size="small" /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="鑱旂郴鐢佃瘽锛�"> + <el-input style="width: 200px" v-model="infoForm.tel" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" size="small" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="200"> + <el-col :span="5"> + <el-form-item label="鑱旂郴鍦板潃锛�"> + <el-input style="width: 200px;" v-model="infoForm.address" placeholder="璇疯緭鍏ヨ仈绯诲湴鍧�" autocomplete="off" + size="small" /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="瀹屾垚鏈熼檺锛�"> + <el-date-picker v-model="infoForm.deadline" type="date" placeholder="閫夋嫨鏃ユ湡" style="width: 200px;" + size="small"> + </el-date-picker> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="閫佹牱鏃堕棿锛�"> + <el-date-picker v-model="infoForm.time" type="date" placeholder="閫夋嫨鏃ユ湡" style="width: 200px;"> + </el-date-picker> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="閫佹牱鏂瑰紡锛�"> + <el-select style="width: 200px;" v-model="infoForm.way" size="small" placeholder="閫佹牱"> + <el-option v-for="options in sampleDeliveryMode" :key="options.key" + :value="options.value">{{ options.value }}</el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="200"> + <el-col :span="5"> + <el-form-item label="閫佹牱浜猴細"> + <el-input style="width: 200px;" v-model="infoForm.sender" placeholder="璇疯緭鍏ラ�佹牱浜�" autocomplete="off" + size="small" /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="閫佹牱浜虹數璇濓細"> + <el-input style="width: 200px;" v-model="infoForm.sendertel" placeholder="璇疯緭鍏ラ�佹牱浜虹數璇�" + autocomplete="off" size="small" /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="鎶ュ憡鏁帮細"> + <el-input style="width: 200px;" v-model="infoForm.num" placeholder="璇疯緭鍏ユ姤鍛婃暟" autocomplete="off" + size="small" /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="濮旀墭澶囨敞锛�"> + <el-input style="width: 200px;" v-model="infoForm.other" placeholder="澶囨敞" autocomplete="off" + size="small" /> + </el-form-item> + </el-col> + </el-row> + </div> + <div class="submitBtn"> + <el-button type="primary" size="small" @click="submitInspection" + style="background-color: rgb(1, 102, 226);">鎻愪氦</el-button> + <!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false --> + <el-button type="primary" size="mini" style="background-color: rgb(1, 102, 226); ">鎵撳嵃濮旀墭鍗�</el-button> + </div> + </el-form> + </div> + </div> + <div class="checkType"> + <el-dialog title="娣诲姞鏍峰搧" :visible.sync="dialogueFormVisible" width="40%" top="30vh"> + <el-form :model="addPointerForm" ref="addPointerForm" class="addPointerForm" label-position="right" + label-width="100px" size="mini"> + <el-row :gutter="50"> + <el-col :span="11"> + <el-form-item label="鏍峰搧缂栧彿锛�"> + <el-input v-model="addPointerForm.sampleNumber" size="small" disabled> + </el-input> + </el-form-item> + </el-col> + <el-col :span="11"> + <el-form-item label="鏍峰搧鍚嶇О锛�"> + <el-select v-model="addPointerForm.sampleName" size="small" placeholder="璇烽�夋嫨鏍峰搧鍚嶇О" + @change="upMaterialName"> + <el-option v-for="options in sampleoptions" :value="options.key" :label="options.value"></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="50"> + <el-col :span="11"> + <el-form-item label="瑙勬牸鍨嬪彿锛�"> + <el-select v-model="addPointerForm.specificationsModels" size="small" placeholder="璇峰厛閫夋嫨鏍峰搧鍚嶇О"> + <el-option v-for="options in model_spe_options" :value="options.value" + :key="options.key">{{ options.value }}</el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="11"> + <el-form-item label="鏍峰搧鍗曚綅锛�"> + <el-input type="text" v-model="addPointerForm.unit" placeholder="璇疯緭鍏ュ崟浣�" autocomplete="off" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="50"> + <el-col :span="11"> + <el-form-item label="鏍峰搧鏁伴噺锛�"> + <el-input type="text" v-model="addPointerForm.samplesNumber" placeholder="璇疯緭鍏ユ暟閲�" autocomplete="off" /> + </el-form-item> + </el-col> + <el-col :span="11"> + <el-form-item label="澶囨敞锛�"> + <el-input type="text" v-model="addPointerForm.remarks" placeholder="璇疯緭鍏ュ娉�" autocomplete="off" /> + </el-form-item> + </el-col> + </el-row> + <el-row :gutter="50"> + <el-col :span="10"> + <el-form-item label="娣诲姞椤圭洰锛�"> + <el-checkbox-group v-model="addPointerForm.experiment" style="display: flex; flex-direction: column;"> + <el-checkbox v-for="expers in experList" :label="expers.label" + :key="expers.key">{{ expers.label }}</el-checkbox> + </el-checkbox-group> + </el-form-item> + </el-col> + </el-row> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="addInspection">娣诲姞</el-button> + <el-button @click="dialogueFormVisible = false">鍙� 娑�</el-button> + </span> + </el-dialog> + </div> + </div> + </div> </template> <script> -import {getSampleName, getModelSpecification, getlink, addInspection} from '@/api/inspection/commisioninspection' -export default { - data() { - return { - currentPage: 0, - searchData: '', - infoForm: { - commisioncode: '', - department: '', - contacter: '', - tel: '', - address: '', - deadline: '', - time: '', - way: '', - sender: '', - sendertel: '', - num: '', - other: '' - }, - detectionInfo: [], - addPointerForm:{ - sampleNumber: '', - sampleName: '', - specificationsModels: '', - unit: '', - samplesNumber: '', - remarks: '', - experiment: [], - addway: '' - }, - experList:[{ - key: '1', - label: '澶栬妫�鏌�' - },{ - key: '2', - label: '鍔ㄤ綔鐢靛帇璇曢獙' - },{ - key: '3', - label: '鐢甸樆绠℃硠婕忕數娴佽瘯楠�' - },{ - key: '4', - label: '缁濈紭閮ㄥ垎浜ゆ祦鑰愬帇璇曢獙' - }], - sampleoptions:[{ - key:'1', - value: '閫夐」1' - },{ - key:'2', - value: '閫夐」2' - }], - samplecodeoptions:[{ - key:'1', - value: '' - }], - model_spe_options:[{ - key:'1', - value: '閫夐」1' - },{ - key: '2', - value: '閫夐」2' - }], - sampleDeliveryMode:[{ - key: '1', - value: '閫佹牱' - },{ - key: '2', - value: '涓婇棬' - }], - dialogueFormVisible: false, - showDetail: false - } - }, - created(){ - this.getlink() - }, - mounted(){ - this.getSampleName() - this.getModelSpecification() - }, - methods: { - // 鑾峰彇閾炬帴link - getlink(){ - getlink().then((result)=>{ - this.$store.commit('settings/SAVE_LINK',result.data) - console.log(this.$store.state.settings.link) - }) - }, - async getSampleName(){ - const res = await getSampleName() - // console.log('res',res.data) - this.sampleoptions = res.data.map((item)=>{ - return{ - key:item.id.toString(), - value:item.name - } - }) - this.samplecodeoptions = res.data.map((item)=>{ - return{ - key:item.id.toString(), - value:item.code - } - }) - }, - async getModelSpecification(){ - const res = await getModelSpecification({materialId: '1'}) - // console.log(res) - this.model_spe_options = res.data.map((item)=>{ - return{ - key:item.specificationsId, - value:item.specificationsName - } - }) - }, - addInspection(){ - let exper = this.addPointerForm.experiment[0] - this.addPointerForm.addway = 1 - for(let i=1;i<this.addPointerForm.experiment.length;i++){ - exper += ',' + this.addPointerForm.experiment[i] - } - // console.log(exper) - this.addPointerForm.experiment = exper - let tmp = this.addPointerForm - this.detectionInfo.push(tmp) - this.dialogueFormVisible = false - this.addPointerForm ={ - sampleNumber: '', - sampleName: '', - specificationsModels: '', - unit: '', - samplesNumber: '', - remarks: '', - experiment: [], - addway: '' - } - }, - async submitInspection(){ - let sampledeliveryway - if(this.infoForm.way === '閫佹牱'){ - sampledeliveryway = 1 - }else{ - sampledeliveryway = 2 - } - const res = await addInspection({completionDeadline: this.infoForm.deadline, - contactAddress: this.infoForm.address, - contactNumber: this.infoForm.tel, - contacts: this.infoForm.contacter, - entrustRemarks: this.infoForm.other, - entrusted: this.infoForm.department, - inspectionTime: this.infoForm.time, - linkDetectionList: this.detectionInfo, - reportNumber: parseInt(this.infoForm.num), - sampleDeliveryMode: sampledeliveryway, - sampleDeliveryPhone: this.infoForm.sendertel, - sampleSender: this.infoForm.sender}) -// const res = await addInspection({ -// completionDeadline: "2023-08-03", -// contactAddress: "姹熻嫃鍗楅��", -// contactNumber: "12321423432", -// contacts: "灏忛粦", -// entrustRemarks: "濮旀墭澶囨敞YPBH123456789YPBH123456789YPBH123456789", -// entrusted: "闃块噷宸村反", -// inspectionTime: "2023-08-03", -// linkDetectionList: [ -// { -// "experiment": "鍋氭ⅵ", -// "remarks": "閫氳繃浜�", -// "sampleName": "鍙戝姩鏈�", -// "sampleNumber": "YPBH123456789", -// "samplesNumber": 20, -// "specificationsModels": "GGXH-AAAAA", -// "unit": "鐧惧害" -// } -// ], -// reportNumber: 23, -// sampleDeliveryMode: 1, -// sampleDeliveryPhone: "123456789676", -// sampleSender: "灏忕櫧" -// }) - // console.log(res) - this.infoForm.commisioncode = res.data - if(res.data){ - this.$message({ - message: '鎭枩浣�!', - type: 'success' - }) - // 璺宠浆椤甸潰 - this.$router.push('/inspectionManagement/commissionInspection') - this.showDetail = true - }else{ - this.$message.error(res.message) - } - }, - handleSizeChange(pageSize) { - this.pageParams.pageSize = pageSize - }, - handleCurrentChange(pageNo) { - this.pageParams.pageNo = pageNo - }, - deleteRow(row){ - console.log(row) - row = null - } - } -} + import { + getSampleName, + getModelSpecification, + getlink, + addInspection, + isIfViewUUID + } from '@/api/inspection/commisioninspection' + export default { + data() { + return { + currentPage: 0, + searchData: '', + infoForm: { + commisioncode: '', + department: '', + contacter: '', + tel: '', + address: '', + deadline: '', + time: '', + way: '', + sender: '', + sendertel: '', + num: '', + other: '' + }, + detectionInfo: [], + addPointerForm: { + sampleNumber: '', + sampleName: '', + specificationsModels: '', + unit: '', + samplesNumber: '', + remarks: '', + experiment: [], + addway: '' + }, + experList: [{ + key: '1', + label: '澶栬妫�鏌�' + }, { + key: '2', + label: '鍔ㄤ綔鐢靛帇璇曢獙' + }, { + key: '3', + label: '鐢甸樆绠℃硠婕忕數娴佽瘯楠�' + }, { + key: '4', + label: '缁濈紭閮ㄥ垎浜ゆ祦鑰愬帇璇曢獙' + }], + sampleoptions: [{ + key: '1', + value: '閫夐」1' + }, { + key: '2', + value: '閫夐」2' + }], + samplecodeoptions: [{ + key: '1', + value: '' + }], + model_spe_options: [], + sampleDeliveryMode: [{ + key: '1', + value: '閫佹牱' + }, { + key: '2', + value: '涓婇棬' + }], + dialogueFormVisible: false, + showDetail: false, + viewId: null + } + }, + created() { + this.viewId = this.$route.params.viewId + this.$store.commit('settings/SAVE_LINK', this.viewId) + this.getlink(this.$route.params.viewId) + }, + mounted() { + this.getSampleName() + }, + methods: { + getlink(viewId) { + if (viewId == null) { + this.$message.error('褰撳墠閾炬帴涓嶅湪鏈夋晥鏈熷唴,绯荤粺鑷姩鍏抽棴') + this.$router.push('/404') + return + } + isIfViewUUID({ + viewId + }).then(res => { + if (!res.data) { + this.$message.error('褰撳墠閾炬帴涓嶅湪鏈夋晥鏈熷唴,绯荤粺鑷姩鍏抽棴') + this.$router.push('/404') + } + }) + }, + async getSampleName() { + const res = await getSampleName() + this.sampleoptions = res.data.map((item) => { + return { + key: item.id.toString(), + value: item.name, + code: item.code + } + }) + }, + async getModelSpecification(val) { + const res = await getModelSpecification({ + materialId: val + }) + this.model_spe_options = res.data.map((item) => { + return { + key: item.specificationsId, + value: item.specificationsName + } + }) + }, + addInspection() { + let exper = this.addPointerForm.experiment[0] + this.addPointerForm.addway = 1 + for (let i = 1; i < this.addPointerForm.experiment.length; i++) { + exper += ',' + this.addPointerForm.experiment[i] + } + // console.log(exper) + this.addPointerForm.experiment = exper + let tmp = this.addPointerForm + this.detectionInfo.push(tmp) + this.dialogueFormVisible = false + this.addPointerForm = { + sampleNumber: '', + sampleName: '', + specificationsModels: '', + unit: '', + samplesNumber: '', + remarks: '', + experiment: [], + addway: '' + } + }, + async submitInspection() { + let sampledeliveryway + if (this.infoForm.way === '閫佹牱') { + sampledeliveryway = 1 + } else { + sampledeliveryway = 2 + } + const res = await addInspection({ + completionDeadline: this.infoForm.deadline, + contactAddress: this.infoForm.address, + contactNumber: this.infoForm.tel, + contacts: this.infoForm.contacter, + entrustRemarks: this.infoForm.other, + entrusted: this.infoForm.department, + inspectionTime: this.infoForm.time, + linkDetectionList: this.detectionInfo, + reportNumber: parseInt(this.infoForm.num), + sampleDeliveryMode: sampledeliveryway, + sampleDeliveryPhone: this.infoForm.sendertel, + sampleSender: this.infoForm.sender + }) + this.infoForm.commisioncode = res.data + if (res.data) { + this.$message({ + message: '鎭枩浣�!', + type: 'success' + }) + // 璺宠浆椤甸潰 + this.$router.push('/inspectionManagement/commissionInspection') + this.showDetail = true + } else { + this.$message.error(res.message) + } + }, + handleSizeChange(pageSize) { + this.pageParams.pageSize = pageSize + }, + handleCurrentChange(pageNo) { + this.pageParams.pageNo = pageNo + }, + deleteRow(row) { + + }, + upMaterialName(val) { + this.sampleoptions.forEach(a => { + if (a.key == val) { + this.addPointerForm.sampleNumber = a.code + } + }) + this.getModelSpecification(val) + } + } + } </script> <style lang="scss" scoped> -.firstBox{ - .title{ - padding:0px 10px 10px 10px; - } - .tableBox{ - background-color: #fff; - padding: 0px 20px; - margin: 0px -15px; - flex: 1; - background: #fff; - /* padding: 20px 20px 10px 20px; */ - display: flex; - flex-direction: column; - .tableBox-header{ - padding: 20px 0px; - .split{ - margin-right: 15px; - } - } - .el-table { - flex: 1; - } - >div:nth-child(3){ - display: flex; - justify-content: end; - margin: 10px 0; - } - } -} -.secondBox{ - margin: 0px -15px; - .header{ - display: flex; - justify-content: space-between; - padding: 10px 20px; - margin-top: 10px; - } - .submitBtn{ - display: flex; - justify-content: end; - margin-right: 156px; - margin-top: 20px; - } -} -.infoForm{ - background-color: #fff; - padding: 20px 50px; -} -</style> +.content-main{ + padding: 20px 40px; + background-color: #f0f2f5; + width: 100%; + height: 100vh; + display: flex; + flex-direction: column; + justify-content: space-between; + // align-items: center; + + .firstBox { + .title { + padding: 15px 10px; + font-size: 18px; + background-color: #0166e2; + color: #fff; + border-radius: 4px; + margin-bottom: 20px; + } + + .tableBox { + background-color: #fff; + padding: 0px 20px; + flex: 1; + background: #fff; + /* padding: 20px 20px 10px 20px; */ + display: flex; + flex-direction: column; + + .tableBox-header { + padding: 20px 0px; + + .split { + margin-right: 15px; + } + } + + .el-table { + flex: 1; + } + + >div:nth-child(3) { + display: flex; + justify-content: end; + margin: 10px 0; + } + } + } + + .secondBox { + + .header { + display: flex; + justify-content: space-between; + padding: 10px 20px; + margin-top: 10px; + } + + .submitBtn { + display: flex; + justify-content: end; + margin-right: 40px; + margin-top: 20px; + } + } + + .infoForm { + background-color: #fff; + padding: 20px 50px; + + .formwrapper { + margin: 20px 0px; + padding-left: 30px; + + .el-row { + margin: 10px 0px; + } + } + } + } +</style> \ No newline at end of file diff --git a/src/views/inspectionManagement/commissionInspection/index.vue b/src/views/inspectionManagement/commissionInspection/index.vue index 0cb885e..271fdf9 100644 --- a/src/views/inspectionManagement/commissionInspection/index.vue +++ b/src/views/inspectionManagement/commissionInspection/index.vue @@ -1,364 +1,455 @@ <template> - <div> - <div v-if="!showDetail"> - <div class="content-main"> - <div class="top-bar"> - <el-form ref="form" :inline="true" :model="searchData"> - <el-form-item label="濮旀墭缂栧彿:" class="sermargin"> - <el-input - v-model="searchData.code" - class="input-form" - placeholder="璇疯緭鍏�" - > - </el-input> - </el-form-item> - <el-form-item label="鏍峰搧鍚嶇О:" class="sermargin"> - <el-input - v-model="searchData.name" - class="input-form" - placeholder="璇疯緭鍏�" - > - </el-input> - </el-form-item> - <el-form-item label="濮旀墭鍗曚綅:" style="margin-right: 20px;"> - <el-select v-model="searchData.department" placeholder="鍏ㄩ儴"> - <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value"> - </el-option> - </el-select> - </el-form-item> - <el-form-item> - <el-button type="primary" @click="search">鏌ヨ</el-button> - <el-button type="primary" plain @click="reset">閲嶇疆</el-button> - </el-form-item> - </el-form> - <el-form> - <el-button class="rightBtn" type="primary" @click="goToaddCommision">鏂板濮旀墭</el-button> - </el-form> - </div> - <div class="library-table"> - <div class="table-header"> - <div class="search-bar"> - <el-radio-group v-model="radioValue" @change="radioclick"> - <el-radio-button v-for="item in conditionsOptions" :key="item.value" :label="item.value"> - {{ item.label }} - </el-radio-button> - </el-radio-group> - </div> - <div class="generateInsp"> - <el-button type="primary" size="mini" icon="el-icon-document" style="background-color: rgb(1, 102, 226);">鐢熸垚鎶ユ鍗�</el-button> - </div> - </div> - <div class="table-box"> - <el-table - ref="commisionTable" - :max-height="800" - :cell-style="{textAlign: 'center'}" - :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" - :data="commisionTable" - style="width: 100%" - > - <el-table-column - type="selection" - min-width="10%" - /> - <el-table-column - type="index" - label="搴忓彿" - min-width="10%" - /> - <el-table-column - prop="entrust_coding" - label="濮旀墭缂栧彿" - min-width="10%" - /> - <el-table-column - prop="entrusted" - label="濮旀墭鍗曚綅" - min-width="12%" - /> - <el-table-column - prop="samples_number" - label="鏍峰搧缂栧彿" - min-width="8%" - /> - <el-table-column - prop="sample_name" - label="鏍峰搧鍚嶇О" - min-width="8%" - /> - <el-table-column - prop="specifications_models" - label="瑙勬牸鍨嬪彿" - min-width="12%" - /> - <el-table-column - prop="dateSurvey" - label="閫佽揪鏃堕棿" - min-width="8%" - /> - <el-table-column - prop="completionDeadline" - label="瀹屾垚鏈熼檺" - min-width="8%" - /> - <el-table-column - prop="contacts" - label="濮旀墭缂栧埗浜�" - min-width="8%" - /> - <el-table-column - prop="inspectionTime" - label="妫�楠屾棩鏈�" - min-width="8%" - /> - <el-table-column - prop="inspection_status" - label="鐘舵��" - min-width="8%"> - <template slot-scope="scope"> - <div v-if="scope.row.inspection_status === 1"> - <span style="color: green;">宸叉娴�</span> - </div> - <div v-else> - <span style="color: red;">寰呮娴�</span> - </div> - </template> - </el-table-column> - <el-table-column - label="鎿嶄綔" - min-width="8%" - > - <template slot-scope="scope"> - <el-button type="text" size="small" @click="handleClick(scope.row)">鍒犻櫎</el-button> - </template> - </el-table-column> - </el-table> - <!-- 鍒嗛〉鍣� --> - <div> - <el-pagination - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - :current-page="currentPage" - :page-sizes="[5, 10, 20]" - :page-size="pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="total"> - </el-pagination> - </div> - </div> - </div> - </div> - </div> - <div v-else> - <router-view /> - </div> - </div> + <div> + <div v-if="!showDetail"> + <div class="content-main"> + <div class="top-bar"> + <el-form ref="form" :inline="true" :model="searchData"> + <el-form-item label="濮旀墭缂栧彿:" class="sermargin"> + <el-input v-model="searchData.code" class="input-form" placeholder="璇疯緭鍏�"> + </el-input> + </el-form-item> + <el-form-item label="鏍峰搧鍚嶇О:" class="sermargin"> + <el-input v-model="searchData.name" class="input-form" placeholder="璇疯緭鍏�"> + </el-input> + </el-form-item> + <el-form-item label="濮旀墭鍗曚綅:" style="margin-right: 20px;"> + <el-select v-model="searchData.department" placeholder="鍏ㄩ儴"> + <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="search">鏌ヨ</el-button> + <el-button type="primary" plain @click="reset">閲嶇疆</el-button> + </el-form-item> + </el-form> + <el-form> + <el-popover placement="left" width="350" trigger="click"> + <div class="vue_qr_div"> + <el-row> + <el-col> + <el-input v-model="view" readonly size="medium" style="width: 250px;margin-right: 10px;"></el-input> + <el-button size="small" type="primary" v-if="viewId==null" @click="viewDia=true">鐢熸垚</el-button> + <el-button size="small" type="primary" v-else-if="viewId!=null" @click="copy">澶嶅埗</el-button> + </el-col> + </el-row> + <el-row style="margin-top: 10px;"> + <el-col v-if="viewId==null">褰撳墠閾炬帴宸茶繃鏈燂紝璇风偣鍑荤敓鎴愭寜閽噸鏂扮敓鎴�</el-col> + <el-col + v-else-if="viewId!=null">褰撳墠閾炬帴灏嗗湪{{(parseInt(viewTime)/60/60)>1?(parseInt(viewTime)/60/60).toFixed(1)+'灏忔椂':Math.round(parseInt(viewTime)/60)+'鍒嗛挓'}}鍚庤繃鏈�</el-col> + </el-row> + </div> + <el-button slot="reference" class="rightBtn" type="primary" @click="goToaddCommision">鏂板濮旀墭</el-button> + </el-popover> + </el-form> + </div> + <div class="library-table"> + <div class="table-header"> + <div class="search-bar"> + <el-radio-group v-model="radioValue" @change="radioclick"> + <el-radio-button v-for="item in conditionsOptions" :key="item.value" :label="item.value"> + {{ item.label }} + </el-radio-button> + </el-radio-group> + </div> + <div class="generateInsp"> + <el-button type="primary" size="mini" icon="el-icon-document" + style="background-color: rgb(1, 102, 226);">鐢熸垚鎶ユ鍗�</el-button> + </div> + </div> + <div class="table-box"> + <el-table ref="commisionTable" :max-height="800" :cell-style="{textAlign: 'center'}" + :header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}" + :data="commisionTable" style="width: 100%"> + <el-table-column type="selection" min-width="10%" /> + <el-table-column type="index" label="搴忓彿" min-width="10%" /> + <el-table-column prop="entrust_coding" label="濮旀墭缂栧彿" min-width="10%" /> + <el-table-column prop="entrusted" label="濮旀墭鍗曚綅" min-width="12%" /> + <el-table-column prop="samples_number" label="鏍峰搧缂栧彿" min-width="8%" /> + <el-table-column prop="sample_name" label="鏍峰搧鍚嶇О" min-width="8%" /> + <el-table-column prop="specifications_models" label="瑙勬牸鍨嬪彿" min-width="12%" /> + <el-table-column prop="dateSurvey" label="閫佽揪鏃堕棿" min-width="8%" /> + <el-table-column prop="completionDeadline" label="瀹屾垚鏈熼檺" min-width="8%" /> + <el-table-column prop="contacts" label="濮旀墭缂栧埗浜�" min-width="8%" /> + <el-table-column prop="inspectionTime" label="妫�楠屾棩鏈�" min-width="8%" /> + <el-table-column prop="inspection_status" label="鐘舵��" min-width="8%"> + <template slot-scope="scope"> + <div v-if="scope.row.inspection_status === 1"> + <span style="color: green;">宸叉娴�</span> + </div> + <div v-else> + <span style="color: red;">寰呮娴�</span> + </div> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" min-width="8%"> + <template slot-scope="scope"> + <el-button type="text" size="small" @click="handleClick(scope.row)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + <!-- 鍒嗛〉鍣� --> + <div> + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" + :current-page="currentPage" :page-sizes="[5, 10, 20]" :page-size="pageSize" + layout="total, sizes, prev, pager, next, jumper" :total="total"> + </el-pagination> + </div> + </div> + </div> + </div> + </div> + <div v-else> + <router-view /> + </div> + <el-dialog title="閾炬帴鏃堕暱璁剧疆" :visible.sync="viewDia" width="30%"> + <div> + <el-row style="line-height: 46px;"> + <el-col :span="6" style="font-size: 14px;text-align: right;">鏃堕暱璁剧疆锛�</el-col> + <el-col :span="14" :offset="1"> + <el-select v-model="viewTime" size="medium"> + <el-option label="1 澶�" :value="1"></el-option> + <el-option label="2 澶�" :value="2"></el-option> + <el-option label="3 澶�" :value="3"></el-option> + <el-option label="4 澶�" :value="4"></el-option> + <el-option label="5 澶�" :value="5"></el-option> + <el-option label="6 澶�" :value="6"></el-option> + <el-option label="1 鍛�" :value="7"></el-option> + </el-select> + </el-col> + </el-row> + </div> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="getViewId()">鎻� 浜�</el-button> + <el-button @click="viewDia = false">鍙� 娑�</el-button> + </span> + </el-dialog> + <!-- 闅愯棌鍩熻緭鍏ユ鐢ㄦ潵澶嶅埗 --> + <input id="copyContext" style="position: absolute;top: 0;left: 0;opacity: 0;z-index: -10;" /> + </div> </template> <script> -import { getCommisionList } from '@/api/inspection/commisioninspection' -export default { - data() { - return { - form: [], - searchData: { - code: '', - name: '', - department: '' - }, - options: [{ - value: '1', - label: '閮ㄩ棬1' - }], - radioValue: 0, - commisionTable: [{ - specifications_models: "GGXH-AAAAA", - inspectionTime: "2023-08-03", - id: 2, - samples_number: 0, - dateSurvey: "2023-08-03", - entrusted: "闃块噷宸村反", - completionDeadline: "2023-08-03", - contacts: "灏忛粦", - entrust_coding: "SL20230803000003", - sample_name: "鍙戝姩鏈�", - inspection_status: 1 - }], - conditionsOptions: [ - { - label: '鍏ㄩ儴', - value: 0 - }, - { - label: '宸叉楠�', - value: 1 - }, - { - label: '寰呮楠�', - value: 2 - } - ], - currentPage: 1, - pageSize: 5, - total: 100, - showDetail: false - } - }, - created() { - this.getCommisionList() - }, - updated() { - if (this.$router.currentRoute.name === 'AddCommision') { - // console.log(this.$router.currentRoute.name) - this.showDetail = true - } - }, - methods: { - async getCommisionList(){ - const res = await getCommisionList({pageNo:this.currentPage, pageSize:this.pageSize}) - this.commisionTable = res.data.row - this.total = res.data.total - // console.log(res) - // 鑾峰彇鎵�鏈夌殑濮旀墭鍗曚綅鍚嶇О - const allDepartmentNames = [...new Set(this.commisionTable.map(item => item.entrusted))] - // 灏哸llDepartmentNames杞崲涓簅ptions闇�瑕佺殑鏍煎紡 - this.options = allDepartmentNames.map(name => ({ value: name, label: name })) + import { + getCommisionList, + getViewUUID, + selectViewUUID + } from '@/api/inspection/commisioninspection' + export default { + data() { + return { + form: [], + searchData: { + code: '', + name: '', + department: '' + }, + options: [{ + value: '1', + label: '閮ㄩ棬1' + }], + radioValue: 0, + commisionTable: [{ + specifications_models: "GGXH-AAAAA", + inspectionTime: "2023-08-03", + id: 2, + samples_number: 0, + dateSurvey: "2023-08-03", + entrusted: "闃块噷宸村反", + completionDeadline: "2023-08-03", + contacts: "灏忛粦", + entrust_coding: "SL20230803000003", + sample_name: "鍙戝姩鏈�", + inspection_status: 1 + }], + conditionsOptions: [{ + label: '鍏ㄩ儴', + value: 0 + }, + { + label: '宸叉楠�', + value: 1 + }, + { + label: '寰呮楠�', + value: 2 + } + ], + currentPage: 1, + pageSize: 5, + total: 100, + showDetail: false, + day: 1, + view: null, + viewId: null, + viewTime: 1, + viewDia: false + } + }, + created() { + this.getCommisionList() + }, + updated() { + if (this.$router.currentRoute.name === 'AddCommision') { + // console.log(this.$router.currentRoute.name) + this.showDetail = true + } + }, + methods: { + async getCommisionList() { + const res = await getCommisionList({ + pageNo: this.currentPage, + pageSize: this.pageSize + }) + this.commisionTable = res.data.row + this.total = res.data.total + // console.log(res) + // 鑾峰彇鎵�鏈夌殑濮旀墭鍗曚綅鍚嶇О + const allDepartmentNames = [...new Set(this.commisionTable.map(item => item.entrusted))] + // 灏哸llDepartmentNames杞崲涓簅ptions闇�瑕佺殑鏍煎紡 + this.options = allDepartmentNames.map(name => ({ + value: name, + label: name + })) - }, - // 鏌ヨ鏂规硶 - async search() { - // 灏嗘悳绱㈡潯浠朵綔涓哄弬鏁颁紶閫掔粰getCommisionList鏂规硶 - let res - if(this.radioValue === 0){ - res = await getCommisionList({ - pageNo: this.currentPage, - pageSize: this.pageSize, - entrustCoding: this.searchData.code, - sampleName: this.searchData.name, - entrusted: this.searchData.department, - }) - }else{ - res = await getCommisionList({ - pageNo: this.currentPage, - pageSize: this.pageSize, - entrustCoding: this.searchData.code, - sampleName: this.searchData.name, - entrusted: this.searchData.department, - inspectionStatus: this.radioValue - }) - } - // console.log(res) - this.commisionTable = res.data.row - this.total = res.data.total - }, + }, + // 鏌ヨ鏂规硶 + async search() { + // 灏嗘悳绱㈡潯浠朵綔涓哄弬鏁颁紶閫掔粰getCommisionList鏂规硶 + let res + if (this.radioValue === 0) { + res = await getCommisionList({ + pageNo: this.currentPage, + pageSize: this.pageSize, + entrustCoding: this.searchData.code, + sampleName: this.searchData.name, + entrusted: this.searchData.department, + }) + } else { + res = await getCommisionList({ + pageNo: this.currentPage, + pageSize: this.pageSize, + entrustCoding: this.searchData.code, + sampleName: this.searchData.name, + entrusted: this.searchData.department, + inspectionStatus: this.radioValue + }) + } + // console.log(res) + this.commisionTable = res.data.row + this.total = res.data.total + }, - // 閲嶇疆鏂规硶 - reset() { - // 閲嶇疆鎼滅储鏉′欢 - this.searchData.code = '' - this.searchData.name = '' - this.searchData.department = '' - this.radioValue = 0 - // 閲嶆柊鑾峰彇鏁版嵁 - this.getCommisionList() - }, - async radioclick(){ - // 澶勭悊鐐瑰嚮radio鐨勬椂闂� - console.log('radioValue',this.radioValue) - if(this.radioValue === 0){ - this.getCommisionList() - }else{ - const res = await getCommisionList({pageNo:this.currentPage, pageSize:this.pageSize, inspectionStatus: this.radioValue}) - // console.log(res) - this.commisionTable = res.data.row - this.total = res.data.total - } - - }, - // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣 - async handleSizeChange(val) { - // console.log(`姣忛〉 ${val} 鏉) - this.currentPage = 1 - this.pageSize = val - if(this.radioValue === 0){ - this.getCommisionList() - }else{ - const res = await getCommisionList({pageNo:this.currentPage, pageSize:this.pageSize, inspectionStatus: this.radioValue}) - this.commisionTable = res.data.row - this.total = res.data.total - } - }, - // 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤� - async handleCurrentChange(val) { - // console.log(`褰撳墠椤�: ${val}`) - this.currentPage = val - if(this.radioValue === 0){ - this.getCommisionList() - }else{ - const res = await getCommisionList({pageNo:this.currentPage, pageSize:this.pageSize, inspectionStatus: this.radioValue}) - this.commisionTable = res.data.row - this.total = res.data.total - } - }, - goToaddCommision() { - this.$router.push('/inspectionManagement/commissionInspection/addCommision') - this.showDetail = true - } - } -} + // 閲嶇疆鏂规硶 + reset() { + // 閲嶇疆鎼滅储鏉′欢 + this.searchData.code = '' + this.searchData.name = '' + this.searchData.department = '' + this.radioValue = 0 + // 閲嶆柊鑾峰彇鏁版嵁 + this.getCommisionList() + }, + async radioclick() { + // 澶勭悊鐐瑰嚮radio鐨勬椂闂� + console.log('radioValue', this.radioValue) + if (this.radioValue === 0) { + this.getCommisionList() + } else { + const res = await getCommisionList({ + pageNo: this.currentPage, + pageSize: this.pageSize, + inspectionStatus: this.radioValue + }) + // console.log(res) + this.commisionTable = res.data.row + this.total = res.data.total + } + + }, + // 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣 + async handleSizeChange(val) { + // console.log(`姣忛〉 ${val} 鏉) + this.currentPage = 1 + this.pageSize = val + if (this.radioValue === 0) { + this.getCommisionList() + } else { + const res = await getCommisionList({ + pageNo: this.currentPage, + pageSize: this.pageSize, + inspectionStatus: this.radioValue + }) + this.commisionTable = res.data.row + this.total = res.data.total + } + }, + // 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤� + async handleCurrentChange(val) { + // console.log(`褰撳墠椤�: ${val}`) + this.currentPage = val + if (this.radioValue === 0) { + this.getCommisionList() + } else { + const res = await getCommisionList({ + pageNo: this.currentPage, + pageSize: this.pageSize, + inspectionStatus: this.radioValue + }) + this.commisionTable = res.data.row + this.total = res.data.total + } + }, + goToaddCommision() { + // this.showDetail = true + selectViewUUID({ + day: this.day + }).then(res => { + this.view = `${this.vueIp}addCommision/${res.data.id}` + this.viewId = res.data.id + this.viewTime = res.data.time + }) + }, + getViewId() { + getViewUUID({ + day: this.viewTime == null ? 1 : this.viewTime + }).then(res => { + this.viewId = res.data + this.view = `${this.vueIp}addCommision/${res.data.id}` + this.viewDia = false + this.$message.success('閾炬帴宸茬敓鎴愶紝鐐瑰嚮澶嶅埗鎸夐挳杩涜澶嶅埗') + }) + }, + copy() { + document.getElementById('copyContext').value = this.view + const input = document.querySelector('#copyContext'); + input.select() + if (document.execCommand('copy')) { + this.$message.success('宸插鍒跺埌鍓创鏉�') + } + } + } + } </script> <style scoped> + .top-bar { + margin: -25px -15px; + background: #fff; + display: flex; + justify-content: space-between; + padding: 5px 24px 0px 24px; -.top-bar{ - margin: -25px -15px; - background: #fff; - display: flex; - justify-content: space-between; - padding: 5px 24px 0px 24px; - .sermargin{ - margin-right: 60px; - } - } -.rightBtn{ - background-color: rgb(1, 102, 226); -} -.library-table{ - background-color: #fff; - flex: 1; - margin: 0px -15px; - margin-top: 40px; - display: flex; - flex-direction: column; - .table-header{ - padding: 20px; - display: flex; - justify-content: space-between; - .el-form-item{ - margin-bottom: 30px !important; - } - } - .table-box{ - padding: 0px 20px; - margin-top: 0px; - flex: 1; - background: #fff; - /* padding: 20px 20px 10px 20px; */ - display: flex; - flex-direction: column; - .el-table { - flex: 1; - } - >div:nth-child(2){ - display: flex; - justify-content: end; - margin: 10px 0; - } - } - } + .sermargin { + margin-right: 60px; + } -</style> + .rightForm { + display: flex; + justify-content: space-between; + /* background-color: #bfa; */ + height: 40px; + line-height: 40px; + + >div { + padding: 0px 10px; + padding-bottom: 10px; + border: 1px solid rgb(8, 156, 230); + margin-right: 10px; + /* height: 40px; + line-height: 40px; */ + } + + .rightBtn { + background-color: rgb(1, 102, 226); + } + } + } + + .library-table { + background-color: #fff; + flex: 1; + margin: 0px -15px; + margin-top: 40px; + display: flex; + flex-direction: column; + + .table-header { + padding: 20px; + display: flex; + justify-content: space-between; + + .el-form-item { + margin-bottom: 30px !important; + } + } + + .table-box { + padding: 0px 20px; + margin-top: 0px; + flex: 1; + background: #fff; + /* padding: 20px 20px 10px 20px; */ + display: flex; + flex-direction: column; + + .el-table { + flex: 1; + } + + >div:nth-child(2) { + display: flex; + justify-content: end; + margin: 10px 0; + } + } + } + + .rightBtn { + background-color: rgb(1, 102, 226); + } + + .library-table { + background-color: #fff; + flex: 1; + margin: 0px -15px; + margin-top: 40px; + display: flex; + flex-direction: column; + + .table-header { + padding: 20px; + display: flex; + justify-content: space-between; + + .el-form-item { + margin-bottom: 30px !important; + } + } + + .table-box { + padding: 0px 20px; + margin-top: 0px; + flex: 1; + background: #fff; + /* padding: 20px 20px 10px 20px; */ + display: flex; + flex-direction: column; + + .el-table { + flex: 1; + } + + >div:nth-child(2) { + display: flex; + justify-content: end; + margin: 10px 0; + } + } + } + + .vue_qr_div { + text-align: center; + color: #0166e2; + } +</style> \ No newline at end of file diff --git a/src/views/laboratory/role/index.vue b/src/views/laboratory/role/index.vue index 494b9da..a56cda7 100644 --- a/src/views/laboratory/role/index.vue +++ b/src/views/laboratory/role/index.vue @@ -7,10 +7,6 @@ <el-input v-model="searchData.roleName" class="input-form" placeholder="璇疯緭鍏ヨ鑹插悕绉�" style="width:250px"> </el-input> </el-form-item> - <el-form-item label="鏉冮檺锛�" class="sermargin"> - <el-input v-model="searchData.permission" class="input-form" placeholder="璇疯緭鍏ユ潈闄�" style="width:250px"> - </el-input> - </el-form-item> <el-form-item class="rightBtn"> <el-button type="primary">鏌ヨ</el-button> <el-button type="primary" plain>閲嶇疆</el-button> @@ -28,11 +24,10 @@ <el-table :max-height="800" :cell-style="{ textAlign: 'center' }" :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }" :data="roleTable" style="width: 100%"> - <el-table-column type="selection" min-width="8%" /> - <el-table-column prop="rolename" label="瑙掕壊鍚嶇О" min-width="20%" /> - <el-table-column prop="permission" label="鏉冮檺" min-width="20%" /> - <el-table-column prop="create_time" label="鍒涘缓鏃堕棿" min-width="20%" /> - <el-table-column prop="update_time" label="鏇存柊鏃堕棿" min-width="20%" /> + <el-table-column type="index" min-width="8%" /> + <el-table-column prop="roleName" label="瑙掕壊鍚嶇О" min-width="20%" /> + <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" min-width="20%" /> + <el-table-column prop="updateTime" label="鏇存柊鏃堕棿" min-width="20%" /> <el-table-column label="鎿嶄綔" min-width="12%"> <template slot-scope="scope"> <el-button type="text" size="small">缂栬緫</el-button> @@ -50,23 +45,61 @@ </div> </div> </div> - <el-dialog title="鏂板瑙掕壊" :visible.sync="dialogTableVisible" width="60%"> + <el-dialog title="鏂板瑙掕壊" :visible.sync="dialogTableVisible" width="50%"> <el-form :model="roleAdd" ref="roleAdd" label-position="right" label-width="100px"> - <el-form-item label="瑙掕壊鍚�:"> - <el-input style="width: 300px" v-model="roleAdd.roleName" placeholder="璇疯緭鍏ヨ鑹插悕"> - </el-input> - </el-form-item> - <el-form-item label="鍔熻兘閫夋嫨:"> - <el-cascader size="medium " v-model="roleAdd.menuData" :options="menuInfo"> - <template slot-scope="{ node, data }"> - <span>{{ data.label }}</span> - <span v-if="!node.isLeaf"> ({{ }}) </span> - </template> - </el-cascader> - </el-form-item> + <el-col :span="24" style="display: flex;justify-content: space-between;"> + <el-form-item :rules="nameaRules" label="瑙掕壊鍚�:"> + <el-input @blur="assertName" style="width: 300px" v-model="roleAdd.roleName" placeholder="璇疯緭鍏ヨ鑹插悕"> + </el-input> + </el-form-item> + <!-- <el-form-item label="鑿滃崟閫夋嫨:"> + <el-cascader style="width: 300px" collapse-tags size="medium " filterable :props="props" + v-model="roleAdd.menuData" :options="menuInfo"> + <template slot-scope="{ data }"> + <span>{{ data.label }}</span> + </template> + </el-cascader> + </el-form-item> --> + </el-col> </el-form> + <el-col :span="24"> + <el-table height="300" :data="menuInfo" style="width: 100%;margin-bottom: 20px;" row-key="id" + :default-expand-all="false" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> + <el-table-column highlight-current-row prop="parentId" label="鑿滃崟绫诲瀷" sortable width="180"> + <template slot-scope="scope"> + <span v-if="scope.row.parentId == 0 && scope.row.children != undefined" style="color: #409eff;">涓昏彍鍗�</span> + <span v-if="scope.row.parentId == 0 && scope.row.children === undefined" style="color: #409eff;"> + 涓昏彍鍗� + </span> + </template> + </el-table-column> + <el-table-column prop="name" label="鑿滃崟鍚�" sortable width="180"> + <template slot-scope="scope"> + <el-col v-if="scope.row.parentId == 0"> + <span style="color: #409eff;">{{ scope.row.name }}</span> + </el-col> + <el-col v-else> + <span style="color: #40b815;">{{ scope.row.name }}</span> + </el-col> + </template> + </el-table-column> + <el-table-column prop="id" label="鎿嶄綔鏉冮檺"> + <template slot-scope="scope"> + <el-col v-if="scope.row.parentId == 0 && scope.row.children != undefined"> + <!-- <el-checkbox v-model="scope.row.select">鏌ヨ</el-checkbox> --> + </el-col> + <el-col v-else> + <el-checkbox size="medium" v-model="scope.row.selected" @change="chekSelect(scope)">鏌ヨ</el-checkbox> + <el-checkbox size="medium" v-model="scope.row.added" @change="chekAdd(scope)">娣诲姞</el-checkbox> + <el-checkbox size="medium" v-model="scope.row.updated" @change="chekUpdate(scope)">淇敼</el-checkbox> + <el-checkbox size="medium" v-model="scope.row.deleted" @change="chekDelet(scope)">鍒犻櫎</el-checkbox> + </el-col> + </template> + </el-table-column> + </el-table> + </el-col> <span slot="footer" class="dialog-footer"> - <el-button @click="dialogTableVisible = false">鍙� 娑�</el-button> + <el-button @click="clearAll">鍙� 娑�</el-button> <el-button type="primary" @click="addRole">纭� 瀹�</el-button> </span> </el-dialog> @@ -74,8 +107,12 @@ </template> <script> -import { getMenusTree } from '@/api/laboratory/role' +import { getMenusTree, addRoleInfo, assertRepeat, getAllRoleAndMenuInfo } from '@/api/laboratory/role' +import { default as menuPower } from './menuPower.vue' export default { + components: { + menuPower: () => import('./menuPower.vue') + }, data() { return { props: { multiple: true }, @@ -83,22 +120,15 @@ roleName: null, menuData: null }, + nameaRules: [{ required: true, message: '璇疯緭鍏ヨ鑹插悕' }], + menuTableTree: null, searchData: { roleName: '', permission: '' }, + assertRepeatName: true, menuInfo: [], - roleTable: [{ - rolename: '閮ㄩ暱', - permission: 'ROOT', - create_time: '2023-07-04 12:12:12', - update_time: '2023-07-04 12:12:12' - }, { - rolename: '缁勯暱', - permission: '--', - create_time: '2023-07-04 12:12:12', - update_time: '2023-07-04 12:12:12' - }], + roleTable: [], updateData: { oldPassWord: '', newPassWord: '', @@ -113,23 +143,62 @@ created() { }, + mounted() { + this.start() + }, methods: { + chekSelect(scope) { + + }, + async start() { + let res = await getAllRoleAndMenuInfo() + this.roleTable = res.data + console.log(res); + }, + async assertName() { + if (this.roleAdd.roleName == null || this.roleAdd.roleName == '') { + this.$message({ + message: '璇疯緭鍏ヨ鑹插悕', + type: 'warning' + }); + return + } + let res = await assertRepeat({ roleName: this.roleAdd.roleName }) + if (!res.data) { + this.assertRepeatName = false + this.$message({ + message: '瑙掕壊鍚嶉噸澶嶏紝璇烽噸鏂拌緭鍏ワ紒', + type: 'warning' + }); + } else { + this.assertRepeatName = true + } + }, + chekAdd(scope) { + scope.row.selected = true + }, + chekUpdate(scope) { + scope.row.selected = true + }, + chekDelet(scope) { + scope.row.selected = true + }, async addClickRole() { let res = await getMenusTree(); this.menuInfo = res.data this.menuInfo.forEach(item => { - item.select = false - item.add = false - item.update = false - item.delete = false + this.$set(item, 'selected', false); + this.$set(item, 'added', false); + this.$set(item, 'updated', false); + this.$set(item, 'deleted', false); if (item.children.length == 0) { delete item['children'] } else { item.children.forEach(c => { - c.select = false - c.add = false - c.update = false - c.delete = false + this.$set(c, 'selected', false); + this.$set(c, 'added', false); + this.$set(c, 'updated', false); + this.$set(c, 'deleted', false); if (c.children.length == 0) { delete c['children'] } @@ -137,10 +206,68 @@ } }) this.dialogTableVisible = true - // console.log(this.dialogTableVisible) }, - addRole() { - console.log(this.roleAdd); + async addRole() { + if (this.roleAdd.roleName == null || this.roleAdd.roleName == '') { + this.$message({ + message: '璇疯緭鍏ヨ鑹插悕', + type: 'warning' + }); + return + } + if (!this.assertRepeatName) { + this.$message({ + message: '瑙掕壊鍚嶉噸澶嶏紝璇烽噸鏂拌緭鍏�', + type: 'warning' + }); + return + } + this.menuInfo.forEach(item => { + if (item.children != undefined) { + item.children.forEach(c => { + if (c.added) { + item.selected = true + } + if (c.selected) { + item.selected = true + } + if (c.updated) { + item.selected = true + } + if (c.deleted) { + item.selected = true + } + }) + } + }) + console.log(this.menuInfo); + this.roleAdd.menuData = JSON.parse(JSON.stringify(this.menuInfo)); + this.roleAdd.menuData.forEach(item => { + if (item.children != undefined) { + let child = item.children.filter(c => { + return c.added == true || c.selected == true || c.deleted == true || c.updated === true + }) + item.children = child + } + }) + this.roleAdd.menuData = this.roleAdd.menuData.filter(item => { + return item.selected == true + }) + let res = await addRoleInfo(this.roleAdd); + if (res.data) { + this.$message({ + message: '娣诲姞瑙掕壊鎴愬姛', + type: 'success' + }); + this.dialogTableVisible = false + } else { + this.$message.error('娣诲姞澶辫触锛佽閲嶆柊鎿嶄綔'); + } + }, + assertDml(a, b) { + a = b ? true : false + console.log(a); + return a }, // search(){}, // reset(){}, @@ -153,6 +280,13 @@ handleCurrentChange(val) { console.log(`褰撳墠鏄${val}椤礰) this.currentPage = val + }, + clearAll() { + this.roleAdd.roleName = null + this.roleAdd.menuData = null + this.menuInfo = [] + this.assertRepeatName = true + this.dialogTableVisible = false } } } diff --git a/src/views/laboratory/role/menuPower.vue b/src/views/laboratory/role/menuPower.vue new file mode 100644 index 0000000..b994a9e --- /dev/null +++ b/src/views/laboratory/role/menuPower.vue @@ -0,0 +1,21 @@ +<template> + <div> + + </div> +</template> +<script> +export default { + data() { + return { + + } + }, + created() { + + }, + methods: { + + } +} +</script> +<style scoped></style> \ No newline at end of file diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 567f922..d753b3b 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -43,10 +43,10 @@ </el-form-item> <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button> - <div class="tips"> + <!-- <div class="tips"> <span style="margin-right:20px;">username: admin</span> <span> password: any</span> - </div> + </div> --> </el-form> </div> </template> @@ -115,7 +115,7 @@ this.loading = false }) } else { - console.log('error submit!!') + console.log('鐧诲綍澶辫触!') return false } }) diff --git a/src/views/template_testReport/index.vue b/src/views/template_testReport/index.vue new file mode 100644 index 0000000..575e579 --- /dev/null +++ b/src/views/template_testReport/index.vue @@ -0,0 +1,651 @@ +<template> + <div class="content-wrapper"> + <div class="content-main"> + <div class="cover"> + <div class="cover-top"> + <div> + <div style="height: 30px; line-height: 30px;">鎶ュ憡缂栧彿:</div> + <div style="height: 30px; line-height: 30px;">Reference No:</div> + </div> + </div> + <div class="title"> + <h1 style="text-align-last:justify ;">妫�楠屾姤鍛�</h1> + <h1>Test Report</h1> + </div> + <div class="cover-body"> + <div class="name"> + <div style="width:140px; text-align-last: justify;"> + <div>璇曟牱鍚嶇О</div> + <span style="font-size: 14px;">Name of Product</span> + </div> + <div class="line"> 娴嬭瘯鍚嶇О</div> + </div> + <div class="name"> + <div style="width:140px; text-align-last: justify;"> + <div style="text-align-last: justify;">鍨嬪彿</div> + <span style="font-size: 14px;">Type and Size</span> + </div> + <div class="line"> 娴嬭瘯鍚嶇О</div> + </div> + <div class="name"> + <div style="width:140px; text-align-last: justify;"> + <div>濮旀墭鍗曚綅</div> + <span style="font-size: 14px;display: block;margin: 10px 50px 0px;">Client</span> + </div> + <div class="line"> 娴嬭瘯鍚嶇О</div> + </div> + <div class="name"> + <div style="width:140px; text-align-last: justify;"> + <div>妫�楠岀被鍒�</div> + <span style="font-size: 14px;">Kind of Test</span></div> + <div class="line"> 娴嬭瘯鍚嶇О</div> + </div> + </div> + <div class="cover-footer"> + <span>姹熻嫃涓ぉ绉戞妧鑲′唤鏈夐檺鍏徃妫�娴嬩腑蹇�</span><br> + <span style="font-size: 14px;">TEST CENTER OF JIANGSU ZHONGTIAN TECHNOLOGY CO.,LTD</span> + </div> + </div> + <div class="pageOne"> + <div class="statement"> + <div><h2>澹版槑</h2></div> + <div style="text-align-last: center;"><h2 style="font-size: 14px;">Statement</h2></div> + </div> + <div class="statement-body"> + <div> + <span>1. 鏈楠屾姤鍛婏紙鍖呮嫭澶嶅嵃浠讹級鏈姞妫�娴嬩笓鐢ㄧ珷涓�寰嬫棤鏁堛��</span><br> + <span>This test report (including any duplicates) shall become effective only with pecial chapter for testing on.</span> + </div> + <div> + <span>2. 鏈楠屾姤鍛婃棤缂栧啓銆佸鏍搞�佹壒鍑嗕汉绛剧珷鏃犳晥銆�</span><br> + <span>This test report shall become effective only with the signatures of compiler checker and approver.</span> + </div> + <div> + <span>3. 鏈楠屾姤鍛婃秱鏀规棤鏁堛��</span><br> + <span>This test report will be invalid if altered.</span> + </div> + <div> + <span>4. 鏈楠屾姤鍛婁笉寰楅儴鍒嗗鍗般��</span><br> + <span>This test report mustn鈥檛 copy partly.</span> + </div> + <div> + <span>5. 閫佹牱濮旀墭妫�楠岋紝浠呭鏉ユ牱璐熻矗銆�</span><br> + <span>For the sample submitted by clients, the test result is valid only for these samples.</span> + </div> + <div> + <span>6. 鏍峰搧鍙婂鎵樺崟浣嶄负濮旀墭鏂硅嚜鍛藉悕銆�</span><br> + <span>Samples and consignor name for the principal.</span> + </div> + <div> + <span>7. 鏈楠屾姤鍛婁腑鑻辨枃鎻忚堪鏈夊啿绐佹椂锛屼互涓枃瑙i噴涓哄噯銆�</span><br> + <span>If the Chinese and English version of the test report have any conflict, the Chinese version should be the standard for arbitrament.</span> + </div> + <div> + <span>8. 濮旀墭鏂瑰鏈楠屾姤鍛婅嫢鏈夊紓璁紝搴斾簬鏍峰搧淇濆瓨鏈熷唴鍚戞湰涓績鎻愬嚭锛岃仈绯荤數璇濓細0513-84885657</span><br> + <span>Clients who have any different ideas about this test report, may contract with Test Central within the sample reservation time. Tel: 0513-84885657</span> + </div> + <div> + <span>9. 鏈腑蹇冩牱鍝佽嚜鎶ュ憡鍙戦�佹棩璧凤紝涓�鑸繚瀛樹竴涓湀锛屼互澶囧楠屻��</span><br> + <span>The sample shall be reserved for one month beginning from the data when this test report is submitted for examine or review.</span> + </div> + </div> + <div class="statement-footer"> + <div class="depart"> + <span>姹熻嫃涓ぉ绉戞妧鑲′唤鏈夐檺鍏徃妫�娴嬩腑蹇�</span><br> + <span>Test Center of Jiangsu Zhongtian Technology Co., LTD</span> + </div> + <div class="address"> + <span>鍦� 鍧�锛氭睙鑻忕渷鍗楅�氬競缁忔祹鎶�鏈紑鍙戝尯鏂板紑鍗楄矾19鍙�</span><br> + <span>Address: No.19 Xinkai South Road, Nantong Economic and Technological Development Zone, Jiangsu Province</span> + </div> + <div class="zipcode">閭斂缂栫爜Zip Code锛�226010</div> + <div class="tel">鐢� 璇漈el锛�0513-89059043</div> + <div class="email">閭� 绠盓-mail:锛歾tttc@chinaztt.com </div> + </div> + </div> + <div class="pageTwo"> + <div class="header" style="line-height: 10px;"> + <div style="width: 350px;margin: 0 auto; text-align-last: justify;"> + <h2 style="font-size: 18px;">姹熻嫃涓ぉ绉戞妧鑲′唤鏈夐檺鍏徃妫�娴嬩腑蹇�</h2> + </div> + <div style="width: 500px; margin: 0 auto;text-align-last: justify;"> + <h2 style="font-size: 14px;">TEST CENTER OF JIANGSU ZHONGTIAN TECHNOLOGY CO.,LTD</h2> + </div> + <div style="width: 120px;margin: 0 auto;text-align-last: justify;"> + <h2 style="font-size: 18px;">妫�娴嬫姤鍛�</h2> + </div> + <div style="width: 100px; margin: 0 auto;text-align-last: justify;"> + <h2 style="font-size: 14px;">Test Report</h2> + </div> + </div> + <div class="table"> + <div class="table-header"> + <div> + <span>鎶ュ憡缂栧彿锛�</span><br> + <span>Reference No锛�</span> + </div> + <div> + <span>绗�1椤靛叡2椤�</span><br> + <span>Page 1 of 2</span> + </div> + </div> + <div class="table-body"> + <table width="100%" border="1" cellspacing="0" style="text-align: center;"> + <tr> + <td><span>璇曟牱鍚嶇О</span><br> + <span>Name of product</span></td> + <td colspan="2"></td> + <td> + <span>瑙勬牸鍨嬪彿</span><br> + <span>Type and size</span> + </td> + <td colspan="2"></td> + </tr> + <tr> + <td> + <span>鏍峰搧鏁伴噺</span><br> + <span>Test item</span> + </td> + <td colspan="2"></td> + <td> + <span>妫�楠岄」鐩�</span><br> + <span>Test item</span> + </td> + <td colspan="2"></td> + </tr> + <tr> + <td> + <span>鏉ユ牱鏂瑰紡</span><br> + <span>Delivering method</span> + </td> + <td colspan="2"></td> + <td> + <span>妫�楠岀被鍨�</span><br> + <span>Type of test</span> + </td> + <td colspan="2"></td> + </tr> + <tr> + <td> + <span>鏍峰搧鐘舵��</span><br> + <span>Sample discription</span> + </td> + <td colspan="2"></td> + <td> + <span>鐢熶骇鍗曚綅</span><br> + <span>Producer</span> + </td> + <td colspan="2"></td> + </tr> + <tr> + <td> + <span>鏀舵牱鏃堕棿</span><br> + <span>Received date</span> + </td> + <td colspan="2"></td> + <td> + <span>妫�楠屾棩鏈�</span><br> + <span>Test date</span> + </td> + <td colspan="2"></td> + </tr> + <tr> + <td> + <span>濮旀墭浜�</span><br> + <span>Consignor</span> + </td> + <td colspan="2"></td> + <td> + <span>鐢佃瘽</span><br> + <span>Tel</span> + </td> + <td colspan="2"></td> + </tr> + <tr> + <td> + <span>濮旀墭鍗曚綅</span><br> + <span>Client</span> + </td> + <td colspan="5"></td> + </tr> + <tr> + <td> + <span>濮旀墭鍗曚綅鍦板潃</span><br> + <span>Address</span> + </td> + <td colspan="5"></td> + </tr> + <tr> + <td> + <span>妫�楠岀幆澧�</span><br> + <span>Test environment</span> + </td> + <td colspan="5"></td> + </tr> + <tr> + <td> + <span>妫�楠屼緷鎹�</span><br> + <span>Test standard</span> + </td> + <td colspan="5"></td> + </tr> + <tr> + <td style="height: 180px;"> + <span>缁撹</span><br> + <span>Conclusion </span> + </td> + <td colspan="5"> + <div style="height: 120px;"></div> + <div style="height: 60px;margin-left: 250px;"> + <span>锛堟娴嬫姤鍛婁笓鐢ㄧ珷锛�</span><br> + <span>( SPECIFIC STAMP FOR TEST RTORT) </span><br> + <span>绛惧彂鏃ユ湡锛� 骞� 鏈� 鏃�</span><br> + <span>Date of issue: August 23, 2023</span> + </div> + </td> + </tr> + <tr> + <td> + <span>澶囨敞</span><br> + <span>Remark </span> + </td> + <td colspan="5"></td> + </tr> + <tr> + <td> + <span>缂栧埗</span><br> + <span>Preparer</span> + </td> + <td colspan="2"></td> + <td> + <span>妫�楠�</span><br> + <span>Tester</span> + </td> + <td colspan="2"></td> + </tr> + <tr> + <td> + <span>瀹℃牳</span><br> + <span>Checker </span> + </td> + <td colspan="2"></td> + <td> + <span>鎵瑰噯</span><br> + <span>Approver</span> + </td> + <td colspan="2"></td> + </tr> + </table> + </div> + </div> + </div> + <div class="pageThree"> + <div class="header" style="line-height: 10px;"> + <div style="width: 350px;margin: 0 auto; text-align-last: justify;"> + <h2 style="font-size: 18px;">姹熻嫃涓ぉ绉戞妧鑲′唤鏈夐檺鍏徃妫�娴嬩腑蹇�</h2> + </div> + <div style="width: 500px; margin: 0 auto;text-align-last: justify;"> + <h2 style="font-size: 14px;">TEST CENTER OF JIANGSU ZHONGTIAN TECHNOLOGY CO.,LTD</h2> + </div> + <div style="width: 120px;margin: 0 auto;text-align-last: justify;"> + <h2 style="font-size: 18px;">妫�娴嬫姤鍛�</h2> + </div> + <div style="width: 100px; margin: 0 auto;text-align-last: justify;"> + <h2 style="font-size: 14px;">Test Report</h2> + </div> + </div> + <div class="table"> + <div class="table-header"> + <div> + <span>鎶ュ憡缂栧彿锛�</span><br> + <span>Reference No锛�</span> + </div> + <div> + <span>绗�2椤靛叡2椤�</span><br> + <span>Page 2 of 2</span> + </div> + </div> + <div class="table-body"> + <table width="100%" border="1" cellspacing="0" style="text-align: center;"> + <tr> + <td colspan="4"> + <span>鏍峰搧缂栧彿</span><br> + <span>Sample No</span></td> + <td colspan="3"></td> + <td colspan="4"> + <span>瑙勬牸鍨嬪彿</span><br> + <span>Type</span> + </td> + <td colspan="3"></td> + </tr> + <tr> + <td> + <span>搴忓彿</span><br> + <span>No</span> + </td> + <td colspan="3"> + <span>妫�楠岄」鐩�</span><br> + <span>Test item</span> + </td> + <td> + <span>鍗曚綅</span><br> + <span>Unit</span> + </td> + <td colspan="3"> + <span>鏍囧噯瑕佹眰</span><br> + <span>Requirement</span> + </td> + <td colspan="3"> + <span>妫�楠岀粨鏋�</span><br> + <span>Test result</span> + </td> + <td> + <span>缁撹</span><br> + <span>Conclusion</span> + </td> + </tr> + <tr> + <td> + <span></span><br> + <span></span> + </td> + <td colspan="3"> + <span>鏍峰搧鏍囪瘑</span><br> + <span>Sample labeling</span> + </td> + <td> + <span></span><br> + <span>I</span> + </td> + <td colspan="3"> + <span></span><br> + <span></span> + </td> + <td colspan="3"> + <span></span><br> + <span></span> + </td> + <td> + <span></span><br> + <span></span> + </td> + </tr> + <tr v-for="item in resultTable" :key="index"> + <td> + <span>{{ item.id }}</span><br> + </td> + <td colspan="3"> + <span>{{ item.testitem }}</span><br> + <span>{{ item.testitem_engName }}</span> + </td> + <td> + <span>{{ item.unit }}</span> + </td> + <td colspan="3"> + <span>{{ item.requirement }}</span><br> + <span>{{ item.requirement_eng }}</span> + </td> + <td colspan="3"> + <span>{{ item.testresult }}</span><br> + <span>{{ item.testresult_engName }}</span> + </td> + <td> + <span>{{ item.conclusion }}</span> + </td> + </tr> + + </table> + </div> + </div> + </div> + <div class="pageFour"> + <div class="page-header" style="display: flex;justify-content: space-between;font-size: 12px;"> + <div> + <span>鎶ュ憡缂栧彿锛�</span><br> + <span>Reference No锛�</span> + </div> + <div> + <span>闄勯〉</span><br> + <span>Appenfix</span> + </div> + </div> + <hr> + <div class="table"> + <div class="table-header"> + <div style="width: 200px; margin: 0 auto;text-align-last: justify;"><h2>妫�楠岃澶囦竴瑙堣〃</h2></div> + <div style="text-align-last: center;"><h2 style="font-size: 14px;">Equipment List</h2></div> + </div> + <div class="table-body"> + <table width="100%" border="1" cellspacing="0" style="text-align: center;"> + <thead> + <tr> + <td> + <span>搴忓彿</span><br> + <span>No</span> + </td> + <td colspan="2"> + <span>璁惧鍚嶇О</span><br> + <span>Equipment name</span> + </td> + <td> + <span>璁惧鍨嬪彿</span><br> + <span>type</span> + </td> + <td colspan="2"> + <span>缂栧彿</span><br> + <span>Factory number</span> + </td> + <td colspan="2"> + <span>鏍″噯鏈夋晥鏈�</span><br> + <span>Date of validity</span> + </td> + </tr> + </thead> + <tr v-for="item in table" :key="index"> + <td> + <span>{{ item.id }}</span> + </td> + <td colspan="2"> + <span>{{ item.equipment_name }}</span> + </td> + <td> + <span>{{ item.type }}</span><br> + </td> + <td colspan="2"> + <span>{{ item.factory_number }}</span> + </td> + <td colspan="2"> + <span>{{ item.validity }}</span> + </td> + </tr> + + </table> + </div> + </div> + </div> + </div> + </div> +</template> + +<script> +export default { + props:{ + + }, + data(){ + return { + resultTable:[ + { + id: '1', + testitem: '鍘熷鎷変几', + testitem_engName: 'Primitive strength', + unit: 'MPa', + requirement: '鏈�灏�10.0', + requirement_eng: 'Minimun 10.0', + testresult: '', + testitem_engName: '' + } + ], + table:[{ + id: 1, + equipment_name: '鎷栨媺鏈�', + type: 1, + factory_number: 'Akjgfewof', + validity:'2023.8.25~2023.8.27' + }] + } + } +} +</script> + +<style lang="scss" scoped> +.content-wrapper{ + background-color: #f0f2f5; + width: 100%; + height: 100vh; + overflow-y: auto; + .content-main{ + margin: -50px auto; + width: 50%; + // background-color: #fff; + // background-color: #bfa; + .cover{ + margin: 80px 0px; + padding:0px 50px; + height: 1200px; + background-color: #fff; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + .cover-top{ + display: flex; + justify-content: end; + font-size: 20px; + margin-right: 50px; + padding-top: 50px; + // font-weight: bold; + } + .title{ + margin-top: 100px; + padding: 0px 220px; + text-align: center; + font-size: 25px; + } + .cover-body{ + font-size: 25px; + margin: 100px 80px; + .name{ + // background-color: #bfa; + display: flex; + justify-content: space-between; + margin-bottom: 20px; + .line{ + width: 500px; + border-bottom: solid 1px black; + text-align: center; + // height: 60px; + line-height: 60px; + } + } + } + .cover-footer{ + text-align: center; + margin-top: 200px; + span{ + font-size: 23px; + height: 40px; + line-height: 40px; + } + } + } + .pageOne{ + margin-top: -50px; + background-color: #fff; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + padding:50px 100px; + height: 1200px; + .statement{ + margin: 0 auto; + width: 100px; + text-align-last: justify; + } + .statement-body{ + line-height: 32px; + text-align: justify; + margin: 30px 0px; + font-size: 12px; + } + .statement-footer{ + line-height: 30px; + font-size: 12px; + } + } + .pageTwo{ + margin-top: 30px; + background-color: #fff; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + padding:50px 60px; + height: 1200px; + .table{ + margin-top: 20px; + .table-header{ + display: flex; + justify-content: space-between; + font-size: 14px; + line-height: 20px; + } + .table-body{ + font-size: 12px; + table td{ + width: 150px; + height: 52px; + } + } + } + } + .pageThree{ + margin-top: 30px; + background-color: #fff; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + padding:50px 60px; + height: 1200px; + .table{ + margin-top: 20px; + .table-header{ + display: flex; + justify-content: space-between; + font-size: 14px; + line-height: 20px; + } + .table-body{ + font-size: 12px; + table td{ + width: 8%; + height: 52px; + } + } + } + } + .pageFour{ + margin-top: 30px; + background-color: #fff; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + padding:50px 60px; + height: 1200px; + .table{ + margin-top: 50px; + .table-header{ + line-height: 20px; + } + .table-body{ + margin-top: 20px; + font-size: 12px; + table td{ + width: 80px; + height: 52px; + } + } + } + } + + } +} +</style> \ No newline at end of file -- Gitblit v1.9.3