Browse Source

审批流 页面

qinbai 3 years ago
parent
commit
6f73e2bc71

+ 9 - 0
src/api/examineApprove/interface.js

@@ -0,0 +1,9 @@
+import request from '@/router/axios';
+
+export const examineApproveSubmit = (data) => {
+  return request({
+    url: '/api/blade-desk/process/check/start-process',
+    method: 'post',
+    data:data,
+  })
+}

+ 62 - 0
src/components/examineApprove/config/startDialog.json

@@ -0,0 +1,62 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuPosition": "right",
+  "searchMenuSpan": 6,
+  "tree": true,
+  "selection": true,
+  "addBtn": false,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 150,
+  "column":[
+    {
+      "label": "租户编号",
+      "prop": "tenantId",
+      "search": true,
+      "index": 1,
+      "width":150
+    },{
+      "label": "流程分类",
+      "prop": "category",
+      "search": true,
+      "row": true,
+      "dicUrl": "/api/blade-system/dict/dictionary?code=flow",
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      },
+      "dataType":"number",
+      "slot": true,
+      "index": 2,
+      "width":120
+    },{
+      "label": "流程标识",
+      "prop": "key",
+      "index": 4,
+      "width":120
+    },{
+      "label": "流程名称",
+      "prop": "name",
+      "search": true,
+      "index": 5,
+      "width":140
+    },{
+      "label": "状态",
+      "prop": "suspensionState",
+      "index": 6,
+      "width":120
+    },{
+      "label": "部署时间",
+      "prop": "deploymentTime",
+      "index": 7,
+      "width":150
+    }
+  ]
+}

+ 111 - 0
src/components/examineApprove/index.vue

@@ -0,0 +1,111 @@
+<template>
+  <div>
+    <avue-crud :option="option"
+               :table-loading="loading"
+               :data="data"
+               ref="crud"
+               @refresh-change="refreshChange"
+               :page.sync="page"
+               @on-load="onLoad">
+      <template slot-scope="scope" slot="menu">
+        <el-button type="text"
+                   size="small"
+                   plain
+                   class="none-border"
+                   @click.stop="handleStart(scope.row)">发起
+        </el-button>
+        <el-button type="text"
+                   size="small"
+                   plain
+                   class="none-border"
+                   @click.stop="handleImage(scope.row,scope.index)">流程图
+        </el-button>
+      </template>
+    </avue-crud>
+    <span slot="footer" class="dialog-footer">
+          <el-button @click="closeFunc == false">关 闭</el-button>
+  </span>
+    <el-dialog
+      title="配置"
+      :visible.sync="dialogConfiguration"
+      width="600px"
+      :modal-append-to-body="false"
+      :close-on-click-modal="false"
+      destroy-on-close
+    >
+      <examine-start
+        :processDefinitionId="processDefinitionId"
+        @dialogClose="dialogConfigurationClose"
+      ></examine-start>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import option from './config/startDialog.json'
+  import {startList} from "@/api/work/work";
+  import examineStart from "@/components/examineApprove/start";
+  export default {
+    name: "index",
+    // props: {
+    //   id: {
+    //     type: String
+    //   },
+    //   closeFunc: {
+    //     type: Boolean
+    //   }
+    // },
+    components:{
+      examineStart
+    },
+    data(){
+      return {
+        option:option,
+        loading:false,
+        data:[],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        dialogConfiguration:false,
+        processDefinitionId:'',
+      }
+    },
+    created() {
+
+    },
+    methods:{
+      refreshChange(){
+
+      },
+      onLoad(page, params = {}){
+        params.mode = '1';
+        this.loading = true;
+        startList(page.currentPage, page.pageSize,params).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+        })
+        .finally(()=>{
+          this.loading = false;
+        })
+      },
+      handleStart(row){
+        this.dialogConfiguration = true;
+        this.processDefinitionId = row.id
+      },
+      handleImage(){
+
+      },
+      dialogConfigurationClose() {
+        this.dialogConfiguration = false;
+        this.onLoad(this.page); //关闭刷新
+        this.$refs.crud.toggleSelection();
+      }
+    }
+  }
+</script>
+<style scoped>
+
+</style>

+ 94 - 0
src/components/examineApprove/start.vue

