This commit is contained in:
曹前明 2022-08-05 16:58:07 +08:00
commit ed09fd07fa
14 changed files with 487 additions and 48 deletions

View File

@ -53,6 +53,9 @@ const install = (Vue, vm) => {
let oplLists = (data = {}) => vm.$u.get('/opm/opl/', data); //作业许可证 let oplLists = (data = {}) => vm.$u.get('/opm/opl/', data); //作业许可证
let oplCate = (data = {}) => vm.$u.get('/opm/opl_cate/', data); //作业许可证类型 let oplCate = (data = {}) => vm.$u.get('/opm/opl_cate/', data); //作业许可证类型
let oplCateItem = (id) => vm.$u.get(`/opm/opl_cate/${id}/`); //作业许可证类型详情 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 rpjList = (data = {}) => vm.$u.get(`/rpm/rpj/`, data); //rpj查询 let rpjList = (data = {}) => vm.$u.get(`/rpm/rpj/`, data); //rpj查询
let rpjItem = (id) => vm.$u.get(`/rpm/rpj/${id}`); //rpj查询 let rpjItem = (id) => vm.$u.get(`/rpm/rpj/${id}`); //rpj查询
@ -113,6 +116,9 @@ const install = (Vue, vm) => {
oplLists, oplLists,
oplItem, oplItem,
oplCate, oplCate,
oplCreate,
oplUpdate,
oplWorker,
areaLists areaLists
}; };

View File

