Browse Source

fix upload

scorpio 2 years ago
parent
commit
ebd3980d93

+ 8 - 0
src/api/project/index.js

@@ -305,6 +305,14 @@ export default {
       parmas,
       'post'
     )
+  },
+  /**
+   * 项目退库
+   * @param params
+   * @returns {Promise<unknown>}
+   */
+  projectCancel(params) {
+    return fetch('/blade-project-manage-v2/project/v2/isExit', params, 'post')
   }
 }
 

+ 116 - 44
src/views/home/component/dash.vue

@@ -99,8 +99,8 @@
           type="primary"
           icon="el-icon-upload"
           @click="projectReport(row)"
-          >上报</el-button
-        >
+          >上报
+        </el-button>
         <el-button
           text
           v-if="
@@ -108,17 +108,26 @@
             row.report_type === 2
           "
           type="primary"
+          icon="el-icon-bell"
           @click="rowClick(row, 1)"
-          >审批</el-button
-        >
+          >审
+        </el-button>
         <el-button
           v-if="row.hasOwnProperty('report_type') && row.report_type === 3"
           text
           type="primary"
           icon="el-icon-upload"
           @click="projectReportFormal(row)"
-          >上报固定资产</el-button
-        >
+          >上报固定资产
+        </el-button>
+        <el-button
+          text
+          type="primary"
+          icon="el-icon-folder-remove"
+          @click="projectCancel(row)"
+          v-if="row.project_stage !== 7"
+          >退库
+        </el-button>
       </template>
       <template #plan_storage_time-header="{ column }">
         <div class="flex flex-center">
@@ -170,9 +179,28 @@
           </div>
         </div>
       </template>
+      <template #project_stage="{ row }">
+        <div class="flex flex-center">
+          <div>{{ row['$project_stage'] }}</div>
+          <el-tooltip :content="row.exit_msg" v-if="row.project_stage === 7">
+            <el-icon @click="showReceipt(row.exit_msg)">
+              <InfoFilled />
+            </el-icon>
+          </el-tooltip>
+        </div>
+      </template>
       <template #report_type="{ row }">
-        <div>
+        <div class="flex flex-center">
           <el-tag>{{ row.report_type_name }}</el-tag>
+          <el-tooltip :content="row.receipt_msg">
+            <el-icon
+              v-if="row.report_type === 4"
+              class="ml-10"
+              @click="showReceipt(row.receipt_msg)"
+            >
+              <WarningFilled />
+            </el-icon>
+          </el-tooltip>
         </div>
       </template>
     </avue-crud>
@@ -282,17 +310,26 @@
       </div>
     </el-dialog>
     <!--    项目审批-->
-    <el-dialog v-model="showApproval" title="审批">
-      <div>
+    <el-dialog v-model="showApproval" title="审核" width="500px">
+      <div class="flex flex-justify-start flex-col">
+        <div class="full-width flex flex-justify-start flex-align-center mb-20">
+          <span>审核状态:</span>
+          <el-radio-group v-model="approvalStatus">
+            <el-radio :label="3">通过</el-radio>
+            <el-radio :label="4">不通过</el-radio>
+          </el-radio-group>
+        </div>
         <el-input
+          class="mt-20"
           type="textarea"
+          :rows="5"
           v-model="approvalMsg"
           placeholder="请填写审批意见"
         />
         <div class="full-width flex flex-justify-end mt-20">
           <el-button plain type="primary" @click="showApproval = false"
-            >取消</el-button
-          >
+            >取消
+          </el-button>
           <el-button type="primary" @click="projectApproval">确定</el-button>
         </div>
       </div>
@@ -308,6 +345,7 @@ import { getLazyList } from '@/api/project/index.js'
 import summaryDialog from '@/views/home/component/summary_dialog.vue'
 import { useStore } from '@/store/user.js'
 import confing from '@/config/website'
