|
@@ -5,15 +5,20 @@
|
|
|
<gw-select :columns="baseBatchs" v-model:value="baseBatch" />
|
|
|
<gw-select :columns="twoBatchs" v-model:value="twoBatch" />
|
|
|
</div>
|
|
|
- <list01 class="inspect-group-wrapper" type="history" :batch="twoBatch"></list01>
|
|
|
+ <van-pull-refresh class="inspect-group-wrapper" v-model="loading" @refresh="getInspBase(twoBatch, 3)">
|
|
|
+ <card01 v-for="item in list" :key="item" :title="item.prsnTitle + ''" icon="notes"
|
|
|
+ :description="`时间:${item.sttm} 至 ${item.entm}`" @click="emits('onClick', item.prsnId)" />
|
|
|
+ </van-pull-refresh>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, watch } from "vue";
|
|
|
-import List01 from "@/components/list01.vue";
|
|
|
+import { ref, watch, defineEmits } from "vue";
|
|
|
import GwSelect from "@/components/GwSelect.vue";
|
|
|
+import card01 from '@/components/card01.vue';
|
|
|
import { getInspBaseByPersid } from "@/api/inspect";
|
|
|
|
|
|
+const emits = defineEmits(['onClick']);
|
|
|
+
|
|
|
const inspectType = ref('008');
|
|
|
const inspectTypes = [{ text: '稽查工作', value: '008' }];
|
|
|
|
|
@@ -23,9 +28,20 @@ const baseBatchs = ref([]);
|
|
|
const twoBatch = ref(null);
|
|
|
const twoBatchs = ref([]);
|
|
|
|
|
|
+const list = ref([]);
|
|
|
+const loading = ref(false);
|
|
|
+
|
|
|
function getInspBase(value, level = 1) {
|
|
|
+ if (!value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 获取批次
|
|
|
getInspBaseByPersid(value).then(res => {
|
|
|
+ if (level === 3) {
|
|
|
+ list.value = res.data;
|
|
|
+ loading.value = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (level === 2) {
|
|
|
twoBatchs.value = res.data.map(item => ({ text: item.prsnTitle, value: item.plnaId })).reverse();
|
|
|
twoBatch.value = twoBatchs.value[0].value;
|
|
@@ -33,20 +49,23 @@ function getInspBase(value, level = 1) {
|
|
|
}
|
|
|
baseBatchs.value = res.data.map(item => ({ text: item.prsnTitle, value: item.plnaId }));
|
|
|
baseBatch.value = baseBatchs.value[0].value;
|
|
|
- // getInspBase(baseBatch.value, 2);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
- getInspBase(inspectType.value)
|
|
|
-});
|
|
|
-
|
|
|
-
|
|
|
watch(() => inspectType, inspectType => {
|
|
|
- getInspBase(inspectType.value);
|
|
|
-})
|
|
|
+ if (inspectType.value) {
|
|
|
+ getInspBase(inspectType.value);
|
|
|
+ }
|
|
|
+}, { deep: true, immediate: true })
|
|
|
watch(() => baseBatch, baseBatch => {
|
|
|
- getInspBase(baseBatch.value, 2);
|
|
|
+ if (baseBatch.value) {
|
|
|
+ getInspBase(baseBatch.value, 2);
|
|
|
+ }
|
|
|
+}, { deep: true, immediate: true })
|
|
|
+watch(() => twoBatch, twoBatch => {
|
|
|
+ if (twoBatch.value) {
|
|
|
+ getInspBase(twoBatch.value, 3)
|
|
|
+ }
|
|
|
}, { deep: true, immediate: true })
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|