liuhj 3 kuukautta sitten
vanhempi
commit
bc77fb7d53
3 muutettua tiedostoa jossa 199 lisäystä ja 50 poistoa
  1. 161 13
      src/components/MarketplacePick.vue
  2. 36 36
      src/components/system/AssignTasks.vue
  3. 2 1
      src/store/index.js

+ 161 - 13
src/components/MarketplacePick.vue

@@ -1,16 +1,45 @@
 <template>
     <div class="marketplacepick-all">
         <div class="marketplacepick-form">
-            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm" >
+            <div class="marketplacepick-form-head">
+                <el-select @change="GroupOrderPreInfochange" style="width: 357px;margin-bottom: 10px;" v-model="tempId" clearable placeholder="请选择">
+                    <el-option v-for="item in tempDatas" :key="item.id" :label="item.name" :value="item.id">
+                    </el-option>
+                </el-select>
+                <el-select @change="GroupOrderPreInfochange" style="width: 357px;margin-bottom: 10px;" v-model="formid" clearable placeholder="请选择">
+                    <el-option v-for="item in names" :key="item.id" :label="item.name" :value="item.id">
+                    </el-option>
+                </el-select>
+            </div>
+            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
                 <div class="marketplacepick-form-ul">
-                    <div class="marketplacepick-form-li"  v-for="(item,index) in controlarr" :key="index" >
+                    <div class="marketplacepick-form-li" v-for="(item,index) in controlarr" :key="index">
                         <el-form-item :label="item.fieldName">
-                            <el-input v-if="item.fieldTypeName=='文本'" v-model="item.newValue"></el-input>
-                            <el-input-number id="marketplacepicknumber" v-if="item.fieldTypeName=='数字'" :controls="false" v-model="item.newValue" ></el-input-number>
-                            <el-radio-group v-if="item.fieldTypeName=='单选按钮'" v-model="item.newValue">
-                                <el-radio label="是"></el-radio>
-                                <el-radio label="否"></el-radio>
+                            <el-input v-if="item.fieldTypeName == '文本'" v-model="item.newValue"></el-input>
+                            <el-input-number id="marketplacepicknumber" v-if="item.fieldTypeName == '数字'"
+                                :controls="false" v-model="item.newValue"></el-input-number>
+                            <el-radio-group v-if="item.fieldTypeName == '单选按钮'" v-model="item.newValue">
+                                <el-radio label="有"></el-radio>
+                                <el-radio label="无"></el-radio>
                             </el-radio-group>
+                            <el-select @change="PromptChecked(item.newValue)" filterable
+                                v-if="item.fieldTypeName == '搜索框' && item.fieldName == '出访国家(地、区)'"
+                                v-model="item.newValue" multiple placeholder="请选择">
+                                <el-option v-for="item in countryarr" :key="item.value" :label="item.value"
+                                    :value="item.value">
+                                </el-option>
+                            </el-select>
+                            <el-select filterable v-if="item.fieldTypeName == '搜索框' && item.fieldName == '涉及城市'"
+                                v-model="item.newValue" multiple placeholder="请选择">
+                                <el-option v-for="item in cityarr" :key="item.value" :label="item.value"
+                                    :value="item.value">
+                                </el-option>
+                            </el-select>
+                            <!-- <el-autocomplete v-if="item.fieldTypeName=='搜索框'&&item.fieldName=='出访国家(地、区)'" popper-class="el-autocomplete-suggestion" :popper-append-to-body="false"
+                                class="inline-input" size="medium" v-model.trim="item.newValue"
+                                :fetch-suggestions="querySearch" @input="InputValue(item.newValue)" @select="PromptChecked(item)"
+                                >
+                            </el-autocomplete> -->
                         </el-form-item>
                         <el-form-item v-if="item.isRemark">
                             <el-input type="textarea" v-model="item.remark"></el-input>
@@ -63,10 +92,13 @@ export default {
                     { required: true, message: '请填写活动形式', trigger: 'blur' }
                 ]
             },
