lizhenhao преди 2 години
родител
ревизия
9437e17a66

+ 88 - 0
src/api/cw/invoice/CwFinanceInvoiceService.js

@@ -0,0 +1,88 @@
+import request from '@/utils/httpRequest'
+
+export default class CwFinanceInvoiceService {
+  list (params) {
+    return request({
+      url: '/cw_finance/invoice/list',
+      method: 'get',
+      params: params
+    })
+  }
+  queryById (id) {
+    return request({
+      url: '/cw_finance/invoice/queryById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  queryByNumber (number, id) {
+    return request({
+      url: '/cw_finance/invoice/queryByNumber',
+      method: 'get',
+      params: {number: number, id: id}
+    })
+  }
+  save (inputForm) {
+    return request({
+      url: `/cw_finance/invoice/save`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+  delete (ids) {
+    return request({
+      url: '/cw_finance/invoice/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+  updateStatusById (data) {
+    return request({
+      url: '/cw_finance/invoice/updateStatusById',
+      method: 'post',
+      data: data
+    })
+  }
+  isReceivables (data) {
+    return request({
+      url: '/cw_finance/invoice/isReceivables',
+      method: 'post',
+      data: data
+    })
+  }
+  saveForm (inputForm) {
+    return request({
+      url: `/cw_finance/invoice/saveForm`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+  saveFormInvalid (inputForm) {
+    return request({
+      url: `/cw_finance/invoice/saveFormInvalid`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+  queryIdByInvalidId (id) {
+    return request({
+      url: '/cw_finance/invoice/queryIdByInvalidId',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  importDetail (data) {
+    return request({
+      url: '/cw_finance/invoice/importDetail',
+      method: 'post',
+      data: data
+    })
+  }
+  exportTemplate () {
+    return request({
+      url: '/cw_finance/invoice/importDetail/template',
+      method: 'get',
+      responseType: 'blob'
+    })
+  }
+}

+ 184 - 0
src/views/modules/cw/invoice/ContractForm.vue

@@ -0,0 +1,184 @@
+<template>
+  <div>
+    <el-dialog
+      title="选择合同"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      @keyup.enter.native=""
+      :visible.sync="visible">
+      <div style="height: calc(100% - 80px);">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="合同名称" prop="name">
+            <el-input size="small" v-model="searchForm.name" placeholder="请输入合同名称" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="委派方" prop="clientName">
+            <el-input size="small" v-model="searchForm.clientName" placeholder="请输入委派方" clearable></el-input>
+          </el-form-item>
+          <!--<el-form-item label="创建人" prop="createBy">
+            <SelectUserTree
+              ref="companyTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+              :url="`/sys/user/treeUserDataAllOffice?type=2`"
+              :value="searchForm.createBy"
+              :clearable="true"
+              :accordion="true"
+              @getValue="(value) => {searchForm.createBy=value}"/>
+          </el-form-item>-->
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="400px"
+          :loading="loading"
+          size="small"
+          ref="workContractTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="radio" width="40px"></vxe-column>
+
+          <vxe-column width="200px" title="合同编号" field="no"></vxe-column>
+          <vxe-column  title="合同名称" field="name"></vxe-column>
+          <vxe-column width="150px" title="委派方" field="clientName"></vxe-column>
+          <vxe-column width="150px" title="合同类型" field="contractType">
+            <template slot-scope="scope">
+              {{ $dictUtils.getDictLabel("contract_type", scope.row.contractType, '-') }}
+            </template>
+          </vxe-column>
+          <vxe-column width="150px" title="创建时间" field="createDate"></vxe-column>
+          <vxe-column width="100px" title="创建人" field="createBy"></vxe-column>
+
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :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>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getContract()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import InputNumber from '@/views/modules/sys/workContract/InputNumber.vue'
+  import WorkContractService from '@/api/sys/WorkContractService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import ProgramProjectListInfoService from '@/api/program/ProgramProjectListInfoService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          clientName: '',
+          name: '',
+          contractDates: [],
+          type: '',
+          filedType: '',
+          contractAmounts: [],
+          createBy: this.$store.state.user.id,
+          procInsId: '',
+          processDefinitionId: ''
+        },
+        rowId: ''
+      }
+    },
+    workContractService: null,
+    programProjectListInfoService: null,
+    created () {
+      this.workContractService = new WorkContractService()
+      this.programProjectListInfoService = new ProgramProjectListInfoService()
+    },
+    components: {
+      SelectUserTree,
+      InputNumber
+    },
+    methods: {
+      init (id) {
+        // if (!this.commonJS.isEmpty(id)) {
+        //   this.$refs.workContractTable.setCurrentRow(id)
+        // }
+        this.visible = true
+        this.list()
+      },
+      // 表单提交
+      getContract () {
+        let row = this.$refs.workContractTable.getRadioRecord()
+        if (this.commonJS.isEmpty(row)) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        this.close()
+        this.$emit('getContract', row)
+      },
+      list () {
+        this.loading = true
+        this.searchForm.createBy = this.$store.state.user.id
+        this.programProjectListInfoService.findContractPageList({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.visible = false
+      }
+    }
+  }
+</script>

Файловите разлики са ограничени, защото са твърде много
+ 1187 - 0
src/views/modules/cw/invoice/InvoiceForm.vue


Файловите разлики са ограничени, защото са твърде много
+ 1298 - 0
src/views/modules/cw/invoice/InvoiceFormTask.vue


Файловите разлики са ограничени, защото са твърде много
+ 1161 - 0
src/views/modules/cw/invoice/InvoiceFormTaskInvalid.vue


+ 717 - 0
src/views/modules/cw/invoice/InvoiceList.vue

@@ -0,0 +1,717 @@
+<template>
+  <div class="page">
+    <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+      <!-- 搜索框-->
+      <el-row :gutter="0">
+        <el-form-item prop="no" label="发票申请编号">
+          <el-input size="small" v-model="searchForm.no" placeholder="请输入发票申请编号" clearable></el-input>
+        </el-form-item>
+        <el-form-item prop="number" label="发票号">
+          <el-input size="small" v-model="searchForm.number" placeholder="请输入发票号" clearable></el-input>
+        </el-form-item>
+<!--        <el-form-item prop="programName" label="项目名称">-->
+<!--          <el-input size="small" v-model="searchForm.programName" placeholder="请输入项目名称" clearable @clear="clearProgram">-->
+<!--            <el-button slot="append" @click="openProgramPageForm()" icon="el-icon-search"></el-button>-->
+<!--          </el-input>-->
+<!--        </el-form-item>-->
+        <el-form-item v-if="showHideItem" prop="accountBegin" label="开票总金额">
+          <el-input-number
+            size="small"
+            v-model="searchForm.accountBegin"
+            controls-position="right"
+            :controls="false"
+            style="width:100%;"
+            :precision="2"
+            placeholder="请填写开票总金额"
+            :step="0.01"
+            :min="0"
+            clearable>
+          </el-input-number>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="accountEnd" label="-">
+          <el-input-number
+            size="small"
+            v-model="searchForm.accountEnd"
+            controls-position="right"
+            :controls="false"
+            style="width:100%;"
+            :precision="2"
+            placeholder="请填写开票总金额"
+            :step="0.01"
+            :min="0"
+            clearable>
+          </el-input-number>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="reconciliationPeopleName" label="对账人">
+          <UserSelect :limit='1' :userName="searchForm.reconciliationPeopleName" @getValue='(value, label) => {searchForm.reconciliationPeopleName = label}'></UserSelect>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" label="经办人" prop="operator">
+          <UserSelect :limit='1' :userName="searchForm.operator" @getValue='(value, label) => {searchForm.operator = label}'></UserSelect>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="operatorOffice" label="经办人部门">
+          <SelectTree
+            ref="officeTree"
+            :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+            :url="`/sys/office/treeData?type=2`"
+            :value="searchForm.operatorOffice"
+            :clearable="true"
+            :accordion="true"
+            @getValue="(value) => {searchForm.operatorOffice=value}"/>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="billingWorkplaceReal" label="开票单位">
+          <el-input size="small" v-model="searchForm.billingWorkplaceReal" placeholder="请输入开票单位" clearable></el-input>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="receivablesStatus" label="是否收款">
+          <el-select v-model="searchForm.receivablesStatus" placeholder="请选择是否收款" clearable>
+            <el-option label="是" value="1"></el-option>
+            <el-option label="否" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="type" label="发票类型">
+          <el-select v-model="searchForm.type" placeholder="请选择发票类型" clearable>
+            <el-option
+              v-for="item in this.$dictUtils.getDictList('invoice_type')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="receivablesType" label="收款类型">
+          <el-select v-model="searchForm.receivablesType" placeholder="请选择收款类型"clearable>
+            <el-option
+              v-for="item in $dictUtils.getDictList('invoice_receivables_type')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="billingContent" label="开票内容">
+          <el-select v-model="searchForm.billingContent" placeholder="请选择开票内容"clearable>
+            <el-option
+              v-for="item in $dictUtils.getDictList('invoice_billing_content')"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="reconciliationArea" label="对账地区">
+          <SelectTree
+            ref="areaTree"
+            :props="{
+                    value: 'id',             // ID字段名
+                    label: 'name',         // 显示名称
+                    children: 'children'    // 子级字段名
+                  }"
+            url="/sys/area/treeData"
+            :value="searchForm.reconciliationArea"
+            :clearable="true"
+            :accordion="true"
+            @getValue="(value) => {searchForm.reconciliationArea=value}"/>
+        </el-form-item>
+
+        <el-form-item v-if="showHideItem" prop="billingDateList" label="开票日期">
+          <el-date-picker
+            size="small"
+            @change="changeBillingDateList"
+            v-model="searchForm.billingDateList"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            range-separator="至"
+            style="width: 100%  "
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            placement="bottom-start"
+            clearabl>
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item v-if="showHideItem" prop="remittanceDateList" label="收款日期">
+          <el-date-picker
+            size="small"
+            v-model="searchForm.remittanceDateList"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            range-separator="至"
+            style="width: 100%  "
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            placement="bottom-start"
+            clearable>
+          </el-date-picker>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="default" @click="showHide" size="small" :icon="showHideIcon">{{showHideName}}</el-button>
+          <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+          <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+        </el-form-item>
+      </el-row>
+    </el-form>
+    <div class="bg-white top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+          <el-button v-if="hasPermission('cw_finance:invoice:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
+<!--          <el-button v-if="hasPermission('cw_finance:invoice:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.invoiceTable && $refs.invoiceTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 80px)">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="invoiceTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+          <vxe-column min-width="150" title="项目名称"align="center" field="programName">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" @click="viewProject(scope.row.id)">{{scope.row.programName}}</el-link>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="150" title="发票申请编号"align="center" field="no">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" @click="view(false, scope.row.id)">{{scope.row.no}}</el-link>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="150" title="发票号"align="center" field="number"></vxe-column>
+          <vxe-column min-width="150" title="实际开票单位"align="center" field="billingWorkplaceReal"></vxe-column>
+          <vxe-column min-width="150" title="经办人"align="center" field="operator"></vxe-column>
+          <vxe-column min-width="150" title="经办人部门"align="center" field="operatorOffice"></vxe-column>
+          <vxe-column min-width="150" title="开票总金额(元)"align="center" field="account"></vxe-column>
+          <vxe-column min-width="150" title="开票金额(元)"align="center" field="accountDetail"></vxe-column>
+          <vxe-column min-width="120" title="开票内容"align="center" field="billingContent">
+            <template slot-scope="scope">
+              {{$dictUtils.getDictLabel('invoice_billing_content', scope.row.billingContent, '-')}}
+            </template>
+          </vxe-column>
+          <vxe-column min-width="100" title="收款类型"align="center" field="receivablesType">
+            <template slot-scope="scope">
+              {{$dictUtils.getDictLabel('invoice_receivables_type', scope.row.receivablesType, '-')}}
+            </template>
+          </vxe-column>
+          <vxe-column min-width="100" title="发票类型"align="center" field="type">
+            <template slot-scope="scope">
+              {{$dictUtils.getDictLabel('invoice_type', scope.row.type, '-')}}
+            </template>
+          </vxe-column>
+          <vxe-column min-width="120" title="开票日期"align="center" field="billingDate"></vxe-column>
+          <vxe-column min-width="120" title="收款日期"align="center" field="receivablesDate"></vxe-column>
+          <vxe-column min-width="110" fixed="right"align="center" title="是否收款" field="receivablesStatus">
+            <template slot-scope="scope">
+              {{scope.row.receivablesStatus === '1'?'已收款':'未收款'}}
+            </template>
+          </vxe-column>
+          <vxe-column min-width="110" fixed="right"align="center" title="是否作废" field="invalidStatus">
+            <template slot-scope="scope">
+              {{scope.row.invalidStatus === '1'?'已作废':'未作废'}}
+            </template>
+          </vxe-column>
+          <vxe-column  min-width="110px" fixed="right"align="center" title="状态" field="status" >
+            <template slot-scope="scope">
+              <el-button  type="text" @click="invoiceDetail(scope.row)" :type="$dictUtils.getDictLabel('invoice_status_info', scope.row.status, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("invoice_status", scope.row.status, '-')}} </el-button>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="300" title="操作"  fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'||scope.row.status === '4'" type="text"  size="small" @click="invoicePush(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '2'" type="text"  size="small" @click="invoiceReback(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"  size="small" @click="editDetail(scope.row.id)">修改发票明细</el-button>
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"   size="small" @click="view(true, scope.row.id)">收款</el-button>
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"   size="small" @click="isReceivables(scope.row)">确认收款</el-button>
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '5'||scope.row.status === '7'||scope.row.status === '8'" type="text"  size="small" @click="invoiceInvalidPush(scope.row)">作废</el-button>
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '6'" type="text"  size="small" @click="invoiceInvalidReBack(scope.row)">作废撤回</el-button>
+              <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'||scope.row.status === '4'" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :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>
+    <InvoiceForm  ref="invoiceForm" @refreshDataList="refreshList"></InvoiceForm>
+    <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>
+    <ProgramForm ref="programForm"></ProgramForm>
+  </div>
+</template>
+
+<script>
+  import FinanceInvoiceService from '@/api/cw/invoice/CwFinanceInvoiceService'
+  import ProgramForm from './ProgramForm'
+  import InvoiceForm from './InvoiceForm'
+  import pick from 'lodash.pick'
+  import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  import UserService from '@/api/sys/UserService'
+  import UserSelect from '@/components/userSelect'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import ProgramPageForm from '@/views/modules/finance/invoice/ProgramPageForm'
+  export default {
+    data () {
+      return {
+        showHideItem: false,
+        showHideIcon: 'el-icon-arrow-down',
+        showHideName: '展示',
+        searchForm: {
+          number: '',
+          accountBegin: undefined,
+          accountEnd: undefined,
+          billingDateList: [],
+          billingDateBegin: '',
+          billingDateEnd: '',
+          remittanceDateList: [],
+          remittanceDateBegin: '',
+          remittanceDateEnd: '',
+          programName: '',
+          programId: '',
+          reconciliationPeopleName: '',
+          operator: '',
+          operatorOffice: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false,
+        processDefinitionId: '',
+        procDefKey: '',
+        processDefinitionInvalidId: '',
+        procDefInvalidKey: ''
+      }
+    },
+    financeInvoiceService: null,
+    taskService: null,
+    processService: null,
+    userService: null,
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      }
+    },
+    created () {
+      this.financeInvoiceService = new FinanceInvoiceService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+      this.userService = new UserService()
+    },
+    components: {
+      InvoiceForm,
+      UserSelect,
+      SelectUserTree,
+      SelectTree,
+      ProgramPageForm,
+      ProgramForm
+    },
+    mounted () {
+      this.refreshList()
+    },
+    activated () {
+      this.refreshList()
+    },
+    methods: {
+      showHide () {
+        if (this.showHideItem === false) {
+          this.showHideItem = true
+          this.showHideIcon = 'el-icon-arrow-up'
+          this.showHideName = '隐藏'
+        } else {
+          this.showHideItem = false
+          this.showHideIcon = 'el-icon-arrow-down'
+          this.showHideName = '展示'
+        }
+      },
+      // 新增
+      add () {
+        this.$refs.invoiceForm.init('add', '')
+      },
+      // 修改发票明细
+      editDetail (id) {
+        id = id || this.$refs.invoiceTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.invoiceForm.init(false, id, true)
+      },
+      // 查看 flag为true时,弹窗为收款,其他值为查看发票详情
+      view (flag, id) {
+        this.$refs.invoiceForm.init(flag, id)
+      },
+      // 查看项目数据
+      viewProject (id) {
+        this.$refs.programForm.init(id)
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        if (!this.commonJS.isEmpty(this.searchForm.billingDateList)) {
+          if (!this.commonJS.isEmpty(this.searchForm.billingDateList[0]) && !this.commonJS.isEmpty(this.searchForm.billingDateList[1])) {
+            this.searchForm.billingDateBegin = this.searchForm.billingDateList[0]
+            this.searchForm.billingDateEnd = this.searchForm.billingDateList[1]
+          }
+        } else {
+          this.searchForm.billingDateBegin = ''
+          this.searchForm.billingDateEnd = ''
+        }
+        if (!this.commonJS.isEmpty(this.searchForm.remittanceDateList)) {
+          if (!this.commonJS.isEmpty(this.searchForm.remittanceDateList[0]) && !this.commonJS.isEmpty(this.searchForm.remittanceDateList[1])) {
+            this.searchForm.remittanceDateBegin = this.searchForm.remittanceDateList[0]
+            this.searchForm.remittanceDateEnd = this.searchForm.remittanceDateList[1]
+          }
+        } else {
+          this.searchForm.remittanceDateBegin = ''
+          this.searchForm.remittanceDateEnd = ''
+        }
+        this.financeInvoiceService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          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 = ''
+            }
+            if (!this.commonJS.isEmpty(item.financeInvoiceDetailDTOList)) {
+              item.accountDetail = 0
+              let num = ''
+              item.financeInvoiceDetailDTOList.forEach((detail, index) => {
+                if (!this.commonJS.isEmpty(detail.account)) {
+                  item.accountDetail = parseFloat(parseFloat(item.accountDetail) + parseFloat(detail.account)).toFixed(2)
+                }
+                if ((index + 1) !== item.financeInvoiceDetailDTOList.length) {
+                  num = num + detail.number + ','
+                } else {
+                  num = num + detail.number
+                }
+              })
+              item.number = num
+            } else {
+              item.number = ''
+              item.accountDetail = ''
+            }
+          })
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+        this.processService.getByName('财务-发票申请').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionId = data.id
+            this.procDefKey = data.key
+          }
+        })
+        this.processService.getByName('财务-发票作废').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionInvalidId = data.id
+            this.procDefInvalidKey = data.key
+          }
+        })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.tablePage.orders = []
+        if (column.order != null) {
+          this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.invoiceTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.financeInvoiceService.delete(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.searchForm = {
+          number: '',
+          accountBegin: undefined,
+          accountEnd: undefined,
+          billingDateList: [],
+          billingDateBegin: '',
+          billingDateEnd: '',
+          remittanceDateList: [],
+          remittanceDateBegin: '',
+          remittanceDateEnd: '',
+          programName: '',
+          programId: '',
+          reconciliationPeopleName: '',
+          operator: '',
+          operatorOffice: ''
+        }
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      start () {
+        // 读取流程表单
+        let tabTitle = `发起流程【发票申请】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [发票申请]`
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
+          status: 'startAndHold'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionId,
+                procDefKey: this.procDefKey,
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessId: 'false',
+                isShow: false,
+                routePath: '/cw/invoice/InvoiceList'
+              }
+            })
+          })
+      },
+      // 发起发票申请审批
+      invoicePush (row) {
+        // 读取流程表单
+        let title = `发起流程【发票申请】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票申请]`
+        let status = 'startAndHold'
+        if (row.status === '3' || row.status === '4') {
+          status = 'startAndClose'
+        }
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
+          businessId: row.id,
+          businessTable: 'cw_finance_invoice'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionId,
+                procDefKey: this.procDefKey,
+                title: title,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'finance_invoice',
+                businessId: row.id,
+                isShow: 'false',
+                status: status,
+                routePath: '/cw/invoice/InvoiceList'
+              }
+            })
+          })
+      },
+      // 发起发票作废审批
+      invoiceInvalidPush (row) {
+        // 读取流程表单
+        let title = `发起流程【发票作废】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票作废]`
+        let status = 'startAndHold'
+        if (row.status === '8' || row.status === '7') {
+          status = 'startAndClose'
+        }
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionInvalidId,
+          businessId: row.financeInvoiceInvalidDTO.id,
+          businessTable: 'cw_finance_invoice_invalid'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionInvalidId,
+                procDefKey: this.procDefInvalidKey,
+                title: title,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'cw_finance_invoice_invalid',
+                businessId: row.financeInvoiceInvalidDTO.id,
+                isShow: 'false',
+                status: status,
+                routePath: '/cw/invoice/InvoiceList'
+              }
+            })
+          })
+      },
+      // 查看发票申请审批流程结果
+      invoiceDetail (row) {
+        if (row.status !== '0' && row.status !== '1') {
+          if (row.status === '6' || row.status === '7' || row.status === '8' || row.status === '9') {
+            this.invoiceInvalidDetail(row)
+          } else {
+            this.taskService.getTaskDef({
+              procInsId: row.procInsId,
+              procDefId: this.processDefinitionId
+            }).then(({data}) => {
+              this.$router.push({
+                path: '/flowable/task/TaskFormDetail',
+                query: {
+                  isShow: 'false',
+                  readOnly: true,
+                  title: '发票申请' + '流程详情',
+                  formTitle: '发票申请' + '流程详情',
+                  businessId: row.id,
+                  status: 'reback',
+                  ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
+                }
+              })
+            })
+          }
+        }
+      },
+      // 查看发票作废审批流程结果
+      invoiceInvalidDetail (row) {
+        this.taskService.getTaskDef({
+          procInsId: row.financeInvoiceInvalidDTO.procInsId,
+          procDefId: this.processDefinitionInvalidId
+        }).then(({data}) => {
+          this.$router.push({
+            path: '/flowable/task/TaskFormDetail',
+            query: {
+              isShow: 'false',
+              readOnly: true,
+              title: '发票作废' + '流程详情',
+              formTitle: '发票作废' + '流程详情',
+              businessId: row.financeInvoiceInvalidDTO.id,
+              status: 'reback',
+              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
+            }
+          })
+        })
+      },
+      // 撤回发票申请审批
+      invoiceReback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          await this.financeInvoiceService.queryById(row.id).then(({data}) => {
+            if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+              this.$message.error('数据已发生改变或不存在,请刷新数据')
+              this.refreshList()
+            } else {
+              this.processService.revokeProcIns(row.procInsId).then(async ({data}) => {
+                let form = {status: '3', id: row.id}
+                await this.financeInvoiceService.updateStatusById(form)
+                this.$message.success(data)
+                this.refreshList()
+              })
+            }
+          })
+        })
+      },
+      invoiceInvalidReBack (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          await this.financeInvoiceService.queryById(row.id).then(({data}) => {
+            if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
+              this.$message.error('数据已发生改变或不存在,请刷新数据')
+              this.refreshList()
+            } else {
+              this.processService.revokeProcIns(row.financeInvoiceInvalidDTO.procInsId).then(async ({data}) => {
+                let form = {status: '5', id: row.id}
+                await this.financeInvoiceService.updateStatusById(form)
+                this.$message.success(data)
+                this.refreshList()
+              })
+            }
+          })
+        })
+      },
+      isReceivables (row) {
+        this.$confirm(`确定要确认收款吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          let param = {id: row.id, receivablesStatus: '1', receivablesDate: this.moment(new Date()).format('YYYY-MM-DD')}
+          this.financeInvoiceService.isReceivables(param).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+          })
+        })
+      },
+      changeBillingDateList (event) {
+        if (this.commonJS.isNotEmpty(this.searchForm.billingDateList)) {
+          console.log('event', event)
+        }
+      },
+      openProgramPageForm () {
+        this.$refs.programPageForm.init('1', false)
+      },
+      getProgram (rows) {
+        if (this.commonJS.isNotEmpty(rows)) {
+          this.searchForm.programName = rows[0].name
+          this.searchForm.programId = rows[0].id
+        }
+      },
+      clearProgram () {
+        this.searchForm.programName = ''
+        this.searchForm.programId = ''
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-input-number .el-input__inner {
+    text-align: left;
+  }
+</style>

+ 656 - 0
src/views/modules/cw/invoice/ProgramForm.vue

@@ -0,0 +1,656 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1300px"
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"
+               label-width="160px" @submit.native.prevent>
+        <el-row  :gutter="15" v-if="baseFlag !== true">
+          <vxe-table
+            border
+            show-overflow
+            show-footer
+            ref="baseTable"
+            class="vxe-table-element"
+            :data="inputForm.financeInvoiceBaseDTOList"
+            style="margin-left: 5em"
+            @cell-click=""
+            @edit-closed=""
+            highlight-current-row
+            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+          >
+            <vxe-table-column field="programName" align="center" title="项目名称">
+              <template slot-scope="scope">
+                <el-link type="primary" :underline="false" @click="openProjectForm(scope.row.programId)" >{{scope.row.programName}}</el-link>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="contractName" align="center" title="合同名称"></vxe-table-column>
+            <vxe-table-column field="programNo" align="center" title="项目编号"></vxe-table-column>
+            <vxe-table-column field="clientName" align="center" title="委托方"></vxe-table-column>
+<!--            <vxe-table-column field="reportNo" title="报告号" :edit-render="{}">-->
+<!--              <template v-slot:edit="scope">-->
+<!--                <el-input v-model="scope.row.reportNo" placeholder="请填写报告号"/>-->
+<!--              </template>-->
+<!--            </vxe-table-column>-->
+<!--            <vxe-table-column title="操作" width="100">-->
+<!--              <template v-slot="scope">-->
+<!--                <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'base')">删除</el-button>-->
+<!--              </template>-->
+<!--            </vxe-table-column>-->
+          </vxe-table>
+        </el-row>
+        <el-row :gutter="15" v-if="baseFlag === true">
+          <el-form-item label="开票详情" prop="">
+          <el-input :readonly="true" type="textarea" maxlength="500" v-model="programName"></el-input>
+          </el-form-item>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+<!--      <el-button size="small" type="primary" v-if="method != 'view'||receivablesFlag!==true" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>-->
+<!--      <el-button size="small" type="primary" v-if="receivablesFlag===true" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>保留</el-button>-->
+    </span>
+    </el-dialog>
+    <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>
+    <ContractForm  ref="contractForm" @getContract="getContract"></ContractForm>
+    <WorkClientForm  ref="workClientForm" @getWorkClient="getWorkClient"></WorkClientForm>
+    <ProjectForm ref="projectForm"></ProjectForm>
+  </div>
+</template>
+
+<script>
+  import FinanceInvoiceService from '@/api/finance/invoice/FinanceInvoiceService'
+  import WorkClientService from '@/api/sys/WorkClientService'
+  import ProjectForm from '@/views/modules/program/registered/ProjectForm'
+  import ProgramPageForm from '@/views/modules/finance/invoice/ProgramPageForm'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import ContractForm from '@/views/modules/program/registered/ContractForm'
+  import WorkClientForm from '@/views/modules/program/registered/WorkClientForm'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          financeInvoiceBaseDTOList: [],
+          programName: '',
+          contractName: '',
+          programNo: '',
+          clientName: '',
+          reportNo: '',
+          type: '1',
+          no: '',
+          billingType: '1',
+          billingWorkplaceReal: '',
+          billingWorkplaceRealId: '',
+          taxpayerIdentificationNo: '',
+          address: '',
+          telPhone: '',
+          openBank: '',
+          bankAccount: '',
+          receivablesType: '2',
+          billingContent: '',
+          account: '',
+          billingContentTerms: '',
+          billingPeople: JSON.parse(localStorage.getItem('user')).name,
+          billingPeopleId: JSON.parse(localStorage.getItem('user')).id,
+          billingDate: '',
+          collectDate: '',
+          billingPeopleReal: JSON.parse(localStorage.getItem('user')).id,
+          reconciliationPeople: '',
+          reconciliationArea: '',
+          remarks: '',
+          name: '',
+          status: '',
+          procInsId: '',
+          processDefinitionId: '',
+          workAttachmentDtoList: [],
+          financeInvoiceDetailDTOList: [],
+          financeInvoiceReceivablesDTOList: [],
+          financeInvoiceInvalidDTO: {}
+        },
+        programRow: '',
+        bankList: [],
+        err: '',
+        receivablesFlag: '', // true为收款,false为非收款
+        detailFlag: '', // true为修改发票明细
+        importVisible: false,
+        baseFlag: false,
+        programName: ''
+      }
+    },
+    financeInvoiceService: null,
+    workClientService: null,
+    created () {
+      this.financeInvoiceService = new FinanceInvoiceService()
+      this.workClientService = new WorkClientService()
+    },
+    components: {
+      ProgramPageForm,
+      ContractForm,
+      WorkClientForm,
+      SelectUserTree,
+      SelectTree,
+      UpLoadComponent,
+      ProjectForm
+    },
+    methods: {
+      init (id) {
+        this.method = 'view'
+        this.title = '查看项目信息'
+        this.inputForm = {
+          id: '',
+          financeInvoiceBaseDTOList: [],
+          programName: '',
+          contractName: '',
+          programNo: '',
+          clientName: '',
+          reportNo: '',
+          type: '1',
+          no: '',
+          billingType: '1',
+          billingWorkplaceReal: '',
+          billingWorkplaceRealId: '',
+          taxpayerIdentificationNo: '',
+          address: '',
+          telPhone: '',
+          openBank: '',
+          bankAccount: '',
+          receivablesType: '2',
+          billingContent: '',
+          account: '',
+          billingContentTerms: '',
+          billingPeople: JSON.parse(localStorage.getItem('user')).name,
+          billingPeopleId: JSON.parse(localStorage.getItem('user')).id,
+          billingDate: '',
+          collectDate: '',
+          billingPeopleReal: JSON.parse(localStorage.getItem('user')).id,
+          reconciliationPeople: '',
+          reconciliationArea: '',
+          remarks: '',
+          name: '',
+          status: '',
+          procInsId: '',
+          processDefinitionId: '',
+          workAttachmentDtoList: [],
+          financeInvoiceDetailDTOList: [],
+          financeInvoiceReceivablesDTOList: [],
+          financeInvoiceInvalidDTO: {
+            id: '',
+            invalidStatus: '',
+            invoiceId: '',
+            remarks: ''
+          }
+        }
+        this.baseFlag = false
+        this.inputForm.id = id
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = true
+          this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+            this.inputForm = this.recover(this.inputForm, data)
+            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            if (!this.commonJS.isEmpty(this.inputForm.billingWorkplaceRealId)) {
+              this.workClientService.findById(this.inputForm.billingWorkplaceRealId).then((data) => {
+                this.bankList = data.data.workClientBank
+              })
+            }
+            if (this.commonJS.isEmpty(this.inputForm.financeInvoiceReceivablesDTOList) || this.inputForm.financeInvoiceReceivablesDTOList.length === 0) {
+              this.inputForm.financeInvoiceReceivablesDTOList = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
+              this.inputForm.workAttachmentDtoList = []
+            }
+            if (this.commonJS.isNotEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
+              if (this.inputForm.financeInvoiceBaseDTOList.length === 1 && this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programId)) {
+                this.baseFlag = true
+                this.programName = this.inputForm.financeInvoiceBaseDTOList[0].programName
+              }
+            }
+            this.loading = false
+          })
+        })
+      },
+      openProjectForm (id) {
+        this.$refs.projectForm.init('view', id)
+      },
+      // 表单提交
+      async doSubmit () {
+        if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
+          this.$message.error('至少新增一条基本信息')
+          return
+        } else {
+          if (this.inputForm.financeInvoiceBaseDTOList.length === 0) {
+            this.$message.error('至少新增一条基本信息')
+            return
+          }
+        }
+        let acc = 0
+        this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
+          if (this.commonJS.isEmpty(item.number)) {
+            this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
+            throw new Error()
+          }
+          if (this.commonJS.isEmpty(item.account)) {
+            this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
+            throw new Error()
+          }
+          acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
+        })
+        if (acc !== this.inputForm.account) {
+          this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
+          return
+        }
+        this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
+          this.inputForm.financeInvoiceDetailDTOList.forEach((item2, index2) => {
+            if (index !== index2) {
+              if (item.number === item2.number) {
+                this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
+                throw new Error()
+              }
+            }
+          })
+        })
+        for await (let [index, item] of this.inputForm.financeInvoiceDetailDTOList.entries()) {
+          if (this.commonJS.isEmpty(item.number)) {
+            this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
+            this.err = true
+          }
+          await this.financeInvoiceService.queryByNumber(item.number, item.id).then(({data}) => {
+            if (data === true) {
+              this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
+              this.err = data
+            }
+          })
+        }
+        if (this.err === true) {
+          this.err = ''
+          return
+        }
+        if (this.receivablesFlag === true) {
+          this.inputForm.financeInvoiceReceivablesDTOList.forEach((item, index) => {
+            if (this.commonJS.isEmpty(item.remittanceUnit)) {
+              this.$message.warning('收款明细中第 ' + (index + 1) + ' 条数据的 “汇款单位” 为空,请重新输入')
+              throw new Error()
+            }
+            if (this.commonJS.isEmpty(item.remittanceAmount) || item.remittanceAmount === 0 || item.remittanceAmount === '0') {
+              this.$message.warning('收款明细中第 ' + (index + 1) + ' 条数据的 “汇款金额” 为空,请重新输入')
+              throw new Error()
+            }
+            if (this.commonJS.isEmpty(item.remittanceDate)) {
+              this.$message.warning('收款明细中第 ' + (index + 1) + ' 条数据的 “汇款时间” 为空,请重新输入')
+              throw new Error()
+            }
+          })
+        }
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+            this.financeInvoiceService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.inputForm = {
+          id: '',
+          financeInvoiceBaseDTOList: [],
+          programName: '',
+          contractName: '',
+          programNo: '',
+          clientName: '',
+          reportNo: '',
+          type: '1',
+          no: '',
+          billingType: '1',
+          billingWorkplaceReal: '',
+          billingWorkplaceRealId: '',
+          taxpayerIdentificationNo: '',
+          address: '',
+          telPhone: '',
+          openBank: '',
+          bankAccount: '',
+          receivablesType: '2',
+          billingContent: '',
+          account: '',
+          billingContentTerms: '',
+          billingPeople: '',
+          billingPeopleId: '',
+          billingDate: '',
+          collectDate: '',
+          billingPeopleReal: '',
+          reconciliationPeople: '',
+          reconciliationArea: '',
+          remarks: '',
+          name: '',
+          workAttachmentDtoList: [],
+          financeInvoiceDetailDTOList: [],
+          financeInvoiceReceivablesDTOList: [],
+          financeInvoiceInvalidDTO: {}
+        }
+        this.bankList = []
+        this.detailFlag = false
+        this.visible = false
+      },
+      insertEvent (type) {
+        if (type === 'base') {
+          if (this.inputForm.financeInvoiceBaseDTOList.length >= 1) {
+            if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programId)) {
+              this.$message.warning('非项目,只能有一条非项目数据')
+              return
+            }
+          }
+          this.$refs.baseTable.insert().then((data) => {
+            this.inputForm.financeInvoiceBaseDTOList.push(data)
+          })
+        }
+        if (type === 'detail') {
+          this.$refs.detailTable.insert().then((data) => {
+            this.inputForm.financeInvoiceDetailDTOList.push(data)
+          })
+        }
+        if (type === 'receivables') {
+          this.$refs.receivablesTable.insert().then((data) => {
+            this.inputForm.financeInvoiceReceivablesDTOList.push(data)
+          })
+        }
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'base') {
+          this.$refs.baseTable.remove(row)
+          this.inputForm.financeInvoiceBaseDTOList.splice(rowIndex, 1)
+        }
+        if (type === 'detail') {
+          this.$refs.detailTable.remove(row)
+          this.inputForm.financeInvoiceDetailDTOList.splice(rowIndex, 1)
+        }
+        if (type === 'receivables') {
+          this.$refs.receivablesTable.remove(row)
+          this.inputForm.financeInvoiceReceivablesDTOList.splice(rowIndex, 1)
+        }
+      },
+      openProgramPageForm (rowIndex) {
+        if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programName) || this.inputForm.financeInvoiceBaseDTOList.length === 1) {
+          this.$refs.programPageForm.init()
+        } else {
+          if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programId)) {
+            this.$refs.programPageForm.init('s')
+          } else {
+            this.$refs.programPageForm.init(false)
+          }
+        }
+        this.programRow = rowIndex
+      },
+      getProgram (rows) {
+        rows.forEach((item, index) => {
+          if (index === 0) {
+            let r = this.inputForm.financeInvoiceBaseDTOList[this.programRow]
+            r.programName = item.name
+            r.contractName = item.contractName
+            r.programNo = item.no
+            r.clientName = item.clientName
+            r.client = item.client
+            r.programId = item.id
+            r.location = item.location // 项目所在地
+            this.inputForm.financeInvoiceBaseDTOList[this.programRow] = r
+          } else {
+            let r = {
+              programName: item.name,
+              contractName: item.contractName,
+              programNo: item.no,
+              clientName: item.clientName,
+              client: item.client,
+              programId: item.id,
+              location: item.location // 项目所在地
+            }
+            this.inputForm.financeInvoiceBaseDTOList.push(r)
+          }
+        })
+        this.$forceUpdate()
+        this.programRow = ''
+        this.inputForm.reconciliationArea = this.inputForm.financeInvoiceBaseDTOList[0].location
+      },
+      openContractForm () {
+        if (!this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0])) {
+          if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programId) && this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programName)) {
+            this.$message.warning('请先选择项目')
+          } else if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programId) && !this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[0].programName)) {
+            this.$refs.contractForm.init()
+          } else {
+            this.$message.warning('只有非项目开票可选择合同信息')
+          }
+        } else {
+          this.$message.warning('请选择项目信息')
+        }
+      },
+      getContract (row) {
+        this.inputForm.financeInvoiceBaseDTOList[0].contractName = row.name // 合同名称
+        this.inputForm.financeInvoiceBaseDTOList[0].client = row.clientId // 委托方
+        this.inputForm.financeInvoiceBaseDTOList[0].clientName = row.clientName // 委托方名称
+        this.$forceUpdate()
+      },
+      changeRadio () {
+        this.inputForm.address = ''
+        this.inputForm.telPhone = ''
+        this.inputForm.billingWorkplaceReal = ''
+        this.inputForm.billingWorkplaceRealId = ''
+        this.inputForm.taxpayerIdentificationNo = ''
+        this.bankList = []
+        this.inputForm.bankAccount = ''
+        this.inputForm.openBank = ''
+        this.inputForm.name = ''
+        this.$forceUpdate()
+      },
+      openWorkClientForm () {
+        this.$refs.workClientForm.init(null, '')
+      },
+      getWorkClient (row) {
+        this.inputForm.billingWorkplaceReal = row.name // 实际开票单位姓名
+        this.inputForm.billingWorkplaceRealId = row.id // 实际开票单位id ‘客户id’
+        this.inputForm.taxpayerIdentificationNo = row.uscCode // 纳税人识别号 ‘统一社会信用代码’
+        this.inputForm.address = row.registerAddress // 地址 ‘注册地址’
+        this.inputForm.telPhone = row.telephone // 电话
+        this.bankList = row.backs
+        this.inputForm.bankAccount = ''
+        this.inputForm.openBank = ''
+        this.$forceUpdate()
+      },
+      changeBank (value) {
+        this.bankList.forEach(item => {
+          if (item.id === value) {
+            this.inputForm.bankAccount = item.bankNumber
+          }
+        })
+      },
+      checkNumber (row, rowIndex) {
+        if (!this.commonJS.isEmpty(row.number)) {
+          if (parseInt(row.number) > 99999999) {
+            this.$message.warning('“发票号” 不可以大于 8 位,请重新输入')
+            row.number = undefined
+            return
+          }
+          this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
+            if (rowIndex !== index) {
+              if (row.number === item.number) {
+                row.number = ''
+                this.$message.warning('“发票号” 已存在,请重新输入')
+                throw new Error()
+              }
+            }
+          })
+          this.financeInvoiceService.queryByNumber(row.number, row.id).then(({data}) => {
+            if (data === true) {
+              row.number = ''
+              this.$message.warning('“发票号” 已存在,请重新输入')
+            }
+          })
+        }
+      },
+      checkAccount (row, rowIndex) {
+        if (this.commonJS.isEmpty(row.account)) {
+          row.account = undefined
+        }
+        this.getAmount(row)
+        this.getTax(row)
+      },
+      checkRate (row, rowIndex) {
+        if (!this.commonJS.isEmpty(row.rate)) {
+          if (parseFloat(row.rate) < 1 || parseFloat(row.rate) > 100) {
+            this.$message.warning('“税率” 请填写 1 到 100 之间的数字,请重新输入')
+            row.rate = undefined
+          }
+        }
+        this.getAmount(row)
+        this.getTax(row)
+      },
+      // 根据开票金额和税率计算出金额: 开票金额-税率*开票金额
+      getAmount (row) {
+        if (!this.commonJS.isEmpty(row.account) && !this.commonJS.isEmpty(row.rate)) {
+          row.amount = parseFloat((parseFloat(row.account) - parseFloat((parseFloat(row.account) * parseFloat((parseFloat(row.rate) / 100).toFixed(4))).toFixed(4))).toFixed(2))
+        } else {
+          row.amount = undefined
+        }
+      },
+      // 根据开票金额和税率计算出税额: 税率*开票金额
+      getTax (row) {
+        if (!this.commonJS.isEmpty(row.account) && !this.commonJS.isEmpty(row.rate)) {
+          row.tax = parseFloat((parseFloat(row.account) * parseFloat((parseFloat(row.rate) / 100).toFixed(4))).toFixed(2))
+        } else {
+          row.tax = undefined
+        }
+      },
+      // 下载模板
+      downloadTpl () {
+        this.loading = true
+        this.financeInvoiceService.exportTemplate().then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, '发票明细导入模板')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
+      async detailPush (data) {
+        if (this.commonJS.isNotEmpty(data)) {
+          await data.forEach(item => {
+            this.getAmount(item)
+            this.getTax(item)
+            this.inputForm.financeInvoiceDetailDTOList.push(item)
+          })
+        }
+        this.$message.success('导入完成')
+      },
+      beforeUploadDetail (file) {
+        const formBody = new FormData()
+        formBody.append('file', file.raw)
+        this.loading = true
+        this.financeInvoiceService.importDetail(formBody).then(async (result) => {
+          if (this.commonJS.isEmpty(result.data)) {
+            this.importVisible = false
+            this.loading = false
+            throw new Error()
+          }
+          for await (let item of result.data) {
+            this.inputForm.financeInvoiceDetailDTOList.forEach(detail => {
+              if (item.number === detail.number) {
+                this.$message.error('上传的文件中存在与页面重复的发票号,请重新填写后上传')
+                this.importVisible = false
+                this.loading = false
+                throw new Error()
+              }
+            })
+          }
+          await this.detailPush(result.data)
+          this.importVisible = false
+          this.loading = false
+        }).catch(() => {
+          this.importVisible = false
+          this.loading = false
+        })
+      },
+      checkIdentificationNo () {
+        if (this.commonJS.isEmpty(this.inputForm.taxpayerIdentificationNo)) {
+          this.$message.error('当前纳税人识别号为空,导入失败')
+          throw new Error()
+        }
+      },
+      async beforeUploadDetailCode (file) {
+        console.log('110', this.inputForm.taxpayerIdentificationNo)
+        await this.checkIdentificationNo()
+        const formBody = new FormData()
+        formBody.append('file', file.raw)
+        this.loading = true
+        this.financeInvoiceService.importDetail(formBody).then(async result => {
+          if (this.commonJS.isEmpty(result.data)) {
+            this.importVisible = false
+            this.loading = false
+            throw new Error()
+          }
+          for await (let item of result.data) {
+            await this.inputForm.financeInvoiceDetailDTOList.forEach(detail => {
+              if (item.number === detail.number) {
+                this.$message.error('上传的文件中存在与页面重复的发票号,请重新填写后上传')
+                this.importVisible = false
+                this.loading = false
+                throw new Error()
+              }
+            })
+          }
+          this.detailPushCode(result.data)
+          this.importVisible = false
+          this.loading = false
+        }).catch(() => {
+          this.importVisible = false
+          this.loading = false
+        })
+      },
+      detailPushCode (data) {
+        if (this.commonJS.isNotEmpty(data)) {
+          data.forEach(item => {
+            if (this.commonJS.isNotEmpty(item.taxpayerIdentificationNo)) {
+              if (item.taxpayerIdentificationNo === this.inputForm.taxpayerIdentificationNo) {
+                this.getAmount(item)
+                this.getTax(item)
+                this.inputForm.financeInvoiceDetailDTOList.push(item)
+              }
+            }
+          })
+        }
+        this.$message.success('导入完成')
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-input-number .el-input__inner {
+    text-align: left;
+  }
+</style>

+ 236 - 0
src/views/modules/cw/invoice/ProgramPageForm.vue

@@ -0,0 +1,236 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      @keyup.enter.native=""
+      :visible.sync="visible">
+      <div v-if="isShow">
+        <el-radio v-model="checkType" label="1" size="small" style="margin-right: 20px">项目</el-radio>
+        <el-radio v-model="checkType" label="2" size="small" style="margin-right: 20px">其他</el-radio>
+      </div>
+      <div v-if="checkType === '1'" style="height: calc(100% - 80px);">
+          <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
+            <!-- 搜索框-->
+            <el-form-item label="项目名称" prop="projectName">
+              <el-input size="small" v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
+            </el-form-item>
+            <el-form-item label="项目编号" prop="projectNumber">
+              <el-input size="small" v-model="searchForm.projectNumber" placeholder="请输入项目编号" clearable></el-input>
+            </el-form-item>
+            <el-form-item label="创建时间" prop="createDates">
+              <el-date-picker
+                placement="bottom-start"
+                format="yyyy-MM-dd HH:mm:ss"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                v-model="searchForm.createDates"
+                type="datetimerange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期">
+              </el-date-picker>
+            </el-form-item>
+
+            <el-form-item>
+              <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+              <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+            </el-form-item>
+          </el-form>
+
+          <vxe-table
+            border="inner"
+            auto-resize
+            resizable
+            height="400px"
+            :loading="loading"
+            size="small"
+            ref="projectTable"
+            show-header-overflow
+            show-overflow
+            highlight-hover-row
+            :menu-config="{}"
+            :print-config="{}"
+            @sort-change=""
+            :sort-config="{remote:true}"
+            :data="dataList"
+            :row-config="{isCurrent: true}"
+            :checkbox-config="{trigger: 'row'}"
+          >
+            <vxe-column type="seq" width="60" title="序号"></vxe-column>
+            <vxe-column type="checkbox" width="40px"></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-table>
+          <vxe-pager
+            background
+            size="small"
+            :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>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  export default {
+    data () {
+      return {
+        title: '项目选择',
+        method: '',
+        visible: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          name: '',
+          no: '',
+          createBy: '',
+          projectMasterName: '',
+          projectNumber: '',
+          projectName: '',
+          createDates: [],
+          status: ''
+        },
+        checkType: '',
+        detail: '',
+        isShow: true,
+        num: true // num为true是多选,false是单选
+      }
+    },
+    projectRecordsService: null,
+    created () {
+      this.projectRecordsService = new ProjectRecordsService()
+    },
+    components: {
+    },
+    methods: {
+      /**
+       * @param isShow
+       *      isShow为空,则可以选择“项目”或填写“其他”
+       *      isShow为false,则只可以选择“项目”,并且弹出提示
+       *      isShow为‘1’,则只可以选择“项目”,不弹出提示
+       *      isShow为其他任何值,则只可以填写“其他”
+       * @param num
+       *      num为空或者true,则允许多选
+       *      num为其他任何值,则只可以单选
+       */
+      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.list()
+      },
+      // 表单提交
+      getProgram () {
+        let rows
+        if (this.checkType === '1') {
+          if (this.commonJS.isEmpty(this.$refs.projectTable.getCheckboxRecords())) {
+            this.$message.error('请至少选择一条数据')
+            return
+          }
+          if (this.num === false) {
+            if (this.$refs.projectTable.getCheckboxRecords().length > 1) {
+              this.$message.error('最多选择一条数据')
+              return
+            }
+          }
+          rows = this.$refs.projectTable.getCheckboxRecords()
+        } else {
+          if (this.commonJS.isEmpty(this.detail)) {
+            this.$message.error('请填写开票详情')
+            return
+          }
+          rows = [{projectName: this.detail}]
+        }
+        this.close()
+        this.$emit('getProgram', rows)
+      },
+      list () {
+        this.loading = true
+        this.searchForm.status = '5'
+        this.projectRecordsService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.detail = ''
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style>
+  .messageZindex {
+    z-index:9999 !important;
+  }
+</style>

+ 222 - 0
src/views/modules/cw/invoice/WorkClientForm.vue

@@ -0,0 +1,222 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      @keyup.enter.native=""
+      :visible.sync="visible">
+      <div style="height: calc(100% - 80px);">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="list()" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="客户名称" prop="name">
+            <el-input size="small" v-model="searchForm.name" placeholder="请输入客户名称" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item label="创建时间" prop="createDates">
+            <el-date-picker
+              placement="bottom-start"
+              v-model="searchForm.createDates"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期">
+            </el-date-picker>
+          </el-form-item>
+
+          <el-form-item label="客户性质" prop="companyType">
+            <el-select v-model="searchForm.companyType" placeholder="请选择" style="width:100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('customer_nature')"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="客户行业" prop="companyIndustry">
+            <el-select v-model="searchForm.companyIndustry" placeholder="请选择" style="width:100%;">
+              <el-option
+                v-for="item in $dictUtils.getDictList('industry')"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="统一社会信用代码" prop="uscCode">
+            <el-input size="small" v-model="searchForm.uscCode" placeholder="请输入统一社会信用代码" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item label="创建人" prop="createBy">
+            <SelectUserTree
+              ref="companyTree"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+              :url="`/sys/user/treeUserDataAllOffice?type=2`"
+              :value="searchForm.createBy"
+              :clearable="true"
+              :accordion="true"
+              @getValue="(value) => {searchForm.createBy=value}"/>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="400px"
+          :loading="loading"
+          size="small"
+          ref="workClientTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="radio" width="40px"></vxe-column>
+
+          <vxe-column width="300px"  title="客户名称" field="name">
+          </vxe-column>
+<!--          <vxe-column width="200px"  title="代表方" field="deputy" ></vxe-column>-->
+          <vxe-column width="100px"  title="客户性质" field="companyType" >
+            <template slot-scope="scope">
+              {{ $dictUtils.getDictLabel("customer_nature", scope.row.companyType, '-') }}
+            </template>
+          </vxe-column>
+          <vxe-column width="100px"  title="客户行业" field="companyIndustry" >
+            <template slot-scope="scope">
+              {{ $dictUtils.getDictLabel("industry", scope.row.companyIndustry, '-') }}
+            </template>
+          </vxe-column>
+          <vxe-column width="200px" title="统一社会信用代码" field="uscCode" > </vxe-column>
+          <vxe-column width="100px" title="创建人" field="createBy" > </vxe-column>
+          <vxe-column width="150px" title="创建时间" field="createDate" > </vxe-column>
+        </vxe-table>
+
+        <vxe-pager
+          background
+          size="small"
+          :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>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getWorkClient()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import WorkClientService from '@/api/sys/WorkClientService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          name: '',
+          areaId: '',
+          createDates: [],
+          companyType: '',
+          companyIndustry: '',
+          clientType: '',
+          uscCode: '',
+          createBy: '',
+          deputy: ''
+        },
+        rowId: '',
+        deputy: ''
+      }
+    },
+    workClientService: null,
+    created () {
+      this.workClientService = new WorkClientService()
+    },
+    components: {
+      SelectUserTree,
+      SelectTree
+    },
+    methods: {
+      init (id, deputy) {
+        // if (!this.commonJS.isEmpty(id)) {
+        //   this.$refs.workContractTable.setCurrentRow(id)
+        // }
+        this.deputy = deputy
+        this.visible = true
+        this.list()
+      },
+      // 表单提交
+      getWorkClient () {
+        let row = this.$refs.workClientTable.getRadioRecord()
+        if (this.commonJS.isEmpty(row)) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        this.close()
+        this.$emit('getWorkClient', row, this.deputy)
+      },
+      list () {
+        this.loading = true
+        this.workClientService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.visible = false
+      }
+    }
+  }
+</script>

+ 1 - 1
src/views/modules/cw/workClientInfo/WorkClientListForm.vue

@@ -11,7 +11,7 @@
       @keyup.enter.native="getWorkClient"
       :visible.sync="visible">
       <div style="height: calc(100%);">
-        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
           <!-- 搜索框-->
           <el-form-item label="客户姓名" prop="name">
             <el-input size="small" v-model="searchForm.name" placeholder="请输入客户姓名" clearable></el-input>