Commit 95e97142 authored by 李志鸣's avatar 李志鸣

fea(报工点查询): 静态开发

parent 839eaa54
......@@ -14,10 +14,10 @@ module.exports = {
proxyTable: {
'/host': {
// target: 'http://10.100.172.150:9108', // 设置你调用的接口域名和端口号 别忘了加http
// target: 'http://192.168.43.244:8888', // 东伟服务器地址
target: 'http://10.100.172.223:8082', // 东伟服务器地址
// target: 'http://192.168.43.153:8080', // 训浩服务器
// target: 'http://10.100.172.23:8082', // 本地服务器
target: 'http://10.100.172.30:8082', // 本地服务器http://10.100.172.30:8082/
// target: 'http://10.100.172.30:8082', // 本地服务器
changeOrigin: true,
pathRewrite: {
'^/host': ''//这里理解成用‘/host’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
......
......@@ -583,7 +583,7 @@
},
"async-validator": {
"version": "1.8.5",
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz",
"resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz?cache=0&sync_timestamp=1575620590760&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync-validator%2Fdownload%2Fasync-validator-1.8.5.tgz",
"integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
"requires": {
"babel-runtime": "6.x"
......@@ -3345,7 +3345,7 @@
},
"deepmerge": {
"version": "1.5.2",
"resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz",
"resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz?cache=0&sync_timestamp=1572279720382&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdeepmerge%2Fdownload%2Fdeepmerge-1.5.2.tgz",
"integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M="
},
"define-properties": {
......@@ -3734,9 +3734,9 @@
"dev": true
},
"element-ui": {
"version": "2.8.2",
"resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.8.2.tgz",
"integrity": "sha1-Iaeky5Jhaw+LddTU5jfToc2MCd4=",
"version": "2.13.0",
"resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.13.0.tgz",
"integrity": "sha1-9rsE5bCnbqX2JGYES3dEB7pOvS0=",
"requires": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
......
......@@ -19,7 +19,7 @@
"connect": "^3.6.6",
"echarts": "^4.6.0",
"el-tree-select": "^2.0.7",
"element-ui": "^2.8.0",
"element-ui": "^2.13.0",
"font-awesome": "^4.7.0",
"js-cookie": "^2.2.0",
"jspdf": "^1.5.3",
......
......@@ -287,10 +287,6 @@
"url": "/api/v1/group",
"method": "put"
},
"page-post": {
"url": "/api/v1/group/page",
"method": "post"
},
"role-post": {
"url": "/api/v1/group/role",
"method": "post"
......@@ -307,10 +303,6 @@
"url": "/api/v1/group/tree/user",
"method": "get"
},
"groupId-get": {
"url": "/api/v1/group/{groupId}",
"method": "get"
},
"groupId-delete": {
"url": "/api/v1/group/{groupId}",
"method": "delete"
......@@ -437,14 +429,6 @@
"url": "/api/v1/user/group/users",
"method": "get"
},
"id-get": {
"url": "/api/v1/user/id/{id}",
"method": "get"
},
"userId-delete": {
"url": "/api/v1/user/id/{userId}",
"method": "delete"
},
"no-get": {
"url": "/api/v1/user/no/{no}",
"method": "get"
......@@ -453,10 +437,6 @@
"url": "/api/v1/user/page",
"method": "get"
},
"page-post": {
"url": "/api/v1/user/page",
"method": "post"
},
"list-get": {
"url": "/api/v1/user/resource/list",
"method": "get"
......@@ -657,14 +637,6 @@
"url": "/api/v2/workStation/delete/{id}",
"method": "delete"
},
"eqpRelation-post": {
"url": "/api/v2/workStation/eqpRelation",
"method": "post"
},
"eqpRelation-put": {
"url": "/api/v2/workStation/eqpRelation",
"method": "put"
},
"workPositionId-post": {
"url": "/api/v2/workStation/equipmentRelation/{workPositionId}",
"method": "post"
......@@ -689,10 +661,6 @@
"url": "/api/v2/workStation/pageEqpRelation",
"method": "get"
},
"pageEquip-post": {
"url": "/api/v2/workStation/pageEquip",
"method": "post"
},
"username-get": {
"url": "/api/v2/workStation/pdaUser/{username}",
"method": "get"
......@@ -812,6 +780,20 @@
"method": "post"
}
},
"station-pass-info-controller": {
"findPassInfoByNoFind-post": {
"url": "/pass/findPassInfoByNoFind",
"method": "post"
},
"findPassInfoBySearchCode-post": {
"url": "/pass/findPassInfoBySearchCode",
"method": "post"
},
"stationName-get": {
"url": "/pass/getStationNo/{stationName}",
"method": "get"
}
},
"report-jdbc-controller": {
"ping-put": {
"url": "/report/jdbc/ping",
......
......@@ -33,6 +33,8 @@ export default {
ElectrophoresisTank: '电泳槽液日常检测报告',
Pretreatment: '前处理槽液日常检测报告',
TrendchartOfTankParameters: '槽液参数趋势图',
// 报工点查询
DutyStationIndex: '报工点查询',
// 烘干室温度
DryingRoomChart: '烘干室温度',
DryingRoomChartIndex: '烘干室温度',
......
......@@ -10,6 +10,7 @@ import './styles/index.scss' // global css
import App from './App'
import router from './router'
import store from './store';
import service from './utils/service';
import i18n from './lang' // Internationalization
import './assets/icons' // icon
......@@ -27,6 +28,7 @@ import 'swiper/dist/css/swiper.css' //引入样式
import htmlToPdf from '@/components/htmlToPdf/htmlToPdf.js'
Vue.prototype._ = lodash;
Vue.prototype.formValidator = formValidator;
Vue.prototype.$service = service;
Vue.config.productionTip = false
Vue.prototype.Authority = Authority;
Vue.use(ElementUI, {
......
......@@ -21,6 +21,8 @@ import deviceRunningTimeRouter from './modules/deviceRunning'
import basicRouter from './modules/basic'
// 化验室报告
import laboratoryRouter from './modules/laboratory'
// 报工点查询
import dutyStationRouter from './modules/dutyStation'
// 烘干室温度
import dryingRoomChartRouter from './modules/dryingRoomChart'
// 涂装生产计划
......@@ -164,6 +166,7 @@ export const asyncRouterMap = [
deviceRunningTimeRouter,
basicRouter,
laboratoryRouter,
dutyStationRouter,
dryingRoomChartRouter,
productionPlanRouter,
monitorRouter,
......
/**
* 报工点查询
*/
export default {
path: '/dutyStation',
component: () => import('@/views/Layout'),
redirect: '/dutyStation/index',
meta: { title: 'Laboratory', icon: 'deal' },
children: [
{
path: 'index',
component: () => import('@/views/DutyStation/list'),
name: 'DutyStationIndex',
meta: { title: 'DutyStationIndex', icon: 'template', noCache: false }
}
]
}
/*
* 参考资料:
* 1.不同服务上面接口,如何调用该方法使用,添加多个服务器接口?
* 2.修改同一时间报出多个错误,如何使用防抖和节流去解决 ?
* 封装请求 :https://www.jianshu.com/p/6e7d92d052c0
* */
import request from './request'
import { Message } from 'element-ui'
import throttle from 'lodash/throttle'
const placeholder = /{(\w+)}?/ig // 占位符
const baseURL = process.env.API_HOST
/**
*
* @param method
* @param api api
* @param params 参数地址
* @param showMes callback() 自定义错误提示信息
* @returns {Promise<AxiosResponse<any>>}
*/
function service (method, api, params = {}, showMes) {
// 判断是否是通过{xxx}进行传递,进行修改最终路径
// const urlPath = placeholder.test(api) ? buildPath(api, params) : api
const urlPath = buildPath(api, params)
return request({
url: api.indexOf('http') > -1 ? api : `${baseURL}${urlPath}`,
method: method,
data: switchData(api, params)
}).then((res) => {
if (res.code === 600) {
return res.data
} else {
// 是否回调函数,可以取消错误提醒
showMes ? showMes() : errorMessage(res.message)
return Promise.reject(res)
}
}).catch((error) => {
return Promise.reject(error)
})
}
/**
* 如何使用防抖处理多次弹窗提醒
* @param message
*/
const errorMessage = throttle((message) => {
Message.error(message)
}, 2000)
/**
* 是否传递数据,如果数据通过api传递,这里传递null
* @param api
* @param params
* @returns {null|*}
*/
function switchData (api, params) {
placeholder.lastIndex = 0
if (placeholder.test(api)) return null
return params
}
/**
* 解析类似 /api/page/2这样动态参数的问题,用正则去匹配我们的占位符,把真实数据放进去
* 将api处理成正常请求的格式
* @param api
* @param params
* @returns {*}
*/
function buildPath (api, params) {
placeholder.lastIndex = 0
if (!placeholder.test(api)) return api
return api.replace(placeholder, function ($1, $2) {
return encodeURIComponent(params[$2])
})
}
export default service
......@@ -139,6 +139,7 @@
},
// 当前分页页数发生了变化
onCurrentChange (currentPage) {
console.log('g12123')
this.tableConfig.paginationConfig.currentPage = currentPage
// 获取表格数据
this.getTableList()
......
......@@ -136,6 +136,7 @@
},
// 当前分页页数发生了变化
onCurrentChange (currentPage) {
console.log(123123)
this.tableConfig.paginationConfig.currentPage = currentPage
// 获取表格数据
this.getTableList()
......
<template>
<div class="page-pack">
<div class="title-pack clear-float pl-15 pr-15">
<div class="float-left">
<span class="page-title-text">报工点查询</span>
</div>
<div class="float-right page-refresh">
<span @click="doRefreshClick" class="pointer">
<svg-icon icon-class="refresh"></svg-icon>
<span class="ml-10">刷新</span>
</span>
</div>
</div>
<div class="tool-pack clear-float pl-15 pr-15">
<Search
searchCode="PASS_INFO"
@search="doSearchClick"
@reset="doResetClick">
</Search>
<div class="float-left">
<el-button
type="primary"
size="small">
报工点补扫
</el-button>
<el-button
type="primary"
size="small">
开启自动补扫
</el-button>
<el-button
type="primary"
size="small">
关闭自动补扫
</el-button>
</div>
</div>
<div class="general-list-main-pack pl-15 pr-15 pb-15">
<div>
<Table
:tableConfig="tableConfig"
@onPageSizeChange="onPageSizeChange"
@onCurrentPageChange="onCurrentPageChange">
<template slot="createTime">
<el-table-column
label="过站时间"
prop="createTime"
show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.createTime === '' || scope.row.createTime === null || scope.row.createTime === undefined">暂无</span>
<span v-else>{{ formatTime(scope.row.createTime, 'YYYY-MM-DD HH:mm:ss') }}</span>
</template>
</el-table-column>
</template>
</Table>
</div>
</div>
</div>
</template>
<script>
import Moment from 'moment';
import Table from '@/components/Table/index.vue';
import Search from '@/components/Search';
export default {
components: {
Search,
Table
},
data () {
return {
// 精准搜索关键字列表
searchList: {},
// 表格配置项
tableConfig: {
height: 0,
data: [],
fieldList: [
{ label: '工单号', value: 'vin' },
{ label: '报工点', value: 'stationName' },
{ label: '工位编码', value: 'stationNo' },
{ label: '过站时间', value: 'createTime', slot: 'createTime' },
{ label: '操作人', value: 'createBy' }
],
paginationToggle: true,
paginationConfig: {
total: 0,
currentPage: 1,
pageSize: 20
}
}
}
},
methods: {
// 日期时间格式化
formatTime (time, format) {
if (time !== null && time !== '') {
return Moment(time).format(format)
} else {
return '暂无'
}
},
// 点击刷新按钮
doRefreshClick () {},
// 点击搜索按钮
doSearchClick () {},
// 点击重置按钮
doResetClick () {},
// 触发表格分页数量改变事件
onPageSizeChange (pageSize) {
this.tableConfig.paginationConfig.currentPage = 1;
this.tableConfig.paginationConfig.pageSize = pageSize;
// 获取报工点记录
this.getDutyStationResult();
},
// 触发表格分页页数事件
onCurrentPageChange (currentPage) {
this.tableConfig.paginationConfig.currentPage = currentPage;
// 获取报工点记录
this.getDutyStationResult();
},
// 获取报工点记录
async getDutyStationResult () {
try {
let params = {
searchCode: this.searchList.searchCode || 'PASS_INFO',
filters: this.searchList.filters || [],
pageSize: this.tableConfig.paginationConfig.pageSize,
pageNum: this.tableConfig.paginationConfig.currentPage
};
let response = await this.$service('POST', '/pass/findPassInfoBySearchCode', params);
this.tableConfig.data = _.cloneDeep(response.list);
this.tableConfig.paginationConfig.total = _.cloneDeep(response.total);
} catch (error) {
throw error;
}
}
},
mounted () {
setTimeout(() => {
this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 210;
// 获取报工点记录
this.getDutyStationResult();
}, 0);
}
}
</script>
<style lang="scss" scoped>
.page-pack {
position: relative;
min-height: 100%;
width: 100%;
border: 1px solid #d2d3d5;
background-color: #fff;
overflow-y: auto;
.title-pack {
height: 38px;
line-height: 38px;
border-bottom: 1px solid #d2d3d5;
}
.tool-pack {
padding-top: 16px;
padding-bottom: 16px;
.tool-tag {
height: 32px;
line-height: 32px;
font-size: 14px;
}
}
.edit-button {
color: #538FFD;
}
.status-circle {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 6px;
margin-right: 5px;
vertical-align: middle;
}
.delete-button {
color: #F47476;
}
.view-span {
color: #1284fa;
border-bottom: 1px solid #1284fa;
&:hover {
cursor: pointer;
}
}
.el-dialog__body {
padding: 30px 30px 10px 20px!important;
.el-row {
.el-col {
line-height: 35px;
.el-form-item {
width: 100%;
.el-form-item__content {
width: 100%;
.el-input {
font-size: 12px;
height: 32px;
}
.el-input__inner {
height: 32px;
}
.el-select {
width: 100%!important;
font-size: 12px;
height: 32px;
}
.el-date-editor {
width: 100%!important;
}
}
}
}
}
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment