Browse Source

价格申报单、采购订单、采购需求单、调拨单、物料申请单列表增加流程收回功能;

001295 1 year ago
parent
commit
7c803781d3

+ 8 - 0
src/api/business/purchase/apply.js

@@ -57,3 +57,11 @@ export function failDownload(data) {
     responseType: 'blob'
     responseType: 'blob'
   })
   })
 }
 }
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
+}

+ 9 - 0
src/api/business/purchase/purchase-order.js

@@ -180,6 +180,14 @@ const downloadFailData = (data) =>{
   });
   });
 }
 }
 
 
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
+}
 
 
 
 
 export default {
 export default {
@@ -203,4 +211,5 @@ export default {
   orderExport,
   orderExport,
   orderImport,
   orderImport,
   downloadFailData,
   downloadFailData,
+  oaBack
 }
 }

+ 21 - 0
src/api/purchase/transferOrder.js

@@ -68,4 +68,25 @@ export function listStAllotItem(pid) {
     url: `/pu/allot/material/byPid/${pid}`,
     url: `/pu/allot/material/byPid/${pid}`,
     method: 'get',
     method: 'get',
   })
   })
+}
+
+//导入
+export function importData(data) {
+  return request({
+    url: `/pu/allot/importData`,
+    method: 'post',
+    data: data,
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    }
+  })
+}
+
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
 }
 }

+ 9 - 0
src/api/requisition/basic.js

@@ -159,3 +159,12 @@ export function toOA(userName, fdId) {
     method: 'get',
     method: 'get',
   })
   })
 }
 }
+
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
+}

+ 26 - 1
src/views/material/requisition/index.vue

@@ -115,6 +115,12 @@
                 @click.stop="deleteRow(scope.row)"
                 @click.stop="deleteRow(scope.row)"
                 v-if="scope.row.status == 0 || scope.row.status == 3"
                 v-if="scope.row.status == 0 || scope.row.status == 3"
               >删除</el-button>
               >删除</el-button>
+              <el-button 
+                v-if="scope.row.status == '1'" 
+                type="text" 
+                size="mini"
+                @click.stop="handleBack(scope.row)"
+              >流程收回</el-button>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
         </el-super-table>
         </el-super-table>
@@ -138,7 +144,7 @@
 
 
 <script>
 <script>
   import addReq from './add.vue';
   import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport,betchSubmit,toOA} from '@/api/requisition/basic';
+  import {getReqList, delReq, importData, fileImport,betchSubmit,toOA,oaBack} from '@/api/requisition/basic';
   import {saveAs} from "file-saver";
   import {saveAs} from "file-saver";
   import { blobValidate } from "@/utils/ruoyi";
   import { blobValidate } from "@/utils/ruoyi";
   import { SearchColumns, TableColumns } from './columns';
   import { SearchColumns, TableColumns } from './columns';
@@ -469,6 +475,25 @@
       //   this.queryParams.pageNum = val
       //   this.queryParams.pageNum = val
       //   this.getList(this.queryParams)
       //   this.getList(this.queryParams)
       // }
       // }
+      //流程收回
+      async handleBack(row){
+        try {
+          const { msg, code } = await oaBack({
+            fdTemplateId: '1873b5ce924f9cc37c06e884b1e9ee26',
+            fdId: row.oaId,
+            billCode: row.code,
+            billMaker: row.createBy
+          });
+          if (code === 200) {
+            this.$emit("success");
+            this.$notify.success(msg);
+          }
+        } catch (err) {
+          console.error(err);
+        } finally {
+          this.getList(this.queryParams);
+        }
+      },
     }
     }
   }
   }
 </script>
 </script>

+ 2 - 2
src/views/purchase/PurchaseDemandList/index.vue

@@ -209,7 +209,7 @@
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
             <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' || scope.row.status == '9'" @click="edit(scope.row)">编辑</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="edit(scope.row)">编辑</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="commit(scope.row)">提交</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @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 == '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' || scope.row.status == '9'" @click="deleteids(scope.row)">删除</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="deleteids(scope.row)">删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -687,7 +687,7 @@ export default {
     // 流程收回
     // 流程收回
     reback(row) {
     reback(row) {
       this.$modal.loading("收回中...");
       this.$modal.loading("收回中...");
-      let params = {billCode: row.code, fdId: row.flowId, fdTemplateId: '18804432233a7813df7921d436ab69b7' }
+      let params = {billCode: row.code, fdId: row.flowId, fdTemplateId: '18804432233a7813df7921d436ab69b7',billMaker: row.createBy }
       rebacktWork(params).then(res => {
       rebacktWork(params).then(res => {
         if (res.code === 200) {
         if (res.code === 200) {
           this.$modal.notifySuccess("收回成功");
           this.$modal.notifySuccess("收回成功");

+ 18 - 4
src/views/purchase/apply/index.vue

@@ -1,7 +1,7 @@
 <script>
 <script>
   import {dicts} from "./dicts";
   import {dicts} from "./dicts";
   import useColumns from "./columns";
   import useColumns from "./columns";
-  import {LIST, mbDownload, failDownload} from "@/api/business/purchase/apply";
+  import {LIST, mbDownload, failDownload,oaBack} from "@/api/business/purchase/apply";
   // 导入的token
   // 导入的token
   import {getToken} from "@/utils/auth";
   import {getToken} from "@/utils/auth";
 
 
@@ -172,8 +172,22 @@
         this.upload.open = true
         this.upload.open = true
       },
       },
       // 收回
       // 收回
-      reback(row) {
-        console.log(row)
+      async reback(row) {
+        try {
+          const { msg, code } = await oaBack({
+            fdTemplateId: '188095a870d007772057d7d4ffaad3c7',
+            fdId: row.flowId,
+            billCode: row.priceCode,
+            billMaker: row.createBy
+          });
+          if (code === 200) {
+            this.$emit("success");
+            this.$notify.success(msg);
+          }
+        } catch (err) {
+          console.error(err);
+        } finally {
+        }
       },
       },
     },
     },
   };
   };
@@ -268,7 +282,7 @@
         width="100"
         width="100"
         >
         >
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <!-- <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 == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-super-table>
     </el-super-table>

+ 25 - 1
src/views/purchase/purchase-order/index.vue

@@ -399,7 +399,25 @@ export default {
       })
       })
      
      
     },
     },
-
+    //流程收回
+    async handleBack(row){
+      try {
+        const { msg, code } = await orderApi.oaBack({
+          fdTemplateId: '1880447a834addc648b3763477a9b09f',
+          fdId: row.flowId,
+          billCode: row.code,
+          billMaker: row.createBy
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.fetchList(this.params, this.page);
+      }
+    },
     // 判断“整单退回”按钮
     // 判断“整单退回”按钮
     judgeIsAllReturn() {
     judgeIsAllReturn() {
       if (this.checkedList.length == 1) {
       if (this.checkedList.length == 1) {
@@ -748,6 +766,12 @@ export default {
                 @click.stop="handleSubmit(scope.row)"
                 @click.stop="handleSubmit(scope.row)"
               >提交</el-button>
               >提交</el-button>
               <el-button 
               <el-button 
+                v-if="scope.row.status == '1'" 
+                type="text" 
+                size="mini"
+                @click.stop="handleBack(scope.row)"
+              >流程收回</el-button>
+              <el-button 
                 v-if="scope.row.flowId && scope.row.flowId !== '' && scope.row.status !== '9'" 
                 v-if="scope.row.flowId && scope.row.flowId !== '' && scope.row.status !== '9'" 
                 type="text" 
                 type="text" 
                 size="mini"
                 size="mini"

+ 85 - 2
src/views/purchase/transferOrder/index.vue

@@ -72,7 +72,24 @@
 
 
       
       
         <div class="btn_grooup">
         <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="addOrder">新增</el-button>
+          <el-button-group>
+            <el-button type="primary" size="mini" @click="addOrder">新增</el-button>
+          </el-button-group>
+          <el-button-group>
+            <el-dropdown @command="btnImport">
+              <el-button type="primary" size="mini">
+                导入<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <!-- <el-dropdown-item command="useImportTemplate">模板下载</el-dropdown-item> -->
+                <el-button size="mini" type="primary" @click="useImportTemplate">模板下载</el-button>
+                <!-- <el-dropdown-item command="useImportData">数据导入</el-dropdown-item> -->
+                <el-upload ref="upload" action="" :http-request="onUpload">
+                  <el-button size="mini" type="primary">数据导入</el-button>
+                </el-upload>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-button-group>
         </div>
         </div>
 
 
         <el-table 
         <el-table 
@@ -136,6 +153,7 @@
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
             <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="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 == '0' || scope.row.status == '3'" @click="commit(scope.row)">提交</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '1'" @click="handleBack(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>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -335,7 +353,7 @@
 import Add from './add.vue'
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import Refers from '@/components/Refers/refers.vue'
 import Refers from '@/components/Refers/refers.vue'
-import {getOrderList, delOrder, submitOrder,listStAllotItem } from '@/api/purchase/transferOrder.js'
+import {getOrderList, delOrder, submitOrder,listStAllotItem,importData,oaBack } from '@/api/purchase/transferOrder.js'
 export default {
 export default {
   name: 'transferOrder',
   name: 'transferOrder',
   dicts: ['sys_allot_billtype'],
   dicts: ['sys_allot_billtype'],
@@ -577,6 +595,62 @@ export default {
         this.queryParams.createBy = selection[0].code
         this.queryParams.createBy = selection[0].code
       }
       }
     },
     },
+    //导入按钮
+    btnImport(command){
+      if(command == 'useImportTemplate'){
+        this.useImportTemplate();
+      }
+      if(command == 'useImportData'){
+        this.useImportData();
+      }
+    },
+    //模板下载
+    useImportTemplate(){
+      this.download('pu/allot/importTemplate', {
+      }, `调拨单导入模板_${new Date().getTime()}.xlsx`)
+    },
+    //导入
+    useImportData(){
+      console.log("导入");
+    },
+    // 上传文件
+    onUpload (file) {
+      let formData = new FormData()
+      formData.append('file',file.file)
+      importData(formData).then((res) => {
+        console.log('res',res);
+        if(res.code == '200'){
+          this.$message.success(res.msg);
+        }else{
+          this.$message.success(res.msg);
+        }
+      }).catch((e) => {
+        console.log('e',e);
+        this.$message.error(e.message)
+      }).finally((e) => {
+        this.$refs['upload'].clearFiles();
+      })
+    },
+    //流程收回
+    async handleBack(row){
+      try {
+        const { msg, code } = await oaBack({
+          fdTemplateId: '188095b2398846ad82cad7a46ef9a971',
+          fdId: row.oaId,
+          billCode: row.code,
+          billMaker: row.createBy
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.getList(this.queryParams);
+      }
+    },
+
   }
   }
 
 
 }
 }
@@ -611,4 +685,13 @@ export default {
 .exporttable {
 .exporttable {
   border: solid 1px #c0c0c0;
   border: solid 1px #c0c0c0;
  }
  }
+.el-dropdown {
+  vertical-align: top;
+}
+.el-dropdown + .el-dropdown {
+  margin-left: 15px;
+}
+.el-icon-arrow-down {
+  font-size: 12px;
+}
 </style>
 </style>