scorpio 2 years ago
parent
commit
7b79acfabb

+ 11 - 5
src/views/home/component/form_dialog.vue

@@ -134,7 +134,7 @@
           <div class="flex flex-center" v-if="selectIndex === 2">
             <div class="bold ml-10 text-right" style="width: 80px">筛选:</div>
             <el-select
-              v-model="year"
+              v-model="yearLocal"
               clearable
               placeholder="选择年份"
               style="width: 200px"
@@ -275,6 +275,12 @@ export default {
     }
   },
   watch: {
+    year: {
+      handler(val) {
+        this.yearLocal = val
+      },
+      immediate: true
+    },
     dialogType: {
       handler(val) {
         if (val === 0) {
@@ -434,7 +440,7 @@ export default {
         this.$api.params
           .paramsList({
             type: this.fieldType[this.selectIndex].dictKey,
-            year: this.year,
+            year: this.yearLocal,
             month: this.month
           })
           .then(res => {
@@ -573,7 +579,7 @@ export default {
       if (tmpsList && tmpsList.length > 0) {
         const result = tmpsList.map(sub => sub.code).join(',')
         this.loading = true
-        this.$emit('export', 'name,' + result, this.year)
+        this.$emit('export', 'name,' + result, this.yearLocal)
       } else {
         this.$message.error('未选择任何字段进行导出')
       }
@@ -649,7 +655,7 @@ export default {
       }
     },
     resetKey() {
-      this.year = ''
+      this.yearLocal = ''
       this.month = ''
       this.search(false)
     },
@@ -657,7 +663,7 @@ export default {
       this.$api.params
         .paramsList({
           type: this.fieldType[this.selectIndex].dictKey,
-          year: this.year,
+          year: this.yearLocal,
           month: this.month
         })
         .then(res => {

+ 23 - 14
src/views/home/component/item1.vue

@@ -1,12 +1,16 @@
 <template>
-  <div class='full-width flex flex-center text-center border-bottom padding-top padding-bottom'>
-    <div class='flex-child-average flex flex-align-center'>
-      <div class=' text-left'>{{item.title}}</div>
+  <div
+    class="full-width flex flex-center text-center border-bottom padding-top padding-bottom"
+  >
+    <div class="flex-child-average flex flex-align-center">
+      <div class="text-left">{{ item.title }}</div>
     </div>
-    <div class='flex-child-average'>{{item.createTime}}</div>
-    <div >
-      <el-radio-group v-model="check" @change='change'>
-        <el-radio label="3" size="large" v-if='item.type === "1" '>不可查看</el-radio>
+    <div class="flex-child-average">{{ item.createTime }}</div>
+    <div>
+      <el-radio-group v-model="checkLocal" @change="change">
+        <el-radio label="3" size="large" v-if="item.type === '1'"
+          >不可查看</el-radio
+        >
         <el-radio label="1" size="large">可见</el-radio>
         <el-radio label="2" size="large">可编辑</el-radio>
         <el-radio label="3" size="large">不可操作</el-radio>
@@ -27,20 +31,27 @@ export default {
     }
   },
   watch: {
+    check: {
+      handler(val) {
+        this.checkLocal = val
+      },
+      immediate: true
+    },
     data: {
-      handler (val) {
+      handler(val) {
         this.item = val
       },
       immediate: true
     }
   },
-  data () {
+  data() {
     return {
-      item: null
+      item: null,
+      checkLocal: ''
     }
   },
   methods: {
-    change (res) {
+    change(res) {
       this.item.check = res
       this.item.index = this.index
       this.$emit('change', this.item)
@@ -49,6 +60,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 112 - 89
src/views/home/component/pro_relation.vue

@@ -1,55 +1,73 @@
 <template>
   <div>
     <!--    项目关联-->
-    <el-dialog v-model='showRelation'
-               append-to-body
-               center
-               title="关联子项目"
-               width="65%"
-               @close="close"
+    <el-dialog
+      v-model="showRelationLocal"
+      append-to-body
+      center
+      title="关联子项目"
+      width="65%"
+      @close="close"
     >
-      <avue-crud ref="crud"
-                 v-model="form"
-                 v-model:page="page"
-                 :before-open="beforeOpen"
-                 :data="data"
-                 :option="option"
-                 :permission="permissionList"
-                 :table-loading="loading"
-                 class="curd"
-                 @row-del="rowDel"
-                 @current-change="currentChange"
-                 @size-change="sizeChange"
-                 @refresh-change="refreshChange"
-                 @on-load="onLoad">
+      <avue-crud
+        ref="crud"
+        v-model="form"
+        v-model:page="page"
+        :before-open="beforeOpen"
+        :data="data"
+        :option="option"
+        :permission="permissionList"
+        :table-loading="loading"
+        class="curd"
+        @row-del="rowDel"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+      >
       </avue-crud>
     </el-dialog>
     <!--    新增关联项目-->
-    <el-dialog v-model='showAdd'
-               append-to-body
-               center
-               title="新增关联项目"
-               width="65%">
+    <el-dialog
+      v-model="showAdd"
+      append-to-body
+      center
+      title="新增关联项目"
+      width="65%"
+    >
       <div class="flex flex-col">
         <el-input
-            v-model="keyWords"
-            clearable
-            placeholder="项目信息快速搜索"
-            prefix-icon="Search"
-            @keydown="searchPro"
+          v-model="keyWords"
+          clearable
+          placeholder="项目信息快速搜索"
+          prefix-icon="Search"
+          @keydown="searchPro"
         />
       </div>
-      <div class="hide-scrollbar full-width" style="height: 30vh;overflow-x: scroll">
+      <div
+        class="hide-scrollbar full-width"
+        style="height: 30vh; overflow-x: scroll"
+      >
         <!--        <div v-if='attaches.length === 0' class='full-width flex flex-center '>-->
         <!--          <el-empty image-size='100'/>-->
         <!--        </div>-->
         <div class="flex flex-justify-between mt-20 flex-center">
-          <span class="bold font-15 grey ml-5 ">搜索结果</span>
+          <span class="bold font-15 grey ml-5">搜索结果</span>
         </div>
-        <el-divider/>
-        <div class="flex flex-center flex-justify-between mt-5" v-for="item in proList" :key="item.id">
+        <el-divider />
+        <div
+          class="flex flex-center flex-justify-between mt-5"
+          v-for="item in proList"
+          :key="item.id"
+        >
           <span class="bold">{{ item.name }}</span>
-          <baseButton icon="Lock" title="关联" type="0" width="60" @click="connectProject(item)"/>
+          <baseButton
+            icon="Lock"
+            title="关联"
+            type="0"
+            width="60"
+            @click="connectProject(item)"
+          />
         </div>
       </div>
     </el-dialog>
@@ -68,18 +86,23 @@ export default {
       type: Boolean,
       default: false
     },
-    projectId: ''
+    projectId: {
+      type: String,
+      default: ''
+    }
   },
   watch: {
     showRelation: {
-      handler (val) {
+      handler(val) {
         console.log(val)
+        this.showRelationLocal = val
       },
       immediate: true
     }
   },
-  data () {
+  data() {
     return {
+      showRelationLocal: false,
       showAdd: false,
       data: [],
       form: {},
@@ -106,7 +129,8 @@ export default {
             prop: 'name',
             addDisplay: false,
             editDisplay: false
-          }]
+          }
+        ]
       },
       page: {
         size: 10,
@@ -118,34 +142,33 @@ export default {
     }
   },
   methods: {
-    close () {
+    close() {
       this.$emit('close')
     },
-    onLoad (query = {}) {
+    onLoad(query = {}) {
       this.loading = true
-      this.$api.project.childrenList({ parentId: this.projectId }).then(res => {
-        this.loading = false
-        if (res.code === 200) {
-          this.data = res.data.childrenList
-          this.page.total = res.data.total
-          this.$emit('success', this.page.total)
-        }
-      }).finally(() => {
-        this.loading = false
-      })
+      this.$api.project
+        .childrenList({ parentId: this.projectId })
+        .then(res => {
+          this.loading = false
+          if (res.code === 200) {
+            this.data = res.data.childrenList
+            this.page.total = res.data.total
+            this.$emit('success', this.page.total)
+          }
+        })
+        .finally(() => {
+          this.loading = false
+        })
     },
-    beforeOpen (done, type) {
+    beforeOpen(done, type) {
       if (['edit'].includes(type)) {
-        ElMessageBox.confirm(
-          '点击确定将解除项目绑定关系?',
-          '提示',
-          {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }
-        )
-          .then((res) => {
+        ElMessageBox.confirm('点击确定将解除项目绑定关系?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(res => {
             console.log(res)
             this.$api.project.removeContact({ id: this.form.id }).then(res => {
               if (res.code === 200) {
@@ -156,8 +179,7 @@ export default {
               }
             })
           })
-          .catch(() => {
-          })
+          .catch(() => {})
       } else if (type === 'view') {
         this.$router.push({
           path: '/home/pro_detail',
@@ -165,44 +187,47 @@ export default {
         })
       } else if (type === 'add') {
         this.showAdd = true
-        this.showRelation = false
+        this.showRelationLocal = false
       }
     },
-    currentChange (currentPage) {
+    currentChange(currentPage) {
       this.page.current = currentPage
     },
-    sizeChange (pageSize) {
+    sizeChange(pageSize) {
       this.page.size = pageSize
     },
-    refreshChange () {
+    refreshChange() {
       this.onLoad()
     },
-    rowDel (row) {
+    rowDel(row) {
       this.$confirm('确定删除选择的项目?', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
-      })
-        .then(() => {
-          this.$api.project.projectRemove({ ids: row.id }).then(res => {
-            if (res.code === 200) {
-              this.$message.success(res.msg)
-              this.onLoad()
-            } else {
-              this.$message.error(res.msg)
-            }
-          })
+      }).then(() => {
+        this.$api.project.projectRemove({ ids: row.id }).then(res => {
+          if (res.code === 200) {
+            this.$message.success(res.msg)
+            this.onLoad()
+          } else {
+            this.$message.error(res.msg)
+          }
         })
+      })
     },
-    searchPro () {
+    searchPro() {
       const data = { projectName: this.keyWords }
-      this.$api.project.projectList(this.page.current, this.page.size, data).then(res => {
-        if (res.code === 200) {
-          this.proList = res.data.records.filter(sub => sub.id !== this.projectId)
-        }
-      })
+      this.$api.project
+        .projectList(this.page.current, this.page.size, data)
+        .then(res => {
+          if (res.code === 200) {
+            this.proList = res.data.records.filter(
+              sub => sub.id !== this.projectId
+            )
+          }
+        })
     },
-    connectProject (item) {
+    connectProject(item) {
       const params = {
         projectId: this.projectId,
         childrenIdList: [item.id]
@@ -221,6 +246,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

File diff suppressed because it is too large
+ 367 - 300
yarn.lock


Some files were not shown because too many files changed in this diff