From e51e45f2cabcc4628ce93e55c7c3806b1b760161 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期一, 11 八月 2025 16:26:23 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java |    8 
 north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor.vue                 |    4 
 north-glass-erp/northglass-erp/src/views/mm/ingredientStock/SelectIngredientsStock.vue       |  365 ++----------------------
 north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java       |   35 ++
 north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml                           |   10 
 north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java         |    2 
 north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue             |  421 ++++++++++++++++++++++++++++
 7 files changed, 513 insertions(+), 332 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor.vue b/north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor.vue
index 2afe1fe..7091b2c 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/UpdateAlienEditor.vue
@@ -438,7 +438,8 @@
   return true
 }
 defineExpose({
-  validate
+  validate,
+  ongetproject
 })
 
 const save =  () => {
@@ -552,7 +553,6 @@
     data8.value=round(maxY-minY-lowerRight[1]*big,0)
   }
 }
-
 
 
 </script>
diff --git a/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue b/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue
new file mode 100644
index 0000000..bd46537
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/MaterialAddition.vue
@@ -0,0 +1,421 @@
+<!-- 棰嗗嚭璁板綍  -->
+<script setup>
+
+import {onMounted, reactive, ref} from "vue";
+import {useRoute, useRouter} from "vue-router"
+import request from "@/utils/request";
+import deepClone from "@/utils/deepClone";
+import useUserInfoStore from "@/stores/userInfo";
+import {ElMessage} from "element-plus";
+import {Search} from "@element-plus/icons-vue";
+import { useI18n } from 'vue-i18n'
+import footSum from "@/hook/footSum";
+import {changeFilterEvent, filterChanged} from "@/hook";
+import {divideAuto, multiply} from "@/utils/decimal";
+
+//璇█鑾峰彇
+const { t } = useI18n()
+const router = useRouter()
+const route = useRoute()
+const userStore = useUserInfoStore()
+const username = userStore.user.userName
+const userid = userStore.user.userId
+let BasicData = ref([])
+let produceLists = ref([])
+let isDisabled = ref(false)
+let arrs = [
+  { type: 'radio',fixed:"left", title: t('basicData.check'), width: '80' },
+  { type: 'seq',fixed:'left', title: t('basicData.Number'), width: '80' },
+  {field: 'id', width: '150',title: t('ingredients.materialCode'), sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}
+]
+
+const value = ref('')
+const options = [
+  {
+    value: t('ingredients.originalFilm'),
+    label: t('ingredients.originalFilm')
+  },
+  {
+    value: t('ingredients.accessories'),
+    label: t('ingredients.accessories'),
+  }
+]
+
+let filterDatas = ref({
+  type:''
+
+})
+let BasicDatas = ref([])
+let materialStores= ref([])
+
+//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
+const titleSelectJson = ref({
+  inventoryOrganization:""
+})
+
+// 瀹氫箟琛ㄥご涓婁紶鏁版嵁
+let titleUploadData = ref({
+  producer:'',
+  dateOfManufacture:'',
+  qualityGuaranteePeriod:'',
+  inventoryOrganization:'',
+  inventoryArea:'',
+  inventoryQuantity:'',
+  remarks:''
+})
+
+
+
+//鐗╂枡鏂板
+const xGrids = ref()
+const gridOption = reactive({
+  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  keepSource: true,//淇濇寔婧愭暟鎹�
+  align: 'center',//鏂囧瓧灞呬腑
+  stripe:true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  id: 'SelectIngredientsStocks',
+  showFooter: true,//鏄剧ず鑴�
+  printConfig: {},
+  importConfig: {},
+  exportConfig: {},
+  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
+  showOverflow:true,
+  columnConfig: {
+    resizable: true,
+    useKey: true
+  },
+  filterConfig: {   //绛涢�夐厤缃」
+                    //remote: true
+  },
+  customConfig: {
+    storage: true
+  },
+  editConfig: {
+    trigger: 'click',
+    mode: 'row',
+    showStatus: true
+  },//琛ㄥご鍙傛暟
+  columns:[
+
+  ],//琛ㄥご鎸夐挳
+  toolbarConfig: {
+    buttons: [
+      {'code': 'add', 'name': t('basicData.save'),status: 'primary',icon: 'vxe-icon-save'},
+    ],
+  }
+
+})
+
+const select= async() =>{
+  request.get(`/BasicWarehouse/BasicWarehouseTypes/`+t('ingredientsStock.inventoryOrganization')).then((res) => {
+
+    if(res.code==200){
+      titleSelectJson.value=deepClone(res.data)
+      titleUploadData.value.inventoryOrganization=titleSelectJson.value.inventoryOrganization[0].operateTypeName
+    }else{
+      ElMessage.warning(res.msg)
+    }
+  })
+}
+
+//鍒楁煡璇�
+const getStoreWork = () => {
+  value.value=t('ingredients.originalFilm')
+  request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
+    if(res.code==200){
+      gridOption.columns=[]
+      BasicData.value = res.data
+      //娣诲姞鍒�
+      gridOption.columns=arrs.slice()
+
+      for (let i=0;i<BasicData.value.length;i++){
+        let column={field: BasicData.value[i].OperateType,
+          width: '150',title: BasicData.value[i].OperateTypeName,
+          sortable: true,showOverflow:'ellipsis' ,
+          filters:[{ data: '' }],
+          slots: { filter: 'num1_filter' },
+          filterMethod:filterChanged}
+        gridOption.columns.push(column)
+
+      }
+      if(value.value==t('ingredients.accessories')){
+        titleUploadData.value.inventoryOrganization=titleSelectJson.value.inventoryOrganization[1].operateTypeName
+      }else{
+        titleUploadData.value.inventoryOrganization=titleSelectJson.value.inventoryOrganization[0].operateTypeName
+      }
+
+      getStoreWorks()
+
+    }else{
+      ElMessage.warning(res.msg)
+    }
+  })
+}
+
+//鏁版嵁缁戝畾
+const getStoreWorks = () => {
+  request.post(`/materialStore/getSelectMaterialStore`,filterDatas.value).then((res) => {
+
+    if(res.code==200){
+      materialStores.value=[]
+      for (let i=0;i<res.data.data.length;i++){
+        materialStores.value[i]=JSON.parse(res.data.data[i].json)
+        materialStores.value[i].id=(res.data.data[i].id)
+
+      }
+
+
+      produceLists = deepClone(materialStores.value)
+      xGrids.value.loadData(produceLists)
+      gridOption.loading=false
+    }else{
+      ElMessage.warning(res.msg)
+      router.push("/login")
+    }
+  })
+}
+
+
+const gridEvent = {
+  async toolbarButtonClick({code}) {
+    const $grid = xGrids.value
+    if ($grid) {
+      switch (code) {
+        case 'add': {
+          if(props.type==1){
+            const selectRecords = $grid.getRadioRecord()
+            if (selectRecords == null) {
+              ElMessage.warning(t('productStock.unselectedData'))
+              return
+            }
+            const errMap = await $grid.validate(selectRecords)
+            if (errMap) {
+              ElMessage.warning(t('productStock.dataVerificationFailed'))
+              return
+            }
+            //琛ㄥご鏁版嵁鏍¢獙
+            const outboundType = titleUploadData.value.inventoryOrganization
+            if(outboundType === null || outboundType === undefined || outboundType === ''){
+              ElMessage.error(t('ingredientsStock.pleaseSelectInventoryOrganization'))
+              return
+            }
+            const materialRequisitionPersonnel = titleUploadData.value.inventoryQuantity
+            if(materialRequisitionPersonnel === null || materialRequisitionPersonnel === undefined || materialRequisitionPersonnel === ''){
+              ElMessage.error(t('ingredientsStock.pleaseEnterTheQuantity'))
+              return
+            }
+            const  dateOfManufacture= titleUploadData.value.dateOfManufacture
+            if(dateOfManufacture === null || dateOfManufacture === undefined || dateOfManufacture === ''){
+              titleUploadData.value.dateOfManufacture=null
+            }
+
+            /*const inventoryArea = titleUploadData.value.inventoryArea
+            if(inventoryArea === null || inventoryArea === undefined || inventoryArea === ''){
+              ElMessage.error("璇疯緭鍏ュ簱瀛樺尯鍩�")
+              return
+            }*/
+            let  flowData
+            if(selectRecords.height===undefined){
+              flowData = ref({
+
+                title: titleUploadData.value,
+                materialCode: selectRecords.id,
+                userName:userStore.user.userName,
+                userId:userStore.user.userId
+
+              })
+            }else{
+              flowData = ref({
+                totalArea: parseFloat(divideAuto(multiply(selectRecords.height,selectRecords.width),1000000,2))*titleUploadData.value.inventoryQuantity,
+                singlePieceArea: parseFloat(divideAuto(multiply(selectRecords.height,selectRecords.width),1000000,2)),
+                title: titleUploadData.value,
+                materialCode: selectRecords.id,
+                userName:userStore.user.userName,
+                userId:userStore.user.userId
+
+              })
+            }
+
+
+            request.post("/materialInventory/saveMaterialInventory", flowData.value).then((res) => {
+              if(res.code==200 && res.data==="true"){
+                ElMessage.success(t('basicData.msg.saveSuccess'))
+                router.push({path: '/main/ingredientsStock/SelectIngredientsStock', query:{random:Math.random()}})
+              }else {
+                ElMessage.warning(t('basicData.msg.ServerConnectionError'))
+              }
+            })
+          }else{
+            let flowData = ref({
+              title: titleUploadData.value,
+              materialInventoryId: props.data.id,
+              userName:userStore.user.userName,
+              userId:userStore.user.userId
+
+            })
+
+            request.post("/materialInventory/updateMaterialInventory", flowData.value).then((res) => {
+              if(res.code==200 && res.data==="true"){
+                ElMessage.success(t('basicData.msg.saveSuccess'))
+                router.push({path: '/main/ingredientsStock/SelectIngredientsStock', query:{random:Math.random()}})
+              }else if(res.data==="false1") {
+                ElMessage.warning("搴撳瓨瀛樺湪澶氭潯")
+              }else {
+                ElMessage.warning(t('basicData.msg.ServerConnectionError'))
+              }
+            })
+          }
+
+          break
+        }
+
+
+      }
+    }
+  }
+}
+
+
+
+
+let props = defineProps({
+  type:0,
+  data:null
+})
+
+onMounted(async ()=>{
+  await select()
+  if(props.data!=null){
+    titleUploadData.value.dateOfManufacture=props.data.dateOfManufacture
+    titleUploadData.value.qualityGuaranteePeriod=props.data.qualityGuaranteePeriod
+    titleUploadData.value.producer=props.data.producer
+    titleUploadData.value.inventoryArea=props.data.inventoryArea
+    titleUploadData.value.inventoryQuantity=props.data.inventoryQuantity
+    titleUploadData.value.remarks=props.data.remarks
+    isDisabled=true
+  }else{
+    isDisabled=false
+    getStoreWork()
+  }
+
+
+})
+
+
+
+</script>
+
+<template>
+  <div  style="width: 100%;height: 100%">
+    <div class="order-primary" >
+      <el-row>
+        <el-col  :span="2"><el-text>{{$t('ingredientsStock.dateOfManufacture')}}:</el-text></el-col>
+        <el-col  :span="4">
+          <el-date-picker
+              :disabled="isDisabled"
+              v-model="titleUploadData.dateOfManufacture"
+              type="date"
+              format="YYYY-MM-DD"
+              value-format="YYYY-MM-DD"
+              :placeholder="$t('ingredientsStock.pleaseDateOfManufacture')"/>
+        </el-col>
+
+        <el-col  :span="2"><el-text>{{$t('ingredientsStock.qualityGuaranteePeriod')}}:</el-text></el-col>
+        <el-col  :span="3"><el-input v-model="titleUploadData.qualityGuaranteePeriod" /></el-col>
+        <el-col  :span="1"><el-text>{{$t('ingredientsStock.producer')}}:</el-text></el-col>
+        <el-col  :span="3"><el-input v-model="titleUploadData.producer" /></el-col>
+
+      </el-row>
+      <el-row>
+        <el-col  :span="2"><el-text>{{$t('ingredientsStock.inventoryOrganization')}}锛�</el-text></el-col>
+        <el-col  :span="4">
+          <el-select  :disabled="isDisabled" v-model="titleUploadData.inventoryOrganization"  clearable :placeholder="$t('processCard.pleaseSelect')"  >
+            <el-option
+                v-for="item in titleSelectJson['inventoryOrganization']"
+                :key="item.id"
+                :label="item.operateTypeName"
+                :value="item.operateTypeName"
+            />
+          </el-select>
+        </el-col>
+        <el-col  :span="2"><el-text>{{$t('productStock.inventoryArea')}}:</el-text></el-col>
+        <el-col  :span="3"><el-input v-model="titleUploadData.inventoryArea" /></el-col>
+        <el-col  :span="1"><el-text>{{$t('order.quantity')}}:</el-text></el-col>
+        <el-col  :span="3"><el-input  :disabled="isDisabled" v-model="titleUploadData.inventoryQuantity" /></el-col>
+        <el-col  :span="1"><el-text>{{$t('basicData.remarks')}}:</el-text></el-col>
+        <el-col  :span="3"><el-input v-model="titleUploadData.remarks" /></el-col>
+
+      </el-row>
+    </div>
+    <div>
+      <el-row v-if="props.type===1">
+        <el-select v-model="value" style="width: 200px" :placeholder="$t('ingredientsStock.pleaseSelectACategory')" @change="getStoreWork">
+          <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+          />
+        </el-select>
+      </el-row>
+    </div>
+    <div class="main-div-customers" style="height: 350px">
+      <vxe-grid
+          height="100%"
+          class="mytable-scrollbar"
+          ref="xGrids"
+          v-bind="gridOption"
+          v-on="gridEvent"
+
+      >
+        <template #num1_filter="{ column, $panel }">
+          <div>
+            <div v-for="(option, index) in column.filters" :key="index">
+              <input type="type" v-model="option.data" @keyup.enter.native="$panel.confirmFilter()" @input="changeFilterEvent($event, option, $panel)"/>
+            </div>
+          </div>
+        </template>
+
+
+        <template #content="{ row }">
+          <ul class="expand-wrapper">
+            <li  v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
+              <span style="font-weight: bold">{{item.title+':  '}}</span>
+              <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span>
+              <span v-else>{{ row[item.field] }}</span>
+            </li>
+          </ul>
+        </template>
+
+        <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+        <template #button_slot="{ row }">
+          <el-button @click="getTableRow(row,'edit')"
+                     link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
+          <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>
+        </template>
+
+
+      </vxe-grid>
+    </div>
+  </div>
+</template>
+
+<style scoped>
+.head{
+  width: 100%;
+  height: 35px;
+}
+
+.main-table{
+  width: 100%;
+  height: calc(100% - 35px);
+}
+.order-primary{
+  width: 100%;
+}
+.el-col{
+  margin-left: 15px;
+  margin-bottom: 5px;
+}
+</style>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/SelectIngredientsStock.vue b/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/SelectIngredientsStock.vue
index 046e2fa..aba5b0d 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/SelectIngredientsStock.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/ingredientStock/SelectIngredientsStock.vue
@@ -13,6 +13,8 @@
 import {divideAuto, multiply} from "@/utils/decimal";
 import companyInfo from "@/stores/sd/companyInfo";
 import footSum from "@/hook/footSum";
