wenhongquan 3 years ago
parent
commit
d8b33fef5e

+ 2 - 0
src/store/useCommonStore.ts

@@ -49,6 +49,8 @@ export default defineStore<'common', CommonStateType, {}, CommonActionsType>(
           getSession<GlobalDict[]>('zhdd_incident_status') ?? [],
         zhdd_incident_type:
           getSession<GlobalDict[]>('zhdd_incident_type') ?? [],
+        zhdd_resource_goods:
+          getSession<GlobalDict[]>('zhdd_resource_goods') ?? [],
         zhdd_org_upload: getSession<GlobalDict[]>('zhdd_org_upload') ?? [],
         zhdd_plan_type: getSession<GlobalDict[]>('zhdd_plan_type') ?? [],
         zhdd_resource: getSession<GlobalDict[]>('zhdd_resource') ?? [],

+ 14 - 11
src/views/IncidentManagementDetailLite/index.tsx

@@ -311,6 +311,7 @@ export default defineComponent({
                 <div style={'height:13px;width:1px'}></div>
                 <Field
                   class={'uploadc'}
+                  label="上传图片"
                   v-slots={{
                     input: () => (
                       <Uploader
@@ -337,6 +338,7 @@ export default defineComponent({
 
                 <Field
                   class={'uploadc'}
+                  label="上传视频"
                   v-slots={{
                     input: () => (
                       <Uploader
@@ -526,17 +528,18 @@ export default defineComponent({
                     </div>
                   </div>
                 ))}
-              <div onClick={() => { 
-                if (route.query.taskid) {
-                  router.push(
-                    `/status/${route.params.status}/detail?id=${route.query.id}`,
-                  );
-                } else { 
-                  router.push(
-                    `/status/${route.params.status}/detail?id=${route.query.id}`,
-                  );
-                }
-              }}
+              <div
+                onClick={() => {
+                  if (route.query.taskid) {
+                    router.push(
+                      `/status/${route.params.status}/detail?id=${route.query.id}`,
+                    );
+                  } else {
+                    router.push(
+                      `/status/${route.params.status}/detail?id=${route.query.id}`,
+                    );
+                  }
+                }}
                 style={
                   'padding-bottom: 30px; text-align: right; padding-top: 10px;padding-top:10px;color:#0B33A8'
                 }>

+ 54 - 4
src/views/Warehouse/index.vue

@@ -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;
     }