From a8eaef6328ae594fcefc0371865001c9163f6873 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 19 三月 2024 09:22:25 +0800
Subject: [PATCH] 提交物料资料

---
 north-glass-erp/northglass-erp/src/lang/en.js                                                 |    4 
 north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml                                     |    2 
 north-glass-erp/src/main/java/com/example/erp/controller/mm/BasicWarehouseTypeController.java |   22 +
 north-glass-erp/northglass-erp/src/views/mm/mainIngredient/SelectIngredients.vue              |  321 +++++++++++++---
 north-glass-erp/northglass-erp/src/lang/zh.js                                                 |    4 
 north-glass-erp/target/classes/mapper/mm/MaterialStore.xml                                    |   57 +++
 north-glass-erp/northglass-erp/src/views/mm/mainProductStock/TakeOutRecord.vue                |   13 
 north-glass-erp/northglass-erp/src/views/mm/mainIngredient/CreateIngredients.vue              |  271 ++++++-------
 north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue                      |    2 
 north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml                                   |    2 
 north-glass-erp/target/classes/mapper/mm/BasicWarehouseType.xml                               |    8 
 north-glass-erp/src/main/java/com/example/erp/service/mm/BasicWarehouseTypeService.java       |   46 ++
 north-glass-erp/src/main/java/com/example/erp/entity/mm/MaterialStore.java                    |   20 +
 north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialService.java                 |  108 +++++
 north-glass-erp/src/main/java/com/example/erp/entity/mm/BasicWarehouseType.java               |    2 
 north-glass-erp/src/main/resources/mapper/mm/BasicWarehouseType.xml                           |    8 
 north-glass-erp/northglass-erp/src/views/pp/Replenish/SelectReplenish.vue                     |    3 
 north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml                               |    2 
 north-glass-erp/northglass-erp/src/views/mm/mainProductStock/ReworkRecord.vue                 |    8 
 north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java     |    2 
 north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialStoreMapper.java              |   32 +
 north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialController.java           |   61 +++
 north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml                                 |    2 
 north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java   |    8 
 north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue                       |    2 
 north-glass-erp/src/main/java/com/example/erp/mapper/mm/BasicWarehouseTypeMapper.java         |    2 
 north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml                                |   57 +++
 north-glass-erp/northglass-erp/src/views/mm/mainProductStock/StorageRecord.vue                |   13 
 north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml                       |    4 
 29 files changed, 852 insertions(+), 234 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/lang/en.js b/north-glass-erp/northglass-erp/src/lang/en.js
index e7fa3ae..f2bb309 100644
--- a/north-glass-erp/northglass-erp/src/lang/en.js
+++ b/north-glass-erp/northglass-erp/src/lang/en.js
@@ -303,6 +303,8 @@
         confirmOutbound:'Delivery Confirmation',
         confirmReceiptOfGoods:'Warehousing Confirmation',
         quantityToBeStockedIn:'Quantity To Be Stocked In',
+        return:'Return',
+        reverseReviewList:'Reverse Review List',
 
         receivedSuccessfully:'Successfully entered the warehouse',
         deliverySuccessful:"Successfully transferred out of warehouse ",
@@ -385,7 +387,7 @@
         customerName:"Customer",
         customerHomePage:'Customer Homepage',
         increaseCustomers:'Increase Customers',
-        resetting:'Resetting',
+        resetting:'Revoke',
 
     },
     delivery:{
diff --git a/north-glass-erp/northglass-erp/src/lang/zh.js b/north-glass-erp/northglass-erp/src/lang/zh.js
index 335dfce..7e197db 100644
--- a/north-glass-erp/northglass-erp/src/lang/zh.js
+++ b/north-glass-erp/northglass-erp/src/lang/zh.js
@@ -308,6 +308,8 @@
         confirmOutbound:'纭鍑哄簱',
         confirmReceiptOfGoods:'纭鍏ュ簱',
         quantityToBeStockedIn:'寰呭叆搴撴暟閲�',
+        return:'杩斿洖',
+        reverseReviewList:'鍙嶅鍒楄〃',
 
 
 
@@ -374,7 +376,7 @@
         totalArea:'鎬婚潰绉�',
         singlePieceArea:'鍗曠墖闈㈢Н',
         perimeter:'鍛ㄩ暱',
-        returnToWarehouse:'閫�鍥�',
+        returnToWarehouse:'鎾ら攢',
 
 
     },
diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/CreateIngredients.vue b/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/CreateIngredients.vue
index 2b8e08e..8b7adc6 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/CreateIngredients.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/CreateIngredients.vue
@@ -1,7 +1,18 @@
-<!-- 鐗╂枡璧勬枡鏂板鍘熺墖 -->
+
 
 <script lang="ts" setup>
-import {ref} from "vue";
+import request from "@/utils/request"
+import deepClone from "@/utils/deepClone"
+import {ElMessage} from "element-plus"
+import {computed, onMounted, ref} from "vue"
+import {useRoute, useRouter} from "vue-router"
+import  useUserInfo from "@/stores/userInfo"
+import GlassType from "@/components/sd/product/GlassType.vue"
+import useProductGlassTypeStore from "@/stores/sd/product/productGlassType"
+
+
+const router = useRouter()
+const route = useRoute()
 const value = ref('')
 const options = [
   {
@@ -13,6 +24,113 @@
     label: '杈呮枡',
   }
 ]
+
+let BasicData = ref([])
+
+let ruleForm = ref({
+  id:0,
+  type: '',
+  json: ''
+
+})
+
+const userinfo=[]
+
+
+
+
+
+const getWork = () => {
+  //椤甸潰鍔犺浇璇锋眰
+  request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
+    if(res.code==200){
+      BasicData.value = res.data
+      for (let i=0;i<BasicData.value.length;i++){
+        BasicData.value[i].Type=userinfo[i]
+      }
+
+    }else{
+      ElMessage.warning(res.msg)
+    }
+  })
+}
+
+const resetForm = () => {
+  BasicData.value.forEach((item)=>{
+    item.Type=""
+  })
+}
+
+const submitForm = () => {
+  let filterData = {}
+  let isBool=true
+  let index = 0
+  let productName = "{"
+
+  BasicData.value.forEach((item)=>{
+    filterData[item.OperateType]=item.Type
+    const customerName = item.Type
+    if(customerName === null || customerName === undefined || customerName === ''){
+      ElMessage.error('璇疯緭鍏�'+item.OperateTypeName)
+      isBool=false
+      return
+    }
+    if(index == BasicData.value.length - 1){
+      productName+='"'+item.OperateType+'":"'+item.Type+'"'
+    }else {
+      productName+='"'+item.OperateType+'":"'+item.Type+'",'
+    }
+    index++;
+  })
+  productName+="}"
+
+  let materialStore={
+    id:ruleForm.value.id,
+    type:value.value,
+    json:productName
+  }
+  console.log(materialStore)
+  if(isBool){
+    request.post("/Material/saveMaterialStore", materialStore).then((res) => {
+      if(res.code==200){
+        resetForm()
+        ElMessage.success('淇濆瓨鎴愬姛')
+      }else{
+        ElMessage.warning(res.msg)
+      }
+    })
+  }
+
+}
+
+
+onMounted(()=>{
+
+  //鑾峰彇浼犺繃鏉ョ殑鏁版嵁杩涜鍒ゆ柇
+  const str = route.query.id
+  if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){
+    ruleForm.value.id = Number(str)
+
+    request.post(`/Material/getSelectMaterialStore/1/100`,ruleForm.value).then((res) => {
+      if(res.code==200){
+        ruleForm.value=deepClone(res.data.data[0])
+        value.value=ruleForm.value.type
+        const cc= JSON.parse(ruleForm.value.json);
+        for (let i in cc){
+          userinfo.push(cc[i])
+        }
+        getWork()
+      }else{
+        ElMessage.warning(res.msg)
+        router.push("/login")
+      }
+    })
+  }
+
+
+})
+
+
 </script>
 <template>
 
