Merge branch 'ehs' into v2

This commit is contained in:
caoqianming 2023-05-11 14:40:39 +08:00
commit a80a1ab83e
62 changed files with 3315 additions and 1173 deletions

View File

@ -9,7 +9,8 @@ VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
#VUE_APP_WS_API = 'ws://localhost:8000' #VUE_APP_WS_API = 'ws://localhost:8000'
VUE_APP_API_BASEURL = http://222.222.144.147:6013/api 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://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 #VUE_APP_BASEURL = http://127.0.0.1:8000

View File

@ -14,14 +14,19 @@
"codemirror": "5.65.5", "codemirror": "5.65.5",
"core-js": "3.29.0", "core-js": "3.29.0",
"cropperjs": "1.5.13", "cropperjs": "1.5.13",
"crypto-browserify": "^3.12.0",
"crypto-js": "4.1.1", "crypto-js": "4.1.1",
"d3": "^7.6.1", "d3": "^7.6.1",
"dagre": "^0.8.5", "dagre": "^0.8.5",
"dagre-d3": "^0.6.4", "dagre-d3": "^0.6.4",
"echarts": "5.3.2",
"element-plus": "2.2.3",
"html2canvas": "^1.4.1",
"json-editor-vue3": "^1.0.6", "json-editor-vue3": "^1.0.6",
"xlsx": "^0.18.5", "xlsx": "^0.18.5",
"echarts": "5.4.1", "echarts": "5.4.1",
"element-plus": "2.2.32", "element-plus": "2.2.32",
"jspdf": "^2.5.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"qrcodejs2": "0.0.2", "qrcodejs2": "0.0.2",
"sortablejs": "1.15.0", "sortablejs": "1.15.0",
@ -32,7 +37,8 @@
"vuedraggable": "4.0.3", "vuedraggable": "4.0.3",
"vuex": "4.1.0", "vuex": "4.1.0",
"xgplayer": "2.32.2", "xgplayer": "2.32.2",
"xgplayer-hls": "2.5.2" "xgplayer-hls": "2.5.2",
"xlsx-style": "^0.8.13"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.21.00", "@babel/core": "7.21.00",

View File

@ -11,6 +11,7 @@
<script type="text/javascript"> <script type="text/javascript">
document.write("<script src='config.js?"+new Date().getTime()+"'><\/script>"); document.write("<script src='config.js?"+new Date().getTime()+"'><\/script>");
</script> </script>
<script type="text/javascript" src="./xlsx.full.min.js"></script>
</head> </head>
<body> <body>
<noscript> <noscript>

20
public/xlsx.full.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -53,6 +53,15 @@ export default {
req: async function(data){ req: async function(data){
return await http.post(`${config.API_URL}/hrm/employee/improve_info/`, 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
);
}
} }
}, },

View File

