This commit is contained in:
曹前明 2022-08-08 13:24:27 +08:00
commit 7b521c9687
10 changed files with 688 additions and 373 deletions

View File

@ -34,6 +34,9 @@ const install = (Vue, vm) => {
let userList = (params = {}) => vm.$u.get('/system/user/', params); //
let deptList = (params = {}) => vm.$u.get('/system/dept/', params); //
let userInfo = (params = {}) => vm.$u.get('/hrm/employee/info/', params); //用户信息
let hrmCertificate = (params = {}) => vm.$u.get('/hrm/certificate/', params); //用户证书
let getTickets = (params = {}) => vm.$u.get('/wf/ticket/', params); //工单查询/wf/ticket/{id}/
let ticketCreate = (data = {}) => vm.$u.post('/wf/ticket/', data); //工单
let getTicketItem = (id) => vm.$u.get(`/wf/ticket/${id}/`); //工单详情
@ -56,7 +59,10 @@ const install = (Vue, vm) => {
let oplCateItem = (id) => vm.$u.get(`/opm/opl_cate/${id}/`); //作业许可证类型详情
let oplCreate = (data = {}) => vm.$u.post('/opm/opl/', data); //添加新许可证
let oplUpdate = (id,data = {}) => vm.$u.put(`/opm/opl/${id}/`, data); //编辑许可证
let oplWorker = (data = {}) => vm.$u.get('/opl_worker/', data); //作业许可证类型
let oplWorker = (data = {}) => vm.$u.get('/opm/opl_worker/', data); //作业许可证类型
let oplWorkerCreate = (data = {}) => vm.$u.post('/opm/opl_worker/', data); //作业许可证类型
let oplGasList = (data = {}) => vm.$u.get('/opm/gas_check/', data); //气体检测记录
let oplGasCreate = (data = {}) => vm.$u.post('/opm/gas_check/', data); //作业许可证类型
let rpjList = (data = {}) => vm.$u.get(`/rpm/rpj/`, data); //rpj查询
let rpjItem = (id) => vm.$u.get(`/rpm/rpj/${id}`); //rpj查询
@ -75,7 +81,8 @@ const install = (Vue, vm) => {
let vpeopleUpdate = (data = {}) => vm.$u.put(`vm/vpeople/${id}/`, data); //来访人员编辑
vm.$u.api = {
getUserInfo,
userInfo,
getCode,
codeLogin,
login,
@ -121,7 +128,12 @@ const install = (Vue, vm) => {
oplCreate,
oplUpdate,
oplWorker,
oplWorkerCreate,
oplGasList,
oplGasCreate,
hrmCertificate,
areaLists
};
}

View File

@ -156,6 +156,14 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/workSpace/operation/gasList",
"style": {
"navigationBarTitleText": "气体检测记录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/workSpace/visit/visitList",
"style": {

View File

@ -185,7 +185,7 @@
code: loginRes.code
}).then(res => {
this.$u.vuex('vuex_token', res.access)
this.$u.api.getUserInfo().then(res => {
this.$u.api.userInfo().then(res => {
uni.hideLoading()
uni.showToast({
title: "登录成功",
@ -323,7 +323,7 @@
that.$u.vuex('vuex_refresh', res.refresh)
// let data = {openid: uni.getStorageSync('wxmp_openid')}
// that.$u.api.bindmp(data).then(res=>{})
that.$u.api.getUserInfo().then(res => {
that.$u.api.userInfo().then(res => {
that.$u.vuex('vuex_user', res)
//
})

View File

@ -28,15 +28,9 @@
</view>
</view>
<view class="enter-list">
<view class="enter-item" @click="goInto('myApply')">
<view class="enter-item" @click="goInto('certificate')">
<image class="left-icon" src="../../static/my/wodeshenqing.png" mode=""></image>
<text class="title-text">我的申请</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
<view class="enter-item" @click="goInto('daiban')">
<image class="left-icon" src="../../static/my/wodeshenpi.png" mode=""></image>
<text class="title-text">我的审批</text>
<text class="title-text">我的证书</text>
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
</view>
<view class="enter-item" @click="goInto('myData')">
@ -72,119 +66,21 @@
}
},
onShow() {
// this.getUserInfo();
//
// this.getBusinessTripDayTimeFn();
//
// this.getLeaveTimeFn();
// ()
// this.getLeaveTimePaidLeaveFn();
//
// this._getSystemHomePageTabChart();
this.getUserInfo();
},
methods: {
/* 查询年假剩余天数 */
_getSystemHomePageTabChart() {
systemHomePageTabChart().then((res) => {
if (res.statusCode === 200) {
if (res.data.data !== undefined && res.data.data !== null && res.data.data !== "") {
this.annualLeaveDay = res.data.data.annualLeaveDay || 0.00;
} else {
this.annualLeaveDay = 0.00;
}
} else {
this.annualLeaveDay = 0.00;
uni.showToast({
title: res.data.message,
icon: 'none'
})
}
}).catch(() => {
this.annualLeaveDay = 0.00
uni.showToast({
title: '网络异常, 请求失败',
icon: 'none'
})
})
},
getLeaveTimePaidLeaveFn() {
getLeaveTimePaidLeave().then(res => {
if (res.statusCode === 200) {
this.getLeaveTimePaidLeaveCon = res.data.data.b_leave_days;
} else {
uni.showToast({
title: '获取用户累计请假天数失败',
icon: 'none'
})
}
}).catch(err => {
uni.showToast({
title: '请求失败',
icon: 'none'
})
})
},
getLeaveTimeFn() {
getLeaveTime().then(res => {
if (res.statusCode === 200) {
this.getLeaveTimeCon = res.data.data.b_leave_days;
} else {
uni.showToast({
title: '获取用户累计调休天数失败',
icon: 'none'
})
}
}).catch(err => {
uni.showToast({
title: '请求失败',
icon: 'none'
})
})
},
getBusinessTripDayTimeFn() {
getBusinessTripDayTime().then(res => {
if (res.statusCode === 200) {
this.getBusinessTripDayTimeCon = res.data.data.b_leave_days;
} else {
uni.showToast({
title: '获取用户累计出差天数失败',
icon: 'none'
})
}
}).catch(err => {
uni.showToast({
title: '请求失败',
icon: 'none'
})
})
},
goInto(type) {
if (type == "myApply") {
if (type == "certificate") {
uni.navigateTo({
url: '/pages/profile/my_apply/my_apply'
})
}
if (type == "daiban") {
uni.navigateTo({
url: '/pages/index/daiban_management/daiban_management'
})
}
if (type == "myData") {
uni.navigateTo({
url: '/pages/my/myInfo'
})
}
if (type == "problem") {
uni.navigateTo({
url: '/pages/profile/common_problem/common_problem'
})
}
},
getUserInfo() {
var promise;

View File

@ -1,233 +1,176 @@
<template>
<view class="my-data">
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="200rpx" leftText="个人信息"
leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<view class="wrap-view">
<view class="item">
<view class="title">所属部门</view>
<picker class="content" mode="selector" :range="deptRange" @change="deptChange" range-key="name">
<view class="">
{{deptGender}}
</view>
</picker>
</view>
</view>
<view class="wrap-view">
<view class="item">
<view class="title">姓名</view>
<view class="content">
<input type="text" v-model="principal.mobile" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item">
<view class="title">手机号</view>
<view class="content">
<input type="text" v-model="principal.mobile" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item">
<view class="title">身份证号</view>
<view class="content">
<input type="text" v-model="principal.mobile" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item">
<view class="title">人员编号</view>
<view class="content">
<input type="text" v-model="principal.mobile" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item">
<view class="title">性别</view>
<picker class="content" mode="selector" :range="genderRange" @change="genderChange" range-key="name">
<view class="">
{{selectedGender}}
</view>
</picker>
</view>
<view class="item">
<view class="title">邮箱</view>
<view class="content">
<input type="text" v-model="principal.email" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item" style="height: fit-content;">
<view class="title">证件照</view>
<view style="flex: 3;">
<uni-file-picker
v-model="principal.mobile"
file-mediatype="image"
mode="grid"
file-extname="png,jpg"
:limit="5"
ref="files"
:auto-upload="false"
@select="select"
/>
</view>
</view>
</view>
<view class="btn">
<button type="default" class="save-btn">保存</button>
<view class="my-data">
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="200rpx" leftText="个人信息"
leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<view class="wrap-view">
<view class="item">
<view class="title">姓名</view>
<view class="content">
<text>{{userInfo.name}}</text>
<!-- <input type="text" v-model="principal.mobile" maxlength="20" placeholder="请输入" /> -->
</view>
</view>
<view class="item">
<view class="title">编号</view>
<view class="content">
<text>{{userInfo.number}}</text>
</view>
</view>
<view class="item">
<view class="title">身份证号</view>
<view class="content">
<text>{{userInfo.id_number}}</text>
</view>
</view>
<view class="item">
<view class="title">学历</view>
<view class="content">
<text>{{userInfo.qualification}}</text>
</view>
</view>
<view class="item">
<view class="title">性别</view>
<view class="content">
<text>{{userInfo.gender}}</text>
</view>
</view>
</view>
<view class="item">
<view class="title">岗位</view>
<view class="content">
<text>{{userInfo.post_name}}</text>
</view>
</view>
<view class="item">
<view class="title">部门</view>
<view class="content">
<text>{{userInfo.belong_dept_name}}</text>
</view>
</view>
</view>
<view class="wrap-view">
<view class="item">
<view class="title">手机号</view>
<view class="content">
<input type="text" v-model="userInfo.phone" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item">
<view class="title">邮箱</view>
<view class="content">
<input type="text" v-model="userInfo.email" maxlength="20" placeholder="请输入" />
</view>
</view>
<view class="item" style="height: fit-content;">
<view class="title">证件照</view>
<view style="flex: 3;">
<uni-file-picker v-model="userInfo.mobile" file-mediatype="image" mode="grid"
file-extname="png,jpg" :limit="5" ref="files" :auto-upload="false" @select="select" />
</view>
</view>
</view>
<view class="btn">
<button type="default" class="save-btn">保存</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
export default {
data() {
return {
userInfo: {},
}
},
onShow() {
this.getUserInfo();
},
methods: {
getUserInfo() {
this.$u.api.userInfo().then(res => {
this.userInfo = res;
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
genderChange(e) {
const idx = e.detail.value;
this.selectedGender = this.genderRange[idx].name;
},
deptChange(e) {
const idx = e.detail.value;
this.deptGender = this.deptRange[idx].name;
},
principal: {},
realname: "",
userId: "",
mobile: "",
selectedGender: '男',
genderRange: [{
id: 0,
name: '男'
},
{
id: 1,
name: '女'
}
],
deptGender: '设计部',
deptRange: [{
id: 10,
name: '设计部'
},
{
id: 11,
name: '生产部'
}
]
}
},
onShow() {
// this.getUserInfo();
},
methods: {
getUserInfo() {
authUser().then((res) => {
if (res.statusCode === 200) {
const principal = res.data.principal;
this.principal = principal;
this.realname = principal.realname;
this.userId = principal.userId;
this.mobile = principal.mobile || '';
} else {
this.principal = {};
this.realname = "";
this.userId = "";
this.mobile = "";
uni.showToast({
title: '获取用户信息失败',
icon: 'none'
})
}
}).catch(() => {
this.principal = {};
this.realname = "";
this.userId = "";
this.mobile = "";
uni.showToast({
title: '请求失败',
icon: 'none'
})
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
genderChange(e) {
const idx = e.detail.value;
this.selectedGender = this.genderRange[idx].name;
},
deptChange(e) {
const idx = e.detail.value;
this.deptGender = this.deptRange[idx].name;
},
}
}
}
}
</script>
<style scoped>
>>>.uni-navbar__header,>>>.uni-status-bar {
background-image: linear-gradient(254deg,
#0ca7ee 0%,
#005aff 100%,
#2a8cff 100%,
#54bdff 100%),
linear-gradient(#e60012,
#e60012);
}
>>>.uni-navbar__header,
>>>.uni-status-bar {
background-image: linear-gradient(254deg,
#0ca7ee 0%,
#005aff 100%,
#2a8cff 100%,
#54bdff 100%),
linear-gradient(#e60012,
#e60012);
}
.my-data {
background-color: #f3fbff;
padding-bottom: 227rpx;
}
.my-data {
background-color: #f3fbff;
padding-bottom: 227rpx;
}
.nav-bar>>>.uni-navbar-btn-text text {
font-size: 32rpx !important;
}
.nav-bar>>>.uni-navbar-btn-text text {
font-size: 32rpx !important;
}
.wrap-view {
width: 720rpx;
margin: 0 auto;
background-color: #ffffff;
border-radius: 10rpx;
line-height: 94rpx;
font-family: PingFang-SC-Medium;
font-size: 30rpx;
}
.wrap-view {
width: 720rpx;
margin: 0 auto;
background-color: #ffffff;
border-radius: 10rpx;
line-height: 94rpx;
font-family: PingFang-SC-Medium;
font-size: 30rpx;
}
.item {
border-bottom: 1rpx solid #eeeeee;
margin: 0rpx 32rpx;
display: flex;
margin-top: 20rpx;
}
.item {
border-bottom: 1rpx solid #eeeeee;
margin: 0rpx 32rpx;
display: flex;
margin-top: 20rpx;
}
.title {
color: #212121;
flex: 1;
}
.title {
color: #212121;
flex: 1;
}
.content {
flex: 3;
color: #414141;
.content {
flex: 3;
color: #414141;
}
}
.content input {
height: 100%;
}
.content input {
height: 100%;
}
.save-btn {
width: 400rpx;
height: 80rpx;
background-color: #2c6fd9;
border-radius: 40rpx;
font-size: 30rpx;
line-height: 80rpx;
color: #f3fbff;
margin-top: 21rpx;
}
.save-btn {
width: 400rpx;
height: 80rpx;
background-color: #2c6fd9;
border-radius: 40rpx;
font-size: 30rpx;
line-height: 80rpx;
color: #f3fbff;
margin-top: 21rpx;
}
</style>

View File

@ -0,0 +1,380 @@
<template>
<view class="list-body">
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="400rpx" leftText="气体检测记录"
leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<view class="apply-info">
<view class="row" v-for="(row,index) in gasCheckList" :key="index" @tap="select(row)">
<view class="center">
<view class="name-tel">
<view class="name">检测部位{{row.check_place}}</view>
<view class="tel">O₂(%){{row.o2}}</view>
<view class="tel">CO{{row.co}}</view>
<view class="tel">可燃气体(V%LEL){{row.lel}}</view>
<view class="tel">检验结论{{row.is_ok}}</view>
<view class="tel">检测人{{row.checker_.name}}</view>
<view class="tel">检验时间{{row.check_time}}</view>
</view>
</view>
<view class="right">
<view class="icon bianji" @tap.stop="edit(row)">
</view>
</view>
</view>
<button type="primary" class="select" @click="addGasCheck">新增记录</button>
</view>
<button type="primary" class="addNew" @click="add">新增人员</button>
<view class="dialogWrap" v-if="limitedDialog">
<view class="dialogCont">
<view class="dialogTitle">
<view>气体检测记录</view>
<view class="dialogCloseImg" @click="closeDialog"></view>
</view>
<form @submit="formSubmit">
<view class="uni-form-item">
<view class="title">检测时间</view>
<uni-datetime-picker v-model="formData.check_time" :border="false" />
<!-- <picker mode="date" :value="formData.check_time" class="content" @change="timeChange">
<view class="uni-input">{{formData.check_time}}</view>
</picker> -->
</view>
<view class="uni-form-item">
<view class="title">检测部位</view>
<input class="content" type="text" v-model="formData.check_place" maxlength="50"
placeholder="请输入" />
</view>
<view class="uni-form-item">
<view class="title">O2(%)</view>
<input class="content" type="text" v-model="formData.o2" maxlength="50"
placeholder="请输入" />
</view>
<view class="uni-form-item">
<view class="title">CO</view>
<input class="content" type="text" v-model="formData.co" maxlength="50"
placeholder="请输入" />
</view>
<view class="uni-form-item">
<view class="title">可燃气体</view>
<input class="content" type="text" v-model="formData.lel" maxlength="50"
placeholder="请输入" />
</view>
<view class="uni-form-item">
<view class="title">检验结论</view>
<radio-group @change="checkboxMeasuresChange" class="content">
<label style="margin-right: 20rpx;margin-bottom: 20rpx;">
<radio value="true" :checked="formData.is_ok" />正常
</label>
<label style="margin-right: 20rpx;margin-bottom: 20rpx;">
<radio value="false" :checked="!formData.is_ok" />不正常
</label>
</radio-group>
</view>
<view class="uni-form-item">
<view class="title">检测人</view>
<uni-data-select class="content" :localdata="workerRange" v-model="formData.checker">
</uni-data-select>
</view>
<view class="uni-btn-v">
<button class="mini-btn" type="primary" size="mini" form-type="submit">确定</button>
</view>
</form>
</view>
</view>
<view class="apply-info" style="min-height: fit-content;display: flex;">
<button type="primary" plain="true" style="width: 25%;" @click="goBack">上一步</button>
<button v-for=" item in initform.transitions" :key="item.id" @click="submitticket(item.id)" type="primary" style="width: 25%;">{{item.name}}
</button>
<button plain="true" style="width: 25%;" @click="nexStep">退出</button>
</view>
</view>
</template>
<script>
export default {
name: "gasList",
data() {
return {
limitedDialog: false,
formData: {
opl: '',
check_time: '选择日期',
check_place:'',
o2:'',
co:'',
lel:'',
is_ok:true,
checker:'',
},
initform: {},
oplDetail:{},
gasCheckList: [],
workerRange: [],
certificateRange: [],
}
},
onLoad(params) {
this.oplId = params.oplId;
},
onShow() {
this.gasCheckList = [];
this.getOplDetail();
this.getWorkerRange();
this.getGasCheckList();
this.getInit();
},
methods: {
timeChange(e){
// debugger;
console.log(e.detail.value)
this.formData.check_time = e.detail.value;
},
formSubmit(val) {
let that = this;
that.formData.opl = that.oplId;
that.$u.api.oplGasCreate(that.formData).then(res => {
if (res.err_msg) {} else {
that.getGasCheckList();
this.limitedDialog = false;
}
})
},
getOplDetail(){
let that = this;
that.$u.api.oplItem(that.oplId).then((res) => {
that.oplDetail = res; //
debugger;
console.log(res);
});
},
//
getWorkerRange() {
let that = this;
that.$u.api.userList({
page: 0
}).then(res => {
let workerRange = [];
let obj = {};
res.forEach(item => {
obj = item;
obj.value = item.id;
obj.text = item.name;
workerRange.push(obj);
})
that.workerRange = workerRange
})
},
//
getGasCheckList() {
let that = this;
that.workerList = [];
that.$u.api.oplGasList({
page: 0,
opl: this.oplId
}).then(res => {
that.gasCheckList = res;
})
},
checkboxMeasuresChange(e) {
let value = e.detail.value;
if (value === 'true') {
this.formData.is_ok = true;
} else {
this.formData.is_ok = false;
}
},
addGasCheck() {
this.limitedDialog = true;
},
closeDialog() {
this.limitedDialog = false;
},
select(row) {},
goBack() {
uni.navigateBack({
delta: 1
})
},
edit(row) {},
nexStep() {
uni.navigateTo({
url: '/pages/workSpace/operation/operationList'
})
},
getInit() {
this.$u.api.workflowInit('opl_fire').then((res) => {
this.initform = res;
});
},
//
submitticket(id) {
let that = this;
let ticket = {};
ticket.workflow = that.initform.workflow;
ticket.ticket_data = {
opl: that.oplId
};
ticket.transition = id;
ticket.title = that.oplDetail.operation_.name + that.oplDetail.cate_name + '申请';
that.$u.api.ticketCreate(ticket).then((res) => {
if (res.err_msg) {} else {
uni.reLaunch({
url: '/pages/workSpace/operation/operationList'
})
}
});
}
}
}
</script>
<style>
>>>.uni-navbar__header,
>>>.uni-status-bar {
background-image: linear-gradient(90deg, #164cc3 0%, #2c6fd9 100%), linear-gradient(#e60012, #e60012) !important;
}
.list-body {
background-color: #f3fbff;
padding-bottom: 113px;
}
.apply-info {
min-height: 70vh;
width: 710upx;
margin: 0 auto;
background-color: #FFFFFF;
border-radius: 5px;
padding: 12px 16px;
box-sizing: border-box;
margin-top: 12px;
}
.row {
padding: 10upx;
margin-bottom: 20upx;
border-bottom: 1upx solid #eeeeee;
}
.uni-list-cell {
display: flex;
padding: 10upx;
margin-bottom: 20upx;
border-bottom: 1upx solid #eeeeee;
}
.addNew {
width: 50px;
height: 50px;
border-radius: 25px;
line-height: 50px;
box-shadow: 0 0 6px 2px rgba(0, 0, 0, .3);
z-index: 100;
position: fixed;
bottom: 20px;
right: 20px;
}
.select {
margin: auto;
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.4);
width: 400rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
}
.save-btn {
height: 80rpx;
color: #fff;
font-size: 30upx;
justify-content: center;
align-items: center;
}
.dialogWrap {
position: fixed;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, .3);
top: 0;
left: 0;
z-index: 110;
}
.dialogCont {
width: 80vw;
position: absolute;
top: 50%;
margin: auto;
background-color: #ffffff;
left: 10vw;
transform: translateY(-50%);
padding: 20rpx;
border-radius: 20rpx;
}
.dialogTitle {
font-size: 36rpx;
padding-bottom: 20rpx;
border-bottom: 1upx solid #eeeeee;
display: flex;
justify-content: space-between;
}
.uni-form-item {
padding: 10px 0;
display: flex;
border-bottom: 1upx solid #eeeeee;
}
.uni-form-item>.title,
>>>uni-input,
>>>.uni-input,
>>>.uni-input-wrapper,
>>>.input-placeholder {
height: 80upx;
line-height: 80upx;
font-size: 32upx;
width: 160upx;
}
>>>uni-input,
>>>.uni-input,
>>>.uni-input-wrapper,
>>>.input-placeholder {
width: 100%;
}
.content {
flex: 1;
}
.uni-btn-v {
text-align: center;
}
.dialogCloseImg {
width: 52rpx;
height: 52rpx;
background-image: url('../../../static/my/my_apply/zuofei.png');
background-repeat: no-repeat;
background-size: cover;
}
.uni-label-pointer {
min-width: 50%;
margin: 0 !important;
line-height: 90upx;
}
>>>uni-radio-group {
display: flex;
}
</style>

View File

@ -6,9 +6,9 @@
<view class="row" v-for="(row,index) in workerList" :key="index" @tap="select(row)">
<view class="center">
<view class="name-tel">
<view class="name">姓名{{row.text}}</view>
<view class="tel">手机号{{row.visitor_.phone}}</view>
<view class="tel">身份证号{{row.visitor_.id_number}}</view>
<view class="name">姓名{{row.worker_.name}}</view>
<view class="tel">手机号{{row.phone}}</view>
<view class="tel">职责{{row.duty}}</view>
</view>
</view>
<view class="right">
@ -22,24 +22,30 @@
<view class="dialogWrap" v-if="limitedPeople">
<view class="dialogCont">
<view class="dialogTitle">
<view>选择来访人员</view>
<view>选择作业人员</view>
<view class="dialogCloseImg" @click="closeDialog"></view>
</view>
<form @submit="formSubmit">
<view class="uni-form-item uni-column">
<view class="title">作业人员</view>
<uni-data-select name="visitor" :localdata="workerRange" v-model="formData.worker">
<uni-data-select :localdata="workerRange" v-model="formData.worker" @change="selectWorker">
</uni-data-select>
</view>
<view class="uni-form-item uni-column">
<view class="title">工作职责</view>
<uni-data-select name="visitor" :localdata="dutyRange" v-model="formData.duty">
<uni-data-select :localdata="dutyRange" v-model="formData.duty">
</uni-data-select>
</view>
<view class="uni-form-item uni-column">
<view class="title">证书</view>
<uni-data-select name="visitor" :localdata="certificateRange" v-model="formData.certificates">
</uni-data-select>
<checkbox-group @change="checkboxMeasuresChange">
<label v-for="(item,index) in certificateRange" :key="item.id"
style="margin-right: 20rpx;margin-bottom: 20rpx;">
<checkbox :value="item.id" :checked="item.checked" />{{item.name}}
</label>
</checkbox-group>
<!-- <uni-data-select :localdata="certificateRange" v-model="formData.certificates">
</uni-data-select> -->
</view>
<view class="uni-btn-v">
<button class="mini-btn" type="primary" size="mini" form-type="submit">确定</button>
@ -48,11 +54,11 @@
</view>
</view>
<view class="apply-info" style="min-height: fit-content;display: flex;">
<button v-for=" item in initform.transitions" :key="item.id" @click="submitticket(item.id)" type="primary" style="width: 25%;">{{item.name}}
</button>
<button type="warn" style="width: 25%;">退出</button>
<button type="primary" plain="true" style="width: 25%;" @click="goBack">上一步</button>
<button type="primary" style="width: 25%;" @click="nexStep">下一步</button>
</view>
</view>
</template>
@ -66,12 +72,32 @@
opl: '',
worker: '',
duty: null,
certificates:[],
certificates: [],
},
initform: {},
workerList: [],
workerRange: [],
dutyRange: [],
dutyRange: [{
value: '10',
text: "作业人员"
},
{
value: '20',
text: "起重司机"
},
{
value: '30',
text: "司索人员"
},
{
value: '40',
text: "起重指挥"
},
{
value: '40',
text: "电工"
},
],
certificateRange: [],
}
},
@ -79,15 +105,15 @@
this.oplId = params.oplId;
},
onShow() {
this.workerList = [];
this.getWorkerList();
this.getWorkerRange();
// this.getVpeopleList();
this.getInit();
},
methods: {
formSubmit(val) {
let that = this;
that.formData.oplId = that.oplId;
that.formData.opl = that.oplId;
that.$u.api.oplWorkerCreate(that.formData).then(res => {
if (res.err_msg) {} else {
that.getWorkerList();
@ -101,38 +127,56 @@
that.$u.api.userList({
page: 0
}).then(res => {
that.userRange = [];
let user = [];
let workerRange = [];
let obj = {};
res.forEach(item => {
obj = item;
obj.value = item.id;
obj.text = item.name;
user.push(obj);
workerRange.push(obj);
})
that.userRange = user
that.workerRange = workerRange
})
},
//
//
getWorkerList() {
let that = this;
that.workerList = [];
that.$u.api.oplWorker({
page: 0,
opl: this.oplId
}).then(res => {
that.workerList = [];
let user = [];
let obj = {};
res.forEach(item => {
obj = item;
obj.value = item.id;
obj.text = item.visitor_.name;
user.push(obj);
})
that.workerList = user
that.workerList = res
})
},
selectWorker(e) {
let that = this;
that.formData.worker = e;
if(e!==''){
that.$u.api.hrmCertificate({
employee__user:e,
page: 0
})
.then((res) => {
let certificateRange = [];
let obj = {};
res.forEach(item => {
obj = item;
obj.chencked = false;
certificateRange.push(obj);
})
that.certificateRange = certificateRange
console.log(res);
});
}else{}
},
checkboxMeasuresChange(e) {
let values = e.detail.value;
this.formData.certificates = values;
},
checkPeople() {
this.certificateRange = [];
this.limitedPeople = true;
},
closeDialog() {
@ -151,22 +195,25 @@
})
},
edit(row) {},
getInit() {
this.$u.api.workflowInit('Fire').then((res) => {
this.initform = res;
});
nexStep(){
let params = `?oplId=${this.oplId}`;
uni.navigateTo({
url: '/pages/workSpace/operation/gasList'+params
})
},
//
submitticket(id) {
let that = this;
let ticket = {};
ticket.workflow = this.initform.workflow;
ticket.workflow = that.initform.workflow;
ticket.ticket_data = {
opl: this.oplId
opl: that.oplId
};
ticket.transition = id;
this.$u.api.ticketCreate(ticket).then((res) => {
if(res.err_msg){}else{
that.$u.api.ticketCreate(ticket).then((res) => {
if (res.err_msg) {} else {
uni.reLaunch({
url: '/pages/workSpace/workSpace'
})
@ -293,4 +340,14 @@
background-repeat: no-repeat;
background-size: cover;
}
.uni-label-pointer {
min-width: 50%;
display: inline-block;
margin-right: 0!important;
margin-bottom: 20upx;
}
.uni-form-item {
height:fit-content!important;
}
</style>

View File

@ -236,12 +236,28 @@
that.measurelist = [];
that.oplCateName = res.name;
that.oplcateCode = res.code;
let risklist =res.risk_options_;
let measurelist =res.measure_options_;
if (that.oplId !== null) {
that.editCheckShow(res.risk_options_, res.measure_options_);
that.editCheckShow(risklist, measurelist);
}else{
risklist.forEach(item => {
let obj = {};
obj = item;
obj.checked = false;
that.risklist.push(obj)
})
measurelist.forEach(item => {
let obj = {};
obj = item;
obj.checked = false;
that.measurelist.push(obj)
})
}
});
},
editCheckShow(risklist, measurelist) {
debugger;
let that = this;
that.$u.api.oplItem(that.oplId).then((res) => {
that.formData = res; //
@ -380,7 +396,10 @@
})
}else{
that.$u.api.oplCreate(that.formData).then(res=>{
params = `?oplId=${that.oplId}`;
uni.navigateTo({
url:'/pages/workSpace/operation/workerList'+params
})
})
}

View File

@ -235,10 +235,10 @@
} else {
that.$u.api.visitCreate(that.formData).then(res => {
if (res.err_msg) {
} else {
let params = `?visit=${res.id}`;
uni.navigateTo({
url: '/pages/workSpace/visit/vpeopleList'
url: '/pages/workSpace/visit/vpeopleList'+params
})
}
})

View File

@ -110,7 +110,7 @@
let that = this;
that.$u.api.vmVpeople({
page: 0,
visit: '1554721956950052864'
visit: that.visitId
}).then(res => {
that.vpeopleList = [];
let user = [];