From c9400e3754eeccfa0cce5cb3584f5adede360263 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 20 十二月 2024 13:54:08 +0800
Subject: [PATCH] 完成量值溯源计划迁移

---
 src/components/view/a6-quantity-value-traceability-plan.vue       |  323 +++++++++++++++++++++++++++++++++++
 src/components/do/a6-quantity-value-traceability-plan/formDia.vue |  162 ++++++++++++++++++
 static/js/menu.js                                                 |   26 +-
 src/assets/api/controller.js                                      |   10 +
 4 files changed, 508 insertions(+), 13 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index d0eb890..e35b34f 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -67,6 +67,7 @@
     facilitiesAndEnvironment,
     internalWastes,
     foreignRegister,
+    feCalibrationSchedule,
   }
 }
 
@@ -890,3 +891,12 @@
   delForeignRegister: '/foreignRegister/delForeignRegister', // 澶栨潵浜哄憳鍒犻櫎
   exportForeignRegister: '/foreignRegister/exportForeignRegister', // 瀵煎嚭澶栨潵浜哄憳
 }
+
+// 6.5閲忓�兼函婧愯鍒�
+const feCalibrationSchedule = {
+  getPageCalibrationSchedule:'/feCalibrationSchedule/getPageCalibrationSchedule',// 閲忓�兼函婧愯鍒掓煡璇�
+  addCalibrationSchedule:'/feCalibrationSchedule/addCalibrationSchedule',//閲忓�兼函婧愯鍒掓柊澧炵紪杈�
+  removeCalibrationSchedule:'/feCalibrationSchedule/removeCalibrationSchedule',//鍒犻櫎閲忓�兼函婧愯鍒�
+  exportOfValueTraceabilityPlan: '/feCalibrationSchedule/exportOfValueTraceabilityPlan', // 閲忓�兼函婧愯鍒� 瀵煎嚭
+  importOfValueTraceabilityPlan: '/feCalibrationSchedule/importOfValueTraceabilityPlan', // 閲忓�兼函婧愯鍒� 瀵煎叆
+}
diff --git a/src/components/do/a6-quantity-value-traceability-plan/formDia.vue b/src/components/do/a6-quantity-value-traceability-plan/formDia.vue
new file mode 100644
index 0000000..44888f1
--- /dev/null
+++ b/src/components/do/a6-quantity-value-traceability-plan/formDia.vue
@@ -0,0 +1,162 @@
+<template>
+  <div>
+    <el-dialog v-loading="diaLoading" :close-on-click-modal="false"
+               :close-on-press-escape="false"
+               :visible.sync="formDia"
+               title="閲忓�兼函婧愯鍒�"
+               width="80%" @close="closeFormDia">
+      <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="浠櫒鍚嶇О" prop="instrumentName">
+              <el-input v-model="form.instrumentName" clearable size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="瑙勬牸鍨嬪彿" prop="model">
+              <el-input v-model="form.model" clearable size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="绠$悊缂栧彿" prop="managementNumber">
+              <el-input v-model="form.managementNumber" clearable size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鎶�鏈寚鏍�" prop="technicalIndicators">
+              <el-input v-model="form.technicalIndicators" clearable size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="妫�瀹氬懆鏈�" prop="verificationCyde">
+              <el-input v-model="form.verificationCyde" clearable size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="妫�瀹氬崟浣�" prop="verificationUnit">
+              <el-input v-model="form.verificationUnit" clearable size="small"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鏈�杩戞瀹氭棩鏈�" prop="recentlyTime">
+              <el-date-picker
+                v-model="form.recentlyTime"
+                clearable
+                format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨鏃ユ湡"
+                size="small" style="width: 100%"
+                type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="璁″垝涓嬫妫�瀹氭棩鏈�" prop="nextTime">
+              <el-date-picker
+                v-model="form.nextTime"
+                clearable
+                format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨鏃ユ湡"
+                size="small" style="width: 100%"
+                type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="澶囨敞" prop="remark">
+              <el-input v-model="form.remark" clearable size="small"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeFormDia">鍙� 娑�</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,
+      form: {
+        instrumentName: '',
+        model: '',
+        managementNumber: '',
+        technicalIndicators: '',
+        verificationCyde: '',
+        verificationUnit: '',
+        recentlyTime: '',
+        nextTime: '',
+        remark: '',
+        id: '',
+      },
+      rules: {
+        instrumentName: [{required: true, message: '璇峰~鍐欎华鍣ㄥ悕绉�',trigger: 'blur'}],
+        model: [{required: true, message: '璇峰~鍐欒鏍煎瀷鍙�',trigger: 'blur'}],
+        managementNumber: [{required: true, message: '璇峰~鍐欑鐞嗙紪鍙�',trigger: 'blur'}],
+        technicalIndicators: [{required: true, message: '璇峰~鍐欐妧鏈寚鏍�',trigger: 'blur'}],
+        verificationCyde: [{required: true, message: '璇峰~鍐欐瀹氬懆鏈�',trigger: 'blur'}],
+        verificationUnit: [{required: true, message: '璇峰~鍐欐瀹氬崟浣�',trigger: 'blur'}],
+        recentlyTime: [{required: true, message: '璇烽�夋嫨鏈�杩戞瀹氭棩鏈�',trigger: 'change'}],
+        nextTime: [{required: true, message: '璇烽�夋嫨璁″垝涓嬫妫�瀹氭棩鏈�',trigger: 'change'}],
+      },
+      operationType: '',
+    }
+  },
+  mounted() {
+
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+// 鎵撳紑寮规
+    openDia (type, row) {
+      this.formDia = true
+      this.operationType = type
+      if (type !== 'add') {
+        this.form = row
+      }
+    },
+    // 鎻愪氦寮规鏁版嵁
+    handleEdit () {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          this.loading = true
+          const internalReport = this.HaveJson(this.form)
+          this.$axios.post(this.$api.feCalibrationSchedule.addCalibrationSchedule, internalReport, {
+            headers: {
+              "Content-Type": "application/json"
+            },
+            noQs: true
+          }).then(res => {
+            this.loading = false
+            if (res.code === 201) return
+            this.$message.success('鎿嶄綔鎴愬姛')
+            this.closeFormDia()
+          }).catch(err => {
+            console.log('err---', err);
+            this.loading = false
+          })
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    closeFormDia () {
+      this.$refs.form.resetFields();
+      this.formDia = false
+      this.$emit('closeFormDia')
+    },
+  },
+}
+</script>
+
+<style scoped>
+</style>
diff --git a/src/components/view/a6-quantity-value-traceability-plan.vue b/src/components/view/a6-quantity-value-traceability-plan.vue
new file mode 100644
index 0000000..d1cc5ac
--- /dev/null
+++ b/src/components/view/a6-quantity-value-traceability-plan.vue
@@ -0,0 +1,323 @@
+<template>
+  <div>
+    <div>
+      <div class="view-title">
+        <span>閲忓�兼函婧愯鍒�</span>
+        <span>
+          <el-button size="medium" @click="exportFun">瀵� 鍑�</el-button>
+          <el-button size="medium" @click="uploadDia = true">瀵� 鍏�</el-button>
+          <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.instrumentName" clearable size="small"></el-input>
+        </span>
+        <span class="search-group">
+          <span style="width: 120px">绠$悊缂栧彿锛�</span>
+          <el-input v-model="searchForm.managementNumber" 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" @closeFormDia="closeFormDia"></form-dia>
+    <el-dialog :visible.sync="uploadDia" title="鏁版嵁瀵煎叆" width="500px">
+      <div style="margin: 0 auto;">
+        <el-upload ref="upload" :action="javaApi + $api.feCalibrationSchedule.importOfValueTraceabilityPlan" :auto-upload="false" :before-upload="beforeUpload" :file-list="fileList" :headers="token"
+                   :limit="1" :on-error="onError" :on-success="onSuccess" accept=".xlsx" drag
+                   name="file">
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+        </el-upload>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="uploadDia = false">鍙� 娑�</el-button>
+        <el-button :loading="uploading" type="primary" @click="submitUpload()">涓� 浼�</el-button>
+      </span>
+    </el-dialog >
+  </div>
+</template>
+
+<script>
+import TableCard from '../caorui/TableCard/index.vue';
+import ZTTable from '../caorui/ZTTable/index.vue';
+import FormDia from '../do/a6-quantity-value-traceability-plan/formDia.vue';
+
+export default {
+  name: 'a6-quantity-value-traceability-plan',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: { FormDia, ZTTable, TableCard },
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      outLoading: false,
+      searchForm: {
+        instrumentName: '',
+        managementNumber: '',
+      },
+      tableColumn: [
+        {
+          label: '浠櫒鍚嶇О',
+          prop: 'instrumentName',
+          minWidth: '120'
+        },
+        {
+          label: '瑙勬牸鍨嬪彿',
+          prop: 'model',
+          minWidth: '100'
+        },
+        {
+          label: '绠$悊缂栧彿',
+          prop: 'managementNumber',
+          minWidth: '100'
+        },
+        {
+          label: '鎶�鏈寚鏍�',
+          prop: 'technicalIndicators',
+          minWidth: '100'
+        },
+        {
+          label: '妫�瀹氬懆鏈�',
+          prop: 'verificationCyde',
+          minWidth: '100'
+        },
+        {
+          label: '妫�瀹氬崟浣�',
+          prop: 'verificationUnit',
+          minWidth: '100'
+        },
+        {
+          label: '鏈�杩戞瀹氭棩鏈�',
+          prop: 'recentlyTime',
+          minWidth: '100'
+        },
+        {
+          label: '璁″垝涓嬫妫�瀹氭棩鏈�',
+          prop: 'nextTime',
+          minWidth: '100'
+        },
+        {
+          label: '澶囨敞',
+          prop: 'remark',
+          minWidth: '100'
+        },
+        {
+          dataType: 'action',
+          fixed: 'right',
+          minWidth: '180',
+          label: '鎿嶄綔',
+          operation: [
+            {
+              name: '缂栬緫',
+              type: 'text',
+              clickFun: (row) => {
+                this.openFormDia('edit', row);
+              },
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              color: '#f56c6c',
+              clickFun: (row) => {
+                this.delPlan(row)
+              },
+            }
+          ]
+        }
+      ],
+      tableData: [],
+      tableLoading: false,
+      uploadDia: false,
+      uploading: false,
+      page: {
+        size: 20,
+        current: 1,
+      },
+      total: 0,
+      formDia: false,
+      fileList: [],
+      token: ""
+    };
+  },
+  mounted() {
+    this.token = {
+      'token': sessionStorage.getItem('token')
+    }
+    this.searchList()
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    beforeUpload(file, fileList) {
+      if (file.type != 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
+        this.$message.error('涓婁紶鏂囦欢鏍煎紡涓嶆纭�');
+        this.$refs.upload.clearFiles()
+        return false;
+      }
+    },
+    submitUpload() {
+      if (this.$refs.upload.uploadFiles.length == 0) {
+        this.$message.error('鏈�夋嫨鏂囦欢')
+        return
+      }
+      this.uploading = true
+      this.$refs.upload.submit();
+      this.uploading = false
+    },
+    onError(err, file, fileList) {
+      this.$message.error('涓婁紶澶辫触')
+      this.$refs.upload.clearFiles()
+      this.uploading = false
+    },
+    onSuccess(response, file, fileList) {
+      this.$refs.upload.clearFiles()
+      this.uploadDia = false
+      this.uploading = false
+      if (response.code == 201) {
+        this.$message.error(response.message)
+        return
+      }
+      this.$message.success('涓婁紶鎴愬姛')
+      this.standardList = []
+      this.productList = []
+      this.searchList()
+    },
+    // 瀵煎嚭
+    exportFun() {
+      this.outLoading = true
+      this.$axios.post(this.$api.feCalibrationSchedule.exportOfValueTraceabilityPlan, {
+        instrumentName: this.searchForm.instrumentName
+      }, {responseType: "blob"}).then(res => {
+        this.outLoading = false
+        this.$message.success('瀵煎嚭鎴愬姛')
+        const blob = new Blob([res], {type: 'application/octet-stream'});
+        const url = URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = '閲忓�兼函婧愯鍒�.xlsx';
+        link.click();
+      }).finally(() => {
+        this.outLoading = false
+      })
+    },
+    // 鏌ヨ鍒楄〃
+    searchList () {
+      this.tableLoading = true
+      this.$axios.get(this.$api.feCalibrationSchedule.getPageCalibrationSchedule + '?instrumentName=' + this.searchForm.instrumentName
+        + '&managementNumber=' + this.searchForm.managementNumber
+        + '&pages=' + this.page.current + '&size=' + this.page.size).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.feCalibrationSchedule.removeCalibrationSchedule + '?id=' + row.id).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: '宸插彇娑堝垹闄�'
+        });
+      });
+    },
+    // 閲嶇疆鏌ヨ鏉′欢
+    resetSearchForm () {
+      this.searchForm.instrumentName = '';
+      this.searchForm.managementNumber = '';
+      this.searchList()
+    },
+    // 鏂板锛岀紪杈戯紝鎵瑰噯寮规
+    openFormDia (type, row) {
+      this.formDia = true
+      this.$nextTick(() => {
+        this.$refs.formDia.openDia(type, row)
+      })
+    },
+    closeFormDia () {
+      this.formDia = false
+      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>
diff --git a/static/js/menu.js b/static/js/menu.js
index 3885883..74c51f3 100644
--- a/static/js/menu.js
+++ b/static/js/menu.js
@@ -370,19 +370,19 @@
 			g: "6.6 澶栭儴鎻愪緵鐨勪骇鍝佸拰鏈嶅姟",
 			p: ""
 		},
-    {
-			v: "璁惧鎬昏",
-			i: "font icon-erjidaohang",
-			u: "a6-device-overview",
-			g: "6.4 璁惧",
-			p: "selectDeviceParameter"
-		}, {
-			v: "璁惧宸ュ叿鏄庣粏",
-			i: "font icon-erjidaohang",
-			u: "a6-device-management",
-			g: "6.4 璁惧",
-			p: "selectDeviceParameter"
-		},
+    // {
+		// 	v: "璁惧鎬昏",
+		// 	i: "font icon-erjidaohang",
+		// 	u: "a6-device-overview",
+		// 	g: "6.4 璁惧",
+		// 	p: "selectDeviceParameter"
+		// }, {
+		// 	v: "璁惧宸ュ叿鏄庣粏",
+		// 	i: "font icon-erjidaohang",
+		// 	u: "a6-device-management",
+		// 	g: "6.4 璁惧",
+		// 	p: "selectDeviceParameter"
+		// },
     {
 			v: "鏍囧噯鐗╄川娓呭崟",
 			i: "font icon-erjidaohang",

--
Gitblit v1.9.3