@@ -22,7 +140,7 @@
 <div>
   <el-row>
   <el-col :span="4">
-    <el-select v-model="value" placeholder="璇烽�夋嫨绫诲埆">
+    <el-select v-model="value" placeholder="璇烽�夋嫨绫诲埆" @change="getWork">
       <el-option
           v-for="item in options"
           :key="item.value"
@@ -36,156 +154,23 @@
 
      <el-divider ></el-divider> <!-- 娣诲姞鍒嗛殧绾� -->
 
-     <el-row gutter="5" v-show="value=='鍘熺墖'" >
-       <el-col :span="4.5">
-        闀垮害 <el-input v-show="value=='鍘熺墖'" v-model="name" placeholder="璇疯緭鍏ラ暱搴�" style="width: 150px; height: 30px;" />
+     <el-row gutter="5"
+             v-for="item in BasicData" >
+       <el-col :span="4.5" >
+         {{item.OperateTypeName}}锛�<el-input v-model="item.Type"  placeholder="璇疯緭鍏ユ暟鎹�" style="width: 150px; height: 30px;" />
        </el-col>
-       <el-col :span="4.5">
-         鍘氬害 <el-input v-show="value=='鍘熺墖'"  v-model="name" placeholder="璇疯緭鍏ュ帤搴�" style="width: 150px; height: 30px;" />
-       </el-col>
-       <el-col :span="4.5">
-         瀹藉害 <el-input v-show="value=='鍘熺墖'" v-model="name" placeholder="璇疯緭鍏ュ搴�" style="width: 150px; height: 30px;" />
-       </el-col>
-<!--       <el-col :span="4">-->
-<!--         <el-dropdown>-->
-<!--           <el-button type="primary">-->
-<!--             鑶滅郴<el-icon class="el-icon&#45;&#45;right" style="width: 66px;"><arrow-down /></el-icon>-->
-<!--           </el-button>-->
-<!--           <template #dropdown>-->
-<!--             <el-dropdown-menu>-->
-<!--               <el-dropdown-item>闈為晙鑶�</el-dropdown-item>-->
-<!--               <el-dropdown-item>鍦ㄧ嚎LOW-E</el-dropdown-item>-->
-<!--               <el-dropdown-item>SUPPER-I</el-dropdown-item>-->
-<!--               <el-dropdown-item>SUPPER-I+</el-dropdown-item>-->
-<!--               <el-dropdown-item>SUPPER-II</el-dropdown-item>-->
-<!--               <el-dropdown-item>SUPPER-III</el-dropdown-item>-->
-<!--               <el-dropdown-item>SUPPER-V</el-dropdown-item>-->
-<!--               <el-dropdown-item>SUPPER-IA</el-dropdown-item>-->
-<!--               <el-dropdown-item>SUNLITE LOWE</el-dropdown-item>-->
-<!--               <el-dropdown-item>LOW-E40</el-dropdown-item>-->
-<!--               <el-dropdown-item>LOW-E40A</el-dropdown-item>-->
-<!--               <el-dropdown-item>LOW-E50</el-dropdown-item>-->
-<!--               <el-dropdown-item>LOW-E55N</el-dropdown-item>-->
-<!--             </el-dropdown-menu>-->
-<!--           </template>-->
-<!--         </el-dropdown>-->
-<!--       </el-col>-->
-     </el-row>
-     <el-divider ></el-divider> <!-- 娣诲姞鍒嗛殧绾� -->
-       <el-row gutter="5" v-show="value=='鍘熺墖'|| value=='杈呮枡'">
-       <el-col :span="4.5">
-         鍚嶇О <el-input  v-show="value=='鍘熺墖' || value=='杈呮枡'" v-model="productName" placeholder="璇疯緭鍏ュ悕绉�" style="width: 150px; height: 30px;" />
-       </el-col>
-         <el-col :span="4.5">
-           鏁伴噺 <el-input v-show="value=='鍘熺墖' || value=='杈呮枡'"  v-model="salId" placeholder="璇疯緭鍏ユ暟閲�" style="width: 150px; height: 30px;" />
-         </el-col>
-         <el-col :span="4.5">
-           鍗曚綅 <el-input v-model="name" placeholder="璇疯緭鍏ュ崟浣�" style="width: 150px; height: 30px;" />
-         </el-col>
-         <el-col :span="4.5">
-           鍨嬪彿<el-input v-model="name" placeholder="璇疯緭鍏ュ瀷鍙�" style="width: 150px; height: 30px;" />
-         </el-col>
-       </el-row>
-     <el-divider v-show="false" ></el-divider> <!-- 娣诲姞鍒嗛殧绾� -->
-<!--         <el-row gutter="5">-->
-<!--           <el-col span="4.5">-->
-<!--           <el-input v-model="name" placeholder="璇疯緭鍏ユ崲绠楀崟浣�" style="width: 150px; height: 30px;" />-->
-<!--           </el-col>-->
-<!--           <el-col :span="4.5">-->
-<!--             <el-input v-model="name" placeholder="璇疯緭鍏ユ崲绠楃巼" style="width: 150px; height: 30px;" />-->
-<!--           </el-col>-->
-<!--     </el-row>-->
-
-     <el-divider ></el-divider> <!-- 娣诲姞鍒嗛殧绾� -->
-
-     <el-row gutter="5">
-
-
+       <el-divider ></el-divider> <!-- 娣诲姞鍒嗛殧绾� -->
 
 
      </el-row>
 
-<!--     <el-divider ></el-divider> &lt;!&ndash; 娣诲姞鍒嗛殧绾� &ndash;&gt;-->
 
