Browse Source

采购销售 审批跳转

qinbai 3 years ago
parent
commit
e6aec06136

+ 2 - 2
src/components/bill/billApplication.vue

@@ -89,7 +89,7 @@
     },
     created() {
       //在账单处关闭了搜索条件  在此处要打开
-      this.historyOption.searchShow = true
+      this.option.searchShow = true
     },
     mounted() {
 
@@ -136,7 +136,7 @@
       onLoad(page, params = {}) {
         this.loading = true;
         params.srcParentId = this.billId
-        if (params.createTime != undefined) {  //合同
+        if (params.createTime && params.createTime.length !== 0) {  //合同
           params.createStartDate = params.createTime[0]+ " " + "00:00:00";
           params.createEndDate = params.createTime[1] + " " + "23:59:59";
           this.$delete(params,'createTime')

+ 1 - 1
src/components/finance/config/option.json

@@ -49,7 +49,7 @@
     },
     {
       "label": "所属公司",
-      "prop": "belongCompany",
+      "prop": "belongToCorpId",
       "overHidden": true,
       "index": 4,
       "width": 180,

+ 2 - 3
src/components/finance/financialAccount.vue

@@ -52,7 +52,6 @@
             corpType="GS"
             style="width: 100%"
           ></crop-select>
-          <span v-else>{{ row.costType }}</span>
         </template>
         <template slot-scope="{row,index}" slot="costType">
           <span v-if="row.$cellEdit" class="required_fields">*</span>
@@ -114,8 +113,8 @@
         <el-button type="primary" size="small" :loading="submitButton" @click="submit()">确定</el-button>
       </div>
     </basic-container>
-    <containerTitle title="历史账单"></containerTitle>
-    <basic-container>
+    <containerTitle v-if="billId" title="历史账单"></containerTitle>
+    <basic-container v-if="billId">
       <avue-crud :option="historyOption"
                  :data="historyDataList"
                  ref="historyCrud"

+ 1 - 0
src/views/approveData/index.vue

@@ -183,6 +183,7 @@ let previousRouterName = ""
               }
             });
           }else{
+            this.$router.$avueRouter.closeTag(row.url);
             this.$router.push({
               path: row.url,
               query: {check : row},

+ 103 - 8
src/views/purchase/contract/detailsPage.vue

@@ -5,7 +5,7 @@
         <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
                    @click="backToList">返回列表
         </el-button>
-      <div  class="upper_right_button">
+      <div v-if="!auditDisabled" class="upper_right_button">
         <el-button type="primary"
                    size="small"
                    v-if="viewDisabled"
@@ -21,12 +21,12 @@
             :loading="buttonLoading"
             :disabled="!form.id || checkDisabled || viewDisabled"
           >
-            审处理<i class="el-icon-arrow-down el-icon--right"></i>
+            审处理<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item  :loading="buttonLoading" @click.native="auditCheck">审核数据</el-dropdown-item>
-            <el-dropdown-item v-if="false" @click.native="">审核进度</el-dropdown-item>
-            <el-dropdown-item v-if="false">撤销审核</el-dropdown-item>
+            <el-dropdown-item  :loading="buttonLoading" @click.native="auditCheck">提交审批</el-dropdown-item>
+            <el-dropdown-item  v-if="false" @click.native="checkScheduleDialog = true">审批进度</el-dropdown-item>
+            <el-dropdown-item  v-if="false">撤销审批</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
 
@@ -81,6 +81,23 @@
         >保存数据
         </el-button>
       </div>
+        <div v-if="auditDisabled" class="upper_right_button">
+          <el-button type="primary"
+                     size="small"
+                     class="el-button--small-yh"
+                     :loading="buttonLoading"
+                     @click.stop="checkScheduleDialog = true,checkId=detailData.check.srcBillId">
+            审批流程
+          </el-button>
+          <el-button type="primary"
+                     size="small"
+                     class="el-button--small-yh"
+                     :loading="buttonLoading"
+                     :disabled="buttonDisabled"
+                     @click.stop="checkDialog = true">
+            审批
+          </el-button>
+        </div>
     </div>
     </div>
     <div class="customer-main">
@@ -366,6 +383,7 @@
       v-dialog-drag
     >
       <financial-account
+        :billId="form.id"
         :billType="billType"
         :billData="billData"
         :checkData="checkData"
@@ -373,6 +391,43 @@
       >
       </financial-account>
     </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批进度"
+      class="el-dialogDeep"
+      :visible.sync="checkScheduleDialog"
+      width="40%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check-schedule
+        :checkId="form.id"
+        :batchNo="batchNo"
+        @choceScheduleFun="choceScheduleFun"
+      >
+      </check-schedule>
+    </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批"
+      class="el-dialogDeep"
+      :visible.sync="checkDialog"
+      width="50%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check
+        :checkData="detailData.check"
+        :checkDetail="false"
+        :idList="[]"
+        @choceCheckFun="choceCheckFun"
+      >
+      </check>
+    </el-dialog>
   </div>
 </template>
 
@@ -390,6 +445,8 @@ import { contrastObj,contrastList } from "@/util/contrastData";
 import ApplyPayment from "../../../components/finance/applyPayment";
 import financialAccount from "../../../components/finance/financialAccount";
 import { pleaseCheck } from "@/api/basicData/configuration"
+import checkSchedule from "../../../components/check/checkSchedule";
+import check from "@/components/check/check";
 
 export default {
   name: "detailsPage",
@@ -411,7 +468,9 @@ export default {
     financialAccount,
     feeInfo,
     uploadFile,
-    billApplication
+    billApplication,
+    checkSchedule,
+    check
   },
   data() {
     return {
@@ -422,14 +481,20 @@ export default {
       contactsData: [],
       itemTypeList:[],
       buttonLoading:false,
+      buttonDisabled:false,
       applyPaymentDialog:false,
       applicationDialog:false,
       financialAccountDialog:false,
+      checkScheduleDialog:false,//审批窗口
+      auditDisabled:false,
+      checkDialog:false,//审批窗口
       commodityData: false,
       takeDisabled:false, //收货状态
       viewDisabled:false,//查看状态
       checkDisabled:false,
+      approverDisabled:false,//审批
       tableData: [],
+      batchNo:'',
       billType:"",
       billData:{},
       contractTypeDic:[],
@@ -770,6 +835,22 @@ export default {
         this.buttonLoading = false;
       })
     }
+    if(this.detailData.check){
+      //待审批状态才可选择通过或者驳回
+      if(this.detailData.check.auditStatus === "S"){
+        this.buttonDisabled = false
+      }
+      this.viewDisabled = true //查看审批不能编辑
+      this.auditDisabled = true
+      this.buttonLoading = true;
+      this.batchNo = this.detailData.check.batchNo
+      let id = this.detailData.check.srcBillId.replace(/\"/g, "")
+      detailListData(id).then(res => {
+        this.afterEcho(res.data.data)
+      }).finally(()=>{
+        this.buttonLoading = false;
+      })
+    }
   },
   methods: {
     //选择货品物种
@@ -996,6 +1077,8 @@ export default {
         itemType:"采购",    //区分采购还是销售
         optionType:'JK',   //区分贸易类型
         billNoList: Array.from(new Set( this.contactsData.map(item =>{return item.billNo}))),
+        amount:this.form.orderAmount,
+        belongToCorpId:this.form.belongToCorpId,
         price:this.form.salesPrice,
         corpsName:this.form.corpsName,
         corpId:this.form.corpId,
@@ -1028,8 +1111,8 @@ export default {
             id : this.form.id,
             checkType: 'cgqh',
             url: '/purchase/contract/index',
-            pageStatus:"this.$store.getters.importCGStatus",
-            pageLabel:"采购订单(I)",
+            pageStatus:"this.$store.getters.entranceCgStatus",
+            pageLabel:"采购订单",
             checkFlag: 1,
           }
 
@@ -1037,6 +1120,7 @@ export default {
             if(res.data.success){
               this.$message.success("操作成功!")
               this.viewDisabled = true
+              this.approverDisabled = true
             }
           })
         }).finally(()=>{
@@ -1106,6 +1190,13 @@ export default {
     //点击行可编辑
     handleRowClick(row, event, column) {
     },
+    //关闭审核
+    choceCheckFun(){
+      this.checkDialog = false;
+    },
+    choceScheduleFun(){
+      this.checkScheduleDialog = false
+    },
     verificationData(){
       this.orderFeesList = this.$refs.feeInfo.submitData();
       if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
@@ -1177,6 +1268,10 @@ export default {
       }
     },
     async openEdit() {
+      if(this.approverDisabled || this.form.status != 0){ //是否审批
+        this.$message.warning("此订单已提交审批,不可编辑!")
+        return
+      }
       //标签页保存key
       this.inDetailsKey(this.$route.name,this.detailData.lockData);
       //单据是否锁定

+ 14 - 0
src/views/purchase/contract/index.vue

@@ -127,6 +127,20 @@ export default {
   async created() {
     this.option = await this.getColumnData(this.getColumnName(36), option);
   },
+  activated() {
+    if(!this.show && !this.$store.getters.entranceCgStatus){
+      this.show = true;
+    }
+    setTimeout(() => {
+      if(this.$route.query.check && this.show){
+        this.detailData={
+          check:this.$route.query.check
+        }
+        this.show = false;
+        this.$store.commit("ENTRANCE_IN_DETAIL");
+      }
+    }, 100);
+  },
   mounted() {
 
   },

+ 104 - 7
src/views/salesManagement/salesContract/detailsPage.vue

@@ -6,7 +6,7 @@
                    @click="backToList">返回列表
         </el-button>
       </div>
-      <div class="upper_right_button">
+      <div v-if="!auditDisabled" class="upper_right_button">
         <el-button type="primary"
                    size="small"
                    v-if="viewDisabled"
@@ -84,6 +84,23 @@
           </el-button>
         </div>
       </div>
+      <div v-if="auditDisabled" class="upper_right_button">
+        <el-button type="primary"
+                   size="small"
+                   class="el-button--small-yh"
+                   :loading="buttonLoading"
+                   @click.stop="checkScheduleDialog = true,checkId=detailData.check.srcBillId">
+          审批流程
+        </el-button>
+        <el-button type="primary"
+                   size="small"
+                   class="el-button--small-yh"
+                   :loading="buttonLoading"
+                   :disabled="buttonDisabled"
+                   @click.stop="checkDialog = true">
+          审批
+        </el-button>
+      </div>
     </div>
     <div class="customer-main">
       <el-form :model="form" ref="form" label-width="130px">
@@ -374,6 +391,7 @@
       v-dialog-drag
     >
       <financial-account
+        :billId="form.id"
         :billType="billType"
         :billData="billData"
         @choceFun="choceFun"
@@ -398,6 +416,43 @@
       >
       </bill-application>
     </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批进度"
+      class="el-dialogDeep"
+      :visible.sync="checkScheduleDialog"
+      width="40%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check-schedule
+        :checkId="form.id"
+        :batchNo="batchNo"
+        @choceScheduleFun="choceScheduleFun"
+      >
+      </check-schedule>
+    </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批"
+      class="el-dialogDeep"
+      :visible.sync="checkDialog"
+      width="50%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check
+        :checkData="detailData.check"
+        :checkDetail="false"
+        :idList="[]"
+        @choceCheckFun="choceCheckFun"
+      >
+      </check>
+    </el-dialog>
   </div>
 </template>
 
@@ -417,6 +472,9 @@ import { isPercentage,roundNumbers } from "@/util/validate";
 import financialAccount from "../../../components/finance/financialAccount";
 import ApplyPayment from "../../../components/finance/applyPayment";
 import  billApplication from "@/components/bill/billApplication";
+import checkSchedule from "../../../components/check/checkSchedule";
+import check from "@/components/check/check";
+import { pleaseCheck } from "@/api/basicData/configuration"
 
 export default {
   name: "detailsPage",
@@ -438,7 +496,9 @@ export default {
     feeInfo,
     financialAccount,
     uploadFile,
-    billApplication
+    billApplication,
+    checkSchedule,
+    check
   },
   data() {
     return {
@@ -451,6 +511,12 @@ export default {
       checkDisabled:false,
       viewDisabled:false,
       takeDisabled:false,
+      buttonDisabled:false,
+      checkScheduleDialog:false,//审批窗口
+      auditDisabled:false,//显示审批按钮还是正常按钮
+      checkDialog:false,//审批窗口
+      approverDisabled:false,//是否审批过了
+      batchNo:'',//审批流程
       lockData:{},
       form: {},
       orderFeesList:[],
@@ -740,6 +806,23 @@ export default {
       let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
       this.$set(this.form,"businesDate",strDate)
     }
+
+    if(this.detailData.check){
+      //待审批状态才可选择通过或者驳回
+      if(this.detailData.check.auditStatus === "S"){
+        this.buttonDisabled = false
+      }
+      this.viewDisabled = true //查看审批不能编辑
+      this.auditDisabled = true
+      this.buttonLoading = true;
+      this.batchNo = this.detailData.check.batchNo
+      let id = this.detailData.check.srcBillId.replace(/\"/g, "")
+      detailSaleList(id).then(res => {
+        this.afterEcho(res.data.data)
+      }).finally(()=>{
+        this.buttonLoading = false;
+      })
+    }
   },
   methods: {
     valueName(value,row){
@@ -824,6 +907,8 @@ export default {
         itemType:"销售",
         optionType:'JK',
         billNoList: this.importInventoryData.map(item =>{return item.billNo}),
+        amount:this.form.orderAmount,
+        belongToCorpId:this.form.belongToCorpId,
         corpsName:this.form.corpName,
         corpId:this.form.corpId,
         price:this.form.salesPrice,
@@ -876,17 +961,18 @@ export default {
           this.buttonLoading = true
           const data = {
             id : this.form.id,
-            checkType: 'cgqh',
-            url: '/purchase/contract/index',
-            pageStatus:"this.$store.getters.importCGStatus",
-            pageLabel:"采购订单(I)",
-            checkFlag: 1,
+            checkType: 'xsqh',
+            url: '/salesManagement/salesContract/index',
+            pageStatus:"this.$store.getters.entranceXsStatus",
+            pageLabel:"销售订单",
+            checkFlag: 2,
           }
 
           pleaseCheck(data).then(res=>{
             if(res.data.success){
               this.$message.success("操作成功!")
               this.viewDisabled = true
+              this.approverDisabled = true
             }
           })
         }).finally(()=>{
@@ -959,6 +1045,13 @@ export default {
     rowUpdateList(row, index, done, loading) {
       done(row);
     },
+    //关闭审核
+    choceCheckFun(){
+      this.checkDialog = false;
+    },
+    choceScheduleFun(){
+      this.checkScheduleDialog = false
+    },
     //删除商品明细触发
     rowDelList(row, index, donerowDel) {
       this.$confirm("确定将选择数据删除?", {
@@ -1166,6 +1259,10 @@ export default {
       }
     },
     async openEdit() {
+      if(this.approverDisabled || this.form.status != 0){ //是否审批
+        this.$message.warning("此订单已提交审批,不可编辑!")
+        return
+      }
       //标签页保存key
       this.inDetailsKey(this.$route.name,this.detailData.lockData);
       //单据是否锁定

+ 19 - 10
src/views/salesManagement/salesContract/index.vue

@@ -131,6 +131,20 @@ export default {
   async created() {
     this.option = await this.getColumnData(this.getColumnName(38), option);
   },
+  activated() {
+    if(!this.show && !this.$store.getters.entranceXsStatus){
+      this.show = true;
+    }
+    setTimeout(() => {
+      if(this.$route.query.check && this.show){
+        this.detailData={
+          check:this.$route.query.check
+        }
+        this.show = false;
+        this.$store.commit("XSACE_IN_DETAIL");
+      }
+    }, 100);
+  },
   methods: {
     //表格展开触发
     expandChange(row, expendList) {
@@ -167,6 +181,11 @@ export default {
     },
     //新增跳转页面
     beforeOpen(row, status) {
+      this.show = false;
+      this.$store.commit("XSACE_IN_DETAIL");
+    },
+    //查看跳转页面
+    beforeOpenPage(row) {
       let lockData = {
         moduleName: 'xs',
         tableName: 'business_order',
@@ -180,16 +199,6 @@ export default {
         view:true,
         lockData:lockData,
       };
-
-      this.show = false;
-      this.$store.commit("XSACE_IN_DETAIL");
-    },
-    //查看跳转页面
-    beforeOpenPage(row) {
-      this.detailData = {
-        id: row.id,
-        view:true
-      };
       this.show = false;
       this.$store.commit("XSACE_IN_DETAIL");
     },

+ 1 - 1
src/views/wel/components/quick-launch.vue

@@ -25,7 +25,7 @@
         </div>
         <div class="content-icon" @click="inPage('sqfk')">
           <i class="tradingIcon icon-apply" style="color:#BE3216"></i>
-          <span>申请付款</span>
+          <span>付费申请</span>
         </div>
         <div class="content-icon" @click="inPage('ff')">
           <i class="tradingIcon icon-pay" style="color:#7E8270"></i>

+ 2 - 2
vue.config.js

@@ -26,8 +26,8 @@ module.exports = {
     proxy: {
       '/api': {
         //本地服务接口地址
-        // target: 'http://192.168.1.177:1080',
-        // target: 'http://192.168.1.151:1080',
+        // target: 'http://192.168.1.12:1080',
+        // target: 'http://192.168.1.117:1080',
         // 打包地址.
         // target: 'http://121.37.83.47:10004',//服务器ip
         target: 'http://trade.tubaosoft.com:10004',//服务器域名