Browse Source

2025-10-17

过站采集报工增加上下岗操作
master
fengyuan_yang 6 months ago
parent
commit
6443c669da
  1. 6
      src/api/yieldReport/produce_order.js
  2. 29
      src/views/modules/yieldReport/com_finish_roll.vue
  3. 5
      src/views/modules/yieldReport/com_produce_report_normal.vue
  4. 3
      src/views/modules/yieldReport/com_split_order_report.vue
  5. 205
      src/views/modules/yieldReport/com_switch_operator.vue
  6. 3
      src/views/modules/yieldReport/otherReport/change_packaging.vue
  7. 3
      src/views/modules/yieldReport/otherReport/fqc_produce_report_normal.vue
  8. 3
      src/views/modules/yieldReport/otherReport/fqc_split_roll_report.vue
  9. 3
      src/views/modules/yieldReport/otherReport/rework_inspect_report.vue

6
src/api/yieldReport/produce_order.js

@ -50,3 +50,9 @@ export const removeOperatorOnDuty = data => createAPI('schedule/removeOperatorOn
// 删除操作员数据 // 删除操作员数据
export const deleteOperatorData = data => createAPI('schedule/deleteOperatorData', 'POST', data) export const deleteOperatorData = data => createAPI('schedule/deleteOperatorData', 'POST', data)
// 更新单行操作员时间
export const updateOperatorTime = data => createAPI('schedule/updateOperatorTime', 'POST', data)
// 批量更新操作员时间
export const batchUpdateOperatorTime = data => createAPI('schedule/batchUpdateOperatorTime', 'POST', data)

29
src/views/modules/yieldReport/com_finish_roll.vue

@ -25,6 +25,10 @@
<el-button class="customer-bun-min" type="primary" @click="closeDialog" style="margin-left: 10px; margin-bottom: 5px;"> <el-button class="customer-bun-min" type="primary" @click="closeDialog" style="margin-left: 10px; margin-bottom: 5px;">
{{buttons.closeButton}}</el-button> {{buttons.closeButton}}</el-button>
</el-form-item> </el-form-item>
<el-form-item class="customer-button">
<el-button class="customer-bun-min" type="primary" @click="openAttendanceModal" style="margin-left: 10px; margin-bottom: 5px;">
考勤修改</el-button>
</el-form-item>
<!-- <el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">多语言设置</el-button>--> <!-- <el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">多语言设置</el-button>-->
</el-col> </el-col>
</el-row> </el-row>
@ -232,6 +236,11 @@
<!--打印卷标签--> <!--打印卷标签-->
<com-roll-label ref="comRollLabel"></com-roll-label> <com-roll-label ref="comRollLabel"></com-roll-label>
<!-- 操作员切换(考勤修改) -->
<comSwitchOperator ref="comSwitchOperator" :close-on-click-modal="false"
:visible.sync="showOperatorFlag">
</comSwitchOperator>
</div> </div>
</template> </template>
@ -241,6 +250,7 @@
/*添加组件*/ /*添加组件*/
import comExceptionReason from "./com_exception_reason";// import comExceptionReason from "./com_exception_reason";//
import comSelectShift from "./com_select_shift";// import comSelectShift from "./com_select_shift";//
import comSwitchOperator from './com_switch_operator';//()
import { import {
getCurrentRollReportedQty, getCurrentRollReportedQty,
countSfdcTimeQty, countSfdcTimeQty,
@ -283,6 +293,7 @@ export default {
showDefault: false, showDefault: false,
showExceptionFlag: false, showExceptionFlag: false,
showShiftFlag: false, showShiftFlag: false,
showOperatorFlag: false,
showNumFlag:false, showNumFlag:false,
sfdcTimeList: [], sfdcTimeList: [],
preItemNo: 0, preItemNo: 0,
@ -907,6 +918,7 @@ export default {
comExceptionReason,/*异常原因的组件*/ comExceptionReason,/*异常原因的组件*/
comSelectShift,/*班次选择的组件*/ comSelectShift,/*班次选择的组件*/
comRollLabel, comRollLabel,
comSwitchOperator,/*操作员切换(考勤修改)*/
}, },
methods: { methods: {
sORoutingPreviousOperationItemNo(){ sORoutingPreviousOperationItemNo(){
@ -1315,6 +1327,23 @@ export default {
this.pageData.remark = username+"更改了班次." this.pageData.remark = username+"更改了班次."
}, },
/*打开考勤修改对话框*/
openAttendanceModal() {
//()
this.showOperatorFlag = true;
this.$nextTick(() => {
//
const scheduleRow = {
site: this.scheduleData.site || this.$store.state.user.site,
orderNo: this.scheduleData.orderNo,
itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo
};
// true
this.$refs.comSwitchOperator.init(0, scheduleRow, true);
});
},
/*打印流转标签*/ /*打印流转标签*/
printSfdcFlowLabel(sfdcRow){ printSfdcFlowLabel(sfdcRow){
// //

5
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -4249,7 +4249,7 @@ export default {
+ this.scheduleData.resourceDesc + ' (' + this.operatorData.operatorName + ')'; + this.scheduleData.resourceDesc + ' (' + this.operatorData.operatorName + ')';
} }
//
//
this.showOperatorFlag = true; this.showOperatorFlag = true;
this.$nextTick(() => { this.$nextTick(() => {
// produce_order.vue currentRow // produce_order.vue currentRow
@ -4259,7 +4259,8 @@ export default {
itemNo: this.scheduleData.itemNo, itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo seqNo: this.scheduleData.seqNo
}; };
this.$refs.comSwitchOperator.init(0, scheduleRow);
// false
this.$refs.comSwitchOperator.init(0, scheduleRow, false);
}); });
}, },

3
src/views/modules/yieldReport/com_split_order_report.vue

@ -3742,7 +3742,8 @@ export default {
itemNo: this.scheduleData.itemNo, itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo seqNo: this.scheduleData.seqNo
}; };
this.$refs.comSwitchOperator.init(0, scheduleRow);
// false
this.$refs.comSwitchOperator.init(0, scheduleRow, false);
}); });
}, },

