Parcourir la source

Merge remote-tracking branch 'origin/master'

lizhenhao il y a 2 ans
Parent
commit
a10039c0cb

+ 8 - 0
src/api/flowable/NoticeService.js

@@ -25,6 +25,14 @@ export default class NoticeService {
     })
   }
 
+  stockUpdate (params) {
+    return request({
+      url: '/flowable/notice/stockUpdate',
+      method: 'get',
+      params: params
+    })
+  }
+
   portionRead (ids) {
     return request({
       url: '/flowable/notice/portionRead',

+ 36 - 22
src/views/modules/flowable/task/NoticePageList.vue

@@ -80,10 +80,12 @@
         height="600px">
           <flow-chart ref="preview" :processInstanceId="processInstanceId"></flow-chart>
         </el-dialog>
+    <WareHouseHistoryPopup ref="wareHouseHistoryPopup"></WareHouseHistoryPopup>
   </div>
 </template>
 
 <script>
+  import WareHouseHistoryPopup from '@/views/modules/materialManagement/wareHouseSummary/WareHouseHistoryPopup'
   import TaskService from '@/api/flowable/TaskService'
   import NoticeService from '@/api/flowable/NoticeService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
@@ -123,6 +125,7 @@
       this.refreshList()
     },
     components: {
+      WareHouseHistoryPopup,
       SelectUserTree
     },
     methods: {
@@ -150,29 +153,40 @@
         this.refreshList()
       },
       todo (row) {
-        this.inputForm = {
-          taskId: '',
-          noticeId: ''
-        }
-        this.taskService.getTaskDef({
-          procInsId: row.taskId,
-          procDefId: row.defId
-        }).then(({data}) => {
-          this.inputForm.taskId = row.taskId
-          this.inputForm.noticeId = row.noticeName
-          this.noticeService.update(this.inputForm)
-          this.$router.push({
-            path: '/flowable/task/TaskForm',
-            query: {
-              isShow: false,
-              formReadOnly: true,
-              formTitle: `${row.title}`,
-              num: 2,
-              title: `审批【${row.taskName || ''}】`,
-              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
-            }
+        // console.log('row', row)
+        if (row.taskName === '库存提醒') {
+          // console.log('测试进来了')
+          this.$refs.wareHouseHistoryPopup.init()
+          this.inputForm = {
+            id: row.id
+          }
+          this.noticeService.stockUpdate(this.inputForm)
+          this.resetSearch()
+        } else {
+          this.inputForm = {
+            taskId: '',
+            noticeId: ''
+          }
+          this.taskService.getTaskDef({
+            procInsId: row.taskId,
+            procDefId: row.defId
+          }).then(({data}) => {
+            this.inputForm.taskId = row.taskId
+            this.inputForm.noticeId = row.noticeName
+            this.noticeService.update(this.inputForm)
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                isShow: false,
+                formReadOnly: true,
+                formTitle: `${row.title}`,
+                num: 2,
+                title: `审批【${row.taskName || ''}】`,
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
+              }
+            })
           })
-        })
+        }
       },
       resetSearch () {
         this.$refs.searchForm.resetFields()

+ 16 - 0
src/views/modules/materialManagement/collect/CollectForm.vue

@@ -694,6 +694,7 @@
       getProgramForType (rows) {
         this.inputForm.detailInfos[this.indexRow].collectTypeId = rows.id
         this.inputForm.detailInfos[this.indexRow].collectType = rows.name
+        this.inputForm.detailInfos[this.indexRow].goodsName = ''
         this.indexRow = ''
         this.$forceUpdate()
       },
@@ -723,6 +724,21 @@
       getContract (row) {
         this.inputForm.detailInfos[this.indexRow].surplusNumber = row.tradeNumber
         this.inputForm.detailInfos[this.indexRow].goodsName = row.tradeName
+        // 去除重复的领用详情
+        let i = this.inputForm.detailInfos.length
+        for (let j = 0; j < i; j++) {
+          console.log('进来了')
+          for (let k = j + 1; k < i; k++) {
+            if (this.inputForm.detailInfos[j].collectTypeId === this.inputForm.detailInfos[k].collectTypeId) {
+              if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].goodsName) &&
+                this.commonJS.isNotEmpty(this.inputForm.detailInfos[k].goodsName) && this.inputForm.detailInfos[j].goodsName === this.inputForm.detailInfos[k].goodsName) {
+                // parseFloat(item.account).toFixed(2)
+                this.inputForm.detailInfos.splice(k, 1)
+                this.$message.warning(`同种领用类型的商品名称只能输入一条信息!`)
+              }
+            }
+          }
+        }
         this.indexRow = ''
         this.$forceUpdate()
       },

