盲板作业

pull/5/head
chenxinying 2024-02-29 08:45:24 +08:00
parent e8ee4b5d24
commit a53064ece7
9 changed files with 572 additions and 113 deletions

View File

@ -627,6 +627,10 @@
"path": "pages/application/blindboard/blindboard-apply/blindboard-apply-detail",
"style": {}
},
{
"path": "pages/application/blindboard/blindboard-workshop/blindboard-workshop-detail",
"style": {}
},
{
"path": "pages/application/blindboard/blindboard-measures/blindboard-measures-detail",
"style": {}

View File

@ -198,7 +198,28 @@
</view>
</view>
<view class="wui-form-list" v-if="!forbidEdit">
<view class="cu-form-group" >
<view class="title">车间人员单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showWorkshopTree">{{pd.WORKSHOP_DEPARTMENT_NAME?pd.WORKSHOP_DEPARTMENT_NAME:''}}</view>
</view>
<tki-tree ref="tkiTree_workshop"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="workshoptreeConfirm"
@cancel="workshoptreeCancel"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">车间人员</view>
<picker @change="PickerWorkshop" :value="workshopindex" :range="workshopUserList" range-key="NAME" :disabled="workshopUserList.length == 0" @click="isBlankList('workshop')">
<view class="picker">
{{pd.WORKSHOP_USER_NAME?pd.WORKSHOP_USER_NAME:'请选择'}}
</view>
</picker>
</view>
</view>
<view class="wui-form-list" v-if="!forbidEdit">
<view class="cu-form-group" >
<view class="title">监护人单位</view>
@ -602,6 +623,8 @@
confirmindex:-1,
guardianUserList:[],
guardianindex:-1,
workshopUserList:[],
workshopindex: -1,
leaderUserList:[],
workUsersList:[],
workusersindex:-1,
@ -837,7 +860,7 @@
formData.OPERATOR=loginUser.USER_ID
formData.ACTION_USER=loginUser.NAME
formData.APPLY_STATUS=STATUS
formData.boardList = JSON.stringify(this.boardList)
formData.boardList = JSON.stringify(this.boardList)
formData.TASK_ID=13
this.buttonloading = true
uni.request({
@ -1009,6 +1032,15 @@
})
}
break
case 'workshop':
if(this.workshopUserList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择车间人员单位',
duration: 1500
})
}
break
case 'confess':
if(this.confessUserList.length == 0) {
uni.showToast({
@ -1111,6 +1143,9 @@
guardiantreeCancel(e) {
this.isUps=false;
},
workshoptreeCancel(e) {
this.isUps=false;
},
//
confesstreeCancel(e) {
this.isUps=false;
@ -1128,6 +1163,11 @@
this.isUps=true
this.$refs.tkiTree_guardian._show();
},
showWorkshopTree() {
this.isUps=true
this.$refs.tkiTree_workshop._show();
},
//
showConfessTree() {
this.isUps=true
@ -1142,7 +1182,12 @@
this.isUps=true
this.$refs.tkiTree_workstart._show();
},
PickerWorkshop(e) {
this.workshopindex = e.detail.value;
this.pd.WORKSHOP_USER_ID=this.workshopUserList[this.workshopindex].USER_ID;
this.pd.WORKSHOP_USER_NAME=this.workshopUserList[this.workshopindex].NAME;
this.$forceUpdate();//
},
PickerGuardian(e) {
this.guardianindex = e.detail.value;
this.pd.GUARDIAN_USER_ID=this.guardianUserList[this.guardianindex].USER_ID;
@ -1218,6 +1263,15 @@
this.$forceUpdate();//
this.getUserList(e[0].id,'guardianUserList');
},
workshoptreeConfirm(e) {
this.isUps=false;
this.pd.WORKSHOP_DEPARTMENT_ID=e[0].id;
this.pd.WORKSHOP_DEPARTMENT_NAME=e[0].name;
this.pd.WORKSHOP_USER_ID = ''
this.pd.WORKSHOP_USER_NAME = ''
this.$forceUpdate();//
this.getUserList(e[0].id,'workshopUserList');
},
// //
// guardiantreeCancel(e) {
// this.isUps=false;

View File

@ -66,10 +66,10 @@
{{boardList[index].BOARD_NO}}
</view>
</view>
<view class="cu-form-group bb-default" v-if="pd.BOARD_PATH">
<view class="title">盲板抽堵位置及安全措施</view>
</view>
<view v-if="pd.BOARD_PATH">
<view class="cu-form-group bb-default">
<view class="title">盲板抽堵位置及安全措施</view>
</view>
<view class="cu-bar">
<view class="action">
@ -86,6 +86,8 @@
</view>
</view>
</view>
</view>
<view v-if="pd.WORK_START_DATE" class="cu-form-group bb-default">
<view class="title">实际作业开始时间</view>

View File

@ -177,6 +177,10 @@
uni.navigateTo({
url: '/pages/application/blindboard/blindboard-apply/blindboard-apply-detail?BLINDBOARD_ID='+e
});
}else if(this.flow === '车间人员签字'){
uni.navigateTo({
url: '/pages/application/blindboard/blindboard-workshop/blindboard-workshop-detail?BLINDBOARD_ID='+e
});
}else if(this.flow === '设置安全措施确认人'){
uni.navigateTo({
url: '/pages/application/blindboard/blindboard-measures/blindboard-measures-detail?BLINDBOARD_ID='+e

View File

@ -7,31 +7,7 @@
<scroll-view scroll-y="false" >
<view class="form">
<detail v-if="pd.BLINDBOARD_ID" :blindboardId="pd.BLINDBOARD_ID" :showMeasures="false"></detail>
<view class="wui-form-list">
<view class="cu-form-textarea">
<view class="cu-form-title">盲板抽堵位置及安全措施</view>
</view>
<view class="cu-bar">
<view class="action" >
盲板抽堵位置图
</view>
</view>
<view class="cu-form-group">
<view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in conimgList" :key="index" @tap="viewImage(index,'conimgList')">
<image :src="baseImgPath + item.filePath" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="delImgs" data-type="2" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
<view class="solids" @tap="chooseImages()">
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
@ -128,7 +104,6 @@
measuresList:[],
modalName:null,
imgList:[],
conimgList: [],
}
},
onLoad(event){
@ -140,74 +115,7 @@
loginSession();
},
methods: {
delImgs(e) {
var _this = this;
uni.showModal({
title: '秦安双控',
content: '确定要删除这张图片吗?',
cancelColor: "#000000",
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
uni.request({
url: basePath+'/app/eightwork/deleteFile',
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
FILE_PATH:_this.conimgList[e.currentTarget.dataset.index].filePath
},
success: (res) => {
uni.showToast({
icon: 'none',
title: '删除成功',
duration: 1500
});
this.conimgList.splice(e.currentTarget.dataset.index, 1)
},
fail: (err) => {
uni.showModal({
content: "删除失败",
showCancel: false
});
}
})
}
}
})
},
chooseImages() {
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['camera', 'album'], //
success: (res) => {
uni.uploadFile({
url: basePath+'/app/eightwork/saveFile',
filePath: res.tempFilePaths[0],
name: 'file',
formData: {
CORPINFO_ID:loginUser.CORPINFO_ID,
},
success: ({data}) => {
let img = {};
img.filePath = JSON.parse(data).FILE_PATH;
this.conimgList.push(img)
console.log(this.conimgList)
},
fail: (err) => {
uni.showModal({
content: "图片上传失败",
showCancel: false
});
}
})
}
});
},
getData() {
var _this = this;
uni.showLoading({
@ -263,14 +171,7 @@
return;
}
}
if(_this.conimgList.length <= 0){
uni.showToast({
icon: 'none',
title: '请上传盲板抽堵位置图',
duration: 1500
});
return;
}
}
const formData={}
var files = [];
@ -287,9 +188,7 @@
formData.USER_ID = loginUser.USER_ID
formData.APPLY_STATUS = APPLY_STATUS
formData.PREPARERS = JSON.stringify(signers)
formData.CONIMG_PATH = this.conimgList.map(item => {
return item.filePath
}).join(",")
uni.uploadFile({
url: basePath+'app/blindboard/nextStep',
files: files,

View File

@ -0,0 +1,483 @@
<template>
<view >
<cu-custom bgColor="bg-gradual-blueness" :isBack="true" >
<block slot="backText">返回</block>
<block slot="content">车间人员签字</block>
</cu-custom>
<scroll-view scroll-y="false" >
<view class="form">
<detail v-if="pd.BLINDBOARD_ID" :blindboardId="pd.BLINDBOARD_ID"></detail>
<view class="wui-form-list">
<view class="cu-form-textarea">
<view class="cu-form-title">盲板抽堵位置及安全措施</view>
</view>
<view class="cu-bar">
<view class="action" >
盲板抽堵位置图
</view>
</view>
<view class="cu-form-group">
<view class="grid col-4 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in conimgList" :key="index" @tap="viewImage(index,'conimgList')">
<image :src="baseImgPath + item.filePath" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="delImgs" data-type="2" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
<view class="solids" @tap="chooseImages()">
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
</view>
<view class="wui-form-list">
<view class="wui-sign" >
<view class="title">车间人员</view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit(-1))"></button>
<button class="cu-btn bg-green margin-tb-sm lg" @click="$noMultipleClicks(goSubmit(1))"></button>
</view>
<view class="padding flex flex-direction">
</view>
</scroll-view>
</view>
</template>
<script>
import {
basePath,corpinfoId,deptId,loginUser,formatDate,loginSession,baseImgPath
} from '@/common/tool.js';
import tkiTree from "@/components/select-tree/select-tree.vue"
import writingBoard from "@/components/writing-board/writing-board.vue"
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/blindboard/blindboard-detail/index'
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
},
data() {
return {
baseImgPath:baseImgPath,
isUps:false,
forbidEdit:true,//
msg:'add',
files: [],
noClick:true,
treeNode:[],//
pd:{},//
measuresList:[],
modalName:null,
imgList:[],
conimgList: [],
}
},
onLoad(event){
this.todayDate = formatDate(new Date(), 'yyyy-MM-dd hh:mm');
this.pd.BLINDBOARD_ID = event.BLINDBOARD_ID;
if(this.pd.BLINDBOARD_ID){
this.msg="edit";
this.getData();
}else {
//
this.pd.APPLY_DEPARTMENT_ID = loginUser.DEPARTMENT_ID;
this.pd.APPLY_DEPARTMENT_NAME = loginUser.DEPARTMENT_NAME;
this.pd.APPLY_USER_ID = loginUser.USER_ID;
this.pd.APPLY_USER_NAME = loginUser.NAME;
this.forbidEdit = false;
}
//
this.getDept();
this.getLimitSpace();
loginSession();
},
methods: {
delImgs(e) {
var _this = this;
uni.showModal({
title: '秦安双控',
content: '确定要删除这张图片吗?',
cancelColor: "#000000",
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
uni.request({
url: basePath+'/app/eightwork/deleteFile',
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
FILE_PATH:_this.conimgList[e.currentTarget.dataset.index].filePath
},
success: (res) => {
uni.showToast({
icon: 'none',
title: '删除成功',
duration: 1500
});
this.conimgList.splice(e.currentTarget.dataset.index, 1)
},
fail: (err) => {
uni.showModal({
content: "删除失败",
showCancel: false
});
}
})
}
}
})
},
chooseImages() {
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['camera', 'album'], //
success: (res) => {
uni.uploadFile({
url: basePath+'/app/eightwork/saveFile',
filePath: res.tempFilePaths[0],
name: 'file',
formData: {
CORPINFO_ID:loginUser.CORPINFO_ID,
},
success: ({data}) => {
let img = {};
img.filePath = JSON.parse(data).FILE_PATH;
this.conimgList.push(img)
console.log(this.conimgList)
},
fail: (err) => {
uni.showModal({
content: "图片上传失败",
showCancel: false
});
}
})
}
});
},
getData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/blindboard/findById',
method: 'POST',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
BLINDBOARD_ID: _this.pd.BLINDBOARD_ID,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
if ("success" == res.data.result) {
uni.hideLoading();
_this.pd = res.data.pd; //map
} else if ("exception" == data.result) {
uni.showToast({
title: '错误',
duration: 2000
});
}
}
});
},
ViewShowImage(url) {
let files = [];
files.push(url)
uni.previewImage({
urls: files,
current: 0
});
},
uploadImgFaults(files,signtime) {
this.imgList.map((item,index) => {
var img = {}
img.name = 'file'+index
img.uri = item.filePath
files.push(img)
signtime.push(item.SIGNER_TIME)
})
},
delImg(e) {
var _this = this;
uni.showModal({
title: '秦安双控',
content: '确定要删除这张图片吗?',
cancelColor: "#000000",
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
uni.request({
url: basePath+'/app/eightwork/deleteFile',
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
FILE_PATH:_this.conimgList[e.currentTarget.dataset.index].filePath
},
success: (res) => {
uni.showToast({
icon: 'none',
title: '删除成功',
duration: 1500
});
this.conimgList.splice(e.currentTarget.dataset.index, 1)
},
fail: (err) => {
uni.showModal({
content: "删除失败",
showCancel: false
});
}
})
}
}
})
},
chooseImage() {
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['camera', 'album'], //
success: (res) => {
uni.uploadFile({
url: basePath+'/app/eightwork/saveFile',
filePath: res.tempFilePaths[0],
name: 'file',
formData: {
CORPINFO_ID:loginUser.CORPINFO_ID,
},
success: ({data}) => {
let img = {};
img.filePath = JSON.parse(data).FILE_PATH;
this.conimgList.push(img)
console.log(this.conimgList)
},
fail: (err) => {
uni.showModal({
content: "图片上传失败",
showCancel: false
});
}
})
}
});
},
goSubmit(APPLY_STATUS){
var _this = this;
let required = true
uni.showLoading({
title: '请稍候'
})
if (_this.imgList.length <= 0) {
uni.showToast({
icon: 'none',
title: '请签字',
duration: 1500
});
return;
}
if(APPLY_STATUS == 1){
if(_this.conimgList.length <= 0){
uni.showToast({
icon: 'none',
title: '请上传盲板抽堵位置图',
duration: 1500
});
return;
}
}
var files = [];
var signtime = [];
const formData={}
this.uploadImgFaults(files,signtime)
formData.SIGNTIME = signtime
formData.BLINDBOARD_ID = this.pd.BLINDBOARD_ID
formData.USER_ID = loginUser.USER_ID
formData.APPLY_STATUS = APPLY_STATUS
formData.CONIMG_PATH = this.conimgList.map(item => {
return item.filePath
}).join(",")
uni.uploadFile({
url: basePath+'app/blindboard/nextStep',
files: files,
formData:formData,
success: (res) => {
uni.showToast({
icon:'none',
title: '保存成功',
duration: 2000
});
_this.goback()
},
fail: (err) => {
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
},
//
getLimitSpace(){
var _this = this;
uni.request({
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
url: basePath + '/app/limitspace/listAllSpace?tm=' + new Date().getTime(),
data: {
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: function (res) {
_this.limitSpaceList = res.data.varList;
}
});
},
getDept() {
var _this = this;
uni.request({
url: basePath + '/app/sys/listTree',//
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
data: {
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: (res) => {
if("success" == res.data.result){
_this.treeNode=eval(res.data.zTreeNodes);
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
});
},
//
getUserList(dept,list,i){
// post
var _this=this
uni.request({
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
},
url: basePath+'/app/sys/listUser',
data: {
DEPARTMENT_ID:dept,
tm:new Date().getTime(),
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
},
success: function(res){
if("success" == res.data.result){
if(i>-1) {
_this[list][i] = [];
_this[list][i] = res.data.userList;
_this.$forceUpdate();//
}else{
_this[list]=res.data.userList;
}
}else{
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
})
},
/*
*手写板
*/
showModal(e) {
this.modalName = e.currentTarget.dataset.target
},
hideModal(e) {
this.modalName = null
},
//
subCanvas(e) {
this.imgList.splice(0,this.imgList.length);
this.imgList.push(e);
e.SIGNER_TIME = formatDate(new Date(), 'yyyy-MM-dd hh:mm');
this.hideModal()
},
ViewImage(e) {
let files =[];
files.push(e.currentTarget.dataset.url)
uni.previewImage({
urls: files,
current: e.currentTarget.dataset.url
});
},
goback(){
var pages = getCurrentPages(); //
var prePage = pages[pages.length - 2]; //
prePage.$vm.initflag = true; // A init true
uni.navigateBack({delta: 1});
uni.hideLoading();
},
radioType(e){
this.HASINSTRUCTOR = e.detail.value
},
goToEdit(){
this.forbidEdit = false;
}
}
}
</script>
<style>
</style>

View File

@ -22,7 +22,16 @@
<view>申请</view>
</view>
</navigator>
<navigator class="apps-item" hover-class="none" url="/pages/application/blindboard/blindboard-list/index?flow=车间人员签字">
<view class="imgs action">
<image src="../../../static/icon-apps/icon-yh-1.png" mode=""></image>
<view v-if="count.WORKSHOP" class="cu-tag badge">{{count.WORKSHOP}}</view>
</view>
<view class="text-semi" style="text-align: center;">
<view>车间人员</view>
<view>签字</view>
</view>
</navigator>
<navigator class="apps-item" hover-class="none" url="/pages/application/blindboard/blindboard-list/index?flow=设置安全措施确认人">
<view class="imgs action">
<image src="../../../static/icon-apps/icon-yh-1.png" mode=""></image>

View File

@ -322,7 +322,7 @@
formData.DESCR = _this.pd.DESCR?_this.pd.DESCR:"无"
formData.USER_ID = loginUser.USER_ID
formData.APPLY_STATUS = APPLY_STATUS
formData.WORK_CONTENT = _this.pd.WORK_CONTENT
formData.WORK_CONTENT = _this.pd.WORK_CONTENT?_this.pd.WORK_CONTENT:""
formData.CONIMG_PATH = this.conimgList.map(item => {
return item.filePath
}).join(",")

View File

@ -705,6 +705,10 @@
name: 'RISK_IDENTIFICATION',
message: '请输入风险辨识结果'
},
{
name: 'SPECIAL_WORK',
message: '请输入关联的其他特殊作业及安全作业票编号'
},
{
name: 'CONFIRM_USER_ID',