From 8645871424fd92bfd435760bb085f004d691fd64 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期二, 05 九月 2023 17:37:06 +0800
Subject: [PATCH] 检验单

---
 src/views/eam/modules/dailyMaintenanceOrder/EquipmentPrecisionCheckOrderModal.vue |  603 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 603 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/modules/dailyMaintenanceOrder/EquipmentPrecisionCheckOrderModal.vue b/src/views/eam/modules/dailyMaintenanceOrder/EquipmentPrecisionCheckOrderModal.vue
new file mode 100644
index 0000000..c65770d
--- /dev/null
+++ b/src/views/eam/modules/dailyMaintenanceOrder/EquipmentPrecisionCheckOrderModal.vue
@@ -0,0 +1,603 @@
+<template>
+  <a-modal
+    :width="1250"
+    :visible="visible"
+    :maskClosable="false"
+    @ok="handleOk"
+    cancelText="鍏抽棴"
+    @cancel="handleCancel"
+    :confirmLoading="confirmLoading"
+  >
+    <!-- :title="title" -->
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+        <a-divider
+          orientation="center"
+          style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;"
+        > 鐢熶骇璁惧绮惧害妫�楠屽崟 </a-divider>
+        <a-row :gutter="24">
+          <a-col :span="8">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="璁惧鍚嶇О"
+            >
+              <span v-if="this.model != null">{{ this.model.equipmentName }}</span>
+              <span v-else>-</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="璁惧鍨嬪彿"
+            >
+              <span v-if="this.model != null">{{ this.model.equipmentModel }}</span>
+              <span v-else>-</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="缁熶竴缂栫爜"
+            >
+              <span v-if="this.model != null">{{ this.model.equipmentNum }}</span>
+              <span v-else>-</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="8">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="浣跨敤鍗曚綅"
+            >
+              <span v-if="this.model != null">{{ this.model.useUnitName }}</span>
+              <span v-else>-</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="淇濆吇鍗曚綅"
+            >
+              <span v-if="this.model != null">{{ this.model.actualEndTime }}</span>
+              <span v-else>-</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </a-spin>
+    <a-table
+      ref="table"
+      bordered
+      size="middle"
+      rowKey='id'
+      :columns="columns"
+      :dataSource="dataSource"
+    >
+      <template
+        v-for="col in columns"
+        :slot="col.dataIndex"
+        slot-scope='text, record, index'
+      >
+        <div :key="col.dataIndex">
+
+          <a-input
+            :value="text"
+            v-if="col.dataIndex == 'actualMeasure'"
+            auto-size
+            placeholder="璇疯緭鍏ュ疄娴嬪��"
+            @change="(e)=>handleChange(e, record.key, col, index)"
+          />
+        </div>
+      </template>
+    </a-table>
+    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol"
+            label="绮惧害妫�楠岃��"
+          >
+            <span v-if="this.model != null">{{ this.model.precisionInspectionUserName}}</span>
+            <span v-else>-</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol"
+            label="缁翠慨瀹や富浠�"
+          >
+            <span v-if="this.model != null">{{ this.model.repairDirectorUserName }}</span>
+            <span v-else>-</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </div>
+    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
+      <span
+        class="ant-descriptions-title"
+        style="font-size: large;font-style: normal;font-size: 15px;"
+      >绮惧害鐘舵��</span>
+    </div>
+    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item
+            :labelCol="{ span: 8 }"
+            :wrapperCol="{ span: 4 }"
+            label="鍚勯」绮惧害杈惧埌鍏佸樊瑕佹眰"
+          >
+            <a-switch
+              checked-children="鏄�"
+              un-checked-children="鍚�"
+              :checked="model.eachTolerance == '1'"
+              @change="handle2Switch(model.eachTolerance)"
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item
+            :labelCol="{ span: 8 }"
+            :wrapperCol="{ span: 4 }"
+            label="閮ㄥ垎绮惧害鏈揪鍒板厑宸姹�"
+          >
+            <a-switch
+              checked-children="鏄�"
+              un-checked-children="鍚�"
+              :checked="model.partTolerance == '1'"
+              @change="handle3Switch(model.partTolerance)"
+            />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col
+          :style="{float: 'right'}"
+          :span="12"
+        >
+          <a-form-item
+            :labelCol="{ span: 8 }"
+            :wrapperCol="{ span: 4 }"
+            label="璁惧妫�楠屽憳"
+          >
+            <span v-if="this.model != null">{{ this.model.equipmentInspectorUserName }}</span>
+            <span v-else>-</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </div>
+    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
+      <span
+        class="ant-descriptions-title"
+        style="font-size: large;font-style: normal;font-size: 15px;"
+      >闆朵欢鐘舵��</span>
+    </div>
+    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item
+            :labelCol="{ span: 8 }"
+            :wrapperCol="{ span: 4 }"
+            label="妫�娴嬭皟璇曞悗璇曞姞宸ラ浂浠跺彿锛�"
+          >
+            <a-switch
+              checked-children="鍚堟牸"
+              un-checked-children="涓嶅悎鏍�"
+              :checked="model.processPass == '1'"
+              @change="handle4Switch(model.processPass)"
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item
+            :labelCol="{ span: 8 }"
+            :wrapperCol="{ span: 4 }"
+            label="鑳藉惁婊¤冻鍔犲伐宸ヨ壓瑕佹眰"
+          >
+            <a-switch
+              checked-children="鑳�"
+              un-checked-children="涓嶈兘"
+              @change="handle5Switch(model.meetProcessRequire)"
+              :checked="model.meetProcessRequire == '1'"
+            />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col
+          :style="{float: 'right'}"
+          :span="12"
+        >
+          <a-form-item
+            :labelCol="{ span: 8 }"
+            :wrapperCol="{ span: 4 }"
+            label="浣跨敤鍗曚綅鎶�鏈富绠�"
+          >
+            <span v-if="this.model != null">{{ this.model.useUnitDirectorUserName }}</span>
+            <span v-else>-</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </div>
+    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
+      <span
+        class="ant-descriptions-title"
+        style="font-size: large;font-style: normal;font-size: 15px;"
+      >缁撹</span>
+    </div>
+    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item
+            :labelCol="{ span: 4 }"
+            :wrapperCol="{ span: 20 }"
+            label="璁惧鍒ゅ畾"
+          >
+            <a-radio-group
+              v-model="model.judgmentResult"
+              @change="onChangeJudgmentResult"
+            >
+              <a-radio value="qualified"> 鍚堟牸 </a-radio>
+              <a-radio value="limitedUse"> 闄愮敤 </a-radio>
+              <a-radio value="disabled"> 绂佺敤 </a-radio>
+            </a-radio-group>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col
+          :style="{float: 'right'}"
+          :span="12"
+        >
+          <a-form-item
+            :labelCol="{ span: 8 }"
+            :wrapperCol="{ span: 4 }"
+            label="璁惧妫�楠屽憳绛惧瓧"
+          >
+            <span v-if="this.model != null">{{ this.model.equipmentInspectorSignUserName }}</span>
+            <span v-else>-</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </div>
+    <div :style="{height: '115px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}">
+      <span
+        class="ant-descriptions-title"
+        style="font-size: large;font-style: normal;font-size: 15px;"
+      >澶囨敞</span>
+    </div>
+    <div :style="{height: '115px',float: 'right',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
+      <a-textarea
+        allowClear
+        :placeholder="'璇疯緭鍏ュ娉ㄤ俊鎭�'"
+        v-model="model.remark "
+        rows="4"
+      />
+      <!-- :disabled="true" -->
+    </div>
+    <template slot="footer">
+      <a-button
+        :style="{marginRight: '8px'}"
+        @click="handleCancel()"
+      >
+        鍏抽棴
+      </a-button>
+
+      <a-button
+        @click="handleOk()"
+        type="primary"
+        :loading="confirmLoading"
+        :disabled="disableSubmit || confirmLoading"
+      >纭畾</a-button>
+    </template>
+  </a-modal>
+
+</template>
+
+<script>
+import { getAction, postAction, requestPut } from '@/api/manage'
+import pick from 'lodash.pick'
+import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
+import Tooltip from 'ant-design-vue/es/tooltip'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { getFileAccessHttpUrl } from '@/api/manage';
+
+export default {
+  name: "EquipmentPrecisionCheckOrderModal",
+  mixins: [JeecgListMixin],
+  components: {
+    JMultiSelectTag,
+    Tooltip,
+  },
+  data() {
+    return {
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          align: 'center',
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1
+          },
+          width: 50,
+        },
+        {
+          title: '妫�楠岄」鐩�',
+          align: 'center',
+          dataIndex: 'precisionParametersName',
+          width: 600,
+        },
+        {
+          title: '鍏佸樊',
+          align: 'center',
+          dataIndex: 'tolerance'
+        },
+        {
+          title: '瀹炴祴',
+          align: 'center',
+          dataIndex: 'actualMeasure',
+          width: 150,
+          scopedSlots: { customRender: 'actualMeasure' }
+        },
+
+
+      ],
+      title: "鎿嶄綔",
+      visible: false,
+      disableSubmit: false,
+      codeDisable: true,
+      dataSource: [],
+      model: {},
+      departs: [],
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 },
+      },
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+      validatorRules: {
+        num: {
+          rules: [
+            { required: true, message: '璇疯緭鍏ヤ繚鍏诲伐鍗曠紪鐮�!' },
+          ]
+        },
+      },
+      url: {
+        add: "/eam/precisionInspection/precisionInspection",
+        getEquipmentPrecision: "/eam/equipmentPrecisionParameters/getByEquipmentId",
+        getPrecisionInspection: "/eam/precisionInspection/getPrecisionInspectionList",
+        list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId",
+      },
+
+    }
+  },
+
+  methods: {
+
+    edit(record) {
+      let that = this;
+
+      this.form.resetFields();
+      // record.eachTolerance = '0'
+      // record.partTolerance = '0'
+      // record.processPass = '0'
+      // record.meetProcessRequire = '0'
+      // record.judgmentResult = ""
+      this.model = Object.assign({}, record);
+      this.getPrecisionInspection()
+      this.getEquipmentPrecision()
+      this.visible = true;
+      that.$nextTick(() => {
+        // that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark'));
+      });
+
+    },
+
+
+    close() {
+      this.$emit('close');
+      this.visible = false;
+    },
+
+    handleCancel() {
+      this.close();
+    },
+
+    handleOk() {
+
+      const that = this;
+      // 瑙﹀彂琛ㄥ崟楠岃瘉
+      that.form.validateFields((err, values) => {
+        if (!err) {
+          this.$confirm({
+            title: '鐢熶骇璁惧绮惧害妫�楠屽崟',
+            content: '鎻愮ず锛氳璋ㄦ厧鎿嶄綔锛�',
+            okText: '纭',
+            cancelText: '鍙栨秷',
+            onOk() {
+              let formData = Object.assign(that.model, values);
+              formData.precisionInspectionDetailList = that.dataSource
+              that.confirmLoading = true;
+              postAction(that.url.add, formData).then((res) => {
+                if (res.success) {
+                  that.$message.success(res.message);
+                  that.$emit('ok', new Date());
+                } else {
+                  that.$message.warning(res.message);
+                }
+              }).finally(() => {
+                that.confirmLoading = false;
+                that.close();
+              })
+            },
+          })
+        }
+      })
+    },
+
+
+    // handleOk() {
+    //   const that = this;
+    //   this.form.validateFields((err, values) => {
+    //     if (!err) {
+    //       that.confirmLoading = true;
+    //       let formData = Object.assign(this.model, values);
+    //       requestPut(this.url.add, formData, { id: this.model.id }).then((res) => {
+    //         if (res.success) {
+    //           that.$message.success(res.message);
+    //           that.$emit('ok');
+    //         } else {
+    //           that.$message.warning(res.message);
+    //         }
+    //       }).finally(() => {
+    //         that.confirmLoading = false;
+    //         that.close();
+    //       })
+    //     }
+    //   })
+    // },
+
+    handleDelete(text, record, index) {
+      this.dataSource.splice(index, 1);
+    },
+
+
+    getEquipmentPrecision() {
+      getAction(this.url.getEquipmentPrecision, { equipmentId: this.model.equipmentId }).then((res) => {
+        if (res.success) {
+          this.dataSource = res.result.records
+        }
+      })
+    },
+
+    getPrecisionInspection() {
+      getAction(this.url.getPrecisionInspection, { maintenanceOrderId: this.model.id }).then((res) => {
+        if (res.success) {
+          this.model = Object.assign({}, res.result[0]);
+          debugger
+        }
+      })
+    },
+
+    handle2Switch(eachTolerance) {
+      if ('0' == eachTolerance) {
+        this.model.eachTolerance = '1'
+      } else {
+        this.model.eachTolerance = '0'
+      }
+      this.model = Object.assign({}, this.model);
+    },
+
+    handle3Switch(partTolerance) {
+      if ('0' == partTolerance) {
+        this.model.partTolerance = '1'
+      } else {
+        this.model.partTolerance = '0'
+      }
+      this.model = Object.assign({}, this.model);
+    },
+
+    handle4Switch(processPass) {
+      if ('0' == processPass) {
+        this.model.processPass = '1'
+      } else {
+        this.model.processPass = '0'
+      }
+      this.model = Object.assign({}, this.model);
+    },
+
+    handle5Switch(meetProcessRequire) {
+      if ('0' == meetProcessRequire) {
+        this.model.meetProcessRequire = '1'
+      } else {
+        this.model.meetProcessRequire = '0'
+      }
+      this.model = Object.assign({}, this.model);
+    },
+
+    onChangeJudgmentResult(e) {
+      this.model.judgmentResult = e.target.value
+    },
+
+    handleChange(value, key, column, index) {
+      let that = this;
+      const temp = [...that.dataSource];
+      const target = temp.filter(item => key === item.key)[index];
+      if (target) {
+        if ('actualMeasure' == column.dataIndex) {
+          target['actualMeasure'] = value.target.value;
+        }
+        //鏄剧ず甯﹁繃鏉ョ殑鏁版嵁
+        that.dataSource = temp;
+      }
+    },
+
+  },
+}
+</script>
+
+<style lang="less" scoped>
+/deep/ .frozenRowClass {
+  color: #c9c9c9;
+}
+.fontweight {
+  font-weight: bold;
+}
+.ant-btn {
+  padding: 0 10px;
+  margin-left: 3px;
+}
+
+.ant-form-item-control {
+  line-height: 0px;
+}
+
+/** 涓昏〃鍗曡闂磋窛 */
+.ant-form .ant-form-item {
+  margin-bottom: 10px;
+}
+
+/** Tab椤甸潰琛岄棿璺� */
+.ant-tabs-content .ant-form-item {
+  margin-bottom: 0px;
+}
+.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;
+}
+
+.line {
+  width: 1px;
+  height: 300px;
+  background-color: #000;
+  border: none;
+  float: left;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3