| <template> | 
|     <view class="main"> | 
|         <u--form labelPosition="top" | 
|             labelWidth="20%" | 
|             :borderBottom="false" | 
|             :model="dataForm" | 
|             ref="uForm"> | 
|             <u-form-item label="煤场" | 
|                 prop="firstClass" | 
|                 :borderBottom="false"> | 
|                 <u-cell-group> | 
|                     <u-cell :title="dataForm.firstClass" | 
|                         value="请选择" | 
|                         @click="firstClassSelect"> | 
|                         <u-icon name="arrow-right" | 
|                             slot="right-icon" | 
|                             size="30"></u-icon></u-cell> | 
|                 </u-cell-group> | 
|             </u-form-item> | 
|             <u-form-item label="煤仓" | 
|                 prop="secondClass" | 
|                 :borderBottom="false"> | 
|                 <u-cell-group> | 
|                     <u-cell :title="dataForm.secondClass" | 
|                         value="请选择" | 
|                         @click="secondClassSelect"> | 
|                         <u-icon name="arrow-right" | 
|                             slot="right-icon" | 
|                             size="30"></u-icon></u-cell> | 
|                 </u-cell-group> | 
|             </u-form-item> | 
|         </u--form> | 
|         <view class="coal-name" | 
|             v-show="coalList.length!==0"> | 
|             <u-checkbox-group v-model="checkedCoal" | 
|                 placement="row" | 
|                 @change="checkboxChange" | 
|                 size="30"> | 
|                 <u-checkbox :customStyle="{marginBottom: '8px',fontSize:'20px'}" | 
|                     v-for="(item, index) in coalList" | 
|                     :key="item.id" | 
|                     :label="item.name" | 
|                     :name="item.name" | 
|                     labelSize='40' | 
|                     iconSize='40'></u-checkbox></u-checkbox-group> | 
|         </view> | 
|         <view style="margin-top: 20rpx;"> | 
|             <u-button type="primary" | 
|                 shape="circle" | 
|                 text="提交" | 
|                 @click.stop="formHandle"></u-button> | 
|         </view> | 
|         <!-- 煤场 --> | 
|         <u-action-sheet :actions="firstClassActionsList" | 
|             :show="firstClassShow" | 
|             cancelText='取消' | 
|             :closeOnClickOverlay='true' | 
|             @close='firstClassClose' | 
|             @select="firstClassSelectClick"></u-action-sheet> | 
|         <!-- 煤仓 --> | 
|         <u-action-sheet :actions="secondClassActionsList" | 
|             :show="secondClassShow" | 
|             cancelText='取消' | 
|             :closeOnClickOverlay='true' | 
|             @close='secondClassClose' | 
|             @select="secondClassSelectClick"></u-action-sheet> | 
|     </view> | 
| </template> | 
|   | 
| <script> | 
|     export default { | 
|         data() { | 
|             return { | 
|                 dataForm: { | 
|                     firstClass: "", | 
|                     secondClass: "", | 
|                 }, | 
|                 index: '', | 
|                 // 煤场操作菜单 | 
|                 firstClassActionsList: [], | 
|                 firstClassShow: false, | 
|                 // 煤仓操作菜单 | 
|                 secondClassActionsList: [], | 
|                 secondClassShow: false, | 
|                 coalList: [], | 
|                 checkedCoal: [], | 
|                 userInfo: {}, | 
|                 filedId: "", | 
|                 selectedCoal: [] | 
|             }; | 
|         }, | 
|         methods: { | 
|             getUserInfo() { | 
|                 this.$reqGet('getUserEntity').then(res => { | 
|                     this.userInfo = res.data; | 
|                     this.userInfo.password = null | 
|                 }) | 
|             }, | 
|             // 获取煤场 | 
|             getDeptIdFiled() { | 
|                 uni.showLoading({ | 
|                     title: "加载中" | 
|                 }) | 
|                 this.$reqGet('getDeptIdFiled').then(res => { | 
|                     uni.hideLoading() | 
|                     if (res.code === 0) { | 
|                         this.firstClassActionsList = res.data | 
|                     } else { | 
|                         this.$u.toast('加载失败') | 
|                     } | 
|                 }).then(() => { | 
|                     this.getUserInfo() | 
|                 }) | 
|             }, | 
|             firstClassSelect() { | 
|                 this.firstClassShow = true | 
|             }, | 
|             firstClassClose() { | 
|                 this.firstClassShow = false | 
|             }, | 
|             firstClassSelectClick(val) { | 
|                 this.dataForm.firstClass = val.name | 
|                 this.getFiledIdCoalBunker(val.id) | 
|                 this.filedId = val.id | 
|             }, | 
|             // 获取煤仓 | 
|             getFiledIdCoalBunker(filedId) { | 
|                 this.$reqGet('getFiledIdCoalBunker', { filedId, }).then(res => { | 
|                     this.secondClassActionsList = res.data | 
|                 }) | 
|             }, | 
|             //煤仓菜单 | 
|             secondClassSelect() { | 
|                 this.secondClassShow = true | 
|             }, | 
|             secondClassClose() { | 
|                 this.secondClassShow = false | 
|             }, | 
|             secondClassSelectClick(val) { | 
|                 this.dataForm.secondClass = val.name | 
|                 this.coalList = this.secondClassActionsList.find(v => v.id === val.id).coalNames.split(',').map(v => { | 
|                     return { | 
|                         name: v, | 
|                         id: Math.floor(Math.random() * 100) + 1, | 
|                         checked: false | 
|                     } | 
|                 }) | 
|                 console.log(this.coalList); | 
|             }, | 
|             checkboxChange(e) { | 
|                 this.selectedCoal = e | 
|             }, | 
|             formHandle() { | 
|                 this.$reqPost('updateUser', Object.assign(this.userInfo, { | 
|                     responsibilityCoal: this.selectedCoal.join(), | 
|                     filedId: this | 
|                         .filedId | 
|                 }), 'json').then(res => { | 
|                     uni.navigateTo({ | 
|                         url: `/pages/loadUnload-page/loadUnload-detail/loadUnload-detail` | 
|                     }) | 
|                 }) | 
|             } | 
|         } | 
|     } | 
| </script> | 
|   | 
| <style lang="scss" | 
|     scoped> | 
|     .main { | 
|         width: 94%; | 
|         margin: 10px; | 
|         // margin-top: vww(100); | 
|         position: relative; | 
|         top: vww(-120); | 
|     } | 
|   | 
|     .slide-fade-enter-active { | 
|         transition: all 0.3s ease-out; | 
|     } | 
|   | 
|     .coal-name { | 
|         width: 95%; | 
|         min-height: vww(100); | 
|   | 
|         .u-checkbox-group { | 
|             .u-checkbox {} | 
|         } | 
|     } | 
| </style> |