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"
|
||||
suffixIconStyle="font-size:12px"></u--input>
|
||||
</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 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 style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">岗位风险清单</view>
|
||||
<u-checkbox-group :value="checkedItems" placement="column" @change="handleCheckboxChange">
|
||||
<u-checkbox :customStyle="{marginBottom: '8px'}" label="全选" name="all">
|
||||
</u-checkbox>
|
||||
<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">
|
||||
<uni-collapse :border="false" accordion>
|
||||
<u-checkbox-group :value="checkedItems" placement="column" @change="handleCheckboxChange">
|
||||
<u-checkbox :customStyle="{marginBottom: '8px'}" label="全选" name="all">
|
||||
</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>
|
||||
<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>
|
||||
</u-checkbox-group>
|
||||
<uni-collapse-item title-border="none" :border="false">
|
||||
<template v-slot:title>
|
||||
<view class="uni-collapse-item__title-box">
|
||||
|
||||
<u-checkbox :key="index" :name="item.ID">
|
||||
</u-checkbox>
|
||||
<view class="uni-collapse-item__title-text">
|
||||
{{item.RISK_DESCRIPTION?index+1+'.'+item.RISK_DESCRIPTION:index+1+'.'}}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="content" style="padding: 0px 0px 0px 10px;">
|
||||
<u-form-item label="生产单元" prop="Nav_Contents.CHECKCONTENT" borderBottom>
|
||||
<u--input fontSize="14px" disabled disabledColor="#fff" v-model="item.MINE_NAME" border="none" inputAlign="right"></u--input>
|
||||
|
||||
</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>
|
||||
|
||||
</view>
|
||||
<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>
|
||||
<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" />
|
||||
@ -89,6 +109,7 @@
|
||||
pageIndex: 0,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
loading:true,
|
||||
baseUrl: config.uni_app_web_source_url,
|
||||
allData: [],
|
||||
// 新增选中项数组,存储选中item的唯一标识
|
||||
@ -99,22 +120,12 @@
|
||||
Nav_Librarys: []
|
||||
},
|
||||
model: {
|
||||
RISK_AREA_NAME: '请选择区域',
|
||||
RISK_AREA_ID: '',
|
||||
ISDOWN: '否',
|
||||
SchedulingType: '',
|
||||
COUNT_WORKER: '',
|
||||
COUNT_LEVEL: '',
|
||||
START_TIME: '',
|
||||
END_TIME: '',
|
||||
SchedulingNEXTTIME: '',
|
||||
LISTPERSON_SCHEDULING: [{
|
||||
Nav_Post: {
|
||||
NAME: ''
|
||||
}],
|
||||
LISTUSER_LEAVE: [{
|
||||
},
|
||||
Nav_Department: {
|
||||
NAME: ''
|
||||
}],
|
||||
ListShow: []
|
||||
},
|
||||
},
|
||||
radiolist: [{
|
||||
value: false,
|
||||
@ -141,6 +152,10 @@
|
||||
},
|
||||
onLoad(option) {
|
||||
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')
|
||||
this.fetchEnums(['SKEvaluateLevelEnum', 'SKProductionUnit']);
|
||||
},
|
||||
@ -149,6 +164,29 @@
|
||||
// this.$refs.uForm.setRules(this.rules)
|
||||
// },
|
||||
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) {
|
||||
try {
|
||||
// 存储所有枚举请求的Promise
|
||||
@ -193,6 +231,7 @@
|
||||
const json = initFilter(this.OrgId, "", "")
|
||||
json.IgnoreDataRule = true
|
||||
GetPostRiskList(json).then(res => {
|
||||
this.loading = false
|
||||
this.allData = res.Data
|
||||
this.allData.map(item => {
|
||||
if (item.Nav_Librarys && item.Nav_Librarys.length > 0) {
|
||||
@ -206,7 +245,9 @@
|
||||
}
|
||||
})
|
||||
// this.total = res.TotalCount
|
||||
|
||||
if (this.model.DEPARTMENT_ID && this.model.POST_ID) {
|
||||
this.filterData()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
@ -278,9 +319,18 @@
|
||||
}
|
||||
},
|
||||
filterData() {
|
||||
|
||||
if (!this.model.DEPARTMENT_ID || !this.model.POST_ID) {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '请选择部门和岗位'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.checkedItems = []
|
||||
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.$nextTick(() => { // 等待 DOM 渲染新数据后再全选
|
||||
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({
|
||||
icon:'error',
|
||||
title:'暂无当前岗位数据'
|
||||
icon: 'error',
|
||||
title: '暂无当前岗位数据',
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@ -2,26 +2,21 @@
|
||||
<view class="content">
|
||||
<u-form>
|
||||
<view>
|
||||
<u-form-item label="公司名称" @click="handleChange()" label-width='150px' style="margin: 0 20px 0 30px;"
|
||||
prop="OrgId" borderBottom>
|
||||
<u--input disabledColor="#fff" v-model="NAME" placeholder="请选择公司名称" border="none"
|
||||
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 label="公司名称" @click="handleChange()" label-width='150px' style="margin: 0 20px 0 30px;" prop="OrgId" borderBottom>
|
||||
<u--input disabledColor="#fff" v-model="NAME" placeholder="请选择公司名称" border="none" 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>
|
||||
</view>
|
||||
<view class="list">
|
||||
<u-grid :border="false" :col="2">
|
||||
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" bgColor="#fff">
|
||||
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.iconName" :size="42"
|
||||
@click="menuClick(baseListItem)" color="#304ffe"></u-icon>
|
||||
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.iconName" :size="42" @click="menuClick(baseListItem)" color="#304ffe"></u-icon>
|
||||
<text class="grid-text">{{baseListItem.name}}</text>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
</u-form>
|
||||
<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" />
|
||||
</view>
|
||||
</template>
|
||||
@ -148,6 +143,8 @@
|
||||
urlTo += '&RISK_AREA_ID=' + this.RISK_AREA_ID
|
||||
if (this.DEPARTMENT_ID && this.DEPARTMENT_ID != undefined && this.DEPARTMENT_ID.length > 1)
|
||||
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({
|
||||
url: urlTo
|
||||
|
||||
Loading…
Reference in New Issue
Block a user