+ 15 - 0
src/views/modules/materialManagement/collect/UpdateCollectInfoForm.vue

@@ -525,6 +525,21 @@
       getContract (row) {
         this.inputForm.detailInfos[this.indexRow].surplusNumber = row.tradeNumber
         this.inputForm.detailInfos[this.indexRow].goodsName = row.tradeName
+        // 去除重复的领用详情
+        let i = this.inputForm.detailInfos.length
+        for (let j = 0; j < i; j++) {
+          console.log('进来了')
+          for (let k = j + 1; k < i; k++) {
+            if (this.inputForm.detailInfos[j].collectTypeId === this.inputForm.detailInfos[k].collectTypeId) {
+              if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].goodsName) &&
+                this.commonJS.isNotEmpty(this.inputForm.detailInfos[k].goodsName) && this.inputForm.detailInfos[j].goodsName === this.inputForm.detailInfos[k].goodsName) {
+                // parseFloat(item.account).toFixed(2)
+                this.inputForm.detailInfos.splice(k, 1)
+                this.$message.warning(`同种领用类型的商品名称只能输入一条信息!`)
+              }
+            }
+          }
+        }
         this.indexRow = ''
         this.$forceUpdate()
       },

+ 17 - 4
src/views/modules/materialManagement/purchase/PurchaseForm.vue

@@ -770,6 +770,19 @@
       getProgramForType (rows) {
         this.inputForm.detailInfos[this.indexRow].procurementTypeId = rows.id
         this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
+        let i = this.inputForm.detailInfos.length
+        for (let j = 0; j < i; j++) {
+          for (let k = j + 1; k < i; k++) {
+            if (this.inputForm.detailInfos[j].procurementTypeId === this.inputForm.detailInfos[k].procurementTypeId) {
+              if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeName) &&
+                this.commonJS.isNotEmpty(this.inputForm.detailInfos[k].tradeName) && this.inputForm.detailInfos[j].tradeName === this.inputForm.detailInfos[k].tradeName) {
+                // parseFloat(item.account).toFixed(2)
+                this.inputForm.detailInfos.splice(k, 1)
+                this.$message.warning(`同种采购类型的商品名称只能输入一条信息!`)
+              }
+            }
+          }
+        }
         this.indexRow = ''
         this.$forceUpdate()
       },