205
src/views/modules/yieldReport/com_switch_operator.vue

@ -1,9 +1,9 @@
<template> <template>
<!-- 操作员切换模块 --> <!-- 操作员切换模块 -->
<div class="customer-css"> <div class="customer-css">
<el-dialog :title="titleCon" v-bind="$attrs" v-on="$listeners" width="600px" :close-on-click-modal="false">
<el-dialog :title="titleCon" v-bind="$attrs" v-on="$listeners" width="800px" :close-on-click-modal="false">
<!-- 上部分添加操作员 --> <!-- 上部分添加操作员 -->
<el-form :inline="true" @submit.native.prevent label-position="top" label-width="100px" style="margin-bottom: 15px;">
<el-form v-if="!isAttendanceMode" :inline="true" @submit.native.prevent label-position="top" label-width="100px" style="margin-bottom: 15px;">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
@ -11,7 +11,7 @@
<el-input <el-input
ref="operatorId" ref="operatorId"
@keyup.enter.native="addOperator" @keyup.enter.native="addOperator"
@blur="checkOperatorId"
v-model="newOperator.operatorId" v-model="newOperator.operatorId"
style="width: 150px"> style="width: 150px">
</el-input> </el-input>
@ -37,6 +37,7 @@
<!-- 中间操作员列表 --> <!-- 中间操作员列表 -->
<div class="operator-list"> <div class="operator-list">
<div class="rq">
<el-table <el-table
:data="operatorList" :data="operatorList"
border border
@ -46,26 +47,51 @@
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
width="60"
width="50"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="operator" prop="operator"
label="操作员编码" label="操作员编码"
align="center">
align="left"
header-align="center"
min-width="100">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="operatorName" prop="operatorName"
label="操作员名称" label="操作员名称"
align="center">
align="left"
header-align="center"
min-width="150">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="onDutyTime"
label="上岗时间" label="上岗时间"
align="center" align="center"
width="160">
width="180">
<template slot-scope="scope"> <template slot-scope="scope">
{{ formatDateTime(scope.row.onDutyTime) }}
<el-date-picker
v-model="scope.row.onDutyTime"
type="datetime"
placeholder="选择上岗时间"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
style="width: 170px;">
</el-date-picker>
</template>
</el-table-column>
<el-table-column
label="下岗时间"
align="center"
width="180">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.offDutyTime"
type="datetime"
placeholder="选择下岗时间"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
style="width: 170px;">
</el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -73,12 +99,13 @@
align="center" align="center"
width="100"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link style="cursor: pointer" @click="removeOperator(scope.row)">下岗</el-link>
<el-link style="cursor: pointer" @click="updateOperatorTime(scope.row)">下岗</el-link>
<el-link style="cursor: pointer" @click="deleteOperator(scope.row)">删除</el-link> <el-link style="cursor: pointer" @click="deleteOperator(scope.row)">删除</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div>
<!-- 底部保存和关闭按钮 --> <!-- 底部保存和关闭按钮 -->
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -98,7 +125,9 @@ import {
getOperatorList2, getOperatorList2,
addOperatorOnDuty, addOperatorOnDuty,
removeOperatorOnDuty, removeOperatorOnDuty,
deleteOperatorData
deleteOperatorData,
updateOperatorTime,
batchUpdateOperatorTime
} from '@/api/yieldReport/produce_order.js'; } from '@/api/yieldReport/produce_order.js';
import { import {
@ -143,6 +172,8 @@ export default {
operatorList: [], operatorList: [],
// //
currentSchedule: {}, currentSchedule: {},
//
isAttendanceMode: false,
buttons: { buttons: {
saveButton: '保存', saveButton: '保存',
closeButton: '关闭', closeButton: '关闭',
@ -244,23 +275,32 @@ export default {
/*关闭modal*/ /*关闭modal*/
closeDialog() { closeDialog() {
// 使使
//
//
this.$emit('update:visible', false);
//
if (this.isAttendanceMode) {
return;
}
// 使使
//
this.operatorData.operatorId = this.$store.state.user.name; this.operatorData.operatorId = this.$store.state.user.name;
this.operatorData.operatorName = this.$store.state.user.userDisplay; this.operatorData.operatorName = this.$store.state.user.userDisplay;
this.operatorData.status = 'Y'; this.operatorData.status = 'Y';
//
this.$emit('update:visible', false);
// , // ,
this.$emit('initOperatorData', this.operatorData); this.$emit('initOperatorData', this.operatorData);
}, },
// //
init(val, scheduleRow) {
init(val, scheduleRow, isAttendanceMode = false) {
// //
this.currentSchedule = scheduleRow || {}; this.currentSchedule = scheduleRow || {};
//
this.isAttendanceMode = isAttendanceMode;
// //
this.operatorData.operatorName = this.$store.state.user.userDisplay; this.operatorData.operatorName = this.$store.state.user.userDisplay;
this.operatorData.operatorId = this.$store.state.user.name; this.operatorData.operatorId = this.$store.state.user.name;
@ -278,11 +318,13 @@ export default {
// //
// this.getMultiLanguageList(); // // this.getMultiLanguageList(); //
//
//
if (!isAttendanceMode) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.operatorId.focus();
this.$refs.operatorId && this.$refs.operatorId.focus();
}); });
this.titleCon = this.labels.componentTitle;//
}
this.titleCon = isAttendanceMode ? '考勤修改' : this.labels.componentTitle;//
}, },
// //
@ -366,38 +408,78 @@ export default {
}); });
}, },
// ()
removeOperator(row) {
this.$confirm('确定让该操作员下岗吗?', '提示', {
// ()
updateOperatorTime(row) {
//
const validateResult = this.validateOperatorTime(row);
if (!validateResult.valid) {
this.$message.error(validateResult.message);
return;
}
this.$confirm('确定更新该操作员的上下岗时间吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const params = { const params = {
id: row.id,
site: this.$store.state.user.site, site: this.$store.state.user.site,
orderNo: this.currentSchedule.orderNo, orderNo: this.currentSchedule.orderNo,
itemNo: this.currentSchedule.itemNo, itemNo: this.currentSchedule.itemNo,
seqNo: this.currentSchedule.seqNo, seqNo: this.currentSchedule.seqNo,
operator: row.operator, operator: row.operator,
id: row.id
onDutyTime: row.onDutyTime,
offDutyTime: row.offDutyTime
}; };
removeOperatorOnDuty(params).then(({ data }) => {
updateOperatorTime(params).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message.success('操作员下岗成功!');
this.$message.success('操作员时间更新成功!');
// //
this.loadOperatorList(); this.loadOperatorList();
} else { } else {
this.$message.error(data.msg || '操作员下岗失败!');
this.$message.error(data.msg || '操作员时间更新失败!');
} }
}).catch(() => { }).catch(() => {
this.$message.error('操作员下岗失败!');
this.$message.error('操作员时间更新失败!');
}); });
}).catch(() => { }).catch(() => {
// //
}); });
}, },
//
validateOperatorTime(row) {
//
if (!row.onDutyTime) {
return { valid: true };
}
const now = new Date();
const onDutyTime = new Date(row.onDutyTime);
//
if (onDutyTime > now) {
return { valid: false, message: '上岗时间不能超过当前时间!' };
}
//
if (row.offDutyTime) {
const offDutyTime = new Date(row.offDutyTime);
//
if (offDutyTime < onDutyTime) {
return { valid: false, message: '下岗时间不能早于上岗时间!' };
}
//
if (offDutyTime > now) {
return { valid: false, message: '下岗时间不能超过当前时间!' };
}
}
return { valid: true };
},
// //
deleteOperator(row) { deleteOperator(row) {
this.$confirm('确定删除该操作员数据吗? 此操作不可恢复!', '提示', { this.$confirm('确定删除该操作员数据吗? 此操作不可恢复!', '提示', {
@ -429,18 +511,77 @@ export default {
// //
}); });
}, },
//
//
saveOperatorData() { saveOperatorData() {
// 使
//
this.batchUpdateOperatorTimeSync().then(() => {
//
if (this.isAttendanceMode) {
return;
}
// 使
this.operatorData.operatorId = this.$store.state.user.name; this.operatorData.operatorId = this.$store.state.user.name;
this.operatorData.operatorName = this.$store.state.user.userDisplay; this.operatorData.operatorName = this.$store.state.user.userDisplay;
this.operatorData.status = 'Y'; this.operatorData.status = 'Y';
this.operatorFlag = true; this.operatorFlag = true;
//
//
this.closeDialog(); this.closeDialog();
// ,
this.$emit('initOperatorData', this.operatorData);
});
},
// Promise
batchUpdateOperatorTimeSync() {
return new Promise((resolve, reject) => {
//
if (!this.operatorList || this.operatorList.length === 0) {
resolve();
return;
}
//
for (let i = 0; i < this.operatorList.length; i++) {
const row = this.operatorList[i];
const validateResult = this.validateOperatorTime(row);
if (!validateResult.valid) {
this.$message.error(`${i + 1} 行:${validateResult.message}`);
reject();
return;
}
}
//
const operatorListData = this.operatorList.map(row => ({
id: row.id,
operator: row.operator,
onDutyTime: row.onDutyTime,
offDutyTime: row.offDutyTime
}));
const params = {
site: this.$store.state.user.site,
orderNo: this.currentSchedule.orderNo,
itemNo: this.currentSchedule.itemNo,
seqNo: this.currentSchedule.seqNo,
operatorList: operatorListData
};
batchUpdateOperatorTime(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('考勤信息批量更新成功!');
//
this.loadOperatorList();
resolve();
} else {
this.$message.error(data.msg || '考勤信息批量更新失败!');
reject();
}
}).catch(() => {
this.$message.error('考勤信息批量更新失败!');
reject();
});
});
}, },
/*检查操作员的信息(用于添加操作员时验证)*/ /*检查操作员的信息(用于添加操作员时验证)*/

