This commit is contained in:
shijing 2022-10-13 14:49:42 +08:00
parent ff0a680f4c
commit d242a5e7c2
2 changed files with 53 additions and 35 deletions

View File

@ -54,36 +54,41 @@
</uni-data-select>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-item border-bottom" style="position: relative;">
<view class="form-left">
<text class="star">*</text>
<text class="form-left-text">作业部门</text>
</view>
<view class="form-right">
<uni-data-picker placeholder="请选择业务部门" popup-title="请选择业务部门" :localdata="depRange"
v-model="formData.dept_do">
</uni-data-picker>
<ba-tree-picker ref="deptDoPicker" :multiple='false' @select-change="deptDoChange" title="选择业务部门"
:localdata="depRange" valueKey="id" textKey="name" childrenKey="children"/>
<text type="text">{{dept_do_name}}</text>
<uni-icons style="position: absolute; right: 0;" @click="showDeptDoPicker" type="arrowright" color="#999999"/>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-item border-bottom" style="position: relative;">
<view class="form-left">
<text class="star">*</text>
<text class="form-left-text">作业负责人</text>
</view>
<view class="form-right">
<uni-data-select v-model="formData.charger" :localdata="userRange">
</uni-data-select>
<ba-tree-picker ref="charger_Picker" :multiple='false' @select-change="select_charger_Change" title="选择部门协调员"
:localdata="vuex_userRange" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
<text type="text">{{charger_name}}</text>
<uni-icons style="position: absolute; right: 0;" @click="showChargerPicker" type="arrowright" color="#999999"/>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-item border-bottom" style="position: relative;">
<view class="form-left">
<text class="star">*</text>
<text class="form-left-text">作业监护人</text>
</view>
<view class="form-right">
<uni-data-select v-model="formData.monitor" :localdata="userRange">
</uni-data-select>
<ba-tree-picker ref="monitor_Picker" :multiple='false' @select-change="select_monitor_Change" title="选择部门协调员"
:localdata="vuex_userRange" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
<text type="text">{{monitor_name}}</text>
<uni-icons style="position: absolute; right: 0;" @click="showMonitorPicker" type="arrowright" color="#999999"/>
</view>
</view>
<view class="form-item border-bottom" style="height: fit-content;">
@ -153,8 +158,14 @@
</template>
<script>
import baTreePicker from "../../comm/ba-tree-picker/ba-tree-picker.vue";
import nonNullCheck from '../../../utils/nonNullCheck.js';
import resetData from '../../../utils/common.js';
export default {
name: "fire",
components: {
baTreePicker
},
data() {
return {
formData: {
@ -181,7 +192,7 @@
risklist: [],
measurelist: [],
range: [],
userRange: [],
//
depRange: [],
leveloptions: [{
@ -197,6 +208,9 @@
text: "二级动火"
},
],
dept_do_name:'',
charger_name:'',
monitor_name:'',
}
},
onLoad(params) {
@ -219,13 +233,32 @@
},
onShow() {
debugger;
this.getdept();
this.getRange();
this.getUserRange();
this.getHeader();
},
methods: {
showDeptDoPicker() {
this.$refs.deptDoPicker._show();
},
showChargerPicker() {
this.$refs.charger_Picker._show();
},
showMonitorPicker() {
this.$refs.monitor_Picker._show();
},
deptDoChange(ids, names) {
this.formData.dept_do = ids[0];
this.dept_do_name = names;
},
select_charger_Change(ids, names) {
this.formData.charger = ids[0];
this.charger_name = names;
},
select_monitor_Change(ids, names) {
this.formData.monitor = ids[0];
this.monitor_name = names;
},
getHeader() {
this.header = {
Authorization: "Bearer " + this.vuex_token
@ -245,7 +278,10 @@
let that = this;
that.$u.api.oplItem(that.oplId).then((res) => {
that.formData = res; //
that.operationName = res.operation_.name
that.operationName = res.operation_.name;
that.dept_do_name = res.dept_do_.name;
that.charger_name = res.charger_.name;
that.monitor_name = res.monitor_.name;
this.getOplcates()
});
@ -277,7 +313,7 @@
});
},
editCheckShow() {
debugger;
// debugger;
let that = this;
that.risklist.forEach(item => {
if (this.formData.risks_checked.indexOf(item.id) > -1) {
@ -314,25 +350,7 @@
this.range = range
})
},
//
getUserRange() {
this.$u.api.userList({
page: 0
}).then(res => {
let user = [];
let obj = {};
res.forEach(item => {
obj = {
value: null,
text: ''
};
obj.value = item.id;
obj.text = item.name;
user.push(obj);
})
this.userRange = user
})
},
//dept
getdept() {
let that = this;

View File

@ -63,7 +63,7 @@
</view>
<view class="form-right" style="position: relative;">
<ba-tree-picker ref="dcoordinator_Picker" :multiple='false' @select-change="select_coordinator_Change" title="选择部门协调员"
:localdata="userRange" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
:localdata="vuex_userRange" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
<text type="text">{{dcoordinator_name}}</text>
<uni-icons style="position: absolute; right: 0;" @click="showDcoordinatorPicker" type="arrowright" color="#999999"/>
</view>