@@ -804,12 +817,12 @@
       ifSameValue () {
         let i = this.inputForm.detailInfos.length
         for (let j = 0; j < i; j++) {
-          if (j + 1 < i) {
-            if (this.inputForm.detailInfos[j].procurementTypeId === this.inputForm.detailInfos[j + 1].procurementTypeId) {
+          for (let k = j + 1; k < i; k++) {
+            if (this.inputForm.detailInfos[j].procurementTypeId === this.inputForm.detailInfos[k].procurementTypeId) {
               if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeName) &&
-                this.commonJS.isNotEmpty(this.inputForm.detailInfos[j + 1].tradeName) && this.inputForm.detailInfos[j].tradeName === this.inputForm.detailInfos[j + 1].tradeName) {
+                this.commonJS.isNotEmpty(this.inputForm.detailInfos[k].tradeName) && this.inputForm.detailInfos[j].tradeName === this.inputForm.detailInfos[k].tradeName) {
                 // parseFloat(item.account).toFixed(2)
-                this.inputForm.detailInfos.splice(j + 1, 1)
+                this.inputForm.detailInfos.splice(k, 1)
                 this.$message.warning(`同种采购类型的商品名称只能输入一条信息!`)
               }
             }

+ 2 - 2
src/views/modules/materialManagement/purchase/PurchaseList.vue

@@ -146,8 +146,8 @@
               <el-button v-if="hasPermission('material:edit')&&scope.row.createBy === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
               <el-button v-if="hasPermission('material:del')&&scope.row.createBy === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
               <el-button v-else-if="hasPermission('material:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
-              <el-button v-if="hasPermission('material:list')&&scope.row.createBy === $store.state.user.id&&scope.row.status==='5'&&scope.row.purchaseModeType==='1'" type="text" size="small" @click="seeWareHouse(scope.row.id)">入库记录</el-button>
-              <el-button v-if="hasPermission('material:add')&&scope.row.createBy === $store.state.user.id&&scope.row.status==='5'&&scope.row.purchaseModeType==='1'" type="text" size="small" @click="wareHouse(scope.row.id)">入库</el-button>
+              <el-button v-if="hasPermission('material:wareHouseRecord:list')&&scope.row.createBy === $store.state.user.id&&scope.row.status==='5'&&scope.row.purchaseModeType==='1'" type="text" size="small" @click="seeWareHouse(scope.row.id)">入库记录</el-button>
+              <el-button v-if="hasPermission('material:wareHouse:add')&&scope.row.createBy === $store.state.user.id&&scope.row.status==='5'&&scope.row.purchaseModeType==='1'" type="text" size="small" @click="wareHouse(scope.row.id)">入库</el-button>
             </template>
           </vxe-column>
         </vxe-table>

+ 54 - 5
src/views/modules/materialManagement/wareHouse/WareHouseAddForm.vue

@@ -162,7 +162,14 @@
                 <el-input :disabled='true' v-model="scope.row.remarks" ></el-input>
               </template>
             </vxe-table-column>
-            <vxe-table-column title="操作" width="180">
+            <vxe-table-column v-if="method === 'purchaseAdd'" title="操作" width="220">
+              <template v-slot="scope">
+                <el-button size="mini" type="primary" :disabled="false" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>
+                <el-button size="mini" v-if="method === 'purchaseAdd'" type="primary" :disabled="false" @click="wareHouseAdd(scope.$rowIndex)">入库</el-button>
+                <!--              <el-button size="mini" v-if="formReadOnly" :disabled="false" type="primary" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>-->
+              </template>
+            </vxe-table-column>
+            <vxe-table-column v-else title="操作" width="180">
               <template v-slot="scope">
                 <el-button size="mini" type="primary" :disabled="false" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>
                 <!--              <el-button size="mini" v-if="formReadOnly" :disabled="false" type="primary" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>-->
@@ -536,6 +543,19 @@
       getProgramForType (rows) {
         this.inputForm.wareHouse[this.indexRow].wareHouseTypeId = rows.id
         this.inputForm.wareHouse[this.indexRow].wareHouseType = rows.name
+        let i = this.inputForm.wareHouse.length
+        for (let j = 0; j < i; j++) {
+          for (let k = j + 1; k < i; k++) {
+            if (this.inputForm.wareHouse[j].wareHouseTypeId === this.inputForm.wareHouse[k].wareHouseTypeId) {
+              if (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeName) &&
+                this.commonJS.isNotEmpty(this.inputForm.wareHouse[k].tradeName) && this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[k].tradeName) {
+                // parseFloat(item.account).toFixed(2)
+                this.inputForm.wareHouse.splice(k, 1)
+                this.$message.warning(`同种入库类型的商品名称只能输入一条信息!`)
+              }
+            }
+          }
+        }
         // this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
         this.indexRow = ''
         this.$forceUpdate()
@@ -778,12 +798,41 @@
       ifSameValue () {
         let i = this.inputForm.wareHouse.length
         for (let j = 0; j < i; j++) {
-          if (j + 1 < i) {
-            if (this.inputForm.wareHouse[j].wareHouseTypeId === this.inputForm.wareHouse[j + 1].wareHouseTypeId) {
+          for (let k = j + 1; k < i; k++) {
+            if (this.inputForm.wareHouse[j].wareHouseTypeId === this.inputForm.wareHouse[k].wareHouseTypeId) {
+              if (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeName) &&
+                this.commonJS.isNotEmpty(this.inputForm.wareHouse[k].tradeName) && this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[k].tradeName) {
+                // parseFloat(item.account).toFixed(2)
+                this.inputForm.wareHouse.splice(k, 1)
+                this.$message.warning(`同种入库类型的商品名称只能输入一条信息!`)
+              }
+            }
+          }
+        }
+      },
+      wareHouseAdd (index) {
+      //  将采购详情中的采购类型,商品名称,商品数量,商品单价,商品总结,带到入库详情中
+        // eslint-disable-next-line no-unused-vars
+        let param = {
+          wareHouseMan: this.name,
+          wareHouseManId: this.wareHouseManId,
+          wareHouseManOffice: this.officeName,
+          wareHouseTypeId: this.inputForm.detailInfos[index].procurementTypeId,
+          wareHouseType: this.inputForm.detailInfos[index].procurementType,
+          tradeName: this.inputForm.detailInfos[index].tradeName,
+          tradeNumber: this.inputForm.detailInfos[index].tradeNumber,
+          company: this.inputForm.detailInfos[index].company,
+          priceSum: this.inputForm.detailInfos[index].priceSum
+        }
+        this.inputForm.wareHouse.push(param)
+        let i = this.inputForm.wareHouse.length
+        for (let j = 0; j < i; j++) {
+          for (let k = j + 1; k < i; k++) {
+            if (this.inputForm.wareHouse[j].wareHouseTypeId === this.inputForm.wareHouse[k].wareHouseTypeId) {
               if (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeName) &&
-                this.commonJS.isNotEmpty(this.inputForm.wareHouse[j + 1].tradeName) && this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[j + 1].tradeName) {
+                this.commonJS.isNotEmpty(this.inputForm.wareHouse[k].tradeName) && this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[k].tradeName) {
                 // parseFloat(item.account).toFixed(2)
-                this.inputForm.wareHouse.splice(j + 1, 1)
+                this.inputForm.wareHouse.splice(k, 1)
                 this.$message.warning(`同种入库类型的商品名称只能输入一条信息!`)
               }
             }

+ 88 - 24
src/views/modules/materialManagement/wareHouseSummary/WareHouseHistory.vue

@@ -13,7 +13,26 @@
       <el-tabs v-model="activeNameTop" type="border-card" @tab-click="tabHandleClickTop">
         <el-tab-pane label="入库记录" name="wareHouse">
           <div style="height: calc(100% - 80px);">
+            <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+              <!-- 搜索框-->
+              <el-form-item label="入库时间" prop="wareHouseDates">
+                <el-date-picker
+                  placement="bottom-start"
+                  format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  v-model="searchForm.wareHouseDates"
+                  type="datetimerange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期">
+                </el-date-picker>
+              </el-form-item>
 
+              <el-form-item>
+                <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+                <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+              </el-form-item>
+            </el-form>
             <vxe-table
               border="inner"
               auto-resize
@@ -42,26 +61,46 @@
                   <span v-else>{{scope.row.wareHouseName}}</span>
                 </template>
               </vxe-column>
-              <vxe-column min-width="160" align="center" title="入库时间" field="wareHouseDate"></vxe-column>
+              <vxe-column min-width="160" align="center" title="入库数量" field="tradeNumber"></vxe-column>
               <vxe-column min-width="160" align="center" title="经办人" field="wareHouseHandledBy"></vxe-column>
               <vxe-column min-width="160" align="center" title="经办人部门" field="wareHouseHandledByOff"></vxe-column>
+              <vxe-column min-width="160" align="center" title="入库时间" field="wareHouseDate"></vxe-column>
 
             </vxe-table>
-<!--            <vxe-pager-->
-<!--              background-->
-<!--              size="small"-->
-<!--              :current-page="tablePage.currentPage"-->
-<!--              :page-size="tablePage.pageSize"-->
-<!--              :total="tablePage.total"-->
-<!--              :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"-->
-<!--              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"-->
-<!--              @page-change="currentChangeHandle">-->
-<!--            </vxe-pager>-->
+            <vxe-pager
+              background
+              size="small"
+              :current-page="tablePage.currentPage"
+              :page-size="tablePage.pageSize"
+              :total="tablePage.total"
+              :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+              @page-change="currentChangeHandle">
+            </vxe-pager>
           </div>
         </el-tab-pane>
         <el-tab-pane label="领用记录" name="collect">
           <div style="height: calc(100% - 80px);">
+            <el-form size="small" :inline="true" class="query-form" ref="searchForm2" :model="searchForm2" @keyup.enter.native="refreshList()" @submit.native.prevent>
+              <!-- 搜索框-->
+              <el-form-item label="领用时间" prop="collectDates">
+                <el-date-picker
+                  placement="bottom-start"
+                  format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  v-model="searchForm2.collectDates"
+                  type="datetimerange"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期">
+                </el-date-picker>
+              </el-form-item>
 
+              <el-form-item>
+                <el-button type="primary" @click="list2()" size="small" icon="el-icon-search">查询</el-button>
+                <el-button @click="resetSearch2()" size="small" icon="el-icon-refresh-right">重置</el-button>
+              </el-form-item>
+            </el-form>
             <vxe-table
               border="inner"
               auto-resize
@@ -90,21 +129,22 @@
                   <span v-else>{{scope.row.goodsName}}</span>
                 </template>
               </vxe-column>
+              <vxe-column min-width="160" align="center" title="领用数量" field="collectNumber"></vxe-column>
               <vxe-column min-width="160" align="center" title="经办人" field="collectHandleBy"></vxe-column>
               <vxe-column min-width="160" align="center" title="经办人部门" field="collectHandleByOff"></vxe-column>
               <vxe-column min-width="160" align="center" title="领用时间" field="collectDate"></vxe-column>
 
             </vxe-table>
-<!--            <vxe-pager-->
-<!--              background-->
-<!--              size="small"-->
-<!--              :current-page="tablePage.currentPage"-->
-<!--              :page-size="tablePage.pageSize"-->
-<!--              :total="tablePage.total"-->
-<!--              :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"-->
-<!--              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"-->
-<!--              @page-change="currentChangeHandle">-->
-<!--            </vxe-pager>-->
+            <vxe-pager
+              background
+              size="small"
+              :current-page="tablePage2.currentPage"
+              :page-size="tablePage2.pageSize"
+              :total="tablePage2.total"
+              :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+              @page-change="currentChangeHandle2">
+            </vxe-pager>
           </div>
         </el-tab-pane>
       </el-tabs>
@@ -137,14 +177,23 @@
           pageSize: 10,
           orders: []
         },
+        tablePage2: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
         tableKey: '',
         dataList: [],
         collectList: [],
         searchForm: {
-          purchaseSketch: '',
           tradeName: '',
           contractDates: []
         },
+        searchForm2: {
+          tradeName: '',
+          collectDates: []
+        },
         activeNameTop: 'wareHouse'
       }
     },
@@ -173,7 +222,9 @@
         this.activeNameTop = 'wareHouse'
         this.visible = true
         this.searchForm.tradeName = tradeName
+        this.searchForm2.tradeName = tradeName
         this.list()
+        this.list2()
       },
       list () {
         this.loading = true
@@ -187,12 +238,14 @@
           this.tableKey = Math.random()
           this.loading = false
         })
+      },
+      list2 () {
         this.wareHouseService.collectHistoryList({
-          ...this.searchForm
+          ...this.searchForm2
         }).then(({data}) => {
           this.collectList = data.records
           // this.collectList = data.collectList
-          this.tablePage.total = data.total
+          this.tablePage2.total = data.total
           this.tableKey = Math.random()
           this.loading = false
         })
@@ -203,12 +256,23 @@
         this.tablePage.pageSize = pageSize
         this.list()
       },
