123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- <template>
- <div class="communal-list" v-loading.fullscreen.lock="fullscreenLoading">
- <div class="communal-title">
- <div>团组任务分配</div>
- </div>
- <div class="konzh" style="display: flex;justify-content: space-between;">
- <el-form style="display: flex;" label-width="70px" class="demo-form-inline">
- <el-form-item style="width: 300px;margin-right: 20px;" label="团组名称">
- <el-select v-model="diId" filterable clearable placeholder="请选择" style="width:100%;"
- @change="diidChange()">
- <el-option v-for="item1 in delegationInfos" :key=item1.id :label=item1.name
- :value=item1.id></el-option>
- </el-select>
- </el-form-item>
- <el-form-item style="width: 300px;margin-right: 20px;" label="操作分类">
- <el-select v-model="ctId" filterable clearable placeholder="请选择" style="width:100%;"
- @change="sdIdChange()">
- <el-option v-for=" item1 in setData" :key=item1.id :label=item1.name :value=item1.id></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <!-- <div style="width: 240px;margin-right: 20px;">
- <el-select v-model="diId" filterable clearable placeholder="请选择" style="width:100%;"
- @change="diidChange()">
- <el-option v-for="item1 in delegationInfos" :key=item1.id :label=item1.name
- :value=item1.id></el-option>
- </el-select>
- </div>
- <div style="width: 200px;">
- <el-select v-model="ctId" filterable clearable placeholder="请选择" style="width:100%;"
- @change="sdIdChange()">
- <el-option v-for=" item1 in setData" :key=item1.id :label=item1.name :value=item1.id></el-option>
- </el-select>
- </div> -->
-
- <div style="width: 30%;text-align: right;">
- <el-button type="primary" style="margin-left: 10px;" @click="btn">保存</el-button>
- </div>
- </div>
- <div class="tzinif-info">
- <div class="tzinif-info-li">
- <label>团 号:</label>
- <span>{{ DelegationInfo.tourCode }}</span>
- </div>
- <div class="tzinif-info-li">
- <label>客 户:</label>
- <span>{{ DelegationInfo.clientName }}</span>
- </div>
- <div class="tzinif-info-li">
- <label>出访国家:</label>
- <span>{{ DelegationInfo.visitCountry |filter_city}}</span>
- </div>
- <div class="tzinif-info-li">
- <label>起止日期:</label>
- <span>{{ DelegationInfo.visitStartDate|filter_time }}~{{ DelegationInfo.visitEndDate|filter_time}}</span>
- </div>
- <div class="tzinif-info-li">
- <label>天数/人数:</label>
- <span>{{ DelegationInfo.visitDays }}/{{ DelegationInfo.visitPNumber }}</span>
- </div>
- </div>
- <!-- <div class="tzinif">
- <span style="font-weight: bold;">团 号:</span>{{ DelegationInfo.tourCode }}
- <span style="font-weight: bold;">客 户:</span>{{ DelegationInfo.clientName }}
- <span style="font-weight: bold;">出访国家:</span>{{ DelegationInfo.visitCountry }}
- <span style="font-weight: bold;">起止日期:</span>{{ DelegationInfo.visitStartDate }} ~ {{
- DelegationInfo.visitEndDate }}
- <span style="font-weight: bold;">天数/人数:</span>{{ DelegationInfo.visitDays }}天/{{ DelegationInfo.visitPNumber }}人
- </div> -->
- <!-- <div>
- <div>人员安排</div>
- </div> -->
- <div style="margin-top: 10px;border-top: 1px solid #C0C4CC;">
- <div style="display: flex;flex-wrap: wrap;">
- <div v-for="( item, index ) in user "
- :key="index"
- style="width: 12.5%;margin: 10px 0;text-align: center;">
- <el-checkbox :label="item.id" :value="userStr.indexOf(item.id) != -1" border @change="check(item.id)"
- style="width: 120px;">{{
- item.name
- }}</el-checkbox>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- rules: {},
- token: '',
- userId: 0,
- delegationInfos: [],
- setData: [],
- user: [],
- diId: '',
- ctId: '',
- userStr: [],
- TaskAssignment: {},
- DelegationInfo: {},
- fullscreenLoading:false,
- }
- },
- methods: {
- GetTaskAssignmen() {
- this.fullscreenLoading=true;
- var that = this
- var url = "/api/Groups/GetTaskAssignmen";
- this.$axios({
- method: 'post',
- url: url,
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- }).then(function (res) {
- console.log(res)
- if (res.data.code == 200) {
- that.delegationInfos = res.data.data.delegationInfos;
- that.diId=res.data.data.delegationInfos[0].id;
- that.setData = res.data.data.setData;
- that.ctId=res.data.data.setData[0].id;
- that.user = res.data.data.user;
- setTimeout(() => {
- that.TaskAssignmenQuery();
- }, 500);
- console.log(that.setData)
- }
- })
- },
- TaskAssignmenQuery() {
- var that = this
- var url = "/api/Groups/TaskAssignmenQuery";
- this.$axios({
- method: 'post',
- url: url,
- data: {
- diId: that.diId,
- ctId: that.ctId,
- },
- headers: {
- Authorization: 'Bearer ' + this.token
- },
- }).then(function (res) {
- if (res.data.code == 200) {
- that.userStr = res.data.data.userStr
- that.TaskAssignment = res.data.data.taskAssignment
- that.DelegationInfo = res.data.data.delegationInfo
- that.fullscreenLoading=false;
- } else {
- that.userStr = [];
- that.TaskAssignment = {};
- that.DelegationInfo = {}
- that.fullscreenLoading=false;
- }
- })
- },
- btn() {
- var id = 0
- var that = this;
- if (that.TaskAssignment.id != undefined) {
- id = that.TaskAssignment.id;
- }
- var url = "/api/Groups/GetTaskAssignmenOp";
- this.$axios({
- method: 'post',
- url: url,
- data: {
- diId: that.diId,
- ctId: that.ctId,
- uIdStr: that.userStr,
- isEnable: 1,
- createUserId: that.userId,
- remark: ""
- },
- headers: {
- Authorization: 'Bearer ' + that.token
- },
- }).then(function (res) {
- if (res.data.code == 200) {
- that.$message({
- message: '保存成功!',
- type: 'success'
- });
- } else {
- that.$message.error('保存失败!' + res.data.msg);
- }
- })
- },
- diidChange() {
- this.userStr = [];
- this.TaskAssignmenQuery()
- console.log(this.userStr)
- },
- sdIdChange() {
- this.TaskAssignmenQuery()
- console.log(this.userStr)
- },
- check(id) {
- var index = this.userStr.indexOf(id)
- if (index == -1) {
- this.userStr.push(id)
- } else {
- this.userStr = this.userStr.filter((x) => x !== id)
- }
- }
- },
- filters:{
- filter_city(value){
- if(value){
- return value.replaceAll('|','、')
- }
- },
- filter_time(value){
- if(value){
- return value.split(" ")[0]
- }
- }
- },
- mounted() {
- this.token = JSON.parse(localStorage.getItem('userinif')).token;
- this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
- this.GetTaskAssignmen();
- }
- }
- </script>
- <style>
- .communal-list {
- background-color: #fff;
- padding: 10px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- min-height: 820px;
- }
- .communal-title {
- display: flex;
- font-size: 17px;
- font-weight: 600;
- color: #555;
- margin-bottom: 15px;
- justify-content: space-between;
- align-items: center;
- }
- .communal-box {
- display: flex;
- }
- .communal-box>button {
- margin-left: 10px;
- padding: 8px 20px;
- }
- .tzinif-info {
- display: flex;
- margin-top: 10px;
- }
- .tzinif-info-li {
- margin-right: 30px;
- }
- .tzinif-info-li label {
- color: #606266;
- font-size: 15px;
- font-weight: 600;
- }
- .tzinif-info-li span {
- color: #606266;
- font-size: 14px;
- }
- .konzh .el-form-item{
- margin-bottom: 0;
- }
- </style>
|