jiangping
2023-10-26 ea87c908fb6cdfc3e227a584a53e6730efb8262a
minipro_standard/pages/allocation/allocation.vue
@@ -60,9 +60,7 @@
         <button class="fp_footer_submit" @click="submit">确认</button>
      </view>
      <!-- 选择日期 -->
      <!-- <u-calendar :show="timeShow" @close="timeShow = false" @confirm="timeConfirm"></u-calendar> -->
      <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5"
         rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
      <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>
@@ -107,12 +105,22 @@
            this.form.equipmentId = val.value[0].id
            this.form.equipmentName = val.value[0].text
            this.personnelData = []
            this.getUser()
            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.listData.startDate = val.startDate
            this.listData.endDate = val.endDate
            this.form.startTime = val[0]
            this.timeShow = false
         },
         // 提交分配
@@ -145,27 +153,9 @@
                     res.data.forEach((element) => {
                        arr.push({ text: element.code + '-' + element.name, id: element.id, checked: false })
                     })
                     this.form.equipmentId = arr[0].id
                     this.form.equipmentName = arr[0].text
                     this.getUser()
                     this.equipment.push(arr)
                  }
               })
         },
         getUser() {
            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
            })
         }
      }
   }