liuhj 1 week ago
parent
commit
6fa5e98b70
2 changed files with 185 additions and 22 deletions
  1. 90 9
      src/components/OP/EntryDetails.vue
  2. 95 13
      src/components/OP/EntryDetailsdraft.vue

+ 90 - 9
src/components/OP/EntryDetails.vue

@@ -1,6 +1,15 @@
 <template>
     <div v-loading.fullscreen.lock="fullscreenLoading">
         <div class="Entry-all">
+            <el-dialog v width="400px" title="设置查看权限" class="permissionsbox" :visible.sync="setpermissions">
+                <el-checkbox-group v-model="viewUsers" @change="handleCheckAllChange">
+                    <el-checkbox v-for="item in viewUsersarr" :label="item.id" :key="item.id">{{item.name}}</el-checkbox>
+                </el-checkbox-group>
+                <div style="text-align: right;margin-top: 15px;">
+                    <el-button size="mini" @click="EnterExitCostSetViewPermissiion" type="primary">分配</el-button>
+                    <el-button size="mini" @click="setpermissions=false">取消</el-button>
+                </div>
+            </el-dialog>
             <div class="Entry-head">
                 <div class="Entry-head-li">
                     <label>团组名称:</label>
@@ -11,7 +20,7 @@
                         </el-option>
                     </el-select>
                 </div>
-                <div class="Entry-head-li">
+                <div v-if="isSave" class="Entry-head-li">
                     <!-- <el-button type="primary">计算费用</el-button> -->
                     <el-button @click="NationalTravelFeeImportReceivables" type="primary">导出到收款账单</el-button>
                     <el-button @click="cleanout" type="primary">全部清空</el-button>
@@ -26,6 +35,7 @@
                         </el-option>
                     </el-select>
                     <el-button @click="eptschedule(2)" type="primary">导出下拉所选表格</el-button>
+                    <el-button @click="setpermissionsbtn" type="primary">设置权限</el-button>
                     <el-button @click="eptschedule(3)" type="primary">团组成员名单</el-button>
                 </div>
             </div>
@@ -259,7 +269,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, quarterageData, 1)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -324,7 +334,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, boardWagesData, 2)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -389,7 +399,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, miscellaneousFeeData, 3)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -454,7 +464,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, trainingExpenseData, 4)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -534,7 +544,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="DeleteOtherExpenses(scope.$index, scope.row, otherData)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -671,7 +681,14 @@ export default {
             visainfo: {},
             //其他币种
             othercurrencys: [],
