Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

lizhenhao 2 tahun lalu
induk
melakukan
a9b365c593

+ 10 - 1
src/views/modules/flowable/task/TaskForm.vue

@@ -30,12 +30,18 @@
 <el-card style="margin-top:10px; padding-bottom:66px" v-if="!procInsId || taskId">
     <el-form size="small" :model="auditForm"   ref="auditForm" label-width="120px">
       <el-col :span="16">
-        <el-form-item  v-if="!procInsId"  label="流程标题" prop="title">
+        <el-form-item  v-if="!procInsId && isShow !== 'false'"  label="流程标题" prop="title">
           <el-input
             placeholder="请输入流程标题"
             v-model="title">
           </el-input>
       </el-form-item>
+        <el-form-item  v-if="!procInsId && isShow === 'false'" label="流程标题" prop="title">
+          <el-input
+            placeholder="请输入流程标题"
+            v-model="this.contractTitle">
+          </el-input>
+        </el-form-item>
       <el-form-item  v-if="taskId"  label="审批信息" prop="message">
           <el-input
             type="textarea"
@@ -218,11 +224,14 @@
         this.auditForm.assignee = null
         this.auditForm.userIds = null
         this.auditForm.message = ''
+        this.contractTitle = this.$route.query.contractTitle
         if (this.$route.query.isShow === undefined || this.$route.query.isShow === '') {
           this.isShow = 'true'
         } else {
           this.isShow = this.$route.query.isShow
         }
+        console.log('isShow', this.isShow)
+        console.log('contractTitle', this.contractTitle)
       },
       cc (procInsId) {
         if (this.isCC && this.auditForm.userIds) {

+ 19 - 15
src/views/modules/sys/workContract/WorkContractForm.vue

@@ -23,7 +23,7 @@
                         :rules="[
                  {required: true, message:'请输入合同名称', trigger:'blur'}
                ]">
-            <el-input v-model="inputForm.name" placeholder="请输入合同名称"></el-input>
+            <el-input maxlength="64" v-model="inputForm.name" placeholder="请输入合同名称"></el-input>
           </el-form-item>
         </el-col>
 
@@ -109,7 +109,7 @@
                         :rules="[
                   {required: true, message:'请输入合同/预计金额(元)', trigger:'blur'}
                ]">
-            <el-input v-model="inputForm.contractAmount" placeholder="请输入合同/预计金额(元)"
+            <el-input maxlength="15" v-model="inputForm.contractAmount" placeholder="请输入合同/预计金额(元)"
                       @keyup.native="inputForm.contractAmount = twoDecimalPlaces(inputForm.contractAmount)"
             ></el-input>
           </el-form-item>
@@ -117,7 +117,7 @@
 
         <el-col :span="12">
           <el-form-item label="对方合同编号" prop="contractOpposite">
-            <el-input v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+            <el-input maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
           </el-form-item>
         </el-col>
 
@@ -149,6 +149,7 @@
         <el-input v-model="inputForm.describes"
                   type="textarea"
                   :rows="5"
+                  maxlength="500"
                   placeholder="请输入描述内容"
                   show-word-limit>
         </el-input>
@@ -158,6 +159,7 @@
         <el-input v-model="inputForm.contractSpecial"
                   type="textarea"
                   :rows="5"
+                  maxlength="500"
                   placeholder="请输入合同特别条款"
                   show-word-limit>
         </el-input>
@@ -167,6 +169,7 @@
         <el-input v-model="inputForm.remarks"
                   type="textarea"
                   :rows="5"
+                  maxlength="500"
                   placeholder="请输入合同备注"
                   show-word-limit>
         </el-input>
