Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

lizhenhao 2 tahun lalu
induk
melakukan
b5a4491c17

+ 46 - 0
src/api/cw/reportCancellApply/ReportCancellApplyService.js

@@ -0,0 +1,46 @@
+import request from '@/utils/httpRequest'
+
+export default class ReportCancellApplyService {
+  findList (params) {
+    return request({
+      url: '/cwProjectReportCancell/findList',
+      method: 'get',
+      params: params
+    })
+  }
+  list (params) {
+    return request({
+      url: '/cwProjectReportCancell/list',
+      method: 'get',
+      params: params
+    })
+  }
+  saveForm (inputForm) {
+    return request({
+      url: `/cwProjectReportCancell/saveForm`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+  queryById (id) {
+    return request({
+      url: '/cwProjectReportCancell/queryById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  updateStatusById (data) {
+    return request({
+      url: '/cwProjectReportCancell/updateStatusById',
+      method: 'post',
+      data: data
+    })
+  }
+  delete (ids) {
+    return request({
+      url: '/cwProjectReportCancell/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+}

+ 157 - 0
src/views/modules/cw/reportCancellApply/ReportCancellApplyChooseCom.vue

@@ -0,0 +1,157 @@
+<template>
+  <div>
+    <el-dialog
+      title="选择报告申请信息"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      append-to-body
+      @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="projectName">
+            <el-input size="small" v-model="searchForm.projectName" 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="projectTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}"
+        >
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="radio" width="40px"></vxe-column>
+          <vxe-column min-width="230" align="center" title="报告文号" field="reportNo"></vxe-column>
+          <vxe-column min-width="230" align="center" title="单据状态" field="documentStatus"></vxe-column>
+          <vxe-column min-width="230" align="center" title="项目名称" field="projectName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="报告申请单号" field="documentNo"></vxe-column>
+
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getProject()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import InputNumber from '@/views/modules/sys/workContract/InputNumber.vue'
+  // import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  import ReportCancellApplyService from '@/api/cw/reportCancellApply/ReportCancellApplyService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          projectName: ''
+        }
+      }
+    },
+    // projectRecordsService: null,
+    reportCancellApplyService: null,
+    created () {
+      // this.projectRecordsService = new ProjectRecordsService()
+      this.reportCancellApplyService = new ReportCancellApplyService()
+    },
+    components: {
+      SelectUserTree,
+      InputNumber
+    },
+    methods: {
+      init () {
+        this.visible = true
+        this.list()
+      },
+      // 表单提交
+      getProject () {
+        let row = this.$refs.projectTable.getRadioRecord()
+        if (this.commonJS.isEmpty(row)) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        this.close()
+        this.$emit('getProject', row)
+      },
+      list () {
+        this.loading = true
+        this.searchForm.createId = this.$store.state.user.id
+        this.searchForm.status = '5'
+        this.reportCancellApplyService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-dialog__body {
+    padding-top: 0px;
+    padding-bottom: 15px;
+  }
+</style>

+ 521 - 0
src/views/modules/cw/reportCancellApply/ReportCancellApplyForm.vue

@@ -0,0 +1,521 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1200px"
+      height="500px"
+      @close="close"
+      @keyup.enter.native=""
+      :visible.sync="visible">
+      <el-row>
+        <el-row>
+          <el-col :span="24">
+
+            <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+                     label-width="135px" @submit.native.prevent>
+              <el-row  :gutter="15">
+                <el-col :span="12">
+                  <el-form-item label="报告文号" prop="reportNo"
+                                :rules="[
+
+                   ]">
+                    <el-input size="medium" :readonly="true" @focus="openContractForm()" v-model="inputForm.reportNo" placeholder="请填写报告文号">
+                      <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>
+                    </el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="项目名称" prop="projectName"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.projectName" placeholder="请填写项目名称" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="报告主办人" prop="reportSponsor"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.reportSponsor" placeholder="请填写报告主办人" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="项目经理" prop="projectMasterName"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.projectMasterName" placeholder="请填写项目经理" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+
+                <el-col :span="12">
+                  <el-form-item label="创建人" prop="createBy.name"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.createBy.name" placeholder="请填写创建人" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="创建时间" prop="createDate"
+                                :rules="[
+                   ]">
+                    <el-input :disabled="true" v-model="inputForm.createDate" placeholder="请填写创建时间" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                  <el-form-item label="作废原因" prop="cancellateReason"
+                                :rules="[
+                   ]">
+                    <el-input v-model="inputForm.cancellateReason" placeholder="请填写作废原因" clearable></el-input>
+                  </el-form-item>
+                </el-col>
+
+              </el-row>
+            </el-form>
+          </el-col>
+        </el-row>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" v-if="method === 'edit'" type="primary" icon="el-icon-circle-check" @click="doSubmit('save')">确定</el-button>
+    </span>
+<!--      <UpLoadComponentDialog ref="upLoadComponentDialog" @getUpload="getUpload"></UpLoadComponentDialog>-->
+<!--      <WorkContractChooseCom ref="workContractChooseCom" @getContract="getContract"></WorkContractChooseCom>-->
+<!--      <WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>-->
+      <ReportCancellApplyChooseCom  ref="reportCancellApplyChooseCom" @getProject="getContract"></ReportCancellApplyChooseCom>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import ReportCancellApplyService from '@/api/cw/reportCancellApply/ReportCancellApplyService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import UserSelect from '@/components/userSelect'
+  import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  import EnterpriseSearchService from '@/api/cw/common/EnterpriseSearchService'
+  import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
+  import WorkContractChooseCom from '../projectRecords/WorkContractChooseCom'
+  import ProjectReportService from '@/api/cw/reportManagement/ProjectReportService'
+  import UpLoadComponentDialog from '@/views/common/UpLoadComponentDialog'
+  import ReportCancellApplyChooseCom from './ReportCancellApplyChooseCom'
+  export default {
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      },
+      status: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        title: '',
+        method: '',
+        loading: false,
+        inputForm: {
+          projectId: '',
+          reportNewLineId: '',
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: JSON.parse(localStorage.getItem('user')).name
+          },
+          remarks: '',
+          reportNo: '',
+          projectName: '',
+          cancellateReason: '',
+          reportSponsor: '',
+          projectMasterName: '',
+          cwFileInfoList: [],
+          servedUnitId: '',
+          status: ''
+        },
+        keyWatch: '',
+        activeName: 'newRow',
+        tableKey: '',
+        tableKeyClient: '1',
+        visible: false
+      }
+    },
+    ReportCancellApplyService: null,
+    projectRecordsService: null,
+    enterpriseSearchService: null,
+    projectReportService: null,
+    created () {
+      this.enterpriseSearchService = new EnterpriseSearchService()
+      this.projectReportService = new ProjectReportService()
+      this.projectRecordsService = new ProjectRecordsService()
+      this.reportCancellApplyService = new ReportCancellApplyService()
+    },
+    computed: {
+      bus: {
+        get () {
+          this.$refs.uploadComponent.setDividerName('附件', false)
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      }
+    },
+    watch: {
+      'keyWatch': {
+        handler (newVal) {
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        }
+      }
+    },
+    components: {
+      SelectUserTree,
+      UpLoadComponent,
+      SelectTree,
+      UserSelect,
+      WorkClientChooseForm,
+      WorkContractChooseCom,
+      UpLoadComponentDialog,
+      ReportCancellApplyChooseCom
+    },
+    methods: {
+      openContractForm () {
+        if (!this.commonJS.isEmpty(this.inputForm.contractId)) {
+          this.$refs.reportCancellApplyChooseCom.init()
+        } else {
+          this.$refs.reportCancellApplyChooseCom.init()
+        }
+      },
+      seeFileInfo (index) {
+        if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].cwFileInfoList)) {
+          this.inputForm.cwProjectInfoList[index].cwFileInfoList = []
+        }
+        this.$refs.upLoadComponentDialog.newUpload('view', this.inputForm.cwProjectInfoList[index].cwFileInfoList, null, null, null, null, null, false, index)
+      },
+      sss (index) {
+        if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].cwFileInfoList)) {
+          this.inputForm.cwProjectInfoList[index].cwFileInfoList = []
+        }
+        this.$refs.upLoadComponentDialog.newUpload(null, this.inputForm.cwProjectInfoList[index].cwFileInfoList, null, null, null, null, null, false, index)
+      },
+      getUpload (p, index) {
+        p.then((list) => {
+          // list为返回数据
+          this.inputForm.cwProjectInfoList[index].cwFileInfoList = list
+          this.inputForm.cwProjectInfoList[index].fileNumber = list.length
+          this.tableKeyClient = Math.random()
+          console.log('this.inputForm.cwFileInfoList', this.inputForm.cwFileInfoList)
+          console.log('list.length', list.length)
+          console.log(list)
+        })
+      },
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
+      init (method, id) {
+        this.visible = true
+        if (method === 'edit') {
+          this.title = '项目信息修改'
+          this.method = method
+        } else {
+          this.title = '项目详情'
+          this.method = 'view'
+        }
+        this.activeName = 'newRow'
+        this.projectRecordsService = new ProjectRecordsService()
+        this.projectReportService = new ProjectReportService()
+        this.reportCancellApplyService = new ReportCancellApplyService()
+        this.method = method
+        this.inputForm = {
+          projectId: '',
+          reportNewLineId: '',
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: JSON.parse(localStorage.getItem('user')).name
+          },
+          remarks: '',
+          reportNo: '',
+          projectName: '',
+          cancellateReason: '',
+          reportSponsor: '',
+          projectMasterName: ''
+        }
+        this.inputForm.id = id
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = true
+          this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
+            // this.$refs.uploadComponent.clearUpload()
+            this.inputForm = this.recover(this.inputForm, data)
+            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+              this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+            }
+            this.loading = false
+          })
+          // this.projectRecordsService.queryById(this.inputForm.id).then(({data}) => {
+          //   // this.$refs.uploadComponent.clearUpload()
+          //   this.inputForm = this.recover(this.inputForm, data)
+          //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+          //   if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+          //     this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          //   }
+          //   this.loading = false
+          // })
+        })
+      },
+      saveForm (callback) {
+        this.doSubmit('save', callback)
+      },
+      startForm (callback) {
+        this.doSubmit('start', callback)
+      },
+      async agreeForm (callback) {
+        await this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
+          if (this.inputForm.status !== '2') { // 审核状态不是“待审核”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error()
+          } else {
+            this.doSubmit('agree', callback)
+          }
+        })
+      },
+      // 表单提交
+      // 表单提交
+      doSubmit (status, callback) {
+        if (status === 'save') {
+          // 暂存
+          // this.inputForm.status = '1'
+          this.loading = true
+          // if (this.$refs.uploadComponent.checkProgress()) {
+          //   this.loading = false
+          //   return
+          // }
+          // this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+          // this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          this.reportCancellApplyService.saveForm(this.inputForm).then(({data}) => {
+            // callback(data.businessTable, data.businessId, this.inputForm)
+            this.close()
+            this.loading = false
+          }).catch(() => {
+            this.loading = false
+          })
+          return
+        } else if (status === 'start') {
+          // 送审  待审核
+          this.inputForm.status = '2'
+        } else if (status === 'agree') {
+          // 审核同意
+          this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          this.inputForm.agreeUserId = this.$store.state.user.id
+          this.inputForm.status = '5'
+        }
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            // if (this.$refs.uploadComponent.checkProgress()) {
+            //   this.loading = false
+            //   return
+            // }
+            // this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+            if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+              this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+            }
+            this.inputForm.cwProjectInfoList.forEach((item, index) => {
+              if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].reportDate)) {
+                this.$message.error('报告日期不能为空')
+                this.loading = false
+                throw new Error('报告日期不能为空')
+              }
+              if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].reportType)) {
+                this.$message.error('报告类型不能为空')
+                this.loading = false
+                throw new Error('报告类型不能为空')
+              }
+              if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList[index].opinionType)) {
+                this.$message.error('意见类型不能为空')
+                this.loading = false
+                throw new Error('意见类型不能为空')
+              }
+            })
+            this.projectReportService.saveForm(this.inputForm).then(({data}) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      async updateStatusById (type) {
+        if (type === 'reject' || type === 'reback') {
+          // if (await this.$refs.uploadComponent.checkProgress()) {
+          //   this.loading = false
+          //   throw new Error()
+          // }
+          await this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
+            if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error()
+            } else {
+              if (type === 'reject') {
+                // 驳回
+                this.inputForm.status = '4'
+                let param = {status: '4', id: this.inputForm.id}
+                this.reportCancellApplyService.updateStatusById(param)
+              }
+              if (type === 'reback') {
+                // 撤回
+                let param = {status: '3', id: this.inputForm.id}
+                this.reportCancellApplyService.updateStatusById(param)
+              }
+            }
+          })
+        }
+      },
+      close () {
+        this.inputForm = {
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: ''
+          },
+          remarks: '',
+          projectNumber: '',
+          projectName: '',
+          officeId: '',
+          projectMoney: '',
+          auditYear: '',
+          planStartDate: '',
+          planEndDate: '',
+          projectMasterId: '',
+          projectLeaderId: '',
+          procInsId: '',
+          processDefinitionId: '',
+          status: '',
+          workAttachmentDtoList: [],
+          cwProjectClientInfoDTOList: [],
+          contractName: '',
+          contractAmount: '',
+          contractNum: '',
+          payerSubject: '',
+          paymentMethod: '',
+          contractId: ''
+        }
+        // this.$refs.uploadComponent.clearUpload()
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+      },
+      tabHandleClick (event) {
+        // console.log(event)
+      },
+      // 新增
+      // eslint-disable-next-line no-dupe-keys
+      // insertEvent (type) {
+      //   if (type === 'client') {
+      //     let d = {
+      //       no: '',
+      //       name: '',
+      //       companyLevel: ''
+      //     }
+      //     if (this.commonJS.isEmpty(this.inputForm.cwProjectClientInfoDTOList)) {
+      //       this.inputForm.cwProjectClientInfoDTOList = []
+      //     }
+      //     this.$refs.clientTable.insertAt(d)
+      //     this.inputForm.cwProjectClientInfoDTOList.push(d)
+      //     this.tableKeyClient = Math.random()
+      //   }
+      // },
+      clearClientList () {
+        // 项目直接对接联系人列表清除
+        this.inputForm.clientList = []
+        this.$forceUpdate()
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'client') {
+          this.$refs.clientTable.remove(row)
+          // this.inputForm.cwProjectClientInfoDTOList.splice(rowIndex, 1)
+          this.inputForm.cwProjectInfoList.splice(rowIndex, 1)
+        }
+      },
+      openWorkClient () {
+        this.$refs.workClientChooseForm.init()
+      },
+      getWorkClientChoose (list) {
+        if (this.commonJS.isEmpty(this.inputForm.cwProjectInfoList)) {
+          this.inputForm.cwProjectInfoList = []
+        }
+        let _this = this
+        let _list = list
+        const waitForEach = function () {
+          return new Promise(function (resolve, reject) {
+            _list.forEach((item) => {
+              _this.inputForm.cwProjectInfoList.forEach(client => {
+                if (item.id === client.servedUnitId) {
+                  // _this.$message.error('已存在客户 “' + client.servedUnitName + '”,请重新选择')
+                  // throw new Error('已存在客户 “' + client.servedUnitName + '”,请重新选择')
+                }
+              })
+            })
+            resolve()
+          })
+        }
+        waitForEach().then(() => {
+          list.forEach(item => {
+            // eslint-disable-next-line no-unused-vars
+            let d = {
+              servedUnitName: item.name, // 被服务单位名称
+              reportNumber: this.inputForm.projectNumber + '-0' + (this.inputForm.cwProjectInfoList.length + 1), // 报告流水号
+              issueReport: '是',
+              sealType: '未盖章',
+              id: this.uuid,
+              servedUnitId: item.id
+            }
+            console.log('新增行数据填入')
+            console.log('item', item)
+            console.log('d', d)
+            this.$refs.clientTable.insertAt(d)
+            this.inputForm.cwProjectInfoList.push(d)
+            console.log('this.inputForm.cwProjectInfoList', this.inputForm.cwProjectInfoList)
+            this.tableKeyClient = Math.random()
+          })
+        })
+      },
+      getContract (row) {
+        console.log('row', row)
+        this.inputForm.projectName = row.projectName // 项目名称
+        this.inputForm.projectId = row.id // 项目id
+        this.inputForm.projectMasterName = row.projectMasterName // 项目经理
+        this.inputForm.reportNo = row.reportNo // 报告文号
+        this.inputForm.reportNewLineId = row.reportNewLineId // 新建行id
+        this.clearClientList()
+        this.$forceUpdate()
+      },
+      openContract () {
+        this.$refs.workContractChooseCom.init()
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-input-number .el-input__inner {
+    text-align: left;
+  }
+</style>

+ 406 - 0
src/views/modules/cw/reportCancellApply/ReportCancellApplyList.vue

@@ -0,0 +1,406 @@
+<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="projectNumber">
+        <el-input size="small" v-model="searchForm.projectNumber" placeholder="请输入项目编号" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="项目名称" prop="projectName">
+        <el-input size="small" v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="项目经理" prop="projectMaster">
+        <el-input size="small" v-model="searchForm.projectMaster" placeholder="请输入项目经理" clearable></el-input>
+      </el-form-item>
+<!--      <el-form-item label="创建人" prop="createBy">-->
+<!--        <el-input size="small" v-model="searchForm.createBy" placeholder="请输入创建人" clearable></el-input>-->
+<!--      </el-form-item>-->
+      <el-form-item label="创建人" prop="createBy">
+        <SelectUserTree
+          ref="companyTree"
+          :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+          :url="`/sys/user/treeUserDataAllOffice?type=2`"
+          :value="searchForm.createBy"
+          :clearable="true"
+          :accordion="true"
+          @getValue="(value) => {searchForm.createBy=value}"/>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="contractDates">
+        <el-date-picker
+          placement="bottom-start"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          v-model="searchForm.contractDates"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </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('cw_work_client:info:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 90px)">
+        <vxe-table
+          :key="tableKey"
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="clientTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column min-width="160" align="center" title="单据编号" field="documentNo">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('cwProjectReport:list')" @click="view(scope.row.id)">{{scope.row.documentNo}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('cwProjectReport:list')"  @click="view(scope.row.id,)">{{scope.row.documentNo}}</el-link>
+              <span v-else>{{scope.row.documentNo}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column min-width="160" align="center" title="项目编号" field="projectNumber"></vxe-column>
+          <vxe-column min-width="160" align="center" title="项目名称" field="projectName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="报告所属部门" field="departmentName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="项目经理" field="projectMasterName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="报告主办人" field="reportSponsor"></vxe-column>
+          <vxe-column min-width="160" align="center" title="创建人" field="userName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="创建时间" field="createDate"></vxe-column>
+          <vxe-column  min-width="150px"align="center" fixed="right" title="状态" field="status" >
+            <template slot-scope="scope">
+              <el-button  type="text" @click="detail(scope.row)" effect="dark" size="mini"
+                          :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.status, '-')">
+                {{$dictUtils.getDictLabel("cw_status", scope.row.status, '-')}}
+              </el-button>
+            </template>
+          </vxe-column>
+
+          <vxe-column title="操作" width="150px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('cwProjectReport:edit')&&scope.row.createById === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text" icon="el-icon-edit" size="small" @click="push(scope.row)">修改</el-button>
+              <el-button v-else-if="hasPermission('cwProjectReport:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('cwProjectReport:edit')&&scope.row.createById === $store.state.user.id&&scope.row.status==='2'" type="text" icon="el-icon-edit" size="small" @click="reback(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('cwProjectReport:del')&&scope.row.createById === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-else-if="hasPermission('cwProjectReport:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+<!--    <ReportManagementForm ref="reportManagementForm"></ReportManagementForm>-->
+    <ReportCancellApplyForm ref="reportCancellApplyForm"></ReportCancellApplyForm>
+  </div>
+</template>
+
+<script>
+  import WorkClientService from '@/api/cw/workClientInfo/WorkClientService'
+  // import ProjectReportService from '@/api/cw/reportManagement/ProjectReportService'
+  import ReportCancellApplyService from '@/api/cw/reportCancellApply/ReportCancellApplyService'
+  import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  // import ReportManagementForm from '../reportManagement/ReportManagementForm'
+  import ReportCancellApplyForm from './ReportCancellApplyForm'
+  import pick from 'lodash.pick'
+  import UserService from '@/api/sys/UserService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          projectNumber: '',
+          projectName: '',
+          projectMaster: '',
+          createBy: '',
+          contractDates: []
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        tableKey: '',
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false,
+        create: ''
+      }
+    },
+    workClientService: null,
+    // projectReportService: null,
+    reportCancellApplyService: null,
+    taskService: null,
+    processService: null,
+    userService: null,
+    created () {
+      this.workClientService = new WorkClientService()
+      // this.projectReportService = new ProjectReportService()
+      this.reportCancellApplyService = new ReportCancellApplyService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+      this.userService = new UserService()
+    },
+    components: {
+      // ReportManagementForm
+      ReportCancellApplyForm,
+      SelectUserTree
+    },
+    computed: {
+      userName () {
+        return JSON.parse(localStorage.getItem('user')).name
+      },
+      user () {
+        this.createName = JSON.parse(localStorage.getItem('user')).name
+        return JSON.parse(localStorage.getItem('user'))
+      }
+    },
+    mounted () {
+      this.refreshList()
+    },
+    activated () {
+      this.refreshList()
+    },
+    methods: {
+      // 新增
+      add () {
+        // this.$refs.reportManagementForm.init('add', '')
+        this.$refs.reportCancellApplyForm.init('add', '')
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.clientTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        // this.$refs.reportManagementForm.init('edit', id)
+        this.$refs.reportCancellApplyForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        // this.$refs.reportManagementForm.init('view', id)
+        this.$refs.reportCancellApplyForm.init('view', id)
+      },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.reportCancellApplyService.findList({
+          '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.tableKey = Math.random()
+          this.loading = false
+        })
+        // this.projectReportService.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.tableKey = Math.random()
+        //   this.loading = false
+        // })
+        this.checkIsAdmin()
+        this.processService.getByName('财务-报告作废申请').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionAuditId = data.id
+            this.procDefAuditKey = data.key
+          }
+        })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.tablePage.orders = []
+        if (column.order != null) {
+          this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.clientTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.reportCancellApplyService.delete(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+          // this.projectReportService.delete(ids).then(({data}) => {
+          //   this.$message.success(data)
+          //   this.refreshList()
+          //   this.loading = false
+          // })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      start () {
+        // 读取流程表单
+        let tabTitle = `发起流程【报告作废申请】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [报告作废申请]`
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          status: 'startAndHold'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                status: 'startAndHold',
+                title: tabTitle,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessId: 'false',
+                isShow: false,
+                routePath: '/cw/reportCancellApply/ReportCancellApplyList'
+              }
+            })
+          })
+      },
+      // 发起客户登记
+      push (row) {
+        // 读取流程表单
+        let title = `发起流程【报告作废申请】`
+        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[报告作废申请]`
+        let status = 'startAndHold'
+        if (row.status === '3' || row.status === '4') {
+          status = 'startAndClose'
+        }
+        this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
+          businessId: row.id,
+          businessTable: 'cw_project_report_cancell_apply'}).then((data) => {
+            this.$router.push({
+              path: '/flowable/task/TaskForm',
+              query: {
+                procDefId: this.processDefinitionAuditId,
+                procDefKey: this.procDefAuditKey,
+                title: title,
+                formType: data.data.formType,
+                formUrl: data.data.formUrl,
+                formTitle: processTitle,
+                businessTable: 'cw_project_report_cancell_apply',
+                businessId: row.id,
+                isShow: 'false',
+                status: status,
+                routePath: '/cw/reportCancellApply/ReportCancellApplyList'
+              }
+            })
+          })
+      },
+      // 查看客户登记流程结果
+      detail (row) {
+        if (row.status !== '0' && row.status !== '1') {
+          // eslint-disable-next-line eqeqeq
+          this.taskService.getTaskDef({
+            procInsId: row.procInsId,
+            procDefId: this.processDefinitionAuditId
+          }).then(({data}) => {
+            this.$router.push({
+              path: '/flowable/task/TaskFormDetail',
+              query: {
+                isShow: 'false',
+                readOnly: true,
+                title: '质控管理' + '流程详情',
+                formTitle: '质控管理' + '流程详情',
+                businessId: row.id,
+                status: 'reback',
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
+              }
+            })
+          })
+        }
+      },
+      // 撤回报告流程
+      reback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          await this.reportCancellApplyService.queryById(row.id).then(({data}) => {
+            if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+              this.$message.error('数据已发生改变或不存在,请刷新数据')
+              this.refreshList()
+            } else {
+              this.processService.revokeProcIns(row.procInsId).then(({data}) => {
+                let form = {status: '3', id: row.id}
+                this.reportCancellApplyService.updateStatusById(form)
+                this.$message.success(data)
+                this.refreshList()
+              })
+            }
+          })
+          // await this.projectReportService.queryById(row.id).then(({data}) => {
+          //   if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+          //     this.$message.error('数据已发生改变或不存在,请刷新数据')
+          //     this.refreshList()
+          //   } else {
+          //     this.processService.revokeProcIns(row.procInsId).then(({data}) => {
+          //       let form = {status: '3', id: row.id}
+          //       this.projectReportService.updateStatusById(form)
+          //       this.$message.success(data)
+          //       this.refreshList()
+          //     })
+          //   }
+          // })
+        })
+      }
+    }
+  }
+</script>

+ 399 - 0
src/views/modules/cw/reportCancellApply/ReportCancellApplyTaskForm.vue

@@ -0,0 +1,399 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+    <el-row>
+      <el-col :span="24">
+
+        <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="formReadOnly"
+                 label-width="135px" @submit.native.prevent>
+          <el-row  :gutter="15">
+            <el-col :span="12">
+              <el-form-item label="报告文号" prop="reportNo"
+                            :rules="[
+
+                   ]">
+                <el-input size="medium" :readonly="true" @focus="openContractForm()" v-model="inputForm.reportNo" placeholder="请填写报告文号">
+                  <el-button slot="append" icon="el-icon-search" @click="openContractForm()"></el-button>
+                </el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="项目名称" prop="projectName"
+                            :rules="[
+                   ]">
+                <el-input :disabled="true" v-model="inputForm.projectName" placeholder="请填写项目名称" clearable></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="报告主办人" prop="reportSponsor"
+                            :rules="[
+                   ]">
+                <el-input :disabled="true" v-model="inputForm.reportSponsor" placeholder="请填写报告主办人" clearable></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="项目经理" prop="projectMasterName"
+                            :rules="[
+                   ]">
+                <el-input :disabled="true" v-model="inputForm.projectMasterName" placeholder="请填写项目经理" clearable></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="创建人" prop="createBy.name"
+                            :rules="[
+                   ]">
+                <el-input :disabled="true" v-model="inputForm.createBy.name" placeholder="请填写创建人" clearable></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="创建时间" prop="createDate"
+                            :rules="[
+                   ]">
+                <el-input :disabled="true" v-model="inputForm.createDate" placeholder="请填写创建时间" clearable></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="作废原因" prop="cancellateReason"
+                            :rules="[
+                   ]">
+                <el-input v-model="inputForm.cancellateReason" placeholder="请填写作废原因" clearable></el-input>
+              </el-form-item>
+            </el-col>
+
+          </el-row>
+        </el-form>
+      </el-col>
+    </el-row>
+    <ReportCancellApplyChooseCom  ref="reportCancellApplyChooseCom" @getProject="getContract"></ReportCancellApplyChooseCom>
+  </div>
+</template>
+
+<script>
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import UserSelect from '../workClientInfo/clientUserSelect'
+  import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
+  // import ProjectReportService from '@/api/cw/reportManagement/ProjectReportService'
+  import ReportCancellApplyService from '@/api/cw/reportCancellApply/ReportCancellApplyService'
+  import EnterpriseSearchService from '@/api/cw/common/EnterpriseSearchService'
+  import ReportCancellApplyChooseCom from './ReportCancellApplyChooseCom'
+  export default {
+    props: {
+      businessId: {
+        type: String,
+        default: ''
+      },
+      formReadOnly: {
+        type: Boolean,
+        default: false
+      },
+      status: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        title: '',
+        method: '',
+        loading: false,
+        inputForm: {
+          projectId: '',
+          reportNewLineId: '',
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: JSON.parse(localStorage.getItem('user')).name
+          },
+          remarks: '',
+          reportNo: '',
+          projectName: '',
+          cancellateReason: '',
+          reportSponsor: '',
+          projectMasterName: '',
+          cwFileInfoList: [],
+          servedUnitId: '',
+          status: ''
+        },
+        keyWatch: '',
+        activeName: 'newRow',
+        tableKey: '',
+        tableKeyClient: '1'
+      }
+    },
+    projectRecordsService: null,
+    // ProjectReportService: null,
+    ReportCancellApplyService: null,
+    enterpriseSearchService: null,
+    created () {
+      this.enterpriseSearchService = new EnterpriseSearchService()
+      this.projectRecordsService = new ProjectRecordsService()
+      // this.projectReportService = new ProjectReportService()
+      this.reportCancellApplyService = new ReportCancellApplyService()
+    },
+    computed: {
+      bus: {
+        get () {
+          return this.businessId
+        },
+        set (val) {
+          this.businessId = val
+        }
+      }
+    },
+    watch: {
+      'keyWatch': {
+        handler (newVal) {
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
+          } else {
+            this.$nextTick(() => {
+              this.$refs.inputForm.resetFields()
+            })
+          }
+        }
+      }
+    },
+    components: {
+      SelectUserTree,
+      UpLoadComponent,
+      SelectTree,
+      UserSelect,
+      ReportCancellApplyChooseCom
+    },
+    methods: {
+      getKeyWatch (keyWatch) {
+        this.keyWatch = keyWatch
+      },
+      init (method, id) {
+        this.activeName = 'newRow'
+        this.projectRecordsService = new ProjectRecordsService()
+        // this.projectReportService = new ProjectReportService()
+        this.reportCancellApplyService = new ReportCancellApplyService()
+        this.method = method
+        this.inputForm = {
+          projectId: '',
+          reportNewLineId: '',
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: JSON.parse(localStorage.getItem('user')).name
+          },
+          remarks: '',
+          reportNo: '',
+          projectName: '',
+          cancellateReason: '',
+          reportSponsor: '',
+          projectMasterName: ''
+        }
+        this.inputForm.id = id
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          this.loading = true
+          this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
+            // this.$refs.uploadComponent.clearUpload()
+            this.inputForm = this.recover(this.inputForm, data)
+            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+              this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+            }
+            this.loading = false
+          })
+          // this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+          //   // this.$refs.uploadComponent.clearUpload()
+          //   this.inputForm = this.recover(this.inputForm, data)
+          //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+          //   if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+          //     this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          //   }
+          //   this.loading = false
+          // })
+        })
+      },
+      openContractForm () {
+        if (!this.commonJS.isEmpty(this.inputForm.contractId)) {
+          this.$refs.reportCancellApplyChooseCom.init()
+        } else {
+          this.$refs.reportCancellApplyChooseCom.init()
+        }
+      },
+      getContract (row) {
+        console.log('row', row)
+        this.inputForm.projectName = row.projectName // 项目名称
+        this.inputForm.projectId = row.id // 项目id
+        this.inputForm.projectMasterName = row.projectMasterName // 项目经理
+        this.inputForm.reportNo = row.reportNo // 报告文号
+        this.inputForm.reportNewLineId = row.reportNewLineId // 新建行id
+        this.clearClientList()
+        this.$forceUpdate()
+      },
+      clearClientList () {
+        // 项目直接对接联系人列表清除
+        this.inputForm.clientList = []
+        this.$forceUpdate()
+      },
+      saveForm (callback) {
+        this.doSubmit('save', callback)
+      },
+      startForm (callback) {
+        this.doSubmit('start', callback)
+      },
+      async agreeForm (callback) {
+        await this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
+          console.log('进来了看看data', data)
+          if (data.status !== '2') { // 审核状态不是“待审核”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error()
+          } else {
+            this.doSubmit('agree', callback)
+          }
+        })
+        // await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+        //   console.log('进来了看看data', data)
+        //   if (data.status !== '2') { // 审核状态不是“待审核”,就弹出提示
+        //     this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+        //     throw new Error()
+        //   } else {
+        //     this.doSubmit('agree', callback)
+        //   }
+        // })
+      },
+      // 表单提交
+      doSubmit (status, callback) {
+        if (status === 'save') {
+          // 暂存
+          this.inputForm.status = '1'
+          this.loading = true
+          this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          // 验证报告 日期报告 类型是否出具报告 意见类型 是否为空
+          // eslint-disable-next-line no-unused-expressions
+          this.reportCancellApplyService.saveForm(this.inputForm).then(({data}) => {
+            callback(data.businessTable, data.businessId, this.inputForm)
+            this.loading = false
+          }).catch(() => {
+            this.loading = false
+          })
+          // this.projectReportService.saveForm(this.inputForm).then(({data}) => {
+          //   callback(data.businessTable, data.businessId, this.inputForm)
+          //   this.loading = false
+          // }).catch(() => {
+          //   this.loading = false
+          // })
+          return
+        } else if (status === 'start') {
+          // 送审  待审核
+          this.inputForm.status = '2'
+        } else if (status === 'agree') {
+          // 审核同意
+          this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          this.inputForm.agreeUserId = this.$store.state.user.id
+          this.inputForm.status = '5'
+        }
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+              this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+            }
+            this.reportCancellApplyService.saveForm(this.inputForm).then(({data}) => {
+              console.log('businessTable', data.businessTable)
+              console.log('businessId', data.businessId)
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+            // this.projectReportService.saveForm(this.inputForm).then(({data}) => {
+            //   console.log('businessTable', data.businessTable)
+            //   console.log('businessId', data.businessId)
+            //   callback(data.businessTable, data.businessId, this.inputForm)
+            //   this.loading = false
+            // }).catch(() => {
+            //   this.loading = false
+            // })
+          }
+        })
+      },
+      async updateStatusById (type) {
+        if (type === 'reject' || type === 'reback') {
+          await this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
+            if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error()
+            } else {
+              if (type === 'reject') {
+                // 驳回
+                this.inputForm.status = '4'
+                let param = {status: '4', id: this.inputForm.id}
+                this.reportCancellApplyService.updateStatusById(param)
+                // this.projectRecordsService.updateStatusById(param)
+              }
+              if (type === 'reback') {
+                // 撤回
+                let param = {status: '3', id: this.inputForm.id}
+                // this.projectRecordsService.updateStatusById(param)
+                this.reportCancellApplyService.updateStatusById(param)
+              }
+            }
+          })
+          // await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+          //   if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
+          //     this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          //     throw new Error()
+          //   } else {
+          //     if (type === 'reject') {
+          //       // 驳回
+          //       this.inputForm.status = '4'
+          //       let param = {status: '4', id: this.inputForm.id}
+          //       this.projectReportService.updateStatusById(param)
+          //       // this.projectRecordsService.updateStatusById(param)
+          //     }
+          //     if (type === 'reback') {
+          //       // 撤回
+          //       let param = {status: '3', id: this.inputForm.id}
+          //       // this.projectRecordsService.updateStatusById(param)
+          //       this.projectReportService.updateStatusById(param)
+          //     }
+          //   }
+          // })
+        }
+      },
+      close () {
+        this.inputForm = {
+          id: '',
+          createDate: '',
+          createBy: {
+            id: '',
+            name: JSON.parse(localStorage.getItem('user')).name
+          },
+          remarks: '',
+          reportNo: '',
+          projectName: '',
+          cancellateReason: '',
+          reportSponsor: '',
+          projectMasterName: ''
+        }
+        // this.$refs.uploadComponent.clearUpload()
+        this.$refs.inputForm.resetFields()
+      },
+      tabHandleClick (event) {
+        // console.log(event)
+      },
+      // 删除
+      removeEvent (row, rowIndex, type) {
+        if (type === 'client') {
+          this.$refs.clientTable.remove(row)
+        }
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-input-number .el-input__inner {
+    text-align: left;
+  }
+</style>

+ 3 - 3
src/views/modules/cw/reportManagement/ReportManagementForm.vue

@@ -137,7 +137,7 @@
             </el-form>
             <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
               <el-tab-pane label="报告信息列表" name="newRow">
-                <el-button type="primary" style="margin-bottom: 15px" size="mini" :disabled="formReadOnly" @click="openWorkClient"
+                <el-button type="primary" style="margin-bottom: 15px" size="mini" :disabled="method === 'view'" @click="openWorkClient"
                            v-if="inputForm.projectName !== '' & inputForm.projectName !== undefined"
                 >
                   新增行
@@ -233,8 +233,8 @@
                       </vxe-table-column>
                       <vxe-table-column align="center" title="操作" width="300">
                         <template v-slot="scope">
-                          <el-button size="mini" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
-                          <el-button size="mini" type="primary" @click="sss(scope.$rowIndex)">上传附件</el-button>
+                          <el-button size="mini" type="danger" :disabled="method === 'view'" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
+                          <el-button size="mini" type="primary" :disabled="method === 'view'" @click="sss(scope.$rowIndex)">上传附件</el-button>
                           <el-button size="mini" :disabled="false" type="primary" @click="seeFileInfo(scope.$rowIndex)">查看文件详情</el-button>
                         </template>
                       </vxe-table-column>

+ 18 - 5
src/views/modules/cw/reportManagement/ReportManagementList.vue

@@ -8,11 +8,22 @@
       <el-form-item label="项目名称" prop="projectName">
         <el-input size="small" v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
       </el-form-item>
-      <el-form-item label="项目经理" prop="projectMaster">
-        <el-input size="small" v-model="searchForm.projectMaster" placeholder="请输入项目经理" clearable></el-input>
+      <el-form-item label="项目经理" prop="projectMasterName">
+        <el-input size="small" v-model="searchForm.projectMasterName" placeholder="请输入项目经理" clearable></el-input>
       </el-form-item>
       <el-form-item label="创建人" prop="createBy">
-        <el-input size="small" v-model="searchForm.createBy" placeholder="请输入创建人" clearable></el-input>
+        <SelectUserTree
+          ref="companyTree"
+          :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+          :url="`/sys/user/treeUserDataAllOffice?type=2`"
+          :value="searchForm.createBy"
+          :clearable="true"
+          :accordion="true"
+          @getValue="(value) => {searchForm.createBy=value}"/>
       </el-form-item>
       <el-form-item label="创建时间" prop="contractDates">
         <el-date-picker
@@ -116,13 +127,14 @@
   import ReportManagementForm from './ReportManagementForm'
   import pick from 'lodash.pick'
   import UserService from '@/api/sys/UserService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   export default {
     data () {
       return {
         searchForm: {
           projectNumber: '',
           projectName: '',
-          projectMaster: '',
+          projectMasterName: '',
           createBy: '',
           contractDates: []
         },
@@ -154,7 +166,8 @@
       this.userService = new UserService()
     },
     components: {
-      ReportManagementForm
+      ReportManagementForm,
+      SelectUserTree
     },
     computed: {
       userName () {

+ 3 - 3
src/views/modules/cw/reportManagement/ReportManagementTaskForm.vue

@@ -207,7 +207,7 @@
                       <el-input :readonly="true" v-model="scope.row.issueReport" placeholder="是否出具报告" clearable></el-input>
                     </template>
                   </vxe-table-column>
-                  <vxe-table-column align="center" field="opinionType" title="意见类型" :edit-render="{}">
+                  <vxe-table-column align="center" field="opinionType" title="意见类型" :edit-render="{name: '$select', options: $dictUtils.getDictList('cw_opinion_type')}">
                     <template v-slot:edit="scope">
                       <el-select v-model="scope.row.opinionType" placeholder="请选择意见类型" clearable style="width: 100%;">
                         <el-option
@@ -248,7 +248,7 @@
     </el-row>
     <UpLoadComponentDialog ref="upLoadComponentDialog" @getUpload="getUpload"></UpLoadComponentDialog>
 <!--    <ProjectInfoForm  ref="projectInfoForm" @getContract="getContract"></ProjectInfoForm>-->
-    <ProjectRecoredChooseCom  ref="projectRecoredChooseCom" @getContract="getContract"></ProjectRecoredChooseCom>
+    <ProjectRecoredChooseCom  ref="projectRecoredChooseCom" @getProject="getContract"></ProjectRecoredChooseCom>
     <ReportServiceUnitForm ref="reportServiceUnitForm" @getWorkClientChoose="getWorkClientChoose"></ReportServiceUnitForm>
   </div>
 </template>
@@ -697,7 +697,7 @@
             // eslint-disable-next-line no-unused-vars
             let d = {
               servedUnitName: item.name, // 被服务单位名称
-              reportNumber: this.inputForm.projectNumber + '-0' + (this.inputForm.cwProjectInfoList.length + 1), // 报告流水号
+              // reportNumber: this.inputForm.projectNumber + '-0' + (this.inputForm.cwProjectInfoList.length + 1), // 报告流水号
               issueReport: '是',
               sealType: '未盖章',
               id: this.uuid,