+import MaterialAddition from "@/views/mm/ingredientStock/MaterialAddition.vue"
+import SelectAlienEditor from "@/components/sd/order/SelectAlienEditor.vue";
 
 //璇█鑾峰彇
 const { t } = useI18n()
@@ -20,8 +22,11 @@
 const company = companyInfo()
 const router = useRouter()
 let produceList = ref([])
-let produceLists = ref([])
+let sheetIndex = ref(-1)
+let rowIndexData = ref(null)
+
 let dialogTableVisible = ref(false)
+let refMaterialAddition=ref()
 const getTableRow = (row,type) =>{
   switch (type) {
     case 'edit' :{
@@ -311,6 +316,7 @@
       {'code': 'out', 'name': t('ingredientsStock.materialOutbound'),status: 'primary'},
       {'code': 'add', 'name': t('ingredients.materialAddition'),status: 'primary'},
       {'code': 'delete', 'name': t('basicData.delete'),status: 'primary'},
+      {'code': 'update', 'name': t('淇敼'),status: 'primary'},
     ],
     /*import: false,
     export: true,
@@ -383,31 +389,26 @@
         }
         case 'add': {
           dialogTableVisible.value=true
-          select()
-          //绗竴娆″姞杞介粯璁�
-          value.value=t('ingredients.originalFilm')
-          filterData.value.type=t('ingredients.originalFilm')
-          request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
-            if(res.code==200){
-              gridOption.columns.splice(0,gridOption.columns.length)
-              BasicData.value = res.data
-              //娣诲姞鍒�
-              gridOption.columns=arr.slice()
-
-              for (let i=0;i<BasicData.value.length;i++){
-                let aa={field: BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}
-                gridOption.columns.push(aa)
-
-              }
-              getStoreWork()
-
-            }else{
-              ElMessage.warning(res.msg)
-            }
-          })
+          rowIndexData.value=null
+          sheetIndex.value=1
           break
+        }
+
+        case 'update': {
+
+          $grid.clearFilter()
+          const selectRecords = $grid.getCheckboxRecords()
+          if (selectRecords.length === 1) {
+            dialogTableVisible.value=true
+            rowIndexData.value=selectRecords[0]
+            sheetIndex.value=2
+          }else{
+            ElMessage.warning(t('productStock.unselectedData'))
+            return
+          }
 
 
+          break
         }
 
         case 'delete': {
@@ -446,7 +447,6 @@
                 }
               }
             }
-            console.log(selectRecords)
             let flowData = ref({
               materialInventory: selectRecords,
               ids: id,
@@ -472,243 +472,6 @@
   }
 }
 
-
-
-
-let arrs = [
-  { type: 'radio',fixed:"left", title: t('basicData.check'), width: '80' },
-  { type: 'seq',fixed:'left', title: t('basicData.Number'), width: '80' },
-  {field: 'id', width: '150',title: t('ingredients.materialCode'), sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}
-]
-
-const value = ref('')
-const options = [
-  {
-    value: t('ingredients.originalFilm'),
-    label: t('ingredients.originalFilm')
-  },
-  {
-    value: t('ingredients.accessories'),
-    label: t('ingredients.accessories'),
-  }
-]
-
-let filterDatas = ref({
-  type:''
-
-})
-let BasicDatas = ref([])
-let materialStores= ref([])
-
-//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
-const titleSelectJson = ref({
-  inventoryOrganization:""
-})
-
-// 瀹氫箟琛ㄥご涓婁紶鏁版嵁
-let titleUploadData = ref({
-  producer:'',
-  dateOfManufacture:'',
-  qualityGuaranteePeriod:'',
-  inventoryOrganization:'',
-  inventoryArea:'',
-  inventoryQuantity:'',
-  remarks:''
-})
-
-
-
-//鐗╂枡鏂板
-const xGrids = ref()
-const gridOption = reactive({
-  border:  "full",//琛ㄦ牸鍔犺竟妗�
-  keepSource: true,//淇濇寔婧愭暟鎹�
-  align: 'center',//鏂囧瓧灞呬腑
-  stripe:true,//鏂戦┈绾�
-  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
-  id: 'SelectIngredientsStocks',
-  showFooter: true,//鏄剧ず鑴�
-  printConfig: {},
-  importConfig: {},
-  exportConfig: {},
-  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
-  showOverflow:true,
-  columnConfig: {
-    resizable: true,
-    useKey: true
-  },
-  filterConfig: {   //绛涢�夐厤缃」
-    //remote: true
-  },
-  customConfig: {
-    storage: true
-  },
-  editConfig: {
-    trigger: 'click',
-    mode: 'row',
-    showStatus: true
-  },//琛ㄥご鍙傛暟
-  columns:[
-
-  ],//琛ㄥご鎸夐挳
-  toolbarConfig: {
-    buttons: [
-      {'code': 'add', 'name': t('basicData.save'),status: 'primary',icon: 'vxe-icon-save'},
-    ],
-  }
-
-})
-
-const select=() =>{
-  request.get(`/BasicWarehouse/BasicWarehouseTypes/`+t('ingredientsStock.inventoryOrganization')).then((res) => {
-
-    if(res.code==200){
-      titleSelectJson.value=deepClone(res.data)
-      titleUploadData.value.inventoryOrganization=titleSelectJson.value.inventoryOrganization[0].operateTypeName
-    }else{
-      ElMessage.warning(res.msg)
-    }
-  })
-}
-
-//鍒楁煡璇�
-const getStoreWork = () => {
-  filterDatas.value.type=value.value
-  request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
-    if(res.code==200){
-      gridOption.columns=[]
-      BasicData.value = res.data
-      //娣诲姞鍒�
-      gridOption.columns=arrs.slice()
-
-      for (let i=0;i<BasicData.value.length;i++){
-        let column={field: BasicData.value[i].OperateType,
-          width: '150',title: BasicData.value[i].OperateTypeName,
-          sortable: true,showOverflow:'ellipsis' ,
-          filters:[{ data: '' }],
-          slots: { filter: 'num1_filter' },
-          filterMethod:filterChanged}
-        gridOption.columns.push(column)
-
-      }
-      if(value.value==t('ingredients.accessories')){
-        titleUploadData.value.inventoryOrganization=titleSelectJson.value.inventoryOrganization[1].operateTypeName
-      }else{
-        titleUploadData.value.inventoryOrganization=titleSelectJson.value.inventoryOrganization[0].operateTypeName
-      }
-
-      getStoreWorks()
-
-    }else{
-      ElMessage.warning(res.msg)
-    }
-  })
-}
-
-//鏁版嵁缁戝畾
-const getStoreWorks = () => {
-  request.post(`/materialStore/getSelectMaterialStore`,filterDatas.value).then((res) => {
-
-    if(res.code==200){
-      materialStores.value=[]
-      for (let i=0;i<res.data.data.length;i++){
-        materialStores.value[i]=JSON.parse(res.data.data[i].json)
-        materialStores.value[i].id=(res.data.data[i].id)
-
-      }
-
-
-      produceLists = deepClone(materialStores.value)
-      xGrids.value.loadData(produceLists)
-      gridOption.loading=false
-    }else{
-      ElMessage.warning(res.msg)
-      router.push("/login")
-    }
-  })
-}
-
-
-const gridEvent = {
-  async toolbarButtonClick({code}) {
-    const $grid = xGrids.value
-    if ($grid) {
-      switch (code) {
-        case 'add': {
-          const selectRecords = $grid.getRadioRecord()
-          if (selectRecords == null) {
-            ElMessage.warning(t('productStock.unselectedData'))
-            return
-          }
-          const errMap = await $grid.validate(selectRecords)
-          if (errMap) {
-            ElMessage.warning(t('productStock.dataVerificationFailed'))
-            return
-          }
-          //琛ㄥご鏁版嵁鏍¢獙
-          const outboundType = titleUploadData.value.inventoryOrganization
-          if(outboundType === null || outboundType === undefined || outboundType === ''){
-            ElMessage.error(t('ingredientsStock.pleaseSelectInventoryOrganization'))
-            return
-          }
-          const materialRequisitionPersonnel = titleUploadData.value.inventoryQuantity
-          if(materialRequisitionPersonnel === null || materialRequisitionPersonnel === undefined || materialRequisitionPersonnel === ''){
-            ElMessage.error(t('ingredientsStock.pleaseEnterTheQuantity'))
-            return
-          }
-          const  dateOfManufacture= titleUploadData.value.dateOfManufacture
-          if(dateOfManufacture === null || dateOfManufacture === undefined || dateOfManufacture === ''){
-            titleUploadData.value.dateOfManufacture=null
-          }
-
-          /*const inventoryArea = titleUploadData.value.inventoryArea
-          if(inventoryArea === null || inventoryArea === undefined || inventoryArea === ''){
-            ElMessage.error("璇疯緭鍏ュ簱瀛樺尯鍩�")
-            return
-          }*/
-          let  flowData
-          if(selectRecords.height===undefined){
-              flowData = ref({
-
-              title: titleUploadData.value,
-              materialCode: selectRecords.id,
-              userName:userStore.user.userName,
-              userId:userStore.user.userId
-
-            })
-          }else{
-              flowData = ref({
-                totalArea: parseFloat(divideAuto(multiply(selectRecords.height,selectRecords.width),1000000,2))*titleUploadData.value.inventoryQuantity,
-                singlePieceArea: parseFloat(divideAuto(multiply(selectRecords.height,selectRecords.width),1000000,2)),
-              title: titleUploadData.value,
-              materialCode: selectRecords.id,
-              userName:userStore.user.userName,
-              userId:userStore.user.userId
-
-            })
-          }
-
-          console.log(flowData.value)
-
-          request.post("/materialInventory/saveMaterialInventory", flowData.value).then((res) => {
-            console.log(res)
-            if(res.code==200 && res.data==="true"){
-              ElMessage.success(t('basicData.msg.saveSuccess'))
-              router.push({path: '/main/ingredientsStock/SelectIngredientsStock', query:{random:Math.random()}})
-            }else if(res.data==="false1") {
-              ElMessage.warning("搴撳瓨瀛樺湪澶氭潯")
-            }else {
-              ElMessage.warning(t('basicData.msg.ServerConnectionError'))
-            }
-          })
-          break
-        }
-
-
-      }
-    }
-  }
-}
 
 
 const rowStyle = ({ row,rowIndex  }) => {
@@ -739,6 +502,7 @@
   }
 
 }
