瀏覽代碼

工作台审核

黄梓星 1 年之前
父節點
當前提交
519a14a76c

+ 16 - 0
src/api/purchase/workSpace.js

@@ -7,4 +7,20 @@ export function getWorkSpaceList(data) {
     method: 'post',
     data: data
   })
+}
+// 工作台审批
+export function auditWork(data) {
+  return request({
+    url: `oaflow/approve`,
+    method: 'post',
+    data: data
+  })
+}
+// 统一所有页面的收回流程接口
+export function rebacktWork(data) {
+  return request({
+    url: `oaflow/rollback`,
+    method: 'post',
+    data: data
+  })
 }

+ 5 - 1
src/views/purchase/DemandSummary/index.vue

@@ -280,7 +280,11 @@
           <el-table-column show-overflow-tooltip v-if="showColumn.minPackage" label="最小包装量" align="center" prop="minPackage"  width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.minOrder" label="最小订货量" align="center" prop="minOrder"  width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.minBatch" label="最小批量" align="center" prop="minBatch"  width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
+            </template>
+          </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.modifyReason" label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
                 <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$index)"/>

+ 10 - 1
src/views/purchase/PurchaseDemandList/index.vue

@@ -209,6 +209,7 @@
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="commit(scope.row)">提交</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
@@ -317,6 +318,8 @@ import Add from './add.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+// 流程收回
+import { rebacktWork } from '@/api/purchase/workSpace.js'
 import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand } from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'PurchaseDemandList',
@@ -660,6 +663,12 @@ export default {
         this.$modal.closeLoading();
       })
     },
+    // 流程收回
+    reback(row) {
+      rebacktWork().then(res => {
+
+      })
+    },
     // 行内删除
     deleteids(row) {
       console.log('row', row)
@@ -678,7 +687,7 @@ export default {
         this.$modal.notifyWarning("请选中至少一条数据");
       } else {
         let param = this.ids.join()
-        this.$modal.confirm('确认信息').then(() => {
+        this.$modal.confirm('确认删除选中数据?').then(() => {
         delDemand(param).then(res => {
           if (res.code === 200) {
             this.$modal.notifySuccess("删除成功");

+ 1 - 0
src/views/purchase/apply/index.vue

@@ -50,6 +50,7 @@
     },
     computed: {},
     created() {
+      this.params.priceCode = this.$route.query.billCode
       this.useQuery(this.params, this.page);
     },
     methods: {

+ 56 - 11
src/views/purchase/workSpace/index.vue

@@ -31,7 +31,7 @@
       </div>
 
       <div class="btn_grooup">
-        <el-button type="primary" size="mini" @click="xxxx">批量同意</el-button>
+        <el-button type="primary" size="mini" @click="audits">批量审批</el-button>
       </div>
 
       <el-table
@@ -62,7 +62,7 @@
           >
           <template slot-scope="scope">
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
-            <el-button type="text" size="mini" @click="agree(scope.row)">同意</el-button>
+            <el-button type="text" size="mini" @click="audit(scope.row)">审批</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -83,7 +83,7 @@
 </template>
 
 <script>
-import { getWorkSpaceList } from '@/api/purchase/workSpace.js'
+import { getWorkSpaceList, auditWork } from '@/api/purchase/workSpace.js'
 export default {
   name: 'workSpace',
   dicts: ['oa_templete_id'],
@@ -97,7 +97,8 @@ export default {
       },
       loading: false,
       tableList: [],
-      total: 0
+      total: 0,
+      ids: []
     }
   },
   created() {
@@ -119,17 +120,61 @@ export default {
     searchList() {
       this.getList(this.queryParams)
     },
-    resetList() {},
-    handleSelectionChange() {},
-    rowSelect() {},
-    doubleClick() {},
-    xxxx() {},
+    resetList() {
+      this.queryParams = {
+        modelIds:[],
+        docSubject: '',
+        pageNum: 1,
+        pageSize: 20
+      }
+      this.searchList()
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.ids = selection
+      // console.log('选中数组', this.ids.join())
+    },
+    rowSelect(row) {
+      this.$refs.tables.toggleRowSelection(row);
+    },
+    doubleClick(row) {
+      this.check(row)
+    },
+    audits() {
+      if(this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        this.$modal.confirm('确认审批选中单据?').then(() => {
+        this.$modal.loading("审批中...");
+        auditWork(this.ids).then(res => {
+          if (res.code === 200) {
+            this.$modal.closeLoading();
+            this.$modal.notifySuccess("审批成功");
+            this.searchList()
+          }
+        })
+        }).catch(() => {
+          this.$modal.closeLoading();
+          this.searchList()
+        })
+      } 
+    },
     check(row) {
       console.log(row)
       this.$router.push({path: row.linkUrl ,query: {billCode: row.billCode}})
     },
-    agree(row) {
-      
+    audit(row) {
+      this.$modal.loading("审批中...");
+      auditWork([row]).then(res => {
+        if(res.code === 200) {
+          this.$modal.closeLoading();
+          this.$modal.notifySuccess("审批成功");
+          this.searchList()
+        }
+      }).catch(() => {
+        this.$modal.closeLoading();
+        this.searchList()
+      })
     },
     handleSizeChange(val) {
       this.queryParams.pageSize = val