|
@@ -116,6 +116,31 @@
|
|
|
<u-form-item label="报修人" prop="actualUser" required :label-width="150">
|
|
<u-form-item label="报修人" prop="actualUser" required :label-width="150">
|
|
|
<u-input v-model="form.actualUser" :cursor-spacing="cursorSpacing" />
|
|
<u-input v-model="form.actualUser" :cursor-spacing="cursorSpacing" />
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
|
|
+ <u-form-item label="通知班长" :label-width="150">
|
|
|
|
|
+ <u-input v-model="form.notifyTeamLeaders" disabled @click="openLeaderPopup" type="select"
|
|
|
|
|
+ placeholder="请选择通知班长(可多选,非必填)" />
|
|
|
|
|
+ </u-form-item>
|
|
|
|
|
+ <u-popup v-model="leaderPopupShow" mode="bottom" border-radius="20">
|
|
|
|
|
+ <view class="bg-color-white">
|
|
|
|
|
+ <view class="d-flex j-between a-center p3">
|
|
|
|
|
+ <view class="text-color-6 f-size-28" @click="cancelLeaderSelect">取消</view>
|
|
|
|
|
+ <view class="main-color-text f-size-32 f-weight-6">通知班长(可多选)</view>
|
|
|
|
|
+ <view class="main-color-text f-size-28" @click="confirmLeaderSelect">确定</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <scroll-view scroll-y style="max-height: 500rpx" class="px3">
|
|
|
|
|
+ <u-checkbox-group shape="square">
|
|
|
|
|
+ <view class="py2" v-for="(leader, index) in teamLeaderList" :key="leader.userId">
|
|
|
|
|
+ <u-checkbox v-model="teamLeaderList[index].checked" :name="leader.userId">
|
|
|
|
|
+ {{ leader.realName }}
|
|
|
|
|
+ </u-checkbox>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-checkbox-group>
|
|
|
|
|
+ <view v-if="!teamLeaderList.length" class="p3 text-color-6 f-size-28">
|
|
|
|
|
+ 暂无具有班长身份的人员
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-popup>
|
|
|
<u-form-item label="故障描述" prop="content" required :label-width="150">
|
|
<u-form-item label="故障描述" prop="content" required :label-width="150">
|
|
|
<u-input v-model="form.content" :cursor-spacing="cursorSpacing" />
|
|
<u-input v-model="form.content" :cursor-spacing="cursorSpacing" />
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
@@ -158,8 +183,14 @@ export default {
|
|
|
levelValue: '',
|
|
levelValue: '',
|
|
|
source: '',
|
|
source: '',
|
|
|
limitDate: '',
|
|
limitDate: '',
|
|
|
- limitHours: ''
|
|
|
|
|
|
|
+ limitHours: '',
|
|
|
|
|
+ // 通知班长:仅展示已选班长姓名,提交用 selectedLeaderIds
|
|
|
|
|
+ notifyTeamLeaders: ''
|
|
|
},
|
|
},
|
|
|
|
|
+ teamLeaderList: [], // 全部具有班长身份的人,带 checked 勾选状态
|
|
|
|
|
+ defaultLeaderIds: [], // 当前用户班组下的班长,默认勾选
|
|
|
|
|
+ selectedLeaderIds: [], // 已选班长用户id
|
|
|
|
|
+ leaderPopupShow: false, // 通知班长多选弹层
|
|
|
category: '',
|
|
category: '',
|
|
|
badState: false,
|
|
badState: false,
|
|
|
badList: [],
|
|
badList: [],
|
|
@@ -378,6 +409,7 @@ export default {
|
|
|
.getSbPositionTree().then(res => {
|
|
.getSbPositionTree().then(res => {
|
|
|
this.sbPositionData = res.data
|
|
this.sbPositionData = res.data
|
|
|
})
|
|
})
|
|
|
|
|
+ this.getTeamLeaders()
|
|
|
// const categoryMap = this.$DictCache.getLabelByValueMapByType(
|
|
// const categoryMap = this.$DictCache.getLabelByValueMapByType(
|
|
|
// this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY
|
|
// this.$DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY
|
|
|
// )
|
|
// )
|
|
@@ -407,6 +439,56 @@ export default {
|
|
|
this.$refs.uForm.setRules(this.rules)
|
|
this.$refs.uForm.setRules(this.rules)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 获取通知班长候选人:默认带出当前用户班组下的班长,找不到则空着
|
|
|
|
|
+ getTeamLeaders() {
|
|
|
|
|
+ this.$Http
|
|
|
|
|
+ .queryRepairTeamLeaders()
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ const data = res.data || {}
|
|
|
|
|
+ const defaultIds = data.defaultIds || []
|
|
|
|
|
+ // 每项附加 checked 勾选状态,默认勾选本班组班长
|
|
|
|
|
+ this.teamLeaderList = (data.leaders || []).map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ checked: defaultIds.indexOf(item.userId) > -1
|
|
|
|
|
+ }))
|
|
|
|
|
+ this.defaultLeaderIds = defaultIds
|
|
|
|
|
+ this.selectedLeaderIds = defaultIds.slice()
|
|
|
|
|
+ this.syncLeaderDisplay()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 已选班长id同步到表单展示姓名
|
|
|
|
|
+ syncLeaderDisplay() {
|
|
|
|
|
+ const names = this.teamLeaderList
|
|
|
|
|
+ .filter(item => this.selectedLeaderIds.indexOf(item.userId) > -1)
|
|
|
|
|
+ .map(item => item.realName)
|
|
|
|
|
+ this.form.notifyTeamLeaders = names.join('、')
|
|
|
|
|
+ },
|
|
|
|
|
+ // 用已选id刷新弹层勾选状态
|
|
|
|
|
+ resetLeaderChecked() {
|
|
|
|
|
+ this.teamLeaderList.forEach((item, index) => {
|
|
|
|
|
+ this.$set(this.teamLeaderList[index], 'checked', this.selectedLeaderIds.indexOf(item.userId) > -1)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ openLeaderPopup() {
|
|
|
|
|
+ if (!this.teamLeaderList.length) {
|
|
|
|
|
+ uni.showToast({ icon: 'none', title: '暂无具有班长身份的人员' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.resetLeaderChecked()
|
|
|
|
|
+ this.leaderPopupShow = true
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmLeaderSelect() {
|
|
|
|
|
+ this.selectedLeaderIds = this.teamLeaderList
|
|
|
|
|
+ .filter(item => item.checked)
|
|
|
|
|
+ .map(item => item.userId)
|
|
|
|
|
+ this.syncLeaderDisplay()
|
|
|
|
|
+ this.leaderPopupShow = false
|
|
|
|
|
+ },
|
|
|
|
|
+ cancelLeaderSelect() {
|
|
|
|
|
+ // 取消:丢弃弹层内未确认的勾选
|
|
|
|
|
+ this.resetLeaderChecked()
|
|
|
|
|
+ this.leaderPopupShow = false
|
|
|
|
|
+ },
|
|
|
//
|
|
//
|
|
|
confirm(e) {
|
|
confirm(e) {
|
|
|
console.log(e)
|
|
console.log(e)
|
|
@@ -475,6 +557,8 @@ export default {
|
|
|
limitHours: this.form.limitHours || null,
|
|
limitHours: this.form.limitHours || null,
|
|
|
// 与 PC 端 BaseForm 一致:提交当前登录人部门
|
|
// 与 PC 端 BaseForm 一致:提交当前登录人部门
|
|
|
deptId: this.userInfo ? this.userInfo.deptId : null,
|
|
deptId: this.userInfo ? this.userInfo.deptId : null,
|
|
|
|
|
+ // 通知班长:选中班长的用户id,逗号分隔,与 PC 端保持一致
|
|
|
|
|
+ notifyTeamLeaders: this.selectedLeaderIds.join(','),
|
|
|
applicationFileList: this.imagesList
|
|
applicationFileList: this.imagesList
|
|
|
}
|
|
}
|
|
|
// this.form.photo = a.join(',');
|
|
// this.form.photo = a.join(',');
|
|
@@ -519,11 +603,15 @@ export default {
|
|
|
levelValue: '',
|
|
levelValue: '',
|
|
|
source: '',
|
|
source: '',
|
|
|
limitDate: '',
|
|
limitDate: '',
|
|
|
- limitHours: ''
|
|
|
|
|
|
|
+ limitHours: '',
|
|
|
|
|
+ notifyTeamLeaders: ''
|
|
|
}
|
|
}
|
|
|
this.category = ''
|
|
this.category = ''
|
|
|
this.imagesList = []
|
|
this.imagesList = []
|
|
|
this.fileList = []
|
|
this.fileList = []
|
|
|
|
|
+ // 通知班长恢复默认本班组班长
|
|
|
|
|
+ this.selectedLeaderIds = this.defaultLeaderIds.slice()
|
|
|
|
|
+ this.syncLeaderDisplay()
|
|
|
},
|
|
},
|
|
|
// 紧急等级
|
|
// 紧急等级
|
|
|
levelSubmit(data) {
|
|
levelSubmit(data) {
|