2 Commits

Author SHA1 Message Date
7e08cb4aba 调机记录 2026-01-04 11:51:56 +08:00
c313a28435 调机记录 2026-01-04 11:51:05 +08:00
10 changed files with 352 additions and 42 deletions

View File

@@ -0,0 +1,9 @@
import request from '@/utils/request'
export function addRecord(data) {
return request({
url: '/mes/mesMachineSetupRecord',
method: 'post',
data: data,
})
}

View File

@@ -2,8 +2,8 @@
"name": "MES", "name": "MES",
"appid": "__UNI__66F7FE2", "appid": "__UNI__66F7FE2",
"description": "", "description": "",
"versionName": "3.4.2", "versionName": "3.4.4",
"versionCode": 342, "versionCode": 344,
"transformPx": false, "transformPx": false,
"sassImplementationName": "node-sass", "sassImplementationName": "node-sass",
"app-plus": { "app-plus": {

View File

@@ -828,6 +828,12 @@
"navigationBarTitleText": "新增模具" "navigationBarTitleText": "新增模具"
} }
}, },
{
"path": "pages/mes/jobReport/commissionRecord",
"style": {
"navigationBarTitleText": "调机记录"
}
},
{ {
"path": "pages/wms/purchase/quickStorage", "path": "pages/wms/purchase/quickStorage",
"style": { "style": {

View File

@@ -1,22 +1,17 @@
<template> <template>
<view> <view class="page-wrap">
<uni-forms ref="form" :modelValue="formData" :rules="rules"> <uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="货位号:" name="locationCode"> <uni-forms-item label="货位号:" name="locationCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanLocationCodeUuid" type="text" <uni-easyinput suffixIcon="scan" @iconClick="scanLocationCodeUuid" v-model="formData.locationCode" />
v-model="formData.locationCode" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="批次号:" name="batchNo"> <uni-forms-item label="批次号:" name="batchNo">
<uni-easyinput suffixIcon="scan" @iconClick="scanBatchNoUuid" type="text" v-model="formData.batchNo" /> <uni-easyinput suffixIcon="scan" @iconClick="scanBatchNoUuid" v-model="formData.batchNo" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<uni-row :gutter="10"> <view class="btns">
<uni-col :span="12"> <u-button type="primary" @click="handleBind" class="sub-btn">绑定</u-button>
<u-button type="success" @click="handleBind">绑定</u-button> <u-button type="warning" @click="handleUnBind" class="pri-btn">解绑</u-button>
</uni-col> </view>
<uni-col :span="12">
<u-button type="primary" @click="handleUnBind">解绑</u-button>
</uni-col>
</uni-row>
</view> </view>
</template> </template>
@@ -131,4 +126,39 @@ export default {
} }
} }
} }
</script> </script>
<style scoped lang="scss">
.page-container {
width: 100%;
height: 100vh;
overflow: hidden;
padding-bottom: 60px;
/* 给按钮留位置 */
box-sizing: border-box;
}
.btns {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-evenly;
background: #fff;
padding: 8px 0;
}
::v-deep .uni-easyinput__content-input {
height: 80rpx;
line-height: 60rpx;
display: flex;
align-items: center;
}
.btns .sub-btn,
.btns .pri-btn {
width: 47%;
height: 60rpx;
}
</style>

View File

@@ -9,11 +9,7 @@
v-model="formData.destLocationCode" /> v-model="formData.destLocationCode" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<uni-row :gutter="10"> <u-button type="success" @click="handleCall">呼叫</u-button>
<uni-col>
<u-button type="success" @click="handleCall">呼叫</u-button>
</uni-col>
</uni-row>
</view> </view>
</template> </template>
@@ -96,4 +92,20 @@ export default {
} }
} }
} }
</script> </script>
<style>
::v-deep .uni-easyinput__content-input {
height: 80rpx !important;
line-height: 60rpx !important;
display: flex !important;
align-items: center !important;
min-height: 80rpx !important;
}
.u-button {
height: 10% !important;
position: absolute;
bottom: 0;
}
</style>

View File

@@ -4,7 +4,7 @@
<view class="title"> <view class="title">
<view class="text-cut">任务类型 : {{item.taskType}}</view> <view class="text-cut">任务类型 : {{item.taskType}}</view>
<view> <view>
<button type="primary" size="mini" @click="choose(item)" style="float: right;">选择任务</button> <button type="primary" size="large" @click="choose(item)" style="float: right;">选择任务</button>
</view> </view>
</view> </view>
<view class="content"> <view class="content">

View File