@ -148,6 +148,14 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/workSpace/operation/workerList",
"style": {
"navigationBarTitleText": "选择工作人员",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/workSpace/visit/visitList", "path": "pages/workSpace/visit/visitList",
"style": { "style": {

View File

@ -2,11 +2,28 @@
<view class="list-body"> <view class="list-body">
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="400rpx" leftText="添加作业许可证" <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> leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<view class="apply-info"> <view class="oplCate-info">
<view class="uni-list-cell uni-list-cell-pd" v-for="row in oplCateList" :key="row.id"> <view class="oplCate-info-title">已添加许可证</view>
<view class="uni-list-cell uni-list-cell-pd" v-for="item in oplList" :key="item.id" @click="addCate(item,'edit')">
<view> <view>
<view class="name" @click="addCate(row)">{{row.name}}</view> <view class="name">{{item.name}}</view>
<view class="name">{{item.cate_name}}</view>
<view class="name">{{item.level}}</view>
</view> </view>
<view>
<view class="oplEditImg"></view>
<!-- <image class="oplEditImg" :src="require('@/static/workSpace/new_apply/update.png')" mode="widthFix"></image> -->
</view>
</view>
</view>
<view class="oplCate-info">
<view class="oplCate-info-title">添加新许可证</view>
<view class="uni-list-cell uni-list-cell-pd" v-for="row in oplCateList" :key="row.id" @click="addCate(row,'add')">
<view>
<view class="name">{{row.name}}</view>
</view>
<image class="oplAddImg" :src="require('@/static/common/addIcon.png')" mode="widthFix">
</image>
</view> </view>
<!-- <checkbox-group @change="checkboxChange"> <!-- <checkbox-group @change="checkboxChange">
<label class="uni-list-cell uni-list-cell-pd" v-for="row in oplCateList" :key="row.id"> <label class="uni-list-cell uni-list-cell-pd" v-for="row in oplCateList" :key="row.id">
@ -36,6 +53,7 @@
name: '', name: '',
}, },
oplCateList: [], oplCateList: [],
oplList: [],
} }
}, },
onLoad(params) { onLoad(params) {
@ -45,9 +63,10 @@
}, },
onShow() { onShow() {
this.getOplCate(); this.getOplCate();
this.getOplLists();
}, },
methods: { methods: {
// //
getOplCate() { getOplCate() {
this.$u.api.oplCate({ this.$u.api.oplCate({
page: 0 page: 0
@ -57,12 +76,32 @@
this.oplCateList = res; this.oplCateList = res;
}) })
}, },
addCate(row) { //
const params = `?oplcateId=${row.id}&operationId=${this.operationId}&type='add'`; getOplLists() {
uni.navigateTo({ this.$u.api.oplLists({
url: '../opls/fire' + params operation: this.operationId
}).then(res => {
debugger;
console.log(res)
this.oplList = res.results;
}) })
}, },
addCate(row,type) {
let params=null,oplCate = '';
if(type==='edit'){
oplCate = row.cate_name;
params = `?oplId=${row.id}&oplcateId=${row.cate_.id}&operationId=${this.operationId}&type=${type}`;
}else{
oplCate = row.name;
params = `?oplcateId=${row.id}&operationId=${this.operationId}&type=${type}`;
}
if(oplCate==='动火'){
uni.navigateTo({
url: '../opls/fire' + params
})
}
},
select(row) {}, select(row) {},
goBack() { goBack() {
uni.navigateBack({ uni.navigateBack({
@ -91,8 +130,7 @@
padding-bottom: 113px; padding-bottom: 113px;
} }
.apply-info { .oplCate-info {
min-height: 70vh;
width: 360px; width: 360px;
margin: 0 auto; margin: 0 auto;
background-color: #FFFFFF; background-color: #FFFFFF;
@ -102,6 +140,14 @@
margin-top: 12px; margin-top: 12px;
} }
.oplCate-info-title {
font-size: 32upx;
color: #333333;
font-weight: bold;
border-bottom: 1upx solid #eeeeee;
height: 70upx;
}
.row { .row {
padding: 10upx; padding: 10upx;
margin-bottom: 20upx; margin-bottom: 20upx;
@ -111,12 +157,26 @@
.uni-list-cell { .uni-list-cell {
display: flex; display: flex;
padding: 10upx; padding: 10upx;
margin-bottom: 20upx;
padding: 30upx 0; padding: 30upx 0;
justify-content: space-between;
border-bottom: 1upx solid #eeeeee; border-bottom: 1upx solid #eeeeee;
} }
.uni-list-cell:last-child {
border-bottom: 0;
}
.oplEditImg {
width: 40rpx;
height: 40upx;
background-size: cover;
background-image: url('@/static/workSpace/new_apply/update.png');
}
.oplAddImg {
width: 40rpx;
height: 40upx;
}
.add { .add {
position: fixed; position: fixed;
bottom: 0; bottom: 0;

View File

@ -0,0 +1,296 @@
<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 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>
</view>
<view class="right">
<view class="icon bianji" @tap.stop="edit(row)">
</view>
</view>
</view>
<button type="primary" class="select" @click="checkPeople">选择人员</button>
</view>
<button type="primary" class="addNew" @click="add">新增人员</button>
<view class="dialogWrap" v-if="limitedPeople">
<view class="dialogCont">
<view class="dialogTitle">
<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>
</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>
</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>
</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 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>
</view>
</view>
</template>
<script>
export default {
name: "workerList",
data() {
return {
limitedPeople: false,
formData: {
opl: '',
worker: '',
duty: null,
certificates:[],
},
initform: {},
workerList: [],
workerRange: [],
dutyRange: [],
certificateRange: [],
}
},
onLoad(params) {
this.oplId = params.oplId;
},
onShow() {
this.getWorkerList();
this.getWorkerRange();
// this.getVpeopleList();
this.getInit();
},
methods: {
formSubmit(val) {
let that = this;
that.formData.oplId = that.oplId;
that.$u.api.oplWorkerCreate(that.formData).then(res => {
if (res.err_msg) {} else {
that.getWorkerList();
this.limitedPeople = false;
}
})
},
//
getWorkerRange() {
let that = this;
that.$u.api.userList({
page: 0
}).then(res => {
that.userRange = [];
let user = [];
let obj = {};
res.forEach(item => {
obj = item;
obj.value = item.id;
obj.text = item.name;
user.push(obj);
})
that.userRange = user
})
},
//
getWorkerList() {
let that = this;
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
})
},
checkPeople() {
this.limitedPeople = true;
},
closeDialog() {
this.limitedPeople = false;
},
select(row) {},
goBack() {
uni.navigateBack({
delta: 1
})
},
add() {
uni.navigateTo({
url: '/pages/workSpace/newWork/addUser'
})
},
edit(row) {},
getInit() {
this.$u.api.workflowInit('Fire').then((res) => {
this.initform = res;
});
},
//
submitticket(id) {
let ticket = {};
ticket.workflow = this.initform.workflow;
ticket.ticket_data = {
opl: this.oplId
};
ticket.transition = id;
this.$u.api.ticketCreate(ticket).then((res) => {
if(res.err_msg){}else{
uni.reLaunch({
url: '/pages/workSpace/workSpace'
})
}
});
}
}
}
</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: 1px solid #eeeeee;
display: flex;
justify-content: space-between;
}
.uni-form-item {
height: 160rpx;
}
.uni-form-item>.title {
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
}
.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;
}
</style>

View File

@ -50,7 +50,7 @@
<text class="form-left-text">作业级别</text> <text class="form-left-text">作业级别</text>
</view> </view>
<view class="form-right"> <view class="form-right">
<uni-data-select v-model="formData.level" :localdata="leveloptions" > <uni-data-select v-model="formData.level" :localdata="leveloptions">
</uni-data-select> </uni-data-select>
</view> </view>
</view> </view>
@ -82,7 +82,7 @@
<text class="form-left-text">作业监护人</text> <text class="form-left-text">作业监护人</text>
</view> </view>
<view class="form-right"> <view class="form-right">
<uni-data-select v-model="formData.monitor" :localdata="userRange" > <uni-data-select v-model="formData.monitor" :localdata="userRange">
</uni-data-select> </uni-data-select>
</view> </view>
</view> </view>
@ -93,8 +93,8 @@
<!-- risks_checked --> <!-- risks_checked -->
</view> </view>
<view class="form-right"> <view class="form-right">
<checkbox-group> <checkbox-group @change="checkboxRiskChange">
<label v-for="(item,index) in risklist" :key="item.value"> <label v-for="(item,index) in risklist" :key="item.value">
<checkbox :value="item.id" :checked="item.checked" />{{item.name}} <checkbox :value="item.id" :checked="item.checked" />{{item.name}}
</label> </label>
</checkbox-group> </checkbox-group>
@ -116,9 +116,10 @@
<!-- measures_checked --> <!-- measures_checked -->
</view> </view>
<view class="form-right"> <view class="form-right">
<checkbox-group> <checkbox-group @change="checkboxMeasuresChange">
<label v-for="(item,index) in measurelist" :key="item.value" style="margin-right: 20rpx;margin-bottom: 20rpx;"> <label v-for="(item,index) in measurelist" :key="item.value"
<checkbox :value="item.id" :checked="item.checked" />{{item.name}} style="margin-right: 20rpx;margin-bottom: 20rpx;">
<checkbox :value="item.id" :checked="item.checked" />{{item.name}}
</label> </label>
</checkbox-group> </checkbox-group>
</view> </view>
@ -132,9 +133,9 @@
<input type="text" v-model="formData.other_emr" maxlength="50" placeholder="请输入" /> <input type="text" v-model="formData.other_emr" maxlength="50" placeholder="请输入" />
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<button type="primary" class="save-btn" @click="saveSubmit">下一步</button> <button type="primary" class="save-btn" @click="saveSubmit">下一步</button>
@ -162,6 +163,7 @@
risks_checked: [], risks_checked: [],
measures_checked: [], measures_checked: [],
}, },
oplId: null,
operationName: '', operationName: '',
oplCateName: '', oplCateName: '',
risklist: [], risklist: [],
@ -190,6 +192,11 @@
console.log(params) console.log(params)
this.operationId = params.operationId; this.operationId = params.operationId;
this.oplcateId = params.oplcateId; this.oplcateId = params.oplcateId;
this.type = params.type;
if (params.oplId) {
this.oplId = params.oplId;
this.formData.id = params.oplId;
}
this.formData.cate = this.oplcateId; this.formData.cate = this.oplcateId;
this.formData.operation = this.operationId; this.formData.operation = this.operationId;
}, },
@ -212,39 +219,70 @@
console.log(res); console.log(res);
}); });
}, },
// getOplDetail(){
// let that = this;
// that.$u.api.oplItem(that.oplId).then((res) => {
// that.formData = res; //
// debugger;
// console.log(res);
// });
// },
//ID===> //ID===>
getOplcates() { getOplcates() {
let that = this; let that = this;
that.$u.api.oplCateItem(that.oplcateId).then((res) => { that.$u.api.oplCateItem(that.oplcateId).then((res) => {
console.log(res); // console.log(res); //
that.risklist = [];
that.measurelist = [];
that.oplCateName = res.name; that.oplCateName = res.name;
that.oplcateCode = res.code; that.oplcateCode = res.code;
let risklist = res.risk_options_; // if (that.oplId !== null) {
that.risklist = []; that.editCheckShow(res.risk_options_, res.measure_options_);
risklist.forEach(item=>{ }
});
},
editCheckShow(risklist, measurelist) {
let that = this;
that.$u.api.oplItem(that.oplId).then((res) => {
that.formData = res; //
risklist.forEach(item => {
let obj = {}; let obj = {};
obj=item; obj = item;
obj.checked = false; if (res.risks_checked.indexOf(item.id) > -1) {
obj.checked = true;
} else {
obj.checked = false;
}
that.risklist.push(obj) that.risklist.push(obj)
}) })
let measurelist = res.measure_options_; // measurelist.forEach(item => {
that.measurelist = [];
measurelist.forEach(item=>{
let obj = {}; let obj = {};
obj=item; obj = item;
obj.checked = false; if (res.measures_checked.indexOf(item.id) > -1) {
obj.checked = true;
} else {
obj.checked = false;
}
that.measurelist.push(obj) that.measurelist.push(obj)
}) })
debugger;
console.log(res);
}); });
}, },
// //
getRange() { getRange() {
this.$u.api.areaLists({page: 0}).then(res => { this.$u.api.areaLists({
page: 0
}).then(res => {
let range = []; let range = [];
let obj = {}; let obj = {};
res.forEach(item => { res.forEach(item => {
obj = {value: null,text: ''}; obj = {
value: null,
text: ''
};
obj.value = item.id; obj.value = item.id;
obj.text = item.name; obj.text = item.name;
range.push(obj); range.push(obj);
@ -254,11 +292,16 @@
}, },
// //
getUserRange() { getUserRange() {
this.$u.api.userList({page: 0}).then(res => { this.$u.api.userList({
page: 0
}).then(res => {
let user = []; let user = [];
let obj = {}; let obj = {};
res.forEach(item => { res.forEach(item => {
obj = {value: null,text: ''}; obj = {
value: null,
text: ''
};
obj.value = item.id; obj.value = item.id;
obj.text = item.name; obj.text = item.name;
user.push(obj); user.push(obj);
@ -269,9 +312,11 @@
//dept //dept
getdept() { getdept() {
let that = this; let that = this;
that.$u.api.deptList({page: 0}).then(res => { that.$u.api.deptList({
page: 0
}).then(res => {
that.depRange = that.redata(res); that.depRange = that.redata(res);
console.log(that.depRange) console.log(that.depRange)
}) })
}, },
@ -301,21 +346,44 @@
console.log(arr); console.log(arr);
return arr; return arr;
}, },
checkboxRiskChange(e) {
let values = e.detail.value;
this.formData.risks_checked = values;
// debugger;
// console.log(this.formData.risks_checked);
},
checkboxMeasuresChange(e) {
let values = e.detail.value;
this.formData.measures_checked = values;
// debugger;
// console.log(this.formData.measures_checked);
},
select(row) {}, select(row) {},
goBack() { goBack() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
}, },
add() {
uni.navigateTo({
url: '/pages/workSpace/newWork/addUser'
})
},
edit(row) {}, edit(row) {},
saveSubmit(){ saveSubmit() {
// debugger;
let that = this;
let params=null;
console.log(this.formData);
if (that.oplId !== null) {
that.$u.api.oplUpdate(that.oplId,that.formData).then(res=>{
params = `?oplId=${that.oplId}`;
uni.navigateTo({
url:'/pages/workSpace/operation/workerList'+params
})
})
}else{
that.$u.api.oplCreate(that.formData).then(res=>{
})
}
}, },
} }
} }
@ -414,10 +482,11 @@
.form-date>>>.uni-icons { .form-date>>>.uni-icons {
display: none; display: none;
} }
.form-right>>>.uni-label-pointer{
.form-right>>>.uni-label-pointer {
min-width: 50%; min-width: 50%;
display: inline-block; display: inline-block;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.apply-reason-text { .apply-reason-text {

BIN
static/common/addIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB