| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="fp"> |
| | | <view class="fp_list"> |
| | | <view class="fp_list_item"> |
| | | <view class="fp_list_item_left"> |
| | | <text style="color: #f00;">*</text> |
| | | <text>计åç产æ°éï¼</text> |
| | | </view> |
| | | <view class="fp_list_item_right"> |
| | | <u--input placeholder="请è¾å
¥" :customStyle="{width: '180rpx'}" inputAlign="right" type="number" border="surround" v-model="form.num"></u--input> |
| | | </view> |
| | | </view> |
| | | <view class="fp_list_item"> |
| | | <view class="fp_list_item_left"> |
| | | <text style="color: #f00;">*</text> |
| | | <text>计åå¼å·¥æ¥æï¼</text> |
| | | </view> |
| | | <view class="fp_list_item_right" @click="timeShow = true"> |
| | | <text class="black" v-if="form.startTime">{{form.startTime}}</text> |
| | | <text v-else>å¹´ / æ / æ¥</text> |
| | | <u-icon name="arrow-right" color="#999999"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="fp_list_item" @click="show1 = true"> |
| | | <view class="fp_list_item_left"> |
| | | <text>ç产设å¤</text> |
| | | </view> |
| | | <view class="fp_list_item_right"> |
| | | <text v-if="form.equipmentName" class="black">{{form.equipmentName}}</text> |
| | | <text v-else>è¯·éæ©</text> |
| | | <u-icon name="arrow-right" color="#999999"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="fp_list_item1" v-show="form.equipmentName"> |
| | | <view class="fp_list_item_left"> |
| | | <text>ç产人å</text> |
| | | </view> |
| | | <view class="fp_list_item_right"> |
| | | <template v-if="personnelData.length > 0"> |
| | | <u-checkbox-group |
| | | placement="column" |
| | | @change="checkboxChange"> |
| | | <u-checkbox |
| | | :customStyle="{marginBottom: '16rpx'}" |
| | | v-for="(item, index) in personnelData" |
| | | :key="index" |
| | | :label="item.text" |
| | | :name="item.id"> |
| | | </u-checkbox> |
| | | </u-checkbox-group> |
| | | </template> |
| | | <view class="wu" v-else> |
| | | <text>ææ æ°æ®</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="fp_footer"> |
| | | <view class="fp_footer_close" @click="go">åæ¶</view> |
| | | <button class="fp_footer_submit" @click="submit">确认</button> |
| | | </view> |
| | | <!-- éæ©æ¥æ --> |
| | | <u-calendar :show="timeShow" @close="timeShow = false" @confirm="timeConfirm"></u-calendar> |
| | | <!-- éæ©è®¾å¤ --> |
| | | <u-picker :show="show1" :columns="equipment" @confirm="confirm" @cancel="show1 = false" keyName="text"></u-picker> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { gsdate } from '@/util/utils.js' |
| | | import { distributeById, getFindAll, getDeviceByCondition } from '@/util/api/PlanningAPI' |
| | | export default { |
| | | data() { |
| | | return { |
| | | id: null, |
| | | show1: false, |
| | | checkboxValue1: [], |
| | | form: { |
| | | num: '', // ç产æ°é |
| | | startTime: gsdate(new Date()), // å¼å§æ¶é´ |
| | | equipmentId: '', // 设å¤id |
| | | equipmentName: '', // 设å¤åç§° |
| | | personnelId: [] // 人åid |
| | | }, |
| | | isOpenDate: false, |
| | | equipment: [], // è®¾å¤æ°æ® |
| | | personnelData: [], // äººåæ°æ® |
| | | timeShow: false |
| | | }; |
| | | }, |
| | | onLoad(option) { |
| | | this.form.num = option.num |
| | | this.id = option.jhid |
| | | this.getDeviceByConditions() |
| | | }, |
| | | methods: { |
| | | checkboxChange(ids) { |
| | | this.form.personnelId = ids; |
| | | }, |
| | | go() { |
| | | uni.navigateBack({ delta: 1 }); |
| | | }, |
| | | // ç¡®è®¤éæ©è®¾å¤ |
| | | confirm(val) { |
| | | this.form.equipmentId = val.value[0].id |
| | | this.form.equipmentName = val.value[0].text |
| | | this.personnelData = [] |
| | | getFindAll({ |
| | | deviceId: this.form.equipmentId |
| | | }).then(res => { |
| | | if (res.code === 200 && res.data && res.data.length !== 0) { |
| | | this.form.personnelId = [] |
| | | let arr = [] |
| | | res.data.forEach((item) => { |
| | | arr.push({ text: item.dmodel.name + '-' + item.umodel.name, id: item.userId }) |
| | | }) |
| | | this.personnelData = arr |
| | | } |
| | | this.show1 = false |
| | | }) |
| | | }, |
| | | timeConfirm(val) { |
| | | this.form.startTime = val[0] |
| | | this.timeShow = false |
| | | }, |
| | | // æäº¤åé
|
| | | submit() { |
| | | if (!this.form.num) return uni.showToast({ title: '计åç产æ°éä¸è½ä¸ºç©ºï¼', icon: 'none', duration: 2000 }); |
| | | if (!this.form.startTime) return uni.showToast({ title: '计åå¼å§æ¥æä¸è½ä¸ºç©ºï¼', icon: 'none', duration: 2000 }); |
| | | distributeById({ |
| | | planId: this.id, |
| | | planNum: this.form.num, |
| | | planDate: this.form.startTime, |
| | | proGroupId: this.form.equipmentId, |
| | | proUserList: this.form.personnelId |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | uni.showToast({ title: 'åé
æå', icon: 'success', duration: 2000, mask: true }); |
| | | setTimeout(() => { |
| | | uni.$emit('update', { msg:'å·æ°å表' }) |
| | | uni.navigateBack({ delta: 1 }); |
| | | }, 2000) |
| | | } |
| | | }) |
| | | }, |
| | | // æ¥è¯¢è®¾å¤ |
| | | getDeviceByConditions() { |
| | | getDeviceByCondition({}) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | this.equipment = [] |
| | | let arr = [] |
| | | res.data.forEach((element) => { |
| | | arr.push({ text: element.code + '-' + element.name, id: element.id, checked: false }) |
| | | }) |
| | | this.equipment.push(arr) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .fp { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: absolute; |
| | | background: #F7F7F7; |
| | | .fp_list { |
| | | display: flex; |
| | | flex-direction: column; |
| | | .fp_list_item1 { |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | padding: 20rpx 30rpx; |
| | | box-sizing: border-box; |
| | | background: #ffffff; |
| | | border-bottom: 1rpx solid #ececec; |
| | | .fp_list_item_left { |
| | | flex-shrink: 0; |
| | | margin-bottom: 40rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | text { |
| | | color: #222222; |
| | | font-size: 30rpx; |
| | | font-weight: 400; |
| | | } |
| | | } |
| | | .fp_list_item_right::v-deep { |
| | | display: flex; |
| | | flex-direction: column; |
| | | .u-checkbox-group--row { |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .u-icon__icon { |
| | | margin-right: 0 !important; |
| | | } |
| | | .fp_list_item_right_dis { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20rpx; |
| | | &:last-child { |
| | | margin-bottom: 0 !important; |
| | | } |
| | | } |
| | | .wu { |
| | | width: 100%; |
| | | margin: 30rpx 0; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | text { |
| | | font-size: 26rpx; |
| | | color: black; |
| | | } |
| | | } |
| | | .black { |
| | | color: black !important; |
| | | } |
| | | // input { |
| | | // width: 180rpx; |
| | | // height: 60rpx; |
| | | // border-radius: 8rpx; |
| | | // border: 2rpx solid #E5E5E5; |
| | | // padding: 0 30rpx; |
| | | // text-align: right; |
| | | // font-size: 25rpx; |
| | | // } |
| | | text { |
| | | font-size: 28rpx; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | margin-right: 20rpx; |
| | | } |
| | | } |
| | | } |
| | | .fp_list_item { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 30rpx; |
| | | height: 98rpx; |
| | | box-sizing: border-box; |
| | | background: #ffffff; |
| | | border-bottom: 1rpx solid #ececec; |
| | | .fp_list_item_left { |
| | | flex-shrink: 0; |
| | | b { |
| | | color: $nav-stateColor4; |
| | | font-size: 28rpx; |
| | | margin-right: 5rpx; |
| | | } |
| | | text { |
| | | color: #222222; |
| | | font-size: 30rpx; |
| | | font-weight: 400; |
| | | } |
| | | } |
| | | .fp_list_item_right::v-deep { |
| | | display: flex; |
| | | align-items: center; |
| | | .u-icon__icon { |
| | | margin-right: 0 !important; |
| | | } |
| | | .wu { |
| | | text-align: center; |
| | | text { |
| | | font-size: 26rpx; |
| | | color: black; |
| | | } |
| | | } |
| | | .black { |
| | | color: black !important; |
| | | } |
| | | // input { |
| | | // width: 180rpx; |
| | | // height: 60rpx; |
| | | // border-radius: 8rpx; |
| | | // border: 1rpx solid #E5E5E5; |
| | | // padding: 0 30rpx; |
| | | // text-align: right; |
| | | // font-size: 25rpx; |
| | | // } |
| | | text { |
| | | font-size: 28rpx; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | margin-right: 20rpx; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .fp_footer { |
| | | width: 100%; |
| | | padding-left: 30rpx; |
| | | padding-right: 30rpx; |
| | | padding-bottom: 68rpx; |
| | | box-sizing: border-box; |
| | | position: fixed; |
| | | bottom: 0; |
| | | left: 0; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | .fp_footer_close { |
| | | width: 334rpx; |
| | | height: 88rpx; |
| | | background: #FFFFFF; |
| | | box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08); |
| | | border-radius: 8rpx; |
| | | font-size: 30rpx; |
| | | font-weight: 500; |
| | | color: #666666; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .fp_footer_submit { |
| | | width: 334rpx; |
| | | height: 88rpx; |
| | | border: none; |
| | | background: $nav-color; |
| | | box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08); |
| | | border-radius: 8rpx; |
| | | font-size: 30rpx; |
| | | font-weight: 500; |
| | | color: #ffffff; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | } |
| | | </style> |