1
This commit is contained in:
parent
ef4d8b48b8
commit
ea18b23aff
@ -17,7 +17,7 @@
|
|||||||
<u--input fontSize="14px" disabled disabledColor="#ffffff" v-model="(model.Nav_Post||{}).NAME" border="none" suffixIcon="arrow-right" customStyle="margin:0px;display:flex;padding:3px 9px"
|
<u--input fontSize="14px" disabled disabledColor="#ffffff" v-model="(model.Nav_Post||{}).NAME" border="none" suffixIcon="arrow-right" customStyle="margin:0px;display:flex;padding:3px 9px"
|
||||||
suffixIconStyle="font-size:12px"></u--input>
|
suffixIconStyle="font-size:12px"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-button type="primary" text="查询" @click="filterData"></u-button>
|
<u-button type="primary" text="查询" @click="filterData" :disabled="loading"></u-button>
|
||||||
|
|
||||||
</u--form>
|
</u--form>
|
||||||
<u--form labelWidth="auto" :model="model" ref="wForm" class="demo-ruleForm" style="margin-top: 20px;" v-if="filterDatas&&filterDatas.Nav_Librarys&&filterDatas.Nav_Librarys.length>0">
|
<u--form labelWidth="auto" :model="model" ref="wForm" class="demo-ruleForm" style="margin-top: 20px;" v-if="filterDatas&&filterDatas.Nav_Librarys&&filterDatas.Nav_Librarys.length>0">
|
||||||
@ -26,40 +26,60 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">岗位风险清单</view>
|
<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">岗位风险清单</view>
|
||||||
<u-checkbox-group :value="checkedItems" placement="column" @change="handleCheckboxChange">
|
<uni-collapse :border="false" accordion>
|
||||||
<u-checkbox :customStyle="{marginBottom: '8px'}" label="全选" name="all">
|
<u-checkbox-group :value="checkedItems" placement="column" @change="handleCheckboxChange">
|
||||||
</u-checkbox>
|
<u-checkbox :customStyle="{marginBottom: '8px'}" label="全选" name="all">
|
||||||
<view v-for="(item, index) in filterDatas.Nav_Librarys" :key="index" style="margin-top: 10px;">
|
|
||||||
|
|
||||||
|
|
||||||
<u-checkbox :customStyle="{marginBottom: '8px'}" :key="index" :label="index+1+'.生产单元:'+item.MINE_NAME" :name="item.ID">
|
|
||||||
</u-checkbox>
|
</u-checkbox>
|
||||||
|
<view v-for="(item, index) in filterDatas.Nav_Librarys" :key="index" style="margin-top: 10px;">
|
||||||
|
|
||||||
<u-form-item label="辨识区域" prop="Nav_Contents.CHECKCONTENT" borderBottom>
|
|
||||||
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="(item.Nav_Area||{}).NAME" border="none" inputAlign="right"></u--input>
|
|
||||||
|
|
||||||
</u-form-item>
|
<uni-collapse-item title-border="none" :border="false">
|
||||||
<u-form-item label="风险名称" prop="HIDDEN_PLACE" borderBottom>
|
<template v-slot:title>
|
||||||
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.RISK_NAME" border="none" inputAlign="right"></u--input>
|
<view class="uni-collapse-item__title-box">
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="风险描述" prop="HIDDEN_PLACE" borderBottom>
|
<u-checkbox :key="index" :name="item.ID">
|
||||||
</u-form-item>
|
</u-checkbox>
|
||||||
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="item.RISK_DESCRIPTION" border="none" inputAlign="right" autoHeight></u--textarea>
|
<view class="uni-collapse-item__title-text">
|
||||||
<u-form-item label="风险类别" prop="HIDDEN_PLACE" borderBottom>
|
{{item.RISK_DESCRIPTION?index+1+'.'+item.RISK_DESCRIPTION:index+1+'.'}}
|
||||||
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="(item.Nav_Type||{}).NAME" border="none" inputAlign="right"></u--input>
|
</view>
|
||||||
</u-form-item>
|
</view>
|
||||||
<u-form-item label="风险等级" prop="HIDDEN_PLACE" borderBottom>
|
</template>
|
||||||
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.EVALUATE_LEVELName" border="none" inputAlign="right"></u--input>
|
<view class="content" style="padding: 0px 0px 0px 10px;">
|
||||||
</u-form-item>
|
<u-form-item label="生产单元" prop="Nav_Contents.CHECKCONTENT" borderBottom>
|
||||||
</view>
|
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.MINE_NAME" border="none" inputAlign="right"></u--input>
|
||||||
</u-checkbox-group>
|
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="辨识区域" prop="Nav_Contents.CHECKCONTENT" borderBottom>
|
||||||
|
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="(item.Nav_Area||{}).NAME" border="none" inputAlign="right"></u--input>
|
||||||
|
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="风险名称" prop="HIDDEN_PLACE" borderBottom>
|
||||||
|
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.RISK_NAME" border="none" inputAlign="right"></u--input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="风险描述" prop="HIDDEN_PLACE" borderBottom>
|
||||||
|
</u-form-item>
|
||||||
|
<u--textarea fontSize="14px" disabled disabledColor="#fff" v-model="item.RISK_DESCRIPTION" border="none" inputAlign="right" autoHeight></u--textarea>
|
||||||
|
<u-form-item label="风险类别" prop="HIDDEN_PLACE" borderBottom>
|
||||||
|
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="(item.Nav_Type||{}).NAME" border="none" inputAlign="right"></u--input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="风险等级" prop="HIDDEN_PLACE" borderBottom>
|
||||||
|
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.EVALUATE_LEVELName" border="none" inputAlign="right"></u--input>
|
||||||
|
</u-form-item>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</uni-collapse-item>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</u-checkbox-group>
|
||||||
|
</uni-collapse>
|
||||||
|
|
||||||
|
|
||||||
</u--form>
|
</u--form>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view style="padding: 10px 16px;" class="bottom-button" v-if="filterDatas&&filterDatas.Nav_Librarys&&filterDatas.Nav_Librarys.length>0">
|
<view style="padding: 10px 16px;" class="bottom-button" v-if="filterDatas&&filterDatas.Nav_Librarys&&filterDatas.Nav_Librarys.length>0">
|
||||||
<u-button type="primary" @click="submit" color="#3d4b70">生产岗位告知卡</u-button>
|
<u-button type="primary" @click="submit" color="#3d4b70">生成岗位告知卡</u-button>
|
||||||
</view>
|
</view>
|
||||||
<query-selector :show="selectorInfo.showPopup" :defaultChecked="selectorInfo.defaultChecked" :title="selectorInfo.title" :lists="selectorInfo.dataLists" @search="handleSearch" @select="handleSelected"
|
<query-selector :show="selectorInfo.showPopup" :defaultChecked="selectorInfo.defaultChecked" :title="selectorInfo.title" :lists="selectorInfo.dataLists" @search="handleSearch" @select="handleSelected"
|
||||||
@close="selectorInfo.showPopup=false" :total="selectorInfo.totalCount" />
|
@close="selectorInfo.showPopup=false" :total="selectorInfo.totalCount" />
|
||||||
@ -89,6 +109,7 @@
|
|||||||
pageIndex: 0,
|
pageIndex: 0,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
loading:true,
|
||||||
baseUrl: config.uni_app_web_source_url,
|
baseUrl: config.uni_app_web_source_url,
|
||||||
allData: [],
|
allData: [],
|
||||||
// 新增选中项数组,存储选中item的唯一标识
|
// 新增选中项数组,存储选中item的唯一标识
|
||||||
@ -99,22 +120,12 @@
|
|||||||
Nav_Librarys: []
|
Nav_Librarys: []
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
RISK_AREA_NAME: '请选择区域',
|
Nav_Post: {
|
||||||
RISK_AREA_ID: '',
|
|
||||||
ISDOWN: '否',
|
|
||||||
SchedulingType: '',
|
|
||||||
COUNT_WORKER: '',
|
|
||||||
COUNT_LEVEL: '',
|
|
||||||
START_TIME: '',
|
|
||||||
END_TIME: '',
|
|
||||||
SchedulingNEXTTIME: '',
|
|
||||||
LISTPERSON_SCHEDULING: [{
|
|
||||||
NAME: ''
|
NAME: ''
|
||||||
}],
|
},
|
||||||
LISTUSER_LEAVE: [{
|
Nav_Department: {
|
||||||
NAME: ''
|
NAME: ''
|
||||||
}],
|
},
|
||||||
ListShow: []
|
|
||||||
},
|
},
|
||||||
radiolist: [{
|
radiolist: [{
|
||||||
value: false,
|
value: false,
|
||||||
@ -141,6 +152,10 @@
|
|||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.OrgId = option.OrgId // 'B043B28B-BBC3-C452-6052-4FBA1457ABFA'
|
this.OrgId = option.OrgId // 'B043B28B-BBC3-C452-6052-4FBA1457ABFA'
|
||||||
|
this.model.DEPARTMENT_ID = option.DEPARTMENT_ID
|
||||||
|
this.model.POST_ID = option.POST_ID
|
||||||
|
this.inntData()
|
||||||
|
|
||||||
// const orgId = uni.getStorageSync('orgId')
|
// const orgId = uni.getStorageSync('orgId')
|
||||||
this.fetchEnums(['SKEvaluateLevelEnum', 'SKProductionUnit']);
|
this.fetchEnums(['SKEvaluateLevelEnum', 'SKProductionUnit']);
|
||||||
},
|
},
|
||||||
@ -149,6 +164,29 @@
|
|||||||
// this.$refs.uForm.setRules(this.rules)
|
// this.$refs.uForm.setRules(this.rules)
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
|
inntData() {
|
||||||
|
if (this.model.DEPARTMENT_ID) {
|
||||||
|
const json = initFilter(this.OrgId, null, "NAME", 0, 1)
|
||||||
|
json.IgnoreDataRule = true
|
||||||
|
extendRule(json, "ID", 1, this.model.DEPARTMENT_ID)
|
||||||
|
DepartOrderPaged(json).then(res => {
|
||||||
|
if (res != undefined && res.Data.length > 0) {
|
||||||
|
this.model.Nav_Department.NAME = res.Data[0].NAME
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (this.model.POST_ID) {
|
||||||
|
const jsons = initFilter(this.OrgId, null, "NAME", 0, 1)
|
||||||
|
jsons.IgnoreDataRule = true
|
||||||
|
extendRule(jsons, "ID", 1, this.model.POST_ID)
|
||||||
|
PostOrderPaged(jsons).then(res => {
|
||||||
|
if (res != undefined && res.Data.length > 0) {
|
||||||
|
this.model.Nav_Post.NAME = res.Data[0].NAME
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
async fetchEnums(enumNames) {
|
async fetchEnums(enumNames) {
|
||||||
try {
|
try {
|
||||||
// 存储所有枚举请求的Promise
|
// 存储所有枚举请求的Promise
|
||||||
@ -193,6 +231,7 @@
|
|||||||
const json = initFilter(this.OrgId, "", "")
|
const json = initFilter(this.OrgId, "", "")
|
||||||
json.IgnoreDataRule = true
|
json.IgnoreDataRule = true
|
||||||
GetPostRiskList(json).then(res => {
|
GetPostRiskList(json).then(res => {
|
||||||
|
this.loading = false
|
||||||
this.allData = res.Data
|
this.allData = res.Data
|
||||||
this.allData.map(item => {
|
this.allData.map(item => {
|
||||||
if (item.Nav_Librarys && item.Nav_Librarys.length > 0) {
|
if (item.Nav_Librarys && item.Nav_Librarys.length > 0) {
|
||||||
@ -206,7 +245,9 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
// this.total = res.TotalCount
|
// this.total = res.TotalCount
|
||||||
|
if (this.model.DEPARTMENT_ID && this.model.POST_ID) {
|
||||||
|
this.filterData()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -278,9 +319,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
filterData() {
|
filterData() {
|
||||||
|
|
||||||
|
if (!this.model.DEPARTMENT_ID || !this.model.POST_ID) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'error',
|
||||||
|
title: '请选择部门和岗位'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.checkedItems = []
|
this.checkedItems = []
|
||||||
this.allData.map(item => {
|
this.allData.map(item => {
|
||||||
if (item.DEPARTMENT_ID == this.model.DEPARTMENT_ID && item.POST_NAME == this.model.Nav_Post.NAME) {
|
// item.POST_ID == this.model.POST_ID
|
||||||
|
if (item.DEPARTMENT_ID == this.model.DEPARTMENT_ID && item.POST_ID == this.model.POST_ID) {
|
||||||
this.$set(this, 'filterDatas', item);
|
this.$set(this, 'filterDatas', item);
|
||||||
this.$nextTick(() => { // 等待 DOM 渲染新数据后再全选
|
this.$nextTick(() => { // 等待 DOM 渲染新数据后再全选
|
||||||
const allIds = this.filterDatas.Nav_Librarys.map(item1 => item1.ID);
|
const allIds = this.filterDatas.Nav_Librarys.map(item1 => item1.ID);
|
||||||
@ -289,10 +339,10 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if(!this.filterDatas||!this.filterDatas.Nav_Librarys||this.filterDatas.Nav_Librarys.length==0){
|
if (!this.filterDatas || !this.filterDatas.Nav_Librarys || this.filterDatas.Nav_Librarys.length == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon:'error',
|
icon: 'error',
|
||||||
title:'暂无当前岗位数据'
|
title: '暂无当前岗位数据',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,26 +2,21 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<u-form>
|
<u-form>
|
||||||
<view>
|
<view>
|
||||||
<u-form-item label="公司名称" @click="handleChange()" label-width='150px' style="margin: 0 20px 0 30px;"
|
<u-form-item label="公司名称" @click="handleChange()" label-width='150px' style="margin: 0 20px 0 30px;" prop="OrgId" borderBottom>
|
||||||
prop="OrgId" borderBottom>
|
<u--input disabledColor="#fff" v-model="NAME" placeholder="请选择公司名称" border="none" inputAlign="right"></u--input>
|
||||||
<u--input disabledColor="#fff" v-model="NAME" placeholder="请选择公司名称" border="none"
|
<u-icon v-if="!OrgId||OrgId.length<1" style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon>
|
||||||
inputAlign="right"></u--input>
|
|
||||||
<u-icon v-if="!OrgId||OrgId.length<1" style="margin-left: 4px;" slot="right"
|
|
||||||
name="arrow-down"></u-icon>
|
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<u-grid :border="false" :col="2">
|
<u-grid :border="false" :col="2">
|
||||||
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" bgColor="#fff">
|
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" bgColor="#fff">
|
||||||
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.iconName" :size="42"
|
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.iconName" :size="42" @click="menuClick(baseListItem)" color="#304ffe"></u-icon>
|
||||||
@click="menuClick(baseListItem)" color="#304ffe"></u-icon>
|
|
||||||
<text class="grid-text">{{baseListItem.name}}</text>
|
<text class="grid-text">{{baseListItem.name}}</text>
|
||||||
</u-grid-item>
|
</u-grid-item>
|
||||||
</u-grid>
|
</u-grid>
|
||||||
</view>
|
</view>
|
||||||
</u-form>
|
</u-form>
|
||||||
<query-selector :show="selectorInfo.showPopup" :defaultChecked="selectorInfo.defaultChecked"
|
<query-selector :show="selectorInfo.showPopup" :defaultChecked="selectorInfo.defaultChecked" :title="selectorInfo.title" :lists="selectorInfo.dataLists" @search="handleSearch" @select="handleSelected"
|
||||||
:title="selectorInfo.title" :lists="selectorInfo.dataLists" @search="handleSearch" @select="handleSelected"
|
|
||||||
@close="selectorInfo.showPopup=false" />
|
@close="selectorInfo.showPopup=false" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -148,6 +143,8 @@
|
|||||||
urlTo += '&RISK_AREA_ID=' + this.RISK_AREA_ID
|
urlTo += '&RISK_AREA_ID=' + this.RISK_AREA_ID
|
||||||
if (this.DEPARTMENT_ID && this.DEPARTMENT_ID != undefined && this.DEPARTMENT_ID.length > 1)
|
if (this.DEPARTMENT_ID && this.DEPARTMENT_ID != undefined && this.DEPARTMENT_ID.length > 1)
|
||||||
urlTo += '&DEPARTMENT_ID=' + this.DEPARTMENT_ID
|
urlTo += '&DEPARTMENT_ID=' + this.DEPARTMENT_ID
|
||||||
|
if (this.POST_ID && this.POST_ID != undefined && this.POST_ID.length > 1)
|
||||||
|
urlTo += '&POST_ID=' + this.POST_ID
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: urlTo
|
url: urlTo
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user