From afdc4f71240ff51dcf4e3b4cf5ce37208f6084b1 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Mon, 29 Jan 2024 18:33:56 +0800
Subject: [PATCH] 更新
---
subPackage/workbench/views/cscj.vue | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 112 insertions(+), 8 deletions(-)
diff --git a/subPackage/workbench/views/cscj.vue b/subPackage/workbench/views/cscj.vue
index c4b2f4f..8db7114 100644
--- a/subPackage/workbench/views/cscj.vue
+++ b/subPackage/workbench/views/cscj.vue
@@ -12,9 +12,6 @@
<view class="box-title">
<box-title title="基础信息"></box-title>
</view>
-
-
-
<u-form-item class="form-item" labelWidth="100" label="场所名称:" :required="isRequiredPlace"
:disabled="isDisabled" prop="placeName">
<u--input v-if="!currentId" border="none" v-model="form.placeName" placeholder="请输入">
@@ -40,6 +37,31 @@
<view class="f-30" v-if="currentId">
{{form.isNine == 1?"是":"否"}}
</view>
+ </u-form-item>
+ <u-form-item v-if="form.isNine == 1" @click="showNineTypePicker = true" class="form-item"
+ labelWidth="100" label="九小场所类型:" :required="isRequired" :disabled="isDisabled" prop="nineType">
+ <u-input border="none" v-model="nineTypeValue" disabled disabledColor="#ffffff"
+ placeholder="请选择">
+ </u-input>
+ <u-icon slot="right" name="arrow-right"></u-icon>
+ </u-form-item>
+ <u-form-item v-if="form.isNine == 1" label="阵地" labelWidth="100" prop="isFront"
+ :required="isRequired">
+ <u-radio-group v-model="form.isFront" v-if="!currentId">
+ <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
+ :key="index" :label="item.name" :name="item.id">
+ </u-radio>
+ </u-radio-group>
+ <view class="f-30" v-if="currentId">
+ {{form.isFront == 1?"是":"否"}}
+ </view>
+ </u-form-item>
+ <u-form-item v-if="form.isFront == 1" @click="showFrontTypePicker = true" class="form-item"
+ labelWidth="100" label="阵地类型:" :required="isRequired" :disabled="isDisabled" prop="frontType">
+ <u-input border="none" v-model="frontTypeValue" disabled disabledColor="#ffffff"
+ placeholder="请选择">
+ </u-input>
+ <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<!-- <view v-if="showLabelList.length" class="label" style="border-bottom:1px solid eff1f3;">
<view v-for="(item,index) in showLabelList" :key="index" class="activeLabel">
@@ -179,9 +201,13 @@
<footer-btn @click="submit" v-if="!currentId" />
- <u-picker :show="showPicker" :defaultIndex="defaultIndex" ref="uPicker" keyName="name" :loading="pickerLoading"
- :columns="pickColumns" @change="changeHandler" @confirm="confirmPicker"
- @cancel="showPicker = false"></u-picker>
+ <u-picker :show="showNineTypePicker" :defaultIndex="nineTypeIndex" ref="uPicker" keyName="name"
+ :loading="pickerLoading" :columns="[nineTypeList]" @confirm="confirmNineTypePicker"
+ @cancel="showNineTypePicker = false"></u-picker>
+
+ <u-picker :show="showFrontTypePicker" :defaultIndex="frontTypeIndex" ref="uPicker" keyName="name"
+ :loading="pickerLoading" :columns="[frontTypeList]" @confirm="confirmFrontTypePicker"
+ @cancel="showFrontTypePicker = false"></u-picker>
<u-picker :show="isShowCatePicker" :defaultIndex="categoryIndex" ref="catePicker" keyName="categoryName"
@@ -215,6 +241,9 @@
import {
minioBaseUrl
} from "../../../common/setting";
+ import {
+ bizDictionary
+ } from '@/api/system/dict.js'
export default {
mixins: [uploadMixin],
components: {
@@ -245,7 +274,10 @@
lat: '',
lng: '',
location: '',
- isNine: ""
+ isNine: "",
+ isFront: "",
+ frontType: "",
+ nineType: ""
},
rules: {
// 'buildingCode': {
@@ -429,6 +461,16 @@
id: 2
}
],
+ nineTypeList: [], //九小类型
+ frontTypeList: [], //阵地
+ nineTypeIndex: [0],
+ frontTypeIndex: [0],
+ showNineTypePicker: false,
+ showFrontTypePicker: false,
+ nineTypeValue: "",
+ frontTypeValue: ""
+
+
}
},
created() {
@@ -460,6 +502,7 @@
})
}
this.getCategory();
+ this.getAllBizDict();
},
watch: {
@@ -528,6 +571,28 @@
// })
// })
// },
+
+
+ async getAllBizDict() {
+ // 获取九小场所类型
+ await this.getBizDict('nineType', this.nineTypeList)
+ // 获取阵地
+ await this.getBizDict('frontType', this.frontTypeList)
+ },
+
+ // 获取业务字典
+ async getBizDict(code, list) {
+ const param = {
+ code: code
+ }
+ const res = await bizDictionary(param)
+ res.data.forEach(e => {
+ list.push({
+ name: e.dictValue,
+ value: Number(e.dictKey)
+ })
+ })
+ },
navTo(type) {
if (type == 1) {
@@ -664,6 +729,25 @@
this.form.images = []
}
}
+
+ if (key == "isNine") {
+ let {
+ index,
+ name
+ } = this.$getIndex(this.nineTypeList, data.nineType, "value", "name");
+ this.nineTypeIndex = index;
+ this.nineTypeValue = name;
+ }
+
+ if (key == "isFrontType") {
+ let {
+ index,
+ name
+ } = this.$getIndex(this.frontTypeList, data.frontType, "value", "name");
+ this.frontTypeIndex = index;
+ this.frontTypeValue = name;
+ }
+
})
this.form.jwd = `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`
@@ -708,7 +792,6 @@
}
})
})
-
})
},
@@ -726,6 +809,15 @@
}
this.form.roleName = uni.getStorageSync("activeRole").roleName;
+ if (this.form.isNine == 2 && this.form.nineType) {
+ this.form.nineType = "";
+ }
+ if (this.form.isFront == 2 && this.form.frontType) {
+ this.form.frontType = "";
+ }
+
+ delete this.form.images;
+
add(this.form).then(res => {
uni.showToast({
icon: 'success',
@@ -814,6 +906,18 @@
this.showPicker = false
},
+ confirmNineTypePicker(e) {
+ this.nineTypeIndex = e.indexs;
+ this.nineTypeValue = e.value[0].name;
+ this.form.nineType = e.value[0].value;
+ },
+
+ confirmFrontTypePicker(e) {
+ this.frontTypeIndex = e.indexs;
+ this.frontTypeValue = e.value[0].name;
+ this.form.frontType = e.value[0].value;
+ },
+
async changeHandler(e) {
const {
columnIndex,
--
Gitblit v1.9.3