Commit 97a0ed43 authored by 李驰骋's avatar 李驰骋

登录改为选择作业单元

parent d0ca3384
...@@ -26,6 +26,8 @@ const install = (Vue, vm) => { ...@@ -26,6 +26,8 @@ const install = (Vue, vm) => {
params), params),
getWorkstationList: (params = {}) => vm.$u.get(config.adminPath + getWorkstationList: (params = {}) => vm.$u.get(config.adminPath +
'/mobile/md/workstation/getWorkstationList', params), '/mobile/md/workstation/getWorkstationList', params),
getWorkUnitList: (params = {}) => vm.$u.get(config.adminPath +
'/md/workunit/getListByUser', params),
/** /**
* 生产管理相关API * 生产管理相关API
**/ **/
......
This diff is collapsed.
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
</view> </view>
<view class="prod-body-right"> <view class="prod-body-right">
<view style="text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;"> <view style="text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;">
{{ this.vuex_workstation == null ? '请选择工作站' : this.vuex_workstation.workstationName }} {{ this.vuex_workunit == null ? '请选择工作单元' : this.vuex_workunit.workunitName }}
</view> </view>
<u-button type="primary" @click="changeWorkstation">切换工作</u-button> <u-button type="primary" @click="changeWorkstation">切换工作单元</u-button>
<br/> <br/>
<u-button type="warning" @click="commonClick('KnifeTemp')">刀模版上下机</u-button> <u-button type="warning" @click="commonClick('KnifeTemp')">刀模版上下机</u-button>
<u-button type="primary" @click="commonClick('Refresh')">刷新</u-button> <u-button type="primary" @click="commonClick('Refresh')">刷新</u-button>
...@@ -716,7 +716,7 @@ export default { ...@@ -716,7 +716,7 @@ export default {
} }
}, },
mounted() { //监听工作站切换事件 mounted() { //监听工作站切换事件
uni.$on('switchWorkstation', (station) => { uni.$on('switchWorkunit', (station) => {
this.getTaskList(); this.getTaskList();
}) })
}, },
...@@ -728,7 +728,7 @@ export default { ...@@ -728,7 +728,7 @@ export default {
} }
}) })
//监听工作站切换事件 //监听工作站切换事件
uni.$on('switchWorkstation', (station) => { uni.$on('switchWorkunit', (station) => {
// this.reset(); // this.reset();
this.getTaskList(); this.getTaskList();
}) })
...@@ -737,7 +737,7 @@ export default { ...@@ -737,7 +737,7 @@ export default {
this.getTaskList(); //刷新任务状态 this.getTaskList(); //刷新任务状态
}) })
if (this.vuex_workstation != null) { if (this.vuex_workunit != null) {
this.getTaskList(); this.getTaskList();
} }
// if (this.vuex_task != null) { // if (this.vuex_task != null) {
...@@ -745,7 +745,7 @@ export default { ...@@ -745,7 +745,7 @@ export default {
// } // }
}, },
destroyed() { destroyed() {
uni.$off('switchWorkstation'); uni.$off('switchWorkunit');
uni.$off('taskStatusChanged'); uni.$off('taskStatusChanged');
}, },
methods: { methods: {
...@@ -759,7 +759,7 @@ export default { ...@@ -759,7 +759,7 @@ export default {
console.log('99999999', arg) console.log('99999999', arg)
}, },
changeWorkstation() { changeWorkstation() {
uni.$emit('changeWorkstation'); uni.$emit('changeWorkunit');
}, },
commonClick(oper) { commonClick(oper) {
if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) { if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) {
...@@ -929,8 +929,9 @@ export default { ...@@ -929,8 +929,9 @@ export default {
}, },
getTaskList() { getTaskList() {
this.form = {} this.form = {}
const t = this;
this.$u.api.getTaskList({ this.$u.api.getTaskList({
workstationId: this.vuex_workstation.workstationId, workunitId: t.vuex_workunit.workunitId,
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.tableData = res.rows; this.tableData = res.rows;
......
...@@ -12,7 +12,7 @@ try{ ...@@ -12,7 +12,7 @@ try{
// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的 // 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
lifeData = uni.getStorageSync('lifeData'); lifeData = uni.getStorageSync('lifeData');
}catch(e){ }catch(e){
} }
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
...@@ -41,14 +41,15 @@ const store = new Vuex.Store({ ...@@ -41,14 +41,15 @@ const store = new Vuex.Store({
vuex_remember: lifeData.vuex_remember ? lifeData.vuex_remember : '', vuex_remember: lifeData.vuex_remember ? lifeData.vuex_remember : '',
vuex_locale: lifeData.vuex_locale ? lifeData.vuex_locale : '', vuex_locale: lifeData.vuex_locale ? lifeData.vuex_locale : '',
vuex_isAgent: lifeData.vuex_isAgent ? lifeData.vuex_isAgent : '', vuex_isAgent: lifeData.vuex_isAgent ? lifeData.vuex_isAgent : '',
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式 // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_config: config, vuex_config: config,
//当前设备绑定的工作站 //当前设备绑定的工作站
vuex_workstation: null, vuex_workstation: null,
vuex_workunit: null,
//当前工作站正在进行的生产任务 //当前工作站正在进行的生产任务
vuex_task: null, vuex_task: null,
// 自定义tabbar数据 // 自定义tabbar数据
// vuex_tabbar: [{ // vuex_tabbar: [{
// iconPath: "/static/uview/example/component.png", // iconPath: "/static/uview/example/component.png",
......
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