Merge branch 'ehs' into v2
This commit is contained in:
commit
a80a1ab83e
|
@ -9,7 +9,8 @@ VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
|
|||
#VUE_APP_WS_API = 'ws://localhost:8000'
|
||||
VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
|
||||
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
|
||||
#VUE_APP_API_BASEURL = http://127.0.0.1:8001/api
|
||||
# VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
||||
# VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
|
||||
#VUE_APP_BASEURL = http://127.0.0.1:8000
|
||||
|
||||
|
||||
|
|
|
@ -14,14 +14,19 @@
|
|||
"codemirror": "5.65.5",
|
||||
"core-js": "3.29.0",
|
||||
"cropperjs": "1.5.13",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
"crypto-js": "4.1.1",
|
||||
"d3": "^7.6.1",
|
||||
"dagre": "^0.8.5",
|
||||
"dagre-d3": "^0.6.4",
|
||||
"echarts": "5.3.2",
|
||||
"element-plus": "2.2.3",
|
||||
"html2canvas": "^1.4.1",
|
||||
"json-editor-vue3": "^1.0.6",
|
||||
"xlsx": "^0.18.5",
|
||||
"echarts": "5.4.1",
|
||||
"element-plus": "2.2.32",
|
||||
"jspdf": "^2.5.1",
|
||||
"nprogress": "0.2.0",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"sortablejs": "1.15.0",
|
||||
|
@ -32,7 +37,8 @@
|
|||
"vuedraggable": "4.0.3",
|
||||
"vuex": "4.1.0",
|
||||
"xgplayer": "2.32.2",
|
||||
"xgplayer-hls": "2.5.2"
|
||||
"xgplayer-hls": "2.5.2",
|
||||
"xlsx-style": "^0.8.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.21.00",
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<script type="text/javascript">
|
||||
document.write("<script src='config.js?"+new Date().getTime()+"'><\/script>");
|
||||
</script>
|
||||
<script type="text/javascript" src="./xlsx.full.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -53,6 +53,15 @@ export default {
|
|||
req: async function(data){
|
||||
return await http.post(`${config.API_URL}/hrm/employee/improve_info/`, data);
|
||||
}
|
||||
},
|
||||
export_excel: {
|
||||
name: "导出",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/hrm/employee/export_excel/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
|
|
@ -70,6 +70,14 @@ export default {
|
|||
data);
|
||||
}
|
||||
},
|
||||
patch: {
|
||||
name: "字段更新",
|
||||
req: async function (id, data) {
|
||||
return await http.patch(
|
||||
`${config.API_URL}/opm/operation/${id}/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
create: {
|
||||
name: "创建",
|
||||
req: async function (data) {
|
||||
|
|
|
@ -47,6 +47,43 @@ export default {
|
|||
}
|
||||
,
|
||||
|
||||
},
|
||||
// 黑名单
|
||||
blacklist: {
|
||||
list: {
|
||||
name: "获取",
|
||||
req: async function (data) {
|
||||
return await http.get(
|
||||
`${config.API_URL}/rpm/blacklist/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
},
|
||||
update: {
|
||||
name: "更新",
|
||||
req: async function (id, data) {
|
||||
return await http.put(
|
||||
`${config.API_URL}/rpm/blacklist/${id}/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
create: {
|
||||
name: "创建",
|
||||
req: async function (data) {
|
||||
return await http.post(
|
||||
`${config.API_URL}/rpm/blacklist/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
delete: {
|
||||
name: "删除",
|
||||
req: async function (id) {
|
||||
return await http.delete(
|
||||
`${config.API_URL}/rpm/blacklist/${id}/`);
|
||||
}
|
||||
}
|
||||
,
|
||||
|
||||
},
|
||||
/*相关方人员 */
|
||||
remployee: {
|
||||
|
@ -170,7 +207,16 @@ export default {
|
|||
return await http.delete(
|
||||
`${config.API_URL}/rpm/rpj/${id}/`);
|
||||
}
|
||||
}
|
||||
},
|
||||
logs: {
|
||||
name: "日志",
|
||||
req: async function (data) {
|
||||
return await http.get(
|
||||
`${config.API_URL}/rpm/rpj_log/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
/*相关方文件 */
|
||||
rfile: {
|
||||
|
@ -266,6 +312,14 @@ export default {
|
|||
data);
|
||||
}
|
||||
},
|
||||
leave: {
|
||||
name: "提前离厂",
|
||||
req: async function (id,data) {
|
||||
return await http.post(
|
||||
`${config.API_URL}/rpm/rpj_member/${id}/leave/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
update: {
|
||||
name: "更新",
|
||||
req: async function (id, data) {
|
||||
|
|
|
@ -202,7 +202,6 @@ export default {
|
|||
}
|
||||
},
|
||||
put:{
|
||||
|
||||
url: `${config.API_URL}/system/user/password/`,
|
||||
name: "修改密码",
|
||||
req: async function(data){
|
||||
|
@ -214,6 +213,12 @@ export default {
|
|||
req: async function(id){
|
||||
return await http.delete(`${config.API_URL}/system/user/${id}/`);
|
||||
}
|
||||
},
|
||||
rPassword: {
|
||||
name: "重置密码",
|
||||
req: async function( id){
|
||||
return await http.post(`${config.API_URL}/system/user/${id}/reset_password/`);
|
||||
}
|
||||
}
|
||||
},
|
||||
post: {
|
||||
|
|
|
@ -211,8 +211,10 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
apiObj: this.$API.system.user.list,
|
||||
params: {},
|
||||
query: {},
|
||||
params: {is_active:true},
|
||||
query: {
|
||||
is_active:true,
|
||||
},
|
||||
selection: [],
|
||||
filterText: "",
|
||||
filterTexts: "",
|
||||
|
|
|
@ -1,311 +1,234 @@
|
|||
<template>
|
||||
<!--基本信息!-->
|
||||
<el-main v-loading="mainLoading">
|
||||
|
||||
<el-card shadow="hover">
|
||||
<el-descriptions title="许可证信息" column=2>
|
||||
<el-descriptions-item label="编号:">
|
||||
{{ form.number }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业级别:">
|
||||
{{ form.level }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预计开始:">
|
||||
{{ form.start_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预计结束:">
|
||||
{{ form.end_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态:">
|
||||
<span v-if="form.ticket_&&form.ticket_.state_" style="margin-right: 5px;">{{form.ticket_.state_.name }}</span>
|
||||
<el-tag
|
||||
v-if="form.ticket_&&form.ticket_.act_state"
|
||||
:type="form.ticket_.act_state===0?'':form.ticket_.act_state===1?'':form.ticket_.act_state===2?'danger':form.ticket_.act_state===3?'danger':form.ticket_.act_state===5?'danger':form.ticket_.act_state===4?'success':''"
|
||||
>{{act_states[form.ticket_.act_state]}}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业部门:">
|
||||
<span v-if="form.dept_do_">{{
|
||||
form.dept_do_.name
|
||||
}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业负责人:">
|
||||
<span v-if="form.charger_">{{
|
||||
form.charger_.name
|
||||
}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业监护人:">
|
||||
<span v-if="form.monitor_">{{
|
||||
form.monitor_.name
|
||||
}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="风险分析:" span=2>
|
||||
<span v-for="item in form.risks_checked_" :key="item.id">{{
|
||||
item.name
|
||||
}}<el-divider direction="vertical"></el-divider></span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="控制措施:" span=2>
|
||||
<span v-for="item in form.measures_checked_" :key="item.id">{{
|
||||
item.name
|
||||
}}<el-divider direction="vertical"></el-divider></span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="监控状态:" span=2>
|
||||
<span v-if="form.mtask_uid">进行中</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<!-- <el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="110px"
|
||||
style="margin: 10px 20px 0 20px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="关联作业:">
|
||||
<span>{{form.name}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业许可种类:">
|
||||
<span>{{pagtitle}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业开始时间:">
|
||||
<span>{{form.start_time}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业结束时间:">
|
||||
<span>{{form.end_time}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业级别:">
|
||||
<el-select v-model="form.level" placeholder="选择作业级别">
|
||||
<el-option
|
||||
v-for="item in leveloptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业部门:">
|
||||
<el-cascader
|
||||
placeholder="选择作业部门"
|
||||
getCheckedNodes="true"
|
||||
v-model="form.dept_do"
|
||||
:options="deptoptions"
|
||||
:props="{
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
}"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业负责人:">
|
||||
<el-select v-model="form.charger" placeholder="选择作业负责人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业监护人:">
|
||||
<el-select v-model="form.monitor" placeholder="选择作业监护人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="风险选择:">
|
||||
<el-checkbox-group v-model="form.risks_checked" disabled>
|
||||
<el-checkbox
|
||||
v-show="form.risks_checked.indexOf(item.id)>-1"
|
||||
v-for="(item, index) in risklist"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>{{ item.name }}
|
||||
</el-checkbox
|
||||
<el-main v-loading="mainLoading" style="margin-top: -10px;">
|
||||
<div class="exportBtn" @click="handleExport">导出</div>
|
||||
<div id="exportDiv" class="exportDiv">
|
||||
<p style="font-weight: 600px;font-size: 18px;text-align: center;margin-top: 40px;">{{form.cate_name}}作业许可证<span>({{ form.number }})</span></p>
|
||||
<p class="tables-title">作业信息</p>
|
||||
<el-card shadow="hover">
|
||||
<el-descriptions column=2 id="opl__opre">
|
||||
<el-descriptions-item label="作业名称:">
|
||||
{{ operationObj.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业区域:">
|
||||
<span v-if="operationObj.area_">
|
||||
{{ operationObj.area_.name }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="生产状态:">
|
||||
{{ operationObj.state_work }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态:">
|
||||
{{ state_[operationObj.state] }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预计开始:">
|
||||
{{ operationObj.start_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预计结束:">
|
||||
{{ operationObj.end_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="属地部门:">
|
||||
<span v-if="operationObj.dept_ter_">
|
||||
{{operationObj.dept_ter_.name}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="业务部门:">
|
||||
<span v-if="operationObj.dept_bus_">
|
||||
{{operationObj.dept_bus_.name}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="协调员:">
|
||||
<span v-if="operationObj.coordinator_">
|
||||
{{operationObj.coordinator_.name}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="监控设备:" v-if="operationObj.vchannels">
|
||||
<span v-for="item in operationObj.vchannels_" :key="item.id">
|
||||
{{ item.name}}({{item.code}})/
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<p class="tables-title">许可证信息</p>
|
||||
<el-card shadow="hover">
|
||||
<el-descriptions column=2 id="opl__opre">
|
||||
<el-descriptions-item label="编号:">
|
||||
{{ form.number }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业级别:">
|
||||
{{ form.level }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间:">
|
||||
{{ form.start_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间:">
|
||||
{{ form.end_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态:">
|
||||
<span v-if="form.ticket_&&form.ticket_.state_" style="margin-right: 5px;">{{form.ticket_.state_.name }}</span>
|
||||
<span :class="['btnState' ,form.ticket_.act_state===0?'nomalState':form.ticket_.act_state===1?'nomalState':form.ticket_.act_state===2?'dangerState':form.ticket_.act_state===3?'dangerState':form.ticket_.act_state===5?'dangerState':form.ticket_.act_state===4?'successState':'nomalState']"
|
||||
v-if="form.ticket_&&form.ticket_.act_state">{{act_states[form.ticket_.act_state]}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业部门:">
|
||||
<span v-if="form.dept_do_">
|
||||
{{form.dept_do_.name}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业负责人:">
|
||||
<span v-if="form.charger_">
|
||||
{{form.charger_.name}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="作业监护人:">
|
||||
<span v-if="form.monitor_">
|
||||
{{form.monitor_.name}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="风险分析:" span=2>
|
||||
<span v-for="item in form.risks_checked_" :key="item.id">
|
||||
{{item.name}}<el-divider direction="vertical"></el-divider>
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="控制措施:" span=2>
|
||||
<span v-for="item in form.measures_checked_" :key="item.id">
|
||||
{{item.name}}<el-divider direction="vertical"></el-divider>
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="监控状态:" span=2 v-if="form.mtask_uid">
|
||||
<span>进行中</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="现场照片:" span=2 v-if="form.create_imgs&&form.create_imgs.length>0">
|
||||
<!-- <el-upload
|
||||
v-model:file-list="create_imgs_list"
|
||||
list-type="picture-card"
|
||||
:auto-upload="false"
|
||||
action="#"
|
||||
:disabled="true"
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="其他风险:">
|
||||
<span>{{form.other_risk}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="措施选择:">
|
||||
<el-checkbox-group v-model="form.measures_checked" disabled>
|
||||
<el-checkbox
|
||||
v-show="form.measures_checked.indexOf(item.id)>-1"
|
||||
v-for="(item, index) in measurelist"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>{{ item.name }}
|
||||
</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div class="clearfix">
|
||||
<span>应急处置:</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>1、发生火灾时立即使用消防器材边灭火边报告</p>
|
||||
<p>2、预判火势无法控制时,应立即疏散人群并拨打110或119求救。</p>
|
||||
<p>
|
||||
3、发生人员烫伤时用清水对烫伤部位进行冲洗或浸泡,用干净的纱布或衣物盖住被烫伤部位,伤势严重时立即拨打120送医。若贴身衣服与伤口粘在一起时,可用剪刀剪开,然后缓慢剥离衣物。
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-form-item label="其他应急处置:">
|
||||
<span>{{form.other_emr}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form> -->
|
||||
<el-card header="作业人员" style="margin-top:8px" shadow="hover">
|
||||
<scTable
|
||||
ref="workerTable"
|
||||
:data="workerData"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
stripe
|
||||
hideDo
|
||||
style="height: calc(100% - 60px);"
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
fixed="left"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column label="姓名" prop="name" width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.worker_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作职责" prop="duty" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column label="证书" prop="certificates" width="150">
|
||||
<template #default="scope">
|
||||
<el-tag v-for="item in scope.row.certificates_"
|
||||
:key="item.number"
|
||||
:label="item.name"
|
||||
:value="item.number">{{item.name}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-button text type="primary" size="small" @click="bltHandle(scope.row,'1')">绑卡</el-button>
|
||||
<el-button text type="primary" size="small" @click="bltHandle(scope.row,'0')">解绑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</scTable>
|
||||
</el-card>
|
||||
<el-card header="气体检测记录" style="margin-top: 8px" shadow="hover" v-show="oplcateCode=='fire'||oplcateCode=='space'||oplcateCode=='cooler'">
|
||||
<scTable
|
||||
ref="gasTable"
|
||||
:data="gasData"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
stripe
|
||||
hideDo
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="检测部位"
|
||||
prop="check_place"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="O2(%)" prop="o2" min-width="120"></el-table-column>
|
||||
<el-table-column label="CO" prop="co" min-width="120"></el-table-column>
|
||||
<el-table-column
|
||||
label="可燃气体(V%LEL)"
|
||||
prop="lel"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="检验结论"
|
||||
prop="is_ok"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ is_ok_[scope.row.is_ok] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检测人"
|
||||
prop="checker"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.checker_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检测时间"
|
||||
prop="check_time"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
</el-main>
|
||||
</el-upload>-->
|
||||
<el-image
|
||||
v-for = "item in form.create_imgs_"
|
||||
:key = "item.id"
|
||||
style="margin-right: 8px;height: 146px;height:146px;"
|
||||
:src="item.path"
|
||||
:preview-src-list="[item.path]"
|
||||
fit="cover"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关闭照片:" span=2 v-if="form.close_imgs&&form.close_imgs.length>0">
|
||||
<el-image
|
||||
v-for = "item in form.close_imgs_"
|
||||
:key = "item.id"
|
||||
style="margin-right: 8px;height: 146px;height:146px;"
|
||||
:src="item.path"
|
||||
:preview-src-list="[item.path]"
|
||||
fit="cover"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<!-- <p class="tables-title" v-if="ticketDetailState">进度流程</p>
|
||||
<el-card shadow="hover" v-if="ticketDetailState">
|
||||
<work-step v-if="ticketDetail.state" ref="workStep" :ticket="ticketDetail"></work-step>
|
||||
</el-card> -->
|
||||
<p class="tables-title">作业人员</p>
|
||||
<table class="tables" cellspacing="0">
|
||||
<tr class="tableTh tableThS">
|
||||
<td class="tableTd">序号</td>
|
||||
<td class="tableTd" style="width:100px">姓名</td>
|
||||
<td class="tableTd" style="width:120px">工作职责</td>
|
||||
<td class="tableTd" style="flex: auto;">证书</td>
|
||||
<td class="tableTd" style="width:180px">创建时间</td>
|
||||
</tr>
|
||||
<tr v-if="workerData.length==0" class="noDataTr"> 无数据</tr>
|
||||
<tr class="tableTr tableTrS" v-for="(item,index) in workerData" :key="item.id">
|
||||
<td class="tableTd" >{{ index+1 }}</td>
|
||||
<td class="tableTd" style="width:100px">{{ item.worker_.name }}</td>
|
||||
<td class="tableTd" style="width:120px">{{ item.duty }}</td>
|
||||
<td class="tableTd" style="flex: auto;">
|
||||
<span v-for="cer in item.certificates_" :key="cer.number">{{cer.name}}-{{cer.number }}</span>
|
||||
</td>
|
||||
<td class="tableTd" style="width:180px">{{ item.create_time }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="tables-title">气体检测记录</p>
|
||||
<table class="tables" cellspacing="0">
|
||||
<tr class="tableTh tableThS">
|
||||
<td class="tableTd">序号</td>
|
||||
<td class="tableTd">检测部位</td>
|
||||
<td class="tableTd">O₂(%)</td>
|
||||
<td class="tableTd">CO</td>
|
||||
<td class="tableTd" style="line-height: 18px;">可燃气体<span style="12px;font-weight:500">(V%LEL)</span></td>
|
||||
<td class="tableTd">检验结论</td>
|
||||
<td class="tableTd">检测人</td>
|
||||
<td class="tableTd">检测时间</td>
|
||||
<td class="tableTd">创建时间</td>
|
||||
</tr>
|
||||
<tr v-if="gasData.length==0" class="noDataTr"> 无数据</tr>
|
||||
<tr class="tableTr tableTrS" v-for="(item,index) in gasData" :key="item.id">
|
||||
<td class="tableTd">{{ index+1 }}</td>
|
||||
<td class="tableTd">{{ item.check_place }}</td>
|
||||
<td class="tableTd">{{ item.o2 }}</td>
|
||||
<td class="tableTd">{{item.co}}</td>
|
||||
<td class="tableTd">{{ item.lel }}</td>
|
||||
<td class="tableTd">{{ is_ok_[item.is_ok] }}</td>
|
||||
<td class="tableTd">{{ item.checker_.name }}</td>
|
||||
<td class="tableTd">{{ item.check_time }}</td>
|
||||
<td class="tableTd">{{ item.create_time }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="tables-title">处理日志</p>
|
||||
<table class="tables" cellspacing="0">
|
||||
<tr class="tableTh">
|
||||
<td class="tableTd">进行状态</td>
|
||||
<td class="tableTd attributeTd">操作类型</td>
|
||||
<td class="tableTd attributeTd">操作属性</td>
|
||||
<td class="tableTd">操作意见</td>
|
||||
<td class="tableTd">操作人</td>
|
||||
<!-- <td class="tableTd">电子签名</td> -->
|
||||
<td class="tableTd">更新时间</td>
|
||||
</tr>
|
||||
<tr v-if="logsData.length==0" class="noDataTr"> 无处理日志</tr>
|
||||
<tr class="tableTr" v-for="item in logsData" :key="item.id">
|
||||
<td class="tableTd" v-if="item.participant_str==null">{{ item.state_.name }}</td>
|
||||
<td class="tableTd attributeTd" v-if="item.participant_str==null">{{ typeOptions[item.intervene_type] }}</td>
|
||||
<td class="tableTd attributeTd" v-if="item.participant_str==null">
|
||||
<span v-if="item.transition_attribute == 1" class="successText">同意</span>
|
||||
<span v-else-if="item.transition_attribute == 2" class="successText">拒绝</span>
|
||||
<span v-else class="dangerText"></span>
|
||||
</td>
|
||||
<td class="tableTd" v-if="item.participant_str==null">{{ item.suggestion }}</td>
|
||||
<td class="tableTd" v-if="item.participant_str==null">
|
||||
<span v-if="item.participant_">{{item.participant_.name}}</span>
|
||||
<span v-if="item.participant_str">{{item.participant_str}}</span>
|
||||
<el-image v-if="item.participant_ && item.participant_.signature" :src="item.participant_.signature" style="width: 60px"></el-image>
|
||||
<!-- <img style="width:60px;vertical-align: bottom;" src="./../../../public/img/signature.jpg"> -->
|
||||
</td>
|
||||
<td class="tableTd" v-if="item.participant_str==null">{{ item.update_time }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</el-main>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {genTree} from "@/utils/verificate";
|
||||
import workStep from "./../../views/wf/steps.vue";
|
||||
import PdfLoader from '@/utils/html2pdf';
|
||||
export default {
|
||||
name: "scFire",
|
||||
components: {
|
||||
workStep
|
||||
},
|
||||
props: {
|
||||
id: { type: String, default: "" },
|
||||
wfId: { type: String, default: "" },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
create_imgs_list: [],
|
||||
close_imgs_list: [],
|
||||
mainLoading: false,
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
|
||||
query: {},
|
||||
selection: [],
|
||||
issave: false, //控制基本信息提交
|
||||
search: {
|
||||
keyword: null,
|
||||
|
@ -318,7 +241,7 @@
|
|||
cate: "",
|
||||
risks_checked: [],
|
||||
},
|
||||
initForm: {},
|
||||
ticketDetailState:false,
|
||||
oplcateCode: 'fire',
|
||||
operationId: "",
|
||||
oplId: "",
|
||||
|
@ -327,27 +250,23 @@
|
|||
{id: 20, name: "一级动火"},
|
||||
{id: 30, name: "二级动火"},
|
||||
],
|
||||
deptoptions: [],
|
||||
useroptions: [],
|
||||
risklist: [],
|
||||
measurelist: [],
|
||||
pagtitle: "",
|
||||
dutyOptions: [
|
||||
{value: 10, label: "作业人员"},
|
||||
{value: 20, label: "起重司机"},
|
||||
{value: 30, label: "司索人员"},
|
||||
{value: 40, label: "起重指挥"},
|
||||
{value: 40, label: "电工"},
|
||||
],
|
||||
certificatesOptions: [],
|
||||
ticketId:'',
|
||||
ticketDetail:{},
|
||||
operationObj:{},
|
||||
workerData: [],
|
||||
workerdialog: false,
|
||||
gasdialog: false,
|
||||
gasData: [],
|
||||
logsData:[],
|
||||
is_ok_: {
|
||||
true: "正常",
|
||||
false: "不正常",
|
||||
},
|
||||
state_: {
|
||||
10: "创建中",
|
||||
20: "审批中",
|
||||
30: "待开始",
|
||||
40: "进行中",
|
||||
50: "已完成",
|
||||
},
|
||||
act_states: {
|
||||
0: "草稿中",
|
||||
1: "进行中",
|
||||
|
@ -356,59 +275,91 @@
|
|||
4: "已完成",
|
||||
5: "已关闭",
|
||||
},
|
||||
typeOptions: {
|
||||
0: "正常处理",
|
||||
1: "转交",
|
||||
2: "加签",
|
||||
3: "加签完成",
|
||||
4: "接单",
|
||||
5: "评论",
|
||||
6: "删除",
|
||||
7: "强制关闭",
|
||||
8: "强制修改状态",
|
||||
9: "hook",
|
||||
10: "撤回",
|
||||
11: "抄送",
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.oplId = that.id; //许可证ID
|
||||
that.operationId = that.wfId; //zuoyeID
|
||||
this.$nextTick(()=>{
|
||||
that.getOplData();
|
||||
that.getworkerList();
|
||||
that.getgasList();
|
||||
that.getOperation();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleExport() {
|
||||
let exportDiv = document.getElementById('exportDiv') // 需要导出部分页面的id名
|
||||
this.pdfDownLoader = new PdfLoader(exportDiv, '作业许可证', 'exportDiv') // fileName -->导出文件名, question-table -->防止被截断的class名
|
||||
this.pdfDownLoader.outPutPdfFn(this.form.number);
|
||||
exportDiv.style.width = "100%"
|
||||
|
||||
},
|
||||
// handleExport(){
|
||||
// let bdHtml = window.document.body.innerHTML;
|
||||
// document.body.innerHTML = document.getElementById('exportDiv').innerHTML;
|
||||
// window.print();
|
||||
// location.reload();
|
||||
// },
|
||||
//根据oplId,查许可证
|
||||
getOplData() {
|
||||
this.mainLoading = true
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.mainLoading = false
|
||||
this.form = res;
|
||||
this.oplcateCode = res.cate_code
|
||||
// this.oplcateId = res.cate;
|
||||
// this.operationId = res.operation;
|
||||
// this.getOperation();
|
||||
// this.getOplcates();
|
||||
let that = this;
|
||||
that.mainLoading = true;
|
||||
that.$API.opm.opl.read.req(that.oplId).then((res) => {
|
||||
that.mainLoading = false
|
||||
that.form = res;
|
||||
that.oplcateCode = res.cate_code;
|
||||
that.ticketId = res.ticket;
|
||||
res.create_imgs_.forEach(item=>{
|
||||
console.log(item)
|
||||
that.create_imgs_list.push({
|
||||
url: item.path,
|
||||
name: '',
|
||||
})
|
||||
})
|
||||
res.close_imgs_.forEach(item=>{
|
||||
that.close_imgs_list.push({
|
||||
url: item.path,
|
||||
name: '',
|
||||
})
|
||||
})
|
||||
that.$nextTick(()=>{
|
||||
this.$API.wf.ticket.ticketFlowlogs.req(that.ticketId).then((res2) => {
|
||||
if (res2.err_msg) {
|
||||
} else {
|
||||
that.logsData = res2;
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(e=>{this.mainLoading=false});
|
||||
},
|
||||
|
||||
// //根据作业许可证类别ID获取,风险、措施===>作业许可证类别详情
|
||||
// getOplcates() {
|
||||
// debugger;
|
||||
// this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
|
||||
// console.log(res); //
|
||||
// this.pagtitle = res.name;
|
||||
// this.oplcateCode = res.code;
|
||||
// this.risklist = res.risk_options_; //风险缝隙
|
||||
// this.measurelist = res.measure_options_; //控制措施
|
||||
// });
|
||||
// },
|
||||
|
||||
// //根据operationId,查作业信息
|
||||
// getOperation() {
|
||||
// this.$API.opm.operation.read.req(this.operationId).then((res) => {
|
||||
// this.form.start_time = res.start_time; //作业开始时间
|
||||
// this.form.end_time = res.end_time; //作业结束时间
|
||||
// this.form.name = res.name; //作业结束时间
|
||||
// });
|
||||
// },
|
||||
// //作业部门
|
||||
// getDept() {
|
||||
// this.$API.system.dept.list.req({page: 0}).then((res) => {
|
||||
// this.deptoptions = genTree(res);
|
||||
// });
|
||||
// },
|
||||
// //作业负责人、作业监护人
|
||||
getOperation() {
|
||||
this.mainLoading = true;
|
||||
this.$API.opm.operation.read
|
||||
.req(this.operationId)
|
||||
.then((res) => {
|
||||
this.mainLoading = false;
|
||||
this.operationObj = res;
|
||||
})
|
||||
.catch((e) => {
|
||||
this.mainLoading = false;
|
||||
});
|
||||
},
|
||||
//作业人员列表
|
||||
getworkerList() {
|
||||
this.$API.opm.worker.list.req({opl: this.oplId, page: 0}).then((res) => {
|
||||
|
@ -426,5 +377,108 @@
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-drawer__header {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.btnState{
|
||||
font-size: 12px;
|
||||
padding: 0 9px;
|
||||
height: 24px;
|
||||
line-height: 23px;
|
||||
border-radius: 5px;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
}
|
||||
.nomalState{
|
||||
color: #536dfe;
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
.dangerState{
|
||||
color: #FF0000;
|
||||
border: 1px solid #fbe0e0;
|
||||
}
|
||||
.successState{
|
||||
color: #14c532;
|
||||
border: 1px solid #e6f3e6;
|
||||
}
|
||||
.successText{
|
||||
color: #14c532;
|
||||
}
|
||||
.dangerText{
|
||||
color: #FF0000;
|
||||
}
|
||||
.tables{
|
||||
width: 100%;
|
||||
color: #606266;
|
||||
border-top: 1px solid #e4e7ed;
|
||||
border-left: 1px solid #e4e7ed;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.tables-title{
|
||||
color: #303331;
|
||||
font-size: 16px;
|
||||
/* font-weight: 700; */
|
||||
margin: 10px 0;
|
||||
}
|
||||
.tableTh,.tableTr{
|
||||
display: flex;
|
||||
}
|
||||
.tableTh>td{
|
||||
font-weight: 700;
|
||||
/* color: #909399; */
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
padding: 0 5px;
|
||||
/* background: #fafafa; */
|
||||
}
|
||||
.tableThS>td:first-child{
|
||||
flex-shrink:0;
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
.tableTr>td{
|
||||
min-height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
.tableTrS>td:first-child{
|
||||
flex-shrink:0;
|
||||
width: 70px;
|
||||
}
|
||||
.tableTh>td.attributeTd{
|
||||
flex-shrink:0;
|
||||
width: 90px;
|
||||
}
|
||||
.tableTr>td.attributeTd{
|
||||
flex-shrink:0;
|
||||
width: 90px;
|
||||
}
|
||||
td{
|
||||
width: 25%;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
.noDataTr{
|
||||
text-align: center;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
}
|
||||
.exportDiv{
|
||||
margin-top: -30px;
|
||||
}
|
||||
.exportBtn{
|
||||
width: 120px;
|
||||
height: 40px;
|
||||
color: #ffffff;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
background: #438af4;
|
||||
font-size: 18px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
/* box-shadow: 0 0 9px 0px rgba(0,0,0,.2); */
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
showFileList: { type: Boolean, default: true },
|
||||
multiple: { type: Boolean, default: true },
|
||||
disabled: { type: Boolean, default: false },
|
||||
draggable: { type: Boolean, default: false },
|
||||
onSuccess: { type: Function, default: () => { return true } }
|
||||
},
|
||||
data(){
|
||||
|
@ -86,6 +85,17 @@
|
|||
this.value = val
|
||||
}
|
||||
}
|
||||
if(Array.isArray(val)){
|
||||
if (JSON.stringify(val) != JSON.stringify(this.formatArr(this.defaultFileList))) {
|
||||
this.defaultFileList = val
|
||||
this.value = val
|
||||
}
|
||||
}else{
|
||||
if (val != this.toStr(this.defaultFileList)) {
|
||||
this.defaultFileList = this.toArr(val)
|
||||
this.value = val
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultFileList: {
|
||||
handler(val){
|
||||
|
@ -155,6 +165,7 @@
|
|||
tableData.splice(newIndex, 0, currRow)
|
||||
}
|
||||
})
|
||||
return _arr
|
||||
},
|
||||
before(file){
|
||||
if(!['image/jpeg','image/png','image/gif'].includes(file.type)){
|
||||
|
@ -167,8 +178,16 @@
|
|||
return false;
|
||||
}
|
||||
},
|
||||
success(res, file){
|
||||
success(res, file,fileList){
|
||||
let ids = [];
|
||||
for(let i = 0;i<fileList.length;i++){
|
||||
if(fileList[i].response!==undefined){
|
||||
ids.push(fileList[i].response.id)
|
||||
}
|
||||
}
|
||||
this.$emit('imagesChange', ids)
|
||||
var os = this.onSuccess(res, file)
|
||||
|
||||
if(os!=undefined && os==false){
|
||||
return false
|
||||
}
|
||||
|
@ -183,6 +202,8 @@
|
|||
})
|
||||
},
|
||||
beforeRemove(uploadFile){
|
||||
debugger;
|
||||
console.log(uploadFile)
|
||||
return this.$confirm(`是否移除 ${uploadFile.name} ?`, '提示', {
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
|
@ -192,8 +213,22 @@
|
|||
})
|
||||
},
|
||||
handleRemove(file){
|
||||
this.$refs.uploader.handleRemove(file)
|
||||
//this.defaultFileList.splice(this.defaultFileList.findIndex(item => item.uid===file.uid), 1)
|
||||
let list = this.defaultFileList;
|
||||
for(let i=0;i<list.length;i++){
|
||||
if(list[i].response!==undefined){
|
||||
if(list[i].response.path===file.url){
|
||||
this.$emit('imagesDel', i)
|
||||
this.$refs.uploader.handleRemove(file);
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
if(list[i].url===file.url){
|
||||
this.$emit('imagesDel', i)
|
||||
this.$refs.uploader.handleRemove(file);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleExceed(){
|
||||
this.$message.warning(`当前设置最多上传 ${this.limit} 个文件,请移除后上传!`)
|
||||
|
@ -217,13 +252,14 @@
|
|||
param.onProgress({percent: complete})
|
||||
}
|
||||
}).then(res => {
|
||||
config.parseData(res);
|
||||
param.onSuccess(res)
|
||||
// if(response.code == config.successCode){
|
||||
// param.onSuccess(res)
|
||||
// }else{
|
||||
// param.onError(response.msg || "未知错误")
|
||||
// }
|
||||
var response = config.parseData(res);
|
||||
console.log(res)
|
||||
console.log(response)
|
||||
if(res.id){
|
||||
param.onSuccess(res)
|
||||
}else{
|
||||
param.onError(response.msg || "未知错误")
|
||||
}
|
||||
}).catch(err => {
|
||||
param.onError(err)
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@ const DEFAULT_CONFIG = {
|
|||
DASHBOARD_URL: "/dashboard",
|
||||
|
||||
//版本号
|
||||
APP_VER: "1.6.9",
|
||||
APP_VER: "2.0.12",
|
||||
|
||||
//内核版本号
|
||||
CORE_VER: "1.6.9",
|
||||
|
@ -61,11 +61,12 @@ const DEFAULT_CONFIG = {
|
|||
//控制台首页默认布局
|
||||
DEFAULT_GRID: {
|
||||
//默认分栏数量和宽度 例如 [24] [18,6] [8,8,8] [6,12,6]
|
||||
layout: [24, 24, 6],
|
||||
layout: [24, 24, 24],
|
||||
//小组件分布,com取值:views/home/components 文件名
|
||||
copmsList: [
|
||||
['ticket'],
|
||||
['eventlist'],
|
||||
['about'],
|
||||
|
||||
]
|
||||
}
|
||||
|
|
|
@ -344,6 +344,16 @@ const routes = [
|
|||
},
|
||||
"component": "rpm/rparty"
|
||||
},
|
||||
{
|
||||
"name": "blacklist",
|
||||
"path": "/rpm/blacklist",
|
||||
"meta": {
|
||||
"title": "黑名单",
|
||||
"icon": "el-icon-box",
|
||||
"perms": ["blacklist"]
|
||||
},
|
||||
"component": "rpm/blacklist"
|
||||
},
|
||||
{
|
||||
"name": "remployee",
|
||||
"path": "/rpm/remployee",
|
||||
|
|
|
@ -9,6 +9,7 @@ import router from './router'
|
|||
import store from './store'
|
||||
import App from './App.vue'
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
import preventReClick from './utils/preventReClick'
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
|
@ -18,7 +19,7 @@ app.use(ElementPlus);
|
|||
app.use(i18n);
|
||||
app.use(scui);
|
||||
app.use(ehsui);
|
||||
|
||||
app.use(preventReClick)
|
||||
//挂载app
|
||||
app.mount('#app');
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
|
|
|
@ -106,4 +106,7 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo
|
|||
|
||||
#eventImgWrap .el-image__preview,#eventImgWrap .el-image__inne{
|
||||
width: auto;
|
||||
}
|
||||
#opl__opre>.el-descriptions__body>.el-descriptions__table:not(.is-bordered) .el-descriptions__cell{
|
||||
padding-bottom: 5px;
|
||||
}
|
|
@ -335,7 +335,8 @@ body .tox-tinymce-aux {
|
|||
}
|
||||
|
||||
.el-drawer__header {
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 0;
|
||||
// margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.el-drawer .el-drawer__body {
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
import jsPDF from 'jspdf'
|
||||
import html2canvas from 'html2canvas'
|
||||
|
||||
/*
|
||||
* 使用说明
|
||||
* ele:需要导出pdf的容器元素(dom节点 不是id)
|
||||
* pdfFileName: 导出文件的名字 通过调用outPutPdfFn方法也可传参数改变
|
||||
* splitClassName: 避免分段截断的类名 当pdf有多页时需要传入此参数 , 避免pdf分页时截断元素 如表格<tr class="itemClass"></tr>
|
||||
* 调用方式 先 let pdf = new PdfLoader(ele, 'pdf' ,'itemClass');
|
||||
* 若想改变pdf名称 pdf.outPutPdfFn(fileName); outPutPdfFn方法返回一个promise 可以使用then方法处理pdf生成后的逻辑
|
||||
* */
|
||||
class PdfLoader {
|
||||
constructor(ele, pdfFileName, splitClassName) {
|
||||
this.ele = ele
|
||||
this.pdfFileName = pdfFileName
|
||||
this.splitClassName = splitClassName
|
||||
this.A4_WIDTH = 595
|
||||
this.A4_HEIGHT = 842
|
||||
}
|
||||
|
||||
async getPDF(resolve) {
|
||||
const ele = this.ele;
|
||||
let eleme = this.ele;
|
||||
eleme.style.width="800px";
|
||||
const pdfFileName = this.pdfFileName
|
||||
const eleW = ele.offsetWidth// 获得该容器的宽
|
||||
const eleH = ele.scrollHeight;// 获得该容器的高
|
||||
const eleOffsetTop = ele.offsetTop// 获得该容器到文档顶部的距离
|
||||
const eleOffsetLeft = ele.offsetLeft// 获得该容器到文档最左的距离
|
||||
const canvas = document.createElement('canvas')
|
||||
canvas.width = eleW * 3// 将画布宽&&高放大两倍
|
||||
canvas.height = eleH * 3
|
||||
const context = canvas.getContext('2d')
|
||||
context.scale(3,3) // 增强图片清晰度
|
||||
context.translate(-eleOffsetLeft , -eleOffsetTop)
|
||||
html2canvas(eleme, {
|
||||
useCORS: true// 允许canvas画布内可以跨域请求外部链接图片, 允许跨域请求。
|
||||
}).then(async canvas => {
|
||||
const contentWidth = canvas.width
|
||||
const contentHeight = canvas.height
|
||||
// 一页pdf显示html页面生成的canvas高度;
|
||||
const pageHeight = (contentWidth / this.A4_WIDTH) * this.A4_HEIGHT // 这样写的目的在于保持宽高比例一致 pageHeight/canvas.width = a4纸高度/a4纸宽度// 宽度和canvas.width保持一致
|
||||
// 未生成pdf的html页面高度
|
||||
let leftHeight = contentHeight
|
||||
// 页面偏移
|
||||
let position = 20
|
||||
// a4纸的尺寸[595,842],单位像素,html页面生成的canvas在pdf中图片的宽高
|
||||
const imgWidth = this.A4_WIDTH - 40 // -10为了页面有右边距
|
||||
const imgHeight = (this.A4_WIDTH / contentWidth) * contentHeight
|
||||
const pageData = canvas.toDataURL('image/jpeg', 1.0)
|
||||
const pdf = jsPDF('', 'pt', 'a4')
|
||||
// 有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
|
||||
// 当内容未超过pdf一页显示的范围,无需分页
|
||||
if (leftHeight < pageHeight) {
|
||||
// 在pdf.addImage(pageData, 'JPEG', 左,上,宽度,高度)设置在pdf中显示;
|
||||
pdf.addImage(pageData, 'JPEG', 20, 20, imgWidth, imgHeight)
|
||||
} else {
|
||||
// 分页
|
||||
while (leftHeight > 0) {
|
||||
pdf.addImage(pageData, 'JPEG', 20, position, imgWidth, imgHeight)
|
||||
leftHeight -= pageHeight
|
||||
position -= this.A4_HEIGHT
|
||||
// 避免添加空白页
|
||||
if (leftHeight > 0) {
|
||||
pdf.addPage()
|
||||
}
|
||||
}
|
||||
}
|
||||
pdf.save(pdfFileName + '.pdf', { returnPromise: true }).then(() => {
|
||||
// 去除添加的空div 防止页面混乱
|
||||
const doms = document.querySelectorAll('.emptyDiv')
|
||||
for (let i = 0; i < doms.length; i++) {
|
||||
doms[i].remove()
|
||||
}
|
||||
})
|
||||
this.ele.style.height = ''
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
//此方法是防止(图表之类)内容因为A4纸张问题被截断
|
||||
async outPutPdfFn(pdfFileName) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.ele.style.height = 'initial'
|
||||
pdfFileName ? this.pdfFileName = pdfFileName : null
|
||||
const target = this.ele
|
||||
const pageHeight = target.scrollWidth / this.A4_WIDTH * this.A4_HEIGHT
|
||||
// 获取分割dom,此处为class类名为item的dom
|
||||
const domList = document.getElementsByClassName(this.splitClassName)
|
||||
// 进行分割操作,当dom内容已超出a4的高度,则将该dom前插入一个空dom,把他挤下去,分割
|
||||
let pageNum = 1 // pdf页数
|
||||
const eleBounding = this.ele.getBoundingClientRect()
|
||||
for (let i = 0; i < domList.length; i++) {
|
||||
const node = domList[i]
|
||||
const bound = node.getBoundingClientRect()
|
||||
const offset2Ele = bound.top - eleBounding.top
|
||||
const currentPage = Math.ceil((bound.bottom - eleBounding.top) / pageHeight) // 当前元素应该在哪一页
|
||||
if (pageNum < currentPage) {
|
||||
pageNum++
|
||||
const divParent = domList[i].parentNode // 获取该div的父节点
|
||||
const newNode = document.createElement('div')
|
||||
newNode.className = 'emptyDiv'
|
||||
newNode.style.background = 'white'
|
||||
newNode.style.height = (pageHeight * (pageNum - 1) - offset2Ele + 30) + 'px' // +30为了在换下一页时有顶部的边距
|
||||
newNode.style.width = '100%'
|
||||
divParent.insertBefore(newNode, node) //在每一个节点前面插入一个空的新节点,防止内容被分割截断
|
||||
}
|
||||
}
|
||||
// 异步函数,导出成功后处理交互
|
||||
this.getPDF(resolve, reject)
|
||||
})
|
||||
}
|
||||
}
|
||||
export default PdfLoader
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
export default (app) => {
|
||||
app.directive('preventReClick', {
|
||||
mounted(el, binding) {
|
||||
el.addEventListener('click', () => {
|
||||
if (!el.disabled) {
|
||||
el.disabled = true
|
||||
setTimeout(() => {
|
||||
el.disabled = false
|
||||
}, binding.value || 3000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
|
@ -166,7 +166,7 @@ export default {
|
|||
this.syncLoading = false;
|
||||
},
|
||||
getEmployee(data) {
|
||||
this.form.employee=data.id;
|
||||
this.form.employee=data.employee;
|
||||
this.form.employee_name=data.name
|
||||
},
|
||||
handleBindBlt(type, row) {
|
||||
|
|
|
@ -1408,7 +1408,7 @@ export default {
|
|||
//区域下的作业
|
||||
getAreaOperation(){
|
||||
let that = this;
|
||||
this.$API.opm.operation.list.req({area:that.areaDetailId}).then(res=>{
|
||||
this.$API.opm.operation.list.req({area:that.areaDetailId, state: 40}).then(res=>{
|
||||
console.log(res)
|
||||
that.areaOperation = res.results;
|
||||
})
|
||||
|
@ -1776,7 +1776,7 @@ export default {
|
|||
}
|
||||
|
||||
},
|
||||
//摄像头
|
||||
//摄像头Marker
|
||||
showCameraMarkers(list) {
|
||||
// debugger;
|
||||
let that = this;
|
||||
|
@ -1815,7 +1815,7 @@ export default {
|
|||
}
|
||||
|
||||
},
|
||||
//喇叭
|
||||
//喇叭Marker
|
||||
showSpeakersMarkers(list) {
|
||||
let that = this;
|
||||
list.forEach(item => {
|
||||
|
@ -1848,7 +1848,7 @@ export default {
|
|||
})
|
||||
|
||||
},
|
||||
//人员
|
||||
//人员Marker
|
||||
showUserMarkers(userList) {
|
||||
// debugger;
|
||||
let that = this;
|
||||
|
@ -1862,9 +1862,9 @@ export default {
|
|||
if (employeeType === 'employee') {
|
||||
userImage = "/img/employee.png"
|
||||
}else if (employeeType === 'driver') {
|
||||
userImage = "/img/visitor.png"
|
||||
userImage = "/img/driver.png"
|
||||
} else if (employeeType === 'remployee') {
|
||||
userImage = "/img/employee.png"
|
||||
userImage = "/img/driver.png"
|
||||
}else {
|
||||
userImage = "/img/visitor.png"
|
||||
}
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
<el-table-column
|
||||
label="名称"
|
||||
prop="name"
|
||||
width="100"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="标识"
|
||||
prop="code"
|
||||
width="80"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column label="触发" prop="trigger" width="80">
|
||||
<template #default="scope">
|
||||
|
@ -159,7 +159,7 @@ export default {
|
|||
selection: [],
|
||||
chosen_cate: "",
|
||||
apiObj1: this.$API.ecm.event_cate.list,
|
||||
params1: { self_algo: true },
|
||||
params1: { trigger: 10 },
|
||||
apiObj2: null,
|
||||
};
|
||||
},
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
prop="vchannel_.name"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="始终开启" prop="always_on" width="150">
|
||||
<el-table-column label="常开" prop="always_on" width="150">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.always_on"
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="始终开启" prop="always_on">
|
||||
<el-form-item label="常开" prop="always_on">
|
||||
<el-switch v-model="form.always_on"></el-switch>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<!-- <el-button @click="visible = false">取 消</el-button> -->
|
||||
|
@ -68,7 +68,7 @@ export default {
|
|||
form: {
|
||||
algo: "",
|
||||
vchannel: "",
|
||||
always_on: true,
|
||||
always_on: false,
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
|
@ -93,7 +93,7 @@ export default {
|
|||
},
|
||||
//视频列表
|
||||
getAlgo() {
|
||||
this.$API.ecm.event_cate.list.req({ self_algo:true,page: 0 }).then((res) => {
|
||||
this.$API.ecm.event_cate.list.req({ trigger:10, page: 0 }).then((res) => {
|
||||
this.algooptions = res;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="始终开启" prop="always_on">
|
||||
<!-- <el-form-item label="常开" prop="always_on">
|
||||
<el-switch v-model="form.always_on"></el-switch>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
|
@ -68,7 +68,7 @@ export default {
|
|||
form: {
|
||||
algo: "",
|
||||
vchannels: [],
|
||||
always_on: true,
|
||||
always_on: false,
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="24">
|
||||
<!-- <el-col :md="12" :sm="24">
|
||||
<el-form-item label="需布设" prop="self_algo">
|
||||
<el-switch v-model="form.self_algo"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="处理时间" prop="handle_minute">
|
||||
|
@ -56,6 +56,15 @@
|
|||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="告警间隔" prop="same_allow_minute">
|
||||
<el-input-number
|
||||
v-model="form.same_allow_minute"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="作业许可" prop="opl_cates">
|
||||
<el-select v-model="form.opl_cates" multiple>
|
||||
|
@ -129,15 +138,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="允许时间" prop="same_allow_minute">
|
||||
<el-input-number
|
||||
v-model="form.same_allow_minute"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<!-- <el-col :md="12" :sm="24">
|
||||
<el-form-item label="开启区域" prop="filter_area_level">
|
||||
|
@ -183,11 +184,13 @@ export default {
|
|||
form: {
|
||||
speaker_on: true,
|
||||
self_algo: false,
|
||||
speakers: [],
|
||||
speakers: []
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入" }],
|
||||
code: [{ required: true, message: "请输入" }],
|
||||
trigger: [{ required: true, message: "请选择" }],
|
||||
},
|
||||
filter_area_level_options: [
|
||||
{
|
||||
|
|
|
@ -1,24 +1,128 @@
|
|||
<template>
|
||||
<el-card shadow="hover" header="关于项目" class="item-background">
|
||||
<p>高性能 / 精致 / 优雅。基于Vue3 + Element-Plus 的中后台前端解决方案,如果喜欢就点个星星支持一下。</p>
|
||||
<p>
|
||||
<a href='https://gitee.com/lolicode/scui' target="_blank">
|
||||
<img src='https://gitee.com/lolicode/scui/badge/star.svg?theme=dark' alt='star' style="vertical-align: middle">
|
||||
</a>
|
||||
</p>
|
||||
</el-card>
|
||||
<el-row :gutter="6">
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-card shadow="hover" header="在厂人员" class="item-background" >
|
||||
<el-table :data="tableData" ref="table" row-key="id" fit hideDo height="332">
|
||||
<el-table-column label="姓名">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.employee_">{{scope.row.employee_.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="部门">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.employee_">{{ scope.row.employee_.belong_dept_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前位置">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.employee_">
|
||||
<span v-if="scope.row.employee_.location">
|
||||
<span v-if="scope.row.employee_.location.area_fix_name">{{scope.row.employee_.location.area_fix_name }}</span>
|
||||
<span v-else>厂区内</span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="MAC">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.employee_">{{ scope.row.code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination background
|
||||
:page-size="1000"
|
||||
:small="true"
|
||||
:total="total"></el-pagination>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>今日事件统计</span>
|
||||
</div>
|
||||
</template>
|
||||
<scEcharts height="360px" :option="option3"></scEcharts>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scEcharts from "@/components/scEcharts";
|
||||
export default {
|
||||
title: "关于项目",
|
||||
icon: "el-icon-setting",
|
||||
description: "点个星星支持一下",
|
||||
components: {
|
||||
scEcharts,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
total:0,
|
||||
dutyAgg: [],
|
||||
tableData:[],
|
||||
postOptions: [],
|
||||
option3: null,
|
||||
operationnumber: null,
|
||||
rpjnumber: null,
|
||||
visitnumber: null,
|
||||
apiObj1 : this.$API.third.blt.all
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var craeteTime = this.$TOOL.dateFormat(
|
||||
new Date().toLocaleDateString(),
|
||||
"yyyy-MM-dd"
|
||||
);
|
||||
|
||||
this.postOptions = [];
|
||||
this.$API.ecm.event.cateAgg
|
||||
.req({ completed: false, start_create: craeteTime })
|
||||
.then((res) => {
|
||||
res.details.forEach((itemI, indexI) => {
|
||||
this.postOptions.push({ value: itemI.count, name: itemI.cate__name });
|
||||
});
|
||||
});
|
||||
this.option3 = {
|
||||
title: {},
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
},
|
||||
legend: {
|
||||
// orient: 'vertical',
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "事件分类",
|
||||
type: "pie",
|
||||
radius: ["40%", "70%"],
|
||||
center: ["50%", "60%"],
|
||||
label: {
|
||||
formatter: '{c}',
|
||||
position: 'inside',
|
||||
color: 'white'
|
||||
},
|
||||
data: this.postOptions,
|
||||
},
|
||||
],
|
||||
};
|
||||
this.$API.third.blt.all
|
||||
.req()
|
||||
.then((res) => {
|
||||
res.forEach((item) => {
|
||||
this.total = res.length;
|
||||
this.tableData.push(item.my_info);
|
||||
});
|
||||
});
|
||||
// this.params.start_create = craeteTime;
|
||||
// this.apiObj1 = this.$API.third.blt.all;
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,23 +1,26 @@
|
|||
<template>
|
||||
<el-row :gutter="6">
|
||||
<el-col :md="3" :sm="24">
|
||||
<el-card shadow="hover">
|
||||
<el-col :md="8" :sm="24">
|
||||
<el-card shadow="hover" style="">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>工单待办</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="card-body">
|
||||
<div v-for="item in dutyAgg" :key="item.workflow" style=" margin-bottom: 10px;">
|
||||
<div class="card-body" v-if="dutyAgg.length>0">
|
||||
<div v-for="item in dutyAgg" :key="item.workflow" style="margin-bottom: 10px;height: fit-content;">
|
||||
<el-badge :value="item.count" class="item workItemImg">
|
||||
<el-button icon="el-icon-promotion" type="primary" size="small" @click="toTicket"></el-button>
|
||||
</el-badge>
|
||||
<div class="workItemText">{{ item.workflow__name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" v-else>
|
||||
<div style="width:100%;line-height: 200px;color: #606266;text-align: center;">暂无待办工单</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="13" :sm="24">
|
||||
<el-col :md="16" :sm="24">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
@ -71,7 +74,7 @@
|
|||
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="24">
|
||||
<!-- <el-col :md="8" :sm="24">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
|
@ -80,7 +83,7 @@
|
|||
</template>
|
||||
<scEcharts height="340px" :option="option3"></scEcharts>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
|
@ -111,45 +114,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
var craeteTime = this.$TOOL.dateFormat(
|
||||
new Date().toLocaleDateString(),
|
||||
"yyyy-MM-dd"
|
||||
);
|
||||
|
||||
this.postOptions = [];
|
||||
this.$API.ecm.event.cateAgg
|
||||
.req({ completed: false, start_create: craeteTime })
|
||||
.then((res) => {
|
||||
res.details.forEach((itemI, indexI) => {
|
||||
this.postOptions.push({ value: itemI.count, name: itemI.cate__name });
|
||||
});
|
||||
});
|
||||
this.option3 = {
|
||||
title: {},
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
},
|
||||
legend: {
|
||||
// orient: 'vertical',
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "事件分类",
|
||||
type: "pie",
|
||||
radius: ["40%", "70%"],
|
||||
center: ["50%", "60%"],
|
||||
label: {
|
||||
formatter: '{c}',
|
||||
position: 'inside',
|
||||
color: 'white'
|
||||
},
|
||||
data: this.postOptions,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
this.params.start_create = craeteTime;
|
||||
|
||||
this.apiObj = this.$API.ecm.event.list;
|
||||
this.getdutyAgg();
|
||||
},
|
||||
|
@ -241,10 +206,10 @@ export default {
|
|||
.card-body {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
height: 340px;
|
||||
overflow-y: scroll;
|
||||
padding-top: 10px;
|
||||
align-content:flex-start
|
||||
}
|
||||
|
||||
.workItemImg{
|
||||
|
|
|
@ -166,9 +166,11 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传证书">
|
||||
<!-- <sc-upload v-model="form.file" :modelValue="form.file" title="证件图片" :width="300" :height="148"></sc-upload> -->
|
||||
<sc-upload-file
|
||||
v-model="form.file"
|
||||
:multiple="false"
|
||||
:limit="1"
|
||||
accept="image/png, image/jpeg, image/jpeg, pdf"
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-upload"
|
||||
|
|
|
@ -69,24 +69,31 @@
|
|||
<span v-if="scope.row.employee">{{scope.row.employee_.belong_dept_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡类型" prop="number">
|
||||
<template #default="scope">
|
||||
<el-tag :type="type_[scope.row.type].color">{{type_[scope.row.type].label}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="触发形式" prop="type">
|
||||
<template #default="scope">
|
||||
{{trigger_[scope.row.trigger]}}--
|
||||
<span v-if="scope.row.detail">{{scope.row.detail.deviceName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="体温(℃)">
|
||||
<!-- <el-table-column label="体温(℃)">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.detail">
|
||||
<span v-if="scope.row.detail.isOverTemp" style="color:red;font-weight:bold">{{scope.row.detail.curTemp}}</span>
|
||||
<span v-else style="color:green;font-weight:bold">{{scope.row.detail.curTemp}}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="考勤推测">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.type==10 || scope.row.type==20">
|
||||
<el-tag :type="type_[scope.row.type].color">{{type_[scope.row.type].label}}</el-tag>
|
||||
</span>
|
||||
<span v-if="(scope.row.type==10 || scope.row.type==20)&&scope.row.exception_type!==null">-</span>
|
||||
<span v-if="scope.row.exception_type==10" class="nomalState type1">在岗时间短</span>
|
||||
<span v-if="scope.row.exception_type==20" class="nomalState type2">在岗时间长</span>
|
||||
<span v-if="scope.row.exception_type==30" class="nomalState type3">缺卡</span>
|
||||
<span v-if="scope.row.exception_type==40" class="nomalState type4">加班</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡时间" prop="create_time"></el-table-column>
|
||||
</scTable>
|
||||
|
@ -96,6 +103,7 @@
|
|||
<script>
|
||||
import config from "@/config"
|
||||
import * as XLSX2 from "xlsx";
|
||||
import * as XLSX from "xlsx-style";
|
||||
import { fill } from "lodash";
|
||||
export default {
|
||||
name: "clock_record",
|
||||
|
@ -111,7 +119,7 @@
|
|||
selection: [],
|
||||
type_:{
|
||||
10: {"label": "上班打卡", "color": ""},
|
||||
20: {"label": "下班打卡", "color": "success"}
|
||||
20: {"label": "下班打卡", "color": "success"},
|
||||
},
|
||||
epOptions:{
|
||||
"employee": "正式员工",
|
||||
|
@ -119,7 +127,8 @@
|
|||
},
|
||||
trigger_:{
|
||||
"door": "门禁",
|
||||
"location": "定位"
|
||||
"location": "定位",
|
||||
"panel": "面板机"
|
||||
},
|
||||
excelName:'',
|
||||
weekList : ['姓名','星期'],
|
||||
|
@ -180,8 +189,6 @@
|
|||
that.cLoading = false;
|
||||
that.ElLoading.close();
|
||||
let urls = config.API_URL.slice(0,-4)+res.path;
|
||||
console.log(urls)
|
||||
|
||||
window.open(urls, "_blank");
|
||||
}).catch(e=>{
|
||||
that.cLoading = false;
|
||||
|
@ -192,7 +199,7 @@
|
|||
getOneData(id){
|
||||
let that = this;
|
||||
return new Promise((resolve,reject)=>{
|
||||
that.$API.hrm.clock_record.list.req({page:1,page_size:400,year:that.query.year,month:that.query.month,employee:id})
|
||||
that.$API.hrm.clock_record.list.req({page:1,page_size:499,type__in:'10,20',year:that.query.year,month:that.query.month,employee:id})
|
||||
.then(res=>{
|
||||
resolve(res.results)
|
||||
})
|
||||
|
@ -208,21 +215,20 @@
|
|||
this.dLoading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
let days = new Date(this.query.year, this.query.month , 0).getDate();
|
||||
let weekList = ['姓名','星期'],daysList=['姓名','日期'],titleData = [];
|
||||
for(var i = 1;i<= days;i++){
|
||||
let weekNum = new Date(this.query.year+'-'+this.query.month+'-'+i).getDay();
|
||||
// debugger;
|
||||
// console.log(weekNum)
|
||||
let week=that.getDayWeek(weekNum)
|
||||
daysList.push(i);
|
||||
weekList.push(week);
|
||||
}
|
||||
let chartName = this.excelName+that.query.year+'年'+that.query.month+'月考勤统计表';
|
||||
titleData.push(chartName)
|
||||
let tipsData = ['','在岗时间长','在岗时间长','缺卡','缺卡','在岗时间短','在岗时间短','加班','加班'];
|
||||
titleData.push(chartName);
|
||||
let tableData = [];
|
||||
tableData.push(titleData)
|
||||
tableData.push(tipsData)
|
||||
tableData.push(weekList)
|
||||
tableData.push(daysList)
|
||||
that.ElLoading = this.$loading({
|
||||
|
@ -230,7 +236,7 @@
|
|||
text: '数据请求中,请稍后...',
|
||||
background: 'rgba(0, 0, 0, 0)',
|
||||
})
|
||||
that.$API.hrm.employee.list.req({page:1,page_size:999,belong_dept:that.query.employee__belong_dept})
|
||||
that.$API.hrm.employee.list.req({page:1,page_size:999,type__in:'employee,remployee',job_state:10,belong_dept:that.query.employee__belong_dept})
|
||||
.then(res=>{
|
||||
let promiseList = [];
|
||||
let rowData1 = [],rowData2=[];
|
||||
|
@ -253,9 +259,9 @@
|
|||
let dateInd = new Date(recordList[j].create_time).getDate();
|
||||
let dateIndex = parseInt(dateInd);
|
||||
if(recordList[j].type==10){
|
||||
rowData1[dateIndex+1] = '√-' + recordList[j].create_time.substring(11);
|
||||
rowData1[dateIndex+1] = recordList[j].create_time.substring(11,16)+'&'+recordList[j].exception_type;
|
||||
}else{
|
||||
rowData2[dateIndex+1] = '√-' + recordList[j].create_time.substring(11);
|
||||
rowData2[dateIndex+1] = recordList[j].create_time.substring(11,16)+'&'+recordList[j].exception_type;
|
||||
}
|
||||
}
|
||||
tableData.push(rowData1);
|
||||
|
@ -263,36 +269,164 @@
|
|||
}
|
||||
let ws = XLSX2.utils.aoa_to_sheet(tableData);
|
||||
let wb = XLSX2.utils.book_new();
|
||||
//字体样式
|
||||
const font = {
|
||||
name: '宋体',
|
||||
sz: 12,
|
||||
bold: true,
|
||||
color: { rgb: '00000000' },
|
||||
ws['!freeze'] = {
|
||||
xSplit: "1", //冻结列
|
||||
ySplit: "1", //冻结行
|
||||
topLeftCell: "B2", //在未冻结区域的左上角显示的单元格,默认为第一个未冻结的单元格
|
||||
state: "frozen"
|
||||
}
|
||||
//设置文字居中
|
||||
const alignment = {
|
||||
horizontal: 'center',
|
||||
vertical: 'center',
|
||||
for(let key in ws){
|
||||
if(key.indexOf('!')!==0){
|
||||
if(key==='A1'){
|
||||
ws[key].s = {
|
||||
font: {
|
||||
sz: "12",
|
||||
bold: true
|
||||
},
|
||||
alignment: {
|
||||
horizontal: "center", vertical: "center"
|
||||
},
|
||||
fill: {
|
||||
bgColor: { rgb: "FFFFAA00" },
|
||||
fgColor: { rgb: "FFFFAA00" }
|
||||
}
|
||||
};
|
||||
}else if(key==='B2'){
|
||||
ws[key].s = {
|
||||
font: {sz: 10},
|
||||
alignment: {
|
||||
horizontal: "center", vertical: "center"
|
||||
},
|
||||
fill: {
|
||||
bgColor: { rgb: "FF0000" },
|
||||
fgColor: { rgb: "FF0000" }
|
||||
}
|
||||
};
|
||||
}else if(key==='D2'){
|
||||
ws[key].s = {
|
||||
font: {sz: 10},
|
||||
alignment: {
|
||||
horizontal: "center", vertical: "center"
|
||||
},
|
||||
fill: {
|
||||
bgColor: { rgb: "FA8435" },
|
||||
fgColor: { rgb: "FA8435" }
|
||||
}
|
||||
};
|
||||
}else if(key==='F2'){
|
||||
ws[key].s = {
|
||||
font: {sz: 10},
|
||||
alignment: {
|
||||
horizontal: "center", vertical: "center"
|
||||
},
|
||||
fill: {
|
||||
bgColor: { rgb: "F8DD4E" },
|
||||
fgColor: { rgb: "F8DD4E" }
|
||||
}
|
||||
};
|
||||
}else if(key==='H2'){
|
||||
ws[key].s = {
|
||||
font: {sz: 10},
|
||||
alignment: {
|
||||
horizontal: "center", vertical: "center"
|
||||
},
|
||||
fill: {
|
||||
bgColor: { rgb: "44CEF6" },
|
||||
fgColor: { rgb: "44CEF6" }
|
||||
}
|
||||
};
|
||||
}else{
|
||||
let cal = ws[key]['v']+'';
|
||||
let type = null;
|
||||
if(cal.indexOf('&')>-1){
|
||||
ws[key]['v'] = cal.split('&')[0]
|
||||
type = cal.split('&')[1];
|
||||
}
|
||||
if(type!==null&&type!=='null'){
|
||||
console.log('type:'+type)
|
||||
if(type==='10'){//在岗时间短-----黄色
|
||||
ws[key].s = {
|
||||
font: {sz: 10},
|
||||
alignment: { horizontal: 'center', vertical: 'center' },
|
||||
fill: {
|
||||
bgColor: { rgb: "F8DD4E" },
|
||||
fgColor: { rgb: "F8DD4E" },
|
||||
}
|
||||
};
|
||||
}else if(type==='20'){//在岗时间长----红色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center'},
|
||||
fill: {
|
||||
bgColor: { rgb: "FF0000" },
|
||||
fgColor: { rgb: "FF0000" }
|
||||
}
|
||||
};
|
||||
}else if(type==='30'){//缺卡-----橙色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center'},
|
||||
fill: {
|
||||
bgColor: { rgb: "FA8435" },
|
||||
fgColor: { rgb: "FA8435" }
|
||||
}
|
||||
};
|
||||
}else if(type==='40'){//加班---蓝色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center' },
|
||||
fill: {
|
||||
bgColor: { rgb: "44CEF6" },
|
||||
fgColor: { rgb: "44CEF6" }
|
||||
}
|
||||
};
|
||||
}
|
||||
}else{//正常--无色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center'},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// ws['A0'].s = {
|
||||
// font,
|
||||
// alignment,
|
||||
// }
|
||||
console.log(ws)
|
||||
// s 意为 start ,即开始的单元格//r 是 row ,表示行号,从 0 计起//c 是 col ,表示列号,从 0 计起
|
||||
let cNumber = daysList.length-1;
|
||||
let merge = [{ s: { r: 0, c: 0 }, e: { r: 0, c:cNumber } }];//{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } },
|
||||
for(let i = 1;i<tableData.length;i++){
|
||||
for(let i = 2;i<tableData.length;i++){
|
||||
merge.push({ s: { r: i, c: 0 }, e: { r: i+1, c: 0 } })
|
||||
i++
|
||||
}
|
||||
ws['!merges'] = merge;
|
||||
let closList = new Array(31).fill({wch: 2 });
|
||||
let closList = new Array(31).fill({wch: 5});
|
||||
closList.unshift({wch:8})
|
||||
closList.unshift({wch:15})
|
||||
closList.unshift({wch:10})
|
||||
ws['!cols'] = closList;
|
||||
let rows = new Array(500).fill({hpx: 15});
|
||||
rows.unshift({hpx:20})
|
||||
ws['!rows'] = rows; // 添加到sheet中
|
||||
XLSX2.utils.book_append_sheet(wb, ws, chartName); // 工作簿名称
|
||||
XLSX2.writeFile(wb, chartName+'.xlsx'); // 保存的文件名
|
||||
// XLSX2.writeFile(wb, chartName+'.xlsx'); // 保存的文件名
|
||||
var wopts = {
|
||||
bookType: 'xlsx', // 要生成的文件类型
|
||||
bookSST: false, // 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
|
||||
type: 'binary'
|
||||
};
|
||||
var wbout = XLSX.write(wb, wopts);
|
||||
var blob = new Blob([this.s2ab(wbout)], {
|
||||
type: "application/octet-stream"
|
||||
}); // 字符串转ArrayBuffer
|
||||
// 导出excel文件 如导出后的文件不能打开,请将后缀替换为 .xls
|
||||
this.openDownloadDialog(blob, chartName+`.xlsx`);
|
||||
that.dLoading = false;
|
||||
that.ElLoading.close();
|
||||
});
|
||||
|
@ -301,6 +435,28 @@
|
|||
that.ElLoading.close();
|
||||
})
|
||||
},
|
||||
s2ab(s) {
|
||||
var buf = new ArrayBuffer(s.length);
|
||||
var view = new Uint8Array(buf);
|
||||
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
|
||||
return buf;
|
||||
},
|
||||
openDownloadDialog(url, saveName) {
|
||||
if (typeof url == 'object' && url instanceof Blob) {
|
||||
url = URL.createObjectURL(url); // 创建blob地址
|
||||
}
|
||||
var aLink = document.createElement('a');
|
||||
aLink.href = url;
|
||||
aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效
|
||||
var event;
|
||||
if (window.MouseEvent) event = new MouseEvent('click');
|
||||
else {
|
||||
event = document.createEvent('MouseEvents');
|
||||
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
}
|
||||
aLink.dispatchEvent(event);
|
||||
},
|
||||
|
||||
getDayWeek(day){
|
||||
switch(day){
|
||||
case 0:
|
||||
|
@ -344,3 +500,36 @@
|
|||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nomalState {
|
||||
font-size: 12px;
|
||||
padding: 0 9px;
|
||||
|
||||
height: 24px;
|
||||
line-height: 23px;
|
||||
border-radius: 5px;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
.nomalState.type1{
|
||||
color: #F8DD4E;
|
||||
background-color: #f9f7e6;
|
||||
border: 1px solid #f3f0d5;
|
||||
}
|
||||
.nomalState.type2{
|
||||
color: #FF0000;
|
||||
background-color: #f7e7e7;
|
||||
border: 1px solid #fbe0e0;
|
||||
}
|
||||
.nomalState.type3{
|
||||
color: #FA8435;
|
||||
background-color: #fef6ed;
|
||||
border: 1px solid #fde9cc;
|
||||
}
|
||||
.nomalState.type4{
|
||||
color: #44CEF6;
|
||||
background-color: #f0f9fb;
|
||||
border: 1px solid #d2f9ff;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -2,29 +2,109 @@
|
|||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-select v-model="query.type" placeholder="人员类型" @change="handleQuery" clearable style="margin-left: 2px">
|
||||
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
<el-select
|
||||
v-model="query.has_blt"
|
||||
placeholder="有无定位卡"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px; width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in bltOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-cascader v-model="query.belong_dept" :options="deptData" clearable placeholder="部门/单位" @change="handleQuery" :show-all-levels="false" :props="{emitPath:false,checkStrictly: true}" style="margin-left:4px"/>
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="人员类型"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px; width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="query.job_state"
|
||||
placeholder="人员状态"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px; width: 120px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in jobOptions2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-cascader
|
||||
v-model="query.belong_dept"
|
||||
:options="deptData"
|
||||
clearable
|
||||
placeholder="部门/单位"
|
||||
@change="handleQuery"
|
||||
:show-all-levels="false"
|
||||
:props="{ emitPath: false, checkStrictly: true }"
|
||||
style="margin-left: 4px; width: 150px"
|
||||
/>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-input v-model="query.search" placeholder="姓名/手机号" clearable @keyup.enter="handleQuery"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="姓名/手机号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading = 'cLoading'
|
||||
icon="el-icon-download"
|
||||
@click="exportExcel"
|
||||
>导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe
|
||||
@resetQuery="resetQuery">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
@selection-change="selectionChange"
|
||||
stripe
|
||||
@resetQuery="resetQuery"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="人员类型" prop="type" width="160">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.type == 'employee' || scope.row.type == 'remployee'">[{{ jobOptions[scope.row.job_state] }}]
|
||||
<span
|
||||
v-if="
|
||||
scope.row.type == 'employee' || scope.row.type == 'remployee'
|
||||
"
|
||||
>[{{ jobOptions[scope.row.job_state] }}]
|
||||
</span>
|
||||
<span>{{ userTypeOptions[scope.row.type] }}</span>
|
||||
<span v-if="scope.row.type == 'employee' && scope.row.is_atwork" style="color:green;font-weight:bold">
|
||||
<span
|
||||
v-if="
|
||||
(scope.row.type == 'employee' ||
|
||||
scope.row.type == 'remployee') &&
|
||||
scope.row.is_atwork
|
||||
"
|
||||
style="color: green; font-weight: bold"
|
||||
>
|
||||
在岗
|
||||
</span>
|
||||
</template>
|
||||
|
@ -38,28 +118,53 @@
|
|||
<el-avatar :size="50" :src="scope.row.photo" shape="square" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号" prop="phone" width="120"></el-table-column>
|
||||
<el-table-column label="部门" prop="belong_dept" width="280">
|
||||
<el-table-column
|
||||
label="手机号"
|
||||
prop="phone"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="部门/单位"
|
||||
prop="belong_dept"
|
||||
width="180"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.belong_dept_">{{
|
||||
scope.row.belong_dept_.name
|
||||
scope.row.belong_dept_.name
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份证号" prop="id_number" width="180"></el-table-column>
|
||||
<el-table-column label="系统账号" prop="user" width="180"><template #default="scope">
|
||||
<span v-if="scope.row.user">{{
|
||||
scope.row.user_.username
|
||||
}}</span>
|
||||
</template></el-table-column>
|
||||
<el-table-column label="定位卡号" prop="blt_" width="180">
|
||||
<el-table-column
|
||||
label="身份证号"
|
||||
prop="id_number"
|
||||
width="180"
|
||||
:show-overflow-tooltip="true"
|
||||
></el-table-column>
|
||||
<el-table-column label="系统账号" prop="user" width="180"
|
||||
><template #default="scope">
|
||||
<span v-if="scope.row.user">{{ scope.row.user_.username }}</span>
|
||||
</template></el-table-column
|
||||
>
|
||||
<el-table-column label="定位卡号" prop="blt_" width="180" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.blt_">{{
|
||||
scope.row.blt_.code
|
||||
}}</span>
|
||||
<div v-if="scope.row.blt_">
|
||||
<div>{{ scope.row.blt_.code }}</div>
|
||||
<div v-if="scope.row.location">
|
||||
{{ scope.row.location.area_fix_name }}-
|
||||
<span v-if="scope.row.location.xx_detail"
|
||||
>({{ scope.row.location.xx_detail.longitude }},
|
||||
{{ scope.row.location.xx_detail.latitude }})</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time"></el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
width="180"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left" width="170">
|
||||
<template #default="scope">
|
||||
<!-- <el-button
|
||||
|
@ -70,25 +175,58 @@
|
|||
v-auth="'employee.update'"
|
||||
>证书
|
||||
</el-button> -->
|
||||
<el-button link type="success" size="small" @click="handleForm('show', scope.row)">查看
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
size="small"
|
||||
@click="handleForm('show', scope.row)"
|
||||
>查看
|
||||
</el-button>
|
||||
<el-button link type="warning" size="small" v-auth="'employee.update'"
|
||||
@click="handleForm('edit', scope.row)">编辑
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
v-auth="'employee.update'"
|
||||
@click="handleForm('edit', scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.blt_" link type="danger" size="small" @click="handleBindBlt(20, scope.row)">解绑
|
||||
<el-button
|
||||
v-if="scope.row.blt_"
|
||||
link
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleBindBlt(20, scope.row)"
|
||||
>解绑
|
||||
</el-button>
|
||||
<el-button v-else link type="primary" size="small" @click="handleBindBlt(10, scope.row)">绑卡
|
||||
<el-button
|
||||
v-else
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleBindBlt(10, scope.row)"
|
||||
>绑卡
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save = false">
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
>
|
||||
</save-dialog>
|
||||
|
||||
<ScBind v-if="showBindBlt" :bindBtl="bindBtl" :bindType="bindType" :bindName="bindName" :bindEmployee="bindEmployee"
|
||||
@closed="closed"></ScBind>
|
||||
<ScBind
|
||||
v-if="showBindBlt"
|
||||
:bindBtl="bindBtl"
|
||||
:bindType="bindType"
|
||||
:bindName="bindName"
|
||||
:bindEmployee="bindEmployee"
|
||||
@closed="closed"
|
||||
></ScBind>
|
||||
<!-- <el-Dialog
|
||||
title="绑定定位卡"
|
||||
v-model="showBindBlt"
|
||||
|
@ -125,12 +263,12 @@
|
|||
import saveDialog from "./ep_form.vue";
|
||||
import ScBind from "@/components/scBind/index.vue";
|
||||
import { genTree } from "@/utils/verificate";
|
||||
|
||||
import config from "@/config"
|
||||
export default {
|
||||
name: "employee",
|
||||
components: {
|
||||
saveDialog,
|
||||
ScBind
|
||||
ScBind,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -138,7 +276,7 @@ export default {
|
|||
save: false,
|
||||
permission: false,
|
||||
},
|
||||
deptData:[],
|
||||
deptData: [],
|
||||
apiObj: this.$API.hrm.employee.list,
|
||||
query: {},
|
||||
tdevice: [],
|
||||
|
@ -152,7 +290,7 @@ export default {
|
|||
bindName: "",
|
||||
bindType: 10,
|
||||
bindBtl: null,
|
||||
bindEmployee: '',
|
||||
bindEmployee: "",
|
||||
form: {
|
||||
type: 10,
|
||||
blt: "",
|
||||
|
@ -162,17 +300,27 @@ export default {
|
|||
employee: "正式员工",
|
||||
remployee: "相关方",
|
||||
visitor: "访客",
|
||||
driver: "货车司机"
|
||||
driver: "货车司机",
|
||||
},
|
||||
jobOptions: {
|
||||
10: "在职",
|
||||
20: "离职",
|
||||
30: "退休",
|
||||
},
|
||||
typeOptions: [
|
||||
{ label: "正式员工", value: "employee" },
|
||||
{ label: "相关方", value: "remployee" },
|
||||
{ label: "访客", value: "visitor" },
|
||||
{ label: "货车司机", value: "driver" }
|
||||
{ label: "货车司机", value: "driver" },
|
||||
],
|
||||
jobOptions2: [
|
||||
{ label: "在职", value: 10 },
|
||||
{ label: "离职", value: 20 },
|
||||
{ label: "退休", value: 30 },
|
||||
],
|
||||
bltOptions :[
|
||||
{ label: "有", value: 1 },
|
||||
{ label: "无", value: 0 },
|
||||
]
|
||||
};
|
||||
},
|
||||
|
@ -182,7 +330,10 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
async getDept() {
|
||||
let res = await this.$API.system.dept.list.req({ page: 0, type__in: 'dept,rparty' });
|
||||
let res = await this.$API.system.dept.list.req({
|
||||
page: 0,
|
||||
type__in: "dept,rparty",
|
||||
});
|
||||
this.deptData = genTree(res);
|
||||
},
|
||||
//人员证书添加
|
||||
|
@ -260,7 +411,7 @@ export default {
|
|||
loading.close();
|
||||
this.$message.success("操作成功");
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {});
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection) {
|
||||
|
@ -311,18 +462,21 @@ export default {
|
|||
},
|
||||
closed(data) {
|
||||
this.showBindBlt = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
|
||||
getBltList() {
|
||||
let that = this;
|
||||
that.$API.third.tdevice.list.req({ type: 30, page: 0, state: 'unused' }).then((res) => {
|
||||
that.tdevice = res;
|
||||
that.bltList = res.filter((item) => {
|
||||
return item.employee_ === null;
|
||||
that.$API.third.tdevice.list
|
||||
.req({ type: 30, page: 0, state: "unused" })
|
||||
.then((res) => {
|
||||
that.tdevice = res;
|
||||
that.bltList = res.filter((item) => {
|
||||
return item.employee_ === null;
|
||||
});
|
||||
console.log(res);
|
||||
console.log(that.bltList);
|
||||
});
|
||||
console.log(res);
|
||||
console.log(that.bltList);
|
||||
});
|
||||
},
|
||||
handleBindBlt(type, row) {
|
||||
// this.dis = false;
|
||||
|
@ -338,13 +492,30 @@ export default {
|
|||
submitBindBlt() {
|
||||
let that = this;
|
||||
that.$API.third.tdevice.bltBind.req(this.form).then((res) => {
|
||||
if (res.err_msg) {
|
||||
} else {
|
||||
that.showBindBlt = false;
|
||||
that.$refs.table.refresh();
|
||||
}
|
||||
that.showBindBlt = false;
|
||||
that.$refs.table.refresh();
|
||||
});
|
||||
},
|
||||
exportExcel(){
|
||||
let that = this;
|
||||
that.cLoading = true;
|
||||
that.ElLoading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据请求中,请稍后...',
|
||||
background: 'rgba(0, 0, 0, 0)',
|
||||
})
|
||||
that.$API.hrm.employee.export_excel.req(that.query)
|
||||
.then(res=>{
|
||||
that.cLoading = false;
|
||||
that.ElLoading.close();
|
||||
let urls = config.API_URL.slice(0,-4)+res.path;
|
||||
console.log(urls)
|
||||
window.open(urls, "_blank");
|
||||
}).catch(e=>{
|
||||
that.cLoading = false;
|
||||
that.ElLoading.close();
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="签名">
|
||||
<sc-upload v-model="form.signature" title="签名"></sc-upload>
|
||||
<el-image :src="form.signature" style="width: 148px;min-height: 80px;"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
</div>
|
||||
-->
|
||||
<div class="login-oauth">
|
||||
<el-button type="success" @click="appDown" style="background-color:#2cd4f9;border-color:#2cd4f9">安卓APP</el-button>
|
||||
<el-button type="default" @click="appDown">安卓APP</el-button>
|
||||
<el-button type="default" @click="h5Show">H5访问</el-button>
|
||||
<el-button type="primary" @click="MonitorOpen" style="background-color:orange;border-color:orange">监控视频</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -59,6 +60,11 @@
|
|||
<sc-qr-code class="qrCode" :size="200" :text="appUrl"></sc-qr-code>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showH5" title="H5页面" :width="400" destroy-on-close>
|
||||
<div class="qrCodeLogin">
|
||||
<sc-qr-code class="qrCode" :size="200" :text="h5Url"></sc-qr-code>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -91,7 +97,9 @@ import passwordForm from './components/passwordForm'
|
|||
showWechatLogin: false,
|
||||
isWechatLoginResult: false,
|
||||
showApp: false,
|
||||
appUrl: 'http://222.222.144.147:6013/media/zc_ehs.apk'
|
||||
appUrl: 'http://222.222.144.147:6013/media/zc_ehs.apk',
|
||||
showH5: false,
|
||||
h5Url: 'http://222.222.144.147:6013/h5/'
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
|
@ -125,6 +133,9 @@ import passwordForm from './components/passwordForm'
|
|||
appDown() {
|
||||
this.showApp = true;
|
||||
},
|
||||
h5Show() {
|
||||
this.showH5 = true;
|
||||
},
|
||||
MonitorOpen(){
|
||||
window.open('http://10.99.5.79:5515/')
|
||||
},
|
||||
|
|
|
@ -164,12 +164,20 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button type="primary"
|
||||
:disabled="isSaving"
|
||||
:loading="isSaving"
|
||||
plain @click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -472,6 +480,7 @@
|
|||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
:disabled="tLoading"
|
||||
@click="submitTicketCreate(item.id)"
|
||||
style="margin-right:4px"
|
||||
>{{item.name}}
|
||||
|
@ -523,12 +532,13 @@
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
|
||||
query: {},
|
||||
selection: [],
|
||||
issave: false, //控制基本信息提交
|
||||
isSaving: false, //控制基本信息提交
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
|
@ -600,6 +610,9 @@
|
|||
measures_checked: [
|
||||
{required: true, message: '请选择'}
|
||||
],
|
||||
fileurl2:[
|
||||
{required: true, message: '请选择'}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -642,6 +655,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -692,47 +710,60 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
this.isSaving = true;
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
} //如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
// debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
this.$API.opm.opl.create.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
|
||||
this.isSaving = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.isSaving = false;
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -866,9 +897,8 @@
|
|||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -876,6 +906,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -163,12 +163,21 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="issaving"
|
||||
:loading="issaving"
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -522,12 +531,13 @@
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
|
||||
query: {},
|
||||
selection: [],
|
||||
issave: false, //控制基本信息提交
|
||||
issaving: false, //控制基本信息提交
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
|
@ -640,6 +650,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -690,50 +705,63 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
if (valid) {
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issaving = true;
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.active = 1;
|
||||
this.issaving = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.issaving = false;
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.active = 1;
|
||||
this.issaving = false;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (this.active==1){
|
||||
if(this.apiworkerObj.length==0){
|
||||
|
@ -742,9 +770,7 @@
|
|||
}
|
||||
}
|
||||
this.active = 2;
|
||||
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
|
||||
//选择人员后,调出该人员的所有证书
|
||||
|
@ -864,9 +890,8 @@
|
|||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -874,6 +899,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -176,12 +176,20 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button type="primary" plain
|
||||
@click="handleNextStep"
|
||||
:disabled="issaving"
|
||||
:loading="issaving"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -481,6 +489,7 @@
|
|||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
:disabled="tLoading"
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -535,12 +544,13 @@
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
|
||||
query: {},
|
||||
selection: [],
|
||||
issave: false, //控制基本信息提交
|
||||
issaving: false, //控制基本信息提交
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
|
@ -653,6 +663,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -703,50 +718,62 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
if (valid) {
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issaving = true; //如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.active = 1;
|
||||
this.issaving = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.issaving = false;
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.active = 1;
|
||||
this.issaving = false;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (this.active==1){
|
||||
if(this.apiworkerObj.length==0){
|
||||
|
@ -755,9 +782,7 @@
|
|||
}
|
||||
}
|
||||
this.active = 2;
|
||||
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
|
||||
//选择人员后,调出该人员的所有证书
|
||||
|
@ -877,9 +902,8 @@
|
|||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -887,11 +911,11 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
id: this.operationId,//作业ID
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -85,12 +85,12 @@
|
|||
v-model="form.dept_do"
|
||||
:options="deptoptions"
|
||||
:props="{
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
@ -172,12 +172,21 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
:loading="issave"
|
||||
:disabled="issave"
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -306,6 +315,7 @@
|
|||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
:disabled="tLoading"
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -360,6 +370,7 @@
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员"],
|
||||
|
@ -383,10 +394,10 @@
|
|||
oplcateCode: "",
|
||||
oplId: "",
|
||||
leveloptions: [
|
||||
{ id: "特级", name: "特级:>30米" },
|
||||
{ id: "三级", name: "三级:15-30米" },
|
||||
{ id: "二级", name: "二级:>5-15米" },
|
||||
{ id: "一级", name: "一级:1.8-5米" },
|
||||
{ id: "特级:>30米", name: "特级:>30米" },
|
||||
{ id: "三级:15-30米", name: "三级:15-30米" },
|
||||
{ id: "二级:>5-15米", name: "二级:>5-15米" },
|
||||
{ id: "一级:1.8-5米", name: "一级:1.8-5米" },
|
||||
],
|
||||
deptoptions: [],
|
||||
useroptions: [],
|
||||
|
@ -479,6 +490,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -503,10 +519,8 @@
|
|||
this.deptoptions = genTree(res);
|
||||
});
|
||||
},
|
||||
|
||||
//作业负责人、作业监护人
|
||||
//作业
|
||||
|
||||
//根据作业许可证类别ID获取,风险、措施===>作业许可证类别详情
|
||||
getOplcates() {
|
||||
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
|
||||
|
@ -529,48 +543,60 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issave = true; //如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.active = 1;
|
||||
this.issave = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.issave = false;
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.active = 1;
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.issave = false;
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -690,17 +716,16 @@
|
|||
//提交,创建工单
|
||||
submitTicketCreate(id) {
|
||||
if(this.apiworkerObj.length==0){
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
let ticket = {};
|
||||
ticket.workflow = this.initForm.workflow;
|
||||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -708,6 +733,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -172,12 +172,21 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
:loading="issave"
|
||||
:disabled="issave"
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -306,6 +315,7 @@
|
|||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
:disabled="tLoading"
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -360,6 +370,7 @@
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员"],
|
||||
|
@ -478,6 +489,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -528,52 +544,65 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issave = true; //如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.active = 1;
|
||||
this.issave = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.active = 1;
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.issave = false;
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
this.getworkerList();
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
} else {
|
||||
this.active = 1;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
|
||||
//选择人员后,调出该人员的所有证书
|
||||
|
@ -689,17 +718,16 @@
|
|||
//提交,创建工单
|
||||
submitTicketCreate(id) {
|
||||
if(this.apiworkerObj.length==0){
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
let ticket = {};
|
||||
ticket.workflow = this.initForm.workflow;
|
||||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -707,6 +735,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -72,12 +72,12 @@
|
|||
v-model="form.dept_do"
|
||||
:options="deptoptions"
|
||||
:props="{
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
@ -89,14 +89,6 @@
|
|||
style="width:200px"
|
||||
disabled
|
||||
></el-input>
|
||||
<!-- <el-select v-model="form.charger_name" placeholder="选择作业负责人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select> -->
|
||||
<ehsUserSelect :multiple="false" @submit="getCharger"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -145,15 +137,23 @@
|
|||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="issave"
|
||||
:loading="issave"
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
<!--作业人员!-->
|
||||
<el-main class="nopadding" v-show="active === 1">
|
||||
<div class="left-panel" style="margin: 10px">
|
||||
|
@ -279,6 +279,7 @@
|
|||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
:disabled="tLoading"
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -324,15 +325,16 @@
|
|||
opl: "",
|
||||
};
|
||||
const defaultformgas = {
|
||||
id: "",
|
||||
check_time: null,
|
||||
opl:""
|
||||
};
|
||||
id: "",
|
||||
check_time: null,
|
||||
opl:""
|
||||
};
|
||||
export default {
|
||||
name: "fire",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员"],
|
||||
|
@ -349,16 +351,19 @@
|
|||
operation: "",
|
||||
cate: "",
|
||||
risks_checked: [],
|
||||
create_imgs:[],
|
||||
},
|
||||
create_imgs:[],
|
||||
imgList:[],
|
||||
initForm: {},
|
||||
operationId: "",
|
||||
oplcateId: "",
|
||||
oplcateCode: "",
|
||||
oplId: "",
|
||||
leveloptions: [
|
||||
{ id: "主干道", name: "主干道" },
|
||||
{ id: "次干渠", name: "次干渠" }
|
||||
],
|
||||
{ id: "主干道", name: "主干道" },
|
||||
{ id: "次干渠", name: "次干渠" }
|
||||
],
|
||||
deptoptions: [],
|
||||
useroptions: [],
|
||||
risklist: [],
|
||||
|
@ -418,6 +423,21 @@
|
|||
// this.getUser();
|
||||
},
|
||||
methods: {
|
||||
uploadSuccess(data){
|
||||
debugger;
|
||||
console.log(data);
|
||||
debugger;
|
||||
let imgArr = [];
|
||||
if(data.constructor===Array ){
|
||||
data.forEach(item=>{
|
||||
imgArr.push(item.response.id)
|
||||
})
|
||||
}else{
|
||||
|
||||
imgArr.push(data.id)
|
||||
}
|
||||
this.form.create_imgs = imgArr;
|
||||
},
|
||||
getCharger(data) {
|
||||
this.form.charger=data.id;
|
||||
this.form.charger_name=data.name
|
||||
|
@ -447,6 +467,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -497,48 +522,66 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
// debugger;
|
||||
console.log(this.form.create_imgs);
|
||||
// return;
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issave = true;
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
// debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.active = 1;
|
||||
this.issave = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.active = 1;
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.issave = false;
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
} else {
|
||||
this.active = 1;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
this.issave = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -658,17 +701,16 @@
|
|||
//提交,创建工单
|
||||
submitTicketCreate(id) {
|
||||
if(this.apiworkerObj.length==0){
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
let ticket = {};
|
||||
ticket.workflow = this.initForm.workflow;
|
||||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -676,6 +718,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -92,19 +92,19 @@
|
|||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time" width="150"></el-table-column>
|
||||
<el-table-column label="作业区域" width="100"
|
||||
<el-table-column label="作业区域" width="150"
|
||||
><template #default="scope">
|
||||
{{ scope.row.area_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预计开始" prop="start_time" width="150"></el-table-column>
|
||||
<el-table-column label="预计结束" prop="end_time" width="150"></el-table-column>
|
||||
<el-table-column label="属地部门" prop="dept_ter" width="100"
|
||||
<el-table-column label="属地部门" prop="dept_ter" width="150" :show-overflow-tooltip="true"
|
||||
><template #default="scope">
|
||||
{{ scope.row.dept_ter_.name }}
|
||||
</template></el-table-column
|
||||
>
|
||||
<el-table-column label="业务部门" prop="dept_bus" width="100"
|
||||
<el-table-column label="业务部门" prop="dept_bus" width="150" :show-overflow-tooltip="true"
|
||||
><template #default="scope">
|
||||
{{ scope.row.dept_bus_.name }}
|
||||
</template></el-table-column
|
||||
|
@ -132,7 +132,7 @@
|
|||
>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.state === 10"
|
||||
v-if="scope.row.state!==50"
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
|
|
|
@ -18,32 +18,35 @@
|
|||
<el-row>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="作业简介" prop="name">
|
||||
<el-input v-model="form.name" type="text" clearable></el-input>
|
||||
<el-input v-model="form.name" type="text" clearable :disabled="mode == 'edit'"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="开始时间" prop="start_time">
|
||||
<el-date-picker
|
||||
:disabled="mode == 'edit'"
|
||||
v-model="form.start_time"
|
||||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
:default-time="defaultTime_start"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="结束时间" prop="end_time">
|
||||
<el-date-picker
|
||||
:disabled="mode == 'edit'"
|
||||
v-model="form.end_time"
|
||||
type="datetime"
|
||||
placeholder="选择结束时间"
|
||||
:default-time="defaultTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="生产状态" prop="state_work">
|
||||
<el-select v-model="form.state_work" placeholder="选择生产状态">
|
||||
<el-select v-model="form.state_work" placeholder="选择生产状态" :disabled="mode == 'edit'">
|
||||
<el-option
|
||||
v-for="item in stateoptions"
|
||||
:key="item.id"
|
||||
|
@ -55,7 +58,7 @@
|
|||
</el-col>
|
||||
<el-col :md="12" :sm="24" :xs="24">
|
||||
<el-form-item label="作业区域" prop="area">
|
||||
<el-select v-model="form.area" placeholder="选择作业区域" @change="areaChange" clearable>
|
||||
<el-select v-model="form.area" placeholder="选择作业区域" @change="areaChange" clearable :disabled="mode == 'edit'">
|
||||
<el-option
|
||||
v-for="item in areaoptions"
|
||||
:key="item.id"
|
||||
|
@ -65,12 +68,11 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="具体地点" prop="place">
|
||||
<el-input v-model="form.place" type="text" clearable></el-input>
|
||||
<el-input v-model="form.place" type="text" clearable :disabled="mode == 'edit'"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="24" :xs="24">
|
||||
<el-form-item label="业务部门" prop="dept_bus">
|
||||
<el-cascader
|
||||
|
@ -89,15 +91,14 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="24" :xs="24">
|
||||
<el-form-item label="部门协调员" prop="coordinator">
|
||||
<el-input
|
||||
v-model="form.coordinator_name"
|
||||
disabled
|
||||
style="width:200px"
|
||||
></el-input>
|
||||
<ehsUserSelect :multiple="false" @submit="getUser"/>
|
||||
v-model="form.coordinator_name"
|
||||
disabled
|
||||
style="width:220px"
|
||||
></el-input>
|
||||
<ehsUserSelect :multiple="false" @submit="getUser" v-if="mode == 'add'"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" :xs="24">
|
||||
|
@ -138,9 +139,7 @@
|
|||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button type="primary" :disabled="isSaveing" :loading="isSaveing" @click="submit" v-if="mode!=='show'">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
|
@ -160,6 +159,8 @@ export default {
|
|||
edit: "编辑",
|
||||
show: "查看",
|
||||
},
|
||||
defaultTime_start:new Date(2000, 1, 1, 10, 0, 0),
|
||||
defaultTime:new Date(2000, 1, 1, 18, 0, 0),
|
||||
form: {},
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入作业简介" }],
|
||||
|
@ -194,9 +195,8 @@ export default {
|
|||
methods: {
|
||||
//所属部门,属地部门,业务部门
|
||||
getDept() {
|
||||
this.$API.system.dept.list.req({ page: 0 , type__in: 'dept, rparty'}).then((res) => {
|
||||
this.$API.system.dept.list.req({ page: 0 , type__in: 'dept'}).then((res) => {
|
||||
this.deptoptions = genTree(res);
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -245,14 +245,22 @@ export default {
|
|||
res = await this.$API.opm.operation.create.req(this.form);
|
||||
this.form.id = res.id;
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.opm.operation.update.req(
|
||||
|
||||
let form = {};
|
||||
form.vchannels = this.form.vchannels;
|
||||
form.dept_ter = this.form.dept_ter;
|
||||
form.dept_bus = this.form.dept_bus;
|
||||
debugger;
|
||||
console.log(form)
|
||||
res = await this.$API.opm.operation.patch.req(
|
||||
this.form.id,
|
||||
this.form
|
||||
form
|
||||
);
|
||||
}
|
||||
this.visible = false;
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
console.log(res)
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
} catch (err) {
|
||||
|
|
|
@ -77,17 +77,17 @@
|
|||
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看
|
||||
</el-button>
|
||||
<el-button v-if="operationObj.state === 10" link type="warning" size="small" v-auth="'opl.update'"
|
||||
<el-button v-if="scope.row.ticket == null" link type="warning" size="small" v-auth="'opl.update'"
|
||||
@click="table_edit(scope.row, scope.$index)">编辑
|
||||
</el-button>
|
||||
<el-button link type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
<el-drawer :size="'50%'" v-model="showLimited" :title="oplName + '作业许可证详情'">
|
||||
<sc-fire :id="oplId"></sc-fire>
|
||||
<el-drawer :size="'50%'" v-model="showLimited" class="scOplDrawer" :show-close="showClose" id="scOplDrawer">
|
||||
<sc-fire :id="oplId" :wfId="operationId"></sc-fire>
|
||||
</el-drawer>
|
||||
</el-main>
|
||||
</template>
|
||||
|
@ -103,6 +103,7 @@ export default {
|
|||
save: false,
|
||||
permission: false,
|
||||
},
|
||||
showClose:false,
|
||||
mainLoading: false,
|
||||
apiObj: [],
|
||||
query: {},
|
||||
|
@ -114,6 +115,7 @@ export default {
|
|||
operationObj: {},
|
||||
showLimited: false,
|
||||
oplId: "",
|
||||
operationId: "",
|
||||
state_: {
|
||||
10: "创建中",
|
||||
20: "审批中",
|
||||
|
@ -133,6 +135,7 @@ export default {
|
|||
},
|
||||
|
||||
mounted() {
|
||||
this.operationId = this.$route.query.id;
|
||||
this.getoplcate();
|
||||
this.getopllist();
|
||||
this.getOperation();
|
||||
|
@ -278,3 +281,11 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.scOplDrawer{
|
||||
width: 50%;
|
||||
}
|
||||
#scOplDrawer{
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
|
@ -64,19 +64,6 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业级别" prop="level">
|
||||
<el-select v-model="form.level" placeholder="选择作业级别">
|
||||
<el-option
|
||||
v-for="item in leveloptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24" >
|
||||
<el-form-item label="作业部门" prop="dept_do">
|
||||
<el-cascader
|
||||
|
@ -85,12 +72,12 @@
|
|||
v-model="form.dept_do"
|
||||
:options="deptoptions"
|
||||
:props="{
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
@ -174,15 +161,23 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
v-preventReClick
|
||||
:loading="issave"
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
<!--作业人员!-->
|
||||
<el-main class="nopadding" v-show="active === 1">
|
||||
<div class="left-panel" style="margin: 10px">
|
||||
|
@ -308,6 +303,7 @@
|
|||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
v-preventReClick
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -362,6 +358,7 @@
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员"],
|
||||
|
@ -384,12 +381,6 @@
|
|||
oplcateId: "",
|
||||
oplcateCode: "",
|
||||
oplId: "",
|
||||
leveloptions: [
|
||||
{ id: "特级", name: "特级:>30米" },
|
||||
{ id: "三级", name: "三级:15-30米" },
|
||||
{ id: "二级", name: "二级:>5-15米" },
|
||||
{ id: "一级", name: "一级:1.8-5米" },
|
||||
],
|
||||
deptoptions: [],
|
||||
useroptions: [],
|
||||
risklist: [],
|
||||
|
@ -481,6 +472,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -531,48 +527,62 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issave = true; //如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.active = 1;
|
||||
this.issave = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.issave = false;
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.active = 1;
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.issave = false;
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
} else {
|
||||
this.active = 1;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
this.issave = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -692,9 +702,9 @@
|
|||
//提交,创建工单
|
||||
submitTicketCreate(id) {
|
||||
if(this.apiworkerObj.length==0){
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
let ticket = {};
|
||||
ticket.workflow = this.initForm.workflow;
|
||||
ticket.ticket_data = {opl: this.oplId};
|
||||
|
@ -702,7 +712,6 @@
|
|||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -710,6 +719,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -85,12 +85,12 @@
|
|||
v-model="form.dept_do"
|
||||
:options="deptoptions"
|
||||
:props="{
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
checkStrictly: true
|
||||
}"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
@ -161,10 +161,10 @@
|
|||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-card header="应急处置">
|
||||
<div class="content">
|
||||
<p>1、管线被破坏时,应立即停止作业并报告相关部门,现场设置紧急隔离线,保护现场等待抢修。</p>
|
||||
<p>2、发生人员受伤时应立即组织救援,救援过程中应避免二次伤害,根据伤情送医或拨打120。</p>
|
||||
<p>1、管线被破坏时,应立即停止作业并报告相关部门,现场设置紧急隔离线,保护现场等待抢修。</p>
|
||||
<p>2、发生人员受伤时应立即组织救援,救援过程中应避免二次伤害,根据伤情送医或拨打120。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-form-item label="其他应急处置">
|
||||
<el-input
|
||||
|
@ -174,12 +174,21 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="issave"
|
||||
:loading="issave"
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -308,6 +317,7 @@
|
|||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
:disabled="tLoading"
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -353,15 +363,16 @@
|
|||
opl: "",
|
||||
};
|
||||
const defaultformgas = {
|
||||
id: "",
|
||||
check_time: null,
|
||||
opl:""
|
||||
};
|
||||
id: "",
|
||||
check_time: null,
|
||||
opl:""
|
||||
};
|
||||
export default {
|
||||
name: "fire",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员"],
|
||||
|
@ -385,9 +396,9 @@
|
|||
oplcateCode: "",
|
||||
oplId: "",
|
||||
leveloptions: [
|
||||
{ id: "主干道", name: "主干道" },
|
||||
{ id: "次干渠", name: "次干渠" }
|
||||
],
|
||||
{ id: "主干道", name: "主干道" },
|
||||
{ id: "次干渠", name: "次干渠" }
|
||||
],
|
||||
deptoptions: [],
|
||||
useroptions: [],
|
||||
risklist: [],
|
||||
|
@ -479,6 +490,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -529,46 +545,65 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
imagesChange(data){
|
||||
// debugger;
|
||||
// console.log(data)
|
||||
//合并新增的图片Ids
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
imagesDel(index){
|
||||
//合并新增的图片Ids
|
||||
this.form.create_imgs.splice(index,1)
|
||||
//console.log(this.form.create_imgs)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issave = true; //如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
// debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
// console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
|
||||
this.issave = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.issave = false
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.issave = false;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.issave = false;
|
||||
this.active = 1;
|
||||
}
|
||||
}
|
||||
|
@ -591,7 +626,7 @@
|
|||
getworkerList() {
|
||||
this.$API.opm.worker.list.req({opl: this.oplId, page: 0}).then((res) => {
|
||||
this.apiworkerObj = res;
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
});
|
||||
},
|
||||
//创建作业人员,显示Form
|
||||
|
@ -690,17 +725,16 @@
|
|||
//提交,创建工单
|
||||
submitTicketCreate(id) {
|
||||
if(this.apiworkerObj.length==0){
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
this.$message.warning("请添加作业人员");
|
||||
return
|
||||
}
|
||||
let ticket = {};
|
||||
ticket.workflow = this.initForm.workflow;
|
||||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -708,6 +742,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -179,12 +179,21 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="issave"
|
||||
:loading="issave"
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -484,6 +493,7 @@
|
|||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
:disabled="tLoading"
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -614,7 +624,8 @@
|
|||
measures_checked: [
|
||||
{required: true, message: '请选择'}
|
||||
],
|
||||
}
|
||||
},
|
||||
fileurl2: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -656,6 +667,11 @@
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplId = res.id;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
|
@ -706,13 +722,33 @@
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
imagesChange(data){
|
||||
debugger;
|
||||
console.log(this.form.create_imgs)
|
||||
console.log(data)
|
||||
//合并新增的图片Ids
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
|
||||
},
|
||||
imagesDel(index){
|
||||
//合并新增的图片Ids
|
||||
this.form.create_imgs.splice(index,1)
|
||||
//console.log(this.form.create_imgs)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
|
||||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
//如果是创建许可证书
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
this.issave = true; //如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
|
@ -724,28 +760,27 @@
|
|||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
|
||||
this.issave = false;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList();
|
||||
this.getgasList();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.issave = false;
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.issave = false;
|
||||
this.getgasList();
|
||||
this.getworkerList();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.issave = false;
|
||||
this.active = 1;
|
||||
}
|
||||
}
|
||||
|
@ -758,7 +793,6 @@
|
|||
}
|
||||
}
|
||||
this.active = 2;
|
||||
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
|
@ -880,9 +914,8 @@
|
|||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.tLoading = true;
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
@ -890,6 +923,7 @@
|
|||
|
||||
//退出界面
|
||||
submitOut() {
|
||||
this.tLoading = false;
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
|
|
|
@ -64,8 +64,6 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业部门" prop="dept_do">
|
||||
<el-cascader
|
||||
|
@ -84,21 +82,27 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业监护人" prop="monitor">
|
||||
<el-select v-model="form.monitor" placeholder="选择作业监护人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业负责人" prop="charger">
|
||||
<el-input
|
||||
v-model="form.charger_name"
|
||||
style="width:200px"
|
||||
disabled
|
||||
></el-input>
|
||||
<ehsUserSelect :multiple="false" @submit="getCharger"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业监护人" prop="monitor">
|
||||
<el-input
|
||||
v-model="form.monitor_name"
|
||||
style="width:200px"
|
||||
disabled
|
||||
></el-input>
|
||||
<ehsUserSelect :multiple="false" @submit="getMonitor"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="供电制式" >
|
||||
<el-select v-model="form.level" placeholder="选择供电制式">
|
||||
<el-option
|
||||
|
@ -115,12 +119,7 @@
|
|||
<el-input-number v-model="form.power_days" type="text" clearable></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--
|
||||
临时用电 !-->
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="工作类型">
|
||||
<el-select v-model="form.work_type" placeholder="选择工作类型">
|
||||
<el-option
|
||||
|
@ -130,7 +129,6 @@
|
|||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
|
@ -140,13 +138,10 @@
|
|||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="验收时间">
|
||||
|
||||
<el-date-picker
|
||||
v-model="form.accept_time"
|
||||
type="datetime"
|
||||
|
@ -164,7 +159,6 @@
|
|||
<el-input v-model="form.power_to" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="用电开始">
|
||||
<el-date-picker
|
||||
|
@ -172,7 +166,6 @@
|
|||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
|
@ -182,7 +175,6 @@
|
|||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
|
@ -190,7 +182,6 @@
|
|||
<el-input v-model="form.power_from" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="风险选择">
|
||||
<el-checkbox-group v-model="form.risks_checked">
|
||||
|
@ -212,14 +203,6 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!--
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="逃生路径">
|
||||
<el-input v-model="escape_route" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col> !-->
|
||||
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="措施选择">
|
||||
<el-checkbox-group v-model="form.measures_checked">
|
||||
|
@ -232,16 +215,13 @@
|
|||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div class="clearfix">
|
||||
<span>应急处置:</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>发生人员触电事故,应迅速切断电源或采用绝缘工器具使触电者脱离电源,判断触电者无意识或心跳、呼吸已停止时,应立即报告,并由经过专业训练或具备相应能力的人员对触电者进行心肺复苏术,直至专业医务人员赶到现场为止。
|
||||
其他应急处置
|
||||
</p>
|
||||
<p>发生人员触电事故,应迅速切断电源或采用绝缘工器具使触电者脱离电源,判断触电者无意识或心跳、呼吸已停止时,应立即报告,并由经过专业训练或具备相应能力的人员对触电者进行心肺复苏术,直至专业医务人员赶到现场为止。其他应急处置</p>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-form-item label="其他应急处置">
|
||||
|
@ -252,23 +232,22 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!--
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业审批照片">
|
||||
<el-input v-model="create_imgs" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
!-->
|
||||
<el-col :md="24" :sm="12" :xs="24" style="position: relative;">
|
||||
<span style="color:red;position: absolute;top: 8px;left: 18px;">*</span>
|
||||
<el-form-item label="作业前照片">
|
||||
<sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 20px; text-align:center">
|
||||
<el-button type="primary" plain @click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
<el-button
|
||||
v-preventReClick
|
||||
type="primary" plain
|
||||
@click="handleNextStep"
|
||||
>下一步</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
<!--作业人员!-->
|
||||
<el-main class="nopadding" v-show="active === 1">
|
||||
<div class="left-panel" style="margin: 10px">
|
||||
|
@ -338,19 +317,13 @@
|
|||
<el-row>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="作业人员">
|
||||
<el-select
|
||||
v-model="formworker.worker"
|
||||
@change="selectWorker"
|
||||
placeholder="选择作业人员"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-input
|
||||
v-model="formworker.worker_name"
|
||||
style="width:200px"
|
||||
disabled
|
||||
></el-input>
|
||||
<ehsUserSelect :multiple="false" @submit="getWorker"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="工作职责">
|
||||
|
@ -396,7 +369,7 @@
|
|||
<div style="margin-top:20px;text-align:center">
|
||||
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
|
||||
<el-button
|
||||
:loading="tLoading"
|
||||
v-preventReClick
|
||||
v-for=" item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
|
@ -405,12 +378,8 @@
|
|||
>{{item.name}}
|
||||
</el-button>
|
||||
<el-button @click="submitOut" type="warning">退出</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</el-main>
|
||||
|
||||
</el-container>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
@ -450,7 +419,7 @@ export default {
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
|
||||
fileurl2: "",
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员"],
|
||||
|
@ -539,8 +508,14 @@ export default {
|
|||
this.getDept();
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
getCharger(data) {
|
||||
this.form.charger=data.id;
|
||||
this.form.charger_name=data.name
|
||||
},
|
||||
getMonitor(data) {
|
||||
this.form.monitor=data.id;
|
||||
this.form.monitor_name=data.name;
|
||||
},
|
||||
getoplData() {
|
||||
if (this.oplId == "") {
|
||||
this.getOperation();
|
||||
|
@ -553,7 +528,11 @@ export default {
|
|||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
|
||||
let imgsLset =[];
|
||||
for(let i=0;i<res.create_imgs_.length;i++){
|
||||
imgsLset.push(res.create_imgs_[i].path)
|
||||
}
|
||||
this.fileurl2 =imgsLset.join(",");
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
this.getOperation();
|
||||
|
@ -584,7 +563,7 @@ export default {
|
|||
});
|
||||
},
|
||||
//作业
|
||||
|
||||
|
||||
//根据作业许可证ID获取,风险、措施
|
||||
getOplcates() {
|
||||
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
|
||||
|
@ -606,14 +585,28 @@ export default {
|
|||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data){
|
||||
if(this.form.create_imgs){
|
||||
this.form.create_imgs = this.form.create_imgs.concat(data);
|
||||
}else{
|
||||
this.form.create_imgs = data;
|
||||
}
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.form.create_imgs.splice(index,1)
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
if (this.active == 0) {
|
||||
// console.log(this.oplId);
|
||||
if(this.form.create_imgs.length>0){}else{
|
||||
this.$message.error('请上传作业前照片');
|
||||
return;
|
||||
}
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
|
@ -622,24 +615,18 @@ export default {
|
|||
.then((res) => {
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList(res.id);
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
|
||||
this.getworkerList(this.oplId);
|
||||
|
||||
});
|
||||
|
@ -649,7 +636,11 @@ export default {
|
|||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
|
||||
getWorker(data) {
|
||||
this.formworker.worker=data.id,
|
||||
this.formworker.worker_name=data.name
|
||||
this.selectWorker()
|
||||
},
|
||||
//选择人员后,调出该人员的所有证书
|
||||
selectWorker() {
|
||||
this.$API.hrm.certificate.list
|
||||
|
@ -719,9 +710,7 @@ export default {
|
|||
ticket.ticket_data = {opl: this.oplId};
|
||||
ticket.transition = id;
|
||||
ticket.title = this.form.name + '-申请';
|
||||
this.tLoading = true
|
||||
this.$API.wf.ticket.create.req(ticket).then((res) => {
|
||||
this.tLoading = false
|
||||
this.$message.success("提交成功");
|
||||
this.submitOut()
|
||||
}).catch(e=>{this.tLoading=false});
|
||||
|
|
|
@ -0,0 +1,168 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
v-auth="'blacklist.create'"
|
||||
></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称/信用号码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column
|
||||
label="企业名称"
|
||||
prop="name"
|
||||
width="240"
|
||||
:show-overflow-tooltip="true"
|
||||
></el-table-column>
|
||||
<el-table-column label="信用代码" prop="number" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="原因"
|
||||
:show-overflow-tooltip="true"
|
||||
prop="reason"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后操作人" width="200">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.update_by_"
|
||||
>{{ scope.row.update_by_.name }}-{{ scope.row.update_time }}</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right" align="left" width="200">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="table_show(scope.row, scope.$index)"
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
@click="table_edit(scope.row, scope.$index)"
|
||||
v-auth="'blacklist.update'"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="table_del(scope.row, scope.$index)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
size="small"
|
||||
v-auth="'blacklist.delete'"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./blacklist_form.vue";
|
||||
export default {
|
||||
name: "rparty",
|
||||
components: {
|
||||
saveDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
apiObj: this.$API.rpm.blacklist.list,
|
||||
query: {},
|
||||
selection: [],
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//添加
|
||||
add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
this.$API.rpm.blacklist.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,146 @@
|
|||
<template>
|
||||
<el-drawer
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:disabled="mode == 'show'"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item label="公司名称" prop="name">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
clearable
|
||||
:disabled="mode != 'add'"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item label="信用代码" prop="number">
|
||||
<el-input
|
||||
v-model="form.number"
|
||||
type="text"
|
||||
clearable
|
||||
:disabled="mode != 'add'"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="24" :xs="24">
|
||||
<el-form-item label="原因" prop="reason">
|
||||
<el-input
|
||||
v-model="form.reason"
|
||||
type="textarea"
|
||||
:rows="10"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "新增",
|
||||
edit: "编辑",
|
||||
show: "查看",
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入" }],
|
||||
number: [{ required: true, message: "请输入" }],
|
||||
reason: [{ required: true, message: "请输入" }],
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
belong_dept_options: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
var res;
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.rpm.blacklist.create.req(this.form);
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.rpm.blacklist.update.req(
|
||||
this.form.id,
|
||||
this.form
|
||||
);
|
||||
}
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
// this.loading = true
|
||||
// const params = {
|
||||
// id: data.id
|
||||
// }
|
||||
// setTimeout(async ()=>{
|
||||
// var res = await this.$API.system.table.info.get(params)
|
||||
// this.loading = false
|
||||
// this.form = res.data
|
||||
// },400)
|
||||
Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -100,7 +100,7 @@
|
|||
</el-main>
|
||||
</el-container>
|
||||
|
||||
<sc-dialog v-model="dialogcart" draggable title="创建人员证书">
|
||||
<sc-dialog v-model="dialogcart" draggable title="创建/编辑人员证书">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
|
@ -127,7 +127,6 @@
|
|||
v-model="form.name"
|
||||
placeholder="请输入证书名称"
|
||||
clearable
|
||||
:disabled="mode != 'add'"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -137,13 +136,12 @@
|
|||
v-model="form.number"
|
||||
placeholder="请输入证书编号"
|
||||
clearable
|
||||
:disabled="mode != 'add'"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="证书类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="选择证书类型" :disabled="mode != 'add'">
|
||||
<el-select v-model="form.type" placeholder="选择证书类型">
|
||||
<el-option
|
||||
v-for="item in typeoptions"
|
||||
:key="item.id"
|
||||
|
@ -189,6 +187,7 @@
|
|||
<sc-upload-file
|
||||
v-model="form.file"
|
||||
:multiple="false"
|
||||
:limit="1"
|
||||
accept="image/png, image/jpeg, image/jpeg, pdf"
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-upload">上传</el-button>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item label="公司名称">
|
||||
<el-form-item label="公司名称" prop="name">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
|
@ -27,7 +27,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item label="信用代码">
|
||||
<el-form-item label="信用代码" prop="number">
|
||||
<el-input
|
||||
v-model="form.number"
|
||||
type="text"
|
||||
|
@ -41,7 +41,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item label="联系人">
|
||||
<el-form-item label="联系人" prop="contacter">
|
||||
<el-input
|
||||
v-model="form.contacter"
|
||||
type="text"
|
||||
|
@ -50,7 +50,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item label="联系电话">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -118,7 +118,12 @@ export default {
|
|||
show: "查看",
|
||||
},
|
||||
form: {},
|
||||
rules: {},
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入" }],
|
||||
number: [{ required: true, message: "请输入" }],
|
||||
contacter: [{ required: true, message: "请输入" }],
|
||||
phone: [{ required: true, message: "请输入" }],
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
selectionFilters: [],
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit"
|
||||
<el-button type="primary" :loading="isSaveing" :disabled="isSaveing" @click="submit"
|
||||
>保存
|
||||
</el-button
|
||||
>
|
||||
|
@ -191,9 +191,9 @@
|
|||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.rpm.rpj.update.req(this.form.id, this.form);
|
||||
}
|
||||
this.visible = false;
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
} catch (err) {
|
||||
|
|
|
@ -9,11 +9,15 @@
|
|||
<el-descriptions-item label="项目类型:">{{ types_[form.type] }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同编号:">{{ form.contract_number }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态:">{{ state_[form.state] }}</el-descriptions-item>
|
||||
<el-descriptions-item label="进厂时间:">{{ form.come_time }}</el-descriptions-item>
|
||||
<el-descriptions-item label="入厂时间:">{{ form.come_time }}</el-descriptions-item>
|
||||
<el-descriptions-item label="离厂时间:">{{ form.leave_time }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属部门:">{{ form.belong_dept_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="相关方:">{{ form.rparty_name }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-button type="primary" size="small"
|
||||
v-if="form.state==30||form.state==40"
|
||||
@click="addWorker('add')">添加成员
|
||||
</el-button>
|
||||
</el-card>
|
||||
<el-card style="margin-top:8px" shadow="hover">
|
||||
<scTable ref="fileTable" :data="rpjFileList" row-key="id" hidePagination stripe hideDo
|
||||
|
@ -37,41 +41,158 @@
|
|||
<el-card style="margin-top:8px" shadow="hover">
|
||||
<scTable ref="table" :data="memeberList" row-key="id" height='auto' stripe hideDo hidePagination>
|
||||
<el-table-column label="#" fixed="left" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="姓名" prop="remployee_.name">
|
||||
<el-table-column label="姓名" prop="remployee_.name" width="80">
|
||||
<template #default="scope">
|
||||
{{ scope.row.remployee_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作职责" prop="duty"></el-table-column>
|
||||
<el-table-column label="工作职责" prop="duty" width="100"></el-table-column>
|
||||
<el-table-column label="证书" prop="rcertificates">
|
||||
<template #default="scope">
|
||||
<el-tag v-for="item in scope.row.rcertificates_" :key="item.number" :label="item.name"
|
||||
:value="item.number">{{ item.name }}
|
||||
</el-tag>
|
||||
<span v-for="cer in scope.row.rcertificates_" :key="cer.id">{{cer.name}}-{{cer.number}}/</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否负责人" prop="is_manager">
|
||||
<el-table-column label="负责人" prop="is_manager" width="80">
|
||||
<template #default="scope">
|
||||
<el-space v-if="scope.row.is_manager === true">是</el-space>
|
||||
<el-space v-else>否</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="60">
|
||||
<el-table-column label="备注" prop="note" width="100"></el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link v-if="scope.row.blt_ == null" type="primary" size="small"
|
||||
<el-button link type="primary" size="small"
|
||||
v-if="form.state!==50&&form.state!==60"
|
||||
@click="addWorker('edit',scope.row)" v-auth="'blt_bind.create'">编辑
|
||||
</el-button>
|
||||
<el-button link v-if="scope.row.blt_ == null&&(form.state==30||form.state==40)" type="primary" size="small"
|
||||
@click="bindCard(scope.row, 10)" v-auth="'blt_bind.create'">绑卡
|
||||
</el-button>
|
||||
<el-button link type="warning" size="small"
|
||||
v-if="form.state==30||form.state==40"
|
||||
@click="leaveDialog(scope.row)">提前离厂
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
<el-card style="margin-top:8px" shadow="hover">
|
||||
<scTable ref="table" :data="logLists" row-key="id" style="height:300px" stripe hideDo hidePagination>
|
||||
<el-table-column label="#" fixed="left" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="变动人" prop="remployee_">
|
||||
<template #default="scope">
|
||||
{{ scope.row.remployee_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动类型" prop="operation">
|
||||
<template #default="scope">
|
||||
<el-space v-if="scope.row.operation === 'member_leave'">提前离厂</el-space>
|
||||
<el-space v-else>新入厂</el-space>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动时间" prop="create_time"></el-table-column>
|
||||
<el-table-column label="处理人" prop="create_by_">
|
||||
<template #default="scope">
|
||||
{{ scope.row.create_by_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
</el-main>
|
||||
<ScBind v-model="showBindBlt" :bindBtl="bindBtl" :bindType="bindType" :bindName="bindName"
|
||||
:bindEmployee="bindEmployee" @success="showBindBltSuccess" @closed="showBindBltClose"></ScBind>
|
||||
:bindEmployee="bindEmployee" @success="showBindBltSuccess" @closed="showBindBltClose"
|
||||
></ScBind>
|
||||
<el-dialog title="提前离厂" v-model="leaveVisible" width="30%" >
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="离厂原因">
|
||||
<el-input v-model="reason" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="leaveVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="preLeave" :loading="btnloading" :disabled="btnloading">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 人员添加编辑 -->
|
||||
<el-dialog v-model="workerVisible" :title="workDialogTitle">
|
||||
<el-form ref="workerForm" :model="formworker" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="项目成员">
|
||||
<el-select
|
||||
v-if="workDialogType=='add'"
|
||||
v-model="formworker.remployee"
|
||||
@change="selectWorker"
|
||||
filterable
|
||||
placeholder="选择项目成员"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in remployeeoptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-else v-model="formworker.remployee_name" type="text" disabled style="width:200px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="是否项目负责人">
|
||||
<el-radio-group v-model="formworker.is_manager" :disabled="workDialogType=='edit'">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="工作职责">
|
||||
<el-input
|
||||
:disabled="workDialogType=='edit'"
|
||||
v-model="formworker.duty"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="证书">
|
||||
<el-select
|
||||
v-model="formworker.rcertificates"
|
||||
multiple
|
||||
placeholder="选择证书"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in certificatesOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="原因">
|
||||
<el-input
|
||||
:disabled="workDialogType=='edit'"
|
||||
v-model="formworker.reason"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="workerdialog = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitWorker" :loading="btnloading" :disabled="btnloading">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ScBind from "@/components/scBind/index.vue";
|
||||
export default {
|
||||
|
@ -87,10 +208,13 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
leaveVisible:false,
|
||||
workerVisible:false,
|
||||
loading: false,
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
showBindBlt: false,
|
||||
btnloading:false,
|
||||
state_: {
|
||||
10: "创建中",
|
||||
20: "审批中",
|
||||
|
@ -104,13 +228,25 @@ export default {
|
|||
30: "保安保洁服务",
|
||||
40: "其他",
|
||||
},
|
||||
formworker : {
|
||||
duty: "",
|
||||
rcertificates: [],
|
||||
rpj: "",
|
||||
},
|
||||
form: {},
|
||||
bindName: "",
|
||||
bindType: 10,
|
||||
bindBtl: null,
|
||||
bindEmployee: '',
|
||||
logLists:[],
|
||||
rpjFileList: [],
|
||||
memeberList: [],
|
||||
remployeeoptions:[],
|
||||
reason:"",
|
||||
leaveId:"",
|
||||
workDialogType:"add",
|
||||
workDialogTitle:"添加项目成员"
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -156,6 +292,7 @@ export default {
|
|||
this.form = res;
|
||||
this.getRpjfileList();
|
||||
this.getMemberList();
|
||||
this.getLogs();
|
||||
this.visible = true;
|
||||
}).catch(e => { this.loading = false });
|
||||
},
|
||||
|
@ -165,13 +302,111 @@ export default {
|
|||
this.rpjFileList = res;
|
||||
});
|
||||
},
|
||||
//作业人员列表
|
||||
//作业成员列表
|
||||
getMemberList() {
|
||||
this.$API.rpm.member.list.req({ rpj: this.form.id, page: 0 }).then((res) => {
|
||||
this.memeberList = res;
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
});
|
||||
},
|
||||
//成员变动操作日志
|
||||
getLogs(){
|
||||
this.$API.rpm.rpj.logs.req({ rpj: this.form.id, page: 0 }).then((res) => {
|
||||
debugger;
|
||||
this.logLists = res;
|
||||
});
|
||||
},
|
||||
//调出项目成员列表
|
||||
getremployee() {
|
||||
this.$API.rpm.remployee.list.req({ page: 0, rparty: this.form.rparty }).then((res) => {
|
||||
this.remployeeoptions = res;
|
||||
});
|
||||
},
|
||||
//选择成员后,调出该成员的所有证书
|
||||
selectWorker() {
|
||||
this.$API.rpm.rcertificate.list
|
||||
.req({ remployee: this.formworker.remployee, page: 0 })
|
||||
.then((res) => {
|
||||
this.certificatesOptions = res;
|
||||
});
|
||||
},
|
||||
addWorker(type,row){
|
||||
let that = this;
|
||||
that.workDialogType = type;
|
||||
if(type=='add'){
|
||||
that.workDialogTitle = "添加项目成员";
|
||||
that.getremployee();
|
||||
}else{
|
||||
that.workDialogTitle = "项目成员编辑";
|
||||
that.formworker = row;
|
||||
that.formworker.remployee_name = row.remployee_.name;
|
||||
debugger;
|
||||
console.log(that.formworker)
|
||||
that.selectWorker();
|
||||
}
|
||||
that.workerVisible = true;
|
||||
},
|
||||
//提交作业成员信息
|
||||
submitWorker() {
|
||||
let that = this;
|
||||
that.btnloading = true;
|
||||
that.formworker.rpj = that.form.id;
|
||||
if(that.workDialogType=="add"){
|
||||
that.$refs.workerForm.validate(async (valid) => {
|
||||
that.$API.rpm.member.create
|
||||
.req(that.formworker)
|
||||
.then((res) => {
|
||||
that.$message.success("项目成员添加成功");
|
||||
that.workerVisible = false;
|
||||
that.btnloading = false;
|
||||
that.getMemberList();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.btnloading = false;
|
||||
return err;
|
||||
});
|
||||
});
|
||||
}else{
|
||||
let formworker = {};
|
||||
formworker.is_manager = that.formworker.is_manager;
|
||||
formworker.rcertificates = that.formworker.rcertificates;
|
||||
that.$API.rpm.member.update
|
||||
.req(that.formworker.id,formworker)
|
||||
.then((res) => {
|
||||
that.$message.success("项目成员证书添加成功");
|
||||
that.workerVisible = false;
|
||||
that.btnloading = false;
|
||||
that.getMemberList();
|
||||
})
|
||||
.catch((err) => {
|
||||
that.btnloading = false;
|
||||
return err;
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
leaveDialog(row){
|
||||
// debugger;
|
||||
this.leaveVisible = true;
|
||||
this.leaveId=row.id;
|
||||
console.log(this.leaveId)
|
||||
},
|
||||
preLeave(){
|
||||
// debugger;
|
||||
this.btnloading = true;
|
||||
if(this.reason!=''){
|
||||
this.$API.rpm.member.leave.req(this.leaveId,{reason:this.reason}).then(res=>{
|
||||
this.leaveVisible = false;
|
||||
this.btnloading = false;
|
||||
}).catch(e=>{
|
||||
this.btnloading = false;
|
||||
})
|
||||
}else{
|
||||
this.btnloading = false;
|
||||
this.$message.error("请填写离厂原因");
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -58,7 +58,8 @@
|
|||
<el-date-picker
|
||||
v-model="rpjform.come_time"
|
||||
type="datetime"
|
||||
placeholder="选择结束时间"
|
||||
placeholder="选择进厂时间"
|
||||
:default-time="defaultTime_start"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -67,7 +68,8 @@
|
|||
<el-date-picker
|
||||
v-model="rpjform.leave_time"
|
||||
type="datetime"
|
||||
placeholder="选择结束时间"
|
||||
placeholder="选择离厂时间"
|
||||
:default-time="defaultTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -110,6 +112,7 @@
|
|||
<el-button
|
||||
style="margin-top: 20px"
|
||||
type="primary"
|
||||
:loading="isSaveing" :disabled="isSaveing"
|
||||
@click="handleNextStep"
|
||||
>下一步
|
||||
</el-button>
|
||||
|
@ -343,6 +346,8 @@
|
|||
v-for="item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
:loading="isSaveing"
|
||||
:disabled="isSaveing"
|
||||
@click="submitTicketCreate(item.id)"
|
||||
style="margin-right: 4px"
|
||||
>{{ item.name }}</el-button
|
||||
|
@ -391,7 +396,7 @@ export default {
|
|||
stepTitle: ["基本信息", "安全审核项目", "选择人员"],
|
||||
query: {},
|
||||
selection: [],
|
||||
issave: false, //控制基本信息提交
|
||||
isSaveing: false, //控制基本信息提交
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
|
@ -426,10 +431,13 @@ export default {
|
|||
come_time: [{ required: true, message: "请选择" }],
|
||||
leave_time: [{ required: true, message: "请选择" }],
|
||||
},
|
||||
defaultTime_start:new Date(2000, 1, 1, 10, 0, 0),
|
||||
defaultTime:new Date(2000, 1, 1, 18, 0, 0),
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.rpjId = this.$route.query.rpjid; //作业ID
|
||||
this.isSaveing = false;
|
||||
this.rpartyShow();
|
||||
if (this.rpjId) {
|
||||
this.getRpj();
|
||||
|
@ -491,6 +499,7 @@ export default {
|
|||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
if (this.rpjId) {
|
||||
this.$API.rpm.rpj.update
|
||||
.req(this.rpjId, this.rpjform)
|
||||
|
@ -500,16 +509,22 @@ export default {
|
|||
this.getmemberList();
|
||||
this.getremployee();
|
||||
this.active = 1;
|
||||
this.isSaveing = false;
|
||||
}).catch(res=>{
|
||||
this.isSaveing = false;
|
||||
});
|
||||
} else {
|
||||
this.$API.rpm.rpj.create.req(this.rpjform).then((res) => {
|
||||
this.$message.success("项目创建成功!");
|
||||
this.rpjId = res.id;
|
||||
this.rpjform.rparty = res.rparty;
|
||||
this.rpjform.rparty = res.rparty;
|
||||
this.getRpjfileList();
|
||||
this.getmemberList();
|
||||
this.getremployee();
|
||||
this.active = 1;
|
||||
this.isSaveing = false;
|
||||
}).catch(res=>{
|
||||
this.isSaveing = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -636,6 +651,7 @@ export default {
|
|||
//提交,创建工单
|
||||
submitTicketCreate(id) {
|
||||
let ticket = {};
|
||||
this.isSaveing = true;
|
||||
ticket.title = this.rpjform.name;
|
||||
ticket.workflow = this.initForm.workflow;
|
||||
ticket.ticket_data = { rpj: this.rpjId ,name:this.rpjform.name};
|
||||
|
@ -646,6 +662,8 @@ export default {
|
|||
name: "rpj",
|
||||
query: {},
|
||||
});
|
||||
}).catch(()=>{
|
||||
this.isSaveing = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -35,19 +35,30 @@
|
|||
@click="add"
|
||||
></el-button>
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="账号类型"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userTypeOptions2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
v-model="query.type"
|
||||
placeholder="账号类型"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userTypeOptions2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="query.is_deleted"
|
||||
placeholder="筛选"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option label="在用" :value="deletedIs"></el-option>
|
||||
<el-option label="已删" :value="isDeleted"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
|
@ -83,8 +94,8 @@
|
|||
<el-table-column label="登录账号" prop="username" width="140"></el-table-column>
|
||||
<el-table-column label="是否启用" prop="is_active">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.is_active">启用</el-tag>
|
||||
<el-tag v-else type="danger">禁用</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.is_deleted">已删</el-tag>
|
||||
<el-tag v-else type="success">在用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="微信通知" width="80">
|
||||
|
@ -129,6 +140,7 @@
|
|||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
v-if="!query.is_deleted"
|
||||
@click="formSetting(scope.row)"
|
||||
v-auth="'user.update'"
|
||||
>
|
||||
|
@ -138,12 +150,22 @@
|
|||
<el-button
|
||||
link
|
||||
size="small"
|
||||
type="warning"
|
||||
@click="formEdit(scope.row, '2')"
|
||||
v-auth="'user.update'"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
type="danger"
|
||||
v-if="!query.is_deleted"
|
||||
@click="formReset(scope.row)"
|
||||
v-auth="'user.update'"
|
||||
>
|
||||
重置密码
|
||||
</el-button>
|
||||
<!-- <el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="table_del(scope.row, scope.$index)"
|
||||
|
@ -204,8 +226,8 @@
|
|||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否在用">
|
||||
<el-switch v-model="addForm.is_active" />
|
||||
<el-form-item label="是否删除">
|
||||
<el-switch active-color="#f56c6c" v-model="addForm.is_deleted" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
@ -245,7 +267,9 @@ export default {
|
|||
save: false,
|
||||
// certSave:false,
|
||||
},
|
||||
query: {},
|
||||
isDeleted: true,
|
||||
deletedIs: false,
|
||||
query: {is_deleted:''},
|
||||
baseUrl: baseUrl.API_URL,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
|
@ -257,7 +281,6 @@ export default {
|
|||
addForm: {
|
||||
username: "",
|
||||
name: "",
|
||||
// email: "",
|
||||
phone: null,
|
||||
// belong_dept: [],
|
||||
is_active: true,
|
||||
|
@ -292,7 +315,7 @@ export default {
|
|||
apiObj: this.$API.system.user.list,
|
||||
temp: [],
|
||||
postList: [],
|
||||
userTypeOptions :{
|
||||
userTypeOptions :{
|
||||
'employee': '正式员工',
|
||||
'remployee': '相关方',
|
||||
'visitor': '访客',
|
||||
|
@ -337,6 +360,14 @@ export default {
|
|||
this.limitedVisible = true;
|
||||
this.addForm = {};
|
||||
},
|
||||
//重置密码
|
||||
formReset(row){
|
||||
this.$API.system.user.rPassword.req(row.id).then(res=>{
|
||||
this.$message.success("重置成功");
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
formEdit(row, index) {
|
||||
console.log(row);
|
||||
|
@ -398,7 +429,7 @@ export default {
|
|||
groupClick(data) {
|
||||
console.log(data);
|
||||
// debugger;
|
||||
this.$refs.table.queryData({ belong_dept: data.id });
|
||||
this.$refs.table.queryData({ depts: data.id });
|
||||
},
|
||||
//搜索
|
||||
handleQuery() {
|
||||
|
@ -411,6 +442,7 @@ export default {
|
|||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
let res;
|
||||
|
||||
if (this.type === "add") {
|
||||
res = await this.$API.system.user.create.req(this.addForm);
|
||||
} else if (this.type === "edit") {
|
||||
|
|
|
@ -60,6 +60,7 @@ export default {
|
|||
account: defineAsyncComponent(() => import("./user/account")),
|
||||
seting: defineAsyncComponent(() => import("./user/seting")),
|
||||
pushSettings: defineAsyncComponent(() => import("./user/pushSettings")),
|
||||
clockRecord: defineAsyncComponent(() => import("./user/clock_record")),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -82,6 +83,11 @@ export default {
|
|||
title: "修改密码",
|
||||
component: "pushSettings",
|
||||
},
|
||||
{
|
||||
icon: "el-icon-platform",
|
||||
title: "打卡记录",
|
||||
component: "clockRecord",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -0,0 +1,455 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
v-model="monthV"
|
||||
type="month"
|
||||
style="margin-left:4px"
|
||||
placeholder="选择月份"
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading = 'cLoading'
|
||||
icon="el-icon-download"
|
||||
@click="exportExcel"
|
||||
>下载记录</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading = 'dLoading'
|
||||
icon="el-icon-download"
|
||||
@click="exportList"
|
||||
>下载统计</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDaata"
|
||||
row-key="id"
|
||||
stripe
|
||||
>
|
||||
<el-table-column label="人员类型" prop="employee">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.employee">{{epOptions[scope.row.employee_.type]}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="人员" prop="employee">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.employee">{{scope.row.employee_.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属部门" prop="employee">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.employee">{{scope.row.employee_.belong_dept_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="触发形式" prop="type">
|
||||
<template #default="scope">
|
||||
{{trigger_[scope.row.trigger]}}--
|
||||
<span v-if="scope.row.detail">{{scope.row.detail.deviceName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考勤推测">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.type==10 || scope.row.type==20">
|
||||
<el-tag :type="type_[scope.row.type].color">{{type_[scope.row.type].label}}</el-tag>
|
||||
</span>
|
||||
<span v-if="(scope.row.type==10 || scope.row.type==20)&&scope.row.exception_type!==null">-</span>
|
||||
<span v-if="scope.row.exception_type==10" class="nomalState type1">在岗时间短</span>
|
||||
<span v-if="scope.row.exception_type==20" class="nomalState type2">在岗时间长</span>
|
||||
<span v-if="scope.row.exception_type==30" class="nomalState type3">缺卡</span>
|
||||
<span v-if="scope.row.exception_type==40" class="nomalState type4">加班</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡时间" prop="create_time"></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
background
|
||||
:small="true"
|
||||
:total="dataTotal"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:page-size="query.page_size"
|
||||
:page-sizes="[20, 50, 100, 200]" v-model:currentPage="query.page"
|
||||
@current-change="getList" @update:page-size="getList"></el-pagination>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import config from "@/config"
|
||||
import * as XLSX2 from "xlsx";
|
||||
import * as XLSX from "xlsx-style";
|
||||
export default {
|
||||
name: "clock_record",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
userForm:{},
|
||||
tableData:[],
|
||||
monthV: null,
|
||||
query: {
|
||||
page:1,
|
||||
page_size:20,
|
||||
year:'',
|
||||
month:'',
|
||||
employee:''
|
||||
},
|
||||
dataTotal:0,
|
||||
selection: [],
|
||||
type_:{
|
||||
10: {"label": "上班打卡", "color": ""},
|
||||
20: {"label": "下班打卡", "color": "success"},
|
||||
},
|
||||
epOptions:{
|
||||
"employee": "正式员工",
|
||||
"remployee": "相关方"
|
||||
},
|
||||
trigger_:{
|
||||
"door": "门禁",
|
||||
"location": "定位"
|
||||
},
|
||||
tableDaata:[],
|
||||
excelName:'',
|
||||
weekList : ['姓名','星期'],
|
||||
daysList:['姓名','日期'],
|
||||
dLoading: false,
|
||||
cLoading:false,
|
||||
ElLoading:null,
|
||||
deptSearch:{},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getemployee();
|
||||
this.ElLoading =null;
|
||||
},
|
||||
methods: {
|
||||
handleQuery(){
|
||||
if(this.monthV){
|
||||
this.query.year = this.monthV.getFullYear();
|
||||
this.query.month = this.monthV.getMonth() + 1;
|
||||
}else{
|
||||
this.query.year = null;
|
||||
this.query.month = null;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
getemployee() {
|
||||
let that = this;
|
||||
that.$API.hrm.employee.read.req().then((res) => {
|
||||
that.userForm = res;
|
||||
that.query.employee = res.id;
|
||||
that.getList();
|
||||
});
|
||||
},
|
||||
getList(){
|
||||
let that = this;
|
||||
that.$API.hrm.clock_record.list.req(that.query)
|
||||
.then(res=>{
|
||||
that.tableDaata = res.results;
|
||||
that.dataTotal = res.count;
|
||||
})
|
||||
},
|
||||
exportExcel(){
|
||||
let that = this;
|
||||
if(that.query.year!=undefined &&that.query.year!=null && that.query.month!=undefined&& that.query.month!=null){
|
||||
}else{
|
||||
that.$message.warning("请选择月份后导出")
|
||||
that.cLoading = false;
|
||||
return;
|
||||
}
|
||||
if(that.monthV){
|
||||
that.query.year = that.monthV.getFullYear();
|
||||
that.query.month = that.monthV.getMonth() + 1;
|
||||
}else{
|
||||
that.query.year = null;
|
||||
that.query.month = null;
|
||||
}
|
||||
that.cLoading = true;
|
||||
that.ElLoading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据请求中,请稍后...',
|
||||
background: 'rgba(0, 0, 0, 0)',
|
||||
})
|
||||
that.$API.hrm.clock_record.export_excel.req(that.query)
|
||||
.then(res=>{
|
||||
that.cLoading = false;
|
||||
that.ElLoading.close();
|
||||
let urls = config.API_URL.slice(0,-4)+res.path;
|
||||
console.log(urls)
|
||||
|
||||
window.open(urls, "_blank");
|
||||
}).catch(e=>{
|
||||
that.cLoading = false;
|
||||
that.ElLoading.close();
|
||||
})
|
||||
},
|
||||
//循环调用的接口
|
||||
getOneData(id){
|
||||
let that = this;
|
||||
return new Promise((resolve,reject)=>{
|
||||
that.$API.hrm.clock_record.list.req({page:1,page_size:499,type__in:'10,20',year:that.query.year,month:that.query.month,employee:id})
|
||||
.then(res=>{
|
||||
resolve(res.results)
|
||||
})
|
||||
})
|
||||
},
|
||||
exportList(){
|
||||
let that = this;
|
||||
that.dLoading = true;
|
||||
if(that.query.year!=undefined &&that.query.year!=null && that.query.month!=undefined&& that.query.month!=null){
|
||||
}else{
|
||||
that.$message.warning("请选择月份后导出")
|
||||
that.dLoading = false;
|
||||
return;
|
||||
}
|
||||
let days = new Date(that.query.year, that.query.month , 0).getDate();
|
||||
let weekList = ['姓名','星期'],daysList=['姓名','日期'],titleData = [];
|
||||
for(var i = 1;i<= days;i++){
|
||||
let weekNum = new Date(that.query.year+'-'+that.query.month+'-'+i).getDay();
|
||||
let week=that.getDayWeek(weekNum)
|
||||
daysList.push(i);
|
||||
weekList.push(week);
|
||||
}
|
||||
let chartName = that.userForm.name+that.query.year+'年'+that.query.month+'月考勤统计表';
|
||||
titleData.push(chartName)
|
||||
let tableData = [];
|
||||
tableData.push(titleData)
|
||||
tableData.push(weekList)
|
||||
tableData.push(daysList)
|
||||
that.ElLoading = that.$loading({
|
||||
lock: true,
|
||||
text: '数据请求中,请稍后...',
|
||||
background: 'rgba(0, 0, 0, 0)',
|
||||
})
|
||||
let rowData1 = [],rowData2=[];
|
||||
rowData1 = [
|
||||
that.userForm.name,
|
||||
'上班打卡',
|
||||
]
|
||||
rowData2 = [
|
||||
that.userForm.name,
|
||||
'下班打卡',
|
||||
]
|
||||
let query = that.query;
|
||||
query.page_size = 499;
|
||||
query.type__in = '10,20';
|
||||
that.$API.hrm.clock_record.list.req(query)
|
||||
.then(res=>{
|
||||
let recordList = res.results;
|
||||
for(let i=0;i<recordList.length;i++){
|
||||
let dateInd = new Date(recordList[i].create_time).getDate();
|
||||
let dateIndex = parseInt(dateInd);
|
||||
if(recordList[i].type==10){
|
||||
rowData1[dateIndex+1] = recordList[i].create_time.substring(11,16)+'&'+recordList[i].exception_type;
|
||||
}else{
|
||||
rowData2[dateIndex+1] = recordList[i].create_time.substring(11,16)+'&'+recordList[i].exception_type;
|
||||
}
|
||||
}
|
||||
tableData.push(rowData1);
|
||||
tableData.push(rowData2);
|
||||
let ws = XLSX2.utils.aoa_to_sheet(tableData);
|
||||
let wb = XLSX2.utils.book_new();
|
||||
ws['!freeze'] = {
|
||||
xSplit: "1", //冻结列
|
||||
ySplit: "1", //冻结行
|
||||
topLeftCell: "B2", //在未冻结区域的左上角显示的单元格,默认为第一个未冻结的单元格
|
||||
state: "frozen"
|
||||
}
|
||||
for(let key in ws){
|
||||
if(key.indexOf('!')!==0){
|
||||
if(key==='A1'){
|
||||
ws[key].s = {
|
||||
font: {
|
||||
sz: "12",
|
||||
bold: true
|
||||
},
|
||||
alignment: {
|
||||
horizontal: "center", vertical: "center"
|
||||
},
|
||||
fill: {
|
||||
bgColor: { rgb: "FFFFAA00" },
|
||||
fgColor: { rgb: "FFFFAA00" }
|
||||
}
|
||||
};
|
||||
}else{
|
||||
let cal = ws[key]['v']+'';
|
||||
let type = null;
|
||||
if(cal.indexOf('&')>-1){
|
||||
ws[key]['v'] = cal.split('&')[0]
|
||||
type = cal.split('&')[1];
|
||||
}
|
||||
if(type!==null&&type!=='null'){
|
||||
console.log('type:'+type)
|
||||
if(type==='10'){//在岗时间短-----黄色
|
||||
ws[key].s = {
|
||||
font: {sz: 10},
|
||||
alignment: { horizontal: 'center', vertical: 'center' },
|
||||
fill: {
|
||||
bgColor: { rgb: "F8DD4E" },
|
||||
fgColor: { rgb: "F8DD4E" },
|
||||
}
|
||||
};
|
||||
}else if(type==='20'){//在岗时间长----红色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center'},
|
||||
fill: {
|
||||
bgColor: { rgb: "FF0000" },
|
||||
fgColor: { rgb: "FF0000" }
|
||||
}
|
||||
};
|
||||
}else if(type==='30'){//缺卡-----橙色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center'},
|
||||
fill: {
|
||||
bgColor: { rgb: "FA8435" },
|
||||
fgColor: { rgb: "FA8435" }
|
||||
}
|
||||
};
|
||||
}else if(type==='40'){//加班---蓝色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center' },
|
||||
fill: {
|
||||
bgColor: { rgb: "44CEF6" },
|
||||
fgColor: { rgb: "44CEF6" }
|
||||
}
|
||||
};
|
||||
}
|
||||
}else{//正常--无色
|
||||
ws[key]['s'] = {
|
||||
font: {
|
||||
sz: 10,
|
||||
},
|
||||
alignment: { horizontal: 'center', vertical: 'center'},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(ws)
|
||||
// s 意为 start ,即开始的单元格//r 是 row ,表示行号,从 0 计起//c 是 col ,表示列号,从 0 计起
|
||||
let cNumber = daysList.length-1;
|
||||
let merge = [{ s: { r: 0, c: 0 }, e: { r: 0, c:cNumber } }];//{ s: { r: 0, c: 0 }, e: { r: 1, c: 0 } },
|
||||
for(let i = 1;i<tableData.length;i++){
|
||||
merge.push({ s: { r: i, c: 0 }, e: { r: i+1, c: 0 } })
|
||||
i++
|
||||
}
|
||||
ws['!merges'] = merge;
|
||||
|
||||
let closList = new Array(31).fill({wch: 5});
|
||||
closList.unshift({wch:8})
|
||||
closList.unshift({wch:10})
|
||||
ws['!cols'] = closList;
|
||||
let rows = new Array(500).fill({hpx: 15});
|
||||
rows.unshift({hpx:20})
|
||||
ws['!rows'] = rows; // 添加到sheet中
|
||||
|
||||
XLSX2.utils.book_append_sheet(wb, ws, chartName); // 工作簿名称
|
||||
// XLSX2.writeFile(wb, chartName+'.xlsx'); // 保存的文件名
|
||||
var wopts = {
|
||||
bookType: 'xlsx', // 要生成的文件类型
|
||||
bookSST: false, // 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
|
||||
type: 'binary'
|
||||
};
|
||||
var wbout = XLSX.write(wb, wopts);
|
||||
var blob = new Blob([this.s2ab(wbout)], {
|
||||
type: "application/octet-stream"
|
||||
}); // 字符串转ArrayBuffer
|
||||
// 导出excel文件 如导出后的文件不能打开,请将后缀替换为 .xls
|
||||
this.openDownloadDialog(blob, chartName+`.xlsx`);
|
||||
that.dLoading = false;
|
||||
that.ElLoading.close();
|
||||
}).catch(e=>{
|
||||
that.dLoading = false;
|
||||
that.ElLoading.close();
|
||||
})
|
||||
},
|
||||
s2ab(s) {
|
||||
var buf = new ArrayBuffer(s.length);
|
||||
var view = new Uint8Array(buf);
|
||||
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
|
||||
return buf;
|
||||
},
|
||||
openDownloadDialog(url, saveName) {
|
||||
if (typeof url == 'object' && url instanceof Blob) {
|
||||
url = URL.createObjectURL(url); // 创建blob地址
|
||||
}
|
||||
var aLink = document.createElement('a');
|
||||
aLink.href = url;
|
||||
aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效
|
||||
var event;
|
||||
if (window.MouseEvent) event = new MouseEvent('click');
|
||||
else {
|
||||
event = document.createEvent('MouseEvents');
|
||||
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
}
|
||||
aLink.dispatchEvent(event);
|
||||
},
|
||||
getDayWeek(day){
|
||||
switch(day){
|
||||
case 0:
|
||||
return '日';
|
||||
case 1:
|
||||
return '一';
|
||||
case 2:
|
||||
return '二';
|
||||
case 3:
|
||||
return '三';
|
||||
case 4:
|
||||
return '四';
|
||||
case 5:
|
||||
return '五';
|
||||
case 6:
|
||||
return '六';
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.nomalState {
|
||||
font-size: 12px;
|
||||
padding: 0 9px;
|
||||
|
||||
height: 24px;
|
||||
line-height: 23px;
|
||||
border-radius: 5px;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
.nomalState.type1{
|
||||
color: #F8DD4E;
|
||||
background-color: #f9f7e6;
|
||||
border: 1px solid #f3f0d5;
|
||||
}
|
||||
.nomalState.type2{
|
||||
color: #FF0000;
|
||||
background-color: #f7e7e7;
|
||||
border: 1px solid #fbe0e0;
|
||||
}
|
||||
.nomalState.type3{
|
||||
color: #FA8435;
|
||||
background-color: #fef6ed;
|
||||
border: 1px solid #fde9cc;
|
||||
}
|
||||
.nomalState.type4{
|
||||
color: #44CEF6;
|
||||
background-color: #f0f9fb;
|
||||
border: 1px solid #d2f9ff;
|
||||
}
|
||||
</style>
|
|
@ -66,7 +66,8 @@
|
|||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="签名">
|
||||
<el-image :src="form.signature" style="width: 148px; height: 80px"></el-image>
|
||||
<sc-upload v-model="form.signature" title="证件照" :disabled="true"></sc-upload>
|
||||
<!-- <el-image :src="form.signature" style="width: 148px; height: 80px"></el-image> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
|
@ -102,8 +103,10 @@ export default {
|
|||
},
|
||||
submitForm() {
|
||||
let sform = {
|
||||
"id_number":this.form.id_number,
|
||||
"photo": this.form.photo,
|
||||
"phone": this.form.phone,
|
||||
"email": this.form.email
|
||||
"email": this.form.email,
|
||||
}
|
||||
this.saveLoading = true
|
||||
this.$API.hrm.employee.improve_info.req(sform).then(res=>{
|
||||
|
|
|
@ -5,41 +5,27 @@
|
|||
<el-main>
|
||||
<el-card header="基本信息" shadow="hover">
|
||||
<el-descriptions :column="2">
|
||||
<el-descriptions-item label="来访概述:">{{
|
||||
form.name
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访级别:">{{
|
||||
levelOptions[form.level]
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访单位:">{{
|
||||
form.company
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访概述:">{{form.name}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访级别:">{{levelOptions[form.level]}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访单位:">{{form.company}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访人数:">
|
||||
<el-tag size="small">{{ form.count_people }}人</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="来访人员:">
|
||||
<el-tag size="small" v-for="item in form.visitors_" :key="item.id">{{ item.visitor_.name }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态:">{{
|
||||
state_[form.state]
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访时间:">{{
|
||||
form.visit_time
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="离开时间:">{{
|
||||
form.leave_time
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访事由:">{{
|
||||
purpose_[form.purpose]
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访详述:">{{
|
||||
form.description
|
||||
}}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="接待人:" v-if="form.receptionist_">
|
||||
{{ form.receptionist_.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态:">{{state_[form.state]}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访时间:">{{form.visit_time}}</el-descriptions-item>
|
||||
<el-descriptions-item label="离开时间:">{{form.leave_time}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访事由:">{{purpose_[form.purpose]}}</el-descriptions-item>
|
||||
<el-descriptions-item label="来访详述:">{{form.description}}</el-descriptions-item>
|
||||
<el-descriptions-item label="接待人:" v-if="form.receptionist_">{{ form.receptionist_.name }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div v-if="form.vehicle_photos_">
|
||||
<span style="vertical-align: top;">车辆照片:</span>
|
||||
<el-image v-for="item in form.vehicle_photos_" :key="item.id" :src="item.path"
|
||||
style="width:100px;height:100px"></el-image>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 8px" shadow="hover" header="访客信息">
|
||||
<scTable ref="table" :data="peoplelist" row-key="id" height="auto" stripe hideDo hidePagination>
|
||||
|
@ -55,6 +41,15 @@
|
|||
<el-space v-if="scope.row.is_main == true">是</el-space>
|
||||
<el-space v-else>否</el-space>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="照片:">
|
||||
<el-image
|
||||
v-if="scope.row.visitor_ && scope.row.visitor_.photo"
|
||||
style="margin-right: 8px;height: 146px;height:146px;"
|
||||
:src="scope.row.visitor_.photo"
|
||||
:preview-src-list="[scope.row.visitor_.photo]"
|
||||
fit="cover"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="健康码:">
|
||||
<el-image style="width: 100px; height: 100px" :src="scope.row.health_code"
|
||||
:preview-src-list="[scope.row.health_code]" fit="cover" />
|
||||
|
@ -97,6 +92,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import config from "@/config"
|
||||
import ScBind from "@/components/scBind/index.vue";
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
|
@ -206,8 +202,13 @@ export default {
|
|||
setData(data) {
|
||||
this.loading = true
|
||||
this.$API.vm.visit.read.req(data.id).then((res) => {
|
||||
this.loading = false
|
||||
this.loading = false;
|
||||
let urls = config.API_URL.slice(0,-4);
|
||||
this.form = res;
|
||||
|
||||
this.form.vehicle_photos_.forEach(item=>{
|
||||
item.path = urls+item.path
|
||||
})
|
||||
}).catch(e => { this.loading = false });
|
||||
|
||||
this.$API.vm.people.list.req({ visit: data.id, page: 0 }).then((res) => {
|
||||
|
|
|
@ -52,13 +52,15 @@
|
|||
v-model="form.visit_time"
|
||||
type="datetime"
|
||||
placeholder="选择来访时间"
|
||||
:default-time="defaultTime_start"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
<el-form-item label="离开时间" prop="leave_time">
|
||||
<el-form-item label="离开时间">
|
||||
<el-date-picker
|
||||
:default-time="defaultTime"
|
||||
v-model="form.leave_time"
|
||||
type="datetime"
|
||||
placeholder="选择离开时间"
|
||||
|
@ -109,8 +111,13 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin-top:20px;text-align:center">
|
||||
<el-button style="margin-top: 20px" @click="handleNextStep"
|
||||
type="primary">下一步</el-button>
|
||||
<el-button style="margin-top: 20px"
|
||||
@click="handleNextStep"
|
||||
:loading="isSaving"
|
||||
:disabled="isSaving"
|
||||
type="primary">
|
||||
下一步
|
||||
</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
|
||||
|
@ -131,27 +138,11 @@
|
|||
<el-table-column label="#" type="expand">
|
||||
<template #default="scope">
|
||||
<el-descriptions :column="3" style="margin-left:70px">
|
||||
<!-- <el-descriptions-item label="返乡时间:">{{ scope.row.return_date }}</el-descriptions-item> -->
|
||||
<el-descriptions-item label="来源地:">{{ scope.row.come_place }}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="行程轨迹:">{{ scope.row.trip_desc }}</el-descriptions-item>
|
||||
<el-descriptions-item label="管控措施:">{{ scope.row.measure }}</el-descriptions-item>
|
||||
<el-descriptions-item label="核酸检测日期:">{{ scope.row.test_date }}</el-descriptions-item> -->
|
||||
<el-descriptions-item label="是否重要访客:">
|
||||
<el-space v-if="scope.row.is_main == true">是</el-space>
|
||||
<el-space v-else>否</el-space>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="健康码:">
|
||||
<el-image style="width: 100px; height: 100px" :src="scope.row.health_code"
|
||||
:preview-src-list="[scope.row.health_code]" fit="cover" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="行程码:">
|
||||
<el-image style="width: 100px; height: 100px" :src="scope.row.travel_code"
|
||||
:preview-src-list="[scope.row.travel_code]" fit="cover" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="核酸报告:">
|
||||
<el-image style="width: 100px; height: 100px" :src="scope.row.test_report"
|
||||
:preview-src-list="[scope.row.test_report]" fit="cover" />
|
||||
</el-descriptions-item> -->
|
||||
</el-descriptions>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -312,12 +303,14 @@
|
|||
style="margin-right:4px">上一步</el-button
|
||||
>
|
||||
<span v-for=" item in initform.transitions" :key="item.id">
|
||||
<el-button @click="submitticket(item.id)"
|
||||
style="margin-right:4px" type="primary">{{item.name}}</el-button
|
||||
>
|
||||
|
||||
</span>
|
||||
<el-button @click="submitOut" type="warning">退出</el-button>
|
||||
<el-button
|
||||
:loading="isSaving"
|
||||
:disabled="isSaving"
|
||||
@click="submitticket(item.id)"
|
||||
style="margin-right:4px" type="primary"
|
||||
>{{item.name}}</el-button>
|
||||
</span>
|
||||
<el-button @click="submitOut" type="warning">退出</el-button>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
@ -362,7 +355,13 @@ export default {
|
|||
measureOptions: ['集中隔离','居家隔离','居家健康检测','排除风险'],
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
form: {purpose:10, level:10},
|
||||
form: {
|
||||
purpose:10,
|
||||
level:10,
|
||||
leave_time:'',
|
||||
},
|
||||
defaultTime_start:new Date(2000, 1, 1, 10, 0, 0),
|
||||
defaultTime:new Date(2000, 1, 1, 18, 0, 0),
|
||||
stepTitle: ["基本信息", "选择访客"],
|
||||
receptionistoptions: [],
|
||||
purposeoptions: [
|
||||
|
@ -430,6 +429,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.visitid = this.$route.query.visitid; //作业ID
|
||||
this.isSaving = false;
|
||||
if(this.visitid){
|
||||
this.getRpj();
|
||||
this.getpeoplelistlist();
|
||||
|
@ -478,23 +478,29 @@ export default {
|
|||
if (this.active == 0) {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaving = true;
|
||||
if(this.visitid){
|
||||
this.$API.vm.visit.update
|
||||
.req(this.visitid, this.form)
|
||||
.then((res) => {
|
||||
this.$message.success("基本信息更新成功");
|
||||
this.getInit();
|
||||
this.active = 1;
|
||||
})
|
||||
this.$API.vm.visit.update
|
||||
.req(this.visitid, this.form)
|
||||
.then((res) => {
|
||||
this.$message.success("基本信息更新成功");
|
||||
this.getInit();
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
}).catch(()=>{
|
||||
this.isSaving = false;
|
||||
})
|
||||
}else{
|
||||
this.$API.vm.visit.create.req(this.form).then(res=>{
|
||||
this.visitid = res.id;
|
||||
this.$message.success("项目创建成功");
|
||||
this.getInit();
|
||||
this.active = 1;
|
||||
this.active = 1;
|
||||
this.isSaving = false;
|
||||
}).catch(()=>{
|
||||
this.isSaving = false;
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -577,19 +583,21 @@ export default {
|
|||
},
|
||||
//提交工单
|
||||
submitticket(id){
|
||||
this.ticket={};
|
||||
this.ticket.title = this.form.name;
|
||||
this.ticket={};
|
||||
this.isSaving = true;
|
||||
this.ticket.title = this.form.name;
|
||||
this.ticket.workflow=this.initform.workflow;
|
||||
this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
|
||||
this.ticket.transition=id;
|
||||
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
|
||||
this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
|
||||
this.ticket.transition=id;
|
||||
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
|
||||
this.$message.success("提交成功");
|
||||
this.$router.push({
|
||||
name: "visit",
|
||||
query: {},
|
||||
name: "visit",
|
||||
query: {},
|
||||
});
|
||||
}).catch(()=>{
|
||||
this.isSaving = false;
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
link
|
||||
size="small"
|
||||
v-if="
|
||||
(scope.row.act_state === 1 || scope.row.act_state === 3) &&
|
||||
scope.row.state_.type === 0
|
||||
(scope.row.act_state === 1&&scope.row.state_.type === 0) || (scope.row.act_state === 3&&
|
||||
scope.row.state_.type === 0) ||scope.row.act_state === 2
|
||||
"
|
||||
type="primary"
|
||||
@click="handleDetail(scope.row)"
|
||||
|
|
|
@ -28,7 +28,10 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
// this.workId = this.ticket?this.ticket:this.$route.query.id;
|
||||
this.workId = this.$route.query.id;
|
||||
debugger;
|
||||
console.log(this.ticket)
|
||||
this.workId = this.ticket.id;
|
||||
this.$route.query.id;
|
||||
this.getFlowSteps();
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -167,7 +167,7 @@
|
|||
</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button :loading="submitLoading" v-for="item in operationBtn" :key="item.id" class="filter-item"
|
||||
<el-button :loading="submitLoading" :disabled="submitLoading" v-for="item in operationBtn" :key="item.id" class="filter-item"
|
||||
:type="item.attribute_type===2?'danger':'primary'" @click="operationSubmit(item.id)">
|
||||
{{item.name}}
|
||||
</el-button>
|
||||
|
@ -211,7 +211,7 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
<el-drawer :size="'50%'" v-model="showLimited" title="作业许可证详情" :close-on-click-modal="false">
|
||||
<sc-fire :id="projectId"></sc-fire>
|
||||
<sc-fire :id="projectId" :wfId="operationId"></sc-fire>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
|
@ -309,6 +309,7 @@
|
|||
},
|
||||
mounted() {
|
||||
debugger;
|
||||
this.submitLoading = false;
|
||||
if (this.cateType === 'visit') {
|
||||
this.getVisit();
|
||||
} else if (this.cateType === 'rpj') {
|
||||
|
@ -381,6 +382,7 @@
|
|||
this.$API.opm.opl.read.req(this.projectId).then((res) => {
|
||||
debugger;
|
||||
this.oplDetail = res;
|
||||
this.operationId = res.operation;
|
||||
});
|
||||
},
|
||||
showMoreInfo() {
|
||||
|
@ -444,10 +446,10 @@
|
|||
params.ticket_data.close_dos = this.form.close_dos;
|
||||
}
|
||||
this.$API.wf.ticket.ticketHandle.req(this.ticketId, params).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.err_msg) {
|
||||
} else {
|
||||
this.$router.push("dutywork");
|
||||
this.submitLoading = false;
|
||||
}
|
||||
}).catch(e=>{this.submitLoading=false;})
|
||||
},
|
||||
|
|
|
@ -72,6 +72,16 @@ module.exports = defineConfig({
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
resolve:{
|
||||
fallback:{
|
||||
fs:false,
|
||||
crypto: require.resolve("crypto-browserify"),
|
||||
stream: false,
|
||||
}
|
||||
},
|
||||
externals:{
|
||||
'./cptable':'var cptable'
|
||||
}
|
||||
},
|
||||
pluginOptions: {
|
||||
|
|
Loading…
Reference in New Issue