Ver código fonte

Merge remote-tracking branch 'origin/master'

lizhenhao 2 anos atrás
pai
commit
d28a9901e0

+ 68 - 0
src/api/cw/reimbursementApproval/ReimbursementApprovalService.js

@@ -0,0 +1,68 @@
+import request from '@/utils/httpRequest'
+
+export default class ReimbursementApprovalService {
+  list (param) {
+    return request({
+      url: '/reimbursementApproval/info/list',
+      method: 'get',
+      params: param
+    })
+  }
+  projectList (params) {
+    return request({
+      url: '/reimbursementApproval/info/projectList',
+      method: 'get',
+      params: params
+    })
+  }
+  save (param) {
+    return request({
+      url: '/reimbursementApproval/info/save',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/reimbursementApproval/info/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  remove (id) {
+    return request({
+      url: '/reimbursementApproval/info/remove',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  updateStatusById (param) {
+    return request({
+      url: '/reimbursementApproval/info/updateStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  checkNumber (number) {
+    return request({
+      url: '/reimbursementApproval/info/checkNumber',
+      method: 'get',
+      params: {number: number}
+    })
+  }
+  userTree (name) {
+    return request({
+      url: '/reimbursementApproval/info/userTree',
+      method: 'get',
+      params: {name: name}
+    })
+  }
+  exportFile (params) {
+    return request({
+      url: '/reimbursementApproval/info/exportFile',
+      method: 'get',
+      params: params,
+      responseType: 'blob'
+    })
+  }
+}

+ 32 - 0
src/api/cw/reimbursementApproval/ReimbursementApprovalTypeService.js

@@ -0,0 +1,32 @@
+import request from '@/utils/httpRequest'
+
+export default class ReimbursementApprovalTypeService {
+  list (param) {
+    return request({
+      url: '/reimbursementApproval/type/list',
+      method: 'get',
+      params: param
+    })
+  }
+  save (param) {
+    return request({
+      url: '/reimbursementApproval/type/save',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/reimbursementApproval/type/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  remove (id) {
+    return request({
+      url: '/reimbursementApproval/type/deleteById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 60 - 0
src/api/cw/workContract/CwWorkContractBorrowService.js

@@ -0,0 +1,60 @@
+import request from '@/utils/httpRequest'
+
+export default class WorkContractService {
+  save (param) {
+    return request({
+      url: '/contract/workContractBorrow/save',
+      method: 'post',
+      data: param
+    })
+  }
+  updateStatusById (param) {
+    return request({
+      url: '/contract/workContractBorrow/updateStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  updateStatusByContractInfoId (param) {
+    return request({
+      url: '/contract/workContractBorrow/updateStatusByContractInfoId',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/contract/workContractBorrow/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  findByContractInfoId (id) {
+    return request({
+      url: '/contract/workContractBorrow/findByContractInfoId',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  updateMessageStatusById (param) {
+    return request({
+      url: '/contract/workContractBorrow/updateMessageStatusById',
+      method: 'post',
+      data: param
+    })
+  }
+  deleteById (id) {
+    return request({
+      url: '/contract/workContractBorrow/deleteById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  findMessageList (id) {
+    return request({
+      url: '/contract/workContractBorrow/findMessageList',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 221 - 0
src/views/modules/cw/reimbursementApproval/info/CwProgramPageForm.vue

@@ -0,0 +1,221 @@
+<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 style="height: calc(100% - 80px);" v-if="checkType === '1'">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @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="no">
+            <el-input size="small" v-model="searchForm.no" placeholder="请输入项目编号" clearable></el-input>
+          </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="programTable"
+          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="checkbox" width="40px"></vxe-column>
+
+          <vxe-column  title="项目名称" field="name"></vxe-column>
+          <vxe-column width="200px" title="项目编号" field="no"></vxe-column>
+<!--          <vxe-column width="150px" title="报告号" field="clientName"></vxe-column>-->
+          <vxe-column width="150px" title="登记人" field="createBy"></vxe-column>
+<!--          <vxe-column width="150px" title="责任人" field="createDate"></vxe-column>-->
+          <vxe-column width="100px" title="委托方" field="clientName"></vxe-column>
+          <vxe-column width="100px" title="是否开票" field="isInvoice"></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 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: {
+          name: '',
+          no: '',
+          createBy: ''
+        },
+        checkType: '',
+        detail: '',
+        isShow: true,
+        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.list()
+      },
+      // 表单提交
+      getProgram () {
+        let rows
+        if (this.checkType === '1') {
+          if (this.commonJS.isEmpty(this.$refs.programTable.getCheckboxRecords())) {
+            this.$message.error('请至少选择一条数据')
+            return
+          }
+          if (this.num === false) {
+            if (this.$refs.programTable.getCheckboxRecords().length > 1) {
+              this.$message.error('最多选择一条数据')
+              return
+            }
+          }
+          rows = this.$refs.programTable.getCheckboxRecords()
+        } else {
+          if (this.commonJS.isEmpty(this.detail)) {
+            this.$message.error('请填写开票详情')
+            return
+          }
+          rows = [{name: this.detail}]
+        }
+        this.close()
+        this.$emit('getProgram', rows)
+      },
+      list () {
+        this.loading = true
+        this.reimbursementApprovalService.projectList({
+          '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
+        })
+        // this.programProjectListInfoService.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>

+ 136 - 0
src/views/modules/cw/reimbursementApproval/info/CwReimbursementTypePullForm.vue

@@ -0,0 +1,136 @@
+<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" @keyup.enter.native="refreshList()" @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>
+            <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="500px"
+          :loading="loading"
+          size="small"
+          ref="typeTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId'}"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+          <vxe-column title="报销内容名称" field="name" align="left" tree-node></vxe-column>
+          <vxe-column width="100" title="序号" field="sort"></vxe-column>
+        </vxe-table>
+      </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="getProgramForType" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+  import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          name: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        title: '',
+        method: '',
+        visible: false,
+        loading: false
+      }
+    },
+    // reimbursementTypeService: null,
+    reimbursementApprovalTypeService: null,
+    created () {
+      // this.reimbursementTypeService = new ReimbursementTypeService()
+      this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+    },
+    components: {
+    },
+    methods: {
+      init () {
+        this.visible = true
+        this.list()
+      },
+      // 表单提交
+      getProgramForType () {
+        let rows
+        if (this.commonJS.isEmpty(this.$refs.typeTable.getCheckboxRecords()) || this.$refs.typeTable.getCheckboxRecords().length > 1) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        rows = this.$refs.typeTable.getCheckboxRecords()
+        if (rows[0].level !== '3' && rows[0].id !== '3') {
+          this.$message.error('请选择子集数据')
+          return
+        }
+        this.$emit('getProgramForType', rows)
+        this.close()
+      },
+      list () {
+        this.loading = true
+        this.reimbursementApprovalTypeService.list({...this.searchForm}).then(({data}) => {
+          this.dataList = data
+          this.loading = false
+        })
+        // this.reimbursementTypeService.list({...this.searchForm}).then(({data}) => {
+        //   this.dataList = data
+        //   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>

+ 325 - 0
src/views/modules/cw/reimbursementApproval/info/InfoForm.vue

@@ -0,0 +1,325 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1200px"
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="100px" @submit.native.prevent>
+
+        <el-divider content-position="left"><i class="el-icon-document"></i> 基础信息</el-divider>
+        <el-row :gutter="26">
+          <el-col :span="12">
+            <el-form-item label="经办人" prop="userName">
+              <el-input v-model="inputForm.userName" :disabled="true"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="报销编号" prop="no">
+              <el-input v-model="inputForm.no" :disabled="true"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="所属部门" prop="department">
+              <el-input v-model="inputForm.department" :disabled="true"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="报销日期" prop="reimDate">
+              <el-date-picker
+                v-model="inputForm.reimDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                style="width: 100%"
+                placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remarks">
+              <el-input v-model="inputForm.remarks"
+                        type="textarea"
+                        :rows="5"
+                        maxlength="500"
+                        placeholder="请输入简介"
+                        show-word-limit>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-divider content-position="left"><i class="el-icon-document"></i>
+          报销详情
+          <el-button style="margin-left: 20px" type="primary" :disabled="method==='view'" size="mini" @click="insertEvent('detail')" plain>
+            新增
+          </el-button>
+        </el-divider>
+        <el-row  :gutter="15" >
+          <vxe-table
+            border
+            show-overflow
+            ref="detailTable"
+            class="vxe-table-element"
+            :data="inputForm.detailInfos"
+            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="userName" title="报销人" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.userName" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="deptName" title="报销部门" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.deptName" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="typeName" title="报销类型" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.typeName" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="projectName" title="报销项目" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.projectName" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="reportNumber" title="报告号" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.reportNumber" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="number" title="费用(元)" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.number" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="receiptNumber" title="收据张数" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.receiptNumber" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="days" title="出差天数" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.days" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="content" title="内容" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.content" ></el-input>
+              </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,'detail')">删除</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-row>
+
+        <el-divider content-position="left"><i class="el-icon-document"></i>
+          专用发票信息
+          <el-button style="margin-left: 20px" type="primary" :disabled="method==='view'" size="mini" @click="insertEvent('amount')" plain>
+            新增
+          </el-button>
+        </el-divider>
+        <el-row  :gutter="15" >
+          <vxe-table
+            border
+            show-overflow
+            ref="amountTable"
+            class="vxe-table-element"
+            :data="inputForm.amountInfos"
+            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="code" title="发票代码" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.code" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="number" title="发票号" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.number" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="amount" title="金额" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.amount" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="taxAmount" title="税额" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.taxAmount" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="count" title="价税合计" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.count" ></el-input>
+              </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,'amount')">删除</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-row>
+
+        <!-- 附件 -->
+        <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+      </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'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  // import ReimbursementService from '@/api/sys/ReimbursementService'
+  import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          userName: '',
+          no: '',
+          department: '',
+          reimDate: '',
+          remarks: '',
+          detailInfos: [],
+          amountInfos: [],
+          files: [] // 附件信息
+        }
+      }
+    },
+    // reimbursementService: null,
+    reimbursementApprovalService: null,
+    created () {
+      // this.reimbursementService = new ReimbursementService()
+      this.reimbursementApprovalService = new ReimbursementApprovalService()
+    },
+    components: {
+      UpLoadComponent
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          userName: '',
+          no: '',
+          department: '',
+          reimDate: '',
+          remarks: '',
+          detailInfos: [],
+          amountInfos: [],
+          files: [] // 附件信息
+        }
+        if (method === 'add') {
+          this.title = `新建报销类型`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改报销类型'
+        } else if (method === 'view') {
+          this.inputForm.id = id
+          this.title = '查看报销类型'
+        } else if (method === 'addChild') {
+          this.title = '添加下级结构'
+          this.inputForm.parentId = id
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.$refs.inputForm.resetFields()
+            this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+            // this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
+            //   this.inputForm = this.recover(this.inputForm, data)
+            //   this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+            //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.reimbursementApprovalTypeService.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.detailInfos = []
+        this.inputForm.amountInfos = []
+        this.$refs.uploadComponent.clearUpload()
+        this.visible = false
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'detail') {
+          this.$refs.detailTable.remove(row)
+          this.inputForm.detailInfos.splice(rowIndex, 1)
+        }
+        if (type === 'amount') {
+          this.$refs.amountTable.remove(row)
+          this.inputForm.amountInfos.splice(rowIndex, 1)
+        }
+      },
+      // 新增
+      async insertEvent (type) {
+        if (type === 'detail') {
+          await this.$refs.detailTable.insert().then((data) => {
+            this.inputForm.detailInfos.push(data)
+          })
+        }
+        if (type === 'amount') {
+          await this.$refs.amountTable.insert().then((data) => {
+            this.inputForm.amountInfos.push(data)
+          })
+        }
+      }
+    }
+  }
+</script>

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

@@ -0,0 +1,465 @@
+<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-form-item label="报销项目" prop="project">
+        <el-input size="small" v-model="searchForm.project" placeholder="请输入报销项目" clearable>
+          <el-button icon="el-icon-search" slot="append" @click="openProgramPageForm"></el-button>
+        </el-input>
+      </el-form-item>
+      <el-form-item label="报销时间" prop="dates">
+        <el-date-picker
+          style=""
+          placement="bottom-start"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          v-model="searchForm.dates"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="经办人" prop="handled">
+        <UserSelect :limit='1' :userName="searchForm.handled" @getValue='(value, label) => {searchForm.handled = label}'></UserSelect>
+      </el-form-item>
+      <el-form-item label="报销人" prop="remiBy">
+        <UserSelect :limit='1' :userName="searchForm.remiBy" @getValue='(value, label) => {searchForm.remiBy = label}'></UserSelect>
+      </el-form-item>
+      <el-form-item label="报销状态" prop="type">
+        <el-select v-model="searchForm.type" placeholder="请选择" style="width:100%;">
+          <el-option
+            v-for="item in $dictUtils.getDictList('status')"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="报销部门" prop="department">
+        <SelectTree
+          ref="officeTree"
+          :props="{
+                value: 'id',             // ID字段名
+                label: 'name',         // 显示名称
+                children: 'children'    // 子级字段名
+              }"
+          :url="`/sys/office/treeData?type=2`"
+          :value="searchForm.department"
+          :clearable="true"
+          :accordion="true"
+          @getValue="(value,label) => {searchForm.department=label}"/>
+      </el-form-item>
+      <el-form-item label="报销类别" prop="remiType">
+        <SelectTree
+          ref="areaTree"
+          :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+          url="/reimbursementApproval/type/treeData?type=12"
+          :value="searchForm.remiType"
+          :clearable="true"
+          :accordion="true"
+          @getValue="(value, label) => {searchForm.remiType=label}"/>
+      </el-form-item>
+      <el-form-item label="报销金额" prop="amounts">
+        <InputNumber :disabled="false" :precision="num" v-model="searchForm.amounts"></InputNumber>
+      </el-form-item>
+      <el-form-item label="报告号" prop="reportNumber">
+        <el-input size="small" v-model="searchForm.reportNumber" placeholder="请输入报告号" clearable></el-input>
+      </el-form-item>
+
+      <el-form-item>
+        <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-form>
+
+    <div class="bg-white top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+          <el-button v-if="hasPermission('reimbursement:info:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
+          <el-button v-if="hasPermission('reimbursement:info:del')" type="danger" size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.infoTable && $refs.infoTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+          <el-button v-if="hasPermission('sys:project:exportFile')"  type="warning" plain @click="exportFile()" size="small">导出</el-button>
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 50px)">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="infoTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :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 width="200" title="报销编号" field="no" align="left">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('reimbursement:info:view')" @click="view(scope.row.id)">{{scope.row.no}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('reimbursement:info:view')" @click="view(scope.row.id)">{{scope.row.no}}</el-link>
+              <span v-else>{{scope.row.no}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column width="200" title="报销类别" field="typeName"></vxe-column>
+          <vxe-column width="200" title="报销项目" field="projectName">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('reimbursement:info:view') && scope.row.projectId != undefined" @click="viewProject(scope.row.projectId)">{{scope.row.projectName}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('reimbursement:info:view') && scope.row.projectId != undefined" @click="viewProject(scope.row.projectId)">{{scope.row.projectName}}</el-link>
+              <span v-else>{{scope.row.projectName}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column width="200" title="报告号" field="reportNumber"></vxe-column>
+          <vxe-column width="100" title="经办人" field="userName"></vxe-column>
+          <vxe-column width="100" title="报销人" field="name"></vxe-column>
+          <vxe-column width="200" title="报销部门" field="deptName"></vxe-column>
+          <vxe-column width="100" title="报销日期" field="reimDate"></vxe-column>
+          <vxe-column width="100" title="报销金额" field="number"></vxe-column>
+          <vxe-column width="100" title="状态" field="type">
+            <template slot-scope="scope">
+              <el-button type="text" @click="detail(scope.row)" :type="$dictUtils.getDictLabel('status_info', scope.row.type, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("status", scope.row.type, '未开始')}} </el-button>
+            </template>
+          </vxe-column>
+
+          <vxe-column title="操作" width="230px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('reimbursement:info:edit') && (scope.row.type === '1' || scope.row.type === '3' || scope.row.type === '4')" type="text"  size="small" @click="edit(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('reimbursement:info:edit') && (scope.row.type === '2')" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('reimbursement:info:del') && (scope.row.type === '1')" 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>
+
+        <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>
+        <InfoForm ref="infoForm" @refreshDataList="refreshList"></InfoForm>
+        <ProjectForm ref="projectForm" @refreshDataList="refreshList"></ProjectForm>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  // import ReimbursementService from '@/api/sys/ReimbursementService'
+  import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
+  import InputNumber from '@/views/modules/sys/workContract/InputNumber.vue'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import UserSelect from '@/components/userSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import ProgramPageForm from '@/views/modules/finance/invoice/ProgramPageForm'
+  import InfoForm from './InfoForm'
+  import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  import pick from 'lodash.pick'
+  import ProjectForm from '@/views/modules/program/registered/ProjectForm'
+  export default {
+    data () {
+      return {
+        num: 0,
+        visable: false,
+        gridData: [],
+        searchForm: {
+          project: '',
+          dates: [],
+          handled: '',
+          remiBy: '',
+          type: [],
+          department: '',
+          remiType: '',
+          amounts: [],
+          reportNumber: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false
+      }
+    },
+    // reimbursementService: null,
+    reimbursementApprovalService: null,
+    taskService: null,
+    processService: null,
+    created () {
+      // this.reimbursementService = new ReimbursementService()
+      this.reimbursementApprovalService = new ReimbursementApprovalService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+    },
+    components: {
+      InputNumber,
+      SelectUserTree,
+      SelectTree,
+      ProgramPageForm,
+      InfoForm,
+      ProjectForm,
+      UserSelect
+    },
+    mounted () {
+      this.refreshList()
+    },
+    activated () {
+      this.refreshList()
+    },
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      },
+      user () {
+        this.create = JSON.parse(localStorage.getItem('user')).id
+        console.log('createId', this.create)
+        return JSON.parse(localStorage.getItem('user'))
+      }
+    },
+    methods: {
+      // 新增
+      add () {
+        // 读取流程表单
+        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/reimbursementApproval/info/InfoList'
+              }
+            })
+          })
+      },
+      // 修改
+      edit (row) {
+        // 暂存修改
+        let status = ''
+        if (row.type === '1') {
+          status = 'startAndHold'
+        }
+        // 撤回或者驳回修改
+        if (row.type === '3' || row.type === '4') {
+          status = 'startAndClose'
+        }
+        // 读取流程表单
+        let tabTitle = `发起流程【财务-报销审批】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [财务-报销审批]`
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
+          businessId: row.id,
+          businessTable: 'cw_reimbursement_info',
+          status: status
+        }).then((data) => {
+          this.$router.push({
+            path: '/flowable/task/TaskForm',
+            query: {
+              procDefId: this.processDefinitionId,
+              procDefKey: this.procDefKey,
+              status: status,
+              title: tabTitle,
+              formType: data.data.formType,
+              formUrl: data.data.formUrl,
+              formTitle: processTitle,
+              businessTable: 'cw_reimbursement_info',
+              businessId: row.id,
+              isShow: false,
+              routePath: '/cw/reimbursementApproval/info/InfoList'
+            }
+          })
+        })
+      },
+      // 撤回
+      reback (row) {
+        this.$confirm(`确定撤回流程吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          taskId: row.procInsId,
+          type: 'warning'
+        }).then(() => {
+          this.taskService.backNodes(row.taskId).then(({data}) => {
+            let backNodes = data
+            if (backNodes.length > 0) {
+              let backTaskDefKey = backNodes[0].taskDefKey
+              this.taskService.back({
+                taskId: row.taskId,
+                backTaskDefKey: backTaskDefKey,
+                isShow: false,
+                ...this.auditForm
+              }).then(({data}) => {
+                row.type = '3'
+                console.log('type', row)
+                // this.reimbursementService.updateStatusById(row)
+                this.reimbursementApprovalService.updateStatusById(row)
+                this.$message.success('回退成功')
+                this.refreshList()
+              })
+            }
+          })
+        })
+      },
+      // 查看
+      view (id) {
+        this.$refs.infoForm.init('view', id)
+      },
+      // 查看报销项目
+      viewProject (id) {
+        this.$refs.projectForm.init('view', id)
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.reimbursementApprovalService.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
+        })
+        // this.reimbursementService.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
+        // })
+        this.processService.getByName('财务-报销审批').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionId = data.id
+            this.procDefKey = data.key
+          }
+        })
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.infoTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.reimbursementApprovalService.remove(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+          // this.reimbursementService.remove(ids).then(({data}) => {
+          //   this.$message.success(data)
+          //   this.refreshList()
+          //   this.loading = false
+          // })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      // 流程详情
+      detail (row) {
+        if (!this.commonJS.isEmpty(row.type) && row.type !== '1') {
+          this.taskService.getTaskDef({
+            procInsId: row.procInsId,
+            procDefId: row.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', 'status', 'title', 'businessId')}
+            })
+          })
+        }
+      },
+      openProgramPageForm (rowIndex) {
+        // 打开单选组件
+        this.$refs.programPageForm.init(null, false)
+      },
+      getProgram (rows) {
+        // rows[0].name // 项目名称、开票详情
+        // rows[0].contractName // 合同名称
+        // rows[0].no // 项目编号
+        // rows[0].clientName // 客户名称
+        // rows[0].client // 客户id
+        // rows[0].id // 项目id
+        // rows[0].location // 项目所在地
+        this.searchForm.project = rows[0].name
+      },
+      // 下载文档
+      exportFile () {
+        this.loading = true
+        this.reimbursementApprovalService.exportFile({
+          'itemType': '1',
+          ...this.searchForm
+        }).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, '财务-报销审批列表信息')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+        // this.reimbursementService.exportFile({
+        //   'itemType': '1',
+        //   ...this.searchForm
+        // }).then((res) => {
+        //   // 将二进制流文件写入excel表,以下为重要步骤
+        //   this.$utils.downloadExcel(res.data, '财务-报销审批列表信息')
+        //   this.loading = false
+        // }).catch(function (err) {
+        //   this.loading = false
+        //   if (err.response) {
+        //     console.log(err.response)
+        //   }
+        // })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      }
+    }
+  }
+</script>

+ 670 - 0
src/views/modules/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -0,0 +1,670 @@
+<template>
+  <div>
+    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="formReadOnly"
+             label-width="100px" @submit.native.prevent>
+
+      <el-divider content-position="left"><i class="el-icon-document"></i> 基础信息</el-divider>
+      <el-row :gutter="26">
+        <el-col :span="12">
+          <el-form-item label="经办人" prop="userName">
+            <el-input v-model="inputForm.userName" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="报销编号" prop="no">
+            <el-input v-model="inputForm.no" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="所属部门" prop="department">
+            <el-input v-model="inputForm.department" :disabled="true"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="报销日期" prop="reimDate" :rules="[{required: true, message:'请选择报销日期', trigger:'blur'}]">
+            <el-date-picker
+              v-model="inputForm.reimDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width: 100%"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="备注" prop="remarks">
+            <el-input v-model="inputForm.remarks"
+                      type="textarea"
+                      :rows="5"
+                      maxlength="500"
+                      placeholder="请输入简介"
+                      show-word-limit>
+            </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-divider content-position="left"><i class="el-icon-document"></i>
+        报销详情
+        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view' || this.formReadOnly" size="mini" @click="insertEvent('detail')" plain>
+          新增
+        </el-button>
+      </el-divider>
+      <el-row  :gutter="15" >
+        <vxe-table
+          border
+          show-footer
+          show-overflow
+          :footer-method="footerMethod"
+          ref="detailTable"
+          class="vxe-table-element"
+          :data="inputForm.detailInfos"
+          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="userName" title="报销人" :edit-render="{}" :rules="[{required: true, message:'请选择报销人', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.userName" @focus="userPullListForm(scope.$rowIndex)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="deptName" title="报销部门" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input :disabled='true' v-model="scope.row.deptName" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="typeName" title="报销类型" :edit-render="{}" :rules="[{required: true, message:'请选择报销类型', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.typeName" @focus="typePullForm(scope.$rowIndex)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="projectName" title="报销项目" :edit-render="{}" :rules="[{required: true, message:'请选择报销项目', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.projectName" @focus="openProgramPageForm(scope.$rowIndex, scope.row)"></el-input>
+            </template>
+          </vxe-table-column>
+<!--          <vxe-table-column field="reportNumber" title="报告号" :edit-render="{}">-->
+<!--            <template v-slot:edit="scope">-->
+<!--              <el-input :disabled="true" v-model="scope.row.reportNumber" ></el-input>-->
+<!--            </template>-->
+<!--          </vxe-table-column>-->
+          <vxe-table-column field="number" title="费用(元)" :edit-render="{}" :rules="[{required: true, message:'请输入费用', trigger:'blur'}]">
+            <template v-slot:edit="scope">
+              <el-input maxlength="15" v-model="scope.row.number" @keyup.native="scope.row.number = twoDecimalPlaces(scope.row.number)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="receiptNumber" title="收据张数" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.receiptNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="days" title="出差天数" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.days" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="content" title="内容" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input v-model="scope.row.content" ></el-input>
+            </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,'detail')">删除</el-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+      </el-row>
+
+      <el-divider content-position="left"><i class="el-icon-document"></i>
+        专用发票信息
+        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view' || this.formReadOnly " size="mini" @click="insertEvent('amount')" plain>
+          新增
+        </el-button>
+      </el-divider>
+      <el-row  :gutter="15" >
+        <vxe-table
+          border
+          show-overflow
+          ref="amountTable"
+          class="vxe-table-element"
+          :data="inputForm.amountInfos"
+          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="code" title="发票代码" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10" v-model="scope.row.code" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="number" title="发票号" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input oninput ="value=value.replace(/\D|^0/g,'')" maxlength="8" @change="isExict(scope.row)" v-model="scope.row.number" ></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="amount" title="金额" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input maxlength="15" v-model="scope.row.amount" @keyup.native="scope.row.amount = twoDecimalPlaces(scope.row.amount)" @change="countAmount(scope.row)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="taxAmount" title="税额" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input maxlength="15" v-model="scope.row.taxAmount" @keyup.native="scope.row.taxAmount = twoDecimalPlaces(scope.row.taxAmount)" @change="countAmount(scope.row)"></el-input>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="count" title="价税合计" :edit-render="{}">
+            <template v-slot:edit="scope">
+              <el-input disabled="true" v-model="scope.row.count" ></el-input>
+            </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,'amount')">删除</el-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+      </el-row>
+
+      <!-- 附件 -->
+      <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+<!--      <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>-->
+      <CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
+<!--      <ReimbursementTypePullForm ref="reimbursementTypePullForm" @getProgramForType="getProgramForType"></ReimbursementTypePullForm>-->
+      <CwReimbursementTypePullForm ref="cwReimbursementTypePullForm" @getProgramForType="getProgramForType"></CwReimbursementTypePullForm>
+      <UserPullForm ref="userPullForm" @getProgramForUser="getProgramForUser"></UserPullForm>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  // import ReimbursementService from '@/api/sys/ReimbursementService'
+  import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
+  // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+  import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import XEUtils from 'xe-utils'
+  import UserService from '@/api/sys/UserService'
+  // import ProgramPageForm from '@/views/modules/finance/invoice/ProgramPageForm'
+  import CwProgramPageForm from './CwProgramPageForm'
+  // import ReimbursementTypePullForm from '@/views/modules/finance/invoice/ReimbursementTypePullForm'
+  import CwReimbursementTypePullForm from './CwReimbursementTypePullForm'
+  import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        indexRow: '',
+        inputForm: {
+          userId: '',
+          userName: '',
+          no: '',
+          department: '',
+          reimDate: '',
+          remarks: '',
+          detailInfos: [],
+          amountInfos: [],
+          files: [] // 附件信息
+        }
+      }
+    },
+    ReimbursementApprovalService: null,
+    // reimbursementService: null,
+    // reimbursementTypeService: null,
+    reimbursementApprovalTypeService: null,
+    userService: null,
+    created () {
+      this.reimbursementApprovalService = new ReimbursementApprovalService()
+      // this.reimbursementService = new ReimbursementService()
+      this.inputForm.userId = this.userId
+      this.inputForm.userName = this.name
+      this.inputForm.reimDate = new Date()
+      this.inputForm.department = this.officeName
+      this.userService = new UserService()
+      // this.reimbursementTypeService = new ReimbursementTypeService()
+      this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      }
+    },
+    components: {
+      UpLoadComponent,
+      SelectUserTree,
+      SelectTree,
+      // ProgramPageForm,
+      CwProgramPageForm,
+      // ReimbursementTypePullForm,
+      CwReimbursementTypePullForm,
+      UserPullForm
+    },
+    computed: {
+      name () {
+        return JSON.parse(localStorage.getItem('user')).name
+      },
+      officeName () {
+        return JSON.parse(localStorage.getItem('user')).officeDTO.name
+      },
+      userId () {
+        return JSON.parse(localStorage.getItem('user')).id
+      }
+    },
+    watch: {
+      'businessId': {
+        handler (newVal) {
+          console.log('aaaaaaaaaaaaaaaaaaaaaaaaaa', this.businessId)
+          if (this.businessId && this.businessId !== 'false') {
+            this.init('edit', this.businessId)
+          } else {
+            this.init('clean', '')
+          }
+        },
+        immediate: true,
+        deep: false
+      }
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          userName: '',
+          no: '',
+          department: '',
+          reimDate: '',
+          remarks: '',
+          detailInfos: [],
+          amountInfos: [],
+          files: [] // 附件信息
+        }
+        if (method === 'add') {
+          this.title = `新建报销类型`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改报销类型'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (this.formReadOnly === true && this.businessId !== 'false') {
+            method = 'view'
+          }
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.$refs.inputForm.resetFields()
+            this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+            // this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
+            //   this.inputForm = this.recover(this.inputForm, data)
+            //   this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
+            //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            //   this.loading = false
+            // })
+          }
+          if (method !== 'edit' && method !== 'view') {
+            this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            this.inputForm.id = this.businessId
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+            // this.reimbursementService.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.detailInfos = []
+        this.inputForm.amountInfos = []
+        this.$refs.uploadComponent.clearUpload()
+        this.visible = false
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'detail') {
+          this.$refs.detailTable.remove(row)
+          this.inputForm.detailInfos.splice(rowIndex, 1)
+        }
+        if (type === 'amount') {
+          this.$refs.amountTable.remove(row)
+          this.inputForm.amountInfos.splice(rowIndex, 1)
+        }
+      },
+      // 新增
+      async insertEvent (type) {
+        if (type === 'detail') {
+          await this.$refs.detailTable.insert().then((data) => {
+            data.userName = this.name
+            data.deptName = this.officeName
+            this.inputForm.detailInfos.push(data)
+          })
+        }
+        if (type === 'amount') {
+          await this.$refs.amountTable.insert().then((data) => {
+            this.inputForm.amountInfos.push(data)
+          })
+        }
+      },
+      // 暂存
+      async saveForm (callback) {
+        this.loading = true
+        if (this.$refs.uploadComponent.checkProgress()) {
+          this.loading = false
+          return
+        }
+        if (this.commonJS.isEmpty(this.inputForm.files)) {
+          this.inputForm.files = []
+        }
+        this.inputForm.files = this.$refs.uploadComponent.getDataList()
+        this.inputForm.type = '1'
+        this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+          callback()
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        }).catch(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        })
+        // this.reimbursementService.save(this.inputForm).then(({data}) => {
+        //   callback()
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // }).catch(() => {
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // })
+      },
+      // 送审
+      async startForm (callback) {
+        this.$refs['inputForm'].validate(async (valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            if (this.commonJS.isEmpty(this.inputForm.detailInfos)) {
+              this.$message.error('至少填写一条报销详情信息')
+              this.loading = false
+              return
+            } else {
+              let i = this.inputForm.detailInfos.length
+              for (let j = 0; j < i; j++) {
+                let k = j + 1
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].userName)) {
+                  this.$message.error('报销详情第' + k + '行请选择报销人')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].typeName)) {
+                  this.$message.error('报销详情第' + k + '行请选择报销类型')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].projectName)) {
+                  this.$message.error('报销详情第' + k + '行请选择报销项目')
+                  this.loading = false
+                  return
+                }
+                if (this.commonJS.isEmpty(this.inputForm.detailInfos[j].number)) {
+                  this.$message.error('报销详情第' + k + '行请输入费用')
+                  this.loading = false
+                  return
+                }
+              }
+            }
+            // if (this.commonJS.isEmpty(this.inputForm.amountInfos)) {
+            //   this.$message.error('至少填写一条专用发票信息')
+            //   this.loading = false
+            //   return
+            // }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.inputForm.type = '2'
+            this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            }).catch(() => {
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            })
+            // this.reimbursementService.save(this.inputForm).then(({data}) => {
+            //   callback(data.businessTable, data.businessId, this.inputForm)
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 通过
+      async agreeForm (callback) {
+        this.$refs['inputForm'].validate(async (valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            await this.userService.is().then(({data}) => {
+              if (data) {
+                this.inputForm.type = '5'
+              }
+            })
+            this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+            // this.reimbursementService.save(this.inputForm).then(({data}) => {
+            //   callback(data.businessTable, data.businessId, this.inputForm)
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 修改状态
+      updateStatusById (type) {
+        if (type === 'reject') {
+          this.inputForm.type = '4'
+          this.reimbursementApprovalService.updateStatusById(this.inputForm)
+          // this.reimbursementService.updateStatusById(this.inputForm)
+        }
+      },
+      footerMethod ({ columns, data }) {
+        const footerData = [
+          columns.map((column, columnIndex) => {
+            if (columnIndex === 0) {
+              return '总报销费用'
+            }
+            if (['number'].includes(column.property)) {
+              // eslint-disable-next-line no-undef
+              return XEUtils.sum(data, column.property)
+            }
+            return null
+          })
+        ]
+        return footerData
+      },
+      twoDecimalPlaces (num) {
+        let str = num.toString()
+        var len1 = str.substr(0, 1)
+        var len2 = str.substr(1, 1)
+        // eslint-disable-next-line eqeqeq
+        if (str.length > 1 && len1 == 0 && len2 != '.') {
+          str = str.substr(1, 1)
+        }
+        // eslint-disable-next-line eqeqeq
+        if (len1 == '.') {
+          str = ''
+        }
+        // eslint-disable-next-line eqeqeq
+        if (str.indexOf('.') != -1) {
+          var str_ = str.substr(str.indexOf('.') + 1)
+          // eslint-disable-next-line eqeqeq
+          if (str_.indexOf('.') != -1) {
+            str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
+          }
+          if (str_.length > 2) {
+            this.$message.warning(`金额小数点后只能输入两位,请正确输入!`)
+            return (str = '')
+          }
+        }
+        // eslint-disable-next-line no-useless-escape
+        str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
+        return str
+      },
+      isExict (row) {
+        this.reimbursementApprovalService.checkNumber(row.number).then(({data}) => {
+          if (data) {
+            this.$message.error('该发票号已存在')
+            row.number = ''
+          }
+        })
+        // this.reimbursementService.checkNumber(row.number).then(({data}) => {
+        //   if (data) {
+        //     this.$message.error('该发票号已存在')
+        //     row.number = ''
+        //   }
+        // })
+      },
+      countAmount (row) {
+        let amount
+        let taxAmount
+        let count = 0
+        if (!this.commonJS.isEmpty(row.amount)) {
+          amount = parseFloat(row.amount)
+          count = count + amount
+        }
+        if (!this.commonJS.isEmpty(row.taxAmount)) {
+          taxAmount = parseFloat(row.taxAmount)
+          count = count + taxAmount
+        }
+        row.count = parseFloat(count).toFixed(2)
+      },
+      openProgramPageForm (rowIndex, row) {
+        if (this.commonJS.isEmpty(row.typeName)) {
+          this.$message.error('请选择报销类型')
+          return
+        }
+        this.indexRow = rowIndex
+        this.reimbursementApprovalTypeService.findById(row.typeId).then(({data}) => {
+          console.log('typeInfo', data.sort)
+          console.log('data', data)
+          let i = data.sort.toString()
+          i = i.substring(0, 1)
+          // 非业务报销
+          if (i !== '1') {
+            this.$refs.cwProgramPageForm.init('2', false)
+          } else {
+            // 打开单选组件
+            this.$refs.cwProgramPageForm.init(null, false)
+          }
+        })
+        // this.reimbursementTypeService.findById(row.typeId).then(({data}) => {
+        //   console.log('typeInfo', data.sort)
+        //   let i = data.sort.toString()
+        //   i = i.substring(0, 1)
+        //   // 非业务报销
+        //   if (i !== '1') {
+        //     this.$refs.programPageForm.init('2', false)
+        //   } else {
+        //     // 打开单选组件
+        //     this.$refs.programPageForm.init(null, false)
+        //   }
+        // })
+      },
+      getProgram (rows) {
+        console.log('aaaaaaaaaaa', rows[0])
+        this.inputForm.detailInfos[this.indexRow].projectId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].projectName = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].reportNumber = rows[0].reportNo
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      // 报销类型下拉弹窗
+      typePullForm (rowIndex) {
+        this.indexRow = rowIndex
+        // this.$refs.reimbursementTypePullForm.init()
+        this.$refs.cwReimbursementTypePullForm.init()
+      },
+      getProgramForType (rows) {
+        this.inputForm.detailInfos[this.indexRow].typeId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].typeName = rows[0].name
+        this.indexRow = ''
+        this.$forceUpdate()
+      },
+      // 报销人下拉弹窗
+      userPullListForm (rowIndex) {
+        this.indexRow = rowIndex
+        this.$refs.userPullForm.init()
+      },
+      getProgramForUser (rows) {
+        console.log('rows', rows)
+        this.inputForm.detailInfos[this.indexRow].userId = rows[0].id
+        this.inputForm.detailInfos[this.indexRow].userName = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].deptId = rows[0].parentId
+        this.inputForm.detailInfos[this.indexRow].deptName = rows[0].officeName
+        this.indexRow = ''
+        this.$forceUpdate()
+      }
+    }
+  }
+</script>

+ 156 - 0
src/views/modules/cw/reimbursementApproval/type/TypeForm.vue

@@ -0,0 +1,156 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="500px"
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="100px" @submit.native.prevent>
+        <el-row  :gutter="15">
+          <el-col :span="21">
+            <el-form-item label="上级节点" prop="parentId">
+              <SelectTree
+                ref="areaTree"
+                :props="{
+                      value: 'id',             // ID字段名
+                      label: 'name',         // 显示名称
+                      children: 'children'    // 子级字段名
+                    }"
+                url="/reimbursementApproval/type/treeData?type=3"
+                :value="inputForm.parentId"
+                :clearable="true"
+                :accordion="true"
+                @getValue="(value) => {inputForm.parentId=value}"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="21">
+            <el-form-item label="报销内容名称" prop="name"
+                          :rules="[
+                          {required: true, message:'报销内容名称不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.name" placeholder="请填写报销内容名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="21">
+            <el-form-item label="序号" prop="no">
+              <el-input v-model="inputForm.no" :disabled="true" show-word-limit></el-input>
+            </el-form-item>
+          </el-col>
+        </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'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+  import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          name: '',
+          no: '',
+          parentId: ''
+        }
+      }
+    },
+    // reimbursementTypeService: null,
+    reimbursementApprovalTypeService: null,
+    created () {
+      // this.reimbursementTypeService = new ReimbursementTypeService()
+      this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+    },
+    components: {
+      SelectTree
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          name: '',
+          no: '',
+          parentId: ''
+        }
+        if (method === 'add') {
+          this.title = `新建报销类型`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改报销类型'
+        } else if (method === 'view') {
+          this.inputForm.id = id
+          this.title = '查看报销类型'
+        } else if (method === 'addChild') {
+          this.title = '添加下级结构'
+          this.inputForm.parentId = id
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.$refs.inputForm.resetFields()
+            this.reimbursementApprovalTypeService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+            // this.reimbursementTypeService.findById(this.inputForm.id).then(({data}) => {
+            //   this.inputForm = this.recover(this.inputForm, data)
+            //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.reimbursementApprovalTypeService.save(this.inputForm).then(({data}) => {
+              if (data === false) {
+                this.close()
+                this.$message.error('报销内容名重复,请重新填写')
+                this.$emit('refreshDataList')
+                this.loading = false
+              } else {
+                this.close()
+                this.$message.success(data)
+                this.$emit('refreshDataList')
+                this.loading = false
+              }
+            }).catch(() => {
+              this.loading = false
+            })
+            // this.reimbursementTypeService.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.visible = false
+      }
+    }
+  }
+</script>

+ 155 - 0
src/views/modules/cw/reimbursementApproval/type/TypeList.vue

@@ -0,0 +1,155 @@
+<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-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="sort">
+        <el-input size="small" v-model="searchForm.sort" placeholder="请输入序号" clearable></el-input>
+      </el-form-item>
+
+      <el-form-item>
+        <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-form>
+
+    <div class="bg-white top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+          <el-button v-if="hasPermission('program:configuration:type:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
+<!--          <el-button v-if="hasPermission('program:configuration:type:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.typeTable && $refs.typeTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 50px)">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="typeTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId'}"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+          <vxe-column title="报销内容名称" field="name" align="left" tree-node></vxe-column>
+          <vxe-column width="100" title="序号" field="sort"></vxe-column>
+
+          <vxe-column title="操作" width="230px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('reimbursement:type:edit')&&(scope.row.level === '1' || scope.row.level === '2')" type="text"  size="small" @click="addChild(scope.row.id)">添加下级结构</el-button>
+              <el-button v-if="hasPermission('reimbursement:type:edit')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('reimbursement:type:remove')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+
+      </div>
+    </div>
+    <TypeForm  ref="typeForm" @refreshDataList="refreshList"></TypeForm>
+  </div>
+</template>
+
+<script>
+  // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+  import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
+  import TypeForm from './TypeForm'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          name: '',
+          no: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false
+      }
+    },
+    // reimbursementTypeService: null,
+    reimbursementApprovalTypeService: null,
+    created () {
+      // this.reimbursementTypeService = new ReimbursementTypeService()
+      this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+    },
+    components: {
+      TypeForm
+    },
+    mounted () {
+      this.refreshList()
+    },
+    methods: {
+      // 新增
+      add () {
+        this.$refs.typeForm.init('add', '')
+      },
+      addChild (id) {
+        this.$refs.typeForm.init('addChild', id)
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.typeTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.typeForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.typeForm.init('view', id)
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.reimbursementApprovalTypeService.list({...this.searchForm}).then(({data}) => {
+          this.dataList = data
+          this.loading = false
+        })
+        // this.reimbursementTypeService.list({...this.searchForm}).then(({data}) => {
+        //   this.dataList = data
+        //   this.loading = false
+        // })
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.typeTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.reimbursementApprovalTypeService.remove(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+          // this.reimbursementTypeService.remove(ids).then(({data}) => {
+          //   this.$message.success(data)
+          //   this.refreshList()
+          //   this.loading = false
+          // })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      }
+    }
+  }
+</script>

+ 1 - 1
src/views/modules/cw/reportCancellApply/ReportCancellApplyTaskForm.vue

@@ -58,7 +58,7 @@
                             :rules="[
                               {required: true, message:'作废原因不能为空', trigger:'blur'}
                    ]">
-                <el-input v-model="inputForm.cancellateReason" placeholder="请填写作废原因" clearable></el-input>
+                <el-input type="textarea" v-model="inputForm.cancellateReason" placeholder="请填写作废原因" clearable></el-input>
               </el-form-item>
             </el-col>
 

+ 158 - 9
src/views/modules/cw/workContract/ContractFileForm.vue

@@ -68,7 +68,18 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="合同金额(元)" prop="contractAmount"
+          <el-form-item label="合同金额类别" prop="contractAmountType"
+                        :rules="[
+                  {required: true, message:'请选择合同金额类别', trigger:'blur'}
+               ]">
+            <el-radio-group :disabled="true" v-model="inputForm.contractAmountType">
+              <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同金额(元)" prop="contractAmount" v-if="inputForm.contractAmountType === '1'"
                         :rules="[
                   {required: true, message:'请输入合同金额(元)', trigger:'blur'}
                ]">
@@ -98,8 +109,24 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="付款约定" prop="paymentAgreement">
-            <el-input maxlength="64" :disabled="true" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          <el-form-item label="对方合同编号" prop="contractOpposite">
+            <el-input :disabled="true" maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="收费标准" prop="contractFees">
+            <el-checkbox-group v-model="inputForm.contractFees">
+              <el-checkbox :disabled="true" @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.value">
+                {{item.label}}
+              </el-checkbox>
+            </el-checkbox-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item prop="contractFee">
+            <el-input style="width: 100%" placeholder="请选择收费标准" :disabled="true" v-model="inputForm.contractFee"></el-input>
           </el-form-item>
         </el-col>
 
@@ -115,7 +142,21 @@
           <el-form-item label="所属部门" prop="department"
                         :rules="[
                  ]">
-            <el-input maxlength="64" :disabled="true" v-model="inputForm.department" placeholder="请输入所属部门"></el-input>
+            <SelectTree
+              ref="officeTree"
+              :disabled="true"
+              :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+              :url="`/sys/office/treeData?type=1`"
+              :value="inputForm.department"
+              :accordion="true"
+              size="medium"
+              @getValue="(value) => {inputForm.department=value}"/>
+<!--            <el-input maxlength="64" :disabled="true" v-model="inputForm.department" placeholder="请输入所属部门"></el-input>-->
           </el-form-item>
         </el-col>
 
@@ -153,6 +194,24 @@
         </el-col>
 
         <el-col :span="12">
+          <el-form-item label="案卷号" prop="filedNo"
+                        :rules="[{required: true, message: '请输入案卷号', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="15" v-model="inputForm.filedNo" placeholder="请输入案卷号"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="确认案卷号" prop="confirmFiledNo"
+                        :rules="[{required: true, message: '请输入确认案卷号', trigger: 'blur'}
+                 ]">
+            <el-input maxlength="15" @change="checkFiledNo" v-model="inputForm.confirmFiledNo" placeholder="请输入确认案卷号"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
           <el-form-item label="创建人" prop="createBy"
                         :rules="[{required: true, message: '创建人', trigger: 'blur'}
                  ]">
@@ -172,6 +231,11 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="付款约定" prop="paymentAgreement">
+            <el-input maxlength="64" type="textarea" :disabled="true" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          </el-form-item>
+        </el-col>
 
       </el-row>
     </el-form>
@@ -244,6 +308,7 @@
   import ContractFileService from '../../../../api/cw/workContract/ContractFileService'
   import UpLoadComponent from '@/views/common/UpLoadComponent'
   import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
   import OSSSerive, {
     httpRequest,
     toHref,
@@ -268,6 +333,8 @@
         visible: false,
         loading: false,
         returnForm: {
+          filedNo: '',
+          confirmFiledNo: '',
           clientId: '',
           name: '',
           contractDate: '',
@@ -287,9 +354,14 @@
           contractProperList: [],
           contractInfoList: [],
           customerNo: '',
-          customerName: ''
+          customerName: '',
+          contractFees: []
         },
         inputForm: {
+          contractFee: '',
+          contractFees: [],
+          contractOpposite: '',
+          contractAmountType: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
@@ -310,7 +382,9 @@
           createId: JSON.parse(localStorage.getItem('user')).id,
           createDate: '',
           contractProperList: [],
-          contractInfoList: []
+          contractInfoList: [],
+          filedNo: '',
+          confirmFiledNo: ''
         },
         activeName: 'archiveFile',
         filesArra2: [],
@@ -346,7 +420,8 @@
     components: {
       ElImageViewer,
       UpLoadComponent,
-      WorkClientChooseForm
+      WorkClientChooseForm,
+      SelectTree
     },
     ossService: null,
     // workContractService: null,
@@ -390,6 +465,14 @@
       }
     },
     methods: {
+      checkFiledNo () {
+        let filedNo = this.inputForm.filedNo
+        let confirmFiledNo = this.inputForm.confirmFiledNo
+        if (filedNo !== confirmFiledNo) {
+          this.$message.warning(`案卷号和确认案卷号不一致`)
+          this.inputForm.confirmFiledNo = ''
+        }
+      },
       getKeyWatch (keyWatch) {
         this.keyWatch = keyWatch
       },
@@ -420,6 +503,10 @@
         this.dataListNew = []
         this.method = method
         this.inputForm = {
+          contractFee: '',
+          contractFees: [],
+          contractOpposite: '',
+          contractAmountType: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
@@ -441,11 +528,12 @@
           createDate: '',
           contractProperList: [],
           contractInfoList: [],
-          cwWorkClientContactDTOList: []
+          cwWorkClientContactDTOList: [],
+          filedNo: '',
+          confirmFiledNo: ''
         }
         this.inputForm.id = id
         if (method === 'add') {
-          // this.inputForm.contractAmountType = '1'
           this.title = `新建合同登记`
         } else if (method === 'edit') {
           this.title = '修改合同登记'
@@ -477,6 +565,28 @@
                 this.contractInfoService.findById(data2.data.contractInfoId).then(async (data3) => {
                   data3.data.contractProperList = this.inputForm.contractProperList
                   data3.data.contractInfoList = this.inputForm.contractInfoList
+                  this.inputForm.contractNo = data3.data.contractNo
+                  this.inputForm.filedNo = data3.data.filedNo
+                  this.inputForm.contractName = data3.data.contractName
+                  this.inputForm.payerSubject = data3.data.payerSubject
+                  this.inputForm.paymentMethod = data3.data.paymentMethod
+                  this.inputForm.signingDate = data3.data.signingDate
+                  this.inputForm.contractAmountType = data3.data.contractAmountType
+                  this.inputForm.contractAmount = data3.data.contractAmount
+                  this.inputForm.actualContractAmount = data3.data.actualContractAmount
+                  this.inputForm.contractNum = data3.data.contractNum
+                  this.inputForm.contractOpposite = data3.data.contractOpposite
+                  this.inputForm.confirmFiledNo = data3.data.confirmFiledNo
+                  this.inputForm.contractFee = data3.data.contractFee
+                  this.inputForm.fees = data3.data.fees
+                  this.inputForm.changeNum = data3.data.changeNum
+                  this.inputForm.department = data3.data.department
+                  console.log('data3.data.department', data3.data.department)
+                  this.inputForm.clientContacts = data3.data.clientContacts
+                  this.inputForm.clientContactsPhone = data3.data.clientContactsPhone
+                  this.inputForm.createBy = data3.data.createBy
+                  this.inputForm.createDate = data3.data.createDate
+                  this.inputForm.paymentAgreement = data3.data.paymentAgreement
                   if (data3.data.filedType === '2' || data3.data.filedType === '5') {
                     // this.$refs.uploadFile.clearUpload()
                     // this.$refs.uploadFile.newUpload('view', data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
@@ -492,6 +602,15 @@
                     await this.$refs.uploadFile.clearUpload()
                     this.$refs.uploadFile.newUpload('view', data3.data.contractProperList, 'cwWorkContract', null, null, null, null, false)
                   }
+                  const f = []
+                  if (data3.data.fees !== null && data3.data.fees !== undefined && data3.data.fees !== '') {
+                    data3.data.fees.split(',').forEach(item => {
+                      if (item !== null && item !== undefined && item !== '') {
+                        f.push(item)
+                      }
+                    })
+                  }
+                  this.inputForm.contractFees = f
 
                   // console.log('data3', data3)
                   // console.log('this.inputForm', this.inputForm)
@@ -624,6 +743,16 @@
             this.loading = false
             throw new Error('请填写合同实际金额')
           }
+          if (this.inputForm.filedNo === '' || this.inputForm.filedNo === undefined) {
+            this.loading = false
+            this.$message.error('请填写案卷号')
+            throw new Error('请填写案卷号')
+          }
+          if (this.inputForm.confirmFiledNo === '' || this.inputForm.confirmFiledNo === undefined) {
+            this.loading = false
+            this.$message.error('请填写确认案卷号')
+            throw new Error('请填写确认案卷号')
+          }
           this.contractInfoService.updateInfo(this.inputForm)
           // console.log('inputForm', this.inputForm)
           this.inputForm.contractInfoId = id
@@ -662,6 +791,26 @@
           })
         }
       },
+      changeContractFee () {
+        let fee = ''
+        let fees = this.inputForm.contractFees
+        console.log('fees', fees)
+        if (fees.length > 0) {
+          fees.forEach(i => {
+            if (i === '1') {
+              i = '发改价格[2009]2914号'
+              fee = fee + ';' + i
+            }
+            if (i === '2') {
+              i = '其他'
+              fee = fee + ';' + i
+            }
+            this.inputForm.contractFee = fee.substring(1, fee.length)
+          })
+        } else {
+          this.inputForm.contractFee = ''
+        }
+      },
       close () {
         this.$refs.inputForm.resetFields()
         this.inputForm.clientName = ''

+ 11 - 7
src/views/modules/cw/workContract/ContractNameForm.vue

@@ -106,12 +106,6 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="付款约定" prop="paymentAgreement">
-            <el-input maxlength="64" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="12">
           <el-form-item label="修改次数" prop="changeNum"
                         :rules="[{required: true, message: '修改次数', trigger: 'blur'}
                  ]">
@@ -132,6 +126,7 @@
               :url="`/sys/office/treeData?type=2`"
               :value="inputForm.department"
               :accordion="true"
+              size="medium"
               @getValue="(value) => {inputForm.department=value}"/>
           </el-form-item>
         </el-col>
@@ -175,6 +170,12 @@
           </el-form-item>
         </el-col>
 
+        <el-col :span="12">
+          <el-form-item label="付款约定" prop="paymentAgreement">
+            <el-input type="textarea" maxlength="64" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          </el-form-item>
+        </el-col>
+
       </el-row>
     </el-form>
     <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
@@ -275,6 +276,8 @@
         visible: false,
         loading: false,
         returnForm: {
+          filedNo: '',
+          confirmFiledNo: '',
           clientId: '',
           name: '',
           contractDate: '',
@@ -376,7 +379,7 @@
       },
       bus: {
         get () {
-          this.$refs.archiveFile.setDividerName('附件')
+          this.$refs.archiveFile.setDividerName('附件', false)
           return this.businessId
         },
         set (val) {
@@ -470,6 +473,7 @@
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
+          this.$refs.archiveFile.setDividerName('附件', false)
           this.$refs.inputForm.resetFields()
             // if (method === 'edit' || method === 'view') { // 修改或者查看
           this.loading = true

+ 104 - 9
src/views/modules/cw/workContract/ContractRegistration.vue

@@ -49,7 +49,7 @@
                   children: 'children'    // 子级字段名
                 }"
 
-          :url="`/sys/office/treeData?type=2`"
+          :url="`/sys/office/treeData?type=1`"
           :value="searchForm.department"
           :accordion="true"
           @getValue="(value) => {searchForm.department=value}"/>
@@ -134,6 +134,11 @@
               <el-button  type="text" @click="detailFiled(scope.row)" :type="$dictUtils.getDictLabel('filed_type_status', scope.row.filedType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("filed_type", scope.row.filedType, '未归档')}} </el-button>
             </template>
           </vxe-column>
+          <vxe-column width="100px"  title="借用状态" field="borrowType" >
+            <template slot-scope="scope">
+              <el-button  type="text" @click="detailBorrow(scope.row)" :type="$dictUtils.getDictLabel('borrow_type_status', scope.row.borrowType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("borrow_type", scope.row.borrowType, '未借用')}} </el-button>
+            </template>
+          </vxe-column>
 
 
           <vxe-column title="操作" width="200px" fixed="right" align="center">
@@ -150,7 +155,13 @@
               <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.createId === $store.state.user.id && (scope.row.filedType === '3' || scope.row.filedType === '4')" type="text" size="small" @click="filedAndClose(scope.row.id)">修改</el-button>
               <!--归档撤回-->
               <el-button v-if="hasPermission('cw:workContract:back') && scope.row.status === '5' && scope.row.filedType === '2'" type="text"  size="small" @click="rebackFiled(scope.row)">撤回</el-button>
-              </template>
+              <!--合同借用-->
+              <el-button v-if="hasPermission('sys:workContract:borrow') && scope.row.status === '5' && scope.row.filedType === '5' && (scope.row.borrowType === undefined || scope.row.borrowType === '0' || scope.row.borrowType === '1')" type="text" size="small" @click="borrow(scope.row.id)">借用</el-button>
+              <!--借用撤回-->
+              <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.borrowType === '2'" type="text" size="small" @click="rebackBorrow(scope.row)">撤回</el-button>
+              <!--借用归还-->
+              <el-button v-if="hasPermission('sys:workContract:reture') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.borrowType === '5'" type="text" size="small" @click="retureBorrow(scope.row)">归还合同</el-button>
+            </template>
           </vxe-column>
         </vxe-table>
         <vxe-pager
@@ -181,7 +192,8 @@
   import ContractInfoService from '../../../../api/cw/workContract/ContractInfoService'
   // import WorkContractFileService from '@/api/sys/WorkContractFileService'
   import ContractFileService from '@/api/cw/workContract/ContractFileService'
-  import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  // import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  import CwWorkContractBorrowService from '@/api/cw/workContract/CwWorkContractBorrowService'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import TaskService from '@/api/flowable/TaskService'
   import ProcessService from '@/api/flowable/ProcessService'
@@ -225,7 +237,8 @@
     // workContractService: null,
     contractInfoService: null,
     contractFileService: null,
-    workContractBorrowService: null,
+    // workContractBorrowService: null,
+    cwWorkContractBorrowService: null,
     taskService: null,
     processService: null,
     userService: null,
@@ -233,7 +246,8 @@
       // this.workContractService = new WorkContractService()
       this.contractInfoService = new ContractInfoService()
       this.contractFileService = new ContractFileService()
-      this.workContractBorrowService = new WorkContractBorrowService()
+      this.cwWorkContractBorrowService = new CwWorkContractBorrowService()
+      // this.workContractBorrowService = new WorkContractBorrowService()
       this.taskService = new TaskService()
       this.processService = new ProcessService()
       this.userService = new UserService()
@@ -510,17 +524,25 @@
         }
         if (type === 'rebackBorrow') {
           row.borrowType = '0'
-          this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
-            this.workContractBorrowService.deleteById(row.id)
+          this.cwWorkContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+            this.cwWorkContractBorrowService.deleteById(row.id)
           })
+          // this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+          //   this.workContractBorrowService.deleteById(row.id)
+          // })
         }
         if (type === 'retureBorrow') {
           row.borrowType = '0'
-          this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+          this.cwWorkContractBorrowService.updateStatusByContractInfoId(row).then(() => {
             row.type = 'reture'
             row.borrowType = '5'
-            this.workContractBorrowService.updateMessageStatusById(row)
+            this.cwWorkContractBorrowService.updateMessageStatusById(row)
           })
+          // this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
+          //   row.type = 'reture'
+          //   row.borrowType = '5'
+          //   this.workContractBorrowService.updateMessageStatusById(row)
+          // })
         }
       },
       is () {
@@ -617,6 +639,79 @@
             }
           })
         }
+      },
+      // 借用
+      borrow (id) {
+        this.processService.getByName('财务-合同登记借用').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            console.log('data', data)
+            // 读取流程表单
+            let tabTitle = `发起流程【财务-合同登记借用】`
+            let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [财务-合同登记借用]`
+            this.taskService.getTaskDef({ procDefId: data.id,
+              businessId: id,
+              businessTable: 'cw_work_contract_borrow',
+              status: 'startAndCloseBorrow'}).then((reture) => {
+                this.$router.push({
+                  path: '/flowable/task/TaskForm',
+                  query: {
+                    procDefId: data.id,
+                    procDefKey: data.key,
+                    status: 'startAndCloseBorrow',
+                    title: tabTitle,
+                    formType: reture.data.formType,
+                    formUrl: reture.data.formUrl,
+                    formTitle: processTitle,
+                    businessTable: 'cw_work_contract_borrow',
+                    businessId: id,
+                    isShow: false,
+                    routePath: '/cw/workContract/ContractRegistration'
+                  }
+                })
+              })
+          }
+        })
+      },
+      // 借用详情
+      detailBorrow (row) {
+        this.$refs.workContractBorrowMessageForm.findList(row.id)
+      },
+      // 借用撤回
+      rebackBorrow (row) {
+        this.$confirm(`确定撤回流程吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          taskId: row.taskBorrowId,
+          type: 'warning'
+        }).then(() => {
+          console.log('datas', row.taskBorrowId)
+          this.taskService.backNodes(row.taskBorrowId).then(({data}) => {
+            let backNodes = data
+            if (backNodes.length > 0) {
+              let backTaskDefKey = backNodes[0].taskDefKey
+              this.taskService.back({
+                taskId: row.taskBorrowId,
+                backTaskDefKey: backTaskDefKey,
+                isShow: false,
+                ...this.auditForm
+              }).then(({data}) => {
+                this.updateStatusById(row, 'rebackBorrow')
+                this.$message.success('回退成功')
+              })
+            }
+          })
+        })
+      },
+      // 归还合同
+      retureBorrow (row) {
+        this.$confirm(`确定归还合同吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.updateStatusById(row, 'retureBorrow')
+          this.refreshList()
+        })
       }
     }
   }

+ 90 - 13
src/views/modules/cw/workContract/ContractRegistrationForm.vue

@@ -67,7 +67,18 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="合同金额(元)" prop="contractAmount"
+          <el-form-item label="合同金额类别" prop="contractAmountType"
+                        :rules="[
+                  {required: true, message:'请选择合同金额类别', trigger:'blur'}
+               ]">
+            <el-radio-group v-model="inputForm.contractAmountType">
+              <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="合同金额(元)" prop="contractAmount" v-if="inputForm.contractAmountType === '1'"
                         :rules="[
                   {required: true, message:'请输入合同金额(元)', trigger:'blur'}
                ]">
@@ -92,11 +103,35 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="付款约定" prop="paymentAgreement">
-            <el-input maxlength="64" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          <el-form-item label="对方合同编号" prop="contractOpposite">
+            <el-input maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="收费标准" prop="contractFees">
+            <el-checkbox-group v-model="inputForm.contractFees">
+              <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee')" :label="item.value">
+                {{item.label}}
+              </el-checkbox>
+            </el-checkbox-group>
           </el-form-item>
         </el-col>
 
+        <el-col :span="24">
+          <el-form-item prop="contractFee">
+            <el-input style="width: 100%" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
+          </el-form-item>
+        </el-col>
+
+<!--        <el-row>-->
+<!--          -->
+<!--        </el-row>-->
+
+<!--        <el-row>-->
+<!--          -->
+<!--        </el-row>-->
+
         <el-col :span="12">
           <el-form-item label="修改次数" prop="changeNum"
                         :rules="[{required: true, message: '修改次数', trigger: 'blur'}
@@ -115,7 +150,7 @@
                   children: 'children'    // 子级字段名
                 }"
 
-              :url="`/sys/office/treeData?type=2`"
+              :url="`/sys/office/treeData?type=1`"
               :value="inputForm.department"
               :accordion="true"
               size="medium"
@@ -125,18 +160,21 @@
 
         <el-col :span="12">
           <el-form-item label="委托方联系人" prop="clientContacts"
-                        :rules="[{required: true, message: '委托方联系人', trigger: 'blur'}
+                        :rules="[
+                          // {required: true, message: '委托方联系人', trigger: 'blur'}
                  ]">
-            <el-input maxlength="100" v-model="inputForm.clientContacts" placeholder="请输入委托方联系人"></el-input>
+            <el-input maxlength="100" @focus="openWorkClient2()" v-model="inputForm.clientContacts" placeholder="请选择委托方联系人">
+              <el-button slot="append"  icon="el-icon-search" @click="openWorkClient2()"></el-button>
+            </el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="12">
           <el-form-item label="委托方联系人电话" prop="clientContactsPhone"
-                        :rules="[{required: true, message: '委托方联系人电话', trigger: 'blur'}
+                        :rules="[
+                          // {required: true, message: '委托方联系人电话', trigger: 'blur'}
                  ]">
-            <el-input maxlength="15" v-model="inputForm.clientContactsPhone" placeholder="请输入委托方联系人电话"
-                      @keyup.native="inputForm.clientContactsPhone = twoDecimalPlaces(inputForm.clientContactsPhone)"
+            <el-input maxlength="15" :disabled="true" v-model="inputForm.clientContactsPhone" placeholder="请输入委托方联系人电话"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -162,6 +200,12 @@
           </el-form-item>
         </el-col>
 
+        <el-col :span="12">
+          <el-form-item label="付款约定" prop="paymentAgreement">
+            <el-input maxlength="64" type="textarea" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
+          </el-form-item>
+        </el-col>
+
       </el-row>
 
       <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
@@ -282,6 +326,8 @@
           customerName: ''
         },
         inputForm: {
+          contractFees: [],
+          contractFee: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
@@ -300,7 +346,10 @@
           createId: JSON.parse(localStorage.getItem('user')).id,
           createDate: '',
           contractProperList: [],
-          cwWorkClientContactDTOList: []
+          cwWorkClientContactDTOList: [],
+          contractAmountType: '',
+          contractOpposite: '',
+          fees: ''
         },
         activeName: 'contractProper',
         filesArra2: [],
@@ -409,11 +458,14 @@
         this.method = method
         console.log('method', method)
         this.inputForm = {
+          contractFees: [],
+          contractFee: '',
           contractNo: '',
           contractName: '',
           payerSubject: '',
           paymentMethod: '',
           signingDate: '',
+          fees: '',
           contractAmount: '',
           actualContractAmount: '',
           contractNum: '',
@@ -427,7 +479,9 @@
           createId: JSON.parse(localStorage.getItem('user')).id,
           createDate: '',
           contractProperList: [],
-          cwWorkClientContactDTOList: []
+          cwWorkClientContactDTOList: [],
+          contractAmountType: '',
+          contractOpposite: ''
         }
         this.inputForm.id = id
         if (method === 'add') {
@@ -526,6 +580,9 @@
       openWorkClient () {
         this.$refs.workClientChooseForm.init()
       },
+      openWorkClient2 () {
+        this.$refs.workClientChooseForm.init()
+      },
       getWorkClientChoose (list) {
         console.log('list', list)
         if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
@@ -563,6 +620,7 @@
         } else {
           this.loading = true
           this.inputForm.status = '1'
+          this.inputForm.fees = this.inputForm.contractFees.join(',')
           this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
           console.log('this.inputForm', this.inputForm)
           await this.contractInfoService.save(this.inputForm).then(({data}) => {
@@ -586,7 +644,7 @@
               this.loading = true
               this.inputForm.status = '2'
               this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
-              // this.inputForm.fees = this.inputForm.contractFees.join(',')
+              this.inputForm.fees = this.inputForm.contractFees.join(',')
               await this.contractInfoService.save(this.inputForm).then(({data}) => {
                 callback(data.businessTable, data.businessId, this.inputForm)
                 this.$refs.inputForm.resetFields()
@@ -610,7 +668,7 @@
               this.loading = true
               this.inputForm.status = '2'
               this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
-              // this.inputForm.fees = this.inputForm.contractFees.join(',')
+              this.inputForm.fees = this.inputForm.contractFees.join(',')
               await this.contractInfoService.save(this.inputForm).then(({data}) => {
                 callback(data.businessTable, data.businessId, this.inputForm)
                 this.$refs.inputForm.resetFields()
@@ -623,6 +681,25 @@
           })
         }
       },
+      changeContractFee () {
+        let fee = ''
+        let fees = this.inputForm.contractFees
+        if (fees.length > 0) {
+          fees.forEach(i => {
+            if (i === '1') {
+              i = '发改价格[2009]2914号'
+              fee = fee + ';' + i
+            }
+            if (i === '2') {
+              i = '其他'
+              fee = fee + ';' + i
+            }
+            this.inputForm.contractFee = fee.substring(1, fee.length)
+          })
+        } else {
+          this.inputForm.contractFee = ''
+        }
+      },
       close () {
         this.$refs.inputForm.resetFields()
         this.inputForm.clientName = ''

+ 376 - 0
src/views/modules/cw/workContract/CwWorkContractBorrowForm.vue

@@ -0,0 +1,376 @@
+<template>
+<div>
+  <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+           label-width="150px">
+    <el-row  :gutter="0">
+      <el-col :span="12">
+        <el-form-item label="合同名称" prop="contractName">
+          <el-input :disabled="true" v-model="inputForm.contractName"></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="合同编号" prop="contractNo">
+          <el-input :disabled="true" v-model="inputForm.contractNo"></el-input>
+        </el-form-item>
+      </el-col>
+
+<!--      <el-col :span="12">-->
+<!--        <el-form-item label="客户名称" prop="clientName">-->
+<!--          <el-input :disabled="true" v-model="inputForm.clientName"></el-input>-->
+<!--        </el-form-item>-->
+<!--      </el-col>-->
+
+      <el-col :span="12">
+        <el-form-item label="借用人" prop="borrowName">
+          <el-input :disabled="true" v-model="inputForm.borrowName"></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="借用日期" prop="borrowData" :rules="[
+                  {required: true, message:'请填写借用日期', trigger:'blur'}
+               ]">
+          <el-date-picker
+            :disabled="this.inputForm.borrowType === '2'"
+            v-model="inputForm.borrowData"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+
+      <el-col :span="12">
+        <el-form-item label="大概归还日期" prop="borrowRetData" :rules="[
+                  {required: true, message:'请填写大概归还日期', trigger:'blur'}
+               ]">
+          <el-date-picker
+            :disabled="this.inputForm.borrowType === '2'"
+            v-model="inputForm.borrowRetData"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+
+    </el-row>
+
+    <el-form-item label="备注" prop="remarks">
+      <el-input v-model="inputForm.remarks"
+                :disabled="this.inputForm.borrowType === '2'"
+                type="textarea"
+                :rows="5"
+                maxlength="500"
+                placeholder="请输入备注"
+                show-word-limit>
+      </el-input>
+    </el-form-item>
+
+  </el-form>
+  <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
+    <el-tab-pane label="合同正文" name="uploadFile">
+      <!--        合同正文-->
+      <UpLoadComponent ref="uploadFile"></UpLoadComponent>
+    </el-tab-pane>
+    <el-tab-pane label="参与签约方" name="contactParty">
+      <el-row :gutter="15">
+        <el-button type="info" :disabled="true" style="margin-bottom: 15px" size="mini"  @click="openWorkClient">
+          新增参与签约方
+        </el-button>
+      </el-row>
+      <el-row  :gutter="15">
+        <el-form :disabled="method === 'view'">
+          <vxe-table
+            border
+            show-overflow
+            show-footer
+            :column-config="{resizable: true}"
+            ref="contactTable"
+            :key="tableKeyClient"
+            class="vxe-table-element"
+            :data="inputForm.cwWorkClientContactDTOList"
+            style=""
+            @cell-click=""
+            @edit-closed=""
+            highlight-current-row
+            :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
+          >
+            <vxe-table-column align="center" field="no" title="客户编号" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :readonly="true" v-model="scope.row.no" placeholder="客户编号" clearable></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column align="center" field="name" title="客户名称" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :readonly="true" v-model="scope.row.name" placeholder="客户名称" clearable></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column align="center" title="操作" width="100">
+              <template v-slot="scope">
+                <el-button size="mini" :disabled="true" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-form>
+      </el-row>
+    </el-tab-pane>
+    <el-tab-pane label="合同归档文件" name="archiveFile">
+      <!--        合同归档文件-->
+      <UpLoadComponent ref="archiveFile"></UpLoadComponent>
+    </el-tab-pane>
+
+  </el-tabs>
+  <WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
+</div>
+</template>
+
+<script>
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  // import WorkContractService from '@/api/sys/WorkContractService'
+  import ContractInfoService from '@/api/cw/workContract/ContractInfoService'
+  // import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  import CwWorkContractBorrowService from '@/api/cw/workContract/CwWorkContractBorrowService'
+  import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          cwWorkClientContactDTOList: [],
+          id: '',
+          contractName: '',
+          contractNo: '',
+          borrowName: '',
+          borrowData: '',
+          borrowRetData: '',
+          remarks: '',
+          borrowType: '',
+          type: ''
+        },
+        tableKeyClient: '1',
+        activeName: 'uploadFile'
+      }
+    },
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      }
+    },
+    components: {
+      UpLoadComponent,
+      WorkClientChooseForm
+    },
+    // workContractBorrowService: null,
+    cwWorkContractBorrowService: null,
+    // workContractService: null,
+    contractInfoService: null,
+    created () {
+      // this.workContractBorrowService = new WorkContractBorrowService()
+      this.cwWorkContractBorrowService = new CwWorkContractBorrowService()
+      this.contractInfoService = new ContractInfoService()
+      // this.workContractService = new WorkContractService()
+    },
+    watch: {
+      'businessId': {
+        handler (newVal) {
+          if (this.businessId) {
+            this.init(this.businessId)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        },
+        immediate: true,
+        deep: false
+      }
+    },
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      }
+    },
+    methods: {
+      init (id) {
+        if (id) {
+          this.loading = true
+          this.inputForm.id = id
+          this.$nextTick(() => {
+            console.log('id', id)
+            this.$refs.inputForm.resetFields()
+            this.cwWorkContractBorrowService.findById(this.inputForm.id).then(({data}) => {
+              if (this.commonJS.isEmpty(data.id)) {
+                this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
+                  this.inputForm = this.recover(this.inputForm, data)
+                  this.inputForm.borrowName = this.userName
+                  this.inputForm.borrowData = new Date()
+                  this.$refs.uploadFile.newUpload('view', data.contractProperList, 'cwWorkContract', null, null, null, null, false)
+                  this.$refs.archiveFile.newUpload('view', data.contractInfoList, 'cwWorkContract', null, null, null, null, false)
+                  console.log('data', data)
+                  this.loading = false
+                })
+                // this.workContractService.findById(this.inputForm.id).then(({data}) => {
+                //   this.inputForm = this.recover(this.inputForm, data)
+                //   this.inputForm.borrowName = this.userName
+                //   this.inputForm.borrowData = new Date()
+                //   this.loading = false
+                // })
+              } else {
+                this.inputForm = this.recover(this.inputForm, data)
+                this.inputForm.borrowName = this.userName
+                this.inputForm.borrowData = new Date()
+                this.loading = false
+              }
+            })
+            // this.workContractBorrowService.findById(this.inputForm.id).then(({data}) => {
+            //   if (this.commonJS.isEmpty(data.id)) {
+            //     this.workContractService.findById(this.inputForm.id).then(({data}) => {
+            //       this.inputForm = this.recover(this.inputForm, data)
+            //       this.inputForm.borrowName = this.userName
+            //       this.inputForm.borrowData = new Date()
+            //       this.loading = false
+            //     })
+            //   } else {
+            //     this.inputForm = this.recover(this.inputForm, data)
+            //     this.inputForm.borrowName = this.userName
+            //     this.inputForm.borrowData = new Date()
+            //     this.loading = false
+            //   }
+            // })
+          })
+        }
+      },
+      tabHandleClick (event) {
+        // console.log(event)
+      },
+      openWorkClient () {
+        this.$refs.workClientChooseForm.init()
+      },
+      removeEvent (row, rowIndex, type) {
+        if (type === 'client') {
+          this.$refs.contactTable.remove(row)
+          this.inputForm.cwWorkClientContactDTOList.splice(rowIndex, 1)
+        }
+      },
+      getWorkClientChoose (list) {
+        // console.log('list', list)
+        if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
+          this.inputForm.cwWorkClientContactDTOList = []
+        }
+        let _this = this
+        let _list = list
+        const waitForEach = function () {
+          return new Promise(function (resolve, reject) {
+            _list.forEach((item) => {
+              _this.inputForm.cwWorkClientContactDTOList.forEach(client => {
+                if (item.no === client.no) {
+                  _this.$message.error('已存在客户 “' + client.name + '”,请重新选择')
+                  throw new Error('已存在客户 “' + client.name + '”,请重新选择')
+                }
+              })
+            })
+            resolve()
+          })
+        }
+        waitForEach().then(() => {
+          list.forEach(item => {
+            this.$refs.contactTable.insertAt(item)
+            this.inputForm.cwWorkClientContactDTOList.push(item)
+            this.tableKeyClient = Math.random()
+          })
+        })
+      },
+      // 表单提交
+      startForm (callback) {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            let id = this.inputForm.id
+            this.loading = true
+            this.inputForm.contractInfoId = id
+            this.inputForm.borrowType = '2'
+            console.log('dosubmit', this.inputForm)
+            this.cwWorkContractBorrowService.save(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            }).catch(() => {
+              this.$refs.inputForm.resetFields()
+              this.loading = false
+            })
+            // this.workContractBorrowService.save(this.inputForm).then(({data}) => {
+            //   callback(data.businessTable, data.businessId, this.inputForm)
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.$refs.inputForm.resetFields()
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      // 同意
+      agreeForm (callback) {
+        this.inputForm.borrowType = '5'
+        this.cwWorkContractBorrowService.updateMessageStatusById(this.inputForm).then(({data}) => {
+          callback(data.businessTable, data.businessId, this.inputForm)
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        }).catch(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = false
+        })
+        // this.workContractBorrowService.updateMessageStatusById(this.inputForm).then(({data}) => {
+        //   callback(data.businessTable, data.businessId, this.inputForm)
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // }).catch(() => {
+        //   this.$refs.inputForm.resetFields()
+        //   this.loading = false
+        // })
+      },
+      // 关闭
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+        this.businessId = ''
+      },
+      // 更改状态
+      updateStatusById (type) {
+        console.log('updateStatusById', this.inputForm)
+        if (type === 'agree') {
+          this.inputForm.borrowType = '5'
+          this.cwWorkContractBorrowService.updateStatusById(this.inputForm)
+          // this.workContractBorrowService.updateStatusById(this.inputForm)
+        }
+        if (type === 'reject') {
+          this.inputForm.borrowType = '0'
+          this.cwWorkContractBorrowService.updateStatusById(this.inputForm).then(() => {
+            this.inputForm.borrowType = '3'
+            this.inputForm.type = 'reject'
+            this.cwWorkContractBorrowService.updateMessageStatusById(this.inputForm)
+          })
+          // this.workContractBorrowService.updateStatusById(this.inputForm).then(() => {
+          //   this.inputForm.borrowType = '3'
+          //   this.inputForm.type = 'reject'
+          //   this.workContractBorrowService.updateMessageStatusById(this.inputForm)
+          // })
+        }
+        if (type === 'reback') {
+          this.inputForm.borrowType = '0'
+          this.cwWorkContractBorrowService.updateStatusById(this.inputForm)
+          // this.workContractBorrowService.updateStatusById(this.inputForm)
+        }
+      }
+    }
+  }
+</script>
+
+

