Parcourir la source

物资管理调整

Hwf il y a 5 mois
Parent
commit
731baefaaf

+ 1 - 1
src/api/comprehensiveGuarantee/materialReserveManagement/materialsDeclaration.ts

@@ -25,7 +25,7 @@ export function createProcurement(data) {
 // 修改
 export function updateProcurement(data, id) {
   return request({
-    url: '/api/resource_provison/material/type/update/' + id,
+    url: '/api/resource_provison/material/procurement/update/' + id,
     method: 'put',
     data: data
   });

+ 5 - 5
src/api/comprehensiveGuarantee/materialReserveManagement/warehouseManagement.ts

@@ -2,7 +2,7 @@ import request from '@/utils/request';
 // 查询
 export function getMaterialWarehouseRootList(params?: any) {
   return request({
-    url: '/api/resource_provison/material/warehouse_root/list',
+    url: '/api/resource_provison/material/warehouse_room/list',
     method: 'get',
     params: params
   });
@@ -10,14 +10,14 @@ export function getMaterialWarehouseRootList(params?: any) {
 // 详情
 export function getMaterialRootInfo(id) {
   return request({
-    url: '/api/resource_provison/material/warehouse_root/info/' + id,
+    url: '/api/resource_provison/material/warehouse_room/info/' + id,
     method: 'get'
   });
 }
 // 新增
 export function createMaterialRoot(data) {
   return request({
-    url: '/api/resource_provison/material/warehouse_root/create',
+    url: '/api/resource_provison/material/warehouse_room/create',
     method: 'post',
     data: data
   });
@@ -25,7 +25,7 @@ export function createMaterialRoot(data) {
 // 修改
 export function updateMaterialRoot(data, id) {
   return request({
-    url: '/api/resource_provison/material/warehouse_root/update/' + id,
+    url: '/api/resource_provison/material/warehouse_room/update/' + id,
     method: 'put',
     data: data
   });
@@ -33,7 +33,7 @@ export function updateMaterialRoot(data, id) {
 // 删除
 export function deleteMaterialRoot(id: string) {
   return request({
-    url: '/api/resource_provison/material/warehouse_root/delete/' + id,
+    url: '/api/resource_provison/material/warehouse_room/delete/' + id,
     method: 'delete'
   });
 }

+ 1 - 1
src/api/globalMap/onlinePlotting.ts

@@ -175,7 +175,7 @@ export const updateClassificationInfo = (id, data) => {
   });
 };
 // 数据创建
-export const getClassificationCreate = (data) => {
+export const createClassification = (data) => {
   return request({
     url: '/api/pattern/classification/create',
     method: 'post',

+ 1 - 1
src/components/Contact/index.vue

@@ -298,7 +298,7 @@ onMounted(() => {
     display: flex;
     .tree-box {
       width: 100%;
-      height: 440px;
+      height: 555px;
       overflow-y: auto;
       padding: 15px 8px;
       :deep(.el-tree) {

+ 6 - 0
src/types/components.d.ts

@@ -28,6 +28,7 @@ declare module 'vue' {
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCard: typeof import('element-plus/es')['ElCard']
+    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
@@ -42,6 +43,7 @@ declare module 'vue' {
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElIcon: typeof import('element-plus/es')['ElIcon']
+    ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
@@ -51,6 +53,7 @@ declare module 'vue' {
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
@@ -59,7 +62,10 @@ declare module 'vue' {
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
+    ElTimeline: typeof import('element-plus/es')['ElTimeline']
+    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
+    ElTree: typeof import('element-plus/es')['ElTree']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']

+ 3 - 0
src/utils/index.ts

@@ -397,6 +397,9 @@ export const isNumericString = (str) => {
 
 // 转换为带有两位小数的字符串
 export const formatToTwoDecimalPlaces = (str) => {
+  if (typeof str === 'number') {
+    str = str.toString();
+  }
   const [integerPart, decimalPart] = str.split('.');
 
   if (decimalPart === undefined || decimalPart.length === 0) {

+ 3 - 3
src/views/comprehensiveGuarantee/MaterialReserveManagement/addMaterialInformation.vue

@@ -374,14 +374,14 @@ const submitForm = async (formEl) => {
 onMounted(() => {
   getMaterialWarehouseRootList().then((res) => {
     materialWarehouseRootList.value = res.data;
-  });
+  })
   getMaterialWarehouseList().then((res) => {
     godownList.value = res.data;
-  });
+  })
   if (!props.id) return;
   getMaterialInfo(props.id).then((res) => {
     form.value = res.data;
-  });
+  })
 });
 </script>
 

+ 8 - 3
src/views/comprehensiveGuarantee/materialReserves/materialsDeclaration.vue

@@ -25,7 +25,7 @@
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
           <template #default="scope">
             <el-text class="common-btn-text-primary" @click="handleView(scope.row)">详情</el-text>
-            <el-text v-if="scope.row.approval_status === '未审批'" class="common-btn-text-primary" @click="handleUpdate(scope.row)">编辑</el-text>
+            <el-text v-if="scope.row.declaration_details === '1'" class="common-btn-text-primary" @click="handleUpdate(scope.row)">编辑</el-text>
           </template>
         </el-table-column>
       </el-table>
@@ -38,7 +38,7 @@
       />
     </div>
     <MaterialsDeclarationView v-if="materialsDeclarationViewState.show" :id="materialsDeclarationViewState.id" @close="handleCancel" />
-    <MaterialsDeclarationAdd v-if="materialsDeclarationAddState.show" @close="handleCancel" />
+    <MaterialsDeclarationAdd v-if="materialsDeclarationAddState.show" :id="materialsDeclarationAddState.id" @close="handleCancel" />
   </div>
 </template>
 
@@ -116,10 +116,15 @@ const handleView = (row: any) => {
   materialsDeclarationViewState.show = true;
 };
 
-const handleCancel = () => {
+const handleCancel = (needUpdate) => {
   materialsDeclarationViewState.show = false;
   materialsDeclarationAddState.show = false;
+  if (!!needUpdate) {
+    handleQuery();
+  }
 };
+
+
 // 定义审批状态映射
 const approvalStatusMap = {
   '1': '未审核',

+ 25 - 5
src/views/comprehensiveGuarantee/materialReserves/materialsDeclarationAdd.vue

@@ -17,9 +17,18 @@
                 <span>{{ $index + 1 }}</span>
               </template>
             </el-table-column>
+            <el-table-column label="仓库" prop="material_type" align="center">
+              <template #default="scope">
+                <el-form-item :prop="'detail.' + scope.$index + '.warehouse_id'" :rules="rules.warehouse_id" disabled>
+                  <el-select v-model="scope.row.warehouse_id" @change="handleWarehouseChange">
+                    <el-option v-for="item in warehouseList" :key="item.warehouse_id" :label="item.warehouse_name" :value="item.warehouse_id" />
+                  </el-select>
+                </el-form-item>
+              </template>
+            </el-table-column>
             <el-table-column label="物资类型" prop="material_type" align="center">
               <template #default="scope">
-                <el-form-item :prop="'detail.' + scope.$index + '.material_type'" :rules="rules.material_type">
+                <el-form-item :prop="'detail.' + scope.$index + '.material_type'" :rules="rules.material_type" disabled>
                   <el-select v-model="scope.row.material_type">
                     <el-option v-for="(item, index) in material_type" :key="index" :label="item.label" :value="item.value" />
                   </el-select>
@@ -85,6 +94,7 @@ import {
 } from '@/api/comprehensiveGuarantee/materialReserveManagement/materialsDeclaration';
 import BigNumber from 'bignumber.js';
 import { formatToTwoDecimalPlaces, isNumericString } from '@/utils';
+import { getMaterialWarehouseList } from '@/api/comprehensiveGuarantee/materialReserveManagement/godownManagement';
 
 const props = defineProps({
   id: String
@@ -100,16 +110,20 @@ let detailData = reactive({
   detail: []
 });
 const rules = reactive({
+  warehouse_id: [{ required: true, message: '请选择仓库', trigger: 'change' }],
   material_type: [{ required: true, message: '请选择物资类型', trigger: 'change' }],
   material_code: [{ required: true, message: '请选择物资名称', trigger: 'change' }],
   material_quantity: [{ required: true, message: '请输入物资数量', trigger: 'blur' }],
   material_unit_price: [{ required: true, message: '请输入物资单价', trigger: 'blur' }],
   material_purpose: [{ required: true, message: '请输入物资用途', trigger: 'blur' }]
 });
+let buttonLoading = ref(false);
+let warehouseList = ref([]);
 let materialList = ref([]);
 // 新增一列
 const addDefaultRow = () => {
   const newRow = {
+    warehouse_id: '',
     material_type: '',
     material_code: '',
     material_quantity: '',
@@ -118,7 +132,10 @@ const addDefaultRow = () => {
   };
   detailData.detail.push(newRow);
 };
+// 选择仓库
+const handleWarehouseChange = () => {
 
+}
 // 计算总额
 const calcTotalAmount = () => {
   let total = new BigNumber('0');
@@ -169,11 +186,11 @@ const submitForm = async (formEl) => {
   });
 };
 
-let height = ref(400);
+let height = ref(300);
 // 计算表格高度
 const calcHeight = () => {
   const el = document.getElementsByClassName('common-dialog-content')[0];
-  height.value = el ? el.clientHeight - 173 : 400;
+  height.value = el && el.clientHeight - 173 > 400 ? el.clientHeight - 173 : 300;
 };
 onMounted(() => {
   if (props.id) {
@@ -184,9 +201,12 @@ onMounted(() => {
   } else {
     addDefaultRow();
   }
-  getMaterialList().then((res) => {
-    materialList.value = res.data;
+  getMaterialWarehouseList().then((res) => {
+    warehouseList.value = res.data;
   });
+  // getMaterialList().then((res) => {
+  //   materialList.value = res.data;
+  // });
   calcHeight();
   window.addEventListener('resize', calcHeight);
 });

+ 2 - 2
src/views/comprehensiveGuarantee/materialReserves/materialsDeclarationView.vue

@@ -72,11 +72,11 @@ const handleReturn = () => {
   emits('close');
 };
 
-let height = ref(400);
+let height = ref(300);
 // 计算表格高度
 const calcHeight = () => {
   const el = document.getElementsByClassName('common-dialog-content')[0];
-  height.value = el ? el.clientHeight - 173 : 400;
+  height.value = el && el.clientHeight - 173 > 400 ? el.clientHeight - 173 : 300;
 };
 onMounted(() => {
   getDeclarationDetail(props.id).then((res) => {

+ 1 - 1
src/views/globalMap/RightMenu/LayerAnalysis.vue

@@ -20,7 +20,7 @@
       </div>
       <div class="box2">
         <div class="box2-title">类型统计</div>
-        <Chart :option="chartOption2" style="width: 100%; height: 230px;" />
+        <Chart :option="chartOption2" style="width: 100%; height: 230px" />
       </div>
     </div>
   </div>

+ 4 - 2
src/views/globalMap/RightMenu/OnlinePlotting/EditClassDialog.vue

@@ -37,7 +37,7 @@
 </template>
 
 <script lang="ts" setup name="EditClassDialog">
-import { getClassificationCreate, getClassificationInfo, updateClassificationInfo } from '@/api/globalMap/onlinePlotting';
+import { createClassification, getClassificationInfo, updateClassificationInfo } from '@/api/globalMap/onlinePlotting';
 import { FormInstance } from 'element-plus';
 import { deepClone } from '@/utils';
 import { toRefs } from 'vue';
@@ -89,11 +89,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
       }
       if (!!props.id) {
         updateClassificationInfo(props.id, data).then(() => {
+          proxy.$modal.msgSuccess('修改成功');
           emits('updateData');
           emits('update:modelValue');
         });
       } else {
-        getClassificationCreate(data).then(() => {
+        createClassification(data).then(() => {
+          proxy.$modal.msgSuccess('新增成功');
           emits('updateData');
           emits('update:modelValue');
         });

+ 2 - 0
src/views/globalMap/RightMenu/OnlinePlotting/TextEdit.vue

@@ -37,6 +37,7 @@ interface Props {
   modelValue: boolean;
 }
 const props = withDefaults(defineProps<Props>(), {});
+const proxy = getCurrentInstance()?.proxy;
 const options = reactive([
   { name: '16px', value: '16px' },
   { name: '26px', value: '26px' },
@@ -56,6 +57,7 @@ const cancelEdit = () => {
 const addText = () => {
   const data = deepClone(textEditState);
   textEditState.text = '';
+  proxy.$modal.msgSuccess('新增成功');
   emits('addText', data);
 };
 </script>

+ 12 - 8
src/views/globalMap/RightMenu/OnlinePlotting/index.vue

@@ -156,12 +156,12 @@
         </div>
         <div class="footer">
           <el-pagination
+            v-model:current-page="queryParams.page"
+            v-model:page-size="queryParams.pageSize"
             background
             :hide-on-single-page="true"
             layout="total, prev, pager, next"
             :total="total"
-            :page-size="queryParams.pageSize"
-            :current-page="queryParams.page"
             @current-change="getList"
           />
         </div>
@@ -179,7 +179,7 @@
   <Contact v-if="shareState.showShare" v-model="shareState.showShare" @close="handleCloseShare" @confirm="handleShareConfirm" />
   <Dialog v-if="showForm" v-model="showForm" customShow title="协同标绘" type="xs" @close="showForm = false" @confirm="handleSendForm">
     <div style="display: flex; align-items: center">
-      <div style="font-size: 16px">预案名称</div>
+      <div style="font-size: 16px">预案名称</div>
       <el-input v-model="form.pattern_name" class="custom-input" placeholder="请输入" style="flex: 1" />
     </div>
   </Dialog>
@@ -309,13 +309,16 @@ const handleShowSwitch = (item) => {
 };
 const handleMenuItemHide = (item) => {
   item.showSetting = false;
-  changeVisibleClassification({ classification_id: item.classification_id, visible: item.visible === '0' ? '1' : '0' }).then(() => {
+  const newVisible = item.visible === '0' ? '1' : '0';
+  changeVisibleClassification({ classification_id: item.classification_id, visible: newVisible }).then(() => {
+    proxy.$modal.msgSuccess(newVisible === '0' ? '隐藏成功' : '显示成功');
     getTemplateTreeData();
   });
 };
 const handleMenuItemDelete = (item) => {
   item.showSetting = false;
   deleteClassificationCreate(item.classification_id).then(() => {
+    proxy.$modal.msgSuccess('删除成功');
     getTemplateTreeData();
   });
 };
@@ -789,13 +792,14 @@ const handleSendForm = () => {
   if (!form.value.pattern_name) {
     return proxy?.$modal.msgWarning('请填写预案名称');
   }
-  // webSock = createWebSocket('ZEaBf-NZ4Fi29kSYGdNeJ', getWebSocketData);
-  // patternId.value = 'ZEaBf-NZ4Fi29kSYGdNeJ';
+  // webSock = createWebSocket('X_cBqh0q1GUVhTOmS5c8w', getWebSocketData);
+  // patternId.value = 'X_cBqh0q1GUVhTOmS5c8w';
   createCollaboration(form.value).then(() => {
     patternId.value = form.value.pattern_id;
     webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
     showForm.value = false;
     collaboration.value = true;
+    proxy?.$modal.msgSuccess('开启协同标绘成功');
   });
 };
 const handleShowDialog = () => {
@@ -1164,7 +1168,7 @@ onMounted(() => {
             display: inline-block;
             width: 12px;
             height: 12px;
-            background: url('@/assets/images/map/rightMenu/onlinePlotting/switch2.png') no-repeat;
+            background: url('@/assets/images/map/rightMenu/onlinePlotting/switch1.png') no-repeat;
             background-size: 100% 100%;
             margin-right: 6px;
           }
@@ -1196,7 +1200,7 @@ onMounted(() => {
             color: #00fde7;
             background: #1e3b77;
             .icon-switch {
-              background: url('@/assets/images/map/rightMenu/onlinePlotting/switch1.png') no-repeat;
+              background: url('@/assets/images/map/rightMenu/onlinePlotting/switch2.png') no-repeat;
               background-size: 100% 100%;
             }
             .icon-eye {