fix:玻纤子工序填写日志操作记录mloguser

This commit is contained in:
shijing 2025-03-25 16:05:40 +08:00
parent 69decccef5
commit f8ad4a7e09
3 changed files with 223 additions and 26 deletions

View File

@ -351,6 +351,26 @@ export default {
},
},
},
mloguser: {
list: {
name: "列表",
req: async function (data) {
return await http.get(`${config.API_URL}/wpm/mloguser/`, data);
},
},
create: {
name: "创建",
req: async function (data) {
return await http.post(`${config.API_URL}/wpm/mloguser/`, data);
},
},
delete: {
name: "删除",
req: async function (id) {
return await http.delete(`${config.API_URL}/wpm/mloguser/${id}/`);
},
},
},
handover: {
list: {
name: "值班记录列表",

View File

@ -68,27 +68,152 @@
>
</div>
</el-card>
<!-- 子工序操作记录 该工序拥有子工序-->
<el-card
v-if="processOptions.length>0"
style="width: 100%; margin: 1vh 0;position: relative"
header="子工序操作记录"
shadow="never"
>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_muser_add"
style="position: absolute; left: 150px; top: 5px"
>新增</el-button>
<scTable
ref="tableMuser"
:apiObj="apiObjMuser"
row-key="id"
stripe
height="250px"
:params="paramsMuser"
hidePagination
>
<el-table-column type="index" width="50" />
<el-table-column label="工序" prop="process_name">
</el-table-column>
<el-table-column label="操作人" prop="handle_user_name">
</el-table-column>
<el-table-column label="操作日期" prop="handle_date">
</el-table-column>
<el-table-column label="班次" prop="shift_name">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-link
:underline="false"
type="danger"
@click="table_muser_del(scope.row)"
>删除</el-link>
</template>
</el-table-column>
</scTable>
</el-card>
<!-- 日志操作记录编辑 -->
<el-dialog v-model="saveMuserDialog" title="子工序操作记录">
<el-form
:model="muserForm"
:rules="rules"
label-width="100px"
ref="saveInForm"
>
<el-row>
<el-col :span="23">
<el-form-item label="操作日期" required>
<el-date-picker
v-model="muserForm.handle_date"
type="date"
placeholder="操作日期"
value-format="YYYY-MM-DD"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="操作人" required>
<ehsSelect
v-model="muserForm.handle_user"
:showName="muserForm.handle_user_name"
:apiObj="this.$API.system.user.list"
:params="{ depts: dept }"
class="width-100"
></ehsSelect>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="子工序" prop="process">
<el-select
v-model="muserForm.process"
placeholder="请选择"
class="width-100"
>
<el-option
v-for="item in processOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="23">
<el-form-item label="关联班次" prop="shift">
<el-select
v-model="muserForm.shift"
placeholder="班次"
class="width-100"
>
<el-option
v-for="item in shiftOtions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button
type="primary"
:loading="isSaveing"
@click="saveMuserSubmit()"
> </el-button>
</template>
</el-dialog>
<!-- 输入物料 -->
<el-card
style="width: 100%; margin: 1vh 0"
style="width: 100%; margin: 1vh 0;position: relative"
header="输入物料"
shadow="never"
>
<div>
<el-button
type="primary"
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
icon="el-icon-plus"
@click="table_add"
>新增</el-button
>
</div>
<div style="height: 4px"></div>
<el-button
type="primary"
v-if="mlogItem.submit_time == null&&(mlogItem.ticket==null||(mlogItem.ticket_&&mlogItem.ticket_.state_.type==1))"
icon="el-icon-plus"
@click="table_add"
style="position: absolute; left: 100px; top: 5px"
>新增</el-button>
<scTable
ref="tableIn"
:apiObj="apiObj"
row-key="id"
stripe
height="250px"
:params="paramsIn"
hidePagination
>
@ -190,12 +315,13 @@
</template>
</el-dialog>
<!-- 输出物料 -->
<el-card style="width: 100%" header="输出物料" shadow="never">
<el-card style="width: 100%;margin-bottom:1vh" header="输出物料" shadow="never">
<scTable
ref="tableOut"
:apiObj="apiObj"
row-key="id"
stripe
height="250px"
:params="paramsOut"
hidePagination
>
@ -342,7 +468,11 @@ export default {
process:{
type: String,
default: "",
}
},
dept:{
type: String,
default: "",
},
},
components: {
editDialog,
@ -358,6 +488,7 @@ export default {
loading: false,
//
form: {},
muserForm:{},
dialog: {
save: false,
edit: false,
@ -367,6 +498,7 @@ export default {
},
apiObj: null,
apiObjWm:null,
apiObjMuser:null,
paramsWm: {
page: 0,
search:'',
@ -383,6 +515,9 @@ export default {
mlog: "",
material_out__isnull: 0,
},
paramsMuser:{
mlog:""
},
tracking:10,
mlogb:"",
mgroup: "",
@ -394,6 +529,7 @@ export default {
fileList:[],
tableDataWm:[],
oinfo_json:[],
processOptions:[],
test_file:'',
deptId: "",
visible: false,
@ -401,19 +537,17 @@ export default {
options: [],
tableData:[],
tableData2:[],
shiftOtions:[],
defectOptions:[],
isSingle:true,
saveInDialog: false,
printVisible:false,
saveMuserDialog:false,
setFiltersVisible: false,
rules: {
count_use: [
{
required: true,
message: "请输入领取数量",
trigger: "blur",
},
],
count_use: [{required: true,message: "请输入领取数量",trigger: "blur"}],
process:[{required: true,message: "请选择工序",trigger: "blur"}],
shift:[{required: true,message: "请选择班次",trigger: "blur"}],
},
route_file:null,
handle_date:'',
@ -445,6 +579,8 @@ export default {
that.tableData = res;
})
that.getMlogItem();
that.getPreocess();
that.getShift();
},
methods: {
open() {
@ -483,7 +619,22 @@ export default {
})
});
},
getPreocess(){
let that = this;
that.$API.mtm.process.list.req({page:0,parent:that.process}).then((res) => {
that.processOptions = res;
if(res.length>0){
that.paramsMuser.mlog = that.mlogId;
that.apiObjMuser = that.$API.wpm.mloguser.list;
}
})
},
getShift(){
let that = this;
that.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
that.shiftOtions = res;
});
},
//
setData(data) {
Object.assign(this.form, data);
@ -582,6 +733,36 @@ export default {
that.$message.success("操作成功");
});
},
table_muser_add(){
let that = this;
let userInfo = that.$TOOL.data.get("USER_INFO");
that.muserForm.mlog = that.mlogItem.id;
that.muserForm.handle_user = userInfo.id;
that.muserForm.handle_user_name = userInfo.name;
that.muserForm.handle_date = this.$TOOL.dateFormat2(new Date());
that.saveMuserDialog = true;
},
saveMuserSubmit (){
let that = this;
that.isSaveing = true;
that.$API.wpm.mloguser.create.req(that.muserForm).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$message.success("操作成功");
that.$refs.tableMuser.refresh();
}).catch(() => {
that.isSaveing = false;
})
},
table_muser_del(row){
let that = this;
that.$confirm("确定删除吗?").then(res=>{
that.$API.wpm.mloguser.delete.req(row.id).then((res) => {
that.$message.success("删除成功");
that.$refs.tableMuser.refresh();
})
})
},
handleSaveSuccess() {
this.$refs.tableIn.refresh();
this.$refs.tableOut.refresh();

View File

@ -171,6 +171,7 @@
:mlogId="mlogId"
:process="processId"
:mtask="mtask"
:dept = "deptId"
@closed="detailClose"
>
</detail-drawer>
@ -245,7 +246,6 @@ export default {
that.processCate = res.process_cate;
that.params.mgroup = res.id;
that.apiObj = that.$API.wpm.mlog.list;
// that.$refs.table.refresh();
});
},
getRemaTime(row){
@ -253,12 +253,8 @@ export default {
let times = 0;
let nowTime = new Date().getTime();
let startTiem = new Date(row.work_start_time).getTime();
console.log('nowTime',nowTime)
console.log('startTiem',startTiem)
let remaTime = nowTime - startTiem;
console.log('remaTime',remaTime)
let temp = Math.floor(remaTime/1000*60);
console.log('temp',temp)
if(remaTime>0&&row.reminder_interval_list[0]){
if(temp<row.reminder_interval_list[0]){
times = row.reminder_interval_list[0]-temp;