@@ -295,15 +298,15 @@
     watch: {
       'businessId': {
         handler (newVal) {
-          if (this.businessId) {
-            if (this.businessId !== 'false') {
-              this.ossService = new OSSSerive()
-              this.init('edit', this.businessId)
-            }
+          if (this.businessId && this.businessId !== 'false') {
+            this.ossService = new OSSSerive()
+            this.init('edit', this.businessId)
           } else {
-            this.$nextTick(() => {
-              this.$refs.inputForm.resetFields()
-            })
+            // this.$refs.inputForm.resetFields()
+            // this.visible = false
+            // this.showVi = true
+            // this.$refs.uploadComponent.clearUpload()
+            this.init('clean', '')
           }
         },
         immediate: true,
@@ -332,6 +335,7 @@
         this.showViewer = false
       },
       init (method, id) {
+        console.log(method)
         this.dataList = []
         this.dataListNew = []
         this.method = method
@@ -365,7 +369,7 @@
         }
         this.inputForm.id = id
         if (method === 'add') {
-          this.inputForm.contractAmountType = '1'
+          // this.inputForm.contractAmountType = '1'
           this.title = `新建合同登记`
         } else if (method === 'edit') {
           this.title = '修改合同登记'
@@ -381,7 +385,6 @@
             this.loading = true
             this.workContractService.findById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
-              console.log('data', data)
               const f = []
               if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
                 data.fees.split(',').forEach(item => {
@@ -442,6 +445,7 @@
       },
       close () {
         this.$refs.inputForm.resetFields()
+        this.inputForm.clientName = ''
         this.visible = false
         this.showVi = true
         this.$refs.uploadComponent.clearUpload()
@@ -505,8 +509,8 @@
           if (str_.indexOf('.') != -1) {
             str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
           }
-          if (str_.length > 4) {
-            this.$message.warning(`金额小数点后只能输入位,请正确输入!`)
+          if (str_.length > 2) {
+            this.$message.warning(`金额小数点后只能输入位,请正确输入!`)
             return (str = '')
           }
         }

+ 26 - 24
src/views/modules/sys/workContract/WorkContractForm2.vue

@@ -32,7 +32,7 @@
                             :rules="[
                  {required: true, message:'请输入合同名称', trigger:'blur'}
                ]">
-                <el-input v-model="inputForm.name" placeholder="请输入合同名称"></el-input>
+                <el-input maxlength="64" v-model="inputForm.name" placeholder="请输入合同名称"></el-input>
               </el-form-item>
             </el-col>
 
@@ -74,6 +74,7 @@
                     {required: true, message:'请选择合同终止日期', trigger:'blur'}
                   ]">
                 <el-date-picker
+                  @change="checkData"
                   v-model="inputForm.closingDate"
                   type="date"
                   style="width: 418px"
@@ -120,7 +121,7 @@
 
             <el-col :span="12">
               <el-form-item label="对方合同编号" prop="contractOpposite">
-                <el-input v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
+                <el-input maxlength="64" v-model="inputForm.contractOpposite" placeholder="请填写对方合同编号"></el-input>
               </el-form-item>
             </el-col>
 
@@ -139,7 +140,7 @@
           <el-row>
             <el-col :span="12">
               <el-form-item prop="contractFee">
-                <el-input style="width: 500px" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
+                <el-input style="width: 100%" placeholder="请选择收费标准" v-model="inputForm.contractFee"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -175,6 +176,16 @@
 
           </el-form>
       <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+
+      <el-image-viewer
+        v-if="showViewer"
+        :on-close="closeViewer"
+        :url-list="[url]"
+        zIndex="9999"/>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close(),closeXTable()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick >确定</el-button>
+    </span>
     </el-dialog>
   </div>
 </template>
@@ -348,7 +359,6 @@
             this.loading = true
             this.workContractService.findById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
-              console.log('data', data)
               const f = []
               if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
                 data.fees.split(',').forEach(item => {
@@ -373,7 +383,7 @@
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true
-            this.inputForm.workAttachmentList = []
+            this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
             this.dataListNew.forEach((item) => {
               if (item.id === null || item.id === undefined || item.id === '') {
                 item.url = item.raw.url
@@ -386,7 +396,7 @@
 
             this.workContractService.save(this.inputForm).then(({data}) => {
               this.close()
-              this.$message.success(data)
+              this.$message.success(data.msg)
               this.$emit('refreshDataList')
               this.loading = false
             }).catch(() => {
@@ -460,8 +470,8 @@
           if (str_.indexOf('.') != -1) {
             str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
           }
-          if (str_.length > 4) {
-            this.$message.warning(`金额小数点后只能输入位,请正确输入!`)
+          if (str_.length > 2) {
+            this.$message.warning(`金额小数点后只能输入位,请正确输入!`)
             return (str = '')
           }
         }
@@ -469,22 +479,6 @@
         str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
         return str
       },
-      positiveInteger (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 no-useless-escape
-        str = str.replace(/[^\d^]+/g, '') // 保留数字
-        return str
-      },
       tableRowClassName ({row, rowIndex}) {
         row.index = rowIndex
       },
@@ -541,6 +535,14 @@
             this.inputForm.contractFee = fee.substring(1, fee.length)
           })
         }
+      },
+      checkData () {
+        let begin = this.inputForm.effectiveDate
+        let close = this.inputForm.closingDate
+        if (close < begin) {
+          this.$message.warning(`合同终止日期异常,请重新选择`)
+          this.inputForm.closingDate = ''
+        }
       }
     }
   }

+ 26 - 18
src/views/modules/sys/workContract/WorkContractList.vue

@@ -140,7 +140,8 @@
                 <vxe-column title="操作" width="200px" fixed="right" align="center">
                     <template  slot-scope="scope">
                       <el-button v-if="hasPermission('sys:workContract:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
-                      <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status !== '2' && scope.row.status !== '5'" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)">修改</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status !== '2' && scope.row.status !== '5' && scope.row.createId === create && create !== '1'" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row)">修改</el-button>
+                      <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status === '5' && create === '1'" type="text" icon="el-icon-edit" size="small" @click="editForm(scope.row.id)">修改</el-button>
                       <el-button v-if="hasPermission('sys:workContract:del') && (scope.row.status === '1' || scope.row.status === '3')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
                       <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '2'" type="text"  icon="el-icon-back" size="small" @click="reback(scope.row)">撤回</el-button>
                     </template>
@@ -198,7 +199,8 @@
         },
         processDefinitionId: '',
         procDefKey: '',
-        loading: false
+        loading: false,
+        create: ''
       }
     },
     workContractService: null,
