From 13900c0be3a45f7e53fef8f7f53c1e67dc3c6c52 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 26 十二月 2024 14:33:07 +0800
Subject: [PATCH] 完成不符合项分布迁移

---
 src/components/do/a7-distribution-of-nonconforming/formDia.vue |  233 +++++++++++++++++++++++++
 src/components/view/a7-distribution-of-nonconforming.vue       |  245 +++++++++++++++++++++++++++
 src/assets/api/controller.js                                   |   13 +
 3 files changed, 490 insertions(+), 1 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 112e278..12d99d0 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -63,6 +63,7 @@
     measuresAddressRisksOpportunities,
     processReport,
     processComplain,
+    inconsistentDistribution,
   }
 }
 
@@ -827,4 +828,14 @@
   getProcessComplain:'/processComplain/getProcessComplain',//鎶曡瘔澶勭悊璇︽儏
   doProcessComplain:'/processComplain/doProcessComplain',//鎶曡瘔澶勭悊淇敼
   exportProcessComplain :'/processComplain/exportProcessComplain ',//鎶曡瘔澶勭悊瀵煎嚭
-}
\ No newline at end of file
+}
+
+// 7.10涓嶇鍚堥」鍒嗗竷
+const inconsistentDistribution = {
+  pageInconsistentDistribution:'/inconsistentDistribution/pageInconsistentDistribution', // 涓嶇鍚堥」鐨勫垎甯冨垎椤垫煡璇�
+  getInconsistentDistributionOne:'/inconsistentDistribution/getInconsistentDistributionOne', // 涓嶇鍚堥」鐨勫垎甯冭鎯�
+  addInconsistentDistribution:'/inconsistentDistribution/addInconsistentDistribution', // 涓嶇鍚堥」鐨勫垎甯冩柊澧�
+  updateInconsistentDistribution:'/inconsistentDistribution/updateInconsistentDistribution', // 涓嶇鍚堥」鐨勫垎甯冧慨鏀�
+  delInconsistentDistribution:'/inconsistentDistribution/delInconsistentDistribution', // 涓嶇鍚堥」鐨勫垎甯冨垹闄�
+  exportInconsistentDistribution:'/inconsistentDistribution/exportInconsistentDistribution', // 瀵煎嚭涓嶇鍚堥」鐨勫垎甯�
+}
diff --git a/src/components/do/a7-distribution-of-nonconforming/formDia.vue b/src/components/do/a7-distribution-of-nonconforming/formDia.vue
new file mode 100644
index 0000000..fae7108
--- /dev/null
+++ b/src/components/do/a7-distribution-of-nonconforming/formDia.vue
@@ -0,0 +1,233 @@
+<template>
+  <div>
+    <el-dialog v-loading="diaLoading" :close-on-click-modal="false"
+               :close-on-press-escape="false"
+               :visible.sync="formDia"
+               title="涓嶇鍚堥」鐨勫垎甯�"
+               width="90%" @close="closeDia">
+      <table border="1" cellspacing="10" class="table">
+        <tr>
+          <td>绔犺妭鍙�</td>
+          <th class="div-with-line">
+            <span style="float: left;">瑕佺礌</span>
+            <span style="float: right;">閮ㄩ棬</span>
+          </th>
+          <th>涓讳换</th>
+          <th>鎶�鏈礋璐d汉</th>
+          <th>璐ㄩ噺璐熻矗浜�</th>
+          <th>缁煎悎瀹�</th>
+          <th>璇曢獙瀹�</th>
+          <th>鍚堣</th>
+          <th>鍗�%</th>
+        </tr>
+        <tr v-for="(item, index) in distributionDetailList" :key="item.value">
+          <td>{{item.chapterNumber}}</td>
+          <th>{{item.essentials}}</th>
+          <th>
+            <el-input-number v-model="item.director" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.technology" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.quality" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.comprehensive" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+            <el-input-number v-model="item.testing" :precision="0" clearable size="small"></el-input-number>
+          </th>
+          <th>
+	          {{item.total}}
+          </th>
+          <th>
+            {{(item.proportion?item.proportion:0) + '%'}}
+          </th>
+        </tr>
+	      <tr>
+		      <td> </td>
+		      <th>
+			      鍗犳瘮
+		      </th>
+		      <th>
+			      {{(distributionProportion.director?distributionProportion.director:0) + '%'}}
+		      </th>
+		      <th>
+			      {{(distributionProportion.technology?distributionProportion.technology:0) + '%'}}
+		      </th>
+		      <th>
+		          {{(distributionProportion.quality?distributionProportion.quality:0) + '%'}}
+		      </th>
+		      <th>
+		          {{(distributionProportion.comprehensive?distributionProportion.comprehensive:0) + '%'}}
+		      </th>
+		      <th>
+		          {{(distributionProportion.testing?distributionProportion.testing:0) + '%'}}
+		      </th>
+		      <th>
+		          {{distributionProportion.total?distributionProportion.total:0}}
+		      </th>
+		      <th> </th>
+	      </tr>
+      </table>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDia">鍙� 娑�</el-button>
+        <el-button :loading="loading" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'formDia',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: {},
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      formDia: false,
+      diaLoading: false,
+      loading: false,
+      distributionDetailList: [],
+      form: {
+
+      },
+	    distributionProportion: {}
+    };
+  },
+  mounted() {
+
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    // 鎵撳紑寮规
+    openDia (type, row) {
+      this.formDia = true
+      this.operationType = type
+      if (type !== 'add') {
+        this.searchInfo(row)
+      } else {
+        this.selectEnumByCategory()
+      }
+    },
+    // 鏌ヨ璇︽儏
+    searchInfo (row) {
+      this.diaLoading = true
+      this.$axios(this.$api.inconsistentDistribution.getInconsistentDistributionOne + '?distributionId=' + row.distributionId).then(res => {
+        this.diaLoading = false
+        if (res.code === 201) return
+        this.form = res.data
+        this.distributionDetailList = this.form.distributionDetailList
+        this.distributionProportion = this.form.distributionProportion
+      }).catch(err => {
+        console.log(err)
+        this.diaLoading = false
+      })
+    },
+    // 鎻愪氦寮规鏁版嵁
+    handleEdit () {
+      const date = new Date();
+      const year = date.getFullYear();
+      this.loading = true
+      const internalPlan = this.HaveJson(this.form)
+      internalPlan.distributionYear = year
+      internalPlan.distributionDetailList = this.HaveJson(this.distributionDetailList)
+      if (this.operationType === 'add') {
+        this.$axios.post(this.$api.inconsistentDistribution.addInconsistentDistribution, internalPlan, {
+          headers: {
+            "Content-Type": "application/json"
+          },
+          noQs: true
+        }).then(res => {
+          this.loading = false
+          if (res.code === 201) return
+          this.$message.success('鎿嶄綔鎴愬姛')
+          this.closeDia()
+        }).catch(err => {
+          console.log('err---', err);
+          this.loading = false
+        })
+      } else if (this.operationType === 'edit') {
+        this.$axios.post(this.$api.inconsistentDistribution.updateInconsistentDistribution, internalPlan, {
+          headers: {
+            "Content-Type": "application/json"
+          },
+          noQs: true
+        }).then(res => {
+          this.loading = false
+          if (res.code === 201) return
+          this.$message.success('鎿嶄綔鎴愬姛')
+          this.closeDia()
+        }).catch(err => {
+          console.log('err---', err);
+          this.loading = false
+        })
+      }
+    },
+    closeDia () {
+      this.formDia = false
+      this.$emit('closeDia')
+    },
+    selectEnumByCategory() {
+      this.distributionDetailList = []
+      this.$axios.post(this.$api.enums.selectEnumByCategory, {
+        category: "瑕佺礌"
+      }).then(res => {
+        res.data.map((item) => {
+          const obj = Object.assign({
+            essentials: item.label,
+            chapterNumber: item.value,
+          })
+          this.distributionDetailList.push(obj)
+        })
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+>>>.el-dialog {
+  margin: 6vh auto 50px !important;
+}
+>>> .el-dialog__body {
+  max-height: 68vh;
+  overflow-y: auto;
+}
+>>> .is-required {
+  margin-bottom: 6px;
+}
+.table {
+  width: 100%;
+  margin-top: 20px;
+}
+.table td {
+  width: 30px;
+  text-align: center;
+}
+.table th {
+  width: 70px;
+  height: 70px;
+  text-align: center;
+}
+.div-with-line {
+  width: 70px;
+  height: 70px;
+  position: relative;
+  /*overflow: hidden; /* 闅愯棌婧㈠嚭鍐呭 */
+}
+.div-with-line::after {
+  content: '';
+  position: absolute;
+  bottom: 0;
+  height: 1px;
+  background-color: #000000;
+  left: 50%;
+  transform: translateX(-50%) rotate(45deg);
+  transform-origin: center 50%;
+  top: 50%;
+  width: 100px;
+}
+</style>
diff --git a/src/components/view/a7-distribution-of-nonconforming.vue b/src/components/view/a7-distribution-of-nonconforming.vue
new file mode 100644
index 0000000..aa102bf
--- /dev/null
+++ b/src/components/view/a7-distribution-of-nonconforming.vue
@@ -0,0 +1,245 @@
+<template>
+  <div>
+    <div>
+      <div class="view-title">
+        <span>涓嶇鍚堥」鐨勫垎甯�</span>
+        <span>
+          <el-button size="medium" type="primary" @click="openFormDia('add')">鏂� 澧�</el-button>
+        </span>
+      </div>
+      <div class="search-background">
+        <span class="search-group">
+          <span style="width: 120px">骞翠唤锛�</span>
+          <el-input v-model="searchForm.distributionYear" clearable size="small"></el-input>
+        </span>
+        <span class="search-group">
+          <el-button size="medium"  @click="resetSearchForm">閲� 缃�</el-button>
+          <el-button size="medium" type="primary" @click="searchList">鏌� 璇�</el-button>
+        </span>
+      </div>
+      <div class="table">
+        <div>
+          <TableCard :showForm="false" :showTitle="false">
+            <template v-slot:table>
+              <ZTTable
+                :column="tableColumn"
+                :height="'calc(100vh - 23em)'"
+                :table-data="tableData"
+                :table-loading="tableLoading"
+                style="padding: 0 15px;margin-bottom: 16px">
+              </ZTTable>
+            </template>
+          </TableCard>
+          <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
+                         :total="total" layout="->,total, sizes, prev, pager, next, jumper"
+                         @size-change="handleSizeChange"
+                         @current-change="handleCurrentChange">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+    <form-dia v-if="formDia" ref="formDia" @closeDia="closeDia"></form-dia>
+  </div>
+</template>
+
+<script>
+import ZTTable from '../caorui/ZTTable/index.vue';
+import TableCard from '../caorui/TableCard/index.vue';
+import FormDia from '../do/a7-distribution-of-nonconforming/formDia.vue';
+
+export default {
+  name: 'a7-distribution-of-nonconforming',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: { FormDia, TableCard, ZTTable },
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      searchForm: {
+        distributionYear: '',
+      },
+      tableColumn: [
+        {
+          label: '骞翠唤',
+          prop: 'distributionYear',
+          minWidth: '100'
+        },
+        {
+          label: '鍒涘缓浜�',
+          prop: 'createUserName',
+          minWidth: '100'
+        },
+        {
+          label: '鍒涘缓鏃堕棿',
+          prop: 'createTime',
+          minWidth: '100'
+        },
+        {
+          label: '淇敼浜�',
+          prop: 'updateUserName',
+          minWidth: '100'
+        },
+        {
+          label: '淇敼鏃堕棿',
+          prop: 'updateTime',
+          minWidth: '100'
+        },
+        {
+          dataType: 'action',
+          minWidth: '220',
+          label: '鎿嶄綔',
+          operation: [
+            {
+              name: '瀵煎嚭',
+              type: 'text',
+              clickFun: (row) => {
+                this.handleDown(row)
+              }
+            },
+            {
+              name: '缂栬緫',
+              type: 'text',
+              clickFun: (row) => {
+                this.openFormDia('edit', row);
+              },
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              color: '#f56c6c',
+              clickFun: (row) => {
+                this.delPlan(row)
+              },
+            }
+          ]
+        }
+      ],
+      tableData: [],
+      tableLoading: false,
+      page: {
+        size: 20,
+        current: 1,
+      },
+      total: 0,
+      formDia: false,
+    };
+  },
+  mounted() {
+    this.searchList()
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    // 鏌ヨ鍒楄〃
+    searchList () {
+      const entity = this.searchForm
+      const page = this.page
+      this.tableLoading = true
+      this.$axios.post(this.$api.inconsistentDistribution.pageInconsistentDistribution, {entity, page}, {
+        headers: {
+          "Content-Type": "application/json"
+        },
+        noQs: true
+      }).then(res => {
+        this.tableLoading = false
+        if (res.code === 201) return
+        this.tableData = res.data.records
+        this.total = res.data.total
+      }).catch(err => {
+        console.log('err---', err);
+        this.tableLoading = false
+      })
+    },
+    // 鍒犻櫎
+    delPlan (row) {
+      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        this.tableLoading = true
+        this.$axios.get(this.$api.inconsistentDistribution.delInconsistentDistribution + '?distributionId=' + row.distributionId).then(res => {
+          this.tableLoading = false
+          if (res.code === 201) return
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.searchList()
+        }).catch(err => {
+          this.tableLoading = false
+          console.log('err---', err);
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
+    },
+    // 鏂板锛岀紪杈戯紝鎵瑰噯寮规
+    openFormDia (type, row) {
+      this.formDia = true
+      this.$nextTick(() => {
+        this.$refs.formDia.openDia(type, row)
+      })
+    },
+    // 瀵煎嚭
+    handleDown (row) {
+      this.$axios.get(this.$api.inconsistentDistribution.exportInconsistentDistribution + '?distributionId=' + row.distributionId,{responseType: "blob"}).then(res => {
+        this.outLoading = false
+        this.$message.success('瀵煎嚭鎴愬姛')
+        const blob = new Blob([res],{ type: 'application/msword' });
+        const url = URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = '涓嶇鍚堥」鐨勫垎甯�' + '.docx';
+        link.click();
+      })
+    },
+    closeDia () {
+      this.formDia = false
+      this.searchList()
+    },
+    // 閲嶇疆鏌ヨ鏉′欢
+    resetSearchForm () {
+      this.searchForm.distributionYear = '';
+      this.searchList()
+    },
+    // 鍒嗛〉
+    handleSizeChange(val) {
+      this.page.size = val;
+      this.searchList();
+    },
+    handleCurrentChange(val) {
+      this.page.current = val;
+      this.searchList();
+    },
+  }
+};
+</script>
+
+<style scoped>
+.view-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  height: 60px;
+  padding-left: 20px;
+}
+
+.search-background {
+  width: 100%;
+  height: 80px;
+  line-height: 80px;
+  background-color: #ffffff;
+  display: flex;
+}
+
+.search-group {
+  display: flex;
+  align-items: center;
+  margin: 0 20px;
+}
+
+.table {
+  margin-top: 20px;
+  background-color: #ffffff;
+  padding-top: 20px;
+}
+</style>

--
Gitblit v1.9.3