Browse Source

Merge branch 'Luckysheet-mk' into luckysheet

luckysheet-xiaowang-Intelligen
mk 11 months ago
parent
commit
9859e3cfd4
  1. 48
      src/views/modules/base/smartExcel/cpts/excel-add.vue

48
src/views/modules/base/smartExcel/cpts/excel-add.vue

@ -54,9 +54,9 @@
@change="handleChangeAgency" :options="orgOptions" :props="orgOptionProps"
:show-all-levels="false" clearable></el-cascader>
<el-select v-model.trim="form.receiverIds" placeholder="请选择" size="small" clearable
@remove-tag="removeTag" multiple class="cell-width-1" collapse-tags style="margin-left: 10px;"
class="cell-width-1" collapse-tags style="margin-left: 10px;"
@change="changeTag" c>
<el-option v-for="item in allStafflist" :key="item.value" :label="item.name"
<el-option v-for="item in workPersonnelList" :key="item.value" :label="item.name"
:value="item.staffId">
</el-option>
</el-select>
@ -131,8 +131,8 @@ export default {
taskPeriod: 'once',//
completeLimitDay: '',//
completeLimitHour: '',//
receiverIds: [],//
moduleUrl: 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20250109/30b1c877b8a94297b993c34d15e8e501.xlsx',//
receiverIds: '',//
moduleUrl: '',//
taskIntroduction: '',//
wordBookId:''//簿id
},
@ -179,7 +179,7 @@ export default {
value: '7'
}
],
// workPersonnelList: [],
workPersonnelList: [],
allStafflist: [],
selfTag: [],
sarr: [],
@ -198,6 +198,7 @@ export default {
);
this.agencylevel = this.sarr[this.sarr.length - 1].level;
this.agencyId = this.sarr[this.sarr.length - 1].agencyId;
this.form.receiverIds = ''
this.getStafflist()
},
getLastItem(list, vals, key) {
@ -220,10 +221,7 @@ export default {
pageSize: 100,
};
this.$http.post("data/aggregator/org/stafflist", parms).then((resp) => {
// this.workPersonnelList = resp.data.data.staffList;
if (resp.data.data.staffList) {
this.allStafflist = this.allStafflist.concat(resp.data.data.staffList)
}
this.workPersonnelList = resp.data.data.staffList;
});
},
getOrgTreeList() {
@ -290,12 +288,21 @@ export default {
}
},
removeTag(val) {
const valueToRemove = val.staffId || val[0];
this.form.receiverIds = this.form.receiverIds.filter(item => item != valueToRemove);
this.selfTag = this.allStafflist.filter(item => this.form.receiverIds.includes(item.staffId));
this.selfTag = this.selfTag.filter(item => item.staffId!=val.staffId);
},
changeTag() {
this.selfTag = this.allStafflist.filter(item => this.form.receiverIds.includes(item.staffId));
changeTag(val) {
let obj = this.workPersonnelList.find(item => item.staffId === val);
obj.agencyId = this.agencyId
if (obj) {
let exists = this.selfTag.some(tag => tag.agencyId === obj.agencyId);
if (!exists) {
this.selfTag.push(obj);
} else {
this.$message.warning('同一个组织只能分发一名工作人员');
}
} else {
console.error('未找到对应的人员信息');
}
},
handleChangetaskPeriod(val){
this.form.completeLimitDay = '';
@ -310,6 +317,19 @@ export default {
}
})
},
async saveEvent(){
let parm = {
...this.form
}
parm.receiverIds = this.selfTag.map(item=>item.staffId)
const {data,code,msg} = await requestPost('/actual/base/communityOneTablePublish/save',parm)
if(code === 0){
this.$emit('handleShowPage')
console.log(data,'发布成功');
}else{
console.log(msg);
}
},
async saveLuckysheet() {
delete this.luckysheetJson[0].data
console.log(this.luckysheetJson);

Loading…
Cancel
Save