Pārlūkot izejas kodu

Merge branch 'main'

xiaodai2017 1 gadu atpakaļ
vecāks
revīzija
afb29050c9
39 mainītis faili ar 1720 papildinājumiem un 1231 dzēšanām
  1. 1 0
      src/apis/components/letter.js
  2. 4 4
      src/apis/service/customerService/paymentApply/index.js
  3. 4 3
      src/apis/service/platformService/invoice/index.js
  4. 8 5
      src/apis/service/platformService/settlement/index.js
  5. 37 6
      src/components/approval-node/src/credentials.vue
  6. 6 3
      src/components/approval-node/src/uploadInvoice/_template.js
  7. 31 6
      src/components/approval-node/src/uploadInvoice/index.vue
  8. 51 13
      src/components/approval-node/src/uploadInvoice/manuallyUploadModal.vue
  9. 31 3
      src/components/approval-node/src/uploadInvoice/xlsxUploadModal.vue
  10. 4 1
      src/components/globalComponents/ex-table/main.vue
  11. 21 6
      src/components/manage/src/letter/_columns.js
  12. 79 10
      src/components/manage/src/letter/index.vue
  13. 19 1
      src/components/manage/src/letter/xlsxUploadModal.vue
  14. 13 8
      src/views/customerService/demandOrder/components/manageActivityScheme.vue
  15. 23 9
      src/views/customerService/demandOrder/components/manageBudgetLetter.vue
  16. 14 9
      src/views/customerService/demandOrder/components/manageProjectLetter.vue
  17. 46 14
      src/views/customerService/demandOrder/components/waitCustomerConfirm.vue
  18. 59 18
      src/views/customerService/demandOrder/detail.vue
  19. 66 12
      src/views/customerService/invoiceApply/columns.js
  20. 1 1
      src/views/customerService/invoiceApply/components/demandModal.vue
  21. 50 20
      src/views/customerService/invoiceApply/detail.vue
  22. 26 0
      src/views/customerService/invoiceApproval/_static.js
  23. 74 48
      src/views/customerService/invoiceApproval/columns.js
  24. 8 3
      src/views/customerService/invoiceApproval/components/invoice-modal.vue
  25. 292 0
      src/views/customerService/invoiceApproval/components/template.js
  26. 160 217
      src/views/customerService/invoiceApproval/index.vue
  27. 17 19
      src/views/customerService/paymentApply/columns.js
  28. 53 105
      src/views/customerService/paymentApply/detail.vue
  29. 21 47
      src/views/customerService/paymentApply/index.vue
  30. 59 35
      src/views/customerService/workbench/detail.vue
  31. 3 1
      src/views/customerService/workbench/index.vue
  32. 1 1
      src/views/customerService/workbench/letterEditing.vue
  33. 55 39
      src/views/platformService/invoice/columns.js
  34. 64 326
      src/views/platformService/invoice/components/invoice-modal.vue
  35. 98 67
      src/views/platformService/invoice/index.vue
  36. 50 48
      src/views/platformService/settlement/columns.js
  37. 89 47
      src/views/platformService/settlement/components/waitSupplierUpload.vue
  38. 78 67
      src/views/platformService/settlement/detail.vue
  39. 4 9
      src/views/platformService/settlement/index.vue

+ 1 - 0
src/apis/components/letter.js

@@ -6,5 +6,6 @@ export default {
   delete: (data, params) => http(api + 'delete', data, 'post', params),
   detail: (data, params) => http(api + 'info', data, 'post', params),
   create: (data, params) => http(api + 'create', data, 'post', params),
+  status: (data, params) => http(api + 'status', data, 'post', params),
 }
 

+ 4 - 4
src/apis/service/customerService/paymentApply/index.js

@@ -1,17 +1,17 @@
 // 物业管理员
 import http from "@/apis/axios";
