Merge remote-tracking branch 'origin/master'
# Conflicts:
# .env.development
# src/views/inspectionManagement/commissionInspection/index.vue
已修改11个文件
已重命名1个文件
已添加2个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | //è·åè´£ä»»äººé¡¹ç®æ°ç»è®¡ |
| | | export function getDutyMater(params) { |
| | | return request({ |
| | | url: '/work/dutyMater', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | //è·åè´£ä»»äººåæ¶ç |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function isIfViewUUID(params){ |
| | | return request({ |
| | | url: '/link-basic/isIfViewUUID', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | |
| | | <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">{{ user.name.slice(0,1) }}</a> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown" class="user-dropdown"> |
| | | <router-link to="/"> |
| | | <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> |
| | |
| | | } 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 |
| | |
| | | 'avatar' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | user: { |
| | | id: null, |
| | | name: 'value' |
| | | } |
| | | } |
| | | }, |
| | | 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') |
| | | }, |
| | |
| | | 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%; |
| | |
| | | return JSON.parse(JSON.stringify(val)) |
| | | } |
| | | |
| | | Vue.prototype.vueIp = "http://localhost:8080/" |
| | | |
| | | // set ElementUI lang to EN |
| | | Vue.use(ElementUI, { locale }) |
| | | // 妿æ³è¦ä¸æç element-uiï¼æå¦ä¸æ¹å¼å£°æ |
| | |
| | | }] |
| | | }, |
| | | { |
| | | path: '/addCommision/:viewId', |
| | | hidden: true, |
| | | component: () => import('@/views/inspectionManagement/commissionInspection/addCommision'), |
| | | }, |
| | | { |
| | | path: '/standardLibrary', |
| | | component: Layout, |
| | | redirect: '/standardLibrary/index', |
| | |
| | | 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', |
| | |
| | | { |
| | | path: '/message', |
| | | component: Layout, |
| | | redirect: '/message/message', |
| | | redirect: '/message/toDo', |
| | | name: 'Message', |
| | | meta: { title: 'æ¶æ¯å¾
å', icon: 'el-icon-s-help' }, |
| | | children: [ |
| | | { |
| | | path: 'message', |
| | | name: 'Message', |
| | | component: () => import('@/views/message/message/index'), |
| | | meta: { title: 'æçæ¶æ¯', icon: 'table' } |
| | | }, |
| | | { |
| | | 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' } |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | ] |
| | | |
| | | const createRouter = () => new Router({ |
| | | // mode: 'history', // require service support |
| | | mode: 'history', |
| | | scrollBehavior: () => ({ y: 0 }), |
| | | routes: constantRoutes |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .content-main { |
| | | .el-form .el-form-item .el-form-item__content { |
| | | width: 100% !important; |
| | | } |
| | | |
| | | .top-bar { |
| | | margin: -25px -15px; |
| | | background: #fff; |
| | |
| | | tr, |
| | | td { |
| | | padding: 10px; |
| | | } |
| | | </style> |
| | | <style > |
| | | .content-main { |
| | | .el-form .el-form-item .el-form-item__content { |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <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> |
| | |
| | | <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: { |
| | |
| | | }; |
| | | option = { |
| | | legend: { |
| | | data: ['bar', 'bar2'], |
| | | data: ['已宿', 'æªå®æ'], |
| | | left: 'center' |
| | | }, |
| | | tooltip: {}, |
| | |
| | | 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(', ')); |
| | | } |
| | | 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 && 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)' |
| | | } |
| | | }; |
| | | 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' |
| | | } |
| | | } |
| | | }, |
| | | initLeaderTimlyChart(){ |
| | | |
| | | legend: { |
| | | data: ['é¡¹ç®æ°', '宿忶ç'], |
| | | show: true |
| | | }, |
| | | initTesterTimlyChart(){ |
| | | 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' |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | option && myChart.setOption(option); |
| | | }, |
| | | } |
| | | } |
| | |
| | | padding: 0; |
| | | .work-head{ |
| | | width:94%; |
| | | height:100; |
| | | height:100px; |
| | | margin: 5px 10px; |
| | | position: fixed; |
| | | z-index: 10; |
| | |
| | | } |
| | | } |
| | | .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%; |
| | | } |
| | | } |
| | | } |
| | |
| | | </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" |
| | |
| | | import * as echarts from 'echarts'; |
| | | import { getVerifiedTop3,getUncheckedTop4,getMatAndFinshQualified, |
| | | getCheckAndProjectNum,getTurno |
| | | } from '@/api/home' |
| | | } from '@/api/home/index' |
| | | export default { |
| | | name: "home", |
| | | data() { |
| | |
| | | insNum: 0, |
| | | insUnNum: 0, |
| | | insproNum: 0, |
| | | insproUnNum: 1110, |
| | | insproUnNum: 0, |
| | | radioType: "æ¬å¹´", |
| | | imgSrc: require("@/assets/404_images/bg.png"), |
| | | verifiedData: new Array(), |
| | |
| | | <template> |
| | | <div v-if="!showDetail"> |
| | | <div class="add_commision"> |
| | | <div class="content-main"> |
| | | <div class="firstBox"> |
| | | <div class="title">æ£æµä¿¡æ¯</div> |
| | | <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 |
| | | <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-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'}" |
| | | <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%"> |
| | | :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> |
| | | <el-tag type="success" disable-transitions>æ«æ</el-tag> |
| | | </div> |
| | | <div v-if="scope.row.addway === 1"> |
| | | <el-tag :type= 'primary' disable-transitions>å½å
¥</el-tag> |
| | | <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%" |
| | | > |
| | | <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="font-size: 16px;margin-bottom: 5px;">åºæ¬ä¿¡æ¯</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" > |
| | | <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-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: 160px" v-model="infoForm.department" placeholder="请è¾å
¥å§æåä½" /> |
| | | <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: 160px" v-model="infoForm.contacter" placeholder="请è¾å
¥å§æåä½" /> |
| | | <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: 160px" v-model="infoForm.tel" placeholder="请è¾å
¥èç³»çµè¯" /> |
| | | <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: 160px;" v-model="infoForm.address" placeholder="请è¾å
¥èç³»å°å" autocomplete="off" /> |
| | | <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: 160px;"> |
| | | <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: 160px;"> |
| | | <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: 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 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 :gutter="200"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="éæ ·äººï¼" > |
| | | <el-input style="width: 160px;" v-model="infoForm.sender" placeholder="请è¾å
¥éæ ·äºº" autocomplete="off" /> |
| | | <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: 160px;" v-model="infoForm.sendertel" placeholder="请è¾å
¥éæ ·äººçµè¯" autocomplete="off" /> |
| | | <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: 160px;" v-model="infoForm.num" placeholder="请è¾å
¥æ¥åæ°" autocomplete="off" /> |
| | | <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: 160px;" v-model="infoForm.other" placeholder="夿³¨" autocomplete="off" /> |
| | | <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> |
| | | <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> |
| | |
| | | </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-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="10"> |
| | | <el-col :span="11"> |
| | | <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-input v-model="addPointerForm.sampleNumber" size="small" disabled> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-col :span="11"> |
| | | <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 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="10"> |
| | | <el-col :span="11"> |
| | | <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 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-col :span="11"> |
| | | <el-form-item label="æ ·ååä½ï¼"> |
| | | <el-input style="width: 160px" type="text" v-model="addPointerForm.unit" placeholder="请è¾å
¥åä½" autocomplete="off" /> |
| | | <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="10"> |
| | | <el-col :span="11"> |
| | | <el-form-item label="æ ·åæ°éï¼"> |
| | | <el-input style="width: 160px" type="text" v-model="addPointerForm.samplesNumber" placeholder="请è¾å
¥æ°é" autocomplete="off" /> |
| | | <el-input type="text" v-model="addPointerForm.samplesNumber" placeholder="请è¾å
¥æ°é" autocomplete="off" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-col :span="11"> |
| | | <el-form-item label="夿³¨ï¼"> |
| | | <el-input style="width: 160px" type="text" v-model="addPointerForm.remarks" placeholder="请è¾å
¥å¤æ³¨" autocomplete="off" /> |
| | | <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-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 v-for="expers in experList" :label="expers.label" |
| | | :key="expers.key">{{ expers.label }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-else> |
| | | <router-view></router-view> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getSampleName, getModelSpecification, getlink, addInspection} from '@/api/inspection/commisioninspection' |
| | | import { |
| | | getSampleName, |
| | | getModelSpecification, |
| | | getlink, |
| | | addInspection, |
| | | isIfViewUUID |
| | | } from '@/api/inspection/commisioninspection' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | key:'1', |
| | | value: '' |
| | | }], |
| | | model_spe_options:[{ |
| | | key:'1', |
| | | value: 'é项1' |
| | | },{ |
| | | key: '2', |
| | | value: 'é项2' |
| | | }], |
| | | model_spe_options: [], |
| | | sampleDeliveryMode:[{ |
| | | key: '1', |
| | | value: 'éæ ·' |
| | |
| | | value: 'ä¸é¨' |
| | | }], |
| | | dialogueFormVisible: false, |
| | | showDetail: false |
| | | showDetail: false, |
| | | viewId: null |
| | | } |
| | | }, |
| | | created(){ |
| | | this.getlink() |
| | | this.viewId = this.$route.params.viewId |
| | | this.$store.commit('settings/SAVE_LINK', this.viewId) |
| | | this.getlink(this.$route.params.viewId) |
| | | }, |
| | | 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) |
| | | 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() |
| | | // 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 |
| | | value: item.name, |
| | | code: item.code |
| | | } |
| | | }) |
| | | }, |
| | | async getModelSpecification(){ |
| | | const res = await getModelSpecification({materialId: '1'}) |
| | | // console.log(res) |
| | | async getModelSpecification(val) { |
| | | const res = await getModelSpecification({ |
| | | materialId: val |
| | | }) |
| | | this.model_spe_options = res.data.map((item)=>{ |
| | | return{ |
| | | key:item.specificationsId, |
| | |
| | | }else{ |
| | | sampledeliveryway = 2 |
| | | } |
| | | const res = await addInspection({completionDeadline: this.infoForm.deadline, |
| | | const res = await addInspection({ |
| | | completionDeadline: this.infoForm.deadline, |
| | | contactAddress: this.infoForm.address, |
| | | contactNumber: this.infoForm.tel, |
| | | contacts: this.infoForm.contacter, |
| | |
| | | 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) |
| | | sampleSender: this.infoForm.sender |
| | | }) |
| | | this.infoForm.commisioncode = res.data |
| | | if(res.data){ |
| | | this.$message({ |
| | |
| | | this.pageParams.pageNo = pageNo |
| | | }, |
| | | deleteRow(row){ |
| | | console.log(row) |
| | | row = null |
| | | |
| | | }, |
| | | upMaterialName(val) { |
| | | this.sampleoptions.forEach(a => { |
| | | if (a.key == val) { |
| | | this.addPointerForm.sampleNumber = a.code |
| | | } |
| | | }) |
| | | this.getModelSpecification(val) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | .firstBox{ |
| | | .title{ |
| | | padding:0px 10px 10px 10px; |
| | | padding: 15px 10px; |
| | | font-size: 18px; |
| | | background-color: #0166e2; |
| | | color: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .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; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .secondBox{ |
| | | margin: 0px -15px; |
| | | |
| | | .header{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding: 10px 20px; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .submitBtn{ |
| | | display: flex; |
| | | justify-content: end; |
| | |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | |
| | | .infoForm{ |
| | | background-color: #fff; |
| | | padding: 20px 50px; |
| | | |
| | | .formwrapper{ |
| | | margin: 20px 0px; |
| | | padding-left: 30px; |
| | | |
| | | .el-row{ |
| | | margin: 10px 0px; |
| | | } |
| | |
| | | <template> |
| | | <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 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 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 v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-button type="primary" plain @click="reset">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-form class="rightForm"> |
| | | <!-- æ¾ç¤ºæ°å¢å§æçç½å龿¥ --> |
| | | <div v-show="showlinkDiv === true"> |
| | | <span style="font-size: 12px;">{{ textToCopy }}</span> |
| | | <el-button type="text" @click="copyText" style="margin-left: 30px;">{{ copied ===false?'å¤å¶':'å·²å¤å¶' }}</el-button> |
| | | <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 class="rightBtn" type="primary" @click="showLink">æ°å¢å§æ</el-button> |
| | | <el-button slot="reference" class="rightBtn" type="primary" @click="goToaddCommision">æ°å¢å§æ</el-button> |
| | | </el-popover> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-card style="margin: 20px 8px;"> |
| | | <div > |
| | | <div class="library-table"> |
| | | <div class="table-header"> |
| | | <div class="search-bar"> |
| | | <el-radio-group v-model="radioValue" @change="radioclick"> |
| | |
| | | </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> |
| | | <el-button type="primary" size="mini" icon="el-icon-document" |
| | | style="background-color: rgb(1, 102, 226);">çææ¥æ£å</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-table |
| | | ref="commisionTable" |
| | | :max-height="800" |
| | | :cell-style="{textAlign: 'center'}" |
| | | <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%"> |
| | | :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> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | min-width="8%" |
| | | > |
| | | <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> |
| | | <!-- åé¡µå¨ --> |
| | | <div> |
| | | <el-pagination |
| | | class="pagination" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10,20,30]" |
| | | :page-size="pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total"> |
| | | <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> |
| | | </el-card> |
| | | |
| | | </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' |
| | | import { |
| | | getCommisionList, |
| | | getViewUUID, |
| | | selectViewUUID |
| | | } from '@/api/inspection/commisioninspection' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | sample_name: "å卿º", |
| | | inspection_status: 1 |
| | | }], |
| | | conditionsOptions: [ |
| | | { |
| | | conditionsOptions: [{ |
| | | label: 'å
¨é¨', |
| | | value: 0 |
| | | }, |
| | |
| | | currentPage: 1, |
| | | pageSize: 5, |
| | | total: 100, |
| | | showlinkDiv: false, |
| | | copied: false, |
| | | textToCopy: 'http://localhost:8080/#/addCommision' |
| | | 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: { |
| | | copyText() { |
| | | this.$copyText(this.textToCopy) |
| | | .then(() => { |
| | | this.copied = true; |
| | | // setTimeout(() => { |
| | | // this.copied = false; |
| | | // }, 2000); |
| | | }) |
| | | .catch(error => { |
| | | console.log('å¤å¶å¤±è´¥',error); |
| | | }); |
| | | 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}) |
| | | 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))] |
| | | // å°allDepartmentNames转æ¢ä¸ºoptionséè¦çæ ¼å¼ |
| | | this.options = allDepartmentNames.map(name => ({ value: name, label: name })) |
| | | this.options = allDepartmentNames.map(name => ({ |
| | | value: name, |
| | | label: name |
| | | })) |
| | | |
| | | }, |
| | | // æ¥è¯¢æ¹æ³ |
| | |
| | | if(this.radioValue === 0){ |
| | | this.getCommisionList() |
| | | }else{ |
| | | const res = await getCommisionList({pageNo:this.currentPage, pageSize:this.pageSize, inspectionStatus: this.radioValue}) |
| | | 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 |
| | |
| | | if(this.radioValue === 0){ |
| | | this.getCommisionList() |
| | | }else{ |
| | | const res = await getCommisionList({pageNo:this.currentPage, pageSize:this.pageSize, inspectionStatus: this.radioValue}) |
| | | const res = await getCommisionList({ |
| | | pageNo: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | inspectionStatus: this.radioValue |
| | | }) |
| | | this.commisionTable = res.data.row |
| | | this.total = res.data.total |
| | | } |
| | |
| | | if(this.radioValue === 0){ |
| | | this.getCommisionList() |
| | | }else{ |
| | | const res = await getCommisionList({pageNo:this.currentPage, pageSize:this.pageSize, inspectionStatus: this.radioValue}) |
| | | const res = await getCommisionList({ |
| | | pageNo: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | inspectionStatus: this.radioValue |
| | | }) |
| | | this.commisionTable = res.data.row |
| | | this.total = res.data.total |
| | | } |
| | | }, |
| | | showLink() { |
| | | this.showlinkDiv = true |
| | | 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 lang="scss" scoped> |
| | | <style scoped> |
| | | .top-bar { |
| | | margin: -25px -15px; |
| | | background: #fff; |
| | |
| | | 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; |
| | | } |
| | | |
| | | .rightForm{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | /* background-color: #bfa; */ |
| | | height: 40px; |
| | | line-height: 40px; |
| | | |
| | | >div{ |
| | | padding: 0px 10px; |
| | | padding-bottom: 10px; |
| | |
| | | /* height: 40px; |
| | | line-height: 40px; */ |
| | | } |
| | | .rightBtn{ |
| | | background-color: rgb(1, 102, 226); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | .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; |
| | | margin-bottom: 10px; |
| | | .search-bar{ |
| | | width: 50%; |
| | | justify-content: space-between; |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 30px !important; |
| | | } |
| | | .generateInsp{ |
| | | width: 50%; |
| | | } |
| | | |
| | | .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; |
| | | } |
| | | } |
| | | .pagination{ |
| | | } |
| | | |
| | | .rightBtn { |
| | | background-color: rgb(1, 102, 226); |
| | | } |
| | | |
| | | .library-table { |
| | | background-color: #fff; |
| | | flex: 1; |
| | | margin: 0px -15px; |
| | | margin-top: 40px; |
| | | display: flex; |
| | | margin-top: 20px; |
| | | justify-content: end; |
| | | 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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </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-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 size="medium " v-model="roleAdd.menuData" :options="menuInfo"> |
| | | <template slot-scope="{ node, data }"> |
| | | <!-- <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> |
| | | <span v-if="!node.isLeaf"> ({{ }}) </span> |
| | | </template> |
| | | </el-cascader> |
| | | </el-form-item> |
| | | </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> |
| | |
| | | </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 }, |
| | |
| | | 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: '', |
| | |
| | | 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'] |
| | | } |
| | |
| | | } |
| | | }) |
| | | 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(){}, |
| | |
| | | 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 |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped></style> |