-<!--     <el-row gutter="5">-->
-<!--       <el-col :span="4.5">-->
-<!--         <el-input v-model="name" placeholder="璇疯緭鍏ュ瀷鍙�" style="width: 150px; height: 30px;" />-->
-<!--       </el-col>-->
-
-<!--       <el-col :span="4.5">-->
-<!--         <el-input v-model="name" placeholder="璇疯緭鍏ュ崟浣�" style="width: 150px; height: 30px;" />-->
-<!--       </el-col>-->
-<!--       <el-col :span="4">-->
-<!--         <el-dropdown>-->
-<!--           <el-button type="primary">-->
-<!--             浜у湴<el-icon class="el-icon&#45;&#45;right" style="width: 66px;"><arrow-down /></el-icon>-->
-<!--           </el-button>-->
-<!--           <template #dropdown>-->
-<!--             <el-dropdown-menu>-->
-<!--               <el-dropdown-item>鏆傛棤</el-dropdown-item>-->
-<!--             </el-dropdown-menu>-->
-<!--           </template>-->
-<!--         </el-dropdown>-->
-<!--       </el-col>-->
-<!--       <el-col :span="4">-->
-<!--         <el-dropdown>-->
-<!--           <el-button type="primary">-->
-<!--             涓被<el-icon class="el-icon&#45;&#45;right" style="width: 66px;"><arrow-down /></el-icon>-->
-<!--           </el-button>-->
-<!--           <template #dropdown>-->
-<!--             <el-dropdown-menu>-->
-<!--               <el-dropdown-item>0</el-dropdown-item>-->
-<!--             </el-dropdown-menu>-->
-<!--           </template>-->
-<!--         </el-dropdown>-->
-<!--       </el-col>-->
-<!--     </el-row>-->
-
-
-<!--     <el-divider ></el-divider> &lt;!&ndash; 娣诲姞鍒嗛殧绾� &ndash;&gt;-->
-
-<!--     <el-row gutter="5">-->
-
-
-<!--       <el-col :span="4.5">-->
-<!--         <el-input v-model="name" placeholder="璇疯緭鍏ュ娉�" style="width: 150px; height: 30px;" />-->
-<!--       </el-col>-->
-<!--       <el-col :span="4">-->
-<!--         <el-dropdown>-->
-<!--           <el-button type="primary">-->
-<!--             灏忕被<el-icon class="el-icon&#45;&#45;right" style="width: 66px;"><arrow-down /></el-icon>-->
-<!--           </el-button>-->
-<!--           <template #dropdown>-->
-<!--             <el-dropdown-menu>-->
-<!--               <el-dropdown-item>0</el-dropdown-item>-->
-<!--             </el-dropdown-menu>-->
-<!--           </template>-->
-<!--         </el-dropdown>-->
-<!--       </el-col>-->
-<!--     </el-row>-->
-
-<!--     <el-divider ></el-divider> &lt;!&ndash; 娣诲姞鍒嗛殧绾� &ndash;&gt;-->
-
-
-<!--     <el-row gutter="5">-->
-<!--&lt;!&ndash;       <el-col :span="4.5">&ndash;&gt;-->
-<!--&lt;!&ndash;         <el-input v-model="name" placeholder="璇疯緭鍏ヤ繚璐ㄦ湡" style="width: 150px; height: 30px;" />&ndash;&gt;-->
-<!--&lt;!&ndash;       </el-col>&ndash;&gt;-->
-<!--&lt;!&ndash;       <el-col :span="4.5">&ndash;&gt;-->
-<!--&lt;!&ndash;         <el-input v-model="name" placeholder="璇疯緭鍏ユ渶楂橀璀�" style="width: 150px; height: 30px;" />&ndash;&gt;-->
-<!--&lt;!&ndash;       </el-col>&ndash;&gt;-->
-<!--&lt;!&ndash;       <el-col :span="4.5">&ndash;&gt;-->
-<!--&lt;!&ndash;         <el-input v-model="name" placeholder="璇疯緭鍏ユ媶鍖呴璀�" style="width: 150px; height: 30px;" />&ndash;&gt;-->
-<!--&lt;!&ndash;       </el-col>&ndash;&gt;-->
-
-<!--     </el-row>-->
-<!--     <el-divider ></el-divider> &lt;!&ndash; 娣诲姞鍒嗛殧绾� &ndash;&gt;-->
      <el-row  gutter="10" justify="center" >
        <el-col span="4">
-         <el-button id="searchButton" type="primary" :icon="Search">鏌ヨ</el-button>
+         <el-button id="searchButton" type="primary" @click="resetForm" >閲嶇疆</el-button>
        </el-col>
        <el-col span="4">
-         <el-button id="searchButton" type="primary" :icon="Search">纭畾</el-button>
+         <el-button id="searchButton" type="primary" @click="submitForm" >淇濆瓨</el-button>
        </el-col>
      </el-row>
    </el-form>
diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/SelectIngredients.vue b/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/SelectIngredients.vue
index eb617c4..beff7f3 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/SelectIngredients.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainIngredient/SelectIngredients.vue
@@ -1,26 +1,231 @@
 <script setup>
 