-const api = "admin/";
+const api = "admin/orderPay/";
 export default {
   // 详情
-  detail: (data, params) => http(api + "bragaininfo", data, "post", params),
+  detail: (data, params) => http(api + "info", data, "post", params),
   // 更新
   update: (data, params) => http(api + "zxedit", data, "post", params),
   // 修改状态
-  status: (data, params) => http(api + "bragainstatus", data, "post", params),
+  status: (data, params) => http(api + "status", data, "post", params),
   // 分页查询 反馈列表
   feedList: (data, params) => http(api + "consultbidlist", data, "post", params),
  // 分页查询
- list: (data, params) => http(api + "bargainlist", data, "post", params),
+ list: (data, params) => http(api + "list", data, "post", params),
 
 
   // 添加

+ 4 - 3
src/apis/service/platformService/invoice/index.js

@@ -1,13 +1,14 @@
 // 物业管理员
 import http from "@/apis/axios";
-const api = "admin/";
+const api = "admin/invoiceInfo/";
 export default {
+  // 分页查询
+  list: (data, params) => http(api + "list", data, "post", params),
+  batch: (data, params) => http(api + "status", data, "post", params),
   // 添加
   add: (data, params) => http(api + "unitcreate", data, "post", params),
   // 更新
   update: (data, params) => http(api + "unitedit", data, "post", params),
-  // 分页查询
-  list: (data, params) => http(api + "unitlist", data, "post", params),
   // 删除
   delete: (data, params) => http(api + "unitdelete", data, "post", params),
   // 修改状态

+ 8 - 5
src/apis/service/platformService/settlement/index.js

@@ -3,15 +3,18 @@ import http from "@/apis/axios";
 const api = "admin/platformSettel/";
 export default {
   // 详情
-  detail: (data, params) => http(api + "bragaininfo", data, "post", params),
+  detail: (data, params) => http(api + "info", data, "post", params),
+  // 修改状态
+  status: (data, params) => http(api + "status", data, "post", params),
+  // 分页查询
+  list: (data, params) => http(api + "list", data, "post", params),
+  //上传发票
+  upload: (data, params) => http(api + "save", data, "post", params),
+
   // 更新
   update: (data, params) => http(api + "zxedit", data, "post", params),
-  // 修改状态
-  status: (data, params) => http(api + "bragainstatus", data, "post", params),
   // 分页查询 反馈列表
   feedList: (data, params) => http(api + "consultbidlist", data, "post", params),
-  // 分页查询
-  list: (data, params) => http(api + "list", data, "post", params),
 
 
   // 添加

+ 37 - 6
src/components/approval-node/src/credentials.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-form label-position="left" :model="ruleForm" :rules="rules" ref="ruleForm" size="mini" label-width="95px">
+    <el-form label-position="left" :model="ruleForm" :rules="rules" ref="ruleForm" size="mini" :label-width="readonly ? '0px' :'95px'">
       <el-form-item label="付款总金额" :prop="amountProp"  v-if="isAmount">
         <digital-input
           style="width:100%"
@@ -7,7 +7,7 @@
           :values="ruleForm[amountProp]"
           :placeholder="'付款总金额'"
           :min="0"
-          :max="100"
+          :max="1000000"
           :position="'right'"
           :precision="2"
           :controls="false"
@@ -16,7 +16,7 @@
         />
       </el-form-item>
 
-      <el-form-item label="凭证图片" :prop="imageProp">
+      <el-form-item :label="readonly ? '' : '凭证图片'" :prop="imageProp">
         <div class="good_info_img_div">
           <ul v-if="ruleForm[imageProp]" class="clear">
             <li
@@ -28,6 +28,7 @@
               <div class="img-show-li-div">
                 <img :src="img" class="img-show" alt="" />
                 <i
+                  v-if="!readonly"
                   class="el-icon-close"
                   @click="closeImg(iindex, imageProp)"
                 ></i>
@@ -38,7 +39,7 @@
               v-if="ruleForm[imageProp].length < 11"
             >
               <div class="activity-upload">
-                <div class="btnupload" style="position: relative">
+                <div class="btnupload" style="position: relative" v-if="!readonly">
                   <i class="el-icon-plus avatar-uploader-icon"></i>
                   <file-upload
                     class="Upload"
@@ -56,7 +57,7 @@
         </div>
       </el-form-item>
 
-      <el-form-item class="flex-end" style="width:100%">
+      <el-form-item class="flex-end" style="width:100%" v-if="!readonly">
         <el-button :loading="loading" type="primary" @click="onSubmit">保存</el-button>
       </el-form-item>
     </el-form>
@@ -66,6 +67,12 @@
 export default {
   name:'CredentialsNode',
   props:{
+    readonly:{
+      type:Boolean
+    },
+    url:{
+      type:Array,
+    },
     imageProp:{
       type:String,
       default:() => 'credentials'
@@ -81,9 +88,33 @@ export default {
     loading:{
       type:Boolean,
       default:() => false
+    },
+    status:{
+      type:Number
+    }
+  },
+  watch:{
+    url:{
+      handler(){
+        if(!this.url) return
+        this.ruleForm[this.imageProp] = [...this.url]
+      },
+      immediate:true
     }
   },
   data(){
+    const validateAmount = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("付款金额不能为空!"));
+      } else {
+        if (Number(value) === 0) {
+          callback(new Error("付款金额不能为0!"));
+        } else {
+          callback()
+        }
+      }
+    };
+
     return {
       ruleForm:{
         [this.imageProp]:[],
@@ -101,7 +132,7 @@ export default {
           {
             required:true,
             trigger:'change',
-            message:'请输入总金额'
+            validator:validateAmount
           }
         ]
       }

+ 6 - 3
src/components/approval-node/src/uploadInvoice/_template.js

@@ -123,7 +123,7 @@ export const columns = [
         prop: mapFields["beforeTax"],
         label: '税前金额',
         width: '150px',
-        required: false
+        required: true
     },
     {
         prop: mapFields["checkNumber"],
@@ -151,7 +151,9 @@ export const requsetFields = [
     mapFields.invoiceCode,
     mapFields.invoiceType,
     mapFields.afterTax,
-    mapFields.openTime
+    mapFields.beforeTax,
+    mapFields.openTime,
+    mapFields.checkNumber
 ]
 
 export const requiredFields = [
@@ -159,7 +161,8 @@ export const requiredFields = [
     mapFields.invoiceCode,
     mapFields.invoiceType,
     mapFields.afterTax,
-    mapFields.openTime
+    mapFields.beforeTax,
+    mapFields.openTime,
 ]
 
 export const numberFields = []

+ 31 - 6
src/components/approval-node/src/uploadInvoice/index.vue

@@ -22,12 +22,13 @@
         <template #header>
           <div style="display:flex;justify-content:space-between;">
             <span>操作</span>
-            <el-button size="mini" type="text" @click="manuallyVisible = true">添加</el-button>
+            <el-button size="mini" type="text" @click="onCreateItem">添加</el-button>
           </div>
         </template>
 
         <template slot-scope="scope">
           <el-button @click="deleteItem(scope.$index)" size="mini" type="text">删除</el-button>
+          <el-button @click="onUpdateItem(scope.$index)" size="mini" type="text">编辑</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -36,7 +37,12 @@
       <el-button size="mini" type="primary" @click="onSave">保存</el-button>
     </div>
 
-    <manually-upload-modal :visible.sync="manuallyVisible" @change="handleModalChange" />
+    <manually-upload-modal 
+      :visible.sync="manuallyVisible"
+      :updateItem="updateItem"
+      :updateIndex="updateIndex"
+      @change="handleModalChange" 
+    />
     <excel-upload-modal :visible.sync="xlsxVisible" @change="handleUploadChange" />
   </div>
 </template>
@@ -76,18 +82,37 @@ export default {
       manuallyVisible: false,
       xlsxVisible: false,
       loading: false,
-      list: []
+      list: [],
+      updateIndex: -1,
+      updateItem:null
     }
   },
   methods:{
+    onCreateItem(){
+      this.updateIndex = -1
+      this.updateItem = null
+      this.manuallyVisible = true
+    },
+    onUpdateItem(index){
+      this.updateIndex = index
+      this.updateItem = this.list[index]
+      this.manuallyVisible = true
+    },
     deleteItem(index){
       this.list.splice(index, 1)
     },
     handleUploadChange(list){
-      this.list = [...list]
+      this.list = [...this.list,...list]
     },
-    handleModalChange(item){
-      this.list.push(item)
+    handleModalChange({data,index}){
+      if(index === -1){
+        this.list.push(data)
+        return
+      }
+
+      this.$set(this.list,index,{
+        ...data
+      })
     },
     async onSave(){
       this.loading = true

+ 51 - 13
src/components/approval-node/src/uploadInvoice/manuallyUploadModal.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog :visible="innerVisible" title="上传发票" align="center" @close="handleClose" :close-on-click-modal="false">
+  <el-dialog :visible="innerVisible" :title="title" align="center" @close="handleClose" :close-on-click-modal="false">
     <el-form :rules="rules" :model="ruleForm" ref="ruleForm"  label-width="90px" size="mini">
       <el-form-item label="扫码枪">
         <el-input v-model="scanValue" type="textarea" placeholder="请在扫码完成后手动回车" @keyup.native.enter="handleEnterParse" />
@@ -25,7 +25,12 @@
         <el-input v-model="ruleForm[mapFields.checkNumber]"  placeholder="校验码" />
       </el-form-item>
       <el-form-item label="开票日期" :prop="mapFields.openTime">
-        <el-date-picker v-model="ruleForm[mapFields.openTime]"  value-format="yyyy-MM-dd HH:mm:ss" style="width:100%" placeholder="开票日期" />
+        <el-date-picker 
+          v-model="ruleForm[mapFields.openTime]"  
+          value-format="yyyy-MM-dd" 
+          style="width:100%" 
+          placeholder="开票日期" 
+        />
       </el-form-item>
 
       <el-form-item style="display:flex;justify-content:flex-end">
@@ -55,27 +60,32 @@ import { invoiceTypeList } from '@/assets/js/statusList'
 */
 
 export default {
-  props:['visible'],
+  props:['visible','updateItem','updateIndex'],
   computed:{
     isAllelectric(){
       const invoiceType = this.ruleForm[mapFields.invoiceType]
       const allelectries = ['5','6']
       return allelectries.includes(invoiceType)
     },
-    isSpecialTicket(){
+    isNormalTicket(){
       const invoiceType = this.ruleForm[mapFields.invoiceType]
-      const specialTickets = ['2','4']
+      const specialTickets = ['1','3']
       return specialTickets.includes(invoiceType)
     },
+    title(){
+      const base = '发票'
+      console.log(this.updateItem)
+      const prefix = this.updateItem ? '编辑' : '上传'
+      return `${prefix}${base}`
+    },
     rules(){
-      const isSpecialTicket = this.isSpecialTicket
-
+      const isNormalTicket = this.isNormalTicket
       return {
         ...manuallyUploadRules,
         [mapFields.checkNumber]:[{
           ...manuallyUploadRules[mapFields.checkNumber][0],
-          //非专票必填校验码
-          required:!isSpecialTicket
+          //票必填校验码
+          required:isNormalTicket
         }]
       }
     },
@@ -88,6 +98,15 @@ export default {
       }
     }
   },
+  watch:{
+    visible:{
+      handler(visible){
+        if(!visible) return
+        this.$nextTick(() => this.initData())
+      },
+      immediate:true
+    }
+  },
   data(){
     return {
       scanValue:"",
@@ -106,7 +125,6 @@ export default {
   methods:{
     handleClose(){
       this.innerVisible = false
-
       this.ruleForm = {
         [mapFields.invoiceType]:"",
         [mapFields.invoiceCode]:"",
@@ -139,11 +157,17 @@ export default {
         const day = open_time.slice(6);
         _open_time = dayjs(`${year}-${month}-${day}`).format("YYYY-MM-DD HH:mm:ss");
       }
+
+      // 1,01,3,4,5,6,7,8,9
+
+      const invoice = invoiceTypeList.find(({scanValue}) => scanValue === String(invoiceType))
       
+
+      console.log(invoice)
       this.scanValue = ""
-      const { invoice } = mapPropertys
+      // const { invoice } = mapPropertys
       this.ruleForm = {
-        [mapFields.invoiceType]:invoiceType,
+        [mapFields.invoiceType]:invoice ? invoice.value : "",
         [mapFields.invoiceCode]:invCode,
         [mapFields.beforeTax]:subtotal_amount,
         [mapFields.openTime]: _open_time,
@@ -151,10 +175,24 @@ export default {
         [mapFields.checkNumber]:checkNumber
       }
     },
+    initData(){
+      const data = this.updateItem ? JSON.parse(JSON.stringify(this.updateItem)) :{
+        [mapFields.invoiceType]:"",
+        [mapFields.invoiceCode]:"",
+        [mapFields.beforeTax]:"",
+        [mapFields.openTime]: "",
+        [mapFields.invoiceNumber]:"",
+        [mapFields.checkNumber]:""
+      }
+      this.ruleForm = data
+    },
     async onSubmit(){
       try{
         await this.$refs.ruleForm.validate()
-        this.$emit("change",this.ruleForm)
+        this.$emit("change",{
+          data:this.ruleForm,
+          index:this.updateIndex
+        })
         this.handleClose()
         // thiis
       }catch(err){

+ 31 - 3
src/components/approval-node/src/uploadInvoice/xlsxUploadModal.vue

@@ -26,7 +26,7 @@
 
 <script>
 import companyHelper from '@/mixins/companyHelper'
-import { MessageBox } from 'element-ui'
+// import { MessageBox } from 'element-ui'
 
 import {
   columns,
@@ -37,6 +37,7 @@ import {
   mapFields,
 } from './_template'
 import { invoiceTypeList } from '@/assets/js/statusList'
+import dayjs from 'dayjs'
 
 export default {
   mixins: [companyHelper],
@@ -87,26 +88,52 @@ export default {
         const tableItem = this.tableData[index]
         const properties = Object.keys(tableItem)
         for (const property of properties) {
+          //必填字段非空校验
           if(requiredFields.includes(property) && !this.isValueNotNull(tableItem[property])){
             this.$message.warning(`第 ${line} 行 : ${getColumn(property).label} 不能为空`)
             return false
           }
 
+          //转入的日期格式
+          if(property === mapFields.openTime && !Number.isNaN(Number(tableItem[property]))){
+            this.tableData[index][property] = this.formatDate(tableItem[property])
+          }
+
+          //发票相关校验
           if(property === mapFields.invoiceType){
             const invoiceType = invoiceTypeList.find(({label}) => label === tableItem[property])
-
+            
+            //类型校验
             if(!invoiceType){
               this.$message.warning(`第 ${line} 行 : ${getColumn(property).label} 必须为 ${invoiceTypeList.map(({label}) => label).join('、')}`)
               return false
             }
 
-            // this.tableData[index][property] = invoiceType.value
+            //普通发票校验验证码
+            if(["1","3"].includes(invoiceType.value) && tableItem[mapFields.checkNumber] === ""){
+              this.$message.warning(`第 ${line} 行 : 发票类型为普通发票时必须上传校验码`)
+              return false
+            }
+
+            console.log(invoiceType.value)
           }
         }
       }
 
       return true
     },
+    formatDate (timeNum) {
+      const time = new Date(((Number(timeNum) - 70 * 365 - 19) * 24 * 3600 - 8 * 3600 - 42.5) * 1000)
+      const year = time.getFullYear()
+      const month = time.getMonth() + 1
+      const date = time.getDate() + 1
+      const dateArr = [
+          year,
+          (month < 10 ? '0' + month : month),
+          (date < 10 ? '0' + date : date),
+      ]
+      return `${dateArr.join('-')}`
+    },
     isValueNotNull(value){
       if(!value) return
       const _value = String(value)
@@ -151,6 +178,7 @@ export default {
 
       const list = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => {
         let data = tableItem[currentKey]
+
         if(currentKey === mapFields.invoiceType){
           const invoiceType = invoiceTypeList.find(({label}) => label === tableItem[currentKey])
           data = invoiceType.value

+ 4 - 1
src/components/globalComponents/ex-table/main.vue

@@ -129,7 +129,7 @@
     >
       <el-pagination
         :current-page="page.curr"
-        :page-sizes="[2, 5, 10, 15, 50, 100]"
+        :page-sizes="sizes ? sizes : [2, 5, 10, 15, 50, 100]"
         :page-size="page.size"
         :size="searchSize"
         :layout="!layout ? 'total, sizes, prev, pager, next, jumper' : layout"
@@ -260,6 +260,9 @@ export default {
      * page-curr-change  分页当前页改变
      * page-size-change  分页大小改变
      */
+    sizes:{
+      type:Array,
+    },
     page: {
       type: Object,
       default: {

+ 21 - 6
src/components/manage/src/letter/_columns.js

@@ -26,6 +26,11 @@ export const budget = [
       width: '120px',
       _slot_:'is_check'
   },
+  {
+    prop:mapFields.status,
+    label:'状态',
+    _slot_:'status'
+  },
   {
       prop: mapFields.letter,
       label: '评估预算函',
@@ -120,12 +125,17 @@ export const project = [
         label: '评估预算函编号',
         width: '120px',
     },
-    // {
-    //     prop: mapFields.status,
-    //     label: '是否选中',
-    //     width: '120px',
-    //     _slot_:'is_check'
-    // },
+    {
+        prop: mapFields.status,
+        label: '是否选中',
+        width: '120px',
+        _slot_:'is_check'
+    },
+    {
+        prop:mapFields.status,
+        label:'状态',
+        _slot_:'status'
+    },
     {
         prop: mapFields.letter,
         label: '计划预算函预览',
@@ -176,6 +186,11 @@ export const settlement = [
         width: '126px',
         _slot_:'letter'
     },
+    {
+        prop:mapFields.status,
+        label:'状态',
+        _slot_:'status'
+    },
     {
         prop: mapFields.budgetAmount,
         label: '评估预算金额',

+ 79 - 10
src/components/manage/src/letter/index.vue

@@ -9,11 +9,14 @@
     <ex-table
       :columns="[
         ...(isSelection ? [{ type: 'selection' }] : []),
-        ...mapColumns[type || 'budget'], { label: '操作', _slot_: 'action', width: '100px',fixed:'right'}
+        ...(mapColumns[type || 'budget']), 
+        ...(!readonly && type !== 'activity' ? [{ label: '操作', _slot_: 'action', width: '130px',fixed: 'right'}] : [])
       ]"
       @page-curr-change="handlePageChange"
       @page-size-change="handleSizeChange"
+      :noPagination="noPagination"
       :page="pageInfo"
+      :sizes="['15']"
       @screen-reset="
         pageInfo.curr = 1;
         parmValue.page = 1;
@@ -41,15 +44,34 @@
         </el-tag>
       </template>
 
+      <template #status="{scope}">
+        <el-tag size="mini" :type="Number(scope.row.status) === 2 ? '' :'info'">
+          {{(statusOptions.find(({value}) => Number(scope.row.status) === value) || {}).label || '--'}}
+        </el-tag>
+      </template>
+
       <template #action="{ scope }">
-        <!-- type === 'budget' && -->
+        <!-- 选中时不能取消发布 -->
         <el-button 
-          v-if="(Number(scope.row.is_check) !== mapCheck[type].ok)" type="text" 
+          size="mini" 
+          type="text" 
+          @click="onPublish(scope.row)">
+          {{Number(scope.row.status) === 1 ? '发布' : '取消发布'}}
+        </el-button>
+
+        <!-- 发布或选中的函无法删除编辑 -->
+        <el-button 
+          v-if="
+            (type !== 'activity' 
+            && (Number(scope.row.is_check) !== mapCheck[type].ok) 
+            && Number(scope.row.status) !== 2) || type === 'settlement'" 
+            type="text" 
           size="mini" 
           @click="linkToLetterUpdate(scope.row)"
         >编辑</el-button>
+
         <el-button 
-          v-if="type === 'budget' && Number(scope.row.is_check) !== mapCheck[type].ok" 
+          v-if="type === 'budget' && Number(scope.row.is_check) !== mapCheck[type].ok && Number(scope.row.status) !== 2" 
           type="text" 
           size="mini" 
           @click="deleteItem(scope.row)"
@@ -66,6 +88,7 @@
       :isFile="isFile"
       :title="title" 
       :type="type"
+      :id="id"
     />
 
     <preview-modal 
@@ -81,9 +104,9 @@ import { mapColumns, mapCheck, mapTitle } from "./_columns"
 import ExcelUploadModal from "./xlsxUploadModal.vue"
 import asyncRequest from "@/apis/components/letter"
 import PreviewModal from "./previewModal.vue"
-import { writeFile, utils } from "xlsx";
 import { template ,mapLetterToType } from "./_template"
 import mixinPage from "@/mixins/elPaginationHandle";
+import { writeFile, utils } from "xlsx";
 
 export default {
   name:'Letter',
@@ -98,6 +121,11 @@ export default {
         border: true,
         'max-height': '800px'
       },
+      statusOptions:[
+        { value:1,label:'草稿'},
+        { value:2,label:'已发布'}
+      ],
+      noPagination:false,
       parmValue:{
         page: 1, // 页码
         size: 15, // 每页显示条数
@@ -147,8 +175,6 @@ export default {
         ({ name,service_cat,unit,price,num,remark,total_fee,tax,pay_fee,tax_fee  })
       )
 
-      console.log(plan_info)
-
       const letter = await asyncRequest.create({
         plan_type: mapLetterToType[form],
         file: fileUrl ? fileUrl : plan_file,
@@ -173,7 +199,7 @@ export default {
       this.$emit('refresh')
     },
     handleSelection({list}){
-      this.$emit('selection', list.map(({id}) => id))
+      this.$emit('selection', list)
     },
     deleteItem(row){
       this.$confirm(`确认删除评估预算函 ${row.planCode}?`,{
@@ -211,20 +237,63 @@ export default {
       if(this.type !== 'project' && (this.beforeModalVisible && !this.beforeModalVisible())){
         return
       }
+
       this.xlsxVisible = true
     },
 
+    async onPublish(row){
+      if(Number(row.is_check) === 1 && this.type !== 'settlement'){
+        this.$message.warning('当前预算函已经被选中,无法取消发布!')
+        return
+      }
+
+      const { status, id } = row
+      this.loading = true
+
+      const baseMsg = `${mapTitle[this.type]} ${row.planCode}`
+      
+      const message = Number(status) === 1 
+      ? `确认发布${baseMsg}?`
+      : `确认将${baseMsg} 恢复为草稿`
+
+      this.$confirm(message,{
+        type:'warning'
+      }).then(async () => {
+        this.loading = true
+        const { code } = await asyncRequest.status({
+          id:[id],
+          status:Number(status) === 1 ? 2 : 1
+        })
+        this.loading = false
+
+        if(code !== 1) return
+
+        const message = Number(status) === 1 
+          ? `${baseMsg} 发布成功`
+          : `${baseMsg} 恢复草稿成功`
+
+        
+        if(Number(status) === 1){
+          this.$emit('publish-ok')
+        }
+
+      this.$message.success(message)
+
+        this.searchList()
+      })
+    },
+
     async searchList(){
-      // if(this.type === 'settlement') return
       this.loading = true
       const { code, data } = await asyncRequest.list({ 
-          plan_type :this.status,          
+          plan_type :this.status, 
           req_id: this.id ,
           ...this.parmValue
         })
       this.loading = false
       if(code !== 1) return
       this.tableData = data.list
+      this.noPagination = Number(data.count) <= 15
       this.pageInfo.total = Number(data.count)
     }
   }

+ 19 - 1
src/components/manage/src/letter/xlsxUploadModal.vue

@@ -73,6 +73,7 @@
 </template>
 
 <script>
+import asyncRequest from "@/apis/components/letter"
 import companyHelper from '@/mixins/companyHelper'
 import { utils, writeFile } from "xlsx"
 import { template, intergeFields } from "./_template"
@@ -90,7 +91,7 @@ import {
 
 export default {
   mixins: [companyHelper],
-  props: ['visible', 'title', 'requsetMethod','isFile', 'type'],
+  props: ['visible', 'title', 'requsetMethod','isFile', 'type', 'id'],
   data() {
     return {
       columns,
@@ -285,6 +286,23 @@ export default {
         return
       }
 
+      if(this.type === "settlement"){
+        const { code, data } = await asyncRequest.list({ 
+          plan_type : 3, 
+          req_id: this.id,
+          status: 2,
+          is_check: 1
+        })
+
+        if(code !== 1) return
+        const [letter] = data.list || []
+        const { store_id , plan_file} = letter
+        this.storeId = store_id
+        this.file_url = plan_file
+      }
+
+
+
       const planinfo = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => ({
         ...prev,
         [currentKey]: tableItem[currentKey]

+ 13 - 8
src/views/customerService/demandOrder/components/manageActivityScheme.vue

@@ -1,11 +1,15 @@
 <template>
  <div v-loading="loading">
     <ex-table
-      :columns="columns"
+      :columns="[
+        ...columns,
+        ...(readonly ? [] : [{ label:'操作', _slot_:'action', width:'80px' }])
+      ]"
       :table="table"
       :data="planList"
       style="margin: 15px 0 0 0"
       :page="pageInfo"
+      :noPagination="noPagination"
       @page-curr-change="handlePageChange"
       @page-size-change="handleSizeChange"
     >
@@ -33,10 +37,11 @@
 import asyncRequest from "@/apis/service/customerService/demandOrder";
 import mixinPage from "@/mixins/elPaginationHandle";
 export default {
-  props:['sitem'],
+  props:['sitem', 'readonly'],
   mixins:[mixinPage],
   data(){
     return {
+      noPagination:false,
       loading:false,
       planList: [],
       table: {
@@ -49,6 +54,10 @@ export default {
         curr: 1,
         total: 0,
       },
+       parmValue:{
+        page:1,
+        size:15
+      },
      columns: [
        {
            type: 'index',
@@ -91,11 +100,6 @@ export default {
            prop: "nickname",
            label: '创建人',
            width: '150px',
-       },
-       {
-        label:'操作',
-        _slot_:"action",
-        width:'80px'
        }
       ]
     }
@@ -128,13 +132,14 @@ export default {
     },
     async searchList(id){
       this.loading = true
-      const { code, data }  = await asyncRequest.planList({ req_id: id ? id :this.sitem.id, plan_type: 2 })
+      const { code, data }  = await asyncRequest.planList({ req_id: id ? id :this.sitem.id, plan_type: 2, ...this.parmValue })
       this.loading = false
 
       if(code === 1){
         const { list = [], count = 0 } = data
         this.planList = list;
         this.$emit('selectedChange',list.filter(({is_check}) => String(is_check) === "1").length)
+        this.noPagination = Number(count) <= 15
         this.pageInfo.total = count
       }
     }

+ 23 - 9
src/views/customerService/demandOrder/components/manageBudgetLetter.vue

@@ -1,14 +1,20 @@
 <template>
  <div v-loading="loading">
     <ex-table
-      :columns="columns"
+      :columns="[
+        ...columns,
+        ...(readonly ? [] : [{ label:'操作', _slot_:'action', width:'80px' }])
+      ]"
       :table="table"
       :data="planList"
       style="margin: 15px 0 0 0"
+      :sizes="[15]"
       :page="pageInfo"
+      :noPagination="noPagination"
       @page-curr-change="handlePageChange"
       @page-size-change="handleSizeChange"
     >
+      <!-- : -->
       <template #is_check="{scope}">
         <el-tag size="mini" :type="String(scope.row.is_check) === '1' ? '' :'info'">
          {{String(scope.row.is_check) === "1" ?  "已选择" : "未选择"}}
@@ -16,7 +22,10 @@
       </template>
 
       <template #letter="{scope}">
-        <a style="color:#409EFF" :href="scope.row.plan_file">{{getFileNameWithUrl(scope.row.plan_file)}}</a>
+        <a style="color:#409EFF" :href="scope.row.plan_file" v-if="scope.row.plan_file">{{
+            getFileNameWithUrl(scope.row.plan_file)
+        }}</a>
+        <p v-else>--</p>
       </template>
       
 
@@ -33,7 +42,7 @@
 import asyncRequest from "@/apis/service/customerService/demandOrder";
 import mixinPage from "@/mixins/elPaginationHandle";
 export default {
-  props:['sitem'],
+  props:['sitem','readonly'],
   mixins:[mixinPage],
   data(){
     return {
@@ -43,6 +52,10 @@ export default {
         stripe: true,
         border: true,
         'max-height': '800px'
+      },
+      parmValue:{
+        page:1,
+        size:15
       },
        pageInfo: {
         size: 15,
@@ -96,11 +109,6 @@ export default {
            prop: "create_time",
            label: '创建时间',
            minWidth: '150px',
-       },
-       {
-        label:'操作',
-        _slot_:"action",
-        width:'80px'
        }
       ]
     }
@@ -132,13 +140,19 @@ export default {
     },
     async searchList(id){
       this.loading = true
-      const { code, data }  = await asyncRequest.planList({ req_id: id ? id : this.sitem.id })
+      const { code, data }  = await asyncRequest.planList({ 
+          req_id: id ? id : this.sitem.id ,
+          status: 2,
+          plan_type: 1,
+          ...this.parmValue
+        })
       this.loading = false
 
       if(code === 1){
         const { list = [], count = 0 } = data
         this.planList = list;
         this.$emit('selectedChange',list.filter(({is_check}) => String(is_check) === "1").length)
+        this.noPagination = Number(count) <= 15
         this.pageInfo.total = count
       }
     }

+ 14 - 9
src/views/customerService/demandOrder/components/manageProjectLetter.vue

@@ -1,9 +1,13 @@
 <template>
  <div v-loading="loading" style="margin-bottom:10px">
     <ex-table
-      :columns="columns"
+      :columns="[
+        ...columns,
+        ...(readonly ? [] : [{ label:'操作', _slot_:'action', width:'80px' }])
+      ]"
       :table="table"
       :data="planList"
+      :noPagination="noPagination"
       style="margin: 15px 0 0 0"
       :page="pageInfo"
       @page-curr-change="handlePageChange"
@@ -16,7 +20,8 @@
       </template>
 
       <template #letter="{scope}">
-        <a style="color:#409EFF" :href="scope.row.plan_file">{{getFileNameWithUrl(scope.row.plan_file)}}</a>
+        <a v-if="scope.row.plan_file" style="color:#409EFF" :href="scope.row.plan_file">{{getFileNameWithUrl(scope.row.plan_file)}}</a>
+        <p v-else>--</p>
       </template>
 
       <template #action="{scope}">
@@ -32,7 +37,7 @@
 import asyncRequest from "@/apis/service/customerService/demandOrder";
 import mixinPage from "@/mixins/elPaginationHandle";
 export default {
-  props:['sitem'],
+  props:['sitem','readonly'],
   mixins:[mixinPage],
   data(){
     return {
@@ -48,6 +53,10 @@ export default {
         curr: 1,
         total: 0,
       },
+      parmValue:{
+        page:1,
+        size:15
+      },
      columns: [
        {
            type: 'index',
@@ -95,11 +104,6 @@ export default {
            prop: "create_time",
            label: '创建时间',
            width: '150px',
-       },
-       {
-           label:'操作',
-           _slot_:"action",
-           width:'80px'
        }
       ]
     }
@@ -132,13 +136,14 @@ export default {
     },
     async searchList(id){
       this.loading = true
-      const { code, data }  = await asyncRequest.planList({ req_id: id ? id :this.sitem.id, plan_type: 3 })
+      const { code, data }  = await asyncRequest.planList({ req_id: id ? id :this.sitem.id, plan_type: 3 , status:2 ,...this.parmValue})
       this.loading = false
 
       if(code !== 1) return
       const { list = [], count = 0 } = data
       this.planList = list;
       this.$emit('selectedChange',list.filter(({is_check}) => String(is_check) === "1").length)
+      this.noPagination = Number(count) <= 15
       this.pageInfo.total = count
     }
   }

+ 46 - 14
src/views/customerService/demandOrder/components/waitCustomerConfirm.vue

@@ -11,6 +11,20 @@
 
       <el-form-item>
         <div class="image">
+          <div class="image_container" v-for="(image,index) in ruleForm.image_file" :key="image">
+            <div style="margin-rigth:5px">
+              <img :src="image" class="avatar" />
+              <i class="el-icon-circle-close" @click="ruleForm.image_file.splice(index,1)"></i>
+            </div>
+          </div>
+
+          <div class="image_container"  v-for="(video,index) in ruleForm.video_file" :key="video">
+            <div style="margin-rigth:5px">
+              <video :src="video" class="avatar" autoplay />
+              <i class="el-icon-circle-close" @click="ruleForm.video_file.splice(index,1)"></i>
+            </div>
+          </div>
+
           <el-upload
               style="margin-right:10px"
               class="avatar-uploader"
@@ -19,12 +33,11 @@
               :http-request="evt => handleRequset(evt,'image')"
               :before-upload="beforeAvatarUpload"
             >
-            <div class="image_container"  v-if="ruleForm.image_file">
+            <!-- <div class="image_container"  v-if="ruleForm.image_file">
               <img :src="ruleForm.image_file" class="avatar" />
               <i class="el-icon-circle-close" @click="handleRemoveImage('image_file')"></i>
-            </div>
-
-            <div v-else>
+            </div> -->
+            <div>
               <i class="el-icon-camera avatar-uploader-icon"></i>
               <p>添加图片</p>
             </div>
@@ -37,12 +50,7 @@
               :before-upload="beforeVideoUpload"
               :http-request="evt => handleRequset(evt,'video')"
             >
-            <div class="image_container"  v-if="ruleForm.video_file">
-              <video :src="ruleForm.video_file" class="avatar" autoplay />
-              <i class="el-icon-circle-close" @click="handleRemoveImage('video_file')"></i>
-            </div>
-
-            <div v-else>
+            <div>
               <i class="el-icon-video-camera avatar-uploader-icon"></i>
               <p>添加视频</p>
             </div>
@@ -78,8 +86,8 @@ export default {
       ruleForm:{
         grade:'', //活动评价
         evaluate_content:'', //客户公司
-        image_file:'',
-        video_file:''
+        image_file:[],
+        video_file:[]
       }
     }
   },
@@ -112,10 +120,10 @@ export default {
         _formData.append("token", token);
         const api = prop === "image" ? asyncRequest.uploadImage : asyncRequest.uploadvideo
         const property = prop === 'image' ? 'image_file' : 'video_file'
-        const { message, code, data } = await api(_formData);
+        const { data } = await api(_formData);
         const { file: _file } = data
         const { full_url } = _file
-        this.ruleForm[property] = full_url
+        this.ruleForm[property].push(full_url)
       }catch(err){
         console.log(err)
       }
@@ -160,6 +168,12 @@ export default {
     },
     async onSubmit(){
        try {
+        const { video_file, image_file } = this.ruleForm
+        if(video_file.length === 0 && image_file.length === 0){
+          this.$message.warning('必须上传一条视频或图片')
+          return
+        }
+
          await this.$refs.ruleForm.validate()
          this.loading = true
 
@@ -168,6 +182,8 @@ export default {
          const { code } = await asyncRequest.evaluate({
           ...this.ruleForm,
           grade: Number(grade / 5).toFixed(2),
+          video_file:video_file.join(","),
+          image_file:image_file.join(","),
           id: this.sitem.id,
          })
          
@@ -237,6 +253,22 @@ export default {
 
   .image {
     display: flex;
+    width: 500px;
+    gap: 10px;
+    flex-wrap: wrap;
+
+    .image_container{
+      border: 1px dashed #d9d9d9;
+      border-radius: 6px;
+
+      .el-icon-circle-close{
+        cursor: pointer;
+
+        &:hover{
+          color:#409EFF;
+        }
+      }
+    }
 
     &_container{
       position: relative;

+ 59 - 18
src/views/customerService/demandOrder/detail.vue

@@ -7,33 +7,72 @@
            <el-collapse-item title="需求订单详情" name="1">
              <demand-detail :sitem="sitem" @refresh="refresh" @switchNode="handleSwitchNode" />
            </el-collapse-item>
-           <el-collapse-item title="评估预算函管理" name="2" v-if="Number(sitem.status) === 1">
-             <manage-budgeet-letter :sitem="sitem" @selectedChange="handleSelectedChange($event,'budget')" />
+
+           <el-collapse-item :title="Number(sitem.status) > 1 ? '评估预算函' :'评估预算函管理'" name="2" v-if="Number(sitem.status) >= 1">
+             <manage-budgeet-letter
+              :sitem="sitem" 
+              :readonly="Number(sitem.status) > 1"
+              @selectedChange="handleSelectedChange($event,'budget')" 
+            />
            </el-collapse-item> 
-           <el-collapse-item title="活动方案管理" name="3" v-if="Number(sitem.status) === 2">
-             <manage-activity-scheme :sitem="sitem" @selectedChange="handleSelectedChange($event,'activity')" />
+
+           <el-collapse-item :title="Number(sitem.status) > 2  ? '活动方案' :'活动方案管理'" name="3" v-if="Number(sitem.status) >= 2">
+             <manage-activity-scheme 
+              :sitem="sitem" 
+              :readonly="Number(sitem.status) > 2"
+              @selectedChange="handleSelectedChange($event,'activity')"
+            />
            </el-collapse-item> 
-           <el-collapse-item title="计划预算函管理" name="10" v-if="Number(sitem.status) === 3">
-             <manage-project-letter :sitem="sitem" @selectedChange="handleSelectedChange($event,'project')" />
+           
+           <el-collapse-item :title="Number(sitem.status) > 3 ? '计划预算函' : '计划预算函管理'" name="10" v-if="Number(sitem.status) >= 3">
+             <manage-project-letter
+              :sitem="sitem" 
+              :readonly="Number(sitem.status) > 3"
+              @selectedChange="handleSelectedChange($event,'project')" 
+            />
            </el-collapse-item> 
-           <el-collapse-item title="待客户上传确认凭证" name="4" v-if="Number(sitem.status) === 4">
-              <credentials-node @confirm="handleCustomerConfirm($event)" />
+           
+           <!-- 审批时查看凭证 驳回可以重新上传凭证 -->
+           <el-collapse-item 
+              v-if="Number(sitem.status) >= 4"
+              :title="Number(sitem.status) > 4 && Number(sitem.status) !== 8 ? '凭证图片' : '待客户上传确认凭证'" 
+              name="4"
+            >
+              <credentials-node
+                :readonly="Number(sitem.status) !== 4 && Number(sitem.status) !== 8"
+                :url="sitem.ReqProof ? sitem.ReqProof.filter(({user_type}) => user_type === 1).map(({proof_url}) => proof_url) : ''"
+                @confirm="handleCustomerConfirm($event)" 
+              />
            </el-collapse-item>
+
            <el-collapse-item title="待平台审核执行凭证" name="5" v-if="Number(sitem.status) === 5">
              <wait-execute-certificate :sitem="sitem" @refresh="initData" />
            </el-collapse-item>
+           
            <el-collapse-item title="待供应商确认已执行" name="6" v-if="Number(sitem.status) === 6">
              <wait-supplier-confirm :sitem="sitem" @refresh="initData"  />
            </el-collapse-item> 
+           
            <el-collapse-item title="待客户确认已执行" name="7" v-if="Number(sitem.status) === 7">
              <wait-customer-confirm :sitem="sitem" @refresh="initData" />
            </el-collapse-item>
-           <el-collapse-item title="待供应商上传结算函" name="8" v-if="Number(sitem.status) === 9">
-             <letter type="settlement" :requsetMethod="handleUploadLetter" :isFile="true" />
-           </el-collapse-item>
-          <el-collapse-item title="结算函" name="8" v-if="Number(sitem.status) > 9 && Number(sitem.status) !== 11">
-             <letter :id="sitem.id" type="settlement" status="4" :requsetMethod="handleUploadLetter" :isFile="true" :readonly="true" />
+           
+          <el-collapse-item 
+            :title="Number(sitem.status) >= 9 && Number(sitem.status) !== 11 ? '结算函' : '待客户上传结算函'"
+             v-if="Number(sitem.status) >= 9"
+             name="8" 
+          >
+             <letter 
+              :id="sitem.id" 
+              type="settlement" 
+              status="4"
+              :readonly="Number(sitem.status) > 9 && Number(sitem.status) !== 11"
+              :requsetMethod="handleUploadLetter" 
+              @publish-ok="refresh"
+              :isFile="true" 
+            />
            </el-collapse-item> 
+           
            <el-collapse-item title="待客户确认结算函" name="9" v-if="Number(sitem.status) === 10">
              <normal-node @confirm="handleConfirmSettlement" />
            </el-collapse-item>
@@ -193,14 +232,16 @@ export default {
       if(code !== 1) return
       this.initForm()
     },
-    async handleUploadLetter(settleinfo, file_url){
+    async handleUploadLetter(plan_info, file, store_id){
       const params = {
-        id: this.sitem.id,
-        settleinfo,
-        file_url
+        req_id: this.sitem.id,
+        plan_type: 4,
+        plan_info,
+        store_id,
+        file,
       }
 
-      const { code, msg, data } = await workbenchRequest.settle(params)
+      const { code, msg, data } = await asyncRequest.planCreate(params)
       
       if(code === 1){
         this.initData()

+ 66 - 12
src/views/customerService/invoiceApply/columns.js

@@ -7,13 +7,6 @@ const statusList = [
   { id: '5', label: '开票申请完成', type: 'success' }
   // 已选完商品,取消议价
 ]
-const demandColumns = [
-  {
-    prop: 'TODO',
-    label: 'TODO',
-    span: 24
-  },
-]
 
 const listCol = [
   {
@@ -59,16 +52,16 @@ const listCol = [
     prop: 'status',
     label: '状态',
     _slot_:'status',
-    'min-width': '125'
+    'min-width': '160px'
   },
   {
-    prop: 'TODO',
+    prop: 'ainv_fee',
     label: '已开票金额',
     minWidth: '150px'
   },
 
   {
-    prop: 'TODO',
+    prop: 'winv_fee',
     label: '未开票金额',
     'width': '120px'
   },
@@ -82,8 +75,69 @@ const listCol = [
   }
 ]
 
+const invoiceApplyColumns = [
+  {
+    prop: 'invNo',
+    label: '发票申请编号',
+    span: 8
+  },
+  {
+    prop:'companyName',
+    label:'客户公司',
+    _slot_:'company',
+    span: 8
+  },
+  {
+    prop:'invoice_title',
+    label:'发票抬头',
+    span: 8
+  },
+  {
+    prop:'invoice_type',
+    label:'发票类型',
+    span: 8,
+    _slot_:'invoice_type'
+  },
+  {
+    prop:'status',
+    label:'状态',
+    span:8,
+    _slot_:'status'
+  },
+  {
+    prop:'creater',
+    label:'创建人',
+    span: 8
+  },
+  {
+    prop:'winv_fee',
+    label:'未开票金额',
+    span: 6
+  },
+  {
+    prop:'ainv_fee',
+    label:'已开票金额',
+    span: 6
+  },
+  {
+    prop:'wpay_amount',
+    label:'未回款金额',
+    span: 6
+  },
+  {
+    prop:'apay_amount',
+    label:'已回款金额',
+    span: 6
+  },
+  {
+    prop:'remark',
+    label:'备注',
+    span: 24
+  }
+]
+
 export {
   listCol, 
-  demandColumns,
-  statusList,
+  invoiceApplyColumns,
+  statusList
 }

+ 1 - 1
src/views/customerService/invoiceApply/components/demandModal.vue

@@ -52,7 +52,7 @@
 
 <script>
 import pageInfo from "@/mixins/elPaginationHandle"
-import asyncRequest from "@/apis/service/customerService/invoiceApply";
+import asyncRequest from "@/apis/service/customerService/demandOrder";
 import { demandStatusOptions } from '@/assets/js/statusList'
 import { columns } from "./_columns"
 export default {

+ 50 - 20
src/views/customerService/invoiceApply/detail.vue

@@ -9,15 +9,44 @@
             </el-collapse-item>
 
             <template v-else>
-              <el-collapse-item title="需求订单详情" name="3">
-                <demand-detail id="2" />
+              <el-collapse-item title="开票申请详情" name="4">
+                <show-data-table
+                  style="margin-bottom:10px"
+                  :newTime="newTime"
+                  :sitem="sitem"
+                  :columns="invoiceApplyColumns"
+                >
+                  <template #company>
+                    <div style="display:flex">
+                      <p style="margin-right:5px">{{sitem.companyName}}</p>
+
+                      <el-tooltip :content="'客户公司编号 : ' + sitem.companyNo" placement="top">
+                        <i class="el-icon-warning-outline" />
+                      </el-tooltip>
+                    </div>
+                  </template>
+
+                  <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 || '--'"
+                    ></el-tag>
+                  </template>
+
+                  <template #invoice_type>
+                    <el-tag size="mini">
+                      {{(invoiceTypeList.find(({value}) => value === String(sitem.invoice_type)) || {}).label || '--'}}
+                    </el-tag>
+                  </template>
+                </show-data-table>
               </el-collapse-item>
 
-              <el-collapse-item title="开票申请详情" name="4">
-                TODO发票详情...
+              <el-collapse-item title="需求订单详情" name="3">
+                <demand-detail id="2" />
               </el-collapse-item>
               
-              <el-collapse-item title="发票申请管理" name="5">
+              <el-collapse-item title="发票申请管理" name="5" v-if="Number(sitem.status) === 2">
                 <upload-invoice-node :requestMethod="handleInvoiceUpload" />
               </el-collapse-item>
             </template>
@@ -33,10 +62,9 @@ import demandRequest from "@/apis/service/customerService/demandOrder";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
 
-import { demandDetailColumns } from '../demandOrder/columns';
 import CreateInvoiceApply from "./components/createInvoiceApply.vue"
-import { demandColumns, statusList,} from "./columns";
-
+import { demandColumns, statusList, invoiceApplyColumns} from "./columns";
+import { invoiceTypeList } from '@/assets/js/statusList';
 
 export default {
   name: "invoiceApplyDetail",
@@ -63,11 +91,13 @@ export default {
 
   data() {
     return {
+      invoiceTypeList,
       size: "small",
       eaxmList: [],
       demandColumns,
       statusList,
       projectTabs: "1",
+      invoiceApplyColumns,
       activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "20"],
       newTime: "",
       loading: false,
@@ -111,18 +141,11 @@ export default {
         id: this.$route.query.id
       })
 
-      if(invoice.code !== 1) {
-        this.loading = false
-        return
-      }
-
-      this.sitem = invoice.data
-
       this.loading = false
-
-      const demand = await demandRequest.detail({
-        reqCode:invoice.reqCode
-      })
+      if(invoice.code !== 1) return
+      
+      this.sitem = invoice.data
+      this.getNewTime()
     },
 
     getNewTime() {
@@ -134,7 +157,14 @@ export default {
         invoiceList,
         id:this.sitem.id
       }
-      return asyncRequest.upload(params)
+
+      const result = await asyncRequest.upload(params)
+      
+      if(result.code === 1){
+        this.initForm()
+      }
+
+      return result
     },
 
     async statusSubmit(model, title) {

+ 26 - 0
src/views/customerService/invoiceApproval/_static.js

@@ -0,0 +1,26 @@
+const search = {
+    //创建时间开始结束
+    createStart:'create_start',
+    createEnd:'create_end',
+    //供应商企业
+    supplier:'supplier',
+    //需求订单编号
+    demandOrderNo:'demandOrderNo',
+    //发票状态
+    invoiceStatus:'invoiceStatus',
+    //开票日期开始结束
+    openStart:'openStart',
+    openEnd:'openEnd',
+    //发票代码
+    invoiceCode:'invCode',
+    //发票号码
+    invoiceNumber:'invNum',
+    //发票类型
+    invoiceType:'invoiceType',
+    invoiceApplyNo:'invoiceApplyNo'
+}
+
+export const mapPropertys = {
+    //搜索表单
+    search
+}

+ 74 - 48
src/views/customerService/invoiceApproval/columns.js

@@ -1,87 +1,113 @@
 
 const statusList = [
-  { id: '0', label: '待业务主管审核', type: '' },
-  { id: '1', label: '业务主管已通过', type: 'success' },
-  { id: '2', label: '业务主管已驳回', type: 'danger' },
-  { id: '3', label: '业务主管越线通过', type: 'warning' },
-  { id: '4', label: '取消议价', type: 'info' }
-  // 已选完商品,取消议价
+  { id: '0', label: '驳回', type: 'danger' },
+  { id: '1', label: '待确认', type: 'info' },
+  { id: '2', label: '确认', type: 'success' },
 ]
+
 const listCol = [
-  {
+    {
     type:'selection',
+    fixed:'left'
   },
   {
-    prop: 'todo',
+    prop: 'inv_code',
     label: '开票申请编号',
-    width: '155'
+    width: '110px'
   },
 
   {
-    prop: 'todo',
-    label: '开票申请发票类型',
-    width: '155'
-  },
 
-  {
-    prop: 'todo',
-    label: '需求订单编号',
-    width: '120px'
-  },
-  {
-    prop: 'todo',
-    label: '需求公司',
-    width: '155'
+    prop:'status',
+    label:'状态',
+    _slot_:'status',
+    width: '75px'
   },
 
   {
-    prop: 'todo',
-    label: '发票记录编号',
-    width: '155px'
+    prop: 'invoiceType',
+    label: '开票申请发票类型',
+    width: '125px',
+    _slot_:'invoiceType'
+    // reuqired:true
   },
+
   {
-    prop: 'todo',
-    label: '发票状态',
-    width: '155px'
+    prop: 'demandOrder',
+    label: '需求订单编号',
+    width: '180px',
+    _slot_:'demandOrder'
   },
+  // {
+  //   prop: 'todo',
+  //   label: '供应商企业',
+  //   width: '155',
+  //   required:true
+  // },
+
+  // {
+  //   prop: 'todo',
+  //   label: '发票记录编号',
+  //   width: '155px',
+  //   required:true
+  // },
+  // {
+  //   prop: 'todo',
+  //   label: '发票状态',
+  //   width: '155px',
+  //   required:true
+  // },
   {
-    prop: "todo",
-    label: "发票类型",
-    width: '155px'
+    prop: 'invoiceType',
+    label: '发票类型',
+    'width': '125px',
+    _slot_:'invoiceType'
   },
   {
-    prop: 'todo',
+    prop: 'invoiceCode',
     label: '发票代码',
-    'min-width': '180'
+    'min-width': '125'
   },
   {
-    prop: 'todo',
+    prop: 'invoiceNum',
     label: '发票号码',
-    'min-width': '125'
+    minWidth: '150px'
   },
+
   {
-    prop: "todo",
-    label: "开票日期",
-    width: 110,
+    prop: 'open_date',
+    label: '开票日期',
+    minWidth: '110px'
   },
   {
-    prop: 'todo',
-    label: '税前金额',
-    minWidth: '150px'
+    prop: 'subtotal_amount',
+    label: '税前金额'
+  },
+  {
+    prop: 'total_amount',
+    label: '税后金额'
   },
   {
-    prop: 'todo',
-    label: '税后金额',
-    'width': '120px'
+    prop:'check_code',
+    label:'校验码',
+    width:'125px'
   },
   {
-    prop: 'todo',
-    label: '驳回原因',
-    'width': '120px'
+    prop:'todo',
+    label:'驳回原因',
+    required:true
   },
+  // {
+  //   prop: '',
+  //   label: '操作',
+  //   fixed: 'right',
+  //   _noset_: true,
+  //   _slot_: 'operation',
+  //   width: 50
+  // }
 ]
 
 export {
   listCol,
-  statusList,
+  statusList
 }

+ 8 - 3
src/views/customerService/invoiceApproval/components/approvalModal.vue → src/views/customerService/invoiceApproval/components/invoice-modal.vue

@@ -3,7 +3,7 @@
     <el-form ref="form" :model="formData" size="mini" :rules="rules" label-width="80px">
       <el-form-item prop="status" label="审批状态">
         <el-select v-model="formData.status" style="width: 100%" placeholder="审批状态">
-          <el-option label="通过" value="1" />
+          <el-option label="通过" value="2" />
           <el-option label="驳回" value="0" />
         </el-select>
       </el-form-item>
@@ -13,7 +13,7 @@
       </el-form-item>
 
       <ElFormItem class="flex-end">
-        <ElButton type="primary" @click="onSubmit">保存</ElButton>
+        <ElButton type="primary" @click="onSubmit" :loading="loading">保存</ElButton>
       </ElFormItem>
     </el-form>
   </el-dialog>
@@ -65,11 +65,16 @@ export default {
     handleClose(){
       this._visible = false
       this.formData = {...defaultData}
+      this.loading = false
     },
     async onSubmit(){
       try{
         await this.$refs.form.validate()
-        this.$emit("confirm",this.formData)
+        this.loading = true
+        this.$emit("confirm",{
+          ...this.formData,
+          inv_type: '1',
+        })
       }catch (e) {
         console.log(e)
       }

+ 292 - 0
src/views/customerService/invoiceApproval/components/template.js

@@ -0,0 +1,292 @@
+const mapTemplateToTable = {
+  '发票申请编码': 'platform_id',
+  '发票类型': 'supplierNo',
+  '发票代码': 'companyNo',
+  '发票号码': 'customerNo',
+  '价税合计': 'cat_id1',
+  '发票金额': 'cat_id2',
+  '校验码': 'cat_id',
+  '开票日期': 'good_unit'
+}
+
+export const getTableProperty = (key) => mapTemplateToTable[key]
+export const PROPERTYS = {
+  COMPANY_NO: getTableProperty('销售方公司编码'),
+  CUSTOMER_NO: getTableProperty('购买方公司编码'),
+  SUPPLIER_NO: getTableProperty('供应商公司编码'),
+  PLATFORM: getTableProperty('所属平台ID'),
+  CATEGORY: getTableProperty('三级品类ID'),
+  GOOD_NAME: getTableProperty('商品名称'),
+  GOOD_UNIT: getTableProperty('商品单位ID'),
+  GOOD_NUM: getTableProperty('数量'),
+  GOOD_PRICE: getTableProperty('销售单价'),
+  TAX: getTableProperty('税率'),
+  CGD_PRICE: getTableProperty('采购单价'),
+  CGD_TAX: getTableProperty('采购毛利率'),
+  SALE_TOTAL: getTableProperty('销售总额'),
+  CONTACTOR: getTableProperty('收货人'),
+  MOBILE: getTableProperty('联系电话'),
+  ADDR: getTableProperty('联系地址'),
+  SEND_TIME: getTableProperty('发货时间'),
+  PO_CODE: getTableProperty('平台订单号'),
+  CGD_TOTAL: getTableProperty('采购总额'),
+  WORK_CODE: getTableProperty('单据号')
+}
+
+export const template = Array(1).fill(1).map(() => ({
+  '所属平台ID': '58',
+  '供应商公司编码': 'QS2206011407522117',
+  '销售方公司编码': 'GS2302231323386950',
+  '购买方公司编码': 'KH2203271822232121',
+  '一级品类ID': '871',
+  '二级品类ID': '871',
+  '三级品类ID': '871',
+  '商品单位ID': '7',
+  '商品名称': '测试商品名称',
+  '销售单价': '32',
+  '数量': '100',
+  '销售总额': '3200',
+  '税率': '13',
+  '采购单价': '30.00',
+  '采购总额': '3000',
+  '采购毛利率': '6',
+  '平台订单号': 'PO206020230400240002',
+  '收货人': '张三',
+  '联系电话': '19955554444',
+  '联系地址': 'xx市xx区xx街道',
+  '发货时间': '2023-4-9 8:00:00'
+}))
+
+export const columns = [
+  {
+    type: 'index',
+    label: '序号',
+    width: '80px'
+  },
+  {
+    prop: PROPERTYS.PLATFORM,
+    label: '所属平台ID',
+    width: '110px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.SUPPLIER_NO,
+    label: '供应商公司编码',
+    width: '120px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.COMPANY_NO,
+    label: '销售方公司编码',
+    width: '156px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.CUSTOMER_NO,
+    label: '购买方公司编码',
+    width: '180px',
+    required: true
+  },
+
+  {
+    prop: getTableProperty('一级品类ID'),
+    label: '一级品类ID',
+    width: '150px',
+    required: true
+  },
+  {
+    prop: getTableProperty('二级品类ID'),
+    label: '二级品类ID',
+    width: '150px',
+    required: true
+  },
+  {
+    prop: getTableProperty('三级品类ID'),
+    label: '三级品类ID',
+    width: '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.GOOD_UNIT,
+    label: '商品单位ID',
+    width: '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.GOOD_NAME,
+    label: '商品名称',
+    width: '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.GOOD_PRICE,
+    label: '销售单价',
+    'width': '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.GOOD_NUM,
+    label: '数量',
+    width: '140px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.SALE_TOTAL,
+    label: '销售总额',
+    'width': '150px'
+  },
+  {
+    prop: PROPERTYS.TAX,
+    label: '税率',
+    width: '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.CGD_PRICE,
+    label: '采购单价',
+    'width': '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.CGD_TOTAL,
+    label: '采购总额',
+    'width': '150px',
+    required: true
+  },
+  {
+    prop: getTableProperty('采购毛利率'),
+    label: '采购毛利率',
+    'width': '150px'
+  },
+  {
+    prop: PROPERTYS.PO_CODE,
+    label: '平台订单号',
+    'width': '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.CONTACTOR,
+    label: '收货人',
+    'width': '150px',
+    required: true
+  },
+  // {
+  //   prop: PROPERTYS.WORK_CODE,
+  //   label: '单据号',
+  //   'width': '150px'
+  // },
+  {
+    prop: PROPERTYS.MOBILE,
+    label: '联系电话',
+    'width': '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.ADDR,
+    label: '联系地址',
+    'width': '150px',
+    required: true
+  },
+  {
+    prop: PROPERTYS.SEND_TIME,
+    label: '发货时间',
+    'width': '150px',
+    required: true
+  }
+]
+
+export function createErrorMessage(messages) {
+  const rows = Object.keys(messages)
+  return [rows[0]].reduce((prev, row, index) => {
+    console.log(messages[row])
+    const suffix = index === rows.length - 1 ? '</ul>' : ''
+    const content = prev + `
+      <li>
+        <strong style="font-weight:700">第${row}行</strong>,${messages[row][0]}
+      </li>
+    `
+    return content + suffix
+  }, '<ul>')
+}
+
+export const createFieldVerification = (message) => ({
+  notValidRows: [],
+  isValid: true,
+  message
+})
+
+export const requsetFields = [
+  PROPERTYS.TAX,
+  PROPERTYS.ADDR,
+  PROPERTYS.MOBILE,
+  PROPERTYS.PO_CODE,
+  PROPERTYS.PLATFORM,
+  PROPERTYS.CATEGORY,
+  PROPERTYS.GOOD_NAME,
+  PROPERTYS.GOOD_UNIT,
+  PROPERTYS.GOOD_NUM,
+  PROPERTYS.CGD_PRICE,
+  PROPERTYS.CONTACTOR,
+  PROPERTYS.SEND_TIME,
+  PROPERTYS.WORK_CODE,
+  PROPERTYS.GOOD_PRICE,
+  PROPERTYS.COMPANY_NO,
+  PROPERTYS.SUPPLIER_NO,
+  PROPERTYS.CUSTOMER_NO,
+  PROPERTYS.CGD_TAX,
+  PROPERTYS.SALE_TOTAL,
+  PROPERTYS.CGD_TOTAL
+]
+
+// 税率、数量、销售单价、采购单价
+export const requiredFields = [
+  PROPERTYS.TAX,
+  PROPERTYS.ADDR,
+  PROPERTYS.MOBILE,
+  PROPERTYS.PO_CODE,
+  PROPERTYS.PLATFORM,
+  PROPERTYS.CATEGORY,
+  PROPERTYS.GOOD_NAME,
+  PROPERTYS.GOOD_UNIT,
+  PROPERTYS.GOOD_NUM,
+  PROPERTYS.CONTACTOR,
+  PROPERTYS.SEND_TIME,
+  PROPERTYS.COMPANY_NO,
+  PROPERTYS.SUPPLIER_NO,
+  PROPERTYS.CUSTOMER_NO,
+  PROPERTYS.CGD_TOTAL,
+  PROPERTYS.SALE_TOTAL,
+  PROPERTYS.CGD_TAX
+]
+
+export const numberFields = [
+  PROPERTYS.CGD_TOTAL,
+  PROPERTYS.SALE_TOTAL,
+  PROPERTYS.GOOD_PRICE,
+  PROPERTYS.CGD_PRICE,
+  PROPERTYS.CGD_TAX
+]
+
+export const intNumberFields = [
+  PROPERTYS.CATEGORY,
+  PROPERTYS.GOOD_UNIT,
+  PROPERTYS.GOOD_NUM,
+  PROPERTYS.TAX
+]
+
+export const helper = {
+  fields: function(sourceObject) {
+    return Object.keys(sourceObject)
+  },
+  values: function(sourceObject, fields, index = 0) {
+    return fields.map(field => {
+      return sourceObject[field][index]
+    })
+  },
+  write: function(sourceObject, fields) {
+    return fields.reduce((prev, currentKey) => ({
+      ...prev,
+      [currentKey]: sourceObject[currentKey]
+    }), {})
+  }
+}

+ 160 - 217
src/views/customerService/invoiceApproval/index.vue

@@ -10,6 +10,7 @@
         :size="size"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
+        @selection-change="handleSelectionChange"
         @screen-reset="
           pageInfo.curr = 1;
           parmValue.page = 1;
@@ -24,24 +25,31 @@
         <template #table-header="{}">
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
-              <el-col :span="4" style="width: 301px; padding: 0 0 0px 0px">
+              <el-col :span="4" style="width: 360px; padding: 0 10px 0 0px">
                 <period-date-picker
-                  :start="parmValue[mapFields.createStart]"
-                  :end="parmValue[mapFields.createEnd]"
-                  :width="'134px'"
+                  :start="parmValue.create_start"
+                  :end="parmValue.create_end"
+                  :width="'164px'"
                   :size="searchSize"
+                  @timeReturned="handleTime"
                   placeholder="创建"
-                  @timeReturned="evt => handleTime(evt,'create')"
                 />
               </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;
+                                parmValue.page = 1;
+                                searchList();"
+                />
+              </el-col>
+
+              <el-col :span="4" style="width: 150px;margin-right:10px">
                 <el-select
-                  style="width:100%"
                   :size="searchSize"
-                  v-model="parmValue[mapFields.status]"
+                  v-model="parmValue.invoiceStatus"
                   clearable
-                  placeholder="申请状态"
+                  placeholder="开票状态"
                   @change="
                     pageInfo.curr = 1;
                     parmValue.page = 1;
@@ -50,7 +58,7 @@
                 >
                   <el-option
                     v-for="item in statusList"
-                    :key="item.id"
+                    :key="item.ids"
                     :label="item.label"
                     :value="item.id"
                   >
@@ -58,23 +66,6 @@
                 </el-select>
               </el-col>
 
-              <el-col :span="4">
-                <el-select
-                  style="width:100%"
-                  :size="searchSize"
-                  v-model="parmValue[mapFields.demandCompany]"
-                  clearable
-                  placeholder="需求企业"
-                  @change="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                >
-                  <el-option />
-                </el-select>
-              </el-col>
-
               <el-col :span="3" style="width: 66px; float: right">
                 <el-button
                   :size="searchSize"
@@ -97,47 +88,34 @@
               </el-col>
             </el-row>
 
-            <el-row  style="margin-top: 10px">
-              <el-col :span="4" style="width: 301px; padding: 0 0 0px 0px">
+            <el-row style="margin-top:10px">
+              <el-col :span="4" style="width: 360px; padding: 0 10px 0 0px">
                 <period-date-picker
-                  :start="parmValue[mapFields.openStart]"
-                  :end="parmValue[mapFields.openEnd]"
-                  :width="'134px'"
+                  :start="parmValue.open_start"
+                  :end="parmValue.open_end"
+                  :width="'164px'"
                   :size="searchSize"
-                  @timeReturned="evt => handleTime(evt,'open')"
+                  @timeReturned="() => handleTime(true)"
                   placeholder="开票"
                 />
               </el-col>
 
               <el-col :span="4" style="margin-right:10px">
-                <el-input
-                  clearable
-                  :size="searchSize"
-                  placeholder="开票申请编号"
-                  v-model="parmValue[mapFields.openInviceNo]"
-                  @change="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                />
+                <el-input size="mini" placeholder="发票代码" v-model="parmValue.invoiceCode"
+                  @change="pageInfo.curr = 1;
+                           parmValue.page = 1;
+                          searchList();"  />
               </el-col>
 
-              <el-col :span="4" style="margin-right:10px">
-                <el-input
-                  clearable
-                  :size="searchSize"
-                  placeholder="需求订单编号"
-                  v-model="parmValue[mapFields.demandOrderNo]"
-                  @change="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                />
+              <el-col :span="4">
+                <el-input size="mini" placeholder="发票号码" v-model="parmValue.invoiceNum"
+                  @change="pageInfo.curr = 1;
+                           parmValue.page = 1;
+                          searchList();"
+                 />
               </el-col>
 
-               <el-col :span="3" style="width: 113px; float: right">
+              <el-col :span="3" style="width:115px;float: right">
                 <el-button
                   :size="searchSize"
                   type="primary"
@@ -152,55 +130,50 @@
                   type="warning"
                   class="fr"
                   :size="searchSize"
-                  @click="visible = true"
+                  @click="onBatchApprovalInvoice"
                 >
-                  批量审发票
+                  批量审发票
                 </el-button>
               </el-col>
             </el-row>
 
             <el-row style="margin-top:10px">
               <el-col :span="4" style="margin-right:10px">
-                <el-input  v-model="parmValue[mapFields.invoiceCode]" size="mini" placeholder="发票代码"  @change="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  " />
-              </el-col>
-
-              <el-col :span="4"  style="margin-right:10px">
-                <el-input
-                  clearable
-                  :size="searchSize"
-                  placeholder="发票号码"
-                  v-model="parmValue[mapFields.invoiceNumber]"
-                  @change="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                />
+                <el-select v-model="parmValue.invoice_type" size="mini" placeholder="发票类型" style="width:100%"
+                  @change="pageInfo.curr = 1;
+                           parmValue.page = 1;
+                           searchList();"
+                  >
+                    <el-option
+                      v-for="type in invoiceTypeList"
+                      :key="type.value"
+                      :value="type.value"
+                      :label="type.label"
+                     />
+                  </el-select>
               </el-col>
 
               <el-col :span="4">
-                <el-select
-                  style="width:100%"
-                  :size="searchSize"
-                  v-model="parmValue[mapFields.invoiceType]"
-                  clearable
-                  placeholder="发票类型"
-                  @change="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                >
-                  <el-option />
-                </el-select>
+                <el-input size="mini" placeholder="发票申请编号" v-model="parmValue.invNo"
+                  @change=" pageInfo.curr = 1;
+                           parmValue.page = 1;
+                          searchList();"
+                 />
               </el-col>
             </el-row>
           </div>
         </template>
+
+        <template #invoiceType="{ scope }">
+          <el-tag size="mini">
+            {{(invoiceTypeList.find(({value}) => value === scope.row.invoiceType) || {}).label || '--'}}
+          </el-tag>
+        </template>
+
+        <template #demandOrder={scope}>{{
+            (scope.row.orderinvoice || {}).reqCode || '--'
+          }}</template>
+
         <template #status="{ scope }">
           <el-tag
             :size="tablebtnSize"
@@ -214,22 +187,7 @@
             "
           ></el-tag>
         </template>
-        <template #good_name="{ scope }">
-          <span>{{ scope.row.good_name }}</span>
-          <span
-            v-for="(si, sii) in scope.row.specinfo"
-            :key="si.spec_value_id + sii"
-          >
-            {{ 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">
-            <span v-if="sii !== 0">_</span>{{ si.name }}</span
-          >
-        </template>
+
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((i) => i == '007')"
@@ -237,79 +195,87 @@
             content="详情"
             placement="top"
           >
-            <i class="el-icon-view tb-icon" @click="getRouter('invoiceApplyDetail', scope.row.bargainNo )" />
+            <i
+              class="el-icon-view tb-icon"
+
+               @click="getRouter('bargainListDetail', scope.row.bargainNo )"
+            ></i>
           </el-tooltip>
         </template>
       </ex-table>
-    </div>
 
-    <ApprovalModal :visible.sync="visible" />
+      <invoice-modal :visible.sync="visible" @confirm="handleBatchApprovalInvoice" />
+    </div>
   </div>
 </template>
 <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import asyncRequest from "@/apis/service/customerService/invoiceApproval";
+import asyncRequest from "@/apis/service/platformService/invoice";
 import companyHelper from "@/mixins/companyHelper"
 import { listCol, statusList } from "./columns";
-import ApprovalModal from "./components/approvalModal.vue";
-import { createEmptyStringObject } from '@/utils/static';
 import { mapGetters } from "vuex";
+import { invoiceTypeList } from '@/assets/js/statusList';
+import InvoiceModal from "./components/invoice-modal.vue"
 
-const mapFields = {
-  //创建时间开始&结束
-  createStart:'createStart',
-  createEnd:'createEnd',
-  //开票时间开始&结束
-  openStart:'openStart',
-  openEnd:'openEnd',
-  //需求企业
-  demandCompany:'demandCompany',
-  //发票号码
-  invoiceNumber:'invoiceNumber',
-  //发票代码
-  invoiceCode:'invoiceCode',
-  //发票类型
-  invoiceType:'invoiceType',
-  //开票申请编号
-  openInviceNo:'openInviceNo',
-  //需求订单编号
-  demandOrderNo:'demandOrderNo',
-  //申请状态
-  status:'status'
-}
 
-const mapDateFields = {
-  create:'创建',
-  open:'开票'
-}
+
+/**
+ * @props
+    create_start 创建开始时间
+    create_end 创建结束时间
+    open_start 开票开始时间
+    open_end 开票结束时间
+    supplier 供应商企业
+    reqCode 需求订单编号
+    invoiceStatus 发票状态
+    invoiceCode 发票代码,
+    invoiceNum 发票号码,
+    invoice_type 发票类型
+    invNo 发票申请编号
+*/
+
 
 export default {
   name: "bargainList",
   mixins: [mixinPage, resToken, companyHelper],
-  components:{ApprovalModal},
+  components:{InvoiceModal},
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       const tran =
-        this.$store.getters.btnList.find((item) => item.menu_route == "invoiceApproval") || {};
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "invoice"
+        ) || {};
       const { action } = tran ?? {};
       return action ?? [];
     },
   },
   data() {
     return {
-      mapFields,
-      visible:false,
+      selected:[],
+      select: "1",
+      s_input: "",
+      invoiceTypeList,
       customerCode: [], //客户公司code
       statusList,
       sitem: null,
       loading: false,
-      showModel: false,
+      visible: false,
       isDetail: false,
       modelId: 0,
       parmValue: {
-        ...createEmptyStringObject(mapFields),
+        create_start:"", // 创建开始时间
+        create_end:"", // 创建结束时间
+        open_start:"", // 开票开始时间
+        open_end:"", // 开票结束时间
+        supplier:"", // 供应商企业
+        reqCode:"", // 需求订单编号
+        invoiceStatus:"", // 发票状态
+        invoiceCode:"", // 发票代码,
+        invoiceNum:"", // 发票号码,
+        invoice_type:"", // 发票类型
+        invNo:"", // 发票申请编号
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
@@ -339,13 +305,6 @@ export default {
       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= {
         size: size,
         curr: page,
@@ -362,8 +321,38 @@ export default {
     }
     this.searchList();
   },
-
   methods: {
+    async handleBatchApprovalInvoice(data){
+      const { code } = await asyncRequest.batch({
+        idArr:this.selected.map(({id}) => id),
+        ...data
+      })
+
+      if(code !== 1) return
+      this.visible = false
+      this.searchList()
+    },
+    onBatchApprovalInvoice(){
+      if(this.selected.length === 0){
+        this.$message.warning('至少选择一张状态为 "待确认" 的发票申请')
+        return
+      }
+
+      const isOK = this.selected.every(({status}) => String(status) === "1")
+
+      if(!isOK){
+         this.$message.warning('请选择状态为 "待确认" 的发票申请')
+        return
+      }
+
+
+      this.visible = true
+      // console.log(this.selected)
+    },
+    handleSelectionChange(list) {
+      console.log(list)
+      this.selected = list
+    },
     getRouter(toRouter, queryId){
       if (toRouter && queryId) {
         let model = {
@@ -392,16 +381,20 @@ export default {
       this.select = "1";
       this.s_input = "";
       this.parmValue = {
-        bidsNo: "", // 反馈编号
-        infoNo: "", // 竞价单编号
-        bargainNo: "", //议价编号
-        status: "", // 状态
-        start: "",
-        end: "",
+        create_start:"", // 创建开始时间
+        create_end:"", // 创建结束时间
+        open_start:"", // 开票开始时间
+        open_end:"", // 开票结束时间
+        supplier:"", // 供应商企业
+        reqCode:"", // 需求订单编号
+        invoiceStatus:"", // 发票状态
+        invoiceCode:"", // 发票代码,
+        invoiceNum:"", // 发票号码,
+        invoice_type:"", // 发票类型
+        invNo:"", // 发票申请编号
         page: 1, // 页码
         size: 15, // 每页显示条数
-        company_name:"",
-      };
+      }
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
@@ -417,68 +410,17 @@ export default {
       this.isDetail = isDetail;
       this.sitem = sitem;
     },
-    async deleteById(id, status) {
-      await this.$confirm("确定要删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(async () => {
-          const model = {
-            id: id,
-            status: status + '' === "1" ? "0" : "1",
-          };
-          const res = await asyncRequest.status(model);
-          if (res && res.code === 0) {
-            this.$notify.success({
-              title: "删除成功",
-              message: "",
-            });
-            this.searchList();
-          } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
-          } else {
-            this.$message.warning(res.message);
-          }
-        })
-        .catch(() => {
-          console.log("取消");
-        });
-    },
     // 列表搜索
     async searchList() {
-      return
-
-      for(const field of Object.keys(mapDateFields)){
-        const startField = `${field}Start`
-        const endField = `${field}End`
-
-        if (
-          (this.parmValue[startField] !== "" && this.parmValue[endField] === "") ||
-          (this.parmValue[startField] === "" && this.parmValue[endField] !== "")
-        ) {
-          this.$message.warning(`${mapDateFields[field]}时间区间不完整!`);
-          return;
-        }
-      }
-
       this.loading = true;
-      this.parmValue.bargainNo = this.select === "1" ? this.s_input : "";
-      this.parmValue.bidsNo = this.select === "2" ? this.s_input : "";
-      this.parmValue.infoNo = this.select === "3" ? this.s_input : "";
-      this.parmValue.company_name = this.select === "4" ? this.s_input : "";
-
       const res = await asyncRequest.list({
         ...this.parmValue,
-        companyNo: this.currentCompany,
-        customer_code: Array.isArray(this.parmValue.customer_code) ? this.parmValue.customer_code[0] : "",
-        noRelation: true
+        inv_type: "1"
       });
 
-      if (res && res.code === 0 && res.data) {
+      if (res && res.code === 1 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
       } else {
         this.tableData = [];
         this.pageInfo.total = 0;
@@ -518,9 +460,10 @@ export default {
         });
     },
     // 时间选择事件
-    async handleTime(e,prop) {
-      const startProp = `${prop}Start`
-      const endProp = `${prop}End`
+    async handleTime(e,isOpen = false) {
+      const startProp = isOpen ? "open_start" :"create_start"
+      const endProp = isOpen ? "open_end" : "create_end"
+
       if (e.startTime !== "") {
         this.parmValue[startProp] = e.startTime;
       } else {

+ 17 - 19
src/views/customerService/paymentApply/columns.js

@@ -1,32 +1,29 @@
 
 const statusList = [
-  { id: '0', label: '待业务主管审核', type: '' },
-  { id: '1', label: '业务主管已通过', type: 'success' },
-  { id: '2', label: '业务主管已驳回', type: 'danger' },
-  { id: '3', label: '业务主管越线通过', type: 'warning' },
-  { id: '4', label: '取消议价', type: 'info' }
-  // 已选完商品,取消议价
+  { id: '1', label: '待上传凭证', type: '' },
+  { id: '2', label: '待供应商确认', type: '' },
+  { id: '3', label: '完成', type: 'success' }
 ]
 
 const editColumns = [
   {
-    prop: 'todo',
+    prop: 'reqCode',
     label: '平台订单编号',
     span: 8
   },
 
   {
-    prop: 'todo',
+    prop: 'DzNo',
     label: '业务订单编号',
     span: 8
   },
   {
-    prop: 'todo',
+    prop: 'createtime',
     label: '创建时间',
     span: 8
   },
   {
-    prop: 'todo',
+    prop: 'pay_amount',
     label: '总金额',
     span: 8
   },
@@ -61,9 +58,9 @@ const editColumns = [
 
 const listCol = [
   {
-    prop: 'todo',
+    prop: 'DzNo',
     label: '付款申请编号',
-    width: '155'
+    width: '115'
   },
 
   {
@@ -74,33 +71,34 @@ const listCol = [
   },
 
   {
-    prop: 'todo',
+    prop: 'pay_amount',
     label: '付款金额',
     width: '120px'
   },
   {
-    prop: 'todo',
+    prop: 'reqCode',
     label: '需求订单编号',
-    width: '155'
+    width: '185'
   },
 
   {
-    prop: 'todo',
+    prop: 'companyName',
     label: '客户公司',
     minWidth: '155px'
   },
   {
     prop: 'todo',
     label: '店铺名称',
-    minWidth: '155px'
+    minWidth: '155px',
+    required: true
   },
   {
-    prop: "todo",
+    prop: "creater",
     label: "创建人",
     minWidth: '155px'
   },
   {
-    prop: 'todo',
+    prop: 'createtime',
     label: '创建时间',
     'min-width': '180'
   },

+ 53 - 105
src/views/customerService/paymentApply/detail.vue

@@ -1,42 +1,50 @@
 <template>
   <div class="bargainListDetail">
-    <div class="bargainListDetail-main" v-if="powers.some((i) => i == '007')">
+    <div class="bargainListDetail-main">
       <el-tabs v-model="projectTabs" v-loading="loading">
         <el-tab-pane label="付款申请管理" name="1">
           <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
-            <el-collapse-item :title="'付款申请信息展示'" name="1">
+            <el-collapse-item :title="'付款申请信息'" name="1">
               <show-data-table
                 v-if="newTime !== ''"
                 style="padding: -5px 0 10px 0"
                 :newTime="newTime"
-                :sitem="{}"
+                :sitem="sitem"
                 :columns="editColumns"
-              />
+              >
+                <template #status>
+                  <el-tag size="mini">
+                    {{ (statusList.find(({id}) => id === String(sitem.status)) || {}).label || '--' }}
+                  </el-tag>
+                </template>
+              </show-data-table>
             </el-collapse-item>
 
-            <el-collapse-item title="待客户上传付款凭证" name="2">
-              <credentials-node :is-amount="true" />
+            <el-collapse-item 
+              v-if="sitem && Number(sitem.status) === 1"
+               v-loading="status_loading" 
+              title="待客户上传付款凭证" 
+              name="2"
+              >
+              <credentials-node :is-amount="true" @confirm="handleUpload" />
             </el-collapse-item>
 
-            <el-collapse-item title="待供应商确认付款" name="3">
+            <el-collapse-item title="待供应商确认付款" name="3" v-if="sitem && Number(sitem.status) === 2">
               <div style="width:100%;display:flex;justify-content:flex-end;margin:10px 0px">
-                <el-button size="mini" type="primary">确认已付款</el-button>
+                <el-button size="mini" type="primary" @click="handleConfirm">确认已付款</el-button>
               </div>
             </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
       </el-tabs>
     </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
   </div>
 </template>
 <script>
 import asyncRequest from "@/apis/service/customerService/paymentApply";
 import privateField from '@/mixins/privateField';
 import resToken from "@/mixins/resToken";
-import { editColumns } from "./columns";
+import { editColumns, statusList } from "./columns";
 import { mapGetters } from "vuex";
 
 export default {
@@ -54,6 +62,7 @@ export default {
 
   data() {
     return {
+      statusList,
       size: "small",
       eaxmList: [],
       editColumns,
@@ -65,6 +74,7 @@ export default {
       queryId: "",
       status: "",
       sitem: null,
+      status_loading:false,
 
       orderItem: {},
       moneyDirItem: {},
@@ -92,110 +102,48 @@ export default {
     async refresh() {
       this.routeReGoto("bargainList", {});
     },
+   async handleUpload(data){
+      const { amount: pay_amount, credentials: pay_proof } = data
+      this.status_loading = true
+      const { code } = await asyncRequest.status({
+        id:this.queryId,
+        pay_amount,
+        pay_proof: pay_proof.join(","),
+        status:2
+      })
+      this.status_loading = false
+
+      if(code !== 1) return
+      this.initForm()
+    },
+    async handleConfirm(){
+      this.status_loading = true
+      const { code } = await asyncRequest.status({
+        id:this.queryId,
+        status:3
+      })
+      this.status_loading = false
+
+      if(code !== 1) return
+      this.initForm()
+    },
     async initData() {
       this.loading = true;
-      const { code, message, data } = await asyncRequest.detail({
-        bargainNo: this.queryId,
+      const { code, data } = await asyncRequest.detail({
+        id: this.queryId,
       });
 
-      this.eaxmList = [];
-      this.loading = false;
-      if (code === 0) {
-        this.sitem = JSON.parse(JSON.stringify(data));
+      this.loading = false
 
-        const { status, exam_info } = this.sitem;
-        this.orderItem = {};
-        this.moneyDirItem = {};
-        this.moneyItem = {};
-        this.BossItem = {};
-        if (exam_info && exam_info.length > 0) {
-          exam_info.forEach((e) => {
-            console.log(e.status);
-            switch (e.info_status + "") {
-              case "0":
-                this.orderItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "2":
-                this.moneyDirItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "4":
-                this.moneyItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "7":
-                this.BossItem = JSON.parse(JSON.stringify(e));
-                break;
-              default:
-                this.orderItem = JSON.parse(JSON.stringify(e));
-            }
-          });
-          this.eaxmList = JSON.parse(JSON.stringify(exam_info));
-        }
+      if(code !== 1) return
+      this.sitem = data
+      this.newTime = this.getNewTime()
 
-        this.status = status;
 
-        this.getNewTime();
-      } else if (code >= 100 && code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(message);
-      }
     },
     getNewTime() {
       this.newTime = new Date().valueOf();
     },
-
-    // 点击业务审核的保存按钮
-    async examFormSubmit(e, title) {
-      if (!this.loading) {
-        const { state, remark, adjunct, adjunct_name } = e;
-        let model = {
-          bargainNo: this.queryId,
-          status: state,
-          adjunct: adjunct,
-          adjunct_name: adjunct_name,
-          remark: remark,
-        };
-        await this.$confirm(`确定要提交${title}审批结果?`, {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-          .then(async () => {
-            const { after_price, lower_price } = this.sitem;
-            if (after_price * 1 < lower_price * 1 && state + "" + "" === "1") {
-              this.loading = false;
-              await this.$confirm(
-                `当前商品同意议价后,售价已低于系统最低售价${this.sitem.lower_price}元!`,
-                `最终售价已低于系统最低售价!是否继续?`,
-
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "error",
-                }
-              )
-                .then(async () => {
-                  if (adjunct === "") {
-                    this.$message.warning("越线通过,附件为必填项!");
-                    return;
-                  }
-                  this.loading = true;
-                  await this.statusSubmit(model, title);
-                })
-                .catch(() => {
-                  this.loading = false;
-                  console.log("取消1");
-                });
-            } else {
-              await this.statusSubmit(model, title);
-            }
-          })
-          .catch(() => {
-            this.loading = false;
-            console.log("取消");
-          });
-      }
-    },
     async statusSubmit(model, title) {
       if (model.status === "0") model.status = "2";
       const { code, data, message } = await asyncRequest.status(model);

+ 21 - 47
src/views/customerService/paymentApply/index.vue

@@ -94,15 +94,21 @@
                   searchList();
                 "/>
               </el-col>
-              <el-col :span="4" style="margin-right:10px">
-                <el-select size="mini" v-model="parmValue[mapFields.demandCompany]" placeholder="需求企业"  @change="
+                <!-- <el-select size="mini" v-model="parmValue[mapFields.demandCompany]" placeholder="需求企业"  @change="
                   pageInfo.curr = 1;
                   parmValue.page = 1;
                   searchList();
                 ">
                   <el-option />
-                </el-select>
-              </el-col>
+                </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;
+                     parmValue.page = 1;
+                     searchList();
+                     " 
+                   />
+                 </el-col>
             </el-row>
           </div>
         </template>
@@ -119,30 +125,13 @@
             "
           ></el-tag>
         </template>
-        <template #good_name="{ scope }">
-          <span>{{ scope.row.good_name }}</span>
-          <span
-            v-for="(si, sii) in scope.row.specinfo"
-            :key="si.spec_value_id + sii"
-          >
-            {{ 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">
-            <span v-if="sii !== 0">_</span>{{ si.name }}</span
-          >
-        </template>
         <template #operation="{ scope }">
           <el-tooltip
-            v-if="powers.some((i) => i == '007')"
             effect="dark"
             content="详情"
             placement="top"
           >
-            <i class="el-icon-view tb-icon" @click="getRouter('paymentApplyDetail', scope.row.bargainNo )" />
+            <i class="el-icon-view tb-icon" @click="getRouter('paymentApplyDetail', scope.row.id )" />
           </el-tooltip>
         </template>
       </ex-table>
@@ -158,13 +147,13 @@ import { listCol, statusList } from "./columns";
 import { mapGetters } from "vuex";
 
 const mapFields = {
-  createStart:'createnStart', //创建开始时间
-  createEnd:'createEnd',  //创建结束时间
-  demandOrderNo:'demandOrderNo', //需求订单编号
-  status:'status', //付款状
-  supplier:'supplier', //供应商公司
-  paymentApplyNo:'paymentApplyNo', //付款申请编号
-  demandCompany:'demandCompany' //需求企业
+  createStart:'create_start', //创建开始时间
+  createEnd:'create_end',  //创建结束时间
+  demandOrderNo:'reqCode', //需求订单编号
+  status:'status', //付款状
+  // supplier:'customer_id', //供应商公司
+  paymentApplyNo:'DzNo', //付款申请编号
+  demandCompany:'customer_id' //需求企业
 }
 
 export default {
@@ -239,7 +228,7 @@ export default {
       // if(this.parmValue.customer_code.length>0){
       //     this.customerCode = [this.parmValue.customer_code] ;
       // }
-      
+
        this.pageInfo= {
         size: size,
         curr: page,
@@ -265,11 +254,6 @@ export default {
           type: 'view',
         };
 
-        //有多选框的条件
-        this.parmValue.select = this.select ;
-        // this.parmValue.sselect = this.sselect ;
-        this.parmValue.s_input= this.s_input;
-        //
          let routerModel = {
           options: JSON.parse(JSON.stringify(this.parmValue)),
           router: this.$route.path,
@@ -340,8 +324,6 @@ export default {
     },
     // 列表搜索
     async searchList() {
-      return
-
       if (
         (this.parmValue[mapFields.createStart] !== "" && this.parmValue[mapFields.createEnd] === "") ||
         (this.parmValue[mapFields.createStart] === "" && this.parmValue[mapFields.createEnd] !== "")
@@ -351,22 +333,14 @@ export default {
       }
 
       this.loading = true;
-      this.parmValue.bargainNo = this.select === "1" ? this.s_input : "";
-      this.parmValue.bidsNo = this.select === "2" ? this.s_input : "";
-      this.parmValue.infoNo = this.select === "3" ? this.s_input : "";
-      this.parmValue.company_name = this.select === "4" ? this.s_input : "";
       
       const res = await asyncRequest.list({
-        ...this.parmValue,
-        companyNo: this.currentCompany,
-        customer_code: Array.isArray(this.parmValue.customer_code) ? this.parmValue.customer_code[0] : ""
+        ...this.parmValue
       });
 
-      if (res && res.code === 0 && res.data) {
+      if (res && res.code === 1 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
       } else {
         this.tableData = [];
         this.pageInfo.total = 0;

+ 59 - 35
src/views/customerService/workbench/detail.vue

@@ -29,34 +29,43 @@
               <div class="page-main-title">活动要求</div>
               <ul class="page-main-ul clear">
                 <li>项目预算:</li>
-                <li>{{ sitem.budget }}</li>
+                <li>{{ sitem.budget || '--'}}</li>
                 <li>活动城市:</li>
-                <li>{{ sitem.shortname }}</li>
+                <li>{{ sitem.shortname || '--' }}</li>
                 <li>需求项目:</li>
-                <li>{{ sitem.req_demand}}</li>
+                <li>
+                  {{sitem.req_demand_name.map(({name}) => name).join(" + ")}}
+                </li>
                 <li>活动人数:</li>
-                <li>{{ sitem.participant }}</li>
+                <li>
+                  <span v-if="Number(sitem.participant_max) === 0">{{sitem.participant_min}}+</span>
+                  <span v-else>{{sitem.participant_min}} ~ {{sitem.participant_max}}</span> 人
+                </li>
                 <li>活动需求:</li>
-                <li>{{ sitem.require_item }}</li>
+                <li>{{ sitem.require_item || '--' }}</li>
                 <li>活动时间:</li>
-                <li>{{ sitem.act_time }}</li>
+                <li>{{ sitem.act_time || '--'}}</li>
               </ul>
             </div>
           </div>
         </div>
 
-        <div class="p-right">
-          <!-- <div style="display:flex;align-items:center;margin:10px 0px">
-            <p style="margin-right:10px">店铺:</p>
-            <search-store size="mini" :value.sync="storeId" />
-          </div> -->
-         
          <!-- v-if="storeId" -->
+        <div class="p-right">
+          <div style="margin:15px 0px" v-if="!isNegotiate">
+             <el-alert
+               title="订单已过磋商阶段,不允许上传方案。"
+               type="warning"
+               show-icon
+               :closable="false"
+             />
+          </div>
+
           <el-collapse v-model="actives">
             <el-collapse-item 
               name="1" 
               title="评估预算函" 
-              v-if="String(sitem.status) === '1' || String(sitem.status) === '2'">
+              v-if="(String(sitem.status) === '1' || String(sitem.status) === '2') || !isNegotiate">
               <letter
                 ref="evaLetter"
                 :status="1"
@@ -64,7 +73,7 @@
                 :id="sitem.id"
                 :isFile="true"
                 :isSelection="true"
-                :readonly="Number(sitem.status) !== 1"
+                :readonly="Number(sitem.status) !== 1 || !isNegotiate"
                 @selection="handleSelection($event, 'evalute')"
                 @updateLetter="linkToLetterUpdate"
                 :requsetMethod="requestBudgetLetter"
@@ -75,7 +84,7 @@
             <el-collapse-item 
               name="2"
               title="活动方案管理" 
-              v-if="String(sitem.status) === '2' || String(sitem.status) === '3'">
+              v-if="(String(sitem.status) === '2' || String(sitem.status) === '3') || !isNegotiate">
               <letter 
                 :status="2"
                 ref="actLetter"
@@ -83,7 +92,7 @@
                 :id="sitem.id"
                 :isFile="true"
                 :isSelection="true"
-                :readonly="Number(sitem.status) !== 2"
+                :readonly="Number(sitem.status) !== 2 || !isNegotiate"
                 :beforeModalVisible="beforeActivityModalVisible"
                 @selection="handleSelection($event, 'activity')"
                 :requsetMethod="reqsetActivityLetter"
@@ -95,14 +104,14 @@
             <el-collapse-item 
              name="3"
              title="计划预算函管理" 
-             v-if="String(sitem.status) === '3'">
+             v-if="String(sitem.status) === '3' || !isNegotiate">
               <letter
                 ref="proLetter"
                 :status="3"
                 type="project"
                 :id="sitem.id"
                 :isFile="true"
-                :readonly="Number(sitem.status) !== 3"
+                :readonly="Number(sitem.status) !== 3 || !isNegotiate"
                 @selection="handleSelection($event, 'project')"
                 :requsetMethod="requsetProjectLetter"
                 :beforeModalVisible="beforeProjectModalVisible"
@@ -151,7 +160,9 @@ export default {
   },
   data() {
     return {
+      isNegotiate: true,
       fullLoading:false,
+      refreshTimer: null,
       storeId: "",
       demandStatusOptions,
       countdown:'00:00:00',
@@ -191,12 +202,12 @@ export default {
     };
   },
   mounted() {
-    this.initForm();
+    this.initForm()
+    this.regiterRefreshTimer()
   },
   beforeDestroy() {
-    if (this.timer) {
-      clearInterval(this.timer);
-    }
+    this.clearRefreshTimer()
+    this.clearTimer()
   },
   methods: {
     async initForm() {
@@ -208,6 +219,20 @@ export default {
       await this.initData();
       this.loading = false;
     },
+    regiterRefreshTimer(){
+      this.refreshTimer = setInterval(async () => {
+        await this.initForm()
+        const letters = ['evaLetter','actLetter','proLetter']
+        letters.forEach(letter => {
+          this.$refs[letter] && this.$refs[letter].searchList()
+        })
+      }, 60000)
+    },
+    clearRefreshTimer(){
+      if(!this.refreshTimer) return
+      window.clearInterval(this.refreshTimer)
+      this.refreshTimer = null
+    },
     getTime(value) {
       var secondTime = parseInt(value);// 秒
       var minuteTime = 0;// 分
@@ -243,11 +268,13 @@ export default {
     },
     async initData() {
       const { code, message, data } = await asyncRequest.detail({
-        id: this.queryId,
+        id: this.queryId
       });
       if (code === 1) {
         this.sitem = data
-        const { req_endtime } = this.sitem;
+        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')
@@ -267,14 +294,6 @@ export default {
     handleSelection(val, key){
       this.selected[key] = val
     },
-    async repeat_initData() {
-      const { code, message, data } = await asyncRequest.detail({
-        infoNo: this.queryId,
-      });
-      const { status } = data;
-      const res = { code, status, message };
-      return res;
-    },
     getNewTime() {
       this.newTime = new Date().valueOf();
     },
@@ -299,9 +318,14 @@ export default {
         return false
       }
 
+      if(Number(this.selected.evalute[0].is_check) !== 1){
+        this.$message.warning('必须选择被选中的预算函')
+        return
+      }
+
       return {
-         req_id: this.$route.query.id,
-        id: this.selected.evalute[0],
+        req_id: this.$route.query.id,
+        id: this.selected.evalute[0].id,
         form: 'activity'
       }
     },
@@ -318,7 +342,7 @@ export default {
 
       return {
         req_id:this.$route.query.id,
-        id: this.selected.activity[0],
+        id: this.selected.activity[0].id,
         form: 'project'
       }
     },

+ 3 - 1
src/views/customerService/workbench/index.vue

@@ -152,7 +152,9 @@
               </div>
 
               <div class="task-card__content">
-                {{item.participant}},{{item.req_demand}}
+                <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(" + ")}}
               </div>
 
               <div class="task-card__content">

+ 1 - 1
src/views/customerService/workbench/letterEditing.vue

@@ -158,7 +158,7 @@ export default {
     async onSubmit() {
       this.loading = true
       const param = {
-        plan_info: this.tableData.planinfo.map(({name, service_cat, price,unit,  num, tax,  id,total_fee   }) =>  ({total_fee ,name, service_cat, price, unit, num, tax, id })),
+        plan_info: this.tableData.planinfo.map(({ name, service_cat, price,unit,  num, tax,  id,total_fee   }) =>  ({total_fee ,name, service_cat, price, unit, num, tax, id })),
         plan_id:this.$route.query.id,
         store_id:this.tableData.store_id
       }

+ 55 - 39
src/views/platformService/invoice/columns.js

@@ -1,85 +1,101 @@
 
 const statusList = [
-  { id: '0', label: '待业务主管审核', type: '' },
-  { id: '1', label: '业务主管已通过', type: 'success' },
-  { id: '2', label: '业务主管已驳回', type: 'danger' },
-  { id: '3', label: '业务主管越线通过', type: 'warning' },
-  { id: '4', label: '取消议价', type: 'info' }
-  // 已选完商品,取消议价
+  { id: '0', label: '驳回', type: 'danger' },
+  { id: '1', label: '待确认', type: 'info' },
+  { id: '2', label: '确认', type: 'success' },
 ]
 
 const listCol = [
     {
-    type:'selection'
+    type:'selection',
+    fixed:'left'
   },
   {
-    prop: 'todo',
+    prop: 'inv_code',
     label: '开票申请编号',
-    width: '155'
+    width: '110px'
   },
 
   {
-    prop: 'todo',
-    label: '开票申请发票类型',
-    width: '155'
-  },
 
-  {
-    prop: 'todo',
-    label: '需求订单编号',
-    width: '120px'
-  },
-  {
-    prop: 'todo',
-    label: '供应商企业',
-    width: '155'
+    prop:'status',
+    label:'状态',
+    _slot_:'status',
+    width: '75px'
   },
 
   {
-    prop: 'todo',
-    label: '发票记录编号',
-    width: '155px'
+    prop: 'invoiceType',
+    label: '开票申请发票类型',
+    width: '125px',
+    _slot_:'invoiceType'
+    // reuqired:true
   },
+
   {
-    prop: 'todo',
-    label: '发票状态',
-    width: '155px'
+    prop: 'demandOrder',
+    label: '需求订单编号',
+    width: '180px',
+    _slot_:'demandOrder'
   },
+  // {
+  //   prop: 'todo',
+  //   label: '供应商企业',
+  //   width: '155',
+  //   required:true
+  // },
+
+  // {
+  //   prop: 'todo',
+  //   label: '发票记录编号',
+  //   width: '155px',
+  //   required:true
+  // },
+  // {
+  //   prop: 'todo',
+  //   label: '发票状态',
+  //   width: '155px',
+  //   required:true
+  // },
   {
-    prop: 'todo',
+    prop: 'invoiceType',
     label: '发票类型',
-    'min-width': '180'
+    'width': '125px',
+    _slot_:'invoiceType'
   },
   {
-    prop: 'todo',
+    prop: 'invoiceCode',
     label: '发票代码',
     'min-width': '125'
   },
   {
-    prop: 'todo',
+    prop: 'invoiceNum',
     label: '发票号码',
     minWidth: '150px'
   },
 
   {
-    prop: 'todo',
-    label: '开票日期'
+    prop: 'open_date',
+    label: '开票日期',
+    minWidth: '110px'
   },
   {
-    prop: 'todo',
+    prop: 'subtotal_tax',
     label: '税前金额'
   },
   {
-    prop: 'todo',
+    prop: 'total_amount',
     label: '税后金额'
   },
   {
-    prop:'todo',
-    label:'校验码'
+    prop:'check_code',
+    label:'校验码',
+    width:'125px'
   },
   {
     prop:'todo',
-    label:'驳回原因'
+    label:'驳回原因',
+    required:true
   },
   // {
   //   prop: '',

+ 64 - 326
src/views/platformService/invoice/components/invoice-modal.vue

@@ -1,350 +1,88 @@
 <template>
-  <el-dialog
-    center
-    width="1024px"
-    title="导入采销订单补录"
-    :visible="innerVisible"
-    :close-on-click-modal="false"
-    @close="innerVisible = false; tableData = []"
-  >
-    <div v-if="tableData && tableData.length > 0" class="tr" style="padding: 10px 0 0 0">
-      <el-button :size="'mini'" @click="() => tableData = []">取消</el-button>
-      <el-button type="primary" :size="'mini'" :loading="loading" @click="onSubmit">提交</el-button>
-    </div>
-    <div v-else>
-      <upload-excel :on-success="onSuccess" :before-upload="beforeUpload" />
-    </div>
-
-    <ex-table
-      :columns="columns"
-      :table="table"
-      :data="tableData"
-      style="margin: 15px 0 0 0"
-    />
+  <el-dialog width="400px" :visible="visible" @close="handleClose" title="批量审批发票" center>
+    <el-form ref="form" :model="formData" size="mini" :rules="rules" label-width="80px">
+      <el-form-item prop="status" label="审批状态">
+        <el-select v-model="formData.status" style="width: 100%" placeholder="审批状态">
+          <el-option label="通过" value="2" />
+          <el-option label="驳回" value="0" />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="备注" prop="remark">
+        <el-input v-model="formData.remark" type="textarea" placeholder="备注" />
+      </el-form-item>
+
+      <ElFormItem class="flex-end">
+        <ElButton type="primary" @click="onSubmit" :loading="loading">保存</ElButton>
+      </ElFormItem>
+    </el-form>
   </el-dialog>
 </template>
 
 <script>
-import asyncRequest from '@/apis/service/platformService/invoice'
-import { isMobile } from '@/utils/validate'
-import companyHelper from '@/mixins/companyHelper'
-import { replaceTextWrapAndSpace } from '@/utils'
-import { MessageBox } from 'element-ui'
-
-import {
-  columns,
-  PROPERTYS,
-  getTableProperty,
-  createFieldVerification,
-  requsetFields,
-  requiredFields,
-  numberFields,
-  intNumberFields
-} from './template'
 
+const defaultData = {
+  status:'',
+  remark:''
+}
 export default {
-  mixins: [companyHelper],
-  props: ['visible'],
-  data() {
+  name: "approvalModal",
+  props:['visible'],
+  data(){
     return {
-      columns,
-      loading: false,
-      tableData: [],
-      table: {
-        stripe: true,
-        border: true,
-        'max-height': '800px'
-      }
+      formData:{...defaultData}
     }
   },
-  computed: {
-    innerVisible: {
-      get() {
+  computed:{
+    rules(){
+      return ({
+        status:[
+          {
+            required:true,
+            trigger:'change',
+            message:'请选择审核状态'
+          }
+        ],
+        remark:[
+          {
+            required: this.formData.status === "0",
+            trigger:'change',
+            message:'请输入备注'
+          }
+        ]
+      })
+    },
+    _visible:{
+      get(){
         return this.visible
       },
-      set(newVal) {
-        this.$emit('update:visible', newVal)
+      set(newVal){
+        this.$emit('update:visible',newVal)
       }
     }
   },
-  methods: {
-    validateTableHeader(header, importHeader) {
-      let isHeaderOk = true
-      if (header.length !== importHeader.length) return false
-      for (const index in header) {
-        const field = header[index]
-        const importField = importHeader[index]
-        if (field !== importField) {
-          isHeaderOk = false
-          break
-        }
-      }
-
-      return isHeaderOk
-    },
-    /* 校验导入的销售方列表编码(与选择的公司必须一致) **/
-    validateCompanyNo(value, row) {
-      const verification = createFieldVerification()
-      const current = this.currentCompany
-      if (value !== current) {
-        verification.isValid = false
-        verification.message = `第 ${row} 行,销售方公司必须与选择的公司一致`
-        return verification
-      }
-      return verification
-    },
-    /* 校验导入的购买方列表编码(开头必须为KH) **/
-    validateKhNo(value, row) {
-      const verification = createFieldVerification()
-      const perfix = String(value || '').slice(0, 2)
-      if (perfix !== 'KH') {
-        verification.isValid = false
-        verification.message = `第 ${row} 行,"购买方公司编码必须以'KH'开头`
-        return verification
-      }
-      return verification
-    },
-    formatDate2(serialNumber, format = '-', mao = ':') {
-      var timestamp = (serialNumber - 25569 - 8 / 24) * 86400 * 1000 // 转换为时间戳
-      var newDate = new Date(timestamp) // 转换为日期时间对象
-      const year = newDate.getFullYear() // 获取年份,例如 2023
-      const month = newDate.getMonth() + 1 // 获取月份,注意需要加上 1,例如 4
-      const day = newDate.getDate() // 获取日期,例如 9
-      let hours = newDate.getHours() // 获取小时,例如 0
-      let minutes = newDate.getMinutes() // 获取分钟,例如 0
-      let seconds = newDate.getSeconds() // 获取秒数,例如 0
-
-      // 判断小时、分钟和秒是否小于 10,如果是,则在前面补一个零
-      if (hours < 10) {
-        hours = '0' + hours
-      }
-      if (minutes < 10) {
-        minutes = '0' + minutes
-      }
-      if (seconds < 10) {
-        seconds = '0' + seconds
-      }
-      return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
-    },
-    /* 校验导入的联系电话是否合法 **/
-    validateMobile(value, row) {
-      const verification = createFieldVerification()
-      if (!isMobile(value)) {
-        verification.isValid = false
-        verification.message = `第${Number(row)}行,联系方式,手机号格式不正确`
-        return verification
-      }
-      return verification
-    },
-    /* 校验导入的购买方列表编码(开头必须为QS) **/
-    validateSupplierNo(value, row) {
-      const verification = createFieldVerification()
-      const perfix = String(value || '').slice(0, 2)
-      if (perfix !== 'QS') {
-        verification.isValid = false
-        verification.message = `第 ${row} 供应商公司编码必须以'QS'开头`
-        return verification
-      }
-      return verification
-    },
-    validateNumberField(field, value, row) {
-      const verification = createFieldVerification()
-      if (!/^\d*\.?\d+$/.test(value)) {
-        verification.isValid = false
-        verification.message = `第${Number(row)}行,${getTableLabel(field)}必须为数字,且不能小于0`
-        return verification
-      }
-      return verification
-    },
-    validateIntNumberField(field, value, row) {
-      const verification = createFieldVerification()
-      if (!/^\d+$/.test(value)) {
-        verification.isValid = false
-        verification.message = `第${Number(row)}行,${getTableLabel(field)}必须为正整数`
-        return verification
-      }
-      return verification
-    },
-    /* 校验导入的税率、数量、采购单价、销售单价是否为数字 **/
-    validateDateField(value) {
-      // const verification = createFieldVerification()
-      // if (!(/^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}$/.test(value))) {
-      //   verification.isValid = false
-      //   verification.message = `第${Number(index)}行,发货日期不能为空,且必须为日期格式`
-      //   return verification
-      // }
-      return /^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}$/.test(value)
-    },
-    validateRequiredField(field, value, row) {
-      const verification = createFieldVerification()
-      if (replaceTextWrapAndSpace(value) === '') {
-        verification.isValid = false
-        verification.message = `第${row}行,${getTableLabel(field)}不能为空`
-        return verification
-      }
-      return verification
-    },
-    /* 处理不合法的值,提示错误信息,并返回最终的验证状态 **/
-    handleNotValidFields(...validFns) {
-      let isFinalValid = true
-      for (const validFn of validFns) {
-        const { message, isValid } = validFn()
-        if (!isValid) {
-          isFinalValid = false
-          MessageBox({ type: 'warning', title: '数据填写错误', message })
-          break
-        }
-      }
-      return isFinalValid
-    },
-    /* 校验导入的数据 **/
-    validateFields(tableData = []) {
-      let verification = null
-      for (const row in tableData) {
-        if (row === 'remove') {
-          continue
-        }
-
-        const tableItem = tableData[row]
-        const index = Number(row) + 1
-
-        for (const field in tableItem) {
-          if (requiredFields.includes(field)) {
-            verification = this.validateRequiredField(field, tableItem[field], index)
-            if (!verification.isValid) {
-              MessageBox({ type: 'warning', title: '数据填写错误', message: verification.message })
-              return false
-            }
-          }
-
-          if (intNumberFields.includes(field)) {
-            verification = this.validateIntNumberField(field, tableItem[field], index)
-            if (!verification.isValid) {
-              MessageBox({ type: 'warning', title: '数据填写错误', message: verification.message })
-              return false
-            }
-          }
-
-          if (numberFields.includes(field)) {
-            verification = this.validateNumberField(field, tableItem[field], index)
-            if (!verification.isValid) {
-              MessageBox({ type: 'warning', title: '数据填写错误', message: verification.message })
-              return false
-            }
-          }
-
-          if (field === PROPERTYS.MOBILE) {
-            verification = this.validateMobile(tableItem[field], index)
-            if (!verification.isValid) {
-              MessageBox({ type: 'warning', title: '数据填写错误', message: verification.message })
-              return false
-            }
-          }
-
-          if (field === PROPERTYS.CUSTOMER_NO) {
-            verification = this.validateKhNo(tableItem[field], index)
-            if (!verification.isValid) {
-              MessageBox({ type: 'warning', title: '数据填写错误', message: verification.message })
-              return false
-            }
-          }
-
-          if (field === PROPERTYS.COMPANY_NO) {
-            verification = this.validateCompanyNo(tableItem[field], index)
-            if (!verification.isValid) {
-              MessageBox({ type: 'warning', title: '数据填写错误', message: verification.message })
-              return false
-            }
-          }
-
-          if (field === PROPERTYS.SUPPLIER_NO) {
-            verification = this.validateSupplierNo(tableItem[field], index)
-            if (!verification.isValid) {
-              MessageBox({ type: 'warning', title: '数据填写错误', message: verification.message })
-              return false
-            }
-          }
-        }
-      }
-      return true
-    },
-    mapTemplateItemToTableItem(templateItem) {
-      const tableItem = {}
-      const templatePropertys = Object.keys(templateItem)
-      templatePropertys.forEach(templateProperty => {
-        const tableproperty = getTableProperty(templateProperty)
-        tableItem[tableproperty] = templateItem[templateProperty]
-      })
-      return tableItem
+  methods:{
+    handleClose(){
+      this._visible = false
+      this.formData = {...defaultData}
+      this.loading = false
     },
-    onSuccess({ results: templateItems, header: templateHeader }) {
-      if (templateItems.length > 1000) {
-        this.$message.error('导入数据不能超过 1000 条')
-        return
-      }
-
-      const isHeaderValid = this.validateTableHeader(
-        this.columns.map(({ label }) => label).slice(1),
-        templateHeader
-      )
-      if (!isHeaderValid) {
-        this.$message.warning('表格与导入的表头不一致!')
-        return
-      }
-      if (templateItems.length === 0) {
-        this.$message.warning('导入的表格没有数据!')
-        return
-      }
-      templateItems.forEach(templateItem => {
-        const tableItem = this.mapTemplateItemToTableItem(templateItem)
-        Object.keys(tableItem).forEach(field => {
-          let target = ''
-          if (field === PROPERTYS.SEND_TIME) {
-            target = this.validateDateField(tableItem[PROPERTYS.SEND_TIME])
-              ? tableItem[PROPERTYS.SEND_TIME]
-              : this.formatDate2(tableItem[PROPERTYS.SEND_TIME])
-          } else {
-            target = tableItem[field] ? String(tableItem[field]).trim() : ''
-          }
-          tableItem[field] = target
+    async onSubmit(){
+      try{
+        await this.$refs.form.validate()
+        this.loading = true
+        this.$emit("confirm",{
+          ...this.formData,
+          inv_type: '2',
         })
-        this.tableData.push(tableItem)
-      })
-
-      this.validateFields(this.tableData)
-    },
-    async onSubmit() {
-      if (!this.validateFields(this.tableData)) return
-
-      const list = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => ({
-        ...prev,
-        workCode: '',
-        [currentKey]: tableItem[currentKey]
-      }), {}))
-
-      this.loading = true
-      const result = await asyncRequest.importOrder({
-        list
-      })
-      this.loading = false
-
-      switch (String(result.code)) {
-        case '0':
-          this.$message.success('导入成功')
-          this.innerVisible = false
-          this.$emit('refresh')
-          break
-        default:
-          this.$message.warning(result.message)
-          break
+      }catch (e) {
+        console.log(e)
       }
     }
   }
 }
 </script>
 
-<style lang="scss">
-.error-message__wrapper{
-  width: 1024px;
-}
+<style scoped>
+
 </style>

+ 98 - 67
src/views/platformService/invoice/index.vue

@@ -27,8 +27,8 @@
             <el-row style="padding: 0 0 0 80px">
               <el-col :span="4" style="width: 360px; padding: 0 10px 0 0px">
                 <period-date-picker
-                  :start="parmValue.createStart"
-                  :end="parmValue.createEnd"
+                  :start="parmValue.create_start"
+                  :end="parmValue.create_end"
                   :width="'164px'"
                   :size="searchSize"
                   @timeReturned="handleTime"
@@ -36,16 +36,16 @@
                 />
               </el-col>
 
-              <el-col :span="3" style="margin-right:10px">
+              <!-- <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> -->
 
               <el-col :span="3" style="margin-right:10px">
-                <el-input v-model="parmValue.demandOrderNo" size="mini" placeholder="需求订单编号" style="width:100%"
+                <el-input v-model="parmValue.reqCode" size="mini" placeholder="需求订单编号" style="width:100%"
                        @change="pageInfo.curr = 1;
                                 parmValue.page = 1;
                                 searchList();"
@@ -99,8 +99,8 @@
             <el-row style="margin-top:10px">
               <el-col :span="4" style="width: 360px; padding: 0 10px 0 0px">
                 <period-date-picker
-                  :start="parmValue.openStart"
-                  :end="parmValue.openEnd"
+                  :start="parmValue.open_start"
+                  :end="parmValue.open_end"
                   :width="'164px'"
                   :size="searchSize"
                   @timeReturned="() => handleTime(true)"
@@ -116,21 +116,21 @@
               </el-col>
 
               <el-col :span="4">
-                <el-input size="mini" placeholder="发票号码" v-model="parmValue.invoiceNumber"
+                <el-input size="mini" placeholder="发票号码" v-model="parmValue.invoiceNum"
                   @change=" pageInfo.curr = 1;
                            parmValue.page = 1;
                           searchList();"
                  />
               </el-col>
 
-              <el-col :span="3" style="width:140px;float: right">
+              <el-col :span="3" style="width:115px;float: right">
                 <el-button
                   :size="searchSize"
                   type="primary"
                   style="float: right; margin-left: 5px"
                   @click="searchList"
                 >
-                  批量上传开票信息
+                  下载发票数据
                 </el-button>
               </el-col>
               <el-col :span="4" class="fr" style="width: 66px">
@@ -138,24 +138,31 @@
                   type="warning"
                   class="fr"
                   :size="searchSize"
-                  @click="onExportOpenResult"
+                  @click="onBatchApprovalInvoice"
                 >
-                  批量导出开票结果
+                  批量审核发票
                 </el-button>
               </el-col>
             </el-row>
 
             <el-row style="margin-top:10px">
               <el-col :span="4" style="margin-right:10px">
-                <el-select v-model="parmValue.invoiceType" size="mini" placeholder="发票类型" style="width:100%"
+                <el-select v-model="parmValue.invoice_type" size="mini" placeholder="发票类型" style="width:100%"
                   @change=" pageInfo.curr = 1;
                            parmValue.page = 1;
                           searchList();"
-                  />
+                  >
+                    <el-option
+                      v-for="type in invoiceTypeList"
+                      :key="type.value"
+                      :value="type.value"
+                      :label="type.label"
+                     />
+                  </el-select>
               </el-col>
 
               <el-col :span="4">
-                <el-input size="mini" placeholder="发票申请编号" v-model="parmValue.invoiceApplyNo"
+                <el-input size="mini" placeholder="发票申请编号" v-model="parmValue.invNo"
                   @change=" pageInfo.curr = 1;
                            parmValue.page = 1;
                           searchList();"
@@ -164,6 +171,17 @@
             </el-row>
           </div>
         </template>
+
+        <template #invoiceType="{ scope }">
+          <el-tag size="mini">
+            {{(invoiceTypeList.find(({value}) => value === scope.row.invoiceType) || {}).label || '--'}}
+          </el-tag>
+        </template>
+
+        <template #demandOrder={scope}>{{
+            scope.row.platformsettle.reqCode
+          }}</template>
+
         <template #status="{ scope }">
           <el-tag
             :size="tablebtnSize"
@@ -177,22 +195,7 @@
             "
           ></el-tag>
         </template>
-        <template #good_name="{ scope }">
-          <span>{{ scope.row.good_name }}</span>
-          <span
-            v-for="(si, sii) in scope.row.specinfo"
-            :key="si.spec_value_id + sii"
-          >
-            {{ 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">
-            <span v-if="sii !== 0">_</span>{{ si.name }}</span
-          >
-        </template>
+
         <template #operation="{ scope }">
           <el-tooltip
             v-if="powers.some((i) => i == '007')"
@@ -208,6 +211,8 @@
           </el-tooltip>
         </template>
       </ex-table>
+
+      <invoice-modal :visible.sync="visible" @confirm="handleBatchApprovalInvoice" />
     </div>
   </div>
 </template>
@@ -218,26 +223,30 @@ import asyncRequest from "@/apis/service/platformService/invoice";
 import companyHelper from "@/mixins/companyHelper"
 import { listCol, statusList } from "./columns";
 import { mapGetters } from "vuex";
+import { invoiceTypeList } from '@/assets/js/statusList';
+import InvoiceModal from "./components/invoice-modal.vue"
+
 
 /**
  * @props
-    createStart 创建开始时间
-    createEnd 创建结束时间
-    openStart 开票开始时间
-    openEnd 开票结束时间
+    create_start 创建开始时间
+    create_end 创建结束时间
+    open_start 开票开始时间
+    open_end 开票结束时间
     supplier 供应商企业
-    demandOrderNo 需求订单编号
+    reqCode 需求订单编号
     invoiceStatus 发票状态
     invoiceCode 发票代码,
-    invoiceNumber 发票号码,
-    invoiceType 发票类型
-    invoiceApplyNo 发票申请编号
+    invoiceNum 发票号码,
+    invoice_type 发票类型
+    invNo 发票申请编号
 */
 
 
 export default {
   name: "bargainList",
   mixins: [mixinPage, resToken, companyHelper],
+  components:{InvoiceModal},
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -254,25 +263,26 @@ export default {
       selected:[],
       select: "1",
       s_input: "",
+      invoiceTypeList,
       customerCode: [], //客户公司code
       statusList,
       sitem: null,
       loading: false,
-      showModel: false,
+      visible: false,
       isDetail: false,
       modelId: 0,
       parmValue: {
-        createStart:"", // 创建开始时间
-        createEnd:"", // 创建结束时间
-        openStart:"", // 开票开始时间
-        openEnd:"", // 开票结束时间
+        create_start:"", // 创建开始时间
+        create_end:"", // 创建结束时间
+        open_start:"", // 开票开始时间
+        open_end:"", // 开票结束时间
         supplier:"", // 供应商企业
-        demandOrderNo:"", // 需求订单编号
+        reqCode:"", // 需求订单编号
         invoiceStatus:"", // 发票状态
         invoiceCode:"", // 发票代码,
-        invoiceNumber:"", // 发票号码,
-        invoiceType:"", // 发票类型
-        invoiceApplyNo:"", // 发票申请编号
+        invoiceNum:"", // 发票号码,
+        invoice_type:"", // 发票类型
+        invNo:"", // 发票申请编号
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
@@ -319,10 +329,35 @@ export default {
     this.searchList();
   },
   methods: {
-    async onExportOpenResult(){
-      //TODO...
+    async handleBatchApprovalInvoice(data){
+      const { code } = await asyncRequest.batch({
+        idArr:this.selected.map(({id}) => id),
+        ...data
+      })
+
+      if(code !== 1) return
+      this.visible = false
+      this.searchList()
+    },
+    onBatchApprovalInvoice(){
+      if(this.selected.length === 0){
+        this.$message.warning('至少选择一张状态为 "待确认" 的发票申请')
+        return
+      }
+
+      const isOK = this.selected.every(({status}) => String(status) === "1")
+
+      if(!isOK){
+         this.$message.warning('请选择状态为 "待确认" 的发票申请')
+        return
+      }
+
+
+      this.visible = true
+      // console.log(this.selected)
     },
-    handleSelectionChange({list}) {
+    handleSelectionChange(list) {
+      console.log(list)
       this.selected = list
     },
     getRouter(toRouter, queryId){
@@ -353,17 +388,17 @@ export default {
       this.select = "1";
       this.s_input = "";
       this.parmValue = {
-        createStart:"", // 创建开始时间
-        createEnd:"", // 创建结束时间
-        openStart:"", // 开票开始时间
-        openEnd:"", // 开票结束时间
+        create_start:"", // 创建开始时间
+        create_end:"", // 创建结束时间
+        open_start:"", // 开票开始时间
+        open_end:"", // 开票结束时间
         supplier:"", // 供应商企业
-        demandOrderNo:"", // 需求订单编号
+        reqCode:"", // 需求订单编号
         invoiceStatus:"", // 发票状态
         invoiceCode:"", // 发票代码,
-        invoiceNumber:"", // 发票号码,
-        invoiceType:"", // 发票类型
-        invoiceApplyNo:"", // 发票申请编号
+        invoiceNum:"", // 发票号码,
+        invoice_type:"", // 发票类型
+        invNo:"", // 发票申请编号
         page: 1, // 页码
         size: 15, // 每页显示条数
       }
@@ -407,19 +442,15 @@ export default {
     },
     // 列表搜索
     async searchList() {
-      return
-      
       this.loading = true;
       const res = await asyncRequest.list({
         ...this.parmValue,
-        noRelation: true
+        inv_type: "2"
       });
 
-      if (res && res.code === 0 && res.data) {
+      if (res && res.code === 1 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
       } else {
         this.tableData = [];
         this.pageInfo.total = 0;
@@ -456,8 +487,8 @@ export default {
     },
     // 时间选择事件
     async handleTime(e,isOpen = false) {
-      const startProp = isOpen ? "openStart" :"createStart"
-      const endProp = isOpen ? "openEnd" : "createEnd"
+      const startProp = isOpen ? "open_start" :"create_start"
+      const endProp = isOpen ? "open_end" : "create_end"
 
       if (e.startTime !== "") {
         this.parmValue[startProp] = e.startTime;

+ 50 - 48
src/views/platformService/settlement/columns.js

@@ -1,41 +1,43 @@
 const statusList = [
-  { id: '0', label: '待业务主管审核', type: '' },
-  { id: '1', label: '业务主管已通过', type: 'success' },
-  { id: '2', label: '业务主管已驳回', type: 'danger' },
-  { id: '3', label: '业务主管越线通过', type: 'warning' },
-  { id: '4', label: '取消议价', type: 'info' }
+  { id: '1', label: '待供应商上传付款凭证', type: '' },
+  { id: '2', label: '待平台审核', type: '' },
+  { id: '3', label: '平台驳回', type: '' },
+  { id: '4', label: '待供应商上传发票抬头', type: '' },
+  { id: '5', label: '待平台上传发票', type: '' },
+  { id: '6', label: '待供应商确认发票', type: '' },
+  { id: '7', label: '平台结算完成', type: 'success' },
   // 已选完商品,取消议价
 ]
 const editColumns = [
   {
-    prop: 'todo',
+    prop: 'settle_code',
     label: '平台订单编号',
     span: 8
   },
 
   {
-    prop: 'todo',
+    prop: 'reqCode',
     label: '业务订单编号',
     span: 8
   },
   {
-    prop: 'todo',
+    prop: 'createtime',
     label: '创建时间',
     span: 8
   },
   {
-    prop: 'todo',
+    prop: 'service_amount',
     label: '总金额',
     span: 8
   },
 
   {
-    prop: 'todo',
+    prop: 'wpay_amount',
     label: '未回款金额',
     span: 8
   },
   {
-    prop: 'todo',
+    prop: 'apay_amount',
     label: '已回款金额',
     span: 8
   },
@@ -46,12 +48,12 @@ const editColumns = [
     span: 8
   },
   {
-    prop: 'todo',
+    prop: 'ainv_fee',
     label: '已开票金额',
     span: 8
   },
   {
-    prop: 'todo',
+    prop: 'winv_fee',
     label: '未开票金额',
     span: 8
   }
@@ -66,72 +68,72 @@ const demandOrderColumns = [
 ]
 const listCol = [
   {
-    prop: 'todo',
+    prop: 'settle_code',
     label: '平台结算编号',
-    width: '155'
+    minWidth: '155'
   },
 
   {
-    prop: 'todo',
+    prop: 'reqCode',
     label: '需求订单编号',
-    width: '155'
+    minWidth: '155'
   },
 
   {
-    prop: 'todo',
+    prop: 'supplierName',
     label: '供应商',
-    width: '120px'
-  },
-  {
-    prop: 'todo',
-    label: '平台结算编码',
-    width: '155'
+    minWidth: '120px'
   },
+  // {
+  //   prop: 'todo',
+  //   label: '平台结算编码',
+  //   width: '155'
+  // },
 
   {
-    prop: 'todo',
+    prop: 'service_amount',
     label: '平台结算金额',
-    width: '100px'
+    minWidth: '100px'
   },
   {
     prop: 'todo',
-    label: '回款状态',
-    width: '125px',
+    label: '状态',
+    minWidth: '130px',
     _slot_:'status',
   },
   {
-    prop: 'todo',
+    prop: 'apay_amount',
     label: '已回款金额',
     'min-width': '100px'
   },
+  // {
+  //   prop: 'todo',
+  //   label: '回款中金额',
+  //   'min-width': '100px'
+  // },
   {
-    prop: 'todo',
-    label: '回款中金额',
-    'min-width': '100px'
-  },
-  {
-    prop: 'todo',
+    prop: 'wpay_amount',
     label: '未回款金额',
     minWidth: '100px'
   },
+  // {
+  //   prop: 'creater',
+  //   label: '开票状态',
+  //   _slot_:'status',
+  //   minWidth: '120px'
+  // },
   {
-    prop: 'creater',
-    label: '开票状态',
-    _slot_:'status',
-    minWidth: '120px'
-  },
-  {
-    prop: 'todo',
+    prop: 'ainv_fee',
     label: '已开票金额',
     minWidth: '100px'
   },
+  // {
+  //   prop: 'todo',
+  //   label: '开票中金额',
+  //   minWidth: '100px'
+  // },
   {
-    prop: 'todo',
-    label: '开票中金额',
-    minWidth: '100px'
-  },
-  {
-    prop: 'todo',
+    prop: 'winv_fee',
     label: '未开票金额',
     minWidth: '100px'
   },

+ 89 - 47
src/views/platformService/settlement/components/waitSupplierUpload.vue

@@ -1,93 +1,138 @@
 <template>
-  <el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-position="left" label-width="80px" size="mini">
-    <ul style="display:flex">
-      <li style="width:500px;margin-right:10px">
-        <el-form-item label="发票抬头" prop="invoiceTitle">
-          <el-input v-model="ruleForm.invoiceTitle" style="width:400px" />
-        </el-form-item>
+  <el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-position="left" label-width="95px" size="mini" v-loading="loading">
+      <el-row gutter="20">
+        <el-col :span="12">
+          <el-form-item label="发票类型" prop="invoice_type">
+            <el-select v-model="ruleForm.invoice_type" style="width:100%" placeholder="发票类型">
+              <el-option 
+                v-for="invoice in invoiceTypeList" 
+                :key="invoice.value" 
+                :value="invoice.value" 
+                :label="invoice.label"  
+              />
+            </el-select>
+          </el-form-item>
 
-        <show-data-table 
-          :sitem="{}"
-          style="padding: -5px 0 10px 0"
-          :newTime="newTime"
-          :columns="invoiceColumns"
-        />
-      </li>
 
-      <li style="500px">
-        <el-form-item label="发票类型" prop="invoiceType">
-          <el-select v-model="ruleForm.invoiceType" style="width:400px" placeholder="发票类型">
-            <el-option />
-          </el-select>
-        </el-form-item>
+          <el-form-item label="备注" prop="remark">
+            <el-input placeholder="备注" v-model="ruleForm.remark" style="width:100%" type="textarea" />
+          </el-form-item>
+        </el-col>
 
-        <el-form-item label="备注" prop="remark">
-          <el-input placeholder="备注" v-model="ruleForm.remark" style="width:400px" type="textarea" />
-        </el-form-item>
-      </li>
-    </ul>
+        <el-col :span="12">
+          <el-form-item label="发票抬头" prop="invoice_id">
+            <search-invoice-title 
+              :value.sync="ruleForm.invoice_id" 
+              @change="_invoiceInfo => invoiceInfo = _invoiceInfo" 
+              style="width:100%"
+              placeholder="请选择发票抬头" 
+            >
+    
+            </search-invoice-title>
+          </el-form-item>
+
+          <show-data-table 
+            v-if="invoiceInfo"
+            :sitem="invoiceInfo"
+            style="padding: -5px 0 10px 0"
+            :newTime="newTime"
+            :columns="invoiceColumns"
+          />
+        </el-col>
+      </el-row>
 
-    <div style="width:980px;display:flex;justify-content:flex-end;margin-bottom:10px">
+    <div style="display:flex;justify-content:flex-end;margin-bottom:10px">
       <el-button size="mini" type="primary" @click="onSubmit">保存</el-button>
     </div>
-    
   </el-form>
 </template>
 
 <script>
-/**
- * @props
- * 发票抬头 invoiceTitle
- * 发票类型 invoiceType
- * 备注 remark
-*/
+import demandRequest from "@/apis/service/customerService/demandOrder";
+import { demandStatusOptions, invoiceTypeList } from '@/assets/js/statusList'
+import asyncRequest from "@/apis/service/customerService/invoiceApply";
+
+  /** 
+  * @props
+  * req_id 需求订单
+    invoice_id /发票抬头
+    invoice_type 发票类型
+    total_amount 申请总金额
+    remark // 备注
+  */
+
 export default {
-  name:'WaitSupplierUpload',
+  name:'CreateInvoiceNode',
+  props:['isApply'],  //isApply 是否为创建开票申请
   data(){
       return {
+        loading: false,
+        demandStatusOptions,
+        invoiceTypeList,
+        demandInfo : null,
+        invoiceInfo: null,
+        demandVisible:false,
           invoiceColumns:[
             {
-              prop: 'todo',
+              prop: 'title',
               label: '抬头',
               span:24
             },
             {
-              prop: 'todo',
+              prop: 'tax_no',
               label: '纳税人识别号',
               span:24
             },
             {
-              prop: 'todo',
+              prop: 'tel',
               label: '地址、电话',
-              span:24
+              span:24,
+              // _slot_: 'tel'
             },
             {
-              prop: 'todo',
+              prop: 'bank_account',
               label: '开户行及账号',
               span:24
             }
           ],
           newTime:"",
+          demandVisible: false,
           ruleForm:{
-            invoiceType:'',
-            invoiceTitle:"",
-            remark:""
+            req_id:"",
+            invoice_id:"", //发票抬头
+            invoice_type:"", //发票类型
+            total_amount:"", //申请总金额
+            remark:"", // 备注
           },
           rules:{
-            invoiceTitle:[
+            invoice_id:[
               {
                 required:true,
                 trigger:'change',
                 message:'请输入发票抬头'
               }
             ],
-            invoiceType:[
+            req_id:[
+               {
+                required:true,
+                trigger:'change',
+                message:'请选择需求订单'
+              }
+            ],
+            invoice_type:[
               {
                 required:true,
                 trigger:'change',
                 message:'请选择发票类型'
               }
             ],
+            total_amount:[
+              {
+                required:true,
+                trigger:'change',
+                message:'请输入申请总金额'
+              }
+            ],
             remark:[
               {
                 required:true,
@@ -103,13 +148,10 @@ export default {
       try {
         await this.$refs.ruleForm.validate()
         this.$emit('confirm',this.ruleForm)
-      }catch(err){
+        }catch(err){
         console.log(err)
       }
     },
-    number_change(e) {
-      this.ruleForm[mapFields.applyAmount] = e || 0
-    },
   }
 }
 </script>

+ 78 - 67
src/views/platformService/settlement/detail.vue

@@ -1,60 +1,54 @@
 <template>
   <div class="bargainListDetail">
-    <div class="bargainListDetail-main" v-if="powers.some((i) => i == '007')">
+    <div class="bargainListDetail-main">
       <el-tabs v-model="projectTabs" v-loading="loading">
         <el-tab-pane label="平台订单详情" name="1">
           <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
             <el-collapse-item :title="'平台订单详情'" name="1">
               <show-data-table
                 style="padding: -5px 0 10px 0"
+                :columns="editColumns"
                 :newTime="newTime"
-                v-if="newTime !== ''"
                 :sitem="sitem"
-                :columns="editColumns"
               >
-                <template slot="status">
+                <template #status>
                   <el-tag
                     :size="tablebtnSize"
                     :type="
-                      (statusList.find((item) => item.id == sitem.status) || {}).type ||
-                      ''
+                      (statusList.find((item) => item.id == sitem.status) || {})
+                        .type || ''
                     "
                     v-text="
-                      (statusList.find((item) => item.id == sitem.status) || {}).label ||
-                      '--'
+                      (statusList.find((item) => item.id == sitem.status) || {})
+                        .label || '--'
                     "
                   ></el-tag>
                 </template>
               </show-data-table>
             </el-collapse-item>
             <el-collapse-item title="需求订单详情" name="2">
-              <show-data-table
-                style="padding: -5px 0 10px 0"
-                :newTime="newTime"
-                v-if="newTime !== ''"
-                :sitem="sitem"
-                :columns="demandOrderColumns"
-              />
+              <demand-detail id="2" />
+            </el-collapse-item>
+
+            <el-collapse-item title="待供应商上传凭证" name="3" v-if="Number(sitem.status) === 1" v-loading="Statusloading">
+              <credentials-node @confirm="hanleSupplierUpload" />
             </el-collapse-item>
 
-            <el-collapse-item title="待供应商上传凭证" name="3">
-              <normal-node />
+            <el-collapse-item title="待平台审核付款凭证" name="3" v-if="Number(sitem.status) === 2" v-loading="Statusloading">
+              <normal-node  @confirm="handlePlatformPay" />
             </el-collapse-item>
 
-            <el-collapse-item title="待供应商上传发票要求" name="4">
-              <wait-supplier-upload />
+            <el-collapse-item title="待供应商上传发票要求" name="4" v-if="Number(sitem.status) === 4" v-loading="Statusloading">
+              <wait-supplier-upload @confirm="handleUploadInvoiceReq" />
             </el-collapse-item>
 
-            <el-collapse-item title="发票管理" name="5">
-              <upload-invoice-node />
+            <el-collapse-item title="发票管理" name="5" v-if="Number(sitem.status) === 5">
+              <upload-invoice-node :requestMethod="handleUploadInvoce" />
             </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
       </el-tabs>
     </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
   </div>
 </template>
 <script>
@@ -105,7 +99,8 @@ export default {
       queryType: "",
       queryId: "",
       status: "",
-      sitem: null,
+      sitem: {},
+      Statusloading: false,
 
       orderItem: {},
       moneyDirItem: {},
@@ -126,7 +121,61 @@ export default {
       await this.initData();
       this.loading = false;
     },
+    async handleUploadInvoce(invoiceList){
+      const params = {
+        invoiceList,
+        id:this.queryId
+      }
+
+      const result = await asyncRequest.upload(params)
+
+      if(result.code === 1){
+        this.initForm()
+      }
+
+      return result
+    },
+    async hanleSupplierUpload({credentials}){
+      const pay_proof = credentials.join(',')
+
+      this.Statusloading = true
+      const { code } = await asyncRequest.status({
+        status:2,
+        pay_proof,
+        id:this.queryId
+      })
+
+      this.Statusloading= false
+
+      if(code !== 1) return
+      this.initForm()
+    },
+    async handleUploadInvoiceReq({ invoice_type, invoice_id, remark:invoice_remark }){
+      this.Statusloading = true
+      const { code } = await asyncRequest.status({
+        status:5,
+        id:this.queryId,
+        invoice_id,
+        invoice_type,
+        invoice_remark
+      })
+      this.Statusloading = false
+      if(code !== 1) return
+      this.initForm()
+    },
+    async handlePlatformPay({status,remark}){
+      this.Statusloading = true
+      const { code } = await asyncRequest.status({
+        id: this.queryId,
+        status: String(status) === "1" ? "4" : "3",
+        remark
+      })
 
+      this.Statusloading= false
+
+      if(code !== 1) return
+      this.initForm()
+    },
     handleClick(row) {
       console.log(row);
     },
@@ -136,50 +185,12 @@ export default {
     async initData() {
       this.loading = true;
       const { code, message, data } = await asyncRequest.detail({
-        bargainNo: this.queryId,
+        id: this.queryId,
       });
-
-      this.eaxmList = [];
       this.loading = false;
-      if (code === 0) {
-        this.sitem = JSON.parse(JSON.stringify(data));
-
-        const { status, exam_info } = this.sitem;
-        this.orderItem = {};
-        this.moneyDirItem = {};
-        this.moneyItem = {};
-        this.BossItem = {};
-        if (exam_info && exam_info.length > 0) {
-          exam_info.forEach((e) => {
-            console.log(e.status);
-            switch (e.info_status + "") {
-              case "0":
-                this.orderItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "2":
-                this.moneyDirItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "4":
-                this.moneyItem = JSON.parse(JSON.stringify(e));
-                break;
-              case "7":
-                this.BossItem = JSON.parse(JSON.stringify(e));
-                break;
-              default:
-                this.orderItem = JSON.parse(JSON.stringify(e));
-            }
-          });
-          this.eaxmList = JSON.parse(JSON.stringify(exam_info));
-        }
-
-        this.status = status;
-
-        this.getNewTime();
-      } else if (code >= 100 && code <= 104) {
-        await this.logout();
-      } else {
-        this.$message.warning(message);
-      }
+      if(code !== 1) return
+      this.sitem = data;
+      this.getNewTime()
     },
     getNewTime() {
       this.newTime = new Date().valueOf();

+ 4 - 9
src/views/platformService/settlement/index.vue

@@ -153,16 +153,12 @@
         </template>
         <template #operation="{ scope }">
           <el-tooltip
-            v-if="powers.some((i) => i == '007')"
             effect="dark"
             content="详情"
             placement="top"
           >
-            <i
-              class="el-icon-view tb-icon"
-              
-               @click="getRouter('settlementDetail', scope.row.bargainNo )"
-            ></i>
+            <i class="el-icon-view tb-icon" @click="getRouter('settlementDetail', scope.row.id )"
+            />
           </el-tooltip>
         </template>
       </ex-table>
@@ -266,6 +262,7 @@ export default {
 
   methods: {
     getRouter(toRouter, queryId){
+      console.log(toRouter,queryId)
       if (toRouter && queryId) {
         let model = {
           id: queryId,
@@ -355,11 +352,9 @@ export default {
         ...this.parmValue,
       });
 
-      if (res && res.code === 0 && res.data) {
+      if (res && res.code === 1 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
       } else {
         this.tableData = [];
         this.pageInfo.total = 0;