@@ -1,5 +1,5 @@
<template> <template>
<view> <view class="page-wrap">
<uni-forms ref="form" :modelValue="formData" :rules="rules"> <uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="发货点位:" :labelWidth='100' name="srcLocationCode"> <uni-forms-item label="发货点位:" :labelWidth='100' name="srcLocationCode">
<uni-easyinput type="text" v-model="formData.srcLocationCode" /> <uni-easyinput type="text" v-model="formData.srcLocationCode" />
@@ -14,14 +14,10 @@
<uni-easyinput type="text" v-model="formData.ctnrTyp" /> <uni-easyinput type="text" v-model="formData.ctnrTyp" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<uni-row :gutter="10"> <view class="btns">
<uni-col :span="12"> <u-button type="primary" @click="handleDelivery" class="sub-btn">配送</u-button>
<u-button type="success" @click="handleDelivery">配送</u-button> <u-button type="warning" @click="handleCancle" class="pri-btn">取消</u-button>
</uni-col> </view>
<uni-col :span="12">
<u-button type="primary" @click="handleCancle">取消</u-button>
</uni-col>
</uni-row>
</view> </view>
</template> </template>
@@ -71,7 +67,7 @@ export default {
handleDelivery() { handleDelivery() {
const _this = this; const _this = this;
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
if (_this.formData.srcLocationCode && this.formData.robotType) { if (_this.formData.srcLocationCode && _this.formData.robotType) {
_this.$modal.loading('提交中') _this.$modal.loading('提交中')
delivery(_this.formData).then(res => { delivery(_this.formData).then(res => {
_this.$modal.closeLoading(); _this.$modal.closeLoading();
@@ -124,4 +120,34 @@ export default {
} }
} }
} }
</script> </script>
<style scoped lang="scss">
.btns {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-evenly;
background: #fff;
padding: 8px 0;
}
::v-deep .uni-easyinput__content-input {
height: 80rpx;
line-height: 60rpx;
display: flex;
align-items: center;
}
::v-deep .uni-select {
height: 60rpx;
}
.btns .sub-btn,
.btns .pri-btn {
width: 47%;
height: 60rpx;
}
</style>

View File

@@ -2,18 +2,13 @@
<view> <view>
<uni-forms ref="form" :modelValue="formData" :rules="rules"> <uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="发货点位:" :labelWidth='90' name="srcLocationCode"> <uni-forms-item label="发货点位:" :labelWidth='90' name="srcLocationCode">
<uni-easyinput type="text" suffixIcon="scan" @iconClick="scanSrcLocationUuid" <uni-easyinput suffixIcon="scan" @iconClick="scanSrcLocationUuid" v-model="formData.srcLocationCode" />
v-model="formData.srcLocationCode" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="目的点位:" :labelWidth='90' name="destLocationCode"> <uni-forms-item label="目的点位:" :labelWidth='90' name="destLocationCode">
<uni-easyinput type="text" v-model="formData.destLocationCode" /> <uni-easyinput v-model="formData.destLocationCode" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<uni-row :gutter="10"> <u-button type="primary" @click="handleCall">呼叫</u-button>
<uni-col>
<u-button type="success" @click="handleCall">呼叫</u-button>
</uni-col>
</uni-row>
</view> </view>
</template> </template>
@@ -87,4 +82,19 @@ export default {
} }
} }
} }
</script> </script>
<style scoped>
::v-deep .uni-easyinput__content-input {
height: 80rpx;
line-height: 60rpx;
display: flex;
align-items: center;
}
.u-button {
height: 10% !important;
position: absolute;
bottom: 0;
}
</style>

View File

