Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

lizhenhao vor 2 Jahren
Ursprung
Commit
d41a48724f

+ 53 - 0
src/api/cw/projectRecords/ManHourManagementService.js

@@ -0,0 +1,53 @@
+import request from '@/utils/httpRequest'
+
+export default class ManHourManagementService {
+  list (params) {
+    return request({
+      url: '/manHourManagement/list',
+      method: 'get',
+      params: params
+    })
+  }
+  queryById (id) {
+    return request({
+      url: '/manHourManagement/queryById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  updateStatus (id) {
+    return request({
+      url: '/manHourManagement/updateStatus',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  save (inputForm) {
+    return request({
+      url: `/manHourManagement/save`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+  delete (ids) {
+    return request({
+      url: '/manHourManagement/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+  getByClientId (id, projectForm) {
+    return request({
+      url: '/cwProjectRecords/getByClientId',
+      method: 'get',
+      params: {clientId: id, ...projectForm}
+    })
+  }
+  getByContractId (id, projectForm) {
+    return request({
+      url: '/cwProjectRecords/getByContractId',
+      method: 'get',
+      params: {contractId: id, ...projectForm}
+    })
+  }
+}

+ 181 - 0
src/views/modules/cw/projectRecords/ManHourManagementForm.vue

@@ -0,0 +1,181 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      label-width="135px"
+      @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="120px" @submit.native.prevent>
+
+        <!--<el-divider content-position="left"><i class="el-icon-document"></i> 项目信息</el-divider>-->
+        <el-row  :gutter="0">
+          <el-col :span="12">
+            <el-form-item label="项目名称" prop="projectName"
+                          :rules="[
+                              {required: true, message:'项目名称不能为空', trigger:'blur'},
+                              {required: true, message:'项目名称不能为空', trigger:'change'}
+                   ]">
+              <el-input size="medium" :readonly="true" @focus="openContractForm()" v-model="inputForm.projectName" 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="projectNumber"
+                          :rules="[
+                   ]">
+              <el-input :disabled="true" v-model="inputForm.projectNumber" 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="planDate"
+                          :rules="[
+                                {required: true, message:'项目预计时间不能为空', trigger:'blur'}
+                   ]">
+              <el-date-picker
+                style="width: 100%"
+                placement="bottom-start"
+                format="yyyy-MM-dd"
+                value-format="yyyy-MM-dd"
+                v-model="inputForm.planDate"
+                type="datetimerange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                @change="forUpdate"
+                end-placeholder="结束日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+
+        </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>
+    <ProjectRecoredChooseCom  ref="projectRecoredChooseCom" @getProject="getContract"></ProjectRecoredChooseCom>
+  </div>
+</template>
+
+<script>
+  import ManHourManagementForm from '@/api/cw/projectRecords/ManHourManagementService'
+  import ProjectRecoredChooseCom from '../projectRecords/ProjectRecordsChooseCom'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          projectId: '',
+          projectName: '',
+          projectNumber: '',
+          planDate: [],
+          projectMasterName: ''
+        }
+      }
+    },
+    ManHourManagementForm: null,
+    created () {
+      this.manHourManagementForm = new ManHourManagementForm()
+    },
+
+    components: {
+      ProjectRecoredChooseCom
+    },
+    methods: {
+      forUpdate () {
+        this.$forceUpdate()
+      },
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          projectId: '',
+          projectName: '',
+          projectNumber: '',
+          planDate: [],
+          projectMasterName: ''
+        }
+        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 = '查看项目计划时间'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.manHourManagementForm.queryById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+          }
+        })
+      },
+      openContractForm () {
+        if (!this.commonJS.isEmpty(this.inputForm.contractId)) {
+          // this.$refs.projectInfoForm.init(this.inputForm.contractId)
+          this.$refs.projectRecoredChooseCom.init(this.inputForm.contractId)
+        } else {
+          this.$refs.projectRecoredChooseCom.init()
+        }
+      },
+      getContract (row) {
+        this.inputForm.projectName = row.projectName // 项目名称
+        this.inputForm.projectId = row.id // 项目id
+        this.inputForm.projectNumber = row.projectNumber // 项目编号
+        this.inputForm.projectMasterName = row.projectMasterName // 项目经理
+        this.clearClientList()
+        this.$forceUpdate()
+        this.inputForm.cwProjectInfoList = []
+      },
+      clearClientList () {
+        // 项目直接对接联系人列表清除
+        this.inputForm.clientList = []
+        this.$forceUpdate()
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.manHourManagementForm.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>

+ 292 - 0
src/views/modules/cw/projectRecords/ManHourManagementList.vue

@@ -0,0 +1,292 @@
+<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="projectName">
+        <el-input size="small" v-model="searchForm.projectName" placeholder="请输入项目名称" clearable></el-input>
+      </el-form-item>
+      <!--<el-form-item label="项目编号" prop="projectNumber">
+        <el-input size="small" v-model="searchForm.projectNumber" placeholder="请输入项目编号" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="项目经理" prop="projectMasterName">
+        <UserSelect :limit='1' :userName="searchForm.projectMasterName" @getValue='(value, label) => {searchForm.projectMasterName = label}'></UserSelect>
+      </el-form-item>-->
+      <!--<el-form-item label="开始时间" prop="createDates">
+        <el-date-picker
+          placement="bottom-start"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          v-model="searchForm.createDates"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="结束时间" prop="endDates">
+        <el-date-picker
+          placement="bottom-start"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          v-model="searchForm.endDates"
+          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}" export custom>
+        <template #buttons>
+          <el-button type="primary" size="small" icon="el-icon-plus" @click="add()">新建</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="projectTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :export-config="{
+                    remote: true,
+                    filename: `项目数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    sheetName: `项目数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    exportMethod: exportMethod,
+                    types: ['xlsx'],
+                    modes: ['current', 'selected', 'all']
+                  }"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="60" title="序号"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+          <vxe-column min-width="230" align="center" title="项目名称" field="projectName">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('manHourManagement:view')" @click="view(scope.row.id)">{{scope.row.projectName}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('manHourManagement:view')"  @click="view(scope.row.id,)">{{scope.row.projectName}}</el-link>
+              <span v-else>{{scope.row.projectName}}</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="projectMasterName"></vxe-column>
+          <vxe-column min-width="160" align="center" title="计划开始时间" field="planStartDate"></vxe-column>
+          <vxe-column min-width="160" align="center" title="计划结束时间" field="planEndDate"></vxe-column>
+          <vxe-column min-width="160" align="center" title="创建人" field="createBy.name"></vxe-column>
+          <vxe-column min-width="160" align="center" title="创建时间" field="createDate"></vxe-column>
+          <vxe-column min-width="100" align="center" title="确认状态" field="statusStr"></vxe-column>
+          <vxe-column title="操作" width="200px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('manHourManagement:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status === '0'" type="text"  size="small" @click="edit(scope.row.id)">编辑</el-button>
+              <el-button v-if="hasPermission('manHourManagement:edit')&&scope.row.status === '0'" type="text"   size="small" @click="isReceivables(scope.row)">确认工时</el-button>
+              <el-button v-if="hasPermission('manHourManagement:del')&&scope.row.status === '0'" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+    <ManHourManagementForm ref="manHourManagementForm" @refreshDataList="refreshList"></ManHourManagementForm>
+  </div>
+</template>
+
+<script>
+  import ManHourManagementService from '@/api/cw/projectRecords/ManHourManagementService'
+  import TaskService from '@/api/flowable/TaskService'
+  import ProcessService from '@/api/flowable/ProcessService'
+  import ManHourManagementForm from './ManHourManagementForm'
+  import UserService from '@/api/sys/UserService'
+  import UserSelect from '@/components/userSelect'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          projectMasterName: '',
+          projectNumber: '',
+          projectName: '',
+          createDates: [],
+          endDates: []
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        tableKey: '',
+        loading: false,
+        processDefinitionAuditId: '',
+        procDefAuditKey: '',
+        isAdmin: false
+      }
+    },
+    manHourManagementService: null,
+    taskService: null,
+    processService: null,
+    userService: null,
+    created () {
+      this.manHourManagementService = new ManHourManagementService()
+      this.taskService = new TaskService()
+      this.processService = new ProcessService()
+      this.userService = new UserService()
+    },
+    components: {
+      ManHourManagementForm,
+      UserSelect
+    },
+    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.manHourManagementForm.init('add', '')
+      },
+      // 修改
+      edit (id) {
+        this.$refs.manHourManagementForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.manHourManagementForm.init('view', id)
+      },
+      // 查询当前用户是否是管理员用户
+      checkIsAdmin () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.manHourManagementService.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()
+      },
+      isReceivables (row) {
+        this.$confirm(`是否确认工时?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.manHourManagementService.updateStatus(row.id).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+          })
+        })
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.projectTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.manHourManagementService.delete(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      // 自定义服务端导出
+      exportMethod ({ options }) {
+        // 传给服务端的参数
+        const params = {
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm,
+          filename: options.filename,
+          sheetName: options.sheetName,
+          isHeader: options.isHeader,
+          original: options.original,
+          mode: options.mode,
+          selectIds: options.mode === 'selected' ? options.data.map(item => item.id) : [],
+          exportFields: options.columns.map(column => column.property)
+        }
+        return this.projectRecordsService.exportFile(params).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, options.filename)
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      }
+    }
+  }
+</script>

+ 9 - 6
src/views/modules/cw/reimbursementApproval/info/InfoList.vue

@@ -85,7 +85,7 @@
           <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)">
+      <div style="height: calc(100% - 80px)">
         <vxe-table
           border="inner"
           auto-resize
@@ -138,7 +138,6 @@
             </template>
           </vxe-column>
         </vxe-table>
-
         <vxe-pager
           background
           size="small"
@@ -152,7 +151,8 @@
 
         <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>
         <InfoForm ref="infoForm" @refreshDataList="refreshList"></InfoForm>
-        <ProjectForm ref="projectForm" @refreshDataList="refreshList"></ProjectForm>
+<!--        <ProjectForm ref="projectForm" @refreshDataList="refreshList"></ProjectForm>-->
+        <ProjectRecordsForm ref="projectRecordsForm" @refreshDataList="refreshList"></ProjectRecordsForm>
       </div>
     </div>
   </div>
@@ -170,7 +170,8 @@
   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'
+  // import ProjectForm from '@/views/modules/program/registered/ProjectForm'
+  import ProjectRecordsForm from '../../projectRecords/ProjectRecordsForm'
   export default {
     data () {
       return {
@@ -214,7 +215,8 @@
       SelectTree,
       ProgramPageForm,
       InfoForm,
-      ProjectForm,
+      // ProjectForm,
+      ProjectRecordsForm,
       UserSelect
     },
     mounted () {
@@ -330,7 +332,8 @@
       },
       // 查看报销项目
       viewProject (id) {
-        this.$refs.projectForm.init('view', id)
+        // this.$refs.projectForm.init('view', id)
+        this.$refs.projectRecordsForm.init('view', id)
       },
       // 获取数据列表
       refreshList () {

+ 29 - 33
src/views/modules/cw/reportManagement/ReportManagementTaskForm.vue

@@ -201,21 +201,7 @@
           </el-col>
           <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status !== 'audit'"
                    label-width="135px" @submit.native.prevent>
-            <el-col v-if="inputForm.status !== '2'" :span="12">
-              <el-form-item label="意见类型" prop="opinionType"
-                            :rules="[
-                     ]">
-                <el-select v-model="inputForm.opinionType" placeholder="请选择意见类型" style="width:100%;">
-                  <el-option
-                    v-for="item in $dictUtils.getDictList('cw_opinion_type')"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col v-if="inputForm.status === '2'" :span="12">
+            <el-col :span="12">
               <el-form-item label="意见类型" prop="opinionType"
                             :rules="[
                               {required: true, message:'意见类型不能为空', trigger:'change'}
@@ -591,32 +577,42 @@
         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.$refs.archiveFile.getDataList().then((data) => {
-              this.inputForm.cwFileInfoList = data
-              if (this.commonJS.isNotEmpty(this.inputForm.cwFileInfoList)) {
-                let _this = this
-                _this.inputForm.cwFileInfoList.forEach((item, index) => {
-                  if (_this.commonJS.isEmpty(item.fileType)) {
-                    _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
-                    _this.loading = false
-                    throw new Error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
-                  } else if (_this.commonJS.isEmpty(item.sealType)) {
-                    _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
-                    _this.loading = false
-                    throw new Error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
+            let _this = this
+            let _num = 0
+            const wait = function () {
+              return new Promise((resolve, reject) => {
+                _this.$refs.archiveFile.getDataList().then((data) => {
+                  _this.inputForm.cwFileInfoList = data
+                  if (_this.commonJS.isNotEmpty(_this.inputForm.cwFileInfoList)) {
+                    _this.inputForm.cwFileInfoList.forEach((item, index) => {
+                      if (_this.commonJS.isEmpty(item.fileType)) {
+                        _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
+                        _num = 1
+                        _this.loading = false
+                        throw new Error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
+                      } else if (_this.commonJS.isEmpty(item.sealType)) {
+                        _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
+                        _num = 1
+                        _this.loading = false
+                        throw new Error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
+                      }
+                    })
                   }
                 })
+                resolve()
+              })
+            }
+            wait().then(() => {
+              if (_num !== 1) {
+                if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+                  this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+                }
                 if (status === 'agree' && this.commonJS.isEmpty(this.inputForm.opinionType)) {
                   this.$message.error('意见类型不能为空')
                   this.loading = false
                   throw new Error('意见类型不能为空')
                 }
                 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(() => {

+ 11 - 0
src/views/modules/cw/workContract/ContractRegistration.vue

@@ -76,6 +76,16 @@
           </el-option>
         </el-select>
       </el-form-item>
+      <el-form-item label="纸质归档" prop="filedPaperType">
+        <el-select v-model="searchForm.filedPaperType" placeholder="请选择" style="width:100%;">
+          <el-option
+            v-for="item in $dictUtils.getDictList('filed_type')"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
 
       <el-form-item>
         <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
@@ -222,6 +232,7 @@
         visible: false,
         num: 0,
         searchForm: {
+          filedPaperType: '',
           contractNo: '',
           contractName: '',
           contractAmount: '',

+ 1 - 1
src/views/modules/cw/workContract/ContractRegistrationForm.vue

@@ -749,7 +749,7 @@
           this.$refs['inputForm'].validate(async (valid) => {
             if (valid) {
               this.loading = true
-              this.inputForm.status = '2'
+              this.inputForm.status = '5'
               this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
               this.inputForm.fees = this.inputForm.contractFees.join(',')
               await this.contractInfoService.save(this.inputForm).then(({data}) => {

+ 4 - 37
src/views/modules/cw/workContract/CwWorkContractBorrowForm.vue

@@ -204,34 +204,15 @@
     methods: {
       init (id) {
         if (id) {
+          console.log('进来了')
           this.loading = true
           this.inputForm.id = id
           this.$nextTick(() => {
-            // console.log('id', id)
             this.$refs.inputForm.resetFields()
-            // this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
-            //   this.$refs.archiveFile.clearUpload()
-            //   this.$refs.uploadFile.clearUpload()
-            //   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.cwWorkContractBorrowService.findById(this.inputForm.id).then(({data}) => {
               this.$refs.archiveFile.clearUpload()
               this.$refs.uploadFile.clearUpload()
-              // 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
-              // })
+              console.log('data1', data)
               if (this.commonJS.isEmpty(data.id)) {
                 this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
                   this.inputForm = this.recover(this.inputForm, data)
@@ -243,7 +224,8 @@
                   this.loading = false
                 })
               } else {
-                this.contractInfoService.findFileInfoById(this.inputForm.id).then(({data}) => {
+                console.log('data2', data)
+                this.contractInfoService.findFileInfoById(data.contractInfoId).then(({data}) => {
                   this.inputForm.cwWorkClientContactDTOList = data.cwWorkClientContactDTOList
                   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)
@@ -253,21 +235,6 @@
                 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
-            //   }
             })
           })
         }

+ 49 - 17
src/views/modules/materialManagement/info/UpdateInfoForm.vue

@@ -105,7 +105,7 @@
             @cell-click=""
             @edit-closed=""
             highlight-current-row
-            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+            :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
           >
             <vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
               <template v-slot:edit="scope">
@@ -129,12 +129,19 @@
             </vxe-table-column>
             <vxe-table-column field="tradePrice" title="商品单价(元)" :edit-render="{}" :rules="[{required: true, message:'请输入商品单价', trigger:'blur'}]">
               <template v-slot:edit="scope">
-                <el-input maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
+                <!--              <el-input @change="changeValue" maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>-->
+                <el-input @change="changeValue" maxlength="15" v-model="scope.row.tradePrice" @blur="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
               </template>
             </vxe-table-column>
             <vxe-table-column field="tradeNumber" title="商品数量" :edit-render="{}">
               <template v-slot:edit="scope">
-                <el-input v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>
+                <!--              <el-input @change="changeValue" v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>-->
+                <el-input @change="changeValue" v-model="scope.row.tradeNumber" @blur="scope.row.tradeNumber = twoDecimalPlaces2(scope.row.tradeNumber)" maxlength="10"></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="priceSum" title="商品总价" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.priceSum" @blur="scope.row.priceSum = twoDecimalPlaces(scope.row.priceSum)" maxlength="15"></el-input>
               </template>
             </vxe-table-column>
             <vxe-table-column field="company" title="单位" :edit-render="{}" :rules="[{required: true, message:'请填写单位', trigger:'blur'}]">
@@ -225,6 +232,7 @@
 </template>
 
 <script>
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
   import MaterialManagementDialog from '../file/MaterialManagementDialog'
   import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
   import MaterialTypePullForm from './MaterialTypePullForm'
@@ -266,6 +274,7 @@
       this.materialManagementService = new MaterialManagementService()
     },
     components: {
+      SelectTree,
       MaterialTypePullForm,
       CwProgramPageForm,
       MaterialManagementDialog,
@@ -312,22 +321,18 @@
               if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
                 this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
               }
+              let i = this.inputForm.detailInfos.length
+              for (let j = 0; j < i; j++) {
+                if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
+                  if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
+                    this.inputForm.detailInfos[j].priceSum = this.inputForm.detailInfos[j].tradePrice * this.inputForm.detailInfos[j].tradeNumber
+                  }
+                }
+              }
               this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
             })
-            // 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
-            // })
           }
         })
       },
@@ -381,6 +386,34 @@
         str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
         return str
       },
+      twoDecimalPlaces2 (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
+      },
       // 采购人下拉弹窗
       userPullListForm (rowIndex) {
         this.indexRow = rowIndex
@@ -392,10 +425,9 @@
             if (columnIndex === 0) {
               return '商品总价'
             }
-            if (['tradePrice'].includes(column.property)) {
+            if (['priceSum'].includes(column.property)) {
               // eslint-disable-next-line no-undef
               this.inputForm.tradeTotalPrice = XEUtils.sum(data, column.property)
-              console.log('this.inputForm.tradeTotalPrice', this.inputForm.tradeTotalPrice)
               return XEUtils.sum(data, column.property)
             }
             return null

+ 42 - 5
src/views/modules/materialManagement/purchase/PurchaseForm.vue

@@ -54,7 +54,9 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="采购方式" prop="purchaseMode"
-                        :rules="[]">
+                        :rules="[
+                          {required: true, message: '采购方式不能为空', trigger: 'blur'},
+          ]">
             <el-select v-model="inputForm.purchaseMode" placeholder="请选择采购方式" style="width:100%;">
               <el-option
                 v-for="item in $dictUtils.getDictList('material_purchase_mode')"
@@ -97,7 +99,7 @@
           @cell-click=""
           @edit-closed=""
           highlight-current-row
-          :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+          :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
         >
           <vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
             <template v-slot:edit="scope">
@@ -121,17 +123,19 @@
           </vxe-table-column>
           <vxe-table-column field="tradePrice" title="商品单价(元)" :edit-render="{}" :rules="[{required: true, message:'请输入商品单价', trigger:'blur'}]">
             <template v-slot:edit="scope">
-              <el-input @change="changeValue" maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
+<!--              <el-input @change="changeValue" maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>-->
+              <el-input @change="changeValue" maxlength="15" v-model="scope.row.tradePrice" @blur="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
             </template>
           </vxe-table-column>
           <vxe-table-column field="tradeNumber" title="商品数量" :edit-render="{}">
             <template v-slot:edit="scope">
-              <el-input @change="changeValue" v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>
+<!--              <el-input @change="changeValue" v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>-->
+              <el-input @change="changeValue" v-model="scope.row.tradeNumber" @blur="scope.row.tradeNumber = twoDecimalPlaces2(scope.row.tradeNumber)" maxlength="10"></el-input>
             </template>
           </vxe-table-column>
           <vxe-table-column field="priceSum" title="商品总价" :edit-render="{}">
             <template v-slot:edit="scope">
-              <el-input v-model="scope.row.priceSum" @keyup.native="scope.row.priceSum = twoDecimalPlaces(scope.row.priceSum)" maxlength="15"></el-input>
+              <el-input v-model="scope.row.priceSum" @blur="scope.row.priceSum = twoDecimalPlaces(scope.row.priceSum)" maxlength="15"></el-input>
             </template>
           </vxe-table-column>
           <vxe-table-column field="company" title="单位" :edit-render="{}" :rules="[{required: true, message:'请填写单位', trigger:'blur'}]">
@@ -220,6 +224,7 @@
 </template>
 
 <script>
+  import UserSelect from '@/components/userSelect'
   // import UpLoadComponentDialog from '@/views/common/UpLoadComponentDialog'
   import MaterialManagementDialog from '../file/MaterialManagementDialog'
   // import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
@@ -284,6 +289,7 @@
       }
     },
     components: {
+      UserSelect,
       MaterialManagementDialog,
       UpLoadComponent,
       SelectUserTree,
@@ -636,6 +642,34 @@
         str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
         return str
       },
+      twoDecimalPlaces2 (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) {
@@ -693,6 +727,9 @@
         this.indexRow = ''
         this.$forceUpdate()
       },
+      getUserInfo (rows) {
+        console.log('rows', rows)
+      },
       // 值改变事件
       changeValue () {
         console.log('进来了')

+ 14 - 14
src/views/modules/materialManagement/purchase/PurchaseList.vue

@@ -46,20 +46,20 @@
           </el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="报销类别" prop="procurementType">
-        <SelectTree
-          ref="areaTree"
-          :props="{
-                  value: 'id',             // ID字段名
-                  label: 'name',         // 显示名称
-                  children: 'children'    // 子级字段名
-                }"
-          url="/reimbursementApproval/type/treeData2?type=12"
-          :value="searchForm.procurementType"
-          :clearable="true"
-          :accordion="true"
-          @getValue="(value, label) => {searchForm.procurementType=label}"/>
-      </el-form-item>
+<!--      <el-form-item label="报销类别" prop="procurementType">-->
+<!--        <SelectTree-->
+<!--          ref="areaTree"-->
+<!--          :props="{-->
+<!--                  value: 'id',             // ID字段名-->
+<!--                  label: 'name',         // 显示名称-->
+<!--                  children: 'children'    // 子级字段名-->
+<!--                }"-->
+<!--          url="/reimbursementApproval/type/treeData2?type=12"-->
+<!--          :value="searchForm.procurementType"-->
+<!--          :clearable="true"-->
+<!--          :accordion="true"-->
+<!--          @getValue="(value, label) => {searchForm.procurementType=label}"/>-->
+<!--      </el-form-item>-->
 <!--      <el-form-item label="采购类别" prop="procurementType">-->
 <!--        <el-select v-model="searchForm.procurementType" placeholder="请选择" style="width:100%;">-->
 <!--          <el-option-->