xgwangman преди 4 години
родител
ревизия
e0198c5278

+ 1 - 1
src/api/api.js

@@ -27,7 +27,7 @@ export const scribeKey = data => fetch.post('/entniche/subscribe/key/get', data)
 // 修改关键词设置
 export const updateKeys = data => fetch.post('/entniche/subscribe/key/update', data);
 // 全员无差别开关
-export const nodiff = data => fetch.post('/entniche/distribute/nodiff', data);
+export const nodiff = data => fetch.get('/entniche/distribute/nodiff', data);
 // 分发设置列表
 export const nodiffList = data => fetch.post('/entniche/distribute/list', data);
 // 统一订阅数据导出接口

+ 97 - 42
src/views/bus/components/antistop.vue

@@ -38,17 +38,18 @@
             </el-form>
             <div class="key_data" v-for="(item,index) in keyDatas.data" :key="index" v-if="keyDatas.data[0]">
                 <h2>{{item.s_item}}
-                    <img src="@/assets/images/bianji.png" @click="editKey(item.s_item)">
-                    <img src="@/assets/images/del.png" @click="delKey(item.s_item)">
+                    <img src="@/assets/images/bianji.png" @click="editKey(item.s_item,'i_edit',index)">
+                    <img src="@/assets/images/del.png" @click="delKey(item.s_item,index)">
                 </h2>
                 <div class="word_card">
                     <div class="lis_card" v-for="(ite,indx) in item.a_key" :key="indx">
                         <p>关键词:{{String(ite.key)?String(ite.key):'--'}}</p>
                         <p>附加词:{{String(ite.appendkey)?String(ite.appendkey.join(",").replace(/,/g, "、")):'--'}}</p>
                         <p>排除词:{{String(ite.notkey) ? String(ite.notkey.join(",").replace(/,/g, "、")) : '--'}}</p>
-                        <img src="@/assets/images/del.png" @click="keyDel">
-                        <div class="top_edit" @click="toop(item.s_item,String(ite.key),String(ite.appendkey),String(ite.notkey))">编辑<i class="tri-down"></i></div>
+                        <img src="@/assets/images/del.png" @click="keyDel(index,indx)">
+                        <div class="top_edit" @click="toop(item.s_item,String(ite.key),String(ite.appendkey),String(ite.notkey),index,'edit')">编辑<i class="tri-down"></i></div>
                     </div>
+                    <div class="lis_card add_card" @click="addCell(item.s_item,'add',index)"><i class="el-icon-plus"></i></div>
                 </div>
             </div>
         </div>
@@ -96,16 +97,16 @@
             </span>
         </el-dialog>
         <!-- 删除关键词分类提醒框 -->
-        <v-warn ref="keysed" :keyNames="keyNames"></v-warn>
+        <v-warns ref="keysed" :exportData="exportData" :arrExport="arrExport" :keyNames="keyNames" :keyIndex="keyIndex"></v-warns>
     </div>
 </template>
 
 <script>
 import { updateKeys, scribeKey } from '@/api/api';