-            otherfylx: []
+            otherfylx: [],
+            //设置权限
+            setpermissions:false,
+            isSave:false,
+            isView:false,
+            viewUsers:[],
+            viewUsersby:[],
+            viewUsersarr:[]
         }
     },
     methods: {
@@ -692,6 +709,7 @@ export default {
                 if (res.data.code == 200) {
                     that.options = res.data.data.groupNameData;
                     that.currencys = res.data.data.currencyInit;
+                    that.viewUsersarr= res.data.data.viewPermissionData;
                     // console.log(that.value)
                     if (that.value == null) {
                         that.value = res.data.data.groupNameData[0].id;
@@ -864,6 +882,8 @@ export default {
             //初始化数据
             this.ID = '';
             // this.currencys=[]
+            this.viewUsers=[];
+            this.viewUsersby=[];
             this.TotalAccommodationFee = 0;//住宿费合计
             this.TotalMeals = 0;//伙食费合计
             this.TotalMiscellaneous = 0;//公杂费合计
@@ -903,6 +923,8 @@ export default {
             this.sumTDC = false//公务舱小计选择框
             this.airJJC_Checked = false//经济舱选择框 
             this.airGWC_Checked = false//公务舱选择框
+            this.isSave = false//保存权限 
+            this.isView = false//查看权限
             this.storageid = 0
 
             this.quarterageData = [
@@ -1365,14 +1387,19 @@ export default {
                 },
                 data: {
                     portType: 1,
-                    diId: that.value
+                    diId: that.value,
+                    currUserId:that.userId
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    console.log(res)
                     that.ID = res.data.data.id;
                     //汇率
                     that.currencys = res.data.data.currencys;
+                    //权限
+                    that.isSave=res.data.data.isSave;
+                    that.isView=res.data.data.isView;
+                    that.viewUsers=res.data.data.viewUsers;
+                    that.viewUsersby=res.data.data.viewUsers;
                     //境内费用
                     that.DomesticFees.visafees = res.data.data.visa;
                     that.DomesticFees.visafeesDescription = res.data.data.visaRemark;
@@ -2444,6 +2471,48 @@ export default {
                 that.$message.error("操作错误,联系信息部!");
             });
         },
+        //设置权限按钮
+        setpermissionsbtn(){
+            this.viewUsers=this.viewUsersby;
+            this.setpermissions=true;
+        },
+        handleCheckAllChange(val) {
+            console.log(val);
+            console.log(this.viewUsers);
+            
+        },
+        //分配查看权限
+        EnterExitCostSetViewPermissiion() {
+            var url = "/api/Groups/EnterExitCostSetViewPermissiion"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data:{
+                    portType:1,
+                    groupId:that.value,
+                    userIds:that.viewUsers,
+                    currUserId:that.userId,
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    that.setpermissions=false;
+                    that.GetEnterExitCostInfobyDiId();
+                } else {
+                    that.setpermissions=false;
+                    that.$message.error(res.data.msg);
+                }
+            }).catch(function (error) {
+                that.$message.error("操作错误,联系信息部!");
+            });
+        },
     },
     filters: {
         numFilter(value) {
@@ -2790,4 +2859,16 @@ export default {
 .Entry-all .el-table th.el-table__cell>.cell {
     text-align: center;
 }
+.Entry-all .el-button+.el-button{
+    margin-left: 0px;
+}
+.Entry-all .permissionsbox .el-checkbox-group{
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+}
+.Entry-all .permissionsbox .el-checkbox{
+    width: 150px;
+    margin-right: 0;
+}
 </style>

+ 95 - 13
src/components/OP/EntryDetailsdraft.vue

@@ -1,6 +1,15 @@
 <template>
     <div v-loading.fullscreen.lock="fullscreenLoading">
         <div class="Entrydraft-all">
+            <el-dialog v width="400px" title="设置查看权限" class="permissionsbox" :visible.sync="setpermissions">
+                <el-checkbox-group v-model="viewUsers" @change="handleCheckAllChange">
+                    <el-checkbox v-for="item in viewUsersarr" :label="item.id" :key="item.id">{{item.name}}</el-checkbox>
+                </el-checkbox-group>
+                <div style="text-align: right;margin-top: 15px;">
+                    <el-button size="mini" @click="EnterExitCostSetViewPermissiion" type="primary">分配</el-button>
+                    <el-button size="mini" @click="setpermissions=false">取消</el-button>
+                </div>
+            </el-dialog>
             <div class="Entrydraft-head">
                 <div class="Entrydraft-head-li" style="width:370px">
                     <label>草稿名称:</label>
@@ -18,7 +27,7 @@
                         </el-option>
                     </el-select> -->
                 </div>
-                <div class="Entrydraft-head-li" style="width:361px">
+                <div v-if="isSave" class="Entrydraft-head-li" style="width:361px">
                     <label>团组:</label>
                     <el-select style="width:250px" v-model="diid" filterable placeholder="请选择">
                         <el-option v-for="item in groupNameDatas" :key="item.id" :label="item.groupName" :value="item.id">
@@ -28,7 +37,7 @@
                     </el-select>
                     <el-button @click="EnterExitCostDraftImportData" type="primary">同步</el-button>
                 </div>
-                <div class="Entrydraft-head-li" style="width:780px">
+                <div v-if="isSave" class="Entrydraft-head-li" style="width:530px">
                     <!-- <el-button type="primary">计算费用</el-button> -->
                     <!-- <el-button @click="NationalTravelFeeImportReceivables" type="primary">导出到收款账单</el-button> -->
                     
@@ -38,11 +47,12 @@
                         </el-option>
                     </el-select>
                     <el-button @click="eptschedule(1)" type="primary">导出所选明细表</el-button>
-                    <el-select style="width:202px" v-model="tablevalue" placeholder="请选择">
+                    <el-button @click="setpermissionsbtn" type="primary">分配权限</el-button>
+                    <!-- <el-select style="width:202px" v-model="tablevalue" placeholder="请选择">
                         <el-option v-for="item in tablevalueoptions" :key="item.id" :label="item.name" :value="item.id">
                         </el-option>
                     </el-select>
-                    <el-button @click="eptschedule(2)" type="primary">导出下拉所选表格</el-button>
+                    <el-button @click="eptschedule(2)" type="primary">导出下拉所选表格</el-button> -->
                     <!-- <el-button @click="eptschedule(3)" type="primary">团组成员名单</el-button> -->
                 </div>
             </div>
@@ -276,7 +286,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, quarterageData, 1)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -341,7 +351,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, boardWagesData, 2)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -406,7 +416,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, miscellaneousFeeData, 3)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -471,7 +481,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="deleteRow(scope.$index, scope.row, trainingExpenseData, 4)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -551,7 +561,7 @@
                             </el-table-column>
                             <el-table-column prop="address" label="操 作">
                                 <template slot-scope="scope">
-                                    <el-button style="color: #fff;" size="mini" type="danger"
+                                    <el-button v-if="isSave" style="color: #fff;" size="mini" type="danger"
                                         @click="DeleteOtherExpenses(scope.$index, scope.row, otherData)">删除</el-button>
                                 </template>
                             </el-table-column>
@@ -695,6 +705,14 @@ export default {
 
             draftNameDatas:[],
             groupNameDatas:[],
+
+            //设置权限
+            setpermissions:false,
+            isSave:false,
+            isView:false,
+            viewUsers:[],
+            viewUsersby:[],
+            viewUsersarr:[]
         }
     },
     methods: {
@@ -737,8 +755,7 @@ export default {
                         };
                     });
                     that.currencys = res.data.data.currencyInit;
-                    console.log(that.value);
-                    console.log(that.draftNameDatas);
+                    that.viewUsersarr= res.data.data.viewPermissionData;
                     if (that.value == null) {
                         that.valuename = that.draftNameDatas[0].value;
                         that.value = that.draftNameDatas[0].id;
@@ -997,6 +1014,8 @@ export default {
             this.sumTDC = false//公务舱小计选择框
             this.airJJC_Checked = false//经济舱选择框 
             this.airGWC_Checked = false//公务舱选择框
+            this.isSave = false//保存权限 
+            this.isView = false//查看权限
             this.storageid = 0
 
             this.quarterageData = [
@@ -1459,7 +1478,8 @@ export default {
                 },
                 data: {
                     portType: 1,
-                    id: that.value
+                    id: that.value,
+                    currUserId:that.userId
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
@@ -1467,6 +1487,11 @@ export default {
                     that.ID = res.data.data.id;
                     //汇率
                     that.currencys = res.data.data.currencys;
+                    //权限
+                    that.isSave=res.data.data.isSave;
+                    that.isView=res.data.data.isView;
+                    that.viewUsers=res.data.data.viewUsers;
+                    that.viewUsersby=res.data.data.viewUsers;
                     //境内费用
                     that.DomesticFees.visafees = res.data.data.visa;
                     that.DomesticFees.visafeesDescription = res.data.data.visaRemark;
@@ -1538,8 +1563,11 @@ export default {
 
             this.value=0;
             this.valuename="";
+            this.viewUsers=[],
+            this.viewUsersby=[],
 
-
+            this.isSave=true,
+            this.isView=true,
 
             this.ID = '';
             // this.currencys=[]
@@ -3016,6 +3044,48 @@ export default {
                 that.$message.error("操作错误,联系信息部!");
             });
         },
+        //设置权限按钮
+        setpermissionsbtn(){
+            this.viewUsers=this.viewUsersby;
+            this.setpermissions=true;
+        },
+        handleCheckAllChange(val) {
+            console.log(val);
+            console.log(this.viewUsers);
+            
+        },
+        //分配查看权限
+        EnterExitCostSetViewPermissiion() {
+            var url = "/api/Groups/EnterExitCostDraftSetViewPermissiion"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data:{
+                    portType:1,
+                    draftId:that.value,
+                    userIds:that.viewUsers,
+                    currUserId:that.userId,
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    that.setpermissions=false;
+                    that.GetEnterExitCostInfobyDiId();
+                } else {
+                    that.setpermissions=false;
+                    that.$message.error(res.data.msg);
+                }
+            }).catch(function (error) {
+                that.$message.error("操作错误,联系信息部!");
+            });
+        },
     },
     filters: {
         numFilter(value) {
@@ -3364,4 +3434,16 @@ export default {
 .Entrydraft-all .el-table th.el-table__cell>.cell {
     text-align: center;
 }
+.Entrydraft-all .el-button+.el-button{
+    margin-left: 0px;
+}
+.Entrydraft-all .permissionsbox .el-checkbox-group{
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+}
+.Entrydraft-all .permissionsbox .el-checkbox{
+    width: 150px;
+    margin-right: 0;
+}
 </style>