PDA产线扫码报工
This commit is contained in:
parent
e0c3a5eb38
commit
9b2e98e679
79
api/workorder/proreportwork.js
Normal file
79
api/workorder/proreportwork.js
Normal file
@ -0,0 +1,79 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
/**
|
||||
* 获取报工工单列表
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getReportWorkOrderList(quary) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProReportwork/list',
|
||||
method: 'post',
|
||||
data:quary
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 如果没有报工记录,先生成报工记录
|
||||
* @param {Id}
|
||||
*/
|
||||
export function manualGenerationOfReportWork(quary) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProReportwork/manual_generation_reportwork',
|
||||
method: 'get',
|
||||
params:quary
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报工表(完成报工)
|
||||
* @param data
|
||||
*/
|
||||
export function updateProReportwork(data) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProReportwork',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报工表详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getProReportwork(id) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProReportwork/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工单进度
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function getWorkOrderProgress(query) {
|
||||
return request({
|
||||
url: '/kanban/workorderProgress/get_workorder_progress',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 放错扫码报工(扫标签码)
|
||||
* @param {主键} pid
|
||||
* <returns> -1 此产品不属于此工单 0 报工失败 1 成功报工 </returns>
|
||||
*/
|
||||
export function errorProofingAndReportingWork(query) {
|
||||
return request({
|
||||
url: '/kanban/workorderProgress/errorProofingAndReportingWork',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
106
api/workorder/proworkorder.js
Normal file
106
api/workorder/proworkorder.js
Normal file
@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 生产工单分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listProWorkorder(data) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProWorkorder/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产工单(不校验)分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listProWorkorderNoCheck(data) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProWorkorder/list_nocheck',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产工单详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getProWorkorder(id) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProWorkorder/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部工艺路线
|
||||
* @param {查询条件} params
|
||||
*/
|
||||
export function GetAllRoute() {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProWorkorder/get_all_route',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部组
|
||||
* @param {查询条件} params
|
||||
*/
|
||||
export function GetAllGroup() {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProWorkorder/get_groups',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 工单进度跟踪
|
||||
* @param {查询条件} params
|
||||
*/
|
||||
export function GetWorkorderTraceProgressList(data) {
|
||||
return request({
|
||||
url: '/mes/productManagement/ProWorkorder/get_workorder_trace_progress',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工单详情
|
||||
* @param {查询条件} params
|
||||
*/
|
||||
export function GetWorkOrderDetail(params) {
|
||||
return request({
|
||||
url: '/kanban/workorderProgress/get_workorder_detail',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始工单
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function startWorkOrder(query) {
|
||||
return request({
|
||||
url: '/kanban/workorderProgress/start_workorder',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成工单
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function finishWorkOrder(query) {
|
||||
return request({
|
||||
url: '/kanban/workorderProgress/finish_workorder2',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
21
pages.json
21
pages.json
@ -119,6 +119,27 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "备料任务详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/produceManagement/workorder/workorder",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "工单列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/produceManagement/reportWorkOrder/reportWorkOrder",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "工单报工"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/produceManagement/scanWorkOrder/scanWorkOrder",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "扫码报工"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
|
||||
@ -12,9 +12,20 @@
|
||||
</uni-swiper-dot>
|
||||
|
||||
<!-- 宫格组件 -->
|
||||
<uni-section title="产线管理" type="line"></uni-section>
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="4" :showBorder="false" @change="changeProduceGrid">
|
||||
<uni-grid-item v-for="(item, index) in produceOptions" :key="index" :index="index">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons :type="item.icon" size="30"></uni-icons>
|
||||
<text class="text">{{ item.name }}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
<uni-section title="物料管理" type="line"></uni-section>
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
|
||||
<uni-grid :column="4" :showBorder="false" @change="changeMaterialGrid">
|
||||
<uni-grid-item v-for="(item, index) in materialOptions" :key="index" :index="index">
|
||||
<view class="grid-item-box">
|
||||
<uni-icons :type="item.icon" size="30"></uni-icons>
|
||||
@ -44,6 +55,14 @@ export default {
|
||||
image: '/static/images/door/3.jpg'
|
||||
}
|
||||
],
|
||||
// 生产模块
|
||||
produceOptions: [
|
||||
{
|
||||
name: '产线报工',
|
||||
icon: 'folder-add-filled',
|
||||
url: '/pages/produceManagement/workorder/workorder'
|
||||
}
|
||||
],
|
||||
// 物料模块
|
||||
materialOptions: [
|
||||
{
|
||||
@ -51,11 +70,11 @@ export default {
|
||||
icon: 'upload-filled',
|
||||
url: '/pages/materialManagement/preparationByPlan/index'
|
||||
},
|
||||
{
|
||||
name: '工单备料',
|
||||
icon: 'upload-filled',
|
||||
url: '/pages/materialManagement/materialPreparation/index'
|
||||
}
|
||||
// {
|
||||
// name: '工单备料',
|
||||
// icon: 'upload-filled',
|
||||
// url: '/pages/materialManagement/materialPreparation/index'
|
||||
// }
|
||||
]
|
||||
};
|
||||
},
|
||||
@ -66,7 +85,18 @@ export default {
|
||||
changeSwiper(e) {
|
||||
this.current = e.detail.current;
|
||||
},
|
||||
changeGrid(e) {
|
||||
// 产线功能
|
||||
changeProduceGrid(e) {
|
||||
const _url = this.produceOptions[e.detail.index].url;
|
||||
uni.navigateTo({
|
||||
url: _url,
|
||||
fail: () => {
|
||||
this.$modal.showToast('模块建设中~');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 物料功能
|
||||
changeMaterialGrid(e) {
|
||||
const _url = this.materialOptions[e.detail.index].url;
|
||||
uni.navigateTo({
|
||||
url: _url,
|
||||
|
||||
108
pages/produceManagement/reportWorkOrder/reportWorkOrder.vue
Normal file
108
pages/produceManagement/reportWorkOrder/reportWorkOrder.vue
Normal file
@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<!-- 工单报工 -->
|
||||
<view>
|
||||
<uni-card>
|
||||
<uni-forms :modelValue="formData" label-width="80px" label-align="right">
|
||||
<uni-forms-item label="工单号" name="fkWorkorder">
|
||||
<span>{{formData.fkWorkorder}}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="产品编号" name="productionCode">
|
||||
<span>{{formData.productionCode}}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="产品名称" name="productionName">
|
||||
<span>{{formData.productionName}}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格" name="specification">
|
||||
<span>{{formData.specification}}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="计划生产" name="dispatchNum">
|
||||
<span>{{formData.dispatchNum}}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="报工数" name="finishedNum">
|
||||
<uni-easyinput type="number" v-model.number="formData.finishedNum" placeholder="请输入报工数" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</uni-card>
|
||||
<view class="bottom-box">
|
||||
<button :disabled="loading" type="primary" @click="submit">确认报工</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { reportWorkOrderFinishNum,manualGenerationOfReportWork,updateProReportwork } from '@/api/workorder/proreportwork.js';
|
||||
export default {
|
||||
onLoad: function (option) {
|
||||
this.$nextTick(()=>{
|
||||
this.formData = JSON.parse(JSON.stringify(option));
|
||||
if(this.formData.id === null || this.formData.id === ''){
|
||||
this.loading = true
|
||||
manualGenerationOfReportWork({workorder:this.formData.fkWorkorder}).then(res=>{
|
||||
if(res.code === 200){
|
||||
this.formData.id = res.data
|
||||
this.loading = false
|
||||
}else{
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '数据异常',
|
||||
});
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
formData: {
|
||||
id:null,
|
||||
finishNum:0
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 报工提交
|
||||
submit() {
|
||||
this.loading = true;
|
||||
uni.showLoading({
|
||||
title:'报工中……'
|
||||
})
|
||||
const params = {
|
||||
id:this.formData.id,
|
||||
finishedNum:this.formData.finishedNum
|
||||
}
|
||||
updateProReportwork(params).then(res=>{
|
||||
if(res.code === 200){
|
||||
this.loading = false;
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '报工成功',
|
||||
duration:2000,
|
||||
success() {
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack(-1)
|
||||
},2000)
|
||||
|
||||
}
|
||||
});
|
||||
uni.hideLoading();
|
||||
}else{
|
||||
uni.hideLoading();
|
||||
}
|
||||
}).catch(()=>{
|
||||
uni.hideLoading();
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
</style>
|
||||
199
pages/produceManagement/scanWorkOrder/scanWorkOrder.vue
Normal file
199
pages/produceManagement/scanWorkOrder/scanWorkOrder.vue
Normal file
@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<!-- 扫码报工 -->
|
||||
<view>
|
||||
<uni-card v-if="!formData.workorder">
|
||||
<text>{{ '线别:' + lineCode }}</text>
|
||||
<text style="margin-left: 20px">{{ '组别' + groupCode }}</text>
|
||||
<ScanInput @scanConfirm="scanConfirm" placeholder="请扫报工码"></ScanInput>
|
||||
</uni-card>
|
||||
<uni-card v-if="formData.workorder && formData.status === 2">
|
||||
<text>{{ '线别:' + lineCode }}</text>
|
||||
<text style="margin-left: 20px">{{ '组别' + groupCode }}</text>
|
||||
<ScanInput @scanConfirm="scanConfirm2" placeholder="请扫产品码"></ScanInput>
|
||||
</uni-card>
|
||||
<uni-card v-if="formData.workorder">
|
||||
<uni-forms :modelValue="formData" label-width="80px" label-align="right">
|
||||
<uni-forms-item label="工单号" name="workorder">
|
||||
<span>{{ formData.workorder }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="产品编号" name="productionCode">
|
||||
<span>{{ formData.productionCode }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="产品名称" name="productionName">
|
||||
<span>{{ formData.productionName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格" name="specification">
|
||||
<span>{{ formData.specification }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="工单状态" name="status">
|
||||
<span style="color: grey" v-if="formData.status === 1">未开始</span>
|
||||
<span style="color: blue" v-if="formData.status === 2">进行中</span>
|
||||
<span style="color: green" v-if="formData.status === 3">已完成</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="计划生产" name="deliveryNum">
|
||||
<span>{{ formData.deliveryNum }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="已报工数" name="finishedNum">
|
||||
<span style="font-size: 26px;">{{ formData.finishNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</uni-card>
|
||||
<view class="bottom-box row-box" v-if="formData.workorder">
|
||||
<button :disabled="loading" type="primary" @click="doStartWorkOrder">开始工单</button>
|
||||
<button :disabled="loading" type="warn" @click="doFinfishWorkOrder">完成工单</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { errorProofingAndReportingWork } from '@/api/workorder/proreportwork.js';
|
||||
import { GetWorkOrderDetail,startWorkOrder,finishWorkOrder } from '@/api/workorder/proworkorder.js';
|
||||
export default {
|
||||
onLoad: function (option) {
|
||||
this.lineCode = option.lineCode;
|
||||
this.groupCode = option.groupCode;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lineCode: '',
|
||||
groupCode: '',
|
||||
loading: false,
|
||||
formData: {
|
||||
id: null,
|
||||
finishNum: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 扫工单码结果
|
||||
async scanConfirm(val) {
|
||||
this.loading = true;
|
||||
if (val === '' || val === null) {
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
let strArray = val.split('^');
|
||||
const params = {
|
||||
workorder: strArray[0]
|
||||
};
|
||||
let res1 = await GetWorkOrderDetail(params);
|
||||
if (res1.code !== 200) {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '标签异常'
|
||||
});
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
if (res1.data.lineCode !== this.lineCode || res1.data.groupCode !== this.groupCode) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '扫码结果异常,该工单不属于此线别或组别'
|
||||
});
|
||||
this.loading = false;
|
||||
return;
|
||||
}
|
||||
this.formData = res1.data;
|
||||
this.loading = false;
|
||||
},
|
||||
// 扫产品码结果
|
||||
async scanConfirm2(val) {
|
||||
if (val === '' || val === null) {
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
workorder: this.formData.workorder,
|
||||
labelContext: val
|
||||
};
|
||||
let res1 = await errorProofingAndReportingWork(params);
|
||||
if (res1.code !== 200) {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '标签异常'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (res1.data === -1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '此产品不属于此工单'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (res1.data === 0) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '报工失败'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (res1.data === 1) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '报工成功'
|
||||
});
|
||||
this.updateWorkOrderDetail(params)
|
||||
return;
|
||||
}
|
||||
},
|
||||
// 更新工单信息
|
||||
updateWorkOrderDetail(params){
|
||||
GetWorkOrderDetail(params).then(res=>{
|
||||
if(res.code === 200){
|
||||
this.formData = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 开始工单
|
||||
doStartWorkOrder() {
|
||||
this.loading = true
|
||||
const params = {
|
||||
workorder:this.formData.workorder
|
||||
}
|
||||
startWorkOrder(params).then(res=>{
|
||||
if(res.code === 200){
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '工单开始成功'
|
||||
});
|
||||
this.updateWorkOrderDetail(params)
|
||||
this.loading = false
|
||||
}else{
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 完成工单
|
||||
doFinfishWorkOrder() {
|
||||
const params = {
|
||||
workorder:this.formData.workorder
|
||||
}
|
||||
finishWorkOrder(params).then(res=>{
|
||||
if(res.code === 200){
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '工单完成成功'
|
||||
});
|
||||
|
||||
this.updateWorkOrderDetail(params)
|
||||
this.loading = false
|
||||
}else{
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.row-box {
|
||||
display: flex;
|
||||
}
|
||||
span {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
</style>
|
||||
200
pages/produceManagement/workorder/workorder.vue
Normal file
200
pages/produceManagement/workorder/workorder.vue
Normal file
@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 工单列表 -->
|
||||
<view class="query-card">
|
||||
<uni-forms style="width: 100%" ref="form">
|
||||
<uni-forms-item label="日期">
|
||||
<uni-datetime-picker type="date" :clear-icon="false" v-model="query.dateTime" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="线别">
|
||||
<uni-data-select v-model="query.lineCode" :localdata="lineOptions" :clear="false"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="组别">
|
||||
<uni-data-select v-model="query.groupCode" :localdata="groupOptions" :clear="false"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<button type="primary" plain @click="getList()">
|
||||
<uni-icons color="#2979ff" type="search" size="18"></uni-icons>
|
||||
查询
|
||||
</button>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<scroll-view class="scroll-view" scroll-y="true">
|
||||
<uni-list style="width: 100%">
|
||||
<uni-list-item
|
||||
v-for="(item, index) in dataList"
|
||||
:key="index"
|
||||
:title="item.title"
|
||||
:note="item.note"
|
||||
rightText="报工"
|
||||
link
|
||||
@click="onListItemClick(item)"
|
||||
></uni-list-item>
|
||||
</uni-list>
|
||||
</scroll-view>
|
||||
<view class="bottom-box">
|
||||
<button type="primary" @click="scanToReport">
|
||||
<uni-icons color="#fff" type="scan" size="18"></uni-icons>
|
||||
扫码报工
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 基础数据
|
||||
import { GetAllRoute, GetAllGroup } from '@/api/workorder/proworkorder.js';
|
||||
// 工单信息
|
||||
import { getReportWorkOrderList } from '@/api/workorder/proreportwork.js';
|
||||
import { tansParams } from '@/utils/common';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 查询条件
|
||||
query: {
|
||||
lineCode: '1',
|
||||
groupCode: '1',
|
||||
dateTime: this.$dayjs().format('YYYY-MM-DD')
|
||||
},
|
||||
value: '',
|
||||
// 线别
|
||||
lineOptions: [],
|
||||
// 组别
|
||||
groupOptions: [],
|
||||
// 工单
|
||||
dataList: [],
|
||||
workOrderSelect: '',
|
||||
sessionKey: '_WorkorderSearch'
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
onShow: function () {
|
||||
this.getSessionStorage();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 初始化数据
|
||||
this.getSelectOptions();
|
||||
},
|
||||
async getSelectOptions() {
|
||||
uni.showLoading();
|
||||
const res1 = await GetAllRoute();
|
||||
if (res1.code === 200) {
|
||||
this.lineOptions = res1.data.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
text: `${item.name}`,
|
||||
value: `${item.code}`
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
const res2 = await GetAllGroup();
|
||||
if (res2.code === 200) {
|
||||
this.groupOptions = res2.data.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
text: `${item.groupName}`,
|
||||
value: `${item.groupCode}`
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
uni.hideLoading();
|
||||
},
|
||||
setSessionStorage(query) {
|
||||
try {
|
||||
const _query = JSON.stringify(query);
|
||||
return uni.setStorageSync(this.sessionKey, _query);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
getSessionStorage() {
|
||||
try {
|
||||
const _query = JSON.parse(uni.getStorageSync(this.sessionKey));
|
||||
if (_query != '' && _query != null) {
|
||||
this.query = _query;
|
||||
}
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
// 获取数据
|
||||
getList() {
|
||||
this.dataList = [];
|
||||
const params = {
|
||||
pageIndex: 1,
|
||||
pageSize: 1000,
|
||||
groupCode: this.query.groupCode,
|
||||
lineCode: this.query.lineCode,
|
||||
timeRange: [this.query.dateTime, this.query.dateTime]
|
||||
};
|
||||
getReportWorkOrderList(params).then((res) => {
|
||||
console.log(res.data);
|
||||
if (res.code === 200) {
|
||||
this.setSessionStorage(this.query);
|
||||
this.dataList = res.data.result.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
workOrderInfo: item,
|
||||
title: `工单号:${item.fkWorkorder}`,
|
||||
note: `${item.productionName} ${item.productionCode}`
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
WorkOrderStatusColor(status) {
|
||||
const list = ['', '未开始', '已开始', '已完成'];
|
||||
const colorList = ['#fff', '#8f939c', '#2979ff', '#18bc37'];
|
||||
return colorList[status * 1];
|
||||
},
|
||||
// 工单点击
|
||||
onListItemClick(item) {
|
||||
const params = item.workOrderInfo;
|
||||
uni.navigateTo({
|
||||
url: '/pages/produceManagement/reportWorkOrder/reportWorkOrder?' + tansParams(params)
|
||||
});
|
||||
},
|
||||
// 扫码报工
|
||||
scanToReport() {
|
||||
const params = this.query;
|
||||
uni.navigateTo({
|
||||
url: '/pages/produceManagement/scanWorkOrder/scanWorkOrder?' + tansParams(params)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.query-card {
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
}
|
||||
.row {
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.card-box {
|
||||
width: 100%;
|
||||
}
|
||||
.scroll-view {
|
||||
height: 760rpx;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user