From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期一, 18 九月 2023 13:24:30 +0800
Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430

---
 src/views/eam/modules/equipmentCalibrationOrder/EquipmentCalibrationOrderExeDrawer.vue |  543 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 543 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/modules/equipmentCalibrationOrder/EquipmentCalibrationOrderExeDrawer.vue b/src/views/eam/modules/equipmentCalibrationOrder/EquipmentCalibrationOrderExeDrawer.vue
new file mode 100644
index 0000000..c5acd18
--- /dev/null
+++ b/src/views/eam/modules/equipmentCalibrationOrder/EquipmentCalibrationOrderExeDrawer.vue
@@ -0,0 +1,543 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="drawerWidth"
+    :visible="visible"
+    @close="handleCancel"
+    :confirmLoading="confirmLoading"
+    :maskClosable="maskClosable"
+  >
+    <a-card :style="getBackground()">
+      <template>
+        <a-card>
+          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+            <a-row :style="{textAlign:'left'}">
+              <!-- <a-button
+                :style="{marginRight: '8px'}"
+                @click="handleSW"
+                :disabled=SWbuttonDistable
+                type="primary"
+              >寮�宸�</a-button> -->
+              <a-button
+                :style="{marginRight: '8px'}"
+                @click="handleReport"
+                :disabled="buttonDistable"
+                type="primary"
+              >鎻愪氦</a-button>
+              <!-- <a-button
+                :style="{marginRight: '8px'}"
+                @click="handleReset"
+                :disabled="revocationDistable"
+                type="primary"
+              >鎾ら攢</a-button> -->
+            </a-row>
+          </div>
+          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+            <a-row :gutter="24">
+              <a-col :span="4">
+                <a-form-item
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="鐘舵��"
+                  class="hightColor"
+                >
+                  <span
+                    v-if="this.model != null"
+                    class="hightColor"
+                  >{{ this.model.status_dictText }}</span>
+                  <span
+                    v-else
+                    class="frozenRowClass"
+                  >-</span>
+                </a-form-item>
+              </a-col>
+              <a-col :span="5">
+                <a-form-item
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="妫�瀹氬伐鍗曞彿"
+                  class="hightColor"
+                >
+                  <span
+                    v-if="this.model != null"
+                    class="hightColor"
+                  >{{ this.model.num }}</span>
+                  <span
+                    v-else
+                    class="frozenRowClass"
+                  >-</span>
+                </a-form-item>
+              </a-col>
+              <a-col :span="5">
+                <a-form-item
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="璁惧缂栧彿"
+                  class="hightColor"
+                >
+                  <span
+                    v-if="this.model != null"
+                    class="hightColor"
+                  >{{ this.model.equipmentNum }}</span>
+                  <span
+                    v-else
+                    class="frozenRowClass"
+                  >-</span>
+                </a-form-item>
+              </a-col>
+              <a-col :span="5">
+                <a-form-item
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="璁惧鍚嶇О"
+                  class="hightColor"
+                >
+                  <span v-if="this.model != null">{{ this.model.equipmentName }}</span>
+                  <span
+                    v-else
+                    class="frozenRowClass"
+                  >-</span>
+                </a-form-item>
+              </a-col>
+              <a-col :span="5">
+                <a-form-item
+                  :labelCol="labelCol"
+                  :wrapperCol="wrapperCol"
+                  label="璁惧鍨嬪彿"
+                  class="hightColor"
+                >
+                  <span v-if="this.model != null">{{ this.model.equipmentModel }}</span>
+                  <span
+                    v-else
+                    class="frozenRowClass"
+                  >-</span>
+                </a-form-item>
+              </a-col>
+            </a-row>
+          </div>
+
+          <a-tabs
+            type="card"
+            defaultActiveKey="1"
+          >
+            <a-tab-pane
+              tab='绮惧害鍙傛暟'
+              key="1"
+              class="hightColor"
+            >
+              <div>
+                <a-table
+                  ref="table"
+                  size="middle"
+                  bordered
+                  rowKey="id"
+                  :columns="columns"
+                  :dataSource="dataSource"
+                  :loading="loading"
+                  @change="handleTableChange"
+                  :pagination="ipagination"
+                >
+                  <!-- :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" -->
+                  <template
+                    v-for="col in columns"
+                    :slot="col.dataIndex"
+                    slot-scope='text, record, index'
+                  >
+                    <div :key="col.dataIndex">
+                      <a-input-number
+                        :value="text"
+                        v-if="col.dataIndex == 'calibrationItemResult'"
+                        :min="0"
+                        :max="20000000"
+                        @change="(e)=>handleChange(e, record.key, col, index,record)"
+                        style="width: 100%"
+                        :disabled="buttonDistable"
+                      />
+                    </div>
+                  </template>
+                </a-table>
+              </div>
+            </a-tab-pane>
+
+            <a-tab-pane
+              tab='閴村畾鎶ュ憡'
+              key="2"
+            >
+              <div
+                class="table-operator"
+                style="margin:-16px"
+              >
+                <equipment-calibration-order-report-drawer-list
+                  :buttonDistable='buttonDistable'
+                  :calibrationOrderId='calibrationOrderId'
+                />
+              </div>
+            </a-tab-pane>
+          </a-tabs>
+        </a-card>
+      </template>
+    </a-card>
+
+    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+      <a-row :style="{textAlign:'right'}">
+        <a-button
+          :style="{marginRight: '8px'}"
+          @click="handleCancel"
+        >
+          鍙栨秷
+        </a-button>
+        <a-button
+          :style="{marginRight: '8px'}"
+          @click="handleTS"
+          :disabled="buttonDistable"
+          type="primary"
+          v-if="false"
+        >鏆傚瓨</a-button>
+        <a-button
+          @click="handleOk"
+          :disabled="buttonDistable"
+          type="primary"
+        >淇濆瓨</a-button>
+      </a-row>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { requestPut, getAction, downFile } from '@/api/manage'
+import Tooltip from 'ant-design-vue/es/tooltip'
+
+import { preview } from 'vue-photo-preview'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import Vue from 'vue'
+import PdfView from '@views/common/PdfView'
+import { getFileAccessHttpUrl } from '@/api/manage';
+import EquipmentCalibrationOrderReportDrawerList from './EquipmentCalibrationOrderReportDrawerList'
+
+
+export default {
+  name: 'EquipmentCalibrationOrderExeDrawer',
+  mixins: [JeecgListMixin],
+  components: {
+    PdfView,
+    preview,
+    Tooltip,
+    EquipmentCalibrationOrderReportDrawerList,
+  },
+  data() {
+    return {
+      title: "妫�瀹氬伐鍗曟墽琛�",
+      visible: false,
+      maskClosable: true,
+      confirmLoading: false,
+      drawerWidth: "100%",
+      buttonDistable: false,
+      SWbuttonDistable: false,
+      revocationDistable: false,
+      // currentNodeSelect: '',
+      calibrationOrderId: '-1',
+      dataSource: [],
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 8 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          align: 'center',
+          width: 60,
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '绮惧害鍙傛暟缂栫爜',
+          align: 'center',
+          dataIndex: 'num',
+        },
+        {
+          title: '绮惧害鍙傛暟鍚嶇О',
+          align: 'center',
+          dataIndex: 'name',
+        },
+        {
+          title: '璁¢噺鍗曚綅',
+          align: 'center',
+          dataIndex: 'unitName',
+        },
+        {
+          title: '涓嬮檺鍊�',
+          align: 'center',
+          dataIndex: 'lowerLimit',
+        },
+        {
+          title: '涓婇檺鍊�',
+          align: 'center',
+          dataIndex: 'upperLimit',
+        },
+        {
+          title: '娴嬪畾鍊�',
+          align: 'center',
+          dataIndex: 'actualValue',
+        },
+        {
+          title: '瀹為檯娴嬪畾鍊�',
+          align: 'center',
+          dataIndex: 'calibrationItemResult',
+          scopedSlots: { customRender: 'calibrationItemResult' },
+          width: 160,
+        },
+        // {
+        //   title: '鍒ゅ畾缁撴灉',
+        //   align: 'center',
+        //   dataIndex: 'judgmentResultName',
+        // class: "notshow"
+        // },
+        {
+          title: '鍒ゅ畾缁撴灉',
+          align: 'center',
+          dataIndex: 'judgmentResult',
+        },
+      ],
+      url: {
+        list: "/eam/calibrationOrderDetail/getCalibrationOrderDetailList",
+        report: "/eam/calibrationOrder/report",
+        save: "/eam/calibrationOrderDetail/save",
+      },
+    }
+  },
+  mounted() {
+    this.$bus.$on('closeDrawer', (data) => {
+      this.visible = false;
+    })
+  },
+
+  methods: {
+
+    handleShow(record) {
+      this.model = Object.assign({}, record);
+      this.calibrationOrderId = record.id
+      this.dataSource = []
+      this.visible = true;
+      this.queryParam.calibrationOrderId = record.id
+      this.loadData1(1)
+    },
+
+    loadData1(arg) {
+      if (!this.url.list) {
+        this.$message.error("璇疯缃畊rl.list灞炴��!")
+        return
+      }
+      //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+      if (arg === 1) {
+        this.ipagination.current = 1;
+      }
+      var params = this.getQueryParams();//鏌ヨ鏉′欢
+      this.loading = true;
+      getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          this.dataSource = res.result.records || res.result;
+          if (res.result.total) {
+            this.ipagination.total = res.result.total;
+          } else {
+            this.ipagination.total = 0;
+          }
+        } else {
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+
+    loadData() {
+    },
+    getBackground() {
+      return "background-color:rgba(127, 127, 127,0.08)";
+    },
+    handleCancel() {
+      this.$emit('ok');
+      this.alterFlag = new Date();
+      this.close()
+    },
+    close() {
+      this.visible = false;
+    },
+    //鏆傚瓨
+    // handleTS() {
+
+    // },
+    //寮�宸�
+    // handleSW() {
+    //   const that = this;
+    //   that.confirmLoading = true;
+    //   this.$confirm({
+    //     title: '淇濆吇宸ュ崟寮�宸�',
+    //     content: '鎻愮ず锛氬紑宸ュ悗鏃犳硶鎾ゅ洖锛岃璋ㄦ厧鎿嶄綔锛�',
+    //     okText: '纭',
+    //     cancelText: '鍙栨秷',
+    //     onOk() {
+    //       requestPut(that.url.editStatus, { id: that.model.id, status: '4' }).then((res) => {
+    //         if (res.success) {
+    //           that.model.status = '4'
+    //           that.$message.success("宸ュ崟寮�宸ユ垚鍔燂紒")
+    //           that.buttonDistable = false
+    //           that.revocationDistable = true
+    //           that.SWbuttonDistable = true
+    //         } else {
+    //           that.$message.warning("宸ュ崟寮�宸ュけ璐ワ紒")
+    //         }
+    //       }).finally(() => {
+    //         that.confirmLoading = false;
+    //         // that.close();
+    //       })
+    //     },
+    //   })
+    // },
+    //鎶ュ伐
+    handleReport() {
+      const that = this;
+      that.confirmLoading = true;
+      this.$confirm({
+        title: '妫�瀹氬伐鍗曟彁浜ゅ畬宸�',
+        content: '鎻愮ず锛氭姤宸ュ悗宸ュ崟瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�',
+        okText: '纭',
+        cancelText: '鍙栨秷',
+        onOk() {
+          requestPut(that.url.report, { id: that.model.id, status: '4' }).then((res) => {
+            if (res.success) {
+              that.model.status = '5'
+              that.$message.success(res.message)
+              that.buttonDistable = false
+              that.revocationDistable = true
+              that.SWbuttonDistable = true
+              that.$emit('ok');
+              that.alterFlag = new Date();
+              that.close();
+            } else {
+              that.$message.warning(res.message)
+            }
+          }).finally(() => {
+            that.confirmLoading = false;
+            // 
+          })
+        },
+      })
+    },
+    //鎾ら攢
+    // handleReset() {
+    //   const that = this;
+    //   that.confirmLoading = true;
+    //   this.$confirm({
+    //     title: '瀹屽伐鎾ら攢',
+    //     content: '鎻愮ず锛氬畬宸ユ挙閿�鍚庡彲缁х画鎶ュ伐鎿嶄綔锛�',
+    //     okText: '纭',
+    //     cancelText: '鍙栨秷',
+    //     onOk() {
+    //       requestPut(that.url.revocation, { id: that.model.id, status: '4' }).then((res) => {
+    //         if (res.success) {
+    //           that.model.status = '4'
+    //           that.$message.success(res.message)
+    //           that.buttonDistable = false
+    //           that.revocationDistable = true
+    //           that.SWbuttonDistable = true
+    //         } else {
+    //           that.$message.warning(res.message)
+    //         }
+    //       }).finally(() => {
+    //         that.confirmLoading = false;
+    //         // that.close();
+    //       })
+    //     },
+    //   })
+    // },
+
+    handleChange(value, key, column, index) {
+      let that = this;
+      const temp = [...that.dataSource];
+      const target = temp.filter(item => key === item.key)[index];
+      if (target) {
+        if (column.dataIndex == 'calibrationItemResult') {
+          target[column.dataIndex] = value;
+          let maxValue = target.upperLimit
+          let minValue = target.lowerLimit
+          if (value > minValue && value < maxValue) {
+            target['judgmentResult'] = "pass";
+            // target['judgmentResultName'] = "姝d骇";
+          } else {
+            target['judgmentResult'] = "fail";
+            // target['judgmentResultName'] = "寮傚父";
+          }
+          if (value == null || value == "") {
+            target['judgmentResult'] = "";
+            // target['judgmentResultName'] = "";
+          }
+
+        }
+        //鏄剧ず甯﹁繃鏉ョ殑鏁版嵁
+        that.dataSource = temp;
+      }
+    },
+    //淇濆瓨
+    handleOk() {
+      const that = this;
+      that.confirmLoading = true;
+      let formData = Object.assign(this.model);
+      for (let i = 0; i < that.dataSource.length; i++) {
+        let o = this.dataSource[i]
+        if (o.calibrationItemResult == null || o.calibrationItemResult == '') {
+          that.$message.warning('璇疯緭鍏ユ瀹氱粨鏋滐紒')
+          that.confirmLoading = false;
+          return
+        }
+      }
+      formData.calibrationOrderDetails = that.dataSource
+      requestPut(this.url.save, formData).then((res) => {
+        if (res.success) {
+          that.$message.success("淇濆瓨鎴愬姛!");
+          that.$emit('ok');
+          that.alterFlag = new Date();
+          that.loadData1()
+        } else {
+          that.$message.warning("淇濆瓨澶辫触!");
+        }
+      }).finally(() => {
+        that.confirmLoading = false;
+        // that.close();
+      })
+    },
+
+  },
+
+}
+</script>
+
+<style scoped>
+@import '~@assets/less/common.less';
+.hightColor {
+  height: 10%;
+  font-weight: bold;
+  font-size: 20px;
+  color: #1b1e1e;
+}
+.frozenRowClass {
+  color: #c9c9c9;
+}
+.fontweight {
+  font-weight: bold;
+}
+.hight {
+  color: #f5222d;
+}
+/deep/ .red {
+  color: red;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3