+      currentChangeHandle2 ({currentPage, pageSize}) {
+        this.tablePage2.currentPage = currentPage
+        this.tablePage2.pageSize = pageSize
+        this.list2()
+      },
       resetSearch () {
         this.$refs.searchForm.resetFields()
         this.list()
       },
+      resetSearch2 () {
+        this.$refs.searchForm2.resetFields()
+        this.list2()
+      },
       close () {
         this.visible = false
+        this.$refs.searchForm.resetFields()
+        this.$refs.searchForm2.resetFields()
       },
       tabHandleClickTop (event) {
         // console.log(event)

+ 189 - 0
src/views/modules/materialManagement/wareHouseSummary/WareHouseHistoryPopup.vue

@@ -0,0 +1,189 @@
+<template>
+  <div>
+    <el-dialog
+      title="库存信息"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      append-to-body
+      @keyup.enter.native=""
+      :visible.sync="visible">
+      <div style="height: calc(100% - 80px);">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="商品名称" prop="tradeName">
+            <el-input size="small" v-model="searchForm.tradeName" placeholder="请输入商品名称" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="入库类型" prop="wareHouseType">
+            <SelectTree
+              ref="areaTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+              url="/material/materialType/summaryTreeData?type=last"
+              :value="searchForm.wareHouseType"
+              :clearable="true"
+              :accordion="true"
+              @getValue="(value, label) => {searchForm.wareHouseType=value}"/>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="400px"
+          :loading="loading"
+          size="small"
+          ref="projectTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}"
+        >
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column min-width="160" align="center" title="入库类型" field="wareHouseTypeName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="商品名称" field="tradeName">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('material:list')" @click="view(scope.row.tradeName)">{{scope.row.tradeName}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('material:list')"  @click="view(scope.row.tradeName,)">{{scope.row.tradeName}}</el-link>
+              <span v-else>{{scope.row.tradeName}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="160" align="center" title="总量" field="allNumber"></vxe-column>
+          <vxe-column min-width="160" align="center" title="领用量" field="borrowNumber"></vxe-column>
+          <vxe-column min-width="160" align="center" title="剩余量" field="tradeNumber"></vxe-column>
+          <vxe-column min-width="160" align="center" title="单位" field="company"></vxe-column>
+
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+    </span>
+    </el-dialog>
+    <WareHouseHistory ref="wareHouseHistory"></WareHouseHistory>
+  </div>
+</template>
+
+<script>
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import WareHouseHistory from './WareHouseHistory'
+  import InputNumber from '@/views/modules/sys/workContract/InputNumber.vue'
+  // import CollectService from '@/api/materialManagement/CollectService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import WareHouseService from '@/api/materialManagement/WareHouseService'
+  export default {
+    data () {
+      return {
+        visible: false,
+        num: 0,
+        searchForm: {
+          wareHouseType: '',
+          tradeName: '',
+          wareHouseNumber: '',
+          wareHouseMan: '',
+          wareHouseManOffice: '',
+          wareHouseDates: [],
+          procurementType: '',
+          createBy: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        tableKey: '',
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false,
+        create: ''
+      }
+    },
+    // collectService: null,
+    wareHouseService: null,
+    created () {
+      // this.collectService = new CollectService()
+      this.wareHouseService = new WareHouseService()
+    },
+    components: {
+      SelectTree,
+      WareHouseHistory,
+      SelectUserTree,
+      InputNumber
+    },
+    methods: {
+      init () {
+        this.visible = true
+        this.refreshList()
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.wareHouseService.wareHouseSummaryList({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.tableKey = Math.random()
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.$refs.searchForm.resetFields()
+        this.visible = false
+        this.typeTest = ''
+      },
+      // 查看
+      view (tradeName) {
+        this.$refs.wareHouseHistory.init(tradeName)
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-dialog__body {
+    padding-top: 0px;
+    padding-bottom: 15px;
+  }
+</style>

+ 4 - 0
src/views/modules/materialManagement/wareHouseSummary/WareHouseSummaryList.vue

@@ -119,6 +119,7 @@
         </vxe-pager>
         <WareHouseAddForm ref="wareHouseAddForm" @refreshList="refreshList"></WareHouseAddForm>
         <WareHouseHistory ref="wareHouseHistory"></WareHouseHistory>
+        <WareHouseHistoryPopup ref="wareHouseHistoryPopup"></WareHouseHistoryPopup>
       </div>
     </div>
   </div>
@@ -128,6 +129,7 @@
   import UserSelect from '@/components/userSelect'
   import WareHouseAddForm from '../wareHouse/WareHouseAddForm'
   import WareHouseHistory from './WareHouseHistory'
+  import WareHouseHistoryPopup from './WareHouseHistoryPopup'
   import InputNumber from '@/views/modules/cw/workContract/InputNumber.vue'
   import SelectTree from '@/components/treeSelect/treeSelect.vue'
   import WorkClientService from '@/api/cw/workClientInfo/WorkClientService'
@@ -185,6 +187,7 @@
       InputNumber,
       SelectUserTree,
       WareHouseHistory,
+      WareHouseHistoryPopup,
       SelectTree,
       WareHouseAddForm
     },
@@ -206,6 +209,7 @@
     methods: {
       // 查看
       view (tradeName) {
+        // this.$refs.wareHouseHistoryPopup.init()
         this.$refs.wareHouseHistory.init(tradeName)
       },
       // 查询当前用户是否是管理员用户

+ 36 - 23
src/views/modules/sys/dashboard/workBench/Pending.vue

@@ -236,6 +236,7 @@
       </el-header>
     </el-container>
     <UpdatePassword ref="updatePassword"></UpdatePassword>
+    <WareHouseHistoryPopup ref="wareHouseHistoryPopup"></WareHouseHistoryPopup>
   </div>
 </template>
 
@@ -249,7 +250,7 @@
   import NoticeService from '@/api/flowable/NoticeService'
   import UserService from '@/api/sys/UserService'
   import UpdatePassword from '@/views/layout/UpdatePassword'
-
+  import WareHouseHistoryPopup from '../../../materialManagement/wareHouseSummary/WareHouseHistoryPopup'
   export default {
     data () {
       return {
@@ -367,6 +368,7 @@
       this.refreshList()
     },
     components: {
+      WareHouseHistoryPopup,
       UserSelect,
       // FlowChart
       NotifyForm,
@@ -539,29 +541,40 @@
         })
       },
       todoPage (row) {
-        this.inputForm = {
-          taskId: '',
-          noticeId: ''
-        }
-        this.taskService.getTaskDef({
-          procInsId: row.taskId,
-          procDefId: row.defId
-        }).then(({data}) => {
-          this.inputForm.taskId = row.taskId
-          this.inputForm.noticeId = row.noticeName
-          this.noticeService.update(this.inputForm)
-          this.$router.push({
-            path: '/flowable/task/TaskForm',
-            query: {
-              isShow: false,
-              formReadOnly: true,
-              formTitle: `${row.title}`,
-              num: 2,
-              title: `审批【${row.taskName || ''}】`,
-              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
-            }
+        // console.log('row', row)
+        if (row.taskName === '库存提醒') {
+          // console.log('测试进来了')
+          this.$refs.wareHouseHistoryPopup.init()
+          this.inputForm = {
+            id: row.id
+          }
+          this.noticeService.stockUpdate(this.inputForm)
+          this.resetSearch()
+        } else {
+          this.inputForm = {
+            taskId: '',
+            noticeId: ''
+          }
+          this.taskService.getTaskDef({
+            procInsId: row.taskId,
+            procDefId: row.defId
+          }).then(({data}) => {
+            this.inputForm.taskId = row.taskId
+            this.inputForm.noticeId = row.noticeName
+            this.noticeService.update(this.inputForm)
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                isShow: false,
+                formReadOnly: true,
+                formTitle: `${row.title}`,
+                num: 2,
+                title: `审批【${row.taskName || ''}】`,
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
+              }
+            })
           })
-        })
+        }
       },
       trace (row) {
         this.processInstanceId = row.task.processInstanceId