소스 검색

财务管理模块调整

sangwenwei 1 년 전
부모
커밋
25ddffad68

+ 24 - 23
src/views/cw/invoice/InvoiceList.vue

@@ -500,30 +500,31 @@
           'orders': this.tablePage.orders,
           ...this.searchForm
         }).then((data) => {
+        	console.log('data',data.records)
         	this.dataList=data.records
-          this.dataList.forEach(item => {
-            item.account = parseFloat(item.account).toFixed(2)
-            if (!this.commonJS.isEmpty(item.financeInvoiceBaseDTOList)) {
-              let pName = ''
-              if (this.commonJS.isNotEmpty(item.financeInvoiceBaseDTOList)) {
-                if (item.financeInvoiceBaseDTOList.length === 1) {
-                  if (this.commonJS.isEmpty(item.financeInvoiceBaseDTOList[0].programId)) {
-                    pName = '其他: '
-                  }
-                }
-              }
-              item.financeInvoiceBaseDTOList.forEach((program, index) => {
-                if ((index + 1) !== item.financeInvoiceBaseDTOList.length) {
-                  pName = pName + program.programName + ','
-                } else {
-                  pName = pName + program.programName
-                }
-              })
-              item.programName = pName
-            } else {
-              item.programName = ''
-            }
-          })
+          // this.dataList.forEach(item => {
+          //   item.account = parseFloat(item.account).toFixed(2)
+          //   if (!this.commonJS.isEmpty(item.financeInvoiceBaseDTOList)) {
+          //     let pName = ''
+          //     if (this.commonJS.isNotEmpty(item.financeInvoiceBaseDTOList)) {
+          //       if (item.financeInvoiceBaseDTOList.length === 1) {
+          //         if (this.commonJS.isEmpty(item.financeInvoiceBaseDTOList[0].programId)) {
+          //           pName = '其他: '
+          //         }
+          //       }
+          //     }
+          //     item.financeInvoiceBaseDTOList.forEach((program, index) => {
+          //       if ((index + 1) !== item.financeInvoiceBaseDTOList.length) {
+          //         pName = pName + program.programName + ','
+          //       } else {
+          //         pName = pName + program.programName
+          //       }
+          //     })
+          //     item.programName = pName
+          //   } else {
+          //     item.programName = ''
+          //   }
+          // })
           this.tablePage.total = data.total
           this.loading = false
         })

+ 5 - 3
src/views/cw/reimbursementApproval/info/CwProgramPageForm.vue

@@ -30,7 +30,7 @@
                 <el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
               </el-form-item>
             </el-form>
-            <div v-if="num" style="margin-bottom: 10px"><span style="color: #F56C6C">注:最多选择 10 条数据</span></div>
+<!--            <div v-if="num" style="margin-bottom: 10px"><span style="color: #F56C6C">注:最多选择 10 条数据</span></div>-->
             <vxe-table
               border="inner"
               auto-resize