+ 12 - 5
src/views/modules/cw/workContract/WorkContractBorrowMessageForm.vue

@@ -26,7 +26,7 @@
                 :data="dataList"
                 :checkbox-config="{}">
 
-                <vxe-column width="300px" title="合同名称" field="name"></vxe-column>
+                <vxe-column width="300px" title="合同名称" field="contractName"></vxe-column>
                 <vxe-column width="100px" title="借用人" field="borrowName" ></vxe-column>
                 <vxe-column width="100px" title="借用状态" field="borrowType" >
                   <template slot-scope="scope">
@@ -49,7 +49,8 @@
 </template>
 
 <script>
-  import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  // import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
+  import CwWorkContractBorrowService from '@/api/cw/workContract/CwWorkContractBorrowService'
   export default {
     data () {
       return {
@@ -59,9 +60,11 @@
         dataList: []
       }
     },
-    workContractBorrowService: null,
+    cwWorkContractBorrowService: null,
+    // workContractBorrowService: null,
     created () {
-      this.workContractBorrowService = new WorkContractBorrowService()
+      this.cwWorkContractBorrowService = new CwWorkContractBorrowService()
+      // this.workContractBorrowService = new WorkContractBorrowService()
     },
     methods: {
       // 获取数据列表
@@ -69,10 +72,14 @@
         this.loading = true
         this.visible = true
         this.title = '合同借用详情'
-        this.workContractBorrowService.findMessageList(id).then(({data}) => {
+        this.cwWorkContractBorrowService.findMessageList(id).then(({data}) => {
           this.dataList = data
           this.loading = false
         })
+        // this.workContractBorrowService.findMessageList(id).then(({data}) => {
+        //   this.dataList = data
+        //   this.loading = false
+        // })
       },
       close () {
         this.visible = false