259 lines
9.6 KiB
Vue
259 lines
9.6 KiB
Vue
|
|
<template>
|
||
|
|
<view class="page-wrap" v-bind:style="{paddingBottom:paddingBottom+'px'}">
|
||
|
|
<view class="background"></view>
|
||
|
|
<view class="card">
|
||
|
|
<!-- <uni-card margin="0" :is-shadow="true"> -->
|
||
|
|
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" class="demo-ruleForm">
|
||
|
|
<view style="position: relative;">
|
||
|
|
<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">基本信息</view>
|
||
|
|
|
||
|
|
<u-form-item label="检查时间" prop="CHECK_TIME" borderBottom>
|
||
|
|
<u--input v-if="model.Nav_Task&&model.Nav_Task.CHECK_TIME" disabledColor="#fff" disabled v-model="model.Nav_Task.CHECK_TIME" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
</u-form-item>
|
||
|
|
|
||
|
|
<u-form-item label="检查类型" prop="Nav_CheckType" borderBottom>
|
||
|
|
<u--input v-if="model.Nav_Task&&model.Nav_Task.Nav_CheckType" disabledColor="#fff" disabled v-model="model.Nav_Task.Nav_CheckType.NAME" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
|
||
|
|
<u-form-item label="检查区域" prop="Nav_ListArea" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="model.Nav_ListAreas" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="检查人员" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="model.CHECKUSERS" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
|
||
|
|
</u--form>
|
||
|
|
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" errorType="border-bottom" ref="sForm" class="sub-form" style="margin-top: 10px;">
|
||
|
|
<view style="position: relative;">
|
||
|
|
<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">检查内容</view>
|
||
|
|
|
||
|
|
<uni-collapse :border="false" accordion>
|
||
|
|
<view v-for="(item, index) in model.Nav_Details" :key="index">
|
||
|
|
<uni-collapse-item title-border="none" :border="false">
|
||
|
|
<template v-slot:title>
|
||
|
|
<view class="uni-collapse-item__title-box">
|
||
|
|
<view class="uni-collapse-item__title-text">
|
||
|
|
{{index+1+'.'+item.CHECK_CONTENT}}
|
||
|
|
</view>
|
||
|
|
<text style="color: #e45656;" size="12" v-if="item.ISORNOT==1">【 异常 】</text>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
<view class="content" style="margin: 0px 10px;">
|
||
|
|
<u-form-item label="生产单元:" prop="MineType" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.MineTypes" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="检查区域" prop="Nav_ListArea" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.Nav_Area.AREA" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
<!-- <u-icon style="margin-left: 4px;" name="arrow-down" size="12"></u-icon> -->
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="检查内容" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.CHECK_CONTENT" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="检查依据" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.CHECK_BASIS" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="是否异常" prop="ISORNOTShow" borderBottom>
|
||
|
|
<u--input disabled disabledColor="#fff" v-model="item.ISORNOTShow" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="问题描述" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.REMARK" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="隐患地点" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.ADRESS" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
</u-form-item>
|
||
|
|
<u-form-item label="整改期限" prop="CHECK_TIME" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.END_TIME" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
|
||
|
|
<u-form-item label="整改责任单位" prop="Nav_Project.NAME" borderBottom>
|
||
|
|
<u--input disabledColor="#fff" disabled v-model="item.Nav_Project.UNIT_NAME" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||
|
|
|
||
|
|
</u-form-item>
|
||
|
|
<view class="upload-title">附件</view>
|
||
|
|
<full-upload v-model="item.Nav_Files" :isShowBtn='false' :listProp='listPropUpload' :listPropVal='listPropValUpload'></full-upload>
|
||
|
|
|
||
|
|
</view>
|
||
|
|
|
||
|
|
|
||
|
|
</uni-collapse-item>
|
||
|
|
<!-- <u-collapse-item :title="item.ROW_NUM + '. ' + item.MEASURE+' - '+transLevel(item.ISORNOT)+' - '+item.REMARK">
|
||
|
|
</u-collapse-item> -->
|
||
|
|
</view>
|
||
|
|
</uni-collapse>
|
||
|
|
</u--form>
|
||
|
|
<check-action v-if="isLoadOK&&tableKey==1&&isAudit" :okApi="okApi" :refuseApi="refuseApi" :dataSource="auditModel"></check-action>
|
||
|
|
</view>
|
||
|
|
<view class="bottom-button" style="padding: 10px 16px;" v-if="isLoadOK&&tableKey==1&&isSign">
|
||
|
|
<u-button type="primary" @click="onTableBtnAgree" color="#3d4b70">确认</u-button>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import {
|
||
|
|
initFilter,
|
||
|
|
extendRule,
|
||
|
|
extendInclude
|
||
|
|
} from '../../../../utils/common'
|
||
|
|
|
||
|
|
import {
|
||
|
|
WBSCRecSign,
|
||
|
|
WBSCTRecGetSign
|
||
|
|
} from '../../../../services/apply/subPages/scWB';
|
||
|
|
import '../../../../utils/showMsg.js'
|
||
|
|
import color from '../../../../uni_modules/uview-ui/libs/config/color'
|
||
|
|
import config from '../../../../config/common'
|
||
|
|
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
model: {},
|
||
|
|
listPropUpload: ['PARENT_ID'],
|
||
|
|
listPropValUpload: [],
|
||
|
|
paddingBottom: '150',
|
||
|
|
TaskID: "",
|
||
|
|
tableKey: '0',
|
||
|
|
isLoadOK: false,
|
||
|
|
isSign: true,
|
||
|
|
isAudit: true,
|
||
|
|
DEALOPINION: "",
|
||
|
|
ORG_ID: uni.getStorageSync('orgId'),
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onLoad(option) {
|
||
|
|
this.model.ID = option.ID;
|
||
|
|
this.TaskID = option.taskID;
|
||
|
|
this.tableKey = option.tableKey ? option.tableKey : '0'
|
||
|
|
this.okApi = option.okApi
|
||
|
|
this.refuseApi = option.refuseApi
|
||
|
|
this.auditModel = {
|
||
|
|
...this.$store.state.auditModel,
|
||
|
|
TaskID: option.taskID ? option.taskID : ''
|
||
|
|
}
|
||
|
|
this.loadData()
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
transLevel(level) {
|
||
|
|
if (level == 0) {
|
||
|
|
return '否';
|
||
|
|
}
|
||
|
|
if (level == 1) {
|
||
|
|
return '是 ';
|
||
|
|
}
|
||
|
|
},
|
||
|
|
getDepartmentName(value) {
|
||
|
|
const codeMap = {
|
||
|
|
'0': '全公司',
|
||
|
|
'10': '选矿厂',
|
||
|
|
'20': '露天矿',
|
||
|
|
'30': '尾矿库',
|
||
|
|
'40': '地下矿'
|
||
|
|
};
|
||
|
|
|
||
|
|
// 去除首尾下划线并分割
|
||
|
|
const codes = value.replace(/^_+|_+$/g, '').split('_');
|
||
|
|
|
||
|
|
// 映射代码到部门名称并过滤无效代码
|
||
|
|
const departments = codes
|
||
|
|
.map(code => codeMap[code])
|
||
|
|
.filter(name => name);
|
||
|
|
|
||
|
|
// 拼接结果,若为空则返回未知部门
|
||
|
|
return departments.length > 0 ? departments.join('、') : '未知部门';
|
||
|
|
},
|
||
|
|
loadData() {
|
||
|
|
const json = initFilter(this.ORG_ID)
|
||
|
|
extendRule(json, 'ID', 1, this.model.ID);
|
||
|
|
extendInclude(json, 'Nav_Task')
|
||
|
|
extendInclude(json, 'Nav_Task.Nav_CheckType')
|
||
|
|
extendInclude(json, 'Nav_Task.Nav_ListArea.Nav_CheckArea')
|
||
|
|
extendInclude(json, 'Nav_TaskDetail.Nav_Users.Nav_User')
|
||
|
|
extendInclude(json, 'Nav_Details.Nav_Project')
|
||
|
|
extendInclude(json, 'Nav_Details.Nav_Area')
|
||
|
|
extendInclude(json, 'Nav_Details.Nav_Files.Nav_ImgFile')
|
||
|
|
WBSCTRecGetSign(json).then(res => {
|
||
|
|
this.model = res
|
||
|
|
// this.model.MineType = this.getDepartmentName(res.MineType)
|
||
|
|
let arr = ''
|
||
|
|
res.Nav_Task.Nav_ListArea.map(item => {
|
||
|
|
|
||
|
|
if (item.Nav_CheckArea && item.Nav_CheckArea.AREA) {
|
||
|
|
arr += item.Nav_CheckArea.AREA
|
||
|
|
}
|
||
|
|
|
||
|
|
})
|
||
|
|
this.model.Nav_ListAreas = arr
|
||
|
|
let arrs = ''
|
||
|
|
this.model.Nav_Details.map(item => {
|
||
|
|
|
||
|
|
if (item.Nav_TaskDetail.Nav_Users && item.Nav_TaskDetail.Nav_Users.length > 0) {
|
||
|
|
item.Nav_TaskDetail.Nav_Users.map(item1 => {
|
||
|
|
if (arrs.indexOf(item1.Nav_User.NAME) < 0)
|
||
|
|
arrs += " " + item1.Nav_User.NAME
|
||
|
|
})
|
||
|
|
}
|
||
|
|
item.Nav_Project = {
|
||
|
|
UNIT_NAME: !item.Nav_Project ? '' : item.Nav_Project.UNIT_NAME ? item.Nav_Project.UNIT_NAME : ''
|
||
|
|
}
|
||
|
|
item.Nav_Area = {
|
||
|
|
AREA: !item.Nav_Area ? '' : item.Nav_Area.AREA ? item.Nav_Area.AREA : ''
|
||
|
|
}
|
||
|
|
let MineTypeName = {
|
||
|
|
0: '全公司',
|
||
|
|
10: '选矿厂',
|
||
|
|
20: '尾矿库',
|
||
|
|
30: '露天矿',
|
||
|
|
40: '地下矿',
|
||
|
|
}
|
||
|
|
item.MineTypes = MineTypeName[item.MineType]
|
||
|
|
item.ISORNOTShow = item.ISORNOT == 0 ? '否' : '是'
|
||
|
|
})
|
||
|
|
this.model.CHECKUSERS = arrs
|
||
|
|
if (this.tableKey == '2' || this.tableKey == undefined) {
|
||
|
|
this.isSign = false;
|
||
|
|
} else if (this.model.STATUS < 20) {
|
||
|
|
this.isSign = true;
|
||
|
|
this.isAudit = false;
|
||
|
|
} else if (this.model.STATUS == 20 && this.tableKey == '1') {
|
||
|
|
this.isSign = false;
|
||
|
|
this.isAudit = true;
|
||
|
|
}
|
||
|
|
this.isLoadOK = true
|
||
|
|
})
|
||
|
|
},
|
||
|
|
onTableBtnAgree() {
|
||
|
|
const json = initFilter(this.ORG_ID)
|
||
|
|
json.Parameter1 = this.model.TASK_ID;
|
||
|
|
json.Parameter2 = this.TaskID;
|
||
|
|
json.Parameter3 = uni.getStorageSync('appInfo')?.User?.ID || ''
|
||
|
|
json.Parameter4 = this.model.ID;
|
||
|
|
WBSCRecSign(json).then(res => {
|
||
|
|
if (res) {
|
||
|
|
uni.$showMsgFunc('操作成功!', () => {
|
||
|
|
uni.navigateBack()
|
||
|
|
}, 'success', 1000)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style>
|
||
|
|
/* @import url("../../../../style/css/editTemplate.css"); */
|
||
|
|
@import url("../../../../style/css/newTemplate.css");
|
||
|
|
</style>
|