@@ -183,6 +183,7 @@
       // 表单提交
       getProgram () {
         let rows
+		  console.log('this.dataListAllSelections',this.dataListAllSelections)
         if (this.checkType === '1') {
           if (this.commonJS.isEmpty(this.dataListAllSelections)) {
             this.$message.error('请至少选择一条数据')
@@ -194,12 +195,13 @@
               return
             }
           } else {
-            if (this.dataListAllSelections.length > 10) {
-              this.$message.error('最多选择10条数据')
+            if (this.dataListAllSelections.length > 50) {
+              this.$message.error('最多选择50条数据')
               return
             }
           }
           rows = this.dataListAllSelections
+
         } else {
           if (this.commonJS.isEmpty(this.detail)) {
             this.$message.error('请填写开票详情')

+ 314 - 0
src/views/cw/reimbursementApproval/info/CwProgramPageForm2.vue

@@ -0,0 +1,314 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+	  draggable
+      width="1200px"
+      height="500px"
+      @close="close"
+      append-to-body
+      v-model="visible">
+      <el-container>
+        <el-main style="padding-top: 0;padding-bottom: 0">
+          <div v-if="isShow">
+            <el-radio v-model="checkType" label="1"  style="margin-right: 20px">项目</el-radio>
+            <el-radio v-model="checkType" label="2"  style="margin-right: 20px">其他</el-radio>
+          </div>
+          <div  v-if="checkType === '1'">
+            <el-form style="margin-bottom: 0"  :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+              <!-- 搜索框-->
+              <el-form-item label="项目名称" prop="name">
+                <el-input  v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
+              </el-form-item>
+              <el-form-item label="项目编号" prop="no">
+                <el-input v-model="searchForm.projectNumber" placeholder="请输入项目编号" clearable></el-input>
+              </el-form-item>
+
+              <el-form-item>
+                <el-button type="primary" @click="list()" icon="el-icon-search">查询</el-button>
+                <el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
+              </el-form-item>
+            </el-form>
+<!--            <div v-if="num" style="margin-bottom: 10px"><span style="color: #F56C6C">注:最多选择 10 条数据</span></div>-->
+            <vxe-table
+              border="inner"
+              auto-resize
+              resizable
+              height="400px"
+              :loading="loading"
+              ref="programTable"
+              show-header-overflow
+              show-overflow
+              highlight-hover-row
+              :menu-config="{}"
+              :print-config="{}"
+              @checkbox-all="selectAllEvent"
+              @checkbox-change="selectionChangeHandle"
+              :row-id="rowId"
+              :checkbox-config="{reserve: true}"
+              :sort-config="{remote:true}"
+              :data="dataList">
+              <vxe-column type="seq" width="60" title="序号"></vxe-column>
+				<vxe-column type="radio" width="60px"></vxe-column>
+              <vxe-column min-width="230" align="center" title="项目名称" field="projectName"></vxe-column>
+              <vxe-column min-width="160" align="center" title="项目编号" field="projectNumber"></vxe-column>
+              <vxe-column min-width="160" align="center" title="合同名称" field="contractName"></vxe-column>
+              <vxe-column min-width="160" align="center" title="创建人" field="createBy.name"></vxe-column>
+              <vxe-column min-width="160" align="center" title="创建时间" field="createDate"></vxe-column>
+              <!--          <vxe-column  title="项目名称" field="name"></vxe-column>-->
+              <!--          <vxe-column width="200px" title="项目编号" field="no"></vxe-column>-->
+              <!--          <vxe-column width="150px" title="登记人" field="createBy"></vxe-column>-->
+              <!--          <vxe-column width="100px" title="委托方" field="clientName"></vxe-column>-->
+
+            </vxe-table>
+            <vxe-pager
+              background
+              :current-page="tablePage.currentPage"
+              :page-size="tablePage.pageSize"
+              :total="tablePage.total"
+              :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+              @page-change="currentChangeHandle">
+            </vxe-pager>
+          </div>
+          <div style="height: 500px;" v-if="checkType === '2'">
+            <el-form  label-width="80px" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+              <el-row  :gutter="15">
+                <el-col :span="21">
+                  <el-form-item label="详情" prop="detail">
+                    <el-input style="width: 100%" type="textarea" maxlength="500" v-model="detail" placeholder="请输入详情" show-word-limit></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form>
+          </div>
+        </el-main>
+        <el-aside width="300px" v-if="checkType === '1' && commonJS.isNotEmpty(dataListAllSelections.length) && dataListAllSelections.length > 0">
+          <el-tag
+            style="margin: 10px 0 0 0"
+            :key="tag.id"
+            v-for="(tag, index) in dataListAllSelections"
+            closable
+            :disable-transitions="false"
+            @close="del(tag, index)">
+            {{tag.projectName.length>20?tag.projectName.substring(0,20)+'...':tag.projectName}}
+          </el-tag>
+        </el-aside>
+      </el-container>
+		<template #footer>
+			<span class="dialog-footer">
+			  <el-button  @click="close()">关闭</el-button>
+			  <el-button  type="primary" v-if="method != 'view'" @click="getProgram()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+			</span>
+		</template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+	import { ref } from "vue";
+  import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  // import ProgramProjectListInfoService from '@/api/program/ProgramProjectListInfoService'
+  // import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
+  export default {
+    data () {
+      return {
+        title: '项目选择',
+        method: '',
+        visible: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          projectName: '',
+          projectNumber: '',
+          createBy: ''
+        },
+        checkType: '',
+        detail: '',
+        isShow: true,
+        dataListAllSelections: [],
+        rowId: 'id',
+        num: true // num为true是多选,false是单选
+      }
+    },
+    // programProjectListInfoService: null,
+    // reimbursementApprovalService: null,
+    created () {
+      // this.programProjectListInfoService = new ProgramProjectListInfoService()
+      // this.reimbursementApprovalService = new ReimbursementApprovalService()
+    },
+    components: {
+    },
+    methods: {
+      init (isShow, num) {
+        if (this.commonJS.isEmpty(isShow)) {
+          this.isShow = true
+          this.checkType = '1'
+        } else {
+          if (isShow === false || isShow === 'false') {
+            this.isShow = false
+            this.checkType = '1'
+            this.$message({message: '第一条为项目后面新增只能选择项目', type: 'warning', customClass: 'messageZindex'})
+          } else if (isShow === '1') {
+            this.isShow = false
+            this.checkType = '1'
+          } else {
+            this.isShow = false
+            this.checkType = '2'
+          }
+        }
+        if (this.commonJS.isEmpty(num) || num === true) {
+          this.num = true // num为true是多选,false是单选
+        } else {
+          this.num = false
+        }
+        this.visible = true
+        this.dataListAllSelections = []
+        this.tablePage.currentPage = 1
+        this.tablePage.pageSize = 10
+        this.searchForm = {
+          projectName: '',
+          projectNumber: '',
+          createBy: ''
+        }
+        this.list()
+      },
+      // 表单提交
+      getProgram () {
+		  let row = this.$refs.programTable.getRadioRecord()
+		  if (this.commonJS.isEmpty(row)) {
+			  this.$message.error('请选择一条数据')
+			  return
+		  }
+        this.close()
+        this.$emit('getProgram', row)
+      },
+      list () {
+        this.loading = true
+        this.searchForm.status = '5'
+        projectRecordsService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(async (data) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+          // 在切换页后,将页面不需要勾选的数据取消勾选
+          let isCheck = []
+          for (let i = 0; i < this.tablePage.pageSize; i++) {
+            for (let j = 0; j < this.dataListAllSelections.length; j++) {
+              if (this.commonJS.isNotEmpty(this.dataList[i]) && this.commonJS.isNotEmpty(this.dataListAllSelections[j])) {
+                if (this.dataList[i].id === this.dataListAllSelections[j].id) { // 符合条件的数据勾选
+                  isCheck.push(this.dataList[i].id)
+                }
+              }
+            }
+          }
+          if (this.commonJS.isNotEmpty(isCheck)) {
+            for (let i = 0; i < this.tablePage.pageSize; i++) {
+              if (isCheck.includes(this.dataList[i].id)) {
+                await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
+              } else {
+                await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
+              }
+            }
+          } else {
+            for (let i = 0; i < this.tablePage.pageSize; i++) {
+              await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
+            }
+          }
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.dataListAllSelections = []
+        this.searchForm = {
+          projectName: '',
+          projectNumber: '',
+          createBy: ''
+        }
+        // this.$refs.programTable.clearCheckboxReserve() // 清除全部页的勾选
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        // this.$refs.programTable.clearCheckboxReserve()
+        this.dataListAllSelections = []
+        this.detail = ''
+        this.visible = false
+      },
+      // 全选/取消全选 时,右侧tag标签同步新增或删除改变
+      async selectAllEvent (event) {
+        this.dataListAllSelections = []
+        let thisPageDate = await this.$refs.programTable.getCheckboxRecords()
+        let otherPageDate = await this.$refs.programTable.getCheckboxReserveRecords()
+        if (this.commonJS.isNotEmpty(otherPageDate)) {
+          for (let i = 0; i < otherPageDate.length; i++) {
+            this.dataListAllSelections.push(otherPageDate[i])
+          }
+        }
+        if (this.commonJS.isNotEmpty(thisPageDate)) {
+          for (let i = 0; i < thisPageDate.length; i++) {
+            this.dataListAllSelections.push(thisPageDate[i])
+          }
+        }
+      },
+      // 当前页“选中/取消选中”数据时,“新增/删除”右侧tag标签
+      selectionChangeHandle (event) {
+        if (event.checked) { // 选中触发
+          let delIndex = -1
+          for (let i = 0; i < this.dataListAllSelections.length; i++) {
+            if (this.dataListAllSelections[i].id === event.row.id) {
+              delIndex = i
+            }
+          }
+          if (this.commonJS.isNotEmpty(delIndex) && delIndex === -1) {
+            this.dataListAllSelections.push(event.row)
+          }
+        } else { // 取消选中触发
+          let delIndex = -1
+          for (let i = 0; i < this.dataListAllSelections.length; i++) {
+            if (this.dataListAllSelections[i].id === event.row.id) {
+              delIndex = i
+            }
+          }
+          if (this.commonJS.isNotEmpty(delIndex) && delIndex !== -1) {
+            this.dataListAllSelections.splice(delIndex, 1)
+          }
+        }
+      },
+      // 删除tag标签时,取消勾选当前页对应的数据
+      async del (tag, index) {
+        this.dataListAllSelections.splice(index, 1)
+        let rows = await this.$refs.programTable.getCheckboxRecords()
+        await this.$refs.programTable.clearCheckboxRow()
+        for (let i = 0; i < this.dataList.length; i++) {
+          for (let j = 0; j < rows.length; j++) {
+            if (this.dataList[i].id !== tag.id && this.dataList[i].id === rows[j].id) {
+              await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
+            }
+          }
+        }
+      }
+    }
+  }
+</script>
+<style>
+  .messageZindex {
+    z-index:9999 !important;
+  }
+</style>

+ 1 - 0
src/views/cw/reimbursementApproval/info/InfoList.vue

@@ -500,6 +500,7 @@
           'orders': this.tablePage.orders,
           ...this.searchForm
         }).then((data) => {
+        	console.log('data',data.records)
           this.dataList = data.records
           this.tablePage.total = data.total
           this.loading = false

+ 6 - 4
src/views/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -749,7 +749,7 @@
 
 <!--      <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>-->
       <CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
-      <CwProgramPageForm ref="cwProgramPageForm3" @getProgram="getProgram3"></CwProgramPageForm>
+      <CwProgramPageForm2 ref="cwProgramPageForm3" @getProgram="getProgram3"></CwProgramPageForm2>
       <CwProgramPageForm ref="cwProgramPageForm4" @getProgram="getProgram4"></CwProgramPageForm>
       <CwProgramPageForm ref="cwProgramPageForm5" @getProgram="getProgram5"></CwProgramPageForm>
       <ReimburseRegisterChoose ref="cwProgramPageForm6" @getProgram="getProgram6"></ReimburseRegisterChoose>
@@ -802,6 +802,7 @@
   // import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
   // import MaterialManagementDialog from '../../../materialManagement/file/MaterialManagementDialog'
   import ProjectListForm from './ProgramForm'
+  import CwProgramPageForm2 from './CwProgramPageForm2'
   import userService from '@/api/sys/UserService'
   export default {
     props: {
@@ -954,6 +955,7 @@
 		UpLoadComponent,
       // ProgramPageForm,
       CwProgramPageForm,
+      CwProgramPageForm2,
 		ReimburseRegisterChoose,
       // ReimbursementTypePullForm,
       CwReimbursementTypePullForm,
@@ -1858,9 +1860,9 @@
         this.$forceUpdate()
       },
       getProgram3 (rows) {
-        this.inputForm.detailInfoReports[this.indexRow].projectId = rows[0].id
-        this.inputForm.detailInfoReports[this.indexRow].projectName = rows[0].projectName
-        this.inputForm.detailInfoReports[this.indexRow].reportNumber = rows[0].reportNumber
+        this.inputForm.detailInfoReports[this.indexRow].projectId = rows.id
+        this.inputForm.detailInfoReports[this.indexRow].projectName = rows.projectName
+        this.inputForm.detailInfoReports[this.indexRow].reportNumber = rows.reportNumber
         this.indexRow = ''
         this.$forceUpdate()
       },