Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7497e41d52 | |||
| 7e08cb4aba | |||
| c313a28435 |
9
api/mes/mesMachineSetUpRecord.js
Normal file
9
api/mes/mesMachineSetUpRecord.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function addRecord(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/mesMachineSetupRecord',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -3,39 +3,46 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
export function updateUserPwd(oldPassword, newPassword) {
|
export function updateUserPwd(oldPassword, newPassword) {
|
||||||
const data = {
|
const data = {
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword
|
newPassword
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile/updatePwd',
|
url: '/system/user/profile/updatePwd',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户个人信息
|
// 查询用户个人信息
|
||||||
export function getUserProfile() {
|
export function getUserProfile() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile',
|
url: '/system/user/profile',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户个人信息
|
// 修改用户个人信息
|
||||||
export function updateUserProfile(data) {
|
export function updateUserProfile(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile',
|
url: '/system/user/profile',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户头像上传
|
// 用户头像上传
|
||||||
export function uploadAvatar(data) {
|
export function uploadAvatar(data) {
|
||||||
return upload({
|
return upload({
|
||||||
url: '/system/user/profile/avatar',
|
url: '/system/user/profile/avatar',
|
||||||
name: data.name,
|
name: data.name,
|
||||||
filePath: data.filePath
|
filePath: data.filePath
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getUserInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@@ -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": {
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
@@ -132,3 +127,38 @@ 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>
|
||||||
@@ -5,15 +5,11 @@
|
|||||||
<uni-easyinput type="text" v-model="formData.srcLocationCode" />
|
<uni-easyinput type="text" 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 suffixIcon="scan" @iconClick="scanDestLocationUuid" type="text" @blur="searchSrcLocation"
|
<uni-easyinput suffixIcon="scan" @iconClick="scanDestLocationUuid" type="text" @@confirm="searchSrcLocation"
|
||||||
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>
|
||||||
|
|
||||||
@@ -97,3 +93,19 @@ 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>
|
||||||
@@ -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">
|
||||||
|
|||||||
@@ -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();
|
||||||
@@ -125,3 +121,33 @@ 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>
|
||||||
@@ -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>
|
||||||
|
|
||||||
@@ -88,3 +83,18 @@ 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>
|
||||||
254
pages/mes/jobReport/commissionRecord.vue
Normal file
254
pages/mes/jobReport/commissionRecord.vue
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
<template>
|
||||||
|
<view class="form-container">
|
||||||
|
<uni-forms ref="form" :modelValue="formData" :rules="rules">
|
||||||
|
<uni-forms-item label="作业编码:" :labelWidth='90' name="pwoJobCode">
|
||||||
|
<uni-easyinput @confirm="searchData" 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="startTime">
|
||||||
|
<view>
|
||||||
|
<uni-datetime-picker type="datetime" v-model="formData.startTime" />
|
||||||
|
</view>
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="结束时间:" :labelWidth='90' name="endTime">
|
||||||
|
<view>
|
||||||
|
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
|
||||||
|
</view>
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="人员:" :labelWidth='90' name="staff">
|
||||||
|
<uni-easyinput type="text" v-model="formData.staff" @confirm="searchStaff" />
|
||||||
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="调试单价:" :labelWidth='90' name="programmingDebuggingUnitPrice">
|
||||||
|
<uni-easyinput type="text" v-model="formData.programmingDebuggingUnitPrice" />
|
||||||
|
</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.js";
|
||||||
|
import { listPwoJob } from "@/api/mes/jobReport.js";
|
||||||
|
import { getUserInfo } from "@/api/system/user.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: '秒' }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.$set(this.formData, "staff", this.$store.state.user.name);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
scanBar() {
|
||||||
|
const _this = this;
|
||||||
|
uni.scanCode({
|
||||||
|
scanType: ['barCode', 'qrCode'],
|
||||||
|
success: function(res) {
|
||||||
|
_this.$set(_this.formData, "pwoJobCode", res.result);
|
||||||
|
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
searchStaff() {
|
||||||
|
const _this = this;
|
||||||
|
getUserInfo(_this.formData.staff).then(async res => {
|
||||||
|
_this.$set(_this.formData, "staff", res.data.userName);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
searchData() {
|
||||||
|
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.$set(_this.formData, "pwoCode", job.pwoCode);
|
||||||
|
_this.$set(_this.formData, "ptNoTar", job.ptNoTar);
|
||||||
|
_this.$set(_this.formData, "ptTitleTar", job.ptTitleTar);
|
||||||
|
_this.$set(_this.formData, "opCode", job.opCode);
|
||||||
|
_this.$set(_this.formData, "opTitle", job.opTitle);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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.$set(this.formData, "pwoCode", job.pwoCode);
|
||||||
|
this.$set(this.formData, "ptNoTar", job.ptNoTar);
|
||||||
|
this.$set(this.formData, "ptTitleTar", job.ptTitleTar);
|
||||||
|
this.$set(this.formData, "opCode", job.opCode);
|
||||||
|
this.$set(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();
|
||||||
|
if (!_this.formData.startTime) {
|
||||||
|
_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>
|
||||||
@@ -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": "合并标签",
|
||||||
|
|||||||
Reference in New Issue
Block a user