liuhj 2 months ago
parent
commit
19c1c2dd16
1 changed files with 74 additions and 2 deletions
  1. 74 2
      src/components/Resource/VisitSchedule.vue

+ 74 - 2
src/components/Resource/VisitSchedule.vue

@@ -1,5 +1,19 @@
 <template>
     <div class="VisitSchedule-all" v-loading.fullscreen.lock="fullscreenLoading">
+        <el-dialog width="400px" title="单位" :visible.sync="UnitVisible">
+            <el-form>
+                <el-form-item label="团组单位:" :label-width="formLabelWidth">
+                    <el-input v-model="unitone" autocomplete="off"></el-input>
+                </el-form-item>
+                <el-form-item label="拜访单位:" :label-width="formLabelWidth">
+                    <el-input v-model="unittwo" autocomplete="off"></el-input>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="UnitSave('覆盖',unitid)">覆 盖</el-button>
+                <el-button type="primary" @click="UnitSave('追加',unitid)">追 加</el-button>
+            </div>
+        </el-dialog>
         <div class="VisitSchedule-search-head">
             <el-form ref="form" label-width="75px">
                 <el-form-item style="width: 340px;" label="团组名称:">
@@ -50,6 +64,9 @@
                             <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="items.details">
                             </el-input>
                         </div>
+                        <div class="VisitSchedule-content-btn">
+                            <el-button @click="openunit(items)" type="primary">单 位</el-button>
+                        </div>
                     </div>
                 </div>
             </div>
@@ -60,7 +77,7 @@
 export default {
     data() {
         return {
-            diid: '',
+            diid: 2373,
             groupList: [],
             tablearr: [],
             userId: '',
@@ -73,6 +90,10 @@ export default {
             blackCodeList: [],
             fileTempList: [],
             fileIndex: 1,
+            UnitVisible:false,
+            formLabelWidth:'70px',
+            unitone:'',
+            unittwo:'',
         }
     },
     methods: {
@@ -126,6 +147,52 @@ export default {
                 that.$message.error('请联系信息部!');
             });
         },
+        openunit(val){
+            this.UnitVisible=true;
+            this.unitid=val;
+            this.unitone="";
+            this.unittwo="";
+        },
+        //单位保存
+        UnitSave(val,id) {
+            this.fullscreenLoading=true;
+            var url = "/api/Groups/ApprovalJourneyAiWrite"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data: {
+                    clientName:that.unitone,
+                    clientPurpose:that.unittwo
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.fullscreenLoading=false;
+                    if (val=='追加') {
+                        id.details+=','+res.data.data;
+                    }else{
+                        id.details=res.data.data;
+                    }
+                    that.$message({
+                        message: res.data.msg,
+                        type: 'success'
+                    });
+                    that.UnitVisible = false;
+                } else {
+                    that.fullscreenLoading=false;
+                    that.$message({
+                        message: res.data.msg,
+                        duration: 1000,
+                        type: "error"
+                    });
+                }
+            }).catch(function (error) {
+                that.$message.error('请联系信息部!');
+            });
+        },
         //报批行程保存
         SaveApprovalJourney() {
             var url = "/api/Groups/SaveApprovalJourney"
@@ -324,7 +391,12 @@ export default {
 }
 
 .VisitSchedule-content-remark {
-    width: 75%;
+    width: 70%;
+    padding: 10px;
+}
+
+.VisitSchedule-content-btn {
+    width: 5%;
     padding: 10px;
 }