+
 
 
 </script>
@@ -825,75 +589,16 @@
     </div>
 
     <el-dialog v-model="dialogTableVisible" :title="$t('ingredients.materialAddition')" style="width: 70%;height:75% ">
-      <div class="order-primary" >
-        <el-row>
-          <el-col  :span="2"><el-text>{{$t('ingredientsStock.dateOfManufacture')}}:</el-text></el-col>
-          <el-col  :span="4">
-            <el-date-picker
-                v-model="titleUploadData.dateOfManufacture"
-                type="date"
-                format="YYYY-MM-DD"
-                value-format="YYYY-MM-DD"
-                :placeholder="$t('ingredientsStock.pleaseDateOfManufacture')"/>
-          </el-col>
-
-          <el-col  :span="2"><el-text>{{$t('ingredientsStock.qualityGuaranteePeriod')}}:</el-text></el-col>
-          <el-col  :span="3"><el-input v-model="titleUploadData.qualityGuaranteePeriod" /></el-col>
-          <el-col  :span="1"><el-text>{{$t('ingredientsStock.producer')}}:</el-text></el-col>
-          <el-col  :span="3"><el-input v-model="titleUploadData.producer" /></el-col>
-
-        </el-row>
-        <el-row>
-          <el-col  :span="2"><el-text>{{$t('ingredientsStock.inventoryOrganization')}}锛�</el-text></el-col>
-          <el-col  :span="4">
-            <el-select v-model="titleUploadData.inventoryOrganization"  clearable :placeholder="$t('processCard.pleaseSelect')"  >
-              <el-option
-                  v-for="item in titleSelectJson['inventoryOrganization']"
-                  :key="item.id"
-                  :label="item.operateTypeName"
-                  :value="item.operateTypeName"
-              />
-            </el-select>
-          </el-col>
-          <el-col  :span="2"><el-text>{{$t('productStock.inventoryArea')}}:</el-text></el-col>
-          <el-col  :span="3"><el-input v-model="titleUploadData.inventoryArea" /></el-col>
-          <el-col  :span="1"><el-text>{{$t('order.quantity')}}:</el-text></el-col>
-          <el-col  :span="3"><el-input v-model="titleUploadData.inventoryQuantity" /></el-col>
-          <el-col  :span="1"><el-text>{{$t('basicData.remarks')}}:</el-text></el-col>
-          <el-col  :span="3"><el-input v-model="titleUploadData.remarks" /></el-col>
-
-        </el-row>
-      </div>
-      <div>
-        <el-row>
-            <el-select v-model="value" style="width: 200px" :placeholder="$t('ingredientsStock.pleaseSelectACategory')" @change="getStoreWork">
-              <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-              />
-            </el-select>
-        </el-row>
-      </div>
-      <div class="main-div-customers" style="height: 350px">
-        <vxe-grid
-            height="100%"
-            class="mytable-scrollbar"
-            ref="xGrids"
-            v-bind="gridOption"
-            v-on="gridEvent"
-
-        >
-          <template #num1_filter="{ column, $panel }">
-            <div>
-              <div v-for="(option, index) in column.filters" :key="index">
-                <input type="type" v-model="option.data" @keyup.enter.native="$panel.confirmFilter()" @input="changeFilterEvent($event, option, $panel)"/>
-              </div>
-            </div>
-          </template>
-        </vxe-grid>
-      </div>
+      <material-addition v-if="sheetIndex===1" ref="refMaterialAddition" style="width: 100%;height: 100%"
+                         :data=rowIndexData :type=1
+                         :close-on-click-modal="false"
+                         :close-on-press-escape="false"
+      />
+      <material-addition v-if="sheetIndex===2" ref="refMaterialAddition" style="width: 100%;height: 100%"
+                         :data=rowIndexData :type=2
+                         :close-on-click-modal="false"
+                         :close-on-press-escape="false"
+      />
     </el-dialog>
   </div>
 </template>
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java
index dbe4b0e..d2796c9 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java
@@ -45,6 +45,7 @@
         return Result.seccess(materialInventoryService.saveMaterialInventory(object));
     }
 