@@ -221,12 +223,17 @@
     computed: {
       userName () {
         return JSON.parse(localStorage.getItem('user')).name
+      },
+      user () {
+        this.create = JSON.parse(localStorage.getItem('user')).id
+        return JSON.parse(localStorage.getItem('user'))
       }
     },
 
     methods: {
       // 获取数据列表
       refreshList () {
+        console.log('user', this.user)
         this.loading = true
         this.workContractService.list({
           'current': this.tablePage.currentPage,
@@ -240,7 +247,6 @@
           this.loading = false
         })
         this.processService.getByName('合同登记新建').then(({data}) => {
-          console.log(data)
           if (!this.commonJS.isEmpty(data.id)) {
             this.processDefinitionId = data.id
             this.procDefKey = data.key
@@ -265,12 +271,10 @@
       add () {
         this.start()
       },
-      // 新增
+      // 详情
       detail (row) {
         // eslint-disable-next-line eqeqeq
         if (!this.commonJS.isEmpty(row.status) && row.status != '1') {
-          console.log(row.procInsId)
-          console.log(row.processDefinitionId)
           this.taskService.getTaskDef({
             procInsId: row.procInsId,
             procDefId: row.processDefinitionId
@@ -289,16 +293,19 @@
       },
       // 修改
       edit (row) {
-        // row.id || this.$refs.workContractTable.getCheckboxRecords().map(item => {
-        //   return item.id
-        // })[0]
-        // this.$refs.workContractForm2.init('edit', id)
         if (row.status === '3' || row.status === '4') {
-          this.start2(row)
+          this.editWithClose(row)
         } else {
-          this.start1(row)
+          this.editWithHold(row)
         }
       },
+      // 管理员修改
+      editForm (id) {
+        id = id || this.$refs.workClientTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.workContractForm2.init('edit', id)
+      },
       // 查看
       view (id) {
         this.$refs.workContractForm2.init('view', id)
@@ -333,6 +340,7 @@
         // 读取流程表单
         let tabTitle = `发起流程【合同登记新建】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
+        let contractTitle = '合同【' + this.searchForm.name + '】登记待审批'
         this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
           status: 'startAndHold'}).then((data) => {
             this.$router.push({
@@ -346,12 +354,13 @@
                 formUrl: data.data.formUrl,
                 formTitle: processTitle,
                 businessId: 'false',
-                isShow: false
+                isShow: false,
+                contractTitle: contractTitle
               }
             })
           })
       },
-      start1 (row) {
+      editWithHold (row) {
         // 读取流程表单
         let tabTitle = `发起流程【合同登记新建】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
@@ -376,7 +385,7 @@
             })
           })
       },
-      start2 (row) {
+      editWithClose (row) {
         // 读取流程表单
         let tabTitle = `发起流程【合同登记新建】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记新建]`
@@ -409,13 +418,12 @@
           taskId: row.procInsId,
           type: 'warning'
         }).then(() => {
-          console.log(row)
-          this.taskService.backNodes(row.procInsId).then(({data}) => {
+          this.taskService.backNodes(row.taskId).then(({data}) => {
             let backNodes = data
             if (backNodes.length > 0) {
               let backTaskDefKey = backNodes[0].taskDefKey
               this.taskService.back({
-                taskId: row.procInsId,
+                taskId: row.taskId,
                 backTaskDefKey: backTaskDefKey,
                 isShow: false,
                 ...this.auditForm