| | |
| | | import router from './router' |
| | | import store from './store' |
| | | import { Message } from 'element-ui' |
| | | import NProgress from 'nprogress' // progress bar |
| | | import 'nprogress/nprogress.css' // progress bar style |
| | | import { getToken } from '@/utils/auth' // get token from cookie |
| | | import getPageTitle from '@/utils/get-page-title' |
| | | // import router from './router' |
| | | // import store from './store' |
| | | // import { Message } from 'element-ui' |
| | | // import NProgress from 'nprogress' // progress bar |
| | | // import 'nprogress/nprogress.css' // progress bar style |
| | | // import { getToken } from '@/utils/auth' // get token from cookie |
| | | // import getPageTitle from '@/utils/get-page-title' |
| | | |
| | | NProgress.configure({ showSpinner: false }) // NProgress Configuration |
| | | // NProgress.configure({ showSpinner: false }) // NProgress Configuration |
| | | |
| | | const whiteList = ['/login'] // no redirect whitelist |
| | | // const whiteList = ['/login'] // no redirect whitelist |
| | | |
| | | router.beforeEach(async(to, from, next) => { |
| | | // start progress bar |
| | | NProgress.start() |
| | | // router.beforeEach(async(to, from, next) => { |
| | | // // start progress bar |
| | | // NProgress.start() |
| | | |
| | | // set page title |
| | | document.title = getPageTitle(to.meta.title) |
| | | // // set page title |
| | | // document.title = getPageTitle(to.meta.title) |
| | | |
| | | // determine whether the user has logged in |
| | | const hasToken = getToken() |
| | | // // determine whether the user has logged in |
| | | // const hasToken = getToken() |
| | | |
| | | if (hasToken) { |
| | | if (to.path === '/login') { |
| | | // if is logged in, redirect to the home page |
| | | next({ path: '/' }) |
| | | NProgress.done() |
| | | } else { |
| | | const hasGetUserInfo = store.getters.name |
| | | if (hasGetUserInfo) { |
| | | next() |
| | | } else { |
| | | try { |
| | | // get user info |
| | | await store.dispatch('user/getInfo') |
| | | // if (hasToken) { |
| | | // if (to.path === '/login') { |
| | | // // if is logged in, redirect to the home page |
| | | // next({ path: '/' }) |
| | | // NProgress.done() |
| | | // } else { |
| | | // const hasGetUserInfo = store.getters.name |
| | | // if (hasGetUserInfo) { |
| | | // next() |
| | | // } else { |
| | | // try { |
| | | // // get user info |
| | | // await store.dispatch('user/getInfo') |
| | | |
| | | next() |
| | | } catch (error) { |
| | | // remove token and go to login page to re-login |
| | | // éæ°å·æ°token |
| | | await store.dispatch('user/resetToken') |
| | | Message.error(error || 'Has Error') |
| | | next(`/login?redirect=${to.path}`) |
| | | NProgress.done() |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | /* has no token*/ |
| | | // next() |
| | | // } catch (error) { |
| | | // // remove token and go to login page to re-login |
| | | // // éæ°å·æ°token |
| | | // await store.dispatch('user/resetToken') |
| | | // Message.error(error || 'Has Error') |
| | | // next(`/login?redirect=${to.path}`) |
| | | // NProgress.done() |
| | | // } |
| | | // } |
| | | // } |
| | | // } else { |
| | | // /* has no token*/ |
| | | |
| | | if (whiteList.indexOf(to.path) !== -1) { |
| | | // in the free login whitelist, go directly |
| | | next() |
| | | } else { |
| | | // other pages that do not have permission to access are redirected to the login page. |
| | | next(`/login?redirect=${to.path}`) |
| | | NProgress.done() |
| | | } |
| | | } |
| | | }) |
| | | // if (whiteList.indexOf(to.path) !== -1) { |
| | | // // in the free login whitelist, go directly |
| | | // next() |
| | | // } else { |
| | | // // other pages that do not have permission to access are redirected to the login page. |
| | | // next(`/login?redirect=${to.path}`) |
| | | // NProgress.done() |
| | | // } |
| | | // } |
| | | // }) |
| | | |
| | | router.afterEach(() => { |
| | | // finish progress bar |
| | | NProgress.done() |
| | | }) |
| | | // router.afterEach(() => { |
| | | // // finish progress bar |
| | | // NProgress.done() |
| | | // }) |
| | |
| | | path: 'reportForInspection', |
| | | name: 'ReportForInspection', |
| | | component: () => import('@/views/rawMaterials/reportForInspection/index'), |
| | | meta: { title: 'åæææ¥æ£', icon: 'table' } |
| | | meta: { title: 'åæææ¥æ£', icon: 'table' }, |
| | | children: [ |
| | | // { |
| | | // path: 'index', |
| | | // name: 'ReportForInspectionIndex', |
| | | // // hidden: true, |
| | | // component: () => import('@/views/rawMaterials/reportForInspection/index'), |
| | | // meta: { title: 'åæææ¥æ£', icon: 'table' } |
| | | // }, |
| | | { |
| | | path: 'forInspectionDetail', |
| | | name: 'ForInspectionDetail', |
| | | hidden: true, |
| | | component: () => import('@/views/rawMaterials/reportForInspection/forInspectionDetail'), |
| | | meta: { title: 'æ°å¢æ£éªå详æ
', icon: 'table' } |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: 'print', |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="forinspection-father-main"> |
| | | <router-view /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="forInspectionDetail-main"> |
| | | <div class="for-inspction-detail-header"> |
| | | <div class="header-left">æ¥æ£ç¼å·ï¼</div> |
| | | <div class="header-right"> |
| | | <el-form class="rightBtn" :inline="true"> |
| | | <el-form-item class="createBtn"> |
| | | <el-button type="error" icon="el-icon-plus">ä½åºç³è¯·</el-button> |
| | | </el-form-item> |
| | | <el-form-item class="getDataBtn"> |
| | | <el-button type="primary" icon="el-icon-download">æäº¤ç³è¯·</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | <div class="content-main"> |
| | | <div class="card-main"> |
| | | <div class="tips-main"> |
| | | <div class="tips"> |
| | | <span /> |
| | | <div>åºæ¬ä¿¡æ¯</div> |
| | | </div> |
| | | <!-- <div class="tips-btn"> |
| | | <span><i class="el-icon-edit" />æä½ï¼</span> |
| | | <el-button type="text">ç¼è¾</el-button> |
| | | </div> --> |
| | | </div> |
| | | <div class="message"> |
| | | <div class="message-item"><span><i class="el-icon-edit" />è¯éªæ¹æ³ï¼</span></div> |
| | | <div class="message-item"> |
| | | <span><i class="el-icon-edit" />项ç®åç±»ï¼</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span><i class="el-icon-edit" />æ´æ°äººï¼</span></div> |
| | | <div class="message-item"> |
| | | <span><i class="el-icon-edit" />æ´æ°æ¶é´ï¼</span></div> |
| | | </div> |
| | | </div> |
| | | <div class="card-main sample-list"> |
| | | <div class="tips-main"> |
| | | <div class="tips"> |
| | | <span /> |
| | | <div>æ ·åç¸å
³</div> |
| | | </div> |
| | | <div class="tips-btn" :style="{marginBottom: '10px'}"> |
| | | <!-- <span><i class="el-icon-edit" />æä½ï¼</span> --> |
| | | <el-button type="primary" icon="el-icon-download" @click="addSampleVisible = true">æ·»å æ ·å</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table-box"> |
| | | <el-table |
| | | ref="sampleTable" |
| | | :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="sampleTable" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column |
| | | prop="applicationOrdernumber" |
| | | label="ç³è¯·åå·" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="typeofInspection" |
| | | label="æ£éªç±»å" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="objectofInspection" |
| | | label="æ£éªå¯¹è±¡" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="palceofObject" |
| | | label="对象ä½ç½®" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="name" |
| | | label="对象åç§°" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="date" |
| | | label="ç»è®°æ¥æ" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="registrant" |
| | | label="ç»è®°äºº" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="applicationTime" |
| | | label="ç³è¯·æ¶é´" |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | label="æä½" |
| | | min-width="200" |
| | | :fixed="true" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="handleClick(scope.row)">æ¥ç</el-button> |
| | | <el-button type="text" size="small">ä½åº</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- åé¡µå¨ --> |
| | | <div> |
| | | <el-pagination |
| | | :current-page="pageParams.pageNo" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="pageParams.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <el-drawer |
| | | title="æ°å¢æ ·å" |
| | | :visible.sync="addSampleVisible" |
| | | :direction="direction" |
| | | size="50%" |
| | | > |
| | | <div class="demo-drawer__content"> |
| | | <el-form :model="addSampleFrom"> |
| | | <el-form-item> |
| | | <el-button>éæ©ç©æ</el-button> |
| | | </el-form-item> |
| | | <el-row> |
| | | <el-col> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | </el-drawer> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | sampleTable: [], |
| | | pageParams: { |
| | | pageNo: 1, |
| | | pageSize: 1, |
| | | total: 3 |
| | | }, |
| | | addSampleVisible: false, |
| | | direction: 'rtl', |
| | | addSampleFrom: {} |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .forInspectionDetail-main{ |
| | | min-height: calc(100vh - 88px); |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .for-inspction-detail-header{ |
| | | width: 100%; |
| | | background: #fff; |
| | | // height: 42px; |
| | | display: flex; |
| | | border-bottom: 1px solid #f0f2f5; |
| | | padding: 8px 24px 12px 24px; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | .header-left{ |
| | | font-size: 20px; |
| | | color: #303133; |
| | | } |
| | | .header-right{ |
| | | .el-form-item{ |
| | | margin-bottom: 0px !important; |
| | | } |
| | | .rightBtn { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | } |
| | | } |
| | | .content-main{ |
| | | display: flex; |
| | | flex: 1; |
| | | flex-direction: column; |
| | | .sample-list{ |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .table-box{ |
| | | padding: 20px; |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .el-table{ |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | ::v-deep .el-table__body-wrapper{ |
| | | flex: 1 !important; |
| | | } |
| | | } |
| | | >div:nth-child(2){ |
| | | display: flex; |
| | | justify-content: end; |
| | | margin: 10px 0; |
| | | } |
| | | } |
| | | } |
| | | .card-main{ |
| | | background: #fff; |
| | | // padding: 10px 20px 10px 20px; |
| | | margin: 0; |
| | | margin-bottom: 12px; |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | .tips-main{ |
| | | // margin: ; |
| | | padding: 10px 20px 0px 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 50px; |
| | | // height: ; |
| | | &:hover{ |
| | | background: #85bff810; |
| | | .tips-btn{ |
| | | display: block; |
| | | left: 0; |
| | | opacity:1; |
| | | } |
| | | } |
| | | .tips-btn{ |
| | | height: 100%; |
| | | // display: none; |
| | | position: relative; |
| | | opacity:0; |
| | | left: 100px; |
| | | transition: all 0.3s ease-in-out; |
| | | } |
| | | .tips{ |
| | | height: 100%; |
| | | display: flex; |
| | | height: 24px; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | // margin-bottom: 12px; |
| | | >span{ |
| | | display: inline-block; |
| | | margin-right: 10px; |
| | | width: 4px; |
| | | height: 16px; |
| | | background: #0077DB; |
| | | } |
| | | >div{ |
| | | height: 100%; |
| | | line-height: 26px; |
| | | } |
| | | .el-button{ |
| | | padding: 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // åºæ¬ä¿¡æ¯åä¼ä¸ä¿¡æ¯çæ¯ä¸ä¸ªä¿¡æ¯é¡¹æ ·å¼ |
| | | .message{ |
| | | padding: 0px 20px 10px 20px; |
| | | |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | border-top: 1px solid #F2F6FC; |
| | | // border-top: 1px solid #F2F6FC; |
| | | >div{ |
| | | flex: 50%; |
| | | max-width: 50%; |
| | | padding: 8px; |
| | | color: #606266; |
| | | align-items: center; |
| | | // height: 65px; |
| | | font-size: 12px; |
| | | height: 52px; |
| | | display: flex; |
| | | align-items: center; |
| | | >span{ |
| | | color: #303133; |
| | | font-size: 16px; |
| | | // |
| | | >i{ |
| | | margin-right: 8px; |
| | | } |
| | | } |
| | | } |
| | | // >div:nth-child(5){ |
| | | // flex: 60%; |
| | | // max-width: 60%; |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .demo-drawer__content{ |
| | | padding: 20px; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <template v-if="!showDetail"> |
| | | <div class="content-main"> |
| | | <div class="top-bar"> |
| | | <el-form ref="form" inline="true" :model="searchData"> |
| | | <el-form ref="form" :inline="true" :model="searchData"> |
| | | <el-form-item> |
| | | <el-input |
| | | v-model="searchData.keyword" |
| | |
| | | <el-button type="primary" icon="el-icon-download" plain>è·åERPæ°æ®</el-button> |
| | | </el-form-item> |
| | | <el-form-item class="createBtn"> |
| | | <el-button type="primary" icon="el-icon-plus">æ°å¢æ£éªå</el-button> |
| | | <el-button type="primary" icon="el-icon-plus" @click="checkTypeVisible = true">æ°å¢æ£éªå</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | <el-table-column |
| | | label="æä½" |
| | | min-width="200" |
| | | :fixed="true" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="handleClick(scope.row)">æ¥ç</el-button> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="checkType"> |
| | | <el-dialog |
| | | title="æ°å¢æ£éªå" |
| | | :visible.sync="checkTypeVisible" |
| | | width="40%" |
| | | > |
| | | <div class="check-box"> |
| | | <el-radio-group v-model="type"> |
| | | <el-radio :label="0" border>åæææ£éª</el-radio> |
| | | <el-radio :label="1" border>åæåæ£éª</el-radio> |
| | | <el-radio :label="2" border>æåæ£éª</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="checkTypeVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="goToForInspectionDetail">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <router-view /> |
| | | </template> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | showDetail: false, |
| | | searchData: { |
| | | keyword: '' |
| | | }, |
| | |
| | | date: '2022-09-23', |
| | | registrant: '管çå', |
| | | applicationTime: '111' |
| | | }, |
| | | { |
| | | applicationOrdernumber: 'QC22-09155', |
| | | typeofInspection: 'éè´å
¥åº', |
| | | objectofInspection: 'MI202207032-1', |
| | | palceofObject: '---', |
| | | name: 'è¿æ¯ä¸æ¡æµè¯æ°æ®', |
| | | date: '2022-09-23', |
| | | registrant: '管çå', |
| | | applicationTime: '111' |
| | | }, |
| | | { |
| | | applicationOrdernumber: 'QC22-09155', |
| | | typeofInspection: 'éè´å
¥åº', |
| | | objectofInspection: 'MI202207032-1', |
| | | palceofObject: '---', |
| | | name: 'è¿æ¯ä¸æ¡æµè¯æ°æ®', |
| | | date: '2022-09-23', |
| | | registrant: '管çå', |
| | | applicationTime: '111' |
| | | }, |
| | | { |
| | | applicationOrdernumber: 'QC22-09155', |
| | | typeofInspection: 'éè´å
¥åº', |
| | | objectofInspection: 'MI202207032-1', |
| | | palceofObject: '---', |
| | | name: 'è¿æ¯ä¸æ¡æµè¯æ°æ®', |
| | | date: '2022-09-23', |
| | | registrant: '管çå', |
| | | applicationTime: '111' |
| | | }, |
| | | { |
| | | applicationOrdernumber: 'QC22-09155', |
| | | typeofInspection: 'éè´å
¥åº', |
| | | objectofInspection: 'MI202207032-1', |
| | | palceofObject: '---', |
| | | name: 'è¿æ¯ä¸æ¡æµè¯æ°æ®', |
| | | date: '2022-09-23', |
| | | registrant: '管çå', |
| | | applicationTime: '111' |
| | | }, |
| | | { |
| | | applicationOrdernumber: 'QC22-09155', |
| | | typeofInspection: 'éè´å
¥åº', |
| | | objectofInspection: 'MI202207032-1', |
| | | palceofObject: '---', |
| | | name: 'è¿æ¯ä¸æ¡æµè¯æ°æ®', |
| | | date: '2022-09-23', |
| | | registrant: '管çå', |
| | | applicationTime: '111' |
| | | } |
| | | ], |
| | | }], |
| | | currentPage: 1, |
| | | total: 20, // æ»æ¡æ° |
| | | pageSize: 100, // æ¯é¡µçæ°æ®æ¡æ° |
| | | radioValue: 'å
¨é¨' |
| | | radioValue: 'å
¨é¨', |
| | | checkTypeVisible: false, |
| | | type: 0 |
| | | } |
| | | }, |
| | | watch: { |
| | | $route: { |
| | | handler(val, oldval) { |
| | | console.log(val)// æ°è·¯ç±ä¿¡æ¯ |
| | | console.log(oldval)// èè·¯ç±ä¿¡æ¯ |
| | | }, |
| | | // 深度è§å¯çå¬ |
| | | deep: true |
| | | } |
| | | }, |
| | | // beforeRouteEnter(to, from, next) { |
| | | // console.log(to, from) |
| | | // next() |
| | | // // 卿¸²æè¯¥ç»ä»¶ç对åºè·¯ç±è¢« confirm åè°ç¨ |
| | | // // ä¸ï¼è½ï¼è·åç»ä»¶å®ä¾ `this` |
| | | // // å 为å½é©åæ§è¡åï¼ç»ä»¶å®ä¾è¿æ²¡è¢«å建 |
| | | // }, |
| | | // beforeRouteUpdate(to, from, next) { |
| | | // console.log(to, from) |
| | | // if (to.name === 'ForInspectionDetail') this.showDetail = true |
| | | // this.$nextTick(() => { |
| | | // console.log(1) |
| | | // this.showDetail = true |
| | | // }) |
| | | // next() |
| | | // // å¨å½åè·¯ç±æ¹åï¼ä½æ¯è¯¥ç»ä»¶è¢«å¤ç¨æ¶è°ç¨ |
| | | // // 䏾便¥è¯´ï¼å¯¹äºä¸ä¸ªå¸¦æå¨æåæ°çè·¯å¾ /foo/:idï¼å¨ /foo/1 å /foo/2 ä¹é´è·³è½¬çæ¶åï¼ |
| | | // // ç±äºä¼æ¸²æåæ ·ç Foo ç»ä»¶ï¼å æ¤ç»ä»¶å®ä¾ä¼è¢«å¤ç¨ãèè¿ä¸ªé©åå°±ä¼å¨è¿ä¸ªæ
åµä¸è¢«è°ç¨ã |
| | | // // å¯ä»¥è®¿é®ç»ä»¶å®ä¾ `this` |
| | | // }, |
| | | updated() { |
| | | if (this.$route.name === 'ForInspectionDetail') this.showDetail = true |
| | | }, |
| | | methods: { |
| | | goToForInspectionDetail() { |
| | | this.$router.push('/rawMaterials/reportForInspection/forInspectionDetail') |
| | | }, |
| | | handleClick(row) { |
| | | console.log(row) |
| | | }, |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .checkType{ |
| | | .check-box{ |
| | | .el-radio-group{ |
| | | display: flex; |
| | | justify-content: space-around; |
| | | .el-radio{ |
| | | // display: flex; |
| | | // align-items: center; |
| | | &.is-checked{ |
| | | background: #ecf5ff; |
| | | border-color: #b3d8ff; |
| | | ::v-deep .el-radio__label{ |
| | | color: #333 !important; |
| | | |
| | | } |
| | | } |
| | | height: auto; |
| | | font-size: 22px !important; |
| | | padding: 20px 40px !important; |
| | | ::v-deep .el-radio__label{ |
| | | font-size: 22px !important; |
| | | padding-left: 0px !important; |
| | | } |
| | | ::v-deep .el-radio__input{ |
| | | display: none !important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .content-main{ |
| | | width: 100%; |
| | | height: 100%; |