schangxiang@126.com
2024-06-08 d939d095aa38879953884ea263eb45984b3876e7
优化界面
已修改5个文件
22633 ■■■■■ 文件已修改
iwara-scada-web/package-lock.json 22514 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iwara-scada-web/src/utils/util.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iwara-scada-web/src/views/main/EquipmentWorkingLog/index.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iwara-scada-web/src/views/main/WorkPieceInfo/index.vue 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iwara-scada-web/src/views/main/WorkPieceProcess/index.vue 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iwara-scada-web/package-lock.json
ÎļþÌ«´ó
iwara-scada-web/src/utils/util.js
@@ -1,3 +1,17 @@
import moment from 'moment'
//默认赋值 å½“前一周的时间
export function getThisWeekRange(){
  const today = new Date();
  const startOfWeek = new Date(today);
  startOfWeek.setDate(startOfWeek.getDate() - startOfWeek.getDay()); // å‡åŽ»ä»Šå¤©æ˜¯ä¸€å‘¨çš„ç¬¬å‡ å¤©ï¼Œå¾—åˆ°å‘¨ä¸€çš„æ—¥æœŸ
  const endOfWeek = new Date(startOfWeek);
  endOfWeek.setDate(endOfWeek.getDate() + 6); // åŠ ä¸Š6天,得到周日的日期
  //return [moment(startOfWeek,"YYYY-MM-DD HH:mm"), moment(endOfWeek,"YYYY-MM-DD HH:mm")];
  return [moment(startOfWeek), moment(endOfWeek)];
}
export function dateFormat(dateString, fmt) {
    const date = new Date(dateString)
        let ret
iwara-scada-web/src/views/main/EquipmentWorkingLog/index.vue
@@ -29,15 +29,15 @@
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="colMd" :sm="colSm">
              <a-form-item label="新增时间">
            <a-col :md="colMd2" :sm="colSm2">
              <a-form-item label="发生时间">
                <a-range-picker v-model="queryParam.logAddTimeRange" :placeholder="['开始日期', '结束日期']" />
              </a-form-item>
            </a-col>
            <a-col :md="colMd" :sm="colSm">
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button>
                <a-button style="margin-left: 8px" @click="resetQueryData">重置</a-button>
                <!-- <a @click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? '收起' : '展开' }}
                    <a-icon :type="advanced ? 'up' : 'down'" />
                  </a> -->
@@ -73,7 +73,7 @@
<script>
import { STable, XCard } from '@/components'
import { downloadFile } from '@/utils/util'
import { downloadFile,getThisWeekRange } from '@/utils/util'
import moment from 'moment'
import { EquipmentWorkingLogPage, equipmentWorkingLogToExcel } from '@/api/modular/main/EquipmentWorkingLogManage'
@@ -89,6 +89,8 @@
      gutter: 36,
      colMd: 6,
      colSm: 18,
      colMd2: 10,
      colSm2: 24,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 }