+
     @ApiOperation("鐗╂枡搴撳瓨鍔犳椂闂存煡璇㈡帴鍙�")
     @SaCheckPermission("selectIngredientsStock.search")
     @PostMapping("/getSelectMaterialInventoryDate/{pageNum}/{pageSize}/{selectDate}")
@@ -216,5 +217,12 @@
 
     }
 
+    @ApiOperation("鐗╂枡搴撳瓨淇敼鎺ュ彛")
+    @SaCheckPermission("selectIngredientsStock.add")
+    @PostMapping("/updateMaterialInventory")
+    public Result updateMaterialInventory( @RequestBody Map<String,Object>  object){
+        return Result.seccess(materialInventoryService.updateMaterialInventory(object));
+    }
+
 
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java
index 80e57b1..ebdbc19 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java
@@ -271,4 +271,6 @@
     Map<String,Integer> getOptimizeOutboundReportTotal(Integer offset, Integer pageSize, String startDate, String endDate, MaterialLog materialLog, String type);
 
     List<Map<String,Object>> getSelectMaterialInventoryMes();
+
+    Boolean updateMaterialInventoryAll(@Param("materialInventoryId") Long materialInventoryId,@Param("materialInventory") MaterialInventory materialInventory);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java b/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
index b5e2954..e35ec42 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
@@ -1244,4 +1244,39 @@
 
     }
 
