Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

humingbo před 1 rokem
rodič
revize
ab90c8757d

+ 8 - 2
src/views/dashboard/index.vue

@@ -20,7 +20,7 @@
         </div>
       </el-card>
       <el-card class="card">
-        <div class="card-text" @click="newTaskOpen=!newTaskOpen">
+        <div class="card-text" @click="toTaskView">
           <div class="card-left"><i class="el-icon-s-order"></i></div>
           <div class="card-right">
             <div class="card-text-title">新任务</div>
@@ -166,7 +166,7 @@ export default {
       detailForm: false,
       auditForm: {},
       auditOpen: false,
-      auditRules:{
+      auditRules: {
         auditResult: [
           {required: true, message: "审核意见不能为空", trigger: "change"}
         ]
@@ -230,6 +230,12 @@ export default {
         this.enforceRemindCount = data.enforceRemindCount
       })
     },
+    toTaskView() {
+      if (this.newTaskNum === 0) {
+        return
+      }
+      this.$router.push(`/task/view`)
+    },
     toMyReceive() {
       this.$router.push(`/material/myReceive`)
     },

+ 8 - 1
src/views/material/asset.vue

@@ -209,6 +209,7 @@
                 type="date"
                 value-format="yyyy-MM-dd"
                 placeholder="选择日期"
+                :picker-options="pickerOptions"
                 style="width: 205px">
               </el-date-picker>
             </el-form-item>
@@ -289,7 +290,7 @@
               <div>{{ transferForm.num }}</div>
             </el-form-item>
             <el-form-item label="流转数量" prop="receiveNum" v-if="transferForm.assetType==='1'">
-              <el-input-number v-model="transferForm.receiveNum"></el-input-number>
+              <el-input-number v-model="transferForm.receiveNum" :max="transferForm.num"></el-input-number>
               <el-tooltip class="item" effect="dark" content="不填表示领取剩余全部库存" placement="right">
                 <div style="margin-left: 10px" class="el-icon-info"></div>
               </el-tooltip>
@@ -387,6 +388,7 @@ import {categoryTree} from "@/api/material/category";
 import {getDeptUserTree} from "@/api/system/user";
 import {getDictData} from "@/api/system/dict";
 import {addTransfer, getTransferList} from "@/api/material/transfer";
+import DateUtil from "@/utils/date";
 
 
 export default {
@@ -429,6 +431,11 @@ export default {
           {required: true, message: "定位位置不能为空", trigger: "blur"}
         ]
       },
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() > DateUtil.unix(DateUtil.day()) * 1000
+        }
+      },
 
       transferOpen: false,
       transferForm: {},

+ 4 - 0
src/views/task/projectView.vue

@@ -303,6 +303,10 @@ export default {
     },
     cellDbClick(row, column, cell, event) {
       let feedbackDate = DateUtil.getFeedBackDate(this.queryParams.rangeDate, column.property)
+      if (DateUtil.unix(feedbackDate) > DateUtil.unix()) {
+        this.$message.warning("评论时间不能超过:" + DateUtil.day())
+        return;
+      }
       this.form = {
         id: undefined,
         taskName: row.taskName,

+ 20 - 10
src/views/task/task.vue

@@ -518,8 +518,11 @@ export default {
       this.title = "添加任务";
       listProject().then(response => {
         this.projectOptions = this.handleTree(response.data, "id");
-        if (this.selectProjectId) {
-          this.form.projectId = this.selectProjectId
+        if (this.selectProjectId && this.projectOptions.length > 0) {
+          let ids = this.projectOptions.map(item => item.id);
+          if (ids.indexOf(this.selectProjectId) < 0) {
+            this.form.projectId = this.selectProjectId
+          }
         }
       });
     },
@@ -612,6 +615,13 @@ export default {
 
     /** 提交按钮 */
     submitForm() {
+      if (this.projectOptions.length > 0) {
+        let ids = this.projectOptions.map(item => item.id);
+        if (ids.indexOf(this.form.projectId) > -1) {
+          this.$message.warning("不可选择分类")
+          return
+        }
+      }
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.form.beginDate = this.form.rangeDate[0]
@@ -669,15 +679,15 @@ export default {
     },
 
     cancelConfirm() {
-      this.open = false;
-      this.splitOpen = false;
       this.confirmOpen = false;
-      this.$refs.dut2.clearText()
-      let dutSplit = this.$refs.dutSplit || [];
-      for (let key in dutSplit) {
-        dutSplit[key].clearText()
-      }
-      this.resetForm("splitForm");
+      // this.open = false;
+      // this.splitOpen = false;
+      // this.$refs.dut2.clearText()
+      // let dutSplit = this.$refs.dutSplit || [];
+      // for (let key in dutSplit) {
+      //   dutSplit[key].clearText()
+      // }
+      // this.resetForm("splitForm");
     },
 
     /** 审核提交按钮 */

+ 18 - 4
src/views/task/view.vue

@@ -72,6 +72,7 @@
         </template>
         <template slot-scope="scope">
           <span v-if="scope.row[item.day].comment" class="comment-badge"></span>
+          <span v-if="scope.row[item.day].audit" class="audit-badge"></span>
           <el-popover
             v-if="scope.row[item.day].value!=''"
             placement="top"
@@ -116,7 +117,7 @@
                     <el-button slot="reference" type="text">详情</el-button>
                   </el-popover>
                   <span
-                    v-if="item.row.feedbackType === '4'&& scope.row.executor===userId && item.row.commentConfirm!='1'"
+                    v-if="(item.row.feedbackType === '4'||item.row.feedbackType === '5')&& scope.row.executor===userId && item.row.commentConfirm!='1'"
                     style="margin-left: 10px">
                   <el-button type="text" icon="el-icon-thumb" size="mini"
                              @click="confirmComment(item.row)">确认</el-button>
@@ -443,9 +444,9 @@ export default {
           }
           addTaskFeedback(this.form).then(res => {
             if (res.code === 'S.F-2001') {
-              let message=''
-              res.data.forEach(item=>{
-                message+=item.taskName+'   '
+              let message = ''
+              res.data.forEach(item => {
+                message += item.taskName + '   '
               })
               this.$alert(message, res.message);
             } else {
@@ -511,6 +512,19 @@ export default {
   vertical-align: text-top;
 }
 
+.audit-badge {
+  height: 10px;
+  width: 10px;
+  border-radius: 5px;
+  background-color: #ff4949;
+  position: absolute;
+  top: 1px;
+  right: 1px;
+  font-size: 8px;
+  color: white;
+  vertical-align: text-top;
+}
+
 .feed-dialog ::v-deep .el-dialog__body {
   padding: 0 20px 10px 20px;
 }