Browse Source

变更提交

ljb 10 months ago
parent
commit
0aa20c038f

+ 12 - 4
src/views/project-manage/change.vue

@@ -19,6 +19,7 @@
       :page.sync="page"
       :before-open="handleBeforeOpen"
       :permission="permissionList"
+      @row-dblclick="handleRowDbClick"
     >
       <template slot="menuLeft">
         <el-button type="primary" size="small" icon="el-icon-position" @click="handleAddChange">
@@ -48,7 +49,8 @@
     />
 
     <el-drawer
-      title="发起变更"
+      v-if="drawerVisible"
+      :title="drawerTitle"
       :visible.sync="drawerVisible"
       modal-append-to-body
       append-to-body
@@ -56,7 +58,7 @@
     >
       
       <change-form
-        v-if="drawerVisible"
+        
         :projectId="params.xmId"
         :data="changeFormData"
         :disabled="isFormReadonly"
@@ -89,6 +91,8 @@ export default window.$crudCommon({
         xmId: ''
       },
       selProject: {},
+
+      drawerTitle: "",
       drawerVisible: false,
 
       wideTableColumns: [],
@@ -110,7 +114,6 @@ export default window.$crudCommon({
   methods: {
     handleProjectChange(data) {
       this.selProject = data;
-      
     },
     handleExport() {
       exportBloByPost(`/api/kd-scientific/xm-bgrz/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
@@ -131,12 +134,17 @@ export default window.$crudCommon({
     handleAddChange() {
       this.drawerVisible = true;
       this.isFormReadonly = false;
+      this.drawerTitle = "发起变更";
       this.changeFormData = {};
     },
     handleRowDbClick(data) {
       this.drawerVisible = true;
       this.isFormReadonly = true;
-      this.changeFormData = data;
+      this.drawerTitle = "变更详情";
+      this.changeFormData = {
+        ...data,
+        attachment: data.attachment ? JSON.parse(data.attachment) : []
+      };
     },
     handleChangeSucc() {
       this.drawerVisible = false;

+ 7 - 6
src/views/project-manage/components/all-budget-table.vue

@@ -43,16 +43,16 @@
                 </el-table-column>
                 <el-table-column
                   prop="sales"
-                  label="科目金额"
+                  label="科目金额(元)"
                   width="120"
                   align="center"
                 >
                 </el-table-column>
                 <el-table-column
                   prop="ratio"
-                  label="占总预算比例"
+                  label="占总预算比例(%)"
                   align="center"
-                  width="120"
+                  width="140"
                 >
                 </el-table-column>
               </el-table>
@@ -125,7 +125,7 @@ export default {
   },
   methods: {
     handleRefresh() {
-      this.getAllBudgetData(this.selProject.id);
+      this.getAllBudgetData(this.currProjectId);
     },
     handleProjectChange(data) {
       this.selProject = data;
@@ -160,7 +160,8 @@ export default {
             item.sales = (data.data[readKey] === -1 ? 0 : data.data[readKey]).toFixed(2);
             let ratio = 0;
             if (item.sales) {
-              ratio = (new Decimal(item.sales).div(new Decimal(ysze))*100).toFixed(2);
+              // console.log(item.sales, ysze)
+              ratio = (new Decimal(item.sales).div(new Decimal(ysze * 10000)) * 100).toFixed(2);
             }
             item.ratio = ratio;
 
@@ -192,7 +193,7 @@ export default {
           // 保留两位小数
           sums[index] = sums[index].toFixed(2);
         } else {
-          sums[index] = 'N/A';
+          sums[index] = '';
         }
       });
       return sums;

+ 21 - 11
src/views/project-manage/components/change-form.vue

@@ -33,7 +33,10 @@
 
         <tr>
           <td class="doc-label">变更前</td>
-          <td class="doc-input">{{ selProject[formData.zdmc == 'xmfzr' ? 'xmfzrxm' : formData.zdmc] }}</td>
+          <td class="doc-input">
+            <span v-if="!disabled">{{ selProject[formData.zdmc == 'xmfzr' ? 'xmfzrxm' : formData.zdmc] }}</span>
+            <span>{{ formData.bgqdz }}</span>
+          </td>
           <td class="doc-label">变更后</td>
           <td class="doc-input">
             <el-input v-if="formData.zdmc === 'xmmc'" placeholder="请输入项目名称" v-model="formData.bghdz" :disabled="disabled" />
@@ -82,6 +85,7 @@
           <td class="doc-label">附件上传</td>
           <td class="doc-input" colspan="3" style="text-align: left;">
             <avue-upload
+              v-if="!disabled"
               action="/api/kd-resource/oss/endpoint/put-file"
               dataType="object"
               :props-http="{
@@ -94,6 +98,11 @@
               style="margin: 14px 0 14px 12px;"
               :disabled="disabled"
             ></avue-upload>
+            <div v-else>
+              <div v-for="(item, index) of formData.attachment" :key="index" style="line-height: 26px; padding: 6px;">
+                <el-link @click="handleDownFile(item)">{{ item.label }}</el-link>
+              </div>
+            </div>
           </td>
         </tr>
       </tbody>
@@ -128,7 +137,9 @@ export default {
   data() {
     return {
       currProjectId: '',
-      formData: {},
+      formData: {
+        attachment: []
+      },
       changeTypeList: [],
       loading: false,
       selProject: {},
@@ -147,14 +158,10 @@ export default {
     this.getDictList("xm_biangeng_field", "changeTypeList");
     this.currProjectId = this.projectId;
 
-    if (this.data && Object.keys(this.data)) {
-      this.formData = {
-        ...this.data,
-      };
-      let attachment = this.formData.attachment;
-
-      this.formData.attachment = JSON.parse(attachment)
-    }
+    this.formData = {
+      ...this.data,
+    };
+    console.log(this.formData.attachment)
   },
   methods: {
     /**
@@ -190,7 +197,7 @@ export default {
       } else if (!this.formData.bgsxsj) {
         errorText = '请选择变更生效时间';
       } else if (!this.formData.bghdz) {
-        errorText = '请输入变更后的信息';
+        errorText = '请输入变更后的';
       }
 
       return errorText;
@@ -221,6 +228,9 @@ export default {
           this.$emit("success");
         }
       });
+    },
+    handleDownFile(file) {
+      window.open(file.value);
     }
   },
 };