|
|
|
|
@ -90,15 +90,17 @@
|
|
|
|
|
</div>
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-select v-model="batchOperateValue" placeholder="批量操作" size="mini" clearable>
|
|
|
|
|
<el-select v-model="batchOperate.operateValue" placeholder="批量操作" size="mini" clearable>
|
|
|
|
|
<el-option label="批量添加小程序标签" :value="1"></el-option>
|
|
|
|
|
<el-option label="批量删除小程序标签" :value="2"></el-option>
|
|
|
|
|
<el-option label="全量添加小程序标签" :value="3"></el-option>
|
|
|
|
|
<el-option label="导出批量数据" :value="12"></el-option>
|
|
|
|
|
<el-option label="导出全量数据" :value="13"></el-option><!-- @click="handleExport" -->
|
|
|
|
|
<el-option label="全量删除小程序标签" :value="4"></el-option>
|
|
|
|
|
<el-option label="导出批量数据" :value="5"></el-option>
|
|
|
|
|
<el-option label="导出全量数据" :value="6"></el-option><!-- @click="handleExport" -->
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="primary" plain icon="el-icon-warning" size="mini" @click="batchOperate()">确认</el-button>
|
|
|
|
|
<el-button type="primary" plain icon="el-icon-warning" size="mini" @click="batchOperatePop()">确认</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"/>
|
|
|
|
|
</el-row>
|
|
|
|
|
@ -150,16 +152,45 @@
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 小程序标签批量操作 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="batchOperate.tagOperateVisible" width="50%"
|
|
|
|
|
:before-close="cancelMiniProgramDialog">
|
|
|
|
|
<el-form ref="miniProgramForm" :model="miniProgramForm" :rules="batchMiniProgramRules" label-width="150px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="100">
|
|
|
|
|
<el-form-item label="小程序标签" prop="tagIdArray" label-width="100px">
|
|
|
|
|
<treeselect v-model="miniProgramForm.tagIdArray" :options="batchOperate.tagTree" :multiple="true"
|
|
|
|
|
:show-count="true" placeholder="请选择小程序标签" :disable-branch-nodes="true"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="cancelMiniProgramDialog(false)">重 置</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitBatchOperate">确 定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {listNursingLog, getNursingLog, delNursingLog, addNursingLog, updateNursingLog} from "@/api/system/nursingLog";
|
|
|
|
|
import {listNursingLog, allAddMiniProgramTag, allDelMiniProgramTag} from "@/api/system/nursingLog";
|
|
|
|
|
import {listAllMode, listInstrument} from "@/api/system/instrument";
|
|
|
|
|
import {getMiniProgramTags, getRegionByPid, getWecomTags} from "@/api/system/member";
|
|
|
|
|
import {
|
|
|
|
|
batchAddMiniProgramTag, batchDelMiniProgramTag,
|
|
|
|
|
getMiniProgramTags,
|
|
|
|
|
getRegionByPid,
|
|
|
|
|
getWecomTags
|
|
|
|
|
} from "@/api/system/member";
|
|
|
|
|
import {tagTreeSelect} from "@/api/system/wechatTab";
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "NursingLog",
|
|
|
|
|
components: {Treeselect},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
@ -215,6 +246,20 @@ export default {
|
|
|
|
|
modeList: [],
|
|
|
|
|
// 查询条件:仪器列表
|
|
|
|
|
instrumentList: [],
|
|
|
|
|
|
|
|
|
|
// 批量操作值
|
|
|
|
|
batchOperate: {
|
|
|
|
|
operateValue: null,
|
|
|
|
|
tagOperateVisible: false,
|
|
|
|
|
title: null,
|
|
|
|
|
tagTree: [],
|
|
|
|
|
userIdList: [],
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
miniProgramForm: {
|
|
|
|
|
tagIdArray: [],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
@ -226,7 +271,11 @@ export default {
|
|
|
|
|
{required: true, message: "设备id不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
batchMiniProgramRules: {
|
|
|
|
|
tagIdArray: [
|
|
|
|
|
{required: true, message: '请选择小程序标签', trigger: 'change'},
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
@ -289,6 +338,7 @@ export default {
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
|
this.batchOperate.userIdList = selection.map(item => item.userId)
|
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
@ -298,10 +348,138 @@ export default {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `nursingLog_${new Date().getTime()}.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
/** 批量操作按钮,显示批量操作弹窗 */
|
|
|
|
|
batchOperatePop() {
|
|
|
|
|
if (this.batchOperate.operateValue == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择要批量操作类型',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
/* 批量操作 */
|
|
|
|
|
if (this.batchOperate.operateValue == 1 || this.batchOperate.operateValue == 2 || this.batchOperate.operateValue == 5) {
|
|
|
|
|
if (this.ids.length == 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择要操作的数据',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperate.operateValue == 1) {
|
|
|
|
|
this.batchOperate.title = '批量添加小程序标签';
|
|
|
|
|
// 获取标签树
|
|
|
|
|
this.getTagTree();
|
|
|
|
|
this.batchOperate.tagOperateVisible = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.batchOperate.operateValue == 2) {
|
|
|
|
|
this.batchOperate.title = '批量删除小程序标签';
|
|
|
|
|
// 获取标签树
|
|
|
|
|
this.getTagTree();
|
|
|
|
|
this.batchOperate.tagOperateVisible = true;
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperate.operateValue == 5) {
|
|
|
|
|
console.log("批量导出数据");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
/* 全量操作 */
|
|
|
|
|
if (this.batchOperate.operateValue == 3) {
|
|
|
|
|
this.batchOperate.title = '全量添加小程序标签';
|
|
|
|
|
// 获取标签树
|
|
|
|
|
this.getTagTree();
|
|
|
|
|
this.batchOperate.tagOperateVisible = true;
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperate.operateValue == 4) {
|
|
|
|
|
this.batchOperate.title = '全量删除小程序标签';
|
|
|
|
|
// 获取标签树
|
|
|
|
|
this.getTagTree();
|
|
|
|
|
this.batchOperate.tagOperateVisible = true;
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperate.operateValue == 6) {
|
|
|
|
|
console.log("全量导出数据");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 查询小程序标签树 */
|
|
|
|
|
getTagTree() {
|
|
|
|
|
tagTreeSelect({type: 1}).then((response) => {
|
|
|
|
|
this.batchOperate.tagTree = response.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 关闭添加小程序标签窗口
|
|
|
|
|
cancelMiniProgramDialog(isClose) {
|
|
|
|
|
this.$refs.miniProgramForm.clearValidate();
|
|
|
|
|
this.miniProgramForm.tagIdArray = [];
|
|
|
|
|
if (isClose) {
|
|
|
|
|
this.batchOperate.title = null;
|
|
|
|
|
this.batchOperate.tagOperateVisible = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/* 批量操作提交按钮 */
|
|
|
|
|
submitBatchOperate() {
|
|
|
|
|
// 批量添加小程序标签
|
|
|
|
|
if (this.batchOperate.operateValue == 1) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
batchAddMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,
|
|
|
|
|
Array.from(new Set(this.batchOperate.userIdList))
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('批量添加小程序标签成功');
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 批量删除小程序标签
|
|
|
|
|
if (this.batchOperate.operateValue == 2) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
batchDelMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,
|
|
|
|
|
Array.from(new Set(this.batchOperate.userIdList))
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('批量删除小程序标签成功')
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 全量添加小程序标签
|
|
|
|
|
if (this.batchOperate.operateValue == 3) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
allAddMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,this.queryParams
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('全量添加小程序标签成功')
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 全量删除小程序标签
|
|
|
|
|
if (this.batchOperate.operateValue == 4) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
allDelMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,this.queryParams
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('全量删除小程序标签成功')
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 查询仪器列表
|
|
|
|
|
queryInstrument() {
|
|
|
|
|
listInstrument({}).then(response => {
|
|
|
|
|
|