wucl 11 mesi fa
parent
commit
282f4cfaa0

+ 7 - 6
src/components/personalForms/sellingAbilityInfo.vue

@@ -179,7 +179,7 @@
               <el-col :xs="24" :sm="12" :lg="8" :span="6">
                 <el-form-item label="实地查勘日:" prop="sceneDateD" label-width="180px" type="date"
                   class="postInfo-container-item" :rules="{ required: true, message: '实地查勘日不能为空', trigger: 'blur' }">
-                  <el-date-picker v-model="sellingAbilityInfo.sceneDateD" type="date" style="width: 100%;"
+                  <el-date-picker v-model="sellingAbilityInfo.sceneDateD" type="date" value-format="yyyy-MM-dd" style="width: 100%;"
                     placeholder="选择日期">
                   </el-date-picker>
                 </el-form-item>
@@ -189,7 +189,7 @@
               <el-col :xs="24" :sm="12" :lg="8" :span="6">
                 <el-form-item label="报告出具日期:" prop="createDateD" type="date" label-width="180px"
                   :rules="{ required: true, message: '报告出具日期不能为空', trigger: 'blur' }" class="postInfo-container-item">
-                  <el-date-picker v-model="sellingAbilityInfo.createDateD" type="date" style="width: 100%;"
+                  <el-date-picker v-model="sellingAbilityInfo.createDateD" type="date" value-format="yyyy-MM-dd" style="width: 100%;"
                     placeholder="选择日期" @change="getLimitDate()">
                   </el-date-picker>
                 </el-form-item>
