Browse Source

一张表

luckysheet-xiaowang-Intelligen
是小王呀\24601 10 months ago
parent
commit
60b71af09e
  1. 69
      src/views/modules/base/smartExcel/cpts/accepting-personel.vue
  2. 208
      src/views/modules/base/smartExcel/cpts/acceptingPersonel.vue
  3. 46
      src/views/modules/base/smartExcel/cpts/excel-info.vue
  4. 5
      src/views/modules/base/smartExcel/filling.vue
  5. 2
      src/views/modules/base/smartExcel/index.vue

69
src/views/modules/base/smartExcel/cpts/accepting-personel.vue

@ -1,69 +0,0 @@
<template>
<!-- 确认模板 -->
<div class=''>
<el-dialog title="模板确认" :visible.sync="showTemplate" width="50%" :close-on-click-modal="false">
<div id="luckysheet"></div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import options from "@/utils/luckysheetConfig.js";
export default {
data() {
return {};
},
created() { },
methods: {
handleCancel(){
this.$emit('handelHideTemplate')
},
handleConfirm(){
this.$emit('saveLuckysheetJson',this.exportJson)
}
},
mounted() {
console.log(this.fileUrl, 'fileUrl===');
this.urlToFile('http://localhost:9001/epmet-work-pc/test1.xlsx',this.fileName)
this.$nextTick(() => {
window.luckysheet.destroy();
options.title = '模板确认'
window.luckysheet.create({
...options,
hook: {
cellEditBefore: this.handleCellEditBefore,
},
});
})
},
props: {
showTemplate: {
type: Boolean,
default: false
},
fileUrl: {
type: String,
default: ''
},
fileName: {
type: String,
default: ''
},
},
components: {},
computed: {},
watch: {},
}
</script>
<style lang='scss' scoped>
#luckysheet {
height: 500px;
}
</style>

208
src/views/modules/base/smartExcel/cpts/acceptingPersonel.vue

@ -0,0 +1,208 @@
<template>
<div style="position:relative;">
<el-form v-if="showType=='adjust'" ref="form" label-position="left" :model="formData" label-width="150px"
style="margin-left: 3%; margin-top: 10px;">
<el-row>
<el-col :span="24">
<el-form-item label="选择接受人员">
<el-cascader class="u-item-width-normal" size="small" ref="myCascader" v-model="cascaderAgencyId"
@change="handleChangeAgency" :options="orgOptions" :props="orgOptionProps"
:show-all-levels="false" clearable></el-cascader>
<el-select v-model.trim="formData.receiverIds" placeholder="请选择" size="small" clearable
class="cell-width-1" collapse-tags style="margin-left: 10px;"
@change="changeTag" c>
<el-option v-for="item in workPersonnelList" :key="item.value" :label="item.name"
:value="item.staffId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="`已选(${selfTag.length})人`">
<div>
<el-tag v-for="tag in selfTag" :key="tag.staffId" closable @close="removeTag(tag)"
style="margin-right: 10px;">
<span> {{ tag.name }}</span>
</el-tag>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-if="showType=='info'" :data="tableData" border class="m-table-item" style="width: 80%;" :height="maxTableHeight" >
<el-table-column label="序号" fixed="left" type="index" align="center" width="80" />
<el-table-column prop="renwu" align="center" :show-overflow-tooltip="true" label="第一接收人">
</el-table-column>
<el-table-column prop="renwu" align="center" :show-overflow-tooltip="true" label="转派给">
</el-table-column>
</el-table>
<el-form v-if="showType=='edit'" ref="formData " label-position="left" :model="formData" label-width="150px"
style="margin-left: 3%; margin-top: 10px;">
<el-row>
<el-form-item prop="taskTitle" label="任务主题">
<el-input v-model="formData.taskTitle" placeholder="请输入内容" clearable class="cell-width-1"></el-input>
</el-form-item>
<el-form-item label="任务要求" prop="taskIntroduction" style="display: block">
<el-input class="cell-width-2" type="textarea" maxlength="500" show-word-limit :rows="5"
placeholder="请输入事件内容,不超过500字" v-model.trim="formData.taskIntroduction"></el-input>
</el-form-item>
</el-row>
</el-form>
<span v-if="showType=='adjust'||showType=='edit'" slot="footer" class="dialog-footer" style="margin-left: 40%;">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button>
</span>
</div>
</template>
<script>
import options from "@/utils/luckysheetConfig.js";
export default {
data() {
return {
tableData:[],
formData:{
taskTitle: '',//
taskType: '1',//
taskPeriod: 'once',//
completeLimitDay: '',//
completeLimitHour: '',//
receiverIds: '',//
moduleUrl: '',//
taskIntroduction: '',//
wordBookId:''//簿id
},
workPersonnelList: [],
cascaderAgencyId:"",
orgOptions: [],
orgOptionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
selfTag: [],
sarr:[],
agencyId: '',
agencylevel: '',
showType:"",
};
},
created() { },
methods: {
getLastItem(list, vals, key) {
let LIST = list || [];
for (let item of LIST) {
for (let i of vals) {
if (item[key] === i) {
this.sarr.push(item);
} else {
this.getLastItem(item.subAgencyList, vals, key);
}
}
}
},
removeTag(val) {
this.selfTag = this.selfTag.filter(item => item.staffId!=val.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);
this.selfTag.push(obj);
} else {
console.error('未找到对应的人员信息');
}
},
getStafflist() {
let parms = {
orgId: this.agencyId,
orgType: 'agency',
pageNo: 1,
pageSize: 100,
};
this.$http.post("data/aggregator/org/stafflist", parms).then((resp) => {
this.workPersonnelList = resp.data.data.staffList;
});
},
async handleChangeAgency(val) {
this.sarr = []
this.getLastItem(
this.orgOptions,
val,
"agencyId"
);
this.agencylevel = this.sarr[this.sarr.length - 1].level;
this.agencyId = this.sarr[this.sarr.length - 1].agencyId;
this.formData.receiverIds = ''
this.getStafflist()
},
getOrgTreeList() {
this.$http
.post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.orgOptions = []
this.orgOptions.push(res.data)
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
handleCancel(){
this.$emit('handelPersonel')
},
handleConfirm(){
this.$http
.post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.$message.success("调整成功")
return this.$emit('handelPersonel')
}
})
.catch(() => {
return this.$message.error('网络错误')
})
return this.$success.error("调整成功")
}
},
mounted() {
console.log(this.showType,"sdlfkl;sdf");
this.getOrgTreeList()
},
props: {
acceptingId: {
type: String,
default: ''
},
showType:{
type: String,
default: ''
}
},
components: {},
computed: {
},
watch: {},
}
</script>
<style lang='scss' scoped>
.dialog-footer{
}
</style>

