Browse Source

月报边界页面:转换数据函数修改

洪海涛 4 years ago
parent
commit
89305595df

+ 2 - 2
src/store/modules/monthlyReport/edit/utils.js

@@ -94,7 +94,7 @@ export function arrToObj(arr, headerList) {
             obj[headerKey] = strToArr(obj[headerKey])
           }
           if (selectType && selectType === 'MultiplePeople') {
-            obj[headerKey] = obj[headerKey].replace(/\[|\]|'/g, '').split(',')
+            obj[headerKey] = strToArr(obj[headerKey])
           }
         }
         if (!itemInfo) {
@@ -147,7 +147,7 @@ export function objToArr(obj, tableHeaders) {
           if (item.selectType && item.selectType === 'MultiplePeople') {
             // param.value = JSON.stringify(param.value)
             // param.value = arrToStr(param.value)
-            param.value = `[${param.value.toString()}]`
+            param.value = JSON.stringify(param.value)
           }
         }
         if (!elms.tableItems) {

+ 14 - 1
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div ref="pageWrapper" class="page-wrapper" @click="setInit">
-    <headerCom title="月报" :sub-title="subTitle">
+    <headerCom title="月报" :sub-title="subTitle" address="/monthlyReport/index">
       <template v-if="pageType === 'edit'" slot="content">
         <el-button
 type="primary"
@@ -22,12 +22,22 @@ size="small"
           >取消
         </el-button>
         <el-button
+          v-if="pageDate && pageDate.status === 0"
           slot="reference"
           plain
           size="small"
           @click="dialogOpen('dialogDelete')"
           >删除
         </el-button>
+        <el-button
+          v-if="pageDate && pageDate.status === 0"
+          slot="reference"
+          plain
+          size="small"
+          @click="dialogOpen('dialogDelete')"
+        >删除
+        </el-button>
+
       </template>
     </headerCom>
     <!--     <div style="position: fixed;z-index: 99; top: 20px">
@@ -145,6 +155,9 @@ export default {
         this.tabPageData.children.length
       )
     },
+    pageDate() {
+      return this.$store.state.monthlyReportEdit.pageDate
+    },
     tabPageData() {
       return this.$store.state.monthlyReportEdit.tabPageData
     },