Commit 58967e36 by cwq0219

物料管理,物料列表,物料订单管理,作业单管理,导入,pdf查看

1 parent 96a286c1
import request from './request'
const path = 'fims.device.'
function getListApi(data) {
data.method = `${path}list`
return request(data)
}
function editApi (data) {
data.method = `${path}edit`
return request(data)
}
function removeApi (data) {
data.method = `${path}remove`
return request(data)
}
function importApi (data) {
data.method = `${path}import`
return request(data)
}
function exportApi (data) {
data.method = `${path}export`
return request(data)
}
export {
getListApi,
editApi,
removeApi,
importApi,
exportApi
}
\ No newline at end of file \ No newline at end of file
import request from './request'
const path = 'fims.maintain.'
function getListApi (data) {
data.method = `${path}search`
return request(data)
}
function removeApi (data) {
data.method = `${path}delete`
return request(data)
}
function exportApi (data) {
data.method = `${path}export`
return request(data)
}
export {
getListApi,
removeApi,
exportApi
}
\ No newline at end of file \ No newline at end of file
import request from './request'
const path = 'fims.order.'
function getListApi(data) {
data.method = `${path}search`
return request(data)
}
function detailApi (data) {
data.method = `${path}detail`
return request(data)
}
function removeApi (data) {
data.method = `${path}delete`
return request(data)
}
function downloadApi (data) {
data.method = `${path}download`
return request(data)
}
export {
getListApi,
detailApi,
removeApi,
downloadApi
}
\ No newline at end of file \ No newline at end of file
import request from './request'
const path = 'fims.material.'
function getListApi (data) {
data.method = `${path}list`
return request(data)
}
export {
getListApi
}
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,6 @@ import router from './router' ...@@ -13,7 +13,6 @@ import router from './router'
// import menuHeader from '@/menu/header' // import menuHeader from '@/menu/header'
// import menuAside from '@/menu/aside' // import menuAside from '@/menu/aside'
// import { frameInRoutes } from '@/router/routes' // import { frameInRoutes } from '@/router/routes'
import echarts from 'echarts'
import VRM from 'vue-role-manager' import VRM from 'vue-role-manager'
Vue.use(VRM, { Vue.use(VRM, {
...@@ -24,7 +23,6 @@ Vue.use(VRM, { ...@@ -24,7 +23,6 @@ Vue.use(VRM, {
// 核心插件 // 核心插件
Vue.use(d2Admin) Vue.use(d2Admin)
Vue.use(D2Crud) Vue.use(D2Crud)
Vue.prototype.$echarts = echarts
new Vue({ new Vue({
router, router,
store, store,
......
...@@ -152,51 +152,63 @@ export const resources = { ...@@ -152,51 +152,63 @@ export const resources = {
component: _import('subSysManagement') component: _import('subSysManagement')
}, },
'104': { '104': {
path: 'trafficManagement', path: 'deviceManagement',
icon: 'folder-o', icon: 'folder-o',
name: '车辆管理', name: '物料管理',
meta: { meta: {
auth: true, auth: true,
title: '车辆管理', title: '物料管理',
id: '104', id: '104',
pid: '0' pid: '0'
}, },
component: _import('trafficManagement') component: _import('deviceManagement')
}, },
'105': { '105': {
path: 'materialList',
icon: 'folder-o',
name: '物料列表',
meta: {
auth: true,
title: '物料列表',
id: '105',
pid: '0'
},
component: _import('materialList')
},
'106': {
path: 'bb', path: 'bb',
icon: 'folder-o', icon: 'folder-o',
name: '单据管理', name: '单据管理',
meta: { meta: {
auth: true, auth: true,
title: '单据管理', title: '单据管理',
id: '105', id: '106',
pid: '0' pid: '0'
} }
}, },
'10501': { '10601': {
path: '/cc', path: '/materiaOrderManagement',
icon: 'folder-o', icon: 'folder-o',
name: '物料订单管理', name: '物料订单管理',
meta: { meta: {
auth: true, auth: true,
title: '物料订单管理', title: '物料订单管理',
id: '10501', id: '10601',
pid: '105' pid: '106'
}, },
component: _import('trafficManagement') component: _import('materiaOrderManagement')
}, },
'10502': { '10602': {
path: '/dd', path: '/maintainManagement',
icon: 'folder-o', icon: 'folder-o',
name: '作业单管理', name: '作业单管理',
meta: { meta: {
auth: true, auth: true,
title: '作业单管理', title: '作业单管理',
id: '10502', id: '10602',
pid: '105' pid: '106'
}, },
component: _import('trafficManagement') component: _import('maintainManagement')
}, },
'107': { '107': {
path: 'user', path: 'user',
......
<!-- 编辑物料弹窗 -->
<template>
<div>
<el-dialog
title="编辑物料"
:visible.sync="isVisible"
:before-close="handleClose"
>
<el-form
:model="editForm"
:rules="rules"
ref="editRuleForm"
label-width="100px"
>
<el-form-item
label="物料代码"
prop="deviceNum">
<el-input
:disabled="disabled" v-model="editForm.deviceNum" placeholder="请输入物料代码" clearable
></el-input>
</el-form-item>
<el-form-item
label="物料编码"
prop="deviceCode">
<el-input
:disabled="disabled" v-model="editForm.deviceCode" placeholder="请输入物料编码" clearable
></el-input>
</el-form-item>
<el-form-item
label="CRC物料号"
prop="crcCode">
<el-input
:disabled="disabled" v-model="editForm.crcCode" placeholder="请输入CRC物料号" clearable
></el-input>
</el-form-item>
<el-form-item
label="图号"
prop="drawNum">
<el-input
:disabled="disabled" v-model="editForm.drawNum" placeholder="请输入图号" clearable
></el-input>
</el-form-item>
<el-form-item
label="物料名称"
prop="deviceName">
<el-input
:disabled="disabled" v-model="editForm.deviceName" placeholder="请输入物料名称" clearable
></el-input>
</el-form-item>
<el-form-item
label="规格"
prop="specifications">
<el-input
:disabled="disabled" v-model="editForm.specifications" placeholder="请输入规格" clearable
></el-input>
</el-form-item>
<el-form-item label="所在地" prop="stationName">
<el-select v-model="editForm.stationName" placeholder="请选择所在地" clearable filterable>
<el-option label="仓库" value="1"></el-option>
<el-option label="广州站" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="库存数量"
prop="stockCount">
<el-input
:disabled="disabled" v-model="editForm.stockCount" placeholder="请输入库存数量" clearable
></el-input>
</el-form-item>
<el-form-item
label="责任人"
prop="responsible">
<el-input
:disabled="disabled" v-model="editForm.responsible" placeholder="请输入责任人" clearable
></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="handleConfirm"
>保存</el-button>
<el-button
@click="handleClose"
>取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'EditDialog',
data () {
return {
disabled: false,
rules: {
deviceNum: [
{ required: true, message: '请输入物料代码', trigger: 'blur' }
],
deviceCode: [
{ required: true, message: '请输入物料编码', trigger: 'blur' }
],
crcCode: [
{ required: true, message: '请输入CRC物料号', trigger: 'blur' }
],
drawNum: [
{ required: true, message: '请输入图号', trigger: 'blur' }
],
deviceName: [
{ required: true, message: '请输入物料名称', trigger: 'blur' }
],
specifications: [
{ required: true, message: '请输入规格', trigger: 'blur' }
],
stationName: [
{ required: true, message: '请选择所在地', trigger: 'change' }
],
stockCount: [
{ required: true, message: '请输入库存数量', trigger: 'blur' }
],
responsible: [
{ required: true, message: '请输入责任人', trigger: 'blur' }
]
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
editForm: Object
},
watch: {
isVisible (val) {
// this.disabled = this.editForm.trafficCode ? true : false
this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
}
},
mounted() {},
methods: {
handleClose () {
this.$emit('closeDialog')
},
handleConfirm () {
this.$refs.editRuleForm.validate((vaild) => {
if (vaild) {
this.$emit('confirmDialog')
}
})
}
}
}
</script>
<style scoped>
</style>
<!-- 物料管理 -->
<template>
<d2-container>
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
>
<el-form-item label="物料">
<el-input v-model="searchForm.keyWord" placeholder="请输入物料代码/编码/名称" clearable></el-input>
</el-form-item>
<el-form-item label="所在地">
<el-select v-model="searchForm.stationCode" placeholder="请选择所在地" clearable filterable>
<el-option value="1" label="仓库"></el-option>
<el-option value="2" label="广州站"></el-option>
</el-select>
</el-form-item>
<el-form-item label="责任人">
<el-select v-model="searchForm.responsible" placeholder="请选择责任人" clearable filterable>
<el-option value="1" label="张三"></el-option>
<el-option value="2" label="李四"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
<el-col :span="12">物料列表</el-col>
<el-col :span="12" style="text-align: right">
<el-button class="import-button" style="">导入
<input
type="file"
class="import-input"
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)" />
</el-button>
<el-button>导出</el-button>
</el-col>
</el-row>
<el-table
:data="tableData"
v-loading="tableLoading"
border
style="margin: 20px 0;"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
<!-- <template slot-scope="scope">
<template v-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template> -->
</el-table-column>
<el-table-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
@click="handleEdit(scope.row, scope.$index)"
>编辑</el-button>
<el-button
type="text"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
<edit-dialog
:isVisible="editVisible"
:editForm="editForm"
@closeDialog="handleEditClose"
@confirmDialog="handleEditConfirm"
></edit-dialog>
</d2-container>
</template>
<script>
import EditDialog from './editDialog'
import { getListApi, editApi, removeApi, importApi, exportApi } from '@api/deviceManagement'
import notice from '@/common/notice'
export default {
name: 'deviceManagement',
components: {
EditDialog
},
data() {
return {
// 编辑弹窗
editVisible: false,
editForm: {
id: '',
deviceNum: '',
deviceCode: '',
crcCode: '',
drawNum: '',
deviceName: '',
specifications: '',
stationCode: '',
stationName: '',
stockCount: '',
responsible: ''
},
// 搜索
searchForm: {
keyWord: '',
stationCode: '',
responsible: ''
},
// 表格
tableLoading: false,
tableData: [],
tableColumns: [{
label: '物料代码',
prop: 'deviceNum'
}, {
label: '物料编码',
prop: 'deviceCode'
}, {
label: 'CRC物料号',
prop: 'crcCode'
}, {
label: '图号',
prop: 'drawNum'
}, {
label: '物料名称',
prop: 'deviceName'
}, {
label: '规格',
prop: 'specifications'
}, {
label: '所在地',
prop: 'stationName'
}, {
label: '库存',
prop: 'stockCount'
}, {
label: '责任人',
prop: 'responsible'
}],
// 页码
currentPage: 1,
pageSize: 10,
total: 30
}
},
mounted() {
this.loadingGetList()
},
methods: {
loadingGetList () {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
getList () {
const params = this.getParams()
getListApi(params).then(res => {
this.tableData = res
this.tableLoading = false
}).catch(err => {
notice.errorTips(err)
this.tableLoading = false
})
},
editDevice(params) {
editApi(params).then(res => {
// console.log(res)
this.handleEditClose()
notice.okTips()
this.loadingGetList()
}).catch(err => {
notice.errorTips()
})
},
// 导入
importFile(e) {
const params = {
file: e.target.files[0]
}
console.log(params)
importApi(params).then(res => {
notice.okTips()
}).catch(err => {
notice.errorTips()
})
},
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
// console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
// console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleEditClose () {
this.editVisible = !this.editVisible
},
handleEditConfirm () {
// console.log(JSON.parse(JSON.stringify(this.editForm)))
var editParams = JSON.parse(JSON.stringify(this.editForm))
this.editDevice(editParams)
},
// 表格-编辑
handleEdit (row, index = -1) {
// console.log(index)
// console.log(row)
console.log(row)
this.editForm = JSON.parse(JSON.stringify(row))
this.editVisible = !this.editVisible
},
handleDelete (index, row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(index)
console.log(row)
this.$message({
type: 'success',
message: '删除成功'
})
}).catch(err => {})
}
}
}
</script>
<style scoped>
.import-button {
width: 70px;
height: 40px;
overflow: hidden;
position: relative;
cursor: pointer;
}
.import-input {
opacity: 0;
position: absolute;
left: 0;
top: 0;
width: 70px;
height: 100%;
cursor: pointer;
font-size:0
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 作业单管理 -->
<template>
<d2-container>
<el-form
:inline="true"
:model="searchForm"
label-width="100px"
>
<el-form-item
v-for="(item, index) in searchFormArr"
:key="index"
:label="item.label"
>
<el-input
v-if="item.type == 'input'"
v-model="searchForm[item.model]"
:placeholder= "'请输入' + item.label"
clearable>
</el-input>
<el-select
v-else-if="item.type == 'select'"
v-model="searchForm[item.model]"
:placeholder="'请选择' + item.label"
clearable
filterable>
<el-option
v-for="(optionItem, optionIndex) in item.options"
:key="optionIndex"
:label="optionItem.label"
:value="optionItem.value"
></el-option>
</el-select>
<el-date-picker
v-else-if="item.type == 'datePick'"
v-model="searchForm[item.model]"
:placeholder="'请选择' + item.label"
value-format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
<el-col :span="12">作业单列表</el-col>
<el-col :span="12" style="text-align: right">
<el-button @click="exportOrder">导出订单</el-button>
</el-col>
</el-row>
<el-table
:data="tableData"
v-loading="tableLoading"
border
style="margin: 20px 0;"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
<template slot-scope="scope">
<template v-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
</d2-container>
</template>
<script>
import { getListApi, removeApi, exportApi } from '@api/maintainManagement'
import notice from '@/common/notice'
export default {
name: 'maintainManagement',
data() {
return {
// 搜索
searchForm: {
taskCode: '',
taskType: '',
downDeviceNum: '',
userName: '',
createTime: '',
trafficCode: '',
stationName: '',
subsystemTypeCode: ''
},
searchFormArr: [{
label: '订单编号',
type: 'input',
model: 'taskCode'
}, {
label: '创建时间',
type: 'datePick',
model: 'createTime'
}, {
label: '订单类型',
type: 'select',
model: 'taskType',
options: [{
label: '系统',
value: '1'
}, {
label: '人工',
value: '2'
}]
}, {
label: '故障物料代码',
type: 'input',
model: 'downDeviceNum'
}, {
label: '处理人',
type: 'input',
model: 'userName'
}, {
label: '车辆编号',
type: 'input',
model: 'trafficCode'
}, {
label: '车辆站点',
type: 'select',
model: 'stationName',
options: [{
label: '青岛',
value: '1'
}, {
label: '深圳',
value: '2'
}]
}, {
label: '子系统',
type: 'select',
model: 'subsystemTypeCode',
options: [{
label: '3#4F',
value: '1'
}, {
label: '3#5F',
value: '2'
}]
}],
// 表格
tableLoading: false,
tableData: [],
tableColumns: [{
label: '订单编号',
prop: 'taskCode'
}, {
label: '创建时间',
prop: 'createTime'
}, {
label: '类型',
prop: 'taskType'
}, {
label: '车辆编号',
prop: 'trafficCode'
}, {
label: '车辆站点',
prop: 'stationName'
}, {
label: '子系统',
prop: 'subsystemCode'
}, {
label: '子系统类型',
prop: 'subsystemType',
formatter: (cellValue) => {
if(cellValue.subsystemType)
return {
1: '座椅',
2: '电池'
}[cellValue.subsystemType]
}
}, {
label: '故障描述',
prop: 'downDescription'
}, {
label: '处理方式',
prop: 'treatment',
formatter: (cellValue) => {
if(cellValue.treatment) {
return {
1: '现场维修',
2: '更换'
}[cellValue.treatment]
}
}
}, {
label: '故障物料代码',
prop: 'downDeviceNum'
}, {
label: '故障物料编码',
prop: 'downDeviceCode'
}, {
label: '故障物料处理',
prop: 'downDeviceTreatment'
}, {
label: '更换物料物料代码',
prop: 'replaceDeviceNum'
}, {
label: '更换物料物料编码',
prop: 'replaceDeviceCode'
}, {
label: '使用数量',
prop: 'usedCount'
}, {
label: '处理人',
prop: 'userName'
}],
// 页码
currentPage: 1,
pageSize: 10,
total: 30
}
},
mounted() {
this.loadingGetList()
},
methods: {
loadingGetList () {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
getList () {
const params = this.getParams()
getListApi(params).then(res => {
this.tableData = res
this.tableLoading = false
}).catch(err => {
notice.errorTips(err)
this.tableLoading = false
})
},
exportOrder() {
const params = this.getParams()
exportApi(params).then(res => {
notice.okTips()
}).catch(err => {
notice.errorTips()
})
},
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleDelete (index, row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(index)
console.log(row)
this.$message({
type: 'success',
message: '删除成功'
})
}).catch(err => {})
}
}
}
</script>
<style scoped>
</style>
<!-- -->
<template>
<div class="detailDialog">
<el-dialog
:visible.sync="isVisible"
:before-close="handleClose"
>
<!-- <embed src="file:///D:/project需求/高铁/物料申请单_20190830150550.pdf" width="100%" height="800px"></embed> -->
<iframe width="100%" height="800px" scrolling="yes" frameborder="0" src="https://web.stanford.edu/~xgzhou/zhou_book2017.pdf"></iframe>
<!-- <embed width="100%" height="800px" src="https://web.stanford.edu/~xgzhou/zhou_book2017.pdf"> -->
</el-dialog>
</div>
</template>
<script>
export default {
name: 'DetailDialog',
data() {
return {
}
},
props: {
isVisible: {
type: Boolean,
default: false
}
},
mounted() {},
methods: {
handleClose() {
this.$emit('closeDialog')
}
}
}
</script>
<style scoped>
.header-title {
text-align: center;
font-size: 18px;
font-weight: bold;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 物料订单管理 -->
<template>
<d2-container>
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
>
<el-form-item label="订单编号">
<el-input v-model="searchForm.orderCode" placeholder="请输入订单编号" clearable></el-input>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="searchForm.createTime" type="date" placeholder="请选择日期"></el-date-picker>
</el-form-item>
<el-form-item label="订单类型">
<el-select v-model="searchForm.orderType" placeholder="请选择订单类型" clearable filterable>
<el-option label="物料申请" value="1"></el-option>
<el-option label="物料报废" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="申请人">
<el-input v-model="searchForm.userName" placeholder="请输入申请人" clearable></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-select v-model="searchForm.status" placeholder="请选择订单状态" clearable filterable>
<el-option label="审批中" value="1"></el-option>
<el-option label="已驳回" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
<el-col :span="12">订单列表</el-col>
<el-col :span="12" style="text-align: right">
<el-button>订单下载</el-button>
</el-col>
</el-row>
<el-table
:data="tableData"
v-loading="tableLoading"
border
style="margin: 20px 0;"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
<template slot-scope="scope">
<template v-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
@click="handleDetail(scope.row, scope.$index)"
>查看详情</el-button>
<el-button
type="text"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
<detail-dialog
:isVisible="detailVisible"
@closeDialog="handleDetailClose"
></detail-dialog>
</d2-container>
</template>
<script>
import DetailDialog from './detailDialog'
import { getListApi, detailApi, removeApi, downloadApi } from '@api/materiaOrderManagement'
import notice from '@/common/notice'
export default {
name: 'materiaOrderManagement',
components: {
DetailDialog
},
data() {
return {
detailVisible: false,
// 搜索
searchForm: {
orderCode: '',
orderType: '',
status: '',
userName: '',
createTime: ''
},
// 表格
tableLoading: false,
tableData: [],
tableColumns: [{
label: '订单编号',
prop: 'orderCode'
}, {
label: '创建时间',
prop: 'createTime'
}, {
label: '类型',
prop: 'orderType'
}, {
label: '申请人',
prop: 'userName'
}, {
label: '状态',
prop: 'status',
formatter: (cellValue) => {
if (cellValue.status) {
return {
1: '审批中',
2: '已驳回',
3: '待发货',
4: '已完成',
5: '待签收'
}[cellValue.status]
}
}
}],
// 页码
currentPage: 1,
pageSize: 10,
total: 30
}
},
mounted() {
this.loadingGetList()
},
methods: {
loadingGetList () {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
getList () {
const params = this.getParams()
getListApi(params).then(res => {
this.tableData = res
this.tableLoading = false
}).catch(err => {
notice.errorTips(err)
this.tableLoading = false
})
},
editSubSystem(value) {
const params = value
params.method = value.id ? methods.Edit : methods.Add
editApi(params).then(res => {
this.handleEditClose()
notice.okTips()
this.loadingGetList()
}).catch(err => {
notice.errorTips()
})
},
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
},
// resetForm (obj) {
// for (var item in obj) {
// if (obj[item] instanceof Array) {
// obj[item] = []
// } else {
// obj[item] = ''
// }
// }
// },
handleDetailClose () {
this.detailVisible = !this.detailVisible
},
// handleEditConfirm () {
// console.log(JSON.parse(JSON.stringify(this.editForm)))
// var editParams = JSON.parse(JSON.stringify(this.editForm))
// this.editSubSystem(this.editForm)
// },
// 表格-查看详情
handleDetail (row, index = -1) {
this.detailVisible = !this.detailVisible
},
handleDelete (index, row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(index)
console.log(row)
this.$message({
type: 'success',
message: '删除成功'
})
}).catch(err => {})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file \ No newline at end of file
<!-- 物料列表 -->
<template>
<d2-container>
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
>
<el-form-item label="物料">
<el-input v-model="searchForm.keyWord" placeholder="请输入物料代码/编码/名称" clearable></el-input>
</el-form-item>
<el-form-item label="责任人">
<el-select v-model="searchForm.responsible" placeholder="请选择责任人" clearable filterable>
<el-option label="张三" value="1"></el-option>
<el-option label="李四" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
<el-col :span="12">物料列表</el-col>
</el-row>
<el-table
:data="tableData"
v-loading="tableLoading"
border
style="margin: 20px 0;"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
<!-- <template slot-scope="scope">
<template v-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template> -->
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
</d2-container>
</template>
<script>
import { getListApi } from '@api/materialList'
import notice from '@/common/notice'
export default {
name: 'materialList',
data() {
return {
searchForm: {
keyWord: '',
responsible: '',
},
// 表格
tableLoading: false,
tableData: [],
tableColumns: [{
label: '物料代码',
prop: 'deviceNum'
}, {
label: '物料编码',
prop: 'deviceCode'
}, {
label: 'CRC物料号',
prop: 'crcCode'
}, {
label: '图号',
prop: 'drawNum'
}, {
label: '物料名称',
prop: 'deviceName'
}, {
label: '规格',
prop: 'specifications'
}, {
label: '责任人',
prop: 'responsible'
}],
// 页码
currentPage: 1,
pageSize: 10,
total: 30
}
},
mounted() {
this.loadingGetList()
},
methods: {
loadingGetList () {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
getList () {
const params = this.getParams()
getListApi(params).then(res => {
this.tableData = res
this.tableLoading = false
}).catch(err => {
notice.errorTips(err)
this.tableLoading = false
})
},
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleDelete (index, row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(index)
console.log(row)
this.$message({
type: 'success',
message: '删除成功'
})
}).catch(err => {})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file \ No newline at end of file
...@@ -114,9 +114,7 @@ export default { ...@@ -114,9 +114,7 @@ export default {
this.$refs.editRuleForm.resetFields() this.$refs.editRuleForm.resetFields()
} }
}, },
mounted: {},
methods: { methods: {
handleClose () { handleClose () {
this.$emit('closeDialog') this.$emit('closeDialog')
......
...@@ -28,11 +28,12 @@ ...@@ -28,11 +28,12 @@
<el-row style="height: 40px; line-height: 40px"> <el-row style="height: 40px; line-height: 40px">
<el-col :span="12">子系统列表</el-col> <el-col :span="12">子系统列表</el-col>
<el-col :span="12" style="text-align: right"> <el-col :span="12" style="text-align: right">
<el-button @click="handleAdd">添加子系统</el-button> <el-button @click="handleEdit(editFormReset)">添加子系统</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table <el-table
:data="tableData" :data="tableData"
v-loading="tableLoading"
border border
style="margin: 20px 0;" style="margin: 20px 0;"
> >
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@click="handleEdit(scope.$index, scope.row)" @click="handleEdit(scope.row, scope.$index)"
>编辑</el-button> >编辑</el-button>
<el-button <el-button
type="text" type="text"
...@@ -108,6 +109,16 @@ export default { ...@@ -108,6 +109,16 @@ export default {
return { return {
// 新增/编辑弹窗 // 新增/编辑弹窗
editVisible: false, editVisible: false,
editFormReset: {
subsystemCode: '',
systemType: '',
trafficCode: '',
merchantName: '',
sendSequence: '',
sendPort: '',
gatewayUrl: '',
gatewayPort: ''
},
editForm: { editForm: {
subsystemCode: '', subsystemCode: '',
systemType: '', systemType: '',
...@@ -125,34 +136,8 @@ export default { ...@@ -125,34 +136,8 @@ export default {
trafficCode: '', trafficCode: '',
merchantName: '' merchantName: ''
}, },
tableData: [{ tableLoading: false,
subsystemCode: '3#1F', tableData: [],
systemType: '座椅',
trafficCode: 'CRH45661-5648',
merchantName: '长春通富机电设备有限公司',
sendSequence: '1.56',
sendPort: '4000',
gatewayUrl: '192.168.1.1',
gatewayPort: '8000'
}, {
subsystemCode: '3#2F',
systemType: '桌板',
trafficCode: 'CRH45661-5648',
merchantName: '长春通富机电设备有限公司',
sendSequence: '1.56',
sendPort: '4000',
gatewayUrl: '192.168.1.1',
gatewayPort: '8000'
}, {
subsystemCode: '3#3F',
systemType: '座椅',
trafficCode: 'CRH45661-5648',
merchantName: '长春通富机电设备有限公司',
sendSequence: '1.56',
sendPort: '4000',
gatewayUrl: '192.168.1.1',
gatewayPort: '8000'
}],
tableColumns: [{ tableColumns: [{
label: '子系统编号', label: '子系统编号',
prop: 'subsystemCode' prop: 'subsystemCode'
...@@ -255,29 +240,20 @@ export default { ...@@ -255,29 +240,20 @@ export default {
} }
}, },
handleAdd () {
console.log(this.editForm)
this.editVisible = !this.editVisible
},
handleEditClose () { handleEditClose () {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
this.resetForm(this.editForm) this.resetForm(this.editForm)
console.log(this.editForm) // console.log(this.editForm)
}, },
handleEditConfirm () { handleEditConfirm () {
console.log(JSON.parse(JSON.stringify(this.editForm))) console.log(JSON.parse(JSON.stringify(this.editForm)))
var editParams = JSON.parse(JSON.stringify(this.editForm)) var editParams = JSON.parse(JSON.stringify(this.editForm))
this.editSubSystem(this.editForm) this.editSubSystem(this.editForm)
// this.editVisible = !this.editVisible
// this.resetForm(this.editForm)
}, },
// 表格-编辑 // 表格-编辑
handleEdit (index, row) { handleEdit (row, index = -1) {
console.log(index)
console.log(row)
this.editForm = JSON.parse(JSON.stringify(row)) this.editForm = JSON.parse(JSON.stringify(row))
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
}, },
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<script> <script>
import { getListApi, reportApi } from '@api/systemMonitor' import { getListApi, reportApi } from '@api/systemMonitor'
import notice from '@/common/notice' import notice from '@/common/notice'
require('echarts/lib/chart/pie')
let echarts = require('echarts/lib/echarts')
export default { export default {
name: 'systemMonitor', name: 'systemMonitor',
data () { data () {
...@@ -233,6 +237,7 @@ export default { ...@@ -233,6 +237,7 @@ export default {
mounted () { mounted () {
// this.drawPie() // this.drawPie()
this.$echarts = echarts
this.loadingGetList() this.loadingGetList()
this.totalECharts = this.$echarts.init(document.getElementById('totalEcharts')) this.totalECharts = this.$echarts.init(document.getElementById('totalEcharts'))
this.getPie() this.getPie()
......
...@@ -80,15 +80,16 @@ export default { ...@@ -80,15 +80,16 @@ export default {
watch: { watch: {
isVisible (val) { isVisible (val) {
this.disabled = !!this.editForm.trafficCode this.disabled = this.editForm.trafficCode ? true : false
this.editForm.openType = this.editForm.trafficCode ? this.editForm.openType : '1' this.editForm.openType = this.editForm.trafficCode ? this.editForm.openType : '1'
this.$refs.editRuleForm.resetFields() this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
} }
}, },
mounted: {}, mounted() {},
methods: { methods: {
handleClose () { handleClose () {
this.$emit('closeDialog') this.$emit('closeDialog')
}, },
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<el-row style="height: 40px; line-height: 40px"> <el-row style="height: 40px; line-height: 40px">
<el-col :span="12">车辆列表</el-col> <el-col :span="12">车辆列表</el-col>
<el-col :span="12" style="text-align: right"> <el-col :span="12" style="text-align: right">
<el-button @click="handleAdd">添加车辆</el-button> <el-button @click="handleEdit(editFormReset)">添加车辆</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table <el-table
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@click="handleEdit(scope.$index, scope.row)" @click="handleEdit(scope.row, scope.$index)"
>编辑</el-button> >编辑</el-button>
<el-button <el-button
type="text" type="text"
...@@ -112,8 +112,16 @@ export default { ...@@ -112,8 +112,16 @@ export default {
return { return {
// 新增/编辑弹窗 // 新增/编辑弹窗
editVisible: false, editVisible: false,
editFormReset: {
trafficCode: '',
stationCode: '',
stationName: '',
merchantName: '',
openType: ''
},
editForm: { editForm: {
trafficCode: '', trafficCode: '',
stationCode: '',
stationName: '', stationName: '',
merchantName: '', merchantName: '',
openType: '' openType: ''
...@@ -156,7 +164,7 @@ export default { ...@@ -156,7 +164,7 @@ export default {
} }
}, },
mounted () { mounted() {
this.loadingGetList() this.loadingGetList()
}, },
...@@ -226,27 +234,22 @@ export default { ...@@ -226,27 +234,22 @@ export default {
} }
}, },
handleAdd () {
console.log(this.editForm)
this.editVisible = !this.editVisible
},
handleEditClose () { handleEditClose () {
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
this.resetForm(this.editForm) this.resetForm(this.editForm)
console.log(this.editForm) delete this.editForm.id
}, },
handleEditConfirm () { handleEditConfirm () {
console.log(JSON.parse(JSON.stringify(this.editForm))) // console.log(JSON.parse(JSON.stringify(this.editForm)))
var editParams = JSON.parse(JSON.stringify(this.editForm)) var editParams = JSON.parse(JSON.stringify(this.editForm))
this.editTraffic(editParams) this.editTraffic(editParams)
}, },
// 表格-编辑 // 表格-编辑
handleEdit (index, row) { handleEdit (row, index = -1) {
console.log(index) // console.log(index)
console.log(row) // console.log(row)
this.editForm = JSON.parse(JSON.stringify(row)) this.editForm = JSON.parse(JSON.stringify(row))
this.editVisible = !this.editVisible this.editVisible = !this.editVisible
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!