This commit is contained in:
shilixia 2022-02-22 15:42:20 +08:00
parent f552f995ab
commit e8002ed7c5
4 changed files with 310 additions and 242 deletions

View File

@ -29,3 +29,22 @@ export function getEmployee(data) {
data data
}) })
} }
//个人离岗说明
export function getNotWorkList(query) {
return request({
url: '/hrm/not_work_remark/',
method: 'get',
params: query
})
}
export function getClockrecordList(query) {
return request({
url: '/hrm/clock_record/',
method: 'get',
params: query
})
}

View File

@ -277,11 +277,27 @@
label-position="right" label-position="right"
:rules="rule1" :rules="rule1"
> >
<el-form-item label="物料"
prop="material"
>
<el-select v-model="packitem.material" @change="selectmaterial" >
<el-option
v-for="item in materialoptions"
:key="item.id"
:value="item.id"
:label="item.name"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="packitem.name" placeholder="名称" /> <el-input v-model="packitem.name" placeholder="名称" />
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-input v-model="packitem.unit" placeholder="单位" /> <el-input v-model="packitem.unit" placeholder="单位" />
</el-form-item>
<el-form-item label="型号" prop="specification">
<el-input v-model="packitem.specification" placeholder="型号" />
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="count"> <el-form-item label="数量" prop="count">
<el-input-number <el-input-number
@ -321,7 +337,7 @@ import { upUrl, upHeaders } from "@/api/file";
import { getProductionplanList } from "@/api/pm"; import { getProductionplanList } from "@/api/pm";
import { getmaterialbatchList } from "@/api/inm"; import { getmaterialbatchList } from "@/api/inm";
import { getOrderList } from "@/api/sam"; import { getOrderList } from "@/api/sam";
import { getMaterial,getpackitemList,createpackitem,updatepackitem,deletepackitem } from "@/api/mtm"; import { getMaterial,getpackitemList,createpackitem,updatepackitem,deletepackitem,getMaterialList } from "@/api/mtm";
import { getwproductList } from "@/api/wpm"; import { getwproductList } from "@/api/wpm";
import { upFile } from "@/api/file"; import { upFile } from "@/api/file";
@ -330,7 +346,9 @@ import Pagination from "@/components/Pagination"; // secondary package based on
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
const defaultpackitem = { const defaultpackitem = {
name:"",
unit:"",
specification:"",
}; };
export default { export default {
components: { Pagination, vueJsonEditor, Treeselect }, components: { Pagination, vueJsonEditor, Treeselect },
@ -346,6 +364,7 @@ export default {
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
pickList:[], pickList:[],
materialoptions:[],
actstate_: { actstate_: {
6: "待复检", 6: "待复检",
10: "操作进行中", 10: "操作进行中",
@ -370,6 +389,7 @@ export default {
created() { created() {
this.material = this.$route.params.id; this.material = this.$route.params.id;
this.type = this.$route.params.type; this.type = this.$route.params.type;
this.getMaterialist()
this.getMaterial(); this.getMaterial();
this.getpickList(); this.getpickList();
this.getOrderList(); this.getOrderList();
@ -379,6 +399,30 @@ export default {
}, },
methods: { methods: {
//新增装箱单 //新增装箱单
getMaterialist()
{
getMaterialList({ pageoff: true,type:3 }).then((response) => {
if (response.data) {
this.materialoptions = response.data;
}
});
},
selectmaterial(selval){
getMaterial(selval).then((response) => {
if (response.data) {
this.packitem.name = response.data.name;
this.packitem.unit = response.data.unit;
this.packitem.specification = response.data.specification;
}
});
},
handleCreate() { handleCreate() {
this.packitem = Object.assign({}, defaultpackitem); this.packitem = Object.assign({}, defaultpackitem);
@ -424,7 +468,7 @@ handleCreate() {
} }
}); });
} else { } else {
this.packitem.material=this.material; this.packitem.product=this.material;
createpackitem(this.packitem).then((res) => { createpackitem(this.packitem).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getpickList(); this.getpickList();
@ -441,7 +485,7 @@ handleCreate() {
getpickList() getpickList()
{ {
getpackitemList({ material: this.material, page: 0 }).then((response) => { getpackitemList({ product: this.material, page: 0 }).then((response) => {
if (response.data) { if (response.data) {
this.pickList = response.data; //zhuangxiang信息 this.pickList = response.data; //zhuangxiang信息
} }

View File

@ -2,156 +2,149 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-tabs type="border-card"> <el-tabs type="border-card">
<el-tab-pane label="今日到岗"> <el-tab-pane label="今日到岗">
<el-table <el-table
:data="userList.results"
style="width: 100%; margin-top: 6px"
highlight-current-row
row-key="id"
height="100"
stripe
border
v-el-height-adaptive-table="{ bottomOffset: 41 }"
>
<el-table-column type="index" width="50" label="序号" />
<el-table-column align="center" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column align="center" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column align="center" label="到岗情况">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.is_atwork">在岗</el-tag>
:data="userList.results" <el-tag type="danger" v-else>离岗</el-tag>
style="width: 100%; margin-top: 6px" </template>
highlight-current-row </el-table-column>
row-key="id"
height="100"
stripe
border
v-el-height-adaptive-table="{ bottomOffset: 41 }"
>
<el-table-column type="index" width="50" label="序号" />
<el-table-column align="center" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column align="center" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column align="center" label="到岗情况">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.is_atwork">在岗</el-tag>
<el-tag type="danger" v-else>离岗</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="离岗备注"> <el-table-column align="center" label="离岗备注">
<template slot-scope="scope">{{ scope.row.not_work_remark }}</template> <template slot-scope="scope">{{
</el-table-column> scope.row.not_work_remark
}}</template>
</el-table-column>
<el-table-column align="header-center" label="部门"> <el-table-column align="header-center" label="部门">
<template v-if="scope.row.dept_" slot-scope="scope">{{ <template v-if="scope.row.dept_" slot-scope="scope">{{
scope.row.dept_.name scope.row.dept_.name
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" label="操作" fixed="right">
align="center" <template slot-scope="scope">
label="操作" <el-link
fixed="right" type="primary"
v-if="scope.row.is_atwork == false"
@click="handlestopwork(scope)"
>离岗说明
</el-link>
</template>
</el-table-column>
</el-table>
> <pagination
<template slot-scope="scope"> v-show="userList.count > 0"
<el-link :total="userList.count"
type="primary" :page.sync="listQuery.page"
v-if="scope.row.is_atwork==false" :limit.sync="listQuery.page_size"
@click="handlestopwork(scope)" @pagination="getList"
>离岗说明 />
</el-link>
</template>
</el-table-column>
</el-table>
<pagination <el-dialog
v-show="userList.count > 0" :visible.sync="dialogVisible"
:total="userList.count" :close-on-click-modal="false"
:page.sync="listQuery.page" title="离岗备注"
:limit.sync="listQuery.page_size" >
@pagination="getList" <el-form
/> ref="Form"
:model="stopwork"
<el-dialog label-width="100px"
:visible.sync="dialogVisible" label-position="right"
:close-on-click-modal="false" >
title="离岗备注" <el-form-item label="备注" prop="remark">
> <el-input
<el-form type="textarea"
ref="Form" v-model="stopwork.not_work_remark"
:model="stopwork" placeholder="备注"
label-width="100px" />
label-position="right" </el-form-item>
</el-form>
> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false"
<el-form-item label="备注" prop="remark"> >取消</el-button
<el-input type="textarea" v-model="stopwork.not_work_remark" placeholder="备注" /> >
</el-form-item> <el-button type="primary" @click="smtconfirm()">确认</el-button>
</div>
</el-form> </el-dialog>
<div style="text-align: right"> </el-tab-pane>
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-tab-pane label="到岗统计">
<el-button type="primary" @click="smtconfirm()">确认</el-button> <el-row>
</div> <el-col :span="12">
</el-dialog> <div class="container">
<span class="demonstration"></span>
</el-tab-pane> <el-date-picker
<el-tab-pane label="到岗统计"> v-model="value2"
type="month"
<el-row> placeholder="选择年月"
<el-col :span="12"> >
<div class="container"> </el-date-picker>
<el-button type="primary" @click="submit">查询</el-button>
</div>
<span class="demonstration"></span> <el-table
<el-date-picker :data="atworkList"
v-model="value2" style="width: 100%; margin-top: 6px"
type="month" highlight-current-row
placeholder="选择年月"> row-key="id"
</el-date-picker> height="680"
<el-button type="primary" @click="submit">查询</el-button> stripe
</div> border
<el-table @current-change="handleCurrentChange"
v-el-height-adaptive-table="{ bottomOffset: 41 }"
:data="atworkList" >
style="width: 100%; margin-top: 6px" <el-table-column type="index" width="50" label="序号" />
highlight-current-row <el-table-column align="center" label="工号">
row-key="id" <template slot-scope="scope">{{ scope.row.number }}</template>
height="680" </el-table-column>
stripe <el-table-column align="center" label="姓名">
border <template slot-scope="scope">{{ scope.row.name }}</template>
@current-change="handleCurrentChange" </el-table-column>
v-el-height-adaptive-table="{ bottomOffset: 41 }"
>
<el-table-column type="index" width="50" label="序号" />
<el-table-column align="center" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column>
<el-table-column align="center" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column align="header-center" label="部门">
<template slot-scope="scope">{{ scope.row.dept_name }}</template>
</el-table-column>
<el-table-column align="center" label="出勤天数">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column>
<el-table-column align="center" label="应到天数">
<template slot-scope="scope">{{ scope.row.count_workday }}</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<el-calendar v-model="value">
<template
slot="dateCell"
slot-scope="{date, data}">
<p>
{{ data.day.split('-').slice(1).join('-') }}<br /> {{dealMyDate(data.day)}}
</p>
</template>
</el-calendar>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<el-table-column align="header-center" label="部门">
<template slot-scope="scope">{{
scope.row.dept_name
}}</template>
</el-table-column>
<el-table-column align="center" label="出勤天数">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column>
<el-table-column align="center" label="应到天数">
<template slot-scope="scope">{{
scope.row.count_workday
}}</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<el-calendar v-model="value">
<template slot="dateCell" slot-scope="{ date, data }">
<p>
{{ data.day.split("-").slice(1).join("-") }}<br />
{{ dealMyDate(data.day) }}
</p>
</template>
</el-calendar>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</el-card> </el-card>
</div> </div>
</template> </template>
@ -183,9 +176,9 @@
<script> <script>
import { getEmployeeList } from "@/api/employee"; import { getEmployeeList } from "@/api/employee";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { notWork } from "@/api/hrm"; import { notWork, getNotWorkList ,getClockrecordList} from "@/api/hrm";
import {getatwork } from "@/api/srm"; import { getatwork } from "@/api/srm";
import { upUrl, upHeaders } from "@/api/file"; import { upUrl, upHeaders } from "@/api/file";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
@ -197,98 +190,114 @@ export default {
return { return {
userList: { count: 0 }, userList: { count: 0 },
atworkList: [], atworkList: [],
stopwork:{not_work_remark:""}, stopwork: { not_work_remark: "" },
value3:null, value3: null,
value2:null, value2: null,
listLoading: true, listLoading: true,
dialogVisible:false, dialogVisible: false,
stopworkID:null, stopworkID: null,
notworkList: "",
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20, page_size: 20,
}, },
resDate: [ resDate: [
{"date":"2022-02-20","content":"放假"}, { date: "2022-02-20", content: "放假" },
{"date":"2022-02-26","content":"去交电费"}, { date: "2022-02-26", content: "去交电费" },
{"date":"2022-02-25","content":"去学习vue"} { date: "2022-02-25", content: "去学习vue" },
], ],
atworkDate:{year:null,month:null}, atworkDate: { year: null, month: null },
value:new Date(), value: new Date(),
}; };
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
checkPermission, checkPermission,
//今日到岗 //今日到岗
getList() { getList() {
this.listQuery.fields='number,name,is_atwork,dept_,id,not_work_remark'; this.listQuery.fields = "number,name,is_atwork,dept_,id,not_work_remark";
getEmployeeList(this.listQuery).then((response) => { getEmployeeList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.userList = response.data; this.userList = response.data;
} }
}); });
}, },
handlestopwork(scope) handlestopwork(scope) {
{ this.dialogVisible = true;
this.dialogVisible=true; this.stopworkID = scope.row.id;
this.stopworkID=scope.row.id;
}, },
handleCurrentChange(){ handleCurrentChange(row) {
this.resDate= [ this.resDate=[],
{"date":"2022-01-20","content":"放假"}, getNotWorkList({page:0,user:row.user_id}).then((response) => {
{"date":"2022-01-26","content":"去交电费"}, if (response.data) {
{"date":"2022-01-25","content":"去学习vue"} response.data.forEach((item) => {
]; this.resDate.push({
data: item.not_work_date,
content: item.remark,
});
});
}
});
getClockrecordList({page:0,create_by:row.user_id}).then((response) => {
if (response.data) {
response.data.forEach((item) => {
var curTime=(item.update_time).substring(0,10)
console.log(curTime);
this.resDate.push({
data: curTime,
content: "在岗",
});
});
}
});
}, },
//离职备注提交 //离职备注提交
smtconfirm() smtconfirm() {
{
console.log(this.stopwork);
notWork(this.stopworkID, this.stopwork).then((res) => {
if (res.code >= 200) {
this.$message.success("离职备注提交成功!");
this.dialogVisible=false;
this.getList();
}
})
notWork(this.stopworkID, this.stopwork).then((res) => {
if (res.code >= 200) {
this.$message.success("离职备注提交成功!");
this.dialogVisible = false;
this.getList();
}
});
}, },
//到岗统计 //到岗统计
submit() submit() {
{ this.atworkDate.year = this.value2.getFullYear();
this.atworkDate.month = this.value2.getMonth() + 1;
this.atworkDate.year=this.value2.getFullYear(); this.value = this.value2;
this.atworkDate.month=this.value2.getMonth()+1; (this.resDate = []),
this.value=this.value2;
this.resDate=[],
getatwork(this.atworkDate).then((response) => { getatwork(this.atworkDate).then((response) => {
if (response.data) { if (response.data) {
this.atworkList = response.data; this.atworkList = response.data;
} }
});
});
}, },
//考勤日历 //考勤日历
dealMyDate(v) { dealMyDate(v) {
console.log(v)
let len = this.resDate.length let len = this.resDate.length;
let res = "" let res = "";
for(let i=0; i<len; i++){ for (let i = 0; i < len; i++) {
if(this.resDate[i].date == v) { if (this.resDate[i].data == v) {
res = this.resDate[i].content res = this.resDate[i].content;
break break;
}
}
return res
} }
}
return res;
},
}, },
}; };
</script> </script>

View File

@ -192,33 +192,29 @@
</el-table-column> </el-table-column>
<el-table-column label="设备状态"> <el-table-column label="设备状态">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.equip_.type === 2"> <div v-if="scope.row.type===2">
<el-tag <el-tag v-if="scope.row.state===40" type="danger">
v-if="scope.row.equip_.state === 40" 禁用
type="danger" </el-tag>
> <el-tag v-else type="success">
禁用 合格
</el-tag> </el-tag>
<el-tag v-else type="success"> 合格 </el-tag> </div>
</div> <div v-else>
<div v-else> <el-tag v-if="scope.row.state===10" type="success">
<el-tag v-if="scope.row.state === 10" type="success"> {{ state_[scope.row.state] }}
{{ state_[scope.row.state] }} </el-tag>
</el-tag> <el-tag v-else-if="scope.row.state===20">
<el-tag v-else-if="scope.row.state === 20"> {{ state_[scope.row.state] }}
{{ state_[scope.row.state] }} </el-tag>
</el-tag> <el-tag v-else-if="scope.row.state===30" type="warning">
<el-tag v-else-if="scope.row.state === 30" type="warning"> {{ state_[scope.row.state] }}
{{ state_[scope.row.state] }} </el-tag>
</el-tag> <el-tag v-else type="danger">
<el-tag v-else type="danger"> {{ state_[scope.row.state] }}
{{ state_[scope.row.state] }} </el-tag>
</el-tag> </div>
</div> </template>
</template>
<template slot-scope="scope">
{{ state_[scope.row.state] }}</template
>
</el-table-column> </el-table-column>
<el-table-column label="设备编号"> <el-table-column label="设备编号">
<template slot-scope="scope"> <template slot-scope="scope">