@@ -353,10 +353,11 @@ export default {
       })
     },
     getLimitDate() {
-      let createdDate = this.sellingAbilityInfo.createDateD;
-      let afterYearDate = new Date(createdDate.getTime());
-      afterYearDate.setFullYear(afterYearDate.getFullYear() + 1);
-      afterYearDate.setDate(afterYearDate.getDate() - 1);
+      let createdDateStr = this.sellingAbilityInfo.createDateD;
+      let createdDate= new Date(createdDateStr);
+      let afterYearDate = new Date(createdDate);
+      afterYearDate.setFullYear(createdDate.getFullYear() + 1);
+      afterYearDate.setDate(createdDate.getDate() - 1);
       const created = createdDate.getFullYear() + '-' + this.addZero((createdDate.getMonth() + 1)) + '-' + this.addZero(createdDate.getDate());
       const limit = afterYearDate.getFullYear() + '-' + this.addZero((afterYearDate.getMonth() + 1)) + '-' + this.addZero(afterYearDate.getDate());
       this.sellingAbilityInfo.limitDate = created + ' 至 ' + limit;

+ 50 - 33
src/utils/personalUtil.js

@@ -223,144 +223,161 @@ function allotFee(rollingLevel){
 export function validateParams(data){
     let requiredIndex = ['单价(元)','坐落','市场状况','所在楼栋','建筑面积(平)','户型','室内装饰','楼层/总楼层','权重'];
     let flag = true;
-    data.forEach(element => {
+    for (let i in data){
+            let element = data[i];
         if (requiredIndex.includes(element.index)){
             if (!element.compareA.valueA && element.index!='权重'){
               Message({
-                message: "实例A["+ element.index +"]不能为空",
-                type: 'error',
+                message: "实例A["+ element.index +"]为空",
+                type: 'warning',
                 duration: 5 * 1000
               })
               flag =  false;
+              return flag;
             }
             if (!element.compareB.valueA && element.index!='权重'){
                 Message({
-                    message: "实例B["+ element.index +"]不能为空",
-                    type: 'error',
+                    message: "实例B["+ element.index +"]为空",
+                    type: 'warning',
                     duration: 5 * 1000
                   })
                   flag =  false;
+                  return flag;
             }
             if (!element.compareC.valueA  && element.index!='权重'){
                 Message({
-                    message: "实例C["+ element.index +"]不能为空",
-                    type: 'error',
+                    message: "实例C["+ element.index +"]为空",
+                    type: 'warning',
                     duration: 5 * 1000
                   })
                   flag =  false;
+                  return flag;
             }
             if (element.index!='权重' && element.index!='单价(元)' && !element.target.valueA  ){
                 Message({
-                    message: "评估对象["+ element.index +"]不能为空",
-                    type: 'error',
+                    message: "评估对象["+ element.index +"]为空",
+                    type: 'warning',
                     duration: 5 * 1000
                   })
                   flag =  false;
+                  return flag;
             }
             if (element.index!='坐落' && element.index!='权重' && element.index!='单价(元)' ){
                 if (!element.compareA.weight){
                     Message({
-                      message: "实例A["+ element.index +"权重]不能为空",
-                      type: 'error',
+                      message: "实例A["+ element.index +"权重]为空",
+                      type: 'warning',
                       duration: 5 * 1000
                     })
                     flag =  false;
+                    return flag;
                   }
                   if (!element.compareB.weight){
                       Message({
-                          message: "实例B["+ element.index +"权重]不能为空",
-                          type: 'error',
+                          message: "实例B["+ element.index +"权重]为空",
+                          type: 'warning',
                           duration: 5 * 1000
                         })
                         flag =  false;
+                        return flag;
                   }
                   if (!element.compareC.weight){
                       Message({
-                          message: "实例C["+ element.index +"权重]不能为空",
-                          type: 'error',
+                          message: "实例C["+ element.index +"权重]为空",
+                          type: 'warning',
                           duration: 5 * 1000
                         })
                         flag =  false;
+                        return flag;
                   }
                   if (!element.target.weight){
                     Message({
-                        message: "评估对象["+ element.index +"权重]不能为空",
-                        type: 'error',
+                        message: "评估对象["+ element.index +"权重]为空",
+                        type: 'warning',
                         duration: 5 * 1000
                       })
                       flag =  false;
+                      return flag;
                 }
             }
             if (element.index==='楼层/总楼层'){
                 if (!element.compareA.valueB){
                     Message({
-                      message: "实例A["+ element.index +"]不能为空",
-                      type: 'error',
+                      message: "实例A["+ element.index +"]为空",
+                      type: 'warning',
                       duration: 5 * 1000
                     })
                     flag =  false;
+                    return flag;
                   }
                   if (!element.compareB.valueB){
                       Message({
-                          message: "实例B["+ element.index +"]不能为空",
-                          type: 'error',
+                          message: "实例B["+ element.index +"]为空",
+                          type: 'warning',
                           duration: 5 * 1000
                         })
                         flag =  false;
+                        return flag;
                   }
                   if (!element.compareC.valueB){
                       Message({
-                          message: "实例C["+ element.index +"]不能为空",
-                          type: 'error',
+                          message: "实例C["+ element.index +"]为空",
+                          type: 'warning',
                           duration: 5 * 1000
                         })
                         flag =  false;
+                        return flag;
                   }
                   if (!element.target.valueB){
                     Message({
-                        message: "评估对象["+ element.index +"]不能为空",
-                        type: 'error',
+                        message: "评估对象["+ element.index +"]为空",
+                        type: 'warning',
                         duration: 5 * 1000
                       })
                       flag =  false;
+                      return flag;
                 }
             }
             if (element.index==='权重'){
                 if (element.compareA.valueA==null){
                     Message({
-                        message: "实例A["+ element.index +"]不能为空",
-                        type: 'error',
+                        message: "实例A["+ element.index +"]为空",
+                        type: 'warning',
                         duration: 5 * 1000
                       })
                       flag =  false;
+                      return flag;
                 }
                 if (element.compareB.valueA==null){
                     Message({
-                        message: "实例B["+ element.index +"]不能为空",
-                        type: 'error',
+                        message: "实例B["+ element.index +"]为空",
+                        type: 'warning',
                         duration: 5 * 1000
                       })
                       flag =  false;
+                      return flag;
                 }
                 if (element.compareC.valueA==null){
                     Message({
-                        message: "实例C["+ element.index +"]不能为空",
-                        type: 'error',
+                        message: "实例C["+ element.index +"]为空",
+                        type: 'warning',
                         duration: 5 * 1000
                       })
                       flag =  false;
+                      return flag;
                 }
               let weightTotal =   parseFloat(element.compareA.valueA) +  parseFloat(element.compareB.valueA) + parseFloat(element.compareC.valueA);
                 if (weightTotal!=1){
                     Message({
                         message: "实例A,B,C权重之和需等于1",
-                        type: 'error',
+                        type: 'warning',
                         duration: 5 * 1000
                         })
                         flag =  false;
+                        return flag;
                 }
             }
         }
-    });
+    }
      return flag;
 }

+ 13 - 20
src/views/personal/todoDetail.vue

@@ -494,10 +494,10 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="5" :span="6" style="margin-left: 20px;">
-              <el-button type="info" round @click="calulate()"
-                v-if="currentNode.nodeCode === 'DETERMINE_PRICE' || currentNode.nodeCode === 'GENERATE_STATEMENT' || currentNode.nodeCode === 'WRITE_REPORT' || currentNode.nodeCode === 'WRITE_LETTER'">计算价格</el-button>
-              <el-button type="primary" round @click="saveCalulateResult()"
-                v-if="currentNode.nodeCode === 'DETERMINE_PRICE' || currentNode.nodeCode === 'GENERATE_STATEMENT' || currentNode.nodeCode === 'WRITE_REPORT' || currentNode.nodeCode === 'WRITE_LETTER'">保存价格</el-button>
+              <el-button type="primary" round @click="calulate()"
+                v-if="currentNode.nodeCode === 'DETERMINE_PRICE' || currentNode.nodeCode === 'GENERATE_STATEMENT' || currentNode.nodeCode === 'WRITE_REPORT' || currentNode.nodeCode === 'WRITE_LETTER'">保存</el-button>
+              <!-- <el-button type="primary" round @click="saveCalulateResult()"
+                v-if="currentNode.nodeCode === 'DETERMINE_PRICE' || currentNode.nodeCode === 'GENERATE_STATEMENT' || currentNode.nodeCode === 'WRITE_REPORT' || currentNode.nodeCode === 'WRITE_LETTER'">保存价格</el-button> -->
             </el-col>
           </el-row>
           <el-table v-loading="calculating" element-loading-text="正在计算..." element-loading-spinner="el-icon-loading"
@@ -830,7 +830,7 @@
         </div>
         <div v-if="showProds" style="display: flex;margin-top: 50px;margin-bottom: 20px; width: 100%;">
           <el-card :body-style="{ padding: '0px' }" shadow="always" style="margin-left: 5%; margin-right: 5%; width: 20%;"
-            v-if="hasStatement">
+            >
             <img :src="statementCardPNG" class="image">
             <div style="padding: 14px;">
               <span>房地产意见书</span>
@@ -839,19 +839,15 @@
               <time class="time">{{ statementProd.modified }}</time>
               <div class="control">
                 <el-button type="text" class="button" @click="doStamp(statementProd.files)"
-                  :disabled="currentNode.nodeCode != 'GENERATE_STATEMENT' || !statementProd.isOnline">加盖公章</el-button>
-                <el-button type="text" class="button" @click="warehouse()"
-                  :disabled="currentNode.nodeCode != 'STATEMENT_IN' && currentNode.nodeCode != 'STATEMENT_OUT'">出入库</el-button>
-                <el-button type="text" class="button" @click="genProductionFile(1)"
-                  :disabled="currentNode.nodeCode != 'GENERATE_STATEMENT'">系统生成</el-button>
+                  :disabled="!statementProd.isOnline">加盖公章</el-button>
+                <el-button type="text" class="button" @click="genProductionFile(1)" >系统生成</el-button>
               </div>
             </div>
             <el-upload style="position: relative; top: -10px; padding: 10px;"
               :action="'/api/personalProduction/upload/' + target.id + '/1'" :file-list="statementProd.files" :limit="1"
               :on-exceed="handleExceed" :on-preview="handleAttachmentPreview" :on-success="getProductions"
               :before-remove="handleRemoveFile">
-              <el-button type="text" style="position: relative; left: 10px;top: -4px;"
-                :disabled="currentNode.nodeCode != 'GENERATE_STATEMENT'">手动上传</el-button>
+              <el-button type="text" style="position: relative; left: 10px;top: -4px;">手动上传</el-button>
             </el-upload>
 
           </el-card>
@@ -866,8 +862,6 @@
               <div class="control">
                 <el-button type="text" class="button" @click="doStamp(technicReportProd.files)"
                   :disabled="currentNode.nodeCode != 'WRITE_REPORT'">加盖公章</el-button>
-                <el-button type="text" class="button" @click="warehouse()"
-                  :disabled="currentNode.nodeCode != 'REPORT_IN' && currentNode.nodeCode != 'REPORT_OUT'">出入库</el-button>
                 <el-button type="text" class="button" @click="genProductionFile(2)"
                   :disabled="currentNode.nodeCode != 'WRITE_REPORT'">系统生成</el-button>
               </div>
@@ -891,8 +885,6 @@
               <div class="control">
                 <el-button type="text" class="button" @click="doStamp(finalReprotProd.files)"
                   :disabled="currentNode.nodeCode != 'WRITE_REPORT'">加盖公章</el-button>
-                <el-button type="text" class="button" @click="warehouse()"
-                  :disabled="currentNode.nodeCode != 'REPORT_IN' && currentNode.nodeCode != 'REPORT_OUT'">出入库</el-button>
                 <el-button type="text" class="button" @click="genProductionFile(3)"
                   :disabled="currentNode.nodeCode != 'WRITE_REPORT'">系统生成</el-button>
               </div>
@@ -914,8 +906,6 @@
                   class="el-icon-circle-check"></i></span>
               <time class="time">{{ letterReprotProd.modified }}</time>
               <div class="control">
-                <el-button type="text" class="button" @click="warehouse()"
-                  :disabled="currentNode.nodeCode != 'LETTER_IN' && currentNode.nodeCode != 'LETTER_OUT'">出入库</el-button>
               </div>
             </div>
             <el-upload style="position: relative; top: -10px;padding: 10px;"
@@ -1891,6 +1881,7 @@ export default {
           }
         }
       })
+      this.saveCalulateResult();
       setTimeout(() => {
         this.calculating = false;
       }, 500)
@@ -1903,14 +1894,16 @@ export default {
       this.target.sellMoneyRate = this.compareList.sellMoneyRate;
       this.target.sellMoney = this.compareList.sellMoney;
       this.target.sellMoneyBase = this.compareList.sellMoneyBase;
+      let message = this.target.price?'价格保存成功。':'价格未计算,暂存可比实例信息。';
+      let type = this.target.price?'success':'warning';
       let taskRecord = this.buildTaskRecordDTO(this.compareList);
       this.$api.personalCalculate.calculate(taskRecord).then(res => {
         if (res.code === 200 && res.data) {
           this.getCaluateTable(this.target.id);
           this.$notify({
             title: '成功',
-            message: '保存成功',
-            type: 'success',
+            message: message,
+            type: type,
             duration: 2000
           });
         } else {