|
@@ -36,16 +36,12 @@
|
|
|
<u-form-item label="成立时间" prop="foundTime" required :borderBottom="true" @click="handleDateTime('成立时间', 0, form.foundTime)">
|
|
|
<u-input v-model="form.foundTime" placeholder="请选择成立时间" border="none" suffixIcon="calendar" suffixIconStyle="color: #909399;font-size:22px" />
|
|
|
</u-form-item>
|
|
|
-
|
|
|
- <!-- 新增 开始 -->
|
|
|
<u-form-item label="单位使用性质" prop="companyNature" :borderBottom="true" @click="handleAction('单位使用性质')" required>
|
|
|
<u-input v-model="form.companyNature" placeholder="请选择单位使用性质" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
|
|
|
</u-form-item>
|
|
|
<u-form-item label="产证" prop="birthCert" :borderBottom="true" @click="handleAction('产证')" required>
|
|
|
<u-input v-model="form.birthCert" placeholder="请选择产证" suffixIcon="arrow-right" suffixIconStyle="color: #909399" border="none" disabledColor="transparent" disabled />
|
|
|
</u-form-item>
|
|
|
- <!-- 新增 结束 -->
|
|
|
-
|
|
|
<u-form-item label="消防安全责任人" prop="fireDutyName" :borderBottom="true">
|
|
|
<u-input v-model="form.fireDutyName" placeholder="请输入消防安全责任人" border="none" />
|
|
|
</u-form-item>
|
|
@@ -84,7 +80,7 @@
|
|
|
<view style="display: flex; overflow: hidden">
|
|
|
<image style="width: 15px; height: 15px; margin: auto 10px auto 0" src="@/static/images/unitInfoCollection/icon1.png" />
|
|
|
<view style="margin: auto auto auto 0">建筑{{ index + 1 }}</view>
|
|
|
- <u-icon v-if="form.baseBuildList.length > 1" name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit('建筑', li)"></u-icon>
|
|
|
+ <u-icon v-if="form.baseBuildList.length > 1" name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit('建筑', index)"></u-icon>
|
|
|
</view>
|
|
|
<view style="padding-left: 9px">
|
|
|
<u-form-item label="建筑名称" :prop="`baseBuildList.${index}.baseBuild.buildName`" required :borderBottom="true">
|
|
@@ -208,16 +204,22 @@
|
|
|
</u-form-item>
|
|
|
|
|
|
<view>
|
|
|
- <view v-for="(base, ind) in li.baseBuildExtinguishList" :key="ind">
|
|
|
+ <view v-for="(base, baseIndex) in li.baseBuildExtinguishList" :key="baseIndex">
|
|
|
<view style="margin: 10px 0; text-align: left">
|
|
|
- {{ "灭火器" + (ind + 1) }}
|
|
|
- <u-icon v-if="li.baseBuildExtinguishList.length > 1" name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit('灭火器', li, base)"></u-icon>
|
|
|
+ {{ "灭火器" + (baseIndex + 1) }}
|
|
|
+ <u-icon v-if="li.baseBuildExtinguishList.length > 1" name="trash" color="#FF0000" size="20" style="float: right" @click="deleteSubmit('灭火器', index, baseIndex)"></u-icon>
|
|
|
</view>
|
|
|
|
|
|
- <u-form-item label="类型" :prop="`baseBuildList.${index}.baseBuildExtinguishList.${ind}.extinguishType`" required :borderBottom="true" @click="handleAction('灭火器', index, ind)">
|
|
|
+ <u-form-item
|
|
|
+ label="类型"
|
|
|
+ :prop="`baseBuildList.${index}.baseBuildExtinguishList.${baseIndex}.extinguishType`"
|
|
|
+ required
|
|
|
+ :borderBottom="true"
|
|
|
+ @click="handleAction('灭火器', index, baseIndex)"
|
|
|
+ >
|
|
|
<u-input v-model="base.extinguishType" placeholder="请选择类型" border="none" suffixIcon="arrow-right" suffixIconStyle="color: #909399" disabledColor="transparent" disabled />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="数量" :prop="`baseBuildList.${index}.baseBuildExtinguishList.${ind}.extinguishNum`" :borderBottom="true" required>
|
|
|
+ <u-form-item label="数量" :prop="`baseBuildList.${index}.baseBuildExtinguishList.${baseIndex}.extinguishNum`" :borderBottom="true" required>
|
|
|
<u-input type="number" v-model="base.extinguishNum" placeholder="请输入数量" border="none" maxlength="10" />
|
|
|
</u-form-item>
|
|
|
</view>
|
|
@@ -691,108 +693,23 @@ const dataList = reactive({
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- baseBuildExtinguishList: [
|
|
|
- {
|
|
|
- extinguishType: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择灭火器类型",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- extinguishNum: [
|
|
|
- {
|
|
|
- type: "number",
|
|
|
- required: true,
|
|
|
- message: "请输入灭火器数量",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- extinguishType: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择灭火器类型",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- extinguishNum: [
|
|
|
- {
|
|
|
- type: "number",
|
|
|
- required: true,
|
|
|
- message: "请输入灭火器数量",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- extinguishType: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择灭火器类型",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- extinguishNum: [
|
|
|
- {
|
|
|
- type: "number",
|
|
|
- required: true,
|
|
|
- message: "请输入灭火器数量",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- extinguishType: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择灭火器类型",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- extinguishNum: [
|
|
|
- {
|
|
|
- type: "number",
|
|
|
- required: true,
|
|
|
- message: "请输入灭火器数量",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
+ baseBuildExtinguishList: [],
|
|
|
+ },
|
|
|
+
|
|
|
+ baseBuildExtinguishRules: {
|
|
|
+ extinguishType: [
|
|
|
{
|
|
|
- extinguishType: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择灭火器类型",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- extinguishNum: [
|
|
|
- {
|
|
|
- type: "number",
|
|
|
- required: true,
|
|
|
- message: "请输入灭火器数量",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
+ required: true,
|
|
|
+ message: "请选择灭火器类型",
|
|
|
+ trigger: ["blur", "change"],
|
|
|
},
|
|
|
+ ],
|
|
|
+ extinguishNum: [
|
|
|
{
|
|
|
- extinguishType: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择灭火器类型",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
- extinguishNum: [
|
|
|
- {
|
|
|
- type: "number",
|
|
|
- required: true,
|
|
|
- message: "请输入灭火器数量",
|
|
|
- trigger: ["blur", "change"],
|
|
|
- },
|
|
|
- ],
|
|
|
+ type: "number",
|
|
|
+ required: true,
|
|
|
+ message: "请输入灭火器数量",
|
|
|
+ trigger: ["blur", "change"],
|
|
|
},
|
|
|
],
|
|
|
},
|
|
@@ -819,6 +736,7 @@ const {
|
|
|
baseBuildExtinguishArray,
|
|
|
rules,
|
|
|
baseBuildListRules,
|
|
|
+ baseBuildExtinguishRules,
|
|
|
pagingBool,
|
|
|
actionTitle,
|
|
|
actionIndex,
|
|
@@ -950,6 +868,7 @@ function handleSubmitApi(value) {
|
|
|
completeYear: el.baseBuild.completeYear, //竣工年份
|
|
|
buildHigh: Number(el.baseBuild.buildHigh), //建筑高度
|
|
|
fireFacilitySystem: el.baseBuild.fireFacilitySystem.join(","), //消防设施
|
|
|
+ fireproofCoat: el.baseBuild.fireproofCoat, //是否有防火涂层;0、无 1、有
|
|
|
otherSystem: el.baseBuild.otherSystem.join(","), //其他系统;0、无 1、有
|
|
|
otherFacilities: el.baseBuild.otherFacilities, //其他设施
|
|
|
},
|
|
@@ -992,7 +911,7 @@ function handleSubmitApi(value) {
|
|
|
|
|
|
addBaseCompany(param).then((res) => {
|
|
|
if (res.status == "SUCCESS") {
|
|
|
- if (scanBool) {
|
|
|
+ if (scanBool.value) {
|
|
|
successBool.value = true;
|
|
|
} else {
|
|
|
uni.showToast({
|
|
@@ -1319,7 +1238,7 @@ function selectAction(e) {
|
|
|
form.value.baseBuildList.push(baseBuildListForm.value);
|
|
|
}
|
|
|
|
|
|
- form.value.baseBuildList.forEach((el) => {
|
|
|
+ form.value.baseBuildList.forEach((el, index) => {
|
|
|
rules.value.baseBuildList.push(JSON.parse(JSON.stringify(baseBuildListRules.value)));
|
|
|
|
|
|
el.baseBuild.fireFacilitySystem = el.baseBuild.fireFacilitySystem ? el.baseBuild.fireFacilitySystem.split(",").map((num) => Number(num)) : [];
|
|
@@ -1363,6 +1282,10 @@ function selectAction(e) {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ el.baseBuildExtinguishList.forEach((f) => {
|
|
|
+ rules.value.baseBuildList[index].baseBuildExtinguishList.push(JSON.parse(JSON.stringify(baseBuildExtinguishRules.value)));
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -1432,6 +1355,7 @@ function timeSubmit(data) {
|
|
|
|
|
|
/**
|
|
|
* @添加建筑
|
|
|
+ * @添加灭火器
|
|
|
* @按钮点击事件
|
|
|
*/
|
|
|
function addSubmit(type, index) {
|
|
@@ -1440,35 +1364,39 @@ function addSubmit(type, index) {
|
|
|
rules.value.baseBuildList.push(JSON.parse(JSON.stringify(baseBuildListRules.value)));
|
|
|
} else if (type == "灭火器") {
|
|
|
form.value.baseBuildList[index].baseBuildExtinguishList.push(JSON.parse(JSON.stringify(baseBuildExtinguishArray.value)));
|
|
|
+ rules.value.baseBuildList[index].baseBuildExtinguishList.push(JSON.parse(JSON.stringify(baseBuildExtinguishRules.value)));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @删除建筑
|
|
|
+ * @删除灭火器
|
|
|
* @按钮点击事件
|
|
|
*/
|
|
|
-function deleteSubmit(type, event, even) {
|
|
|
+function deleteSubmit(type, index, baseIndex) {
|
|
|
if (type == "建筑") {
|
|
|
- if ("id" in event.baseBuild) {
|
|
|
- delBaseBuild(event.baseBuild.id).then((res) => {
|
|
|
+ if ("id" in form.value.baseBuildList[index].baseBuild) {
|
|
|
+ delBaseBuild(form.value.baseBuildList[index].baseBuild.id).then((res) => {
|
|
|
if (res.status == "SUCCESS") {
|
|
|
- form.value.baseBuildList.splice(form.value.baseBuildList.indexOf(event), 1);
|
|
|
+ form.value.baseBuildList.splice(index, 1);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- form.value.baseBuildList.splice(form.value.baseBuildList.indexOf(event), 1);
|
|
|
+ form.value.baseBuildList.splice(index, 1);
|
|
|
}
|
|
|
- rules.value.baseBuildList.splice(0, 1);
|
|
|
+ rules.value.baseBuildList.splice(index, 1);
|
|
|
} else if (type == "灭火器") {
|
|
|
- if ("id" in even) {
|
|
|
- delBaseBuildExtinguish(even.id).then((res) => {
|
|
|
+ if ("id" in form.value.baseBuildList[index].baseBuildExtinguishList[baseIndex]) {
|
|
|
+ delBaseBuildExtinguish(form.value.baseBuildList[index].baseBuildExtinguishList[baseIndex].id).then((res) => {
|
|
|
if (res.status == "SUCCESS") {
|
|
|
- form.value.baseBuildList[form.value.baseBuildList.indexOf(event)].baseBuildExtinguishList.splice(form.value.baseBuildList.indexOf(even), 1);
|
|
|
+ form.value.baseBuildList[index].baseBuildExtinguishList.splice(baseIndex, 1);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- form.value.baseBuildList[form.value.baseBuildList.indexOf(event)].baseBuildExtinguishList.splice(form.value.baseBuildList.indexOf(even), 1);
|
|
|
+ form.value.baseBuildList[index].baseBuildExtinguishList.splice(baseIndex, 1);
|
|
|
}
|
|
|
+
|
|
|
+ rules.value.baseBuildList[index].baseBuildExtinguishList.splice(baseIndex, 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1480,10 +1408,9 @@ onLoad((options) => {
|
|
|
|
|
|
if (options.scanBool) {
|
|
|
scanBool.value = options.scanBool;
|
|
|
- }
|
|
|
-
|
|
|
- if (scanBool.value) {
|
|
|
- document.getElementsByClassName("uni-page-head-hd")[0].style.cssText = "display: none;";
|
|
|
+ if (scanBool.value) {
|
|
|
+ document.getElementsByClassName("uni-page-head-hd")[0].style.cssText = "display: none;";
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
</script>
|