-import {reactive} from "vue";
-import {useRouter} from  'vue-router'
-let router=useRouter()
+import request from "@/utils/request"
+import deepClone from "@/utils/deepClone"
+import {ElMessage} from "element-plus"
+import {computed, onMounted, reactive, ref} from "vue"
+import {useRoute, useRouter} from "vue-router"
+import {changeFilterEvent,filterChanged} from "@/hook"
+
+const router = useRouter()
+const route = useRoute()
+let produceList = ref([])
 const getTableRow = (row,type) =>{
   switch (type) {
     case 'edit' :{
-      //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
       router.push({path: '/main/ingredients/CreateIngredients', query: { id: row.id }})
-      break
+      return
     }
     case 'delete':{
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
-      break
+      let flowData = ref({
+        id: row.id
+      })
+      request.post("/Material/deleteMaterialStore",flowData.value).then((res) => {
+        if(res.code==200){
+          ElMessage.success("鍒犻櫎鎴愬姛")
+          router.push({path:'/main/ingredients/SelectIngredients',query:{random:Math.random()}})
+        }else{
+          ElMessage.warning(res.msg)
+          router.push("/login")
+        }
+      })
+      return
     }
   }
+}
+
+const value = ref('')
+const options = [
+  {
+    value: '鍘熺墖',
+    label: '鍘熺墖'
+  },
+  {
+    value: '杈呮枡',
+    label: '杈呮枡',
+  }
+]
+
+const hasDecimal=(value)=>{
+  const regex=/\./ // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+  return regex.test(value) //杩斿洖true/false
+}
+
+const hasDecimalhtml=(item,row)=>{
+  let aa=item.split('.').length
+  if (aa===2){
+    return row[item.split('.')[0]][item.split('.')[1]]
+  }else if(aa===3){
+    return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]]
+  }
+
+
+}
+
+let pageNum=ref(1)
+let total = reactive({
+  pageTotal : 0,
+  dataTotal : 0,
+  pageSize : 2
+})
+
+let filterData = ref({
+  type:''
+
+})
+let BasicData = ref([])
+
+let materialStore= ref([])
+
+let arr = [
+  {type:'expand',fixed:'left',slots: { content:'content' },width: '50'},
+  {title: '鎿嶄綔', width: '110', slots: { default: 'button_slot' },fixed:'left'},
+  { type: 'seq',fixed:'left', title: '鑷簭', width: '80' },
+  {field: 'id', width: '150',title: '鐗╂枡缂栫爜', sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}
+]
+
+/*//绗竴娆″姞杞介粯璁�
+value.value='鍘熺墖'
+filterData.value.type='鍘熺墖'
+request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
+  if(res.code==200){
+    gridOptions.columns.splice(0,gridOptions.columns.length)
+    console.log(res.data)
+    BasicData.value = res.data
+    //娣诲姞鍒�
+    gridOptions.columns=arr
+
+    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}
+      console.log(gridOptions.columns)
+      gridOptions.columns.push(aa)
+
+    }
+    getWorks()
+
+  }else{
+    ElMessage.warning(res.msg)
+  }
+})*/
+
+
+//鍒楁煡璇�
+const getWork = () => {
+  filterData.value.type=value.value
+  request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
+    if(res.code==200){
+      gridOptions.columns=[]
+      BasicData.value = res.data
+      //娣诲姞鍒�
+      gridOptions.columns=arr.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}
+
+         gridOptions.columns.push(column)
+
+      }
+      getWorks()
+
+    }else{
+      ElMessage.warning(res.msg)
+    }
+  })
+}
+
+
+//鏁版嵁缁戝畾
+const getWorks = () => {
+  console.log(filterData.value)
+  request.post(`/Material/getSelectMaterialStore/1/${total.pageSize}`,filterData.value).then((res) => {
+
+    if(res.code==200){
+      console.log(res.data.data)
+      materialStore.value=[]
+      for (let i=0;i<res.data.data.length;i++){
+        materialStore.value[i]= JSON.parse(res.data.data[i].json)
+        materialStore.value[i].id= res.data.data[i].id
+      }
+      console.log(materialStore)
+
+      total.dataTotal = res.data.total.total*1
+      total.pageTotal= res.data.total.pageTotal
+      pageNum.value=1
+
+      produceList = deepClone(materialStore.value)
+      xGrid.value.loadData(produceList)
+      gridOptions.loading=false
+    }else{
+      ElMessage.warning(res.msg)
+      router.push("/login")
+    }
+  })
+}
+
+//鍒嗛〉鏌ヨ
+const getWorkPaging = () => {
+  console.log(filterData.value)
+  request.post(`/Material/getSelectMaterialStore/${pageNum.value}/${total.pageSize}`,filterData.value).then((res) => {
+
+    if(res.code==200){
+      console.log(res.data.data)
+      materialStore.value=[]
+      for (let i=0;i<res.data.data.length;i++){
+        materialStore.value[i]= JSON.parse(res.data.data[i].json)
+        materialStore.value[i].id= res.data.data[i].id
+      }
+
+      produceList = deepClone(materialStore.value)
+      xGrid.value.loadData(produceList)
+      gridOptions.loading=false
+    }else{
+      ElMessage.warning(res.msg)
+      router.push("/login")
+    }
+  })
+}
+
+//鍒嗛〉鏌ヨ
+const selectOrderList = ()=>{
+  filterData.value.type=value.value
+  request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
+    if(res.code==200){
+      gridOptions.columns.splice(0,gridOptions.columns.length)
+      console.log(res.data)
+      BasicData.value = res.data
+      //娣诲姞鍒�
+      gridOptions.columns=arr
+
+      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}
+        console.log(gridOptions.columns)
+        gridOptions.columns.push(aa)
+
+      }
+      getWorkPaging()
+
+    }else{
+      ElMessage.warning(res.msg)
+    }
+  })
+}
+//椤佃剼璺宠浆
+const handlePageChange = ({ currentPage, pageSize }) => {
+  total.pageTotal = pageSize
+  pageNum.value=currentPage
+
+  selectOrderList();
 }
 
 
 
 //瀛愮粍浠舵帴鏀跺弬鏁�
-
+const xGrid = ref()
 const gridOptions = reactive({
   border:  "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
@@ -39,7 +244,7 @@
     useKey: true
   },
   filterConfig: {   //绛涢�夐厤缃」
-    remote: true
+    //remote: true
   },
   customConfig: {
     storage: true
@@ -50,25 +255,9 @@
     showStatus: true
   },//琛ㄥご鍙傛暟
   columns:[
-    {type:'expand',fixed:"left",slots: { content:'content' },width: '50'},
-    // { type: 'checkbox',fixed:"left", title: '閫夋嫨', width: '80' },
-    {title: '鎿嶄綔', width: '110', slots: { default: 'button_slot' },fixed:"left"},
-    { type: 'seq',fixed:"left", title: '鑷簭', width: '80' },
-    {field: 'materialCode', width:'150', title: '鐗╂枡缂栫爜', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } } },
-    {field: 'materialName', width: '150',title: '鐗╂枡鍚嶇О', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'origin', width: '120',title: '浜у湴', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'width', width: '100',title: '瀹藉害', sortable: true},
-    {field: 'height',width: '100', title: '楂樺害', sortable: true,showOverflow:"ellipsis"},
-    {field: 'thickness', width: '80',title: '鍘氬害', sortable: true},
-    {field: 'model',width: '100', title: '鍨嬪彿', sortable: true},
-    {field: 'conversionRate', width: '100',title: '鎹㈢畻鐜�', sortable: true},
-    {field: 'unit',width: '100', title: '鍗曚綅', sortable: true},
-    {field: 'conversionUnit', width: '80',title: '鎹㈢畻鍗曚綅', sortable: true},
-    {field: 'shelfLife',width: '100', title: '淇濊川鏈�', sortable: true},
-    {field: 'weight', width: '100',title: ' 閲嶉噺', sortable: true},
-    {field: 'quantity',width: '110', title: '鏁伴噺', sortable: true},
-    {field: 'inventoryOrganization',width: '100', title: '搴撳瓨缁勭粐', sortable: true},
-    {field: 'remark',width: '80', title: '澶囨敞', sortable: true},
+
+
+
 
   ],//琛ㄥご鎸夐挳
   toolbarConfig: {
@@ -79,51 +268,13 @@
     zoom: true,
     custom: true
   },
