@sy-common/organize-select-help 1.0.0-beta.56 → 1.0.0-beta.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.vue +17 -1
package/package.json
CHANGED
package/src/index.vue
CHANGED
|
@@ -253,6 +253,10 @@ export default {
|
|
|
253
253
|
defaultOrgUnitId:{
|
|
254
254
|
type: String,
|
|
255
255
|
default: ''
|
|
256
|
+
},
|
|
257
|
+
staffSingle:{
|
|
258
|
+
type: Boolean,
|
|
259
|
+
default: false
|
|
256
260
|
}
|
|
257
261
|
},
|
|
258
262
|
data(){
|
|
@@ -942,12 +946,24 @@ export default {
|
|
|
942
946
|
},
|
|
943
947
|
//staff
|
|
944
948
|
addStaffList(){
|
|
949
|
+
console.log("this.staffSingle", this.staffSingle)
|
|
945
950
|
let staffList = this.staffAllList.filter((item)=>item.checked===true);
|
|
951
|
+
|
|
946
952
|
if (!staffList.length) {
|
|
947
953
|
this.$Message.error("请选择人员");
|
|
948
954
|
return;
|
|
949
955
|
}
|
|
950
|
-
|
|
956
|
+
if (this.staffSingle && this.staffList.length >= 1) {
|
|
957
|
+
this.$Message.error("请先清除已选人员,再重新添加");
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
if(this.staffSingle && staffList.length > 1){
|
|
962
|
+
this.$Message.error("温馨提示:当前业务暂时只支持选择一位人员");
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// 基于item.id去重,不修改原数据字段,仅过滤重复项
|
|
951
967
|
let uniqueStaffList = staffList.filter(newItem =>
|
|
952
968
|
// 检查右侧条件区域(staffList)是否已有该人员,避免重复添加
|
|
953
969
|
!this.staffList.some(existItem => existItem.userId === newItem.userId)
|