123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696 |
- <template>
- <div>
- <div class="container">
- <div class="container-box">
- <div class="adv-type">
- <!-- <div v-for="item in typeList" :key="item.dataCode" @click="advmaterial(item)" >
- <div v-if="(roleStatus <= 1 && item.dataName=='信息汇总') || (roleStatus < 4 && item.dataName=='信息填报')">
- <span><i class="el-icon-folder-opened"></i></span>
- <span>{{item.dataName}}</span>
- </div>
- </div> -->
- <div @click="advmaterial(typeList[0])" v-if="roleStatus < 4">
-
- <span><i class="el-icon-folder-opened"></i></span>
- <span>信息填报</span>
-
- </div>
- <!-- <div @click="advmaterial(typeList[1])" v-if="roleStatus <= 1"> -->
- <div @click="advmaterial(typeList[1])" v-if="roleStatus <= 2">
-
- <span><i class="el-icon-folder-opened"></i></span>
- <span>信息汇总</span>
-
- </div>
- </div>
- <div class="adv-box">
- <div class="adv-tit" @click="jumpadv('1')" v-if="roleStatus < 3">
- <i class="el-icon-loading"></i>
- <span>进行中 </span>
- </div>
- <div class="adv-tit" @click="jumpadv('2')" v-if="roleStatus < 3">
- <i class="el-icon-notebook-1"></i>
- <span>已结束 </span>
- </div>
- <div class="adv-tit adv-add" @click="advadd" v-if="roleStatus == 0">
- <i class="el-icon-plus"></i>
- <span>申请</span>
- </div>
- </div>
- </div>
- </div>
- <el-dialog title="添加" :visible.sync="dialogStatus" width="50%" :destroy-on-close="true"
- :modal-append-to-body="false" :close-on-click-modal="false" :fullscreen="true">
- <el-form :model="infolist" ref="infolist" :rules="rules"
- style="height: calc(100vh - 180px);overflow-y: scroll;">
- <el-form-item prop="woName" class="info-line online">
- <span>统计名称</span>
- <el-input v-model="infolist.woName" placeholder="统计名称"></el-input>
- </el-form-item>
- <el-form-item prop="time" class="info-line online">
- <span>统计周期</span>
- <el-date-picker v-model="infolist.time" type="daterange"></el-date-picker>
- </el-form-item>
- <el-form-item class="info-line online">
- <span>填报人</span>
- <deptTree v-if="!disableStatus" :closeList="closeList" class="tree" @treeCheck="treeCheck">
- </deptTree>
- <div :class="!disableStatus?'tree treeUser':'tree treeUserb'">
- <p v-for="(item,index) in treeList" :key="index">{{item.receiveName}}
- <i @click="deletess(item,index)" class="el-icon-error"></i>
- </p>
- </div>
- </el-form-item>
- <el-form-item class="info-line online">
- <span>负责人</span>
- <div class="tree treeUser" style="width: 30%;margin-right: 1%;">
- <p v-for="(item,index) in deptList" :key="index" @click="choseDepta(item)">{{item.ou}}</p>
- </div>
- <div :class="!disableStatus?'tree treeUser':'tree treeUserb'" style="width: 30%;margin-right: 1%;">
- <p v-for="(item,index) in treeListp" :key="index">
- <span>{{item.ou}}</span>
- <span class="p-btn" @click="fzperson(item)">负责人</span>
- <i @click="deletes(item,index)" class="el-icon-error"></i>
- </p>
- </div>
- <div :class="!disableStatus?'tree treeUser':'tree treeUserb'" style="width: 30%;">
- <p v-for="(item,index) in treeListp" :key="index">{{item.loginNameStr}}</p>
- </div>
- </el-form-item>
- </el-form>
- <div style="text-align: right;margin-top: 20px">
- <el-button @click="dialogCli(1)" type="primary">确 定</el-button>
- <el-button @click="dialogCli(2)">取 消</el-button>
- </div>
- </el-dialog>
- <el-dialog title="选择负责人" :visible.sync="dialogStatusp" width="50%" :destroy-on-close="true"
- :modal-append-to-body="false" :close-on-click-modal="false">
- <el-form :model="infolist" ref="infolist" style="height: 50vh;overflow-y: scroll;">
- <div class="treeUserp">
- <p v-for="(item,index) in treeListponly" :key="index" @click="chofz(item)" v-if="item.loginNameStr">
- {{item.groupName}} -
- {{item.loginNameStr}}
- </p>
- </div>
- </el-form>
- </el-dialog>
- </div>
- </template>
- <script>
- import deptTree from "../../../components/deptTreeUser.vue"
- import deptTreep from "../../../components/deptTreeP.vue"
- export default {
- components: {
- deptTree,
- deptTreep
- },
- data() {
- const woName = (rule, value, callback) => {
- if (!this.infolist.woName) {
- callback(new Error('不能为空'))
- } else {
- callback()
- }
- }
- const time = (rule, value, callback) => {
- if (!this.infolist.time) {
- callback(new Error('不能为空'))
- } else {
- callback()
- }
- }
- return {
- rules: {
- woName: [{
- required: true,
- trigger: 'blur',
- validator: woName
- }],
- time: [{
- required: true,
- trigger: 'change',
- validator: time
- }]
- },
- typeList: [{
- dataCode: '1',
- dataName: '信息填报'
- },
- {
- dataCode: '2',
- dataName: '信息汇总'
- },
- ],
- dialogStatus: false,
- disableStatus: false,
- dialogStatusp: false,
- infolist: {},
- treeList:[],
- treeListp:[],
- treeListponly:[],
- closeList:[],
- defaultList:[],
- depttype:0,
- fadept:{},
- deptList:[],
- // roleList: {
- // isProvinceRole: false,
- // isCityRole: false,
- // isCountyRole: false,
- // isOtherRole: false,
- // }
- roleStatus: '', //0 省 1地市 2区县 3其他
- roleList:[]
- }
- },
- methods: {
- dialogCli(v) {
- let _this = this;
- if (v === 1) {
- let param = {};
- param.woName = this.infolist.woName;
- this.infolist.time?param.startTime = this.$formatDate(this.infolist.time[0], "YYYY-MM-DD"):'';
- this.infolist.time?param.endTime = this.$formatDate(this.infolist.time[1], "YYYY-MM-DD"):'';
- param.dutyList = [];
- for (let i = 0; i < this.treeListp.length; i++) {
- param.dutyList.push({
- dutyNo:this.treeListp[i].loginNoStr,
- dutyName:this.treeListp[i].loginNameStr,
- groupId:this.treeListp[i].o,
- groupName:this.treeListp[i].ou,
- })
- }
- param.fillList = [];
- // console.log(this.treeList)
- for (let i = 0; i < this.treeList.length; i++) {
- param.fillList.push({
- fillNo:this.treeList[i].receiveNo,
- fillName:this.treeList[i].label,
- })
- }
- for (let i = 0; i < this.treeList.length; i++) {
- for (let ii = 0; ii < this.treeListp.length; ii++) {
- if(this.treeListp[ii].loginNoStr == this.treeList[i].receiveNo){
- this.$message({
- message: '负责人和填报人重复!',
- type: 'error'
- });
- return
- }
- }
- }
- this.$refs.infolist.validate(valid => {
- if (valid) {
- this.$http({
- url: "/market/cMemberWo/add",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: param,
- }).then((res) => {
- if (res.data.result === 1) {
- _this.$message({
- message: res.data.desc,
- type: 'error'
- });
- } else {
- _this.$message({
- message: '成功',
- type: 'success'
- });
- _this.infolist = {};
- _this.treeList = [];
- _this.treeListp = [];
- _this.dialogStatus = false;
- }
- });
- }
- })
- } else if (v === 2) {
- this.infolist = {};
- this.treeList = [];
- this.treeListp = [];
- this.dialogStatus = false;
- }
- },
- chofz(v){
- this.dialogStatusp = false;
- for (let i = 0; i < this.treeListp.length; i++) {
- if(this.treeListp[i].o == this.fadept.o){
- this.treeListp[i].loginNameStr = v.loginNameStr;
- this.treeListp[i].loginNoStr = v.loginNoStr;
- }
- }
- },
- fzperson(v){
- this.fadept= v;
- this.dialogStatusp = true;
- this.$http({
- url: "/sysmgr/sysuserinfo/queryList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- groupId: v.o,
- },
- }).then((res) => {
- this.treeListponly = res.data;
- });
- this.$http({
- url: "/sysmgr/csysdept/queryRegionDeptList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- parentorgid: v.o,
- },
- }).then((res) => {
- res.data.forEach(item=>{
- this.$http({
- url: "/sysmgr/sysuserinfo/queryList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- groupId: item.o,
- },
- }).then((ress) => {
- this.treeListponly.push({bumen:item.ou})
- this.treeListponly=this.treeListponly.concat(ress.data);
- });
- })
- });
- },
- deletess(val, index) {
- this.closeList = [];
- for (var i = 0; i < this.treeList.length; i++) {
- if (this.treeList[i] == val) {
- // this.treeList.splice(i, 1);
- } else {
- this.closeList.push(this.treeList[i]);
- }
- }
- },
- deletes(val, index) {
- this.treeListp.splice(index, 1);
- },
- treeCheck(v){
- this.treeList = v;
- },
- choseDepta(v){
- let x = 'no';
- for (let i = 0; i < this.treeListp.length; i++) {
- if(this.treeListp[i].o == v.o){
- x = i;
- }
- }
- if(x != 'no'){
- this.treeListp.splice(x, 1)
- }else{
- this.treeListp.push(v);
- }
- },
- advadd() {
- this.dialogStatus = true;
- this.$http({
- url: "/sysmgr/csysdept/queryRegionDeptList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {},
- }).then((res) => {
- this.deptList = res.data[0].children;
- });
- },
- jumpadv(v) {
- if(v == 1){
- this.$router.push({
- path: "/haveInHand",
- });
- this.setabList("进行中任务", "/haveInHand");
- }else{
- this.$router.push({
- path: "/Completed",
- });
- this.setabList("已完成", "/Completed");
- }
- },
- advmaterial(v) {
- if(v.dataCode == 1){
- this.$router.push({
- path: "/empInfoFilling",
- });
- this.setabList("信息填报", "/empInfoFilling");
- this.$http({
- url: "/market/cMemberFill/queryMkMemberFillInfo",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {},
- }).then((res) => {
- if(res.data){
- this.$router.push({
- path: "/empInfoFilling",
- });
- this.setabList("信息填报", "/empInfoFilling");
- }
- });
- }else{
- this.$router.push({
- path: "/dataStatistics",
- });
- this.setabList("数据统计", "/dataStatistics");
- }
- },
- setabList(n, p) {
- let params = {
- children: "",
- name: n,
- rountPath: p,
- target: "_self",
- };
- for (let i = 0; i < this.$store.state.tabList.length; i++) {
- if (this.$store.state.tabList[i].name === params.name) {
- this.$store.state.tabList[i] = params;
- }
- }
- let set = new Set([...this.$store.state.tabList, params]);
- set.add(params);
- this.$store.commit("setDefaultActive", params.rountPath);
- this.$store.commit("setTabList", Array.from(set));
- },
- getlist() {
- // this.$http({
- // url: "/market/cadv/queryMkAdvStsNum",
- // method: "post",
- // headers: {
- // "Content-Type": "application/json",
- // },
- // data: {},
- // }).then((res) => {
- // this.info = res.data
- // });
- },
- getUser() {
- this.userInfo = JSON.parse(window.sessionStorage.userInfo);
- // console.log(this.userInfo);
- let newArr = [];
-
- if(this.userInfo.cityName == null && this.userInfo.countyName == null){
- this.roleStatus = 0;
- return;
- }else if(this.userInfo.cityName != null && this.userInfo.countyName == null){
-
- this.$http({
- url: "/market/cMemberWo/queryProvTraceBase",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- sts: 0
- },
- }).then((res) => {
- // console.log(res.data.body);
- res.data.body.forEach(item=>{
- newArr.push(...item.dutyNo.split(","));
- })
- let n = newArr.filter(item=>{
- return item == this.userInfo.loginNoStr
- })
- // console.log(n);
- if(n.length != 0){
- this.roleStatus = 1;
- }else{
- this.roleStatus = 3;
- }
- });
- return;
- }else if(this.userInfo.cityName != null && this.userInfo.countyName != null){
- this.$http({
- url: "/market/cMemberWo/queryProvTraceBase",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- sts: 0
- },
- }).then((res) => {
-
- res.data.body.forEach(item=>{
- newArr.push(...item.dutyNo.split(","));
- })
- let n = newArr.filter(item=>{
- return item == this.userInfo.loginNoStr
- })
- // console.log(n);
- if(n.length != 0){
- this.roleStatus = 2;
- }else{
- this.roleStatus = 3;
- }
- });
- // this.roleStatus = 2;
- return;
- }else{
- this.roleStatus = 3;
- return;
- }
- },
- },
- mounted() {
- this.getUser();
- this.getlist();
- },
- created() {
- }
- }
- </script>
- <style scoped lang="scss">
- .container-box {
- padding: 0 30px;
- height: calc(100% - 40px);
- overflow-y: scroll;
- padding-bottom: 20px;
- }
- .adv-box {
- margin-top: 20px;
- display: flex;
- flex-wrap: nowrap;
- // justify-content: space-between;
- div {
- display: inline-block;
- cursor: pointer;
- .el-card {
- width: 100%;
- }
- i {
- margin-right: 10px;
- }
- }
- .adv-tit {
- width: 28%;
- border: 1px solid transparent;
- border-radius: 5px;
- height: 60px;
- line-height: 60px;
- padding-left: 20px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
- overflow: hidden;
- margin-right: 2%;
- em {
- float: right;
- margin-right: 20px;
- font-style: normal;
- color: #0074D9;
- }
- }
- .adv-tit:hover {
- border: 1px solid #CFE8FC;
- background: #CFE8FC;
- }
- .adv-add {
- width: 100px;
- }
- }
- .adv-type {
- margin-top: 20px;
- display: flex;
- // justify-content: space-between;
- flex-wrap: wrap;
- // border: 1px solid #ddd;
- border-radius: 5px;
- padding: 20px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
- div {
- width: 24%;
- text-align: center;
- height: 80px;
- overflow: hidden;
- min-width: 100px;
- cursor: pointer;
- padding-top: 10px;
- margin: 10px 0;
- div{
- width: 100%;
- padding-top: 0;
- margin: 0;
- }
- }
- div:hover {
- background: #CFE8FC;
- border-radius: 5px;
- }
- span {
- width: 100%;
- display: inline-block;
- height: 40px;
- // line-height: 40px;
- i {
- color: #0074D9;
- font-size: 36px;
- }
- }
- }
- .info-line {
- width: 100%;
- display: block;
- padding-left: 20px;
- div {
- width: 50%;
- display: inline-block;
- }
- span {
- width: 80px;
- display: inline-block;
- text-align: left;
- i {
- color: red;
- display: inline-block;
- padding-right: 5px;
- }
- }
- .el-select,
- .el-input {
- width: calc(100% - 100px);
- }
- .tree {
- width: calc(50% - 60px);
- display: inline-block;
- margin-right: 20px;
- height: 300px;
- overflow-y: scroll;
- p{
- overflow: hidden;
- display: flex;
- justify-content: space-between;
- }
- .p-btn{
- width: 50px!important;
- cursor: pointer;
- color: #0074DA;
- }
- span{
- display: inline-block;
- width: calc(100% - 100px);
- }
- .el-icon-error {
- float: right;
- font-size: 20px;
- margin-top: 9px;
- cursor: pointer;
- }
- }
- .treeUser {
- margin: 0;
- border: 1px solid #ddd;
- p {
- background: #f4f4f4;
- padding: 0 20px;
- margin-bottom: 5px;
- }
- }
- .treeUserb {
- width: calc(100% - 100px);
- border: 1px solid #ddd;
- background: #f4f4f4;
- border-radius: 3px;
- height: auto;
- overflow: hidden;
- p {
- display: inline-block;
- padding: 0 20px;
- margin-bottom: 5px;
- }
- }
- }
- .treeUserp{
- p{
- padding: 5px;
- }
- p:hover{
- background: #01BEF0;
- color: #fff;
- cursor: pointer;
- }
- }
- .online {
- width: 100%;
- .el-select {
- width: calc(100% - 120px);
- }
- span {
- vertical-align: top;
- }
- .el-textarea,
- .el-date-editor {
- width: calc(100% - 100px);
- display: inline-flex;
- }
- }
- </style>
|