-  data:  [
-    {
-      "materialCode": 700900000000941,
-      "materialName": "涓濊闃叉檼鎵嬪濂楄",
-      "origin": "00",
-      "width": "00",
-      "height": "00",
-      "thickness":'00',
-      "model": "鏈嶉グ",
-      "conversionRate": "1000",
-      "unit": "鍙�",
-      "conversionUnit": "1",
-      "shelfLife": "12涓湀",
-      "weight": "0.0000",
-      "quantity": "10000",
-      "inventoryOrganization": "浜哄伐搴�",
-      "remark": "娴嬭瘯",
-    },
-    {
-      "materialCode": 700900000000941,
-      "materialName": "涓濊闃叉檼鎵嬪濂楄",
-      "origin": "00",
-      "width": "00",
-      "height": "00",
-      "thickness":'00',
-      "model": "鏈嶉グ",
-      "conversionRate": "1000",
-      "unit": "鍙�",
-      "conversionUnit": "1",
-      "shelfLife": "12涓湀",
-      "weight": "0.0000",
-      "quantity": "10000",
-      "inventoryOrganization": "浜哄伐搴�",
-      "remark": "娴嬭瘯",
-    },
-  ],//table body瀹為檯鏁版嵁
   footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
     return[
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return '鍚堣:'
         }
-        // if (props.tableProp.footList.includes(column.field)) {
-        //   return sumNum(data, column.field)
-        // }
+
         return ''
       })
     ]
@@ -136,22 +287,39 @@
 </script>
 
 <template>
+
+
   <div class="main-div-customer">
+    <div>
+      <el-row>
+        <el-col :span="4">
+          <el-select v-model="value" placeholder="璇烽�夋嫨绫诲埆" @change="getWork">
+            <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+            />
+          </el-select>
+        </el-col>
+      </el-row>
+    </div>
+
+
     <vxe-grid
         max-height="100%"
-        @filter-change="filterChanged"
         class="mytable-scrollbar"
         ref="xGrid"
         v-bind="gridOptions"
 
     >
       <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
-      <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
       <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>{{ row[item.field] }}</span>
+            <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span>
+            <span v-else>{{ row[item.field] }}</span>
           </li>
         </ul>
       </template>
@@ -170,6 +338,19 @@
         </div>
       </template>
 
+      <template #pager>
+        <!--浣跨敤 pager 鎻掓Ы-->
+        <vxe-pager
+            @page-change="handlePageChange"
+            :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
+            v-model:current-page="pageNum"
+            v-model:page-size="total.pageSize"
+            v-model:pager-count="total.pageTotal"
+            :total="total.dataTotal"
+        >
+        </vxe-pager>
+      </template>
+
 
     </vxe-grid>
   </div>
diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/ReworkRecord.vue b/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/ReworkRecord.vue
index 2364204..8074e2a 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/ReworkRecord.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/ReworkRecord.vue
@@ -210,6 +210,9 @@
   ],//琛ㄥご鎸夐挳
   toolbarConfig: {
     buttons: [{
+      'name': t('productStock.return'), status:"info" ,icon: 'vxe-icon-undo',
+      'code':'return'
+    },{
       'name': t('basicData.cancelReview'),status: 'primary',
       'code':'add'
     }],
@@ -268,7 +271,10 @@
           return;
 
         }
-
+        case 'return': {
+          router.go(-1)
+          return
+        }
 
       }
     }
diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/StorageRecord.vue b/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/StorageRecord.vue
index d980d64..cc698d8 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/StorageRecord.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/StorageRecord.vue
@@ -221,6 +221,10 @@
   toolbarConfig: {
     buttons: [
       {
+        'name': t('productStock.return'), status:"info" ,icon: 'vxe-icon-undo',
+        'code':'return'
+      },
+      {
         'name': t('productStock.returnToWarehouse'),status: 'primary',
         'code':'cancel'
       }],
@@ -259,6 +263,10 @@
           if ($table) {
             const selectRecords = $table.getCheckboxRecords()
 
+            if (selectRecords.length <= 0) {
+              ElMessage.warning(t('productStock.unselectedData'))
+              return
+            }
             let flowData = ref({
 
               userId:userid,
@@ -281,7 +289,10 @@
           return;
 
         }
-
+        case 'return': {
+          router.go(-1)
+          break
+        }
 
       }
     }
diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/TakeOutRecord.vue b/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/TakeOutRecord.vue
index aa39057..108b0d2 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/TakeOutRecord.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainProductStock/TakeOutRecord.vue
@@ -207,12 +207,17 @@
     {field: 'remarks', width: '140',title: t('productStock.remarks'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
   ],//琛ㄥご鎸夐挳
   toolbarConfig: {
-    buttons: [{
+    buttons: [
+      {
+        'name': t('productStock.return'), status:"info" ,icon: 'vxe-icon-undo',
+        'code':'return'
+      },
+      {
       'name': t('basicData.review'),status: 'primary',
       'code':'add'
     },
       {
-        'name': t('basicData.cancelReview'),status: 'primary',
+        'name': t('productStock.reverseReviewList'),status: 'primary',
         'code':'rework'
       },
       {
@@ -278,6 +283,10 @@
           router.push({path: '/main/productStock/ReworkRecord'});
           return
         }
+        case 'return': {
+          router.go(-1)
+          break
+        }
         case 'cancel': {
           const $table = xGrid.value
           //gridOptions.columns.unshift(a)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/Replenish/SelectReplenish.vue b/north-glass-erp/northglass-erp/src/views/pp/Replenish/SelectReplenish.vue
index f79fe94..35ff20b 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/Replenish/SelectReplenish.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/Replenish/SelectReplenish.vue
@@ -73,6 +73,7 @@
   }
 })
 
+
 //琛ㄥ熬姹傚拰
 const sumNum = (list, field) => {
   let count = 0
@@ -205,7 +206,7 @@
               }
             })
           }
-          return;
+          return
 
         }
 
