Kaynağa Gözat

feat:发票申请驳回后上传

snow 1 yıl önce
ebeveyn
işleme
994c2fad39

+ 3 - 2
src/apis/service/customerService/paymentApply/index.js

@@ -10,8 +10,9 @@ export default {
   status: (data, params) => http(api + "status", data, "post", params),
   // 分页查询 反馈列表
   feedList: (data, params) => http(api + "consultbidlist", data, "post", params),
- // 分页查询
- list: (data, params) => http(api + "list", data, "post", params),
+  // 分页查询
+  list: (data, params) => http(api + "list", data, "post", params),
+  batch: (data, params) => http(api + "batch", data, "post", params),
 
 
   // 添加

+ 1 - 0
src/apis/service/platformService/invoice/index.js

@@ -5,6 +5,7 @@ export default {
   // 分页查询
   list: (data, params) => http(api + "list", data, "post", params),
   batch: (data, params) => http(api + "status", data, "post", params),
+  download: (data, params) => http(api + "download", data, "post", params),
   // 添加
   add: (data, params) => http(api + "unitcreate", data, "post", params),
   // 更新

+ 8 - 0
src/components/manage/src/letter/index.vue

@@ -85,6 +85,7 @@
       @submit="handleSubmit"
       @refresh="refresh"
       @activitySubmit="file => onUpdateLetter(file)"
+      @abnormal="abnormal"
       :isFile="isFile"
       :title="title" 
       :type="type"
@@ -190,6 +191,10 @@ export default {
         return
       }
 
+      if(letter.code === 0){
+        this.abnormal()
+      }
+
       if(letter.code !== 1) return
       //创建获取获取新id进入编辑页...
       this.$router.push(`/customerService/letterEditing?id=${letter.data.id}&from=${form}&type=create`)
@@ -241,6 +246,9 @@ export default {
       this.xlsxVisible = true
     },
 
+    abnormal(){
+      this.$emit('abnormal')
+    },
     async onPublish(row){
       if(Number(row.is_check) === 1 && this.type !== 'settlement'){
         this.$message.warning('当前预算函已经被选中,无法取消发布!')

+ 5 - 4
src/components/manage/src/letter/xlsxUploadModal.vue

@@ -241,7 +241,6 @@ export default {
           if(property === mapFields.nonTaxQuotes){
             //校验:非税报价 + 税额 = 含税报价
             const total = add_sum(tableItem[mapFields.nonTaxQuotes], tableItem[mapFields.tax])
-            console.log(total)
             if(Number(total) !== Number(tableItem[mapFields.taxIncludedQuote])){
               this.$message.warning(`第 ${line} 行 : 非税报价 + 税额必须等于含税报价`)
               return
@@ -322,8 +321,6 @@ export default {
         this.file_url = plan_file
       }
 
-
-
       const planinfo = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => ({
         ...prev,
         [currentKey]: tableItem[currentKey]
@@ -332,7 +329,11 @@ export default {
       this.loading = true
       const { code } = await this.requsetMethod(planinfo, this.file_url, this.storeId)
       this.loading = false
-      if(code !== 1) return
+
+      if(code !== 1){
+        return
+      }
+
       this.$emit('refresh')
       this.innerVisible = false
     }

+ 10 - 2
src/views/customerService/invoiceApproval/index.vue

@@ -120,7 +120,7 @@
                   :size="searchSize"
                   type="primary"
                   style="float: right; margin-left: 5px"
-                  @click="searchList"
+                  @click="downloadInvoice"
                 >
                   下载发票数据
                 </el-button>
@@ -332,9 +332,17 @@ export default {
       this.visible = false
       this.searchList()
     },
+    downloadInvoice(){
+      if(this.selected.length === 0){
+        this.$message.warning('至少选择一个发票申请')
+        return
+      }
+
+      const ids = this.selected.map(({id}) => id)
+    },
     onBatchApprovalInvoice(){
       if(this.selected.length === 0){
-        this.$message.warning('至少选择一张状态为 "待确认" 的发票申请')
+        this.$message.warning('至少选择一状态为 "待确认" 的发票申请')
         return
       }
 

+ 3 - 0
src/views/customerService/paymentApply/columns.js

@@ -57,6 +57,9 @@ const editColumns = [
 ]
 
 const listCol = [
+  {
+    type:'selection'
+  },
   {
     prop: 'DzNo',
     label: '付款申请编号',

+ 6 - 4
src/views/customerService/paymentApply/detail.vue

@@ -11,6 +11,7 @@
                 :newTime="newTime"
                 :sitem="sitem"
                 :columns="editColumns"
+                @selection-change="handleSelection"
               >
                 <template #status>
                   <el-tag size="mini">
@@ -42,9 +43,9 @@
 </template>
 <script>
 import asyncRequest from "@/apis/service/customerService/paymentApply";
+import { editColumns, statusList } from "./columns";
 import privateField from '@/mixins/privateField';
 import resToken from "@/mixins/resToken";
-import { editColumns, statusList } from "./columns";
 import { mapGetters } from "vuex";
 
 export default {
@@ -75,7 +76,7 @@ export default {
       status: "",
       sitem: null,
       status_loading:false,
-
+      selected:[],
       orderItem: {},
       moneyDirItem: {},
       moneyItem: {},
@@ -138,12 +139,13 @@ export default {
       if(code !== 1) return
       this.sitem = data
       this.newTime = this.getNewTime()
-
-
     },
     getNewTime() {
       this.newTime = new Date().valueOf();
     },
+    handleSelection({list}){
+      this.selected = list
+    },
     async statusSubmit(model, title) {
       if (model.status === "0") model.status = "2";
       const { code, data, message } = await asyncRequest.status(model);

+ 45 - 19
src/views/customerService/paymentApply/index.vue

@@ -10,6 +10,7 @@
         :size="size"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
+        @selection-change="handleSelection"
         @screen-reset="
           pageInfo.curr = 1;
           parmValue.page = 1;
@@ -94,13 +95,6 @@
                   searchList();
                 "/>
               </el-col>
-                <!-- <el-select size="mini" v-model="parmValue[mapFields.demandCompany]" placeholder="需求企业"  @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                ">
-                  <el-option />
-                </el-select> -->
                 <el-col :span="4" style="margin-left:10px">
                    <search-customer style="width:100%" size="mini" placeholder="需求公司" :value.sync="parmValue[mapFields.demandCompany]" @change="
                      pageInfo.curr = 1;
@@ -109,6 +103,17 @@
                      " 
                    />
                  </el-col>
+
+              <el-col :span="3" style="width: 66px; float: right">
+                <el-button
+                  :size="searchSize"
+                  type="primary"
+                  style="float: right; margin-left: 5px"
+                  @click="handleApproval"
+                >
+                  批量审核付款申请
+                </el-button>
+              </el-col>
             </el-row>
           </div>
         </template>
@@ -177,7 +182,7 @@ export default {
       mapFields,
       statusList,
       sitem: null,
-
+      selected:[],
       loading: false,
       showModel: false,
       isDetail: false,
@@ -220,16 +225,10 @@ export default {
     const { back } = this.$route.query;
     if (back) {
       this.parmValue = JSON.parse(back);
-      console.log(this.parmValue)
-      const {page,size}=this.parmValue;
-      // this.parmValue.start = start || last_start;
-      // this.parmValue.end = end || last_end;
-
-      // if(this.parmValue.customer_code.length>0){
-      //     this.customerCode = [this.parmValue.customer_code] ;
-      // }
-
-       this.pageInfo= {
+      
+      const { page, size }=this.parmValue;
+      
+      this.pageInfo= {
         size: size,
         curr: page,
         total: 0,
@@ -245,7 +244,6 @@ export default {
     }
     this.searchList();
   },
-
   methods: {
     getRouter(toRouter, queryId){
       if (toRouter && queryId) {
@@ -322,6 +320,34 @@ export default {
           console.log("取消");
         });
     },
+    handleSelection(list){
+      this.selected = list
+    },
+    handleApproval(){
+      console.log(this.selected)
+      if(this.selected.length === 0){
+        this.$message.warning('请选择至少一个状态为"待供应商确认"的付款申请')
+        return
+      }
+
+      const isOK = this.selected.every(({status}) => Number(status) === 2)
+
+      if(!isOK){
+        this.$message.warning('请选择状态为"待供应商确认"的付款申请')
+        return
+      }
+
+      this.$confirm("是否确认付款?",{
+        title:'供应商确认付款',
+        type:'warning'
+      }).then(async () => {
+        const { code } = await asyncRequest.batch({
+          ids:this.selected.map(({id}) => id)
+        })
+        if(code !== 1) return
+        this.searchList()
+      })
+    },
     // 列表搜索
     async searchList() {
       if (

+ 26 - 17
src/views/customerService/workbench/detail.vue

@@ -33,7 +33,7 @@
                 <li>活动城市:</li>
                 <li>{{ sitem.shortname || '--' }}</li>
                 <li>需求项目:</li>
-                <li>
+                <li v-if="sitem && sitem.req_demand_name">
                   {{sitem.req_demand_name.map(({name}) => name).join(" + ")}}
                 </li>
                 <li>活动人数:</li>
@@ -50,7 +50,6 @@
           </div>
         </div>
 
-         <!-- v-if="storeId" -->
         <div class="p-right">
           <div style="margin:15px 0px" v-if="!isNegotiate">
              <el-alert
@@ -78,6 +77,7 @@
                 @updateLetter="linkToLetterUpdate"
                 :requsetMethod="requestBudgetLetter"
                 @refresh="refresh('eva')"
+                @abnormal="abnormal"
               />
             </el-collapse-item>
 
@@ -95,9 +95,9 @@
                 :readonly="Number(sitem.status) !== 2 || !isNegotiate"
                 :beforeModalVisible="beforeActivityModalVisible"
                 @selection="handleSelection($event, 'activity')"
-                :requsetMethod="reqsetActivityLetter"
                 :updateLoading="updateLoading"
                 @refresh="refresh('act')"
+                @abnormal="abnormal"
               />
             </el-collapse-item>
 
@@ -117,14 +117,10 @@
                 :beforeModalVisible="beforeProjectModalVisible"
                 :updateLoading="updateLoading"
                 @refresh="refresh('pro')"
+                @abnormal="abnormal"
               />
             </el-collapse-item>
           </el-collapse>
-
-          <!-- <div class="empty-warning" v-else>
-            <i class="el-icon-warning" style="margin-right:10px" />
-            请选择店铺
-          </div> -->
         </div>
       </div>
     </div>
@@ -219,14 +215,19 @@ export default {
       await this.initData();
       this.loading = false;
     },
+    async getPageData(){
+      await this.initForm()
+      const letters = ['evaLetter','actLetter','proLetter']
+      letters.forEach(letter => this.$refs[letter] && this.$refs[letter].searchList())
+    },
+    async abnormal(){
+      console.log(111,222);
+      await this.getPageData()
+      this.clearRefreshTimer()
+      this.regiterRefreshTimer()
+    },
     regiterRefreshTimer(){
-      this.refreshTimer = setInterval(async () => {
-        await this.initForm()
-        const letters = ['evaLetter','actLetter','proLetter']
-        letters.forEach(letter => {
-          this.$refs[letter] && this.$refs[letter].searchList()
-        })
-      }, 60000)
+      this.refreshTimer = setInterval(async () => this.getPageData(), 60000)
     },
     clearRefreshTimer(){
       if(!this.refreshTimer) return
@@ -275,11 +276,13 @@ export default {
         const { req_endtime , flow_stage } = this.sitem;
 
         this.isNegotiate = flow_stage === "磋商阶段"
+
         this.timer = setInterval(() => {
           let now = dayjs(new Date())
           const minuend = now.diff(req_endtime, 'second')
           this.countdown = minuend < 0 ? this.getTime(Math.abs(minuend)) : '00:00:00'
         },1000) 
+        
         this.getNewTime();
       }  else {
         this.$message.warning(message);
@@ -365,7 +368,7 @@ export default {
 
       return asyncRequest.planCreate(params)
     },
-    async reqsetActivityLetter(planinfo, file_activty_url){
+    async reqsetActivityLetter(_, file_activty_url){
       const params = {
         status: 2,
         id: this.selected.evalute[0],
@@ -383,7 +386,13 @@ export default {
         plan_info
       }
 
-      return asyncRequest.planCreate(params)
+      const result = await asyncRequest.planCreate(params)
+
+      if(result.code === 0){
+        this.abnormal()
+      }
+
+      return result
     },
   },
 };

+ 15 - 21
src/views/platformService/invoice/index.vue

@@ -36,17 +36,10 @@
                 />
               </el-col>
 
-              <!-- <el-col :span="3" style="margin-right:10px">
-                <el-select v-model="parmValue.supplier" size="mini" placeholder="供应商企业" style="width:100%"
-                  @change=" pageInfo.curr = 1;
-                           parmValue.page = 1;
-                          searchList();"
-                  />
-              </el-col> -->
-
               <el-col :span="3" style="margin-right:10px">
-                <el-input v-model="parmValue.reqCode" size="mini" placeholder="需求订单编号" style="width:100%"
-                       @change="pageInfo.curr = 1;
+                <el-input 
+                  v-model="parmValue.reqCode" size="mini" placeholder="需求订单编号" style="width:100%"
+                  @change="pageInfo.curr = 1;
                                 parmValue.page = 1;
                                 searchList();"
                 />
@@ -128,7 +121,7 @@
                   :size="searchSize"
                   type="primary"
                   style="float: right; margin-left: 5px"
-                  @click="searchList"
+                  @click="downloadInvoice"
                 >
                   下载发票数据
                 </el-button>
@@ -178,21 +171,15 @@
           </el-tag>
         </template>
 
-        <template #demandOrder={scope}>{{
+        <template #demandOrder="{ scope }">{{
             scope.row.platformsettle.reqCode
           }}</template>
 
         <template #status="{ scope }">
           <el-tag
             :size="tablebtnSize"
-            :type="
-              (statusList.find((item) => item.id == scope.row.status) || {})
-                .type || ''
-            "
-            v-text="
-              (statusList.find((item) => item.id == scope.row.status) || {})
-                .label || '--'
-            "
+            :type="(statusList.find((item) => item.id == scope.row.status) || {}).type || ''"
+            v-text="(statusList.find((item) => item.id == scope.row.status) || {}) .label || '--'"
           ></el-tag>
         </template>
 
@@ -356,8 +343,15 @@ export default {
       this.visible = true
       // console.log(this.selected)
     },
+    downloadInvoice(){
+      if(this.selected.length === 0){
+        this.$message.warning('至少选择一个发票申请')
+        return
+      }
+
+      const ids = this.selected.map(({id}) => id)
+    },
     handleSelectionChange(list) {
-      console.log(list)
       this.selected = list
     },
     getRouter(toRouter, queryId){

+ 1 - 1
src/views/platformService/settlement/detail.vue

@@ -36,7 +36,7 @@
               <wait-supplier-upload @confirm="handleUploadInvoiceReq" />
             </el-collapse-item>
 
-            <el-collapse-item title="发票管理" name="5" v-if="Number(sitem.status) === 5">
+            <el-collapse-item title="发票管理" name="5" v-if="Number(sitem.status) === 5 || Number(sitem.status) === 3">
               <upload-invoice-node :requestMethod="handleUploadInvoce" />
             </el-collapse-item>
           </el-collapse>