批量添加

zhangtao
laozt 1 year ago
parent 9a6f26e519
commit 97c32a76e8

@ -168,7 +168,14 @@
草稿箱(<span> {{ enterpriseTotal }} </span>) 草稿箱(<span> {{ enterpriseTotal }} </span>)
</div> </div>
<div class="btn" ref="next" @click="btnNext"></div> <div class="btn" ref="next" @click="btnNext"></div>
<div class="btn-add" ref="next" @click="btnAdd">稿</div> <div
class="btn-add"
ref="next"
@click="btnAdd"
:style="multiple ? ' background-color: #6bd7bc;' : ''"
>
批量加入草稿箱
</div>
</div> </div>
<firm-dialog ref="firmDialog"></firm-dialog> <firm-dialog ref="firmDialog"></firm-dialog>
@ -227,6 +234,7 @@ export default {
loading: true, loading: true,
// //
ids: [], ids: [],
idsRow: [],
// //
single: true, single: true,
// //
@ -294,6 +302,38 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id); this.ids = selection.map((item) => item.id);
let userInfo = JSON.parse(sessionStorage.getItem("USER_INFO"));
this.idsRow = [];
selection.map((item) => {
this.idsRow.push({
id: null,
isPoint: null,
district: item.district,
enterpriseId: item.enterpriseId,
enterpriseName: item.enterpriseName,
uuto: item.id,
lawSort: userInfo.lawSort,
lawAreas: userInfo.lawAreas,
lawLevel: userInfo.lawLevel,
lawHierarchy: userInfo.nickName,
plannedYear: this.$moment(new Date()).format("yyyy"),
plannedMonth: null,
status: 0,
checkStatus: null,
checkId: null,
checkAgeing: null,
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
userId: null,
deptId: null,
});
});
this.single = selection.length !== 1; this.single = selection.length !== 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -328,7 +368,22 @@ export default {
btnNext() { btnNext() {
this.$emit("nextTab", 2); this.$emit("nextTab", 2);
}, },
btnAdd() {}, btnAdd() {
// console.log(this.idsRow);
let _this = this;
// console.log(this.idsRow.length);
this.idsRow.map((item, index) => {
// console.log(index);
addEnterprise(item).then((response) => {
if (index == _this.idsRow.length - 1) {
_this.$modal.msgSuccess("加入成功");
_this.idsRow = [];
_this.getList(); //稿
_this.getPlanEnterpriseList();
}
});
});
},
// 稿 // 稿
handleAddDrafts(row) { handleAddDrafts(row) {
this.resetPlanEnterprise(); this.resetPlanEnterprise();
@ -730,16 +785,16 @@ export default {
.btn-add { .btn-add {
width: 150px; width: 150px;
height: 30px; height: 30px;
border: 1px solid #3ecaa7; border: 1px solid #6bd7bc;
border-radius: 2px; border-radius: 2px;
background-color: #eff6ff; background-color: #0ad9a5;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 15px; font-size: 15px;
font-family: "Alibaba PuHuiTi"; font-family: "Alibaba PuHuiTi";
font-weight: 400; font-weight: 400;
color: #48e1bb; color: #eff6ff;
cursor: pointer; cursor: pointer;
margin-left: 10px; margin-left: 10px;
} }

@ -99,6 +99,7 @@
class="btn-del" class="btn-del"
icon="el-icon-delete" icon="el-icon-delete"
:disabled="multiple" :disabled="multiple"
:style="multiple ? 'background: #eb7a9a;' : ''"
@click="handleDelete" @click="handleDelete"
>批量删除</el-button >批量删除</el-button
> >

Loading…
Cancel
Save