@@ -161,7 +163,7 @@
          dataIndex: 'equipmentStateTimeHand'
        },
        {
          title: '新增时间',
          title: '发生时间',
          align: 'center',
          sorter: true,
          dataIndex: 'logAddTime'
@@ -190,9 +192,19 @@
  },
  created() {
    this.getEquipmentName()
    this.initData();
  },
  methods: {
    initData(){
      this.queryParam.logAddTimeRange = [];
      this.queryParam.logAddTimeRange = getThisWeekRange();
    },
     //重置
    resetQueryData(){
      this.queryParam = { logAddTimeRange:[] }
      this.initData();
    },
    moment,
    /**
     * æŸ¥è¯¢å‚数组装
iwara-scada-web/src/views/main/WorkPieceInfo/index.vue
@@ -40,7 +40,6 @@
                </a-select>
              </a-form-item>
            </a-col>
            <template v-if="advanced">
              <a-col :md="colMd" :sm="colSm">
                <a-form-item label="工序">
                  <a-select
@@ -55,17 +54,18 @@
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :md="colMd" :sm="colSm">
              <a-col :md="colMd2" :sm="colSm2">
                <a-form-item label="初始上线时间">
                  <a-range-picker style="width:100%" :show-time="{format:'HH:mm'}" v-model="queryParam.dates" format="YYYY-MM-DD HH:mm" />
                </a-form-item>
              </a-col>
            </template>
            <!-- <template v-if="advanced">
            </template> -->
            <a-col :md="colMd" :sm="colSm">
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="getData(1)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button>
                <a-button style="margin-left: 8px" @click="resetQueryData">重置</a-button>
                <a @click="toggleAdvanced" style="margin-left: 8px">
                  {{ advanced ? '收起' : '展开' }}
                  <a-icon :type="advanced ? 'up' : 'down'" />
@@ -108,7 +108,7 @@
<script>
// åœ¨åˆ¶å“ç›‘控
import { STable, XCard } from '@/components'
import { downloadFile } from '@/utils/util'
import { downloadFile,getThisWeekRange } from '@/utils/util'
import moment from 'moment'
import { WorkPieceInfoPage, WorkPieceInfoToExcel1 } from '@/api/modular/main/WorkPieceInfoManage'
import editForm from './editForm.vue'
@@ -125,6 +125,8 @@
      gutter: 36,
      colMd: 6,
      colSm: 18,
      colMd2: 10,
      colSm2: 24,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 }
@@ -134,7 +136,9 @@
        sm: { span: 15 }
      },
      advanced: false, // é«˜çº§æœç´¢ å±•å¼€/关闭
      queryParam: {},
      queryParam: {
        dates:[]
      },
      columns: [
        {
          title: '序号',
@@ -232,11 +236,21 @@
  },
  created() {
    this.getEquipmentName()
    this.initData();
    this.getData()
    this.ProcessSelectData = this.$options.filters['dictData']('process_type')
    this.QualityStateSelectData = this.$options.filters['dictData']('quality_state')
  },
  methods: {
    initData(){
      this.queryParam.dates = [];
      this.queryParam.dates = getThisWeekRange();
    },
     //重置
    resetQueryData(){
      this.queryParam = { dates:[] }
      this.initData();
    },
    getRowBackGround(record) {
      switch (
        record.cololType // è¿™é‡Œæ ¹æ®æ¡ä»¶æ”¹å˜è¡¨æ ¼èƒŒæ™¯è‰²
iwara-scada-web/src/views/main/WorkPieceProcess/index.vue
@@ -19,8 +19,13 @@
              </a-form-item>
            </a-col>
            <a-col :md="colMd" :sm="colSm">
              <a-form-item label="工件ID">
              <a-form-item label="工件号">
                <a-input v-model="queryParam.workPieceID" allow-clear placeholder="请输入工件号" />
              </a-form-item>
            </a-col>
             <a-col :md="colMd" :sm="colSm">
              <a-form-item label="成品码">
                <a-input v-model="queryParam.oP80NewCode" allow-clear placeholder="请输入成品码" />
              </a-form-item>
            </a-col>
            <a-col :md="colMd" :sm="colSm">
@@ -35,6 +40,11 @@
                    {{ item.name }}
                  </a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="colMd2" :sm="colSm2">
                <a-form-item :label="queryParam.selectModel == 1?'初始上线时间':'上线时间'">
                  <a-range-picker  style="width:100%" :show-time="{format:'HH:mm'}" v-model="queryParam.dates" format="YYYY-MM-DD HH:mm" />
              </a-form-item>
            </a-col>
            <template v-if="advanced">
@@ -90,16 +100,12 @@
                </a-form-item>
              </a-col>
              <a-col :md="colMd" :sm="colSm">
                <a-form-item :label="queryParam.selectModel == 1?'初始上线时间':'上线时间'">
                  <a-range-picker style="width:100%" :show-time="{format:'HH:mm'}" v-model="queryParam.dates" format="YYYY-MM-DD HH:mm" />
                </a-form-item>
              </a-col>
            </template>
            <a-col :md="colMd" :sm="colSm">
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="getData(1)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => (queryParam = { selectModel: 1 })">重置</a-button>
                <a-button style="margin-left: 8px" @click="resetQueryData">重置</a-button>
                <a @click="advanced = !advanced" style="margin-left: 8px">
                  {{ advanced ? '收起' : '展开' }}
                  <a-icon :type="advanced ? 'up' : 'down'" />
@@ -145,7 +151,7 @@
<script>
// å·¥ä»¶åŠ å·¥è¿½æº¯
import { STable, XCard } from '@/components'
import { downloadFile } from '@/utils/util'
import { downloadFile,getThisWeekRange } from '@/utils/util'
import moment from 'moment'
import {
  workPieceInfoMachiningPage,
@@ -167,6 +173,8 @@
      gutter: 36,
      colMd: 6,
      colSm: 18,
      colMd2: 10,
      colSm2: 24,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 }
@@ -177,7 +185,11 @@
      },
      advanced: false, // é«˜çº§æœç´¢ å±•å¼€/关闭
      confirmLoading: false,
      queryParam: { selectModel: 1 },
      currentSelModel:1,//当前选择的维护
      queryParam: {
        selectModel: 1,
        dates:[]
      },
      pages: {
        current: 1,
        pageSize: 10,
@@ -197,7 +209,7 @@
          customRender: (text, record, index) => `${index + 1}`
        },
        {
          title: '工件ID',
          title: '工件号',
          align: 'center',
          sorter: true,
          dataIndex: 'workPieceID'
@@ -213,6 +225,12 @@
          align: 'center',
          sorter: true,
          dataIndex: 'qualityStateName'
        },
        {
          title: '成品码',
          align: 'center',
          sorter: true,
          dataIndex: 'oP80NewCode'
        },
        {
          title: '质量详情',
@@ -254,7 +272,7 @@
          }
        },
        {
          title: '已加工时长',
          title: '加工时长',
          align: 'center',
          sorter: true,
          dataIndex: 'workPieceCurr'
@@ -313,7 +331,10 @@
  watch: {
    'queryParam.selectModel': {
      handler(val, oldVal) {
        this.queryParam = { selectModel: val }
        var old_dates=this.queryParam.dates;
        this.queryParam = { selectModel: val,dates:[] }
        this.queryParam.dates = old_dates;
        this.currentSelModel=val;
        if (val == 1) {
          if (oldVal) {
            this.columns.splice(3, this.columns2.length)
@@ -337,9 +358,19 @@
      { name: '工件+工序', code: 2 }
    ]
    this.QualityState = this.$options.filters['dictData']('quality_state')
    this.initData();
    this.getData()
  },
  methods: {
    initData(){
      this.queryParam.dates = [];
      this.queryParam.dates = getThisWeekRange();
    },
    //重置
    resetQueryData(){
      this.queryParam = { selectModel: this.currentSelModel,dates:[] }
      this.initData();
    },
    setDisabled() {
      this.data.forEach((item) => {
        if (item.operationTypeHand == 'SPC') {