diff --git a/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue b/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue
index 92cb34b..38d855f 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue
@@ -43,7 +43,7 @@
       request.post("/customer/deleteCustomer", flowData.value).then((res) => {
         if(res.code==200){
           ElMessage.success("鍒犻櫎鎴愬姛")
-          location.reload();
+          router.push({path:'/main/customer/selectCustomer',query:{random:Math.random()}})
         }else{
           ElMessage.warning(res.msg)
           router.push("/login")
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
index f97e9a1..3477fe7 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
@@ -317,7 +317,7 @@
       </template>
 
       <template #state="{ row,column}">
-        <el-checkbox @click.native.prevent  :checked="row[column.field]===2"/>
+        <el-checkbox @click.native.prevent :indeterminate="row[column.field]===1" :checked="row[column.field]===2"/>
       </template>
 
       <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/mm/BasicWarehouseTypeController.java b/north-glass-erp/src/main/java/com/example/erp/controller/mm/BasicWarehouseTypeController.java
new file mode 100644
index 0000000..116806b
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/mm/BasicWarehouseTypeController.java
@@ -0,0 +1,22 @@
+package com.example.erp.controller.mm;
+
+import com.example.erp.common.Result;
+import com.example.erp.service.mm.BasicWarehouseTypeService;
+import com.example.erp.service.sd.BasicDateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/BasicWarehouse")
+public class BasicWarehouseTypeController {
+    @Autowired
+    BasicWarehouseTypeService basicWarehouseTypeService;
+    @GetMapping("/BasicWarehouseType/{type}")
+    public Result getBasicWarehouseType(@PathVariable String type){
+        return Result.seccess(basicWarehouseTypeService.getBasicWarehouseType(type));
+    }
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialController.java b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialController.java
new file mode 100644
index 0000000..912d9e8
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialController.java
@@ -0,0 +1,61 @@
+package com.example.erp.controller.mm;
+
+
+import com.example.erp.common.Constants;
+import com.example.erp.common.Result;
+import com.example.erp.entity.mm.FinishedGoodsInventory;
+import com.example.erp.entity.mm.FinishedOperateLog;
+import com.example.erp.entity.mm.MaterialStore;
+import com.example.erp.entity.pp.FlowCard;
+import com.example.erp.entity.sd.Customer;
+import com.example.erp.entity.sd.OrderDetail;
+import com.example.erp.exception.ServiceException;
+import com.example.erp.service.mm.FinishedGoodsInventoryService;
+import com.example.erp.service.mm.MaterialService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/Material")
+@Api(value="鐗╂枡controller",tags={"鐗╂枡鎿嶄綔鎺ュ彛"})
+public class MaterialController {
+    @Autowired
+    MaterialService faterialService;
+
+    @ApiOperation("鐗╂枡鏂板鎺ュ彛")
+    @PostMapping("/saveMaterialStore")
+    public Result saveMaterialStore( @RequestBody Map<String,Object>  object){
+        if(faterialService.saveMaterialStore(object)){
+            return Result.seccess();
+        }else {
+            throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触");
+
+        }
+    }
+
+    @ApiOperation("鐗╂枡鏌ヨ鎺ュ彛")
+    @PostMapping("/getSelectMaterialStore/{pageNum}/{pageSize}")
+    public Result getSelectMaterialStore(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialStore materialStore){
+        return Result.seccess(faterialService.getSelectMaterialStore(pageNum,pageSize,materialStore));
+    }
+
+    @ApiOperation("鐗╂枡鍒犻櫎鎺ュ彛")
+    @PostMapping("/deleteMaterialStore")
+    public Result deleteMaterialStore( @RequestBody Map<String,Object>  object){
+        if(faterialService.deleteMaterialStore(object)){
+
+            return Result.seccess();
+
+        }else {
+            throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触");
+
+        }
+    }
+
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/mm/BasicWarehouseType.java b/north-glass-erp/src/main/java/com/example/erp/entity/mm/BasicWarehouseType.java
index 22318a2..454c893 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/mm/BasicWarehouseType.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/mm/BasicWarehouseType.java
@@ -14,7 +14,9 @@
     private Integer operateTypeId;
     private String operateTypeName;
     private String operateType;
+    private String type;
     private LocalDate createTime;
 
 
+
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/mm/MaterialStore.java b/north-glass-erp/src/main/java/com/example/erp/entity/mm/MaterialStore.java
new file mode 100644
index 0000000..d0fd4f4
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/mm/MaterialStore.java
@@ -0,0 +1,20 @@
+package com.example.erp.entity.mm;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.time.LocalDate;
+
+@Data
+public class MaterialStore {
+    @TableId(type = IdType.AUTO)
+
+    private Long id;
+    private String type;
+    private String json;
+    private LocalDate createTime;
+
+
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/BasicWarehouseTypeMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/BasicWarehouseTypeMapper.java
index 1f55f5e..5de372d 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/BasicWarehouseTypeMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/BasicWarehouseTypeMapper.java
@@ -15,5 +15,7 @@
 
     List<BasicWarehouseType> getBasicWarehouseTypeRework();
 
+    List<BasicWarehouseType> getBasicWarehouseType(String type);
+
 
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
index 52acccc..5f7eccf 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
@@ -41,6 +41,8 @@
 
     Integer findOrderNumberdsum(String orderId);
 
+    Integer findOrderDeliveryQuantitySum(String orderId);
+
     Integer findDeliveryQuantity(String deliveryId);
 
     Integer findDeliverydetailsum(String deliveryId,Integer deliveryDetailState);
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialStoreMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialStoreMapper.java
new file mode 100644
index 0000000..06ea450
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialStoreMapper.java
@@ -0,0 +1,32 @@
+package com.example.erp.mapper.mm;
+
+import com.example.erp.entity.mm.BasicWarehouseType;
+import com.example.erp.entity.mm.MaterialStore;
+import com.example.erp.entity.pp.FlowCard;
+import com.example.erp.entity.sd.Customer;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.repository.CrudRepository;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface MaterialStoreMapper extends CrudRepository<MaterialStore,Long> {
+
+    List<MaterialStore> getSelectMaterialStore(@Param("offset") Integer offset,
+                                     @Param("pageSize") Integer pageSize,
+                                     @Param("materialStore") MaterialStore materialStore);
+
+
+    Map<String,Integer> getSelectMaterialStorePageTotal(Integer offset, Integer pageSize, MaterialStore materialStore);
+
+    Boolean insertMaterialStore(@Param("type") String type,
+                                         @Param("json") String json);
+
+    Boolean updateMaterialStore(@Param("type") String type,
+                                @Param("json") String json, @Param("id") Long id);
+
+    Boolean deleteMaterialStore(@Param("id") Long id);
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/mm/BasicWarehouseTypeService.java b/north-glass-erp/src/main/java/com/example/erp/service/mm/BasicWarehouseTypeService.java
new file mode 100644
index 0000000..5d02f01
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/service/mm/BasicWarehouseTypeService.java
@@ -0,0 +1,46 @@
+package com.example.erp.service.mm;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.erp.entity.mm.BasicWarehouseType;
+import com.example.erp.entity.sd.BasicData;
+import com.example.erp.entity.sd.Customer;
+import com.example.erp.mapper.mm.BasicWarehouseTypeMapper;
+import com.example.erp.mapper.sd.BasicDateMapper;
+import com.example.erp.mapper.sd.CustomerMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@DS("sd")
+public class BasicWarehouseTypeService {
+    @Autowired
+    private BasicWarehouseTypeMapper basicWarehouseTypeMapper;
+
+    public List<Map<String, Object>> getBasicWarehouseType(String type){
+        List<Map<String, Object>> Result=new ArrayList<Map<String, Object>>();
+
+        List<BasicWarehouseType> basicWarehouseType=basicWarehouseTypeMapper.getBasicWarehouseType(type);
+        for (BasicWarehouseType item : basicWarehouseType){
+            Map<String, Object> map = new HashMap<>();
+
+            map.put("OperateTypeId",item.getOperateTypeId());
+            map.put("OperateTypeName",item.getOperateTypeName());
+            map.put("OperateType",item.getOperateType());
+            map.put("Type","");
+
+            Result.add(map) ;
+        }
+        return Result;
+        /*Map<String, Object> map = new HashMap<>();
+        map.put("type", basicWarehouseTypeMapper.getBasicWarehouseType(type));
+        return map;*/
+
+    }
+
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java b/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
index cfc4f0f..844c86d 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
@@ -167,9 +167,9 @@
                     finishedOperateLogMapper.insertOutFinishedOperateLog(orderDetail,userName,oddNumber);
                     Integer finishedGoodsInventorycount = finishedGoodsInventoryMapper.findOrderNumberdcount(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber());
 
-                    Integer finishedGoodsInventorybycount=finishedGoodsInventoryMapper.finishedGoodsInventorybycount(orderDetail.getDeliveryDetail().getOrderId(),orderDetail.getDeliveryDetail().getOrderNumber());
+                    
                     Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(orderDetail.getDeliveryDetail().getOrderId());
-                    Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(orderDetail.getDeliveryDetail().getOrderId());
+                    Integer orderDeliveryQuantitySum = finishedGoodsInventoryMapper.findOrderDeliveryQuantitySum(orderDetail.getDeliveryDetail().getOrderId());
 
                     Integer deliverysum = finishedGoodsInventoryMapper.findDeliveryQuantity(orderDetail.getDeliveryDetail().getDeliveryId());
                     Integer deliverydetailsum = finishedGoodsInventoryMapper.findDeliverydetailsum(orderDetail.getDeliveryDetail().getDeliveryId(),0);
@@ -177,7 +177,7 @@
                         deliverydetailsum=0;
                     }
 
-                    System.out.println("璁㈠崟鎬绘暟:" + ordersum + "璁㈠崟鍓╀綑鏁伴噺锛�" + ordernumbersum + "鍑嗗鍑哄簱鏁伴噺" +
+                    System.out.println("璁㈠崟鎬绘暟:" + ordersum + "璁㈠崟宸插彂鏁伴噺锛�" + orderDeliveryQuantitySum + "鍑嗗鍑哄簱鏁伴噺" +
                             orderDetail.getWarehouseNum()+ "鍙戣揣鏁伴噺" + orderDetail.getDeliveryDetail().getQuantity()+ "鍙戣揣鎬绘暟" +
                             deliverysum+ "宸插彂鏁伴噺" + deliverydetailsum);
                     if (finishedGoodsInventorycount > 0) {
@@ -193,7 +193,7 @@
                             //淇敼璁㈠崟琛ㄥ彂璐х姸鎬�
                             finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),1);
                             //鍒ゆ柇璁㈠崟鏄惁鍏ㄩ儴鍙戣揣
-                            if (0 == (ordernumbersum - orderDetail.getWarehouseNum())) {
+                            if (ordersum == (orderDeliveryQuantitySum + orderDetail.getWarehouseNum())) {
                                 //淇敼璁㈠崟琛ㄥ彂璐х姸鎬�
                                 finishedGoodsInventoryMapper.updateOrderDeliveryState(orderDetail.getDeliveryDetail().getOrderId(),2);
                             }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialService.java b/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialService.java
new file mode 100644
index 0000000..9c7b114
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialService.java
@@ -0,0 +1,108 @@
+package com.example.erp.service.mm;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.erp.entity.mm.FinishedGoodsInventory;
+import com.example.erp.entity.mm.FinishedOperateLog;
+import com.example.erp.entity.mm.MaterialStore;
+import com.example.erp.entity.pp.FlowCard;
+import com.example.erp.entity.sd.Customer;
+import com.example.erp.entity.sd.OrderDetail;
+import com.example.erp.entity.sd.Product;
+import com.example.erp.entity.userInfo.SysError;
+import com.example.erp.mapper.mm.BasicWarehouseTypeMapper;
+import com.example.erp.mapper.mm.FinishedGoodsInventoryMapper;
+import com.example.erp.mapper.mm.FinishedOperateLogMapper;
+import com.example.erp.mapper.mm.MaterialStoreMapper;
+import com.example.erp.service.userInfo.SysErrorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.util.*;
+
+@Service
+@DS("mm")
+@Transactional(rollbackFor = Exception.class)
+public class MaterialService {
+    @Autowired
+    MaterialStoreMapper materialStoreMapper;
+    @Autowired
+    BasicWarehouseTypeMapper basicWarehouseTypeMapper;
+    @Autowired
+    SysErrorService sysErrorService;
+
+    public Boolean saveMaterialStore(Map<String,Object> object) {
+        boolean saveState = true;
+            String id = "";
+            String type = "";
+            String json = "";
+            if (object.get("id") != null) {
+                id = object.get("id").toString();
+            }
+            if (object.get("type") != null) {
+                type = object.get("type").toString();
+            }
+            if (object.get("json") != null) {
+                json = object.get("json").toString();
+            }
+            if(Long.parseLong(id)>0){
+                materialStoreMapper.updateMaterialStore(type,json, Long.valueOf(id));
+            }else{
+                materialStoreMapper.insertMaterialStore(type,json);
+            }
+
+        return saveState;
+
+    }
+
+    public Map<String, Object> getSelectMaterialStore(Integer pageNum, Integer pageSize, MaterialStore materialStore) {
+        Integer offset = (pageNum - 1) * pageSize;
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", materialStoreMapper.getSelectMaterialStore(offset, pageSize, materialStore));
+        map.put("total", materialStoreMapper.getSelectMaterialStorePageTotal(offset, pageSize, materialStore));
+        return map;
+    }
+
+    public Boolean deleteMaterialStore(Map<String,Object> object) {
+        boolean saveState = true;
+        //璁剧疆鍥炴粴鐐�
+        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
+        try {
+            String id = "";
+            if (object.get("id") != null) {
+                id = object.get("id").toString();
+            }
+            if(id!=null){
+                materialStoreMapper.deleteMaterialStore(Long.valueOf(id));
+            }
+
+
+
+        } catch (Exception e) {
+            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
+            //灏嗗紓甯镐紶鍏ユ暟鎹簱
+            SysError sysError = new SysError();
+            sysError.setError(e.toString());
+            sysError.setFunc("saveOrder");
+            sysErrorService.insert(sysError);
+            saveState = false;
+
+        }
+        return saveState;
+
+    }
+
+
+
+
+
+
+
+
+}
diff --git a/north-glass-erp/src/main/resources/mapper/mm/BasicWarehouseType.xml b/north-glass-erp/src/main/resources/mapper/mm/BasicWarehouseType.xml
index 7bdf911..93dc77b 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/BasicWarehouseType.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/BasicWarehouseType.xml
@@ -5,11 +5,15 @@
 <mapper namespace="com.example.erp.mapper.mm.BasicWarehouseTypeMapper">
 
     <select id="getBasicWarehouseTypeTakeOut" >
-        select * from mm.basic_warehouse_type where operate_type='棰嗗嚭';
+        select * from mm.basic_warehouse_type where type='棰嗗嚭';
     </select>
 
     <select id="getBasicWarehouseTypeRework" >
-        select * from mm.basic_warehouse_type where operate_type='杩斿伐';
+        select * from mm.basic_warehouse_type where type='杩斿伐';
+    </select>
+
+    <select id="getBasicWarehouseType" >
+        select * from mm.basic_warehouse_type where type=#{type};
     </select>
 
 
diff --git a/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml b/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
index d380c35..7448fbc 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
@@ -428,6 +428,10 @@
         select sum(warehouse_num) from sd.order_detail where order_id=#{orderId}
     </select>
 
+    <select id="findOrderDeliveryQuantitySum"  >
+        select sum(delivery_num) from sd.order_detail where order_id=#{orderId}
+    </select>
+
     <select id="findDeliveryQuantity" >
         select quantity from sd.`delivery`  where delivery_id=#{deliveryId}
     </select>
diff --git a/north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml b/north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml
new file mode 100644
index 0000000..4911316
--- /dev/null
+++ b/north-glass-erp/src/main/resources/mapper/mm/MaterialStore.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.example.erp.mapper.mm.MaterialStoreMapper">
+
+    <select id="getSelectMaterialStore">
+        select
+        *
+        from
+        mm.material_store m
+        <where>
+            <if test="materialStore.id != null and materialStore.id != ''">
+                and m.id regexp #{materialStore.id}
+            </if>
+            <if test="materialStore.type != null and materialStore.type != ''">
+                and m.type regexp #{materialStore.type}
+            </if>
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectMaterialStorePageTotal">
+        select
+        CEILING(count(id)/#{pageSize}) as 'pageTotal',
+        count(id) as 'total'
+        from
+        mm.material_store m
+        <where>
+            <if test="materialStore.id != null and materialStore.id != ''">
+                and m.id regexp #{materialStore.id}
+            </if>
+
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <insert id="insertMaterialStore"  useGeneratedKeys="true"  >
+        insert into mm.material_store (type,json,create_time
+        )
+        values (
+                   #{type},#{json},now()
+               )
+    </insert>
+
+    <update id="updateMaterialStore" >
+        update mm.material_store set json=#{json} where id=#{id}
+    </update>
+
+    <delete id="deleteMaterialStore" >
+        delete from mm.material_store where id=#{id}
+    </delete>
+
+
+
+
+</mapper>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml b/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
index 01afd6b..6ed4567 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -147,7 +147,7 @@
                  left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                            on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
 
-        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.quality_ins_status=1))
+        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.quality_ins_status!=1))
         order by dd.id desc
     </select>
 
diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml b/north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml
index e9b248d..d065c29 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml
@@ -97,7 +97,7 @@
                  left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                            on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
 
-        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.quality_ins_status=1 order by dd.id
+        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 order by dd.id
 
     </select>
 
diff --git a/north-glass-erp/target/classes/mapper/mm/BasicWarehouseType.xml b/north-glass-erp/target/classes/mapper/mm/BasicWarehouseType.xml
index 7bdf911..93dc77b 100644
--- a/north-glass-erp/target/classes/mapper/mm/BasicWarehouseType.xml
+++ b/north-glass-erp/target/classes/mapper/mm/BasicWarehouseType.xml
@@ -5,11 +5,15 @@
 <mapper namespace="com.example.erp.mapper.mm.BasicWarehouseTypeMapper">
 
     <select id="getBasicWarehouseTypeTakeOut" >
-        select * from mm.basic_warehouse_type where operate_type='棰嗗嚭';
+        select * from mm.basic_warehouse_type where type='棰嗗嚭';
     </select>
 
     <select id="getBasicWarehouseTypeRework" >
-        select * from mm.basic_warehouse_type where operate_type='杩斿伐';
+        select * from mm.basic_warehouse_type where type='杩斿伐';
+    </select>
+
+    <select id="getBasicWarehouseType" >
+        select * from mm.basic_warehouse_type where type=#{type};
     </select>
 
 
diff --git a/north-glass-erp/target/classes/mapper/mm/MaterialStore.xml b/north-glass-erp/target/classes/mapper/mm/MaterialStore.xml
new file mode 100644
index 0000000..4911316
--- /dev/null
+++ b/north-glass-erp/target/classes/mapper/mm/MaterialStore.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.example.erp.mapper.mm.MaterialStoreMapper">
+
+    <select id="getSelectMaterialStore">
+        select
+        *
+        from
+        mm.material_store m
+        <where>
+            <if test="materialStore.id != null and materialStore.id != ''">
+                and m.id regexp #{materialStore.id}
+            </if>
+            <if test="materialStore.type != null and materialStore.type != ''">
+                and m.type regexp #{materialStore.type}
+            </if>
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <select id="getSelectMaterialStorePageTotal">
+        select
+        CEILING(count(id)/#{pageSize}) as 'pageTotal',
+        count(id) as 'total'
+        from
+        mm.material_store m
+        <where>
+            <if test="materialStore.id != null and materialStore.id != ''">
+                and m.id regexp #{materialStore.id}
+            </if>
+
+        </where>
+        limit #{offset},#{pageSize};
+    </select>
+
+    <insert id="insertMaterialStore"  useGeneratedKeys="true"  >
+        insert into mm.material_store (type,json,create_time
+        )
+        values (
+                   #{type},#{json},now()
+               )
+    </insert>
+
+    <update id="updateMaterialStore" >
+        update mm.material_store set json=#{json} where id=#{id}
+    </update>
+
+    <delete id="deleteMaterialStore" >
+        delete from mm.material_store where id=#{id}
+    </delete>
+
+
+
+
+</mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml b/north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml
index 01afd6b..6ed4567 100644
--- a/north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml
+++ b/north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml
@@ -147,7 +147,7 @@
                  left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                            on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
 
-        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.quality_ins_status=1))
+        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.quality_ins_status!=1))
         order by dd.id desc
     </select>
 
diff --git a/north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml b/north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml
index e9b248d..d065c29 100644
--- a/north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml
+++ b/north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml
@@ -97,7 +97,7 @@
                  left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                            on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
 
-        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.quality_ins_status=1 order by dd.id
+        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 order by dd.id
 
     </select>
 

--
Gitblit v1.8.0