From eba694c15d4e666ab472cc8ab7c5a8072f32241f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 25 十月 2023 16:10:00 +0800
Subject: [PATCH] 1.模具上下机记录  借还记录 100%

---
 src/views/mouldManager/mouldUpDownRecord.vue |  495 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 492 insertions(+), 3 deletions(-)

diff --git a/src/views/mouldManager/mouldUpDownRecord.vue b/src/views/mouldManager/mouldUpDownRecord.vue
index 4353192..479a653 100644
--- a/src/views/mouldManager/mouldUpDownRecord.vue
+++ b/src/views/mouldManager/mouldUpDownRecord.vue
@@ -1,11 +1,500 @@
-<template />
+<template>
+  <div>
+    <div class="body" :style="{height:mainHeight+'px'}">
+      <div class="bodyTopButtonGroup">
+        <el-button v-waves type="primary" icon="el-icon-download" @click="download">瀵煎嚭</el-button>
+      </div>
+
+      <div class="bodyTopFormGroup">
+        <el-form
+          ref="form"
+          :model="form"
+          label-width="100px"
+          inline
+          style="display: flex;"
+        >
+          <div class="elForm">
+            <el-form-item label="妯″叿缂栫爜" style=" display: flex;">
+              <el-input v-model="form.mouldcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="妯″叿鍚嶇О" style=" display: flex;">
+              <el-input v-model="form.mouldname" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="瑙勬牸鍨嬪彿" style=" display: flex;">
+              <el-input v-model="form.mouldspec" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+
+            <el-form-item label="鎿嶄綔绫诲瀷" style=" display: flex;">
+              <el-select v-model="form.type" style="width: 200px" placeholder="璇烽�夋嫨">
+                <el-option
+                  v-for="item in typeArr"
+                  :key="item.code"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
+            </el-form-item>
+
+            <el-form-item v-show="isExpandForm" label="璁惧缂栫爜" style=" display: flex;">
+              <el-input v-model="form.devicecode" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鎿嶄綔浜哄憳" style=" display: flex;">
+              <el-input v-model="form.operuser" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+            <el-form-item
+              v-show="isExpandForm"
+              style="display: flex;align-items: center"
+              label="鎿嶄綔鏃堕棿"
+            >
+              <el-date-picker
+                v-model="form.operdate"
+                type="daterange"
+                range-separator="~"
+                class="timeMini"
+                size="mini"
+                style="width: 200px;display: flex;line-height: 34px;height: 34px;"
+                :clearable="false"
+                start-placeholder="寮�濮嬫棩鏈�"
+                end-placeholder="缁撴潫鏃ユ湡"
+              />
+              <!--              font-size: 14px!important;-->
+              <!--              :picker-options="expireTimeOption"-->
+
+            </el-form-item>
+
+          </div>
+          <div
+            class="bodySearchReset"
+            :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+          >
+            <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+          </div>
+        </el-form>
+        <div
+          class="bodyTopFormExpand"
+        >
+          <svg-icon
+            v-show="mouseHoverType==='mouseout'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+            @mouseenter="mouseHoverType=$event.type"
+          />
+          <svg-icon
+            v-show="mouseHoverType==='mouseenter'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+            @click="isExpandForm=!isExpandForm"
+            @mouseout="mouseHoverType=$event.type"
+          />
+        </div>
+      </div>
+
+      <div class="elTableDiv">
+        <el-table
+          ref="tableDataRef"
+          class="tableFixed"
+          :data="tableData"
+          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
+          border
+          :row-class-name="tableRowClassName"
+          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
+          highlight-current-row
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @sort-change="sortChange"
+        >
+          <el-table-column
+            prop="rowNum"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+
+          <el-table-column
+            prop="mould_code"
+            label="妯″叿缂栫爜"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="mould_name"
+            label="妯″叿鍚嶇О"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="mould_spec"
+            label="浜у搧瑙勬牸"
+            show-tooltip-when-overflow
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.mould_spec">{{ row.mould_spec }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="type"
+            label="鎿嶄綔绫诲瀷"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="usecount_life"
+            label="鍓╀綑瀵垮懡"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              {{ row.usecount_life?row.usecount_life:'/' }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="eqp_code"
+            label="璁惧缂栫爜"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="eqp_name"
+            label="璁惧鍚嶇О"
+            sortable="custom"
+          />
+
+          <el-table-column
+            prop="lm_user"
+            label="鎿嶄綔浜�"
+            sortable="custom"
+          />
+          <!--          <el-table-column-->
+          <!--            prop="chk_result"-->
+          <!--            label="鐐规缁撴灉"-->
+          <!--            sortable="custom"-->
+          <!--          >-->
+          <!--            <template slot-scope="{row}">-->
+          <!--              <el-tag v-if="row.chk_result==='OK'" size="small" type="success">鍚堟牸</el-tag>-->
+          <!--              <el-tag v-if="row.chk_result==='NG'" size="small" type="danger">寮傚父</el-tag>-->
+          <!--            </template>-->
+          <!--          </el-table-column>-->
+
+          <el-table-column
+            prop="lm_date"
+            label="鎿嶄綔鏃堕棿"
+            sortable="custom"
+          />
+
+          <!--          <el-table-column-->
+          <!--            label="鎿嶄綔"-->
+          <!--            width="120"-->
+          <!--            fixed="right"-->
+          <!--          >-->
+          <!--            <template slot-scope="{row}">-->
+          <!--              <div class="operationClass">-->
+
+          <!--                <el-tooltip class="item" effect="dark" content="鏄庣粏" placement="top">-->
+          <!--                  <i-->
+          <!--                    class="el-icon-tickets"-->
+          <!--                    :style="{color:$store.state.settings.theme}"-->
+          <!--                    style="cursor: pointer;margin-right: 15px"-->
+          <!--                    @click="edit(row)"-->
+          <!--                  />-->
+          <!--                </el-tooltip>-->
+          <!--              </div>-->
+          <!--            </template>-->
+          <!--          </el-table-column>-->
+        </el-table>
+      </div>
+      <!--鍒嗛〉-->
+      <pagination
+        :total="total"
+        :page.sync="form.page"
+        :limit.sync="form.rows"
+        align="right"
+        layout="total,prev, pager, next,sizes"
+        popper-class="select_bottom"
+        @pagination="getMouldUpDownMachinesSearch"
+      />
+    </div>
+
+    <el-dialog
+      v-el-drag-dialog
+      title="鏄庣粏"
+      :visible.sync="dialogVisible"
+      width="800px"
+      :close-on-click-modal="false"
+      top="15vh"
+      @closed="handleClose"
+      @close="handleClose"
+    >
+      <div class="elTableDiv" style="margin-top: 0">
+        <el-table
+          :data="tableDataDialog"
+          :height="500+'px'"
+          border
+          :row-class-name="tableRowClassName"
+          :style="{width: 100+'%',height:500+'px'}"
+          highlight-current-row
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @sort-change="sortChange"
+        >
+          <el-table-column
+            prop="seq"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+          <el-table-column
+            prop="itemcode"
+            label="閮ㄤ綅缂栫爜"
+          />
+          <el-table-column
+            prop="itemname"
+            label="閮ㄤ綅鍚嶇О"
+          />
+          <el-table-column
+            prop="result"
+            label="鐐规缁撴灉"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.result==='OK'" style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                姝e父
+              </div>
+              <div v-if="row.result==='NG'" style="display: flex;align-items: center">
+                <i class="el-icon-info" style="margin-right: 2px" />
+                寮傚父
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="chk_value"
+            label="鏁板��"
+          >
+            <template slot-scope="{row}">
+              {{ row.chk_value ? row.chk_value : '/' }}
+            </template>
+          </el-table-column>
+          <!--          <el-table-column-->
+          <!--            prop="remark"-->
+          <!--            label="澶囨敞"-->
+          <!--            show-tooltip-when-overflow-->
+          <!--          />-->
+        </el-table>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
+          <!--          <el-button v-waves type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>-->
+        </div>
+      </span>
+    </el-dialog>
+
+  </div>
+</template>
 
 <script>
+import Pagination from '@/components/Pagination'
+import { handleDatetime } from '@/utils/global'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
+import {
+  MouldCheckSubTakeSearch,
+  MouldCheckTakeOutExcel,
+  MouldUpDownMachinesOutExcel,
+  MouldUpDownMachinesSearch
+} from '@/api/MouldManager'
+
 export default {
-  name: 'MouldUpDownRecord'
+  name: 'Zzjg',
+  components: {
+    Pagination
+  },
+  directives: { elDragDialog, waves },
+  data() {
+    return {
+      mouseHoverType: 'mouseout',
+      isExpandForm: false,
+      mainHeight: 0,
+      tableHeight: 0,
+      form: {
+        mouldcode: '',
+        mouldname: '',
+        mouldspec: '',
+        devicecode: '',
+        stanedname: '',
+        operuser: '',
+        type: '',
+        operdate: '',
+        prop: 'lm_date', // 鎺掑簭瀛楁
+        order: 'desc', // 鎺掑簭瀛楁
+        page: 1, // 绗嚑椤�
+        rows: 20 // 姣忛〉澶氬皯鏉�
+      },
+      typeArr: [
+        { code: 'UP', name: '涓婃満' },
+        { code: 'DOWN', name: '涓嬫満' }
+      ],
+      total: 10,
+      tableData: [],
+      dialogVisible: false,
+      tableDataDialog: []
+
+    }
+  },
+
+  created() {
+    this.getMouldUpDownMachinesSearch()
+  },
+  mounted() {
+    window.addEventListener('resize', this.getHeight)
+    this.getHeight()
+  },
+  methods: {
+    async getMouldUpDownMachinesSearch() {
+      let tempDate = this.form.operdate
+      if (tempDate.length > 0) {
+        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
+      }
+
+      const data = {
+        mouldcode: this.form.mouldcode,
+        mouldname: this.form.mouldname,
+        mouldspec: this.form.mouldspec,
+        devicecode: this.form.devicecode,
+        operuser: this.form.operuser,
+        type: this.form.type,
+        operdate: tempDate,
+        prop: this.form.prop,
+        order: this.form.order,
+        page: this.form.page,
+        rows: this.form.rows
+
+      }
+      console.log(data, 1)
+      const res = await MouldUpDownMachinesSearch(data)
+      this.tableData = res.data
+      this.total = res.count
+    },
+    // 鎺掑簭鏀瑰彉鏃�
+    sortChange({ column, prop, order }) {
+      if (order === 'descending') {
+        order = 'desc'
+      } else if (order === 'ascending') {
+        order = 'asc'
+      } else {
+        order = 'desc'
+      }
+      this.form.order = order
+      this.form.prop = prop
+      this.getMouldUpDownMachinesSearch()
+    },
+    async download() {
+      let tempDate = this.form.operdate
+      if (tempDate.length > 0) {
+        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
+      }
+
+      const data = {
+        mouldcode: this.form.mouldcode,
+        mouldname: this.form.mouldname,
+        mouldspec: this.form.mouldspec,
+        devicecode: this.form.devicecode,
+        stanedname: this.form.stanedname,
+        operuser: this.form.operuser,
+        type: this.form.type,
+        operdate: tempDate
+      }
+
+      const { data: res } = await MouldUpDownMachinesOutExcel(data)
+      window.location.href = res
+    },
+    // 鏌ヨ
+    search() {
+      this.getMouldUpDownMachinesSearch()
+    },
+
+    // 閲嶇疆
+    reset() {
+      this.form.mouldcode = ''
+      this.form.mouldname = ''
+      this.form.mouldspec = ''
+      this.form.devicecode = ''
+      this.form.operuser = ''
+      this.form.type = ''
+      this.form.operdate = ''
+      this.getMouldUpDownMachinesSearch()
+    },
+
+    // 淇敼鎸夐挳
+    async edit(row) {
+      this.dialogVisible = true
+
+      const { data: res } = await MouldCheckSubTakeSearch({ id: row.id })
+      this.tableDataDialog = res
+
+      // this.$nextTick(() => {
+      //   this.dialogForm.OrgCode = row.org_code
+      //   this.dialogForm.OrgName = row.org_name
+      //   this.dialogForm.SupUnit = row.parent_id
+      // })
+    },
+
+    // 瀵硅瘽妗嗗叧闂簨浠�
+    handleClose() {
+      this.tableDataDialog = []
+    },
+    // 瀵硅瘽妗嗗彇娑�
+    dialogVisibleCancel() {
+      this.dialogVisible = false
+    },
+
+    // 鑾峰彇椤甸潰楂樺害
+    getHeight() {
+      this.$nextTick(() => {
+        this.mainHeight = window.innerHeight - 85
+        this.tableHeight = this.mainHeight - 255
+        this.$refs.tableDataRef.doLayout()
+      })
+    },
+    tableRowClassName({ row, rowIndex }) {
+      return 'custom-row'
+    }
+  }
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+::v-deep .el-select__caret {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
 
+::v-deep .el-range__icon {
+  line-height: 28px !important;
+}
+
+::v-deep .el-range-separator {
+  line-height: 28px !important;
+}
+
+::v-deep .el-range-input {
+  font-size: 14px;
+}
+
+::v-deep .el-range-separator {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+::v-deep .el-progress-bar__innerText {
+  display: none !important;
+}
+</style>
+<style>
+
+.el-table .custom-row {
+  background: #f8f8fa;
+}
 </style>

--
Gitblit v1.9.3