Browse Source

变更详情页面完善

ljb 9 months ago
parent
commit
f79087a7fb

+ 2 - 0
src/views/project-manage/change.vue

@@ -175,10 +175,12 @@ export default window.$crudCommon({
       if (item.zdmc === 'XMYSZEMX') {
         // 变更前的值
         let bgqmx = JSON.parse(item.bgqdz);
+        item.bgqdzJSON = bgqmx;
         item.bgqdz = formatXmysLabel(bgqmx);
 
         // 变更后的值
         let bghmx = JSON.parse(item.bghdz);
+        item.bghdzJSON = bghmx;
         item.bghdz = formatXmysLabel(bghmx)
       }
 

+ 16 - 7
src/views/project-manage/components/change-form.vue

@@ -100,8 +100,8 @@
         </tr>
         
         <!-- 变更结束时间,同时增加预算变更 -->
-        <tr v-if="formData.zdmc === 'xmjssj'"><td colspan="4" align="center" style="height: 46px; font-weight: 600;">预算变更</td></tr>
-        <tr v-if="formData.zdmc === 'xmjssj'">
+        <tr v-if="formData.zdmc === 'xmjssj' && !disabled"><td colspan="4" align="center" style="height: 46px; font-weight: 600;">预算变更</td></tr>
+        <tr v-if="formData.zdmc === 'xmjssj' && !disabled">
           <td class="doc-label">变更前</td>
           <td class="doc-input" style="padding: 0;">
             <div style="height: 31px; line-height: 31px; border-bottom: 1px solid #000;">总计:{{ selProject.xmysze }}万元</div>
@@ -270,9 +270,15 @@ export default {
     this.getDictList("project_state", "projectStateList");
     this.currProjectId = this.projectId;
 
-    this.formData = {
-      ...this.data,
-    };
+    if (Object.keys(this.data).length) {
+      this.formData = { ...this.data, zdmc: this.data.zdmc.toLowerCase() };
+      if (this.formData.zdmc === 'xmyszemx') {
+        this.oldXmyszemxList = this.formData.bgqdzJSON;
+        this.newXmyszemxList = this.formData.bghdzJSON;
+      }
+      this.currProjectId = this.data.xmId;
+    }
+    
   },
   methods: {
     handleEndDateChange(e) {
@@ -307,8 +313,11 @@ export default {
     },
     handleProjectChange(data) {
       this.selProject = data;
-      this.oldXmyszemxList = JSON.parse(data.xmyszemx);
-      this.newXmyszemxList = JSON.parse(data.xmyszemx);
+
+      if (!this.disabled) {
+        this.oldXmyszemxList = JSON.parse(data.xmyszemx);
+        this.newXmyszemxList = JSON.parse(data.xmyszemx);
+      }
     },
     validForm() {
       let errorText = '';