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. 287
      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 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;">
{{buttons.closeButton}}</el-button>
</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-col>
</el-row>
@ -232,6 +236,11 @@
<!--打印卷标签-->
<com-roll-label ref="comRollLabel"></com-roll-label>
<!-- 操作员切换(考勤修改) -->
<comSwitchOperator ref="comSwitchOperator" :close-on-click-modal="false"
:visible.sync="showOperatorFlag">
</comSwitchOperator>
</div>
</template>
@ -241,6 +250,7 @@
/*添加组件*/
import comExceptionReason from "./com_exception_reason";//
import comSelectShift from "./com_select_shift";//
import comSwitchOperator from './com_switch_operator';//()
import {
getCurrentRollReportedQty,
countSfdcTimeQty,
@ -283,6 +293,7 @@ export default {
showDefault: false,
showExceptionFlag: false,
showShiftFlag: false,
showOperatorFlag: false,
showNumFlag:false,
sfdcTimeList: [],
preItemNo: 0,
@ -907,6 +918,7 @@ export default {
comExceptionReason,/*异常原因的组件*/
comSelectShift,/*班次选择的组件*/
comRollLabel,
comSwitchOperator,/*操作员切换(考勤修改)*/
},
methods: {
sORoutingPreviousOperationItemNo(){
@ -1315,6 +1327,23 @@ export default {
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){
//

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

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

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

@ -1,9 +1,9 @@
<template>
<!-- 操作员切换模块 -->
<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-col :span="8">
<el-form-item>
@ -11,7 +11,7 @@
<el-input
ref="operatorId"
@keyup.enter.native="addOperator"
@blur="checkOperatorId"
v-model="newOperator.operatorId"
style="width: 150px">
</el-input>
@ -37,47 +37,74 @@
<!-- 中间操作员列表 -->
<div class="operator-list">
<el-table
:data="operatorList"
border
stripe
height="300"
style="width: 100%">
<el-table-column
type="index"
label="序号"
width="60"
align="center">
</el-table-column>
<el-table-column
prop="operator"
label="操作员编码"
align="center">
</el-table-column>
<el-table-column
prop="operatorName"
label="操作员名称"
align="center">
</el-table-column>
<el-table-column
prop="onDutyTime"
label="上岗时间"
align="center"
width="160">
<template slot-scope="scope">
{{ formatDateTime(scope.row.onDutyTime) }}
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="100">
<template slot-scope="scope">
<el-link style="cursor: pointer" @click="removeOperator(scope.row)">下岗</el-link>
<el-link style="cursor: pointer" @click="deleteOperator(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<div class="rq">
<el-table
:data="operatorList"
border
stripe
height="300"
style="width: 100%">
<el-table-column
type="index"
label="序号"
width="50"
align="center">
</el-table-column>
<el-table-column
prop="operator"
label="操作员编码"
align="left"
header-align="center"
min-width="100">
</el-table-column>
<el-table-column
prop="operatorName"
label="操作员名称"
align="left"
header-align="center"
min-width="150">
</el-table-column>
<el-table-column
label="上岗时间"
align="center"
width="180">
<template slot-scope="scope">
<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>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="100">
<template slot-scope="scope">
<el-link style="cursor: pointer" @click="updateOperatorTime(scope.row)">下岗</el-link>
<el-link style="cursor: pointer" @click="deleteOperator(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- 底部保存和关闭按钮 -->
@ -98,7 +125,9 @@ import {
getOperatorList2,
addOperatorOnDuty,
removeOperatorOnDuty,
deleteOperatorData
deleteOperatorData,
updateOperatorTime,
batchUpdateOperatorTime
} from '@/api/yieldReport/produce_order.js';
import {
@ -143,6 +172,8 @@ export default {
operatorList: [],
//
currentSchedule: {},
//
isAttendanceMode: false,
buttons: {
saveButton: '保存',
closeButton: '关闭',
@ -244,23 +275,32 @@ export default {
/*关闭modal*/
closeDialog() {
// 使使
//
//
this.$emit('update:visible', false);
//
if (this.isAttendanceMode) {
return;
}
// 使使
//
this.operatorData.operatorId = this.$store.state.user.name;
this.operatorData.operatorName = this.$store.state.user.userDisplay;
this.operatorData.status = 'Y';
//
this.$emit('update:visible', false);
// ,
this.$emit('initOperatorData', this.operatorData);
},
//
init(val, scheduleRow) {
init(val, scheduleRow, isAttendanceMode = false) {
//
this.currentSchedule = scheduleRow || {};
//
this.isAttendanceMode = isAttendanceMode;
//
this.operatorData.operatorName = this.$store.state.user.userDisplay;
this.operatorData.operatorId = this.$store.state.user.name;
@ -278,11 +318,13 @@ export default {
//
// this.getMultiLanguageList(); //
//
this.$nextTick(() => {
this.$refs.operatorId.focus();
});
this.titleCon = this.labels.componentTitle;//
//
if (!isAttendanceMode) {
this.$nextTick(() => {
this.$refs.operatorId && this.$refs.operatorId.focus();
});
}
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: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = {
id: row.id,
site: this.$store.state.user.site,
orderNo: this.currentSchedule.orderNo,
itemNo: this.currentSchedule.itemNo,
seqNo: this.currentSchedule.seqNo,
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) {
this.$message.success('操作员下岗成功!');
this.$message.success('操作员时间更新成功!');
//
this.loadOperatorList();
} else {
this.$message.error(data.msg || '操作员下岗失败!');
this.$message.error(data.msg || '操作员时间更新失败!');
}
}).catch(() => {
this.$message.error('操作员下岗失败!');
this.$message.error('操作员时间更新失败!');
});
}).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) {
this.$confirm('确定删除该操作员数据吗? 此操作不可恢复!', '提示', {
@ -429,18 +511,77 @@ export default {
//
});
},
//
//
saveOperatorData() {
// 使
this.operatorData.operatorId = this.$store.state.user.name;
this.operatorData.operatorName = this.$store.state.user.userDisplay;
this.operatorData.status = 'Y';
this.operatorFlag = true;
//
this.batchUpdateOperatorTimeSync().then(() => {
//
if (this.isAttendanceMode) {
return;
}
//
this.closeDialog();
// ,
this.$emit('initOperatorData', this.operatorData);
// 使
this.operatorData.operatorId = this.$store.state.user.name;
this.operatorData.operatorName = this.$store.state.user.userDisplay;
this.operatorData.status = 'Y';
this.operatorFlag = true;
//
this.closeDialog();
});
},
// 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,
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,
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,
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,
seqNo: this.scheduleData.seqNo
};
this.$refs.comSwitchOperator.init(0, scheduleRow);
// false
this.$refs.comSwitchOperator.init(0, scheduleRow, false);
});
},

Loading…
Cancel
Save