3
src/views/modules/yieldReport/otherReport/change_packaging.vue

@ -3762,7 +3762,8 @@ export default {
itemNo: this.scheduleData.itemNo, itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo seqNo: this.scheduleData.seqNo
}; };
this.$refs.comSwitchOperator.init(0, scheduleRow);
// false
this.$refs.comSwitchOperator.init(0, scheduleRow, false);
}); });
}, },

3
src/views/modules/yieldReport/otherReport/fqc_produce_report_normal.vue

@ -3800,7 +3800,8 @@ export default {
itemNo: this.scheduleData.itemNo, itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo seqNo: this.scheduleData.seqNo
}; };
this.$refs.comSwitchOperator.init(0, scheduleRow);
// false
this.$refs.comSwitchOperator.init(0, scheduleRow, false);
}); });
}, },

3
src/views/modules/yieldReport/otherReport/fqc_split_roll_report.vue

@ -3462,7 +3462,8 @@ export default {
itemNo: this.scheduleData.itemNo, itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo seqNo: this.scheduleData.seqNo
}; };
this.$refs.comSwitchOperator.init(0, scheduleRow);
// false
this.$refs.comSwitchOperator.init(0, scheduleRow, false);
}); });
}, },

3
src/views/modules/yieldReport/otherReport/rework_inspect_report.vue

@ -3732,7 +3732,8 @@ export default {
itemNo: this.scheduleData.itemNo, itemNo: this.scheduleData.itemNo,
seqNo: this.scheduleData.seqNo seqNo: this.scheduleData.seqNo
}; };
this.$refs.comSwitchOperator.init(0, scheduleRow);
// false
this.$refs.comSwitchOperator.init(0, scheduleRow, false);
}); });
}, },

Loading…
Cancel
Save