@@ -0,0 +1,209 @@
<template>
<view class="form-container">
<uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-forms-item label="作业编码:" :labelWidth='90' name="pwoJobCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" v-model="formData.pwoJobCode" />
</uni-forms-item>
<uni-forms-item label="工单:" :labelWidth='90' name="pwoCode">
<uni-easyinput type="text" v-model="formData.pwoCode" />
</uni-forms-item>
<uni-forms-item label="产品编码:" :labelWidth='90' name="ptNoTar">
<uni-easyinput type="text" v-model="formData.ptNoTar" />
</uni-forms-item>
<uni-forms-item label="产品名称:" :labelWidth='90' name="ptTitleTar">
<uni-easyinput type="text" v-model="formData.ptTitleTar" />
</uni-forms-item>
<uni-forms-item label="制程编码:" :labelWidth='90' name="opCode">
<uni-easyinput type="text" v-model="formData.opCode" />
</uni-forms-item>
<uni-forms-item label="制程名称:" :labelWidth='90' name="opTitle">
<uni-easyinput type="text" v-model="formData.opTitle" />
</uni-forms-item>
<uni-forms-item label="结束时间:" :labelWidth='90' name="endTime">
<view class="example-body">
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
</view>
</uni-forms-item>
<view class="form-row">
<uni-forms-item label="调机时长:" :labelWidth='90' name="timeTake" class="form-col">
<uni-easyinput type="text" v-model="timeTake" />
</uni-forms-item>
<uni-forms-item label="时间单位:" :labelWidth='90' name="timeUnit" class="form-col">
<uni-data-select v-model="timeUnit" :localdata="unitOptions" placeholder="选择时间单位" />
</uni-forms-item>
</view>
</uni-forms>
<u-button type="primary" @click="submit">提交</u-button>
</view>
</template>
<script>
import { addRecord } from "@/api/mes/mesMachineSetUpRecord";
import { listPwoJob } from "@/api/mes/jobReport.js";
export default {
data() {
return {
formData: {
machineAdjustmentDuration: null,
},
timeTake: null,
timeUnit: 'h',
rules: {
pwoJobCode: {
rules: [{
required: true,
errorMessage: '请扫描作业编码!'
}]
}
},
unitOptions: [
{ value: 'h', text: '小时' },
{ value: 'm', text: '分钟' },
{ value: 's', text: '秒' }
],
}
},
methods: {
scanBar() {
const _this = this;
uni.scanCode({
scanType: ['barCode', 'qrCode'],
success: function(res) {
_this.formData.pwoJobCode = res.result;
_this.scanBarCode(_this.formData.pwoJobCode);
}
});
},
scanBarCode() {
const _this = this;
if (_this.formData.pwoJobCode) {
let obj = {
code: _this.formData.pwoJobCode
}
listPwoJob(obj).then(async res => {
let jobs = res.rows;
if (jobs.length == 0) {
_this.$modal.msg("未检索到该作业编码相关的信息!");
} else {
let job = jobs[0];
_this.formData.pwoCode = job.pwoCode;
_this.formData.ptNoTar = job.ptNoTar;
_this.formData.ptTitleTar = job.ptTitleTar;
_this.formData.opCode = job.opCode;
_this.formData.opTitle = job.opTitle;
}
})
}
},
submit() {
const _this = this;
this.$refs.form.validate().then(res => {
if (_this.timeTake && _this.timeUnit && _this.formData.endTime) {
_this.changeTime();
_this.formData.startTime = _this.getCurrentDatetime();
const isLegal = new Date(_this.formData.startTime).getTime() < new Date(_this.formData.endTime).getTime();
if (!isLegal) {
_this.$modal.msg("结束时间不能早于开始时间");
return;
}
_this.$modal.loading('提交中')
addRecord(_this.formData).then(res => {
_this.$modal.closeLoading();
_this.$modal.msgSuccess("提交成功!");
_this.reset();
setTimeout(() => {
this.$tab.switchTab("/pages/work/index");
}, 500);
})
} else {
_this.$modal.msg("请将信息补充完整");
}
})
},
changeTime() {
const _this = this;
if (_this.timeUnit === 'h') {
_this.formData.machineAdjustmentDuration = _this.timeTake * 60 * 60;
} else if (_this.timeUnit === 'm') {
_this.formData.machineAdjustmentDuration = _this.timeTake * 60;
} else {
_this.formData.machineAdjustmentDuration = _this.timeTake;
}
},
getCurrentDatetime() {
const now = new Date();
// 年4位
const year = now.getFullYear();
// 月补零2位
const month = String(now.getMonth() + 1).padStart(2, '0');
// 日补零2位
const day = String(now.getDate()).padStart(2, '0');
// 时补零2位
const hour = String(now.getHours()).padStart(2, '0');
// 分补零2位
const minute = String(now.getMinutes()).padStart(2, '0');
// 秒补零2位
const second = String(now.getSeconds()).padStart(2, '0');
// 拼接为 "YYYY-MM-DD HH:mm" 格式
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
},
reset() {
this.timeTake = null;
this.timeUnit = 'h';
this.formData = {
startTime: null,
endTime: null,
pwoJobCode: null,
pwoCode: null,
ptNoTar: null,
ptTitleTar: null,
opCode: null,
opTitle: null,
machineAdjustmentDuration: null
};
}
}
}
</script>
<style scoped>
.form-container {
padding: 15px;
}
.form-row {
display: flex;
align-items: center;
gap: 15px;
/* 两个项之间的间距 */
width: 100%;
margin: 10px 0;
/* 与上下表单项保持默认间距 */
}
/* 并列项平分宽度 */
.form-col {
flex: 1;
min-width: 0;
}
/* 可选统一并列项的label样式避免对齐错乱 */
:deep(.form-col .uni-forms-item__label) {
width: 80px !important;
/* 固定label宽度 */
text-align: left;
}
/* 其他表单项保持默认样式,无需额外修改 */
:deep(.uni-forms-item) {
margin-bottom: 80px;
/* 统一所有表单项的底部间距 */
}
.u-button {
height: 10% !important;
position: absolute;
bottom: 0;
}
</style>

View File

@@ -281,6 +281,14 @@
"style": { "style": {
"navigationBarTitleText": "班产报工" "navigationBarTitleText": "班产报工"
} }
}, {
"path": "/pages/mes/jobReport/commissionRecord",
"permission": "mes:pwoReport:add",
"icon": "icon-gongdan",
"color": "linear-gradient(#95D097,#7BC47D)",
"style": {
"navigationBarTitleText": "调机记录"
}
}] }]
}, { }, {
"name": "合并标签", "name": "合并标签",