-import vWarn from './warnBox.vue';
+import vWarns from './warnBox.vue';
 export default {
     components: {
-        vWarn
+        vWarns
     },
     data() {
         return {
@@ -130,7 +131,12 @@ export default {
             tips: false,
             keyNames: '',
             keys: '',
-            keysEdit: []
+            keysEdit: [],
+            toopIndex: 0,
+            wordType: '',
+            exportData: {},
+            arrExport: {},
+            keyIndex: 0
         }
     },
     created() {
@@ -143,27 +149,33 @@ export default {
                 this.keyDatas = res.data;
             })
         },
-        editKey(name) {
+        editKey(name,tip,inx) {
             this.editVisible = true;
             this.tips = false;
             this.editsForm.keyClassify = name;
+            this.wordType = tip;
+            this.toopIndex = inx;
         },
-        toop(ite1,ite2,ite3,ite4) {
+        toop(ite1,ite2,ite3,ite4,index,name) {
             this.editVisible = true;
             this.tips = true;
             this.editsForm.keyClassify = ite1;
             this.editsForm.botWord = ite2;
             this.editsForm.lWord = ite3.split(',');
             this.editsForm.rWord = ite4.split(',');
+            this.toopIndex = index;
+            this.wordType = name;
         },
-        delKey(name) {
+        delKey(name,index) {
             this.$refs.keysed.visibles = true;
             this.$refs.keysed.care = 1;
             this.$refs.keysed.keyShow = true;
             this.keyNames = name;
+            this.keyIndex = index;
         },
-        keyDel() {
-            alert('111')
+        keyDel(index,indx) {
+            this.keyDatas.data[index].a_key.splice(indx,1);
+            this.updated({a_items:this.keyDatas.data});
         },
         wAdd() {
             this.bookForm.additions.push({
@@ -183,6 +195,18 @@ export default {
         exclude() {
             this.editsForm.rWord.push("");
         },
+        addCell(ite1,name,index) {
+            this.editVisible = true;
+            this.tips = true;
+            this.editsForm.keyClassify = ite1;
+            this.wordType = name;
+            this.toopIndex = index;
+            // this.editsForm = {
+            //     botWord: '',
+            //     lWord: [],
+            //     rWord: []
+            // };
+        },
         updated(obj) {
             updateKeys(obj).then(res => {
                 if (res.data.status == 1) {
@@ -232,40 +256,54 @@ export default {
                     ]
                 }
             ]
-            this.keyDatas.data.forEach(v => {
-                arr1.push(v);
-                if (this.bookForm.keyType == v.s_item) {
-                    this.$message({
-                        message: '所填关键词分类名已存在',
-                        type: 'warning'
-                    });
-                    return;
-                }
-            })
+            if (this.keyDatas.data) {
+                this.keyDatas.data.forEach(v => {
+                    arr1.push(v);
+                    if (this.bookForm.keyType == v.s_item) {
+                        this.$message({
+                            message: '所填关键词分类名已存在',
+                            type: 'warning'
+                        });
+                        return;
+                    }
+                })
+            }
             this.updated({a_items:arr1})
         },
         saveEdit() {
             this.editVisible = false;
-            this.keyDatas.data.push({ 
-                s_item: this.editsForm.keyClassify,
-                a_key:[
-                    {
-                        key: this.editsForm.botWord,
-                        appendkey: this.editsForm.lWord,
-                        notkey: this.editsForm.rWord
-                    }
-                ]
-            })
-            console.log(this.keyDatas.data)
-            let obj = {
-                delete_item: '',
-                update_item: {
-                    before: '',
-                    after: ''
-                },
-                a_items:[this.keyDatas.data]
+            let a_key = [];
+            if(this.wordType == 'add') {
+                this.keyDatas.data[this.toopIndex].a_key.push({
+                    key: this.editsForm.botWord,
+                    appendkey: this.editsForm.lWord,
+                    notkey: this.editsForm.rWord
+                })
+                this.editsForm = {
+                    botWord: '',
+                    lWord: [],
+                    rWord: []
+                };
+            } else if(this.wordType == 'edit') {
+                this.keyDatas.data.splice(this.toopIndex,1,{ 
+                    s_item: this.editsForm.keyClassify,
+                    a_key:[
+                        {
+                            key: this.editsForm.botWord,
+                            appendkey: this.editsForm.lWord,
+                            notkey: this.editsForm.rWord
+                        }
+                    ]
+                })
+                this.editsForm = {
+                    botWord: '',
+                    lWord: [],
+                    rWord: []
+                };
+            } else if(this.wordType == 'i_edit') {
+                this.keyDatas.data[this.toopIndex].s_item = this.editsForm.keyClassify;
             }
-            // this.updated(obj)
+            this.updated({a_items:this.keyDatas.data})
         }
     }
 }
@@ -399,6 +437,23 @@ export default {
                         cursor: pointer;
                     }
                 }
+                .add_card {
+                    width: 164px;
+                    height: 82px;
+                    display: flex;
+                    justify-content: center;
+                    align-items: center;
+                    cursor: pointer;
+                    padding: 0;
+                    i {
+                        font-size: 24px;
+                        color: #C4C4C4;
+                    }
+                    &:hover {
+                        color: #2CB7CA;
+                    }
+                    
+                }
             }
         }
     }

+ 2 - 2
src/views/bus/components/bidMsg.vue

@@ -224,7 +224,7 @@ export default {
         },
         curChange(val) {
             this.pageSize = val;
-            this.sendData();
+            this.sendData(this.change);
         },
         changed(num) {
             this.change = num;
@@ -356,7 +356,7 @@ export default {
                     return;
                 }
                 this.$refs.warned.visibles = true;
-                    this.exportData = res;
+                this.exportData = res;
                 if (res.isExport) {
                     this.$refs.warned.care = 1;
                     this.arrExport = obj2;

+ 6 - 5
src/views/bus/components/distribute.vue

@@ -104,7 +104,8 @@ export default {
         }
     },
     created() {
-        this.fens = this.viewDatas.nodiff == 1 ? true : false;
+        let nums = this.viewDatas.nodiff;
+        this.fens = nums == 1 ? true : false;
         nodiffList().then(res => {
             this.tableData1 = res.data.rules;
             res.data.rules.forEach((el,i) => {
@@ -116,11 +117,10 @@ export default {
                     area: String(arr.join(",").replace(/,/g, "、")),
                     buyerclass: String(el.buyerclass.join(",").replace(/,/g, "、")),
                     persons: String(el.persons),
-                    items: String(el.items)
+                    items: String(el.items.join(",").replace(/,/g, "、"))
                 })
             });
         })
-        console.log(this.tableData)
     },
     methods: {
         noSwitch() {
@@ -145,12 +145,13 @@ export default {
         cellClick(indx, index, arr) {
             this.digs = indx;
             this.cellIndex = index;
-            this.boxData = this.tableData1[index]?this.tableData1[index].buyerclass:[];
-            // console.log(this.boxData)
             if (indx == 5) {
                 this.$refs.fenModel.centerDialogVisible = true;
                 // this.$refs.fenModel.selectedList = [];
+            } else if (indx == 6) {
+                
             } else {
+                this.boxData = this.tableData1[index]?this.tableData1[index]:[];
                 this.$refs.editModel.boxVisible = true;
             }
         },

+ 50 - 17
src/views/bus/components/editBox.vue

@@ -15,7 +15,7 @@
                         v-model="input1">
                     </el-input>
                     <div class="industy_lis">
-                        <div class="quan_bu">
+                        <div class="quan_bu" v-if="digs != 6">
                             <el-checkbox-button 
                                 :label="digs == 1?'全国':digs == 2?'全部行业':'全部类型'"
                                 :class="{c_active:digs != 2}"
@@ -24,13 +24,13 @@
                             </el-checkbox-button>
                         </div>
                         <!-- 区域 -->
-                        <div class="lists" v-if="digs == 1"></div>
+                        <!-- <div class="lists" v-if="digs == 1"></div> -->
                         <!-- 采购单位行业 -->
                         <div class="lists" v-if="digs == 2">
                             <ul>
                                 <li v-for="item in groupData2" :key="item.id" class="li_data">
                                     <h3>{{item.letter}}</h3>
-                                    <el-checkbox-group v-model="boxData">
+                                    <el-checkbox-group v-model="boxData.buyerclass">
                                         <el-checkbox-button v-for="ite in item.list" :key="ite.id" :label="ite.name">{{ite.name}}</el-checkbox-button>
                                     </el-checkbox-group>
                                 </li>
@@ -51,15 +51,15 @@
                         </div>
                         <!-- 分类名称 -->
                         <div class="lists" v-if="digs == 6">
-                            <ul>
-                                <li v-for="item in groupData4" :key="item.id" class="li_data">
-                                    <h3>{{item.letter}}</h3>
-                                    <el-checkbox-group v-model="checkboxGroup4">
-                                        <el-checkbox-button :label="ite.id">{{ite.name}}</el-checkbox-button>
-                                        <el-checkbox-button v-for="ite in item.list" :key="ite.id" :label="ite.id">{{ite.name}}</el-checkbox-button>
-                                    </el-checkbox-group>
-                                </li>
-                            </ul>
+                            <div class="li_fen" v-for="(item,index) in groupData6" :key="index">
+                                <div class="card_icons">
+                                    <i class="el-icon-check"></i>
+                                </div>
+                                <div class="conts">
+                                    <h2>钢筋水泥</h2>
+                                    <p>钢筋水泥、钢筋水泥】钢筋水泥、钢筋水泥钢筋水泥钢筋水泥钢筋水泥、钢筋水泥】钢筋水泥、钢筋水泥钢筋水泥钢筋水泥</p>
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>
@@ -69,7 +69,7 @@
                 <el-button @click="boxVisible = false" plain>取 消</el-button>
             </span>
         </el-dialog>
-        <!-- <area-select></area-select> -->
+        <!-- <area-select v-if="digs == 1"></area-select> -->
     </div>
 </template>
 
@@ -80,7 +80,6 @@ export default {
     components:{ areaSelect },
     props: {
         digs: Number,
-        keyNames: String,
         boxCheck: {},
         boxData: {}
     },
@@ -118,14 +117,16 @@ export default {
                 Y: ['云南'],
                 Z: ['浙江']
             },
-            proMapList: []
+            proMapList: [],
+            keyData6: {}
         }
     },
     created() {
         this.groupData2 = industryData2;
         this.groupData3 = industryData3;
-        this.checkboxGroup2 = this.boxData;
-        console.log(this.boxData);
+        // this.checkboxGroup2 = this.boxData;
+        this.groupData6 = this.keyData6;
+        console.log(this.groupData6);
         for (const key in this.provinceData) {
             this.groupData1.push(key);
             this.proMapList[key] =this.provinceData[key].map(v => {
@@ -136,6 +137,7 @@ export default {
     methods: {
         confirmed() {
             this.boxVisible = false;
+            console.log()
         }
     }
 }
@@ -187,6 +189,37 @@ export default {
                                 
                             }
                         }
+                        .li_fen {
+                            display: flex;
+                            flex-direction: initial;
+                            text-align: left;
+                            padding: 10px 20px!important;
+                            box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
+                            .card_icons {
+                                width: 18px;
+                                height: 18px;
+                                line-height: 18px;
+                                text-align: center;
+                                color: #2ABED1;
+                                background: #F5F6F7;
+                                border-radius: 50%;
+                                border: 1px solid #C0C4CC;
+                            }
+                            .conts {
+                                margin-left: 12px;
+                                h2 {
+                                    font-weight: bold;
+                                    font-size: 14px;
+                                    line-height: 20px;
+                                }
+                                p {
+                                    font-size: 12px;
+                                    line-height: 20px;
+                                    color: #686868;
+                                    margin-top: 5px;
+                                }
+                            }
+                        }
                         .li_area {
                             box-shadow: none!important;
                             .quan {

+ 11 - 5
src/views/bus/components/subMage.vue

@@ -6,8 +6,8 @@
         </el-breadcrumb>
         <el-divider></el-divider>
         <div class="pattern_cont">
-            <h2>选择订阅模式</h2>
-            <div class="card_twice">
+            <h2 v-if="!entData.admin_department">选择订阅模式</h2>
+            <div class="card_twice" v-if="!entData.admin_department">
                 <el-card class="left_card" :class="{c_active:apper == 0}" shadow="hover" @click.native="booked(0)">
                     <h3>统一订阅模式</h3>
                     <p>企业或部门统一订阅,统一分发给下属员工,可进行商机追踪。</p>
@@ -19,13 +19,12 @@
                 <el-card class="left_card right_card" :class="{c_active:apper == 1}" shadow="hover" @click.native="booked(1)">
                     <h3>个人订阅模式</h3>
                     <p>员工个人自行订阅,不可进行商机追踪。</p>
-                    <!-- <span v-if="apper == 1">推荐</span> -->
                     <div class="card_icons">
                         <i class="el-icon-check" v-if="apper == 1"></i>
                     </div>
                 </el-card>
             </div>
-            <h2 style="margin-top:38px">订阅设置</h2>
+            <h2>订阅设置</h2>
             <el-divider></el-divider>
             <div class="book_cont">
                 <el-form class="demo_form">
@@ -126,6 +125,9 @@ import vDistri from './distribute.vue';
 import vWarn from './warnBox.vue';
 import vEdit from './editBox.vue';
 export default {
+    props: {
+        entData: {}
+    },
     components: {
         vKey, 
         vDistri,
@@ -165,7 +167,7 @@ export default {
         scribeData().then(res => {
             this.viewDatas = res.data;
             this.bookForm.dispense = res.data.subdis == '1' ? true : false;
-            this.boxData = res.data.subscribe.buyerclass;
+            this.boxData = res.data.subscribe;
             this.bookForm.tuiRadio = res.data.subscribe.ratemode;
             this.bookForm.proPei = res.data.subscribe.projectmatch == '1' ? true : false;
         })
@@ -289,11 +291,15 @@ export default {
                 }
             }
         }
+        .h_active {
+            margin-top: 38px;
+        }
         .card_twice {
             display: flex;
             flex-direction: initial;
             justify-content: center;
             margin-top: 18px;
+            margin-bottom: 38px;
             .left_card {
                 position: relative;
                 width: 343px;

+ 10 - 4
src/views/bus/components/warnBox.vue

@@ -43,7 +43,8 @@ export default {
         keyNames: String,
         exportData: {},
         tuiNums: Boolean,
-        arrExport: Object
+        arrExport: Object,
+        keyIndex: Number
     },
     data() {
         return {
@@ -56,9 +57,14 @@ export default {
     methods: {
         confirmed(val) {
             this.visibles = false;
-            subscribeExport(this.arrExport).then(str => {
-                window.location.href = str.xlsxUrl;
-            })
+            if (!this.keyShow) {
+                subscribeExport(this.arrExport).then(str => {
+                    window.location.href = str.xlsxUrl;
+                })
+            } else {
+                this.$parent.keyDatas.data.splice(this.keyIndex,1);
+                this.$parent.updated({a_items:this.$parent.keyDatas.data})
+            }
         },
         knowed() {
             this.visibles = false;

+ 9 - 2
src/views/bus/subscribe.vue

@@ -2,9 +2,9 @@
     <div class="sub_set">
         <el-tabs v-model="activeName" @tab-click="handleClick">
             <el-tab-pane label="招标信息" name="first">
-                <v-sub></v-sub>
+                <v-sub :entData="entData"></v-sub>
             </el-tab-pane>
-            <el-tab-pane label="数据导出记录" name="second">
+            <el-tab-pane label="数据导出记录" name="second" v-if="entData.admin_system">
                 <v-export></v-export>
             </el-tab-pane>
         </el-tabs>
@@ -12,6 +12,7 @@
 </template>
 
 <script>
+import { entinfo } from '@/api/api';
 import vExport from './components/export.vue';
 import vSub from './components/subMage.vue';
 export default {
@@ -22,8 +23,14 @@ export default {
     data() {
         return {
             activeName: 'first',
+            entData: []
         }
     },
+    created() {
+        entinfo().then(res => {
+            this.entData = res.data;
+        });
+    },
     methods: {
         handleClick(tab, event) {
             this.activeName = tab.name

+ 6 - 6
vue.config.js

@@ -17,9 +17,9 @@ module.exports = {
     proxy: {
       "/entbase": {
         // target: "https://app2-jytest.jianyu360.cn",
-        target: "http://127.0.0.1:815",
+        // target: "http://127.0.0.1:815",
         // target:'http://192.168.20.51:815',
-        // target:'http://192.168.20.241:815',
+        target:'http://192.168.20.241:815',
         changeOrigin: true,
         ws: true,
         pathRewrite: {
@@ -28,8 +28,8 @@ module.exports = {
       },
       "/entniche": {
         // target: "https://app2-jytest.jianyu360.cn",
-        // target: "http://192.168.20.241:812",
-        target: "http://127.0.0.1:812",
+        target: "http://192.168.20.241:812",
+        // target: "http://127.0.0.1:812",
         // target:'http://192.168.20.214:813',
         changeOrigin: true,
         ws: true,
@@ -41,10 +41,10 @@ module.exports = {
         // target: "http://ent-xzh.jianyu360.cn",
         // target: "https://app2-jytest.jianyu360.cn",
         // target: "http://192.168.20.241:813/entniche",
-        target: "http://127.0.0.1:813",
+        // target: "http://127.0.0.1:813",
         // target:'http://192.168.20.51:815/entbase',
         // target:'http://192.168.20.51:813/entdataexport',
-        // target:'http://192.168.20.241:813',
+        target:'http://192.168.20.241:813',
         // target:'http://192.168.20.241:812',
         changeOrigin: true,
         ws: true,