+import { ElMessageBox } from 'element-plus'
 
 export default {
   name: 'dash',
@@ -321,6 +359,7 @@ export default {
     return {
       showApproval: false,
       approvalMsg: '',
+      approvalStatus: 3,
       reportTime: '',
       currentReport: null,
       reportShow: false,
@@ -364,7 +403,8 @@ export default {
             label: '项目情况',
             prop: 'project_stage',
             type: 'select',
-            width: 120,
+            slot: true,
+            width: 140,
             dicUrl:
               '/api/blade-system/dict-biz/dictionary?code=project-situation',
             props: {
@@ -664,12 +704,16 @@ export default {
      * @param res
      */
     projectReport(res) {
-      this.$api.project.upReportType({ id: res.id }).then(res => {
-        if (res.code === 200) {
-          this.$message.success(res.msg)
-          this.refreshChange()
-        } else {
-          this.$message.error(res.msg)
+      this.$confirm('确认上报审核?').then(ele => {
+        if (ele === 'confirm') {
+          this.$api.project.upReportType({ id: res.id }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.refreshChange()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
         }
       })
     },
@@ -681,11 +725,20 @@ export default {
     },
     /**
      * 管理员审批项目
-     * @param res
+     * approvalStatus === 4 审核不通过,需要填写原因
      */
-    projectApproval(res) {
+    projectApproval() {
+      if (this.approvalStatus === 4 && this.approvalMsg.length === 0) {
+        this.$message.error('请填写审核意见')
+        return
+      }
+      this.showApproval = false
       this.$api.project
-        .approvalProject({ id: res.id, reportType: 3 })
+        .approvalProject({
+          id: this.form.id,
+          reportType: this.approvalStatus,
+          receiptMsg: this.approvalMsg
+        })
         .then(res => {
           if (res.code === 200) {
             this.$message.success(res.msg)
@@ -700,17 +753,23 @@ export default {
      * @param res
      */
     projectReportFormal(res) {
-      this.$api.project.reportToAssets({ ids: res.id }).then(res => {
-        if (res.code === 200) {
-          this.$message.success(res.msg)
-          this.refreshChange()
-        } else {
-          this.$message.error(res.msg)
+      this.$confirm('确定上报到固定资产?').then(res => {
+        if (res === 'confirm') {
+          this.$api.project.reportToAssets({ ids: res.id }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.refreshChange()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
         }
       })
     },
+    /**
+     * 项目结转
+     */
     projectCarry() {
-      console.log(this.selectList)
       this.$api.project
         .projectCarry({ ids: this.selectList.join(',') })
         .then(res => {
@@ -722,6 +781,28 @@ export default {
           }
         })
     },
+    /**
+     * 项目退库
+     */
+    projectCancel(res) {
+      ElMessageBox.prompt('请输入退库原因', '提示', {}).then(({ value }) => {
+        console.log(value)
+        if (value === null || value.length === 0) {
+          this.$message.error('请输入退库原因')
+          return
+        }
+        this.$api.project
+          .projectCancel({ id: res.id, exitMsg: value })
+          .then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.refreshChange()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+      })
+    },
     track(res) {
       const data = {
         id: res.id,
@@ -738,22 +819,6 @@ export default {
           this.$message.error(res.msg)
         }
       })
-      // // if (res.is_report === 1) {
-      // //   this.$message.error('该项目已经上报')
-      // //   return
-      // // }
-      // this.$confirm(
-      //   res.project_stage === 1
-      //     ? '上报后该项目情况将更新为正式项目,请确认项目相关信息已经审核完成'
-      //     : '是否确定进行项目上报',
-      //   {
-      //     confirmButtonText: '确定',
-      //     cancelButtonText: '取消',
-      //     type: 'warning'
-      //   }
-      // ).then(() => {
-      //
-      // })
     },
     projectSave() {
       if (this.disable) {
@@ -798,6 +863,13 @@ export default {
       )
       this.$router.push({ query: data, path: '/home/excel' })
     },
+    showReceipt(msg) {
+      this.$confirm(msg, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+    },
     exportExcelTotal(item) {
       const dataIds = {
         ...this.queryData,

+ 6 - 12
src/views/home/component/params/params1.vue

@@ -106,16 +106,13 @@
             class="flex-child-average"
             style="flex: 1"
           >
-            <el-input v-model="form.industry" />
+            <el-input v-model="form.record_id" />
           </el-form-item>
           <el-form-item label="备案时间" class="flex-child-average ml-20">
-            <el-input
-              v-if="disabled"
-              v-model="form.construction_start_and_end"
-            />
+            <el-input v-if="disabled" v-model="form.record_time" />
             <el-date-picker
               v-else
-              v-model="form.construction_start_and_end_new"
+              v-model="form.record_date"
               @change="changeDate"
               placeholder="备案时间"
               style="width: 100%"
@@ -131,16 +128,13 @@
             class="flex-child-average"
             style="flex: 1"
           >
-            <el-input v-model="form.industry" />
+            <el-input v-model="form.available_approval_id" />
           </el-form-item>
           <el-form-item label="可研批复时间" class="flex-child-average ml-20">
-            <el-input
-              v-if="disabled"
-              v-model="form.construction_start_and_end"
-            />
+            <el-input v-if="disabled" v-model="form.available_approval_date" />
             <el-date-picker
               v-else
-              v-model="form.construction_start_and_end_new"
+              v-model="form.available_approval_date"
               @change="changeDate"
               placeholder="可研批复时间"
               style="width: 100%"

+ 164 - 58
src/views/invest/resource.vue

@@ -1,92 +1,198 @@
 <template>
-  <div class="full-width flex flex-align-start flex-justify-center mt-10">
-    <el-col :span="6">
-      <basic-container>
-        <left />
-      </basic-container>
-    </el-col>
-    <el-col :span="18">
-      <basic-container>
-        <!--        年度-->
-        <years />
-      </basic-container>
-
-      <basic-container>
-        <div class="flex query-screen">
-          <div class="flex flex-col flex-child-average">
-            <div class="flex flex-center flex-justify-between">
-              <span class="font-16 bold full-width text-left"
-                >投资数据统计 单位(亿元)</span
-              >
-              <div
-                class="flex flex-center"
-                :class="isAverage ? 'green' : 'red'"
-              >
-                <el-icon>
-                  <Warning />
-                </el-icon>
-                <span
-                  class="full-width text-right ml-5 nowrap mr-20"
-                  v-if="isAverage"
-                  >上月已完成平均投资指标</span
+  <div class="flex flex-center full-width">
+    <div class="full-width flex mt-10">
+      <el-col :span="6" v-if="hasChildrenDept">
+        <basic-container>
+          <left :has-children="hasChildrenDept" @change="changeDept" />
+        </basic-container>
+      </el-col>
+      <el-col :span="hasChildrenDept ? 18 : 24">
+        <basic-container>
+          <div class="flex flex-align-start">
+            <el-select
+              v-model="year"
+              clearable
+              style="width: 15%"
+              @change="yearSelect"
+            >
+              <el-option
+                v-for="item in years"
+                :key="item.value"
+                :label="item.value"
+                :value="item.value"
+              />
+            </el-select>
+          </div>
+          <div class="mt-20">
+            <years :dept-id="dept" :year="year" @change="change" />
+          </div>
+        </basic-container>
+        <basic-container>
+          <div class="flex query-screen">
+            <div
+              class="flex-child-average full-width flex flex-col flex-justify-start"
+            >
+              <div class="flex flex-center flex-justify-between">
+                <span class="font-16 bold full-width text-left"
+                  >投资数据统计 单位(亿元)</span
                 >
-                <span class="full-width text-right ml-5 nowrap mr-20" v-else
-                  >上月未完成平均投资指标</span
+                <div
+                  class="flex flex-center"
+                  :class="isAverage ? 'green' : 'red'"
                 >
+                  <el-icon>
+                    <Warning />
+                  </el-icon>
+                  <span
+                    class="full-width text-right ml-5 nowrap mr-20"
+                    v-if="isAverage"
+                    >上月已完成平均投资指标</span
+                  >
+                  <span class="full-width text-right ml-5 nowrap mr-20" v-else
+                    >上月未完成平均投资指标</span
+                  >
+                </div>
               </div>
-            </div>
-            <div class="flex flex-center flex-justify-between">
-              <span class="font-16 bold full-width text-left"
+              <div class="full-width mt-10" style="background-color: #f7fafd">
+                <chart
+                  :dept-id="dept"
+                  :quarter="yearType.value === 0 ? '' : yearType"
+                  :year="year"
+                />
+              </div>
+              <span class="font-16 bold full-width text-left mt-20"
                 >项目入库统计 单位(个)</span
               >
+              <div class="full-width mt-10" style="background-color: #f7fafd">
+                <chart2
+                  :dept-id="dept"
+                  :quarter="
+                    yearType.value === 0 || yearType === '0' ? '' : yearType
+                  "
+                  :year="year"
+                />
+              </div>
+            </div>
+            <div class="white-bg padding"></div>
+            <div class="flex-child-average">
+              <amount
+                v-if="user.info.viewStage === 1 && dept === null"
+                :type="yearType"
+                :deptId="dept"
+                :year="year"
+              />
+              <complete v-else :type="yearType" :deptId="dept" :year="year" />
             </div>
           </div>
-
-          <div class="flex flex-center flex-justify-between flex-child-average">
-            <span class="font-16 bold full-width text-left">
-              各部门/乡镇投资完成情况总览
-            </span>
-          </div>
-        </div>
-      </basic-container>
-    </el-col>
+        </basic-container>
+      </el-col>
+    </div>
   </div>
 </template>
 
 <route>
 {
+path: '/invest/resource',
 name: '固定资产投资管理',
 }
 </route>
 
 <script>
 import BasicContainer from '@/components/basic-container/main.vue'
+import left from './components/left.vue'
 import years from '@/views/invest/components/years.vue'
-import left from '@/views/invest/components/left.vue'
+import amount from '@/views/invest/components/amount.vue'
+import chart from '@/views/invest/components/chart.vue'
+import chart2 from '@/views/invest/components/chart2.vue'
+import complete from '@/views/invest/components/complete.vue'
+import { useStore } from '@/store/user.js'
 
 export default {
-  components: { BasicContainer, years, left },
+  name: 'resource',
+  components: { BasicContainer, left, years, amount, chart, chart2, complete },
+  setup() {
+    const user = useStore()
+    return { user }
+  },
   data() {
-    return {}
+    return {
+      yearType: {
+        value: 0
+      },
+      dept: null,
+      year: '',
+      hasChildrenDept: false,
+      years: [
+        {
+          value: 2023
+        },
+        {
+          value: 2022
+        },
+        {
+          value: 2021
+        },
+        {
+          value: 2020
+        },
+        {
+          value: 2019
+        },
+        {
+          value: 2018
+        },
+        {
+          value: 2017
+        }
+      ],
+      isAverage: false
+    }
   },
-  mounted() {
-    this.init()
+  created() {
+    this.year = new Date().getFullYear()
+    this.deptDetail()
+    this.getAvg()
   },
   methods: {
-    init() {
-      const screenWidth = window.innerWidth
+    deptDetail() {
+      this.$api.system
+        .getDeptDetail({ id: this.user.info.deptId })
+        .then(res => {
+          if (res.code === 200) {
+            this.hasChildrenDept = res.data.hasChildren
+            this.dept = res.data.id
+          }
+        })
+    },
+    changeDept(res) {
+      if (res === null) {
+        this.dept = null
+        this.getAvg()
+        return
+      }
+      this.dept = res.id
+      this.getAvg()
+    },
+    getAvg() {
+      this.$api.invest
+        .belowAverage({ deptId: this.dept ? this.dept : '' })
+        .then(res => {
+          if (res.code === 200) {
+            this.isAverage = res.data
+          }
+        })
+    },
+    change(index) {
+      this.yearType = index
+    },
+    yearSelect(res) {
+      this.year = res
     }
   }
 }
 </script>
 
-<style lang="scss" scoped>
-.content {
-  border-radius: 10px;
-  background-color: white;
-  font-size: 23px;
-}
-
+<style scoped>
 @media (max-width: 1440px) {
   .query-screen {
     flex-direction: column;