|
|
@@ -12,12 +12,12 @@
|
|
|
<p>选择类型</p>
|
|
|
<div>
|
|
|
<span>素材时间</span>
|
|
|
- <select name="materialTime" class="selectStyle" v-model="materialTime" autocomplete="off">
|
|
|
+ <select name="materialTime" class="selectStyle" v-model="materialTime" autocomplete="off" @change="materialTimeChange">
|
|
|
<option value="" selected>请选择</option>
|
|
|
<option v-for="(time, index) in materialTimeList" :key="index" :value="time">{{time}}</option>
|
|
|
</select>
|
|
|
<span>经销商范围</span>
|
|
|
- <select class="selectStyle" v-model="range" autocomplete="off">
|
|
|
+ <select class="selectStyle" v-model="scope" autocomplete="off" @change="scopeChange">
|
|
|
<option value="" selected>共通</option>
|
|
|
<option value="part">部分</option>
|
|
|
</select>
|
|
|
@@ -28,9 +28,9 @@
|
|
|
<div class="addByArea">
|
|
|
<span>按区域添加</span>
|
|
|
<div v-for="(area, index) in areaList" :key="index">
|
|
|
- <input type="checkbox"><span>{{area}}</span>
|
|
|
+ <input type="checkbox" value=""><span>{{area}}</span>
|
|
|
</div>
|
|
|
- <button>添加</button>
|
|
|
+ <button @click="addByArea">添加</button>
|
|
|
</div>
|
|
|
<div class="addByCustomize">
|
|
|
<span>自定义添加</span>
|
|
|
@@ -85,10 +85,9 @@
|
|
|
</div>
|
|
|
<div class="uploadFile">
|
|
|
<p>附件</p>
|
|
|
- <input type="file" :v-model="fileValue" name="fileName" @change='changeFile()'>
|
|
|
+ <input type="file" name="fileName" id="fileInput">
|
|
|
</div>
|
|
|
<button @click="submit" class="submitBtn">提交</button>
|
|
|
- <input id="myCar" list="cars" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -110,7 +109,7 @@ export default {
|
|
|
Tablepage
|
|
|
},
|
|
|
watch: {
|
|
|
- range(val) {
|
|
|
+ scope(val) {
|
|
|
if(val === 'part') {
|
|
|
this.isShow = true;
|
|
|
} else [
|
|
|
@@ -125,9 +124,8 @@ export default {
|
|
|
inforName: '',
|
|
|
inforDes: '',
|
|
|
materialTime: '',
|
|
|
- range: '',
|
|
|
+ scope: '',
|
|
|
addByCustomize: '',
|
|
|
- fileValue: '',
|
|
|
addFlag: [true, true, true, true, true, true], // 长度等于groupList.length
|
|
|
optionFlag: false, // 是否展示按小组添加的选择栏
|
|
|
// 表格配置
|
|
|
@@ -154,10 +152,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- showDetail: () => {
|
|
|
- alert('展示详情');
|
|
|
- },
|
|
|
- // 检查名字是否重复
|
|
|
+ // 检查名字是否重复 失去焦点判断
|
|
|
checkName: function() {
|
|
|
if(this.inforName==1) {
|
|
|
this.tipFlag = true;
|
|
|
@@ -167,10 +162,22 @@ export default {
|
|
|
hideTip: function() {
|
|
|
this.tipFlag = false;
|
|
|
},
|
|
|
+ // 素材时间变化
|
|
|
+ materialTimeChange: function() {
|
|
|
+ console.log(this.materialTime);
|
|
|
+ },
|
|
|
+ // 进销商范围变化
|
|
|
+ scopeChange: function() {
|
|
|
+ console.log(this.scope)
|
|
|
+ },
|
|
|
// 显示隐藏按小组添加下拉框
|
|
|
showOption() {
|
|
|
this.optionFlag = !this.optionFlag;
|
|
|
},
|
|
|
+ // 点击按区域添加button
|
|
|
+ addByArea: function() {
|
|
|
+ console.log()
|
|
|
+ },
|
|
|
// 按小组添加,增加小组
|
|
|
addGroup: function(index) {
|
|
|
this.addFlag.splice(index, 1, false);
|
|
|
@@ -210,7 +217,33 @@ export default {
|
|
|
}
|
|
|
console.log(this.currentPage);
|
|
|
},
|
|
|
+ // 点击提交,检查名字是否重复,获取数据
|
|
|
submit: function() {
|
|
|
+ this.checkName();
|
|
|
+ // if(!this.inforName){
|
|
|
+ // alert('资料名称不能为空');
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // if(!this.inforDes){
|
|
|
+ // alert('资料描述不能为空');
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // if(!this.inforName){
|
|
|
+ // alert('资料名称不能为空');
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ if(!this.tipFlag){
|
|
|
+ console.log(this.inforName);
|
|
|
+ console.log(this.inforDes);
|
|
|
+ console.log(this.materialTime);
|
|
|
+ console.log(this.scope);
|
|
|
+ console.log(this.tableData);
|
|
|
+ const file = document.getElementById('fileInput').value;
|
|
|
+ console.log(file);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 接口请求
|
|
|
+ submitRequest: function() {
|
|
|
// this.$http({
|
|
|
// method: 'post',
|
|
|
// url: '/auth/checkSign',
|
|
|
@@ -222,12 +255,8 @@ export default {
|
|
|
// }).catch((err) => {
|
|
|
// console.log(err);
|
|
|
// })
|
|
|
- // console.log(this.inforName, this.inforDes, this.materialTime, this.range, this.addByCustomize, File.size);
|
|
|
+ // console.log(this.inforName, this.inforDes, this.materialTime, this.scope, this.addByCustomize, File.size);
|
|
|
// console.log(FileList.);
|
|
|
- },
|
|
|
- //
|
|
|
- changeFile(){
|
|
|
- console.log(123);
|
|
|
}
|
|
|
}
|
|
|
}
|