@ -70,6 +70,14 @@ export default {
data); data);
} }
}, },
patch: {
name: "字段更新",
req: async function (id, data) {
return await http.patch(
`${config.API_URL}/opm/operation/${id}/`,
data);
}
},
create: { create: {
name: "创建", name: "创建",
req: async function (data) { req: async function (data) {

View File

@ -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: { remployee: {
@ -170,7 +207,16 @@ export default {
return await http.delete( return await http.delete(
`${config.API_URL}/rpm/rpj/${id}/`); `${config.API_URL}/rpm/rpj/${id}/`);
} }
} },
logs: {
name: "日志",
req: async function (data) {
return await http.get(
`${config.API_URL}/rpm/rpj_log/`,
data
);
}
},
}, },
/*相关方文件 */ /*相关方文件 */
rfile: { rfile: {
@ -266,6 +312,14 @@ export default {
data); data);
} }
}, },
leave: {
name: "提前离厂",
req: async function (id,data) {
return await http.post(
`${config.API_URL}/rpm/rpj_member/${id}/leave/`,
data);
}
},
update: { update: {
name: "更新", name: "更新",
req: async function (id, data) { req: async function (id, data) {

View File

@ -202,7 +202,6 @@ export default {
} }
}, },
put:{ put:{
url: `${config.API_URL}/system/user/password/`, url: `${config.API_URL}/system/user/password/`,
name: "修改密码", name: "修改密码",
req: async function(data){ req: async function(data){
@ -214,6 +213,12 @@ export default {
req: async function(id){ req: async function(id){
return await http.delete(`${config.API_URL}/system/user/${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: { post: {

View File

@ -211,8 +211,10 @@ export default {
data() { data() {
return { return {
apiObj: this.$API.system.user.list, apiObj: this.$API.system.user.list,
params: {}, params: {is_active:true},
query: {}, query: {
is_active:true,
},
selection: [], selection: [],
filterText: "", filterText: "",
filterTexts: "", filterTexts: "",

View File

@ -1,311 +1,234 @@
<template> <template>
<!--基本信息!--> <!--基本信息!-->
<el-main v-loading="mainLoading"> <el-main v-loading="mainLoading" style="margin-top: -10px;">
<div class="exportBtn" @click="handleExport">导出</div>
<el-card shadow="hover"> <div id="exportDiv" class="exportDiv">
<el-descriptions title="许可证信息" column=2> <p style="font-weight: 600px;font-size: 18px;text-align: center;margin-top: 40px;">{{form.cate_name}}作业许可证<span>{{ form.number }}</span></p>
<el-descriptions-item label="编号:"> <p class="tables-title">作业信息</p>
{{ form.number }} <el-card shadow="hover">
</el-descriptions-item> <el-descriptions column=2 id="opl__opre">
<el-descriptions-item label="作业级别:"> <el-descriptions-item label="作业名称:">
{{ form.level }} {{ operationObj.name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="预计开始:"> <el-descriptions-item label="作业区域:">
{{ form.start_time }} <span v-if="operationObj.area_">
</el-descriptions-item> {{ operationObj.area_.name }}
<el-descriptions-item label="预计结束:"> </span>
{{ form.end_time }} </el-descriptions-item>
</el-descriptions-item> <el-descriptions-item label="生产状态:">
<el-descriptions-item label="状态:"> {{ operationObj.state_work }}
<span v-if="form.ticket_&&form.ticket_.state_" style="margin-right: 5px;">{{form.ticket_.state_.name }}</span> </el-descriptions-item>
<el-tag <el-descriptions-item label="状态:">
v-if="form.ticket_&&form.ticket_.act_state" {{ state_[operationObj.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':''" </el-descriptions-item>
>{{act_states[form.ticket_.act_state]}}</el-tag> <el-descriptions-item label="预计开始:">
</el-descriptions-item> {{ operationObj.start_time }}
<el-descriptions-item label="作业部门:"> </el-descriptions-item>
<span v-if="form.dept_do_">{{ <el-descriptions-item label="预计结束:">
form.dept_do_.name {{ operationObj.end_time }}
}}</span> </el-descriptions-item>
</el-descriptions-item> <el-descriptions-item label="属地部门:">
<el-descriptions-item label="作业负责人:"> <span v-if="operationObj.dept_ter_">
<span v-if="form.charger_">{{ {{operationObj.dept_ter_.name}}
form.charger_.name </span>
}}</span> </el-descriptions-item>
</el-descriptions-item> <el-descriptions-item label="业务部门:">
<el-descriptions-item label="作业监护人:"> <span v-if="operationObj.dept_bus_">
<span v-if="form.monitor_">{{ {{operationObj.dept_bus_.name}}
form.monitor_.name </span>
}}</span> </el-descriptions-item>
</el-descriptions-item> <el-descriptions-item label="协调员:">
<el-descriptions-item label="风险分析:" span=2> <span v-if="operationObj.coordinator_">
<span v-for="item in form.risks_checked_" :key="item.id">{{ {{operationObj.coordinator_.name}}
item.name </span>
}}<el-divider direction="vertical"></el-divider></span> </el-descriptions-item>
</el-descriptions-item> <el-descriptions-item label="监控设备:" v-if="operationObj.vchannels">
<el-descriptions-item label="控制措施:" span=2> <span v-for="item in operationObj.vchannels_" :key="item.id">
<span v-for="item in form.measures_checked_" :key="item.id">{{ {{ item.name}}({{item.code}})/
item.name </span>
}}<el-divider direction="vertical"></el-divider></span> </el-descriptions-item>
</el-descriptions-item> </el-descriptions>
<el-descriptions-item label="监控状态:" span=2> </el-card>
<span v-if="form.mtask_uid">进行中</span> <p class="tables-title">许可证信息</p>
</el-descriptions-item> <el-card shadow="hover">
</el-descriptions> <el-descriptions column=2 id="opl__opre">
</el-card> <el-descriptions-item label="编号:">
<!-- <el-form {{ form.number }}
ref="dialogForm" </el-descriptions-item>
:model="form" <el-descriptions-item label="作业级别:">
:rules="rules" {{ form.level }}
label-width="110px" </el-descriptions-item>
style="margin: 10px 20px 0 20px" <el-descriptions-item label="开始时间:">
> {{ form.start_time }}
<el-row> </el-descriptions-item>
<el-col :md="12" :sm="12" :xs="24"> <el-descriptions-item label="结束时间:">
<el-form-item label="关联作业:"> {{ form.end_time }}
<span>{{form.name}}</span> </el-descriptions-item>
</el-form-item> <el-descriptions-item label="状态:">
</el-col> <span v-if="form.ticket_&&form.ticket_.state_" style="margin-right: 5px;">{{form.ticket_.state_.name }}</span>
<el-col :md="12" :sm="12" :xs="24"> <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']"
<el-form-item label="作业许可种类:"> v-if="form.ticket_&&form.ticket_.act_state">{{act_states[form.ticket_.act_state]}}</span>
<span>{{pagtitle}}</span> </el-descriptions-item>
</el-form-item> <el-descriptions-item label="作业部门:">
</el-col> <span v-if="form.dept_do_">
<el-col :md="12" :sm="12" :xs="24"> {{form.dept_do_.name}}
<el-form-item label="作业开始时间:"> </span>
<span>{{form.start_time}}</span> </el-descriptions-item>
</el-form-item> <el-descriptions-item label="作业负责人:">
</el-col> <span v-if="form.charger_">
<el-col :md="12" :sm="12" :xs="24"> {{form.charger_.name}}
<el-form-item label="作业结束时间:"> </span>
<span>{{form.end_time}}</span> </el-descriptions-item>
</el-form-item> <el-descriptions-item label="作业监护人:">
</el-col> <span v-if="form.monitor_">
<el-col :md="12" :sm="12" :xs="24"> {{form.monitor_.name}}
<el-form-item label="作业级别:"> </span>
<el-select v-model="form.level" placeholder="选择作业级别"> </el-descriptions-item>
<el-option <el-descriptions-item label="风险分析:" span=2>
v-for="item in leveloptions" <span v-for="item in form.risks_checked_" :key="item.id">
:key="item.id" {{item.name}}<el-divider direction="vertical"></el-divider>
:label="item.name" </span>
:value="item.name" </el-descriptions-item>
/> <el-descriptions-item label="控制措施:" span=2>
</el-select> <span v-for="item in form.measures_checked_" :key="item.id">
</el-form-item> {{item.name}}<el-divider direction="vertical"></el-divider>
</el-col> </span>
</el-descriptions-item>
<el-col :md="12" :sm="12" :xs="24"> <el-descriptions-item label="监控状态:" span=2 v-if="form.mtask_uid">
<el-form-item label="作业部门:"> <span>进行中</span>
<el-cascader </el-descriptions-item>
placeholder="选择作业部门" <el-descriptions-item label="现场照片:" span=2 v-if="form.create_imgs&&form.create_imgs.length>0">
getCheckedNodes="true" <!-- <el-upload
v-model="form.dept_do" v-model:file-list="create_imgs_list"
:options="deptoptions" list-type="picture-card"
:props="{ :auto-upload="false"
expandTrigger: 'hover', // action="#"
label: 'label', // :disabled="true"
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-checkbox-group> </el-upload>-->
</el-form-item> <el-image
</el-col> v-for = "item in form.create_imgs_"
<el-col :md="24" :sm="12" :xs="24"> :key = "item.id"
<el-form-item label="其他风险:"> style="margin-right: 8px;height: 146px;height:146px;"
<span>{{form.other_risk}}</span> :src="item.path"
</el-form-item> :preview-src-list="[item.path]"
</el-col> fit="cover"
<el-col :md="24" :sm="12" :xs="24"> />
<el-form-item label="措施选择:"> </el-descriptions-item>
<el-checkbox-group v-model="form.measures_checked" disabled> <el-descriptions-item label="关闭照片:" span=2 v-if="form.close_imgs&&form.close_imgs.length>0">
<el-checkbox <el-image
v-show="form.measures_checked.indexOf(item.id)>-1" v-for = "item in form.close_imgs_"
v-for="(item, index) in measurelist" :key = "item.id"
:key="index" style="margin-right: 8px;height: 146px;height:146px;"
:label="item.id" :src="item.path"
>{{ item.name }} :preview-src-list="[item.path]"
</el-checkbox fit="cover"
> />
</el-checkbox-group> </el-descriptions-item>
</el-form-item> </el-descriptions>
</el-col> </el-card>
<el-col :md="24" :sm="12" :xs="24"> <!-- <p class="tables-title" v-if="ticketDetailState">进度流程</p>
<el-card class="box-card"> <el-card shadow="hover" v-if="ticketDetailState">
<div class="clearfix"> <work-step v-if="ticketDetail.state" ref="workStep" :ticket="ticketDetail"></work-step>
<span>应急处置</span> </el-card> -->
</div> <p class="tables-title">作业人员</p>
<div class="content"> <table class="tables" cellspacing="0">
<p>1发生火灾时立即使用消防器材边灭火边报告</p> <tr class="tableTh tableThS">
<p>2预判火势无法控制时应立即疏散人群并拨打110或119求救</p> <td class="tableTd">序号</td>
<p> <td class="tableTd" style="width:100px">姓名</td>
3发生人员烫伤时用清水对烫伤部位进行冲洗或浸泡用干净的纱布或衣物盖住被烫伤部位伤势严重时立即拨打120送医若贴身衣服与伤口粘在一起时可用剪刀剪开然后缓慢剥离衣物 <td class="tableTd" style="width:120px">工作职责</td>
</p> <td class="tableTd" style="flex: auto;">证书</td>
</div> <td class="tableTd" style="width:180px">创建时间</td>
</el-card> </tr>
<el-form-item label="其他应急处置:"> <tr v-if="workerData.length==0" class="noDataTr"> 无数据</tr>
<span>{{form.other_emr}}</span> <tr class="tableTr tableTrS" v-for="(item,index) in workerData" :key="item.id">
</el-form-item> <td class="tableTd" >{{ index+1 }}</td>
</el-col> <td class="tableTd" style="width:100px">{{ item.worker_.name }}</td>
</el-row> <td class="tableTd" style="width:120px">{{ item.duty }}</td>
</el-form> --> <td class="tableTd" style="flex: auto;">
<el-card header="作业人员" style="margin-top:8px" shadow="hover"> <span v-for="cer in item.certificates_" :key="cer.number">{{cer.name}}-{{cer.number }}</span>
<scTable </td>
ref="workerTable" <td class="tableTd" style="width:180px">{{ item.create_time }}</td>
:data="workerData" </tr>
row-key="id" </table>
hidePagination <p class="tables-title">气体检测记录</p>
stripe <table class="tables" cellspacing="0">
hideDo <tr class="tableTh tableThS">
style="height: calc(100% - 60px);" <td class="tableTd">序号</td>
> <td class="tableTd">检测部位</td>
<el-table-column <td class="tableTd">O₂%</td>
label="#" <td class="tableTd">CO</td>
fixed="left" <td class="tableTd" style="line-height: 18px;">可燃气体<span style="12px;font-weight:500">(V%LEL)</span></td>
type="index" <td class="tableTd">检验结论</td>
width="50" <td class="tableTd">检测人</td>
></el-table-column> <td class="tableTd">检测时间</td>
<el-table-column label="姓名" prop="name" width="150"> <td class="tableTd">创建时间</td>
<template #default="scope"> </tr>
{{ scope.row.worker_.name }} <tr v-if="gasData.length==0" class="noDataTr"> 无数据</tr>
</template> <tr class="tableTr tableTrS" v-for="(item,index) in gasData" :key="item.id">
</el-table-column> <td class="tableTd">{{ index+1 }}</td>
<el-table-column label="工作职责" prop="duty" width="150"> <td class="tableTd">{{ item.check_place }}</td>
</el-table-column> <td class="tableTd">{{ item.o2 }}</td>
<el-table-column label="证书" prop="certificates" width="150"> <td class="tableTd">{{item.co}}</td>
<template #default="scope"> <td class="tableTd">{{ item.lel }}</td>
<el-tag v-for="item in scope.row.certificates_" <td class="tableTd">{{ is_ok_[item.is_ok] }}</td>
:key="item.number" <td class="tableTd">{{ item.checker_.name }}</td>
:label="item.name" <td class="tableTd">{{ item.check_time }}</td>
:value="item.number">{{item.name}} <td class="tableTd">{{ item.create_time }}</td>
</el-tag> </tr>
</template> </table>
</el-table-column> <p class="tables-title">处理日志</p>
<el-table-column <table class="tables" cellspacing="0">
label="创建时间" <tr class="tableTh">
prop="create_time" <td class="tableTd">进行状态</td>
width="150" <td class="tableTd attributeTd">操作类型</td>
></el-table-column> <td class="tableTd attributeTd">操作属性</td>
<!-- <el-table-column label="操作" fixed="right" align="center" width="100"> <td class="tableTd">操作意见</td>
<template #default="scope"> <td class="tableTd">操作人</td>
<el-button text type="primary" size="small" @click="bltHandle(scope.row,'1')">绑卡</el-button> <!-- <td class="tableTd">电子签名</td> -->
<el-button text type="primary" size="small" @click="bltHandle(scope.row,'0')">解绑</el-button> <td class="tableTd">更新时间</td>
</template> </tr>
</el-table-column> --> <tr v-if="logsData.length==0" class="noDataTr"> 无处理日志</tr>
</scTable> <tr class="tableTr" v-for="item in logsData" :key="item.id">
</el-card> <td class="tableTd" v-if="item.participant_str==null">{{ item.state_.name }}</td>
<el-card header="气体检测记录" style="margin-top: 8px" shadow="hover" v-show="oplcateCode=='fire'||oplcateCode=='space'||oplcateCode=='cooler'"> <td class="tableTd attributeTd" v-if="item.participant_str==null">{{ typeOptions[item.intervene_type] }}</td>
<scTable <td class="tableTd attributeTd" v-if="item.participant_str==null">
ref="gasTable" <span v-if="item.transition_attribute == 1" class="successText">同意</span>
:data="gasData" <span v-else-if="item.transition_attribute == 2" class="successText">拒绝</span>
row-key="id" <span v-else class="dangerText"></span>
hidePagination </td>
stripe <td class="tableTd" v-if="item.participant_str==null">{{ item.suggestion }}</td>
hideDo <td class="tableTd" v-if="item.participant_str==null">
> <span v-if="item.participant_">{{item.participant_.name}}</span>
<el-table-column <span v-if="item.participant_str">{{item.participant_str}}</span>
label="#" <el-image v-if="item.participant_ && item.participant_.signature" :src="item.participant_.signature" style="width: 60px"></el-image>
type="index" <!-- <img style="width:60px;vertical-align: bottom;" src="./../../../public/img/signature.jpg"> -->
width="50" </td>
></el-table-column> <td class="tableTd" v-if="item.participant_str==null">{{ item.update_time }}</td>
<el-table-column </tr>
label="检测部位" </table>
prop="check_place" </div>
min-width="150"
></el-table-column> </el-main>
<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>
</template> </template>
<script> <script>
import {genTree} from "@/utils/verificate"; import workStep from "./../../views/wf/steps.vue";
import PdfLoader from '@/utils/html2pdf';
export default { export default {
name: "scFire", name: "scFire",
components: {
workStep
},
props: { props: {
id: { type: String, default: "" }, id: { type: String, default: "" },
wfId: { type: String, default: "" },
}, },
data() { data() {
return { return {
create_imgs_list: [],
close_imgs_list: [],
mainLoading: false, mainLoading: false,
active: 0,
stepSuc: [0],
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
query: {},
selection: [],
issave: false, // issave: false, //
search: { search: {
keyword: null, keyword: null,
@ -318,7 +241,7 @@
cate: "", cate: "",
risks_checked: [], risks_checked: [],
}, },
initForm: {}, ticketDetailState:false,
oplcateCode: 'fire', oplcateCode: 'fire',
operationId: "", operationId: "",
oplId: "", oplId: "",
@ -327,27 +250,23 @@
{id: 20, name: "一级动火"}, {id: 20, name: "一级动火"},
{id: 30, name: "二级动火"}, {id: 30, name: "二级动火"},
], ],
deptoptions: [], ticketId:'',
useroptions: [], ticketDetail:{},
risklist: [], operationObj:{},
measurelist: [],
pagtitle: "",
dutyOptions: [
{value: 10, label: "作业人员"},
{value: 20, label: "起重司机"},
{value: 30, label: "司索人员"},
{value: 40, label: "起重指挥"},
{value: 40, label: "电工"},
],
certificatesOptions: [],
workerData: [], workerData: [],
workerdialog: false,
gasdialog: false,
gasData: [], gasData: [],
logsData:[],
is_ok_: { is_ok_: {
true: "正常", true: "正常",
false: "不正常", false: "不正常",
}, },
state_: {
10: "创建中",
20: "审批中",
30: "待开始",
40: "进行中",
50: "已完成",
},
act_states: { act_states: {
0: "草稿中", 0: "草稿中",
1: "进行中", 1: "进行中",
@ -356,59 +275,91 @@
4: "已完成", 4: "已完成",
5: "已关闭", 5: "已关闭",
}, },
typeOptions: {
0: "正常处理",
1: "转交",
2: "加签",
3: "加签完成",
4: "接单",
5: "评论",
6: "删除",
7: "强制关闭",
8: "强制修改状态",
9: "hook",
10: "撤回",
11: "抄送",
},
}; };
}, },
mounted() { mounted() {
let that = this; let that = this;
that.oplId = that.id; //ID that.oplId = that.id; //ID
that.operationId = that.wfId; //zuoyeID
this.$nextTick(()=>{ this.$nextTick(()=>{
that.getOplData(); that.getOplData();
that.getworkerList(); that.getworkerList();
that.getgasList(); that.getgasList();
that.getOperation();
}) })
}, },
methods: { 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 //oplId
getOplData() { getOplData() {
this.mainLoading = true let that = this;
this.$API.opm.opl.read.req(this.oplId).then((res) => { that.mainLoading = true;
this.mainLoading = false that.$API.opm.opl.read.req(that.oplId).then((res) => {
this.form = res; that.mainLoading = false
this.oplcateCode = res.cate_code that.form = res;
// this.oplcateId = res.cate; that.oplcateCode = res.cate_code;
// this.operationId = res.operation; that.ticketId = res.ticket;
// this.getOperation(); res.create_imgs_.forEach(item=>{
// this.getOplcates(); 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}); }).catch(e=>{this.mainLoading=false});
}, },
getOperation() {
// //ID===> this.mainLoading = true;
// getOplcates() { this.$API.opm.operation.read
// debugger; .req(this.operationId)
// this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => { .then((res) => {
// console.log(res); // this.mainLoading = false;
// this.pagtitle = res.name; this.operationObj = res;
// this.oplcateCode = res.code; })
// this.risklist = res.risk_options_; // .catch((e) => {
// this.measurelist = res.measure_options_; // this.mainLoading = false;
// }); });
// }, },
// //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);
// });
// },
// //
// //
getworkerList() { getworkerList() {
this.$API.opm.worker.list.req({opl: this.oplId, page: 0}).then((res) => { this.$API.opm.worker.list.req({opl: this.oplId, page: 0}).then((res) => {
@ -426,5 +377,108 @@
</script> </script>
<style scoped> <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> </style>

View File

@ -64,7 +64,6 @@
showFileList: { type: Boolean, default: true }, showFileList: { type: Boolean, default: true },
multiple: { type: Boolean, default: true }, multiple: { type: Boolean, default: true },
disabled: { type: Boolean, default: false }, disabled: { type: Boolean, default: false },
draggable: { type: Boolean, default: false },
onSuccess: { type: Function, default: () => { return true } } onSuccess: { type: Function, default: () => { return true } }
}, },
data(){ data(){
@ -86,6 +85,17 @@
this.value = val 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: { defaultFileList: {
handler(val){ handler(val){
@ -155,6 +165,7 @@
tableData.splice(newIndex, 0, currRow) tableData.splice(newIndex, 0, currRow)
} }
}) })
return _arr
}, },
before(file){ before(file){
if(!['image/jpeg','image/png','image/gif'].includes(file.type)){ if(!['image/jpeg','image/png','image/gif'].includes(file.type)){
@ -167,8 +178,16 @@
return false; 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) var os = this.onSuccess(res, file)
if(os!=undefined && os==false){ if(os!=undefined && os==false){
return false return false
} }
@ -183,6 +202,8 @@
}) })
}, },
beforeRemove(uploadFile){ beforeRemove(uploadFile){
debugger;
console.log(uploadFile)
return this.$confirm(`是否移除 ${uploadFile.name} ?`, '提示', { return this.$confirm(`是否移除 ${uploadFile.name} ?`, '提示', {
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
@ -192,8 +213,22 @@
}) })
}, },
handleRemove(file){ handleRemove(file){
this.$refs.uploader.handleRemove(file) let list = this.defaultFileList;
//this.defaultFileList.splice(this.defaultFileList.findIndex(item => item.uid===file.uid), 1) 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(){ handleExceed(){
this.$message.warning(`当前设置最多上传 ${this.limit} 个文件,请移除后上传!`) this.$message.warning(`当前设置最多上传 ${this.limit} 个文件,请移除后上传!`)
@ -217,13 +252,14 @@
param.onProgress({percent: complete}) param.onProgress({percent: complete})
} }
}).then(res => { }).then(res => {
config.parseData(res); var response = config.parseData(res);
param.onSuccess(res) console.log(res)
// if(response.code == config.successCode){ console.log(response)
// param.onSuccess(res) if(res.id){
// }else{ param.onSuccess(res)
// param.onError(response.msg || "") }else{
// } param.onError(response.msg || "未知错误")
}
}).catch(err => { }).catch(err => {
param.onError(err) param.onError(err)
}) })

View File

@ -6,7 +6,7 @@ const DEFAULT_CONFIG = {
DASHBOARD_URL: "/dashboard", DASHBOARD_URL: "/dashboard",
//版本号 //版本号
APP_VER: "1.6.9", APP_VER: "2.0.12",
//内核版本号 //内核版本号
CORE_VER: "1.6.9", CORE_VER: "1.6.9",
@ -61,11 +61,12 @@ const DEFAULT_CONFIG = {
//控制台首页默认布局 //控制台首页默认布局
DEFAULT_GRID: { DEFAULT_GRID: {
//默认分栏数量和宽度 例如 [24] [18,6] [8,8,8] [6,12,6] //默认分栏数量和宽度 例如 [24] [18,6] [8,8,8] [6,12,6]
layout: [24, 24, 6], layout: [24, 24, 24],
//小组件分布com取值:views/home/components 文件名 //小组件分布com取值:views/home/components 文件名
copmsList: [ copmsList: [
['ticket'], ['ticket'],
['eventlist'], ['eventlist'],
['about'],
] ]
} }

View File

@ -344,6 +344,16 @@ const routes = [
}, },
"component": "rpm/rparty" "component": "rpm/rparty"
}, },
{
"name": "blacklist",
"path": "/rpm/blacklist",
"meta": {
"title": "黑名单",
"icon": "el-icon-box",
"perms": ["blacklist"]
},
"component": "rpm/blacklist"
},
{ {
"name": "remployee", "name": "remployee",
"path": "/rpm/remployee", "path": "/rpm/remployee",

View File

@ -9,6 +9,7 @@ import router from './router'
import store from './store' import store from './store'
import App from './App.vue' import App from './App.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue' import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import preventReClick from './utils/preventReClick'
const app = createApp(App); const app = createApp(App);
@ -18,7 +19,7 @@ app.use(ElementPlus);
app.use(i18n); app.use(i18n);
app.use(scui); app.use(scui);
app.use(ehsui); app.use(ehsui);
app.use(preventReClick)
//挂载app //挂载app
app.mount('#app'); app.mount('#app');
for (const [key, component] of Object.entries(ElementPlusIconsVue)) { for (const [key, component] of Object.entries(ElementPlusIconsVue)) {

View File

@ -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{ #eventImgWrap .el-image__preview,#eventImgWrap .el-image__inne{
width: auto; width: auto;
}
#opl__opre>.el-descriptions__body>.el-descriptions__table:not(.is-bordered) .el-descriptions__cell{
padding-bottom: 5px;
} }

View File

@ -335,7 +335,8 @@ body .tox-tinymce-aux {
} }
.el-drawer__header { .el-drawer__header {
margin-bottom: 16px; margin-bottom: 0;
// margin-bottom: 16px;
} }
.el-drawer .el-drawer__body { .el-drawer .el-drawer__body {

114
src/utils/html2pdf.js Normal file
View File

@ -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

View File

@ -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)
}
})
}
})
}

View File

@ -166,7 +166,7 @@ export default {
this.syncLoading = false; this.syncLoading = false;
}, },
getEmployee(data) { getEmployee(data) {
this.form.employee=data.id; this.form.employee=data.employee;
this.form.employee_name=data.name this.form.employee_name=data.name
}, },
handleBindBlt(type, row) { handleBindBlt(type, row) {

View File

@ -1408,7 +1408,7 @@ export default {
// //
getAreaOperation(){ getAreaOperation(){
let that = this; 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) console.log(res)
that.areaOperation = res.results; that.areaOperation = res.results;
}) })
@ -1776,7 +1776,7 @@ export default {
} }
}, },
// //Marker
showCameraMarkers(list) { showCameraMarkers(list) {
// debugger; // debugger;
let that = this; let that = this;
@ -1815,7 +1815,7 @@ export default {
} }
}, },
// //Marker
showSpeakersMarkers(list) { showSpeakersMarkers(list) {
let that = this; let that = this;
list.forEach(item => { list.forEach(item => {
@ -1848,7 +1848,7 @@ export default {
}) })
}, },
// //Marker
showUserMarkers(userList) { showUserMarkers(userList) {
// debugger; // debugger;
let that = this; let that = this;
@ -1862,9 +1862,9 @@ export default {
if (employeeType === 'employee') { if (employeeType === 'employee') {
userImage = "/img/employee.png" userImage = "/img/employee.png"
}else if (employeeType === 'driver') { }else if (employeeType === 'driver') {
userImage = "/img/visitor.png" userImage = "/img/driver.png"
} else if (employeeType === 'remployee') { } else if (employeeType === 'remployee') {
userImage = "/img/employee.png" userImage = "/img/driver.png"
}else { }else {
userImage = "/img/visitor.png" userImage = "/img/visitor.png"
} }

View File

@ -26,12 +26,12 @@
<el-table-column <el-table-column
label="名称" label="名称"
prop="name" prop="name"
width="100" width="120"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="标识" label="标识"
prop="code" prop="code"
width="80" width="120"
></el-table-column> ></el-table-column>
<el-table-column label="触发" prop="trigger" width="80"> <el-table-column label="触发" prop="trigger" width="80">
<template #default="scope"> <template #default="scope">
@ -159,7 +159,7 @@ export default {
selection: [], selection: [],
chosen_cate: "", chosen_cate: "",
apiObj1: this.$API.ecm.event_cate.list, apiObj1: this.$API.ecm.event_cate.list,
params1: { self_algo: true }, params1: { trigger: 10 },
apiObj2: null, apiObj2: null,
}; };
}, },

View File

@ -76,7 +76,7 @@
prop="vchannel_.name" prop="vchannel_.name"
width="150" width="150"
></el-table-column> ></el-table-column>
<el-table-column label="始终开启" prop="always_on" width="150"> <el-table-column label="常开" prop="always_on" width="150">
<template #default="scope"> <template #default="scope">
<el-switch <el-switch
v-model="scope.row.always_on" v-model="scope.row.always_on"

View File

@ -34,9 +34,9 @@
/> />
</el-select> </el-select>
</el-form-item> </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-switch v-model="form.always_on"></el-switch>
</el-form-item> --> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<!-- <el-button @click="visible = false"> </el-button> --> <!-- <el-button @click="visible = false"> </el-button> -->
@ -68,7 +68,7 @@ export default {
form: { form: {
algo: "", algo: "",
vchannel: "", vchannel: "",
always_on: true, always_on: false,
}, },
// //
rules: { rules: {
@ -93,7 +93,7 @@ export default {
}, },
// //
getAlgo() { 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; this.algooptions = res;
}); });
}, },

View File

@ -34,7 +34,7 @@
/> />
</el-select> </el-select>
</el-form-item> </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-switch v-model="form.always_on"></el-switch>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
@ -68,7 +68,7 @@ export default {
form: { form: {
algo: "", algo: "",
vchannels: [], vchannels: [],
always_on: true, always_on: false,
}, },
// //
rules: { rules: {

View File

@ -39,11 +39,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <!-- <el-col :md="12" :sm="24">
<el-form-item label="需布设" prop="self_algo"> <el-form-item label="需布设" prop="self_algo">
<el-switch v-model="form.self_algo"></el-switch> <el-switch v-model="form.self_algo"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="处理时间" prop="handle_minute"> <el-form-item label="处理时间" prop="handle_minute">
@ -56,6 +56,15 @@
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
</el-col> </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-col :md="12" :sm="24">
<el-form-item label="作业许可" prop="opl_cates"> <el-form-item label="作业许可" prop="opl_cates">
<el-select v-model="form.opl_cates" multiple> <el-select v-model="form.opl_cates" multiple>
@ -129,15 +138,7 @@
</el-form-item> </el-form-item>
</el-col> </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-col :md="12" :sm="24">
<el-form-item label="开启区域" prop="filter_area_level"> <el-form-item label="开启区域" prop="filter_area_level">
@ -183,11 +184,13 @@ export default {
form: { form: {
speaker_on: true, speaker_on: true,
self_algo: false, self_algo: false,
speakers: [], speakers: []
}, },
// //
rules: { rules: {
name: [{ required: true, message: "请输入" }], name: [{ required: true, message: "请输入" }],
code: [{ required: true, message: "请输入" }],
trigger: [{ required: true, message: "请选择" }],
}, },
filter_area_level_options: [ filter_area_level_options: [
{ {

View File

@ -1,24 +1,128 @@
<template> <template>
<el-card shadow="hover" header="关于项目" class="item-background"> <el-row :gutter="6">
<p>高性能 / 精致 / 优雅基于Vue3 + Element-Plus 的中后台前端解决方案如果喜欢就点个星星支持一下</p> <el-col :md="12" :sm="24">
<p> <el-card shadow="hover" header="在厂人员" class="item-background" >
<a href='https://gitee.com/lolicode/scui' target="_blank"> <el-table :data="tableData" ref="table" row-key="id" fit hideDo height="332">
<img src='https://gitee.com/lolicode/scui/badge/star.svg?theme=dark' alt='star' style="vertical-align: middle"> <el-table-column label="姓名">
</a> <template #default="scope">
</p> <span v-if="scope.row.employee_">{{scope.row.employee_.name }}</span>
</el-card> </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> </template>
<script> <script>
import scEcharts from "@/components/scEcharts";
export default { export default {
title: "关于项目", title: "关于项目",
icon: "el-icon-setting", icon: "el-icon-setting",
description: "点个星星支持一下", description: "点个星星支持一下",
components: {
scEcharts,
},
data() { data() {
return { 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> </script>

View File

@ -1,23 +1,26 @@
<template> <template>
<el-row :gutter="6"> <el-row :gutter="6">
<el-col :md="3" :sm="24"> <el-col :md="8" :sm="24">
<el-card shadow="hover"> <el-card shadow="hover" style="">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>工单待办</span> <span>工单待办</span>
</div> </div>
</template> </template>
<div class="card-body"> <div class="card-body" v-if="dutyAgg.length>0">
<div v-for="item in dutyAgg" :key="item.workflow" style=" margin-bottom: 10px;"> <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-badge :value="item.count" class="item workItemImg">
<el-button icon="el-icon-promotion" type="primary" size="small" @click="toTicket"></el-button> <el-button icon="el-icon-promotion" type="primary" size="small" @click="toTicket"></el-button>
</el-badge> </el-badge>
<div class="workItemText">{{ item.workflow__name }}</div> <div class="workItemText">{{ item.workflow__name }}</div>
</div> </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-card>
</el-col> </el-col>
<el-col :md="13" :sm="24"> <el-col :md="16" :sm="24">
<el-card shadow="hover"> <el-card shadow="hover">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
@ -71,7 +74,7 @@
</el-card> </el-card>
</el-col> </el-col>
<el-col :md="8" :sm="24"> <!-- <el-col :md="8" :sm="24">
<el-card shadow="hover"> <el-card shadow="hover">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
@ -80,7 +83,7 @@
</template> </template>
<scEcharts height="340px" :option="option3"></scEcharts> <scEcharts height="340px" :option="option3"></scEcharts>
</el-card> </el-card>
</el-col> </el-col> -->
</el-row> </el-row>
</template> </template>
@ -111,45 +114,7 @@ export default {
}; };
}, },
created() { 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.apiObj = this.$API.ecm.event.list;
this.getdutyAgg(); this.getdutyAgg();
}, },
@ -241,10 +206,10 @@ export default {
.card-body { .card-body {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-around;
height: 340px; height: 340px;
overflow-y: scroll; overflow-y: scroll;
padding-top: 10px; padding-top: 10px;
align-content:flex-start
} }
.workItemImg{ .workItemImg{

View File

@ -166,9 +166,11 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="上传证书"> <el-form-item label="上传证书">
<!-- <sc-upload v-model="form.file" :modelValue="form.file" title="证件图片" :width="300" :height="148"></sc-upload> -->
<sc-upload-file <sc-upload-file
v-model="form.file" v-model="form.file"
:multiple="false" :multiple="false"
:limit="1"
accept="image/png, image/jpeg, image/jpeg, pdf" accept="image/png, image/jpeg, image/jpeg, pdf"
> >
<el-button type="primary" icon="el-icon-upload" <el-button type="primary" icon="el-icon-upload"

View File

@ -69,24 +69,31 @@
<span v-if="scope.row.employee">{{scope.row.employee_.belong_dept_name}}</span> <span v-if="scope.row.employee">{{scope.row.employee_.belong_dept_name}}</span>
</template> </template>
</el-table-column> </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"> <el-table-column label="触发形式" prop="type">
<template #default="scope"> <template #default="scope">
{{trigger_[scope.row.trigger]}}-- {{trigger_[scope.row.trigger]}}--
<span v-if="scope.row.detail">{{scope.row.detail.deviceName}}</span> <span v-if="scope.row.detail">{{scope.row.detail.deviceName}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="体温(℃)"> <!-- <el-table-column label="体温(℃)">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.detail"> <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-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 v-else style="color:green;font-weight:bold">{{scope.row.detail.curTemp}}</span>
</span> </span>
</template> </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>
<el-table-column label="打卡时间" prop="create_time"></el-table-column> <el-table-column label="打卡时间" prop="create_time"></el-table-column>
</scTable> </scTable>
@ -96,6 +103,7 @@
<script> <script>
import config from "@/config" import config from "@/config"
import * as XLSX2 from "xlsx"; import * as XLSX2 from "xlsx";
import * as XLSX from "xlsx-style";
import { fill } from "lodash"; import { fill } from "lodash";
export default { export default {
name: "clock_record", name: "clock_record",
@ -111,7 +119,7 @@
selection: [], selection: [],
type_:{ type_:{
10: {"label": "上班打卡", "color": ""}, 10: {"label": "上班打卡", "color": ""},
20: {"label": "下班打卡", "color": "success"} 20: {"label": "下班打卡", "color": "success"},
}, },
epOptions:{ epOptions:{
"employee": "正式员工", "employee": "正式员工",
@ -119,7 +127,8 @@
}, },
trigger_:{ trigger_:{
"door": "门禁", "door": "门禁",
"location": "定位" "location": "定位",
"panel": "面板机"
}, },
excelName:'', excelName:'',
weekList : ['姓名','星期'], weekList : ['姓名','星期'],
@ -180,8 +189,6 @@
that.cLoading = false; that.cLoading = false;
that.ElLoading.close(); that.ElLoading.close();
let urls = config.API_URL.slice(0,-4)+res.path; let urls = config.API_URL.slice(0,-4)+res.path;
console.log(urls)
window.open(urls, "_blank"); window.open(urls, "_blank");
}).catch(e=>{ }).catch(e=>{
that.cLoading = false; that.cLoading = false;
@ -192,7 +199,7 @@
getOneData(id){ getOneData(id){
let that = this; let that = this;
return new Promise((resolve,reject)=>{ 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=>{ .then(res=>{
resolve(res.results) resolve(res.results)
}) })
@ -208,21 +215,20 @@
this.dLoading = false; this.dLoading = false;
return; return;
} }
let days = new Date(this.query.year, this.query.month , 0).getDate(); let days = new Date(this.query.year, this.query.month , 0).getDate();
let weekList = ['姓名','星期'],daysList=['姓名','日期'],titleData = []; let weekList = ['姓名','星期'],daysList=['姓名','日期'],titleData = [];
for(var i = 1;i<= days;i++){ for(var i = 1;i<= days;i++){
let weekNum = new Date(this.query.year+'-'+this.query.month+'-'+i).getDay(); let weekNum = new Date(this.query.year+'-'+this.query.month+'-'+i).getDay();
// debugger;
// console.log(weekNum)
let week=that.getDayWeek(weekNum) let week=that.getDayWeek(weekNum)
daysList.push(i); daysList.push(i);
weekList.push(week); weekList.push(week);
} }
let chartName = this.excelName+that.query.year+'年'+that.query.month+'月考勤统计表'; let chartName = this.excelName+that.query.year+'年'+that.query.month+'月考勤统计表';
titleData.push(chartName) let tipsData = ['','在岗时间长','在岗时间长','缺卡','缺卡','在岗时间短','在岗时间短','加班','加班'];
titleData.push(chartName);
let tableData = []; let tableData = [];
tableData.push(titleData) tableData.push(titleData)
tableData.push(tipsData)
tableData.push(weekList) tableData.push(weekList)
tableData.push(daysList) tableData.push(daysList)
that.ElLoading = this.$loading({ that.ElLoading = this.$loading({
@ -230,7 +236,7 @@
text: '数据请求中,请稍后...', text: '数据请求中,请稍后...',
background: 'rgba(0, 0, 0, 0)', 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=>{ .then(res=>{
let promiseList = []; let promiseList = [];
let rowData1 = [],rowData2=[]; let rowData1 = [],rowData2=[];
@ -253,9 +259,9 @@
let dateInd = new Date(recordList[j].create_time).getDate(); let dateInd = new Date(recordList[j].create_time).getDate();
let dateIndex = parseInt(dateInd); let dateIndex = parseInt(dateInd);
if(recordList[j].type==10){ 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{ }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); tableData.push(rowData1);
@ -263,36 +269,164 @@
} }
let ws = XLSX2.utils.aoa_to_sheet(tableData); let ws = XLSX2.utils.aoa_to_sheet(tableData);
let wb = XLSX2.utils.book_new(); let wb = XLSX2.utils.book_new();
// ws['!freeze'] = {
const font = { xSplit: "1", //
name: '宋体', ySplit: "1", //
sz: 12, topLeftCell: "B2", //
bold: true, state: "frozen"
color: { rgb: '00000000' },
} }
// for(let key in ws){
const alignment = { if(key.indexOf('!')!==0){
horizontal: 'center', if(key==='A1'){
vertical: 'center', 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 = { console.log(ws)
// font,
// alignment,
// }
// s start //r row 0 //c col 0 // s start //r row 0 //c col 0
let cNumber = daysList.length-1; 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 } }, 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 } }) merge.push({ s: { r: i, c: 0 }, e: { r: i+1, c: 0 } })
i++ i++
} }
ws['!merges'] = merge; 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:8})
closList.unshift({wch:15}) closList.unshift({wch:10})
ws['!cols'] = closList; 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.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 TableIOS
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.dLoading = false;
that.ElLoading.close(); that.ElLoading.close();
}); });
@ -301,6 +435,28 @@
that.ElLoading.close(); 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 || ''; // HTML5file:///
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){ getDayWeek(day){
switch(day){ switch(day){
case 0: case 0:
@ -344,3 +500,36 @@
}, },
}; };
</script> </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>

View File

@ -2,29 +2,109 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select v-model="query.type" placeholder="人员类型" @change="handleQuery" clearable style="margin-left: 2px"> <el-select
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> 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-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>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="query.search" placeholder="姓名/手机号" clearable @keyup.enter="handleQuery"></el-input> <el-input
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> 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>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe <scTable
@resetQuery="resetQuery"> 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 type="selection" width="50"></el-table-column> -->
<el-table-column label="#" type="index" width="50"></el-table-column> <el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="人员类型" prop="type" width="160"> <el-table-column label="人员类型" prop="type" width="160">
<template #default="scope"> <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>
<span>{{ userTypeOptions[scope.row.type] }}</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> </span>
</template> </template>
@ -38,28 +118,53 @@
<el-avatar :size="50" :src="scope.row.photo" shape="square" /> <el-avatar :size="50" :src="scope.row.photo" shape="square" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="手机号" prop="phone" width="120"></el-table-column> <el-table-column
<el-table-column label="部门" prop="belong_dept" width="280"> label="手机号"
prop="phone"
width="120"
></el-table-column>
<el-table-column
label="部门/单位"
prop="belong_dept"
width="180"
:show-overflow-tooltip="true"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.belong_dept_">{{ <span v-if="scope.row.belong_dept_">{{
scope.row.belong_dept_.name scope.row.belong_dept_.name
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="身份证号" prop="id_number" width="180"></el-table-column> <el-table-column
<el-table-column label="系统账号" prop="user" width="180"><template #default="scope"> label="身份证号"
<span v-if="scope.row.user">{{ prop="id_number"
scope.row.user_.username width="180"
}}</span> :show-overflow-tooltip="true"
</template></el-table-column> ></el-table-column>
<el-table-column label="定位卡号" prop="blt_" width="180"> <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"> <template #default="scope">
<span v-if="scope.row.blt_">{{ <div v-if="scope.row.blt_">
scope.row.blt_.code <div>{{ scope.row.blt_.code }}</div>
}}</span> <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> </template>
</el-table-column> </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"> <el-table-column label="操作" fixed="right" align="left" width="170">
<template #default="scope"> <template #default="scope">
<!-- <el-button <!-- <el-button
@ -70,25 +175,58 @@
v-auth="'employee.update'" v-auth="'employee.update'"
>证书 >证书
</el-button> --> </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>
<el-button link type="warning" size="small" v-auth="'employee.update'" <el-button
@click="handleForm('edit', scope.row)">编辑 link
type="warning"
size="small"
v-auth="'employee.update'"
@click="handleForm('edit', scope.row)"
>编辑
</el-button> </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>
<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> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </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> </save-dialog>
<ScBind v-if="showBindBlt" :bindBtl="bindBtl" :bindType="bindType" :bindName="bindName" :bindEmployee="bindEmployee" <ScBind
@closed="closed"></ScBind> v-if="showBindBlt"
:bindBtl="bindBtl"
:bindType="bindType"
:bindName="bindName"
:bindEmployee="bindEmployee"
@closed="closed"
></ScBind>
<!-- <el-Dialog <!-- <el-Dialog
title="绑定定位卡" title="绑定定位卡"
v-model="showBindBlt" v-model="showBindBlt"
@ -125,12 +263,12 @@
import saveDialog from "./ep_form.vue"; import saveDialog from "./ep_form.vue";
import ScBind from "@/components/scBind/index.vue"; import ScBind from "@/components/scBind/index.vue";
import { genTree } from "@/utils/verificate"; import { genTree } from "@/utils/verificate";
import config from "@/config"
export default { export default {
name: "employee", name: "employee",
components: { components: {
saveDialog, saveDialog,
ScBind ScBind,
}, },
data() { data() {
return { return {
@ -138,7 +276,7 @@ export default {
save: false, save: false,
permission: false, permission: false,
}, },
deptData:[], deptData: [],
apiObj: this.$API.hrm.employee.list, apiObj: this.$API.hrm.employee.list,
query: {}, query: {},
tdevice: [], tdevice: [],
@ -152,7 +290,7 @@ export default {
bindName: "", bindName: "",
bindType: 10, bindType: 10,
bindBtl: null, bindBtl: null,
bindEmployee: '', bindEmployee: "",
form: { form: {
type: 10, type: 10,
blt: "", blt: "",
@ -162,17 +300,27 @@ export default {
employee: "正式员工", employee: "正式员工",
remployee: "相关方", remployee: "相关方",
visitor: "访客", visitor: "访客",
driver: "货车司机" driver: "货车司机",
}, },
jobOptions: { jobOptions: {
10: "在职", 10: "在职",
20: "离职", 20: "离职",
30: "退休",
}, },
typeOptions: [ typeOptions: [
{ label: "正式员工", value: "employee" }, { label: "正式员工", value: "employee" },
{ label: "相关方", value: "remployee" }, { label: "相关方", value: "remployee" },
{ label: "访客", value: "visitor" }, { 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: { methods: {
async getDept() { 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); this.deptData = genTree(res);
}, },
// //
@ -260,7 +411,7 @@ export default {
loading.close(); loading.close();
this.$message.success("操作成功"); this.$message.success("操作成功");
}) })
.catch(() => { }); .catch(() => {});
}, },
// //
selectionChange(selection) { selectionChange(selection) {
@ -311,18 +462,21 @@ export default {
}, },
closed(data) { closed(data) {
this.showBindBlt = false; this.showBindBlt = false;
this.$refs.table.refresh();
}, },
getBltList() { getBltList() {
let that = this; let that = this;
that.$API.third.tdevice.list.req({ type: 30, page: 0, state: 'unused' }).then((res) => { that.$API.third.tdevice.list
that.tdevice = res; .req({ type: 30, page: 0, state: "unused" })
that.bltList = res.filter((item) => { .then((res) => {
return item.employee_ === null; 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) { handleBindBlt(type, row) {
// this.dis = false; // this.dis = false;
@ -338,13 +492,30 @@ export default {
submitBindBlt() { submitBindBlt() {
let that = this; let that = this;
that.$API.third.tdevice.bltBind.req(this.form).then((res) => { that.$API.third.tdevice.bltBind.req(this.form).then((res) => {
if (res.err_msg) { that.showBindBlt = false;
} else { 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> </script>

View File

@ -114,7 +114,7 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="签名"> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -39,7 +39,8 @@
</div> </div>
--> -->
<div class="login-oauth"> <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> <el-button type="primary" @click="MonitorOpen" style="background-color:orange;border-color:orange">监控视频</el-button>
</div> </div>
</div> </div>
@ -59,6 +60,11 @@
<sc-qr-code class="qrCode" :size="200" :text="appUrl"></sc-qr-code> <sc-qr-code class="qrCode" :size="200" :text="appUrl"></sc-qr-code>
</div> </div>
</el-dialog> </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> </template>
<script> <script>
@ -91,7 +97,9 @@ import passwordForm from './components/passwordForm'
showWechatLogin: false, showWechatLogin: false,
isWechatLoginResult: false, isWechatLoginResult: false,
showApp: 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:{ watch:{
@ -125,6 +133,9 @@ import passwordForm from './components/passwordForm'
appDown() { appDown() {
this.showApp = true; this.showApp = true;
}, },
h5Show() {
this.showH5 = true;
},
MonitorOpen(){ MonitorOpen(){
window.open('http://10.99.5.79:5515/') window.open('http://10.99.5.79:5515/')
}, },

View File

@ -164,12 +164,20 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button type="primary"
>下一步 :disabled="isSaving"
</el-button> :loading="isSaving"
plain @click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
@ -472,6 +480,7 @@
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
:disabled="tLoading"
@click="submitTicketCreate(item.id)" @click="submitTicketCreate(item.id)"
style="margin-right:4px" style="margin-right:4px"
>{{item.name}} >{{item.name}}
@ -523,12 +532,13 @@
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员", "气体检测记录"], stepTitle: ["基本信息", "作业人员", "气体检测记录"],
query: {}, query: {},
selection: [], selection: [],
issave: false, // isSaving: false, //
search: { search: {
keyword: null, keyword: null,
}, },
@ -600,6 +610,9 @@
measures_checked: [ measures_checked: [
{required: true, message: '请选择'} {required: true, message: '请选择'}
], ],
fileurl2:[
{required: true, message: '请选择'}
]
} }
}; };
}, },
@ -642,6 +655,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -692,47 +710,60 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// this.isSaving = true;
if(this.form.create_imgs.length>0){}else{
this.$message.error('请上传作业前照片');
return;
} //
if (this.oplId == "") { if (this.oplId == "") {
// //
debugger; // debugger;
this.form.cate = this.oplcateId; this.form.cate = this.oplcateId;
this.form.operation = this.operationId; this.form.operation = this.operationId;
console.log(this.form); console.log(this.form);
this.$API.opm.opl.create this.$API.opm.opl.create.req(this.form)
.req(this.form)
.then((res) => { .then((res) => {
this.$emit("success", this.form); this.$emit("success", this.form);
this.$message.success("创建成功"); this.$message.success("创建成功");
this.issave = true;
this.active = 1; this.active = 1;
this.isSaving = false;
this.oplId = res.id; this.oplId = res.id;
this.getworkerList(); this.getworkerList();
this.getgasList(); this.getgasList();
return res; return res;
}) })
.catch((err) => { .catch((err) => {
this.isSaving = false;
return err; return err;
}); });
} else if (this.oplId != "") { } else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => { this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!"); this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1; this.active = 1;
this.isSaving = false;
this.getgasList(); this.getgasList();
this.getworkerList(); this.getworkerList();
}); });
} else { } else {
this.active = 1; this.active = 1;
this.isSaving = false;
} }
} }
}) })
@ -866,9 +897,8 @@
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -876,6 +906,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -163,12 +163,21 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 :disabled="issaving"
</el-button> :loading="issaving"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
@ -522,12 +531,13 @@
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员", "气体检测记录"], stepTitle: ["基本信息", "作业人员", "气体检测记录"],
query: {}, query: {},
selection: [], selection: [],
issave: false, // issaving: false, //
search: { search: {
keyword: null, keyword: null,
}, },
@ -640,6 +650,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -690,50 +705,63 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
if (this.oplId == "") { this.$message.error('请上传作业前照片');
// return;
debugger; }
this.form.cate = this.oplcateId; this.issaving = true;
this.form.operation = this.operationId; //
console.log(this.form); if (this.oplId == "") {
this.$API.opm.opl.create //
.req(this.form) debugger;
.then((res) => { this.form.cate = this.oplcateId;
this.$emit("success", this.form); this.form.operation = this.operationId;
this.$message.success("创建成功"); console.log(this.form);
this.issave = true; this.$API.opm.opl.create
this.active = 1; .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 { } else {
if (this.active==1){ if (this.active==1){
if(this.apiworkerObj.length==0){ if(this.apiworkerObj.length==0){
@ -742,9 +770,7 @@
} }
} }
this.active = 2; this.active = 2;
} }
// this.stepSuc.push(++this.active)
}, },
// //
@ -864,9 +890,8 @@
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -874,6 +899,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -176,12 +176,20 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button type="primary" plain
>下一步 @click="handleNextStep"
</el-button> :disabled="issaving"
:loading="issaving"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
@ -481,6 +489,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" :loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -535,12 +544,13 @@
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员", "气体检测记录"], stepTitle: ["基本信息", "作业人员", "气体检测记录"],
query: {}, query: {},
selection: [], selection: [],
issave: false, // issaving: false, //
search: { search: {
keyword: null, keyword: null,
}, },
@ -653,6 +663,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -703,50 +718,62 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
if (this.oplId == "") { this.$message.error('请上传作业前照片');
// return;
debugger; }
this.form.cate = this.oplcateId; this.issaving = true; //
this.form.operation = this.operationId; if (this.oplId == "") {
console.log(this.form); //
this.$API.opm.opl.create this.form.cate = this.oplcateId;
.req(this.form) this.form.operation = this.operationId;
.then((res) => { console.log(this.form);
this.$emit("success", this.form); this.$API.opm.opl.create
this.$message.success("创建成功"); .req(this.form)
this.issave = true; .then((res) => {
this.active = 1; 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 { } else {
if (this.active==1){ if (this.active==1){
if(this.apiworkerObj.length==0){ if(this.apiworkerObj.length==0){
@ -755,9 +782,7 @@
} }
} }
this.active = 2; this.active = 2;
} }
// this.stepSuc.push(++this.active)
}, },
// //
@ -877,9 +902,8 @@
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -887,11 +911,11 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {
id: this.operationId,//ID id: this.operationId,//ID
}, },
}); });
} }

View File

@ -85,12 +85,12 @@
v-model="form.dept_do" v-model="form.dept_do"
:options="deptoptions" :options="deptoptions"
:props="{ :props="{
expandTrigger: 'hover', // expandTrigger: 'hover', //
label: 'label', // label: 'label', //
value: 'value', // value: 'value', //
emitPath: false, // false emitPath: false, // false
checkStrictly: true checkStrictly: true
}" }"
clearable clearable
/> />
</el-form-item> </el-form-item>
@ -172,12 +172,21 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 :loading="issave"
</el-button> :disabled="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
@ -306,6 +315,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" :loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -360,6 +370,7 @@
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员"], stepTitle: ["基本信息", "作业人员"],
@ -383,10 +394,10 @@
oplcateCode: "", oplcateCode: "",
oplId: "", oplId: "",
leveloptions: [ leveloptions: [
{ id: "特级", name: "特级>30米" }, { id: "特级:>30米", name: "特级:>30米" },
{ id: "三级", name: "三级:15-30米" }, { id: "三级:15-30米", name: "三级:15-30米" },
{ id: "二级", name: "二级>5-15米" }, { id: "二级:>5-15米", name: "二级:>5-15米" },
{ id: "一级", name: "一级:1.8-5米" }, { id: "一级:1.8-5米", name: "一级:1.8-5米" },
], ],
deptoptions: [], deptoptions: [],
useroptions: [], useroptions: [],
@ -479,6 +490,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -503,10 +519,8 @@
this.deptoptions = genTree(res); this.deptoptions = genTree(res);
}); });
}, },
// //
// //
//ID===> //ID===>
getOplcates() { getOplcates() {
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => { this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
@ -529,48 +543,60 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
if (this.oplId == "") { this.$message.error('请上传作业前照片');
// return;
debugger; }
this.form.cate = this.oplcateId; this.issave = true; //
this.form.operation = this.operationId; if (this.oplId == "") {
console.log(this.form); //
this.$API.opm.opl.create debugger;
.req(this.form) this.form.cate = this.oplcateId;
.then((res) => { this.form.operation = this.operationId;
this.$emit("success", this.form); console.log(this.form);
this.$message.success("创建成功"); this.$API.opm.opl.create
this.issave = true; .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.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList(); this.getgasList();
return res; this.getworkerList();
})
.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;
}
} }
}) })
} }
@ -690,17 +716,16 @@
//, //,
submitTicketCreate(id) { submitTicketCreate(id) {
if(this.apiworkerObj.length==0){ if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员"); this.$message.warning("请添加作业人员");
return return
} }
let ticket = {}; let ticket = {};
ticket.workflow = this.initForm.workflow; ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -708,6 +733,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -172,12 +172,21 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 :loading="issave"
</el-button> :disabled="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
@ -306,6 +315,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" :loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -360,6 +370,7 @@
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员"], stepTitle: ["基本信息", "作业人员"],
@ -478,6 +489,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -528,52 +544,65 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
if (this.oplId == "") { this.$message.error('请上传作业前照片');
// return;
debugger; }
this.form.cate = this.oplcateId; this.issave = true; //
this.form.operation = this.operationId; if (this.oplId == "") {
console.log(this.form); //
this.$API.opm.opl.create debugger;
.req(this.form) this.form.cate = this.oplcateId;
.then((res) => { this.form.operation = this.operationId;
this.$emit("success", this.form); console.log(this.form);
this.$message.success("创建成功"); this.$API.opm.opl.create
this.issave = true; .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.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList(); this.getgasList();
return res; this.getworkerList();
})
.catch((err) => {
return err;
}); });
} else if (this.oplId != "") { } else {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1; this.active = 1;
this.getgasList(); }
this.getworkerList();
});
} else {
this.active = 1;
}
} }
}) })
} }
// this.stepSuc.push(++this.active)
}, },
// //
@ -689,17 +718,16 @@
//, //,
submitTicketCreate(id) { submitTicketCreate(id) {
if(this.apiworkerObj.length==0){ if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员"); this.$message.warning("请添加作业人员");
return return
} }
let ticket = {}; let ticket = {};
ticket.workflow = this.initForm.workflow; ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -707,6 +735,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -72,12 +72,12 @@
v-model="form.dept_do" v-model="form.dept_do"
:options="deptoptions" :options="deptoptions"
:props="{ :props="{
expandTrigger: 'hover', // expandTrigger: 'hover', //
label: 'label', // label: 'label', //
value: 'value', // value: 'value', //
emitPath: false, // false emitPath: false, // false
checkStrictly: true checkStrictly: true
}" }"
clearable clearable
/> />
</el-form-item> </el-form-item>
@ -89,14 +89,6 @@
style="width:200px" style="width:200px"
disabled disabled
></el-input> ></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"/> <ehsUserSelect :multiple="false" @submit="getCharger"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -145,15 +137,23 @@
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 :disabled="issave"
</el-button> :loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
<!--作业人员!--> <!--作业人员!-->
<el-main class="nopadding" v-show="active === 1"> <el-main class="nopadding" v-show="active === 1">
<div class="left-panel" style="margin: 10px"> <div class="left-panel" style="margin: 10px">
@ -279,6 +279,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" :loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -324,15 +325,16 @@
opl: "", opl: "",
}; };
const defaultformgas = { const defaultformgas = {
id: "", id: "",
check_time: null, check_time: null,
opl:"" opl:""
}; };
export default { export default {
name: "fire", name: "fire",
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员"], stepTitle: ["基本信息", "作业人员"],
@ -349,16 +351,19 @@
operation: "", operation: "",
cate: "", cate: "",
risks_checked: [], risks_checked: [],
create_imgs:[],
}, },
create_imgs:[],
imgList:[],
initForm: {}, initForm: {},
operationId: "", operationId: "",
oplcateId: "", oplcateId: "",
oplcateCode: "", oplcateCode: "",
oplId: "", oplId: "",
leveloptions: [ leveloptions: [
{ id: "主干道", name: "主干道" }, { id: "主干道", name: "主干道" },
{ id: "次干渠", name: "次干渠" } { id: "次干渠", name: "次干渠" }
], ],
deptoptions: [], deptoptions: [],
useroptions: [], useroptions: [],
risklist: [], risklist: [],
@ -418,6 +423,21 @@
// this.getUser(); // this.getUser();
}, },
methods: { 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) { getCharger(data) {
this.form.charger=data.id; this.form.charger=data.id;
this.form.charger_name=data.name this.form.charger_name=data.name
@ -447,6 +467,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -497,48 +522,66 @@
this.active = 0; 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() { handleNextStep() {
// debugger;
console.log(this.form.create_imgs);
// return;
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
if (this.oplId == "") { this.$message.error('请上传作业前照片');
// return;
debugger; }
this.form.cate = this.oplcateId; this.issave = true;
this.form.operation = this.operationId; //
console.log(this.form); if (this.oplId == "") {
this.$API.opm.opl.create //
.req(this.form) // debugger;
.then((res) => { this.form.cate = this.oplcateId;
this.$emit("success", this.form); this.form.operation = this.operationId;
this.$message.success("创建成功"); console.log(this.form);
this.issave = true; 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.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList(); this.getgasList();
return res; this.getworkerList();
})
.catch((err) => {
return err;
}); });
} else if (this.oplId != "") { } else {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1; this.active = 1;
this.getgasList(); this.issave = false;
this.getworkerList(); }
});
} else {
this.active = 1;
}
} }
}) })
} }
@ -658,17 +701,16 @@
//, //,
submitTicketCreate(id) { submitTicketCreate(id) {
if(this.apiworkerObj.length==0){ if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员"); this.$message.warning("请添加作业人员");
return return
} }
let ticket = {}; let ticket = {};
ticket.workflow = this.initForm.workflow; ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -676,6 +718,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -92,19 +92,19 @@
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time" width="150"></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"> ><template #default="scope">
{{ scope.row.area_.name }} {{ scope.row.area_.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计开始" prop="start_time" width="150"></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="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"> ><template #default="scope">
{{ scope.row.dept_ter_.name }} {{ scope.row.dept_ter_.name }}
</template></el-table-column </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"> ><template #default="scope">
{{ scope.row.dept_bus_.name }} {{ scope.row.dept_bus_.name }}
</template></el-table-column </template></el-table-column
@ -132,7 +132,7 @@
>查看 >查看
</el-button> </el-button>
<el-button <el-button
v-if="scope.row.state === 10" v-if="scope.row.state!==50"
link link
type="warning" type="warning"
size="small" size="small"

View File

@ -18,32 +18,35 @@
<el-row> <el-row>
<el-col :md="24" :sm="12" :xs="24"> <el-col :md="24" :sm="12" :xs="24">
<el-form-item label="作业简介" prop="name"> <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-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="开始时间" prop="start_time"> <el-form-item label="开始时间" prop="start_time">
<el-date-picker <el-date-picker
:disabled="mode == 'edit'"
v-model="form.start_time" v-model="form.start_time"
type="datetime" type="datetime"
placeholder="选择开始时间" placeholder="选择开始时间"
:default-time="defaultTime_start"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="结束时间" prop="end_time"> <el-form-item label="结束时间" prop="end_time">
<el-date-picker <el-date-picker
:disabled="mode == 'edit'"
v-model="form.end_time" v-model="form.end_time"
type="datetime" type="datetime"
placeholder="选择结束时间" placeholder="选择结束时间"
:default-time="defaultTime"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="生产状态" prop="state_work"> <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 <el-option
v-for="item in stateoptions" v-for="item in stateoptions"
:key="item.id" :key="item.id"
@ -55,7 +58,7 @@
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="作业区域" prop="area"> <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 <el-option
v-for="item in areaoptions" v-for="item in areaoptions"
:key="item.id" :key="item.id"
@ -65,12 +68,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-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-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="业务部门" prop="dept_bus"> <el-form-item label="业务部门" prop="dept_bus">
<el-cascader <el-cascader
@ -89,15 +91,14 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
<el-form-item label="部门协调员" prop="coordinator"> <el-form-item label="部门协调员" prop="coordinator">
<el-input <el-input
v-model="form.coordinator_name" v-model="form.coordinator_name"
disabled disabled
style="width:200px" style="width:220px"
></el-input> ></el-input>
<ehsUserSelect :multiple="false" @submit="getUser"/> <ehsUserSelect :multiple="false" @submit="getUser" v-if="mode == 'add'"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" :xs="24"> <el-col :md="12" :sm="24" :xs="24">
@ -138,9 +139,7 @@
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit" <el-button type="primary" :disabled="isSaveing" :loading="isSaveing" @click="submit" v-if="mode!=='show'">保存</el-button>
>保存</el-button
>
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
</el-container> </el-container>
@ -160,6 +159,8 @@ export default {
edit: "编辑", edit: "编辑",
show: "查看", show: "查看",
}, },
defaultTime_start:new Date(2000, 1, 1, 10, 0, 0),
defaultTime:new Date(2000, 1, 1, 18, 0, 0),
form: {}, form: {},
rules: { rules: {
name: [{ required: true, message: "请输入作业简介" }], name: [{ required: true, message: "请输入作业简介" }],
@ -194,9 +195,8 @@ export default {
methods: { methods: {
//, //,
getDept() { 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); this.deptoptions = genTree(res);
}); });
}, },
@ -245,14 +245,22 @@ export default {
res = await this.$API.opm.operation.create.req(this.form); res = await this.$API.opm.operation.create.req(this.form);
this.form.id = res.id; this.form.id = res.id;
} else if (this.mode == "edit") { } 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.id,
this.form form
); );
} }
this.visible = false;
this.isSaveing = false; this.isSaveing = false;
this.$emit("success", this.form, this.mode); this.$emit("success", this.form, this.mode);
this.visible = false; console.log(res)
this.$message.success("操作成功"); this.$message.success("操作成功");
return res; return res;
} catch (err) { } catch (err) {

View File

@ -77,17 +77,17 @@
<el-table-column label="操作" fixed="right" width="100"> <el-table-column label="操作" fixed="right" width="100">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看 <el-button v-if="scope.row.ticket == null" link type="warning" size="small" v-auth="'opl.update'"
</el-button>
<el-button v-if="operationObj.state === 10" link type="warning" size="small" v-auth="'opl.update'"
@click="table_edit(scope.row, scope.$index)">编辑 @click="table_edit(scope.row, scope.$index)">编辑
</el-button> </el-button>
<el-button link type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-card> </el-card>
<el-drawer :size="'50%'" v-model="showLimited" :title="oplName + '作业许可证详情'"> <el-drawer :size="'50%'" v-model="showLimited" class="scOplDrawer" :show-close="showClose" id="scOplDrawer">
<sc-fire :id="oplId"></sc-fire> <sc-fire :id="oplId" :wfId="operationId"></sc-fire>
</el-drawer> </el-drawer>
</el-main> </el-main>
</template> </template>
@ -103,6 +103,7 @@ export default {
save: false, save: false,
permission: false, permission: false,
}, },
showClose:false,
mainLoading: false, mainLoading: false,
apiObj: [], apiObj: [],
query: {}, query: {},
@ -114,6 +115,7 @@ export default {
operationObj: {}, operationObj: {},
showLimited: false, showLimited: false,
oplId: "", oplId: "",
operationId: "",
state_: { state_: {
10: "创建中", 10: "创建中",
20: "审批中", 20: "审批中",
@ -133,6 +135,7 @@ export default {
}, },
mounted() { mounted() {
this.operationId = this.$route.query.id;
this.getoplcate(); this.getoplcate();
this.getopllist(); this.getopllist();
this.getOperation(); this.getOperation();
@ -278,3 +281,11 @@ export default {
}, },
}; };
</script> </script>
<style>
.scOplDrawer{
width: 50%;
}
#scOplDrawer{
width: 50%;
}
</style>

View File

@ -64,19 +64,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </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-col :md="12" :sm="12" :xs="24" >
<el-form-item label="作业部门" prop="dept_do"> <el-form-item label="作业部门" prop="dept_do">
<el-cascader <el-cascader
@ -85,12 +72,12 @@
v-model="form.dept_do" v-model="form.dept_do"
:options="deptoptions" :options="deptoptions"
:props="{ :props="{
expandTrigger: 'hover', // expandTrigger: 'hover', //
label: 'label', // label: 'label', //
value: 'value', // value: 'value', //
emitPath: false, // false emitPath: false, // false
checkStrictly: true checkStrictly: true
}" }"
clearable clearable
/> />
</el-form-item> </el-form-item>
@ -174,15 +161,23 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 v-preventReClick
</el-button> :loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
<!--作业人员!--> <!--作业人员!-->
<el-main class="nopadding" v-show="active === 1"> <el-main class="nopadding" v-show="active === 1">
<div class="left-panel" style="margin: 10px"> <div class="left-panel" style="margin: 10px">
@ -308,6 +303,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" :loading="tLoading"
v-preventReClick
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -362,6 +358,7 @@
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员"], stepTitle: ["基本信息", "作业人员"],
@ -384,12 +381,6 @@
oplcateId: "", oplcateId: "",
oplcateCode: "", oplcateCode: "",
oplId: "", oplId: "",
leveloptions: [
{ id: "特级", name: "特级:>30米" },
{ id: "三级", name: "三级:15-30米" },
{ id: "二级", name: "二级:>5-15米" },
{ id: "一级", name: "一级:1.8-5米" },
],
deptoptions: [], deptoptions: [],
useroptions: [], useroptions: [],
risklist: [], risklist: [],
@ -481,6 +472,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -531,48 +527,62 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
if (this.oplId == "") { this.$message.error('请上传作业前照片');
// return;
debugger; }
this.form.cate = this.oplcateId; this.issave = true; //
this.form.operation = this.operationId; if (this.oplId == "") {
console.log(this.form); //
this.$API.opm.opl.create this.form.cate = this.oplcateId;
.req(this.form) this.form.operation = this.operationId;
.then((res) => { console.log(this.form);
this.$emit("success", this.form); this.$API.opm.opl.create
this.$message.success("创建成功"); .req(this.form)
this.issave = true; .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.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList(); this.getgasList();
return res; this.getworkerList();
})
.catch((err) => {
return err;
}); });
} else if (this.oplId != "") { } else {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1; this.active = 1;
this.getgasList(); this.issave = false;
this.getworkerList(); }
});
} else {
this.active = 1;
}
} }
}) })
} }
@ -692,9 +702,9 @@
//, //,
submitTicketCreate(id) { submitTicketCreate(id) {
if(this.apiworkerObj.length==0){ if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员"); this.$message.warning("请添加作业人员");
return return
} }
let ticket = {}; let ticket = {};
ticket.workflow = this.initForm.workflow; ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
@ -702,7 +712,6 @@
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -710,6 +719,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -85,12 +85,12 @@
v-model="form.dept_do" v-model="form.dept_do"
:options="deptoptions" :options="deptoptions"
:props="{ :props="{
expandTrigger: 'hover', // expandTrigger: 'hover', //
label: 'label', // label: 'label', //
value: 'value', // value: 'value', //
emitPath: false, // false emitPath: false, // false
checkStrictly: true checkStrictly: true
}" }"
clearable clearable
/> />
</el-form-item> </el-form-item>
@ -161,10 +161,10 @@
<el-col :md="24" :sm="12" :xs="24"> <el-col :md="24" :sm="12" :xs="24">
<el-card header="应急处置"> <el-card header="应急处置">
<div class="content"> <div class="content">
<p>1管线被破坏时,应立即停止作业并报告相关部门现场设置紧急隔离线保护现场等待抢修</p> <p>1管线被破坏时,应立即停止作业并报告相关部门现场设置紧急隔离线保护现场等待抢修</p>
<p>2发生人员受伤时应立即组织救援救援过程中应避免二次伤害根据伤情送医或拨打120</p> <p>2发生人员受伤时应立即组织救援救援过程中应避免二次伤害根据伤情送医或拨打120</p>
</div> </div>
</el-card> </el-card>
<el-form-item label="其他应急处置"> <el-form-item label="其他应急处置">
<el-input <el-input
@ -174,12 +174,21 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 :disabled="issave"
</el-button> :loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
@ -308,6 +317,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" :loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -353,15 +363,16 @@
opl: "", opl: "",
}; };
const defaultformgas = { const defaultformgas = {
id: "", id: "",
check_time: null, check_time: null,
opl:"" opl:""
}; };
export default { export default {
name: "fire", name: "fire",
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员"], stepTitle: ["基本信息", "作业人员"],
@ -385,9 +396,9 @@
oplcateCode: "", oplcateCode: "",
oplId: "", oplId: "",
leveloptions: [ leveloptions: [
{ id: "主干道", name: "主干道" }, { id: "主干道", name: "主干道" },
{ id: "次干渠", name: "次干渠" } { id: "次干渠", name: "次干渠" }
], ],
deptoptions: [], deptoptions: [],
useroptions: [], useroptions: [],
risklist: [], risklist: [],
@ -479,6 +490,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -529,46 +545,65 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
this.$message.error('请上传作业前照片');
return;
}
this.issave = true; //
if (this.oplId == "") { if (this.oplId == "") {
// //
debugger; // debugger;
this.form.cate = this.oplcateId; this.form.cate = this.oplcateId;
this.form.operation = this.operationId; this.form.operation = this.operationId;
console.log(this.form); // console.log(this.form);
this.$API.opm.opl.create this.$API.opm.opl.create
.req(this.form) .req(this.form)
.then((res) => { .then((res) => {
this.$emit("success", this.form); this.$emit("success", this.form);
this.$message.success("创建成功"); this.$message.success("创建成功");
this.issave = true;
this.active = 1; this.active = 1;
this.issave = false;
this.oplId = res.id; this.oplId = res.id;
this.getworkerList(); this.getworkerList();
this.getgasList(); this.getgasList();
return res; return res;
}) })
.catch((err) => { .catch((err) => {
this.issave = false
return err; return err;
}); });
} else if (this.oplId != "") { } else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => { this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!"); this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1; this.active = 1;
this.issave = false;
this.getgasList(); this.getgasList();
this.getworkerList(); this.getworkerList();
}); });
} else { } else {
this.issave = false;
this.active = 1; this.active = 1;
} }
} }
@ -591,7 +626,7 @@
getworkerList() { getworkerList() {
this.$API.opm.worker.list.req({opl: this.oplId, page: 0}).then((res) => { this.$API.opm.worker.list.req({opl: this.oplId, page: 0}).then((res) => {
this.apiworkerObj = res; this.apiworkerObj = res;
console.log(res); // console.log(res);
}); });
}, },
//Form //Form
@ -690,17 +725,16 @@
//, //,
submitTicketCreate(id) { submitTicketCreate(id) {
if(this.apiworkerObj.length==0){ if(this.apiworkerObj.length==0){
this.$message.warning("请添加作业人员"); this.$message.warning("请添加作业人员");
return return
} }
let ticket = {}; let ticket = {};
ticket.workflow = this.initForm.workflow; ticket.workflow = this.initForm.workflow;
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -708,6 +742,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -179,12 +179,21 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 :disabled="issave"
</el-button> :loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
@ -484,6 +493,7 @@
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" :loading="tLoading"
:disabled="tLoading"
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -614,7 +624,8 @@
measures_checked: [ measures_checked: [
{required: true, message: '请选择'} {required: true, message: '请选择'}
], ],
} },
fileurl2: "",
}; };
}, },
mounted() { mounted() {
@ -656,6 +667,11 @@
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplId = res.id;
this.oplcateId = res.cate; this.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
@ -706,13 +722,33 @@
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
if (valid) { if (valid) {
// if(this.form.create_imgs.length>0){}else{
this.$message.error('请上传作业前照片');
return;
}
this.issave = true; //
if (this.oplId == "") { if (this.oplId == "") {
// //
debugger; debugger;
@ -724,28 +760,27 @@
.then((res) => { .then((res) => {
this.$emit("success", this.form); this.$emit("success", this.form);
this.$message.success("创建成功"); this.$message.success("创建成功");
this.issave = true;
this.active = 1; this.active = 1;
this.issave = false;
this.oplId = res.id; this.oplId = res.id;
this.getworkerList(); this.getworkerList();
this.getgasList(); this.getgasList();
return res; return res;
}) })
.catch((err) => { .catch((err) => {
this.issave = false;
return err; return err;
}); });
} else if (this.oplId != "") { } else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => { this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!"); this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1; this.active = 1;
this.issave = false;
this.getgasList(); this.getgasList();
this.getworkerList(); this.getworkerList();
}); });
} else { } else {
this.issave = false;
this.active = 1; this.active = 1;
} }
} }
@ -758,7 +793,6 @@
} }
} }
this.active = 2; this.active = 2;
} }
// this.stepSuc.push(++this.active) // this.stepSuc.push(++this.active)
}, },
@ -880,9 +914,8 @@
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true this.tLoading = true;
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});
@ -890,6 +923,7 @@
//退 //退
submitOut() { submitOut() {
this.tLoading = false;
this.$router.push({ this.$router.push({
name: "opl", name: "opl",
query: { query: {

View File

@ -64,8 +64,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="作业部门" prop="dept_do"> <el-form-item label="作业部门" prop="dept_do">
<el-cascader <el-cascader
@ -84,21 +82,27 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="作业监护人" prop="monitor"> <el-form-item label="作业负责人" prop="charger">
<el-select v-model="form.monitor" placeholder="选择作业监护人"> <el-input
<el-option v-model="form.charger_name"
v-for="item in useroptions" style="width:200px"
:key="item.id" disabled
:label="item.name" ></el-input>
:value="item.id" <ehsUserSelect :multiple="false" @submit="getCharger"/>
/> </el-form-item>
</el-select> </el-col>
</el-form-item> <el-col :md="12" :sm="12" :xs="24">
</el-col> <el-form-item label="作业监护人" prop="monitor">
<el-col :md="12" :sm="12" :xs="24"> <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-form-item label="供电制式" >
<el-select v-model="form.level" placeholder="选择供电制式"> <el-select v-model="form.level" placeholder="选择供电制式">
<el-option <el-option
@ -115,12 +119,7 @@
<el-input-number v-model="form.power_days" type="text" clearable></el-input-number> <el-input-number v-model="form.power_days" type="text" clearable></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :md="12" :sm="12" :xs="24">
临时用电 !-->
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="工作类型"> <el-form-item label="工作类型">
<el-select v-model="form.work_type" placeholder="选择工作类型"> <el-select v-model="form.work_type" placeholder="选择工作类型">
<el-option <el-option
@ -130,7 +129,6 @@
:value="item.name" :value="item.name"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
@ -140,13 +138,10 @@
type="datetime" type="datetime"
placeholder="选择开始时间" placeholder="选择开始时间"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="验收时间"> <el-form-item label="验收时间">
<el-date-picker <el-date-picker
v-model="form.accept_time" v-model="form.accept_time"
type="datetime" type="datetime"
@ -164,7 +159,6 @@
<el-input v-model="form.power_to" type="text" clearable></el-input> <el-input v-model="form.power_to" type="text" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
<el-form-item label="用电开始"> <el-form-item label="用电开始">
<el-date-picker <el-date-picker
@ -172,7 +166,6 @@
type="datetime" type="datetime"
placeholder="选择开始时间" placeholder="选择开始时间"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <el-col :md="12" :sm="12" :xs="24">
@ -182,7 +175,6 @@
type="datetime" type="datetime"
placeholder="选择开始时间" placeholder="选择开始时间"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="12" :xs="24"> <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-input v-model="form.power_from" type="text" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="24" :sm="12" :xs="24"> <el-col :md="24" :sm="12" :xs="24">
<el-form-item label="风险选择"> <el-form-item label="风险选择">
<el-checkbox-group v-model="form.risks_checked"> <el-checkbox-group v-model="form.risks_checked">
@ -212,14 +203,6 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-col :md="24" :sm="12" :xs="24">
<el-form-item label="措施选择"> <el-form-item label="措施选择">
<el-checkbox-group v-model="form.measures_checked"> <el-checkbox-group v-model="form.measures_checked">
@ -232,16 +215,13 @@
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="24" :sm="12" :xs="24"> <el-col :md="24" :sm="12" :xs="24">
<el-card class="box-card"> <el-card class="box-card">
<div class="clearfix"> <div class="clearfix">
<span>应急处置</span> <span>应急处置</span>
</div> </div>
<div class="content"> <div class="content">
<p>发生人员触电事故应迅速切断电源或采用绝缘工器具使触电者脱离电源判断触电者无意识或心跳呼吸已停止时应立即报告并由经过专业训练或具备相应能力的人员对触电者进行心肺复苏术直至专业医务人员赶到现场为止 <p>发生人员触电事故应迅速切断电源或采用绝缘工器具使触电者脱离电源判断触电者无意识或心跳呼吸已停止时应立即报告并由经过专业训练或具备相应能力的人员对触电者进行心肺复苏术直至专业医务人员赶到现场为止其他应急处置</p>
其他应急处置
</p>
</div> </div>
</el-card> </el-card>
<el-form-item label="其他应急处置"> <el-form-item label="其他应急处置">
@ -252,23 +232,22 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </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-col :md="12" :sm="12" :xs="24"> <el-form-item label="作业前照片">
<el-form-item label="作业审批照片"> <sc-upload-multiple v-model="fileurl2" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
<el-input v-model="create_imgs" type="text" clearable></el-input> </el-form-item>
</el-form-item> </el-col>
</el-col>
!-->
</el-row> </el-row>
</el-form> </el-form>
<div style="margin-bottom: 20px; text-align:center"> <div style="margin-bottom: 20px; text-align:center">
<el-button type="primary" plain @click="handleNextStep" <el-button
>下一步 v-preventReClick
</el-button> type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div> </div>
</el-main> </el-main>
<!--作业人员!--> <!--作业人员!-->
<el-main class="nopadding" v-show="active === 1"> <el-main class="nopadding" v-show="active === 1">
<div class="left-panel" style="margin: 10px"> <div class="left-panel" style="margin: 10px">
@ -338,19 +317,13 @@
<el-row> <el-row>
<el-col :md="24" :sm="12" :xs="24"> <el-col :md="24" :sm="12" :xs="24">
<el-form-item label="作业人员"> <el-form-item label="作业人员">
<el-select <el-input
v-model="formworker.worker" v-model="formworker.worker_name"
@change="selectWorker" style="width:200px"
placeholder="选择作业人员" disabled
> ></el-input>
<el-option <ehsUserSelect :multiple="false" @submit="getWorker"/>
v-for="item in useroptions" </el-form-item>
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col> </el-col>
<el-col :md="24" :sm="12" :xs="24"> <el-col :md="24" :sm="12" :xs="24">
<el-form-item label="工作职责"> <el-form-item label="工作职责">
@ -396,7 +369,7 @@
<div style="margin-top:20px;text-align:center"> <div style="margin-top:20px;text-align:center">
<el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right:4px">上一步</el-button>
<el-button <el-button
:loading="tLoading" v-preventReClick
v-for=" item in initForm.transitions" v-for=" item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
@ -405,12 +378,8 @@
>{{item.name}} >{{item.name}}
</el-button> </el-button>
<el-button @click="submitOut" type="warning">退出</el-button> <el-button @click="submitOut" type="warning">退出</el-button>
</div> </div>
</el-main> </el-main>
</el-container> </el-container>
</template> </template>
<style scoped> <style scoped>
@ -450,7 +419,7 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
fileurl2: "",
active: 0, active: 0,
stepSuc: [0], stepSuc: [0],
stepTitle: ["基本信息", "作业人员"], stepTitle: ["基本信息", "作业人员"],
@ -539,8 +508,14 @@ export default {
this.getDept(); this.getDept();
}, },
methods: { 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() { getoplData() {
if (this.oplId == "") { if (this.oplId == "") {
this.getOperation(); this.getOperation();
@ -553,7 +528,11 @@ export default {
getData() { getData() {
this.$API.opm.opl.read.req(this.oplId).then((res) => { this.$API.opm.opl.read.req(this.oplId).then((res) => {
this.form = 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.oplcateId = res.cate;
this.operationId = res.operation; this.operationId = res.operation;
this.getOperation(); this.getOperation();
@ -584,7 +563,7 @@ export default {
}); });
}, },
// //
//ID //ID
getOplcates() { getOplcates() {
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => { this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
@ -606,14 +585,28 @@ export default {
this.active = 0; 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() { handleNextStep() {
if (this.active == 0) { if (this.active == 0) {
// console.log(this.oplId); if(this.form.create_imgs.length>0){}else{
this.$message.error('请上传作业前照片');
return;
}
// //
if (this.oplId == "") { if (this.oplId == "") {
// //
debugger;
this.form.cate = this.oplcateId; this.form.cate = this.oplcateId;
this.form.operation = this.operationId; this.form.operation = this.operationId;
console.log(this.form); console.log(this.form);
@ -622,24 +615,18 @@ export default {
.then((res) => { .then((res) => {
this.$emit("success", this.form); this.$emit("success", this.form);
this.$message.success("创建成功"); this.$message.success("创建成功");
this.issave = true;
this.active = 1; this.active = 1;
this.oplId = res.id; this.oplId = res.id;
this.getworkerList(res.id); this.getworkerList(res.id);
return res; return res;
}) })
.catch((err) => { .catch((err) => {
return err; return err;
}); });
} else if (this.oplId != "") { } else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => { this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!"); this.$message.success("基本修改成功!");
this.issave = true;
this.active = 1; this.active = 1;
this.getworkerList(this.oplId); this.getworkerList(this.oplId);
}); });
@ -649,7 +636,11 @@ export default {
} }
// this.stepSuc.push(++this.active) // this.stepSuc.push(++this.active)
}, },
getWorker(data) {
this.formworker.worker=data.id,
this.formworker.worker_name=data.name
this.selectWorker()
},
// //
selectWorker() { selectWorker() {
this.$API.hrm.certificate.list this.$API.hrm.certificate.list
@ -719,9 +710,7 @@ export default {
ticket.ticket_data = {opl: this.oplId}; ticket.ticket_data = {opl: this.oplId};
ticket.transition = id; ticket.transition = id;
ticket.title = this.form.name + '-申请'; ticket.title = this.form.name + '-申请';
this.tLoading = true
this.$API.wf.ticket.create.req(ticket).then((res) => { this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading = false
this.$message.success("提交成功"); this.$message.success("提交成功");
this.submitOut() this.submitOut()
}).catch(e=>{this.tLoading=false}); }).catch(e=>{this.tLoading=false});

168
src/views/rpm/blacklist.vue Normal file
View File

@ -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>

View File

@ -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>

View File

@ -100,7 +100,7 @@
</el-main> </el-main>
</el-container> </el-container>
<sc-dialog v-model="dialogcart" draggable title="创建人员证书"> <sc-dialog v-model="dialogcart" draggable title="创建/编辑人员证书">
<el-form <el-form
ref="dialogForm" ref="dialogForm"
:model="form" :model="form"
@ -127,7 +127,6 @@
v-model="form.name" v-model="form.name"
placeholder="请输入证书名称" placeholder="请输入证书名称"
clearable clearable
:disabled="mode != 'add'"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -137,13 +136,12 @@
v-model="form.number" v-model="form.number"
placeholder="请输入证书编号" placeholder="请输入证书编号"
clearable clearable
:disabled="mode != 'add'"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="证书类型" prop="type"> <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 <el-option
v-for="item in typeoptions" v-for="item in typeoptions"
:key="item.id" :key="item.id"
@ -189,6 +187,7 @@
<sc-upload-file <sc-upload-file
v-model="form.file" v-model="form.file"
:multiple="false" :multiple="false"
:limit="1"
accept="image/png, image/jpeg, image/jpeg, pdf" accept="image/png, image/jpeg, image/jpeg, pdf"
> >
<el-button type="primary" icon="el-icon-upload">上传</el-button> <el-button type="primary" icon="el-icon-upload">上传</el-button>

View File

@ -17,7 +17,7 @@
> >
<el-row> <el-row>
<el-col :md="8" :sm="12" :xs="24"> <el-col :md="8" :sm="12" :xs="24">
<el-form-item label="公司名称"> <el-form-item label="公司名称" prop="name">
<el-input <el-input
v-model="form.name" v-model="form.name"
type="text" type="text"
@ -27,7 +27,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :sm="12" :xs="24"> <el-col :md="8" :sm="12" :xs="24">
<el-form-item label="信用代码"> <el-form-item label="信用代码" prop="number">
<el-input <el-input
v-model="form.number" v-model="form.number"
type="text" type="text"
@ -41,7 +41,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :sm="12" :xs="24"> <el-col :md="8" :sm="12" :xs="24">
<el-form-item label="联系人"> <el-form-item label="联系人" prop="contacter">
<el-input <el-input
v-model="form.contacter" v-model="form.contacter"
type="text" type="text"
@ -50,7 +50,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :sm="12" :xs="24"> <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-input v-model="form.phone" type="text" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -118,7 +118,12 @@ export default {
show: "查看", show: "查看",
}, },
form: {}, form: {},
rules: {}, rules: {
name: [{ required: true, message: "请输入" }],
number: [{ required: true, message: "请输入" }],
contacter: [{ required: true, message: "请输入" }],
phone: [{ required: true, message: "请输入" }],
},
visible: false, visible: false,
isSaveing: false, isSaveing: false,
selectionFilters: [], selectionFilters: [],

View File

@ -100,7 +100,7 @@
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit" <el-button type="primary" :loading="isSaveing" :disabled="isSaveing" @click="submit"
>保存 >保存
</el-button </el-button
> >
@ -191,9 +191,9 @@
} else if (this.mode == "edit") { } else if (this.mode == "edit") {
res = await this.$API.rpm.rpj.update.req(this.form.id, this.form); res = await this.$API.rpm.rpj.update.req(this.form.id, this.form);
} }
this.visible = false;
this.isSaveing = false; this.isSaveing = false;
this.$emit("success", this.form, this.mode); this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功"); this.$message.success("操作成功");
return res; return res;
} catch (err) { } catch (err) {

View File

@ -9,11 +9,15 @@
<el-descriptions-item label="项目类型:">{{ types_[form.type] }}</el-descriptions-item> <el-descriptions-item label="项目类型:">{{ types_[form.type] }}</el-descriptions-item>
<el-descriptions-item label="合同编号:">{{ form.contract_number }}</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="状态:">{{ 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.leave_time }}</el-descriptions-item>
<el-descriptions-item label="所属部门:">{{ form.belong_dept_name }}</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-item label="相关方:">{{ form.rparty_name }}</el-descriptions-item>
</el-descriptions> </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>
<el-card style="margin-top:8px" shadow="hover"> <el-card style="margin-top:8px" shadow="hover">
<scTable ref="fileTable" :data="rpjFileList" row-key="id" hidePagination stripe hideDo <scTable ref="fileTable" :data="rpjFileList" row-key="id" hidePagination stripe hideDo
@ -37,41 +41,158 @@
<el-card style="margin-top:8px" shadow="hover"> <el-card style="margin-top:8px" shadow="hover">
<scTable ref="table" :data="memeberList" row-key="id" height='auto' stripe hideDo hidePagination> <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="#" 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"> <template #default="scope">
{{ scope.row.remployee_.name }} {{ scope.row.remployee_.name }}
</template> </template>
</el-table-column> </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"> <el-table-column label="证书" prop="rcertificates">
<template #default="scope"> <template #default="scope">
<el-tag v-for="item in scope.row.rcertificates_" :key="item.number" :label="item.name" <span v-for="cer in scope.row.rcertificates_" :key="cer.id">{{cer.name}}-{{cer.number}}/</span>
:value="item.number">{{ item.name }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否负责人" prop="is_manager"> <el-table-column label="负责人" prop="is_manager" width="80">
<template #default="scope"> <template #default="scope">
<el-space v-if="scope.row.is_manager === true"></el-space> <el-space v-if="scope.row.is_manager === true"></el-space>
<el-space v-else></el-space> <el-space v-else></el-space>
</template> </template>
</el-table-column> </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"> <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'">绑卡 @click="bindCard(scope.row, 10)" v-auth="'blt_bind.create'">绑卡
</el-button> </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> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-card> </el-card>
</el-main> </el-main>
<ScBind v-model="showBindBlt" :bindBtl="bindBtl" :bindType="bindType" :bindName="bindName" <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-container>
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import ScBind from "@/components/scBind/index.vue"; import ScBind from "@/components/scBind/index.vue";
export default { export default {
@ -87,10 +208,13 @@ export default {
}, },
data() { data() {
return { return {
leaveVisible:false,
workerVisible:false,
loading: false, loading: false,
visible: false, visible: false,
isSaveing: false, isSaveing: false,
showBindBlt: false, showBindBlt: false,
btnloading:false,
state_: { state_: {
10: "创建中", 10: "创建中",
20: "审批中", 20: "审批中",
@ -104,13 +228,25 @@ export default {
30: "保安保洁服务", 30: "保安保洁服务",
40: "其他", 40: "其他",
}, },
formworker : {
duty: "",
rcertificates: [],
rpj: "",
},
form: {}, form: {},
bindName: "", bindName: "",
bindType: 10, bindType: 10,
bindBtl: null, bindBtl: null,
bindEmployee: '', bindEmployee: '',
logLists:[],
rpjFileList: [], rpjFileList: [],
memeberList: [], memeberList: [],
remployeeoptions:[],
reason:"",
leaveId:"",
workDialogType:"add",
workDialogTitle:"添加项目成员"
}; };
}, },
mounted() { mounted() {
@ -156,6 +292,7 @@ export default {
this.form = res; this.form = res;
this.getRpjfileList(); this.getRpjfileList();
this.getMemberList(); this.getMemberList();
this.getLogs();
this.visible = true; this.visible = true;
}).catch(e => { this.loading = false }); }).catch(e => { this.loading = false });
}, },
@ -165,13 +302,111 @@ export default {
this.rpjFileList = res; this.rpjFileList = res;
}); });
}, },
// //
getMemberList() { getMemberList() {
this.$API.rpm.member.list.req({ rpj: this.form.id, page: 0 }).then((res) => { this.$API.rpm.member.list.req({ rpj: this.form.id, page: 0 }).then((res) => {
this.memeberList = 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> </script>

View File

@ -58,7 +58,8 @@
<el-date-picker <el-date-picker
v-model="rpjform.come_time" v-model="rpjform.come_time"
type="datetime" type="datetime"
placeholder="选择结束时间" placeholder="选择进厂时间"
:default-time="defaultTime_start"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -67,7 +68,8 @@
<el-date-picker <el-date-picker
v-model="rpjform.leave_time" v-model="rpjform.leave_time"
type="datetime" type="datetime"
placeholder="选择结束时间" placeholder="选择离厂时间"
:default-time="defaultTime"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -110,6 +112,7 @@
<el-button <el-button
style="margin-top: 20px" style="margin-top: 20px"
type="primary" type="primary"
:loading="isSaveing" :disabled="isSaveing"
@click="handleNextStep" @click="handleNextStep"
>下一步 >下一步
</el-button> </el-button>
@ -343,6 +346,8 @@
v-for="item in initForm.transitions" v-for="item in initForm.transitions"
:key="item.id" :key="item.id"
type="primary" type="primary"
:loading="isSaveing"
:disabled="isSaveing"
@click="submitTicketCreate(item.id)" @click="submitTicketCreate(item.id)"
style="margin-right: 4px" style="margin-right: 4px"
>{{ item.name }}</el-button >{{ item.name }}</el-button
@ -391,7 +396,7 @@ export default {
stepTitle: ["基本信息", "安全审核项目", "选择人员"], stepTitle: ["基本信息", "安全审核项目", "选择人员"],
query: {}, query: {},
selection: [], selection: [],
issave: false, // isSaveing: false, //
search: { search: {
keyword: null, keyword: null,
}, },
@ -426,10 +431,13 @@ export default {
come_time: [{ required: true, message: "请选择" }], come_time: [{ required: true, message: "请选择" }],
leave_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() { mounted() {
this.rpjId = this.$route.query.rpjid; //ID this.rpjId = this.$route.query.rpjid; //ID
this.isSaveing = false;
this.rpartyShow(); this.rpartyShow();
if (this.rpjId) { if (this.rpjId) {
this.getRpj(); this.getRpj();
@ -491,6 +499,7 @@ export default {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
this.isSaveing = true;
if (this.rpjId) { if (this.rpjId) {
this.$API.rpm.rpj.update this.$API.rpm.rpj.update
.req(this.rpjId, this.rpjform) .req(this.rpjId, this.rpjform)
@ -500,16 +509,22 @@ export default {
this.getmemberList(); this.getmemberList();
this.getremployee(); this.getremployee();
this.active = 1; this.active = 1;
this.isSaveing = false;
}).catch(res=>{
this.isSaveing = false;
}); });
} else { } else {
this.$API.rpm.rpj.create.req(this.rpjform).then((res) => { this.$API.rpm.rpj.create.req(this.rpjform).then((res) => {
this.$message.success("项目创建成功!"); this.$message.success("项目创建成功!");
this.rpjId = res.id; this.rpjId = res.id;
this.rpjform.rparty = res.rparty; this.rpjform.rparty = res.rparty;
this.getRpjfileList(); this.getRpjfileList();
this.getmemberList(); this.getmemberList();
this.getremployee(); this.getremployee();
this.active = 1; this.active = 1;
this.isSaveing = false;
}).catch(res=>{
this.isSaveing = false;
}); });
} }
} }
@ -636,6 +651,7 @@ export default {
//, //,
submitTicketCreate(id) { submitTicketCreate(id) {
let ticket = {}; let ticket = {};
this.isSaveing = true;
ticket.title = this.rpjform.name; ticket.title = this.rpjform.name;
ticket.workflow = this.initForm.workflow; ticket.workflow = this.initForm.workflow;
ticket.ticket_data = { rpj: this.rpjId ,name:this.rpjform.name}; ticket.ticket_data = { rpj: this.rpjId ,name:this.rpjform.name};
@ -646,6 +662,8 @@ export default {
name: "rpj", name: "rpj",
query: {}, query: {},
}); });
}).catch(()=>{
this.isSaveing = false;
}); });
}, },
}, },

View File

@ -35,19 +35,30 @@
@click="add" @click="add"
></el-button> ></el-button>
<el-select <el-select
v-model="query.type" v-model="query.type"
placeholder="账号类型" placeholder="账号类型"
@change="handleQuery" @change="handleQuery"
clearable clearable
style="margin-left: 2px" style="margin-left: 2px"
> >
<el-option <el-option
v-for="item in userTypeOptions2" v-for="item in userTypeOptions2"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </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>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <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="username" width="140"></el-table-column>
<el-table-column label="是否启用" prop="is_active"> <el-table-column label="是否启用" prop="is_active">
<template #default="scope"> <template #default="scope">
<el-tag type="success" v-if="scope.row.is_active">启用</el-tag> <el-tag type="danger" v-if="scope.row.is_deleted">已删</el-tag>
<el-tag v-else type="danger"></el-tag> <el-tag v-else type="success"></el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="微信通知" width="80"> <!-- <el-table-column label="微信通知" width="80">
@ -129,6 +140,7 @@
type="primary" type="primary"
link link
size="small" size="small"
v-if="!query.is_deleted"
@click="formSetting(scope.row)" @click="formSetting(scope.row)"
v-auth="'user.update'" v-auth="'user.update'"
> >
@ -138,12 +150,22 @@
<el-button <el-button
link link
size="small" size="small"
type="warning"
@click="formEdit(scope.row, '2')" @click="formEdit(scope.row, '2')"
v-auth="'user.update'" v-auth="'user.update'"
> >
编辑 编辑
</el-button> </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 <!-- <el-popconfirm
title="确定删除吗?" title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)" @confirm="table_del(scope.row, scope.$index)"
@ -204,8 +226,8 @@
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否在用"> <el-form-item label="是否删除">
<el-switch v-model="addForm.is_active" /> <el-switch active-color="#f56c6c" v-model="addForm.is_deleted" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -245,7 +267,9 @@ export default {
save: false, save: false,
// certSave:false, // certSave:false,
}, },
query: {}, isDeleted: true,
deletedIs: false,
query: {is_deleted:''},
baseUrl: baseUrl.API_URL, baseUrl: baseUrl.API_URL,
type: "add", type: "add",
titleMap: { titleMap: {
@ -257,7 +281,6 @@ export default {
addForm: { addForm: {
username: "", username: "",
name: "", name: "",
// email: "",
phone: null, phone: null,
// belong_dept: [], // belong_dept: [],
is_active: true, is_active: true,
@ -292,7 +315,7 @@ export default {
apiObj: this.$API.system.user.list, apiObj: this.$API.system.user.list,
temp: [], temp: [],
postList: [], postList: [],
userTypeOptions :{ userTypeOptions :{
'employee': '正式员工', 'employee': '正式员工',
'remployee': '相关方', 'remployee': '相关方',
'visitor': '访客', 'visitor': '访客',
@ -337,6 +360,14 @@ export default {
this.limitedVisible = true; this.limitedVisible = true;
this.addForm = {}; this.addForm = {};
}, },
//
formReset(row){
this.$API.system.user.rPassword.req(row.id).then(res=>{
this.$message.success("重置成功");
}).catch(err=>{
})
},
// //
formEdit(row, index) { formEdit(row, index) {
console.log(row); console.log(row);
@ -398,7 +429,7 @@ export default {
groupClick(data) { groupClick(data) {
console.log(data); console.log(data);
// debugger; // debugger;
this.$refs.table.queryData({ belong_dept: data.id }); this.$refs.table.queryData({ depts: data.id });
}, },
// //
handleQuery() { handleQuery() {
@ -411,6 +442,7 @@ export default {
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
let res; let res;
if (this.type === "add") { if (this.type === "add") {
res = await this.$API.system.user.create.req(this.addForm); res = await this.$API.system.user.create.req(this.addForm);
} else if (this.type === "edit") { } else if (this.type === "edit") {

View File

@ -60,6 +60,7 @@ export default {
account: defineAsyncComponent(() => import("./user/account")), account: defineAsyncComponent(() => import("./user/account")),
seting: defineAsyncComponent(() => import("./user/seting")), seting: defineAsyncComponent(() => import("./user/seting")),
pushSettings: defineAsyncComponent(() => import("./user/pushSettings")), pushSettings: defineAsyncComponent(() => import("./user/pushSettings")),
clockRecord: defineAsyncComponent(() => import("./user/clock_record")),
}, },
data() { data() {
return { return {
@ -82,6 +83,11 @@ export default {
title: "修改密码", title: "修改密码",
component: "pushSettings", component: "pushSettings",
}, },
{
icon: "el-icon-platform",
title: "打卡记录",
component: "clockRecord",
},
], ],
}, },
], ],

View File

@ -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 TableIOS
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 || ''; // HTML5file:///
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>

View File

@ -66,7 +66,8 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="签名"> <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-form-item>
</el-col> </el-col>
<el-col> <el-col>
@ -102,8 +103,10 @@ export default {
}, },
submitForm() { submitForm() {
let sform = { let sform = {
"id_number":this.form.id_number,
"photo": this.form.photo,
"phone": this.form.phone, "phone": this.form.phone,
"email": this.form.email "email": this.form.email,
} }
this.saveLoading = true this.saveLoading = true
this.$API.hrm.employee.improve_info.req(sform).then(res=>{ this.$API.hrm.employee.improve_info.req(sform).then(res=>{

View File

@ -5,41 +5,27 @@
<el-main> <el-main>
<el-card header="基本信息" shadow="hover"> <el-card header="基本信息" shadow="hover">
<el-descriptions :column="2"> <el-descriptions :column="2">
<el-descriptions-item label="来访概述:">{{ <el-descriptions-item label="来访概述:">{{form.name}}</el-descriptions-item>
form.name <el-descriptions-item label="来访级别:">{{levelOptions[form.level]}}</el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item label="来访单位:">{{form.company}}</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-descriptions-item label="来访人数:">
<el-tag size="small">{{ form.count_people }}</el-tag> <el-tag size="small">{{ form.count_people }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="来访人员:"> <el-descriptions-item label="来访人员:">
<el-tag size="small" v-for="item in form.visitors_" :key="item.id">{{ item.visitor_.name }}</el-tag> <el-tag size="small" v-for="item in form.visitors_" :key="item.id">{{ item.visitor_.name }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="状态:">{{ <el-descriptions-item label="状态:">{{state_[form.state]}}</el-descriptions-item>
state_[form.state] <el-descriptions-item label="来访时间:">{{form.visit_time}}</el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item label="离开时间:">{{form.leave_time}}</el-descriptions-item>
<el-descriptions-item label="来访时间:">{{ <el-descriptions-item label="来访事由:">{{purpose_[form.purpose]}}</el-descriptions-item>
form.visit_time <el-descriptions-item label="来访详述:">{{form.description}}</el-descriptions-item>
}}</el-descriptions-item> <el-descriptions-item label="接待人:" v-if="form.receptionist_">{{ form.receptionist_.name }}</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> </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>
<el-card style="margin-top: 8px" shadow="hover" header="访客信息"> <el-card style="margin-top: 8px" shadow="hover" header="访客信息">
<scTable ref="table" :data="peoplelist" row-key="id" height="auto" stripe hideDo hidePagination> <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-if="scope.row.is_main == true"></el-space>
<el-space v-else></el-space> <el-space v-else></el-space>
</el-descriptions-item> </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-descriptions-item label="健康码:">
<el-image style="width: 100px; height: 100px" :src="scope.row.health_code" <el-image style="width: 100px; height: 100px" :src="scope.row.health_code"
:preview-src-list="[scope.row.health_code]" fit="cover" /> :preview-src-list="[scope.row.health_code]" fit="cover" />
@ -97,6 +92,7 @@
</template> </template>
<script> <script>
import config from "@/config"
import ScBind from "@/components/scBind/index.vue"; import ScBind from "@/components/scBind/index.vue";
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
@ -206,8 +202,13 @@ export default {
setData(data) { setData(data) {
this.loading = true this.loading = true
this.$API.vm.visit.read.req(data.id).then((res) => { 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 = res;
this.form.vehicle_photos_.forEach(item=>{
item.path = urls+item.path
})
}).catch(e => { this.loading = false }); }).catch(e => { this.loading = false });
this.$API.vm.people.list.req({ visit: data.id, page: 0 }).then((res) => { this.$API.vm.people.list.req({ visit: data.id, page: 0 }).then((res) => {

View File

@ -52,13 +52,15 @@
v-model="form.visit_time" v-model="form.visit_time"
type="datetime" type="datetime"
placeholder="选择来访时间" placeholder="选择来访时间"
:default-time="defaultTime_start"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :sm="12" :xs="24"> <el-col :md="8" :sm="12" :xs="24">
<el-form-item label="离开时间" prop="leave_time"> <el-form-item label="离开时间">
<el-date-picker <el-date-picker
:default-time="defaultTime"
v-model="form.leave_time" v-model="form.leave_time"
type="datetime" type="datetime"
placeholder="选择离开时间" placeholder="选择离开时间"
@ -109,8 +111,13 @@
</el-row> </el-row>
</el-form> </el-form>
<div style="margin-top:20px;text-align:center"> <div style="margin-top:20px;text-align:center">
<el-button style="margin-top: 20px" @click="handleNextStep" <el-button style="margin-top: 20px"
type="primary">下一步</el-button> @click="handleNextStep"
:loading="isSaving"
:disabled="isSaving"
type="primary">
下一步
</el-button>
</div> </div>
</el-main> </el-main>
@ -131,27 +138,11 @@
<el-table-column label="#" type="expand"> <el-table-column label="#" type="expand">
<template #default="scope"> <template #default="scope">
<el-descriptions :column="3" style="margin-left:70px"> <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.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-descriptions-item label="是否重要访客:">
<el-space v-if="scope.row.is_main == true"></el-space> <el-space v-if="scope.row.is_main == true"></el-space>
<el-space v-else></el-space> <el-space v-else></el-space>
</el-descriptions-item> </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> </el-descriptions>
</template> </template>
</el-table-column> </el-table-column>
@ -312,12 +303,14 @@
style="margin-right:4px">上一步</el-button style="margin-right:4px">上一步</el-button
> >
<span v-for=" item in initform.transitions" :key="item.id"> <span v-for=" item in initform.transitions" :key="item.id">
<el-button @click="submitticket(item.id)" <el-button
style="margin-right:4px" type="primary">{{item.name}}</el-button :loading="isSaving"
> :disabled="isSaving"
@click="submitticket(item.id)"
</span> style="margin-right:4px" type="primary"
<el-button @click="submitOut" type="warning">退出</el-button> >{{item.name}}</el-button>
</span>
<el-button @click="submitOut" type="warning">退出</el-button>
</div> </div>
</el-main> </el-main>
</el-container> </el-container>
@ -362,7 +355,13 @@ export default {
measureOptions: ['集中隔离','居家隔离','居家健康检测','排除风险'], measureOptions: ['集中隔离','居家隔离','居家健康检测','排除风险'],
active: 0, active: 0,
stepSuc: [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: ["基本信息", "选择访客"], stepTitle: ["基本信息", "选择访客"],
receptionistoptions: [], receptionistoptions: [],
purposeoptions: [ purposeoptions: [
@ -430,6 +429,7 @@ export default {
}, },
mounted() { mounted() {
this.visitid = this.$route.query.visitid; //ID this.visitid = this.$route.query.visitid; //ID
this.isSaving = false;
if(this.visitid){ if(this.visitid){
this.getRpj(); this.getRpj();
this.getpeoplelistlist(); this.getpeoplelistlist();
@ -478,23 +478,29 @@ export default {
if (this.active == 0) { if (this.active == 0) {
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
this.isSaving = true;
if(this.visitid){ if(this.visitid){
this.$API.vm.visit.update this.$API.vm.visit.update
.req(this.visitid, this.form) .req(this.visitid, this.form)
.then((res) => { .then((res) => {
this.$message.success("基本信息更新成功"); this.$message.success("基本信息更新成功");
this.getInit(); this.getInit();
this.active = 1; this.active = 1;
}) this.isSaving = false;
}).catch(()=>{
this.isSaving = false;
})
}else{ }else{
this.$API.vm.visit.create.req(this.form).then(res=>{ this.$API.vm.visit.create.req(this.form).then(res=>{
this.visitid = res.id; this.visitid = res.id;
this.$message.success("项目创建成功"); this.$message.success("项目创建成功");
this.getInit(); this.getInit();
this.active = 1; this.active = 1;
this.isSaving = false;
}).catch(()=>{
this.isSaving = false;
}) })
} }
} }
}); });
} else { } else {
@ -577,19 +583,21 @@ export default {
}, },
// //
submitticket(id){ submitticket(id){
this.ticket={}; this.ticket={};
this.ticket.title = this.form.name; this.isSaving = true;
this.ticket.title = this.form.name;
this.ticket.workflow=this.initform.workflow; this.ticket.workflow=this.initform.workflow;
this.ticket.ticket_data={visit:this.visitid,name:this.form.name}; this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
this.ticket.transition=id; this.ticket.transition=id;
this.$API.wf.ticket.create.req(this.ticket).then((res) => { this.$API.wf.ticket.create.req(this.ticket).then((res) => {
this.$message.success("提交成功"); this.$message.success("提交成功");
this.$router.push({ this.$router.push({
name: "visit", name: "visit",
query: {}, query: {},
});
}).catch(()=>{
this.isSaving = false;
}); });
});
} }
}, },
}; };

View File

@ -70,8 +70,8 @@
link link
size="small" size="small"
v-if=" v-if="
(scope.row.act_state === 1 || scope.row.act_state === 3) && (scope.row.act_state === 1&&scope.row.state_.type === 0) || (scope.row.act_state === 3&&
scope.row.state_.type === 0 scope.row.state_.type === 0) ||scope.row.act_state === 2
" "
type="primary" type="primary"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"

View File

@ -28,7 +28,10 @@ export default {
}, },
mounted() { mounted() {
// this.workId = this.ticket?this.ticket:this.$route.query.id; // 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(); this.getFlowSteps();
}, },
methods: { methods: {

View File

@ -167,7 +167,7 @@
</el-button> </el-button>
</div> </div>
<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)"> :type="item.attribute_type===2?'danger':'primary'" @click="operationSubmit(item.id)">
{{item.name}} {{item.name}}
</el-button> </el-button>
@ -211,7 +211,7 @@
</div> </div>
</el-dialog> </el-dialog>
<el-drawer :size="'50%'" v-model="showLimited" title="作业许可证详情" :close-on-click-modal="false"> <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> </el-drawer>
</template> </template>
@ -309,6 +309,7 @@
}, },
mounted() { mounted() {
debugger; debugger;
this.submitLoading = false;
if (this.cateType === 'visit') { if (this.cateType === 'visit') {
this.getVisit(); this.getVisit();
} else if (this.cateType === 'rpj') { } else if (this.cateType === 'rpj') {
@ -381,6 +382,7 @@
this.$API.opm.opl.read.req(this.projectId).then((res) => { this.$API.opm.opl.read.req(this.projectId).then((res) => {
debugger; debugger;
this.oplDetail = res; this.oplDetail = res;
this.operationId = res.operation;
}); });
}, },
showMoreInfo() { showMoreInfo() {
@ -444,10 +446,10 @@
params.ticket_data.close_dos = this.form.close_dos; params.ticket_data.close_dos = this.form.close_dos;
} }
this.$API.wf.ticket.ticketHandle.req(this.ticketId, params).then(res => { this.$API.wf.ticket.ticketHandle.req(this.ticketId, params).then(res => {
this.submitLoading = false;
if (res.err_msg) { if (res.err_msg) {
} else { } else {
this.$router.push("dutywork"); this.$router.push("dutywork");
this.submitLoading = false;
} }
}).catch(e=>{this.submitLoading=false;}) }).catch(e=>{this.submitLoading=false;})
}, },

View File

@ -72,6 +72,16 @@ module.exports = defineConfig({
} }
} }
} }
},
resolve:{
fallback:{
fs:false,
crypto: require.resolve("crypto-browserify"),
stream: false,
}
},
externals:{
'./cptable':'var cptable'
} }
}, },
pluginOptions: { pluginOptions: {