-            formid:0,
+            formid:1,
             tempId:1404,
             controlarr:[],
             tempDatas:[],
+            countryarr:[],
+            cityarr:[],
+            names:[]
         }
     },
     methods:{
@@ -92,16 +124,106 @@ export default {
                 url: url,
             }).then(function (res) {
                 if (res.data.code==200) {
-                    that.tempDatas=res.data.data.tempDatas;
+                    var basicsdata=res.data.data
+                    that.tempDatas=basicsdata.tempDatas;
                     that.tempId=that.tempDatas[0].id;
+                    that.names=basicsdata.names;
+                    that.formid=that.names[0].id;
+
                     that.GroupOrderPreInfo();
                 }else{
                     that.$message.error(res.data.msg);
                 }
             })
         },
+        //或取国家
+        CountryInit() {
+            var url = "/api/Groups/CountryInit"
+            var that = this
+            this.$axios({
+                method: 'get',
+                url: url,
+            }).then(function (res) {
+                if (res.data.code==200) {
+                    var countryarr=res.data.data;
+                    that.countryarr = countryarr.map((terminal) => {
+                        return {
+                            value: terminal,
+                        };
+                    });
+                }else{
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
+        //或取城市
+        CityByCountry(val) {
+            console.log(val);
+            var url = "/api/Groups/CityByCountry/"+val
+            var that = this
+            this.$axios({
+                method: 'get',
+                url: url,
+            }).then(function (res) {
+                if (res.data.code==200) {
+                    var cityarr=res.data.data;
+                    that.cityarr = cityarr.map((terminal) => {
+                        return {
+                            value: terminal,
+                        };
+                    });
+                }else{
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
+        querySearch(queryString, cb) {
+            var restaurants = this.countryarr;
+            var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
+            // 调用 callback 返回建议列表的数据
+            console.log(cb);
+            
+            cb(results);
+        },
+        createFilter(queryString) {
+            var queryStrings=queryString.split('、')
+            return (restaurant) => {
+                return restaurant.value.replace("  ", "").toLowerCase().match(queryStrings[queryStrings.length-1].toLowerCase());
+            };
+        },
+        PromptChecked(val){
+            console.log(val);
+            var gjval='';
+            val.map((value)=>{
+                gjval+=value+','
+            })
+            gjval=gjval.substring(0,gjval.length-1)
+            this.CityByCountry(gjval)
+            // this.$store.state.countrystring.push(val.newValue)
+            // var res=new Map();
+            // var countrystringqrr=this.$store.state.countrystring.filter((a)=>!res.has(a)&&res.set(a,1));
+            // console.log(countrystringqrr);
+            
+            // // val.newValue=this.$store.state.countrystring
+            // var newValue=''
+            // countrystringqrr.map((value)=>{
+            //     newValue+=value+'、'
+            // })
+            // val.newValue=newValue.substring(0,newValue.length-1)
+        },
+        InputValue(val){
+            // console.log(val);
+            // var countryinputarr=val.split('、')
+            // var res=new Map();
+            // var countryinputarrs=countryinputarr.filter((a)=>!res.has(a)&&res.set(a,1));
+            // console.log(countryinputarrs);
+
+            // this.$store.state.countrystring=countryinputarrs
+            
+        },
         //获取表单
         GroupOrderPreInfo() {
+            this.controlarr=[];
             var url = "/api/Groups/GroupOrderPreInfo/"+this.formid+"/"+this.tempId
             var that = this
             this.$axios({
@@ -115,9 +237,14 @@ export default {
                 }
             })
         },
+
+        GroupOrderPreInfochange(){
+            this.GroupOrderPreInfo();
+        }
     },
     mounted(){
         this.GroupOrderPreInfos();
+        this.CountryInit();
         // this.GroupOrderPreInfo();
     }
 }
@@ -127,10 +254,10 @@ export default {
     max-width: 1200px;
     min-width: 375px;
 }
-.marketplacepick-form .el-select{
+.marketplacepick-form-head,.marketplacepick-form .el-select{
     width: 100%;
 }
-.marketplacepick-form-li .el-input-number{
+.marketplacepick-form-head,.marketplacepick-form-li .el-input-number{
     width: 100%;
 }
 .marketplacepick-form-li .el-input-number .el-input__inner{
@@ -141,10 +268,31 @@ export default {
     flex-wrap: wrap;
 }
 .marketplacepick-form-li{
-    width: 365px;
-    margin-right: 10px;
+    width: 345px;
     margin-bottom: 10px;
     padding: 0px 5px;
     border: 1px dashed #b0b1b3;
 }
+.marketplacepick-form-li .el-autocomplete{
+    width: 100%;
+}
+.marketplacepick-form-li .el-input--medium .el-input__inner{
+    height: 40px;
+    line-height: 40px;
+}
+.marketplacepick-form-head .el-select{
+    width: 357px;
+    margin-bottom: 10px;
+}
+.marketplacepick-form-li .el-form-item__label{
+    float: none;
+}
+@media screen and (min-width: 376px) {
+    .marketplacepick-form-li{
+        margin-right: 10px;
+    }
+    .marketplacepick-form-head .el-select{
+        margin-right: 10px;
+    }
+}
 </style>

+ 36 - 36
src/components/system/AssignTasks.vue

@@ -345,42 +345,42 @@ export default {
             var url = "/api/PersonnelModule/PostTaskAllocationAddOrEdit"
             var that = this
             console.log(that.contents);
-            // this.$axios({
-            //     method: 'post',
-            //     url: url,
-            //     headers: {
-            //         Authorization: 'Bearer ' + that.userId
-            //     },
-            //     data:{
-            //         portType:1,
-            //         userId: 5,
-            //         pageId: that.pageId,
-            //         id: id,
-            //         depId: that.taskform.department,
-            //         diId: that.taskform.Thegroup,
-            //         taskPriority:that.taskform.value,
-            //         taskName:that.taskform.taskname,
-            //         taskContent: that.contents,
-            //         userIds: that.taskform.staff,
-            //         predictBeginTime: that.transferdate(that.taskform.schedulerules[0]),
-            //         predictEndTime: that.transferdate(that.taskform.schedulerules[1]),
-            //         isIntoPerformance: that.taskform.staff?1:0,
-            //     }
-            // }).then(function (res) {
-            //     console.log(res)
-            //     if(res.data.code==200){
-            //         that.$message({
-            //             type: 'success',
-            //             message: res.data.msg,
-            //             duration:'3000'
-            //         });
-            //         that.goback();
-            //     }else{
-            //         that.$message.error(res.data.msg);
-            //     }
-            // }).catch(function (error) {
-            //     that.$message.error("获取数据源失败!");
-            // });
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.userId
+                },
+                data:{
+                    portType:1,
+                    userId: 5,
+                    pageId: that.pageId,
+                    id: id,
+                    depId: that.taskform.department,
+                    diId: that.taskform.Thegroup,
+                    taskPriority:that.taskform.value,
+                    taskName:that.taskform.taskname,
+                    taskContent: that.contents,
+                    userIds: that.taskform.staff,
+                    predictBeginTime: that.transferdate(that.taskform.schedulerules[0]),
+                    predictEndTime: that.transferdate(that.taskform.schedulerules[1]),
+                    isIntoPerformance: that.taskform.staff?1:0,
+                }
+            }).then(function (res) {
+                console.log(res)
+                if(res.data.code==200){
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg,
+                        duration:'3000'
+                    });
+                    that.goback();
+                }else{
+                    that.$message.error(res.data.msg);
+                }
+            }).catch(function (error) {
+                that.$message.error("保存失败!请联系信息部!");
+            });
         },
     },
     computed: {

+ 2 - 1
src/store/index.js

@@ -965,7 +965,8 @@ const store = new Vuex.Store({
                         "value": 11056.426
                     }
                 ]
-            }
+            },
+            countrystring:[]
 		}
 	},
 	// 在 mutations 内封装数据更新方法