报工接口全部重写
This commit is contained in:
parent
bbfaad9630
commit
65461ced79
61
api/workorder/index.js
Normal file
61
api/workorder/index.js
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
// 获取全部工艺路线
|
||||||
|
export function getAllRoute(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/ReportWork/get_all_route',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取全部工艺路线
|
||||||
|
export function getAllGroup(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/ReportWork/get_groups',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取报工工单列表
|
||||||
|
export function getWorkOrderList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/ReportWork/get_workorder_status_list',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开始工单
|
||||||
|
export function doStartWorkOrder(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/ReportWork/start_workorder',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 结束工单
|
||||||
|
export function doFinishWorkOrder(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/ReportWork/finish_workorder',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 工单详情
|
||||||
|
export function getWorkOrderDetail(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/ReportWork/get_workorder_detail',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 无需防错就报工(修改报工表数据)
|
||||||
|
export function updateReport(params) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/Mobile/ReportWork/no_errorProofingAndReportingReport',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -7,7 +7,7 @@ module.exports = {
|
|||||||
// 应用名称
|
// 应用名称
|
||||||
name: "DOAN-PDA",
|
name: "DOAN-PDA",
|
||||||
// 应用版本
|
// 应用版本
|
||||||
version: "1.1.4",
|
version: "1.2.0",
|
||||||
// 应用logo
|
// 应用logo
|
||||||
logo: "/static/logo.png",
|
logo: "/static/logo.png",
|
||||||
// 官方网站
|
// 官方网站
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "DOAN总装车间PDA",
|
"name" : "DOAN总装车间PDA",
|
||||||
"appid" : "__UNI__EFA389B",
|
"appid" : "__UNI__EFA389B",
|
||||||
"description" : "",
|
"description" : "DOAN总装车间PDA",
|
||||||
"versionName" : "1.1.4",
|
"versionName" : "1.2.0",
|
||||||
"versionCode" : 114,
|
"versionCode" : 120,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
|
|||||||
@ -30,26 +30,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { reportWorkOrderFinishNum,manualGenerationOfReportWork,updateProReportwork } from '@/api/workorder/proreportwork.js';
|
import { manualGenerationOfReportWork,updateReport } from '@/api/workorder/index.js';
|
||||||
export default {
|
export default {
|
||||||
onLoad: function (option) {
|
onLoad: function (option) {
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.formData = JSON.parse(JSON.stringify(option));
|
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() {
|
data() {
|
||||||
@ -69,10 +54,10 @@ export default {
|
|||||||
title:'报工中……'
|
title:'报工中……'
|
||||||
})
|
})
|
||||||
const params = {
|
const params = {
|
||||||
id:this.formData.id,
|
workorder:this.formData.fkWorkorder,
|
||||||
finishedNum:this.formData.finishedNum
|
reportNum:this.formData.finishedNum
|
||||||
}
|
}
|
||||||
updateProReportwork(params).then(res=>{
|
updateReport(params).then(res=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@ -98,6 +98,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { errorProofingAndReportingWork,updateProReportwork,noErrorProofingAndReportingReport } from '@/api/workorder/proreportwork.js';
|
import { errorProofingAndReportingWork,updateProReportwork,noErrorProofingAndReportingReport } from '@/api/workorder/proreportwork.js';
|
||||||
import { GetWorkOrderDetail, startWorkOrder, finishWorkOrder } from '@/api/workorder/proworkorder.js';
|
import { GetWorkOrderDetail, startWorkOrder, finishWorkOrder } from '@/api/workorder/proworkorder.js';
|
||||||
|
import { getWorkOrderDetail,doStartWorkOrder,updateReport,doFinishWorkOrder } from '@/api/workorder/index.js';
|
||||||
export default {
|
export default {
|
||||||
onLoad: function (option) {
|
onLoad: function (option) {
|
||||||
this.lineCode = option.lineCode;
|
this.lineCode = option.lineCode;
|
||||||
@ -137,7 +138,7 @@ export default {
|
|||||||
const params = {
|
const params = {
|
||||||
workorder: strArray[0]
|
workorder: strArray[0]
|
||||||
};
|
};
|
||||||
let res1 = await GetWorkOrderDetail(params);
|
let res1 = await getWorkOrderDetail(params);
|
||||||
if (res1 === null || res1.code !== 200) {
|
if (res1 === null || res1.code !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
@ -174,7 +175,7 @@ export default {
|
|||||||
const params = {
|
const params = {
|
||||||
workorder: this.formData.workorder
|
workorder: this.formData.workorder
|
||||||
};
|
};
|
||||||
startWorkOrder(params).then((res) => {
|
doStartWorkOrder(params).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@ -249,7 +250,7 @@ export default {
|
|||||||
reportNum:this.finishedNum
|
reportNum:this.finishedNum
|
||||||
}
|
}
|
||||||
|
|
||||||
noErrorProofingAndReportingReport(params).then(res=>{
|
updateReport(params).then(res=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@ -259,7 +260,7 @@ export default {
|
|||||||
const params2 = {
|
const params2 = {
|
||||||
workorder: that.formData.workorder
|
workorder: that.formData.workorder
|
||||||
};
|
};
|
||||||
finishWorkOrder(params2).then((res) => {
|
doFinishWorkOrder(params2).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@ -285,7 +286,7 @@ export default {
|
|||||||
const params = {
|
const params = {
|
||||||
workorder: this.formData.workorder
|
workorder: this.formData.workorder
|
||||||
};
|
};
|
||||||
finishWorkOrder(params).then((res) => {
|
doFinishWorkOrder(params).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@ -313,7 +314,7 @@ export default {
|
|||||||
reportNum:this.finishedNum
|
reportNum:this.finishedNum
|
||||||
}
|
}
|
||||||
|
|
||||||
noErrorProofingAndReportingReport(params).then(res=>{
|
updateReport(params).then(res=>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
@ -323,7 +324,7 @@ export default {
|
|||||||
const params2 = {
|
const params2 = {
|
||||||
workorder: that.formData.workorder
|
workorder: that.formData.workorder
|
||||||
};
|
};
|
||||||
finishWorkOrder(params2).then((res) => {
|
doFinishWorkOrder(params2).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
|
|||||||
@ -44,9 +44,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// 基础数据
|
// 基础数据
|
||||||
import { GetAllRoute, GetAllGroup } from '@/api/workorder/proworkorder.js';
|
import { getAllRoute, getAllGroup, getWorkOrderList } from '@/api/workorder/index.js';
|
||||||
// 工单信息
|
// 工单信息
|
||||||
import { getReportWorkOrderList,getWorkOrderStatusList } from '@/api/workorder/proreportwork.js';
|
// import { getReportWorkOrderList,getWorkOrderStatusList } from '@/api/workorder/proreportwork.js';
|
||||||
import { tansParams } from '@/utils/common';
|
import { tansParams } from '@/utils/common';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -58,7 +58,7 @@ export default {
|
|||||||
status: 1,
|
status: 1,
|
||||||
dateTime: this.$dayjs().format('YYYY-MM-DD')
|
dateTime: this.$dayjs().format('YYYY-MM-DD')
|
||||||
},
|
},
|
||||||
current:0,
|
current: 0,
|
||||||
selectItems: ['未开始', '进行中', '已完成'],
|
selectItems: ['未开始', '进行中', '已完成'],
|
||||||
value: '',
|
value: '',
|
||||||
// 线别
|
// 线别
|
||||||
@ -76,7 +76,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
this.getSessionStorage();
|
this.getSessionStorage();
|
||||||
this.current = this.query.status - 1
|
this.current = this.query.status - 1;
|
||||||
//this.getList();
|
//this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -97,11 +97,11 @@ export default {
|
|||||||
},
|
},
|
||||||
onClickSelect(e) {
|
onClickSelect(e) {
|
||||||
this.query.status = e.currentIndex + 1;
|
this.query.status = e.currentIndex + 1;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
async getSelectOptions() {
|
async getSelectOptions() {
|
||||||
uni.showLoading();
|
uni.showLoading();
|
||||||
const res1 = await GetAllRoute();
|
const res1 = await getAllRoute();
|
||||||
if (res1.code === 200) {
|
if (res1.code === 200) {
|
||||||
this.lineOptions = res1.data.map((item) => {
|
this.lineOptions = res1.data.map((item) => {
|
||||||
return {
|
return {
|
||||||
@ -112,7 +112,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const res2 = await GetAllGroup();
|
const res2 = await getAllGroup();
|
||||||
if (res2.code === 200) {
|
if (res2.code === 200) {
|
||||||
this.groupOptions = res2.data.map((item) => {
|
this.groupOptions = res2.data.map((item) => {
|
||||||
return {
|
return {
|
||||||
@ -147,15 +147,15 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
const params = {
|
const params = {
|
||||||
groupCode: this.query.groupCode,
|
group_code: this.query.groupCode,
|
||||||
status: this.query.status,
|
status: this.query.status,
|
||||||
timeRange: [this.query.dateTime,this.query.dateTime]
|
handleDate: this.query.dateTime
|
||||||
};
|
};
|
||||||
getReportWorkOrderList(params).then((res) => {
|
getWorkOrderList(params).then((res) => {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.setSessionStorage(this.query);
|
this.setSessionStorage(this.query);
|
||||||
this.dataList = res.data.result.map((item) => {
|
this.dataList = res.data.map((item) => {
|
||||||
let statusStr = that.getWorkOrderStatus(item.status);
|
let statusStr = that.getWorkOrderStatus(item.status);
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
@ -233,4 +233,4 @@ export default {
|
|||||||
.bg-green {
|
.bg-green {
|
||||||
background-color: rgb(209.4, 236.7, 195.9) !important;
|
background-color: rgb(209.4, 236.7, 195.9) !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user