Commit 0804c1f0 authored by 沈翠玲's avatar 沈翠玲

显示全部的工作单元

parent dfbd643a
...@@ -38,6 +38,11 @@ const install = (Vue, vm) => { ...@@ -38,6 +38,11 @@ const install = (Vue, vm) => {
/** /**
* 系统设置API * 系统设置API
*/ */
getTaskConfig: (params = {}) =>
vm.$u.get(
config.adminPath + '/system/config/configKey/pda.all.task.state',
params
),
//获取工序清单 //获取工序清单
getProcessList: (params = {}) => getProcessList: (params = {}) =>
vm.$u.get( vm.$u.get(
...@@ -57,6 +62,9 @@ const install = (Vue, vm) => { ...@@ -57,6 +62,9 @@ const install = (Vue, vm) => {
/** /**
* 生产管理相关API * 生产管理相关API
**/ **/
//获取所有工作中心的生产任务
getAllTaskList: (params = {}) =>
vm.$u.get(config.adminPath + '/mobile/pro/protask/getAllTaskList', params),
//获取当前工作中心的生产任务 //获取当前工作中心的生产任务
getTaskList: (params = {}) => getTaskList: (params = {}) =>
vm.$u.get(config.adminPath + '/mobile/pro/protask/getTaskList', params), vm.$u.get(config.adminPath + '/mobile/pro/protask/getTaskList', params),
......
...@@ -149,7 +149,18 @@ export default { ...@@ -149,7 +149,18 @@ export default {
}); });
// this.checkWorkstation(); // this.checkWorkstation();
await this.getWorkUnitList(); await this.getWorkUnitList();
this.setWorkUnit(this.workUnitList[0])
this.$u.api.getTaskConfig().then(res => {
if (res.code === 200) {
if (res.data) {
this.setWorkUnit(null)
} else {
this.setWorkUnit(this.workUnitList[0])
}
}
uni.$emit('getTaskConfig')
})
}, },
destroyed() { destroyed() {
uni.$off('switchTab'); uni.$off('switchTab');
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
> >
{{ {{
this.vuex_workunit == null this.vuex_workunit == null
? $t('请选择工作单元') ? ''
: this.vuex_workunit.workunitName : this.vuex_workunit.workunitName
}} }}
</view> </view>
...@@ -989,19 +989,31 @@ export default { ...@@ -989,19 +989,31 @@ export default {
name: 'arrangeCode', name: 'arrangeCode',
label: i18n.t('工单编号'), label: i18n.t('工单编号'),
align: 'center', align: 'center',
width: 200, width: 180,
}, },
{ {
name: 'scheduleStartDateStr', name: 'scheduleStartDateStr',
label: i18n.t('计划开始时间'), label: i18n.t('计划开始时间'),
align: 'center', align: 'center',
width: 95, width: 140,
}, },
{ {
name: 'scheduleEndDateStr', name: 'scheduleEndDateStr',
label: i18n.t('计划结束时间'), label: i18n.t('计划结束时间'),
align: 'center', align: 'center',
width: 95, width: 140,
},
{
name: 'workstationName',
label: i18n.t('工作中心名称'),
align: 'center',
width: 140,
},
{
name: 'workunitName',
label: i18n.t('工作单元名称'),
align: 'center',
width: 140,
}, },
{ {
name: 'quantity', name: 'quantity',
...@@ -1250,6 +1262,11 @@ export default { ...@@ -1250,6 +1262,11 @@ export default {
this.screenHeight = res.windowHeight this.screenHeight = res.windowHeight
}, },
}) })
// 获取所有工作单元的任务
uni.$on('getTaskConfig', (station) => {
this.getTaskList()
})
//监听工作中心切换事件 //监听工作中心切换事件
uni.$on('switchWorkunit', (station) => { uni.$on('switchWorkunit', (station) => {
// this.reset(); // this.reset();
...@@ -1327,6 +1344,18 @@ export default { ...@@ -1327,6 +1344,18 @@ export default {
align: 'center', align: 'center',
width: 140, width: 140,
}, },
{
name: 'workstationName',
label: i18n.t('工作中心名称'),
align: 'center',
width: 140,
},
{
name: 'workunitName',
label: i18n.t('工作单元名称'),
align: 'center',
width: 140,
},
{ {
name: 'quantity', name: 'quantity',
label: i18n.t('任务数量'), label: i18n.t('任务数量'),
...@@ -1385,15 +1414,10 @@ export default { ...@@ -1385,15 +1414,10 @@ export default {
this.getTaskList() //刷新任务状态 this.getTaskList() //刷新任务状态
}) })
if (this.vuex_workunit != null) {
this.getTaskList()
}
// if (this.vuex_task != null) {
// this.shiftTask(this.vuex_task.taskId);
// }
}, },
destroyed() { destroyed() {
uni.$off('switchWorkunit') uni.$off('switchWorkunit')
uni.$off('getTaskConfig')
uni.$off('taskStatusChanged') uni.$off('taskStatusChanged')
}, },
computed: { computed: {
...@@ -2041,7 +2065,12 @@ export default { ...@@ -2041,7 +2065,12 @@ export default {
}) })
this.tableSelectData = [] this.tableSelectData = []
let apires let apires
if (this.isWaiXie) { if (!this.vuex_workunit) {
apires = this.$u.api.getAllTaskList({
...this.tableParams,
...params,
})
} else if (this.isWaiXie) {
apires = this.$u.api.getTaskList({ apires = this.$u.api.getTaskList({
outsourced: 1, outsourced: 1,
workunitId: t.vuex_workunit.workunitId, workunitId: t.vuex_workunit.workunitId,
......
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