Compare commits
6 Commits
v3.4.4
...
256bbeb705
| Author | SHA1 | Date | |
|---|---|---|---|
| 256bbeb705 | |||
| 3befba7767 | |||
| c670c32515 | |||
| 1689c0fc6e | |||
| 9638599dce | |||
| 7497e41d52 |
@@ -85,3 +85,10 @@ export function delEmployeeLineRel(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getEmployeeByCode(code) {
|
||||
return request({
|
||||
url: '/basic/employee/getEmpByCode/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -39,3 +39,10 @@ export function uploadAvatar(data) {
|
||||
filePath: data.filePath
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserInfo(id) {
|
||||
return request({
|
||||
url: '/system/user/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "MES",
|
||||
"appid" : "__UNI__66F7FE2",
|
||||
"description" : "",
|
||||
"versionName": "3.4.4",
|
||||
"versionCode": 344,
|
||||
"versionName" : "3.4.9",
|
||||
"versionCode" : 349,
|
||||
"transformPx" : false,
|
||||
"sassImplementationName" : "node-sass",
|
||||
"app-plus" : {
|
||||
|
||||
@@ -73,7 +73,6 @@ export default {
|
||||
bind(_this.formData).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("绑定成功!");
|
||||
_this.reset();
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
@@ -102,7 +101,6 @@ export default {
|
||||
unBind(_this.formData.locationCode).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("解绑成功!");
|
||||
_this.reset();
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
@@ -117,13 +115,6 @@ export default {
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.formData = {
|
||||
locationCode: null,
|
||||
batchNo: null,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<uni-easyinput type="text" v-model="formData.srcLocationCode" />
|
||||
</uni-forms-item>
|
||||
<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" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
@@ -75,7 +75,6 @@ export default {
|
||||
addDeliveryTask(_this.formData).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("提交成功!");
|
||||
_this.reset();
|
||||
setTimeout(() => {
|
||||
_this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
@@ -85,11 +84,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.formData.srcLocationCode = null;
|
||||
this.formData.destLocationCode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -72,7 +72,6 @@ export default {
|
||||
delivery(_this.formData).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("提交成功!");
|
||||
_this.reset();
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
@@ -96,7 +95,6 @@ export default {
|
||||
cancel(arr).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("取消成功!");
|
||||
_this.reset();
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
@@ -108,16 +106,6 @@ export default {
|
||||
});
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
this.formData = {
|
||||
id: null,
|
||||
srcLocationCode: null,
|
||||
taskTyp: null,
|
||||
robotType: null,
|
||||
ctnrTyp: null,
|
||||
};
|
||||
this.destLocationCode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -66,7 +66,6 @@ export default {
|
||||
addDeliveryTask(_this.formData).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("提交成功!");
|
||||
_this.reset();
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
@@ -76,10 +75,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
this.formData.srcLocationCode = null;
|
||||
this.formData.destLocationCode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<view class="form-container">
|
||||
<view>
|
||||
<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-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" />
|
||||
@@ -19,27 +20,40 @@
|
||||
<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 class="example-body">
|
||||
<view>
|
||||
<uni-datetime-picker type="datetime" v-model="formData.endTime" />
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<view class="form-row">
|
||||
<uni-forms-item label="人员:" :labelWidth='90' name="staff">
|
||||
<uni-easyinput type="text" v-model="formData.staff" @confirm="searchStaff" />
|
||||
</uni-forms-item>
|
||||
<uni-row>
|
||||
<uni-col :span="12">
|
||||
<uni-forms-item label="调机时长:" :labelWidth='90' name="timeTake" class="form-col">
|
||||
<uni-easyinput type="text" v-model="timeTake" />
|
||||
</uni-forms-item>
|
||||
</uni-col>
|
||||
<uni-col :span="12">
|
||||
<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-col>
|
||||
</uni-row>
|
||||
</uni-forms>
|
||||
<u-button type="primary" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addRecord } from "@/api/mes/mesMachineSetUpRecord";
|
||||
import { addRecord } from "@/api/mes/mesMachineSetUpRecord.js";
|
||||
import { listPwoJob } from "@/api/mes/jobReport.js";
|
||||
import { getEmployeeByCode } from "@/api/basic/employee.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -63,17 +77,51 @@ export default {
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$set(this.formData, "staff", this.$store.state.employee.empName);
|
||||
},
|
||||
methods: {
|
||||
scanBar() {
|
||||
const _this = this;
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode'],
|
||||
success: function(res) {
|
||||
_this.formData.pwoJobCode = res.result;
|
||||
_this.$set(_this.formData, "pwoJobCode", res.result);
|
||||
_this.scanBarCode(_this.formData.pwoJobCode);
|
||||
}
|
||||
});
|
||||
},
|
||||
searchStaff() {
|
||||
const _this = this;
|
||||
getEmployeeByCode(_this.formData.staff).then(async res => {
|
||||
if(res.data != null){
|
||||
_this.$set(_this.formData, "staff", res.data.name);
|
||||
}else{
|
||||
_this.$modal.msg("未查询到该员工!");
|
||||
}
|
||||
})
|
||||
},
|
||||
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) {
|
||||
@@ -86,11 +134,11 @@ export default {
|
||||
_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;
|
||||
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);
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -100,7 +148,9 @@ export default {
|
||||
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("结束时间不能早于开始时间");
|
||||
@@ -110,7 +160,7 @@ export default {
|
||||
addRecord(_this.formData).then(res => {
|
||||
_this.$modal.closeLoading();
|
||||
_this.$modal.msgSuccess("提交成功!");
|
||||
_this.reset();
|
||||
// _this.reset();
|
||||
setTimeout(() => {
|
||||
this.$tab.switchTab("/pages/work/index");
|
||||
}, 500);
|
||||
@@ -148,62 +198,9 @@ export default {
|
||||
// 拼接为 "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>
|
||||
</style>
|
||||
@@ -283,7 +283,7 @@
|
||||
}
|
||||
}, {
|
||||
"path": "/pages/mes/jobReport/commissionRecord",
|
||||
"permission": "mes:pwoReport:add",
|
||||
"permission": "mes:mesMachineSetupRecord:list",
|
||||
"icon": "icon-gongdan",
|
||||
"color": "linear-gradient(#95D097,#7BC47D)",
|
||||
"style": {
|
||||
|
||||
Reference in New Issue
Block a user