46
src/views/modules/base/smartExcel/cpts/excel-info.vue

@ -2,8 +2,7 @@
<div class="g-main">
<div class="right">
<div class="title-small" id="base">任务信息
<el-button type="text" class="div-table-button--blue" size="small"
@click="handelCLickShowCheckPassword('name')">返回</el-button>
<el-button type="text" round @click="handelClickBack" icon="el-icon-back">返回</el-button>
</div>
<el-form ref="form" label-position="left" :model="formData" label-width="120px"
style="margin-left: 3%; margin-top: 30px;">
@ -50,8 +49,8 @@
<el-form-item label="分发人员">
<div style="display: flex;flex-direction: row; align-items: center;">
<div>{{formData.fenfa}}</div>
<el-button style="margin-left: 10px;" type="text">查看接受人员名单</el-button>
<el-button type="text">调整接受人员</el-button>
<el-button @click="oncClickInfo('info')" style="margin-left: 10px;" type="text">查看接受人员名单</el-button>
<el-button @click="oncClickInfo('adjust')" type="text">调整接受人员</el-button>
</div>
</el-form-item>
@ -60,7 +59,7 @@
<el-form-item label="任务说明">
<div style="display: flex;flex-direction: row; align-items: center;">
<div>{{formData.shuoming}}</div>
<el-button style="margin-left: 10px;" type="text">[修改]</el-button>
<el-button style="margin-left: 10px;" type="text" @click="oncClickInfo('edit')">[修改]</el-button>
</div>
</el-form-item>
</el-col>
@ -68,9 +67,7 @@
</el-form>
<div class="title-small" id="reside">任务进展情况</div>
<div class="m-table">
<div class="div_btn">
<el-button size="small" type="primary " @click="handleAdd">新增</el-button>
</div>
<el-table :data="tableData" border class="m-table-item" style="width: 70%;margin-left: 3%; margin-top: 30px;" :height="maxTableHeight" >
<el-table-column label="序号" fixed="left" type="index" align="center" width="80" />
<el-table-column prop="renwu" align="center" :show-overflow-tooltip="true" label="任务周期">
@ -85,19 +82,23 @@
</div>
</div>
<div class=''>
<el-dialog title="模板确认" :visible.sync="showTemplate" width="50%" :close-on-click-modal="false">
<acceptingPersonel :formData></acceptingPersonel>
<el-dialog title="调整接收人员" :visible.sync="showPersonel" width="50%" :close-on-click-modal="false">
<acceptingPersonel :showType="showType" :acceptingId="formData.acceptingId" @handelPersonel="handelPersonel" ></acceptingPersonel>
</el-dialog>
</div>
</div>
</template>
<script>
import acceptingPersonel from "./cpts/accepting-personel.vue";
import acceptingPersonel from "./acceptingPersonel.vue";
import { mapGetters } from 'vuex'
export default {
data() {
return {
showType:"",
showPersonel:false,
showSummary:false,
formData:{
acceptingId:"12313",
title:"请各社区提报党员信息进行中",
date:"2024-11-18 11:20:32",
person:"张三",
@ -119,6 +120,21 @@ export default {
},
created() {},
methods: {
handelClickBack() {
console.log("sfdkfsdl;k");
this.$emit('handleShowPage')
},
handelPersonel() {
this.showPersonel = false;
},
oncClickPersonel(){
this.showType="adjust"
this.showPersonel=true
},
oncClickInfo(value){
this.showType=value
this.showPersonel=true
},
handelClickShowSummary(){
this.showSummary = true
},
@ -129,7 +145,13 @@ export default {
components:{
acceptingPersonel
},
computed:{},
computed:{
tableHeight() {
return (this.clientHeight - 140) + 'px'
},
...mapGetters(['clientHeight', 'resolution']),
},
watch: {},
}
</script>

5
src/views/modules/base/smartExcel/filling.vue

@ -15,6 +15,11 @@
clearable placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="传创建人" prop="eventContent">
<el-input v-model.trim="formData.eventContent" class="u-item-width-normal" size="small"
clearable placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="发布时间" prop="startTime">
<el-date-picker v-model.trim="formData.startTime" :picker-options="startPickerOptions"
class="u-item-width-daterange" size="small" type="date"

2
src/views/modules/base/smartExcel/index.vue

@ -97,7 +97,7 @@
</div>
</div>
<div v-if="pageType == 'info'">
<excel-info></excel-info>
<excel-info @handleShowPage="handleShowPage"></excel-info>
</div>
<div v-if="pageType == 'add'">
<excel-add @handleShowPage="handleShowPage"></excel-add>

Loading…
Cancel
Save