瀏覽代碼

Merge branch 'main'

xiaodai2017 1 年之前
父節點
當前提交
65335b0405

+ 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),
   // 更新

+ 1 - 1
src/components/manage/src/letter/_template.js

@@ -1,4 +1,4 @@
-const mapFields = {
+export const mapFields = {
     name: "name",
     // primaryClassification: 'primaryClassification', // 一级分类
     // secondaryClassification: 'secondaryClassification',  // 二级分类

+ 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('当前预算函已经被选中,无法取消发布!')

+ 28 - 6
src/components/manage/src/letter/xlsxUploadModal.vue

@@ -85,8 +85,10 @@ import {
   getColumn,
   requsetFields,
   requiredFields,
-  getTableProperty
+  getTableProperty,
+  mapFields
 } from './_template'
+import { add_sum, accMul } from '../../../../utils/validate'
 
 
 export default {
@@ -221,11 +223,29 @@ export default {
             return false
           }
 
-          console.log(tableItem[property])
-          if(intergeFields.includes(property) && this.isNumberValid(tableItem[property]) && String(tableItem[property]).includes(".")){
+          if(intergeFields.includes(property) && this.isNumberValid(tableItem[property]) 
+            && String(tableItem[property]).includes(".")){
             this.$message.warning(`第 ${line} 行 : ${getColumn(property).label} 必须为正整数`)
             return false
           }
+
+          if(property === mapFields.price){
+            // 校验:单价 * 数量 = 含税报价
+            const includeTaxTotal = accMul(tableItem[mapFields.price], tableItem[mapFields.num])
+            if(Number(includeTaxTotal) !== Number(tableItem[mapFields.taxIncludedQuote])){
+              this.$message.warning(`第 ${line} 行 : 单价 * 数量必须等于含税报价`)
+              return
+            }
+          }
+
+          if(property === mapFields.nonTaxQuotes){
+            //校验:非税报价 + 税额 = 含税报价
+            const total = add_sum(tableItem[mapFields.nonTaxQuotes], tableItem[mapFields.tax])
+            if(Number(total) !== Number(tableItem[mapFields.taxIncludedQuote])){
+              this.$message.warning(`第 ${line} 行 : 非税报价 + 税额必须等于含税报价`)
+              return
+            }
+          }
         }
       }
 
@@ -301,8 +321,6 @@ export default {
         this.file_url = plan_file
       }
 
-
-
       const planinfo = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => ({
         ...prev,
         [currentKey]: tableItem[currentKey]
@@ -311,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
     }

+ 1 - 1
src/views/customerService/demandOrder/columns.js

@@ -40,7 +40,7 @@ const listCol = [
   },
 
   {
-    prop: 'require_item',
+    prop: 'require_item_name',
     label: '活动需求',
     width: '155px'
   },

+ 1 - 1
src/views/customerService/demandOrder/index.vue

@@ -163,7 +163,7 @@
 
             <span v-else>
               {{scope.row.participant_min}} ~ {{scope.row.participant_max}}
-            </span>
+            </span>
           </template>
         <template #status="{ scope }">
           <el-tag

+ 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
     },
   },
 };

+ 2 - 2
src/views/customerService/workbench/index.vue

@@ -153,8 +153,8 @@
 
               <div class="task-card__content">
                 <span v-if="Number(item.participant_max) === 0">{{item.participant_min}}+</span>
-                <span v-else>{{item.participant_min}} ~ {{item.participant_max}}</span> 人
-                 ,  {{item.req_demand_name.map(({name}) => name).join(" + ")}}
+                <span v-else>{{item.participant_min}} ~ {{item.participant_max}} </span> 人
+                 ,  {{item.req_demand_name.map(({name}) => name).join(" + ") || '--'}}
               </div>
 
               <div class="task-card__content">

+ 17 - 8
src/views/customerService/workbench/modal.vue

