Просмотр исходного кода

审批页面优化,物料申购、消息提醒页面翻页问题

l1069030731 2 лет назад
Родитель
Сommit
51b8b5cef0

+ 5 - 0
src/components/dateSelect/dateSelect.vue

@@ -1,6 +1,7 @@
 <template>
 	<div class="date-filter-wrap" style="float: right">
 		<DatePicker
+      v-if="selectMonthStatus"
 			:clearable="false"
 			@on-change="dateClick2"
 			v-model="dataArea2"
@@ -67,6 +68,10 @@ export default {
 		value: {
 			type: Object,
 		},
+    selectMonthStatus: {
+      type: Boolean,
+      default: true
+    }
 	},
 	watch: {
 		value: {

+ 9 - 9
src/view/index/msg/msg.vue

@@ -131,7 +131,7 @@ export default {
                       // 请购单审批
                       GetApplyPurchasePageList({
                         id: params.row.linkId,
-                        pageIndex: 1,
+                        pageNum: 1,
                         pageSize: 1
                       }).then(res => {
                         if (res.code === 0) {
@@ -143,7 +143,7 @@ export default {
                       // 合同审批
                       GetPurContractPageList({
                         id: params.row.linkId,
-                        pageIndex: 1,
+                        pageNum: 1,
                         pageSize: 1
                       }).then(res => {
                         if (res.code === 0) {
@@ -159,7 +159,7 @@ export default {
                       // 领料申请
                       GetApplyTakePageList({
                         id: params.row.linkId,
-                        pageIndex: 1,
+                        pageNum: 1,
                         pageSize: 1
                       }).then(res => {
                         if (res.code === 0) {
@@ -356,7 +356,7 @@ export default {
         
       ],
       params: {
-        pageIndex: 1,
+        pageNum: 1,
         pageSize: 20,
         total: 0,
         userNo:window.localStorage.getItem('jobNo'),
@@ -369,12 +369,12 @@ export default {
   methods: {
     readStateChange2(){
       const v = this
-      v.params.pageIndex = 1
+      v.params.pageNum = 1
       v.getList()
     },
     readStateChange(){
       const v = this
-      v.params.pageIndex = 1
+      v.params.pageNum = 1
       v.getList()
       // v.getMsgState()
     },
@@ -385,7 +385,7 @@ export default {
     eventHandle (option) {
       switch (option._evnet) {
         case 'search':
-          this.params.pageIndex = 1
+          this.params.pageNum = 1
           this.params.keyWord = option.key
           this.getList()
           break
@@ -413,8 +413,8 @@ export default {
           break
       }
     },
-    changePage (pageIndex) {
-      this.params.pageIndex = pageIndex
+    changePage (pageNum) {
+      this.params.pageNum = pageNum
       this.getList()
     },
     // getMsgState(){

+ 273 - 164
src/view/index/schedule/schedule.vue

@@ -1,17 +1,48 @@
 <!-- 待办事项 -->
 <template>
   <div class="container">
-    <my-table
-      :data="data"
-      :columns="columns"
-      :table-filter="tableFilter"
-      :table-page="params"
-      selectKey="linkId"
-      @event-handle="eventHandle"
-      @on-select="getSelect"
-      @on-change="changePage"
-    >
-    </my-table>
+    <div class="tab-nav">
+      <date-select v-model="params" :selectMonthStatus="false" @change="selectTime"></date-select>
+      <div style="margin-left: 16px">
+        <RadioGroup v-model="params.checkState" @on-change="changeState">
+          <Radio
+            v-for="(radio, index) in stateList"
+            :key="index"
+            :label="radio.value"
+          >
+            {{ radio.label }}
+          </Radio>
+        </RadioGroup>
+      </div>
+      <div style="margin-left: 16px">
+        <Select v-model="params.id" clearable style="width:200px" @on-change="changeFlow">
+          <Option v-for="item in flowList" :value="item.id" :key="item.id" :label="item.flowName">
+            <span>{{ item.flowName }} (</span>
+            <span style="color: red">{{ item.count }}</span>
+            <span>)</span>
+          </Option>
+        </Select>
+      </div>
+      <div style="margin-left: 16px">
+        <Input v-model="params.keyword" clearable placeholder="请输入关键字" style="width: 200px" />
+      </div>
+      <Button type="primary" style="margin-left: 16px" @click="clickSearch">查询</Button>
+      <Button type="primary" style="margin-left: 16px" @click="clickExportExcel">导出Excel</Button>
+      <Button type="primary" style="margin-left: 32px" @click="dispatchShow = true">批量审核</Button>
+    </div>
+    <div class="main">
+      <my-table
+        :data="data"
+        :columns="columns"
+        :table-page="params"
+        selectKey="linkId"
+        @on-select="getSelect"
+        @on-change="changePage"
+      >
+        <!-- :table-filter="tableFilter"
+        @event-handle="eventHandle" -->
+      </my-table>
+    </div>
     <purchase-form
       v-model="purchaseShow"
       :data="formData"
@@ -165,6 +196,9 @@ import ProviderTagDelForm from './provider-tag-del-form'
 import ProviderShipmentForm from './provider-shipment-form'
 import profitTagForm from './profit-tag-form'
 import { exportExcel } from '@/libs/util'
+import dateSelect from '@/components/dateSelect/dateSelect'
+import axios from 'axios'
+
 export default {
   name: 'schedule',
   components: {
@@ -186,7 +220,8 @@ export default {
     ProviderContractOverForm,
     ProviderTagDelForm,
     ProviderShipmentForm,
-    profitTagForm
+    profitTagForm,
+    dateSelect
   },
   data () {
     return {
@@ -241,146 +276,153 @@ export default {
               {
                 on: {
                   click (e) {
-                    e.stopPropagation()
-                    _this.formData = {}
-                    if (params.row.dealWithType === 0) {
-                      // 请购单审批
-                      GetApplyPurchasePageList({
-                        id: params.row.linkId,
-                        pageIndex: 1,
-                        pageSize: 1
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = {
-                            ...res.result.list[0],
-                            ...params.row
-                          }
-                          _this.purchaseShow = true
-                        }
-                      })
-                    } else if (params.row.dealWithType === 1) {
-                      // 合同审批
-                      GetPurContractPageList({
-                        id: params.row.linkId,
-                        pageIndex: 1,
-                        pageSize: 1
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = {
-                            ...res.result.list[0],
-                            ...params.row
-                          }
-                          _this.contractShow = true
-                        }
-                      })
-                    } else if (params.row.dealWithType === 2) {
-                      // 付款审批
-                      _this.formData = { ...params.row }
-                      _this.payShow = true
-                    } else if (params.row.dealWithType === 3) {
-                      // 领料申请
-                      GetApplyTakePageList({
-                        id: params.row.linkId,
-                        pageIndex: 1,
-                        pageSize: 1
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = {
-                            ...res.result.list[0],
-                            ...params.row
-                          }
-                          _this.applyMaterialShow = true
-                        }
-                      })
-                    } else if (params.row.dealWithType === 4) {
-                      // 其他出库退货/报损
-                      GetApplyStockOutBill({
-                        id: params.row.linkId
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = { ...res.result, ...params.row }
-                          _this.otherShow = true
-                        }
+                    axios
+                      .post('/cloudApi/applet/getApproveType', {
+                        ...params.row
                       })
-                    } else if (params.row.dealWithType === 5) {
-                      // 到货质检数量修正
-                      GetQuantityCheckLake({
-                        checkAdjustId: params.row.linkId
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = { ...res.result, ...params.row }
-                          _this.qtyCheckShow = true
+                      .then(res => {
+                        params.row.approveType = res.data.data
+                        e.stopPropagation()
+                        _this.formData = {}
+                        if (params.row.dealWithType === 0) {
+                          // 请购单审批
+                          GetApplyPurchasePageList({
+                            id: params.row.linkId,
+                            pageNum: 1,
+                            pageSize: 1
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = {
+                                ...res.result.list[0],
+                                ...params.row
+                              }
+                              _this.purchaseShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 1) {
+                          // 合同审批
+                          GetPurContractPageList({
+                            id: params.row.linkId,
+                            pageNum: 1,
+                            pageSize: 1
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = {
+                                ...res.result.list[0],
+                                ...params.row
+                              }
+                              _this.contractShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 2) {
+                          // 付款审批
+                          _this.formData = { ...params.row }
+                          _this.payShow = true
+                        } else if (params.row.dealWithType === 3) {
+                          // 领料申请
+                          GetApplyTakePageList({
+                            id: params.row.linkId,
+                            pageNum: 1,
+                            pageSize: 1
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = {
+                                ...res.result.list[0],
+                                ...params.row
+                              }
+                              _this.applyMaterialShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 4) {
+                          // 其他出库退货/报损
+                          GetApplyStockOutBill({
+                            id: params.row.linkId
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = { ...res.result, ...params.row }
+                              _this.otherShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 5) {
+                          // 到货质检数量修正
+                          GetQuantityCheckLake({
+                            checkAdjustId: params.row.linkId
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = { ...res.result, ...params.row }
+                              _this.qtyCheckShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 6) {
+                          // 物料审批
+                          _this.formData = { ...params.row }
+                          _this.materialApproveShow = true
+                        } else if (params.row.dealWithType === 7) {
+                          // 供应商调价
+                          GetChangePriceCheck({
+                            priceChangeId: params.row.linkId
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = { ...res.result, ...params.row }
+                              _this.providerPriceShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 8) {
+                          // 审核盘点
+                          _this.formData = { ...params.row }
+                          _this.profitShow = true
+                        } else if (params.row.dealWithType === 9) {
+                          // 归还入库
+                          GetApplyStockInBackRequestDto({
+                            id: params.row.linkId
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = { ...res.result, ...params.row }
+                              _this.returnShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 10) {
+                          // 合同删除
+                          GetPurchaseContractDel({
+                            id: params.row.linkId
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = { ...res.result, ...params.row }
+                              _this.delContractShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 11) {
+                          // 免检申请
+                          GetStockExemptCheck({
+                            exemptCheckId: params.row.linkId
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = { ...res.result, ...params.row }
+                              _this.noCheckShow = true
+                            }
+                          })
+                        } else if (params.row.dealWithType === 12) {
+                          // 供应商审批
+                          GetSupplierShipFlow({
+                            flowCheckId: params.row.flowChekId
+                          }).then(res => {
+                            if (res.code === 0) {
+                              _this.formData = { ...res.result, ...params.row }
+                              if (res.result.supplierApplyType === 0) {
+                                _this.providerShipmentShow = true
+                              } else if (res.result.supplierApplyType === 1) {
+                                _this.providerContractOverShow = true
+                              } else if (res.result.supplierApplyType === 2) {
+                                _this.providerTagDelShow = true
+                              }
+                            }
+                          })
+                        } else if (params.row.dealWithType === 13) {
+                          // 盘点标签处置
+                          _this.formData = { ...params.row }
+                          _this.profitTagFormShow = true
                         }
                       })
-                    } else if (params.row.dealWithType === 6) {
-                      // 物料审批
-                      _this.formData = { ...params.row }
-                      _this.materialApproveShow = true
-                    } else if (params.row.dealWithType === 7) {
-                      // 供应商调价
-                      GetChangePriceCheck({
-                        priceChangeId: params.row.linkId
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = { ...res.result, ...params.row }
-                          _this.providerPriceShow = true
-                        }
-                      })
-                    } else if (params.row.dealWithType === 8) {
-                      // 审核盘点
-                      _this.formData = { ...params.row }
-                      _this.profitShow = true
-                    } else if (params.row.dealWithType === 9) {
-                      // 归还入库
-                      GetApplyStockInBackRequestDto({
-                        id: params.row.linkId
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = { ...res.result, ...params.row }
-                          _this.returnShow = true
-                        }
-                      })
-                    } else if (params.row.dealWithType === 10) {
-                      // 合同删除
-                      GetPurchaseContractDel({
-                        id: params.row.linkId
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = { ...res.result, ...params.row }
-                          _this.delContractShow = true
-                        }
-                      })
-                    } else if (params.row.dealWithType === 11) {
-                      // 免检申请
-                      GetStockExemptCheck({
-                        exemptCheckId: params.row.linkId
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = { ...res.result, ...params.row }
-                          _this.noCheckShow = true
-                        }
-                      })
-                    } else if (params.row.dealWithType === 12) {
-                      // 供应商审批
-                      GetSupplierShipFlow({
-                        flowCheckId: params.row.flowChekId
-                      }).then(res => {
-                        if (res.code === 0) {
-                          _this.formData = { ...res.result, ...params.row }
-                          if (res.result.supplierApplyType === 0) {
-                            _this.providerShipmentShow = true
-                          } else if (res.result.supplierApplyType === 1) {
-                            _this.providerContractOverShow = true
-                          } else if (res.result.supplierApplyType === 2) {
-                            _this.providerTagDelShow = true
-                          }
-                        }
-                      })
-                    } else if (params.row.dealWithType === 13) {
-                      // 盘点标签处置
-                      _this.formData = { ...params.row }
-                      _this.profitTagFormShow = true
-                    }
                   }
                 }
               },
@@ -457,13 +499,27 @@ export default {
         }
       ],
       params: {
-        pageIndex: 1,
+        pageNum: 1,
         pageSize: 20,
-        total: 0
-      }
+        beginTime: '',
+        endTime: '',
+        checkState: 1,
+        total: 0,
+        keyword: ''
+      },
+      stateList:  [
+        { label: '待审批', value: 1 },
+        { label: '已审批', value: 2 },
+        { label: '已驳回', value: 3 },
+        { label: '已发起', value: 0 }
+      ],
+      flowList: []
     }
   },
   methods: {
+    selectTime() {
+      this.getList()
+    },
     pass (type) {
       ApprovalBillFlow({
         linkCheckId: this.selectList,
@@ -482,7 +538,6 @@ export default {
     },
     getSelect (selection, data) {
       this.selectList = selection.map(item => item.flowChekId)
-      console.log(this.selectList)
     },
     cfm (type, formData) {
       if (type === 'add') {
@@ -511,7 +566,7 @@ export default {
     eventHandle (option) {
       switch (option._evnet) {
         case 'search':
-          this.params.pageIndex = 1
+          this.params.pageNum = 1
           this.params.keyWord = option.key
           this.params.approvalFlowState = option.approvalFlowState
           this.params.dealWithType = option.dealWithType
@@ -520,7 +575,7 @@ export default {
         case 'export':
           GetDealWithItem({
             ...this.params,
-            pageIndex: 1,
+            pageNum: 1,
             pageSize: 99999
           }).then(res => {
             if (res.code === 0) {
@@ -535,18 +590,61 @@ export default {
           break
       }
     },
-    changePage (pageIndex) {
-      this.params.pageIndex = pageIndex
+    changePage (pageNum) {
+      this.params.pageNum = pageNum
       this.getList()
     },
     getList () {
-      GetDealWithItem(this.params).then(res => {
-        if (res.code === 0) {
-          this.data = res.result.list
-          this.params.total = res.result.totalCount
-        }
-      })
-    }
+      axios
+        .post('/cloudApi/applet/flowPage', {
+          ...this.params
+        })
+        .then(res => {
+          this.data = res.data.data.records
+          this.params.total = res.data.data.total
+        })
+      // GetDealWithItem(this.params).then(res => {
+      //   if (res.code === 0) {
+      //   }
+      // })
+    },
+    getFlowList() {
+      axios
+        .post('/cloudApi/applet/flowNum', {
+          beginTime: this.params.beginTime,
+          endTime: this.params.endTime,
+          checkState: this.params.checkState
+        })
+        .then(res => {
+          this.flowList = res.data.data
+        })
+    },
+    changeState() {
+      this.params.id = ''
+      this.getFlowList()
+      this.getList()
+    },
+    changeFlow() {
+      this.getList()
+    },
+    clickSearch() {
+      this.params.pageNum = 1
+      this.getList()
+    },
+    clickExportExcel() {
+      axios
+        .post('/cloudApi/applet/flowPage', {
+          ...this.params
+        })
+        .then(res => {
+          let data = res.data.data.records
+          if (data.length < 1) return this.$Message.error('数据为空!')
+          exportExcel(this.columns, data, '待办事项')
+        })
+    },
+  },
+  created () {
+    this.getFlowList()
   },
   mounted () {
     this.getList()
@@ -557,6 +655,17 @@ export default {
 <style lang="less" scoped>
 .container {
   height: 100%;
+  display: flex;
+  flex-direction: column;
+  .tab-nav {
+    display: flex;
+    align-items: center;
+    height: 32px;
+  }
+  .main {
+    flex: 1;
+    overflow: hidden;
+  }
 }
 /deep/ .ivu-modal-body {
   background: transparent;

+ 4 - 4
src/view/material-manege/material-apply-detail/material-apply-detail.vue

@@ -259,7 +259,7 @@ export default {
         }
       ],
       params: {
-        pageIndex: 1,
+        pageNum: 1,
         pageSize: 10,
         type: '3',
         beginTime: null,
@@ -336,7 +336,7 @@ export default {
     eventHandle(option) {
       switch (option._evnet) {
         case 'search':
-          this.params.pageIndex = 1
+          this.params.pageNum = 1
           this.params.keyWord = option.key
           this.params.beginTime = option.dateStartTime
           this.params.endTime = option.dateEndTime
@@ -507,8 +507,8 @@ export default {
           break
       }
     },
-    changePage(pageIndex) {
-      this.params.pageIndex = pageIndex
+    changePage(pageNum) {
+      this.params.pageNum = pageNum
       this.getList()
     },
     getHandleData() {