+
+    public String updateMaterialInventory(Map<String,Object> object) {
+        String saveState = "true";
+        //璁剧疆鍥炴粴鐐�
+        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
+        try {
+
+            long materialInventoryId = 0L;
+            if (object.get("materialInventoryId") != null) {
+                materialInventoryId = Long.parseLong(object.get("materialInventoryId").toString());
+            }
+            Log log = new Log();
+            log.setOperatorId(object.get("userId").toString());
+            log.setOperator(object.get("userName").toString());
+            log.setContent(object.toString());
+            log.setFunction("updateMaterialInventory鐗╂枡搴撳瓨淇敼");
+            MaterialInventory materialInventory = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), MaterialInventory.class);
+
+            materialInventoryMapper.updateMaterialInventoryAll(materialInventoryId,materialInventory);
+
+            logService.saveLog(log);
+        } catch (Exception e) {
+            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
+            //灏嗗紓甯镐紶鍏ユ暟鎹簱
+            SysError sysError = new SysError();
+            sysError.setError(e+Arrays.toString(e.getStackTrace()));
+            sysError.setFunc("saveMaterialInventory");
+            sysErrorService.insert(sysError);
+            saveState = "false";
+
+        }
+        return saveState;
+
+    }
+
 }
diff --git a/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml b/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
index 4f4bfc5..804b60f 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -1309,4 +1309,14 @@
         order by mi.id desc
     </select>
 
+    <update id="updateMaterialInventoryAll" >
+        update mm.material_inventory set date_of_manufacture=#{materialInventory.dateOfManufacture},
+                                         producer=#{materialInventory.producer},
+                                         quality_guarantee_period=#{materialInventory.qualityGuaranteePeriod},
+                                         inventory_area=#{materialInventory.inventoryArea},
+                                         remarks=#{materialInventory.remarks},
+                                         inventory_organization=#{materialInventory.inventoryOrganization}
+        where id=#{materialInventoryId}
+    </update>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0