From d3475019350136c3946afcb3a831a5444e97bc17 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 29 三月 2024 09:59:02 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorage.vue |  332 +++++++++++++++++++++++++++++++++----------------------
 1 files changed, 200 insertions(+), 132 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorage.vue b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorage.vue
index 3d8a6f8..cfae732 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorage.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorage.vue
@@ -5,25 +5,173 @@
 
 import {reactive, ref} from "vue";
 import {useRouter} from  'vue-router'
-let router=useRouter()
+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 {toolbarButtonClickEvent} from "@/hook/mouseMove";
+
+//璇█鑾峰彇
+const { t } = useI18n()
+
+const router = useRouter()
+let produceList = ref([])
 const getTableRow = (row,type) =>{
   switch (type) {
     case 'edit' :{
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
-      router.push({path: '/main/ingredientsStock/CreateOutbound', query: { id: row.id }})
+      router.push({path: '/main/ingredientsStock/ReturnToStorageCreate', query: { returningId: row.returningId }})
       break
     }
-    case 'delete':{
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
-      break
+
+  }
+}
+
+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 : 4
+})
+
+let filterData = ref({
+
+})
+
+let selectDate = ref(["",""])
+
+
+request.post(`/MaterialInventory/getSelectReturningWarehouseDate/1/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
+
+  if(res.code==200){
+    console.log(res.data)
+    total.dataTotal = res.data.total.total*1
+    total.pageTotal= res.data.total.pageTotal
+    pageNum.value=1
+    selectDate.value = res.data.selectDate
+    produceList = deepClone(res.data.data)
+    xGrid.value.loadData(produceList)
+    gridOptions.loading=false
+  }else{
+    ElMessage.warning(res.msg)
+    router.push("/login")
+  }
+})
+
+
+
+
+/*浣跨敤绛涢�夛紝鍚庣鑾峰彇鏁版嵁*/
+const changeFilterEvent = (event, option, $panel,) => {
+  // 鎵嬪姩瑙﹀彂绛涢��
+  $panel.changeOption(event, !!option.data, option)
+}
+function filterChanged(column){
+  gridOptions.loading=true
+  //绛涢�夋潯浠跺彂鐢熷彉鍖栨潯浠跺彂鐢熷彉鍖�
+  let value = column.datas[0]!=undefined?column.datas[0]:''
+  value = value.trim()
+  //鍒ゆ柇鏄惁瀛樺湪澶栭敭
+  if (column.property.indexOf('.')>-1){
+    const  columnArr = column.property.split('.')
+    filterData.value[columnArr[0]] = {
+      [columnArr[1]]:value
+    }
+  }else{
+    filterData.value[column.property] = value
+  }
+  request.post(`/MaterialInventory/getSelectReturningWarehouseDate/1/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
+
+    if(res.code==200){
+      total.dataTotal = res.data.total.total*1
+      total.pageTotal= res.data.total.pageTotal
+
+      selectDate.value = res.data.selectDate
+      pageNum.value=1
+      produceList = deepClone(res.data.data)
+      xGrid.value.loadData(produceList)
+      gridOptions.loading=false
+    }else{
+      ElMessage.warning(res.msg)
+      router.push("/login")
+    }
+  })
+}
+
+
+const selectOrderList = ()=>{
+  request.post(`/MaterialInventory/getSelectReturningWarehouseDate/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
+    if(res.code==200){
+      selectDate.value = res.data.selectDate
+
+
+      if (res.data.total!=null){
+        total.dataTotal = res.data.total.total*1
+        total.pageTotal= res.data.total.pageTotal
+      }
+      produceList = deepClone(res.data.data)
+      xGrid.value.loadData(produceList)
+      gridOptions.loading=false
+    }else{
+      ElMessage.warning(res.msg)
+      router.push("/login")
+    }
+  })
+}
+
+const changeDate =  ()=>{
+  selectOrderList()
+}
+
+//椤佃剼璺宠浆
+const handlePageChange = ({ currentPage, pageSize }) => {
+
+  total.pageTotal = pageSize
+  pageNum.value=currentPage
+
+  selectOrderList()
+}
+
+
+const gridEvents = {
+  async toolbarButtonClick({code}) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (code) {
+        case 'add': {
+
+          router.push({path: '/main/ingredientsStock/ReturnToStorageCreate'})
+
+          break
+        }
+
+      }
     }
   }
+
 }
 
 
 
 //瀛愮粍浠舵帴鏀跺弬鏁�
-
+const  xGrid = ref();
 const gridOptions = reactive({
   border:  "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
@@ -53,105 +201,32 @@
     showStatus: true
   },//琛ㄥご鍙傛暟
   columns:[
-    {type:'expand',fixed:"left",slots: { content:'content' },width: '50'},
+    {type:'expand',fixed:"left",slots: { content:'content' },width: '60'},
     {title: '鎿嶄綔', width: '110', slots: { default: 'button_slot' },fixed:"left"},
-    // { type: 'checkbox',fixed:"left", title: '閫夋嫨', width: '80' },
     { type: 'seq',fixed:"left", title: '鑷簭', width: '80' },
-
-    {title: '瀹℃牳', width: 50, slots: { default: 'state' },},
-
-    {field: 'ReturnNum', width:'150', title: '杩斿簱缂栧彿', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } } },
-    {field: 'SalesNum', width: '150',title: '閿�鍞崟鍙�', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'ReturnType', width: '120',title: '杩斿簱绫诲瀷', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'DocumentType',width: '100', title: '鍗曟嵁绫诲瀷', sortable: true},
-    {field: 'ProjectName', width:'150', title: '椤圭洰鍚嶇О', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } } },
-    {field: 'MaterialCode', width: '100',title: '鐗╂枡缂栫爜', sortable: true},
-    {field: 'MaterialName',width: '100', title: '鐗╂枡鍚嶇О', sortable: true,showOverflow:"ellipsis"},
-    {field: 'Width', width: '80',title: '瀹藉害', sortable: true},
-    {field: 'Height',width: '100', title: '楂樺害', sortable: true},
-    {field: 'Thickness', width: '100',title: '鍘氬害', sortable: true},
-    {field: 'OriginPlace',width: '100', title: '浜у湴', sortable: true},
-    {field: 'SaveQuantity', width: '100',title: '鑺傜害鏁伴噺', sortable: true},
-    {field: 'Type', width: '100',title: '绫诲瀷', sortable: true},
-    {field: 'Supplier',width: '140', title: '棰嗘枡鍛�/渚涘簲鍟�', sortable: true},
-    {field: 'ClassGroup',width: '100', title: '鐝粍/渚涘簲鍟�', sortable: true},
-    {field: 'WarehouseKeeper',width: '100', title: '浠撶鍛�', sortable: true},
-    {field: 'Remark',width: '100', title: '澶囨敞', sortable: true},
-    {field: 'MakingData',width: '100', title: '鍒跺崟鏃ユ湡', sortable: true},
+    {field: 'reviewedState',title: '瀹℃牳', width: 50, slots: { default: 'state' },},
+    {field: 'returningId', width:'150', title: '杩斿簱鍗曞彿', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'materialRequisitionPersonnel', width: '150',title: '棰嗘枡鍛�/渚涘簲鍟�', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'materialRequisitionTeam', width: '120',title: '棰嗘枡鐝粍/渚涘簲鍟�', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'orderId', width:'150', title: '閿�鍞崟鍙�', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'project', width:'150', title: '椤圭洰鍚嶇О', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'batch', width:'150', title: '鎵规', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'returningType', width: '100',title: '杩斿簱绫诲瀷', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'warehouseManager',width: '100', title: '浠撶鍛�', sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'reviewed',width: '100', title: '瀹℃牳鍛�', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'reviewedTime', width: '100',title: '瀹℃牳鏃堕棿', sortable: true},
+    {field: 'createTime',width: '100', title: '鍒跺崟鏃ユ湡', sortable: true},
   ],//琛ㄥご鎸夐挳
   toolbarConfig: {
-    buttons: [{
-      code:'add','name': '杩斿簱鏂板',status:'primary'
-    }],
-    import: false,
+    buttons: [
+      {'code': 'add', 'name': '杩斿簱鏂板',status: 'primary'},
+    ],
+    /*import: false,
     export: true,
-    print: true,
+    print: true,*/
     zoom: true,
     custom: true
   },
-  data:  [
-    {
-      "ReturnNum": "FK24010811",
-      "SalesNum": "杩愯緭鏉愭枡鐮存崯",
-      "ReturnType": "閲囪喘鐮存崯",
-      "DocumentType": "瀹℃牳",
-      "ProjectName": "",
-      "MaterialCode": "80010128003308035401530000",
-      "MaterialName": "鐧界幓-3鍘�-鍒堕暅-浼樿川鍔犲伐绾�",
-      "Width": '3540.00',
-      "Height": "1530.00",
-      "Thickness": "3.00",
-      "OriginPlace": "骞胯タ鍗楀畞",
-      "SaveQuantity": "1.000",
-      "Type": "鐩存帴杩斿簱",
-      "Supplier": "骞胯タ鍗楀畞浼忔硶",
-      "ClassGroup": "鏇叉儬闇�",
-      "WarehouseKeeper": "鏇叉儬闇�",
-      "Remark": "2401060345",
-      "MakingData": "2024-01-08 08锛�41锛�09",
-    },
-    {
-      "ReturnNum": "FK24010811",
-      "SalesNum": "杩愯緭鏉愭枡鐮存崯",
-      "ReturnType": "閲囪喘鐮存崯",
-      "DocumentType": "瀹℃牳",
-      "ProjectName": "",
-      "MaterialCode": "80010128003308035401530000",
-      "MaterialName": "鐧界幓-3鍘�-鍒堕暅-浼樿川鍔犲伐绾�",
-      "Width": '3540.00',
-      "Height": "1530.00",
-      "Thickness": "3.00",
-      "OriginPlace": "骞胯タ鍗楀畞",
-      "SaveQuantity": "1.000",
-      "Type": "鐩存帴杩斿簱",
-      "Supplier": "骞胯タ鍗楀畞浼忔硶",
-      "ClassGroup": "鏇叉儬闇�",
-      "WarehouseKeeper": "鏇叉儬闇�",
-      "Remark": "2401060345",
-      "MakingData": "2024-01-08 08锛�41锛�09",
-    },
-    {
-      "ReturnNum": "FK24010811",
-      "SalesNum": "杩愯緭鏉愭枡鐮存崯",
-      "ReturnType": "閲囪喘鐮存崯",
-      "DocumentType": "瀹℃牳",
-      "ProjectName": "",
-      "MaterialCode": "80010128003308035401530000",
-      "MaterialName": "鐧界幓-3鍘�-鍒堕暅-浼樿川鍔犲伐绾�",
-      "Width": '3540.00',
-      "Height": "1530.00",
-      "Thickness": "3.00",
-      "OriginPlace": "骞胯タ鍗楀畞",
-      "SaveQuantity": "1.000",
-      "Type": "鐩存帴杩斿簱",
-      "Supplier": "骞胯タ鍗楀畞浼忔硶",
-      "ClassGroup": "鏇叉儬闇�",
-      "WarehouseKeeper": "鏇叉儬闇�",
-      "Remark": "2401060345",
-      "MakingData": "2024-01-08 08锛�41锛�09",
-    },
-
-  ],//table body瀹為檯鏁版嵁
   footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
     return[
       columns.map((column, columnIndex) => {
@@ -168,44 +243,23 @@
 
 })
 
-const  xGrid = ref();
-const gridEvents = {
-  toolbarButtonClick({ code }) {
-    const $grid = xGrid.value
-    if($grid){
-      switch (code){
-        case 'add':{
-          /*VXETable.modal.confirm('鐐瑰嚮浜嗗簱瀛樿皟鎷�');*/
-          router.push({path: '/main/ingredientsStock/ReturnToStorageCreate'});
-          return;
-          break
-        }
-      }
-    }
-  }
-}
 
 
 </script>
 
 <template>
   <div class="main-div-customer">
-    <el-row gutter="10" >
-      <el-col :span="2.5">
-        <div class="label-text">浼樺寲鏃ユ湡</div>
-      </el-col>
-      <el-col :span="4">
-        <el-date-picker
-            type="daterange"
-            start-placeholder="寮�濮嬫椂闂�"
-            end-placeholder="缁撴潫鏃堕棿"
-            style="width: 200px;"
-        />
-      </el-col>
-      <el-col span="4">
-        <el-button id="searchButton" type="primary" :icon="Search">鏌ヨ</el-button>
-      </el-col>
-    </el-row>
+    <el-date-picker
+        v-model="selectDate"
+        type="daterange"
+        start-placeholder="寮�濮嬫椂闂�"
+        end-placeholder="缁撴潫鏃堕棿"
+        format="YYYY-MM-DD"
+        value-format="YYYY-MM-DD"
+
+    />
+    <el-button @click="changeDate" style="margin-top: -5px"  id="searchButton" type="primary" :icon="Search">鏌ヨ</el-button>
+
     <vxe-grid
         max-height="100%"
         @filter-change="filterChanged"
@@ -239,8 +293,22 @@
         </div>
       </template>
 
-      <template #state="{ row}">
-        <el-checkbox checked/>
+      <template #state="{ row,column}">
+        <el-checkbox @click.native.prevent :checked="row[column.field]===1"/>
+      </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>

--
Gitblit v1.8.0