@@ -0,0 +1,94 @@
+<template>
+  <basic-container>
+    <avue-form :option="option" v-model="form" @submit="handleSubmit"/>
+  </basic-container>
+</template>
+
+<script>
+  import { examineApproveSubmit } from "@/api/examineApprove/interface";
+    export default {
+        name: "start",
+      props:{
+        processDefinitionId:{
+          type:String
+        }
+      },
+      data(){
+        return {
+          form: {},
+          option: {
+            group: [
+              {
+                column: [
+                  {
+                    label: '第一级审批人',
+                    prop: 'checkUser',
+                    type: 'select',
+                    dicUrl: `/api/blade-user/user-list`,
+                    props: {
+                      label: "account",
+                      value: "id"
+                    },
+                    span: 6,
+                    rules: [
+                      {
+                        required: true,
+                        message: '请选择第一级审批人',
+                        trigger: 'blur'
+                      }
+                    ]
+                  },
+                  {
+                    label: '第二级审批人',
+                    prop: 'checkSecondsUser',
+                    type: 'select',
+                    dicUrl: `/api/blade-user/user-list`,
+                    props: {
+                      label: "account",
+                      value: "id"
+                    },
+                    span: 6,
+                    rules: [
+                      {
+                        required: true,
+                        message: '请选择第二级审批人',
+                        trigger: 'blur'
+                      }
+                    ]
+                  },
+                  {
+                    label: '备注',
+                    prop: 'reason',
+                    type: 'textarea',
+                    span: 6,
+                    rules: [
+                      {
+                        required: true,
+                        message: '请输入请假理由',
+                        trigger: 'blur'
+                      }
+                    ]
+                  },
+                ]
+              },
+            ],
+          }
+        }
+      },
+      methods:{
+        handleSubmit(){
+          this.form.processDefinitionId = this.processDefinitionId
+          examineApproveSubmit(this.form).then(res =>{
+            console.log(res)
+          })
+        }
+      }
+    }
+</script>
+
+<style scoped>
+  .startFrom-input{
+    display:flex;
+    justify-content:center;
+  }
+</style>

+ 2 - 2
src/router/views/index.js

