|
|
|
@ -193,24 +193,26 @@ |
|
|
|
label-width="150px" |
|
|
|
prop="serviceTimeEnd" |
|
|
|
> |
|
|
|
<!-- :picker-options="startPickerOptions" --> |
|
|
|
<!-- --> |
|
|
|
<el-date-picker |
|
|
|
v-model="newFormData.serviceTimeStart" |
|
|
|
:picker-options="startPickerOptions" |
|
|
|
class="item_width_2" |
|
|
|
style="width: 220px" |
|
|
|
type="date" |
|
|
|
type="datetime" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
value="yyyy-MM-dd" |
|
|
|
placeholder="开始时间" |
|
|
|
> |
|
|
|
</el-date-picker> |
|
|
|
<!-- :picker-options="endPickerOptions" --> |
|
|
|
<!-- --> |
|
|
|
<span class="u-data-tag">至</span> |
|
|
|
<el-date-picker |
|
|
|
v-model="newFormData.serviceTimeEnd" |
|
|
|
:picker-options="endPickerOptions" |
|
|
|
class="item_width_2 u-data-tag" |
|
|
|
style="width: 220px" |
|
|
|
type="date" |
|
|
|
type="datetime" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
value="yyyy-MM-dd" |
|
|
|
placeholder="结束时间" |
|
|
|
@ -299,22 +301,22 @@ export default { |
|
|
|
let endDisabledDate = (time) => { |
|
|
|
//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 |
|
|
|
let nowData = Date.now(); |
|
|
|
if (this.formData.serviceTimeStart) { |
|
|
|
let serviceTimeStart = new Date(this.formData.serviceTimeStart); |
|
|
|
if (this.newFormData.serviceTimeStart) { |
|
|
|
let serviceTimeStart = new Date(this.newFormData.serviceTimeStart); |
|
|
|
return ( |
|
|
|
time.getTime() > nowData || |
|
|
|
time.getTime() < serviceTimeStart || |
|
|
|
time.getTime() === serviceTimeStart |
|
|
|
time.getTime() < serviceTimeStart- 24 * 60 * 60 * 1000 || |
|
|
|
time.getTime() === serviceTimeStart- 24 * 60 * 60 * 1000 |
|
|
|
); |
|
|
|
} else { |
|
|
|
return time.getTime() > nowData; |
|
|
|
return (time.getTime() > nowData || time.getTime() === nowData) ; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
let startDisabledDate = (time) => { |
|
|
|
//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 |
|
|
|
let nowData = Date.now(); |
|
|
|
return time.getTime() > nowData; |
|
|
|
let nowData = Date.now() - 24 * 60 * 60 * 1000; |
|
|
|
return (time.getTime() < nowData || |
|
|
|
time.getTime() === nowData); |
|
|
|
}; |
|
|
|
|
|
|
|
return { |
|
|
|
@ -346,6 +348,12 @@ export default { |
|
|
|
assignInfo: {}, |
|
|
|
content: "", // |
|
|
|
}, |
|
|
|
endPickerOptions: { |
|
|
|
disabledDate: endDisabledDate |
|
|
|
}, |
|
|
|
startPickerOptions: { |
|
|
|
disabledDate: startDisabledDate |
|
|
|
}, |
|
|
|
newFormData: { |
|
|
|
noticeApproches: [], |
|
|
|
serviceScopeList: [], // |
|
|
|
@ -392,7 +400,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
"formData.serviceTimeEnd": function (val) { |
|
|
|
"newFormData.serviceTimeEnd": function (val) { |
|
|
|
if (val && val != "") { |
|
|
|
let arrayTemp = val.split(" "); |
|
|
|
this.formData.serviceTimeEnd = arrayTemp[0] + " 23:59:59"; |
|
|
|
@ -609,23 +617,33 @@ export default { |
|
|
|
const url = "/gov/org/icServiceProject/service/serviceScopeTree"; |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree' |
|
|
|
let params = {}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
++this.iscascaderShow; |
|
|
|
this.casOptions = []; |
|
|
|
this.scopeIdArray = []; |
|
|
|
await this.handleData(data.children) |
|
|
|
this.casOptions.push(data); |
|
|
|
} else { |
|
|
|
this.$message.error(rspMsg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//子级为空数组的赋值为null解决有空白页的问题 |
|
|
|
handleData(data){ |
|
|
|
for(let i=0;i<data.length;i++){ |
|
|
|
if(data[i].children!=null){ |
|
|
|
if(data[i].children.length==0){ |
|
|
|
data[i].children = null |
|
|
|
}else if(data[i].children!=null){ |
|
|
|
this.handleData(data[i].children) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return data |
|
|
|
}, |
|
|
|
async handleComfirm() { |
|
|
|
this.handleAdd(); |
|
|
|
}, |
|
|
|
// |
|
|
|
getLastItem(list, vals, key) { |
|
|
|
let LIST = list || []; |
|
|
|
for (let item of LIST) { |
|
|
|
|