|
|
@@ -24,17 +24,20 @@
|
|
|
</div>
|
|
|
<div class="selectType">
|
|
|
<p>选择类型</p>
|
|
|
- <div>
|
|
|
+ <div class="material_time">
|
|
|
<span>素材时间</span>
|
|
|
- <input
|
|
|
- type="month"
|
|
|
- :min="localMonth"
|
|
|
- class="inputStyle"
|
|
|
- v-model="materialTime"
|
|
|
- @change="materialTimeChange"
|
|
|
- />
|
|
|
- <span style="margin-left: 30px">经销商范围</span>
|
|
|
- <select class="selectStyle" v-model="scope" autocomplete="off">
|
|
|
+ <Datepicker
|
|
|
+ :language="zh"
|
|
|
+ format="yyyy/MM"
|
|
|
+ placeholder=" 年 / 月"
|
|
|
+ v-model="monthPickValue"
|
|
|
+ minimum-view="month"
|
|
|
+ :disabled-dates="limit"
|
|
|
+ ></Datepicker>
|
|
|
+ </div>
|
|
|
+ <div class="dealer_scope">
|
|
|
+ <span>经销商范围</span>
|
|
|
+ <select class="selectStyle" v-model="scope" autocomplete="off" style="margin:0">
|
|
|
<option value="1">共通</option>
|
|
|
<option value="0">部分</option>
|
|
|
</select>
|
|
|
@@ -120,21 +123,20 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="dataName" style="margin-top: 2%">
|
|
|
+ <div class="feed_back" style="margin-top: 2%">
|
|
|
<span>反馈设置</span>
|
|
|
<select class="selectStyle" v-model="isFeedBack" autocomplete="off">
|
|
|
<option value="0">不需要反馈</option>
|
|
|
<option value="1">需要反馈</option>
|
|
|
</select>
|
|
|
- <input
|
|
|
- type="date"
|
|
|
- :min="localDay"
|
|
|
- class="inputStyle"
|
|
|
- v-model="feedBackTime"
|
|
|
+ <Datepicker
|
|
|
+ :language="zh"
|
|
|
+ format="yyyy/MM/dd"
|
|
|
+ placeholder=" 年 / 月 / 日"
|
|
|
v-show="isFeedBack === '1'"
|
|
|
- @change="feedBackTimeChange"
|
|
|
- />
|
|
|
+ v-model="datePickValue"
|
|
|
+ :disabled-dates="limit"
|
|
|
+ ></Datepicker>
|
|
|
</div>
|
|
|
<div class="uploadFile">
|
|
|
<p class="title">附件</p>
|
|
|
@@ -154,7 +156,6 @@
|
|
|
:tipText="tipModalText"
|
|
|
@close_tip_modal="closeTipModal"
|
|
|
/>
|
|
|
- <!-- <Datepicker :language="zh" format="yyyy/MM" :typeable="false" type="month"></Datepicker> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -163,8 +164,8 @@ import UpLoadTable from "./components/UploadInforTable";
|
|
|
import Count from "../../components/Count";
|
|
|
import Tablepage from "../../components/TablePage";
|
|
|
import TipModal from "../../components/TipModal";
|
|
|
-// import Datepicker from 'vuejs-datepicker';
|
|
|
-// import {zh} from 'vuejs-datepicker/dist/locale'
|
|
|
+import Datepicker from 'vuejs-datepicker';
|
|
|
+import {zh} from 'vuejs-datepicker/dist/locale'
|
|
|
export default {
|
|
|
props: {
|
|
|
isManufacturer: {
|
|
|
@@ -177,12 +178,15 @@ export default {
|
|
|
Count,
|
|
|
Tablepage,
|
|
|
TipModal,
|
|
|
- // Datepicker
|
|
|
+ Datepicker
|
|
|
},
|
|
|
watch: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- // zh: zh,
|
|
|
+ zh: zh,
|
|
|
+ monthPickValue: "",
|
|
|
+ datePickValue: "",
|
|
|
+ limit: {},
|
|
|
allDataNameList: [],
|
|
|
tipFlag: false, // 是否展示提示
|
|
|
tipText: "资料名称不能重复,请重新输入",
|
|
|
@@ -203,8 +207,6 @@ export default {
|
|
|
currentPage: 1,
|
|
|
areaList: [], // 按区域添加
|
|
|
groupList: [], // 按小组添加
|
|
|
- localMonth: "",
|
|
|
- localDay: "",
|
|
|
tableData: [], // 表格显示的数据
|
|
|
allDlr: [], // 所有经销商数据
|
|
|
idList: [],
|
|
|
@@ -223,8 +225,6 @@ export default {
|
|
|
// 检查名字是否重复 失去焦点判断
|
|
|
checkName: function () {
|
|
|
let include = this.allDataNameList.indexOf(this.inforName);
|
|
|
- console.log(this.allDataNameList, "all");
|
|
|
- console.log(include);
|
|
|
if (!this.inforName) {
|
|
|
this.tipText = "资料名不能为空";
|
|
|
this.tipFlag = true;
|
|
|
@@ -240,16 +240,6 @@ export default {
|
|
|
this.tipText = "资料名称不能重复,请重新输入";
|
|
|
this.tipFlag = false;
|
|
|
},
|
|
|
- // 素材时间变化
|
|
|
- materialTimeChange: function () {
|
|
|
- // this.materialTime = this.localMonth.replace('-', '/');
|
|
|
- console.log(this.materialTime);
|
|
|
- },
|
|
|
- // 反馈时间变化
|
|
|
- feedBackTimeChange: function () {
|
|
|
- // this.materialTime = this.localMonth.replace('-', '/');
|
|
|
- console.log(this.feedBackTime);
|
|
|
- },
|
|
|
// 显示隐藏按小组添加下拉框
|
|
|
showOption() {
|
|
|
this.optionFlag = !this.optionFlag;
|
|
|
@@ -363,11 +353,33 @@ export default {
|
|
|
this.currentPage * this.pageSize
|
|
|
);
|
|
|
},
|
|
|
+ // 时间格式转化
|
|
|
+ formatDateToMonth: function (val) {
|
|
|
+ let date = new Date(val)
|
|
|
+ let y = date.getFullYear()
|
|
|
+ let m = date.getMonth() + 1
|
|
|
+ m = m < 10 ? ('0' + m) : m
|
|
|
+ const time = y + '-' + m;
|
|
|
+ this.materialTime = time;
|
|
|
+ console.log(time);
|
|
|
+ },
|
|
|
+ formatDateToDate: function (val) {
|
|
|
+ let date = new Date(val)
|
|
|
+ let y = date.getFullYear()
|
|
|
+ let m = date.getMonth() + 1
|
|
|
+ m = m < 10 ? ('0' + m) : m
|
|
|
+ let d = date.getDate()
|
|
|
+ d = d < 10 ? ('0' + d) : d
|
|
|
+ const time = y + '-' + m + '-' + d;
|
|
|
+ this.feedBackTime = time;
|
|
|
+ },
|
|
|
// 点击提交,检查名字是否重复,获取数据
|
|
|
submit: function () {
|
|
|
if (this.isFeedBack === "0") {
|
|
|
this.feedBackTime = "";
|
|
|
}
|
|
|
+ this.formatDateToMonth(this.monthPickValue);
|
|
|
+ this.formatDateToDate(this.datePickValue);
|
|
|
this.checkName();
|
|
|
if (!this.tipFlag) {
|
|
|
if (!this.inforDes) {
|
|
|
@@ -412,21 +424,9 @@ export default {
|
|
|
getLocalMonth: function () {
|
|
|
let data = new Date();
|
|
|
let year = data.getFullYear();
|
|
|
- let month = data.getMonth() + 1;
|
|
|
+ let month = data.getMonth();
|
|
|
let day = data.getDate();
|
|
|
- if (month < 10) {
|
|
|
- month = "0" + month;
|
|
|
- } else {
|
|
|
- month = month + "";
|
|
|
- }
|
|
|
- if (day < 10) {
|
|
|
- day = "0" + day;
|
|
|
- } else {
|
|
|
- day = day + "";
|
|
|
- }
|
|
|
- this.localMonth = year + "-" + month;
|
|
|
- this.localDay = year + "-" + month + "-" + day;
|
|
|
- console.log(this.localDay);
|
|
|
+ this.limit = {to : new Date(year, month, day)};
|
|
|
},
|
|
|
// 提交接口
|
|
|
submitRequest: function () {
|
|
|
@@ -439,12 +439,9 @@ export default {
|
|
|
paramData.append("sourceTime", this.materialTime);
|
|
|
paramData.append("endDate", this.feedBackTime);
|
|
|
paramData.append("dealerScope", this.scope);
|
|
|
- console.log(this.scope, 111);
|
|
|
if (this.scope === "0") {
|
|
|
paramData.append("dealerList", this.idList);
|
|
|
- console.log(1111, this.idList);
|
|
|
}
|
|
|
- console.log(paramData.getAll("dataName"));
|
|
|
this.$http
|
|
|
.uploadFile("/firmsUpload", paramData)
|
|
|
.then((res) => {
|
|
|
@@ -489,7 +486,6 @@ export default {
|
|
|
data: data,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- console.log(res);
|
|
|
this.tableData = [];
|
|
|
let nowSum = this.sum;
|
|
|
if (res.data && res.data.code === 200) {
|
|
|
@@ -629,8 +625,24 @@ export default {
|
|
|
.selectType {
|
|
|
margin-top: 10px;
|
|
|
margin-bottom: 10px;
|
|
|
- div {
|
|
|
+ .material_time {
|
|
|
+ display: flex;
|
|
|
+ margin-left: 65px;
|
|
|
+ span{
|
|
|
+ height: 20px;
|
|
|
+ line-height: 20px;
|
|
|
+ width: 100px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dealer_scope {
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
margin-left: 65px;
|
|
|
+ span{
|
|
|
+ height: 20px;
|
|
|
+ line-height: 20px;
|
|
|
+ width: 100px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.selectStyle {
|
|
|
@@ -760,6 +772,9 @@ export default {
|
|
|
height: 28px;
|
|
|
}
|
|
|
}
|
|
|
+ .feed_back {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
.table {
|
|
|
margin-top: 10px;
|
|
|
}
|