|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<van-nav-bar
|
|
|
- title="应急仓库"
|
|
|
+ title="应急物资"
|
|
|
left-arrow
|
|
|
placeholder
|
|
|
@click-left="goback"
|
|
@@ -56,10 +56,13 @@
|
|
|
<van-field
|
|
|
v-model="item.name"
|
|
|
label="名称"
|
|
|
- :readonly="!isedit"
|
|
|
+
|
|
|
+ readonly
|
|
|
input-align="right"
|
|
|
- placeholder="请输入名称"
|
|
|
+ placeholder="请选择名称"
|
|
|
+ @click="selectwz(index)"
|
|
|
/>
|
|
|
+
|
|
|
<van-field
|
|
|
v-model="item.model"
|
|
|
label="型号"
|
|
@@ -123,7 +126,16 @@
|
|
|
>提交</van-button
|
|
|
>
|
|
|
</div>
|
|
|
+ <van-popup v-model:show="showPicker" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ :columns="goodlist"
|
|
|
+ :default-index ="indexp"
|
|
|
+ @confirm="onConfirm"
|
|
|
+ @cancel="showPicker = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
+
|
|
|
<div><van-empty v-if="isempt" description="无仓库" /></div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -142,9 +154,20 @@ import { BaseMediaUrl } from '@/utils';
|
|
|
import { upload } from '@/api/common';
|
|
|
import { cloneDeep } from 'lodash';
|
|
|
|
|
|
+import { useCommonStore } from '@/store';
|
|
|
+
|
|
|
const whdata = reactive({
|
|
|
value: { name: '', manageUnit: '', contactName: '', contactPhone: '' },
|
|
|
});
|
|
|
+const showPicker = ref(false);
|
|
|
+const onConfirm=(value)=>{
|
|
|
+ wzdata.aar[currentindex.value].name = value;
|
|
|
+ showPicker.value = false;
|
|
|
+
|
|
|
+}
|
|
|
+// const columns = ref()
|
|
|
+
|
|
|
+
|
|
|
const isedit = ref(true);
|
|
|
const isempt = ref(true);
|
|
|
// let deletwzarr = [];
|
|
@@ -155,6 +178,26 @@ const beforeRead = (file,detail)=>{
|
|
|
handleUpload(file);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+const commonStore = useCommonStore();
|
|
|
+
|
|
|
+const goodlist = ref([]);
|
|
|
+const currentindex = ref(0);
|
|
|
+const indexp = ref(0);
|
|
|
+const selectwz = (index)=>{
|
|
|
+ if(!isedit.value) return;
|
|
|
+ if(wzdata.aar[index].name){
|
|
|
+ indexp.value = goodlist.value.indexOf(wzdata.aar[index].name);
|
|
|
+ }else{
|
|
|
+ indexp.value =0;
|
|
|
+ }
|
|
|
+ showPicker.value = true;
|
|
|
+ currentindex.value = index;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const handleUpload = (file) => {
|
|
|
Toast.loading({
|
|
|
message: '上传中...',
|
|
@@ -271,10 +314,17 @@ const isbj = ref(true);
|
|
|
|
|
|
const route = useRoute();
|
|
|
onMounted(()=>{
|
|
|
+ var c = async ()=>{
|
|
|
+ await commonStore.getGlobalDict("zhdd_resource_goods");
|
|
|
+ goodlist.value = commonStore.globalDict['zhdd_resource_goods']?.map(o=>o.dictLabel);
|
|
|
+
|
|
|
+ }
|
|
|
+ c();
|
|
|
+
|
|
|
try{
|
|
|
var p = JSON.parse(localStorage.getItem('cck'));
|
|
|
if(p){
|
|
|
- whdata.value = p;
|
|
|
+ whdata.value = p;
|
|
|
}
|
|
|
|
|
|
|