|
@@ -109,79 +109,39 @@
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group>
|
|
|
- <van-field
|
|
|
- v-model="inputForm.effectiveDateStart"
|
|
|
- center
|
|
|
- required
|
|
|
- clearable
|
|
|
- readonly
|
|
|
- :rules="[{ required: true }]"
|
|
|
- label-width="8em"
|
|
|
- label="有效起始时间:"
|
|
|
- input-align="right"
|
|
|
- right-icon="arrow-down"
|
|
|
- placeholder="请选择有效起始时间"
|
|
|
- @click="hs_Start = true"
|
|
|
- />
|
|
|
+ <van-field v-model="inputForm.effectiveDateStart" center readonly required label-width="8em"
|
|
|
+ :rules="[{ required: true }]" label="有效起始时间:" placeholder="请选择时间"
|
|
|
+ input-align="right" right-icon="arrow-down" @click="hs_Start = true" />
|
|
|
<van-popup v-model:show="hs_Start" round position="bottom">
|
|
|
- <van-date-picker
|
|
|
- v-model="currentDate"
|
|
|
- title="选择日期"
|
|
|
- :min-date="minDate"
|
|
|
- :max-date="maxDate"
|
|
|
- @cancel="hs_Start = false"
|
|
|
- @confirm="getStart"
|
|
|
- />
|
|
|
+ <van-picker-group title="有效起始时间" :tabs="['选择日期', '选择时间']" next-step-text="下一步" @confirm="getTime"
|
|
|
+ @cancel="hs_Start = false">
|
|
|
+ <van-date-picker v-model="currentDate" />
|
|
|
+ <van-time-picker v-model="currentTime" :columns-type="columnsType" />
|
|
|
+ </van-picker-group>
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group>
|
|
|
- <van-field
|
|
|
- v-model="inputForm.effectiveDateEnd"
|
|
|
- center
|
|
|
- required
|
|
|
- clearable
|
|
|
- readonly
|
|
|
- :rules="[{ required: true }]"
|
|
|
- label-width="8em"
|
|
|
- label="有效结束时间:"
|
|
|
- input-align="right"
|
|
|
- right-icon="arrow-down"
|
|
|
- placeholder="请选择有效结束时间"
|
|
|
- @click="hs_End = true"
|
|
|
- />
|
|
|
+ <van-field v-model="inputForm.effectiveDateEnd" center readonly required label-width="8em"
|
|
|
+ :rules="[{ required: true }]" label="有效结束时间:" placeholder="请选择时间"
|
|
|
+ input-align="right" right-icon="arrow-down" @click="hs_End = true" />
|
|
|
<van-popup v-model:show="hs_End" round position="bottom">
|
|
|
- <van-date-picker
|
|
|
- v-model="currentDate"
|
|
|
- title="选择日期"
|
|
|
- :min-date="minDate"
|
|
|
- :max-date="maxDate"
|
|
|
- @cancel="hs_End = false"
|
|
|
- @confirm="getEnd"
|
|
|
- />
|
|
|
+ <van-picker-group title="有效结束时间" :tabs="['选择日期', '选择时间']" next-step-text="下一步" @confirm="getTimeend"
|
|
|
+ @cancel="hs_End = false">
|
|
|
+ <van-date-picker v-model="currentDate" />
|
|
|
+ <van-time-picker v-model="currentTime" :columns-type="columnsType" />
|
|
|
+ </van-picker-group>
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group>
|
|
|
- <van-field
|
|
|
- v-model="inputForm.nextMaintenanceDate"
|
|
|
- center
|
|
|
- clearable
|
|
|
- readonly
|
|
|
- label-width="8em"
|
|
|
- label="下次保养时期:"
|
|
|
- input-align="right"
|
|
|
- right-icon="arrow-down"
|
|
|
- placeholder="请选择下次保养时期"
|
|
|
- @click="hs_upkeep = true"
|
|
|
- />
|
|
|
+ <van-field v-model="inputForm.nextMaintenanceDate" center readonly label-width="8em"
|
|
|
+ label="下次保养时期:" placeholder="请选择时间"
|
|
|
+ input-align="right" right-icon="arrow-down" @click="hs_upkeep = true" />
|
|
|
<van-popup v-model:show="hs_upkeep" round position="bottom">
|
|
|
- <van-date-picker
|
|
|
- v-model="currentDate"
|
|
|
- title="选择日期"
|
|
|
- :min-date="minDate"
|
|
|
- :max-date="maxDate"
|
|
|
- @cancel="hs_upkeep = false"
|
|
|
- @confirm="getupkeep"
|
|
|
- />
|
|
|
+ <van-picker-group title="下次保养时期" :tabs="['选择日期', '选择时间']" next-step-text="下一步" @confirm="getTimeupkeep"
|
|
|
+ @cancel="hs_upkeep = false">
|
|
|
+ <van-date-picker v-model="currentDate" />
|
|
|
+ <van-time-picker v-model="currentTime" :columns-type="columnsType" />
|
|
|
+ </van-picker-group>
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group>
|
|
@@ -233,6 +193,7 @@ import placeFirefighting from "@/api/placeFirefighting/placeFirefighting";
|
|
|
import PlaceRegister from "@/api/placeRegister/placeRegister";
|
|
|
import tools from "@/api/sys/tools";
|
|
|
import $base from "@/utils/config";
|
|
|
+import { formatDate, formatTime } from "@/utils/datatime";
|
|
|
export default {
|
|
|
setup() {
|
|
|
const inputForm = ref({
|
|
@@ -264,7 +225,7 @@ export default {
|
|
|
let id = "";
|
|
|
id = val.id;
|
|
|
locationName.value = val.name;
|
|
|
- const json = Object.assign(inputForm.value, { location: { id: id } });
|
|
|
+ const json = Object.assign(inputForm.value, { siteId: val.id });
|
|
|
inputForm.value = json;
|
|
|
checked.value = val.id;
|
|
|
};
|
|
@@ -304,48 +265,30 @@ export default {
|
|
|
};
|
|
|
//有效期起始时间
|
|
|
let hs_Start = ref(false);
|
|
|
- const getStart = ({ selectedOptions }) => {
|
|
|
+ let currentDate = ref(formatDate(new Date()));
|
|
|
+ let currentTime = ref(formatTime(new Date()));
|
|
|
+ const columnsType = ["hour", "minute", "second"];
|
|
|
+ const getTime = () => {
|
|
|
hs_Start.value = false;
|
|
|
- const json = Object.assign(inputForm.value, {
|
|
|
- effectiveDateStart:
|
|
|
- selectedOptions[0].text +
|
|
|
- "-" +
|
|
|
- selectedOptions[1].text +
|
|
|
- "-" +
|
|
|
- selectedOptions[2].text +
|
|
|
- " 00:00:00",
|
|
|
- });
|
|
|
- inputForm.value = json;
|
|
|
+ inputForm.value.effectiveDateStart = `${currentDate.value.join(
|
|
|
+ "-"
|
|
|
+ )} ${currentTime.value.join(":")}`;
|
|
|
};
|
|
|
//有效期结束时间
|
|
|
let hs_End = ref(false);
|
|
|
- const getEnd = ({ selectedOptions }) => {
|
|
|
+ const getTimeend = () => {
|
|
|
hs_End.value = false;
|
|
|
- const json = Object.assign(inputForm.value, {
|
|
|
- effectiveDateEnd:
|
|
|
- selectedOptions[0].text +
|
|
|
- "-" +
|
|
|
- selectedOptions[1].text +
|
|
|
- "-" +
|
|
|
- selectedOptions[2].text +
|
|
|
- " 00:00:00",
|
|
|
- });
|
|
|
- inputForm.value = json;
|
|
|
+ inputForm.value.effectiveDateEnd = `${currentDate.value.join(
|
|
|
+ "-"
|
|
|
+ )} ${currentTime.value.join(":")}`;
|
|
|
};
|
|
|
//下次保养日期
|
|
|
let hs_upkeep = ref(false);
|
|
|
- const getupkeep = ({ selectedOptions }) => {
|
|
|
+ const getTimeupkeep = () => {
|
|
|
hs_upkeep.value = false;
|
|
|
- const json = Object.assign(inputForm.value, {
|
|
|
- nextMaintenanceDate:
|
|
|
- selectedOptions[0].text +
|
|
|
- "-" +
|
|
|
- selectedOptions[1].text +
|
|
|
- "-" +
|
|
|
- selectedOptions[2].text +
|
|
|
- " 00:00:00",
|
|
|
- });
|
|
|
- inputForm.value = json;
|
|
|
+ inputForm.value.nextMaintenanceDate = `${currentDate.value.join(
|
|
|
+ "-"
|
|
|
+ )} ${currentTime.value.join(":")}`;
|
|
|
};
|
|
|
//图片上传
|
|
|
let fileList = ref([]);
|
|
@@ -429,14 +372,17 @@ export default {
|
|
|
hs_typeOfEmployees,
|
|
|
gettypeOfEmployees,
|
|
|
// 有效起始时间
|
|
|
+ currentDate,
|
|
|
+ currentTime,
|
|
|
+ columnsType,
|
|
|
hs_Start,
|
|
|
- getStart,
|
|
|
+ getTime,
|
|
|
// 有效结束时间
|
|
|
hs_End,
|
|
|
- getEnd,
|
|
|
+ getTimeend,
|
|
|
// 下次保养日期
|
|
|
hs_upkeep,
|
|
|
- getupkeep,
|
|
|
+ getTimeupkeep,
|
|
|
//图片上传
|
|
|
fileList,
|
|
|
chooseImg,
|