@@ -273,7 +273,7 @@ export default [{
     children: [
       {
         path: '/importTrade/receipt/index',
-        name:'收货单',
+        name:'进口收货单',
         meta: {
           i18n: '/importTrade/receipt/index',
           keepAlive: true
@@ -290,7 +290,7 @@ export default [{
     children: [
       {
         path: '/importTrade/invoice/index',
-        name:'发货单',
+        name:'进口发货单',
         meta: {
           i18n: 'importTrade/invoice/index',
           keepAlive: true

+ 14 - 1
src/views/purchase/contract/config/mainList.json

@@ -3,7 +3,7 @@
   "tip": false,
   "simplePage": true,
   "searchShow": true,
-  "searchMenuSpan": 24,
+  "searchMenuSpan": 12,
   "dialogWidth": "60%",
   "align": "center",
   "searchMenuPosition": "right",
@@ -41,6 +41,19 @@
       "width":150
     },
     {
+      "label": "供应商",
+      "prop": "corpId",
+      "search": true,
+      "index": 3,
+      "width":120
+    },{
+      "label": "采购商",
+      "prop": "purchaserId",
+      "search": true,
+      "index": 4,
+      "width":120
+    },
+    {
       "label": "付款日期/开证日期",
       "prop": "accountsCollectionDate",
       "type": "date",

+ 68 - 10
src/views/purchase/contract/detailsPage.vue

@@ -119,7 +119,7 @@
               </el-button>
               <el-button type="info"
                          size="small"
-                         @click=""
+                         @click="applicationDialog = true"
               >查看申请记录
               </el-button>
             </template>
@@ -151,7 +151,8 @@
       width="80%"
       :close-on-click-modal="false"
       :destroy-on-close="true"
-      :close-on-press-escape="false">
+      :close-on-press-escape="false"
+      v-dialog-drag>
       <el-row style="height: 0;">
         <el-col :span="5">
           <div>
@@ -183,6 +184,30 @@
                      :disabled="tableData.length !== 1">导入<</el-button>
         </span>
     </el-dialog>
+    <el-dialog
+      title="查看申请记录"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="applicationDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <basic-container>
+        <avue-crud :option="customerContact"
+                   :table-loading="applicationLoading"
+                   :data="applicationData"
+                   ref="applicationCrud"
+                   @refresh-change="applicationRefreshChange"
+                   :page.sync="applicationPage"
+                   @on-load="applicationOnLoad"></avue-crud>
+      </basic-container>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="applicationDialog = false ">关 闭</el-button>
+        </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -199,6 +224,7 @@ import uploadFile from "@/components/upload-file/main";
 //商品详情接口
 import {corpsattn, corpsbank,  getDeptLazyTreeS} from "@/api/basicData/configuration"
 import { getList } from "@/api/basicData/commodityType"
+import { contrastObj,contrastList } from "@/util/contrastData";
 export default {
   name: "detailsPage",
   props: {
@@ -321,6 +347,20 @@ export default {
       tableDataCost: [],
       treeDeptIdCost: '',
       choiceIndex: '',
+      //查看申请记录
+      applicationDialog:false,
+      applicationLoading:false,
+      applicationData:[],
+      applicationPage:{
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      //对比新旧数据信息
+      oldContactsData:[],
+      oldForm:{},
+      oldFeesList:[],
+      oldFilesList:[],
     //  基础信息
       basicData: {
         column: [
@@ -562,16 +602,20 @@ export default {
       let id = this.detailData.id.replace(/\"/g, "")
       detailListData(id).then(res => {
         this.form = res.data.data;
+        this.oldForm = res.data.data;
         this.configuration.dicData = this.form.corpsName
         this.pConfiguration.dicData = this.form.purchaserName
         if(res.data.data.itemsVOList){
           this.contactsData = res.data.data.itemsVOList
+          this.oldContactsData = res.data.data.itemsVOList
         }
         if(res.data.data.orderFeesList){
           this.orderFeesList = res.data.data.orderFeesList
+          this.oldFeesList = res.data.data.orderFeesList
         }
         if( res.data.data.orderFilesList){
           this.orderFilesList = res.data.data.orderFilesList
+          this.oldFilesList = res.data.data.orderFilesList
         }
       })
     }else{
@@ -639,16 +683,20 @@ export default {
               this.$message.success("操作成功!")
               detailListData(this.form.id).then(res => {
                 this.form = res.data.data;
+                this.oldForm = res.data.data;
                 this.configuration.dicData = this.form.corpsName
                 this.pConfiguration.dicData = this.form.purchaserName
                 if(res.data.data.itemsVOList){
                   this.contactsData = res.data.data.itemsVOList
+                  this.oldContactsData = res.data.data.itemsVOList
                 }
                 if(res.data.data.orderFeesList){
                   this.orderFeesList = res.data.data.orderFeesList
+                  this.oldFeesList = res.data.data.orderFeesList
                 }
                 if( res.data.data.orderFilesList){
                   this.orderFilesList = res.data.data.orderFilesList
+                  this.oldFilesList = res.data.data.orderFilesList
                 }
               })
             }
@@ -747,6 +795,14 @@ export default {
         }
       })
     },
+    //刷新
+    applicationRefreshChange(){
+
+    },
+    //申请记录
+    applicationOnLoad(){
+
+    },
     //点击商品明细选择触发
     commodityChoice(row) {
       this.dialogVisible = !this.dialogVisible
@@ -980,15 +1036,17 @@ export default {
       this.$message.success('发货成功')
     },
     backToList() {
-      this.$confirm("是否保存当前页面?", "提示", {
-        confirmButtonText: "保存",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.editCustomer(true)
-      }).catch(() => {
+      if(contrastObj(this.form,this.oldform) || contrastList(this.orderFeesList,this.olddata)){
+        this.$confirm("是否保存当前页面?", "提示", {
+          confirmButtonText: "保存",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          this.editCustomer(true)
+        })
+      }else{
         this.$emit("goBack");
-      })
+      }
     },
   }
 }

+ 11 - 1
src/views/purchase/contract/index.vue

@@ -3,6 +3,7 @@
     <basic-container v-if="show">
       <avue-crud :option="option"
                  :data="dataList"
+                 :table-loading="loading"
                  ref="crud"
                  v-model="form"
                  :page.sync="page"
@@ -89,6 +90,7 @@ export default {
   name: "index",
   data() {
     return {
+      loading:false,
       option: option,
       detailData:{},
       dataList: [],
@@ -215,7 +217,6 @@ export default {
       console.log('1')
     },
     onLoad(page, params) {
-      console.log()
       if(params){
         if (params.businesDate != undefined) {
           params.businesStartDate = params.businesDate[0]+ " " + "00:00:00";
@@ -238,9 +239,18 @@ export default {
         current: page.currentPage,
         tradeType:"JK"  //进口参数
       })
+      this.loading = true
       selectPurchaseList(queryParams).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
+        if (this.page.total) {
+          this.option.height = window.innerHeight - 350;
+        } else {
+          this.option.height = window.innerHeight - 305;
+        }
+      })
+      .finally(()=>{
+        this.loading = false
       })
     },
     //表格展开触发

+ 41 - 0
src/views/salesManagement/salesContract/detailsPage.vue

@@ -109,6 +109,7 @@
               <el-button type="info"
                          size="small"
                          :disabled="importInventoryData.length < 1"
+                         @click="payeeDialog = true"
               >收款记录
               </el-button>
             </template>
@@ -177,6 +178,29 @@
                      :disabled="tableData.length !== 1">导入</el-button>
         </span>
     </el-dialog>
+    <el-dialog
+      title="收款记录"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="payeeDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag>
+      <basic-container>
+        <avue-crud :option="importInventory"
+                   :table-loading="payeeLoading"
+                   :data="payeeData"
+                   ref="applicationCrud"
+                   @refresh-change="payeeRefreshChange"
+                   :page.sync="payeePage"
+                   @on-load="payeeOnLoad"></avue-crud>
+      </basic-container>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="payeeDialog = false ">关 闭</el-button>
+        </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -465,6 +489,15 @@ export default {
           }
         ],
       },
+      //收款记录
+      payeeDialog:false,
+      payeeLoading:false,
+      payeeData:[],
+      payeePage:{
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
       // 导入库存配置
       importInventory: importInventory,
       importInventoryForm: {},
@@ -670,6 +703,14 @@ export default {
         }
       });
     },
+    //刷新
+    payeeRefreshChange(){
+
+    },
+    //申请记录
+    payeeOnLoad(){
+
+    },
     //商品选中触发
     productSelection(selection){
       this.selection = selection

+ 62 - 0
src/views/workManagement/main-items/configuration/startDialog.json

@@ -0,0 +1,62 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuPosition": "right",
+  "searchMenuSpan": 6,
+  "tree": true,
+  "selection": true,
+  "addBtn": false,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "menuWidth": 150,
+  "column":[
+    {
+      "label": "租户编号",
+      "prop": "tenantId",
+      "search": true,
+      "index": 1,
+      "width":150
+    },{
+      "label": "流程分类",
+      "prop": "category",
+      "search": true,
+      "row": true,
+      "dicUrl": "/api/blade-system/dict/dictionary?code=flow",
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      },
+      "dataType":"number",
+      "slot": true,
+      "index": 2,
+      "width":120
+    },{
+      "label": "流程标识",
+      "prop": "key",
+      "index": 4,
+      "width":120
+    },{
+      "label": "流程名称",
+      "prop": "name",
+      "search": true,
+      "index": 5,
+      "width":140
+    },{
+      "label": "状态",
+      "prop": "suspensionState",
+      "index": 6,
+      "width":120
+    },{
+      "label": "部署时间",
+      "prop": "deploymentTime",
+      "index": 7,
+      "width":150
+    }
+  ]
+}

+ 109 - 8
src/views/workManagement/main-items/detailsPage.vue

@@ -66,7 +66,8 @@
             </el-button>
             <el-button type="info"
                        size="small"
-                       @click.stop="beforePleaseCheck">请 核
+                       :disabled="crudSelection == 0"
+                       @click.stop="pleaseCheckDialog = true">请 核
             </el-button>
           </template>
           <template slot="menuRight">
@@ -182,11 +183,75 @@
       <el-button type="primary" :disabled="this.userSelection.length == 1 ? false:true" @click="userConfirm" >确 定</el-button>
     </span>
     </el-dialog>
+    <el-dialog
+      title="请核"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="pleaseCheckDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag>
+      <examine-approve
+
+      >
+      </examine-approve>
+<!--      <basic-container>-->
+<!--        <avue-crud :option="pleaseCheckContact"-->
+<!--                   :table-loading="pleaseCheckLoading"-->
+<!--                   :data="pleaseCheckData"-->
+<!--                   ref="applicationCrud"-->
+<!--                   @refresh-change="pleaseCheckRefreshChange"-->
+<!--                   :page.sync="pleaseCheckPage"-->
+<!--                   @on-load="pleaseCheckOnLoad">-->
+<!--          <template slot-scope="scope" slot="menu">-->
+<!--            <el-button type="text"-->
+<!--                       size="small"-->
+<!--                       plain-->
+<!--                       class="none-border"-->
+<!--                       @click.stop="handleStart(scope.row)">发起-->
+<!--            </el-button>-->
+<!--            <el-button type="text"-->
+<!--                       size="small"-->
+<!--                       plain-->
+<!--                       class="none-border"-->
+<!--                       @click.stop="handleImage(scope.row,scope.index)">流程图-->
+<!--            </el-button>-->
+<!--          </template>-->
+<!--        </avue-crud>-->
+<!--      </basic-container>-->
+<!--      <span slot="footer" class="dialog-footer">-->
+<!--          <el-button @click="applicationDialog = false ">关 闭</el-button>-->
+<!--        </span>-->
+    </el-dialog>
+    <el-dialog title="流程图"
+               append-to-body
+               :visible.sync="flowBox"
+               :fullscreen="true">
+      <iframe
+        :src=flowUrl
+        width="80%"
+        height="700"
+        title="流程图"
+        frameBorder="no"
+        border="0"
+        marginWidth="0"
+        marginHeight="0"
+        scrolling="no"
+        allowTransparency="yes">
+      </iframe>
+      <span slot="footer"
+            class="dialog-footer">
+        <el-button @click="flowBox = false">关 闭</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
   import option from "./configuration/detailsPage.json";
+  import startOption from "./configuration/startDialog.json";
   import { projectDetail,editMianProject,updateItemStatus,getSysNo } from "@/api/workManagement/mainProject";
   //上传文件json
   import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json"
@@ -204,6 +269,11 @@
 
   //上传附件删除
   import { corpsbank } from "@/api/basicData/configuration"
+  //事务
+  import examineApprove from "@/components/examineApprove/index";
+  import {flowCategory, flowRoute} from "@/util/flow";
+  import {startList} from "@/api/work/work";
+
 
   export default {
     data() {
@@ -458,6 +528,19 @@
           total: 0,
           pageSize: 10
         },
+        //请核窗口定义
+        pleaseCheckDialog:false,
+        pleaseCheckContact:startOption,
+        pleaseCheckLoading:false,
+        pleaseCheckData:[],
+        pleaseCheckPage:{
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        //流程图
+        flowBox: false,
+        flowUrl: '',
       };
     },
     created() {
@@ -484,6 +567,9 @@
         this.paymentTerm = res.data.data;
       })
     },
+    components:{
+      examineApprove
+    },
     mounted() {
 
     },
@@ -570,7 +656,7 @@
       },
       //请核之前
       beforePleaseCheck(){
-        if(this.crudSelection.length!=0){
+        if(this.crudSelection){
           let resultUserName = [];
           let result = [];
           this.crudSelection.forEach(item=>{
@@ -598,11 +684,6 @@
               this.editMainProject(10086);
             })
           }
-        }else{
-          this.$message({
-            type: "error",
-            message: "请先选择一条数据!"
-          });
         }
       },
       //新增 修改
@@ -822,7 +903,27 @@
            this.$set(this.data[this.detailsSelect],'userName',this.userSelection[0].realName)
            this.userDialog = !this.userDialog
          }
-      }
+      },
+      pleaseCheckRefreshChange(){
+
+      },
+      pleaseCheckOnLoad(page, params = {}) {
+        params.mode = '1';
+        this.pleaseCheckLoading = true;
+        startList(page.currentPage, page.pageSize,params).then(res => {
+          const data = res.data.data;
+          this.pleaseCheckPage.total = data.total;
+          this.pleaseCheckData = data.records;
+          this.pleaseCheckLoading = false;
+        });
+      },
+      handleStart(row) {
+        this.$router.push({path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/form/${row.id}`});
+      },
+      handleImage(row) {
+        this.flowUrl = `/api/blade-flow/process/resource-view?processDefinitionId=${row.id}`;
+        this.flowBox = true;
+      },
     },
   };
 </script>