Commit c2e97b11 by liimin

1.完善注册 2.增加 基础数据vuex 管理

1 parent d5893268
import request from './request' import request from './request'
const path = 'fims.device.' const path = 'fims.device.'
function getListApi(data) { function getListApi (data) {
data.method = `${path}list` data.method = `${path}list`
return request(data) return request(data)
} }
...@@ -32,4 +32,4 @@ export { ...@@ -32,4 +32,4 @@ export {
removeApi, removeApi,
importApi, importApi,
exportApi exportApi
}
\ No newline at end of file \ No newline at end of file
}
...@@ -3,8 +3,8 @@ import request from './request' ...@@ -3,8 +3,8 @@ import request from './request'
const path = 'fims.maintain.' const path = 'fims.maintain.'
function getListApi (data) { function getListApi (data) {
data.method = `${path}search` data.method = `${path}search`
return request(data) return request(data)
} }
function removeApi (data) { function removeApi (data) {
...@@ -13,12 +13,12 @@ function removeApi (data) { ...@@ -13,12 +13,12 @@ function removeApi (data) {
} }
function exportApi (data) { function exportApi (data) {
data.method = `${path}export` data.method = `${path}export`
return request(data) return request(data)
} }
export { export {
getListApi, getListApi,
removeApi, removeApi,
exportApi exportApi
}
\ No newline at end of file \ No newline at end of file
}
...@@ -2,29 +2,29 @@ import request from './request' ...@@ -2,29 +2,29 @@ import request from './request'
const path = 'fims.order.' const path = 'fims.order.'
function getListApi(data) { function getListApi (data) {
data.method = `${path}search` data.method = `${path}search`
return request(data) 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
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
}
...@@ -3,10 +3,10 @@ import request from './request' ...@@ -3,10 +3,10 @@ import request from './request'
const path = 'fims.material.' const path = 'fims.material.'
function getListApi (data) { function getListApi (data) {
data.method = `${path}list` data.method = `${path}list`
return request(data) return request(data)
} }
export { export {
getListApi
}
\ No newline at end of file \ No newline at end of file
getListApi
}
...@@ -2,12 +2,15 @@ ...@@ -2,12 +2,15 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:41 * @Date: 2019-08-26 18:02:41
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-08-29 03:55:24 * @Last Modified time: 2019-09-01 15:33:02
*/ */
import axios from '@/plugin/axios' import axios from '@/plugin/axios'
import sign from './sign' import sign from './sign'
const request = (params, method) => { import RequestMethods from './request.methods'
// import util from '@/libs/util'
const request = (params = {}, method = RequestMethods.GET) => {
// params = util.deepClone(params)
params.source = '' params.source = ''
params.app_key = '48e5e13229b82c1b4e6e8c96151f0637' params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime() params.timestamp = new Date().getTime()
...@@ -18,7 +21,7 @@ const request = (params, method) => { ...@@ -18,7 +21,7 @@ const request = (params, method) => {
const url = params.method const url = params.method
return axios({ return axios({
url, url,
method: method || 'get', method,
data: sign(params) data: sign(params)
}) })
} }
......
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 17:18:41
*/
import request from './request'
import RequestMethods from './request.methods'
// 用户相关
const user_path = 'fims.user.'
/**
* 用户登录
* @param {*} data 参数
*/
export function AccountLogin (data) {
data.method = `${user_path}login`
return request(data, RequestMethods.POST)
}
/**
* 注册
* @param {*} data 参数
*/
export function Reg (data = {}) {
data.method = `${user_path}register`
return request(data, RequestMethods.GET)
}
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 17:19:07
*/
import request from './request'
import RequestMethods from './request.methods'
// 基础数据
const path = 'fims.base.'
/**
* 获取站点列表
* @param {*} data 参数
*/
export function StationList (data = {}) {
data.method = `${path}station`
return request(data, RequestMethods.GET)
}
/**
* 获取公司列表
* @param {*} data 参数
*/
export function CompanyList (data = {}) {
data.method = `${path}company`
return request(data, RequestMethods.GET)
}
/**
* 获取部门列表
* @param {*} data 参数
*/
export function DepartList (data = {}) {
data.method = `${path}depart`
return request(data, RequestMethods.GET)
}
/**
* 获取角色列表
* @param {*} data 参数
*/
export function FetchRoleList (data = {}) {
data.method = `fims.role.list`
return request(data, RequestMethods.GET)
}
/*
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 19:06:01
*/
export const BaseData = {
ROLE: 'role',
COMPANY: 'company',
DEPART: 'depart',
STATION: 'station'
}
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-08-31 12:44:16 * @Date: 2019-08-31 12:44:16
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-08-31 12:44:16 * @Last Modified time: 2019-08-31 12:44:16
*/ */
import Vue from 'vue' import Vue from 'vue'
import focus from './src/focus' import focus from './src/focus'
Vue.directive(focus.name,focus)
\ No newline at end of file \ No newline at end of file
Vue.directive(focus.name, focus)
/* /*
* @Author: limin * @Author: limin
* @Date: 2019-08-31 12:44:08 * @Date: 2019-08-31 12:44:08
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-08-31 12:44:08 * @Last Modified time: 2019-08-31 12:44:08
*/ */
export default { export default {
name:'focus',
inserted: function (el) {
el.querySelector('input').focus();
}
}
\ No newline at end of file \ No newline at end of file
name: 'focus',
inserted: function (el) {
el.querySelector('input').focus()
}
}
...@@ -15,14 +15,14 @@ export default { ...@@ -15,14 +15,14 @@ export default {
data () { data () {
return { return {
predefine: [ predefine: [
'#FF0000','#008000','#0000FF' '#FF0000', '#008000', '#0000FF'
] ]
} }
}, },
computed: { computed: {
...mapState('d2admin', { ...mapState('d2admin', {
value:state=>state.color.value, value: state => state.color.value,
listTheme:state=>state.theme.list listTheme: state => state.theme.list
}) })
}, },
watch: { watch: {
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.predefine= [...this.predefine,...this.listTheme.map(theme=>theme.color)] this.predefine = [...this.predefine, ...this.listTheme.map(theme => theme.color)]
}, },
methods: { methods: {
...mapActions('d2admin/color', [ ...mapActions('d2admin/color', [
......
...@@ -46,100 +46,95 @@ ...@@ -46,100 +46,95 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from 'vuex'
import { Message, MessageBox } from "element-ui"; import { Message, MessageBox } from 'element-ui'
export default { export default {
name: "PersonalPanel", name: 'PersonalPanel',
props: { props: {
user: { user: {
type: Object, type: Object,
default: { default: {
name: "admin", name: 'admin',
avatar: "@/assets/user.png", avatar: '@/assets/user.png',
role: "超级管理员", role: '超级管理员',
registeInfo: "注册时间:2018-12-25 " registeInfo: '注册时间:2018-12-25 '
} }
} }
}, },
computed: { computed: {
...mapState("d2admin/user", ["info"]) ...mapState('d2admin/user', ['info'])
}, },
data() { data () {
return {}; return {}
}, },
methods: { methods: {
...mapActions("d2admin/account", ["logout"]), ...mapActions('d2admin/account', ['logout']),
/** /**
* @description 登出 * @description 登出
*/ */
logOut() { logOut () {
this.$store.commit("d2admin/gray/set", true); this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm("确定要注销当前用户吗", "注销用户", { MessageBox.confirm('确定要注销当前用户吗', '注销用户', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(async () => { }).then(async () => {
await this.$store.commit("d2admin/gray/set", false); await this.$store.commit('d2admin/gray/set', false)
// await this.$store.dispatch('d2admin/user/set', {}) // await this.$store.dispatch('d2admin/user/set', {})
await this.logout(); await this.logout()
this.$router.push('/login') this.$router.push('/login')
}) })
.catch(() => { .catch(() => {
this.$store.commit("d2admin/gray/set", false); this.$store.commit('d2admin/gray/set', false)
Message({ Message({
message: "取消注销操作" message: '取消注销操作'
});
});
},
clear(){
this.$store.commit("d2admin/gray/set", true);
MessageBox.confirm("清空缓存将重置所有个性化设置并退出到登录界面", "清空缓存", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
await this.$store.commit("d2admin/gray/set", false);
await this.$store.dispatch('d2admin/db/set', {
dbName: 'sys',
path: '',
value: '',
user: true
}) })
window.location.reload()
}) })
},
clear () {
this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm('清空缓存将重置所有个性化设置并退出到登录界面', '清空缓存', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await this.$store.commit('d2admin/gray/set', false)
localStorage.clear();
window.location.reload()
})
.catch(() => { .catch(() => {
this.$store.commit("d2admin/gray/set", false); this.$store.commit('d2admin/gray/set', false)
Message({ Message({
message: "取消清除缓存操作" message: '取消清除缓存操作'
}); })
}); })
}, },
comfirm(text,title,cancleText){ comfirm (text, title, cancleText) {
return new Promise((reject,resolve)=>{ return new Promise((reject, resolve) => {
this.$store.commit("d2admin/gray/set", true); this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm(text, title, { MessageBox.confirm(text, title, {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(async () => { }).then(async () => {
await this.$store.commit("d2admin/gray/set", false); await this.$store.commit('d2admin/gray/set', false)
resolve(true) resolve(true)
}) })
.catch(() => { .catch(() => {
this.$store.commit("d2admin/gray/set", false); this.$store.commit('d2admin/gray/set', false)
Message({ Message({
message: cancleText message: cancleText
}); })
reject() reject()
}); })
}) })
}, },
// 打开个人信息弹出框 // 打开个人信息弹出框
openUserMsgDialog: function() { openUserMsgDialog: function () {
console.log("aaaa"); console.log('aaaa')
} }
} }
}; }
</script> </script>
<style scoped> <style scoped>
...@@ -165,7 +160,7 @@ export default { ...@@ -165,7 +160,7 @@ export default {
} }
.avatar-container { .avatar-container {
display: inline-block; display: inline-block;
align: center; text-align: center;
} }
.name-role { .name-role {
font-size: 14px; font-size: 14px;
......
...@@ -7,7 +7,7 @@ import 'flex.css' ...@@ -7,7 +7,7 @@ import 'flex.css'
import '@/components' import '@/components'
// svg 图标 // svg 图标
import '@/assets/svg-icons' import '@/assets/svg-icons'
//指令 // 指令
import '@/directives' import '@/directives'
// 功能插件 // 功能插件
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
// 事件传递 // 事件传递
Vue.prototype.$event = new Vue() Vue.prototype.$event = new Vue()
// Element // Element
Vue.use(ElementUI,{ size: 'medium', zIndex: 3000 }) Vue.use(ElementUI, { size: 'medium', zIndex: 3000 })
// 插件 // 插件
Vue.use(pluginError) Vue.use(pluginError)
Vue.use(pluginLog) Vue.use(pluginLog)
......
import util from '@/libs/util.js' import util from '@/libs/util.js'
import router from '@/router' import router from '@/router'
import { AccountLogin } from '@api/sys.login' import { AccountLogin } from '@api/sys.account'
export default { export default {
namespaced: true, namespaced: true,
actions: { actions: {
...@@ -36,6 +36,8 @@ export default { ...@@ -36,6 +36,8 @@ export default {
await dispatch('d2admin/user/set', { await dispatch('d2admin/user/set', {
name: user.name name: user.name
}, { root: true }) }, { root: true })
// 强制初始化基础数据
await dispatch('d2admin/base/init', null, { root: true })
// 用户登录后从持久化数据加载一系列的设置 // 用户登录后从持久化数据加载一系列的设置
await dispatch('load') await dispatch('load')
// 结束 // 结束
...@@ -85,6 +87,8 @@ export default { ...@@ -85,6 +87,8 @@ export default {
// await dispatch('d2admin/size/set', 'medium', { root: true }) // await dispatch('d2admin/size/set', 'medium', { root: true })
// DB -> store 持久化数据加载全局尺寸 // DB -> store 持久化数据加载全局尺寸
await dispatch('d2admin/size/load', null, { root: true }) await dispatch('d2admin/size/load', null, { root: true })
// DB - > 初始化 基础数据
// await dispatch('d2admin/base/init', null, { root: true })
// // store 设置系统主色 // // store 设置系统主色
// await dispatch('d2admin/color/set', process.env.VUE_APP_MAIN_COLOR) // await dispatch('d2admin/color/set', process.env.VUE_APP_MAIN_COLOR)
// 后台接口 -> store // 后台接口 -> store
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-27 17:25:12 * @Date: 2019-08-27 17:25:12
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-08-29 00:53:59 * @Last Modified time: 2019-09-01 19:00:46
*/ */
import util from '@/libs/util.js' import util from '@/libs/util.js'
import router from '@/router' import router from '@/router'
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
// 设置数据 // 设置数据
dispatch('d2admin/db/set', { dispatch('d2admin/db/set', {
dbName: 'sys', dbName: 'database',
path: 'source', path: 'source',
value: state.source, value: state.source,
user: true user: true
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
if (!state.source) { if (!state.source) {
state.source = await dispatch('d2admin/db/get', { state.source = await dispatch('d2admin/db/get', {
dbName: 'sys', dbName: 'database',
path: 'source', path: 'source',
user: true user: true
}, { root: true }) }, { root: true })
......
/*
* @Author: limin
* @Date: 2019-09-01 17:56:57
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 18:57:45
*/
import { FetchRoleList, CompanyList, DepartList, StationList } from '@/api/sys.base'
import { BaseData } from '@/common/constants'
const map = {
[BaseData.ROLE]: FetchRoleList,
[BaseData.COMPANY]: CompanyList,
[BaseData.DEPART]: DepartList,
[BaseData.STATION]: StationList
}
export default {
namespaced: true,
state: {
// 所属公司
company: [],
// 角色
role: [],
// 部门
depart: [],
// 站点
station: []
},
actions: {
/**
* 初始化获取 基础数据 并 前端持久化
* 每次登录会强制 初始化
* @param {*} param0
*/
init ({ state, dispatch, commit }) {
return new Promise(async resolve => {
Promise.all([
FetchRoleList(),
CompanyList(),
DepartList(),
StationList()
]).then( async ([role, company, depart, station] = res) => {
state.role = role
state.station = station
state.depart = depart
state.company = company
await dispatch('save2db', {path: `base`,value: {role, company, depart, station}})
resolve({ role, company, depart, station })
})
})
},
/**
* 根据名字获取基础数据
* 获取步骤:
* 内存 -> 前端持久化数据库 -> 后台接口
* @param {*} param0
* @param {*} name 名称 state 中的任意一个 强烈建议 使用 @/common/constants/BaseData 中的常量 便于灵活修改
*/
get ({ state, dispatch }, name) {
return new Promise(async resolve => {
let __data = state[name]
if (!__data.length) {
__data = await dispatch('getFromdb', `base.${name}`) || await dispatch('getFromAjax', name)
state[name] = __data
await dispatch('save2db', {path: `base.${name}`,value: __data})
}
resolve(__data)
})
},
/**
* 获取所有基础数据
* 获取步骤:
* 内存 -> 前端持久化数据库 -> 后台接口
* @param {*} param0
*/
load ({ state,dispatch }) {
return new Promise(async resolve => {
if (state.role.length === 0) {
state = await dispatch('getFromdb','base') || await dispatch('init')
}
const {role, company, depart, station} = state
resolve({role, company, depart, station})
})
},
/**
* 内部方法 从前端持久化数据库 获取指定数据
* @param {*} param0
* @param {*} path 数据 路径
*/
getFromdb ({ dispatch }, path) {
return new Promise(async resolve => {
const value = await dispatch('d2admin/db/get', {
dbName: 'database',
path,
user: true
}, { root: true })
resolve(value)
})
},
/**
* 内部方法 前端持久化 一个 数据
* @param {*} param0
* @param {*} param1 value 需要持久化的数据 path 需要持久化的数据路径
*/
save2db ({ dispatch }, {value,path}) {
return new Promise(async resolve => {
await dispatch('d2admin/db/set', {
dbName: 'database',
path,
value,
user: true
}, { root: true })
resolve(value)
})
},
/**
* 从后端获取一个数据
* @param {*} param0
* @param {*} name @/common/constants/BaseData 中的常量
*/
getFromAjax ({ state, dispatch, commit }, name) {
return new Promise(async resolve => {
const value = await map[name]()
resolve(value)
})
}
},
mutations: {
}
}
...@@ -42,10 +42,10 @@ export default { ...@@ -42,10 +42,10 @@ export default {
resolve() resolve()
}) })
}, },
clear ({ state, dispatch },) { clear ({ state, dispatch }) {
return new Promise(async resolve => { return new Promise(async resolve => {
await dispatch('set',{}) await dispatch('set', {})
resolve() resolve()
}) })
} }
......
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
</style>
...@@ -135,12 +135,12 @@ export default { ...@@ -135,12 +135,12 @@ export default {
watch: { watch: {
isVisible (val) { isVisible (val) {
// this.disabled = this.editForm.trafficCode ? true : false // this.disabled = this.editForm.trafficCode ? true : false
this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields() this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
} }
}, },
mounted() {}, mounted () {},
methods: { methods: {
......
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
<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 class="import-button" style="">导入 <el-button class="import-button" style="">导入
<input <input
type="file" type="file"
class="import-input" class="import-input"
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)" /> @change="importFile($event)" />
</el-button> </el-button>
<el-button>导出</el-button> <el-button>导出</el-button>
...@@ -105,14 +105,14 @@ ...@@ -105,14 +105,14 @@
<script> <script>
import EditDialog from './editDialog' import EditDialog from './editDialog'
import { getListApi, editApi, removeApi, importApi, exportApi } from '@api/deviceManagement' import { getListApi, editApi, removeApi, importApi, exportApi } from '@api/deviceManagement'
import notice from '@/common/notice' import notice from '@/common/notice'
export default { export default {
name: 'deviceManagement', name: 'deviceManagement',
components: { components: {
EditDialog EditDialog
}, },
data() { data () {
return { return {
// 编辑弹窗 // 编辑弹窗
editVisible: false, editVisible: false,
...@@ -139,32 +139,32 @@ export default { ...@@ -139,32 +139,32 @@ export default {
tableLoading: false, tableLoading: false,
tableData: [], tableData: [],
tableColumns: [{ tableColumns: [{
label: '物料代码', label: '物料代码',
prop: 'deviceNum' prop: 'deviceNum'
}, { }, {
label: '物料编码', label: '物料编码',
prop: 'deviceCode' prop: 'deviceCode'
}, { }, {
label: 'CRC物料号', label: 'CRC物料号',
prop: 'crcCode' prop: 'crcCode'
}, { }, {
label: '图号', label: '图号',
prop: 'drawNum' prop: 'drawNum'
}, { }, {
label: '物料名称', label: '物料名称',
prop: 'deviceName' prop: 'deviceName'
}, { }, {
label: '规格', label: '规格',
prop: 'specifications' prop: 'specifications'
}, { }, {
label: '所在地', label: '所在地',
prop: 'stationName' prop: 'stationName'
}, { }, {
label: '库存', label: '库存',
prop: 'stockCount' prop: 'stockCount'
}, { }, {
label: '责任人', label: '责任人',
prop: 'responsible' prop: 'responsible'
}], }],
// 页码 // 页码
currentPage: 1, currentPage: 1,
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
} }
}, },
mounted() { mounted () {
this.loadingGetList() this.loadingGetList()
}, },
...@@ -202,7 +202,7 @@ export default { ...@@ -202,7 +202,7 @@ export default {
}) })
}, },
editDevice(params) { editDevice (params) {
editApi(params).then(res => { editApi(params).then(res => {
// console.log(res) // console.log(res)
this.handleEditClose() this.handleEditClose()
...@@ -214,7 +214,7 @@ export default { ...@@ -214,7 +214,7 @@ export default {
}, },
// 导入 // 导入
importFile(e) { importFile (e) {
const params = { const params = {
file: e.target.files[0] file: e.target.files[0]
} }
...@@ -286,20 +286,20 @@ export default { ...@@ -286,20 +286,20 @@ export default {
</script> </script>
<style scoped> <style scoped>
.import-button { .import-button {
width: 70px; width: 70px;
height: 40px; height: 40px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
} }
.import-input { .import-input {
opacity: 0; opacity: 0;
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 70px; width: 70px;
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
font-size:0 font-size:0
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -15,24 +15,24 @@ ...@@ -15,24 +15,24 @@
<script> <script>
export default { export default {
name: 'DetailDialog', name: 'DetailDialog',
data() { data () {
return { return {
} }
}, },
props: { props: {
isVisible: { isVisible: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
mounted() {}, mounted () {},
methods: { methods: {
handleClose() { handleClose () {
this.$emit('closeDialog') this.$emit('closeDialog')
} }
} }
} }
...@@ -43,4 +43,4 @@ export default { ...@@ -43,4 +43,4 @@ export default {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -102,14 +102,14 @@ ...@@ -102,14 +102,14 @@
<script> <script>
import DetailDialog from './detailDialog' import DetailDialog from './detailDialog'
import { getListApi, detailApi, removeApi, downloadApi } from '@api/materiaOrderManagement' import { getListApi, detailApi, removeApi, downloadApi } from '@api/materiaOrderManagement'
import notice from '@/common/notice' import notice from '@/common/notice'
export default { export default {
name: 'materiaOrderManagement', name: 'materiaOrderManagement',
components: { components: {
DetailDialog DetailDialog
}, },
data() { data () {
return { return {
detailVisible: false, detailVisible: false,
// 搜索 // 搜索
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
formatter: (cellValue) => { formatter: (cellValue) => {
if (cellValue.status) { if (cellValue.status) {
return { return {
1: '审批中', 1: '审批中',
2: '已驳回', 2: '已驳回',
...@@ -157,8 +157,8 @@ export default { ...@@ -157,8 +157,8 @@ export default {
} }
}, },
mounted() { mounted () {
this.loadingGetList() this.loadingGetList()
}, },
methods: { methods: {
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
this.tableLoading = false this.tableLoading = false
}) })
}, },
editSubSystem(value) { editSubSystem (value) {
const params = value const params = value
params.method = value.id ? methods.Edit : methods.Add params.method = value.id ? methods.Edit : methods.Add
editApi(params).then(res => { editApi(params).then(res => {
...@@ -261,4 +261,4 @@ export default { ...@@ -261,4 +261,4 @@ export default {
</script> </script>
<style scoped> <style scoped>
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -67,95 +67,95 @@ ...@@ -67,95 +67,95 @@
</template> </template>
<script> <script>
import { getListApi } from '@api/materialList' import { getListApi } from '@api/materialList'
import notice from '@/common/notice' import notice from '@/common/notice'
export default { export default {
name: 'materialList', name: 'materialList',
data() { data () {
return { return {
searchForm: { searchForm: {
keyWord: '', keyWord: '',
responsible: '', responsible: ''
}, },
// 表格 // 表格
tableLoading: false, tableLoading: false,
tableData: [], tableData: [],
tableColumns: [{ tableColumns: [{
label: '物料代码', label: '物料代码',
prop: 'deviceNum' prop: 'deviceNum'
}, { }, {
label: '物料编码', label: '物料编码',
prop: 'deviceCode' prop: 'deviceCode'
}, { }, {
label: 'CRC物料号', label: 'CRC物料号',
prop: 'crcCode' prop: 'crcCode'
}, { }, {
label: '图号', label: '图号',
prop: 'drawNum' prop: 'drawNum'
}, { }, {
label: '物料名称', label: '物料名称',
prop: 'deviceName' prop: 'deviceName'
}, { }, {
label: '规格', label: '规格',
prop: 'specifications' prop: 'specifications'
}, { }, {
label: '责任人', label: '责任人',
prop: 'responsible' prop: 'responsible'
}], }],
// 页码 // 页码
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 30 total: 30
} }
}, },
mounted() { mounted () {
this.loadingGetList() this.loadingGetList()
}, },
methods: { methods: {
loadingGetList () { loadingGetList () {
this.tableLoading = true this.tableLoading = true
this.getList() this.getList()
}, },
/* 接口请求-start */ /* 接口请求-start */
getParams () { getParams () {
return { return {
pageCount: this.pageSize, pageCount: this.pageSize,
pageSize: this.currentPage, pageSize: this.currentPage,
...this.searchForm ...this.searchForm
} }
}, },
getList () { getList () {
const params = this.getParams() const params = this.getParams()
getListApi(params).then(res => { getListApi(params).then(res => {
this.tableData = res this.tableData = res
this.tableLoading = false this.tableLoading = false
}).catch(err => { }).catch(err => {
notice.errorTips(err) notice.errorTips(err)
this.tableLoading = false this.tableLoading = false
}) })
}, },
/* 接口请求-end */ /* 接口请求-end */
// 搜索 // 搜索
handleSearch () { handleSearch () {
console.log(this.searchForm) console.log(this.searchForm)
this.loadingGetList() this.loadingGetList()
}, },
// 页码 // 页码
handleSizeChange (value) { handleSizeChange (value) {
console.log(value) console.log(value)
this.pageSize = value this.pageSize = value
// 调接口 // 调接口
this.loadingGetList() this.loadingGetList()
}, },
handleCurrentChange (value) { handleCurrentChange (value) {
console.log(value) console.log(value)
this.currentPage = value this.currentPage = value
// 调接口 // 调接口
this.loadingGetList() this.loadingGetList()
}, },
handleDelete (index, row) { handleDelete (index, row) {
...@@ -167,8 +167,8 @@ export default { ...@@ -167,8 +167,8 @@ export default {
console.log(index) console.log(index)
console.log(row) console.log(row)
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功' message: '删除成功'
}) })
}).catch(err => {}) }).catch(err => {})
} }
...@@ -177,4 +177,4 @@ export default { ...@@ -177,4 +177,4 @@ export default {
</script> </script>
<style scoped> <style scoped>
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
this.$refs.editRuleForm.resetFields() this.$refs.editRuleForm.resetFields()
} }
}, },
methods: { methods: {
handleClose () { handleClose () {
this.$emit('closeDialog') this.$emit('closeDialog')
......
...@@ -80,13 +80,13 @@ export default { ...@@ -80,13 +80,13 @@ export default {
watch: { watch: {
isVisible (val) { isVisible (val) {
this.disabled = this.editForm.trafficCode ? true : false this.disabled = !!this.editForm.trafficCode
this.editForm.openType = this.editForm.trafficCode ? this.editForm.openType : '1' this.editForm.openType = this.editForm.trafficCode ? this.editForm.openType : '1'
this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields() this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
} }
}, },
mounted() {}, mounted () {},
methods: { methods: {
......
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
} }
}, },
mounted() { mounted () {
this.loadingGetList() this.loadingGetList()
}, },
......
...@@ -139,11 +139,11 @@ module.exports = { ...@@ -139,11 +139,11 @@ module.exports = {
args[0].cdn = cdn args[0].cdn = cdn
return args return args
}) })
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
config config
.plugin('webpack-bundle-analyzer') .plugin('webpack-bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin) .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
} }
// 判断环境加入模拟数据 // 判断环境加入模拟数据
// const entry = config.entry('app') // const entry = config.entry('app')
// if (process.env.VUE_APP_BUILD_MODE !== 'nomock') { // if (process.env.VUE_APP_BUILD_MODE !== 'nomock') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!