@@ -1,13 +1,6 @@
 <template>
   <el-dialog :visible="innerVisible" :title="title" center :close-on-click-modal="false" @close="handleClose">
     <el-form ref="ruleForm" label-width="110px" size="mini" :rules="rules" :model="ruleForm">
-      <!-- <el-form-item label="服务名称" prop="name">
-        <el-input placeholder="服务名称" v-model="ruleForm.name" />
-      </el-form-item>
-      <el-form-item label="服务分类" prop="service_cat">
-        <search-category :value.sync="ruleForm.service_cat" style="width:100%" ref="category" />
-      </el-form-item> -->
-
       <el-form-item label="服务分类" prop="service_cat">
         <search-sort ref="sort" :value="service_cat" size="mini" placeholder="服务分类" @handleChange="handleCategoryChange" />
       </el-form-item>
@@ -120,6 +113,7 @@
 <script>
 import { ModalTypes } from "./_template"
 import asyncRequest from "@/apis/service/customerService/workbench";
+import { accMul, add_sum } from '../../../utils/validate';
 
 export default {
   props:['visible','sitem', 'type', "storeId"],
@@ -250,7 +244,20 @@ export default {
       this.$refs.ruleForm.validate(async isValid => {
         if(!isValid) return
 
-        const { id,name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee } = this.ruleForm;
+        const { id, name, service_cat, unit, price, num, remark, total_fee, tax, pay_fee, tax_fee } = this.ruleForm;
+
+        const includeTaxTotal = accMul(num, price)
+        const total = add_sum(pay_fee, tax_fee)
+
+        if(Number(includeTaxTotal) !== Number(total_fee)) {
+          this.$message.warning('单价*数量 必须等于必须等于含税报价!')
+          return
+        }
+
+        if(Number(total) !== Number(total_fee)){
+          this.$message.warning('非税报价+税额 必须等于含税报价!')
+          return
+        }
 
         const params = {
           id,
@@ -268,6 +275,8 @@ export default {
           tax_fee
         }
 
+
+
         if(this.type === ModalTypes.copy){
           delete params.id
         }

+ 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){

+ 3 - 9
src/views/platformService/settlement/detail.vue

@@ -14,14 +14,8 @@
                 <template #status>
                   <el-tag
                     :size="tablebtnSize"
-                    :type="
-                      (statusList.find((item) => item.id == sitem.status) || {})
-                        .type || ''
-                    "
-                    v-text="
-                      (statusList.find((item) => item.id == sitem.status) || {})
-                        .label || '--'
-                    "
+                    :type="(statusList.find((item) => item.id == sitem.status) || {}).type || ''"
+                    v-text="(statusList.find((item) => item.id == sitem.status) || {}).label || '--'"
                   ></el-tag>
                 </template>
               </show-data-table>
@@ -30,7 +24,7 @@
               <demand-detail id="2" />
             </el-collapse-item>
 
-            <el-collapse-item title="待供应商上传凭证" name="3" v-if="Number(sitem.status) === 1" v-loading="Statusloading">
+            <el-collapse-item title="待供应商上传凭证" name="3" v-if="Number(sitem.status) === 1 || Number(sitem.status) === 3" v-loading="Statusloading">
               <credentials-node @confirm="hanleSupplierUpload" />
             </el-collapse-item>
 

+ 1 - 3
src/views/platformService/settlement/index.vue

@@ -142,9 +142,7 @@
             v-for="(si, sii) in scope.row.specinfo"
             :key="si.spec_value_id + sii"
           >
-            {{ sii == 0 ? "__" : "--" }}{{ si.spec_name }}[{{
-              si.spec_value_name
-            }}]</span>
+            {{ sii == 0 ? "__" : "--" }}{{ si.spec_name }}[{{si.spec_value_name}}]</span>
         </template>
         <template #can="{ scope }">
           <span v-for="(si, sii) in scope.row.can" :key="si.id + sii">